w-design-system 0.0.83 → 0.0.85
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/.storybook/main.ts +8 -5
- package/.storybook/preview.ts +4 -13
- package/dist/components/Banner/index.d.ts +1 -1
- package/dist/components/Banner/styles.d.ts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/styles.d.ts +2 -2
- package/dist/components/Button/test.d.ts +0 -1
- package/dist/components/ButtonRadiusIcon/index.d.ts +1 -1
- package/dist/components/ButtonRadiusIcon/styles.d.ts +1 -1
- package/dist/components/ButtonRound/index.d.ts +1 -1
- package/dist/components/ButtonRound/styles.d.ts +1 -1
- package/dist/components/CardStories/index.d.ts +1 -1
- package/dist/components/CardStories/index.d.ts.map +1 -1
- package/dist/components/CardStories/stories.d.ts +2 -2
- package/dist/components/CountryStateSelector/index.d.ts +1 -2
- package/dist/components/DatePicker/index.d.ts +2 -7
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/index.d.ts +1 -1
- package/dist/components/DateRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/styles.d.ts +7 -7
- package/dist/components/EmptyState/index.d.ts +1 -1
- package/dist/components/EmptyState/index.d.ts.map +1 -1
- package/dist/components/EmptyState/stories.d.ts +1 -1
- package/dist/components/EmptyState/styles.d.ts +1 -1
- package/dist/components/IconWrapper/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/styles.d.ts +6 -6
- package/dist/components/InputTag/index.d.ts +1 -1
- package/dist/components/InputTag/index.d.ts.map +1 -1
- package/dist/components/InputTag/styles.d.ts +6 -6
- package/dist/components/Loading/index.d.ts +1 -1
- package/dist/components/Loading/stories.d.ts +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/styles.d.ts +2 -2
- package/dist/components/MultiSelect/index.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/Paginate/index.d.ts +1 -1
- package/dist/components/Paginate/index.d.ts.map +1 -1
- package/dist/components/Paginate/styles.d.ts +1 -1
- package/dist/components/Paragraph/index.d.ts +1 -1
- package/dist/components/Paragraph/stories.d.ts +1 -1
- package/dist/components/PortalSelect/index.d.ts +1 -1
- package/dist/components/PortalSelect/styles.d.ts +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/styles.d.ts +9 -9
- package/dist/components/Sidebar/SidebarGroup/index.d.ts +1 -2
- package/dist/components/Sidebar/SidebarGroup/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarGroup/styles.d.ts +3 -3
- package/dist/components/Sidebar/SidebarItem/index.d.ts +1 -1
- package/dist/components/Sidebar/SidebarItem/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarItem/styles.d.ts +2 -2
- package/dist/components/Sidebar/SidebarLogo/index.d.ts +1 -1
- package/dist/components/Sidebar/SidebarLogo/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarLogo/styles.d.ts +1 -1
- package/dist/components/Sidebar/index.d.ts +1 -1
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/styles.d.ts +4 -4
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/stories.d.ts +1 -1
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/Tabs/styles.d.ts +2 -2
- package/dist/components/Title/index.d.ts +1 -1
- package/dist/components/Title/stories.d.ts +1 -1
- package/dist/favicon.ico +0 -0
- package/dist/index.html +43 -0
- package/dist/logo192.png +0 -0
- package/dist/logo512.png +0 -0
- package/dist/manifest.json +25 -0
- package/dist/robots.txt +3 -0
- package/dist/setupTests.d.ts +0 -1
- package/dist/src/globalStyles.d.ts +1 -1
- package/dist/stories/Button.d.ts +1 -2
- package/dist/stories/Button.d.ts.map +1 -1
- package/dist/stories/Button.stories.d.ts +3 -3
- package/dist/stories/Header.d.ts +1 -2
- package/dist/stories/Header.d.ts.map +1 -1
- package/dist/stories/Header.stories.d.ts +5 -5
- package/dist/stories/Page.d.ts +1 -2
- package/dist/stories/Page.stories.d.ts +2 -2
- package/dist/w-design-system.es.js +4656 -0
- package/dist/w-design-system.umd.js +1412 -0
- package/eslint.config.ts +21 -0
- package/package.json +28 -45
- package/prettier.config.js +11 -0
- package/src/components/Input/index.tsx +3 -6
- package/src/components/InputTag/index.tsx +3 -5
- package/src/components/Select/styles.ts +1 -1
- package/tsconfig.json +5 -18
- package/vite.config.ts +31 -0
- package/.babelrc +0 -8
- package/dist/assets/icon/index.js +0 -41
- package/dist/assets/icon/index.js.map +0 -1
- package/dist/components/Banner/index.js +0 -44
- package/dist/components/Banner/index.js.map +0 -1
- package/dist/components/Banner/stories.js +0 -25
- package/dist/components/Banner/stories.js.map +0 -1
- package/dist/components/Banner/styles.js +0 -56
- package/dist/components/Banner/styles.js.map +0 -1
- package/dist/components/Button/index.js +0 -66
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Button/stories.js +0 -88
- package/dist/components/Button/stories.js.map +0 -1
- package/dist/components/Button/styles.js +0 -217
- package/dist/components/Button/styles.js.map +0 -1
- package/dist/components/Button/test.js +0 -33
- package/dist/components/Button/test.js.map +0 -1
- package/dist/components/ButtonRadiusIcon/index.js +0 -25
- package/dist/components/ButtonRadiusIcon/index.js.map +0 -1
- package/dist/components/ButtonRadiusIcon/stories.js +0 -42
- package/dist/components/ButtonRadiusIcon/stories.js.map +0 -1
- package/dist/components/ButtonRadiusIcon/styles.js +0 -150
- package/dist/components/ButtonRadiusIcon/styles.js.map +0 -1
- package/dist/components/ButtonRound/index.js +0 -21
- package/dist/components/ButtonRound/index.js.map +0 -1
- package/dist/components/ButtonRound/stories.js +0 -43
- package/dist/components/ButtonRound/stories.js.map +0 -1
- package/dist/components/ButtonRound/styles.js +0 -134
- package/dist/components/ButtonRound/styles.js.map +0 -1
- package/dist/components/CardStories/index.js +0 -43
- package/dist/components/CardStories/index.js.map +0 -1
- package/dist/components/CardStories/stories.js +0 -35
- package/dist/components/CardStories/stories.js.map +0 -1
- package/dist/components/CountryStateSelector/index.js +0 -106
- package/dist/components/CountryStateSelector/index.js.map +0 -1
- package/dist/components/CountryStateSelector/stories.js +0 -46
- package/dist/components/CountryStateSelector/stories.js.map +0 -1
- package/dist/components/DatePicker/index.js +0 -22
- package/dist/components/DatePicker/index.js.map +0 -1
- package/dist/components/DatePicker/stories.js +0 -61
- package/dist/components/DatePicker/stories.js.map +0 -1
- package/dist/components/DateRangePicker/index.js +0 -187
- package/dist/components/DateRangePicker/index.js.map +0 -1
- package/dist/components/DateRangePicker/stories.js +0 -65
- package/dist/components/DateRangePicker/stories.js.map +0 -1
- package/dist/components/DateRangePicker/styles.js +0 -122
- package/dist/components/DateRangePicker/styles.js.map +0 -1
- package/dist/components/EmptyState/index.js +0 -14
- package/dist/components/EmptyState/index.js.map +0 -1
- package/dist/components/EmptyState/stories.js +0 -31
- package/dist/components/EmptyState/stories.js.map +0 -1
- package/dist/components/EmptyState/styles.js +0 -29
- package/dist/components/EmptyState/styles.js.map +0 -1
- package/dist/components/IconWrapper/index.js +0 -34
- package/dist/components/IconWrapper/index.js.map +0 -1
- package/dist/components/Input/index.js +0 -91
- package/dist/components/Input/index.js.map +0 -1
- package/dist/components/Input/stories.js +0 -55
- package/dist/components/Input/stories.js.map +0 -1
- package/dist/components/Input/styles.js +0 -86
- package/dist/components/Input/styles.js.map +0 -1
- package/dist/components/InputTag/index.js +0 -124
- package/dist/components/InputTag/index.js.map +0 -1
- package/dist/components/InputTag/stories.js +0 -25
- package/dist/components/InputTag/stories.js.map +0 -1
- package/dist/components/InputTag/styles.js +0 -146
- package/dist/components/InputTag/styles.js.map +0 -1
- package/dist/components/Loading/index.js +0 -50
- package/dist/components/Loading/index.js.map +0 -1
- package/dist/components/Loading/stories.js +0 -46
- package/dist/components/Loading/stories.js.map +0 -1
- package/dist/components/Modal/index.js +0 -31
- package/dist/components/Modal/index.js.map +0 -1
- package/dist/components/Modal/stories.js +0 -24
- package/dist/components/Modal/stories.js.map +0 -1
- package/dist/components/Modal/styles.js +0 -48
- package/dist/components/Modal/styles.js.map +0 -1
- package/dist/components/MultiSelect/index.js +0 -284
- package/dist/components/MultiSelect/index.js.map +0 -1
- package/dist/components/MultiSelect/stories.js +0 -39
- package/dist/components/MultiSelect/stories.js.map +0 -1
- package/dist/components/MultiSelect/styles.d.ts +0 -14
- package/dist/components/MultiSelect/styles.d.ts.map +0 -1
- package/dist/components/MultiSelect/styles.js +0 -66
- package/dist/components/MultiSelect/styles.js.map +0 -1
- package/dist/components/Paginate/index.js +0 -63
- package/dist/components/Paginate/index.js.map +0 -1
- package/dist/components/Paginate/stories.js +0 -44
- package/dist/components/Paginate/stories.js.map +0 -1
- package/dist/components/Paginate/styles.js +0 -64
- package/dist/components/Paginate/styles.js.map +0 -1
- package/dist/components/Paragraph/index.js +0 -51
- package/dist/components/Paragraph/index.js.map +0 -1
- package/dist/components/Paragraph/stories.js +0 -113
- package/dist/components/Paragraph/stories.js.map +0 -1
- package/dist/components/PortalSelect/index.js +0 -141
- package/dist/components/PortalSelect/index.js.map +0 -1
- package/dist/components/PortalSelect/stories.js +0 -82
- package/dist/components/PortalSelect/stories.js.map +0 -1
- package/dist/components/PortalSelect/styles.js +0 -9
- package/dist/components/PortalSelect/styles.js.map +0 -1
- package/dist/components/Select/index.js +0 -260
- package/dist/components/Select/index.js.map +0 -1
- package/dist/components/Select/stories.js +0 -40
- package/dist/components/Select/stories.js.map +0 -1
- package/dist/components/Select/styles.js +0 -90
- package/dist/components/Select/styles.js.map +0 -1
- package/dist/components/Sidebar/SidebarGroup/index.js +0 -42
- package/dist/components/Sidebar/SidebarGroup/index.js.map +0 -1
- package/dist/components/Sidebar/SidebarGroup/styles.js +0 -68
- package/dist/components/Sidebar/SidebarGroup/styles.js.map +0 -1
- package/dist/components/Sidebar/SidebarItem/index.js +0 -26
- package/dist/components/Sidebar/SidebarItem/index.js.map +0 -1
- package/dist/components/Sidebar/SidebarItem/styles.js +0 -64
- package/dist/components/Sidebar/SidebarItem/styles.js.map +0 -1
- package/dist/components/Sidebar/SidebarLogo/index.js +0 -12
- package/dist/components/Sidebar/SidebarLogo/index.js.map +0 -1
- package/dist/components/Sidebar/SidebarLogo/styles.js +0 -48
- package/dist/components/Sidebar/SidebarLogo/styles.js.map +0 -1
- package/dist/components/Sidebar/index.js +0 -45
- package/dist/components/Sidebar/index.js.map +0 -1
- package/dist/components/Sidebar/stories.js +0 -94
- package/dist/components/Sidebar/stories.js.map +0 -1
- package/dist/components/Sidebar/styles.js +0 -73
- package/dist/components/Sidebar/styles.js.map +0 -1
- package/dist/components/Table/index.js +0 -95
- package/dist/components/Table/index.js.map +0 -1
- package/dist/components/Table/stories.js +0 -163
- package/dist/components/Table/stories.js.map +0 -1
- package/dist/components/Table/styles.js +0 -2
- package/dist/components/Table/styles.js.map +0 -1
- package/dist/components/Tabs/index.js +0 -13
- package/dist/components/Tabs/index.js.map +0 -1
- package/dist/components/Tabs/stories.js +0 -31
- package/dist/components/Tabs/stories.js.map +0 -1
- package/dist/components/Tabs/styles.js +0 -22
- package/dist/components/Tabs/styles.js.map +0 -1
- package/dist/components/Themes/index.js +0 -88
- package/dist/components/Themes/index.js.map +0 -1
- package/dist/components/Title/index.js +0 -17
- package/dist/components/Title/index.js.map +0 -1
- package/dist/components/Title/stories.js +0 -61
- package/dist/components/Title/stories.js.map +0 -1
- package/dist/components/Types/index.js +0 -2
- package/dist/components/Types/index.js.map +0 -1
- package/dist/components/index.js +0 -16
- package/dist/components/index.js.map +0 -1
- package/dist/index.js +0 -25
- package/dist/index.js.map +0 -1
- package/dist/prettier.config.js +0 -13
- package/dist/prettier.config.js.map +0 -1
- package/dist/reportWebVitals.d.ts +0 -4
- package/dist/reportWebVitals.d.ts.map +0 -1
- package/dist/reportWebVitals.js +0 -14
- package/dist/reportWebVitals.js.map +0 -1
- package/dist/setupTests.js +0 -6
- package/dist/setupTests.js.map +0 -1
- package/dist/src/globalStyles.js +0 -15
- package/dist/src/globalStyles.js.map +0 -1
- package/dist/stories/Button.js +0 -22
- package/dist/stories/Button.js.map +0 -1
- package/dist/stories/Button.stories.js +0 -45
- package/dist/stories/Button.stories.js.map +0 -1
- package/dist/stories/Header.js +0 -21
- package/dist/stories/Header.js.map +0 -1
- package/dist/stories/Header.stories.js +0 -27
- package/dist/stories/Header.stories.js.map +0 -1
- package/dist/stories/Page.js +0 -38
- package/dist/stories/Page.js.map +0 -1
- package/dist/stories/Page.stories.js +0 -34
- package/dist/stories/Page.stories.js.map +0 -1
- package/dist/utils/constanst.js +0 -3
- package/dist/utils/constanst.js.map +0 -1
- package/src/reportWebVitals.ts +0 -16
package/eslint.config.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import reactPlugin from 'eslint-plugin-react'
|
|
2
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
3
|
+
import jsxA11y from 'eslint-plugin-jsx-a11y'
|
|
4
|
+
import storybook from 'eslint-plugin-storybook'
|
|
5
|
+
import prettierConfig from 'eslint-config-prettier'
|
|
6
|
+
|
|
7
|
+
// @ts-check
|
|
8
|
+
|
|
9
|
+
import eslint from '@eslint/js'
|
|
10
|
+
import tseslint from 'typescript-eslint'
|
|
11
|
+
|
|
12
|
+
export default tseslint.config(
|
|
13
|
+
eslint.configs.recommended,
|
|
14
|
+
tseslint.configs.recommended,
|
|
15
|
+
reactPlugin.configs.flat.recommended,
|
|
16
|
+
reactPlugin.configs.flat['jsx-runtime'],
|
|
17
|
+
reactHooks.configs['recommended-latest'],
|
|
18
|
+
jsxA11y.configs.recommended,
|
|
19
|
+
storybook.configs['flat/recommended'],
|
|
20
|
+
prettierConfig
|
|
21
|
+
)
|
package/package.json
CHANGED
|
@@ -1,75 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "w-design-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.85",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@
|
|
8
|
-
"@testing-library/
|
|
9
|
-
"@testing-library/
|
|
10
|
-
"@testing-library/user-event": "^13.5.0",
|
|
11
|
-
"@types/jest": "^27.5.2",
|
|
12
|
-
"@types/node": "^16.18.104",
|
|
13
|
-
"@types/react": "^18.3.3",
|
|
14
|
-
"@types/react-dom": "^18.3.0",
|
|
15
|
-
"@types/styled-components": "^5.1.34",
|
|
16
|
-
"file-loader": "^6.2.0",
|
|
7
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
8
|
+
"@testing-library/react": "^16.3.0",
|
|
9
|
+
"@testing-library/user-event": "^14.6.1",
|
|
17
10
|
"react": "^18.3.1",
|
|
18
11
|
"react-dom": "^18.3.1",
|
|
19
|
-
"react-scripts": "5.0.1",
|
|
20
12
|
"react-svg": "^16.1.34",
|
|
21
13
|
"styled-components": "^6.1.12",
|
|
22
|
-
"typescript": "^5.
|
|
23
|
-
"
|
|
14
|
+
"typescript": "^5.8.3",
|
|
15
|
+
"vite": "^6.3.5"
|
|
24
16
|
},
|
|
25
17
|
"scripts": {
|
|
26
|
-
"
|
|
18
|
+
"dev": "vite",
|
|
19
|
+
"build": "rm -rf dist && vite build && yarn copy-assets",
|
|
27
20
|
"copy-assets": "cpx 'src/assets/icon/**/*' dist/assets/icon",
|
|
28
|
-
"
|
|
29
|
-
"test": "react-scripts test",
|
|
30
|
-
"eject": "react-scripts eject",
|
|
21
|
+
"test": "vitest",
|
|
31
22
|
"storybook": "storybook dev -p 6006",
|
|
32
23
|
"build-storybook": "storybook build",
|
|
33
24
|
"clean": "rm -rf node_modules && rm -rf dist && yarn cache clean && yarn install"
|
|
34
25
|
},
|
|
35
|
-
"eslintConfig": {
|
|
36
|
-
"extends": [
|
|
37
|
-
"react-app",
|
|
38
|
-
"react-app/jest",
|
|
39
|
-
"plugin:storybook/recommended"
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
"browserslist": {
|
|
43
|
-
"production": [
|
|
44
|
-
">0.2%",
|
|
45
|
-
"not dead",
|
|
46
|
-
"not op_mini all"
|
|
47
|
-
],
|
|
48
|
-
"development": [
|
|
49
|
-
"last 1 chrome version",
|
|
50
|
-
"last 1 firefox version",
|
|
51
|
-
"last 1 safari version"
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
26
|
"devDependencies": {
|
|
55
|
-
"@chromatic-com/storybook": "^
|
|
27
|
+
"@chromatic-com/storybook": "^3.2.6",
|
|
28
|
+
"@eslint/js": "^9.26.0",
|
|
56
29
|
"@storybook/addon-essentials": "^8.2.6",
|
|
57
30
|
"@storybook/addon-interactions": "^8.2.6",
|
|
58
31
|
"@storybook/addon-links": "^8.2.6",
|
|
59
32
|
"@storybook/addon-onboarding": "^8.2.6",
|
|
60
33
|
"@storybook/blocks": "^8.2.6",
|
|
61
|
-
"@storybook/preset-create-react-app": "^8.2.6",
|
|
62
34
|
"@storybook/react": "^8.2.6",
|
|
63
|
-
"@storybook/react-
|
|
35
|
+
"@storybook/react-vite": "^8.6.12",
|
|
64
36
|
"@storybook/test": "^8.2.6",
|
|
65
|
-
"
|
|
37
|
+
"@testing-library/dom": "^10.4.0",
|
|
38
|
+
"@types/jest": "^29.5.14",
|
|
39
|
+
"@types/node": "^22.15.18",
|
|
40
|
+
"@types/react": "^18.3.21",
|
|
41
|
+
"@types/react-dom": "^18.3.7",
|
|
42
|
+
"@types/styled-components": "^5.1.34",
|
|
43
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
66
44
|
"cpx": "^1.5.0",
|
|
67
|
-
"eslint
|
|
45
|
+
"eslint": "^9.26.0",
|
|
46
|
+
"eslint-config-prettier": "^10.1.5",
|
|
47
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
48
|
+
"eslint-plugin-react": "^7.37.5",
|
|
49
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
50
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
51
|
+
"jiti": "^2.4.2",
|
|
68
52
|
"prettier": "^3.3.3",
|
|
69
53
|
"prop-types": "^15.8.1",
|
|
70
54
|
"storybook": "^8.2.6",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"webpack-cli": "^5.1.4"
|
|
55
|
+
"typescript-eslint": "^8.32.1",
|
|
56
|
+
"vite-plugin-dts": "^4.5.4"
|
|
74
57
|
}
|
|
75
58
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { HTMLAttributes, ReactNode, useCallback, useEffect, useId, useRef
|
|
1
|
+
import React, { HTMLAttributes, ReactNode, useCallback, useEffect, useId, useRef } from 'react'
|
|
2
2
|
import { InputWrapper, StyledInput, StyledInputBorder, StyledInputContent, StyledLabel } from './styles'
|
|
3
3
|
|
|
4
4
|
export interface InputProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -70,11 +70,8 @@ export const Input: React.FC<InputProps> = ({
|
|
|
70
70
|
})
|
|
71
71
|
}, [])
|
|
72
72
|
|
|
73
|
-
const onClickHandler = (
|
|
74
|
-
|
|
75
|
-
if (element.tagName !== "INPUT") {
|
|
76
|
-
inputRef.current?.focus()
|
|
77
|
-
}
|
|
73
|
+
const onClickHandler = () => {
|
|
74
|
+
inputRef.current?.focus()
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
useEffect(() => {
|
|
@@ -117,11 +117,9 @@ export const InputTag: React.FC<InputProps> = ({
|
|
|
117
117
|
setTags(tags.filter(tag => tag !== tagToRemove))
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
const handleContainerClick = (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
inputRef.current?.focus()
|
|
124
|
-
}
|
|
120
|
+
const handleContainerClick = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
121
|
+
inputRef.current?.focus()
|
|
122
|
+
e.stopPropagation()
|
|
125
123
|
}
|
|
126
124
|
|
|
127
125
|
return (
|
|
@@ -25,7 +25,7 @@ export const Dropdown = styled.div<DropdownProps>`
|
|
|
25
25
|
|
|
26
26
|
background-color: ${theme.colors.white};
|
|
27
27
|
width: ${({ $dropDownWidth }) => ($dropDownWidth ? $dropDownWidth : '100%')};
|
|
28
|
-
${({ $dropDownTop }) => ($dropDownTop ? 'bottom:
|
|
28
|
+
${({ $dropDownTop }) => ($dropDownTop ? 'bottom: 58px;' : 'margin-top: 4px;')};
|
|
29
29
|
padding: 16px;
|
|
30
30
|
|
|
31
31
|
border-radius: 4px;
|
package/tsconfig.json
CHANGED
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"exclude": [
|
|
3
|
-
"node_modules",
|
|
4
|
-
"dist",
|
|
5
|
-
"./stories"
|
|
6
|
-
],
|
|
2
|
+
"exclude": ["node_modules", "dist", "./stories"],
|
|
7
3
|
"compilerOptions": {
|
|
8
4
|
"skipLibCheck": true,
|
|
9
5
|
"target": "es6",
|
|
10
6
|
"module": "esnext",
|
|
11
|
-
"lib": [
|
|
12
|
-
"es6",
|
|
13
|
-
"dom"
|
|
14
|
-
],
|
|
7
|
+
"lib": ["es6", "dom"],
|
|
15
8
|
"jsx": "react",
|
|
16
9
|
"declaration": true,
|
|
17
10
|
"declarationMap": true,
|
|
18
11
|
"sourceMap": true,
|
|
19
12
|
"outDir": "./dist",
|
|
20
|
-
"rootDirs": [
|
|
21
|
-
"./src",
|
|
22
|
-
"./stories"
|
|
23
|
-
],
|
|
13
|
+
"rootDirs": ["./src", "./stories"],
|
|
24
14
|
"moduleResolution": "node",
|
|
25
15
|
"allowSyntheticDefaultImports": true,
|
|
26
16
|
"esModuleInterop": true,
|
|
@@ -29,10 +19,7 @@
|
|
|
29
19
|
"strict": true,
|
|
30
20
|
"noFallthroughCasesInSwitch": true,
|
|
31
21
|
"resolveJsonModule": true,
|
|
32
|
-
"isolatedModules": true
|
|
33
|
-
|
|
22
|
+
"isolatedModules": true
|
|
34
23
|
},
|
|
35
|
-
"include": [
|
|
36
|
-
"src"
|
|
37
|
-
]
|
|
24
|
+
"include": ["src"]
|
|
38
25
|
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// vite.config.ts
|
|
2
|
+
import { defineConfig } from 'vite'
|
|
3
|
+
import react from '@vitejs/plugin-react'
|
|
4
|
+
import path from 'path'
|
|
5
|
+
import dts from 'vite-plugin-dts'
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
plugins: [react(), dts({ include: ['src'] })],
|
|
9
|
+
build: {
|
|
10
|
+
lib: {
|
|
11
|
+
entry: path.resolve(__dirname, 'src/index.tsx'),
|
|
12
|
+
name: 'WDesignSystem',
|
|
13
|
+
fileName: format => `w-design-system.${format}.js`,
|
|
14
|
+
},
|
|
15
|
+
rollupOptions: {
|
|
16
|
+
external: ['react', 'react-dom', 'styled-components'],
|
|
17
|
+
output: {
|
|
18
|
+
globals: {
|
|
19
|
+
react: 'React',
|
|
20
|
+
'react-dom': 'ReactDOM',
|
|
21
|
+
'styled-components': 'styled',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
resolve: {
|
|
27
|
+
alias: {
|
|
28
|
+
'@': path.resolve(__dirname, 'src'),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
})
|
package/.babelrc
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { default as alertSVG } from './alert.svg';
|
|
2
|
-
import { default as appsSVG } from './apps.svg';
|
|
3
|
-
import { default as bellSVG } from './bel.svg';
|
|
4
|
-
import { default as bindSVG } from './bind.svg';
|
|
5
|
-
import { default as bookmarkSVG } from './bookmark.svg';
|
|
6
|
-
import { default as calendarSVG } from './calendar.svg';
|
|
7
|
-
import { default as checkSVG } from './check.svg';
|
|
8
|
-
import { default as chevronDownSVG } from './chevron-down.svg';
|
|
9
|
-
import { default as chevronLeftSVG } from './chevron-left.svg';
|
|
10
|
-
import { default as chevronRightSVG } from './chevron-right.svg';
|
|
11
|
-
import { default as closeSVG } from './close.svg';
|
|
12
|
-
import { default as coinsSVG } from './coins.svg';
|
|
13
|
-
import { default as commentSVG } from './comment.svg';
|
|
14
|
-
import { default as dashboardSVG } from './dashboard.svg';
|
|
15
|
-
import { default as docCheckSVG } from './doc-check.svg';
|
|
16
|
-
import { default as docDownloadSVG } from './doc-download.svg';
|
|
17
|
-
import { default as docUploadSVG } from './doc-upload.svg';
|
|
18
|
-
import { default as docSVG } from './doc.svg';
|
|
19
|
-
import { default as dumpSVG } from './dump.svg';
|
|
20
|
-
import { default as editSVG } from './edit.svg';
|
|
21
|
-
import { default as editalSVG } from './edital.svg';
|
|
22
|
-
import { default as eyesSVG } from './eyes.svg';
|
|
23
|
-
import { default as fileSVG } from './file.svg';
|
|
24
|
-
import { default as financeSVG } from './finance.svg';
|
|
25
|
-
import { default as gavelSVG } from './gavel.svg';
|
|
26
|
-
import { default as gearSVG } from './gear.svg';
|
|
27
|
-
import { default as grid2PlusSVG } from './grid-2-plus.svg';
|
|
28
|
-
import { default as imageSVG } from './image.svg';
|
|
29
|
-
import { default as lockSVG } from './lock.svg';
|
|
30
|
-
import { default as moneySVG } from './money.svg';
|
|
31
|
-
import { default as monitoringSVG } from './monitoring.svg';
|
|
32
|
-
import { default as orderSVG } from './order.svg';
|
|
33
|
-
import { default as portalSVG } from './portal.svg';
|
|
34
|
-
import { default as settingSVG } from './seting.svg';
|
|
35
|
-
import { default as spinSVG } from './spin.svg';
|
|
36
|
-
import { default as spreadsheetSVG } from './spreadsheet.svg';
|
|
37
|
-
import { default as wavePulseSVG } from './wave-pulse.svg';
|
|
38
|
-
import { default as logoWaveGrayPNG } from './logoWaveGray.png';
|
|
39
|
-
import { default as addSVG } from './add.svg';
|
|
40
|
-
export { alertSVG, appsSVG, bellSVG, bindSVG, bookmarkSVG, calendarSVG, checkSVG, chevronDownSVG, chevronLeftSVG, chevronRightSVG, closeSVG, coinsSVG, commentSVG, dashboardSVG, docCheckSVG, docDownloadSVG, docSVG, docUploadSVG, dumpSVG, editalSVG, editSVG, eyesSVG, fileSVG, financeSVG, gavelSVG, gearSVG, grid2PlusSVG, imageSVG, lockSVG, moneySVG, monitoringSVG, orderSVG, portalSVG, settingSVG, spinSVG, spreadsheetSVG, wavePulseSVG, logoWaveGrayPNG, addSVG };
|
|
41
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/assets/icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,i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M,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,WAAW,EACX,WAAW,EACX,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,MAAM,EACN,YAAY,EACZ,OAAO,EACP,SAAS,EACT,OAAO,EACP,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,SAAS,EACT,UAAU,EACV,OAAO,EACP,cAAc,EACd,YAAY,EACZ,eAAe,EACf,MAAM,EACP,CAAA"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { BannerStyled } from './styles';
|
|
14
|
-
import { docCheckSVG, alertSVG, commentSVG, closeSVG } from '../../assets/icon';
|
|
15
|
-
import { IconWrapper } from '../IconWrapper';
|
|
16
|
-
import { Paragraph } from '../Paragraph';
|
|
17
|
-
import { theme } from '../Themes';
|
|
18
|
-
const { colors: { cyan40, mint40, honey40, red40, shade40, shade30 }, } = theme;
|
|
19
|
-
export const Banner = (_a) => {
|
|
20
|
-
var { title, onClick, variant, subTitle } = _a, props = __rest(_a, ["title", "onClick", "variant", "subTitle"]);
|
|
21
|
-
const searchIcon = () => {
|
|
22
|
-
switch (variant) {
|
|
23
|
-
case 'notice':
|
|
24
|
-
return { icon: commentSVG, color: cyan40 };
|
|
25
|
-
case 'success':
|
|
26
|
-
return { icon: docCheckSVG, color: mint40 };
|
|
27
|
-
case 'warning':
|
|
28
|
-
return { icon: alertSVG, color: honey40 };
|
|
29
|
-
case 'danger':
|
|
30
|
-
return { icon: alertSVG, color: red40 };
|
|
31
|
-
default:
|
|
32
|
-
return { icon: commentSVG, color: cyan40 };
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
const { icon, color } = searchIcon();
|
|
36
|
-
return (React.createElement(BannerStyled, Object.assign({ variant: variant }, props),
|
|
37
|
-
React.createElement("div", { className: 'bannerWrapper' },
|
|
38
|
-
React.createElement(IconWrapper, { src: icon, className: 'buttonRadiusWrapperIcon' }),
|
|
39
|
-
React.createElement("span", null,
|
|
40
|
-
React.createElement(Paragraph, { size: 'medium', color: color }, title),
|
|
41
|
-
subTitle && (React.createElement(Paragraph, { size: 'small', color: shade40 }, subTitle)))),
|
|
42
|
-
React.createElement(IconWrapper, { src: closeSVG, width: '14px', height: '14px', color: shade30, onClick: onClick })));
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Banner/index.tsx"],"names":[],"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,EAAE,CAAA;IAEpC,OAAO,CACL,oBAAC,YAAY,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK;QACvC,6BAAK,SAAS,EAAE,eAAe;YAC7B,oBAAC,WAAW,IAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,yBAAyB,GAAI;YAChE;gBACE,oBAAC,SAAS,IAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,IACpC,KAAK,CACI;gBACX,QAAQ,IAAI,CACX,oBAAC,SAAS,IAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,IACrC,QAAQ,CACC,CACb,CACI,CACH;QACN,oBAAC,WAAW,IAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAI,CAClF,CAChB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { VARIANTS_TYPES_BANNER } from '../../utils/constanst';
|
|
2
|
-
import { Banner } from './index';
|
|
3
|
-
const meta = {
|
|
4
|
-
title: 'Components/Banner',
|
|
5
|
-
component: Banner,
|
|
6
|
-
tags: ['autodocs'],
|
|
7
|
-
argTypes: {
|
|
8
|
-
variant: {
|
|
9
|
-
control: {
|
|
10
|
-
type: 'select',
|
|
11
|
-
options: VARIANTS_TYPES_BANNER,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
onClick: { action: 'clicked' },
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export default meta;
|
|
18
|
-
export const Playground = {
|
|
19
|
-
args: {
|
|
20
|
-
variant: 'success',
|
|
21
|
-
title: 'Sucesso!',
|
|
22
|
-
subTitle: 'Mensagem de sucesso.',
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/Banner/stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,MAAM,IAAI,GAAwB;IAChC,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,qBAAqB;aAC/B;SACF;QAED,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;KAC/B;CAC4B,CAAA;AAE/B,eAAe,IAAI,CAAA;AAGnB,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,sBAAsB;KACjC;CACF,CAAA"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
import { theme } from '../Themes';
|
|
3
|
-
const { colors } = theme;
|
|
4
|
-
const buttonRadiusWrapperIconStyles = (color) => css `
|
|
5
|
-
.buttonRadiusWrapperIcon {
|
|
6
|
-
svg {
|
|
7
|
-
fill: ${color};
|
|
8
|
-
path {
|
|
9
|
-
fill: ${color};
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
const colorScheme = {
|
|
15
|
-
notice: css `
|
|
16
|
-
background: ${colors.cyan10};
|
|
17
|
-
border-color: ${colors.cyan40};
|
|
18
|
-
${buttonRadiusWrapperIconStyles(colors.cyan40)};
|
|
19
|
-
`,
|
|
20
|
-
danger: css `
|
|
21
|
-
background: ${colors.red10};
|
|
22
|
-
border-color: ${colors.red40};
|
|
23
|
-
${buttonRadiusWrapperIconStyles(colors.red40)};
|
|
24
|
-
`,
|
|
25
|
-
warning: css `
|
|
26
|
-
background: ${colors.honey10};
|
|
27
|
-
border-color: ${colors.honey40};
|
|
28
|
-
${buttonRadiusWrapperIconStyles(colors.honey40)};
|
|
29
|
-
`,
|
|
30
|
-
success: css `
|
|
31
|
-
background: ${colors.mint10};
|
|
32
|
-
border-color: ${colors.mint40};
|
|
33
|
-
${buttonRadiusWrapperIconStyles(colors.mint40)};
|
|
34
|
-
`,
|
|
35
|
-
};
|
|
36
|
-
export const BannerStyled = styled.div `
|
|
37
|
-
display: flex;
|
|
38
|
-
box-sizing: border-box;
|
|
39
|
-
justify-content: space-between;
|
|
40
|
-
align-items: center;
|
|
41
|
-
width: 100%;
|
|
42
|
-
height: 100%;
|
|
43
|
-
max-height: 100px;
|
|
44
|
-
min-height: 56px;
|
|
45
|
-
padding: 12px 24px;
|
|
46
|
-
border-radius: 16px;
|
|
47
|
-
border: 1px dashed;
|
|
48
|
-
${({ variant = 'notice' }) => colorScheme[variant]};
|
|
49
|
-
|
|
50
|
-
.bannerWrapper {
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
gap: 12px;
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Banner/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAIjC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;AACxB,MAAM,6BAA6B,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,CAAA;;;cAG9C,KAAK;;gBAEH,KAAK;;;;CAIpB,CAAA;AACD,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,GAAG,CAAA;kBACK,MAAM,CAAC,MAAM;oBACX,MAAM,CAAC,MAAM;MAC3B,6BAA6B,CAAC,MAAM,CAAC,MAAM,CAAC;GAC/C;IACD,MAAM,EAAE,GAAG,CAAA;kBACK,MAAM,CAAC,KAAK;oBACV,MAAM,CAAC,KAAK;MAC1B,6BAA6B,CAAC,MAAM,CAAC,KAAK,CAAC;GAC9C;IACD,OAAO,EAAE,GAAG,CAAA;kBACI,MAAM,CAAC,OAAO;oBACZ,MAAM,CAAC,OAAO;MAC5B,6BAA6B,CAAC,MAAM,CAAC,OAAO,CAAC;GAChD;IACD,OAAO,EAAE,GAAG,CAAA;kBACI,MAAM,CAAC,MAAM;oBACX,MAAM,CAAC,MAAM;MAC3B,6BAA6B,CAAC,MAAM,CAAC,MAAM,CAAC;GAC/C;CACO,CAAA;AAEV,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAa;;;;;;;;;;;;IAY/C,CAAC,EAAE,OAAO,GAAG,QAAQ,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;;;;;;CAOnD,CAAA"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { IconWrapper } from '../IconWrapper';
|
|
14
|
-
import { ButtonStyled } from './styles';
|
|
15
|
-
import { spinSVG } from '../../assets/icon';
|
|
16
|
-
import { theme } from '../Themes';
|
|
17
|
-
const { colors } = theme;
|
|
18
|
-
const handleColorLoading = ({ variant, outline }) => {
|
|
19
|
-
if (outline) {
|
|
20
|
-
if (variant === 'primary') {
|
|
21
|
-
return colors.cyan50;
|
|
22
|
-
}
|
|
23
|
-
if (variant === 'secondary') {
|
|
24
|
-
return colors.cyan30;
|
|
25
|
-
}
|
|
26
|
-
if (variant === 'danger') {
|
|
27
|
-
return colors.red40;
|
|
28
|
-
}
|
|
29
|
-
if (variant === 'warning') {
|
|
30
|
-
return colors.honey30;
|
|
31
|
-
}
|
|
32
|
-
if (variant === 'gray') {
|
|
33
|
-
return colors.shade30;
|
|
34
|
-
}
|
|
35
|
-
if (variant === 'success') {
|
|
36
|
-
return colors.mint40;
|
|
37
|
-
}
|
|
38
|
-
if (variant === 'yellow') {
|
|
39
|
-
return colors.yellow30;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
if (variant === 'primary') {
|
|
43
|
-
return 'white';
|
|
44
|
-
}
|
|
45
|
-
if (variant === 'primary') {
|
|
46
|
-
return colors.cyan50;
|
|
47
|
-
}
|
|
48
|
-
if (variant === 'warning') {
|
|
49
|
-
return colors.honey30;
|
|
50
|
-
}
|
|
51
|
-
if (variant === 'gray') {
|
|
52
|
-
return colors.shade40;
|
|
53
|
-
}
|
|
54
|
-
if (variant === 'yellow') {
|
|
55
|
-
return colors.yellow30;
|
|
56
|
-
}
|
|
57
|
-
return 'white';
|
|
58
|
-
};
|
|
59
|
-
export const Button = (_a) => {
|
|
60
|
-
var { variant = 'primary', children, disabled = false, icon, radius, outline, halfLeft, halfRight, fullWidth, size, loading } = _a, props = __rest(_a, ["variant", "children", "disabled", "icon", "radius", "outline", "halfLeft", "halfRight", "fullWidth", "size", "loading"]);
|
|
61
|
-
return (React.createElement(ButtonStyled, Object.assign({ variant: variant, disabled: disabled, radius: radius, outline: outline, halfLeft: halfLeft, halfRight: halfRight, fullWidth: fullWidth, size: size }, props),
|
|
62
|
-
loading && React.createElement(IconWrapper, { src: spinSVG, loading: true, color: handleColorLoading({ variant, outline }) }),
|
|
63
|
-
icon && (React.createElement(IconWrapper, { src: icon, color: 'white', className: 'buttonRadiusWrapperIcon', width: size !== 'large' ? '20px' : '24px', height: size !== 'large' ? '20px' : '24px' })),
|
|
64
|
-
children));
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AACjC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;AAExB,MAAM,kBAAkB,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAO,EAAE,EAAE;IACvD,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC,MAAM,CAAA;QACtB,CAAC;QACD,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;YAC5B,OAAO,MAAM,CAAC,MAAM,CAAA;QACtB,CAAC;QACD,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;YACzB,OAAO,MAAM,CAAC,KAAK,CAAA;QACrB,CAAC;QACD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC,OAAO,CAAA;QACvB,CAAC;QACD,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC,OAAO,CAAA;QACvB,CAAC;QACD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YA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AAO,EAAE,OAAO,EAAE,CAAC,GAAI;QACjG,IAAI,IAAI,CACP,oBAAC,WAAW,IACV,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,yBAAyB,EACpC,KAAK,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EACzC,MAAM,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAC1C,CACH;QACA,QAAQ,CACI,CAChB,CAAA;CAAA,CAAA"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import exampleIcon from '../../assets/icon/image.svg';
|
|
2
|
-
import { Button } from './index';
|
|
3
|
-
import { VARIANTS_TYPES } from '../../utils/constanst';
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Components/Button',
|
|
6
|
-
component: Button,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
argTypes: {
|
|
9
|
-
variant: {
|
|
10
|
-
control: {
|
|
11
|
-
type: 'select',
|
|
12
|
-
options: VARIANTS_TYPES,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
disabled: {
|
|
16
|
-
control: 'boolean',
|
|
17
|
-
},
|
|
18
|
-
icon: {
|
|
19
|
-
control: 'object',
|
|
20
|
-
options: [exampleIcon],
|
|
21
|
-
description: exampleIcon,
|
|
22
|
-
},
|
|
23
|
-
onClick: { action: 'clicked' },
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
export default meta;
|
|
27
|
-
export const Playground = {
|
|
28
|
-
args: {
|
|
29
|
-
variant: 'primary',
|
|
30
|
-
children: 'ButtonPlayground',
|
|
31
|
-
disabled: false,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
export const ButtonDefault = {
|
|
35
|
-
args: {
|
|
36
|
-
variant: 'secondary',
|
|
37
|
-
children: 'ButtonPlayground',
|
|
38
|
-
disabled: false,
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
export const ButtonOutilne = {
|
|
42
|
-
args: {
|
|
43
|
-
variant: 'secondary',
|
|
44
|
-
children: 'ButtonPlayground',
|
|
45
|
-
disabled: false,
|
|
46
|
-
outline: true,
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
export const ButtonRadius = {
|
|
50
|
-
args: {
|
|
51
|
-
variant: 'success',
|
|
52
|
-
children: 'ButtonPlayground',
|
|
53
|
-
disabled: false,
|
|
54
|
-
radius: true,
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
export const ButtonDisabled = {
|
|
58
|
-
args: {
|
|
59
|
-
variant: 'danger',
|
|
60
|
-
children: 'ButtonPlayground',
|
|
61
|
-
disabled: true,
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
export const ButtonIcon = {
|
|
65
|
-
args: {
|
|
66
|
-
variant: 'primary',
|
|
67
|
-
children: 'ButtonPlayground',
|
|
68
|
-
icon: exampleIcon,
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
export const ButtonIconHalfRightOutiline = {
|
|
72
|
-
args: {
|
|
73
|
-
variant: 'success',
|
|
74
|
-
children: 'ButtonPlayground',
|
|
75
|
-
icon: exampleIcon,
|
|
76
|
-
halfRight: true,
|
|
77
|
-
outline: true,
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
export const ButtonIconHalfLeft = {
|
|
81
|
-
args: {
|
|
82
|
-
variant: 'success',
|
|
83
|
-
children: 'ButtonPlayground',
|
|
84
|
-
icon: exampleIcon,
|
|
85
|
-
halfLeft: true,
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/Button/stories.tsx"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,C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