@react5/ui 1.0.27 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +2 -2
- package/package.json +38 -38
- package/packages/app/README.md +50 -50
- package/packages/app/eslint.config.js +28 -28
- package/packages/app/index.html +13 -13
- package/packages/app/jest.config.js +12 -12
- package/packages/app/package.json +36 -36
- package/packages/app/src/App.css +5 -5
- package/packages/app/src/App.tsx +35 -35
- package/packages/app/src/i18n/config.ts +21 -21
- package/packages/app/src/i18n/en/translation.json +4 -4
- package/packages/app/src/i18n/fr/translation.json +4 -4
- package/packages/app/src/i18n/index.ts +3 -3
- package/packages/app/src/main.tsx +16 -16
- package/packages/app/src/styles/1-reset.scss +72 -72
- package/packages/app/src/styles/2-colors.scss +11 -11
- package/packages/app/src/vite-env.d.ts +1 -1
- package/packages/app/tsconfig.app.json +26 -26
- package/packages/app/tsconfig.json +7 -7
- package/packages/app/tsconfig.node.json +24 -24
- package/packages/app/vite.config.ts +7 -7
- package/packages/lib/.babelrc +9 -9
- package/packages/lib/.storybook/main.js +50 -50
- package/packages/lib/.storybook/preview.js +13 -13
- package/packages/lib/declaration.d.ts +9 -9
- package/packages/lib/dist/esm/index.esm.js +1 -1
- package/packages/lib/dist/esm/index.esm.js.map +1 -1
- package/packages/lib/dist/esm/index.esm.scss +1401 -1401
- package/packages/lib/dist/index.js +1 -1
- package/packages/lib/dist/index.js.map +1 -1
- package/packages/lib/dist/index.scss +1401 -1401
- package/packages/lib/jest.config.js +19 -19
- package/packages/lib/package.json +100 -102
- package/packages/lib/plop/component/index.js +43 -43
- package/packages/lib/plop/index.js +3 -3
- package/packages/lib/plop/templates/component/component.hbs +19 -19
- package/packages/lib/plop/templates/component/index.hbs +1 -1
- package/packages/lib/plop/templates/component/stories.hbs +17 -17
- package/packages/lib/plop/templates/component/style.hbs +1 -1
- package/packages/lib/plop/templates/component/test.hbs +11 -11
- package/packages/lib/plopfile.js +1 -1
- package/packages/lib/rollup.config.mjs +64 -64
- package/packages/lib/src/components/Accordion/Accordion.scss +67 -67
- package/packages/lib/src/components/Accordion/Accordion.tsx +36 -36
- package/packages/lib/src/components/Button/Button.scss +60 -60
- package/packages/lib/src/components/Button/Button.stories.tsx +26 -26
- package/packages/lib/src/components/Button/Button.tsx +40 -40
- package/packages/lib/src/components/Button/index.tsx +1 -1
- package/packages/lib/src/components/ButtonsGroup/ButtonsGroup.scss +3 -3
- package/packages/lib/src/components/ButtonsGroup/ButtonsGroup.stories.tsx +17 -17
- package/packages/lib/src/components/ButtonsGroup/ButtonsGroup.test.tsx +11 -11
- package/packages/lib/src/components/ButtonsGroup/ButtonsGroup.tsx +17 -17
- package/packages/lib/src/components/ButtonsGroup/index.tsx +1 -1
- package/packages/lib/src/components/CheckBox/CheckBox.scss +63 -63
- package/packages/lib/src/components/CheckBox/CheckBox.stories.tsx +22 -22
- package/packages/lib/src/components/CheckBox/CheckBox.tsx +42 -42
- package/packages/lib/src/components/CheckBox/index.tsx +1 -1
- package/packages/lib/src/components/DialogPrompt/DialogPrompt.scss +6 -6
- package/packages/lib/src/components/DialogPrompt/DialogPrompt.stories.tsx +17 -17
- package/packages/lib/src/components/DialogPrompt/DialogPrompt.test.tsx +11 -11
- package/packages/lib/src/components/DialogPrompt/DialogPrompt.tsx +41 -41
- package/packages/lib/src/components/DialogPrompt/index.tsx +1 -1
- package/packages/lib/src/components/Divider/Divider.scss +22 -22
- package/packages/lib/src/components/Divider/Divider.tsx +20 -20
- package/packages/lib/src/components/DropDown/DropDown.scss +70 -70
- package/packages/lib/src/components/DropDown/DropDown.stories.tsx +45 -45
- package/packages/lib/src/components/DropDown/DropDown.tsx +61 -61
- package/packages/lib/src/components/DropDown/index.tsx +1 -1
- package/packages/lib/src/components/Form/Form.scss +3 -3
- package/packages/lib/src/components/Form/Form.stories.tsx +20 -20
- package/packages/lib/src/components/Form/Form.tsx +25 -25
- package/packages/lib/src/components/FormButtons/FormButtons.scss +5 -5
- package/packages/lib/src/components/FormButtons/FormButtons.tsx +18 -18
- package/packages/lib/src/components/HeaderButtons/HeaderButtons.scss +6 -6
- package/packages/lib/src/components/HeaderButtons/HeaderButtons.stories.tsx +17 -17
- package/packages/lib/src/components/HeaderButtons/HeaderButtons.test.tsx +11 -11
- package/packages/lib/src/components/HeaderButtons/HeaderButtons.tsx +28 -28
- package/packages/lib/src/components/HeaderButtons/index.tsx +1 -1
- package/packages/lib/src/components/IconButton/IconButton.scss +64 -64
- package/packages/lib/src/components/IconButton/IconButton.tsx +44 -44
- package/packages/lib/src/components/MenuItem/MenuItem.scss +13 -13
- package/packages/lib/src/components/MenuItem/MenuItem.tsx +36 -36
- package/packages/lib/src/components/Modal/Modal.scss +71 -71
- package/packages/lib/src/components/Modal/Modal.tsx +60 -60
- package/packages/lib/src/components/Navbar/Navbar.scss +52 -52
- package/packages/lib/src/components/Navbar/Navbar.stories.tsx +25 -25
- package/packages/lib/src/components/Navbar/Navbar.tsx +38 -38
- package/packages/lib/src/components/NavbarLink/NavbarLink.scss +15 -15
- package/packages/lib/src/components/NavbarLink/NavbarLink.tsx +34 -34
- package/packages/lib/src/components/NavbarMenu/NavbarMenu.scss +156 -156
- package/packages/lib/src/components/NavbarMenu/NavbarMenu.stories.tsx +24 -24
- package/packages/lib/src/components/NavbarMenu/NavbarMenu.tsx +72 -72
- package/packages/lib/src/components/Panel/Panel.scss +29 -29
- package/packages/lib/src/components/Panel/Panel.stories.tsx +32 -32
- package/packages/lib/src/components/Panel/Panel.test.tsx +11 -11
- package/packages/lib/src/components/Panel/Panel.tsx +29 -29
- package/packages/lib/src/components/Panel/index.tsx +1 -1
- package/packages/lib/src/components/Paper/Paper.scss +5 -5
- package/packages/lib/src/components/Paper/Paper.stories.tsx +18 -18
- package/packages/lib/src/components/Paper/Paper.tsx +18 -18
- package/packages/lib/src/components/Paper/index.tsx +1 -1
- package/packages/lib/src/components/RangeSlider/RangeSlider.scss +83 -83
- package/packages/lib/src/components/RangeSlider/RangeSlider.stories.tsx +24 -24
- package/packages/lib/src/components/RangeSlider/RangeSlider.tsx +150 -150
- package/packages/lib/src/components/ResponsiveBar/ResponsiveBar.scss +72 -72
- package/packages/lib/src/components/ResponsiveBar/ResponsiveBar.tsx +38 -38
- package/packages/lib/src/components/ScrollView/ScrollView.scss +20 -20
- package/packages/lib/src/components/ScrollView/ScrollView.stories.tsx +17 -17
- package/packages/lib/src/components/ScrollView/ScrollView.test.tsx +11 -11
- package/packages/lib/src/components/ScrollView/ScrollView.tsx +19 -19
- package/packages/lib/src/components/ScrollView/index.tsx +1 -1
- package/packages/lib/src/components/Section/Section.scss +17 -17
- package/packages/lib/src/components/Section/Section.tsx +26 -26
- package/packages/lib/src/components/SelectField/SelectField.scss +42 -42
- package/packages/lib/src/components/SelectField/SelectField.stories.tsx +14 -14
- package/packages/lib/src/components/SelectField/SelectField.tsx +54 -54
- package/packages/lib/src/components/SelectField/index.tsx +1 -1
- package/packages/lib/src/components/Spacer/Spacer.scss +2 -2
- package/packages/lib/src/components/Spacer/Spacer.tsx +6 -6
- package/packages/lib/src/components/StackPanel/StackPanel.scss +8 -8
- package/packages/lib/src/components/StackPanel/StackPanel.stories.tsx +17 -17
- package/packages/lib/src/components/StackPanel/StackPanel.test.tsx +11 -11
- package/packages/lib/src/components/StackPanel/StackPanel.tsx +31 -31
- package/packages/lib/src/components/StackPanel/index.tsx +1 -1
- package/packages/lib/src/components/Submenu/Submenu.scss +55 -55
- package/packages/lib/src/components/Submenu/Submenu.stories.tsx +45 -45
- package/packages/lib/src/components/Submenu/Submenu.tsx +59 -59
- package/packages/lib/src/components/Submenu/index.tsx +1 -1
- package/packages/lib/src/components/SuccessCongratulation/SuccessCongratulation.scss +75 -75
- package/packages/lib/src/components/SuccessCongratulation/SuccessCongratulation.stories.tsx +17 -17
- package/packages/lib/src/components/SuccessCongratulation/SuccessCongratulation.test.tsx +11 -11
- package/packages/lib/src/components/SuccessCongratulation/SuccessCongratulation.tsx +63 -63
- package/packages/lib/src/components/SuccessCongratulation/index.tsx +1 -1
- package/packages/lib/src/components/TextArea/TextArea.scss +41 -41
- package/packages/lib/src/components/TextArea/TextArea.stories.tsx +14 -14
- package/packages/lib/src/components/TextArea/TextArea.tsx +50 -50
- package/packages/lib/src/components/TextArea/index.tsx +1 -1
- package/packages/lib/src/components/TextField/TextField.scss +56 -56
- package/packages/lib/src/components/TextField/TextField.stories.tsx +14 -14
- package/packages/lib/src/components/TextField/TextField.tsx +89 -89
- package/packages/lib/src/components/TextField/index.tsx +1 -1
- package/packages/lib/src/components/TitleEdit/TitleEdit.scss +17 -17
- package/packages/lib/src/components/TitleEdit/TitleEdit.tsx +69 -69
- package/packages/lib/src/components/Toast/Toast.scss +32 -32
- package/packages/lib/src/components/Toast/Toast.tsx +29 -29
- package/packages/lib/src/components/ToggleButton/ToggleButton.scss +47 -47
- package/packages/lib/src/components/ToggleButton/ToggleButton.stories.tsx +22 -22
- package/packages/lib/src/components/ToggleButton/ToggleButton.tsx +41 -41
- package/packages/lib/src/components/ToggleButton/index.tsx +1 -1
- package/packages/lib/src/components/Toolbar/Toolbar.scss +16 -16
- package/packages/lib/src/components/Toolbar/Toolbar.stories.tsx +17 -17
- package/packages/lib/src/components/Toolbar/Toolbar.test.tsx +11 -11
- package/packages/lib/src/components/Toolbar/Toolbar.tsx +20 -20
- package/packages/lib/src/components/Toolbar/index.tsx +1 -1
- package/packages/lib/src/components/Typography/Typography.scss +51 -51
- package/packages/lib/src/components/Typography/Typography.stories.tsx +18 -18
- package/packages/lib/src/components/Typography/Typography.tsx +19 -19
- package/packages/lib/src/components/index.tsx +34 -34
- package/packages/lib/src/hooks/index.tsx +3 -3
- package/packages/lib/src/hooks/use-click-outside.tsx +19 -19
- package/packages/lib/src/hooks/use-form.tsx +107 -107
- package/packages/lib/src/hooks/use-keys-enteresc.tsx +25 -25
- package/packages/lib/src/hooks/use-set-startup-focus.tsx +8 -8
- package/packages/lib/src/i18n/config.ts +8 -8
- package/packages/lib/src/i18n/en/translation.json +11 -11
- package/packages/lib/src/i18n/fr/translation.json +11 -11
- package/packages/lib/src/i18n/index.ts +11 -11
- package/packages/lib/src/index.tsx +7 -7
- package/packages/lib/src/stories/Intrduction.mdx +171 -171
- package/packages/lib/src/stories/assets/github.svg +3 -3
- package/packages/lib/src/styles/1-color-vars.scss +51 -51
- package/packages/lib/src/styles/2-font-variables.scss +2 -2
- package/packages/lib/src/styles/variables.scss +1 -1
- package/packages/lib/src/test/i18n.ts +17 -17
- package/packages/lib/src/utils/bem.ts +4 -4
- package/packages/lib/src/utils/formatError.ts +5 -5
- package/packages/lib/src/utils/index.ts +1 -1
- package/packages/lib/src/utils/interfaces.ts +5 -5
- package/packages/lib/tsconfig.json +26 -25
- package/packages/lib/vite.config.js +18 -18
- package/packages/ui-test/package-lock.json +97 -97
- package/packages/ui-test/package.json +19 -19
- package/packages/ui-test/playwright.config.ts +80 -80
- package/packages/ui-test/tests/example.spec.ts +18 -18
- package/packages/ui-test/tests-examples/demo-todo-app.spec.ts +437 -437
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
|
2
|
-
export default {
|
|
3
|
-
preset: 'ts-jest',
|
|
4
|
-
passWithNoTests: true,
|
|
5
|
-
testEnvironment: 'jsdom',
|
|
6
|
-
transform: {
|
|
7
|
-
'^.+\\.(js|jsx|mjs|ts|tsx)$': 'babel-jest',
|
|
8
|
-
},
|
|
9
|
-
moduleNameMapper:{
|
|
10
|
-
"\\.(css|less|scss|sass|svg)$": "identity-obj-proxy"
|
|
11
|
-
},
|
|
12
|
-
// transformIgnorePatterns: [
|
|
13
|
-
// 'node_modules/(?!(bem)/)',
|
|
14
|
-
// ],
|
|
15
|
-
testPathIgnorePatterns: [
|
|
16
|
-
"/build/",
|
|
17
|
-
"/dist/"
|
|
18
|
-
],
|
|
19
|
-
setupFilesAfterEnv: ['./src/test/setupTests.ts'],
|
|
1
|
+
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
|
2
|
+
export default {
|
|
3
|
+
preset: 'ts-jest',
|
|
4
|
+
passWithNoTests: true,
|
|
5
|
+
testEnvironment: 'jsdom',
|
|
6
|
+
transform: {
|
|
7
|
+
'^.+\\.(js|jsx|mjs|ts|tsx)$': 'babel-jest',
|
|
8
|
+
},
|
|
9
|
+
moduleNameMapper:{
|
|
10
|
+
"\\.(css|less|scss|sass|svg)$": "identity-obj-proxy"
|
|
11
|
+
},
|
|
12
|
+
// transformIgnorePatterns: [
|
|
13
|
+
// 'node_modules/(?!(bem)/)',
|
|
14
|
+
// ],
|
|
15
|
+
testPathIgnorePatterns: [
|
|
16
|
+
"/build/",
|
|
17
|
+
"/dist/"
|
|
18
|
+
],
|
|
19
|
+
setupFilesAfterEnv: ['./src/test/setupTests.ts'],
|
|
20
20
|
};
|
|
@@ -1,102 +1,100 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@react5/lib",
|
|
3
|
-
"version": "0.1.1",
|
|
4
|
-
"description": "React library starter.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"module": "dist/esm/index.esm.js",
|
|
8
|
-
"types": "dist/types/index.d.ts",
|
|
9
|
-
"style": "dist/index.css",
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/react5/ui.git"
|
|
13
|
-
},
|
|
14
|
-
"author": "React5.com",
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"peerDependencies": {
|
|
17
|
-
"react": ">=19",
|
|
18
|
-
"react-dom": ">=19",
|
|
19
|
-
"clsx": "^2.1.1",
|
|
20
|
-
"@react5/bem": "^0.4.3",
|
|
21
|
-
"i18next": ">=23",
|
|
22
|
-
"react-i18next": ">=15",
|
|
23
|
-
"react-icons": ">=5",
|
|
24
|
-
"react-router": ">=7",
|
|
25
|
-
"@react5/time-span": "^0.3.34"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@babel/core": "^7.
|
|
29
|
-
"@babel/eslint-parser": "^7.
|
|
30
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
31
|
-
"@babel/preset-env": "^7.
|
|
32
|
-
"@babel/preset-react": "^7.
|
|
33
|
-
"@babel/preset-typescript": "^7.
|
|
34
|
-
"@babel/runtime": "^7.
|
|
35
|
-
"@testing-library/react": "^16.3.
|
|
36
|
-
"@types/jest": "^30.0.0",
|
|
37
|
-
"@types/react": "^19.
|
|
38
|
-
"@types/react-dom": "^19.
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
40
|
-
"@typescript-eslint/parser": "^8.
|
|
41
|
-
"eslint": "^9.
|
|
42
|
-
"eslint-plugin-react": "^7.37.5",
|
|
43
|
-
"eslint-plugin-prettier": "^5.5.
|
|
44
|
-
"eslint-plugin-react-hooks": "^
|
|
45
|
-
"jest": "^30.0
|
|
46
|
-
"prettier": "^3.
|
|
47
|
-
"prettier-eslint": "^16.4.2",
|
|
48
|
-
"
|
|
49
|
-
"react": "^19.
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"@rollup/plugin-
|
|
56
|
-
"@rollup/plugin-
|
|
57
|
-
"@rollup/plugin-
|
|
58
|
-
"
|
|
59
|
-
"rollup
|
|
60
|
-
"@rollup
|
|
61
|
-
"@
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"i18next": "^
|
|
69
|
-
"react-
|
|
70
|
-
"react-
|
|
71
|
-
"
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"@storybook/
|
|
75
|
-
"@storybook/
|
|
76
|
-
"@
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"watch": "
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@react5/lib",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "React library starter.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"module": "dist/esm/index.esm.js",
|
|
8
|
+
"types": "dist/types/index.d.ts",
|
|
9
|
+
"style": "dist/index.css",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/react5/ui.git"
|
|
13
|
+
},
|
|
14
|
+
"author": "React5.com",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": ">=19",
|
|
18
|
+
"react-dom": ">=19",
|
|
19
|
+
"clsx": "^2.1.1",
|
|
20
|
+
"@react5/bem": "^0.4.3",
|
|
21
|
+
"i18next": ">=23",
|
|
22
|
+
"react-i18next": ">=15",
|
|
23
|
+
"react-icons": ">=5",
|
|
24
|
+
"react-router": ">=7",
|
|
25
|
+
"@react5/time-span": "^0.3.34"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@babel/core": "^7.28.6",
|
|
29
|
+
"@babel/eslint-parser": "^7.28.6",
|
|
30
|
+
"@babel/plugin-transform-runtime": "^7.28.5",
|
|
31
|
+
"@babel/preset-env": "^7.28.6",
|
|
32
|
+
"@babel/preset-react": "^7.28.5",
|
|
33
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
34
|
+
"@babel/runtime": "^7.28.6",
|
|
35
|
+
"@testing-library/react": "^16.3.1",
|
|
36
|
+
"@types/jest": "^30.0.0",
|
|
37
|
+
"@types/react": "^19.2.8",
|
|
38
|
+
"@types/react-dom": "^19.2.3",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^8.53.0",
|
|
40
|
+
"@typescript-eslint/parser": "^8.53.0",
|
|
41
|
+
"eslint": "^9.39.2",
|
|
42
|
+
"eslint-plugin-react": "^7.37.5",
|
|
43
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
44
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
45
|
+
"jest": "^30.2.0",
|
|
46
|
+
"prettier": "^3.8.0",
|
|
47
|
+
"prettier-eslint": "^16.4.2",
|
|
48
|
+
"react": "^19.2.3",
|
|
49
|
+
"react-dom": "^19.2.3",
|
|
50
|
+
"babel-jest": "^30.2.0",
|
|
51
|
+
"ts-jest": "^29.4.6",
|
|
52
|
+
"typescript": "^5.9.3",
|
|
53
|
+
"clsx": "^2.1.1",
|
|
54
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
55
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
56
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
57
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
58
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
59
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
60
|
+
"@svgr/rollup": "^8.1.0",
|
|
61
|
+
"@react5/bundle-sass": "^0.5.9",
|
|
62
|
+
"postcss": "^8.5.6",
|
|
63
|
+
"rollup": "^4.55.1",
|
|
64
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
65
|
+
"npm-run-all": "^4.1.5",
|
|
66
|
+
"sass-embedded": "^1.97.2",
|
|
67
|
+
"i18next": "^25.7.4",
|
|
68
|
+
"react-i18next": "^16.5.3",
|
|
69
|
+
"react-icons": "^5.5.0",
|
|
70
|
+
"react-router": "^7.12.0",
|
|
71
|
+
"@react5/time-span": "^0.3.36",
|
|
72
|
+
"@storybook/addon-links": "^10.1.11",
|
|
73
|
+
"@storybook/addon-onboarding": "^10.1.11",
|
|
74
|
+
"@storybook/react": "^10.1.11",
|
|
75
|
+
"@storybook/react-vite": "^10.1.11",
|
|
76
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
77
|
+
"eslint-plugin-storybook": "^10.1.11",
|
|
78
|
+
"storybook": "^10.1.11",
|
|
79
|
+
"vite": "^7.3.1",
|
|
80
|
+
"plop": "^4.0.4",
|
|
81
|
+
"@testing-library/dom": "^10.4.1",
|
|
82
|
+
"identity-obj-proxy": "^3.0.0",
|
|
83
|
+
"vite-plugin-svgr": "^4.5.0"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"build": "npm-run-all tsc rollup",
|
|
87
|
+
"rollup": "rollup -c --filterLogs '!message:*__PURE__*'",
|
|
88
|
+
"clean": "rimraf build",
|
|
89
|
+
"watch": "rollup -c -w --filterLogs '!message:*__PURE__*'",
|
|
90
|
+
"dev": "npm-run-all --parallel tsc-watch watch",
|
|
91
|
+
"dev-watch": "npm-run-all --parallel tsc-watch watch",
|
|
92
|
+
"tsc": "tsc -b",
|
|
93
|
+
"tsc-watch": "tsc -b --watch",
|
|
94
|
+
"lint": "eslint \"src/**\" --ext .ts --ext .tsx",
|
|
95
|
+
"test": "jest",
|
|
96
|
+
"storybook": "storybook dev -p 6006",
|
|
97
|
+
"build-storybook": "storybook build",
|
|
98
|
+
"plop": "plop"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
export default function (plop) {
|
|
2
|
-
// component generator
|
|
3
|
-
plop.setGenerator('component', {
|
|
4
|
-
description: 'A design system component',
|
|
5
|
-
prompts: [{
|
|
6
|
-
type: 'input',
|
|
7
|
-
name: 'name',
|
|
8
|
-
message: 'name:'
|
|
9
|
-
}],
|
|
10
|
-
actions: [{
|
|
11
|
-
type: 'add',
|
|
12
|
-
path: 'src/components/{{pascalCase name}}/index.tsx',
|
|
13
|
-
templateFile: 'plop/templates/component/index.hbs'
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
type: 'add',
|
|
17
|
-
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.tsx',
|
|
18
|
-
templateFile: 'plop/templates/component/component.hbs'
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
type: 'add',
|
|
22
|
-
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.scss',
|
|
23
|
-
templateFile: 'plop/templates/component/style.hbs'
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'add',
|
|
27
|
-
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.test.tsx',
|
|
28
|
-
templateFile: 'plop/templates/component/test.hbs'
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
type: 'add',
|
|
32
|
-
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.stories.tsx',
|
|
33
|
-
templateFile: 'plop/templates/component/stories.hbs'
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
type: 'append',
|
|
39
|
-
path: 'src/components/index.tsx',
|
|
40
|
-
template: "export * from './{{pascalCase name}}'"
|
|
41
|
-
},
|
|
42
|
-
]
|
|
43
|
-
});
|
|
1
|
+
export default function (plop) {
|
|
2
|
+
// component generator
|
|
3
|
+
plop.setGenerator('component', {
|
|
4
|
+
description: 'A design system component',
|
|
5
|
+
prompts: [{
|
|
6
|
+
type: 'input',
|
|
7
|
+
name: 'name',
|
|
8
|
+
message: 'name:'
|
|
9
|
+
}],
|
|
10
|
+
actions: [{
|
|
11
|
+
type: 'add',
|
|
12
|
+
path: 'src/components/{{pascalCase name}}/index.tsx',
|
|
13
|
+
templateFile: 'plop/templates/component/index.hbs'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: 'add',
|
|
17
|
+
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.tsx',
|
|
18
|
+
templateFile: 'plop/templates/component/component.hbs'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'add',
|
|
22
|
+
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.scss',
|
|
23
|
+
templateFile: 'plop/templates/component/style.hbs'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'add',
|
|
27
|
+
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.test.tsx',
|
|
28
|
+
templateFile: 'plop/templates/component/test.hbs'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'add',
|
|
32
|
+
path: 'src/components/{{pascalCase name}}/{{pascalCase name}}.stories.tsx',
|
|
33
|
+
templateFile: 'plop/templates/component/stories.hbs'
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
type: 'append',
|
|
39
|
+
path: 'src/components/index.tsx',
|
|
40
|
+
template: "export * from './{{pascalCase name}}'"
|
|
41
|
+
},
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
44
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import component from './component/index.js'
|
|
2
|
-
export default function (plop) {
|
|
3
|
-
component(plop);
|
|
1
|
+
import component from './component/index.js'
|
|
2
|
+
export default function (plop) {
|
|
3
|
+
component(plop);
|
|
4
4
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { FormEvent, ReactNode } from 'react';
|
|
2
|
-
import './{{pascalCase name}}.scss'
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { bem } from "../../utils/bem";
|
|
5
|
-
|
|
6
|
-
interface {{pascalCase name}}Props {
|
|
7
|
-
onClick?: (e?: FormEvent<HTMLButtonElement>) => void;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
className?: string;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
}
|
|
12
|
-
const b = bem("{{dashCase name}}");
|
|
13
|
-
export const {{pascalCase name}} = ({children, onClick, className}: {{pascalCase name}}Props) => {
|
|
14
|
-
return (
|
|
15
|
-
<div className={clsx(b(), className)} onClick={onClick}>
|
|
16
|
-
{children}
|
|
17
|
-
</div>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
1
|
+
import { FormEvent, ReactNode } from 'react';
|
|
2
|
+
import './{{pascalCase name}}.scss'
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { bem } from "../../utils/bem";
|
|
5
|
+
|
|
6
|
+
interface {{pascalCase name}}Props {
|
|
7
|
+
onClick?: (e?: FormEvent<HTMLButtonElement>) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
const b = bem("{{dashCase name}}");
|
|
13
|
+
export const {{pascalCase name}} = ({children, onClick, className}: {{pascalCase name}}Props) => {
|
|
14
|
+
return (
|
|
15
|
+
<div className={clsx(b(), className)} onClick={onClick}>
|
|
16
|
+
{children}
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
20
|
export default {{pascalCase name}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./{{pascalCase name}}";
|
|
1
|
+
export * from "./{{pascalCase name}}";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { {{pascalCase name}} } from './{{pascalCase name}}';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof {{pascalCase name}}> = {
|
|
5
|
-
title: 'Example/{{pascalCase name}}',
|
|
6
|
-
component: {{pascalCase name}},
|
|
7
|
-
argTypes: {
|
|
8
|
-
backgroundColor: { control: 'color' },
|
|
9
|
-
},
|
|
10
|
-
} as Meta;
|
|
11
|
-
export default meta;
|
|
12
|
-
|
|
13
|
-
type Story = StoryObj<typeof {{pascalCase name}}>;
|
|
14
|
-
|
|
15
|
-
export const Text{{pascalCase name}}: Story = {
|
|
16
|
-
render: () => <{{pascalCase name}}>Test</{{pascalCase name}}>,
|
|
17
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { {{pascalCase name}} } from './{{pascalCase name}}';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof {{pascalCase name}}> = {
|
|
5
|
+
title: 'Example/{{pascalCase name}}',
|
|
6
|
+
component: {{pascalCase name}},
|
|
7
|
+
argTypes: {
|
|
8
|
+
backgroundColor: { control: 'color' },
|
|
9
|
+
},
|
|
10
|
+
} as Meta;
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof {{pascalCase name}}>;
|
|
14
|
+
|
|
15
|
+
export const Text{{pascalCase name}}: Story = {
|
|
16
|
+
render: () => <{{pascalCase name}}>Test</{{pascalCase name}}>,
|
|
17
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.r5ui-{{dashCase name}} {
|
|
1
|
+
.r5ui-{{dashCase name}} {
|
|
2
2
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
-
import '@testing-library/jest-dom';
|
|
4
|
-
import { {{pascalCase name}} } from './{{pascalCase name}}';
|
|
5
|
-
|
|
6
|
-
describe('{{pascalCase name}} Component', () => {
|
|
7
|
-
test('renders the button with the correct label', () => {
|
|
8
|
-
render(<{{pascalCase name}} onClick={jest.fn()} >Test</{{pascalCase name}}>);
|
|
9
|
-
const div = screen.getByRole('{{pascalCase name}}', { name: /click me/i });
|
|
10
|
-
expect(div).toBeInTheDocument();
|
|
11
|
-
});
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
|
+
import { {{pascalCase name}} } from './{{pascalCase name}}';
|
|
5
|
+
|
|
6
|
+
describe('{{pascalCase name}} Component', () => {
|
|
7
|
+
test('renders the button with the correct label', () => {
|
|
8
|
+
render(<{{pascalCase name}} onClick={jest.fn()} >Test</{{pascalCase name}}>);
|
|
9
|
+
const div = screen.getByRole('{{pascalCase name}}', { name: /click me/i });
|
|
10
|
+
expect(div).toBeInTheDocument();
|
|
11
|
+
});
|
|
12
12
|
});
|
package/packages/lib/plopfile.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './plop/index.js';
|
|
1
|
+
export { default } from './plop/index.js';
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import pkg from "./package.json" with { type: "json" };
|
|
2
|
-
|
|
3
|
-
import { babel } from "@rollup/plugin-babel";
|
|
4
|
-
import terser from "@rollup/plugin-terser";
|
|
5
|
-
import resolve from "@rollup/plugin-node-resolve";
|
|
6
|
-
import commonjs from "@rollup/plugin-commonjs";
|
|
7
|
-
import bundleSass from "@react5/bundle-sass";
|
|
8
|
-
import json from '@rollup/plugin-json';
|
|
9
|
-
import svgr from '@svgr/rollup';
|
|
10
|
-
|
|
11
|
-
const production = !process.env.ROLLUP_WATCH;
|
|
12
|
-
process.env.NODE_ENV = production ? 'production' : '';
|
|
13
|
-
const extensions = [".js", ".jsx", ".ts", ".tsx", ".json", ".svg", ];
|
|
14
|
-
const external = [
|
|
15
|
-
...Object.keys(pkg.peerDependencies || {}),
|
|
16
|
-
...Object.keys(pkg.dependencies || {}),
|
|
17
|
-
"@babel/runtime",
|
|
18
|
-
"react/jsx-runtime"
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
const pathsToWatch =[ 'src/**' ];
|
|
22
|
-
|
|
23
|
-
export default [
|
|
24
|
-
{
|
|
25
|
-
input: "./src/index.tsx",
|
|
26
|
-
output: [
|
|
27
|
-
{
|
|
28
|
-
file: pkg.main,
|
|
29
|
-
format: "cjs",
|
|
30
|
-
exports: "named",
|
|
31
|
-
sourcemap: !production,
|
|
32
|
-
//inlineDynamicImports: true,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
file: pkg.module,
|
|
36
|
-
format: "es",
|
|
37
|
-
exports: "named",
|
|
38
|
-
sourcemap: !production,
|
|
39
|
-
//inlineDynamicImports: true,
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
external,
|
|
43
|
-
plugins: [
|
|
44
|
-
resolve({
|
|
45
|
-
extensions,
|
|
46
|
-
}),
|
|
47
|
-
json(),
|
|
48
|
-
svgr(),
|
|
49
|
-
commonjs(),
|
|
50
|
-
babel({
|
|
51
|
-
exclude: /^(.+\/)?node_modules\/.+$/,
|
|
52
|
-
extensions,
|
|
53
|
-
babelHelpers: "runtime",
|
|
54
|
-
sourcemap: !production,
|
|
55
|
-
skipPreflightCheck: true
|
|
56
|
-
}),
|
|
57
|
-
bundleSass({scssOnly: false}),
|
|
58
|
-
production && terser(),
|
|
59
|
-
],
|
|
60
|
-
watch: {
|
|
61
|
-
paths: pathsToWatch
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
];
|
|
1
|
+
import pkg from "./package.json" with { type: "json" };
|
|
2
|
+
|
|
3
|
+
import { babel } from "@rollup/plugin-babel";
|
|
4
|
+
import terser from "@rollup/plugin-terser";
|
|
5
|
+
import resolve from "@rollup/plugin-node-resolve";
|
|
6
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
7
|
+
import bundleSass from "@react5/bundle-sass";
|
|
8
|
+
import json from '@rollup/plugin-json';
|
|
9
|
+
import svgr from '@svgr/rollup';
|
|
10
|
+
|
|
11
|
+
const production = !process.env.ROLLUP_WATCH;
|
|
12
|
+
process.env.NODE_ENV = production ? 'production' : '';
|
|
13
|
+
const extensions = [".js", ".jsx", ".ts", ".tsx", ".json", ".svg", ];
|
|
14
|
+
const external = [
|
|
15
|
+
...Object.keys(pkg.peerDependencies || {}),
|
|
16
|
+
...Object.keys(pkg.dependencies || {}),
|
|
17
|
+
"@babel/runtime",
|
|
18
|
+
"react/jsx-runtime"
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
const pathsToWatch =[ 'src/**' ];
|
|
22
|
+
|
|
23
|
+
export default [
|
|
24
|
+
{
|
|
25
|
+
input: "./src/index.tsx",
|
|
26
|
+
output: [
|
|
27
|
+
{
|
|
28
|
+
file: pkg.main,
|
|
29
|
+
format: "cjs",
|
|
30
|
+
exports: "named",
|
|
31
|
+
sourcemap: !production,
|
|
32
|
+
//inlineDynamicImports: true,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
file: pkg.module,
|
|
36
|
+
format: "es",
|
|
37
|
+
exports: "named",
|
|
38
|
+
sourcemap: !production,
|
|
39
|
+
//inlineDynamicImports: true,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
external,
|
|
43
|
+
plugins: [
|
|
44
|
+
resolve({
|
|
45
|
+
extensions,
|
|
46
|
+
}),
|
|
47
|
+
json(),
|
|
48
|
+
svgr(),
|
|
49
|
+
commonjs(),
|
|
50
|
+
babel({
|
|
51
|
+
exclude: /^(.+\/)?node_modules\/.+$/,
|
|
52
|
+
extensions,
|
|
53
|
+
babelHelpers: "runtime",
|
|
54
|
+
sourcemap: !production,
|
|
55
|
+
skipPreflightCheck: true
|
|
56
|
+
}),
|
|
57
|
+
bundleSass({scssOnly: false}),
|
|
58
|
+
production && terser(),
|
|
59
|
+
],
|
|
60
|
+
watch: {
|
|
61
|
+
paths: pathsToWatch
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
];
|