@astryxdesign/core 0.1.7 → 0.1.8-canary.c5fa19b

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 (190) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +30 -19
  3. package/dist/Avatar/Avatar.d.ts +10 -5
  4. package/dist/Avatar/Avatar.d.ts.map +1 -1
  5. package/dist/Avatar/Avatar.js +12 -8
  6. package/dist/Avatar/AvatarSizeContext.d.ts +1 -1
  7. package/dist/Avatar/AvatarSizeContext.js +1 -1
  8. package/dist/Avatar/AvatarStatusDot.d.ts +2 -2
  9. package/dist/Avatar/AvatarStatusDot.js +2 -2
  10. package/dist/AvatarGroup/AvatarGroup.d.ts +2 -2
  11. package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
  12. package/dist/AvatarGroup/AvatarGroup.js +2 -2
  13. package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
  14. package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
  15. package/dist/AvatarGroup/AvatarGroupOverflow.js +16 -14
  16. package/dist/Carousel/Carousel.d.ts +3 -2
  17. package/dist/Carousel/Carousel.d.ts.map +1 -1
  18. package/dist/Carousel/Carousel.js +32 -2
  19. package/dist/Chat/ChatMessage.d.ts +1 -1
  20. package/dist/Chat/ChatMessage.d.ts.map +1 -1
  21. package/dist/Chat/ChatMessage.js +1 -1
  22. package/dist/Citation/Citation.d.ts.map +1 -1
  23. package/dist/Citation/Citation.js +10 -4
  24. package/dist/Collapsible/Collapsible.d.ts +11 -1
  25. package/dist/Collapsible/Collapsible.d.ts.map +1 -1
  26. package/dist/Collapsible/Collapsible.js +36 -4
  27. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  28. package/dist/ContextMenu/ContextMenu.js +4 -3
  29. package/dist/ContextMenu/index.d.ts +3 -0
  30. package/dist/ContextMenu/index.d.ts.map +1 -1
  31. package/dist/ContextMenu/index.js +7 -1
  32. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  33. package/dist/DropdownMenu/DropdownMenu.js +8 -4
  34. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +89 -0
  35. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -0
  36. package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +170 -0
  37. package/dist/DropdownMenu/DropdownMenuContext.d.ts +17 -1
  38. package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
  39. package/dist/DropdownMenu/DropdownMenuContext.js +18 -0
  40. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +69 -0
  41. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -0
  42. package/dist/DropdownMenu/DropdownMenuRadioGroup.js +70 -0
  43. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +69 -0
  44. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -0
  45. package/dist/DropdownMenu/DropdownMenuRadioItem.js +178 -0
  46. package/dist/DropdownMenu/index.d.ts +5 -1
  47. package/dist/DropdownMenu/index.d.ts.map +1 -1
  48. package/dist/DropdownMenu/index.js +10 -1
  49. package/dist/DropdownMenu/menuItemRoles.d.ts +13 -0
  50. package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -0
  51. package/dist/DropdownMenu/menuItemRoles.js +15 -0
  52. package/dist/Icon/Icon.d.ts +43 -13
  53. package/dist/Icon/Icon.d.ts.map +1 -1
  54. package/dist/Icon/Icon.js +62 -27
  55. package/dist/Outline/Outline.d.ts +69 -3
  56. package/dist/Outline/Outline.d.ts.map +1 -1
  57. package/dist/Outline/Outline.js +129 -26
  58. package/dist/Outline/useScrollSpy.d.ts +27 -7
  59. package/dist/Outline/useScrollSpy.d.ts.map +1 -1
  60. package/dist/Outline/useScrollSpy.js +202 -70
  61. package/dist/TabList/Tab.d.ts.map +1 -1
  62. package/dist/TabList/Tab.js +2 -2
  63. package/dist/TabList/TabList.d.ts.map +1 -1
  64. package/dist/TabList/TabList.js +2 -0
  65. package/dist/TabList/TabMenu.d.ts.map +1 -1
  66. package/dist/TabList/TabMenu.js +1 -1
  67. package/dist/Table/Table.d.ts +1 -1
  68. package/dist/Table/Table.js +1 -1
  69. package/dist/Table/index.d.ts +2 -0
  70. package/dist/Table/index.d.ts.map +1 -1
  71. package/dist/Table/index.js +1 -0
  72. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  73. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +24 -2
  74. package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
  75. package/dist/Table/plugins/sortable/useTableSortable.js +18 -7
  76. package/dist/Table/plugins/tree/index.d.ts +5 -0
  77. package/dist/Table/plugins/tree/index.d.ts.map +1 -0
  78. package/dist/Table/plugins/tree/index.js +4 -0
  79. package/dist/Table/plugins/tree/useTableTreeData.d.ts +38 -0
  80. package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -0
  81. package/dist/Table/plugins/tree/useTableTreeData.js +358 -0
  82. package/dist/Table/plugins/tree/useTableTreeState.d.ts +51 -0
  83. package/dist/Table/plugins/tree/useTableTreeState.d.ts.map +1 -0
  84. package/dist/Table/plugins/tree/useTableTreeState.js +175 -0
  85. package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
  86. package/dist/Table/useBaseTablePlugins.js +6 -3
  87. package/dist/Toolbar/Toolbar.d.ts.map +1 -1
  88. package/dist/Toolbar/Toolbar.js +8 -1
  89. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  90. package/dist/TreeList/TreeListItem.js +5 -14
  91. package/dist/astryx.css +24 -4
  92. package/dist/astryx.umd.js +54 -54
  93. package/dist/astryx.umd.js.map +4 -4
  94. package/dist/theme/Theme.js +1 -1
  95. package/dist/theme/defineTheme.d.ts +1 -1
  96. package/dist/theme/defineTheme.js +1 -1
  97. package/dist/theme/hct.d.ts +0 -1
  98. package/dist/theme/hct.d.ts.map +1 -1
  99. package/dist/theme/hct.js +0 -3
  100. package/docs.mjs +32 -461
  101. package/locales/en.json +200 -172
  102. package/locales/pseudo.json +21 -0
  103. package/package.json +3 -1
  104. package/scripts/postinstall.mjs +93 -0
  105. package/src/Avatar/Avatar.doc.mjs +6 -6
  106. package/src/Avatar/Avatar.tsx +16 -11
  107. package/src/Avatar/AvatarSizeContext.ts +1 -1
  108. package/src/Avatar/AvatarStatusDot.tsx +2 -2
  109. package/src/AvatarGroup/AvatarGroup.doc.mjs +1 -1
  110. package/src/AvatarGroup/AvatarGroup.test.tsx +17 -3
  111. package/src/AvatarGroup/AvatarGroup.tsx +3 -3
  112. package/src/AvatarGroup/AvatarGroupOverflow.doc.mjs +4 -4
  113. package/src/AvatarGroup/AvatarGroupOverflow.tsx +21 -5
  114. package/src/Carousel/Carousel.doc.mjs +1 -0
  115. package/src/Carousel/Carousel.test.tsx +96 -1
  116. package/src/Carousel/Carousel.tsx +29 -2
  117. package/src/Chat/Chat.doc.mjs +1 -1
  118. package/src/Chat/ChatMessage.tsx +4 -2
  119. package/src/CheckboxInput/CheckboxInput.doc.mjs +1 -1
  120. package/src/Citation/Citation.test.tsx +51 -0
  121. package/src/Citation/Citation.tsx +8 -2
  122. package/src/Collapsible/Collapsible.doc.mjs +7 -0
  123. package/src/Collapsible/Collapsible.test.tsx +80 -0
  124. package/src/Collapsible/Collapsible.tsx +58 -5
  125. package/src/ContextMenu/ContextMenu.test.tsx +75 -1
  126. package/src/ContextMenu/ContextMenu.tsx +10 -5
  127. package/src/ContextMenu/index.ts +15 -0
  128. package/src/DropdownMenu/DropdownMenu.doc.mjs +23 -0
  129. package/src/DropdownMenu/DropdownMenu.tsx +11 -6
  130. package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +95 -0
  131. package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +237 -0
  132. package/src/DropdownMenu/DropdownMenuContext.tsx +29 -1
  133. package/src/DropdownMenu/DropdownMenuItem.doc.mjs +7 -1
  134. package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +80 -0
  135. package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +119 -0
  136. package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +80 -0
  137. package/src/DropdownMenu/DropdownMenuRadioItem.tsx +232 -0
  138. package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +163 -0
  139. package/src/DropdownMenu/index.ts +23 -3
  140. package/src/DropdownMenu/menuItemRoles.ts +22 -0
  141. package/src/Field/Field.doc.mjs +1 -1
  142. package/src/Field/FieldLabel.doc.mjs +1 -1
  143. package/src/Icon/Icon.doc.mjs +12 -0
  144. package/src/Icon/Icon.test.tsx +142 -0
  145. package/src/Icon/Icon.tsx +98 -30
  146. package/src/Item/Item.doc.mjs +1 -1
  147. package/src/NumberInput/NumberInput.doc.mjs +2 -2
  148. package/src/Outline/Outline.doc.mjs +123 -3
  149. package/src/Outline/Outline.test.tsx +735 -0
  150. package/src/Outline/Outline.tsx +184 -33
  151. package/src/Outline/useScrollSpy.ts +248 -72
  152. package/src/Selector/SelectorOption.doc.mjs +1 -1
  153. package/src/SideNav/SideNavItem.doc.mjs +2 -2
  154. package/src/Switch/Switch.doc.mjs +1 -1
  155. package/src/TabList/Tab.tsx +5 -1
  156. package/src/TabList/TabList.doc.mjs +3 -3
  157. package/src/TabList/TabList.test.tsx +66 -0
  158. package/src/TabList/TabList.tsx +8 -0
  159. package/src/TabList/TabMenu.tsx +4 -1
  160. package/src/Table/Table.doc.mjs +2 -0
  161. package/src/Table/Table.tsx +1 -1
  162. package/src/Table/index.ts +7 -0
  163. package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +90 -1
  164. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +37 -5
  165. package/src/Table/plugins/sortable/useTableSortable.test.tsx +95 -9
  166. package/src/Table/plugins/sortable/useTableSortable.tsx +23 -7
  167. package/src/Table/plugins/tree/index.ts +12 -0
  168. package/src/Table/plugins/tree/useTableTreeData-perf.test.tsx +163 -0
  169. package/src/Table/plugins/tree/useTableTreeData.test.tsx +594 -0
  170. package/src/Table/plugins/tree/useTableTreeData.tsx +495 -0
  171. package/src/Table/plugins/tree/useTableTreeState.test.tsx +636 -0
  172. package/src/Table/plugins/tree/useTableTreeState.tsx +253 -0
  173. package/src/Table/useBaseTablePlugins.ts +6 -2
  174. package/src/Table/useTableTreeData.doc.mjs +75 -0
  175. package/src/Table/useTableTreeState.doc.mjs +98 -0
  176. package/src/TextArea/TextArea.doc.mjs +1 -1
  177. package/src/TextInput/TextInput.doc.mjs +1 -1
  178. package/src/Toolbar/Toolbar.tsx +10 -3
  179. package/src/TreeList/TreeList.test.tsx +32 -1
  180. package/src/TreeList/TreeListItem.tsx +19 -10
  181. package/src/docs-script.test.mjs +18 -13
  182. package/src/postinstall.test.mjs +71 -0
  183. package/src/theme/Theme.doc.mjs +4 -4
  184. package/src/theme/Theme.tsx +1 -1
  185. package/src/theme/defineTheme.ts +1 -1
  186. package/src/theme/hct.ts +0 -4
  187. package/dist/TreeList/treeListItem.markers.stylex.d.ts +0 -16
  188. package/dist/TreeList/treeListItem.markers.stylex.d.ts.map +0 -1
  189. package/dist/TreeList/treeListItem.markers.stylex.js +0 -22
  190. package/src/TreeList/treeListItem.markers.stylex.ts +0 -20
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ export { useTableTreeData } from "./useTableTreeData.js";
4
+ export { useTableTreeState } from "./useTableTreeState.js";
@@ -0,0 +1,38 @@
1
+ import type { TablePlugin } from '../../types';
2
+ /** Structural position of one visible row within the tree. */
3
+ export interface TableTreeRowMeta {
4
+ /** The row's id (from `idKey`). */
5
+ id: string;
6
+ /** 0-based depth: roots are level 0. */
7
+ level: number;
8
+ /** Whether the row shows an expander. */
9
+ hasChildren: boolean;
10
+ /** Whether the row is currently expanded. */
11
+ isExpanded: boolean;
12
+ }
13
+ /**
14
+ * Configuration for useTableTreeData. `useTableTreeState` returns a
15
+ * ready-made value (`treeConfig`); consumers with server-driven or
16
+ * pre-flattened trees can construct one directly.
17
+ */
18
+ export interface UseTableTreeDataConfig<T extends Record<string, unknown>> {
19
+ /** Structural meta for a visible row; undefined for unknown rows. */
20
+ getRowMeta: (item: T) => TableTreeRowMeta | undefined;
21
+ /** Toggle a row's expansion. */
22
+ onToggleItem: (item: T) => void;
23
+ /**
24
+ * Whether any row in the dataset is expandable. When false the plugin is
25
+ * a no-op: no expanders, no indent, no tree ARIA — flat data renders
26
+ * identically to a Table without the plugin.
27
+ */
28
+ hasExpandableRows: boolean;
29
+ /**
30
+ * Indent step per level, as spacing tokens.
31
+ * @default 'md'
32
+ */
33
+ indent?: 'sm' | 'md' | 'lg';
34
+ /** Column that carries the indent + expander. @default the first column */
35
+ treeColumnKey?: string;
36
+ }
37
+ export declare function useTableTreeData<T extends Record<string, unknown>>(config: UseTableTreeDataConfig<T>): TablePlugin<T>;
38
+ //# sourceMappingURL=useTableTreeData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableTreeData.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/tree/useTableTreeData.tsx"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAC,WAAW,EAAkC,MAAM,aAAa,CAAC;AAO9E,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,WAAW,EAAE,OAAO,CAAC;IACrB,6CAA6C;IAC7C,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACvE,qEAAqE;IACrE,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,gBAAgB,GAAG,SAAS,CAAC;IACtD,gCAAgC;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAChC;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5B,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAqQD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAChC,WAAW,CAAC,CAAC,CAAC,CAgJhB"}
@@ -0,0 +1,358 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ /**
6
+ * @file useTableTreeData.tsx
7
+ * @input React, StyleX, Icon, Table types, theme tokens, i18n (useTranslator)
8
+ * @output Exports useTableTreeData hook + config/meta types
9
+ * @position Tree plugin; consumed by Table via plugins prop.
10
+ * Pairs with useTableTreeState (owns expansion state + flattening).
11
+ *
12
+ * ## Architecture (mirrors useTableSelection)
13
+ *
14
+ * The tree affordance decorates the tree column's cells in place — no
15
+ * synthetic column. `transformColumns` wraps the tree column's renderCell
16
+ * with a flex wrapper carrying per-level indentation and an expander
17
+ * button (or a fixed-width spacer on leaves). Other columns get zero
18
+ * extra DOM.
19
+ *
20
+ * Expansion state flows through an external store (TreeStore) so each
21
+ * row's expander subscribes independently — a toggle re-renders only the
22
+ * affected cells, not the whole body. Row ARIA (aria-level,
23
+ * aria-expanded) is applied imperatively via a ref callback on each
24
+ * <tr>, exactly like selection's row styling; each subscription
25
+ * self-cleans when the row disconnects.
26
+ *
27
+ * When `hasExpandableRows` is false (flat data), every transform is a
28
+ * pass-through: adopting the plugin ahead of hierarchical data is a
29
+ * no-op.
30
+ */
31
+ import { createContext, use, useCallback, useEffect, useMemo, useRef, useSyncExternalStore } from 'react';
32
+ import * as stylex from '@stylexjs/stylex';
33
+ import "../../../theme/tokens.stylex.js";
34
+ import { colorVars, radiusVars, spacingVars } from "../../../theme/tokens.stylex.js";
35
+ import { Icon } from "../../../Icon/index.js";
36
+ import { mergeRefs } from "../../../utils/index.js";
37
+ import { useTranslator } from "../../../i18n/index.js";
38
+
39
+ // =============================================================================
40
+ // Types
41
+ // =============================================================================
42
+
43
+ /** Structural position of one visible row within the tree. */
44
+
45
+ /**
46
+ * Configuration for useTableTreeData. `useTableTreeState` returns a
47
+ * ready-made value (`treeConfig`); consumers with server-driven or
48
+ * pre-flattened trees can construct one directly.
49
+ */
50
+
51
+ // =============================================================================
52
+ // Tree Store (external store for fine-grained row subscriptions)
53
+ // =============================================================================
54
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
55
+ function createTreeStore(configRef) {
56
+ const listeners = new Set();
57
+ return {
58
+ subscribe(listener) {
59
+ listeners.add(listener);
60
+ return () => listeners.delete(listener);
61
+ },
62
+ notify() {
63
+ for (const listener of listeners) {
64
+ listener();
65
+ }
66
+ },
67
+ getConfig() {
68
+ return configRef.current;
69
+ }
70
+ };
71
+ }
72
+
73
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
74
+ const TreeStoreContext = /*#__PURE__*/createContext(null);
75
+ TreeStoreContext.displayName = 'TreeStoreContext';
76
+
77
+ /** Indent token -> index, for the numeric row snapshot. */
78
+ const INDENT_INDEX = {
79
+ sm: 0,
80
+ md: 1,
81
+ lg: 2
82
+ };
83
+
84
+ /**
85
+ * Encode a row's tree meta as a primitive for useSyncExternalStore —
86
+ * object snapshots would tear. The indent token participates so a
87
+ * runtime `indent` change re-renders the affected cells.
88
+ * Encoding: level * 16 + indentIndex * 4 + hasChildren * 2 + isExpanded;
89
+ * -1 = no meta.
90
+ */
91
+ function encodeRowMeta(config, item) {
92
+ const meta = config.getRowMeta(item);
93
+ if (!meta) {
94
+ return -1;
95
+ }
96
+ return meta.level * 16 + INDENT_INDEX[config.indent ?? 'md'] * 4 + (meta.hasChildren ? 2 : 0) + (meta.isExpanded ? 1 : 0);
97
+ }
98
+ function useRowMetaSnapshot(store, item) {
99
+ const getSnapshot = useCallback(() => encodeRowMeta(store.getConfig(), item), [store, item]);
100
+ return useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
101
+ }
102
+
103
+ // =============================================================================
104
+ // Row ARIA (imperative, mirrors selection's row styling)
105
+ // =============================================================================
106
+
107
+ function applyRowTreeAria(el, meta) {
108
+ if (!meta) {
109
+ el.removeAttribute('aria-level');
110
+ el.removeAttribute('aria-expanded');
111
+ return;
112
+ }
113
+ el.setAttribute('aria-level', String(meta.level + 1));
114
+ if (meta.hasChildren) {
115
+ el.setAttribute('aria-expanded', String(meta.isExpanded));
116
+ } else {
117
+ el.removeAttribute('aria-expanded');
118
+ }
119
+ }
120
+
121
+ // =============================================================================
122
+ // Styles
123
+ // =============================================================================
124
+
125
+ /** Indent step per level, by the `indent` config token. */
126
+ const INDENT_STEP = {
127
+ sm: spacingVars['--spacing-3'],
128
+ md: spacingVars['--spacing-4'],
129
+ lg: spacingVars['--spacing-6']
130
+ };
131
+ const treeStyles = {
132
+ cell: {
133
+ k1xSpc: "x78zum5",
134
+ kGNEyG: "x6s0dn4",
135
+ kOIVth: "xzye2dw",
136
+ $$css: true
137
+ },
138
+ indent: paddingInlineStart => [{
139
+ kZCmMZ: paddingInlineStart != null ? "xnvo3vl" : paddingInlineStart,
140
+ $$css: true
141
+ }, {
142
+ "--x-paddingInlineStart": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(paddingInlineStart)
143
+ }]
144
+ };
145
+
146
+ // =============================================================================
147
+ // Cell content
148
+ // =============================================================================
149
+
150
+ function TreeExpander({
151
+ isExpanded,
152
+ onToggle
153
+ }) {
154
+ const t = useTranslator();
155
+ return /*#__PURE__*/_jsx("button", {
156
+ type: "button",
157
+ ...{
158
+ className: "x3nfvp2 x6s0dn4 xl56j7k xvy4d1p xxk0z11 xx3sua9 x1ypdohk xv9yike x1gbuem2 xx6bhzk x1717udv x2lah0s x1ilzqfv x1cqbx0l"
159
+ },
160
+ onClick: e => {
161
+ e.stopPropagation();
162
+ onToggle();
163
+ },
164
+ "aria-label": isExpanded ? t('@astryx.tableTree.collapseRow') : t('@astryx.tableTree.expandRow'),
165
+ "aria-expanded": isExpanded,
166
+ children: /*#__PURE__*/_jsx("span", {
167
+ ...{
168
+ 0: {
169
+ className: "x3nfvp2 x11xpdln xx6bhzk x7p49u4"
170
+ },
171
+ 1: {
172
+ className: "x3nfvp2 x11xpdln xx6bhzk x1iffjtl"
173
+ }
174
+ }[!!isExpanded << 0],
175
+ children: /*#__PURE__*/_jsx(Icon, {
176
+ icon: "chevronRight",
177
+ size: "xsm"
178
+ })
179
+ })
180
+ });
181
+ }
182
+ function TreeCellContent({
183
+ item,
184
+ children
185
+ }) {
186
+ const store = use(TreeStoreContext);
187
+ if (!store) {
188
+ return /*#__PURE__*/_jsx(_Fragment, {
189
+ children: children
190
+ });
191
+ }
192
+ return /*#__PURE__*/_jsx(TreeCellContentInner, {
193
+ store: store,
194
+ item: item,
195
+ children: children
196
+ });
197
+ }
198
+ function TreeCellContentInner({
199
+ store,
200
+ item,
201
+ children
202
+ }) {
203
+ // Subscribe to this row's structural meta so a toggle re-renders only
204
+ // the affected cells.
205
+ useRowMetaSnapshot(store, item);
206
+ const config = store.getConfig();
207
+ const meta = config.getRowMeta(item);
208
+ if (!meta) {
209
+ return /*#__PURE__*/_jsx(_Fragment, {
210
+ children: children
211
+ });
212
+ }
213
+ const step = INDENT_STEP[config.indent ?? 'md'];
214
+ const indent = `calc(${meta.level} * ${step})`;
215
+ return /*#__PURE__*/_jsxs("div", {
216
+ ...stylex.props(treeStyles.cell, meta.level > 0 && treeStyles.indent(indent)),
217
+ children: [meta.hasChildren ? /*#__PURE__*/_jsx(TreeExpander, {
218
+ isExpanded: meta.isExpanded,
219
+ onToggle: () => store.getConfig().onToggleItem(item)
220
+ }) : /*#__PURE__*/_jsx("span", {
221
+ ...{
222
+ className: "x1rg5ohu xvy4d1p xxk0z11 x2lah0s"
223
+ }
224
+ }), children]
225
+ });
226
+ }
227
+
228
+ // =============================================================================
229
+ // Hook
230
+ // =============================================================================
231
+
232
+ export function useTableTreeData(config) {
233
+ const configRef = useRef(config);
234
+ configRef.current = config;
235
+ const storeRef = useRef(null);
236
+ if (storeRef.current == null) {
237
+ storeRef.current = createTreeStore(configRef);
238
+ }
239
+ const store = storeRef.current;
240
+
241
+ // Notify subscribers on every render — useSyncExternalStore only
242
+ // re-renders cells whose snapshot actually changed. Row ref subscribers
243
+ // apply imperative ARIA independently.
244
+ useEffect(() => {
245
+ store.notify();
246
+ });
247
+
248
+ // transformColumns runs on every table render; wrapped column objects
249
+ // must keep their identity across renders or the per-row memo breaks
250
+ // and a toggle re-renders the whole body. Earlier plugins may rebuild
251
+ // structurally-identical arrays each render, so the cache compares
252
+ // input columns by shallow equality, not array identity. Held in a ref
253
+ // (like rowExpansion's column tracking) — transforms run during
254
+ // BaseTable's render, where a closure variable reassignment trips the
255
+ // react-compiler lint.
256
+ const columnsCacheRef = useRef(null);
257
+
258
+ // The plugin object is created once per store and never changes shape:
259
+ // every transform reads the live config through the store, and
260
+ // internally no-ops when hasExpandableRows is false. Swapping between
261
+ // an empty and a context-wrapping plugin would change the element tree
262
+ // and remount the whole table when flat data turns nested.
263
+ return useMemo(() => {
264
+ const getCachedColumns = (columns, treeKey, wrapped) => {
265
+ const cache = columnsCacheRef.current;
266
+ if (!cache || cache.treeKey !== treeKey || cache.wrapped !== wrapped) {
267
+ return null;
268
+ }
269
+ const prev = cache.input;
270
+ if (prev !== columns) {
271
+ if (prev.length !== columns.length) {
272
+ return null;
273
+ }
274
+ for (let i = 0; i < prev.length; i++) {
275
+ if (prev[i] !== columns[i]) {
276
+ return null;
277
+ }
278
+ }
279
+ }
280
+ return cache.output;
281
+ };
282
+ return {
283
+ transformTableContext(children) {
284
+ return /*#__PURE__*/_jsx(TreeStoreContext, {
285
+ value: store,
286
+ children: children
287
+ });
288
+ },
289
+ transformColumns(columns) {
290
+ const {
291
+ hasExpandableRows,
292
+ treeColumnKey
293
+ } = store.getConfig();
294
+
295
+ // Resolve the tree column: the configured key when present, else
296
+ // the first non-synthetic column (a configured column may have
297
+ // been hidden by columnSettings — the expander must not vanish).
298
+ const configuredExists = treeColumnKey != null && columns.some(c => c.key === treeColumnKey);
299
+ const treeKey = configuredExists ? treeColumnKey : columns.find(c => !c.key.startsWith('__'))?.key ?? columns[0]?.key;
300
+
301
+ // Migration guarantee: flat data renders identically to a Table
302
+ // without the plugin.
303
+ const wrapped = hasExpandableRows;
304
+ const cached = getCachedColumns(columns, treeKey, wrapped);
305
+ if (cached) {
306
+ return cached;
307
+ }
308
+ const output = !wrapped ? columns : columns.map(col => {
309
+ if (col.key !== treeKey) {
310
+ return col;
311
+ }
312
+ const originalRenderCell = col.renderCell;
313
+ return {
314
+ ...col,
315
+ renderCell: item => /*#__PURE__*/_jsx(TreeCellContent, {
316
+ item: item,
317
+ children: originalRenderCell ? originalRenderCell(item) : String(item[col.key] ?? '')
318
+ })
319
+ };
320
+ });
321
+ columnsCacheRef.current = {
322
+ input: columns,
323
+ treeKey,
324
+ wrapped,
325
+ output
326
+ };
327
+ return output;
328
+ },
329
+ transformBodyRow(props, item) {
330
+ // Attach a ref that subscribes to the store for imperative row
331
+ // ARIA. The ref returns a cleanup so React unsubscribes on
332
+ // detach — without it, every row re-render would leak one
333
+ // subscription (toggles shift rowIndex and re-render rows, so
334
+ // the listener set would grow on every toggle). The ref is
335
+ // attached even when no row is expandable so tree ARIA is
336
+ // removed if the data turns flat.
337
+ const treeRef = el => {
338
+ if (!el) {
339
+ return;
340
+ }
341
+ const apply = () => {
342
+ const cfg = store.getConfig();
343
+ applyRowTreeAria(el, cfg.hasExpandableRows ? cfg.getRowMeta(item) : undefined);
344
+ };
345
+ apply();
346
+ const unsub = store.subscribe(apply);
347
+ return () => {
348
+ unsub();
349
+ };
350
+ };
351
+ return {
352
+ ...props,
353
+ ref: props.ref ? mergeRefs(props.ref, treeRef) : treeRef
354
+ };
355
+ }
356
+ };
357
+ }, [store]);
358
+ }
@@ -0,0 +1,51 @@
1
+ import type { UseTableTreeDataConfig } from './useTableTreeData';
2
+ export interface UseTableTreeStateConfig<T extends Record<string, unknown>> {
3
+ /** Nested data: rows may carry child rows under `childrenKey`. */
4
+ data: T[];
5
+ /** Row ID accessor: property name, or a function returning a unique id. */
6
+ idKey: (keyof T & string) | ((item: T) => string | number);
7
+ /**
8
+ * Property holding each row's children array.
9
+ * @default 'children'
10
+ */
11
+ childrenKey?: string;
12
+ /** Initial expanded row ids for uncontrolled mode. Ignored when `expandedIds` is provided. */
13
+ defaultExpandedIds?: Iterable<string>;
14
+ /**
15
+ * Controlled set of expanded row ids. When provided, the hook uses this
16
+ * instead of internal state. Pair with `onExpandedIdsChange`.
17
+ */
18
+ expandedIds?: ReadonlySet<string>;
19
+ /** Called with the next expanded set whenever expansion changes. */
20
+ onExpandedIdsChange?: (ids: ReadonlySet<string>) => void;
21
+ /**
22
+ * Should this row show an expander? Overrides the default
23
+ * "has a non-empty children array" check — use for lazy loading, where a
24
+ * row is expandable before its children have been fetched.
25
+ */
26
+ isItemExpandable?: (item: T) => boolean;
27
+ /**
28
+ * Sort each sibling group independently during flattening. Children always
29
+ * stay directly under their parent — sorting never crosses levels. Pass
30
+ * `applySort` from `useTableSortableState` to compose with column sorting.
31
+ */
32
+ sortSiblings?: (siblings: T[]) => T[];
33
+ /** Indent step per level, forwarded to useTableTreeData. */
34
+ indent?: 'sm' | 'md' | 'lg';
35
+ /** Column that carries the tree affordance, forwarded to useTableTreeData. */
36
+ treeColumnKey?: string;
37
+ }
38
+ export interface UseTableTreeStateResult<T extends Record<string, unknown>> {
39
+ /** The flattened, currently-visible rows. Pass to `<Table data>`. */
40
+ visibleData: T[];
41
+ /** Ready-to-use config for useTableTreeData. */
42
+ treeConfig: UseTableTreeDataConfig<T>;
43
+ /** The current expanded row ids. */
44
+ expandedIds: ReadonlySet<string>;
45
+ /** Expand every expandable row in the tree. */
46
+ expandAll: () => void;
47
+ /** Collapse every row. */
48
+ collapseAll: () => void;
49
+ }
50
+ export declare function useTableTreeState<T extends Record<string, unknown>>(config: UseTableTreeStateConfig<T>): UseTableTreeStateResult<T>;
51
+ //# sourceMappingURL=useTableTreeState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableTreeState.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/tree/useTableTreeState.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAM5B,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxE,kEAAkE;IAClE,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,2EAA2E;IAC3E,KAAK,EAAE,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC,CAAC;IAC3D;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8FAA8F;IAC9F,kBAAkB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtC;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,oEAAoE;IACpE,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACzD;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IACxC;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;IACtC,4DAA4D;IAC5D,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5B,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxE,qEAAqE;IACrE,WAAW,EAAE,CAAC,EAAE,CAAC;IACjB,gDAAgD;IAChD,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;IACtC,oCAAoC;IACpC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,+CAA+C;IAC/C,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,0BAA0B;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAMD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC,GACjC,uBAAuB,CAAC,CAAC,CAAC,CAoK5B"}
@@ -0,0 +1,175 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ /**
6
+ * @file useTableTreeState.tsx
7
+ * @input React
8
+ * @output Exports useTableTreeState hook and config/result types
9
+ * @position Tree state helper; owns the expanded set + flattens nested data.
10
+ * Pairs with useTableTreeData (the headless tree plugin).
11
+ *
12
+ * Modeled after useTableSortableState — a convenience layer that owns state
13
+ * (controlled or uncontrolled) and produces both the visible flattened rows
14
+ * and a ready-to-use config for the headless plugin. Data shaping stays
15
+ * outside the render pipeline: Table always receives exactly the rows it
16
+ * renders, so collapsed subtrees are unmounted, not hidden.
17
+ */
18
+ import { useCallback, useMemo, useRef, useState } from 'react';
19
+
20
+ // =============================================================================
21
+ // Config
22
+ // =============================================================================
23
+
24
+ // =============================================================================
25
+ // Result
26
+ // =============================================================================
27
+
28
+ // =============================================================================
29
+ // Hook
30
+ // =============================================================================
31
+
32
+ export function useTableTreeState(config) {
33
+ const {
34
+ data,
35
+ idKey,
36
+ childrenKey = 'children',
37
+ defaultExpandedIds,
38
+ expandedIds: controlledExpandedIds,
39
+ onExpandedIdsChange,
40
+ isItemExpandable,
41
+ sortSiblings,
42
+ indent,
43
+ treeColumnKey
44
+ } = config;
45
+ const getId = useCallback(item => typeof idKey === 'function' ? String(idKey(item)) : String(item[idKey]), [idKey]);
46
+ const getChildren = useCallback(item => {
47
+ const children = item[childrenKey];
48
+ return Array.isArray(children) ? children : [];
49
+ }, [childrenKey]);
50
+ const getIsExpandable = useCallback(item => isItemExpandable ? isItemExpandable(item) : getChildren(item).length > 0, [isItemExpandable, getChildren]);
51
+
52
+ // Internal state (used in uncontrolled mode)
53
+ const [internalExpandedIds, setInternalExpandedIds] = useState(() => new Set(defaultExpandedIds));
54
+
55
+ // Resolve controlled vs uncontrolled
56
+ const isControlled = controlledExpandedIds !== undefined;
57
+ const expandedIds = isControlled ? controlledExpandedIds : internalExpandedIds;
58
+
59
+ // Stable refs so callbacks don't churn on inline-prop identity changes
60
+ const expandedIdsRef = useRef(expandedIds);
61
+ expandedIdsRef.current = expandedIds;
62
+ const onExpandedIdsChangeRef = useRef(onExpandedIdsChange);
63
+ onExpandedIdsChangeRef.current = onExpandedIdsChange;
64
+ const commitExpandedIds = useCallback(next => {
65
+ // Advance the ref immediately so a second commit in the same React
66
+ // batch (e.g. two onToggleItem calls in one event handler) builds
67
+ // on this one instead of the pre-batch set. The ref re-syncs from
68
+ // the resolved state on the next render either way.
69
+ expandedIdsRef.current = next;
70
+ if (!isControlled) {
71
+ setInternalExpandedIds(next);
72
+ }
73
+ onExpandedIdsChangeRef.current?.(next);
74
+ }, [isControlled]);
75
+
76
+ // Flatten: depth-first walk emitting only visible rows, collecting per-row
77
+ // meta ({level, hasChildren, isExpanded}) in the same pass. Children mount
78
+ // only when their parent is expanded, so collapsed subtrees stay unmounted.
79
+ // `path` holds the ids on the current ancestor chain: an edge pointing back
80
+ // at an ancestor is skipped instead of recursing forever. Sibling arrays
81
+ // are copied before sortSiblings so an in-place sorter can't reorder the
82
+ // consumer's data.
83
+ const {
84
+ visibleData,
85
+ metaMap
86
+ } = useMemo(() => {
87
+ const rows = [];
88
+ const meta = new Map();
89
+ const path = new Set();
90
+ const walk = (items, level) => {
91
+ const siblings = sortSiblings ? sortSiblings([...items]) : items;
92
+ for (const item of siblings) {
93
+ const id = getId(item);
94
+ if (path.has(id)) {
95
+ continue; // cyclic edge — this row is its own ancestor
96
+ }
97
+ const hasChildren = getIsExpandable(item);
98
+ const isExpanded = hasChildren && expandedIds.has(id);
99
+ rows.push(item);
100
+ meta.set(id, {
101
+ id,
102
+ level,
103
+ hasChildren,
104
+ isExpanded
105
+ });
106
+ if (isExpanded) {
107
+ path.add(id);
108
+ walk(getChildren(item), level + 1);
109
+ path.delete(id);
110
+ }
111
+ }
112
+ };
113
+ walk(data, 0);
114
+ return {
115
+ visibleData: rows,
116
+ metaMap: meta
117
+ };
118
+ }, [data, expandedIds, getId, getChildren, getIsExpandable, sortSiblings]);
119
+
120
+ // Every expandable row id across the whole tree, including collapsed
121
+ // subtrees (drives expandAll and the migration no-op flag). Same
122
+ // ancestor-chain guard as the flatten walk.
123
+ const allExpandableIds = useMemo(() => {
124
+ const idsAcc = [];
125
+ const path = new Set();
126
+ const walk = items => {
127
+ for (const item of items) {
128
+ const id = getId(item);
129
+ if (path.has(id)) {
130
+ continue;
131
+ }
132
+ if (getIsExpandable(item)) {
133
+ idsAcc.push(id);
134
+ }
135
+ path.add(id);
136
+ walk(getChildren(item));
137
+ path.delete(id);
138
+ }
139
+ };
140
+ walk(data);
141
+ return idsAcc;
142
+ }, [data, getId, getChildren, getIsExpandable]);
143
+ const hasExpandableRows = allExpandableIds.length > 0;
144
+ const onToggleItem = useCallback(item => {
145
+ const id = getId(item);
146
+ const next = new Set(expandedIdsRef.current);
147
+ if (next.has(id)) {
148
+ next.delete(id);
149
+ } else {
150
+ next.add(id);
151
+ }
152
+ commitExpandedIds(next);
153
+ }, [getId, commitExpandedIds]);
154
+ const expandAll = useCallback(() => {
155
+ commitExpandedIds(new Set(allExpandableIds));
156
+ }, [commitExpandedIds, allExpandableIds]);
157
+ const collapseAll = useCallback(() => {
158
+ commitExpandedIds(new Set());
159
+ }, [commitExpandedIds]);
160
+ const getRowMeta = useCallback(item => metaMap.get(getId(item)), [metaMap, getId]);
161
+ const treeConfig = useMemo(() => ({
162
+ getRowMeta,
163
+ onToggleItem,
164
+ hasExpandableRows,
165
+ indent,
166
+ treeColumnKey
167
+ }), [getRowMeta, onToggleItem, hasExpandableRows, indent, treeColumnKey]);
168
+ return {
169
+ visibleData,
170
+ treeConfig,
171
+ expandedIds,
172
+ expandAll,
173
+ collapseAll
174
+ };
175
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseTablePlugins.d.ts","sourceRoot":"","sources":["../../src/Table/useBaseTablePlugins.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AA6GzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,EAC7B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GACtD,WAAW,CAAC,CAAC,CAAC,EAAE,CA2ClB"}
1
+ {"version":3,"file":"useBaseTablePlugins.d.ts","sourceRoot":"","sources":["../../src/Table/useBaseTablePlugins.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AA8GzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,EAC7B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GACtD,WAAW,CAAC,CAAC,CAAC,EAAE,CA2ClB"}
@@ -18,12 +18,15 @@
18
18
  * Canonical order:
19
19
  * 1. columnSettings — column filtering (future: transformColumns)
20
20
  * 2. sort — header cell sort controls
21
- * 3. selection — checkbox column + row selection
22
- * 4. pagination — pagination controls around the table
21
+ * 3. tree — indent + expander on the tree column
22
+ * 4. selection — checkbox column + row selection
23
+ * 5. pagination — pagination controls around the table
23
24
  *
24
25
  * Rationale:
25
26
  * - columnSettings filters columns before sort/selection see them
26
27
  * - sort adds header cell UI before selection adds its header column
28
+ * - tree wraps the first *user* column before selection prepends its
29
+ * checkbox column, so the expander never lands in the checkbox column
27
30
  * - selection adds its column after sort so the checkbox header
28
31
  * doesn't get a sort button
29
32
  * - pagination wraps the table in context last (outermost provider)
@@ -40,7 +43,7 @@ import { useRef } from 'react';
40
43
  * Plugins are sorted by their position in this array.
41
44
  * Unknown names are appended after the known set.
42
45
  */
43
- const PLUGIN_ORDER = ['columnSettings', 'sort', 'selection', 'pagination'];
46
+ const PLUGIN_ORDER = ['columnSettings', 'sort', 'tree', 'selection', 'pagination'];
44
47
 
45
48
  /** Lookup map for O(1) ordering checks. */
46
49
  const PLUGIN_ORDER_MAP = new Map(PLUGIN_ORDER.map((name, index) => [name, index]));
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../src/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAqH5D,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AAEtC,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC7D,gDAAgD;IAChD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;CACnD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,EACtB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,KAAK,EACL,IAAW,EACX,GAAO,EACP,WAA0B,EAC1B,OAAuB,EACvB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,KAAK,EACX,YAAY,EAAE,UAAU,EACxB,kBAAkB,EAAE,gBAAgB,EACpC,GAAG,KAAK,EACT,EAAE,YAAY,+BA+Id;yBApKe,OAAO"}
1
+ {"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../src/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAqH5D,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AAEtC,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC7D,gDAAgD;IAChD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;CACnD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,EACtB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,KAAK,EACL,IAAW,EACX,GAAO,EACP,WAA0B,EAC1B,OAAuB,EACvB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,KAAK,EACX,YAAY,EAAE,UAAU,EACxB,kBAAkB,EAAE,gBAAgB,EACpC,GAAG,KAAK,EACT,EAAE,YAAY,+BAsJd;yBA3Ke,OAAO"}