@wonderflow/react-components 5.4.0 → 6.0.0

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.
Files changed (107) hide show
  1. package/dist/components/autocomplete/autocomplete.js +2 -2
  2. package/dist/components/button/button.d.ts.map +1 -1
  3. package/dist/components/button/button.js +2 -2
  4. package/dist/components/card/card.d.ts +1 -1
  5. package/dist/components/card/card.d.ts.map +1 -1
  6. package/dist/components/card/card.js +2 -2
  7. package/dist/components/chip/chip.js +1 -1
  8. package/dist/components/drawer/drawer.js +1 -1
  9. package/dist/components/dropdown/dropdown.d.ts +28 -0
  10. package/dist/components/dropdown/dropdown.d.ts.map +1 -1
  11. package/dist/components/dropdown/dropdown.js +13 -8
  12. package/dist/components/elevator/elevator.d.ts.map +1 -1
  13. package/dist/components/elevator/elevator.js +2 -2
  14. package/dist/components/icon/icon.d.ts +6 -4
  15. package/dist/components/icon/icon.d.ts.map +1 -1
  16. package/dist/components/icon/icon.js +1 -1
  17. package/dist/components/info-state/info-state.js +1 -1
  18. package/dist/components/input-group/input-group.d.ts.map +1 -1
  19. package/dist/components/input-group/input-group.js +4 -4
  20. package/dist/components/list/list.js +1 -1
  21. package/dist/components/masonry/masonry.d.ts.map +1 -1
  22. package/dist/components/masonry/masonry.js +2 -2
  23. package/dist/components/menu/menu-item/menu-item.js +1 -1
  24. package/dist/components/menu/menu-item/menu-item.module.css +1 -1
  25. package/dist/components/menu/menu.js +1 -1
  26. package/dist/components/modal/content/modal-content.js +1 -1
  27. package/dist/components/select/select.js +1 -1
  28. package/dist/components/selection-controls/checkbox.d.ts.map +1 -1
  29. package/dist/components/selection-controls/checkbox.js +8 -2
  30. package/dist/components/selection-controls/selection-controls.module.css +1 -1
  31. package/dist/components/skeleton/skeleton.d.ts +5 -1
  32. package/dist/components/skeleton/skeleton.d.ts.map +1 -1
  33. package/dist/components/skeleton/skeleton.js +4 -6
  34. package/dist/components/skeleton/skeleton.module.css +1 -1
  35. package/dist/components/slider/slider.js +1 -1
  36. package/dist/components/snackbar/snackbar.js +1 -1
  37. package/dist/components/stack/stack.d.ts +4 -4
  38. package/dist/components/stack/stack.d.ts.map +1 -1
  39. package/dist/components/stack/stack.js +6 -6
  40. package/dist/components/star-meter/star-meter.js +1 -1
  41. package/dist/components/tab/tab-item.js +1 -1
  42. package/dist/components/tab/tab.d.ts.map +1 -1
  43. package/dist/components/tab/tab.js +2 -3
  44. package/dist/components/table/index.d.ts +0 -1
  45. package/dist/components/table/index.d.ts.map +1 -1
  46. package/dist/components/table/table-cell/index.d.ts +2 -0
  47. package/dist/components/table/table-cell/index.d.ts.map +1 -0
  48. package/dist/components/table/table-cell/index.js +1 -0
  49. package/dist/components/table/table-cell/table-cell.d.ts +18 -0
  50. package/dist/components/table/table-cell/table-cell.d.ts.map +1 -0
  51. package/dist/components/table/table-cell/table-cell.js +29 -0
  52. package/dist/components/table/table-cell/table-cell.module.css +1 -0
  53. package/dist/components/table/table-checkbox/index.d.ts +2 -0
  54. package/dist/components/table/table-checkbox/index.d.ts.map +1 -0
  55. package/dist/components/table/table-checkbox/index.js +1 -0
  56. package/dist/components/table/table-checkbox/table-checkbox.d.ts +5 -0
  57. package/dist/components/table/table-checkbox/table-checkbox.d.ts.map +1 -0
  58. package/dist/components/table/table-checkbox/table-checkbox.js +4 -0
  59. package/dist/components/table/table-checkbox/table-checkbox.module.css +1 -0
  60. package/dist/components/table/table-controls/index.d.ts +2 -0
  61. package/dist/components/table/table-controls/index.d.ts.map +1 -0
  62. package/dist/components/table/table-controls/index.js +1 -0
  63. package/dist/components/table/table-controls/toggle-columns.d.ts +9 -0
  64. package/dist/components/table/table-controls/toggle-columns.d.ts.map +1 -0
  65. package/dist/components/table/table-controls/toggle-columns.js +23 -0
  66. package/dist/components/table/table-expand/index.d.ts +3 -0
  67. package/dist/components/table/table-expand/index.d.ts.map +1 -0
  68. package/dist/components/table/table-expand/index.js +1 -0
  69. package/dist/components/table/table-expand/table-expand.d.ts +7 -0
  70. package/dist/components/table/table-expand/table-expand.d.ts.map +1 -0
  71. package/dist/components/table/table-expand/table-expand.js +3 -0
  72. package/dist/components/table/table-expand/table-expand.module.css +1 -0
  73. package/dist/components/table/table-header/index.d.ts +3 -0
  74. package/dist/components/table/table-header/index.d.ts.map +1 -0
  75. package/dist/components/table/table-header/index.js +1 -0
  76. package/dist/components/table/table-header/table-header.d.ts +7 -0
  77. package/dist/components/table/table-header/table-header.d.ts.map +1 -0
  78. package/dist/components/table/table-header/table-header.js +4 -0
  79. package/dist/components/table/table-header/table-header.module.css +1 -0
  80. package/dist/components/table/table-pagination/index.d.ts +3 -0
  81. package/dist/components/table/table-pagination/index.d.ts.map +1 -0
  82. package/dist/components/table/table-pagination/index.js +1 -0
  83. package/dist/components/table/table-pagination/table-pagination.d.ts +13 -0
  84. package/dist/components/table/table-pagination/table-pagination.d.ts.map +1 -0
  85. package/dist/components/table/table-pagination/table-pagination.js +11 -0
  86. package/dist/components/table/table-row/index.d.ts +2 -0
  87. package/dist/components/table/table-row/index.d.ts.map +1 -0
  88. package/dist/components/table/table-row/index.js +1 -0
  89. package/dist/components/table/table-row/table-row.d.ts +5 -0
  90. package/dist/components/table/table-row/table-row.d.ts.map +1 -0
  91. package/dist/components/table/table-row/table-row.js +6 -0
  92. package/dist/components/table/table-row/table-row.module.css +1 -0
  93. package/dist/components/table/table.d.ts +127 -15
  94. package/dist/components/table/table.d.ts.map +1 -1
  95. package/dist/components/table/table.js +114 -15
  96. package/dist/components/table/table.module.css +1 -1
  97. package/dist/components/table/types.d.ts +21 -0
  98. package/dist/components/table/types.d.ts.map +1 -0
  99. package/dist/components/table/types.js +1 -0
  100. package/dist/components/textfield/textfield.d.ts.map +1 -1
  101. package/dist/components/textfield/textfield.js +2 -2
  102. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  103. package/dist/components/tooltip/tooltip.js +4 -3
  104. package/package.json +13 -12
  105. package/dist/components/table/theme.d.ts +0 -3
  106. package/dist/components/table/theme.d.ts.map +0 -1
  107. package/dist/components/table/theme.js +0 -78
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AnimatePresence, motion } from 'framer-motion';
3
3
  import { AutocompleteOption } from './autocomplete-option';
4
- import { Children, cloneElement, forwardRef, useCallback, useMemo, useRef, useState, useEffect } from 'react';
4
+ import { Children, cloneElement, forwardRef, useCallback, useMemo, useRef, useState, useEffect, isValidElement } from 'react';
5
5
  import { useDebounce, useFocusWithin, useKeyPress, useSize } from 'ahooks';
6
6
  import { Text, Menu, Textfield } from '../..';
7
7
  import styles from './autocomplete.module.css';
