@wonderflow/react-components 6.1.0 → 7.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 (108) hide show
  1. package/core/utils/media.css +5 -5
  2. package/dist/components/autocomplete/autocomplete-option.js +1 -1
  3. package/dist/components/autocomplete/autocomplete.js +2 -2
  4. package/dist/components/avatar/avatar.js +1 -1
  5. package/dist/components/button/button.js +2 -2
  6. package/dist/components/button/button.module.css +1 -1
  7. package/dist/components/card/card.js +1 -1
  8. package/dist/components/chip/chip.js +1 -1
  9. package/dist/components/circular-progress/circular-progress.js +3 -3
  10. package/dist/components/clamp-text/clamp-text.js +1 -1
  11. package/dist/components/container/container.js +1 -1
  12. package/dist/components/datetime/datetime.js +1 -1
  13. package/dist/components/disclosure/disclosure.js +3 -3
  14. package/dist/components/disclosure/disclosure.module.css +1 -1
  15. package/dist/components/drawer/drawer.js +1 -1
  16. package/dist/components/elevator/elevator.js +1 -1
  17. package/dist/components/grid/grid.js +1 -1
  18. package/dist/components/grid/item/grid-item.js +1 -1
  19. package/dist/components/icon/icon.js +2 -2
  20. package/dist/components/icon-button/icon-button.js +1 -1
  21. package/dist/components/index.d.ts +1 -1
  22. package/dist/components/index.d.ts.map +1 -1
  23. package/dist/components/index.js +1 -1
  24. package/dist/components/info-state/info-state.js +1 -1
  25. package/dist/components/input-group/input-group.js +4 -4
  26. package/dist/components/linear-progress/linear-progress.js +2 -2
  27. package/dist/components/list/index.d.ts +1 -0
  28. package/dist/components/list/index.d.ts.map +1 -1
  29. package/dist/components/list/list-item.d.ts +28 -0
  30. package/dist/components/list/list-item.d.ts.map +1 -0
  31. package/dist/components/list/list-item.js +31 -0
  32. package/dist/components/list/list.d.ts +6 -11
  33. package/dist/components/list/list.d.ts.map +1 -1
  34. package/dist/components/list/list.js +9 -19
  35. package/dist/components/list/list.module.css +1 -1
  36. package/dist/components/masonry/masonry.js +1 -1
  37. package/dist/components/menu/menu-item/menu-item-checkbox.js +1 -1
  38. package/dist/components/menu/menu-item/menu-item.js +3 -3
  39. package/dist/components/menu/menu.d.ts +1 -1
  40. package/dist/components/menu/menu.js +1 -1
  41. package/dist/components/modal/content/modal-content.js +1 -1
  42. package/dist/components/modal/modal.js +1 -1
  43. package/dist/components/overlay-container/overlay-container.js +1 -1
  44. package/dist/components/overlay-container/overlay-context.js +1 -1
  45. package/dist/components/pagination/pagination.js +1 -1
  46. package/dist/components/popover/index.d.ts +4 -0
  47. package/dist/components/popover/index.d.ts.map +1 -0
  48. package/dist/components/popover/index.js +2 -0
  49. package/dist/components/popover/popover.d.ts +95 -0
  50. package/dist/components/popover/popover.d.ts.map +1 -0
  51. package/dist/components/popover/popover.js +93 -0
  52. package/dist/components/popover/popover.module.css +1 -0
  53. package/dist/components/prose/prose.js +1 -1
  54. package/dist/components/select/select.js +1 -1
  55. package/dist/components/select/select.module.css +1 -1
  56. package/dist/components/selection-controls/checkbox.js +1 -1
  57. package/dist/components/selection-controls/radio.js +1 -1
  58. package/dist/components/selection-controls/selection-controls.module.css +1 -1
  59. package/dist/components/selection-controls/toggle.js +1 -1
  60. package/dist/components/separator/separator.js +1 -1
  61. package/dist/components/skeleton/skeleton.js +3 -3
  62. package/dist/components/slider/slider.d.ts.map +1 -1
  63. package/dist/components/slider/slider.js +2 -2
  64. package/dist/components/slider/slider.module.css +1 -1
  65. package/dist/components/snackbar/snackbar.js +1 -1
  66. package/dist/components/spinner/spinner.js +1 -1
  67. package/dist/components/split-button/split-button.d.ts +2 -2
  68. package/dist/components/split-button/split-button.d.ts.map +1 -1
  69. package/dist/components/split-button/split-button.js +2 -2
  70. package/dist/components/stack/stack.js +1 -1
  71. package/dist/components/star-meter/star-meter.d.ts.map +1 -1
  72. package/dist/components/star-meter/star-meter.js +10 -10
  73. package/dist/components/star-meter/star-meter.module.css +1 -1
  74. package/dist/components/tab/primitive-tab.js +1 -1
  75. package/dist/components/tab/tab-item.d.ts.map +1 -1
  76. package/dist/components/tab/tab-item.js +1 -1
  77. package/dist/components/tab/tab-list.js +1 -1
  78. package/dist/components/tab/tab-panel.js +1 -1
  79. package/dist/components/tab/tab.js +2 -2
  80. package/dist/components/table/table-cell/table-cell.js +1 -1
  81. package/dist/components/table/table-checkbox/table-checkbox.js +1 -1
  82. package/dist/components/table/table-controls/toggle-columns.js +2 -2
  83. package/dist/components/table/table-expand/table-expand.js +1 -1
  84. package/dist/components/table/table-header/table-header.js +1 -1
  85. package/dist/components/table/table-pagination/table-pagination.js +2 -2
  86. package/dist/components/table/table-row/table-row.js +1 -1
  87. package/dist/components/table/table.d.ts +1 -1
  88. package/dist/components/table/table.d.ts.map +1 -1
  89. package/dist/components/table/table.js +28 -23
  90. package/dist/components/text/text.js +3 -3
  91. package/dist/components/text/text.module.css +1 -1
  92. package/dist/components/textfield/base-field/base-field.js +1 -1
  93. package/dist/components/textfield/base-field/base-field.module.css +1 -1
  94. package/dist/components/textfield/textfield.js +3 -3
  95. package/dist/components/title/title.js +3 -3
  96. package/dist/components/title/title.module.css +1 -1
  97. package/dist/components/toggle-button/toggle-button.js +2 -2
  98. package/dist/components/tooltip/tooltip.d.ts +1 -1
  99. package/dist/components/tooltip/tooltip.js +2 -2
  100. package/dist/components/tooltip/tooltip.module.css +1 -1
  101. package/package.json +10 -11
  102. package/dist/components/dropdown/dropdown.d.ts +0 -87
  103. package/dist/components/dropdown/dropdown.d.ts.map +0 -1
  104. package/dist/components/dropdown/dropdown.js +0 -69
  105. package/dist/components/dropdown/dropdown.module.css +0 -1
  106. package/dist/components/dropdown/index.d.ts +0 -3
  107. package/dist/components/dropdown/index.d.ts.map +0 -1
  108. package/dist/components/dropdown/index.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useMemo } from 'react';
