@itwin/itwinui-react 5.0.0-alpha.1 → 5.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +102 -0
- package/LICENSE.md +1 -1
- package/README.md +6 -6
- package/dist/DEV/bricks/Anchor.js +5 -10
- package/dist/DEV/bricks/Avatar.js +24 -0
- package/dist/DEV/bricks/Badge.js +22 -0
- package/dist/DEV/bricks/Button.js +11 -4
- package/dist/DEV/bricks/Checkbox.js +17 -9
- package/dist/DEV/bricks/Chip.js +42 -0
- package/dist/DEV/bricks/Description.js +29 -0
- package/dist/DEV/bricks/Divider.js +3 -2
- package/dist/DEV/bricks/DropdownMenu.js +109 -30
- package/dist/DEV/bricks/Field.js +115 -14
- package/dist/DEV/bricks/Icon.js +177 -10
- package/dist/DEV/bricks/IconButton.js +14 -3
- package/dist/DEV/bricks/Kbd.internal.js +19 -0
- package/dist/DEV/bricks/Kbd.js +23 -6
- package/dist/DEV/bricks/Label.js +11 -8
- package/dist/DEV/bricks/ProgressBar.js +25 -0
- package/dist/DEV/bricks/Radio.js +17 -9
- package/dist/DEV/bricks/Root.internal.js +17 -0
- package/dist/DEV/bricks/Root.js +103 -26
- package/dist/DEV/bricks/Select.js +17 -11
- package/dist/DEV/bricks/Skeleton.js +24 -0
- package/dist/DEV/bricks/Spinner.js +55 -0
- package/dist/DEV/bricks/Switch.js +18 -10
- package/dist/DEV/bricks/Table.js +114 -0
- package/dist/DEV/bricks/Tabs.js +6 -6
- package/dist/DEV/bricks/Text.js +2 -2
- package/dist/DEV/bricks/TextBox.js +54 -16
- package/dist/DEV/bricks/Tooltip.js +17 -25
- package/dist/DEV/bricks/Tree.js +15 -107
- package/dist/DEV/bricks/TreeItem.js +227 -0
- package/dist/DEV/bricks/VisuallyHidden.js +2 -2
- package/dist/DEV/bricks/index.js +16 -0
- package/dist/DEV/bricks/styles.css.js +2 -2
- package/dist/DEV/bricks/~hooks.js +57 -3
- package/dist/DEV/bricks/~utils.GhostAligner.js +13 -0
- package/dist/DEV/bricks/{ListItem.js → ~utils.ListItem.js} +19 -3
- package/dist/DEV/bricks/~utils.js +17 -0
- package/dist/DEV/foundations/styles.css.js +2 -2
- package/dist/bricks/Anchor.js +5 -10
- package/dist/bricks/Avatar.d.ts +47 -0
- package/dist/bricks/Avatar.js +23 -0
- package/dist/bricks/Badge.d.ts +28 -0
- package/dist/bricks/Badge.js +21 -0
- package/dist/bricks/Button.js +11 -4
- package/dist/bricks/Checkbox.d.ts +2 -2
- package/dist/bricks/Checkbox.js +17 -9
- package/dist/bricks/Chip.d.ts +31 -0
- package/dist/bricks/Chip.js +41 -0
- package/dist/bricks/Description.d.ts +19 -0
- package/dist/bricks/Description.js +29 -0
- package/dist/bricks/Divider.d.ts +2 -2
- package/dist/bricks/Divider.js +3 -2
- package/dist/bricks/DropdownMenu.d.ts +41 -14
- package/dist/bricks/DropdownMenu.js +106 -30
- package/dist/bricks/Field.d.ts +23 -1
- package/dist/bricks/Field.js +115 -14
- package/dist/bricks/Icon.d.ts +43 -4
- package/dist/bricks/Icon.js +174 -10
- package/dist/bricks/IconButton.d.ts +20 -4
- package/dist/bricks/IconButton.js +14 -3
- package/dist/bricks/Kbd.d.ts +15 -0
- package/dist/bricks/Kbd.internal.d.ts +17 -0
- package/dist/bricks/Kbd.internal.js +19 -0
- package/dist/bricks/Kbd.js +16 -6
- package/dist/bricks/Label.js +11 -8
- package/dist/bricks/ProgressBar.d.ts +31 -0
- package/dist/bricks/ProgressBar.js +24 -0
- package/dist/bricks/Radio.d.ts +2 -2
- package/dist/bricks/Radio.js +17 -9
- package/dist/bricks/Root.d.ts +12 -0
- package/dist/bricks/Root.internal.d.ts +6 -0
- package/dist/bricks/Root.internal.js +17 -0
- package/dist/bricks/Root.js +103 -26
- package/dist/bricks/Select.d.ts +9 -3
- package/dist/bricks/Select.js +17 -11
- package/dist/bricks/Skeleton.d.ts +25 -0
- package/dist/bricks/Skeleton.js +23 -0
- package/dist/bricks/Spinner.d.ts +31 -0
- package/dist/bricks/Spinner.js +54 -0
- package/dist/bricks/Switch.d.ts +2 -2
- package/dist/bricks/Switch.js +18 -10
- package/dist/bricks/Table.d.ts +115 -0
- package/dist/bricks/Table.js +108 -0
- package/dist/bricks/Tabs.d.ts +4 -4
- package/dist/bricks/Tabs.js +6 -6
- package/dist/bricks/Text.d.ts +1 -1
- package/dist/bricks/Text.js +2 -2
- package/dist/bricks/TextBox.d.ts +23 -2
- package/dist/bricks/TextBox.js +53 -16
- package/dist/bricks/Tooltip.d.ts +2 -2
- package/dist/bricks/Tooltip.js +17 -25
- package/dist/bricks/Tree.d.ts +19 -20
- package/dist/bricks/Tree.js +14 -102
- package/dist/bricks/TreeItem.d.ts +129 -0
- package/dist/bricks/TreeItem.js +222 -0
- package/dist/bricks/VisuallyHidden.js +2 -2
- package/dist/bricks/index.d.ts +8 -0
- package/dist/bricks/index.js +16 -0
- package/dist/bricks/styles.css.js +2 -2
- package/dist/bricks/~hooks.d.ts +63 -0
- package/dist/bricks/~hooks.js +57 -3
- package/dist/bricks/~utils.GhostAligner.d.ts +22 -0
- package/dist/bricks/~utils.GhostAligner.js +13 -0
- package/dist/bricks/~utils.ListItem.d.ts +14 -0
- package/dist/bricks/{ListItem.js → ~utils.ListItem.js} +18 -3
- package/dist/bricks/~utils.d.ts +14 -3
- package/dist/bricks/~utils.js +17 -0
- package/dist/foundations/styles.css.js +2 -2
- package/package.json +14 -13
- package/dist/DEV/bricks/Textarea.js +0 -30
- package/dist/bricks/ListItem.d.ts +0 -10
- package/dist/bricks/Textarea.d.ts +0 -24
- package/dist/bricks/Textarea.js +0 -29
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import cx from "classnames";
|
|
4
|
-
import * as
|
|
5
|
-
import {
|
|
4
|
+
import * as AkTooltip from "@ariakit/react/tooltip";
|
|
5
|
+
import { useStoreState } from "@ariakit/react/store";
|
|
6
|
+
import { forwardRef } from "./~utils.js";
|
|
7
|
+
import { usePopoverApi } from "./~hooks.js";
|
|
6
8
|
const Tooltip = forwardRef(
|
|
7
9
|
(props, forwardedRef) => {
|
|
10
|
+
const generatedId = React.useId();
|
|
8
11
|
const {
|
|
9
12
|
content,
|
|
10
13
|
children,
|
|
11
|
-
className,
|
|
12
14
|
type = "description",
|
|
13
|
-
id =
|
|
15
|
+
id = generatedId,
|
|
14
16
|
defaultOpen: defaultOpenProp,
|
|
15
17
|
open: openProp,
|
|
16
18
|
setOpen: setOpenProp,
|
|
17
19
|
unmountOnHide = type === "none",
|
|
18
20
|
...rest
|
|
19
21
|
} = props;
|
|
20
|
-
const store =
|
|
21
|
-
const open =
|
|
22
|
-
const popover =
|
|
23
|
-
store,
|
|
24
|
-
(state) => state.popoverElement
|
|
25
|
-
);
|
|
26
|
-
React.useEffect(
|
|
27
|
-
function syncPopoverWithOpenState() {
|
|
28
|
-
if (popover?.isConnected) {
|
|
29
|
-
popover?.togglePopover?.(open);
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
[open, popover]
|
|
33
|
-
);
|
|
22
|
+
const store = AkTooltip.useTooltipStore();
|
|
23
|
+
const open = useStoreState(store, (store2) => store2.open);
|
|
24
|
+
const popover = usePopoverApi(store);
|
|
34
25
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
35
|
-
|
|
26
|
+
AkTooltip.TooltipProvider,
|
|
36
27
|
{
|
|
37
28
|
store,
|
|
38
29
|
defaultOpen: defaultOpenProp,
|
|
@@ -40,28 +31,29 @@ const Tooltip = forwardRef(
|
|
|
40
31
|
setOpen: setOpenProp,
|
|
41
32
|
children: [
|
|
42
33
|
/* @__PURE__ */ jsx(
|
|
43
|
-
|
|
34
|
+
AkTooltip.TooltipAnchor,
|
|
44
35
|
{
|
|
45
36
|
render: children,
|
|
37
|
+
"data-has-popover-open": open || void 0,
|
|
46
38
|
...type === "description" && { "aria-describedby": id },
|
|
47
39
|
...type === "label" && { "aria-labelledby": id }
|
|
48
40
|
}
|
|
49
41
|
),
|
|
50
42
|
/* @__PURE__ */ jsx(
|
|
51
|
-
|
|
43
|
+
AkTooltip.Tooltip,
|
|
52
44
|
{
|
|
53
45
|
"aria-hidden": "true",
|
|
46
|
+
portal: true,
|
|
54
47
|
...rest,
|
|
55
48
|
unmountOnHide,
|
|
56
|
-
className: cx("\u{1F95D}-tooltip", className),
|
|
49
|
+
className: cx("\u{1F95D}-tooltip", props.className),
|
|
57
50
|
ref: forwardedRef,
|
|
58
51
|
id,
|
|
59
52
|
style: {
|
|
60
|
-
|
|
53
|
+
...popover.style,
|
|
61
54
|
...props.style
|
|
62
55
|
},
|
|
63
|
-
wrapperProps:
|
|
64
|
-
portal: !supportsPopover,
|
|
56
|
+
wrapperProps: popover.wrapperProps,
|
|
65
57
|
children: content
|
|
66
58
|
}
|
|
67
59
|
)
|
package/dist/DEV/bricks/Tree.js
CHANGED
|
@@ -1,118 +1,26 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import * as React from "react";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import cx from "classnames";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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";
|
|
6
|
+
import { Root as TreeItemRoot, Action as TreeItemAction } from "./TreeItem.js";
|
|
9
7
|
const Tree = forwardRef((props, forwardedRef) => {
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
DEV: Tree.displayName = "Tree.Root";
|
|
13
|
-
const TreeItem = forwardRef((props, forwardedRef) => {
|
|
14
|
-
const { selected, content, children, className, expanded, style, ...rest } = props;
|
|
15
|
-
const parentContext = React.useContext(TreeItemContext);
|
|
16
|
-
const level = parentContext ? parentContext.level + 1 : 1;
|
|
17
|
-
const firstSelected = !!selected && !parentContext?.selected;
|
|
8
|
+
const composite = useCompositeStore({ orientation: "vertical" });
|
|
18
9
|
return /* @__PURE__ */ jsx(
|
|
19
|
-
|
|
10
|
+
Role.div,
|
|
20
11
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
[level, expanded, selected]
|
|
28
|
-
),
|
|
29
|
-
children: /* @__PURE__ */ jsxs("div", { role: "listitem", "aria-current": firstSelected ? true : void 0, children: [
|
|
30
|
-
/* @__PURE__ */ jsx(
|
|
31
|
-
ListItem.Root,
|
|
32
|
-
{
|
|
33
|
-
...rest,
|
|
34
|
-
"data-kiwi-expanded": expanded,
|
|
35
|
-
"data-kiwi-selected": selected,
|
|
36
|
-
"data-kiwi-parent-selected": parentContext?.selected,
|
|
37
|
-
className: cx("\u{1F95D}-tree-item", className),
|
|
38
|
-
style: {
|
|
39
|
-
...style,
|
|
40
|
-
"--\u{1F95D}tree-item-level": level
|
|
41
|
-
},
|
|
42
|
-
ref: forwardedRef,
|
|
43
|
-
role: void 0,
|
|
44
|
-
children: content
|
|
45
|
-
}
|
|
46
|
-
),
|
|
47
|
-
children && /* @__PURE__ */ jsx("div", { role: "list", children })
|
|
48
|
-
] })
|
|
12
|
+
role: "tree",
|
|
13
|
+
...props,
|
|
14
|
+
render: /* @__PURE__ */ jsx(Composite, { store: composite }),
|
|
15
|
+
className: cx("\u{1F95D}-tree", props.className),
|
|
16
|
+
ref: forwardedRef,
|
|
17
|
+
children: props.children
|
|
49
18
|
}
|
|
50
19
|
);
|
|
51
20
|
});
|
|
52
|
-
DEV:
|
|
53
|
-
const TreeItemContent = forwardRef(
|
|
54
|
-
(props, forwardedRef) => {
|
|
55
|
-
const { children, ...rest } = props;
|
|
56
|
-
return /* @__PURE__ */ jsx(
|
|
57
|
-
ListItem.Content,
|
|
58
|
-
{
|
|
59
|
-
...rest,
|
|
60
|
-
className: cx("\u{1F95D}-tree-item-content", props.className),
|
|
61
|
-
ref: forwardedRef,
|
|
62
|
-
children: /* @__PURE__ */ jsx("button", { type: "button", children })
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
DEV: TreeItemContent.displayName = "Tree.Content";
|
|
68
|
-
const TreeItemExpander = forwardRef(
|
|
69
|
-
(props, forwardedRef) => {
|
|
70
|
-
const context = React.useContext(TreeItemContext);
|
|
71
|
-
const expanded = context?.expanded;
|
|
72
|
-
return /* @__PURE__ */ jsx(
|
|
73
|
-
IconButton,
|
|
74
|
-
{
|
|
75
|
-
icon: /* @__PURE__ */ jsx(TreeChevron, {}),
|
|
76
|
-
label: "Toggle",
|
|
77
|
-
"aria-expanded": expanded === void 0 ? void 0 : expanded,
|
|
78
|
-
...props,
|
|
79
|
-
className: cx("\u{1F95D}-tree-item-expander", props.className),
|
|
80
|
-
variant: "ghost",
|
|
81
|
-
labelVariant: "visually-hidden",
|
|
82
|
-
ref: forwardedRef
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
DEV: TreeItemExpander.displayName = "Tree.Expander";
|
|
88
|
-
const TreeChevron = forwardRef(
|
|
89
|
-
(props, forwardedRef) => {
|
|
90
|
-
return /* @__PURE__ */ jsx(
|
|
91
|
-
Icon,
|
|
92
|
-
{
|
|
93
|
-
...props,
|
|
94
|
-
render: /* @__PURE__ */ jsx(
|
|
95
|
-
Ariakit.Role.svg,
|
|
96
|
-
{
|
|
97
|
-
width: "16",
|
|
98
|
-
height: "16",
|
|
99
|
-
fill: "currentColor",
|
|
100
|
-
viewBox: "0 0 16 16",
|
|
101
|
-
render: props.render,
|
|
102
|
-
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" })
|
|
103
|
-
}
|
|
104
|
-
),
|
|
105
|
-
className: cx("\u{1F95D}-tree-chevron", props.className),
|
|
106
|
-
ref: forwardedRef
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
DEV: TreeChevron.displayName = "TreeChevron";
|
|
112
|
-
const TreeItemContext = React.createContext(void 0);
|
|
21
|
+
DEV: Tree.displayName = "Tree.Root";
|
|
113
22
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
TreeItem as Item,
|
|
23
|
+
TreeItemRoot as Item,
|
|
24
|
+
TreeItemAction as ItemAction,
|
|
117
25
|
Tree as Root
|
|
118
26
|
};
|
|
@@ -0,0 +1,227 @@
|
|
|
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, StatusWarning } from "./Icon.js";
|
|
12
|
+
import { forwardRef } from "./~utils.js";
|
|
13
|
+
import { useEventHandlers } from "./~hooks.js";
|
|
14
|
+
import { GhostAligner, useGhostAlignment } 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: iconProp,
|
|
23
|
+
unstable_decorations,
|
|
24
|
+
label,
|
|
25
|
+
description,
|
|
26
|
+
actions,
|
|
27
|
+
error,
|
|
28
|
+
onSelectedChange,
|
|
29
|
+
onExpandedChange,
|
|
30
|
+
onClick: onClickProp,
|
|
31
|
+
onKeyDown: onKeyDownProp,
|
|
32
|
+
...rest
|
|
33
|
+
} = props;
|
|
34
|
+
const handleClick = (event) => {
|
|
35
|
+
if (selected === void 0) return;
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
onSelectedChange?.(!selected);
|
|
38
|
+
};
|
|
39
|
+
const handleKeyDown = (event) => {
|
|
40
|
+
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (expanded === void 0) return;
|
|
44
|
+
if (event.key === "ArrowRight" || event.key === "ArrowLeft") {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
onExpandedChange?.(event.key === "ArrowRight");
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const labelId = React.useId();
|
|
50
|
+
const descriptionId = React.useId();
|
|
51
|
+
const decorationId = React.useId();
|
|
52
|
+
const icon = error ? /* @__PURE__ */ jsx(StatusWarning, {}) : iconProp;
|
|
53
|
+
const describedBy = React.useMemo(() => {
|
|
54
|
+
const idRefs = [];
|
|
55
|
+
if (description) idRefs.push(descriptionId);
|
|
56
|
+
if (unstable_decorations || icon) idRefs.push(decorationId);
|
|
57
|
+
return idRefs.length > 0 ? idRefs.join(" ") : void 0;
|
|
58
|
+
}, [unstable_decorations, icon, decorationId, description, descriptionId]);
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
TreeItemContext.Provider,
|
|
61
|
+
{
|
|
62
|
+
value: React.useMemo(
|
|
63
|
+
() => ({
|
|
64
|
+
level,
|
|
65
|
+
expanded,
|
|
66
|
+
selected
|
|
67
|
+
}),
|
|
68
|
+
[level, expanded, selected]
|
|
69
|
+
),
|
|
70
|
+
children: /* @__PURE__ */ jsx(
|
|
71
|
+
CompositeItem,
|
|
72
|
+
{
|
|
73
|
+
render: /* @__PURE__ */ jsx(Role, { ...rest }),
|
|
74
|
+
onClick: useEventHandlers(
|
|
75
|
+
onClickProp,
|
|
76
|
+
handleClick
|
|
77
|
+
),
|
|
78
|
+
onKeyDown: useEventHandlers(
|
|
79
|
+
onKeyDownProp,
|
|
80
|
+
handleKeyDown
|
|
81
|
+
),
|
|
82
|
+
role: "treeitem",
|
|
83
|
+
"aria-expanded": expanded,
|
|
84
|
+
"aria-selected": selected,
|
|
85
|
+
"aria-labelledby": labelId,
|
|
86
|
+
"aria-describedby": describedBy,
|
|
87
|
+
"aria-level": level,
|
|
88
|
+
className: cx("\u{1F95D}-tree-item", props.className),
|
|
89
|
+
ref: forwardedRef,
|
|
90
|
+
children: /* @__PURE__ */ jsxs(
|
|
91
|
+
ListItem.Root,
|
|
92
|
+
{
|
|
93
|
+
"data-kiwi-expanded": expanded,
|
|
94
|
+
"data-kiwi-selected": selected,
|
|
95
|
+
"data-kiwi-error": error ? true : void 0,
|
|
96
|
+
className: "\u{1F95D}-tree-item-node",
|
|
97
|
+
style: { "--\u{1F95D}tree-item-level": level },
|
|
98
|
+
role: void 0,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ jsxs(ListItem.Decoration, { children: [
|
|
101
|
+
/* @__PURE__ */ jsx(GhostAligner, { align: description ? "block" : void 0, children: /* @__PURE__ */ jsx(
|
|
102
|
+
TreeItemExpander,
|
|
103
|
+
{
|
|
104
|
+
onClick: () => {
|
|
105
|
+
if (expanded === void 0) return;
|
|
106
|
+
onExpandedChange?.(!expanded);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
) }),
|
|
110
|
+
icon || unstable_decorations ? /* @__PURE__ */ jsx(
|
|
111
|
+
Role,
|
|
112
|
+
{
|
|
113
|
+
className: "\u{1F95D}-tree-item-decoration",
|
|
114
|
+
id: decorationId,
|
|
115
|
+
render: React.isValidElement(icon) ? icon : typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { href: icon }) : void 0,
|
|
116
|
+
children: !icon ? unstable_decorations : null
|
|
117
|
+
}
|
|
118
|
+
) : null
|
|
119
|
+
] }),
|
|
120
|
+
/* @__PURE__ */ jsx(ListItem.Content, { id: labelId, className: "\u{1F95D}-tree-item-content", children: label }),
|
|
121
|
+
description ? /* @__PURE__ */ jsx(
|
|
122
|
+
ListItem.Content,
|
|
123
|
+
{
|
|
124
|
+
id: descriptionId,
|
|
125
|
+
className: "\u{1F95D}-tree-item-description",
|
|
126
|
+
children: description
|
|
127
|
+
}
|
|
128
|
+
) : void 0,
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
ListItem.Decoration,
|
|
131
|
+
{
|
|
132
|
+
render: /* @__PURE__ */ jsx(TreeItemActions, { children: actions })
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
DEV: TreeItemRoot.displayName = "TreeItem.Root";
|
|
145
|
+
const TreeItemActions = forwardRef((props, forwardedRef) => {
|
|
146
|
+
return /* @__PURE__ */ jsx(
|
|
147
|
+
Toolbar,
|
|
148
|
+
{
|
|
149
|
+
...props,
|
|
150
|
+
onClick: useEventHandlers(props.onClick, (e) => e.stopPropagation()),
|
|
151
|
+
onKeyDown: useEventHandlers(props.onKeyDown, (e) => e.stopPropagation()),
|
|
152
|
+
className: cx("\u{1F95D}-tree-item-actions-container", props.className),
|
|
153
|
+
ref: forwardedRef,
|
|
154
|
+
children: props.children
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
});
|
|
158
|
+
DEV: TreeItemActions.displayName = "TreeItemActions";
|
|
159
|
+
const TreeItemAction = forwardRef(
|
|
160
|
+
(props, forwardedRef) => {
|
|
161
|
+
const { visible, ...rest } = props;
|
|
162
|
+
return /* @__PURE__ */ jsx(
|
|
163
|
+
IconButton,
|
|
164
|
+
{
|
|
165
|
+
inert: visible === false ? true : void 0,
|
|
166
|
+
...rest,
|
|
167
|
+
variant: "ghost",
|
|
168
|
+
className: cx("\u{1F95D}-tree-item-action", props.className),
|
|
169
|
+
"data-kiwi-visible": visible,
|
|
170
|
+
ref: forwardedRef
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
DEV: TreeItemAction.displayName = "TreeItem.Action";
|
|
176
|
+
const TreeItemExpander = forwardRef(
|
|
177
|
+
(props, forwardedRef) => {
|
|
178
|
+
return /* @__PURE__ */ jsx(
|
|
179
|
+
Role.span,
|
|
180
|
+
{
|
|
181
|
+
"aria-hidden": "true",
|
|
182
|
+
...props,
|
|
183
|
+
onClick: useEventHandlers(props.onClick, (e) => e.stopPropagation()),
|
|
184
|
+
className: cx(
|
|
185
|
+
"\u{1F95D}-button",
|
|
186
|
+
"\u{1F95D}-icon-button",
|
|
187
|
+
"\u{1F95D}-ghost-aligner",
|
|
188
|
+
"\u{1F95D}-tree-item-expander",
|
|
189
|
+
props.className
|
|
190
|
+
),
|
|
191
|
+
"data-kiwi-variant": "ghost",
|
|
192
|
+
"data-kiwi-ghost-align": useGhostAlignment(),
|
|
193
|
+
ref: forwardedRef,
|
|
194
|
+
children: /* @__PURE__ */ jsx(TreeChevron, {})
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
DEV: TreeItemExpander.displayName = "TreeItemExpander";
|
|
200
|
+
const TreeChevron = forwardRef(
|
|
201
|
+
(props, forwardedRef) => {
|
|
202
|
+
return /* @__PURE__ */ jsx(
|
|
203
|
+
Icon,
|
|
204
|
+
{
|
|
205
|
+
...props,
|
|
206
|
+
render: /* @__PURE__ */ jsx(
|
|
207
|
+
Role.svg,
|
|
208
|
+
{
|
|
209
|
+
width: "16",
|
|
210
|
+
height: "16",
|
|
211
|
+
fill: "currentColor",
|
|
212
|
+
viewBox: "0 0 16 16",
|
|
213
|
+
render: props.render,
|
|
214
|
+
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" })
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
className: cx("\u{1F95D}-tree-chevron", props.className),
|
|
218
|
+
ref: forwardedRef
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
DEV: TreeChevron.displayName = "TreeChevron";
|
|
224
|
+
export {
|
|
225
|
+
TreeItemAction as Action,
|
|
226
|
+
TreeItemRoot as Root
|
|
227
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
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(
|
|
6
|
+
return /* @__PURE__ */ jsx(AkVisuallyHidden, { ...props, ref: forwardedRef });
|
|
7
7
|
}
|
|
8
8
|
);
|
|
9
9
|
DEV: VisuallyHidden.displayName = "VisuallyHidden";
|
package/dist/DEV/bricks/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root } from "./Root.js";
|
|
3
3
|
import { Anchor } from "./Anchor.js";
|
|
4
|
+
import { Avatar } from "./Avatar.js";
|
|
5
|
+
import { Badge } from "./Badge.js";
|
|
4
6
|
import { Button } from "./Button.js";
|
|
5
7
|
import { Checkbox } from "./Checkbox.js";
|
|
8
|
+
import { Chip } from "./Chip.js";
|
|
9
|
+
import { Description } from "./Description.js";
|
|
6
10
|
import * as DropdownMenu from "./DropdownMenu.js";
|
|
7
11
|
import { Divider } from "./Divider.js";
|
|
8
12
|
import { Icon } from "./Icon.js";
|
|
@@ -10,18 +14,26 @@ import { IconButton } from "./IconButton.js";
|
|
|
10
14
|
import { Field } from "./Field.js";
|
|
11
15
|
import { Kbd } from "./Kbd.js";
|
|
12
16
|
import { Label } from "./Label.js";
|
|
17
|
+
import { ProgressBar } from "./ProgressBar.js";
|
|
13
18
|
import { Radio } from "./Radio.js";
|
|
14
19
|
import * as Select from "./Select.js";
|
|
20
|
+
import { Spinner } from "./Spinner.js";
|
|
21
|
+
import { Skeleton } from "./Skeleton.js";
|
|
15
22
|
import { Switch } from "./Switch.js";
|
|
16
23
|
import * as Tabs from "./Tabs.js";
|
|
17
24
|
import { Text } from "./Text.js";
|
|
18
25
|
import * as TextBox from "./TextBox.js";
|
|
26
|
+
import * as Tree from "./Tree.js";
|
|
19
27
|
import { Tooltip } from "./Tooltip.js";
|
|
20
28
|
import { VisuallyHidden } from "./VisuallyHidden.js";
|
|
21
29
|
export {
|
|
22
30
|
Anchor,
|
|
31
|
+
Avatar,
|
|
32
|
+
Badge,
|
|
23
33
|
Button,
|
|
24
34
|
Checkbox,
|
|
35
|
+
Chip,
|
|
36
|
+
Description,
|
|
25
37
|
Divider,
|
|
26
38
|
DropdownMenu,
|
|
27
39
|
Field,
|
|
@@ -29,13 +41,17 @@ export {
|
|
|
29
41
|
IconButton,
|
|
30
42
|
Kbd,
|
|
31
43
|
Label,
|
|
44
|
+
ProgressBar,
|
|
32
45
|
Radio,
|
|
33
46
|
Root,
|
|
34
47
|
Select,
|
|
48
|
+
Skeleton,
|
|
49
|
+
Spinner,
|
|
35
50
|
Switch,
|
|
36
51
|
Tabs,
|
|
37
52
|
Text,
|
|
38
53
|
TextBox,
|
|
39
54
|
Tooltip,
|
|
55
|
+
Tree,
|
|
40
56
|
VisuallyHidden
|
|
41
57
|
};
|