@@ -73,7 +73,7 @@ export const Autocomplete = forwardRef(({ children, onChange, disabled, readOnly
73
73
  }, [value]);
74
74
  return (_jsxs("div", { ref: autocompleteRef, className: styles.Autocomplete, "data-focus-within": isFocusWithin, children: [_jsx(Textfield, { ref: setTriggerRef, id: seedID('autocomplete-trigger'), "aria-haspopup": "true", "aria-controls": seedID('autocomplete-menu'), "aria-expanded": isOpen, onChange: handleFilter, value: content, autoComplete: "off", disabled: disabled, readOnly: readOnly, ...otherProps }, seedID('autocomplete-trigger')), _jsx(AnimatePresence, { children: visible && (_jsx("div", { ref: setTooltipRef, ...getTooltipProps({ className: styles.PopUp, style: { minInlineSize: triggerSize ? (triggerSize.width + 2) : 'auto' } }), children: _jsx(motion.div, { variants: AutocompleteAnimation, initial: "hidden", animate: "visible", exit: "hidden", children: _jsx(Menu, { role: "listbox", id: seedID('autocomplete-menu'), className: styles.OptionsList, style: dynamicStyle, "aria-labelledby": seedID('autocomplete-trigger'), children: filteredOptions.length === 0
75
75
  ? _jsx(Text, { as: "div", textAlign: "center", dimmed: 5, children: emptyMessage }, void 0)
76
- : Children.map(filteredOptions, (child) => cloneElement(child, {
76
+ : Children.map(filteredOptions, (child) => isValidElement(child) && cloneElement(child, {
77
77
  onClick: handleOptionClick
78
78
  })) }, void 0) }, void 0) }, void 0)) }, void 0)] }, void 0));
79
79
  });
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAsC,UAAU,EAAe,MAAM,OAAO,CAAA;AACvF,OAAO,EAAQ,SAAS,EAAE,WAAW,EAAW,MAAM,cAAc,CAAA;AAGpE,oBAAY,WAAW,GAAG;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;IACxC;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;IACxC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,GAAG,IAAI,CAAC;CAC1E,CAAA;AAED,aAAK,iBAAiB,GAAG,WAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAEhF,eAAO,MAAM,MAAM,mBA+DI,CAAA;AAEvB,oBAAY,iBAAiB,GAAG,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAAC,CAAA;AAExF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAe9C,CAAA"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAsC,UAAU,EAA+B,MAAM,OAAO,CAAA;AACvG,OAAO,EAAQ,SAAS,EAAE,WAAW,EAAW,MAAM,cAAc,CAAA;AAGpE,oBAAY,WAAW,GAAG;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;IACxC;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;IACxC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,GAAG,IAAI,CAAC;CAC1E,CAAA;AAED,aAAK,iBAAiB,GAAG,WAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAEhF,eAAO,MAAM,MAAM,mBA+DI,CAAA;AAEvB,oBAAY,iBAAiB,GAAG,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAAC,CAAA;AAExF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAe9C,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import clsx from 'clsx';
3
- import { Children, cloneElement, forwardRef, useCallback } from 'react';
3
+ import { Children, cloneElement, forwardRef, useCallback, isValidElement } from 'react';
4
4
  import { Icon, Spinner } from '../..';
5
5
  import styles from './button.module.css';
6
6
  export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', className, children, fullWidth, icon, disabled, iconPosition = 'left', iconColor, type = 'button', pressed, onClick, busy, as: Wrapper = 'button', ...otherProps }, forwardedRef) => {
@@ -17,7 +17,7 @@ export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', cla
17
17
  };
18
18
  return (_jsxs(Wrapper, { ref: forwardedRef, type: Wrapper === 'button' ? type : undefined, className: clsx(styles.Button, className), "data-button-icon-position": iconPosition, "data-button-dimension": dimension, "data-button-kind": kind, "data-button-fullwidth": fullWidth, "aria-disabled": disabled, "aria-busy": busy, "aria-pressed": Wrapper === 'button' ? pressed : undefined, "aria-live": busy ? 'polite' : undefined, onClick: handleClick(), ...otherProps, children: [icon && (_jsx(Icon, { source: icon, fill: iconColor, dimension: iconSize[dimension] }, void 0)), (children && busy) ? _jsx("span", { children: children }, void 0) : children, busy && (_jsx("span", { className: styles.SpinnerIndicator, children: _jsx(Spinner, { dimension: dimension }, void 0) }, void 0))] }, void 0));
19
19
  });
