1.4.1 • Published 1 year ago

demandscience-ui v1.4.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

DemandScience UI

This library relies on TailwindCSS, make sure the project is configured to use TailwindCSS before include it in your project.

To add this library to your React app, run

yarn add demandscience-ui

and then, in your tailwind.config.js, add

// tailwind.config.js
...
module.exports = {
  content: [
    ...
    "./node_modules/demandscience-ui/dist/*.js",
   ],
  ...
  }

In your index.js (React) or _app.js (Next.js), add

// index.js (React) or _app.js (Next.js)

import 'demandscience-ui/dist/tailwind.css'; // LIBRARY STYLES
import 'styles/index.css'; // YOUR STYLES

Make sure that demandscience-ui/dist/tailwind.css is above your own stylesheet. Otherwise your styles will be overwritten.

Storybook

Run inside another terminal:

yarn storybook

This loads the stories from ./stories.

NOTE: Stories should reference the components as if using the library, similar to the example playground. This means importing from the root project directory. This has been aliased in the tsconfig and the storybook webpack config as a helper.

If you're using two instances of storybook at the same time (i.e., one for the ui library and one for the main project), you can pass -p 6007 parameter to run the storybook on a different port.

To do a one-off build, use npm run build or yarn build.

To run tests, use npm test or yarn test.

Deployment

The storybook for the latest version of the main branch is deployed on Chromatic.

Configuration

Code quality is set up for you with prettier, husky, and lint-staged. Adjust the respective fields in package.json accordingly.

Jest

Jest tests are set up to run with npm test or yarn test.

Bundle analysis

Calculates the real cost of your library using size-limit with npm run size and visulize it with npm run analyze.

Setup Files

/src
  /inputs
    Button.tsx
  index.tsx       
/test
  /input
    Button.test.tsx   
/stories
  /inputs
    Button.stories.tsx
/.storybook
  main.js
  preview.js
.gitignore
package.json
README.md        
tsconfig.json

Continuous Integration

GitHub Actions

Two actions are added by default:

  • main which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
  • size which comments cost comparison of your library on every pull request using size-limit
1.3.9

1 year ago

1.3.8

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.7

1 year ago

1.2.0

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.25

2 years ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.1-3.1

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.2

2 years ago

0.6.21

2 years ago

1.0.1

2 years ago

0.6.20

2 years ago

0.6.23

2 years ago

0.6.22

2 years ago

0.6.7

2 years ago

0.4.9

2 years ago

0.6.6

2 years ago

0.4.8

2 years ago

0.6.9

2 years ago

0.6.8

2 years ago

1.0.3

2 years ago

0.6.10

2 years ago

0.6.12

2 years ago

0.6.11

2 years ago

0.6.18

2 years ago

0.6.17

2 years ago

0.6.19

2 years ago

0.6.14

2 years ago

0.6.13

2 years ago

0.6.16

2 years ago

0.6.15

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.9

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.5

2 years ago

0.4.7

2 years ago

0.6.4

2 years ago

0.4.6

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.3.9

2 years ago

0.4.5

2 years ago

0.3.6

2 years ago

0.4.4

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.4.1

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.4.3

2 years ago

0.3.4

2 years ago

0.4.2

2 years ago

0.3.3

2 years ago

0.3.0

2 years ago

0.2.7

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.8

2 years ago

0.2.6

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.2.3

2 years ago

0.1.4

2 years ago

0.2.2

2 years ago

0.1.3

2 years ago

0.2.5

2 years ago

0.1.6

2 years ago

0.2.4

2 years ago

0.1.5

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago