@itwin/itwinui-react 5.0.0-alpha.8 → 5.0.0-alpha.9

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 (83) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/LICENSE.md +1 -1
  3. package/dist/DEV/bricks/Anchor.js +4 -9
  4. package/dist/DEV/bricks/Avatar.js +2 -2
  5. package/dist/DEV/bricks/Badge.js +2 -2
  6. package/dist/DEV/bricks/Button.js +10 -3
  7. package/dist/DEV/bricks/Checkbox.js +4 -2
  8. package/dist/DEV/bricks/Chip.js +2 -2
  9. package/dist/DEV/bricks/Divider.js +3 -2
  10. package/dist/DEV/bricks/DropdownMenu.js +79 -19
  11. package/dist/DEV/bricks/Field.js +21 -17
  12. package/dist/DEV/bricks/Icon.js +5 -5
  13. package/dist/DEV/bricks/IconButton.js +14 -6
  14. package/dist/DEV/bricks/Kbd.internal.js +19 -0
  15. package/dist/DEV/bricks/Kbd.js +3 -18
  16. package/dist/DEV/bricks/Label.js +2 -2
  17. package/dist/DEV/bricks/Radio.js +4 -2
  18. package/dist/DEV/bricks/Root.js +35 -4
  19. package/dist/DEV/bricks/Select.js +3 -3
  20. package/dist/DEV/bricks/Spinner.js +2 -2
  21. package/dist/DEV/bricks/Switch.js +4 -2
  22. package/dist/DEV/bricks/Table.js +7 -7
  23. package/dist/DEV/bricks/Tabs.js +5 -5
  24. package/dist/DEV/bricks/Text.js +2 -2
  25. package/dist/DEV/bricks/TextBox.js +8 -7
  26. package/dist/DEV/bricks/Tooltip.js +5 -5
  27. package/dist/DEV/bricks/Tree.js +8 -195
  28. package/dist/DEV/bricks/TreeItem.js +219 -0
  29. package/dist/DEV/bricks/VisuallyHidden.js +2 -2
  30. package/dist/DEV/bricks/styles.css.js +1 -1
  31. package/dist/DEV/bricks/~hooks.js +11 -6
  32. package/dist/DEV/bricks/~utils.GhostAligner.js +13 -0
  33. package/dist/DEV/bricks/{ListItem.js → ~utils.ListItem.js} +3 -3
  34. package/dist/bricks/Anchor.js +4 -9
  35. package/dist/bricks/Avatar.js +2 -2
  36. package/dist/bricks/Badge.js +2 -2
  37. package/dist/bricks/Button.js +10 -3
  38. package/dist/bricks/Checkbox.d.ts +2 -2
  39. package/dist/bricks/Checkbox.js +4 -2
  40. package/dist/bricks/Chip.js +2 -2
  41. package/dist/bricks/Divider.d.ts +2 -2
  42. package/dist/bricks/Divider.js +3 -2
  43. package/dist/bricks/DropdownMenu.d.ts +38 -23
  44. package/dist/bricks/DropdownMenu.js +77 -19
  45. package/dist/bricks/Field.d.ts +5 -5
  46. package/dist/bricks/Field.js +21 -17
  47. package/dist/bricks/Icon.js +5 -5
  48. package/dist/bricks/IconButton.d.ts +18 -2
  49. package/dist/bricks/IconButton.js +14 -6
  50. package/dist/bricks/Kbd.d.ts +2 -17
  51. package/dist/bricks/Kbd.internal.d.ts +17 -0
  52. package/dist/bricks/Kbd.internal.js +19 -0
  53. package/dist/bricks/Kbd.js +3 -18
  54. package/dist/bricks/Label.js +2 -2
  55. package/dist/bricks/Radio.d.ts +2 -2
  56. package/dist/bricks/Radio.js +4 -2
  57. package/dist/bricks/Root.js +35 -4
  58. package/dist/bricks/Select.d.ts +1 -2
  59. package/dist/bricks/Select.js +3 -3
  60. package/dist/bricks/Spinner.js +2 -2
  61. package/dist/bricks/Switch.d.ts +2 -2
  62. package/dist/bricks/Switch.js +4 -2
  63. package/dist/bricks/Table.js +7 -7
  64. package/dist/bricks/Tabs.d.ts +4 -4
  65. package/dist/bricks/Tabs.js +5 -5
  66. package/dist/bricks/Text.js +2 -2
  67. package/dist/bricks/TextBox.js +8 -7
  68. package/dist/bricks/Tooltip.d.ts +2 -2
  69. package/dist/bricks/Tooltip.js +5 -5
  70. package/dist/bricks/Tree.d.ts +3 -110
  71. package/dist/bricks/Tree.js +8 -190
  72. package/dist/bricks/TreeItem.d.ts +123 -0
  73. package/dist/bricks/TreeItem.js +214 -0
  74. package/dist/bricks/VisuallyHidden.js +2 -2
  75. package/dist/bricks/styles.css.js +1 -1
  76. package/dist/bricks/~hooks.d.ts +11 -2
  77. package/dist/bricks/~hooks.js +11 -6
  78. package/dist/bricks/~utils.GhostAligner.d.ts +22 -0
  79. package/dist/bricks/~utils.GhostAligner.js +13 -0
  80. package/dist/bricks/{ListItem.d.ts → ~utils.ListItem.d.ts} +5 -5
  81. package/dist/bricks/{ListItem.js → ~utils.ListItem.js} +3 -3
  82. package/dist/bricks/~utils.d.ts +6 -3
  83. package/package.json +1 -1