20
- export const ButtonsGroup = ({ children, className, kind, dimension = 'regular' }) => (_jsx("div", { className: clsx(styles.ButtonsGroup, className), children: Children.map(children, (child) => cloneElement(child, {
20
+ export const ButtonsGroup = ({ children, className, kind, dimension = 'regular' }) => (_jsx("div", { className: clsx(styles.ButtonsGroup, className), children: Children.map(children, (child) => isValidElement(child) && cloneElement(child, {
21
21
  kind,
22
22
  dimension
23
23
  })) }, void 0));
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { StackProps, Polymorphic } from '../..';
3
3
  import { TokensTypes } from '@wonderflow/tokens/platforms/web';
4
- export declare type CardProps = Pick<StackProps, 'wrap' | 'columnGap' | 'rowGap' | 'verticalAlign' | 'horizontalAlign'> & {
4
+ export declare type CardProps = Pick<StackProps, 'wrap' | 'columnGap' | 'rowGap' | 'vAlign' | 'hAlign'> & {
5
5
  /**
6
6
  * Set the padding on each side of the card.
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5D,OAAO,EAAS,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAI7D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,oBAAY,SAAS,GAAG,IAAI,CAC5B,UAAU,EACR,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,eAAe,GAAG,iBAAiB,CAAC,GACpE;IACF;;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,CAAA;IAClB;;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,iBA6DI,CAAA"}
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5D,OAAO,EAAS,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAI7D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,oBAAY,SAAS,GAAG,IAAI,CAC5B,UAAU,EACR,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,GACpD;IACF;;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,CAAA;IAClB;;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,iBA6DI,CAAA"}
@@ -4,10 +4,10 @@ import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
4
4
  import { Stack } from '../..';
5
5
  import clsx from 'clsx';
6
6
  import styles from './card.module.css';
7
- export const Card = forwardRef(({ as: Wrapper = 'div', children, className, padding = 24, radius = 8, left, right, dimmed, bordered, columnGap = 24, rowGap = 24, verticalAlign = 'start', horizontalAlign = 'space-between', vibrant = false, highlightOnHover = false, wrap, style, ...otherProps }, forwardedRef) => {
7
+ export const Card = forwardRef(({ as: Wrapper = 'div', children, className, padding = 24, radius = 8, left, right, dimmed, bordered, columnGap = 24, rowGap = 24, vAlign = 'start', hAlign = 'space-between', vibrant = false, highlightOnHover = false, wrap, style, ...otherProps }, forwardedRef) => {
8
8
  const dynamicStyle = {
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", fill: false, verticalAlign: verticalAlign, horizontalAlign: horizontalAlign, columnGap: columnGap, rowGap: rowGap, wrap: wrap, children: [left && _jsx("div", { className: styles.Left, children: left }, void 0), children && (_jsx("div", { className: styles.Content, children: children }, void 0)), right && (_jsx("div", { className: styles.Right, children: right }, void 0))] }, void 0) }, void 0));
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", fill: false, vAlign: vAlign, hAlign: hAlign, columnGap: columnGap, rowGap: rowGap, wrap: wrap, children: [left && _jsx("div", { className: styles.Left, children: left }, void 0), children && (_jsx("div", { className: styles.Content, children: children }, void 0)), right && (_jsx("div", { className: styles.Right, children: right }, void 0))] }, void 0) }, void 0));
13
13
  });
@@ -18,6 +18,6 @@ export const Chip = forwardRef(({ children, className, dimension = 'regular', co
18
18
  style: 'outline'
19
19
  }
20
20
  };
21
- return (_jsxs(Stack, { as: "span", direction: "row", columnGap: 8, inline: true, "data-chip-color": color, "data-chip-dimension": dimension, className: clsx(styles.Chip, className), verticalAlign: "center", ref: forwardedRef, ...otherProps, children: [_jsx("b", { children: children }, void 0), interactive && (_jsx("button", { onClick: interactive && onDismissClick, className: styles.Action, type: "button", children: _jsx(Icon, { source: "xmark", weight: properties[dimension].style, dimension: properties[dimension].iconSize }, void 0) }, void 0))] }, void 0));
21
+ return (_jsxs(Stack, { as: "span", direction: "row", columnGap: 8, inline: true, "data-chip-color": color, "data-chip-dimension": dimension, className: clsx(styles.Chip, className), vAlign: "center", ref: forwardedRef, ...otherProps, children: [_jsx("b", { children: children }, void 0), interactive && (_jsx("button", { onClick: interactive && onDismissClick, className: styles.Action, type: "button", children: _jsx(Icon, { source: "xmark", weight: properties[dimension].style, dimension: properties[dimension].iconSize }, void 0) }, void 0))] }, void 0));
22
22
  });
23
23
  Chip.displayName = 'Chip';
@@ -28,6 +28,6 @@ export const Drawer = forwardRef(({ children, className, closeOnClickOutside = t
28
28
  }
29
29
  }
30
30
  };
31
- return (_jsx("div", { role: "dialog", "aria-modal": isModal, "data-theme": theme, "aria-labelledby": titleId, className: clsx(styles.Drawer, className), ref: forwardedRef, ...otherProps, children: _jsx(FocusOn, { enabled: isModal, onClickOutside: closeOnClickOutside ? onClose : undefined, onEscapeKey: onClose, children: _jsx(motion.div, { variants: DrawerAnimation, initial: "hidden", animate: "visible", exit: "hidden", className: styles.Container, "data-drawer-side": side, children: _jsx(Elevator, { resting: 4, children: _jsxs("div", { className: styles.Content, style: dynamicStyle, ref: forwardedRef, ...otherProps, children: [(showHeader && title) && (_jsxs(Stack, { verticalAlign: "center", fill: false, horizontalAlign: "space-between", direction: "row", className: styles.Header, children: [_jsx(Title, { responsive: false, level: "6", id: titleId, children: title }, void 0), onClose && _jsx(IconButton, { onClick: onClose, className: styles.CloseButton, icon: "xmark", kind: "flat" }, void 0)] }, void 0)), _jsx(AutoFocusInside, { children: children }, void 0)] }, void 0) }, void 0) }, void 0) }, void 0) }, void 0));
31
+ return (_jsx("div", { role: "dialog", "aria-modal": isModal, "data-theme": theme, "aria-labelledby": titleId, className: clsx(styles.Drawer, className), ref: forwardedRef, ...otherProps, children: _jsx(FocusOn, { enabled: isModal, onClickOutside: closeOnClickOutside ? onClose : undefined, onEscapeKey: onClose, children: _jsx(motion.div, { variants: DrawerAnimation, initial: "hidden", animate: "visible", exit: "hidden", className: styles.Container, "data-drawer-side": side, children: _jsx(Elevator, { resting: 4, children: _jsxs("div", { className: styles.Content, style: dynamicStyle, ref: forwardedRef, ...otherProps, children: [(showHeader && title) && (_jsxs(Stack, { vAlign: "center", fill: false, hAlign: "space-between", direction: "row", className: styles.Header, children: [_jsx(Title, { responsive: false, level: "6", id: titleId, children: title }, void 0), onClose && _jsx(IconButton, { onClick: onClose, className: styles.CloseButton, icon: "xmark", kind: "flat" }, void 0)] }, void 0)), _jsx(AutoFocusInside, { children: children }, void 0)] }, void 0) }, void 0) }, void 0) }, void 0) }, void 0));
32
32
  });
33
33
  Drawer.displayName = 'Drawer';
@@ -27,6 +27,20 @@ export declare type DropdownProps = PropsWithClass & {
27
27
  * Enable or disable the itneraction on the trigger.
28
28
  */
29
29
  disabled?: boolean;
30
+ /**
31
+ * Calllback triggered when the dropdown state changes.
32
+ * It returns the new `boolean` state.
33
+ */
34
+ onOpenChange?: (open: boolean) => void;
35
+ /**
36
+ * Programmatically open or close the dropdown. If set to `true`, the dropdown
37
+ * will be open when rendered. This make the dropdown a controlled component.
38
+ */
39
+ open?: boolean;
40
+ /**
41
+ * Enable or disable the auto close of the dropdown when clicking outside of it.
42
+ */
43
+ closeOnOutsideClick?: boolean;
30
44
  };
31
45
  export declare const Dropdown: import("react").ForwardRefExoticComponent<PropsWithClass & {
32
46
  /**
@@ -55,5 +69,19 @@ export declare const Dropdown: import("react").ForwardRefExoticComponent<PropsWi
55
69
  * Enable or disable the itneraction on the trigger.
56
70
  */
57
71
  disabled?: boolean | undefined;
72
+ /**
73
+ * Calllback triggered when the dropdown state changes.
74
+ * It returns the new `boolean` state.
75
+ */
76
+ onOpenChange?: ((open: boolean) => void) | undefined;
77
+ /**
78
+ * Programmatically open or close the dropdown. If set to `true`, the dropdown
79
+ * will be open when rendered. This make the dropdown a controlled component.
80
+ */
81
+ open?: boolean | undefined;
82
+ /**
83
+ * Enable or disable the auto close of the dropdown when clicking outside of it.
84
+ */
85
+ closeOnOutsideClick?: boolean | undefined;
58
86
  } & import("react").RefAttributes<HTMLDivElement>>;
59
87
  //# sourceMappingURL=dropdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAMV,MAAM,OAAO,CAAA;AAId,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAKjF,oBAAY,aAAa,GAAG,cAAc,GAAG;IAC3C;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,kBAAkB,CAAC;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAA;AAqBD,eAAO,MAAM,QAAQ;IA/CnB;;OAEG;cACO,SAAS;IACnB;;OAEG;aACM,SAAS;IAClB;;OAEG;;IAEH;;;;;;;;OAQG;;IAEH;;OAEG;;kDA+GH,CAAA"}
1
+ {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAQV,MAAM,OAAO,CAAA;AAId,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAKjF,oBAAY,aAAa,GAAG,cAAc,GAAG;IAC3C;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,kBAAkB,CAAC;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAA;AAqBD,eAAO,MAAM,QAAQ;IA7DnB;;OAEG;cACO,SAAS;IACnB;;OAEG;aACM,SAAS;IAClB;;OAEG;;IAEH;;;;;;;;OAQG;;IAEH;;OAEG;;IAEH;;;OAGG;2BACmB,OAAO,KAAK,IAAI;IACtC;;;OAGG;;IAEH;;OAEG;;kDAwHH,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, Children, cloneElement, useRef, forwardRef } from 'react';
2
+ import { useState, Children, cloneElement, useRef, forwardRef, isValidElement, useEffect } from 'react';
3
3
  import { useKeyPress, useFocusWithin } from 'ahooks';
4
4
  import styles from './dropdown.module.css';
5
5
  import { useUIDSeed } from 'react-uid';
@@ -24,8 +24,7 @@ const DropdownAnimation = {
24
24
  }
25
25
  }
26
26
  };
27
- export const Dropdown = forwardRef(({ children, trigger, offset = 8, placement = 'auto-start', disabled, className, ...otherProps }, forwardedRef) => {
28
- const renderedChildren = Children.toArray(children).filter(Boolean);
27
+ export const Dropdown = forwardRef(({ children, trigger, offset = 8, placement = 'auto-start', open, disabled, closeOnOutsideClick = true, className, onOpenChange, ...otherProps }, forwardedRef) => {
29
28
  const seedID = useUIDSeed();
30
29
  const dropdownRef = useRef(forwardedRef);
31
30
  const [isOpen, setIsOpen] = useState(false);
@@ -35,10 +34,13 @@ export const Dropdown = forwardRef(({ children, trigger, offset = 8, placement =
35
34
  trigger: !disabled ? ['click'] : null,
36
35
  visible: isOpen,
37
36
  closeOnTriggerHidden: true,
38
- onVisibleChange: setIsOpen,
37
+ closeOnOutsideClick,
38
+ onVisibleChange: state => {
39
+ onOpenChange?.(state);
40
+ setIsOpen(state);
41
+ },
39
42
  placement: placement,
40
- offset: [0, offset],
41
- closeOnOutsideClick: true
43
+ offset: [0, offset]
42
44
  });
43
45
  const isFocusWithin = useFocusWithin(dropdownRef, {
44
46
  onBlur: (e) => {
@@ -48,7 +50,10 @@ export const Dropdown = forwardRef(({ children, trigger, offset = 8, placement =
48
50
  }
49
51
  });
50
52
  useKeyPress('esc', () => setIsOpen(false));
51
- return (_jsxs("div", { ref: dropdownRef, className: clsx(styles.Dropdown, className), "data-dropdown-has-focus": isFocusWithin, children: [Children.map(trigger, (child) => cloneElement(child, {
53
+ useEffect(() => {
54
+ open !== undefined && setIsOpen(open);
55
+ }, [open]);
56
+ return (_jsxs("div", { ref: dropdownRef, className: clsx(styles.Dropdown, className), "data-dropdown-has-focus": isFocusWithin, children: [Children.map(trigger, (child) => isValidElement(child) && cloneElement(child, {
52
57
  ref: setTriggerRef,
53
58
  id: seedID('dropdown-trigger'),
54
59
  key: seedID('dropdown-trigger'),
@@ -56,7 +61,7 @@ export const Dropdown = forwardRef(({ children, trigger, offset = 8, placement =
56
61
  'aria-controls': seedID('dropdown-menu'),
57
62
  'aria-expanded': isOpen,
58
63
  ...otherProps
59
- })), _jsx(AnimatePresence, { children: visible && (_jsx("div", { ref: setTooltipRef, role: "tooltip", id: seedID('tooltip-content'), ...getTooltipProps({ className: styles.PopUp }), children: _jsx(motion.div, { variants: DropdownAnimation, initial: "hidden", animate: "visible", exit: "hidden", children: Children.map(renderedChildren, (child) => cloneElement(child, {
64
+ })), _jsx(AnimatePresence, { children: visible && (_jsx("div", { ref: setTooltipRef, role: "tooltip", id: seedID('tooltip-content'), ...getTooltipProps({ className: styles.PopUp }), children: _jsx(motion.div, { variants: DropdownAnimation, initial: "hidden", animate: "visible", exit: "hidden", children: Children.map(children, (child) => isValidElement(child) && cloneElement(child, {
60
65
  id: seedID('dropdown-menu'),
61
66
  'aria-labelledby': seedID('dropdown-trigger')
62
67
  })) }, void 0) }, seedID('tooltip-content'))) }, void 0)] }, void 0));
@@ -1 +1 @@
1
- {"version":3,"file":"elevator.d.ts","sourceRoot":"","sources":["../../../src/components/elevator/elevator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAoC,YAAY,EAAE,MAAM,OAAO,CAAA;AAE1E,oBAAY,aAAa,GAAG;IAC1B;;MAEE;IACF,OAAO,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAgBtC,CAAA"}
1
+ {"version":3,"file":"elevator.d.ts","sourceRoot":"","sources":["../../../src/components/elevator/elevator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAoC,YAAY,EAAkB,MAAM,OAAO,CAAA;AAE1F,oBAAY,aAAa,GAAG;IAC1B;;MAEE;IACF,OAAO,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAgBtC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Fragment, Children, cloneElement } from 'react';
2
+ import { Fragment, Children, cloneElement, isValidElement } from 'react';
3
3
  export const Elevator = ({ children, resting, hover }) => {
4
- return (_jsx(Fragment, { children: Children.map(children, (child) => cloneElement(child, {
4
+ return (_jsx(Fragment, { children: Children.map(children, (child) => isValidElement(child) && cloneElement(child, {
5
5
  'data-elevation': resting,
6
6
  'data-elevation-hover': hover
7
7
  })) }, void 0));
@@ -16,8 +16,9 @@ export declare type IconProps = SVGAttributes<SVGElement | SVGSVGElement> & {
16
16
  dimension?: TokensTypes['icon']['size'];
17
17
  /**
18
18
  * Set the weight of the icon.
19
- * The default weight is `solid` and outline or duotone icons are available
20
- * only for icons sized 24pt or larger.
19
+ * The default weight is `outline` if `dimension` is greather than `12` or `undefined`.
20
+ * If `dimension` is set to `12`, the weight is ignored and the icon forced to use
21
+ * the `solid` style to improve the readability.
21
22
  */
22
23
  weight?: 'solid' | 'outline' | 'duotone';
23
24
  };
@@ -36,8 +37,9 @@ export declare const Icon: import("react").ForwardRefExoticComponent<SVGAttribut
36
37
  dimension?: 16 | 24 | 12 | 32 | 40 | 48 | 56 | undefined;
37
38
  /**
38
39
  * Set the weight of the icon.
39
- * The default weight is `solid` and outline or duotone icons are available
40
- * only for icons sized 24pt or larger.
40
+ * The default weight is `outline` if `dimension` is greather than `12` or `undefined`.
41
+ * If `dimension` is set to `12`, the weight is ignored and the icon forced to use
42
+ * the `solid` style to improve the readability.
41
43
  */
42
44
  weight?: "solid" | "outline" | "duotone" | undefined;
43
45
  } & import("react").RefAttributes<SVGSVGElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAIL,YAAY,EACZ,aAAa,EAEd,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAI9D,oBAAY,SAAS,GAAG,aAAa,CAAC,UAAU,GAAG,aAAa,CAAC,GAAG;IAClE;;;;;OAKG;IACH,MAAM,EAAE,SAAS,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACnD;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC;;;;MAIE;IACF,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;CAC1C,CAAA;AAED,eAAO,MAAM,IAAI;IApBf;;;;;OAKG;YACK,SAAS,GAAG,aAAa,gBAAgB,CAAC;IAClD;;;OAGG;;IAEH;;;;MAIE;;iDAyCF,CAAA"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAIL,YAAY,EACZ,aAAa,EAEd,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAI9D,oBAAY,SAAS,GAAG,aAAa,CAAC,UAAU,GAAG,aAAa,CAAC,GAAG;IAClE;;;;;OAKG;IACH,MAAM,EAAE,SAAS,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACnD;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC;;;;;MAKE;IACF,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;CAC1C,CAAA;AAED,eAAO,MAAM,IAAI;IArBf;;;;;OAKG;YACK,SAAS,GAAG,aAAa,gBAAgB,CAAC;IAClD;;;OAGG;;IAEH;;;;;MAKE;;iDAyCF,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Children, cloneElement, forwardRef, useMemo } from 'react';
3
- import sprite from '@wonderflow/icons/sprite';
3
+ import sprite from '@wonderflow/icons/sprite.svg';
4
4
  import clsx from 'clsx';
5
5
  import styles from './icon.module.css';
6
6
  export const Icon = forwardRef(({ className, source, dimension = 16, weight = 'outline', fill, ...otherProps }, forwardedRef) => {
@@ -4,6 +4,6 @@ import { Stack, Icon, Title, Text } from '../..';
4
4
  import styles from './info-state.module.css';
5
5
  export const InfoState = forwardRef(({ className, children, title, icon, image, direction = 'column', iconColor = 'blue', actions, ...otherProps }, forwardedRef) => {
6
6
  const isHorizontal = direction === 'row';
7
- return (_jsxs(Stack, { ref: forwardedRef, direction: direction, rowGap: 24, columnGap: 32, className: className, horizontalAlign: isHorizontal ? 'start' : 'center', verticalAlign: (isHorizontal && image) ? 'center' : 'start', fill: false, wrap: !!image, ...otherProps, children: [(!image && icon) && (_jsx("span", { "data-info-state-icon-color": iconColor, className: styles.IconWrapper, children: _jsx(Icon, { source: icon, dimension: 48 }, void 0) }, void 0)), (image && !icon) && _jsx("img", { className: styles.Image, alt: "", width: "400", src: image, loading: "lazy", decoding: "async" }, void 0), _jsxs(Stack, { rowGap: 16, horizontalAlign: isHorizontal ? 'start' : 'center', verticalAlign: "center", fill: false, children: [_jsx(Title, { maxWidth: "20ch", textAlign: isHorizontal ? 'start' : 'center', level: "4", children: title }, void 0), _jsx(Text, { maxWidth: "60ch", dimmed: 6, textAlign: isHorizontal ? 'start' : 'center', children: children }, void 0), actions && (_jsx(Stack, { verticalPadding: 16, inline: true, direction: "row", columnGap: 16, rowGap: 16, wrap: true, children: actions }, void 0))] }, void 0)] }, void 0));
7
+ return (_jsxs(Stack, { ref: forwardedRef, direction: direction, rowGap: 24, columnGap: 32, className: className, hAlign: isHorizontal ? 'start' : 'center', vAlign: (isHorizontal && image) ? 'center' : 'start', fill: false, wrap: !!image, ...otherProps, children: [(!image && icon) && (_jsx("span", { "data-info-state-icon-color": iconColor, className: styles.IconWrapper, children: _jsx(Icon, { source: icon, dimension: 48 }, void 0) }, void 0)), (image && !icon) && _jsx("img", { className: styles.Image, alt: "", width: "400", src: image, loading: "lazy", decoding: "async" }, void 0), _jsxs(Stack, { rowGap: 16, hAlign: isHorizontal ? 'start' : 'center', vAlign: "center", fill: false, children: [_jsx(Title, { maxWidth: "20ch", textAlign: isHorizontal ? 'start' : 'center', level: "4", children: title }, void 0), _jsx(Text, { maxWidth: "60ch", dimmed: 6, textAlign: isHorizontal ? 'start' : 'center', children: children }, void 0), actions && (_jsx(Stack, { vPadding: 16, inline: true, direction: "row", columnGap: 16, rowGap: 16, wrap: true, children: actions }, void 0))] }, void 0)] }, void 0));
8
8
  });
9
9
  InfoState.displayName = 'InfoState';
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../../src/components/input-group/input-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsC,SAAS,EAAE,MAAM,OAAO,CAAA;AAKrE,oBAAY,eAAe,GAAG,cAAc,GAAG;IAC7C;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;CACzC,CAAA;AAED,eAAO,MAAM,UAAU;IAtBrB;;OAEG;WACI,SAAS;IAChB;;OAEG;YACK,SAAS;IACjB;;OAEG;UACG,SAAS;IACf;;OAEG;YACK,SAAS;IACjB;;OAEG;;uDAgEH,CAAA"}
1
+ {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../../src/components/input-group/input-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsD,SAAS,EAAE,MAAM,OAAO,CAAA;AAKrF,oBAAY,eAAe,GAAG,cAAc,GAAG;IAC7C;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;CACzC,CAAA;AAED,eAAO,MAAM,UAAU;IAtBrB;;OAEG;WACI,SAAS;IAChB;;OAEG;YACK,SAAS;IACjB;;OAEG;UACG,SAAS;IACf;;OAEG;YACK,SAAS;IACjB;;OAEG;;uDAgEH,CAAA"}
@@ -1,17 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import clsx from 'clsx';
3
- import { Children, cloneElement, forwardRef } from 'react';
3
+ import { Children, cloneElement, forwardRef, isValidElement } from 'react';
4
4
  import { Stack, Text } from '../..';
5
5
  import { useUIDSeed } from 'react-uid';
6
6
  import styles from './input-group.module.css';
7
7
  export const InputGroup = forwardRef(({ className, input, end, start, label, dimension = 'regular', ...otherProps }, forwardedRef) => {
8
8
  const seedID = useUIDSeed();
9
- return (_jsxs(Stack, { rowGap: 4, horizontalAlign: "stretch", verticalAlign: "start", fill: false, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: seedID('field'), children: label }, void 0), _jsxs(Stack, { as: "fieldset", direction: "row", verticalAlign: "start", horizontalAlign: "start", fill: false, inline: true, ref: forwardedRef, className: clsx(styles.InputGroup, className), "data-input-group-has-end": Boolean(end), "data-input-group-has-start": !!start, ...otherProps, children: [_jsx("div", { className: styles.Start, children: Children.map(start, (child) => cloneElement(child, {
9
+ return (_jsxs(Stack, { rowGap: 4, hAlign: "stretch", vAlign: "start", fill: false, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: seedID('field'), children: label }, void 0), _jsxs(Stack, { as: "fieldset", direction: "row", vAlign: "start", hAlign: "start", fill: false, inline: true, ref: forwardedRef, className: clsx(styles.InputGroup, className), "data-input-group-has-end": Boolean(end), "data-input-group-has-start": !!start, ...otherProps, children: [_jsx("div", { className: styles.Start, children: Children.map(start, (child) => isValidElement(child) && cloneElement(child, {
10
10
  dimension
11
- })) }, void 0), _jsx("div", { className: styles.InputField, children: Children.map(input, (child) => cloneElement(child, {
11
+ })) }, void 0), _jsx("div", { className: styles.InputField, children: Children.map(input, (child) => isValidElement(child) && cloneElement(child, {
12
12
  id: seedID('field'),
13
13
  dimension
14
- })) }, void 0), _jsx("div", { className: styles.End, children: Children.map(end, (child) => cloneElement(child, {
14
+ })) }, void 0), _jsx("div", { className: styles.End, children: Children.map(end, (child) => isValidElement(child) && cloneElement(child, {
15
15
  dimension
16
16
  })) }, void 0)] }, void 0)] }, void 0));
17
17
  });
@@ -19,5 +19,5 @@ export const List = forwardRef(({ as: Wrapper = 'ul', children, marker = 'circle
19
19
  }
20
20
  };
21
21
  const isUnordered = useMemo(() => Wrapper === 'ul', [Wrapper]);
22
- return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.List, className), "data-list-size": dimension, "data-list-ordered": !isUnordered, "data-list-no-marker": hideMarker, ...otherProps, children: Children.map(children, (child) => (_jsxs(Stack, { as: "li", direction: "row", horizontalAlign: "start", verticalAlign: "start", fill: false, children: [(isUnordered && !hideMarker) && (_jsx(Icon, { source: marker, className: styles.Marker, fill: markerColor, "data-list-default-marker": marker === 'circle', weight: marker === 'circle' ? 'solid' : undefined, dimension: marker !== 'circle' ? sizes[dimension].icon : 16 }, void 0)), _jsx(Text, { as: "span", size: sizes[dimension].text, children: child.props.children }, void 0)] }, void 0))) }, void 0));
22
+ return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.List, className), "data-list-size": dimension, "data-list-ordered": !isUnordered, "data-list-no-marker": hideMarker, ...otherProps, children: Children.map(children, (child) => (_jsxs(Stack, { as: "li", direction: "row", hAlign: "start", vAlign: "start", fill: false, children: [(isUnordered && !hideMarker) && (_jsx(Icon, { source: marker, className: styles.Marker, fill: markerColor, "data-list-default-marker": marker === 'circle', weight: marker === 'circle' ? 'solid' : undefined, dimension: marker !== 'circle' ? sizes[dimension].icon : 16 }, void 0)), _jsx(Text, { as: "span", size: sizes[dimension].text, children: child.props.children }, void 0)] }, void 0))) }, void 0));
23
23
  });
@@ -1 +1 @@
1
- {"version":3,"file":"masonry.d.ts","sourceRoot":"","sources":["../../../src/components/masonry/masonry.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAyC,MAAM,OAAO,CAAA;AAGjE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAG9D,oBAAY,YAAY,GAAG,cAAc,GAAG;IAC1C;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAC3B,CAAA;AAED,aAAK,OAAO,GAAG;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CA4CpC,CAAA"}
1
+ {"version":3,"file":"masonry.d.ts","sourceRoot":"","sources":["../../../src/components/masonry/masonry.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAyD,MAAM,OAAO,CAAA;AAGjF,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAG9D,oBAAY,YAAY,GAAG,cAAc,GAAG;IAC1C;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAC3B,CAAA;AAED,aAAK,OAAO,GAAG;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CA4CpC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import clsx from 'clsx';
3
- import { Children, cloneElement } from 'react';
3
+ import { Children, cloneElement, isValidElement } from 'react';
4
4
  import MasonryLayout from 'react-masonry-css';
5
5
  import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
6
6
  import styles from './masonry.module.css';
@@ -20,7 +20,7 @@ export const Masonry = ({ className, children, columns = 3, gutter = 16, style,
20
20
  default: columns.default,
21
21
  [breakpoints[current]]: columns[current]
22
22
  }), {});
23
- return (_jsx(MasonryLayout, { role: "list", className: clsx(styles.Masonry, className), columnClassName: styles.Column, breakpointCols: typeof columns === 'number' ? columns : computedColumns, style: { ...dynamicStyle, ...style }, ...otherProps, children: Children.map(children, (child) => cloneElement(child, {
23
+ return (_jsx(MasonryLayout, { role: "list", className: clsx(styles.Masonry, className), columnClassName: styles.Column, breakpointCols: typeof columns === 'number' ? columns : computedColumns, style: { ...dynamicStyle, ...style }, ...otherProps, children: Children.map(children, (child) => isValidElement(child) && cloneElement(child, {
24
24
  role: 'listitem'
25
25
  })) }, void 0));
26
26
  };
@@ -15,7 +15,7 @@ export const MenuItem = forwardRef(({ className, children, onClick, icon, dimens
15
15
  onClick(e);
16
16
  }
17
17
  }, [handleClick, onClick]);
18
- const InnerContent = useMemo(() => (_jsxs(Stack, { direction: isIconRight ? 'row-reverse' : 'row', as: "span", fill: false, className: styles.ItemContent, horizontalAlign: isIconRight ? 'space-between' : 'start', verticalAlign: "center", columnGap: 8, horizontalPadding: 16, verticalPadding: 8, "data-menu-item-icon-right": isIconRight, "data-menu-item-has-icon": Boolean(icon), "data-menu-item-padding": padding, style: { inlineSize: '100%' }, children: [icon && (_jsx(Icon, { className: styles.IconClass, source: icon, dimension: dimension === 'small' ? 12 : 16 }, void 0)), _jsxs(Stack, { className: styles.DecorationContent, columnGap: 16, fill: false, direction: "row", horizontalAlign: "space-between", children: [children, decoration] }, void 0)] }, void 0)), [children, dimension, icon, isIconRight, decoration, padding]);
18
+ const InnerContent = useMemo(() => (_jsxs(Stack, { direction: isIconRight ? 'row-reverse' : 'row', as: "span", fill: false, className: styles.ItemContent, hAlign: isIconRight ? 'space-between' : 'start', vAlign: "center", columnGap: 8, hPadding: 16, vPadding: 8, "data-menu-item-icon-right": isIconRight, "data-menu-item-has-icon": Boolean(icon), "data-menu-item-padding": padding, style: { inlineSize: '100%' }, children: [icon && (_jsx(Icon, { className: styles.IconClass, source: icon, dimension: dimension === 'small' ? 12 : 16 }, void 0)), _jsxs(Stack, { className: styles.DecorationContent, columnGap: 16, fill: false, direction: "row", hAlign: "space-between", children: [children, decoration] }, void 0)] }, void 0)), [children, dimension, icon, isIconRight, decoration, padding]);
19
19
  return (_jsx(Wrapper, { autoFocus: autoFocus, ref: itemRef, role: "menuitem", className: clsx(styles.MenuItem, className), onClick: disabled ? undefined : triggerClick, onKeyDown: disabled ? undefined : handleKeyDown, tabIndex: tabIndex, "aria-disabled": disabled, type: Wrapper === 'button' ? 'button' : undefined, "data-menu-item-dimension": dimension, ...otherProps, children: description
20
20
  ? (_jsx(Tooltip, { fill: true, open: focused, placement: "right-start", interactive: true, trigger: InnerContent, children: description }, void 0))
21
21
  : InnerContent }, void 0));
@@ -1 +1 @@
1
- .MenuItem{background:none;border:0;box-sizing:border-box;color:var(--dimmed-6);cursor:pointer;font:inherit;font-size:.89rem;font-weight:600;inline-size:100%;padding:0;position:relative;text-align:start}.MenuItem:hover{color:var(--global-foreground)}.MenuItem[aria-checked=true]{color:var(--global-interactive-text)}.MenuItem:before{border-radius:.22rem;bottom:0;content:"";left:.44rem;opacity:.6;position:absolute;right:.44rem;top:0;z-index:0}.MenuItem:is(:hover,:focus-visible,[aria-pressed=true]):not([aria-disabled=true]){outline:none}.MenuItem:is(:hover,:focus-visible,[aria-pressed=true]):not([aria-disabled=true]):before{background-color:var(--dimmed-1)}.MenuItem[data-menu-item-dimension=small]{font-size:.78rem}.MenuItem>*{position:relative}.MenuItem[aria-disabled=true]{color:var(--global-disabled-foreground);cursor:not-allowed}.MenuItem [data-menu-item-padding=true][data-menu-item-has-icon=false][data-menu-item-icon-right=false]{padding-left:2.22rem}.MenuItem [data-menu-item-padding=true][data-menu-item-has-icon=false][data-menu-item-icon-right=true]{padding-right:2.22rem}.ItemContent{position:relative}.DecorationContent{flex-grow:1}.Icon{align-self:flex-start;flex-grow:0;flex-shrink:0;margin-top:4px}
1
+ .MenuItem{--padding:2.22rem;background:none;border:0;box-sizing:border-box;color:var(--dimmed-6);cursor:pointer;font:inherit;font-size:.89rem;font-weight:600;inline-size:100%;padding:0;position:relative;text-align:start}.MenuItem:hover{color:var(--global-foreground)}.MenuItem[aria-checked=true]{color:var(--global-interactive-text)}.MenuItem:before{border-radius:.22rem;bottom:0;content:"";left:.44rem;opacity:.6;position:absolute;right:.44rem;top:0;z-index:0}.MenuItem:is(:hover,:focus-visible,[aria-pressed=true]):not([aria-disabled=true]){outline:none}.MenuItem:is(:hover,:focus-visible,[aria-pressed=true]):not([aria-disabled=true]):before{background-color:var(--dimmed-1)}.MenuItem[data-menu-item-dimension=small]{--padding:2rem;font-size:.78rem}.MenuItem>*{position:relative}.MenuItem[aria-disabled=true]{color:var(--global-disabled-foreground);cursor:not-allowed}.MenuItem [data-menu-item-padding=true][data-menu-item-has-icon=false][data-menu-item-icon-right=false]{padding-left:var(--padding)}.MenuItem [data-menu-item-padding=true][data-menu-item-has-icon=false][data-menu-item-icon-right=true]{padding-right:var(--padding)}.ItemContent{position:relative}.DecorationContent{flex-grow:1}.Icon{align-self:flex-start;flex-grow:0;flex-shrink:0;margin-top:4px}
@@ -8,7 +8,7 @@ import styles from './menu.module.css';
8
8
  import clsx from 'clsx';
9
9
  export const Menu = forwardRef(({ className, children, ...otherProps }, forwardedRef) => {
10
10
  const renderedChildren = Children.toArray(children).filter(Boolean);
11
- return (_jsx(Elevator, { resting: 2, children: _jsx(Stack, { as: "ul", ref: forwardedRef, className: clsx(styles.Menu, className), verticalPadding: 8, role: "menu", ...otherProps, children: _jsx(RovingTabIndexProvider, { options: { direction: 'vertical', loopAround: true }, children: Children.map(renderedChildren, (child) => (_jsx(Stack, { as: "li", role: "none", verticalPadding: child.type?.displayName === 'Separator' ? 8 : undefined, children: child }, void 0))) }, void 0) }, void 0) }, void 0));
11
+ return (_jsx(Elevator, { resting: 2, children: _jsx(Stack, { as: "ul", ref: forwardedRef, className: clsx(styles.Menu, className), vPadding: 8, role: "menu", ...otherProps, children: _jsx(RovingTabIndexProvider, { options: { direction: 'vertical', loopAround: true }, children: Children.map(renderedChildren, (child) => (_jsx(Stack, { as: "li", role: "none", vPadding: child.type?.displayName === 'Separator' ? 8 : undefined, children: child }, void 0))) }, void 0) }, void 0) }, void 0));
12
12
  });
13
13
  Menu.displayName = 'Menu';
14
14
  Menu.Item = MenuItem;
@@ -6,6 +6,6 @@ import styles from './modal-content.module.css';
6
6
  import { Title, Elevator, IconButton, Stack, useOverlayContext } from '../../..';
7
7
  export const ModalContent = forwardRef(({ children, className, title, theme = 'light', ...otherProps }, forwardedRef) => {
8
8
  const { onClose, titleId } = useOverlayContext();
9
- return (_jsx(Elevator, { resting: 4, children: _jsxs("div", { className: clsx(styles.Content, className), ref: forwardedRef, "data-theme": theme, ...otherProps, children: [_jsxs(Stack, { verticalAlign: "center", fill: false, horizontalAlign: "space-between", direction: "row", className: styles.Header, children: [_jsx(Title, { responsive: false, level: "5", id: titleId, children: title }, void 0), onClose && _jsx(IconButton, { onClick: onClose, className: styles.CloseButton, icon: "xmark", kind: "flat" }, void 0)] }, void 0), _jsx(AutoFocusInside, { children: children }, void 0)] }, void 0) }, void 0));
9
+ return (_jsx(Elevator, { resting: 4, children: _jsxs("div", { className: clsx(styles.Content, className), ref: forwardedRef, "data-theme": theme, ...otherProps, children: [_jsxs(Stack, { vAlign: "center", fill: false, hAlign: "space-between", direction: "row", className: styles.Header, children: [_jsx(Title, { responsive: false, level: "5", id: titleId, children: title }, void 0), onClose && _jsx(IconButton, { onClick: onClose, className: styles.CloseButton, icon: "xmark", kind: "flat" }, void 0)] }, void 0), _jsx(AutoFocusInside, { children: children }, void 0)] }, void 0) }, void 0));
10
10
  });
11
11
  ModalContent.displayName = 'Modal.Content';
@@ -11,6 +11,6 @@ export const Select = forwardRef(({ children, className, disabled = false, icon
11
11
  regular: 16,
12
12
  big: 24
13
13
  };
14
- 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, horizontalAlign: "start", verticalAlign: "start", inline: true, tabIndex: disabled ? 0 : undefined, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: seedID('select'), children: label }, void 0), _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 }, void 0), kind === 'single' && (_jsx(Icon, { className: styles.Icon, source: icon, dimension: iconSizes[dimension] }, void 0))] }, void 0)] }, void 0));
14
+ 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", size: dimension === 'small' ? 14 : 16, htmlFor: seedID('select'), children: label }, void 0), _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 }, void 0), kind === 'single' && (_jsx(Icon, { className: styles.Icon, source: icon, dimension: iconSizes[dimension] }, void 0))] }, void 0)] }, void 0));
15
15
  });
16
16
  Select.displayName = 'Select';
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAc,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAGpE,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;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;CACvD,CAAA;AAED,eAAO,MAAM,QAAQ;IApBnB;;OAEG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;;OAGG;qBACc,YAAY,gBAAgB,CAAC,GAAG,IAAI;oDAwBrD,CAAA"}
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAc,mBAAmB,EAAqB,MAAM,OAAO,CAAA;AAGvF,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;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;CACvD,CAAA;AAED,eAAO,MAAM,QAAQ;IApBnB;;OAEG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;;OAGG;qBACc,YAAY,gBAAgB,CAAC,GAAG,IAAI;oDA+BrD,CAAA"}
@@ -1,8 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import clsx from 'clsx';
3
- import { forwardRef } from 'react';
3
+ import { forwardRef, useEffect, useRef } from 'react';
4
4
  import styles from './selection-controls.module.css';
5
5
  export const Checkbox = forwardRef(({ className, disabled, dimension = 'regular', onChange, indeterminate, ...otherProps }, forwardedRef) => {
6
- return (_jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, "data-control-indeterminate": indeterminate, onChange: onChange, className: clsx(styles.Checkbox, className), ref: forwardedRef, ...otherProps }, void 0));
6
+ const ref = useRef(forwardedRef);
7
+ useEffect(() => {
8
+ if (ref.current) {
9
+ ref.current.indeterminate = indeterminate;
10
+ }
11
+ }, [indeterminate]);
12
+ return (_jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(styles.Checkbox, className), ref: ref, ...otherProps }, void 0));
7
13
  });
8
14
  Checkbox.displayName = 'Checkbox';
@@ -1 +1 @@
1
- .Checkbox{--w:24px;--h:24px;-webkit-appearance:none;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:.22rem;color:var(--global-background);inline-size:var(--w);max-block-size:var(--h);max-inline-size:var(--w);position:relative}.Checkbox: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)}.Checkbox:active{background-color:var(--global-vibrancy-background-hard)}.Checkbox:checked,.Checkbox[data-control-indeterminate=true]{background:var(--dimmed-7)}.Checkbox:checked:after,.Checkbox[data-control-indeterminate=true]:after{display:block}.Checkbox:disabled{background-color:var(--global-disabled-background);color:var(--global-disabled-foreground);cursor:not-allowed}.Checkbox[data-control-dimension=small]{--w:16px;--h:16px}.Checkbox[data-control-indeterminate=true]:after{block-size:2px;border-left:0;transform:translate(-50%,-50%)}.Radio{composes:Checkbox;border-radius:100%}.Radio:after{background-color:currentColor;block-size:50%;border:0;border-radius:100%;inline-size:50%;transform:translate(-50%,-50%)}.Toggle{--w:44px;--h:24px;--p:2px;composes:Radio;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}
1
+ .Checkbox{--w:24px;--h:24px;-webkit-appearance:none;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:.22rem;color:var(--global-background);inline-size:var(--w);max-block-size:var(--h);max-inline-size:var(--w);position:relative}.Checkbox: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)}.Checkbox:active{background-color:var(--global-vibrancy-background-hard)}.Checkbox:checked,.Checkbox:indeterminate{background:var(--dimmed-7)}.Checkbox:checked:after,.Checkbox:indeterminate:after{display:block}.Checkbox:disabled{background-color:var(--global-disabled-background);color:var(--global-disabled-foreground);cursor:not-allowed}.Checkbox[data-control-dimension=small]{--w:16px;--h:16px}.Checkbox:indeterminate:after{block-size:2px;border-left:0;transform:translate(-50%,-50%)}.Radio{composes:Checkbox;border-radius:100%}.Radio:after{background-color:currentcolor;block-size:50%;border:0;border-radius:100%;inline-size:50%;transform:translate(-50%,-50%)}.Toggle{--w:44px;--h:24px;--p:2px;composes:Radio;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}
@@ -32,6 +32,10 @@ export declare type SkeletonProps = PropsWithClass & {
32
32
  * Enable the shim animation and the announcement of the loading state.
33
33
  */
34
34
  enableAnimation?: boolean;
35
+ /**
36
+ * Set the gap between stacked skeleton items.
37
+ */
38
+ gap?: TokensTypes['space'];
35
39
  };
36
- export declare const Skeleton: ({ className, borderRadius, style, width, height, count, enableAnimation, inline, circle, ...otherProps }: SkeletonProps) => JSX.Element;
40
+ export declare const Skeleton: ({ className, borderRadius, style, width, height, count, gap, enableAnimation, inline, circle, ...otherProps }: SkeletonProps) => JSX.Element;
37
41
  //# sourceMappingURL=skeleton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAM9D,oBAAY,aAAa,GAAG,cAAc,GAAG;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAA;AAED,eAAO,MAAM,QAAQ,6GAWlB,aAAa,gBA+Cf,CAAA"}
1
+ {"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAM9D,oBAAY,aAAa,GAAG,cAAc,GAAG;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,GAAG,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAC5B,CAAA;AAED,eAAO,MAAM,QAAQ,kHAYlB,aAAa,gBA6Cf,CAAA"}
@@ -3,7 +3,7 @@ import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
3
3
  import { Fragment, useCallback } from 'react';
4
4
  import { useUIDSeed } from 'react-uid';
5
5
  import styles from './skeleton.module.css';
6
- export const Skeleton = ({ className, borderRadius = 4, style, width, height, count = 1, enableAnimation = true, inline, circle, ...otherProps }) => {
6
+ export const Skeleton = ({ className, borderRadius = 4, style, width, height, count = 1, gap, enableAnimation = true, inline, circle, ...otherProps }) => {
7
7
  const uid = useUIDSeed();
8
8
  const computedWidth = typeof width === 'number' ? `${width}px` : width;
9
9
  const computedHeight = typeof height === 'number' ? `${height}px` : height;
@@ -11,13 +11,11 @@ export const Skeleton = ({ className, borderRadius = 4, style, width, height, co
11
11
  const dynamicStyle = {
12
12
  '--radius': borderRadius && tkns.radius[borderRadius],
13
13
  '--width': width && computedWidth,
14
- '--height': height && computedHeight
14
+ '--height': height && computedHeight,
15
+ '--gap': gap ? tkns.space[gap] : undefined
15
16
  };
16
17
  return (_jsx("span", { className: styles.SkeletonItem, "data-skeleton-circle": circle, "data-skeleton-animated": enableAnimation, style: { ...dynamicStyle, ...style }, children: "\u200C" }, void 0));
17
- }, [
18
- borderRadius, width, computedWidth, height,
19
- computedHeight, circle, style, enableAnimation
20
- ]);
18
+ }, [borderRadius, width, computedWidth, height, computedHeight, gap, circle, enableAnimation, style]);
21
19
  return (_jsx("span", { className: className, "aria-live": "polite", "aria-busy": enableAnimation, ...otherProps, children: Array.from({ length: count }).map((_, i) => {
22
20
  return inline
23
21
  ? _jsx(SkeletonItem, {}, uid(i))
@@ -1 +1 @@
1
- .SkeletonItem{--base-color:var(--dimmed-1);--highlight-color:var(--dimmed-0);--animation-duration:1.5s;--animation-direction:normal;background-color:var(--base-color);border-radius:var(--radius,1.78rem);display:inline-flex;height:var(--height);line-height:1;overflow:hidden;position:relative;width:var(--width,100%);z-index:1}.SkeletonItem:after{background-image:linear-gradient(to right,var(--base-color),var(--highlight-color),var(--base-color));background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;transform:translateX(-100%)}.SkeletonItem[data-skeleton-animated=true]:after{animation-direction:normal;animation-duration:1.5s;animation-iteration-count:infinite;animation-name:skeleton-shimmer;animation-timing-function:ease-in-out}.SkeletonItem[data-skeleton-circle=true]{border-radius:100%}@keyframes skeleton-shimmer{to{transform:translateX(100%)}}
1
+ .SkeletonItem{--base-color:var(--dimmed-1);--highlight-color:var(--dimmed-0);--animation-duration:1.5s;--animation-direction:normal;background-color:var(--base-color);border-radius:var(--radius,1.78rem);display:inline-flex;height:var(--height);line-height:1;overflow:hidden;position:relative;width:var(--width,100%);z-index:1}.SkeletonItem+br+.SkeletonItem{margin-top:var(--gap,0)}.SkeletonItem:after{background-image:linear-gradient(to right,var(--base-color),var(--highlight-color),var(--base-color));background-repeat:no-repeat;content:" ";display:block;height:100%;left:0;position:absolute;right:0;transform:translateX(-100%)}.SkeletonItem[data-skeleton-animated=true]:after{animation-direction:normal;animation-duration:1.5s;animation-iteration-count:infinite;animation-name:skeleton-shimmer;animation-timing-function:ease-in-out}.SkeletonItem[data-skeleton-circle=true]{border-radius:100%}@keyframes skeleton-shimmer{to{transform:translateX(100%)}}
@@ -10,6 +10,6 @@ export const Slider = forwardRef(({ min = 0, max = 100, step, onInput, className
10
10
  onInput && onInput(currentTarget.valueAsNumber);
11
11
  setValue(currentTarget.valueAsNumber);
12
12
  }, [onInput]);
13
- return (_jsxs(Stack, { direction: "row", verticalAlign: "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, children: value }, void 0), (iconMin && !showValues) && _jsx(Icon, { source: iconMin, dimension: isSmall ? 16 : 24 }, void 0), _jsx("input", { ref: forwardedRef, className: styles.Input, type: "range", min: min, max: max, defaultValue: value, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, step: step, onInput: handleInput, ...otherProps }, void 0), showValues && _jsx(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", className: styles.Value, children: max }, void 0), (iconMax && !showValues) && _jsx(Icon, { source: iconMax, dimension: isSmall ? 16 : 24 }, void 0)] }, void 0));
13
+ return (_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, children: value }, void 0), (iconMin && !showValues) && _jsx(Icon, { source: iconMin, dimension: isSmall ? 16 : 24 }, void 0), _jsx("input", { ref: forwardedRef, className: styles.Input, type: "range", min: min, max: max, defaultValue: value, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, step: step, onInput: handleInput, ...otherProps }, void 0), showValues && _jsx(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", className: styles.Value, children: max }, void 0), (iconMax && !showValues) && _jsx(Icon, { source: iconMax, dimension: isSmall ? 16 : 24 }, void 0)] }, void 0));
14
14
  });
15
15
  Slider.displayName = 'Slider';
@@ -11,5 +11,5 @@ export const Snackbar = forwardRef(({ children, className, title, icon, kind = '
11
11
  positive: 'check',
12
12
  danger: 'circle-x'
13
13
  };
14
- return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.Snackbar, className), "data-snackbar-kind": kind, role: "status", ...otherProps, children: _jsxs(Stack, { verticalAlign: "start", horizontalAlign: "start", direction: "row", columnGap: 16, fill: false, children: [_jsx(Icon, { className: styles.Icon, weight: "duotone", source: icon || defaultIcons[kind], dimension: 24 }, void 0), _jsxs(Stack, { rowGap: 16, children: [_jsxs(Stack, { rowGap: 8, children: [title && _jsx(Title, { level: "5", children: title }, void 0), _jsx("p", { children: children }, void 0)] }, void 0), dismissable && (_jsx(Stack, { horizontalAlign: "end", children: _jsx(Button, { onClick: onDismiss, className: styles.Action, children: dismissLabel }, void 0) }, void 0))] }, void 0)] }, void 0) }, void 0));
14
+ return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.Snackbar, className), "data-snackbar-kind": kind, role: "status", ...otherProps, children: _jsxs(Stack, { vAlign: "start", hAlign: "start", direction: "row", columnGap: 16, fill: false, children: [_jsx(Icon, { className: styles.Icon, weight: "duotone", source: icon || defaultIcons[kind], dimension: 24 }, void 0), _jsxs(Stack, { rowGap: 16, children: [_jsxs(Stack, { rowGap: 8, children: [title && _jsx(Title, { level: "5", children: title }, void 0), _jsx("p", { children: children }, void 0)] }, void 0), dismissable && (_jsx(Stack, { hAlign: "end", children: _jsx(Button, { onClick: onDismiss, className: styles.Action, children: dismissLabel }, void 0) }, void 0))] }, void 0)] }, void 0) }, void 0));
15
15
  });
@@ -26,20 +26,20 @@ export declare type StackProps = {
26
26
  * Set the vertical content placement instead of
27
27
  * growing to fill the available space.
28
28
  */
29
- verticalAlign?: string;
29
+ vAlign?: string;
30
30
  /**
31
31
  * Set the horizontal content placement instead of
32
32
  * growing to fill the available space.
33
33
  */
34
- horizontalAlign?: string;
34
+ hAlign?: string;
35
35
  /**
36
36
  * Set the horizontal padding (left/right)
37
37
  */
38
- horizontalPadding?: TokensTypes['space'];
38
+ hPadding?: TokensTypes['space'];
39
39
  /**
40
40
  * Set the vertical padding (top/bottom)
41
41
  */
42
- verticalPadding?: TokensTypes['space'];
42
+ vPadding?: TokensTypes['space'];
43
43
  /**
44
44
  * Renderes children as rows or columns. The value can be one of the flex directions.
45
45
  * More info: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction
@@ -1 +1 @@
1
- {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/components/stack/stack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAI1C,oBAAY,UAAU,GAAG;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACzC;;OAEG;IACH,eAAe,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;CACjE,CAAA;AAED,aAAK,gBAAgB,GAAG,WAAW,CAAC,mBAAmB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAE3E,eAAO,MAAM,KAAK,kBAgDI,CAAA"}
1
+ {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/components/stack/stack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAI1C,oBAAY,UAAU,GAAG;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;CACjE,CAAA;AAED,aAAK,gBAAgB,GAAG,WAAW,CAAC,mBAAmB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAE3E,eAAO,MAAM,KAAK,kBAgDI,CAAA"}