3
- import { Button, Menu, Dropdown } from '../../..';
3
+ import { Button, Menu, Popover } from '../../..';
4
4
  export const ToggleColumnsControl = ({ columns, visibleColumns }) => {
5
5
  const someVisibleColums = useMemo(() => visibleColumns.length !== 0, [visibleColumns]);
6
6
  const filteredColumns = useMemo(() => columns.filter(col => !col.hideFromList), [columns]);
@@ -19,5 +19,5 @@ export const ToggleColumnsControl = ({ columns, visibleColumns }) => {
19
19
  */
20
20
  filteredColumns.forEach(col => col.toggleHidden(false));
21
21
  }, [someVisibleColums, filteredColumns, visibleColumns]);
22
- return (_jsx(Dropdown, { placement: "bottom-start", trigger: _jsx(Button, { kind: "secondary", children: "Toggle columns" }, void 0), children: _jsxs(Menu, { children: [_jsx(Menu.ItemCheckbox, { onClick: () => handleToggleAll(), checked: true, icon: visibleColumns.length === 0 ? 'check' : 'minus', children: "Toggle All" }, void 0), columns.filter(col => !col.hideFromList).map((column, i) => (_jsx(Menu.ItemCheckbox, { autoFocus: i === 0, checked: column.isVisible, icon: column.isVisible ? 'check' : undefined, onClick: () => column.toggleHidden(), children: column.render('Header') }, column.id)))] }, void 0) }, void 0));
22
+ return (_jsx(Popover, { placement: "bottom-start", trigger: _jsx(Button, { kind: "secondary", children: "Toggle columns" }), children: _jsxs(Menu, { children: [_jsx(Menu.ItemCheckbox, { onClick: () => handleToggleAll(), checked: true, icon: visibleColumns.length === 0 ? 'check' : 'minus', children: "Toggle All" }), columns.filter(col => !col.hideFromList).map((column, i) => (_jsx(Menu.ItemCheckbox, { autoFocus: i === 0, checked: column.isVisible, icon: column.isVisible ? 'check' : undefined, onClick: () => column.toggleHidden(), children: column.render('Header') }, column.id)))] }) }));
23
23
  };
@@ -1,3 +1,3 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import styles from './table-expand.module.css';
3
- export const TableExpand = ({ data, component: Component }) => (_jsx("div", { className: styles.TableExpand, children: _jsx("div", { className: styles.ExpandContent, children: Component ? _jsx(Component, { ...data }, void 0) : null }, void 0) }, void 0));
3
+ export const TableExpand = ({ data, component: Component }) => (_jsx("div", { className: styles.TableExpand, children: _jsx("div", { className: styles.ExpandContent, children: Component ? _jsx(Component, { ...data }) : null }) }));
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Stack, Title } from '../../..';
3
3
  import styles from './table-header.module.css';
4
- export const TableHeader = ({ children, title, id, ...otherProps }) => (_jsxs(Stack, { direction: "row", columnGap: 32, vAlign: "center", hAlign: "space-between", fill: false, className: styles.TableHeader, ...otherProps, children: [_jsx("div", { children: typeof title === 'string' ? _jsx(Title, { id: id, level: "5", children: title }, void 0) : title }, void 0), _jsx(Stack, { direction: "row", vAlign: "center", columnGap: 8, inline: true, children: children }, void 0)] }, void 0));
4
+ export const TableHeader = ({ children, title, id, ...otherProps }) => (_jsxs(Stack, { direction: "row", columnGap: 32, vAlign: "center", hAlign: "space-between", fill: false, className: styles.TableHeader, ...otherProps, children: [_jsx("div", { children: typeof title === 'string' ? _jsx(Title, { id: id, level: "5", children: title }) : title }), _jsx(Stack, { direction: "row", vAlign: "center", columnGap: 8, inline: true, children: children })] }));
@@ -7,7 +7,7 @@ export const TablePagination = ({ children, pageSize, onPageSizeChange, clusters
7
7
  const computedPageCount = useMemo(() => (isManual ? Math.ceil(totalItems / pageSize) : totalPages), [isManual, pageSize, totalItems, totalPages]);
8
8
  const computedItemsInPageStart = useMemo(() => (currentPage && pageSize) && currentPage * pageSize, [currentPage, pageSize]);
9
9
  const computedItemsInPageEnd = useMemo(() => currentPage * pageSize + pageSize, [currentPage, pageSize]);
10
- return (_jsxs(Stack, { fill: false, direction: "row", columnGap: 16, vAlign: "center", hAlign: "end", vPadding: 16, ...otherProps, children: [_jsxs(Stack, { direction: "row", columnGap: 4, children: [_jsx(Text, { as: "label", htmlFor: uid('table-i-per-page'), size: 14, children: "Items per page:" }, void 0), _jsx(Select, { value: pageSize, dimension: "small", id: uid('table-i-per-page'), onChange: ({ currentTarget }) => {
10
+ return (_jsxs(Stack, { fill: false, direction: "row", columnGap: 16, vAlign: "center", hAlign: "end", vPadding: 16, ...otherProps, children: [_jsxs(Stack, { direction: "row", columnGap: 4, children: [_jsx(Text, { as: "label", htmlFor: uid('table-i-per-page'), size: 14, children: "Items per page:" }), _jsx(Select, { value: pageSize, dimension: "small", id: uid('table-i-per-page'), onChange: ({ currentTarget }) => {
11
11
  onPageSizeChange?.(Number(currentTarget.value));
12
- }, children: clusters.map(cluster => (_jsx("option", { value: cluster, children: cluster }, cluster))) }, void 0)] }, void 0), _jsx(Text, { "aria-hidden": "true", weight: "bold", size: 14, children: `${computedItemsInPageStart + 1}-${computedItemsInPageEnd > totalItems ? totalItems : computedItemsInPageEnd} of ${totalItems}` }, void 0), _jsx(Pagination, { itemsCount: totalItems, itemsPerPage: pageSize, pageCount: computedPageCount, onPageClick: ({ selected }) => onPageClick?.(selected), renderOnZeroPageCount: () => null, forcePage: currentPage }, void 0)] }, void 0));
12
+ }, children: clusters.map(cluster => (_jsx("option", { value: cluster, children: cluster }, cluster))) })] }), _jsx(Text, { "aria-hidden": "true", weight: "bold", size: 14, children: `${computedItemsInPageStart + 1}-${computedItemsInPageEnd > totalItems ? totalItems : computedItemsInPageEnd} of ${totalItems}` }), _jsx(Pagination, { itemsCount: totalItems, itemsPerPage: pageSize, pageCount: computedPageCount, onPageClick: ({ selected }) => onPageClick?.(selected), renderOnZeroPageCount: () => null, forcePage: currentPage })] }));
13
13
  };
@@ -11,5 +11,5 @@ export const TableRow = ({ children, className, expanded, rowData, expandedRows,
11
11
  });
12
12
  return Boolean(isHighlight);
13
13
  }, [expandedRows, rowData]);
14
- return (_jsx("tr", { className: clsx(styles.TableRow, className), "data-table-row-expanded": expanded, "data-table-row-highlight": highlightRow || undefined, ...otherProps, children: children }, void 0));
14
+ return (_jsx("tr", { className: clsx(styles.TableRow, className), "data-table-row-expanded": expanded, "data-table-row-highlight": highlightRow || undefined, ...otherProps, children: children }));
15
15
  };
@@ -40,7 +40,7 @@ export declare type TableProps<T extends Record<string, unknown>> = PropsWithCla
40
40
  totalRows?: number;
41
41
  /**
42
42
  * Set clusters of items to show in a single page. These values are used to
43
- * compute the select options for the page size dropdown.
43
+ * compute the select options for the page size select.
44
44
  */
45
45
  pageClusters?: TablePaginationProps['clusters'];
46
46
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAA2B,SAAS,EAClD,MAAM,OAAO,CAAA;AACd,OAAO,EACE,MAAM,EAAE,GAAG,EAAE,WAAW,EAGhC,MAAM,aAAa,CAAA;AAapB,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAmB,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAE1E,OAAO,EAC+B,iBAAiB,EACrD,iBAAiB,EACA,iBAAiB,EAAE,cAAc,EACnD,MAAM,SAAS,CAAA;AAEhB,oBAAY,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,cAAc,GAAG;IAC3E;;OAEG;IACH,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC9B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC;;OAEG;IACH,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACjF;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,oBAAoB,CAAC,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KG;IACH,sBAAsB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC1C;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CACvC,CAAA;AAED,eAAO,MAAM,KAAK,shBA0VjB,CAAA"}
@@ -44,10 +44,8 @@ export const Table = ({ className, style, columns, data = [], selectableRows, on
44
44
  id: 'selection',
45
45
  isCollapsed: true,
46
46
  hideFromList: true,
47
- Header: ({ getToggleAllRowsSelectedProps }) => (!loading
48
- ? (_jsx(TableCheckbox, { ...getToggleAllRowsSelectedProps() }, void 0))
49
- : null),
50
- Cell: ({ row }) => (_jsx(TableCheckbox, { ...row.getToggleRowSelectedProps() }, void 0))
47
+ Header: ({ getToggleAllRowsSelectedProps }) => (!loading ? _jsx(TableCheckbox, { ...getToggleAllRowsSelectedProps() }) : null),
48
+ Cell: ({ row }) => _jsx(TableCheckbox, { ...row.getToggleRowSelectedProps() })
51
49
  }];
52
50
  const expanderColumn = [{
53
51
  id: 'expander',
@@ -60,14 +58,14 @@ export const Table = ({ className, style, columns, data = [], selectableRows, on
60
58
  const subRowsExpanded = row.subRows.filter(r => r.isExpanded);
61
59
  subRowsExpanded.forEach(r => r.toggleRowExpanded(!r.isExpanded));
62
60
  row.toggleRowExpanded(!row.isExpanded);
63
- } }, void 0))
61
+ } }))
64
62
  : null)
65
63
  }];
66
64
  const actionsColumn = [{
67
65
  id: 'actions',
68
66
  isCollapsed: true,
69
67
  hideFromList: true,
70
- Cell: ({ row }) => (ActionsRowComponent ? _jsx(ActionsRowComponent, { ...row }, void 0) : null)
68
+ Cell: ({ row }) => (ActionsRowComponent ? _jsx(ActionsRowComponent, { ...row }) : null)
71
69
  }];
72
70
  hooks.visibleColumns.push(columns => [
73
71
  ...checkboxColumn,
@@ -89,7 +87,6 @@ export const Table = ({ className, style, columns, data = [], selectableRows, on
89
87
  selectableRows,
90
88
  setHiddenColumns,
91
89
  defaultHiddenColumns,
92
- expandableRowComponent,
93
90
  hasSomeExpandableRows,
94
91
  ActionsRowComponent
95
92
  ]);
@@ -109,22 +106,30 @@ export const Table = ({ className, style, columns, data = [], selectableRows, on
109
106
  '--table-height': height,
110
107
  '--table-background': background
111
108
  };
112
- return (_jsxs("div", { className: clsx(styles.Table, className), style: { ...dynamicStyle, ...style }, children: [_jsx(AnimatePresence, { children: selectedFlatRows?.length && (_jsxs(Stack, { as: motion.div, className: styles.Toast, direction: "row", hAlign: "space-between", vAlign: "center", hPadding: 16, vPadding: 8, fill: false, columnGap: 16, initial: { y: '-16px', opacity: 0 }, animate: {
113
- y: 0,
114
- opacity: 1,
115
- transition: {
116
- type: 'spring',
117
- stiffness: 700,
118
- damping: 30
119
- }
120
- }, exit: { y: '-16px', opacity: 0 }, children: [_jsx(Text, { as: "span", size: 14, weight: "bold", children: selectedLabel(selectedFlatRows) }, void 0), selectedActions] }, void 0)) }, void 0), (showHeader || selectableRows) && (_jsxs(TableHeader, { title: title, children: [(columnsControl && data.length)
121
- ? (_jsx(ToggleColumnsControl, { columns: allColumns, visibleColumns: filteredVisibleColumns }, void 0))
122
- : null, actions] }, void 0)), ((data.length || loading) && filteredVisibleColumns.length)
123
- ? (_jsx("div", { className: styles.TableWrapper, "data-table-scrolling": Boolean(height), children: _jsxs("table", { className: styles.TableElement, "data-table-stripes": stripes, "data-table-separators": showSeparators, "data-table-loading": loading, "aria-labelledby": uid('table-title'), ...getTableProps(), ...otherProps, children: [showTableHead && (_jsx("thead", { role: "rowgroup", className: styles.THead, children: headerGroups.map(headerGroup => (_jsx(TableRow, { ...headerGroup.getHeaderGroupProps(), children: headerGroup.headers.map((column) => (_jsx(TableCell, { as: "th", width: column.minWidth === 0 ? undefined : column.minWidth, collapsed: column.isCollapsed, isSorted: column.isSorted, isSortedDesc: column.isSorted && column.isSortedDesc, align: column.align, ...column.getHeaderProps(column.getSortByToggleProps()), children: column.render('Header') }, void 0))) }, void 0))) }, void 0)), _jsx("tbody", { role: "rowgroup", className: styles.TBody, ...getTableBodyProps(), children: loading
124
- ? (_jsx(TableRow, { children: visibleColumns.map(() => (_jsx(TableCell, { children: _jsx(Skeleton, { gap: 16, height: 16, count: 5 }, void 0) }, void 0))) }, void 0))
109
+ return (_jsxs("div", { className: clsx(styles.Table, className), style: { ...dynamicStyle, ...style }, children: [_jsxs(AnimatePresence, { children: [selectedFlatRows?.length && (_jsxs(Stack, { as: motion.div, className: styles.Toast, direction: "row", hAlign: "space-between", vAlign: "center", hPadding: 16, vPadding: 8, fill: false, columnGap: 16, initial: { y: -16, opacity: 0 }, animate: {
110
+ y: 0,
111
+ opacity: 1,
112
+ transition: {
113
+ type: 'spring',
114
+ stiffness: 700,
115
+ damping: 30
116
+ }
117
+ }, exit: { y: -16, opacity: 0 }, children: [_jsx(Text, { as: "span", size: 14, weight: "bold", children: selectedLabel(selectedFlatRows) }), selectedActions] })), (showHeader || selectableRows) && (_jsx(motion.div, { animate: {
118
+ y: selectedFlatRows?.length ? 20 : 0,
119
+ opacity: selectedFlatRows?.length ? 0 : 1,
120
+ transition: {
121
+ type: 'spring',
122
+ stiffness: 700,
123
+ damping: 30
124
+ }
125
+ }, children: _jsxs(TableHeader, { title: title, children: [(columnsControl && data.length)
126
+ ? (_jsx(ToggleColumnsControl, { columns: allColumns, visibleColumns: filteredVisibleColumns }))
127
+ : null, actions] }) }))] }), ((data.length || loading) && filteredVisibleColumns.length)
128
+ ? (_jsx("div", { className: styles.TableWrapper, "data-table-scrolling": Boolean(height), children: _jsxs("table", { className: styles.TableElement, "data-table-stripes": stripes, "data-table-separators": showSeparators, "data-table-loading": loading, "aria-labelledby": uid('table-title'), ...getTableProps(), ...otherProps, children: [showTableHead && (_jsx("thead", { role: "rowgroup", className: styles.THead, children: headerGroups.map(headerGroup => (_jsx(TableRow, { ...headerGroup.getHeaderGroupProps(), children: headerGroup.headers.map((column) => (_jsx(TableCell, { as: "th", width: column.minWidth === 0 ? undefined : column.minWidth, collapsed: column.isCollapsed, isSorted: column.isSorted, isSortedDesc: column.isSorted && column.isSortedDesc, align: column.align, ...column.getHeaderProps(column.getSortByToggleProps()), children: column.render('Header') }))) }))) })), _jsx("tbody", { role: "rowgroup", className: styles.TBody, ...getTableBodyProps(), children: loading
129
+ ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 100, children: _jsx(Skeleton, { gap: 16, height: 24, count: 10 }) }) }))
125
130
  : rowEntries.map((row) => {
126
131
  prepareRow(row);
127
- return (_jsxs(Fragment, { children: [_jsx(TableRow, { ...row.getRowProps(), expanded: (row.isExpanded && !row.subRows.some(subrow => subrow.isExpanded && subrow.canExpand)), rowData: row, expandedRows: expandedRows, children: row.cells.map((cell) => (_jsx(TableCell, { collapsed: cell.column.isCollapsed, width: cell.column.minWidth === 0 ? undefined : cell.column.minWidth, align: cell.column.align, ...cell.getCellProps(), children: cell.render('Cell') }, void 0))) }, void 0), (row.subRows && row.isExpanded && expandableRowComponent) && row.subRows.map(subRow => (_jsx(TableRow, { "data-table-row-expander": true, children: _jsx(TableCell, { padding: false, colSpan: 100, children: _jsx(TableExpand, { data: subRow.original, component: expandableRowComponent }, void 0) }, void 0) }, subRow.id)))] }, row.id));
128
- }) }, void 0)] }, void 0) }, void 0))
129
- : (_jsx(Stack, { vAlign: "center", hAlign: "center", children: emptyComponent ?? 'No data' }, void 0)), (showPagination && filteredVisibleColumns.length > 0 && !!rows.length) && (_jsx(TablePagination, { clusters: pageClusters, pageSize: pageSize, totalItems: totalRows ?? rows.length, currentPage: pageIndex, totalPages: pageCount, isManual: Boolean(isManualPaginated && totalRows), onPageSizeChange: newPageSize => setPageSize(newPageSize), onPageClick: selected => gotoPage(selected) }, void 0))] }, void 0));
132
+ return (_jsxs(Fragment, { children: [_jsx(TableRow, { ...row.getRowProps(), expanded: (row.isExpanded && !row.subRows.some(subrow => subrow.isExpanded && subrow.canExpand)), rowData: row, expandedRows: expandedRows, children: row.cells.map((cell) => (_jsx(TableCell, { collapsed: cell.column.isCollapsed, width: cell.column.minWidth === 0 ? undefined : cell.column.minWidth, align: cell.column.align, ...cell.getCellProps(), children: cell.render('Cell') }))) }), (row.subRows && row.isExpanded && expandableRowComponent) && row.subRows.map(subRow => (_jsx(TableRow, { "data-table-row-expander": true, children: _jsx(TableCell, { padding: false, colSpan: 100, children: _jsx(TableExpand, { data: subRow.original, component: expandableRowComponent }) }) }, subRow.id)))] }, row.id));
133
+ }) })] }) }))
134
+ : (_jsx(Stack, { vAlign: "center", hAlign: "center", children: emptyComponent ?? 'No data' })), (showPagination && filteredVisibleColumns.length > 0 && !!rows.length) && (_jsx(TablePagination, { clusters: pageClusters, pageSize: pageSize, totalItems: totalRows ?? rows.length, currentPage: pageIndex, totalPages: pageCount, isManual: Boolean(isManualPaginated && totalRows), onPageSizeChange: newPageSize => setPageSize(newPageSize), onPageClick: selected => gotoPage(selected) }))] }));
130
135
  };
@@ -4,8 +4,8 @@ import styles from './text.module.css';
4
4
  import clsx from 'clsx';
5
5
  export const Text = forwardRef(({ children, className, size, sentiment, dimmed, weight, maxWidth, textAlign = 'start', as: Wrapper = 'p', responsive = true, lineHeight = 'large', style, ...otherProps }, forwardedRef) => {
6
6
  const dynamicStyle = {
7
- '--maxW': maxWidth,
8
- '--tAlign': textAlign
7
+ '--max-w': maxWidth,
8
+ '--t-align': textAlign
9
9
  };
10
- return (_jsx(Wrapper, { ref: forwardedRef, "data-text-size": size, "data-text-weight": weight, "data-text-sentiment": sentiment, "data-text-dimmed": dimmed, "data-text-line-height": lineHeight, "data-text-responsive": size === 14 ? 14 : responsive, className: clsx(styles.Text, className), style: { ...dynamicStyle, ...style }, ...otherProps, children: children }, void 0));
10
+ return (_jsx(Wrapper, { ref: forwardedRef, "data-text-size": size, "data-text-weight": weight, "data-text-sentiment": sentiment, "data-text-dimmed": dimmed, "data-text-line-height": lineHeight, "data-text-responsive": size === 14 ? 14 : responsive, className: clsx(styles.Text, className), style: { ...dynamicStyle, ...style }, ...otherProps, children: children }));
11
11
  });
@@ -1 +1 @@
1
- .Text{font-size:var(--fs-max);max-inline-size:var(--maxW,initial);min-block-size:.01vh;text-align:var(--tAlign)}.Text[data-text-dimmed="5"]{color:var(--dimmed-5)}.Text[data-text-dimmed="6"]{color:var(--dimmed-6)}.Text[data-text-dimmed="7"]{color:var(--dimmed-7)}.Text[data-text-sentiment=positive]{color:var(--highlight-green-foreground)}.Text[data-text-sentiment=informative]{color:var(--highlight-blue-foreground)}.Text[data-text-sentiment=danger]{color:var(--highlight-red-foreground)}.Text[data-text-sentiment=warning]{color:var(--highlight-yellow-foreground)}.Text[data-text-size="14"]{--fs-min:0.78rem;--fs-max:0.78rem}.Text[data-text-size="16"]{--fs-min:0.78rem;--fs-max:0.89rem}.Text[data-text-size="18"]{--fs-min:0.89rem;--fs-max:1.00rem}.Text[data-text-size="22"]{--fs-min:1.00rem;--fs-max:1.22rem}.Text[data-text-size="28"]{--fs-min:1.22rem;--fs-max:1.56rem}.Text[data-text-weight=thin]{font-weight:100}.Text[data-text-weight=bold]{font-weight:600}.Text[data-text-responsive=true]{font-size:var(--fs-min)}@media (min-width:48em){.Text[data-text-responsive=true]{font-size:var(--fs-max)}}.Text[data-text-line-height=none]{line-height:1}.Text[data-text-line-height=small]{line-height:1.2}.Text[data-text-line-height=large]{line-height:1.5}
1
+ .Text{font-size:var(--fs-max);max-inline-size:var(--max-w,initial);min-block-size:.01vh;text-align:var(--t-align)}.Text[data-text-dimmed="5"]{color:var(--dimmed-5)}.Text[data-text-dimmed="6"]{color:var(--dimmed-6)}.Text[data-text-dimmed="7"]{color:var(--dimmed-7)}.Text[data-text-sentiment=positive]{color:var(--highlight-green-foreground)}.Text[data-text-sentiment=informative]{color:var(--highlight-blue-foreground)}.Text[data-text-sentiment=danger]{color:var(--highlight-red-foreground)}.Text[data-text-sentiment=warning]{color:var(--highlight-yellow-foreground)}.Text[data-text-size="14"]{--fs-min:0.78rem;--fs-max:0.78rem}.Text[data-text-size="16"]{--fs-min:0.78rem;--fs-max:0.89rem}.Text[data-text-size="18"]{--fs-min:0.89rem;--fs-max:1.00rem}.Text[data-text-size="22"]{--fs-min:1.00rem;--fs-max:1.22rem}.Text[data-text-size="28"]{--fs-min:1.22rem;--fs-max:1.56rem}.Text[data-text-weight=thin]{font-weight:100}.Text[data-text-weight=bold]{font-weight:600}.Text[data-text-responsive=true]{font-size:var(--fs-min)}@media (min-width:48em){.Text[data-text-responsive=true]{font-size:var(--fs-max)}}.Text[data-text-line-height=none]{line-height:1}.Text[data-text-line-height=small]{line-height:1.2}.Text[data-text-line-height=large]{line-height:1.5}
@@ -3,6 +3,6 @@ import { forwardRef } from 'react';
3
3
  import styles from './base-field.module.css';
4
4
  import clsx from 'clsx';
5
5
  export const BaseField = forwardRef(({ as: Wrapper = 'input', invalid, className, ...otherProps }, forwardedRef) => {
6
- return (_jsx(Wrapper, { ref: forwardedRef, "data-basefield-invalid": invalid, className: clsx(styles.BaseField, className), ...otherProps }, void 0));
6
+ return (_jsx(Wrapper, { ref: forwardedRef, "data-basefield-invalid": invalid, className: clsx(styles.BaseField, className), ...otherProps }));
7
7
  });
8
8
  BaseField.displayName = 'BaseField';
@@ -1 +1 @@
1
- .BaseField{-webkit-appearance:none;appearance:none;background-color:var(--global-background);block-size:var(--field-height);border:1px solid var(--dimmed-2);border-radius:.22rem;box-sizing:border-box;caret-color:var(--cta-default);color:inherit;display:flex;font-family:inherit;font-size:var(--font-size);inline-size:100%;line-height:1;margin:0;outline-offset:2px;overflow:hidden;padding:0 var(--field-padding);text-overflow:ellipsis}[data-textfield-has-icon=true] .BaseField::-webkit-calendar-picker-indicator{opacity:0;position:absolute;right:calc(var(--field-padding)/2)}.BaseField:-moz-ui-invalid{box-shadow:none}.BaseField::placeholder{color:var(--dimmed-5)}.BaseField:focus-visible{border-color:var(--dimmed-5)}.BaseField:disabled{background:linear-gradient(to bottom,var(--global-disabled-background),var(--global-disabled-background));border-color:transparent;color:var(--global-disabled-foreground);cursor:not-allowed}.BaseField:disabled::placeholder{color:var(--dimmed-6)}.BaseField[readonly]{border-style:dashed;box-shadow:none;cursor:default}.BaseField:-webkit-autofill,.BaseField:-webkit-autofill:active,.BaseField:-webkit-autofill:focus,.BaseField:-webkit-autofill:hover{border:1px solid var(--dimmed-2);box-shadow:0 0 0 100px var(--global-background) inset}.BaseField:autofill,.BaseField:autofill:active,.BaseField:autofill:focus,.BaseField:autofill:hover{border:1px solid var(--dimmed-2);box-shadow:0 0 0 100px var(--global-background) inset}.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range),.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range):focus-visible{border-color:var(--highlight-red-foreground)}.BaseField[type=number]{-webkit-appearance:textfield;appearance:textfield}.BaseField[type=number]::-webkit-inner-spin-button,.BaseField[type=number]::-webkit-outer-spin-button{display:none}.BaseField[type=search]{-webkit-appearance:none;appearance:none}.BaseField[type=search]::-webkit-search-cancel-button,.BaseField[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}textarea.BaseField{block-size:auto;line-height:1.5;min-block-size:1.78rem;padding:calc(var(--field-padding)/2) calc(var(--field-padding) + .89rem) calc(var(--field-padding)/2) var(--field-padding);resize:vertical}textarea.BaseField::-webkit-datetime-edit-text{opacity:.3}textarea.BaseField::-webkit-calendar-picker-indicator{color:var(--global-foreground)}textarea.BaseField:-moz-ui-invalid{box-shadow:none}textarea.BaseField::-webkit-calendar-picker-indicator:hover{background-color:transparent}
1
+ .BaseField{-webkit-appearance:none;appearance:none;background-color:var(--global-background);block-size:var(--field-height);border:1px solid var(--dimmed-2);border-radius:.22rem;box-sizing:border-box;caret-color:var(--cta-default);color:inherit;display:flex;font-family:inherit;font-size:var(--font-size);inline-size:100%;line-height:1;margin:0;outline-offset:2px;overflow:hidden;padding:0 var(--field-padding);text-overflow:ellipsis}[data-textfield-has-icon=true] .BaseField::-webkit-calendar-picker-indicator{opacity:0;position:absolute;right:calc(var(--field-padding)/2)}.BaseField:-moz-ui-invalid{box-shadow:none}.BaseField::placeholder{color:var(--dimmed-5)}.BaseField:focus-visible{border-color:var(--dimmed-5)}.BaseField:disabled{background:linear-gradient(to bottom,var(--global-disabled-background),var(--global-disabled-background));border-color:transparent;color:var(--global-disabled-foreground);cursor:not-allowed}.BaseField:disabled::placeholder{color:var(--dimmed-6)}.BaseField[readonly]{border-style:dashed;box-shadow:none;cursor:default}.BaseField:-webkit-autofill,.BaseField:-webkit-autofill:active,.BaseField:-webkit-autofill:focus,.BaseField:-webkit-autofill:hover{-webkit-text-fill-color:var(--global-vibrancy-foreground);border:1px solid var(--dimmed-2);box-shadow:0 0 0 100px var(--global-background) inset}:is(.BaseField:-webkit-autofill,.BaseField:-webkit-autofill:hover,.BaseField:-webkit-autofill:focus,.BaseField:-webkit-autofill:active)::selection{-webkit-text-fill-color:var(--dimmed-0)}.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range),.BaseField:is(:invalid,[data-basefield-invalid=true],:out-of-range):focus-visible{border-color:var(--highlight-red-foreground)}.BaseField[type=number]{-webkit-appearance:textfield;appearance:textfield}.BaseField[type=number]::-webkit-inner-spin-button,.BaseField[type=number]::-webkit-outer-spin-button{display:none}.BaseField[type=search]{-webkit-appearance:none;appearance:none}.BaseField[type=search]::-webkit-search-cancel-button,.BaseField[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}textarea.BaseField{block-size:auto;line-height:1.5;min-block-size:1.78rem;padding:calc(var(--field-padding)/2) calc(var(--field-padding) + .89rem) calc(var(--field-padding)/2) var(--field-padding);resize:vertical}textarea.BaseField::-webkit-datetime-edit-text{opacity:.3}textarea.BaseField::-webkit-calendar-picker-indicator{color:var(--global-foreground)}textarea.BaseField:-moz-ui-invalid{box-shadow:none}textarea.BaseField::-webkit-calendar-picker-indicator:hover{background-color:transparent}
@@ -29,8 +29,8 @@ export const Textfield = forwardRef(({ children, className, disabled = false, ic
29
29
  disabled,
30
30
  onChange
31
31
  };
32
- return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(styles.Textfield, className), "data-textfield-has-icon": isPassword || Boolean(icon), "data-textfield-icon-position": iconPosition, "data-textfield-dimension": dimension, "data-textfield-invalid": invalid, "aria-disabled": disabled, hAlign: "stretch", vAlign: "start", tabIndex: disabled ? 0 : undefined, style: style, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: fieldID, children: label }, void 0), _jsxs("div", { className: styles.FieldContainer, children: [textarea
33
- ? (_jsx(BaseField, { ref: forwardedRef, as: "textarea", id: fieldID, ...commonProps, ...otherProps }, void 0))
34
- : (_jsx(BaseField, { className: styles.InputField, id: fieldID, ref: forwardedRef, type: passwordVisible ? 'text' : type, spellCheck: isPassword ? false : undefined, ...commonProps, ...otherProps }, void 0)), isPassword && (_jsx(IconButton, { className: styles.IconButton, dimension: actionSizes[dimension], onClick: handlePasswordVisibility, kind: "flat", "aria-label": "Reveal password", icon: passwordVisible ? 'eye-slash' : 'eye' }, void 0)), !textarea && icon && !isPassword && (_jsx(Icon, { className: styles.Icon, source: icon, dimension: iconSizes[dimension] }, void 0))] }, void 0)] }, void 0));
32
+ return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(styles.Textfield, className), "data-textfield-has-icon": isPassword || Boolean(icon), "data-textfield-icon-position": iconPosition, "data-textfield-dimension": dimension, "data-textfield-invalid": invalid, "aria-disabled": disabled, hAlign: "stretch", vAlign: "start", tabIndex: disabled ? 0 : undefined, style: style, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: fieldID, children: label }), _jsxs("div", { className: styles.FieldContainer, children: [textarea
33
+ ? (_jsx(BaseField, { ref: forwardedRef, as: "textarea", id: fieldID, ...commonProps, ...otherProps }))
34
+ : (_jsx(BaseField, { className: styles.InputField, id: fieldID, ref: forwardedRef, type: passwordVisible ? 'text' : type, spellCheck: isPassword ? false : undefined, ...commonProps, ...otherProps })), isPassword && (_jsx(IconButton, { className: styles.IconButton, dimension: actionSizes[dimension], onClick: handlePasswordVisibility, kind: "flat", "aria-label": "Reveal password", icon: passwordVisible ? 'eye-slash' : 'eye' })), !textarea && icon && !isPassword && (_jsx(Icon, { className: styles.Icon, source: icon, dimension: iconSizes[dimension] }))] })] }));
35
35
  });
36
36
  Textfield.displayName = 'Textfield';
@@ -5,8 +5,8 @@ import clsx from 'clsx';
5
5
  export const Title = forwardRef(({ children, className, as: Wrapper = 'span', lineHeight = 'small', level = '1', textAlign = 'start', maxWidth, responsive = true, style, ...otherProps }, forwardedRef) => {
6
6
  const computedLevel = level.match(/\d/g) ? `H${level}` : level.charAt(0).toUpperCase() + level.slice(1);
7
7
  const dynamicStyle = {
8
- '--maxW': maxWidth,
9
- '--tAlign': textAlign
8
+ '--max-w': maxWidth,
9
+ '--t-align': textAlign
10
10
  };
11
- return (_jsx(Wrapper, { ref: forwardedRef, "data-title-line-height": lineHeight, "data-title-responsive": responsive, className: clsx(styles.Title, styles[computedLevel], className), style: { ...dynamicStyle, ...style }, ...otherProps, children: children }, void 0));
11
+ return (_jsx(Wrapper, { ref: forwardedRef, "data-title-line-height": lineHeight, "data-title-responsive": responsive, className: clsx(styles.Title, styles[computedLevel], className), style: { ...dynamicStyle, ...style }, ...otherProps, children: children }));
12
12
  });
@@ -1 +1 @@
1
- .Title:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){--lh:1.5;color:var(--heading-foreground);display:block;font-size:var(--fs-max);line-height:1.2;max-inline-size:var(--maxW,initial);min-block-size:.01vh;overflow-wrap:break-word;text-align:var(--tAlign)}.Title[data-title-line-height=small]:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){--lh:1.2}.Title[data-title-line-height=large]:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){line-height:1.5}.Title:is(.H6){--fs-min:0.78rem;--fs-max:1.00rem;font-weight:700}.Title:is(.H5){--fs-min:1rem;--fs-max:1.33rem;font-weight:700}.Title:is(.H5):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H4){--fs-min:1.33rem;--fs-max:1.77rem;font-weight:700}.Title:is(.H4):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H3){--fs-min:1.77rem;--fs-max:2.37rem;font-weight:800}.Title:is(.H3):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H2){--fs-min:2.37rem;--fs-max:3.16rem;font-weight:800}.Title:is(.H2):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H1){--fs-min:3.16rem;--fs-max:4.2rem;font-weight:800}.Title:is(.H1):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title.Display{--fs-min:4.2rem;--fs-max:5.6rem;font-weight:800}.Title.Display:before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title[data-title-responsive=true]{font-size:var(--fs-min)}@media (min-width:48em){.Title[data-title-responsive=true]{font-size:var(--fs-max)}}
1
+ .Title:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){--lh:1.5;color:var(--heading-foreground);display:block;font-size:var(--fs-max);line-height:1.2;max-inline-size:var(--max-w,initial);min-block-size:.01vh;overflow-wrap:break-word;text-align:var(--t-align)}.Title[data-title-line-height=small]:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){--lh:1.2}.Title[data-title-line-height=large]:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){line-height:1.5}.Title:is(.H6){--fs-min:0.78rem;--fs-max:1.00rem;font-weight:700}.Title:is(.H5){--fs-min:1rem;--fs-max:1.33rem;font-weight:700}.Title:is(.H5):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H4){--fs-min:1.33rem;--fs-max:1.77rem;font-weight:700}.Title:is(.H4):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H3){--fs-min:1.77rem;--fs-max:2.37rem;font-weight:800}.Title:is(.H3):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H2){--fs-min:2.37rem;--fs-max:3.16rem;font-weight:800}.Title:is(.H2):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H1){--fs-min:3.16rem;--fs-max:4.2rem;font-weight:800}.Title:is(.H1):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title.Display{--fs-min:4.2rem;--fs-max:5.6rem;font-weight:800}.Title.Display:before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title[data-title-responsive=true]{font-size:var(--fs-min)}@media (min-width:48em){.Title[data-title-responsive=true]{font-size:var(--fs-max)}}
@@ -38,9 +38,9 @@ export const ToggleButton = forwardRef(({ className, restingIcon, pressedIcon, d
38
38
  regular: 16,
39
39
  small: 12
40
40
  };
41
- return (_jsx(Icon, { source: icon, dimension: iconSize[dimension] }, void 0));
41
+ return (_jsx(Icon, { source: icon, dimension: iconSize[dimension] }));
42
42
  }, []);