@@ -1,207 +1,25 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
1
+ import { jsx } from "react/jsx-runtime";
3
2
  import cx from "classnames";
4
- import * as Ariakit from "@ariakit/react";
5
- import * as ListItem from "./ListItem.js";
6
- import { IconButton } from "./IconButton.js";
7
- import { Icon } from "./Icon.js";
3
+ import { Role } from "@ariakit/react/role";
4
+ import { useCompositeStore, Composite } from "@ariakit/react/composite";
8
5
  import { forwardRef } from "./~utils.js";
9
- import { useEventHandlers } from "./~hooks.js";
6
+ import { Root as TreeItemRoot, Action as TreeItemAction } from "./TreeItem.js";
10
7
  const Tree = forwardRef((props, forwardedRef) => {
11
- const composite = Ariakit.useCompositeStore({ orientation: "vertical" });
8
+ const composite = useCompositeStore({ orientation: "vertical" });
12
9
  return /* @__PURE__ */ jsx(
13
- Ariakit.Role.div,
10
+ Role.div,
14
11
  {
15
12
  role: "tree",
16
13
  ...props,
17
- render: /* @__PURE__ */ jsx(Ariakit.Composite, { store: composite }),
14
+ render: /* @__PURE__ */ jsx(Composite, { store: composite }),
18
15
  className: cx("\u{1F95D}-tree", props.className),
19
16
  ref: forwardedRef,
20
17
  children: props.children
21
18
  }
22
19
  );
23
20
  });
24
- const TreeItem = forwardRef((props, forwardedRef) => {
25
- const {
26
- "aria-level": level,
27
- selected,
28
- expanded,
29
- icon,
30
- label,
31
- description,
32
- actions,
33
- onSelectedChange,
34
- onExpandedChange,
35
- onClick: onClickProp,
36
- onKeyDown: onKeyDownProp,
37
- ...rest
38
- } = props;
39
- const handleClick = (event) => {
40
- if (selected === void 0) return;
41
- event.stopPropagation();
42
- onSelectedChange?.(!selected);
43
- };
44
- const handleKeyDown = (event) => {
45
- if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
46
- return;
47
- }
48
- if (expanded === void 0) return;
49
- if (event.key === "ArrowRight" || event.key === "ArrowLeft") {
50
- event.preventDefault();
51
- onExpandedChange?.(event.key === "ArrowRight");
52
- }
53
- };
54
- const labelId = React.useId();
55
- const descriptionId = React.useId();
56
- return /* @__PURE__ */ jsx(
57
- TreeItemContext.Provider,
58
- {
59
- value: React.useMemo(
60
- () => ({
61
- level,
62
- expanded,
63
- selected
64
- }),
65
- [level, expanded, selected]
66
- ),
67
- children: /* @__PURE__ */ jsx(
68
- Ariakit.CompositeItem,
69
- {
70
- render: /* @__PURE__ */ jsx(Ariakit.Role, { ...rest }),
71
- onClick: useEventHandlers(
72
- onClickProp,
73
- handleClick
74
- ),
75
- onKeyDown: useEventHandlers(
76
- onKeyDownProp,
77
- handleKeyDown
78
- ),
79
- role: "treeitem",
80
- "aria-expanded": expanded,
81
- "aria-selected": selected,
82
- "aria-labelledby": labelId,
83
- "aria-describedby": description ? descriptionId : void 0,
84
- "aria-level": level,
85
- className: cx("\u{1F95D}-tree-item", props.className),
86
- ref: forwardedRef,
87
- children: /* @__PURE__ */ jsxs(
88
- ListItem.Root,
89
- {
90
- "data-kiwi-expanded": expanded,
91
- "data-kiwi-selected": selected,
92
- className: "\u{1F95D}-tree-item-node",
93
- style: { "--\u{1F95D}tree-item-level": level },
94
- role: void 0,
95
- children: [
96
- /* @__PURE__ */ jsxs(ListItem.Decoration, { children: [
97
- /* @__PURE__ */ jsx(
98
- TreeItemExpander,
99
- {
100
- "data-kiwi-description": description ? true : void 0,
101
- onClick: () => {
102
- if (expanded === void 0) return;
103
- onExpandedChange?.(!expanded);
104
- }
105
- }
106
- ),
107
- typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { href: icon }) : icon
108
- ] }),
109
- /* @__PURE__ */ jsx(ListItem.Content, { id: labelId, className: "\u{1F95D}-tree-item-content", children: label }),
110
- description ? /* @__PURE__ */ jsx(
111
- ListItem.Content,
112
- {
113
- id: descriptionId,
114
- className: "\u{1F95D}-tree-item-description",
115
- children: description
116
- }
117
- ) : void 0,
118
- /* @__PURE__ */ jsx(
119
- ListItem.Decoration,
120
- {
121
- render: /* @__PURE__ */ jsx(TreeItemActions, { children: actions })
122
- }
123
- )
124
- ]
125
- }
126
- )
127
- }
128
- )
129
- }
130
- );
131
- });
132
- const TreeItemActions = forwardRef((props, forwardedRef) => {
133
- return /* @__PURE__ */ jsx(
134
- Ariakit.Toolbar,
135
- {
136
- ...props,
137
- onClick: useEventHandlers(props.onClick, (e) => e.stopPropagation()),
138
- className: cx("\u{1F95D}-tree-item-actions", props.className),
139
- ref: forwardedRef,
140
- children: props.children
141
- }
142
- );
143
- });
144
- const TreeItemAction = forwardRef(
145
- (props, forwardedRef) => {
146
- const { visible, ...rest } = props;
147
- return /* @__PURE__ */ jsx(
148
- IconButton,
149
- {
150
- inert: visible === false ? true : void 0,
151
- ...rest,
152
- variant: "ghost",
153
- className: cx("\u{1F95D}-tree-item-action", props.className),
154
- "data-kiwi-visible": visible,
155
- ref: forwardedRef
156
- }
157
- );
158
- }
159
- );
160
- const TreeItemExpander = forwardRef(
161
- (props, forwardedRef) => {
162
- return /* @__PURE__ */ jsx(
163
- IconButton,
164
- {
165
- tabIndex: -1,
166
- "aria-hidden": "true",
167
- icon: /* @__PURE__ */ jsx(TreeChevron, {}),
168
- label: "Toggle",
169
- ...props,
170
- onClick: useEventHandlers(props.onClick, (e) => e.stopPropagation()),
171
- className: cx("\u{1F95D}-tree-item-expander", props.className),
172
- variant: "ghost",
173
- labelVariant: "visually-hidden",
174
- ref: forwardedRef
175
- }
176
- );
177
- }
178
- );
179
- const TreeChevron = forwardRef(
180
- (props, forwardedRef) => {
181
- return /* @__PURE__ */ jsx(
182
- Icon,
183
- {
184
- ...props,
185
- render: /* @__PURE__ */ jsx(
186
- Ariakit.Role.svg,
187
- {
188
- width: "16",
189
- height: "16",
190
- fill: "currentColor",
191
- viewBox: "0 0 16 16",
192
- render: props.render,
193
- children: /* @__PURE__ */ jsx("path", { d: "M4.146 6.146a.5.5 0 0 1 .708 0L8 9.293l3.146-3.147a.5.5 0 0 1 .708.708l-3.5 3.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 0 1 0-.708Z" })
194
- }
195
- ),
196
- className: cx("\u{1F95D}-tree-chevron", props.className),
197
- ref: forwardedRef
198
- }
199
- );
200
- }
201
- );
202
- const TreeItemContext = React.createContext(void 0);
203
21
  export {
204
- TreeItem as Item,
22
+ TreeItemRoot as Item,
205
23
  TreeItemAction as ItemAction,
206
24
  Tree as Root
207
25
  };
