@wonderflow/react-components 11.0.3 → 11.0.5
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/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete.js +1 -1
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/disclosure/disclosure.d.ts.map +1 -1
- package/dist/components/disclosure/disclosure.js +3 -1
- package/dist/components/disclosure/disclosure.stories.d.ts.map +1 -1
- package/dist/components/disclosure/disclosure.stories.js +2 -2
- package/dist/components/select/select.js +1 -1
- package/dist/components/selection-controls/checkbox.d.ts.map +1 -1
- package/dist/components/selection-controls/checkbox.js +1 -1
- package/dist/components/selection-controls/radio.d.ts.map +1 -1
- package/dist/components/selection-controls/radio.js +1 -1
- package/dist/components/selection-controls/selection-controls.module.css +1 -1
- package/dist/components/selection-controls/toggle.d.ts.map +1 -1
- package/dist/components/selection-controls/toggle.js +1 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/table/table.module.css +1 -1
- package/dist/examples/shell.module.css +1 -0
- package/dist/examples/shell.stories.d.ts +6 -0
- package/dist/examples/shell.stories.d.ts.map +1 -0
- package/dist/examples/shell.stories.js +40 -0
- package/dist/hooks/useBreakpointsConfig.d.ts.map +1 -1
- package/dist/hooks/useBreakpointsConfig.js +2 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/autocomplete.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAC+B,yBAAyB,EAG7D,SAAS,EAEV,MAAM,OAAO,CAAC;AAMf,OAAO,EACmC,cAAc,EACvD,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAiB,SAAS,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAsB,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEpF,aAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAA;AAED,oBAAY,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC;IAC5D;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB,CAAC,CAAC,CAAC;AAEJ,aAAK,qBAAqB,GAAG,yBAAyB,CAAC,iBAAiB,CAAC,GAAG;IAC1E,MAAM,EAAE,yBAAyB,CAAC,uBAAuB,CAAC,CAAC;CAC5D,CAAA;AAqBD,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/autocomplete.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAC+B,yBAAyB,EAG7D,SAAS,EAEV,MAAM,OAAO,CAAC;AAMf,OAAO,EACmC,cAAc,EACvD,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAiB,SAAS,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAsB,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEpF,aAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAA;AAED,oBAAY,iBAAiB,GAAG,cAAc,CAAC,cAAc,CAAC;IAC5D;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB,CAAC,CAAC,CAAC;AAEJ,aAAK,qBAAqB,GAAG,yBAAyB,CAAC,iBAAiB,CAAC,GAAG;IAC1E,MAAM,EAAE,yBAAyB,CAAC,uBAAuB,CAAC,CAAC;CAC5D,CAAA;AAqBD,eAAO,MAAM,YAAY,uBAyKE,CAAC"}
|
|
@@ -107,7 +107,7 @@ export const Autocomplete = forwardRef(({ children, onChange, disabled, readOnly
|
|
|
107
107
|
setValue(String(val));
|
|
108
108
|
setOptionValues(currentValues);
|
|
109
109
|
}, [filteredOptions, val]);
|
|
110
|
-
return (_jsxs("div", { ref: autocompleteRef, className: styles.Autocomplete, "data-focus-within": isFocusWithin, children: [_jsx(Textfield, {
|
|
110
|
+
return (_jsxs("div", { ref: autocompleteRef, className: styles.Autocomplete, "data-focus-within": isFocusWithin, children: [_jsx(Textfield, { "aria-haspopup": true, "aria-controls": seedID('autocomplete-menu'), "aria-expanded": isOpen, role: "combobox", ref: mergeRefs([setTriggerRef, forwardedRef]), id: seedID('autocomplete-trigger'), onChange: handleFilter, "data-testid": "Autocomplete", "data-current-value": value, value: query, autoComplete: "off", disabled: disabled, readOnly: readOnly, ...otherProps }, seedID('autocomplete-trigger')), visible && createPortal(_jsx(AnimatePresence, { children: _jsx("div", { ref: setTooltipRef, ...getTooltipProps({ className: styles.PopUp, style: { minInlineSize: triggerSize ? (triggerSize.width + 2) : 'auto' } }), children: _jsx(LazyMotion, { features: domMax, strict: true, children: _jsx(m.div, { variants: AutocompleteAnimation, initial: "hidden", animate: "visible", exit: "hidden", children: _jsxs(Menu, { role: "listbox", id: seedID('autocomplete-menu'), className: styles.OptionsList, maxHeight: maxHeight, "aria-labelledby": seedID('autocomplete-trigger'), children: [(filteredOptions.length === 0 && !busy) && _jsx(Text, { as: "div", textAlign: "center", dimmed: 5, children: emptyContent }), busy
|
|
111
111
|
? _jsx(Stack, { hPadding: 8, as: "span", children: _jsx(Skeleton, { count: 3 }) })
|
|
112
112
|
: Children.map(filteredOptions, child => isValidElement(child) && cloneElement(child, {
|
|
113
113
|
onClick: handleOptionClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAAO,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAS,UAAU,EAAE,MAAM,cAAc,CAAC;AAI9D,oBAAY,SAAS,GAAG,IAAI,CAC5B,UAAU,EACV,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,GACpD;IACA;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IACvC;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAA;AAED,aAAK,eAAe,GAAG,WAAW,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAEzE,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAAO,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAS,UAAU,EAAE,MAAM,cAAc,CAAC;AAI9D,oBAAY,SAAS,GAAG,IAAI,CAC5B,UAAU,EACV,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,GACpD;IACA;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IACvC;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAA;AAED,aAAK,eAAe,GAAG,WAAW,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAEzE,eAAO,MAAM,IAAI,iBA+DI,CAAC"}
|
|
@@ -9,5 +9,5 @@ export const Card = forwardRef(({ as: Wrapper = 'div', children, className, padd
|
|
|
9
9
|
'--padding': padding && tkns.space[padding],
|
|
10
10
|
'--radius': radius && tkns.radius[radius],
|
|
11
11
|
};
|
|
12
|
-
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.Card, className), style: { ...dynamicStyle, ...style }, "data-card-dimmed": dimmed, "data-card-bordered": bordered, "data-card-vibrant": vibrant, "data-card-highlight-hover": highlightOnHover, ...otherProps, children: _jsxs(Stack, { direction: "row", className:
|
|
12
|
+
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.Card, className), style: { ...dynamicStyle, ...style }, "data-card-dimmed": dimmed, "data-card-bordered": bordered, "data-card-vibrant": vibrant, "data-card-highlight-hover": highlightOnHover, ...otherProps, children: _jsxs(Stack, { "data-inner-element": "Row", direction: "row", className: styles.Row, fill: false, vAlign: vAlign, hAlign: hAlign, columnGap: columnGap, rowGap: rowGap, wrap: wrap, children: [left && _jsx("div", { className: styles.Left, "data-inner-element": "Left", children: left }), children && (_jsx("div", { className: styles.Content, "data-inner-element": "Content", children: children })), right && (_jsx("div", { className: styles.Right, "data-inner-element": "Right", children: right }))] }) }));
|
|
13
13
|
});
|
|
@@ -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;;sDA4GH,CAAC"}
|
|
@@ -52,7 +52,9 @@ export const Disclosure = forwardRef(({ children, open = false, padding = true,
|
|
|
52
52
|
icon: 24,
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
|
-
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, ...otherProps, children: [_jsxs(Text, { as: "summary", responsive: false, className: styles.Summary, id: seedID('disclosure'), size: sizes[dimension].summary, weight: "bold", children: [summary, expandable && (_jsx(Symbol, { className: styles.ExpandIcon, source: "chevron-right", dimension: sizes[dimension].icon }))] }), _jsx(LazyMotion, { features: domMax, children: _jsx(m.div, { className: styles.Content, "data-disclosure-padding": padding, "data-disclosure-height": Boolean(contentMaxHeight), animate: isOpen ? {
|
|
55
|
+
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: 'unset',
|
|
57
|
+
} : {
|
|
56
58
|
y: 0, opacity: 0, height: 0, overflow: 'hidden',
|
|
57
59
|
}, transition: { ease: 'easeOut', duration: 0.2, delay: 0 }, initial: false, role: "region", "aria-labelledby": seedID('disclosure'), children: children }) })] }));
|
|
58
60
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disclosure.stories.d.ts","sourceRoot":"","sources":["../../../src/components/disclosure/disclosure.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,UAAU,CAwB3C,CAAC;AAEF,eAAe,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"disclosure.stories.d.ts","sourceRoot":"","sources":["../../../src/components/disclosure/disclosure.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,UAAU,CAwB3C,CAAC;AAEF,eAAe,KAAK,CAAC;AA2CrB,eAAO,MAAM,OAAO;;;;;;;;uDAAoB,CAAC;AAmCzC,eAAO,MAAM,MAAM;;;;;;;;uDAA0B,CAAC"}
|
|
@@ -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", 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("p", { 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!" }) }) })] })] }));
|
|
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("p", { 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
|
-
const NestedTemplate = args => (_jsxs(Disclosure, { ...args, children: [_jsxs(Autocomplete, { style: { maxWidth: '300px', padding: '0.5rem 0' }, icon: "magnifying-glass", 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!" })] }));
|
|
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({});
|
|
@@ -26,6 +26,6 @@ export const Select = forwardRef(({ children, className, disabled = false, icon
|
|
|
26
26
|
regular: 16,
|
|
27
27
|
big: 24,
|
|
28
28
|
};
|
|
29
|
-
return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(styles.Select, className), "data-select-is-multiple": kind === 'multiple', "data-select-has-label": Boolean(label), "data-select-dimension": dimension, "aria-disabled": disabled, hAlign: "start", vAlign: "start", inline: true, tabIndex: disabled ? 0 : undefined, children: [label && _jsx(Text, { as: "label", "aria-disabled": disabled, className: styles.Label, size: dimension === 'small' ? 14 : 16, htmlFor: seedID('select'), children: label }), _jsxs("div", { className: styles.FieldContainer, children: [_jsx("select", { disabled: disabled, className: styles.Field, id: seedID('select'), multiple: kind === 'multiple', onChange: onChange, ref: forwardedRef, ...otherProps, children: children }), kind === 'single' && (_jsx(Symbol, { className: styles.Icon, source: icon, dimension: iconSizes[dimension] }))] })] }));
|
|
29
|
+
return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(styles.Select, className), "data-select-is-multiple": kind === 'multiple', "data-select-has-label": Boolean(label), "data-select-dimension": dimension, "aria-disabled": disabled, hAlign: "start", vAlign: "start", inline: true, tabIndex: disabled ? 0 : undefined, children: [label && _jsx(Text, { as: "label", lineHeight: "small", "aria-disabled": disabled, className: styles.Label, size: dimension === 'small' ? 14 : 16, htmlFor: seedID('select'), children: label }), _jsxs("div", { className: styles.FieldContainer, children: [_jsx("select", { disabled: disabled, className: styles.Field, id: seedID('select'), multiple: kind === 'multiple', onChange: onChange, ref: forwardedRef, ...otherProps, children: children }), kind === 'single' && (_jsx(Symbol, { className: styles.Icon, source: icon, dimension: iconSizes[dimension] }))] })] }));
|
|
30
30
|
});
|
|
31
31
|
Select.displayName = 'Select';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/checkbox.tsx"],"names":[],"mappings":"AAkBA,OAAO,EACL,WAAW,EAAc,mBAAmB,EAC7C,MAAM,OAAO,CAAC;AAOf,oBAAY,aAAa,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAClE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC3D,CAAA;AAED,eAAO,MAAM,QAAQ;IA1BnB;;OAEG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;OAGG;wBACgB,YAAY,gBAAgB,CAAC,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/checkbox.tsx"],"names":[],"mappings":"AAkBA,OAAO,EACL,WAAW,EAAc,mBAAmB,EAC7C,MAAM,OAAO,CAAC;AAOf,oBAAY,aAAa,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAClE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC3D,CAAA;AAED,eAAO,MAAM,QAAQ;IA1BnB;;OAEG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;OAGG;wBACgB,YAAY,gBAAgB,CAAC,KAAK,IAAI;oDAqEzD,CAAC"}
|
|
@@ -29,6 +29,6 @@ export const Checkbox = forwardRef(({ className, disabled, dimension = 'regular'
|
|
|
29
29
|
ref.current.indeterminate = indeterminate;
|
|
30
30
|
}
|
|
31
31
|
}, [indeterminate]);
|
|
32
|
-
return (_jsx(LazyMotion, { features: domAnimation, strict: true, children: _jsx(m.span, { className: clsx(styles.InputWrapper, className), whileTap: { scale: 1.15 }, transition: { duration: 0.3, ease: 'backOut' }, "data-radio-control": hidden, children:
|
|
32
|
+
return (_jsxs(Stack, { as: "span", direction: "row", columnGap: 8, vAlign: "center", fill: false, wrap: true, children: [_jsx(LazyMotion, { features: domAnimation, strict: true, children: _jsx(m.span, { className: clsx(styles.InputWrapper, className), whileTap: { scale: 1.15 }, transition: { duration: 0.3, ease: 'backOut' }, "data-radio-control": hidden, children: _jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: styles.CheckboxInput, ref: ref, hidden: hidden, id: fieldID, ...otherProps }) }) }), label && (_jsx(Text, { as: "label", "aria-disabled": disabled, className: styles.Label, htmlFor: fieldID, size: dimension === 'small' ? 14 : 16, title: otherProps?.title, children: label }))] }));
|
|
33
33
|
});
|
|
34
34
|
Checkbox.displayName = 'Checkbox';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/radio.tsx"],"names":[],"mappings":"AAkBA,OAAO,EACL,WAAW,EAAc,mBAAmB,EAC7C,MAAM,OAAO,CAAC;AAOf,oBAAY,UAAU,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC3D,CAAA;AAED,eAAO,MAAM,KAAK;IArBhB;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;OAGG;wBACgB,YAAY,gBAAgB,CAAC,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/radio.tsx"],"names":[],"mappings":"AAkBA,OAAO,EACL,WAAW,EAAc,mBAAmB,EAC7C,MAAM,OAAO,CAAC;AAOf,oBAAY,UAAU,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC3D,CAAA;AAED,eAAO,MAAM,KAAK;IArBhB;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;OAGG;wBACgB,YAAY,gBAAgB,CAAC,KAAK,IAAI;oDA4DzD,CAAC"}
|
|
@@ -23,6 +23,6 @@ import * as styles from './selection-controls.module.css';
|
|
|
23
23
|
export const Radio = forwardRef(({ className, disabled, id, label, dimension = 'regular', onChange, hidden, ...otherProps }, forwardedRef) => {
|
|
24
24
|
const seedID = useUIDSeed();
|
|
25
25
|
const fieldID = useMemo(() => id ?? seedID('radio'), [id, seedID]);
|
|
26
|
-
return (_jsx(LazyMotion, { features: domAnimation, strict: true, children: _jsx(m.span, { className: clsx(styles.InputWrapper, className), whileTap: { scale: 1.15 }, transition: { duration: 0.3, ease: 'backOut' }, "data-radio-control": hidden, children:
|
|
26
|
+
return (_jsxs(Stack, { as: "span", direction: "row", columnGap: 8, vAlign: "center", fill: false, wrap: true, children: [_jsx(LazyMotion, { features: domAnimation, strict: true, children: _jsx(m.span, { className: clsx(styles.InputWrapper, className), whileTap: { scale: 1.15 }, transition: { duration: 0.3, ease: 'backOut' }, "data-radio-control": hidden, children: _jsx("input", { type: "radio", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: styles.RadioInput, ref: forwardedRef, hidden: hidden, id: fieldID, ...otherProps }) }) }), label && (_jsx(Text, { as: "label", "aria-disabled": disabled, className: styles.Label, size: dimension === 'small' ? 14 : 16, htmlFor: fieldID, title: otherProps?.title, children: label }))] }));
|
|
27
27
|
});
|
|
28
28
|
Radio.displayName = 'Radio';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.InputWrapper{display:inline-block;line-height:0}.InputWrapper[data-radio-control=true]{position:absolute}.CheckboxInput{--w:24px;--h:24px;appearance:none;-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background);block-size:var(--h);border-radius:.25rem;box-shadow:0 0 0 1px var(--global-background),inset 0 0 0 1px var(--dimmed-2);color:var(--global-background);inline-size:var(--w);max-block-size:var(--h);max-inline-size:var(--w);position:relative}.CheckboxInput:after{block-size:27%;border-bottom:2px solid;border-left:2px solid;content:"";display:none;inline-size:50%;left:50%;position:absolute;top:50%;transform:translate(-50%,-80%) rotate(-45deg)}.CheckboxInput:active{background-color:var(--global-vibrancy-background-hard)}.CheckboxInput:checked,.CheckboxInput:indeterminate{background:var(--dimmed-7);box-shadow:0 0 0 1px var(--global-background),inset 0 0 0 1px transparent}.CheckboxInput:checked:after,.CheckboxInput:indeterminate:after{display:block}.CheckboxInput:disabled{background-color:var(--global-disabled-background);box-shadow:none;color:var(--global-disabled-foreground);cursor:not-allowed}.CheckboxInput[data-control-dimension=small]{--w:16px;--h:16px}.CheckboxInput:indeterminate:after{block-size:2px;border-left:0;transform:translate(-50%,-50%)}.RadioInput{composes:CheckboxInput;border-radius:100%}.RadioInput:after{background-color:currentcolor;block-size:50%;border:0;border-radius:100%;inline-size:50%;transform:translate(-50%,-50%)}.RadioInput:disabled{box-shadow:none}.RadioInput:indeterminate{background-color:var(--global-vibrancy-background);box-shadow:0 0 0 1px var(--global-background),inset 0 0 0 1px var(--dimmed-2)}.RadioInput:indeterminate:disabled{box-shadow:none}.RadioInput:indeterminate:after{block-size:0}.Toggle{--w:44px;--h:24px;--p:2px;composes:RadioInput;border-radius:200px;color:var(--dimmed-7)}.Toggle:checked{color:var(--global-background)}.Toggle:disabled{color:var(--global-disabled-foreground)}.Toggle:after{block-size:calc(var(--h) - var(--p)*2);bottom:var(--p);display:block;inline-size:calc(var(--h) - var(--p)*2);left:var(--p);top:var(--p);transform:none;transition:transform .1s cubic-bezier(.3,.07,.34,1),background-color .1s cubic-bezier(.3,.07,.34,1)}.Toggle:checked:after{display:block;transform:translateX(100%)}.Toggle[data-control-dimension=small]{--w:28px;--h:16px}.Label[aria-disabled=true]{color:var(--global-disabled-foreground);cursor:not-allowed}}
|
|
1
|
+
@layer components{.InputWrapper{cursor:none;display:inline-block;line-height:0}.InputWrapper:hover{cursor:pointer}.InputWrapper[data-radio-control=true]{position:absolute}.CheckboxInput{--w:24px;--h:24px;appearance:none;-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background);block-size:var(--h);border-radius:.25rem;box-shadow:0 0 0 1px var(--global-background),inset 0 0 0 1px var(--dimmed-2);color:var(--global-background);cursor:none;inline-size:var(--w);max-block-size:var(--h);max-inline-size:var(--w);position:relative}.CheckboxInput:hover{cursor:pointer}.CheckboxInput:after{block-size:27%;border-bottom:2px solid;border-left:2px solid;content:"";display:none;inline-size:50%;left:50%;position:absolute;top:50%;transform:translate(-50%,-80%) rotate(-45deg)}.CheckboxInput:active{background-color:var(--global-vibrancy-background-hard)}.CheckboxInput:checked,.CheckboxInput:indeterminate{background:var(--dimmed-7);box-shadow:0 0 0 1px var(--global-background),inset 0 0 0 1px transparent}.CheckboxInput:checked:after,.CheckboxInput:indeterminate:after{display:block}.CheckboxInput:disabled{background-color:var(--global-disabled-background);box-shadow:none;color:var(--global-disabled-foreground);cursor:not-allowed}.CheckboxInput[data-control-dimension=small]{--w:16px;--h:16px}.CheckboxInput:indeterminate:after{block-size:2px;border-left:0;transform:translate(-50%,-50%)}.RadioInput{composes:CheckboxInput;border-radius:100%}.RadioInput:after{background-color:currentcolor;block-size:50%;border:0;border-radius:100%;inline-size:50%;transform:translate(-50%,-50%)}.RadioInput:disabled{box-shadow:none}.RadioInput:indeterminate{background-color:var(--global-vibrancy-background);box-shadow:0 0 0 1px var(--global-background),inset 0 0 0 1px var(--dimmed-2)}.RadioInput:indeterminate:disabled{box-shadow:none}.RadioInput:indeterminate:after{block-size:0}.Toggle{--w:44px;--h:24px;--p:2px;composes:RadioInput;border-radius:200px;color:var(--dimmed-7)}.Toggle:checked{color:var(--global-background)}.Toggle:disabled{color:var(--global-disabled-foreground)}.Toggle:after{block-size:calc(var(--h) - var(--p)*2);bottom:var(--p);display:block;inline-size:calc(var(--h) - var(--p)*2);left:var(--p);top:var(--p);transform:none;transition:transform .1s cubic-bezier(.3,.07,.34,1),background-color .1s cubic-bezier(.3,.07,.34,1)}.Toggle:checked:after{display:block;transform:translateX(100%)}.Toggle[data-control-dimension=small]{--w:28px;--h:16px}.Label{cursor:none}.Label:hover{cursor:pointer}.Label[aria-disabled=true]{color:var(--global-disabled-foreground);cursor:not-allowed}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/toggle.tsx"],"names":[],"mappings":"AAiBA,OAAO,EACL,WAAW,EAAc,mBAAmB,EAC7C,MAAM,OAAO,CAAC;AAOf,oBAAY,WAAW,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAChE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/toggle.tsx"],"names":[],"mappings":"AAiBA,OAAO,EACL,WAAW,EAAc,mBAAmB,EAC7C,MAAM,OAAO,CAAC;AAOf,oBAAY,WAAW,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAChE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IAEH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC3D,CAAA;AAED,eAAO,MAAM,MAAM;IAtBjB;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAGH;;;OAGG;wBACgB,YAAY,gBAAgB,CAAC,KAAK,IAAI;oDAiDzD,CAAC"}
|
|
@@ -22,6 +22,6 @@ import * as styles from './selection-controls.module.css';
|
|
|
22
22
|
export const Toggle = forwardRef(({ className, disabled, id, label, dimension = 'regular', onChange, ...otherProps }, forwardedRef) => {
|
|
23
23
|
const seedID = useUIDSeed();
|
|
24
24
|
const fieldID = useMemo(() => id ?? seedID('toggle'), [id, seedID]);
|
|
25
|
-
return (_jsxs(Stack, { as: "span", direction: "row", columnGap: 8, vAlign: "center", fill: false, wrap: true, children: [_jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(styles.Toggle, className), ref: forwardedRef, id: fieldID, ...otherProps }), label && (_jsx(Text, { as: "label", "aria-disabled": disabled, className: styles.Label, size: dimension === 'small' ? 14 : 16, htmlFor: fieldID, children: label }))] }));
|
|
25
|
+
return (_jsxs(Stack, { as: "span", direction: "row", columnGap: 8, vAlign: "center", fill: false, wrap: true, children: [_jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(styles.Toggle, className), ref: forwardedRef, id: fieldID, ...otherProps }), label && (_jsx(Text, { as: "label", "aria-disabled": disabled, className: styles.Label, size: dimension === 'small' ? 14 : 16, htmlFor: fieldID, title: otherProps?.title, children: label }))] }));
|
|
26
26
|
});
|
|
27
27
|
Toggle.displayName = 'Toggle';
|
|
@@ -28,6 +28,6 @@ export const Slider = forwardRef(({ min = 0, max = 100, step, onInput, className
|
|
|
28
28
|
}, [onInput]);
|
|
29
29
|
const seedID = useUIDSeed();
|
|
30
30
|
const fieldID = useMemo(() => id ?? seedID('slider'), [id, seedID]);
|
|
31
|
-
return (_jsxs(Stack, { direction: "column", rowGap: 8, children: [label && _jsx(Text, { as: "label", size: isSmall ? 14 : 16, className: styles.Label, "aria-disabled": disabled, htmlFor: fieldID, children: label }), _jsxs(Stack, { direction: "row", vAlign: "center", columnGap: 8, className: clsx(styles.Slider, className), "data-slider-dimension": dimension, children: [showValues && _jsx(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", textAlign: "end", className: styles.Value, "aria-disabled": disabled, children: min }), (iconMin && !showValues) && (_jsx(Symbol, { source: iconMin, dimension: isSmall ? 16 : 24, className: styles.Icon, "aria-disabled": disabled })), _jsx("input", { ref: forwardedRef, className: styles.Input, type: "range", min: min, max: max, defaultValue: value, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, "aria-disabled": disabled, step: step, onInput: handleInput, disabled: disabled, id: fieldID, "data-testid": "SliderInput", ...otherProps }), showValues && _jsx(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", className: styles.Value, "aria-disabled": disabled, children: max }), showValues && _jsx(Textfield, { readOnly: true, dimension: "small", size: String(max).length, value: value, disabled: disabled }), (iconMax && !showValues) && (_jsx(Symbol, { source: iconMax, dimension: isSmall ? 16 : 24, className: styles.Icon, "aria-disabled": disabled }))] })] }));
|
|
31
|
+
return (_jsxs(Stack, { direction: "column", rowGap: 8, children: [label && _jsx(Text, { as: "label", lineHeight: "small", size: isSmall ? 14 : 16, className: styles.Label, "aria-disabled": disabled, htmlFor: fieldID, children: label }), _jsxs(Stack, { direction: "row", vAlign: "center", columnGap: 8, className: clsx(styles.Slider, className), "data-slider-dimension": dimension, children: [showValues && _jsx(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", textAlign: "end", className: styles.Value, "aria-disabled": disabled, children: min }), (iconMin && !showValues) && (_jsx(Symbol, { source: iconMin, dimension: isSmall ? 16 : 24, className: styles.Icon, "aria-disabled": disabled })), _jsx("input", { ref: forwardedRef, className: styles.Input, type: "range", min: min, max: max, defaultValue: value, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, "aria-disabled": disabled, step: step, onInput: handleInput, disabled: disabled, id: fieldID, "data-testid": "SliderInput", ...otherProps }), showValues && _jsx(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", className: styles.Value, "aria-disabled": disabled, children: max }), showValues && _jsx(Textfield, { readOnly: true, dimension: "small", size: String(max).length, value: value, disabled: disabled }), (iconMax && !showValues) && (_jsx(Symbol, { source: iconMax, dimension: isSmall ? 16 : 24, className: styles.Icon, "aria-disabled": disabled }))] })] }));
|
|
32
32
|
});
|
|
33
33
|
Slider.displayName = 'Slider';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.Table{position:relative;width:100%;z-index:0}.TableWrapper[data-table-scrolling=true]{-webkit-overflow-scrolling:touch;background:var(--table-background);max-height:var(--table-height);overflow:auto;overscroll-behavior:contain}.TableElement{border-collapse:collapse;font-size:1rem;width:100%}.TableElement[data-table-loading=true]{pointer-events:none;-webkit-user-select:none;user-select:none}.THead{background:var(--table-background);box-shadow:inset 0 -3px 0 var(--dimmed-2);position:sticky;top:0;z-index:2}@media not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){.THead{border-bottom:3px solid var(--dimmed-2);box-shadow:none}}}.THead th{padding-bottom:1rem;padding-top:1rem}.Toast{-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background);border-radius:.5rem;left:0;min-block-size:3.5rem;position:absolute;right:0;top:0;z-index:4}.ExpandButton{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}}
|
|
1
|
+
@layer components{.Table{position:relative;width:100%;z-index:0}.TableWrapper{overflow-x:auto}.TableWrapper[data-table-scrolling=true]{-webkit-overflow-scrolling:touch;background:var(--table-background);max-height:var(--table-height);overflow:auto;overscroll-behavior:contain}.TableElement{border-collapse:collapse;font-size:1rem;width:100%}.TableElement[data-table-loading=true]{pointer-events:none;-webkit-user-select:none;user-select:none}.THead{background:var(--table-background);box-shadow:inset 0 -3px 0 var(--dimmed-2);position:sticky;top:0;z-index:2}@media not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){.THead{border-bottom:3px solid var(--dimmed-2);box-shadow:none}}}.THead th{padding-bottom:1rem;padding-top:1rem}.Toast{-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background);border-radius:.5rem;left:0;min-block-size:3.5rem;position:absolute;right:0;top:0;z-index:4}.ExpandButton{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.MainContainer{background-color:#f9fafb}.LeftMenu{background-color:var(--global-background);border-right:1px solid var(--dimmed-1);max-width:63px;min-width:63px}.LeftMenu[data-is-open=true]{max-width:279px;min-width:279px}.LeftMenuInner{wordbreak:break-all;background-color:var(--dimmed-1);border-bottom:1px solid var(--dimmed-1);height:64px;max-height:64px;padding:.5rem}.LeftMenuInner[data-is-open=true]{background-color:var(--global-background);height:250px;max-height:250px}.MainMenu{maxheight:64px;border-bottom:1px solid var(--dimmed-1);height:64px;padding:0 2rem}.MainMenu,.RightMenu{background-color:var(--global-background)}.RightMenu{border-left:1px solid var(--dimmed-1);max-width:0;min-width:0;overflow:hidden}.RightMenu[data-is-open=true]{max-width:299px;min-width:299px}.RightMenuInner{wordbreak:break-all;background-color:var(--global-background);border-bottom:1px solid var(--dimmed-1);height:4rem;max-height:4rem;padding:.5rem}.Container{height:calc(100vh - 64px);overflow:auto}.Filter{overflowy:scroll;max-height:calc(100vh - 64px)}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import { Container } from '..';
|
|
3
|
+
declare const story: ComponentMeta<typeof Container>;
|
|
4
|
+
export default story;
|
|
5
|
+
export declare const Shell: ComponentStory<import("../types/polymorphic").ForwardRefComponent<"div", import("..").ContainerProps>>;
|
|
6
|
+
//# sourceMappingURL=shell.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.stories.d.ts","sourceRoot":"","sources":["../../src/examples/shell.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQjE,OAAO,EAGL,SAAS,EAOV,MAAM,cAAc,CAAC;AAItB,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,SAAS,CAG1C,CAAC;AAEF,eAAe,KAAK,CAAC;AAuJrB,eAAO,MAAM,KAAK,kHAAoB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { useEffect, useMemo, useRef, useState, } from 'react';
|
|
4
|
+
import { useUIDSeed } from 'react-uid';
|
|
5
|
+
import { Button, Card, Container, Disclosure, Grid, IconButton, Menu, Snackbar, Stack, Text, Title, useBreakpoints, useBreakpointsConfig, useSSR, } from '..';
|
|
6
|
+
import * as style from './shell.module.css';
|
|
7
|
+
const story = {
|
|
8
|
+
title: 'Examples/Wireframe',
|
|
9
|
+
component: Container,
|
|
10
|
+
};
|
|
11
|
+
export default story;
|
|
12
|
+
const Template = () => {
|
|
13
|
+
const [isLeftOpen, setIsLeftOpen] = useState(false);
|
|
14
|
+
const [isRightOpen, setIsRightOpen] = useState(false);
|
|
15
|
+
const ref = useRef(null);
|
|
16
|
+
const seed = useUIDSeed();
|
|
17
|
+
const { isBrowser } = useSSR();
|
|
18
|
+
const { matches, size } = useBreakpoints();
|
|
19
|
+
const linkIcons = useMemo(() => ['accessibility', 'astronomy', 'crown', 'megaphone', 'thumbs-up'], []);
|
|
20
|
+
const { value: containerValue, matches: containerMatches, size: containerSize, } = useBreakpointsConfig({
|
|
21
|
+
sm: { gutter: 16, col: 3, dimension: 'fixed' },
|
|
22
|
+
md: { gutter: 24, col: 3, dimension: 'fixed' },
|
|
23
|
+
lg: { gutter: 24, col: 4, dimension: 'fixed' },
|
|
24
|
+
xl: { gutter: 24, col: 6, dimension: 'fixed' },
|
|
25
|
+
fallback: { gutter: 16, col: 2, dimension: 'fixed' },
|
|
26
|
+
}, ref);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (isBrowser) {
|
|
29
|
+
document.body.style.padding = '0px';
|
|
30
|
+
return () => {
|
|
31
|
+
document.body.style.padding = '1rem';
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
}, [isBrowser]);
|
|
36
|
+
return (_jsx(Container, { dimension: "full", padding: false, className: style.MainContainer, children: _jsxs(Stack, { direction: "row", children: [_jsxs(Stack, { id: "LeftMenu", rowGap: 16, className: style.LeftMenu, "data-is-open": isLeftOpen, children: [_jsx("div", { className: style.LeftMenuInner, "data-is-open": isLeftOpen }), isLeftOpen
|
|
37
|
+
? (_jsx("div", { children: linkIcons.map((e, i) => (_jsx(Menu.Item, { disabled: true, value: `${e}`, icon: linkIcons[i], children: e }, seed(`linkMenu${i}`)))) }))
|
|
38
|
+
: (_jsx(Stack, { inline: true, hAlign: "center", rowGap: 8, children: linkIcons.map((e, i) => (_jsx(IconButton, { disabled: true, icon: linkIcons[i], kind: "flat" }, `${e} ${seed(`icons${i}`)}`))) }))] }), _jsxs(Stack, { children: [_jsxs(Stack, { id: "MainMenu", direction: "row", vAlign: "center", hAlign: "space-between", columnGap: 16, className: style.MainMenu, children: [_jsx(Stack, { inline: true, children: _jsx(Button, { kind: "secondary", dimension: "regular", fullWidth: false, onClick: () => setIsLeftOpen(!isLeftOpen), children: "Menu" }) }), _jsx(Stack, { inline: true, children: _jsx(Button, { kind: "secondary", dimension: "regular", fullWidth: false, onClick: () => setIsRightOpen(!isRightOpen), children: "Filters" }) })] }), _jsx(Container, { ref: ref, dimension: containerValue.dimension, className: clsx(style.Container, 'ContainerEx'), children: _jsxs(Stack, { rowGap: 32, vPadding: 32, children: [_jsxs(Snackbar, { children: [_jsx(Title, { level: "2", children: "Product Card Container" }), _jsx(Text, { as: "span", children: `Window Width: ${size}px - Breakpoints Match: ${matches.toUpperCase()}` }), _jsx("br", {}), _jsx(Text, { as: "span", children: `Container Width: ${containerSize}px - Grid Columns: ${containerValue.col} - Grid Gutter: ${containerValue.gutter}px` }), _jsx("br", {}), _jsx(Text, { as: "span", children: `useBreakpointsConfig.value: ${JSON.stringify(containerValue)} - useBreakpointsConfig.matches: ${containerMatches.toUpperCase()}` })] }), _jsx(Grid, { columns: containerValue.col, rowGap: containerValue.gutter, columnGap: containerValue.gutter, filling: false, children: Array(12).fill('Card').map((e, i) => (_jsx(Grid.Item, { children: _jsx(Card, { bordered: true, style: { height: '500px' }, children: _jsx(Stack, { hAlign: "center", children: _jsx(Text, { size: 14, children: `${e} ${i + 1}` }) }) }) }, seed(`cards${i}`)))) })] }) })] }), _jsxs(Stack, { id: "RightMenu", className: style.RightMenu, "data-is-open": isRightOpen, children: [_jsx("div", { className: style.RightMenuInner }), _jsx("div", { className: style.Filter, children: Array(10).fill('Filter').map((e, i) => (_jsxs(Disclosure, { summary: `${e} ${String.fromCharCode(i + 65)}`, children: [_jsx(Menu.Item, { value: "1", subtext: "Hint Text", children: "Menu Item 1" }), _jsx(Menu.Item, { value: "2", subtext: "Hint Text", children: "Menu Item 2" }), _jsx(Menu.Item, { value: "3", subtext: "Hint Text", children: "Menu Item 3" }), _jsx(Menu.Item, { value: "4", subtext: "Hint Text", children: "Menu Item 4" })] }, seed(`filters${i}`)))) })] })] }) }));
|
|
39
|
+
};
|
|
40
|
+
export const Shell = Template.bind({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpointsConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useBreakpointsConfig.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAuB,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAkB,MAAM,kBAAkB,CAAC;AAEzF,oBAAY,iBAAiB,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,CAAC,CAAA;CAAE,CAAA;AAEzF,eAAO,MAAM,oBAAoB,6CAEtB,iBAAiB,WAAW,GAAG,IAAI,CAAC,aAClC,mBAAmB;;;;;
|
|
1
|
+
{"version":3,"file":"useBreakpointsConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useBreakpointsConfig.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAuB,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAkB,MAAM,kBAAkB,CAAC;AAEzF,oBAAY,iBAAiB,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,CAAC,CAAA;CAAE,CAAA;AAEzF,eAAO,MAAM,oBAAoB,6CAEtB,iBAAiB,WAAW,GAAG,IAAI,CAAC,aAClC,mBAAmB;;;;;CAmB/B,CAAC"}
|
|
@@ -21,7 +21,8 @@ export const useBreakpointsConfig = (config, target, settings) => {
|
|
|
21
21
|
const { matches, breakpoints, size, } = useBreakpoints(target, settings);
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
setValue(config[matches] ?? fallback);
|
|
24
|
-
|
|
24
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25
|
+
}, [matches]);
|
|
25
26
|
return ({
|
|
26
27
|
value,
|
|
27
28
|
matches,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wonderflow/react-components",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.5",
|
|
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.5",
|
|
86
|
+
"@wonderflow/tokens": "11.0.5",
|
|
87
87
|
"babel-loader": "8.2.5",
|
|
88
88
|
"cpy-cli": "3.1.1",
|
|
89
89
|
"postcss": "8.4.17",
|