43
43
  return (_jsx(IconButton, { as: "button", ref: forwardedRef, dimension: dimension, "aria-pressed": isPressed, kind: kind, disabled: disabled, onClick: handleClick, className: clsx(styles.ToggleButton, className), ...otherProps, children: isPressed && pressedIcon
44
44
  ? (_jsx(motion.span, { variants: scaleAnimation, initial: firstRender && isPressed ? false : 'scaleOut', animate: "scaleIn", children: renderIcon(pressedIcon, dimension) }, "pressedIcon"))
45
- : restingIcon && (_jsx(motion.span, { variants: scaleAnimation, initial: firstRender && !isPressed ? false : 'scaleOut', animate: "scaleIn", children: renderIcon(restingIcon, dimension) }, "restingIcon")) }, void 0));
45
+ : restingIcon && (_jsx(motion.span, { variants: scaleAnimation, initial: firstRender && !isPressed ? false : 'scaleOut', animate: "scaleIn", children: renderIcon(restingIcon, dimension) }, "restingIcon")) }));
46
46
  });
@@ -14,7 +14,7 @@ export declare type TooltipProps = PropsWithClass & {
14
14
  * scroll and viewport edges.
15
15
  *
16
16
  * The first key refers to the X axis, the second key refers to the Y axis.
17
- * Eg: `auto-start` means the dropdown will be placed automatically on left or right
17
+ * Eg: `auto-start` means the tooltip will be placed automatically on left or right
18
18
  * based on the available space, and anchored at the top (start) of the trigger.
19
19
  */
20
20
  placement?: AutoPlacement | BasePlacement | VariationPlacement;
@@ -33,11 +33,11 @@ export const Tooltip = ({ children, trigger, placement = 'bottom-start', open, s
33
33
  }
34
34
  });
35
35
  const dynamycStyle = {
36
- '--maxW': maxWidth
36
+ '--max-w': maxWidth
37
37
  };
38
38
  return (_jsxs("div", { "data-tooltip-fill": fill, className: styles.TooltipClass, ref: tooltipContainerRef, "data-tooltip-has-focus-within": isFocusWithin, style: { ...style }, children: [Children.map(trigger, (child) => isValidElement(child) && cloneElement(child, {
39
39
  ref: setTriggerRef,
40
40
  tabIndex: 0,
41
41
  'aria-describedby': seedID('tooltip-content')
42
- })), visible && (_jsx(Elevator, { resting: 1, children: _jsxs("div", { ref: setTooltipRef, role: "tooltip", id: seedID('tooltip-content'), "data-theme": "dark", ...getTooltipProps({ className: styles.Balloon, style: dynamycStyle }), children: [children, _jsx("div", { ...getArrowProps({ className: styles.Arrow }) }, void 0)] }, void 0) }, void 0))] }, void 0));
42
+ })), visible && (_jsx(Elevator, { resting: 1, children: _jsxs("div", { ref: setTooltipRef, role: "tooltip", id: seedID('tooltip-content'), "data-theme": "dark", ...getTooltipProps({ className: styles.Balloon, style: dynamycStyle }), children: [children, _jsx("div", { ...getArrowProps({ className: styles.Arrow }) })] }) }))] }));
43
43
  };
@@ -1 +1 @@
1
- .Tooltip{display:contents}.Balloon{word-wrap:break-word;background-color:#31363f;border-radius:.22rem;font-size:.89rem;max-inline-size:var(--maxW);padding:.44rem .89rem;position:relative;z-index:2}.Balloon[data-popper-reference-hidden=true]{pointer-events:none;visibility:hidden}.Arrow:before{background-color:#31363f;block-size:12px;content:"";inline-size:12px;position:absolute;transform:rotate(45deg);visibility:visible}.Balloon[data-popper-reference-hidden=true] .Arrow{pointer-events:none;visibility:hidden}.Balloon[data-popper-placement^=top] .Arrow{bottom:6px}.Balloon[data-popper-placement^=top] .Arrow:before{transform:translateX(-50%) rotate(45deg)}.Balloon[data-popper-placement^=left] .Arrow{right:6px}.Balloon[data-popper-placement^=left] .Arrow:before{transform:translateY(-50%) rotate(45deg)}.Balloon[data-popper-placement^=bottom] .Arrow{top:-6px}.Balloon[data-popper-placement^=bottom] .Arrow:before{transform:translateX(-50%) rotate(45deg)}.Balloon[data-popper-placement^=right] .Arrow{left:-6px}.Balloon[data-popper-placement^=right] .Arrow:before{transform:translateY(-50%) rotate(45deg)}
1
+ .Tooltip{display:contents}.Balloon{word-wrap:break-word;background-color:#31363f;border-radius:.22rem;font-size:.89rem;max-inline-size:var(--max-w);padding:.44rem .89rem;position:relative;z-index:2}.Balloon[data-popper-reference-hidden=true]{pointer-events:none;visibility:hidden}.Arrow:before{background-color:#31363f;block-size:12px;content:"";inline-size:12px;position:absolute;transform:rotate(45deg);visibility:visible}.Balloon[data-popper-reference-hidden=true] .Arrow{pointer-events:none;visibility:hidden}.Balloon[data-popper-placement^=top] .Arrow{bottom:6px}.Balloon[data-popper-placement^=top] .Arrow:before{transform:translateX(-50%) rotate(45deg)}.Balloon[data-popper-placement^=left] .Arrow{right:6px}.Balloon[data-popper-placement^=left] .Arrow:before{transform:translateY(-50%) rotate(45deg)}.Balloon[data-popper-placement^=bottom] .Arrow{top:-6px}.Balloon[data-popper-placement^=bottom] .Arrow:before{transform:translateX(-50%) rotate(45deg)}.Balloon[data-popper-placement^=right] .Arrow{left:-6px}.Balloon[data-popper-placement^=right] .Arrow:before{transform:translateY(-50%) rotate(45deg)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wonderflow/react-components",
3
- "version": "6.1.0",
3
+ "version": "7.0.0",
4
4
  "description": "UI components from Wonderflow's Wanda design system",
5
5
  "author": "Wonderflow",
6
6
  "license": "MIT",
@@ -56,7 +56,7 @@
56
56
  "react-dom": "^17.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@babel/core": "7.17.5",
59
+ "@babel/core": "7.17.8",
60
60
  "@babel/preset-typescript": "7.16.7",
61
61
  "@storybook/addon-actions": "6.4.19",
62
62
  "@storybook/addon-essentials": "6.4.19",
@@ -67,26 +67,26 @@
67
67
  "@storybook/manager-webpack5": "6.5.0-alpha.21",
68
68
  "@storybook/react": "6.4.19",
69
69
  "@storybook/theming": "6.5.0-alpha.21",
70
- "@types/react": "17.0.39",
71
- "@types/react-dom": "17.0.11",
72
- "@types/react-table": "7.7.9",
70
+ "@types/react": "17.0.43",
71
+ "@types/react-dom": "17.0.14",
72
+ "@types/react-table": "7.7.10",
73
73
  "@wonderflow/config": "*",
74
74
  "@wonderflow/stylelint-config": "1.1.4",
75
75
  "@wonderflow/tokens": "*",
76
- "babel-loader": "8.2.3",
76
+ "babel-loader": "8.2.4",
77
77
  "cpy-cli": "3.1.1",
78
- "postcss": "8.4.7",
78
+ "postcss": "8.4.12",
79
79
  "postcss-cli": "9.1.0",
80
80
  "react": "17.0.2",
81
81
  "react-dom": "17.0.2",
82
82
  "storybook-addon-themes": "6.1.0",
83
83
  "storybook-css-modules-preset": "1.1.1",
84
84
  "tsconfig": "*",
85
- "typescript": "4.5.5",
85
+ "typescript": "4.6.3",
86
86
  "typescript-plugin-css-modules": "3.4.0"
87
87
  },
88
88
  "dependencies": {
89
- "ahooks": "3.1.10",
89
+ "ahooks": "3.3.0",
90
90
  "clsx": "1.1.1",
91
91
  "framer-motion": "6.2.8",
92
92
  "react-focus-on": "3.5.4",
@@ -96,7 +96,6 @@
96
96
  "react-roving-tabindex": "3.1.1",
97
97
  "react-table": "7.7.0",
98
98
  "react-uid": "2.3.1",
99
- "styled-components": "5.3.3",
100
- "type-fest": "2.12.0"
99
+ "type-fest": "2.12.1"
101
100
  }
102
101
  }
