@bitrise/bitkit 9.4.1-alpha.2 → 9.5.0-alpha.4
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 +1 -1
- package/.husky/commit-msg +4 -0
- package/.nvmrc +1 -1
- package/.stylelintignore +0 -1
- package/.tool-versions +1 -1
- package/CHANGELOG.md +12 -3
- package/bitrise.yml +32 -28
- package/jest.setup.js +1 -0
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.d.ts +6 -3
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.d.ts.map +1 -1
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.js +13 -6
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
- package/lib/cjs/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/cjs/Dropdown/Dropdown.js +9 -8
- package/lib/cjs/Dropdown/Dropdown.js.map +1 -1
- package/lib/cjs/Placement/Placement.css +17 -35
- package/lib/cjs/Placement/Placement.d.ts +5 -8
- package/lib/cjs/Placement/Placement.d.ts.map +1 -1
- package/lib/cjs/Placement/Placement.js.map +1 -1
- package/lib/cjs/Placement/PlacementPopper.d.ts +3 -4
- package/lib/cjs/Placement/PlacementPopper.d.ts.map +1 -1
- package/lib/cjs/Placement/PlacementPopper.js +32 -17
- package/lib/cjs/Placement/PlacementPopper.js.map +1 -1
- package/lib/cjs/Tooltip/Tooltip.d.ts +1 -1
- package/lib/cjs/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/cjs/hooks/useEventListener.d.ts.map +1 -1
- package/lib/cjs/hooks/useEventListener.js +0 -1
- package/lib/cjs/hooks/useEventListener.js.map +1 -1
- package/lib/cjs/index.d.ts +0 -9
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +1 -20
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.d.ts +6 -3
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.d.ts.map +1 -1
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.js +10 -3
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
- package/lib/esn/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/esn/Dropdown/Dropdown.js +9 -5
- package/lib/esn/Dropdown/Dropdown.js.map +1 -1
- package/lib/esn/Placement/Placement.css +17 -35
- package/lib/esn/Placement/Placement.d.ts +5 -8
- package/lib/esn/Placement/Placement.d.ts.map +1 -1
- package/lib/esn/Placement/Placement.js.map +1 -1
- package/lib/esn/Placement/PlacementPopper.d.ts +3 -4
- package/lib/esn/Placement/PlacementPopper.d.ts.map +1 -1
- package/lib/esn/Placement/PlacementPopper.js +44 -29
- package/lib/esn/Placement/PlacementPopper.js.map +1 -1
- package/lib/esn/Tooltip/Tooltip.d.ts +1 -1
- package/lib/esn/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/esn/hooks/useEventListener.d.ts.map +1 -1
- package/lib/esn/hooks/useEventListener.js +0 -1
- package/lib/esn/hooks/useEventListener.js.map +1 -1
- package/lib/esn/index.d.ts +0 -9
- package/lib/esn/index.d.ts.map +1 -1
- package/lib/esn/index.js +0 -9
- package/lib/esn/index.js.map +1 -1
- package/lib/esn/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -41
- package/postcss.config.js +9 -5
- package/site/components/Documentation/Components/SectionButtons.tsx +8 -4
- package/site/components/Documentation/Components/SectionDropdowns.tsx +1 -1
- package/site/components/Documentation/Components/SectionPlacement.tsx +7 -1
- package/src/ButtonWithDropdown/ButtonWithDropdown.tsx +22 -21
- package/src/Dropdown/Dropdown.tsx +16 -8
- package/src/Placement/Placement.css +17 -35
- package/src/Placement/Placement.tsx +5 -8
- package/src/Placement/PlacementPopper.tsx +64 -48
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/src/hooks/useEventListener.ts +25 -5
- package/src/index.ts +0 -10
- package/tsconfig.json +2 -5
- package/.storybook/main.js +0 -35
- package/.storybook/preview.js +0 -20
- package/lib/cjs/chakra/BitkitProvider.d.ts +0 -5
- package/lib/cjs/chakra/BitkitProvider.d.ts.map +0 -1
- package/lib/cjs/chakra/BitkitProvider.js +0 -14
- package/lib/cjs/chakra/BitkitProvider.js.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.d.ts +0 -22
- package/lib/cjs/chakra/components/Button/Button.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.js +0 -61
- package/lib/cjs/chakra/components/Button/Button.js.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.stories.d.ts +0 -6
- package/lib/cjs/chakra/components/Button/Button.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.stories.js +0 -37
- package/lib/cjs/chakra/components/Button/Button.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.theme.d.ts +0 -117
- package/lib/cjs/chakra/components/Button/Button.theme.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.theme.js +0 -119
- package/lib/cjs/chakra/components/Button/Button.theme.js.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.d.ts +0 -14
- package/lib/cjs/chakra/components/IconButton/IconButton.d.ts.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.js +0 -41
- package/lib/cjs/chakra/components/IconButton/IconButton.js.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts +0 -6
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.js +0 -48
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.d.ts +0 -16
- package/lib/cjs/chakra/components/Link/Link.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.js +0 -44
- package/lib/cjs/chakra/components/Link/Link.js.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.stories.d.ts +0 -12
- package/lib/cjs/chakra/components/Link/Link.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.stories.js +0 -42
- package/lib/cjs/chakra/components/Link/Link.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.d.ts +0 -6
- package/lib/cjs/chakra/components/Menu/Menu.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.js +0 -21
- package/lib/cjs/chakra/components/Menu/Menu.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts +0 -9
- package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.stories.js +0 -48
- package/lib/cjs/chakra/components/Menu/Menu.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts +0 -4
- package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.theme.js +0 -23
- package/lib/cjs/chakra/components/Menu/Menu.theme.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/MenuItem.d.ts +0 -12
- package/lib/cjs/chakra/components/Menu/MenuItem.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/MenuItem.js +0 -39
- package/lib/cjs/chakra/components/Menu/MenuItem.js.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts +0 -16
- package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.js +0 -36
- package/lib/cjs/chakra/components/StatusTag/StatusTag.js.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts +0 -13
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js +0 -44
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts +0 -45
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js +0 -47
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.d.ts +0 -32
- package/lib/cjs/chakra/components/Text/Text.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.js +0 -38
- package/lib/cjs/chakra/components/Text/Text.js.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.stories.d.ts +0 -12
- package/lib/cjs/chakra/components/Text/Text.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.stories.js +0 -42
- package/lib/cjs/chakra/components/Text/Text.stories.js.map +0 -1
- package/lib/cjs/chakra/shared.d.ts +0 -2
- package/lib/cjs/chakra/shared.d.ts.map +0 -1
- package/lib/cjs/chakra/shared.js +0 -15
- package/lib/cjs/chakra/shared.js.map +0 -1
- package/lib/cjs/chakra/theme/theme.d.ts +0 -3
- package/lib/cjs/chakra/theme/theme.d.ts.map +0 -1
- package/lib/cjs/chakra/theme/theme.js +0 -54
- package/lib/cjs/chakra/theme/theme.js.map +0 -1
- package/lib/cjs/chakra/theme/typographyConfig.d.ts +0 -4
- package/lib/cjs/chakra/theme/typographyConfig.d.ts.map +0 -1
- package/lib/cjs/chakra/theme/typographyConfig.js +0 -38
- package/lib/cjs/chakra/theme/typographyConfig.js.map +0 -1
- package/lib/esn/chakra/BitkitProvider.d.ts +0 -5
- package/lib/esn/chakra/BitkitProvider.d.ts.map +0 -1
- package/lib/esn/chakra/BitkitProvider.js +0 -8
- package/lib/esn/chakra/BitkitProvider.js.map +0 -1
- package/lib/esn/chakra/components/Button/Button.d.ts +0 -22
- package/lib/esn/chakra/components/Button/Button.d.ts.map +0 -1
- package/lib/esn/chakra/components/Button/Button.js +0 -34
- package/lib/esn/chakra/components/Button/Button.js.map +0 -1
- package/lib/esn/chakra/components/Button/Button.stories.d.ts +0 -6
- package/lib/esn/chakra/components/Button/Button.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Button/Button.stories.js +0 -29
- package/lib/esn/chakra/components/Button/Button.stories.js.map +0 -1
- package/lib/esn/chakra/components/Button/Button.theme.d.ts +0 -117
- package/lib/esn/chakra/components/Button/Button.theme.d.ts.map +0 -1
- package/lib/esn/chakra/components/Button/Button.theme.js +0 -117
- package/lib/esn/chakra/components/Button/Button.theme.js.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.d.ts +0 -14
- package/lib/esn/chakra/components/IconButton/IconButton.d.ts.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.js +0 -18
- package/lib/esn/chakra/components/IconButton/IconButton.js.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts +0 -6
- package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.stories.js +0 -21
- package/lib/esn/chakra/components/IconButton/IconButton.stories.js.map +0 -1
- package/lib/esn/chakra/components/Link/Link.d.ts +0 -16
- package/lib/esn/chakra/components/Link/Link.d.ts.map +0 -1
- package/lib/esn/chakra/components/Link/Link.js +0 -17
- package/lib/esn/chakra/components/Link/Link.js.map +0 -1
- package/lib/esn/chakra/components/Link/Link.stories.d.ts +0 -12
- package/lib/esn/chakra/components/Link/Link.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Link/Link.stories.js +0 -16
- package/lib/esn/chakra/components/Link/Link.stories.js.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.d.ts +0 -6
- package/lib/esn/chakra/components/Menu/Menu.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.js +0 -5
- package/lib/esn/chakra/components/Menu/Menu.js.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.stories.d.ts +0 -9
- package/lib/esn/chakra/components/Menu/Menu.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.stories.js +0 -39
- package/lib/esn/chakra/components/Menu/Menu.stories.js.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.theme.d.ts +0 -4
- package/lib/esn/chakra/components/Menu/Menu.theme.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.theme.js +0 -21
- package/lib/esn/chakra/components/Menu/Menu.theme.js.map +0 -1
- package/lib/esn/chakra/components/Menu/MenuItem.d.ts +0 -12
- package/lib/esn/chakra/components/Menu/MenuItem.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/MenuItem.js +0 -12
- package/lib/esn/chakra/components/Menu/MenuItem.js.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts +0 -16
- package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.js +0 -30
- package/lib/esn/chakra/components/StatusTag/StatusTag.js.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts +0 -13
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js +0 -16
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts +0 -45
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js +0 -45
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js.map +0 -1
- package/lib/esn/chakra/components/Text/Text.d.ts +0 -32
- package/lib/esn/chakra/components/Text/Text.d.ts.map +0 -1
- package/lib/esn/chakra/components/Text/Text.js +0 -22
- package/lib/esn/chakra/components/Text/Text.js.map +0 -1
- package/lib/esn/chakra/components/Text/Text.stories.d.ts +0 -12
- package/lib/esn/chakra/components/Text/Text.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Text/Text.stories.js +0 -19
- package/lib/esn/chakra/components/Text/Text.stories.js.map +0 -1
- package/lib/esn/chakra/shared.d.ts +0 -2
- package/lib/esn/chakra/shared.d.ts.map +0 -1
- package/lib/esn/chakra/shared.js +0 -11
- package/lib/esn/chakra/shared.js.map +0 -1
- package/lib/esn/chakra/theme/theme.d.ts +0 -3
- package/lib/esn/chakra/theme/theme.d.ts.map +0 -1
- package/lib/esn/chakra/theme/theme.js +0 -49
- package/lib/esn/chakra/theme/theme.js.map +0 -1
- package/lib/esn/chakra/theme/typographyConfig.d.ts +0 -4
- package/lib/esn/chakra/theme/typographyConfig.d.ts.map +0 -1
- package/lib/esn/chakra/theme/typographyConfig.js +0 -36
- package/lib/esn/chakra/theme/typographyConfig.js.map +0 -1
- package/src/chakra/BitkitProvider.tsx +0 -9
- package/src/chakra/components/Button/Button.stories.tsx +0 -32
- package/src/chakra/components/Button/Button.theme.ts +0 -117
- package/src/chakra/components/Button/Button.tsx +0 -52
- package/src/chakra/components/IconButton/IconButton.stories.tsx +0 -24
- package/src/chakra/components/IconButton/IconButton.tsx +0 -29
- package/src/chakra/components/Link/Link.stories.tsx +0 -19
- package/src/chakra/components/Link/Link.tsx +0 -30
- package/src/chakra/components/Menu/Menu.stories.tsx +0 -57
- package/src/chakra/components/Menu/Menu.theme.ts +0 -23
- package/src/chakra/components/Menu/Menu.tsx +0 -8
- package/src/chakra/components/Menu/MenuItem.tsx +0 -20
- package/src/chakra/components/StatusTag/StatusTag.stories.tsx +0 -19
- package/src/chakra/components/StatusTag/StatusTag.theme.ts +0 -45
- package/src/chakra/components/StatusTag/StatusTag.tsx +0 -55
- package/src/chakra/components/Text/Text.stories.tsx +0 -22
- package/src/chakra/components/Text/Text.tsx +0 -73
- package/src/chakra/shared.ts +0 -11
- package/src/chakra/theme/theme.ts +0 -50
- package/src/chakra/theme/typographyConfig.ts +0 -38
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.5.0-alpha.4",
|
|
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,28 +27,21 @@
|
|
|
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"
|
|
31
|
-
"storybook": "start-storybook -p 6006",
|
|
32
|
-
"build-storybook": "build-storybook"
|
|
30
|
+
"test": "jest ./src"
|
|
33
31
|
},
|
|
34
32
|
"alias": {
|
|
35
|
-
"@bitrise/bitkit": "./src"
|
|
36
|
-
"framer-motion": "./node_modules/framer-motion/dist/cjs"
|
|
33
|
+
"@bitrise/bitkit": "./src"
|
|
37
34
|
},
|
|
38
35
|
"dependencies": {
|
|
39
|
-
"@chakra-ui/react": "^1.8.6",
|
|
40
|
-
"@emotion/react": "^11",
|
|
41
|
-
"@emotion/styled": "^11",
|
|
42
36
|
"@juggle/resize-observer": "^3.3.1",
|
|
37
|
+
"@popperjs/core": "^2.11.4",
|
|
43
38
|
"classnames": "^2.3.1",
|
|
44
39
|
"clipboard": "^2.0.10",
|
|
45
|
-
"framer-motion": "^6",
|
|
46
40
|
"luxon": "^2.3.1",
|
|
47
41
|
"normalize.css": "^8.0.1",
|
|
48
|
-
"popper.js": "^1.14.4",
|
|
49
42
|
"react": "^17.0.2",
|
|
50
43
|
"react-dom": "^17.0.2",
|
|
51
|
-
"react-popper": "^
|
|
44
|
+
"react-popper": "^2.2.5",
|
|
52
45
|
"react-transition-group": "^4.4.2"
|
|
53
46
|
},
|
|
54
47
|
"peerDependencies": {
|
|
@@ -56,21 +49,13 @@
|
|
|
56
49
|
"react-dom": "^17.0.2"
|
|
57
50
|
},
|
|
58
51
|
"devDependencies": {
|
|
59
|
-
"@babel/core": "^7.17.8",
|
|
60
52
|
"@bitrise/eslint-plugin": "^2.1.0",
|
|
61
|
-
"@commitlint/cli": "^
|
|
62
|
-
"@commitlint/config-conventional": "^
|
|
53
|
+
"@commitlint/cli": "^16.2.3",
|
|
54
|
+
"@commitlint/config-conventional": "^16.2.1",
|
|
55
|
+
"@gkz/ast-types": "^0.14.4",
|
|
63
56
|
"@semantic-release/changelog": "^6.0.1",
|
|
64
57
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
65
58
|
"@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",
|
|
74
59
|
"@svgr/cli": "^6.2.1",
|
|
75
60
|
"@types/cheerio": "^0.22.31",
|
|
76
61
|
"@types/clipboard": "^2.0.1",
|
|
@@ -86,15 +71,13 @@
|
|
|
86
71
|
"@types/react-router-dom": "^5.3.3",
|
|
87
72
|
"@types/react-transition-group": "^4.4.4",
|
|
88
73
|
"@types/vfile-message": "^2.0.0",
|
|
89
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
90
|
-
"@typescript-eslint/parser": "^5.
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^5.16.0",
|
|
75
|
+
"@typescript-eslint/parser": "^5.16.0",
|
|
91
76
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
|
|
92
|
-
"autoprefixer": "^9",
|
|
77
|
+
"autoprefixer": "^9.8.8",
|
|
93
78
|
"babel-eslint": "^10.0.1",
|
|
94
|
-
"babel-loader": "^8.2.3",
|
|
95
79
|
"chokidar-cli": "^3.0.0",
|
|
96
|
-
"concurrently": "^
|
|
97
|
-
"csstype": "3.0.9",
|
|
80
|
+
"concurrently": "^7.0.0",
|
|
98
81
|
"enzyme": "^3.11.0",
|
|
99
82
|
"enzyme-to-json": "^3.6.2",
|
|
100
83
|
"eslint": "^8.11.0",
|
|
@@ -104,10 +87,9 @@
|
|
|
104
87
|
"eslint-plugin-prettier": "^4.0.0",
|
|
105
88
|
"eslint-plugin-react": "^7.29.4",
|
|
106
89
|
"eslint-plugin-react-hooks": "^4.3.0",
|
|
107
|
-
"eslint-plugin-storybook": "^0.5.7",
|
|
108
90
|
"eslint-plugin-testing-library": "^5.1.0",
|
|
109
91
|
"fscreen": "^1.2.0",
|
|
110
|
-
"husky": "^
|
|
92
|
+
"husky": "^7.0.4",
|
|
111
93
|
"identity-obj-proxy": "^3.0.0",
|
|
112
94
|
"jest": "^27.5.1",
|
|
113
95
|
"jsdom": "^19.0.0",
|
|
@@ -119,26 +101,20 @@
|
|
|
119
101
|
"postcss-preset-env": "^6.7.1",
|
|
120
102
|
"prettier": "^2.6.0",
|
|
121
103
|
"prismjs": "^1.27.0",
|
|
104
|
+
"react-docgen": "5.4.0",
|
|
122
105
|
"react-router": "^5.2.1",
|
|
123
106
|
"react-router-dom": "^5.3.0",
|
|
124
|
-
"semantic-release": "^
|
|
107
|
+
"semantic-release": "^19.0.2",
|
|
125
108
|
"stylelint": "^14.6.0",
|
|
126
109
|
"stylelint-order": "^5.0.0",
|
|
127
110
|
"superstatic": "^7.1.0",
|
|
128
111
|
"ts-jest": "^27.1.3",
|
|
129
112
|
"ts-node": "^10.7.0",
|
|
130
|
-
"
|
|
131
|
-
"typescript": "^4.6.2",
|
|
132
|
-
"webpack": "^5.70.0"
|
|
113
|
+
"typescript": "^4.6.2"
|
|
133
114
|
},
|
|
134
115
|
"publishConfig": {
|
|
135
116
|
"access": "public"
|
|
136
117
|
},
|
|
137
|
-
"husky": {
|
|
138
|
-
"hooks": {
|
|
139
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
118
|
"jest": {
|
|
143
119
|
"moduleNameMapper": {
|
|
144
120
|
"^.+\\.css$": "identity-obj-proxy"
|
|
@@ -151,6 +127,6 @@
|
|
|
151
127
|
}
|
|
152
128
|
},
|
|
153
129
|
"resolutions": {
|
|
154
|
-
"
|
|
130
|
+
"**/ast-types": "npm:@gkz/ast-types"
|
|
155
131
|
}
|
|
156
132
|
}
|
package/postcss.config.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
const autoprefixer = require('autoprefixer');
|
|
3
|
+
const postcssPresetEnv = require('postcss-preset-env');
|
|
4
|
+
|
|
1
5
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
plugins: [
|
|
7
|
+
autoprefixer(),
|
|
8
|
+
postcssPresetEnv({
|
|
9
|
+
stage: 3,
|
|
10
|
+
features: {
|
|
7
11
|
'custom-properties': false,
|
|
8
12
|
'nesting-rules': true,
|
|
9
13
|
},
|
|
@@ -376,22 +376,26 @@ const SectionButtons = () => {
|
|
|
376
376
|
<ButtonWithDropdown
|
|
377
377
|
items={[
|
|
378
378
|
{
|
|
379
|
+
key: '1',
|
|
379
380
|
component: 'button',
|
|
380
381
|
icon: 'Percent',
|
|
381
|
-
|
|
382
|
+
content: 'Refer your friends',
|
|
382
383
|
},
|
|
383
384
|
{
|
|
385
|
+
key: '2',
|
|
384
386
|
component: 'a',
|
|
385
387
|
icon: 'Settings',
|
|
386
|
-
|
|
388
|
+
content: 'Account setings',
|
|
387
389
|
},
|
|
388
390
|
{
|
|
391
|
+
key: '3',
|
|
389
392
|
icon: 'ChangePlan',
|
|
390
|
-
|
|
393
|
+
content: 'Change plan',
|
|
391
394
|
},
|
|
392
395
|
{
|
|
396
|
+
key: '4',
|
|
393
397
|
icon: 'Logout',
|
|
394
|
-
|
|
398
|
+
content: 'Log out',
|
|
395
399
|
},
|
|
396
400
|
]}
|
|
397
401
|
>
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
DropdownMenu,
|
|
5
5
|
DropdownMenus,
|
|
6
6
|
DropdownMenuItem,
|
|
7
|
-
DropdownMenuItemGroup,
|
|
8
7
|
Flex,
|
|
9
8
|
Icon,
|
|
10
9
|
Placement,
|
|
@@ -245,6 +244,7 @@ const SectionDropdown = () => {
|
|
|
245
244
|
setSelectedItem(undefined);
|
|
246
245
|
handleToggle3();
|
|
247
246
|
}}
|
|
247
|
+
sameWidth
|
|
248
248
|
visible={visible3}
|
|
249
249
|
>
|
|
250
250
|
{() => (
|
|
@@ -21,7 +21,12 @@ const SectionPlacement = () => {
|
|
|
21
21
|
const [selectedTab, setSelectedTab] = useState(1);
|
|
22
22
|
const [ref, setRef] = useState<SVGSVGElement>();
|
|
23
23
|
|
|
24
|
-
const handleToggle = () =>
|
|
24
|
+
const handleToggle = (event?: any) => {
|
|
25
|
+
if (event && event.stopPropagation) {
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
}
|
|
28
|
+
setVisible(!visible);
|
|
29
|
+
};
|
|
25
30
|
|
|
26
31
|
return (
|
|
27
32
|
<Section>
|
|
@@ -39,6 +44,7 @@ const SectionPlacement = () => {
|
|
|
39
44
|
<>
|
|
40
45
|
<PlacementManager>
|
|
41
46
|
<PlacementReference>
|
|
47
|
+
{/* eslint-disable-next-line @typescript-eslint/no-shadow */}
|
|
42
48
|
{({ ref }) => (
|
|
43
49
|
<Button innerRef={ref} level="primary" onClick={handleToggle}>
|
|
44
50
|
<Icon name="More" />
|
|
@@ -10,14 +10,18 @@ import {
|
|
|
10
10
|
PlacementManager,
|
|
11
11
|
PlacementProps,
|
|
12
12
|
PlacementReference,
|
|
13
|
+
BaseProps,
|
|
13
14
|
} from '@bitrise/bitkit';
|
|
14
15
|
|
|
15
16
|
export interface ItemProps extends DropdownMenuItemProps {
|
|
17
|
+
key: string;
|
|
16
18
|
component?: string;
|
|
17
19
|
disabled?: boolean;
|
|
18
20
|
href?: string;
|
|
21
|
+
onClick?: (e?: any) => void;
|
|
19
22
|
target?: string;
|
|
20
|
-
|
|
23
|
+
content: React.ReactNode;
|
|
24
|
+
textColor?: BaseProps['textColor'];
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export interface Props {
|
|
@@ -28,46 +32,43 @@ export interface Props {
|
|
|
28
32
|
placementProps?: PlacementProps;
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
const ButtonWithDropdown = ({
|
|
32
|
-
buttonProps = {},
|
|
33
|
-
children,
|
|
34
|
-
dropdownWidth,
|
|
35
|
-
items,
|
|
36
|
-
placementProps,
|
|
37
|
-
}: Props): JSX.Element => {
|
|
35
|
+
const ButtonWithDropdown = ({ buttonProps, children, dropdownWidth, items, placementProps }: Props): JSX.Element => {
|
|
38
36
|
const [visible, setVisible] = React.useState(false);
|
|
39
37
|
|
|
38
|
+
const onButtonClick = (event: any) => {
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
if (buttonProps?.onClick) {
|
|
41
|
+
buttonProps.onClick(!visible);
|
|
42
|
+
}
|
|
43
|
+
setVisible(!visible);
|
|
44
|
+
};
|
|
45
|
+
|
|
40
46
|
return (
|
|
41
47
|
<PlacementManager>
|
|
42
48
|
<PlacementReference>
|
|
43
49
|
{({ ref }) => (
|
|
44
|
-
<Button innerRef={ref}
|
|
50
|
+
<Button innerRef={ref} {...buttonProps} onClick={onButtonClick}>
|
|
45
51
|
{children}
|
|
46
52
|
<Icon name="ChevronDown" />
|
|
47
53
|
</Button>
|
|
48
54
|
)}
|
|
49
55
|
</PlacementReference>
|
|
50
|
-
{!buttonProps
|
|
51
|
-
<Placement
|
|
52
|
-
disableMargin="left-right"
|
|
53
|
-
onClose={() => setVisible(false)}
|
|
54
|
-
placement="bottom-end"
|
|
55
|
-
visible={visible}
|
|
56
|
-
{...placementProps}
|
|
57
|
-
>
|
|
56
|
+
{!buttonProps?.disabled && (
|
|
57
|
+
<Placement onClose={() => setVisible(false)} placement="bottom-end" visible={visible} {...placementProps}>
|
|
58
58
|
{() => (
|
|
59
59
|
<DropdownMenu width={dropdownWidth} withArrow>
|
|
60
|
-
{items.map(({ component, disabled, href, icon, onClick, target,
|
|
60
|
+
{items.map(({ key, component, disabled, href, icon, onClick, target, content, textColor }) => (
|
|
61
61
|
<DropdownMenuItem
|
|
62
|
-
Component={component || '
|
|
62
|
+
Component={component || 'button'}
|
|
63
63
|
disabled={disabled}
|
|
64
64
|
href={href}
|
|
65
65
|
icon={icon}
|
|
66
|
-
key={text}
|
|
67
66
|
onClick={onClick}
|
|
67
|
+
key={key}
|
|
68
68
|
target={target}
|
|
69
|
+
textColor={textColor}
|
|
69
70
|
>
|
|
70
|
-
{
|
|
71
|
+
{content}
|
|
71
72
|
</DropdownMenuItem>
|
|
72
73
|
))}
|
|
73
74
|
</DropdownMenu>
|
|
@@ -41,17 +41,15 @@ const Dropdown: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
41
41
|
const { children, options, onChange, selected, maxHeight, ...rest } = props;
|
|
42
42
|
const [visible, setVisible] = useState(false);
|
|
43
43
|
|
|
44
|
-
const handleToggleVisible = () => setVisible(!visible);
|
|
45
|
-
|
|
46
44
|
const handleChange = (value: DropdownValue) => {
|
|
47
45
|
if (onChange) {
|
|
48
46
|
onChange(value);
|
|
49
47
|
}
|
|
50
|
-
|
|
48
|
+
setVisible(false);
|
|
51
49
|
};
|
|
52
50
|
|
|
53
51
|
const renderOption = ({ text, value }: Option) => (
|
|
54
|
-
<DropdownMenuItem onClick={() => handleChange(value)} selected={selected === value}>
|
|
52
|
+
<DropdownMenuItem onClick={() => handleChange(value)} selected={selected === value} width="100%">
|
|
55
53
|
{text}
|
|
56
54
|
</DropdownMenuItem>
|
|
57
55
|
);
|
|
@@ -60,15 +58,25 @@ const Dropdown: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
60
58
|
<PlacementManager>
|
|
61
59
|
<PlacementReference>
|
|
62
60
|
{({ ref }) => (
|
|
63
|
-
<DropdownButton
|
|
61
|
+
<DropdownButton
|
|
62
|
+
{...rest}
|
|
63
|
+
alignChildrenHorizontal="start"
|
|
64
|
+
innerRef={ref}
|
|
65
|
+
onClick={(event: any) => {
|
|
66
|
+
if (event && event.preventDefault) {
|
|
67
|
+
event.stopPropagation();
|
|
68
|
+
}
|
|
69
|
+
setVisible(!visible);
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
64
72
|
<Text ellipsis>{children}</Text>
|
|
65
73
|
</DropdownButton>
|
|
66
74
|
)}
|
|
67
75
|
</PlacementReference>
|
|
68
76
|
|
|
69
|
-
<Placement onClose={
|
|
70
|
-
{(
|
|
71
|
-
<DropdownMenu maxHeight={maxHeight} width=
|
|
77
|
+
<Placement onClose={() => setVisible(false)} sameWidth visible={visible}>
|
|
78
|
+
{() => (
|
|
79
|
+
<DropdownMenu maxHeight={maxHeight} width="100%">
|
|
72
80
|
{options.map((option) => (
|
|
73
81
|
<React.Fragment key={option.text}>
|
|
74
82
|
{'options' in option ? (
|
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
:root {
|
|
3
|
-
--Placement-arrow-size: var(--size--x3);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
2
|
.Placement {
|
|
7
3
|
position: absolute;
|
|
8
|
-
margin: var(--Placement-arrow-size);
|
|
9
4
|
z-index: var(--z-index-Placement--below-modal);
|
|
10
5
|
pointer-events: none;
|
|
11
6
|
}
|
|
12
7
|
|
|
13
|
-
.Placement--disable-margin {
|
|
14
|
-
margin: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.Placement--disable-margin-top-bottom {
|
|
18
|
-
margin-top: 0;
|
|
19
|
-
margin-bottom: 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.Placement--disable-margin-left-right {
|
|
23
|
-
margin-right: 0;
|
|
24
|
-
margin-left: 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
8
|
.Placement--animate {
|
|
28
9
|
transition-property: transform;
|
|
29
10
|
transition-duration: var(--transition-duration--fast);
|
|
@@ -83,50 +64,51 @@
|
|
|
83
64
|
border-top: 0.0625rem solid var(--color-gray--2);
|
|
84
65
|
}
|
|
85
66
|
|
|
86
|
-
.Placement__arrow
|
|
67
|
+
.Placement__arrow,
|
|
68
|
+
.Placement__arrow::before {
|
|
87
69
|
position: absolute;
|
|
88
|
-
width: var(--
|
|
89
|
-
height: var(--
|
|
70
|
+
width: var(--size--x3);
|
|
71
|
+
height: var(--size--x3);
|
|
90
72
|
}
|
|
91
73
|
|
|
92
74
|
.Placement__arrow,
|
|
93
75
|
.Placement__arrow:first-child,
|
|
94
76
|
.Placement__arrow:last-child {
|
|
95
|
-
|
|
77
|
+
visibility: hidden;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.Placement__arrow::before {
|
|
81
|
+
content: '';
|
|
82
|
+
display: block;
|
|
83
|
+
transform: rotate(45deg);
|
|
84
|
+
background: inherit;
|
|
85
|
+
visibility: visible;
|
|
96
86
|
}
|
|
97
87
|
|
|
98
88
|
.Placement--top .Placement__arrow,
|
|
99
89
|
.Placement--top-start .Placement__arrow,
|
|
100
90
|
.Placement--top-end .Placement__arrow {
|
|
101
91
|
top: 100%;
|
|
102
|
-
|
|
103
|
-
translateY(calc(-50% + var(--Placement-arrow-size) * -1))
|
|
104
|
-
rotate(45deg);
|
|
92
|
+
margin-top: -0.375rem;
|
|
105
93
|
}
|
|
106
94
|
|
|
107
95
|
.Placement--right .Placement__arrow,
|
|
108
96
|
.Placement--right-start .Placement__arrow,
|
|
109
97
|
.Placement--right-end .Placement__arrow {
|
|
110
98
|
right: 100%;
|
|
111
|
-
|
|
112
|
-
translateX(calc(50% - var(--Placement-arrow-size) * -1))
|
|
113
|
-
rotate(45deg);
|
|
99
|
+
margin-right: -0.375rem;
|
|
114
100
|
}
|
|
115
101
|
|
|
116
102
|
.Placement--bottom .Placement__arrow,
|
|
117
103
|
.Placement--bottom-start .Placement__arrow,
|
|
118
104
|
.Placement--bottom-end .Placement__arrow {
|
|
119
105
|
bottom: 100%;
|
|
120
|
-
|
|
121
|
-
translateY(calc(50% - var(--Placement-arrow-size) * -1))
|
|
122
|
-
rotate(45deg);
|
|
106
|
+
margin-bottom: -0.375rem;
|
|
123
107
|
}
|
|
124
108
|
|
|
125
109
|
.Placement--left .Placement__arrow,
|
|
126
110
|
.Placement--left-start .Placement__arrow,
|
|
127
111
|
.Placement--left-end .Placement__arrow {
|
|
128
112
|
left: 100%;
|
|
129
|
-
|
|
130
|
-
translateX(calc(-50% + var(--Placement-arrow-size) * -1))
|
|
131
|
-
rotate(45deg);
|
|
113
|
+
margin-left: -0.375rem;
|
|
132
114
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Placement as TypePlacement
|
|
2
|
+
import { Placement as TypePlacement } from '@popperjs/core';
|
|
3
3
|
import { Props as BaseProps } from '../Base/Base';
|
|
4
4
|
import { ModalContext } from '../Modal/ModalContext';
|
|
5
5
|
import PlacementPopper from './PlacementPopper';
|
|
@@ -13,15 +13,11 @@ export interface Props extends BaseProps {
|
|
|
13
13
|
animatePosition?: boolean;
|
|
14
14
|
/**
|
|
15
15
|
* A render callback function that provides a
|
|
16
|
-
*
|
|
16
|
+
* update function to trigger a reposition,
|
|
17
17
|
* and the width of the target that is being positioned
|
|
18
18
|
* around.
|
|
19
19
|
*/
|
|
20
|
-
children: (props: {
|
|
21
|
-
/**
|
|
22
|
-
* Flag that disables margin around the Placement.
|
|
23
|
-
*/
|
|
24
|
-
disableMargin?: boolean | 'top-bottom' | 'left-right';
|
|
20
|
+
children: (props: { update: () => void; width?: number }) => React.ReactNode;
|
|
25
21
|
/**
|
|
26
22
|
* Flag that disables repositioning on scroll and resize events.
|
|
27
23
|
*/
|
|
@@ -45,7 +41,8 @@ export interface Props extends BaseProps {
|
|
|
45
41
|
/**
|
|
46
42
|
* An optional reference element to be used as the target.
|
|
47
43
|
*/
|
|
48
|
-
referenceElement?:
|
|
44
|
+
referenceElement?: any;
|
|
45
|
+
sameWidth?: boolean;
|
|
49
46
|
/**
|
|
50
47
|
* The visibilty of the positioned content.
|
|
51
48
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/* eslint-disable react/default-props-match-prop-types */
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import { Placement as TypePlacement
|
|
4
|
+
import { Placement as TypePlacement } from '@popperjs/core';
|
|
4
5
|
import { Popper, PopperProps } from 'react-popper';
|
|
5
6
|
import { CSSTransition } from 'react-transition-group';
|
|
6
7
|
import classnames from 'classnames';
|
|
@@ -27,15 +28,14 @@ const transitionClasses = {
|
|
|
27
28
|
|
|
28
29
|
export interface Props extends BaseProps {
|
|
29
30
|
animatePosition?: boolean;
|
|
30
|
-
children: (props: {
|
|
31
|
+
children: (props: { update: () => void; width?: number }) => React.ReactNode;
|
|
31
32
|
closeElement?: null | HTMLElement;
|
|
32
|
-
disableMargin?: boolean | 'top-bottom' | 'left-right';
|
|
33
33
|
disableReposition?: boolean;
|
|
34
34
|
flip?: boolean;
|
|
35
35
|
isInsideModal?: boolean;
|
|
36
36
|
onClose?: (event: MouseEvent) => void;
|
|
37
37
|
placement?: TypePlacement;
|
|
38
|
-
referenceElement?:
|
|
38
|
+
referenceElement?: any;
|
|
39
39
|
visible?: boolean;
|
|
40
40
|
timeout?: number;
|
|
41
41
|
}
|
|
@@ -46,13 +46,13 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
46
46
|
backgroundColor,
|
|
47
47
|
children,
|
|
48
48
|
closeElement,
|
|
49
|
-
disableMargin,
|
|
50
49
|
disableReposition,
|
|
51
50
|
flip,
|
|
52
51
|
isInsideModal,
|
|
53
52
|
onClose,
|
|
54
53
|
placement: desiredPlacement,
|
|
55
54
|
referenceElement,
|
|
55
|
+
sameWidth,
|
|
56
56
|
visible,
|
|
57
57
|
timeout = transitionDurationFast,
|
|
58
58
|
...rest
|
|
@@ -71,7 +71,7 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
71
71
|
closeElement || document,
|
|
72
72
|
'click',
|
|
73
73
|
(event) => {
|
|
74
|
-
if (onClose && ref.current && !ref.current.contains(event.target as Node)) {
|
|
74
|
+
if (onClose && ref.current && !ref.current.contains(event.target as Node) && visible) {
|
|
75
75
|
onClose(event as MouseEvent);
|
|
76
76
|
}
|
|
77
77
|
},
|
|
@@ -93,19 +93,36 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
preventOverflow: {
|
|
102
|
-
boundariesElement: 'window',
|
|
103
|
-
},
|
|
104
|
-
flip: {
|
|
105
|
-
behavior: 'flip',
|
|
106
|
-
enabled: flip,
|
|
96
|
+
const modifiers: any[] = [
|
|
97
|
+
{
|
|
98
|
+
name: 'offset',
|
|
99
|
+
options: {
|
|
100
|
+
offset: [0, 12],
|
|
107
101
|
},
|
|
108
102
|
},
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
if (sameWidth) {
|
|
106
|
+
modifiers.push({
|
|
107
|
+
enabled: true,
|
|
108
|
+
name: 'sameWidth',
|
|
109
|
+
phase: 'beforeWrite',
|
|
110
|
+
requires: ['computeStyles'],
|
|
111
|
+
fn: ({ state }: any) => {
|
|
112
|
+
// eslint-disable-next-line no-param-reassign
|
|
113
|
+
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
114
|
+
},
|
|
115
|
+
effect: ({ state }: any) => {
|
|
116
|
+
// eslint-disable-next-line no-param-reassign
|
|
117
|
+
state.elements.popper.style.width = `${state.elements.reference.getBoundingClientRect().width || 0}px`;
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const popperProps: PopperProps<any> = {
|
|
123
|
+
children: () => null,
|
|
124
|
+
placement: desiredPlacement,
|
|
125
|
+
modifiers,
|
|
109
126
|
};
|
|
110
127
|
|
|
111
128
|
if (referenceElement) {
|
|
@@ -116,37 +133,36 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
116
133
|
// eslint-disable-next-line no-return-assign
|
|
117
134
|
<Popper {...popperProps} innerRef={(el) => (ref.current = el || null)}>
|
|
118
135
|
{/* eslint-disable-next-line @typescript-eslint/no-shadow */}
|
|
119
|
-
{({ arrowProps, placement, ref,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
'Placement
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
)}
|
|
136
|
+
{({ arrowProps, placement, ref, update, style }) => {
|
|
137
|
+
return (
|
|
138
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
139
|
+
<PlacementArrowPropsContext.Provider value={{ ...arrowProps, backgroundColor }}>
|
|
140
|
+
<div
|
|
141
|
+
className={classnames('Placement', `Placement--${placement}`, {
|
|
142
|
+
'Placement--above-modal': isInsideModal,
|
|
143
|
+
'Placement--animate': animatePosition,
|
|
144
|
+
})}
|
|
145
|
+
ref={ref}
|
|
146
|
+
style={style}
|
|
147
|
+
>
|
|
148
|
+
<CSSTransition appear={visible} classNames={transitionClasses} in={visible} timeout={timeout}>
|
|
149
|
+
<div className="Placement__content">
|
|
150
|
+
<Base {...rest} backgroundColor={backgroundColor} className="Placement__shadow">
|
|
151
|
+
<PlacementManagerContext.Consumer>
|
|
152
|
+
{({ referenceNode }) =>
|
|
153
|
+
children({
|
|
154
|
+
update,
|
|
155
|
+
width: (referenceNode && referenceNode.clientWidth) || undefined,
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
</PlacementManagerContext.Consumer>
|
|
159
|
+
</Base>
|
|
160
|
+
</div>
|
|
161
|
+
</CSSTransition>
|
|
162
|
+
</div>
|
|
163
|
+
</PlacementArrowPropsContext.Provider>
|
|
164
|
+
);
|
|
165
|
+
}}
|
|
150
166
|
</Popper>,
|
|
151
167
|
document.body,
|
|
152
168
|
);
|
package/src/Tooltip/Tooltip.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReferenceChildrenProps } from 'react-popper';
|
|
3
|
-
import { Placement as TypePlacement } from '
|
|
3
|
+
import { Placement as TypePlacement } from '@popperjs/core';
|
|
4
4
|
import { Props as BaseProps } from '../Base/Base';
|
|
5
5
|
import Placement from '../Placement/Placement';
|
|
6
6
|
import PlacementArea from '../Placement/PlacementArea';
|