@@ -0,0 +1,123 @@
1
+ import * as React from "react";
2
+ import { IconButton } from "./IconButton.js";
3
+ import { type BaseProps } from "./~utils.js";
4
+ interface TreeItemRootProps extends Omit<BaseProps, "content" | "children"> {
5
+ /** Specifies the nesting level of the tree item. Nesting levels start at 1. */
6
+ "aria-level": number;
7
+ /** Defines tree item position in the current level of tree items. Integer greater than or equal to 1. */
8
+ "aria-posinset": number;
9
+ /** Defines tree item set size of the current level. */
10
+ "aria-setsize": number;
11
+ /**
12
+ * Specifies if the tree item is selected.
13
+ *
14
+ * If `undefined`, the tree item is not selectable.
15
+ *
16
+ * @default undefined
17
+ */
18
+ selected?: boolean;
19
+ /**
20
+ * Callback fired when the tree item is selected.
21
+ *
22
+ * Should be used with the `selected` prop.
23
+ */
24
+ onSelectedChange?: (selected: boolean) => void;
25
+ /**
26
+ * Specifies if the tree item is expanded.
27
+ *
28
+ * Used to determine if a tree item is a parent node. If `undefined`, it is a leaf node (i.e. not expandable).
29
+ *
30
+ * @default undefined
31
+ * */
32
+ expanded?: boolean;
33
+ /**
34
+ * Callback fired when the tree item is expanded.
35
+ *
36
+ * Should be used with the `expanded` prop.
37
+ */
38
+ onExpandedChange?: (expanded: boolean) => void;
39
+ /**
40
+ * Icon to be displayed inside the tree item.
41
+ *
42
+ * Can be a URL of an SVG from the `@itwin/itwinui-icons` package, or a JSX element.
43
+ *
44
+ * For multiple icons/decorations, use the `unstable_decorations` prop.
45
+ */
46
+ icon?: string | React.JSX.Element;
47
+ /**
48
+ * Decoration(s) to be displayed inside the tree item.
49
+ *
50
+ * This is an alternative to the `icon` prop, and can be used to
51
+ * display multiple icons or other decorations before the label.
52
+ *
53
+ * Note: This should _not_ be used together with the `icon` prop.
54
+ *
55
+ * @experimental
56
+ */
57
+ unstable_decorations?: React.ReactNode;
58
+ /**
59
+ * The primary label that identifies the tree item and is displayed inside it.
60
+ */
61
+ label?: React.ReactNode;
62
+ /** Secondary line of text to display additional information about the tree item. */
63
+ description?: React.ReactNode;
64
+ /**
65
+ * The actions available for the tree item. Must be a list of `Tree.ItemAction` components.
66
+ *
67
+ * Example:
68
+ * ```tsx
69
+ * actions={[
70
+ * <Tree.ItemAction key={…} icon={…} label={…} />,
71
+ * <Tree.ItemAction key={…} icon={…} label={…} />,
72
+ * ]}
73
+ * ```
74
+ */
75
+ actions?: React.ReactNode[];
76
+ }
77
+ /**
78
+ * A treeitem is a node in a tree structure that may be expanded or collapsed to reveal or hide its descendants.
79
+ *
80
+ * `Tree.Item`s can be rendered inside a `Tree.Root`. Additional properties are specified to the `Tree.Item`s to create a hierarchical tree structure.
81
+ *
82
+ * Example:
83
+ * ```tsx
84
+ * <Tree.Root>
85
+ * <Tree.Item label="Parent" aria-level={1} aria-posinset={1} aria-setsize={1} />
86
+ * <Tree.Item label="Child 1" aria-level={2} aria-posinset={1} aria-setsize={2} />
87
+ * <Tree.Item label="Child 2" aria-level={2} aria-posinset={2} aria-setsize={2} />
88
+ * </Tree.Root>
89
+ * ```
90
+ *
91
+ * The `label` and `icon` props can be used to specify the treeitem's own content.
92
+ *
93
+ * The `aria-level` prop is used to specify the nesting level of the treeitem. Nesting levels start at 1.
94
+ *
95
+ * The `aria-posinset` and `aria-setsize` props are used to define the treeitem's position in the current level of tree items.
96
+ *
97
+ * The `expanded` and `onExpandedChange` props can be used to control the expansion state of a treeitem.
98
+ *
99
+ * The `selected` and `onSelectedChange` props can be used to control the selection state of a treeitem.
100
+ *
101
+ * Secondary actions can be passed into the `actions` prop.
102
+ */
103
+ declare const TreeItemRoot: React.ForwardRefExoticComponent<TreeItemRootProps & React.RefAttributes<HTMLElement | HTMLDivElement>>;
104
+ type IconButtonProps = React.ComponentProps<typeof IconButton>;
105
+ interface TreeItemActionProps extends BaseProps<"button">, Pick<IconButtonProps, "label" | "icon"> {
106
+ /**
107
+ * Controls the visibility of the action.
108
+ *
109
+ * If `true`, the action is always visible.
110
+ * If `false`, the action is hidden and becomes inaccessible, but still occupies space.
111
+ *
112
+ * By default, the action is shown only when the treeitem receives hover/focus.
113
+ */
114
+ visible?: boolean;
115
+ }
116
+ /**
117
+ * A secondary action for `<Tree.Item>`, to be passed into the `actions` prop. The action is typically
118
+ * displayed as an icon-button on the right end of the treeitem.
119
+ *
120
+ * By default, the action appears only on hover/focus. This can be controlled by the `visible` prop.
121
+ */
122
+ declare const TreeItemAction: React.ForwardRefExoticComponent<TreeItemActionProps & React.RefAttributes<HTMLElement | HTMLButtonElement>>;
123
+ export { TreeItemRoot as Root, TreeItemAction as Action };
@@ -0,0 +1,214 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import cx from "classnames";
4
+ import { Role } from "@ariakit/react/role";
5
+ import {
6
+ CompositeItem
7
+ } from "@ariakit/react/composite";
8
+ import { Toolbar } from "@ariakit/react/toolbar";
9
+ import * as ListItem from "./~utils.ListItem.js";
10
+ import { IconButton } from "./IconButton.js";
11
+ import { Icon } from "./Icon.js";
12
+ import { forwardRef } from "./~utils.js";
13
+ import { useEventHandlers } from "./~hooks.js";
14
+ import { GhostAligner } from "./~utils.GhostAligner.js";
15
+ const TreeItemContext = React.createContext(void 0);
16
+ const TreeItemRoot = forwardRef(
17
+ (props, forwardedRef) => {
18
+ const {
19
+ "aria-level": level,
20
+ selected,
21
+ expanded,
22
+ icon,
23
+ unstable_decorations,
24
+ label,
25
+ description,
26
+ actions,
27
+ onSelectedChange,
28
+ onExpandedChange,
29
+ onClick: onClickProp,
30
+ onKeyDown: onKeyDownProp,
31
+ ...rest
32
+ } = props;
33
+ const handleClick = (event) => {
34
+ if (selected === void 0) return;
35
+ event.stopPropagation();
36
+ onSelectedChange?.(!selected);
37
+ };
38
+ const handleKeyDown = (event) => {
39
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
40
+ return;
41
+ }
42
+ if (expanded === void 0) return;
43
+ if (event.key === "ArrowRight" || event.key === "ArrowLeft") {
44
+ event.preventDefault();
45
+ onExpandedChange?.(event.key === "ArrowRight");
46
+ }
47
+ };
48
+ const labelId = React.useId();
49
+ const descriptionId = React.useId();
50
+ const decorationId = React.useId();
51
+ const describedBy = React.useMemo(() => {
52
+ const idRefs = [];
53
+ if (description) idRefs.push(descriptionId);
54
+ if (unstable_decorations || icon) idRefs.push(decorationId);
55
+ return idRefs.length > 0 ? idRefs.join(" ") : void 0;
56
+ }, [unstable_decorations, icon, decorationId, description, descriptionId]);
57
+ return /* @__PURE__ */ jsx(
58
+ TreeItemContext.Provider,
59
+ {
60
+ value: React.useMemo(
61
+ () => ({
62
+ level,
63
+ expanded,
64
+ selected
65
+ }),
66
+ [level, expanded, selected]
67
+ ),
68
+ children: /* @__PURE__ */ jsx(
69
+ CompositeItem,
70
+ {
71
+ render: /* @__PURE__ */ jsx(Role, { ...rest }),
72
+ onClick: useEventHandlers(
73
+ onClickProp,
74
+ handleClick
75
+ ),
76
+ onKeyDown: useEventHandlers(
77
+ onKeyDownProp,
78
+ handleKeyDown
79
+ ),
80
+ role: "treeitem",
81
+ "aria-expanded": expanded,
82
+ "aria-selected": selected,
83
+ "aria-labelledby": labelId,
84
+ "aria-describedby": describedBy,
85
+ "aria-level": level,
86
+ className: cx("\u{1F95D}-tree-item", props.className),
87
+ ref: forwardedRef,
88
+ children: /* @__PURE__ */ jsxs(
89
+ ListItem.Root,
90
+ {
91
+ "data-kiwi-expanded": expanded,
92
+ "data-kiwi-selected": selected,
93
+ className: "\u{1F95D}-tree-item-node",
94
+ style: { "--\u{1F95D}tree-item-level": level },
95
+ role: void 0,
96
+ children: [
97
+ /* @__PURE__ */ jsxs(ListItem.Decoration, { children: [
98
+ /* @__PURE__ */ jsx(GhostAligner, { align: description ? "block" : void 0, children: /* @__PURE__ */ jsx(
99
+ TreeItemExpander,
100
+ {
101
+ onClick: () => {
102
+ if (expanded === void 0) return;
103
+ onExpandedChange?.(!expanded);
104
+ }
105
+ }
106
+ ) }),
107
+ icon || unstable_decorations ? /* @__PURE__ */ jsx(
108
+ Role,
109
+ {
110
+ className: "\u{1F95D}-tree-item-decoration",
111
+ id: decorationId,
112
+ render: React.isValidElement(icon) ? icon : typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { href: icon }) : void 0,
113
+ children: !icon ? unstable_decorations : null
114
+ }
115
+ ) : null
116
+ ] }),
117
+ /* @__PURE__ */ jsx(ListItem.Content, { id: labelId, className: "\u{1F95D}-tree-item-content", children: label }),
118
+ description ? /* @__PURE__ */ jsx(
119
+ ListItem.Content,
120
+ {
121
+ id: descriptionId,
122
+ className: "\u{1F95D}-tree-item-description",
123
+ children: description
124
+ }
125
+ ) : void 0,
126
+ /* @__PURE__ */ jsx(
127
+ ListItem.Decoration,
128
+ {
129
+ render: /* @__PURE__ */ jsx(TreeItemActions, { children: actions })
130
+ }
131
+ )
132
+ ]
133
+ }
134
+ )
135
+ }
136
+ )
137
+ }
138
+ );
139
+ }
140
+ );
141
+ const TreeItemActions = forwardRef((props, forwardedRef) => {
142
+ return /* @__PURE__ */ jsx(
143
+ Toolbar,
144
+ {
145
+ ...props,
146
+ onClick: useEventHandlers(props.onClick, (e) => e.stopPropagation()),
147
+ className: cx("\u{1F95D}-tree-item-actions", props.className),
148
+ ref: forwardedRef,
149
+ children: props.children
150
+ }
151
+ );
152
+ });
153
+ const TreeItemAction = forwardRef(
154
+ (props, forwardedRef) => {
155
+ const { visible, ...rest } = props;
156
+ return /* @__PURE__ */ jsx(
157
+ IconButton,
158
+ {
159
+ inert: visible === false ? true : void 0,
160
+ ...rest,
161
+ variant: "ghost",
162
+ className: cx("\u{1F95D}-tree-item-action", props.className),
163
+ "data-kiwi-visible": visible,
164
+ ref: forwardedRef
165
+ }
166
+ );
167
+ }
168
+ );
169
+ const TreeItemExpander = forwardRef(
170
+ (props, forwardedRef) => {
171
+ return /* @__PURE__ */ jsx(
172
+ IconButton,
173
+ {
174
+ tabIndex: -1,
175
+ "aria-hidden": "true",
176
+ icon: /* @__PURE__ */ jsx(TreeChevron, {}),
177
+ label: "Toggle",
178
+ ...props,
179
+ onClick: useEventHandlers(props.onClick, (e) => e.stopPropagation()),
180
+ className: cx("\u{1F95D}-tree-item-expander", props.className),
181
+ variant: "ghost",
182
+ labelVariant: "visually-hidden",
183
+ ref: forwardedRef
184
+ }
185
+ );
186
+ }
187
+ );
188
+ const TreeChevron = forwardRef(
189
+ (props, forwardedRef) => {
190
+ return /* @__PURE__ */ jsx(
191
+ Icon,
192
+ {
193
+ ...props,
194
+ render: /* @__PURE__ */ jsx(
195
+ Role.svg,
196
+ {
197
+ width: "16",
198
+ height: "16",
199
+ fill: "currentColor",
200
+ viewBox: "0 0 16 16",
201
+ render: props.render,
202
+ children: /* @__PURE__ */ jsx("path", { d: "M4.146 6.146a.5.5 0 0 1 .708 0L8 9.293l3.146-3.147a.5.5 0 0 1 .708.708l-3.5 3.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 0 1 0-.708Z" })
203
+ }
204
+ ),
205
+ className: cx("\u{1F95D}-tree-chevron", props.className),
206
+ ref: forwardedRef
207
+ }
208
+ );
209
+ }
210
+ );
211
+ export {
212
+ TreeItemAction as Action,
213
+ TreeItemRoot as Root
214
+ };
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import * as Ariakit from "@ariakit/react";
2
+ import { VisuallyHidden as AkVisuallyHidden } from "@ariakit/react/visually-hidden";
3
3
  import { forwardRef } from "./~utils.js";
4
4
  const VisuallyHidden = forwardRef(
5
5
  (props, forwardedRef) => {
6
- return /* @__PURE__ */ jsx(Ariakit.VisuallyHidden, { ...props, ref: forwardedRef });
6
+ return /* @__PURE__ */ jsx(AkVisuallyHidden, { ...props, ref: forwardedRef });
7
7
  }
8
8
  );
9
9
  export {