@wonderflow/react-components 11.0.5 → 11.0.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disclosure.d.ts","sourceRoot":"","sources":["../../../src/components/disclosure/disclosure.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAEL,qBAAqB,EACrB,SAAS,EACV,MAAM,OAAO,CAAC;AASf,oBAAY,eAAe,GAAG,qBAAqB,CAAC,kBAAkB,CAAC,GAAG;IACxE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAA;AAED,eAAO,MAAM,UAAU;IAnCrB;;OAEG;;IAEH;;;OAGG;aACM,SAAS;IAClB;;;;OAIG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;
|
|
1
|
+
{"version":3,"file":"disclosure.d.ts","sourceRoot":"","sources":["../../../src/components/disclosure/disclosure.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAEL,qBAAqB,EACrB,SAAS,EACV,MAAM,OAAO,CAAC;AASf,oBAAY,eAAe,GAAG,qBAAqB,CAAC,kBAAkB,CAAC,GAAG;IACxE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAA;AAED,eAAO,MAAM,UAAU;IAnCrB;;OAEG;;IAEH;;;OAGG;aACM,SAAS;IAClB;;;;OAIG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;sDA8GH,CAAC"}
|
|
@@ -32,8 +32,9 @@ export const Disclosure = forwardRef(({ children, open = false, padding = true,
|
|
|
32
32
|
const handleOpen = useCallback(() => () => {
|
|
33
33
|
if (ref.current && expandable)
|
|
34
34
|
setIsOpen(open || ref.current.open);
|
|
35
|
-
if (expandable
|
|
35
|
+
if (expandable) {
|
|
36
36
|
onToggle?.(open || ref.current.open);
|
|
37
|
+
}
|
|
37
38
|
}, [expandable, onToggle, open]);
|
|
38
39
|
const dynamicStyle = {
|
|
39
40
|
'--max-height': contentMaxHeight,
|
|
@@ -53,7 +54,7 @@ export const Disclosure = forwardRef(({ children, open = false, padding = true,
|
|
|
53
54
|
},
|
|
54
55
|
};
|
|
55
56
|
return (_jsxs("details", { style: { ...dynamicStyle, ...style }, className: clsx(styles.Disclosure, className), "data-testid": "Disclosure", "data-disclosure-icon-position": iconPosition, "data-disclosure-dimension": dimension, "data-disclosure-expandable": expandable, onToggle: handleOpen(), ref: ref, open: isOpen, "aria-controls": seedID('disclosure-content'), ...otherProps, children: [_jsxs(Text, { as: "summary", responsive: false, className: styles.Summary, id: seedID('disclosure'), size: sizes[dimension].summary, weight: "bold", "aria-expanded": isOpen, children: [summary, expandable && (_jsx(Symbol, { className: styles.ExpandIcon, source: "chevron-right", dimension: sizes[dimension].icon }))] }), _jsx(LazyMotion, { features: domMax, children: _jsx(m.div, { id: seedID('disclosure-content'), className: styles.Content, "data-disclosure-padding": padding, "data-disclosure-height": Boolean(contentMaxHeight), animate: isOpen ? {
|
|
56
|
-
y: 5, opacity: 1, height: 'auto', overflow: '
|
|
57
|
+
y: 5, opacity: 1, height: 'auto', overflow: 'initial',
|
|
57
58
|
} : {
|
|
58
59
|
y: 0, opacity: 0, height: 0, overflow: 'hidden',
|
|
59
60
|
}, transition: { ease: 'easeOut', duration: 0.2, delay: 0 }, initial: false, role: "region", "aria-labelledby": seedID('disclosure'), children: children }) })] }));
|
|
@@ -31,7 +31,7 @@ const story = {
|
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
export default story;
|
|
34
|
-
const Template = args => (_jsxs(Disclosure, { ...args, children: [_jsxs(Autocomplete, { style: { maxWidth: '300px', padding: '0.5rem 0' }, icon: "magnifying-glass", label: "Fruits", children: [_jsx(Autocomplete.Option, { value: "apple", children: "Apple" }), _jsx(Autocomplete.Option, { value: "banana", decoration: _jsx(Chip, { dimension: "small", color: "green", children: "110 Cal" }), children: "Banana" }), _jsx(Autocomplete.Option, { value: "cherry", children: "Cherry" })] }), _jsxs("
|
|
34
|
+
const Template = args => (_jsxs(Disclosure, { ...args, children: [_jsxs(Autocomplete, { style: { maxWidth: '300px', padding: '0.5rem 0' }, icon: "magnifying-glass", label: "Fruits", children: [_jsx(Autocomplete.Option, { value: "apple", children: "Apple" }), _jsx(Autocomplete.Option, { value: "banana", decoration: _jsx(Chip, { dimension: "small", color: "green", children: "110 Cal" }), children: "Banana" }), _jsx(Autocomplete.Option, { value: "cherry", children: "Cherry" })] }), _jsxs("div", { children: ["Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus corporis nobis ipsum natus laudantium dolorem sapiente, sint adipisci at asperiores quia ex voluptatum veniam! Quos rerum natus eos excepturi atque!", ' ', _jsx(Popover, { trigger: _jsx(IconButton, { icon: "circle-info", dimension: "small", kind: "flat" }), children: _jsx(Menu, { style: { maxWidth: '300px' }, children: _jsx(MenuItem, { value: "1", children: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus corporis nobis ipsum natus laudantium dolorem sapiente, sint adipisci at asperiores quia ex voluptatum veniam! Quos rerum natus eos excepturi atque!" }) }) })] })] }));
|
|
35
35
|
export const Default = Template.bind({});
|
|
36
36
|
const NestedTemplate = args => (_jsxs(Disclosure, { ...args, children: [_jsxs(Autocomplete, { style: { maxWidth: '300px', padding: '0.5rem 0' }, icon: "magnifying-glass", label: "Fruits", children: [_jsx(Autocomplete.Option, { value: "apple", children: "Apple" }), _jsx(Autocomplete.Option, { value: "banana", decoration: _jsx(Chip, { dimension: "small", color: "green", children: "110 Cal" }), children: "Banana" }), _jsx(Autocomplete.Option, { value: "cherry", children: "Cherry" })] }), "Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus corporis nobis ipsum natus laudantium dolorem sapiente, sint adipisci at asperiores quia ex voluptatum veniam! Quos rerum natus eos excepturi atque!", _jsx(Disclosure, { summary: "Nested", children: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus corporis nobis ipsum natus laudantium dolorem sapiente, sint adipisci at asperiores quia ex voluptatum veniam! Quos rerum natus eos excepturi atque!" })] }));
|
|
37
37
|
export const Nested = NestedTemplate.bind({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wonderflow/react-components",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.6",
|
|
4
4
|
"description": "UI components from Wonderflow's Wanda design system",
|
|
5
5
|
"author": "Wonderflow",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"@types/react-dom": "17.0.14",
|
|
83
83
|
"@types/react-table": "7.7.12",
|
|
84
84
|
"@types/react-test-renderer": "18.0.0",
|
|
85
|
-
"@wonderflow/config": "11.0.
|
|
86
|
-
"@wonderflow/tokens": "11.0.
|
|
85
|
+
"@wonderflow/config": "11.0.6",
|
|
86
|
+
"@wonderflow/tokens": "11.0.6",
|
|
87
87
|
"babel-loader": "8.2.5",
|
|
88
88
|
"cpy-cli": "3.1.1",
|
|
89
89
|
"postcss": "8.4.17",
|