@bitrise/bitkit 9.3.1 → 9.4.1-alpha.2
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/.eslintrc.js +9 -2
- package/.storybook/main.js +35 -0
- package/.storybook/preview.js +20 -0
- package/.stylelintignore +1 -0
- package/.stylelintrc +2 -3
- package/CHANGELOG.md +11 -0
- package/jest.setup.js +1 -1
- package/lib/cjs/Dropdown/DropdownMenu.css +1 -1
- package/lib/cjs/Toggle/Toggle.css +19 -0
- package/lib/cjs/Toggle/Toggle.d.ts +2 -0
- package/lib/cjs/Toggle/Toggle.d.ts.map +1 -1
- package/lib/cjs/Toggle/Toggle.js +8 -4
- package/lib/cjs/Toggle/Toggle.js.map +1 -1
- package/lib/cjs/chakra/BitkitProvider.d.ts +5 -0
- package/lib/cjs/chakra/BitkitProvider.d.ts.map +1 -0
- package/lib/cjs/chakra/BitkitProvider.js +14 -0
- package/lib/cjs/chakra/BitkitProvider.js.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.d.ts +22 -0
- package/lib/cjs/chakra/components/Button/Button.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.js +61 -0
- package/lib/cjs/chakra/components/Button/Button.js.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.stories.d.ts +6 -0
- package/lib/cjs/chakra/components/Button/Button.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.stories.js +37 -0
- package/lib/cjs/chakra/components/Button/Button.stories.js.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.theme.d.ts +117 -0
- package/lib/cjs/chakra/components/Button/Button.theme.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Button/Button.theme.js +119 -0
- package/lib/cjs/chakra/components/Button/Button.theme.js.map +1 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.d.ts +14 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.d.ts.map +1 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.js +41 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.js.map +1 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts +6 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.js +48 -0
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.js.map +1 -0
- package/lib/cjs/chakra/components/Link/Link.d.ts +16 -0
- package/lib/cjs/chakra/components/Link/Link.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Link/Link.js +44 -0
- package/lib/cjs/chakra/components/Link/Link.js.map +1 -0
- package/lib/cjs/chakra/components/Link/Link.stories.d.ts +12 -0
- package/lib/cjs/chakra/components/Link/Link.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Link/Link.stories.js +42 -0
- package/lib/cjs/chakra/components/Link/Link.stories.js.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.d.ts +6 -0
- package/lib/cjs/chakra/components/Menu/Menu.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.js +21 -0
- package/lib/cjs/chakra/components/Menu/Menu.js.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts +9 -0
- package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.stories.js +48 -0
- package/lib/cjs/chakra/components/Menu/Menu.stories.js.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts +4 -0
- package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Menu/Menu.theme.js +23 -0
- package/lib/cjs/chakra/components/Menu/Menu.theme.js.map +1 -0
- package/lib/cjs/chakra/components/Menu/MenuItem.d.ts +12 -0
- package/lib/cjs/chakra/components/Menu/MenuItem.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Menu/MenuItem.js +39 -0
- package/lib/cjs/chakra/components/Menu/MenuItem.js.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts +16 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.js +36 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.js.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts +13 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js +44 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts +45 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts.map +1 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js +47 -0
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js.map +1 -0
- package/lib/cjs/chakra/components/Text/Text.d.ts +32 -0
- package/lib/cjs/chakra/components/Text/Text.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Text/Text.js +38 -0
- package/lib/cjs/chakra/components/Text/Text.js.map +1 -0
- package/lib/cjs/chakra/components/Text/Text.stories.d.ts +12 -0
- package/lib/cjs/chakra/components/Text/Text.stories.d.ts.map +1 -0
- package/lib/cjs/chakra/components/Text/Text.stories.js +42 -0
- package/lib/cjs/chakra/components/Text/Text.stories.js.map +1 -0
- package/lib/cjs/chakra/shared.d.ts +2 -0
- package/lib/cjs/chakra/shared.d.ts.map +1 -0
- package/lib/cjs/chakra/shared.js +15 -0
- package/lib/cjs/chakra/shared.js.map +1 -0
- package/lib/cjs/chakra/theme/theme.d.ts +3 -0
- package/lib/cjs/chakra/theme/theme.d.ts.map +1 -0
- package/lib/cjs/chakra/theme/theme.js +54 -0
- package/lib/cjs/chakra/theme/theme.js.map +1 -0
- package/lib/cjs/chakra/theme/typographyConfig.d.ts +4 -0
- package/lib/cjs/chakra/theme/typographyConfig.d.ts.map +1 -0
- package/lib/cjs/chakra/theme/typographyConfig.js +38 -0
- package/lib/cjs/chakra/theme/typographyConfig.js.map +1 -0
- package/lib/cjs/index.d.ts +9 -0
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +20 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esn/Dropdown/DropdownMenu.css +1 -1
- package/lib/esn/Toggle/Toggle.css +19 -0
- package/lib/esn/Toggle/Toggle.d.ts +2 -0
- package/lib/esn/Toggle/Toggle.d.ts.map +1 -1
- package/lib/esn/Toggle/Toggle.js +8 -4
- package/lib/esn/Toggle/Toggle.js.map +1 -1
- package/lib/esn/chakra/BitkitProvider.d.ts +5 -0
- package/lib/esn/chakra/BitkitProvider.d.ts.map +1 -0
- package/lib/esn/chakra/BitkitProvider.js +8 -0
- package/lib/esn/chakra/BitkitProvider.js.map +1 -0
- package/lib/esn/chakra/components/Button/Button.d.ts +22 -0
- package/lib/esn/chakra/components/Button/Button.d.ts.map +1 -0
- package/lib/esn/chakra/components/Button/Button.js +34 -0
- package/lib/esn/chakra/components/Button/Button.js.map +1 -0
- package/lib/esn/chakra/components/Button/Button.stories.d.ts +6 -0
- package/lib/esn/chakra/components/Button/Button.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/Button/Button.stories.js +29 -0
- package/lib/esn/chakra/components/Button/Button.stories.js.map +1 -0
- package/lib/esn/chakra/components/Button/Button.theme.d.ts +117 -0
- package/lib/esn/chakra/components/Button/Button.theme.d.ts.map +1 -0
- package/lib/esn/chakra/components/Button/Button.theme.js +117 -0
- package/lib/esn/chakra/components/Button/Button.theme.js.map +1 -0
- package/lib/esn/chakra/components/IconButton/IconButton.d.ts +14 -0
- package/lib/esn/chakra/components/IconButton/IconButton.d.ts.map +1 -0
- package/lib/esn/chakra/components/IconButton/IconButton.js +18 -0
- package/lib/esn/chakra/components/IconButton/IconButton.js.map +1 -0
- package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts +6 -0
- package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/IconButton/IconButton.stories.js +21 -0
- package/lib/esn/chakra/components/IconButton/IconButton.stories.js.map +1 -0
- package/lib/esn/chakra/components/Link/Link.d.ts +16 -0
- package/lib/esn/chakra/components/Link/Link.d.ts.map +1 -0
- package/lib/esn/chakra/components/Link/Link.js +17 -0
- package/lib/esn/chakra/components/Link/Link.js.map +1 -0
- package/lib/esn/chakra/components/Link/Link.stories.d.ts +12 -0
- package/lib/esn/chakra/components/Link/Link.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/Link/Link.stories.js +16 -0
- package/lib/esn/chakra/components/Link/Link.stories.js.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.d.ts +6 -0
- package/lib/esn/chakra/components/Menu/Menu.d.ts.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.js +5 -0
- package/lib/esn/chakra/components/Menu/Menu.js.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.stories.d.ts +9 -0
- package/lib/esn/chakra/components/Menu/Menu.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.stories.js +39 -0
- package/lib/esn/chakra/components/Menu/Menu.stories.js.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.theme.d.ts +4 -0
- package/lib/esn/chakra/components/Menu/Menu.theme.d.ts.map +1 -0
- package/lib/esn/chakra/components/Menu/Menu.theme.js +21 -0
- package/lib/esn/chakra/components/Menu/Menu.theme.js.map +1 -0
- package/lib/esn/chakra/components/Menu/MenuItem.d.ts +12 -0
- package/lib/esn/chakra/components/Menu/MenuItem.d.ts.map +1 -0
- package/lib/esn/chakra/components/Menu/MenuItem.js +12 -0
- package/lib/esn/chakra/components/Menu/MenuItem.js.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts +16 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.js +30 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.js.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts +13 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js +16 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts +45 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts.map +1 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js +45 -0
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js.map +1 -0
- package/lib/esn/chakra/components/Text/Text.d.ts +32 -0
- package/lib/esn/chakra/components/Text/Text.d.ts.map +1 -0
- package/lib/esn/chakra/components/Text/Text.js +22 -0
- package/lib/esn/chakra/components/Text/Text.js.map +1 -0
- package/lib/esn/chakra/components/Text/Text.stories.d.ts +12 -0
- package/lib/esn/chakra/components/Text/Text.stories.d.ts.map +1 -0
- package/lib/esn/chakra/components/Text/Text.stories.js +19 -0
- package/lib/esn/chakra/components/Text/Text.stories.js.map +1 -0
- package/lib/esn/chakra/shared.d.ts +2 -0
- package/lib/esn/chakra/shared.d.ts.map +1 -0
- package/lib/esn/chakra/shared.js +11 -0
- package/lib/esn/chakra/shared.js.map +1 -0
- package/lib/esn/chakra/theme/theme.d.ts +3 -0
- package/lib/esn/chakra/theme/theme.d.ts.map +1 -0
- package/lib/esn/chakra/theme/theme.js +49 -0
- package/lib/esn/chakra/theme/theme.js.map +1 -0
- package/lib/esn/chakra/theme/typographyConfig.d.ts +4 -0
- package/lib/esn/chakra/theme/typographyConfig.d.ts.map +1 -0
- package/lib/esn/chakra/theme/typographyConfig.js +36 -0
- package/lib/esn/chakra/theme/typographyConfig.js.map +1 -0
- package/lib/esn/index.d.ts +9 -0
- package/lib/esn/index.d.ts.map +1 -1
- package/lib/esn/index.js +9 -0
- package/lib/esn/index.js.map +1 -1
- package/lib/esn/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -21
- package/site/components/Documentation/Components/SectionToggle.tsx +12 -0
- package/src/Dropdown/DropdownMenu.css +1 -1
- package/src/Toggle/Toggle.css +19 -0
- package/src/Toggle/Toggle.tsx +18 -3
- package/src/chakra/BitkitProvider.tsx +9 -0
- package/src/chakra/components/Button/Button.stories.tsx +32 -0
- package/src/chakra/components/Button/Button.theme.ts +117 -0
- package/src/chakra/components/Button/Button.tsx +52 -0
- package/src/chakra/components/IconButton/IconButton.stories.tsx +24 -0
- package/src/chakra/components/IconButton/IconButton.tsx +29 -0
- package/src/chakra/components/Link/Link.stories.tsx +19 -0
- package/src/chakra/components/Link/Link.tsx +30 -0
- package/src/chakra/components/Menu/Menu.stories.tsx +57 -0
- package/src/chakra/components/Menu/Menu.theme.ts +23 -0
- package/src/chakra/components/Menu/Menu.tsx +8 -0
- package/src/chakra/components/Menu/MenuItem.tsx +20 -0
- package/src/chakra/components/StatusTag/StatusTag.stories.tsx +19 -0
- package/src/chakra/components/StatusTag/StatusTag.theme.ts +45 -0
- package/src/chakra/components/StatusTag/StatusTag.tsx +55 -0
- package/src/chakra/components/Text/Text.stories.tsx +22 -0
- package/src/chakra/components/Text/Text.tsx +73 -0
- package/src/chakra/shared.ts +11 -0
- package/src/chakra/theme/theme.ts +50 -0
- package/src/chakra/theme/typographyConfig.ts +38 -0
- package/src/index.ts +10 -0
- package/tsconfig.json +5 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrise/bitkit",
|
|
3
3
|
"description": "Bitrise React component library",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.4.1-alpha.2",
|
|
5
5
|
"repository": "git@github.com:bitrise-io/bitkit.git",
|
|
6
6
|
"main": "lib/cjs/index.js",
|
|
7
7
|
"esnext": "lib/esn/index.js",
|
|
@@ -27,34 +27,50 @@
|
|
|
27
27
|
"start:docs": "ts-node ./scripts/build-docs-watch",
|
|
28
28
|
"start:site": "parcel serve site/index.html --port 4001 -d dist --no-cache",
|
|
29
29
|
"start:icons": "chokidar src/Icon/svg/** -c \"yarn svgr {path} && yarn lint:fix-icons\"",
|
|
30
|
-
"test": "jest ./src"
|
|
30
|
+
"test": "jest ./src",
|
|
31
|
+
"storybook": "start-storybook -p 6006",
|
|
32
|
+
"build-storybook": "build-storybook"
|
|
31
33
|
},
|
|
32
34
|
"alias": {
|
|
33
|
-
"@bitrise/bitkit": "./src"
|
|
35
|
+
"@bitrise/bitkit": "./src",
|
|
36
|
+
"framer-motion": "./node_modules/framer-motion/dist/cjs"
|
|
34
37
|
},
|
|
35
38
|
"dependencies": {
|
|
39
|
+
"@chakra-ui/react": "^1.8.6",
|
|
40
|
+
"@emotion/react": "^11",
|
|
41
|
+
"@emotion/styled": "^11",
|
|
36
42
|
"@juggle/resize-observer": "^3.3.1",
|
|
37
43
|
"classnames": "^2.3.1",
|
|
38
44
|
"clipboard": "^2.0.10",
|
|
39
|
-
"
|
|
45
|
+
"framer-motion": "^6",
|
|
46
|
+
"luxon": "^2.3.1",
|
|
40
47
|
"normalize.css": "^8.0.1",
|
|
41
48
|
"popper.js": "^1.14.4",
|
|
42
|
-
"react": "^
|
|
43
|
-
"react-dom": "^
|
|
49
|
+
"react": "^17.0.2",
|
|
50
|
+
"react-dom": "^17.0.2",
|
|
44
51
|
"react-popper": "^1.3.11",
|
|
45
|
-
"react-transition-group": "^
|
|
52
|
+
"react-transition-group": "^4.4.2"
|
|
46
53
|
},
|
|
47
54
|
"peerDependencies": {
|
|
48
|
-
"react": "^
|
|
49
|
-
"react-dom": "^
|
|
55
|
+
"react": "^17.0.2",
|
|
56
|
+
"react-dom": "^17.0.2"
|
|
50
57
|
},
|
|
51
58
|
"devDependencies": {
|
|
59
|
+
"@babel/core": "^7.17.8",
|
|
52
60
|
"@bitrise/eslint-plugin": "^2.1.0",
|
|
53
61
|
"@commitlint/cli": "^8.3.6",
|
|
54
62
|
"@commitlint/config-conventional": "^8.3.6",
|
|
55
63
|
"@semantic-release/changelog": "^6.0.1",
|
|
56
64
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
57
65
|
"@semantic-release/git": "^10.0.1",
|
|
66
|
+
"@storybook/addon-actions": "^6.4.19",
|
|
67
|
+
"@storybook/addon-essentials": "^6.4.19",
|
|
68
|
+
"@storybook/addon-interactions": "^6.4.19",
|
|
69
|
+
"@storybook/addon-links": "^6.4.19",
|
|
70
|
+
"@storybook/builder-webpack5": "^6.4.19",
|
|
71
|
+
"@storybook/manager-webpack5": "^6.4.19",
|
|
72
|
+
"@storybook/react": "^6.4.19",
|
|
73
|
+
"@storybook/testing-library": "^0.0.9",
|
|
58
74
|
"@svgr/cli": "^6.2.1",
|
|
59
75
|
"@types/cheerio": "^0.22.31",
|
|
60
76
|
"@types/clipboard": "^2.0.1",
|
|
@@ -62,30 +78,33 @@
|
|
|
62
78
|
"@types/jest": "^27.4.1",
|
|
63
79
|
"@types/lodash.sample": "^4.2.6",
|
|
64
80
|
"@types/lodash.shuffle": "^4.2.6",
|
|
65
|
-
"@types/luxon": "^
|
|
81
|
+
"@types/luxon": "^2.3.1",
|
|
66
82
|
"@types/prismjs": "^1.26.0",
|
|
67
|
-
"@types/react": "
|
|
68
|
-
"@types/react-dom": "^17.0.
|
|
83
|
+
"@types/react": "17.0.40",
|
|
84
|
+
"@types/react-dom": "^17.0.14",
|
|
69
85
|
"@types/react-router": "^5.1.18",
|
|
70
86
|
"@types/react-router-dom": "^5.3.3",
|
|
71
|
-
"@types/react-transition-group": "^
|
|
87
|
+
"@types/react-transition-group": "^4.4.4",
|
|
72
88
|
"@types/vfile-message": "^2.0.0",
|
|
73
89
|
"@typescript-eslint/eslint-plugin": "^5.15.0",
|
|
74
90
|
"@typescript-eslint/parser": "^5.15.0",
|
|
75
|
-
"
|
|
91
|
+
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
|
|
92
|
+
"autoprefixer": "^9",
|
|
76
93
|
"babel-eslint": "^10.0.1",
|
|
94
|
+
"babel-loader": "^8.2.3",
|
|
77
95
|
"chokidar-cli": "^3.0.0",
|
|
78
96
|
"concurrently": "^4.1.2",
|
|
97
|
+
"csstype": "3.0.9",
|
|
79
98
|
"enzyme": "^3.11.0",
|
|
80
|
-
"enzyme-adapter-react-16": "^1.15.6",
|
|
81
99
|
"enzyme-to-json": "^3.6.2",
|
|
82
100
|
"eslint": "^8.11.0",
|
|
83
101
|
"eslint-plugin-import": "^2.25.4",
|
|
84
|
-
"eslint-plugin-jest": "^26.1.
|
|
102
|
+
"eslint-plugin-jest": "^26.1.2",
|
|
85
103
|
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
86
104
|
"eslint-plugin-prettier": "^4.0.0",
|
|
87
105
|
"eslint-plugin-react": "^7.29.4",
|
|
88
106
|
"eslint-plugin-react-hooks": "^4.3.0",
|
|
107
|
+
"eslint-plugin-storybook": "^0.5.7",
|
|
89
108
|
"eslint-plugin-testing-library": "^5.1.0",
|
|
90
109
|
"fscreen": "^1.2.0",
|
|
91
110
|
"husky": "^3.1.0",
|
|
@@ -100,16 +119,17 @@
|
|
|
100
119
|
"postcss-preset-env": "^6.7.1",
|
|
101
120
|
"prettier": "^2.6.0",
|
|
102
121
|
"prismjs": "^1.27.0",
|
|
103
|
-
"react-docgen": "5.4.0",
|
|
104
122
|
"react-router": "^5.2.1",
|
|
105
123
|
"react-router-dom": "^5.3.0",
|
|
106
124
|
"semantic-release": "^18.0.1",
|
|
107
|
-
"stylelint": "^
|
|
108
|
-
"stylelint-order": "^0.
|
|
109
|
-
"superstatic": "^
|
|
125
|
+
"stylelint": "^14.6.0",
|
|
126
|
+
"stylelint-order": "^5.0.0",
|
|
127
|
+
"superstatic": "^7.1.0",
|
|
110
128
|
"ts-jest": "^27.1.3",
|
|
111
129
|
"ts-node": "^10.7.0",
|
|
112
|
-
"
|
|
130
|
+
"tsconfig-paths-webpack-plugin": "^3.5.2",
|
|
131
|
+
"typescript": "^4.6.2",
|
|
132
|
+
"webpack": "^5.70.0"
|
|
113
133
|
},
|
|
114
134
|
"publishConfig": {
|
|
115
135
|
"access": "public"
|
|
@@ -129,5 +149,8 @@
|
|
|
129
149
|
"transform": {
|
|
130
150
|
"\\.tsx?$": "ts-jest"
|
|
131
151
|
}
|
|
152
|
+
},
|
|
153
|
+
"resolutions": {
|
|
154
|
+
"@types/react": "17.0.40"
|
|
132
155
|
}
|
|
133
156
|
}
|
|
@@ -22,6 +22,18 @@ const SectionToggle = () => {
|
|
|
22
22
|
<SectionSubTitle>Unchecked Toggle</SectionSubTitle>
|
|
23
23
|
<Toggle>Label</Toggle>
|
|
24
24
|
</Flex>
|
|
25
|
+
|
|
26
|
+
<Flex grow initial={match('896px') ? 'none' : 'content'}>
|
|
27
|
+
<SectionSubTitle>Disabled & checked Toggle</SectionSubTitle>
|
|
28
|
+
<Toggle defaultChecked disabled>
|
|
29
|
+
Label
|
|
30
|
+
</Toggle>
|
|
31
|
+
</Flex>
|
|
32
|
+
|
|
33
|
+
<Flex grow initial={match('896px') ? 'none' : 'content'}>
|
|
34
|
+
<SectionSubTitle>Disabled & unchecked Toggle</SectionSubTitle>
|
|
35
|
+
<Toggle disabled>Label</Toggle>
|
|
36
|
+
</Flex>
|
|
25
37
|
</Flex>
|
|
26
38
|
|
|
27
39
|
<CodeBlock title="Toggle usage example">{`const Component = () => (
|
package/src/Toggle/Toggle.css
CHANGED
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
--Toggle--border: 0.125rem;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
.Toggle__container--disabled {
|
|
7
|
+
cursor: not-allowed;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
.Toggle {
|
|
7
11
|
display: block;
|
|
8
12
|
position: relative;
|
|
9
13
|
width: calc(var(--Toggle--size) * 2);
|
|
10
14
|
height: var(--Toggle--size);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.Toggle__container:not(.Toggle__container--disabled) .Toggle {
|
|
11
18
|
cursor: pointer;
|
|
12
19
|
}
|
|
13
20
|
|
|
@@ -56,6 +63,10 @@
|
|
|
56
63
|
.Toggle__icon-left { left: var(--Toggle--border); }
|
|
57
64
|
.Toggle__icon-right { right: var(--Toggle--border); }
|
|
58
65
|
|
|
66
|
+
.Toggle__container--disabled .Toggle__control {
|
|
67
|
+
background-color: var(--color-gray--2);
|
|
68
|
+
}
|
|
69
|
+
|
|
59
70
|
.Toggle__input:checked + .Toggle__control {
|
|
60
71
|
background-color: var(--color-aqua--3);
|
|
61
72
|
|
|
@@ -63,3 +74,11 @@
|
|
|
63
74
|
transform: translate(calc(100% + (var(--Toggle--border) * 2)), -50%);
|
|
64
75
|
}
|
|
65
76
|
}
|
|
77
|
+
|
|
78
|
+
.Toggle__container--disabled .Toggle__input:checked + .Toggle__control {
|
|
79
|
+
background-color: var(--color-aqua--2);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.Toggle__container--disabled .Toggle__label {
|
|
83
|
+
opacity: 0.8;
|
|
84
|
+
}
|
package/src/Toggle/Toggle.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
2
3
|
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
3
4
|
import Icon from '../Icon/Icon';
|
|
4
5
|
import './Toggle.css';
|
|
@@ -10,16 +11,29 @@ export interface Props extends FlexProps {
|
|
|
10
11
|
defaultChecked?: boolean;
|
|
11
12
|
/** Handler for when the toggle state changes */
|
|
12
13
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
+
/** Applies styling to indicate the input is disabled */
|
|
15
|
+
disabled?: boolean;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* A slick styled toggle component.
|
|
17
20
|
*/
|
|
18
21
|
const Toggle: React.FunctionComponent<Props> = (props: Props) => {
|
|
19
|
-
const { checked, children, defaultChecked, onChange, ...rest } = props;
|
|
22
|
+
const { className, checked, children, defaultChecked, onChange, disabled, ...rest } = props;
|
|
23
|
+
|
|
24
|
+
const classes = classnames(className, 'Toggle__container', {
|
|
25
|
+
'Toggle__container--disabled': disabled,
|
|
26
|
+
});
|
|
20
27
|
|
|
21
28
|
return (
|
|
22
|
-
<Flex
|
|
29
|
+
<Flex
|
|
30
|
+
{...rest}
|
|
31
|
+
Component="label"
|
|
32
|
+
alignChildrenVertical="middle"
|
|
33
|
+
direction="horizontal"
|
|
34
|
+
gap="x2"
|
|
35
|
+
className={classes}
|
|
36
|
+
>
|
|
23
37
|
<Flex className="Toggle">
|
|
24
38
|
<input
|
|
25
39
|
checked={checked}
|
|
@@ -27,6 +41,7 @@ const Toggle: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
27
41
|
defaultChecked={defaultChecked}
|
|
28
42
|
onChange={onChange}
|
|
29
43
|
type="checkbox"
|
|
44
|
+
disabled={disabled}
|
|
30
45
|
/>
|
|
31
46
|
<Flex className="Toggle__control">
|
|
32
47
|
<span className="Toggle__icon-left">
|
|
@@ -42,7 +57,7 @@ const Toggle: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
42
57
|
</Flex>
|
|
43
58
|
|
|
44
59
|
{children && (
|
|
45
|
-
<Flex minWidth="0px" shrink>
|
|
60
|
+
<Flex minWidth="0px" shrink className="Toggle__label">
|
|
46
61
|
{children}
|
|
47
62
|
</Flex>
|
|
48
63
|
)}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChakraProvider, ChakraProviderProps } from '@chakra-ui/react';
|
|
3
|
+
import theme from './theme/theme';
|
|
4
|
+
|
|
5
|
+
const BitkitProvider = ({ children }: ChakraProviderProps) => {
|
|
6
|
+
return <ChakraProvider theme={theme}>{children}</ChakraProvider>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default BitkitProvider;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { sortObjectByKey } from '../../shared';
|
|
4
|
+
import { IconList } from '../../../Icon/tsx';
|
|
5
|
+
import Button from './Button';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/Button',
|
|
9
|
+
component: Button,
|
|
10
|
+
argTypes: {
|
|
11
|
+
leftIconName: {
|
|
12
|
+
options: IconList,
|
|
13
|
+
},
|
|
14
|
+
rightIconName: {
|
|
15
|
+
options: IconList,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
} as ComponentMeta<typeof Button>;
|
|
19
|
+
|
|
20
|
+
const Template: ComponentStory<typeof Button> = (props) => <Button {...props} />;
|
|
21
|
+
|
|
22
|
+
export const WithProps = Template.bind({});
|
|
23
|
+
WithProps.args = sortObjectByKey({
|
|
24
|
+
...Button.defaultProps,
|
|
25
|
+
as: 'button',
|
|
26
|
+
className: '',
|
|
27
|
+
isDisabled: false,
|
|
28
|
+
href: '',
|
|
29
|
+
target: '_self',
|
|
30
|
+
type: 'button',
|
|
31
|
+
children: 'Button',
|
|
32
|
+
});
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
const ButtonTheme = {
|
|
2
|
+
baseStyle: {
|
|
3
|
+
border: '1px solid',
|
|
4
|
+
borderRadius: 'base',
|
|
5
|
+
fontWeight: 'normal',
|
|
6
|
+
lineHeight: 3,
|
|
7
|
+
},
|
|
8
|
+
variants: {
|
|
9
|
+
primary: {
|
|
10
|
+
bgGradient: 'linear(to-b, #6C0EB2, #450674)',
|
|
11
|
+
borderColor: '#683D87',
|
|
12
|
+
color: '#F8F8F8',
|
|
13
|
+
fontWeight: 'bold',
|
|
14
|
+
_hover: {
|
|
15
|
+
bgGradient: 'linear(to-b, #50167B, #3D125D)',
|
|
16
|
+
_disabled: {
|
|
17
|
+
bgGradient: 'linear(to-b, #ccc, #ACACAC)',
|
|
18
|
+
borderColor: '#ACACAC',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
_active: {
|
|
22
|
+
bgGradient: 'linear(to-b, #351D48, #351D48)',
|
|
23
|
+
},
|
|
24
|
+
_disabled: {
|
|
25
|
+
bgGradient: 'linear(to-b, #ccc, #ACACAC)',
|
|
26
|
+
borderColor: '#ACACAC',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
secondary: {
|
|
30
|
+
bgGradient: 'linear(to-b, #f8f8f8, #fff)',
|
|
31
|
+
borderColor: '#ddd',
|
|
32
|
+
color: '#351D48',
|
|
33
|
+
_hover: {
|
|
34
|
+
bgGradient: 'linear(to-b, #ECECEC, #ECECEC)',
|
|
35
|
+
},
|
|
36
|
+
_active: {
|
|
37
|
+
bgGradient: 'linear(to-b, #351D48, #351D48)',
|
|
38
|
+
color: '#F8F8F8',
|
|
39
|
+
},
|
|
40
|
+
_disabled: {
|
|
41
|
+
color: '#ACACAC',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
tertiary: {
|
|
45
|
+
background: 'transparent',
|
|
46
|
+
borderColor: 'transparent',
|
|
47
|
+
color: '#760FC3',
|
|
48
|
+
_hover: {
|
|
49
|
+
background: '#F8F0FF',
|
|
50
|
+
},
|
|
51
|
+
_active: {
|
|
52
|
+
background: '#351D48',
|
|
53
|
+
color: '#F8F8F8',
|
|
54
|
+
},
|
|
55
|
+
_disabled: {
|
|
56
|
+
color: '#ACACAC',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
dangerPrimary: {
|
|
60
|
+
bgGradient: 'linear(to-b, #E41447, #FF2158)',
|
|
61
|
+
borderColor: '#D4093C',
|
|
62
|
+
color: '#fff',
|
|
63
|
+
fontWeight: 'bold',
|
|
64
|
+
_hover: {
|
|
65
|
+
bgGradient: 'linear(to-b, #C90032, #C90032)',
|
|
66
|
+
_disabled: {
|
|
67
|
+
bgGradient: 'linear(to-b, #ccc, #acacac)',
|
|
68
|
+
borderColor: '#ACACAC',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
_active: {
|
|
72
|
+
bgGradient: 'linear(to-b, #C02048, #C02048)',
|
|
73
|
+
},
|
|
74
|
+
_disabled: {
|
|
75
|
+
bgGradient: 'linear(to-b, #ccc, #acacac)',
|
|
76
|
+
borderColor: '#ACACAC',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
dangerSecondary: {
|
|
80
|
+
bgGradient: 'linear(to-b, #f8f8f8, #fff)',
|
|
81
|
+
borderColor: '#ddd',
|
|
82
|
+
color: '#FF2158',
|
|
83
|
+
_hover: {
|
|
84
|
+
bgGradient: 'linear(to-b, #FFE8EE, #FFE8EE)',
|
|
85
|
+
borderColor: '#FF8FAB',
|
|
86
|
+
_disabled: {
|
|
87
|
+
bgGradient: 'linear(to-b, #f8f8f8, #fff)',
|
|
88
|
+
borderColor: '#ddd',
|
|
89
|
+
color: '#ACACAC',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
_active: {
|
|
93
|
+
bgGradient: 'linear(to-b, #C02048, #C02048)',
|
|
94
|
+
color: '#fff',
|
|
95
|
+
},
|
|
96
|
+
_disabled: {
|
|
97
|
+
color: '#ACACAC',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
sizes: {
|
|
102
|
+
small: {
|
|
103
|
+
minWidth: '32px',
|
|
104
|
+
height: '32px',
|
|
105
|
+
fontSize: 2,
|
|
106
|
+
paddingX: '12px',
|
|
107
|
+
},
|
|
108
|
+
medium: {
|
|
109
|
+
minWidth: '48px',
|
|
110
|
+
height: '48px',
|
|
111
|
+
fontSize: 3,
|
|
112
|
+
paddingX: '16px',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export default ButtonTheme;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Button as ChakraButton, ButtonProps } from '@chakra-ui/react';
|
|
4
|
+
import { Icon, TypeIconName } from '@bitrise/bitkit';
|
|
5
|
+
|
|
6
|
+
export interface Props {
|
|
7
|
+
as?: 'a' | 'button';
|
|
8
|
+
children: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
leftIconName?: TypeIconName;
|
|
13
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
14
|
+
ref?: ButtonProps['itemRef'];
|
|
15
|
+
rightIconName?: TypeIconName;
|
|
16
|
+
size?: 'small' | 'medium';
|
|
17
|
+
sx?: ButtonProps['sx'];
|
|
18
|
+
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
19
|
+
type?: ButtonProps['type'];
|
|
20
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'dangerPrimary' | 'dangerSecondary';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const Button = React.forwardRef<HTMLButtonElement, Props>((props: Props, ref) => {
|
|
24
|
+
const { as, leftIconName, rightIconName, size, ...rest } = props;
|
|
25
|
+
const properties: ButtonProps = { as, size, ...rest };
|
|
26
|
+
if (leftIconName) {
|
|
27
|
+
properties.leftIcon = <Icon name={leftIconName} />;
|
|
28
|
+
}
|
|
29
|
+
if (rightIconName) {
|
|
30
|
+
properties.rightIcon = <Icon name={rightIconName} />;
|
|
31
|
+
}
|
|
32
|
+
if (leftIconName || rightIconName) {
|
|
33
|
+
properties.iconSpacing = size === 'medium' ? '10px' : '6px';
|
|
34
|
+
}
|
|
35
|
+
if (as === 'a') {
|
|
36
|
+
delete properties.type;
|
|
37
|
+
} else {
|
|
38
|
+
/* @ts-ignore */
|
|
39
|
+
delete properties.href;
|
|
40
|
+
/* @ts-ignore */
|
|
41
|
+
delete properties.target;
|
|
42
|
+
}
|
|
43
|
+
return <ChakraButton ref={ref} {...properties} />;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
Button.defaultProps = {
|
|
47
|
+
as: 'button',
|
|
48
|
+
size: 'medium',
|
|
49
|
+
variant: 'primary',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default Button;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { sortObjectByKey } from '../../shared';
|
|
4
|
+
import { IconList } from '../../../Icon/tsx';
|
|
5
|
+
import IconButton from './IconButton';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/IconButton',
|
|
9
|
+
component: IconButton,
|
|
10
|
+
argTypes: {
|
|
11
|
+
iconName: {
|
|
12
|
+
options: IconList,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
} as ComponentMeta<typeof IconButton>;
|
|
16
|
+
|
|
17
|
+
const Template: ComponentStory<typeof IconButton> = ({ ...props }) => <IconButton {...props} />;
|
|
18
|
+
|
|
19
|
+
export const WithProps = Template.bind({});
|
|
20
|
+
WithProps.args = sortObjectByKey({
|
|
21
|
+
...IconButton.defaultProps,
|
|
22
|
+
iconName: 'AddOns',
|
|
23
|
+
label: 'This is the label',
|
|
24
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconButton as ChakraIconButton, IconButtonProps } from '@chakra-ui/react';
|
|
3
|
+
import { Icon, TypeIconName } from '@bitrise/bitkit';
|
|
4
|
+
|
|
5
|
+
export interface Props {
|
|
6
|
+
iconName: TypeIconName;
|
|
7
|
+
label: IconButtonProps['aria-label'];
|
|
8
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
9
|
+
size?: 'small' | 'medium';
|
|
10
|
+
sx?: IconButtonProps['sx'];
|
|
11
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'dangerPrimary' | 'dangerSecondary';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const IconButton = React.forwardRef<HTMLButtonElement, Props>((props: Props, ref) => {
|
|
15
|
+
const { iconName, label, ...rest } = props;
|
|
16
|
+
const properties: IconButtonProps = {
|
|
17
|
+
'aria-label': label,
|
|
18
|
+
icon: <Icon name={iconName} />,
|
|
19
|
+
...rest,
|
|
20
|
+
};
|
|
21
|
+
return <ChakraIconButton ref={ref} {...properties} />;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
IconButton.defaultProps = {
|
|
25
|
+
size: 'medium',
|
|
26
|
+
variant: 'primary',
|
|
27
|
+
} as Props;
|
|
28
|
+
|
|
29
|
+
export default IconButton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { sortObjectByKey } from '../../shared';
|
|
4
|
+
import Link from './Link';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Link',
|
|
8
|
+
component: Link,
|
|
9
|
+
} as ComponentMeta<typeof Link>;
|
|
10
|
+
|
|
11
|
+
const Template: ComponentStory<typeof Link> = ({ ...props }) => <Link {...props} />;
|
|
12
|
+
|
|
13
|
+
export const WithProps = Template.bind({});
|
|
14
|
+
WithProps.args = sortObjectByKey({
|
|
15
|
+
...Link.defaultProps,
|
|
16
|
+
children: 'The quick brown fox jumps over the lazy dog.',
|
|
17
|
+
href: '#',
|
|
18
|
+
target: '_self',
|
|
19
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link as ChakraLink, LinkProps } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
export type TypeLinkColor = 'grape-3' | 'grape-5' | 'gray-1' | 'gray-5' | 'white' | 'inherit';
|
|
5
|
+
|
|
6
|
+
export interface Props {
|
|
7
|
+
children: LinkProps['children'];
|
|
8
|
+
color?: TypeLinkColor;
|
|
9
|
+
href: string;
|
|
10
|
+
isUnderlined?: boolean;
|
|
11
|
+
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Link = (props: Props) => {
|
|
15
|
+
const { isUnderlined, ...rest } = props;
|
|
16
|
+
const properties: LinkProps = { ...rest };
|
|
17
|
+
properties.as = 'a';
|
|
18
|
+
if (isUnderlined) {
|
|
19
|
+
properties.textDecoration = 'underline';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return <ChakraLink {...properties} />;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
Link.defaultProps = {
|
|
26
|
+
color: 'grape-3',
|
|
27
|
+
isUnderlined: true,
|
|
28
|
+
} as Props;
|
|
29
|
+
|
|
30
|
+
export default Link;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { ButtonGroup, HStack, MenuButton, MenuList } from '@chakra-ui/react';
|
|
4
|
+
import Button from '../Button/Button';
|
|
5
|
+
import IconButton from '../IconButton/IconButton';
|
|
6
|
+
import Menu from './Menu';
|
|
7
|
+
import MenuItem from './MenuItem';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Components/Menu',
|
|
11
|
+
component: Menu,
|
|
12
|
+
subcomponents: { MenuButton, MenuList, MenuItem },
|
|
13
|
+
} as ComponentMeta<typeof Menu>;
|
|
14
|
+
|
|
15
|
+
export const WithButton: ComponentStory<typeof Menu> = () => (
|
|
16
|
+
<Menu>
|
|
17
|
+
<MenuButton as={Button}>Actions</MenuButton>
|
|
18
|
+
<MenuList>
|
|
19
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Download</MenuItem>
|
|
20
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Create a Copy</MenuItem>
|
|
21
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Mark as Draft</MenuItem>
|
|
22
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Delete</MenuItem>
|
|
23
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Attend a Workshop</MenuItem>
|
|
24
|
+
</MenuList>
|
|
25
|
+
</Menu>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const WithIconButton: ComponentStory<typeof Menu> = () => (
|
|
29
|
+
<Menu>
|
|
30
|
+
<MenuButton as={IconButton} iconName="AddOnsColorTuorqouise" label="Open menu" />
|
|
31
|
+
<MenuList>
|
|
32
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Download</MenuItem>
|
|
33
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Create a Copy</MenuItem>
|
|
34
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Mark as Draft</MenuItem>
|
|
35
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Delete</MenuItem>
|
|
36
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Attend a Workshop</MenuItem>
|
|
37
|
+
</MenuList>
|
|
38
|
+
</Menu>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const WithButtonGroup: ComponentStory<typeof Menu> = () => (
|
|
42
|
+
<HStack justifyContent="end">
|
|
43
|
+
<ButtonGroup isAttached>
|
|
44
|
+
<Button>Button</Button>
|
|
45
|
+
<Menu>
|
|
46
|
+
<MenuButton as={IconButton} iconName="AddOnsColorTuorqouise" label="Open menu" />
|
|
47
|
+
<MenuList>
|
|
48
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Download</MenuItem>
|
|
49
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Create a Copy</MenuItem>
|
|
50
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Mark as Draft</MenuItem>
|
|
51
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Delete</MenuItem>
|
|
52
|
+
<MenuItem iconName="AddOnsColorTuorqouise">Attend a Workshop</MenuItem>
|
|
53
|
+
</MenuList>
|
|
54
|
+
</Menu>
|
|
55
|
+
</ButtonGroup>
|
|
56
|
+
</HStack>
|
|
57
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SystemStyleObject } from '@chakra-ui/theme-tools';
|
|
2
|
+
|
|
3
|
+
const MenuTheme: SystemStyleObject = {
|
|
4
|
+
baseStyle: {
|
|
5
|
+
list: {
|
|
6
|
+
backgroundColor: '#fff',
|
|
7
|
+
borderRadius: '8px',
|
|
8
|
+
filter: 'drop-shadow(0 0.125rem 0.3125rem rgba(199, 205, 207, 0.7))',
|
|
9
|
+
paddingY: '16px',
|
|
10
|
+
},
|
|
11
|
+
item: {
|
|
12
|
+
padding: '12px 32px',
|
|
13
|
+
_focus: {
|
|
14
|
+
backgroundColor: '#F8F0FF',
|
|
15
|
+
},
|
|
16
|
+
_hover: {
|
|
17
|
+
backgroundColor: '#F8F0FF',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default MenuTheme;
|