Skip to content

Commit a73a123

Browse files
authored
Merge pull request #109 from wrap-org/feature/wrap-1222-component-library
NPM package
2 parents 7ec9646 + d86b7be commit a73a123

25 files changed

Lines changed: 13419 additions & 16033 deletions
File renamed without changes.

.github/workflows/chromatic.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ jobs:
2222
- uses: chromaui/action@v11
2323
with:
2424
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
25+
buildScriptName: build:storybook

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ jobs:
3636
node-version: ${{ matrix.version }}
3737
cache: npm
3838
- run: npm ci
39-
- run: npm run build-storybook
39+
- run: npm run build:storybook
4040
- run: npx playwright install --with-deps
41-
- run: npm run test-storybook
41+
- run: npm run test:storybook
4242
lint:
4343
name: 🧹 Lint
4444
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
node_modules
22
storybook-static
33
dist
4-
src/index.tsx
4+
src/index.ts
55
*.log
66
.vscode/*
77

.storybook/main.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ const config: StorybookConfig = {
4040
options: {}
4141
},
4242
staticDirs: [path.resolve(__dirname, '../src/assets')],
43+
typescript: {
44+
reactDocgen: 'react-docgen-typescript',
45+
reactDocgenTypescriptOptions: {
46+
shouldExtractLiteralValuesFromEnum: true,
47+
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
48+
},
49+
},
4350
};
4451

4552
export default config;
File renamed without changes.

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,18 @@ Install the module.
2525
npm install --save @wrap.ngo/evergreen
2626
```
2727

28-
Add the global CSS in your main app file or CSS.
28+
Add the global CSS and JS in your main app file.
2929

3030
```js
31-
import '@wrap.ngo/evergreen/src/styles/main.scss';
32-
33-
// Optional font face
34-
import '@wrap.ngo/evergreen/src/styles/fonts.scss';
35-
```
36-
37-
Components can be used by importing them into the files to be used or they can be installed once globally (because web components are all registered to a [global registry](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry) on the window).
38-
39-
```js
40-
import '@wrap.ngo/evergreen/components/control/Button/Button';
31+
// Global styles
32+
import '@wrap.ngo/evergreen/styles';
33+
// Optional font import
34+
import '@wrap.ngo/evergreen/fonts';
35+
// Component registration
36+
import '@wrap.ngo/evergreen/components'
4137
```
4238

43-
Use the component anywhere in HTML or JSX.
39+
Use the components anywhere.
4440

4541
```html
4642
<evg-button variant="primary">

0 commit comments

Comments
 (0)