@@ -1,87 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { AutoPlacement, BasePlacement, VariationPlacement } from '@popperjs/core';
3
- export declare type DropdownProps = PropsWithClass & {
4
- /**
5
- * The content of the dropdown to display when the dropdown is open.
6
- */
7
- children: ReactNode;
8
- /**
9
- * The element to use as the trigger for the dropdown.
10
- */
11
- trigger: ReactNode;
12
- /**
13
- * The distance from the trigger to the dropdown.
14
- */
15
- offset?: number;
16
- /**
17
- * The placement of the dropdown. This is automatically handled based on
18
- * scroll and viewport edges. By default the dropdown is anchored at
19
- * the beginning of the trigger.
20
- *
21
- * The first key refers to the X axis, the second key refers to the Y axis.
22
- * Eg: `auto-start` means the dropdown will be placed automatically on left or right
23
- * based on the available space, and anchored at the top (start) of the trigger.
24
- */
25
- placement?: AutoPlacement | BasePlacement | VariationPlacement;
26
- /**
27
- * Enable or disable the itneraction on the trigger.
28
- */
29
- disabled?: boolean;
30
- /**
31
- * Callback 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;
44
- };
45
- export declare const Dropdown: import("react").ForwardRefExoticComponent<PropsWithClass & {
46
- /**
47
- * The content of the dropdown to display when the dropdown is open.
48
- */
49
- children: ReactNode;
50
- /**
51
- * The element to use as the trigger for the dropdown.
52
- */
53
- trigger: ReactNode;
54
- /**
55
- * The distance from the trigger to the dropdown.
56
- */
57
- offset?: number | undefined;
58
- /**
59
- * The placement of the dropdown. This is automatically handled based on
60
- * scroll and viewport edges. By default the dropdown is anchored at
61
- * the beginning of the trigger.
62
- *
63
- * The first key refers to the X axis, the second key refers to the Y axis.
64
- * Eg: `auto-start` means the dropdown will be placed automatically on left or right
65
- * based on the available space, and anchored at the top (start) of the trigger.
66
- */
67
- placement?: AutoPlacement | BasePlacement | VariationPlacement | undefined;
68
- /**
69
- * Enable or disable the itneraction on the trigger.
70
- */
71
- disabled?: boolean | undefined;
72
- /**
73
- * Callback 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;
86
- } & import("react").RefAttributes<HTMLDivElement>>;
87
- //# sourceMappingURL=dropdown.d.ts.map
@@ -1 +0,0 @@
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,69 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, Children, cloneElement, useRef, forwardRef, isValidElement, useEffect } from 'react';
3
- import { useKeyPress, useFocusWithin } from 'ahooks';
4
- import styles from './dropdown.module.css';
5
- import { useUIDSeed } from 'react-uid';
6
- import { usePopperTooltip } from 'react-popper-tooltip';
7
- import { AnimatePresence, motion } from 'framer-motion';
8
- import clsx from 'clsx';
9
- const DropdownAnimation = {
10
- visible: {
11
- y: 0,
12
- opacity: 1,
13
- transition: {
14
- ease: [0, 0, 0.34, 1],
15
- duration: 0.1
16
- }
17
- },
18
- hidden: {
19
- y: -5,
20
- opacity: 0,
21
- transition: {
22
- ease: [0.3, 0.07, 1, 1],
23
- duration: 0.1
24
- }
25
- }
26
- };
27
- export const Dropdown = forwardRef(({ children, trigger, offset = 8, placement = 'auto-start', open, disabled, closeOnOutsideClick = true, className, onOpenChange, ...otherProps }, forwardedRef) => {
28
- const seedID = useUIDSeed();
29
- const dropdownRef = useRef(forwardedRef);
30
- const [isOpen, setIsOpen] = useState(false);
31
- const { getTooltipProps, setTooltipRef, setTriggerRef, visible } = usePopperTooltip({
32
- delayShow: 0,
33
- delayHide: 0,
34
- trigger: !disabled ? ['click'] : null,
35
- visible: isOpen,
36
- closeOnTriggerHidden: true,
37
- closeOnOutsideClick,
38
- onVisibleChange: state => {
39
- onOpenChange?.(state);
40
- setIsOpen(state);
41
- },
42
- placement: placement,
43
- offset: [0, offset]
44
- });
45
- const isFocusWithin = useFocusWithin(dropdownRef, {
46
- onBlur: (e) => {
47
- if (e.relatedTarget && visible) {
48
- setIsOpen(false);
49
- }
50
- }
51
- });
52
- useKeyPress('esc', () => setIsOpen(false));
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, {
57
- ref: setTriggerRef,
58
- id: seedID('dropdown-trigger'),
59
- key: seedID('dropdown-trigger'),
60
- 'aria-haspopup': 'true',
61
- 'aria-controls': seedID('dropdown-menu'),
62
- 'aria-expanded': isOpen,
63
- ...otherProps
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, {
65
- id: seedID('dropdown-menu'),
66
- 'aria-labelledby': seedID('dropdown-trigger')
67
- })) }, void 0) }, seedID('tooltip-content'))) }, void 0)] }, void 0));
68
- });
69
- Dropdown.displayName = 'Dropdown';
@@ -1 +0,0 @@
1
- .Dropdown{display:contents}.PopUp{inline-size:max-content;z-index:2}
@@ -1,3 +0,0 @@
1
- export { Dropdown } from './dropdown';
2
- export type { DropdownProps } from './dropdown';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
@@ -1 +0,0 @@
1
- export { Dropdown } from './dropdown';