@wonderflow/react-components 2.18.2 → 2.18.6
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/dropdown/dropdown-menu.module.css +1 -1
- package/dropdown/dropdown.js +10 -6
- package/package.json +19 -19
- package/prose/prose.module.css +1 -1
- package/themes/dark.css +1 -1
- package/themes/light.css +2 -2
- package/themes/light.json +1 -1
- package/themes.css +4 -4
package/dropdown/dropdown.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import React, { useState, Children, cloneElement } from 'react';
|
|
3
|
-
import { useKey } from 'react-use';
|
|
2
|
+
import React, { useState, Children, cloneElement, useRef } from 'react';
|
|
3
|
+
import { useKey, useClickAway } from 'react-use';
|
|
4
4
|
import { Dropdown as DropdownClass, PopUp } from './dropdown.module.css';
|
|
5
5
|
import { useUIDSeed } from 'react-uid';
|
|
6
6
|
import { useFocusWithin } from '@react-aria/interactions';
|
|
@@ -10,6 +10,7 @@ import { usePopperTooltip } from 'react-popper-tooltip';
|
|
|
10
10
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
11
11
|
export const Dropdown = ({ className, children, trigger, offset = 8, placement = 'auto-start' }) => {
|
|
12
12
|
const seedID = useUIDSeed();
|
|
13
|
+
const popupRef = useRef(null);
|
|
13
14
|
const [isOpen, setIsOpen] = useState(false);
|
|
14
15
|
const { getTooltipProps, setTooltipRef, setTriggerRef, visible } = usePopperTooltip({
|
|
15
16
|
delayShow: 0,
|
|
@@ -19,9 +20,12 @@ export const Dropdown = ({ className, children, trigger, offset = 8, placement =
|
|
|
19
20
|
closeOnTriggerHidden: true,
|
|
20
21
|
onVisibleChange: setIsOpen,
|
|
21
22
|
placement: placement,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
interactive: true,
|
|
24
|
+
offset: [0, offset],
|
|
25
|
+
closeOnOutsideClick: false
|
|
26
|
+
});
|
|
27
|
+
useClickAway(popupRef, () => {
|
|
28
|
+
setIsOpen(false);
|
|
25
29
|
});
|
|
26
30
|
const { focusWithinProps } = useFocusWithin({
|
|
27
31
|
onFocusWithin: () => null,
|
|
@@ -29,7 +33,7 @@ export const Dropdown = ({ className, children, trigger, offset = 8, placement =
|
|
|
29
33
|
onFocusWithinChange: () => null
|
|
30
34
|
});
|
|
31
35
|
useKey('Escape', () => setIsOpen(false));
|
|
32
|
-
return (React.createElement("div", Object.assign({ className: clsx(DropdownClass, className) }, focusWithinProps),
|
|
36
|
+
return (React.createElement("div", Object.assign({ ref: popupRef, className: clsx(DropdownClass, className) }, focusWithinProps),
|
|
33
37
|
Children.map(trigger, (child) => cloneElement(child, {
|
|
34
38
|
ref: setTriggerRef,
|
|
35
39
|
id: seedID('dropdown-trigger'),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wonderflow/react-components",
|
|
3
3
|
"description": "UI components from Wonderflow's Wanda design system",
|
|
4
|
-
"version": "2.18.
|
|
4
|
+
"version": "2.18.6",
|
|
5
5
|
"author": "Wonderflow",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "index.js",
|
|
@@ -55,15 +55,15 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@bumaga/tabs": "0.2.0",
|
|
57
57
|
"@radix-ui/react-polymorphic": "0.0.13",
|
|
58
|
-
"@react-aria/interactions": "3.
|
|
58
|
+
"@react-aria/interactions": "3.6.0",
|
|
59
59
|
"@wonderflow/config": "1.4.7",
|
|
60
60
|
"@wonderflow/eslint-config": "1.1.0",
|
|
61
61
|
"@wonderflow/stylelint-config": "1.0.1",
|
|
62
|
-
"@wonderflow/tokens": "1.3.
|
|
62
|
+
"@wonderflow/tokens": "1.3.4",
|
|
63
63
|
"clsx": "1.1.1",
|
|
64
64
|
"flat": "5.0.2",
|
|
65
65
|
"framer-motion": "4.1.17",
|
|
66
|
-
"postcss": "8.3.
|
|
66
|
+
"postcss": "8.3.7",
|
|
67
67
|
"react": ">=17.0.2",
|
|
68
68
|
"react-dom": ">=17.0.2",
|
|
69
69
|
"react-popper-tooltip": "4.3.0",
|
|
@@ -71,21 +71,21 @@
|
|
|
71
71
|
"react-uid": "2.3.1",
|
|
72
72
|
"react-use": "17.3.1",
|
|
73
73
|
"style-dictionary": "3.0.2",
|
|
74
|
-
"type-fest": "2.
|
|
74
|
+
"type-fest": "2.3.4"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"react": ">=17.0.2",
|
|
78
78
|
"react-dom": ">=17.0.2"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@babel/core": "7.15.
|
|
81
|
+
"@babel/core": "7.15.5",
|
|
82
82
|
"@commitlint/cli": "13.1.0",
|
|
83
83
|
"@commitlint/config-conventional": "13.1.0",
|
|
84
|
-
"@semantic-release/exec": "
|
|
85
|
-
"@semantic-release/git": "
|
|
86
|
-
"@semantic-release/github": "
|
|
87
|
-
"@semantic-release/npm": "
|
|
88
|
-
"@semantic-release/release-notes-generator": "
|
|
84
|
+
"@semantic-release/exec": "6.0.1",
|
|
85
|
+
"@semantic-release/git": "10.0.0",
|
|
86
|
+
"@semantic-release/github": "8.0.1",
|
|
87
|
+
"@semantic-release/npm": "8.0.0",
|
|
88
|
+
"@semantic-release/release-notes-generator": "10.0.2",
|
|
89
89
|
"@storybook/addon-actions": "6.3.8",
|
|
90
90
|
"@storybook/addon-essentials": "6.3.8",
|
|
91
91
|
"@storybook/addon-links": "6.3.8",
|
|
@@ -95,35 +95,35 @@
|
|
|
95
95
|
"@storybook/theming": "6.3.8",
|
|
96
96
|
"@types/flat": "5.0.2",
|
|
97
97
|
"@types/react-dom": "17.0.9",
|
|
98
|
-
"@typescript-eslint/eslint-plugin": "4.
|
|
99
|
-
"@typescript-eslint/parser": "4.
|
|
98
|
+
"@typescript-eslint/eslint-plugin": "4.31.2",
|
|
99
|
+
"@typescript-eslint/parser": "4.31.2",
|
|
100
100
|
"babel-loader": "8.2.2",
|
|
101
101
|
"commit-analyzer-fail-on-no-release": "1.0.0",
|
|
102
102
|
"commitizen": "4.2.4",
|
|
103
103
|
"copyfiles": "2.4.1",
|
|
104
104
|
"cz-conventional-changelog": "3.3.0",
|
|
105
|
-
"directory-tree": "
|
|
105
|
+
"directory-tree": "3.0.0",
|
|
106
106
|
"eslint": "7.32.0",
|
|
107
107
|
"eslint-config-standard": "16.0.3",
|
|
108
108
|
"eslint-plugin-import": "2.24.2",
|
|
109
109
|
"eslint-plugin-jsx-a11y": "6.4.1",
|
|
110
110
|
"eslint-plugin-node": "11.1.0",
|
|
111
111
|
"eslint-plugin-promise": "5.1.0",
|
|
112
|
-
"eslint-plugin-react": "7.
|
|
112
|
+
"eslint-plugin-react": "7.26.0",
|
|
113
113
|
"fs-extra": "10.0.0",
|
|
114
114
|
"husky": "7.0.2",
|
|
115
115
|
"is-ci": "3.0.0",
|
|
116
116
|
"npm-run-all": "4.1.5",
|
|
117
117
|
"ora": "5.4.1",
|
|
118
118
|
"rimraf": "3.0.2",
|
|
119
|
-
"semantic-release": "
|
|
119
|
+
"semantic-release": "18.0.0",
|
|
120
120
|
"storybook-addon-themes": "6.1.0",
|
|
121
121
|
"storybook-css-modules-preset": "1.1.1",
|
|
122
122
|
"stylelint": "13.13.1",
|
|
123
|
-
"svgo": "2.
|
|
123
|
+
"svgo": "2.7.0",
|
|
124
124
|
"svgstore": "3.0.0-2",
|
|
125
|
-
"typescript": "4.3
|
|
125
|
+
"typescript": "4.4.3",
|
|
126
126
|
"typescript-plugin-css-modules": "3.4.0",
|
|
127
|
-
"yargs": "17.
|
|
127
|
+
"yargs": "17.2.0"
|
|
128
128
|
}
|
|
129
129
|
}
|
package/prose/prose.module.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@custom-selector :--headings h1, h2, h3, h4, h5, h6;
|
|
2
|
-
@custom-selector :--blocks h1, h2, h3, h4, h5, h6, hgroup, ul, ol, dd, p, figure, img, pre, table, fieldset, blockquote;
|
|
2
|
+
@custom-selector :--blocks h1, h2, h3, h4, h5, h6, hgroup, ul, ol, dd, p, figure, img, pre, table, fieldset, blockquote, picture;
|
|
3
3
|
|
|
4
4
|
.Prose {
|
|
5
5
|
& > :--headings:is(:--headings) {
|
package/themes/dark.css
CHANGED
package/themes/light.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Mon, 27 Sep 2021 07:30:47 GMT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
:root {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
--cta-default: hsl(0 100% 47%);
|
|
17
17
|
--cta-dark: hsl(0 100% 41%);
|
|
18
18
|
--cta-foreground: hsl(0 0% 100%);
|
|
19
|
-
--dimmed-0: hsl(
|
|
19
|
+
--dimmed-0: hsl(210 20% 98%);
|
|
20
20
|
--dimmed-1: hsl(220 19% 91%);
|
|
21
21
|
--dimmed-2: hsl(220 16% 85%);
|
|
22
22
|
--dimmed-3: hsl(219 14% 75%);
|
package/themes/light.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"cta-default": "hsl(0 100% 47%)",
|
|
12
12
|
"cta-dark": "hsl(0 100% 41%)",
|
|
13
13
|
"cta-foreground": "hsl(0 0% 100%)",
|
|
14
|
-
"dimmed-0": "hsl(
|
|
14
|
+
"dimmed-0": "hsl(210 20% 98%)",
|
|
15
15
|
"dimmed-1": "hsl(220 19% 91%)",
|
|
16
16
|
"dimmed-2": "hsl(220 16% 85%)",
|
|
17
17
|
"dimmed-3": "hsl(219 14% 75%)",
|
package/themes.css
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
color: var(--global-foreground);
|
|
5
5
|
/**
|
|
6
6
|
* Do not edit directly
|
|
7
|
-
* Generated on
|
|
7
|
+
* Generated on Mon, 27 Sep 2021 07:30:47 GMT
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
--cta-default: hsl(0 100% 47%);
|
|
21
21
|
--cta-dark: hsl(0 100% 41%);
|
|
22
22
|
--cta-foreground: hsl(0 0% 100%);
|
|
23
|
-
--dimmed-0: hsl(
|
|
23
|
+
--dimmed-0: hsl(210 20% 98%);
|
|
24
24
|
--dimmed-1: hsl(220 19% 91%);
|
|
25
25
|
--dimmed-2: hsl(220 16% 85%);
|
|
26
26
|
--dimmed-3: hsl(219 14% 75%);
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
color: var(--global-foreground);
|
|
52
52
|
/**
|
|
53
53
|
* Do not edit directly
|
|
54
|
-
* Generated on
|
|
54
|
+
* Generated on Mon, 27 Sep 2021 07:30:47 GMT
|
|
55
55
|
*/
|
|
56
56
|
|
|
57
57
|
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
color: var(--global-foreground);
|
|
100
100
|
/**
|
|
101
101
|
* Do not edit directly
|
|
102
|
-
* Generated on
|
|
102
|
+
* Generated on Mon, 27 Sep 2021 07:30:47 GMT
|
|
103
103
|
*/
|
|
104
104
|
|
|
105
105
|
|