@stratakit/structures 0.3.2 → 0.4.1
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 +128 -0
- package/dist/AccordionItem.js +10 -10
- package/dist/Banner.js +8 -8
- package/dist/Chip.js +4 -4
- package/dist/DEV/AccordionItem.js +10 -10
- package/dist/DEV/Banner.js +8 -8
- package/dist/DEV/Chip.js +4 -4
- package/dist/DEV/Dialog.js +179 -0
- package/dist/DEV/DropdownMenu.js +10 -10
- package/dist/DEV/ErrorRegion.js +12 -12
- package/dist/DEV/NavigationRail.js +213 -0
- package/dist/DEV/Table.js +7 -7
- package/dist/DEV/Tabs.js +7 -7
- package/dist/DEV/Toolbar.js +41 -18
- package/dist/DEV/Tree.js +1 -1
- package/dist/DEV/TreeItem.js +14 -14
- package/dist/DEV/index.js +4 -0
- package/dist/DEV/styles.css.js +1 -1
- package/dist/DEV/~utils.ListItem.js +3 -3
- package/dist/DEV/~utils.icons.js +1 -1
- package/dist/Dialog.d.ts +153 -0
- package/dist/Dialog.js +170 -0
- package/dist/DropdownMenu.d.ts +8 -8
- package/dist/DropdownMenu.js +9 -9
- package/dist/ErrorRegion.js +12 -12
- package/dist/NavigationRail.d.ts +203 -0
- package/dist/NavigationRail.js +201 -0
- package/dist/Table.js +7 -7
- package/dist/Tabs.d.ts +9 -9
- package/dist/Tabs.js +6 -6
- package/dist/Toolbar.d.ts +21 -3
- package/dist/Toolbar.js +41 -18
- package/dist/Tree.js +1 -1
- package/dist/TreeItem.js +14 -14
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/styles.css.js +1 -1
- package/dist/~utils.ListItem.js +3 -3
- package/dist/~utils.icons.js +1 -1
- package/package.json +23 -11
package/dist/DEV/DropdownMenu.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
import cx from "classnames";
|
|
26
26
|
import { Checkmark } from "./~utils.icons.js";
|
|
27
27
|
import * as ListItem from "./~utils.ListItem.js";
|
|
28
|
-
function
|
|
28
|
+
function DropdownMenuProvider(props) {
|
|
29
29
|
const {
|
|
30
30
|
children,
|
|
31
31
|
placement,
|
|
@@ -45,7 +45,7 @@ function DropdownMenuRoot(props) {
|
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
-
DEV:
|
|
48
|
+
DEV: DropdownMenuProvider.displayName = "DropdownMenu.Provider";
|
|
49
49
|
const DropdownMenuContent = forwardRef(
|
|
50
50
|
(props, forwardedRef) => {
|
|
51
51
|
const context = useMenuContext();
|
|
@@ -61,7 +61,7 @@ const DropdownMenuContent = forwardRef(
|
|
|
61
61
|
gutter: 4,
|
|
62
62
|
style: { ...popoverProps.style, ...props.style },
|
|
63
63
|
wrapperProps: { popover: popoverProps.popover },
|
|
64
|
-
className: cx("\u{1F95D}
|
|
64
|
+
className: cx("\u{1F95D}DropdownMenu", props.className),
|
|
65
65
|
ref: forwardedRef
|
|
66
66
|
}
|
|
67
67
|
);
|
|
@@ -81,7 +81,7 @@ const DropdownMenuButton = forwardRef(
|
|
|
81
81
|
children,
|
|
82
82
|
/* @__PURE__ */ jsx(DisclosureArrow, {})
|
|
83
83
|
] }),
|
|
84
|
-
className: cx("\u{1F95D}
|
|
84
|
+
className: cx("\u{1F95D}DropdownMenuButton", props.className),
|
|
85
85
|
"data-has-popover-open": open || void 0,
|
|
86
86
|
ref: forwardedRef
|
|
87
87
|
}
|
|
@@ -106,7 +106,7 @@ const DropdownMenuItem = forwardRef(
|
|
|
106
106
|
accessibleWhenDisabled: true,
|
|
107
107
|
"aria-describedby": dotId,
|
|
108
108
|
...rest,
|
|
109
|
-
className: cx("\u{1F95D}
|
|
109
|
+
className: cx("\u{1F95D}DropdownMenuItem", props.className),
|
|
110
110
|
ref: forwardedRef
|
|
111
111
|
}
|
|
112
112
|
)
|
|
@@ -119,7 +119,7 @@ const DropdownMenuItem = forwardRef(
|
|
|
119
119
|
unstable_dot ? /* @__PURE__ */ jsx(
|
|
120
120
|
ListItem.Decoration,
|
|
121
121
|
{
|
|
122
|
-
render: /* @__PURE__ */ jsx(Dot, { id: dotId, className: "\u{1F95D}
|
|
122
|
+
render: /* @__PURE__ */ jsx(Dot, { id: dotId, className: "\u{1F95D}DropdownMenuItemDot", children: unstable_dot })
|
|
123
123
|
}
|
|
124
124
|
) : null
|
|
125
125
|
]
|
|
@@ -141,7 +141,7 @@ const DropdownMenuItemShortcuts = forwardRef((props, forwardedRef) => {
|
|
|
141
141
|
{
|
|
142
142
|
render: /* @__PURE__ */ jsx("span", {}),
|
|
143
143
|
...rest,
|
|
144
|
-
className: cx("\u{1F95D}
|
|
144
|
+
className: cx("\u{1F95D}DropdownMenuItemShortcuts", props.className),
|
|
145
145
|
ref: forwardedRef,
|
|
146
146
|
children: shortcutKeys.map(({ key, isSymbol }, index) => {
|
|
147
147
|
if (isSymbol) {
|
|
@@ -209,7 +209,7 @@ const DropdownMenuCheckboxItem = forwardRef((props, forwardedRef) => {
|
|
|
209
209
|
{
|
|
210
210
|
accessibleWhenDisabled: true,
|
|
211
211
|
...rest,
|
|
212
|
-
className: cx("\u{1F95D}
|
|
212
|
+
className: cx("\u{1F95D}DropdownMenuItem", props.className),
|
|
213
213
|
ref: forwardedRef
|
|
214
214
|
}
|
|
215
215
|
)
|
|
@@ -221,7 +221,7 @@ const DropdownMenuCheckboxItem = forwardRef((props, forwardedRef) => {
|
|
|
221
221
|
/* @__PURE__ */ jsx(
|
|
222
222
|
ListItem.Decoration,
|
|
223
223
|
{
|
|
224
|
-
render: /* @__PURE__ */ jsx(Checkmark, { className: "\u{1F95D}
|
|
224
|
+
render: /* @__PURE__ */ jsx(Checkmark, { className: "\u{1F95D}DropdownMenuCheckmark" })
|
|
225
225
|
}
|
|
226
226
|
)
|
|
227
227
|
]
|
|
@@ -234,5 +234,5 @@ export {
|
|
|
234
234
|
DropdownMenuCheckboxItem as CheckboxItem,
|
|
235
235
|
DropdownMenuContent as Content,
|
|
236
236
|
DropdownMenuItem as Item,
|
|
237
|
-
|
|
237
|
+
DropdownMenuProvider as Provider
|
|
238
238
|
};
|
package/dist/DEV/ErrorRegion.js
CHANGED
|
@@ -40,7 +40,7 @@ const ErrorRegionRoot = forwardRef(
|
|
|
40
40
|
const pulse = () => {
|
|
41
41
|
const el = containerRef.current;
|
|
42
42
|
if (!el) return;
|
|
43
|
-
const id = "--\u{1F95D}
|
|
43
|
+
const id = "--\u{1F95D}ErrorRegion-pulse";
|
|
44
44
|
const animations = el.getAnimations({ subtree: true });
|
|
45
45
|
if (animations.find((animation) => animation.id === id)) return;
|
|
46
46
|
el.animate(
|
|
@@ -87,24 +87,24 @@ const ErrorRegionRoot = forwardRef(
|
|
|
87
87
|
{
|
|
88
88
|
...rest,
|
|
89
89
|
"aria-labelledby": sectionLabelledBy,
|
|
90
|
-
className: cx("\u{1F95D}
|
|
91
|
-
"data-
|
|
92
|
-
"data-
|
|
90
|
+
className: cx("\u{1F95D}ErrorRegion", props.className),
|
|
91
|
+
"data-_sk-visible": !!label,
|
|
92
|
+
"data-_sk-expanded": open,
|
|
93
93
|
ref: forwardedRef,
|
|
94
|
-
children: /* @__PURE__ */ jsxs("div", { className: "\u{1F95D}
|
|
94
|
+
children: /* @__PURE__ */ jsxs("div", { className: "\u{1F95D}ErrorRegionContainer", ref: containerRef, children: [
|
|
95
95
|
/* @__PURE__ */ jsxs(
|
|
96
96
|
DialogDisclosure,
|
|
97
97
|
{
|
|
98
|
-
className: "\u{1F95D}
|
|
98
|
+
className: "\u{1F95D}ErrorRegionHeader",
|
|
99
99
|
render: /* @__PURE__ */ jsx(Button, { variant: "ghost" }),
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */ jsx(StatusIcon, { tone: "attention", className: "\u{1F95D}
|
|
101
|
+
/* @__PURE__ */ jsx(StatusIcon, { tone: "attention", className: "\u{1F95D}ErrorRegionIcon" }),
|
|
102
102
|
/* @__PURE__ */ jsx(
|
|
103
103
|
Text,
|
|
104
104
|
{
|
|
105
105
|
render: /* @__PURE__ */ jsx("span", {}),
|
|
106
106
|
id: labelId,
|
|
107
|
-
className: "\u{1F95D}
|
|
107
|
+
className: "\u{1F95D}ErrorRegionLabel",
|
|
108
108
|
variant: "body-sm",
|
|
109
109
|
children: label
|
|
110
110
|
}
|
|
@@ -116,7 +116,7 @@ const ErrorRegionRoot = forwardRef(
|
|
|
116
116
|
/* @__PURE__ */ jsx(
|
|
117
117
|
Dialog,
|
|
118
118
|
{
|
|
119
|
-
className: "\u{1F95D}
|
|
119
|
+
className: "\u{1F95D}ErrorRegionDialog",
|
|
120
120
|
portal: false,
|
|
121
121
|
modal: false,
|
|
122
122
|
autoFocusOnShow: false,
|
|
@@ -125,7 +125,7 @@ const ErrorRegionRoot = forwardRef(
|
|
|
125
125
|
Collection,
|
|
126
126
|
{
|
|
127
127
|
store,
|
|
128
|
-
className: "\u{1F95D}
|
|
128
|
+
className: "\u{1F95D}ErrorRegionItems",
|
|
129
129
|
role: "list",
|
|
130
130
|
children: items
|
|
131
131
|
}
|
|
@@ -153,11 +153,11 @@ const ErrorRegionItem = forwardRef(
|
|
|
153
153
|
{
|
|
154
154
|
...rest,
|
|
155
155
|
role: "listitem",
|
|
156
|
-
className: cx("\u{1F95D}
|
|
156
|
+
className: cx("\u{1F95D}ErrorRegionItem", props.className),
|
|
157
157
|
ref: forwardedRef,
|
|
158
158
|
children: [
|
|
159
159
|
/* @__PURE__ */ jsx(Text, { id: messageId, variant: "body-sm", children: message }),
|
|
160
|
-
/* @__PURE__ */ jsx("div", { className: "\u{1F95D}
|
|
160
|
+
/* @__PURE__ */ jsx("div", { className: "\u{1F95D}ErrorRegionItemActions", children: actions })
|
|
161
161
|
]
|
|
162
162
|
}
|
|
163
163
|
);
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Role } from "@ariakit/react/role";
|
|
4
|
+
import { Tooltip, VisuallyHidden } from "@stratakit/bricks";
|
|
5
|
+
import { Icon } from "@stratakit/foundations";
|
|
6
|
+
import {
|
|
7
|
+
forwardRef,
|
|
8
|
+
useEventHandlers,
|
|
9
|
+
useSafeContext
|
|
10
|
+
} from "@stratakit/foundations/secret-internals";
|
|
11
|
+
import cx from "classnames";
|
|
12
|
+
import { createStore, useStore } from "zustand";
|
|
13
|
+
function createNavigationRailStore() {
|
|
14
|
+
return createStore((set) => ({
|
|
15
|
+
collapsed: true,
|
|
16
|
+
setCollapsed: (collapsed) => set({ collapsed })
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
const NavigationRailContext = React.createContext(void 0);
|
|
20
|
+
function NavigationRailProvider(props) {
|
|
21
|
+
const [store] = React.useState(() => createNavigationRailStore());
|
|
22
|
+
return /* @__PURE__ */ jsx(NavigationRailContext.Provider, { value: store, children: props.children });
|
|
23
|
+
}
|
|
24
|
+
function useNavigationRailState(selectorFn) {
|
|
25
|
+
const store = useSafeContext(NavigationRailContext);
|
|
26
|
+
return useStore(store, selectorFn);
|
|
27
|
+
}
|
|
28
|
+
const NavigationRailRoot = forwardRef(
|
|
29
|
+
(props, forwardedRef) => {
|
|
30
|
+
return /* @__PURE__ */ jsx(NavigationRailProvider, { children: /* @__PURE__ */ jsx(NavigationRailRootInner, { ...props, ref: forwardedRef }) });
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
DEV: NavigationRailRoot.displayName = "NavigationRail.Root";
|
|
34
|
+
const NavigationRailRootInner = forwardRef(
|
|
35
|
+
(props, forwardedRef) => {
|
|
36
|
+
const collapsed = useNavigationRailState((state) => state.collapsed);
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
Role.nav,
|
|
39
|
+
{
|
|
40
|
+
...props,
|
|
41
|
+
className: cx("\u{1F95D}NavigationRail", props.className),
|
|
42
|
+
"data-_sk-expanded": collapsed ? "false" : "true",
|
|
43
|
+
ref: forwardedRef
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
DEV: NavigationRailRootInner.displayName = "NavigationRail.RootInner";
|
|
49
|
+
const NavigationRailHeader = forwardRef(
|
|
50
|
+
(props, forwardedRef) => {
|
|
51
|
+
const collapsed = useNavigationRailState((state) => state.collapsed);
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
Role.header,
|
|
54
|
+
{
|
|
55
|
+
...props,
|
|
56
|
+
className: cx("\u{1F95D}NavigationRailHeader", props.className),
|
|
57
|
+
"data-_sk-collapsed": collapsed ? "true" : void 0,
|
|
58
|
+
ref: forwardedRef
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
DEV: NavigationRailHeader.displayName = "NavigationRail.Header";
|
|
64
|
+
const NavigationRailToggleButton = forwardRef((props, forwardedRef) => {
|
|
65
|
+
const { label = "Expand navigation", ...rest } = props;
|
|
66
|
+
const collapsed = useNavigationRailState((state) => state.collapsed);
|
|
67
|
+
const setCollapsed = useNavigationRailState((state) => state.setCollapsed);
|
|
68
|
+
return /* @__PURE__ */ jsxs(
|
|
69
|
+
Role.button,
|
|
70
|
+
{
|
|
71
|
+
"aria-expanded": collapsed ? "false" : "true",
|
|
72
|
+
...rest,
|
|
73
|
+
className: cx("\u{1F95D}NavigationRailToggleButton", props.className),
|
|
74
|
+
ref: forwardedRef,
|
|
75
|
+
onClick: useEventHandlers(props.onClick, () => setCollapsed(!collapsed)),
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ jsx("svg", { width: "12", height: "12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
78
|
+
"path",
|
|
79
|
+
{
|
|
80
|
+
fill: "currentColor",
|
|
81
|
+
d: "M5.405 2.845a.75.75 0 1 0-1.06 1.06L6.439 6 4.345 8.095a.75.75 0 0 0 1.06 1.06L8.03 6.53a.75.75 0 0 0 0-1.06L5.405 2.845Z"
|
|
82
|
+
}
|
|
83
|
+
) }),
|
|
84
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: label })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
DEV: NavigationRailToggleButton.displayName = "NavigationRail.ToggleButton";
|
|
90
|
+
const NavigationRailContent = forwardRef(
|
|
91
|
+
(props, forwardedRef) => {
|
|
92
|
+
return /* @__PURE__ */ jsx(
|
|
93
|
+
Role.div,
|
|
94
|
+
{
|
|
95
|
+
...props,
|
|
96
|
+
className: cx("\u{1F95D}NavigationRailContent", props.className),
|
|
97
|
+
ref: forwardedRef
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
DEV: NavigationRailContent.displayName = "NavigationRail.Content";
|
|
103
|
+
const NavigationRailList = forwardRef(
|
|
104
|
+
(props, forwardedRef) => {
|
|
105
|
+
return /* @__PURE__ */ jsx(
|
|
106
|
+
Role,
|
|
107
|
+
{
|
|
108
|
+
role: "list",
|
|
109
|
+
...props,
|
|
110
|
+
className: cx("\u{1F95D}NavigationRailList", props.className),
|
|
111
|
+
ref: forwardedRef
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
DEV: NavigationRailList.displayName = "NavigationRail.List";
|
|
117
|
+
const NavigationRailListItem = forwardRef(
|
|
118
|
+
(props, forwardedRef) => {
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
Role.div,
|
|
121
|
+
{
|
|
122
|
+
role: "listitem",
|
|
123
|
+
...props,
|
|
124
|
+
className: cx("\u{1F95D}NavigationRailListItem", props.className),
|
|
125
|
+
ref: forwardedRef
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
DEV: NavigationRailListItem.displayName = "NavigationRail.Item";
|
|
131
|
+
const NavigationRailItemAction = forwardRef((props, forwardedRef) => {
|
|
132
|
+
const collapsed = useNavigationRailState((state) => state.collapsed);
|
|
133
|
+
const { label, icon, ...rest } = props;
|
|
134
|
+
DEV: if (!label || !icon) throw new Error("label and icon are required");
|
|
135
|
+
const action = /* @__PURE__ */ jsxs(
|
|
136
|
+
Role,
|
|
137
|
+
{
|
|
138
|
+
...rest,
|
|
139
|
+
className: cx("\u{1F95D}NavigationRailItemAction", props.className),
|
|
140
|
+
ref: forwardedRef,
|
|
141
|
+
children: [
|
|
142
|
+
typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { href: icon }) : icon,
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
Role.span,
|
|
145
|
+
{
|
|
146
|
+
className: "\u{1F95D}NavigationRailItemActionLabel",
|
|
147
|
+
render: collapsed ? /* @__PURE__ */ jsx(VisuallyHidden, {}) : void 0,
|
|
148
|
+
children: label
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
if (collapsed) {
|
|
155
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: label, placement: "right", type: "none", children: action });
|
|
156
|
+
}
|
|
157
|
+
return action;
|
|
158
|
+
});
|
|
159
|
+
DEV: NavigationRailItemAction.displayName = "NavigationRail.ItemAction";
|
|
160
|
+
const NavigationRailAnchor = forwardRef(
|
|
161
|
+
(props, forwardedRef) => {
|
|
162
|
+
const { label, icon, active, ...rest } = props;
|
|
163
|
+
return /* @__PURE__ */ jsx(
|
|
164
|
+
NavigationRailItemAction,
|
|
165
|
+
{
|
|
166
|
+
label,
|
|
167
|
+
icon,
|
|
168
|
+
"aria-current": active ? "page" : void 0,
|
|
169
|
+
render: /* @__PURE__ */ jsx(Role.a, { ...rest, ref: forwardedRef })
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
DEV: NavigationRailAnchor.displayName = "NavigationRail.Anchor";
|
|
175
|
+
const NavigationRailButton = forwardRef(
|
|
176
|
+
(props, forwardedRef) => {
|
|
177
|
+
const { label, icon, ...rest } = props;
|
|
178
|
+
return /* @__PURE__ */ jsx(
|
|
179
|
+
NavigationRailItemAction,
|
|
180
|
+
{
|
|
181
|
+
label,
|
|
182
|
+
icon,
|
|
183
|
+
render: /* @__PURE__ */ jsx(Role.button, { ...rest, ref: forwardedRef })
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
DEV: NavigationRailButton.displayName = "NavigationRail.Button";
|
|
189
|
+
const NavigationRailFooter = forwardRef(
|
|
190
|
+
(props, forwardedRef) => {
|
|
191
|
+
return /* @__PURE__ */ jsx(
|
|
192
|
+
Role,
|
|
193
|
+
{
|
|
194
|
+
render: /* @__PURE__ */ jsx("footer", {}),
|
|
195
|
+
...props,
|
|
196
|
+
className: cx("\u{1F95D}NavigationRailFooter", props.className),
|
|
197
|
+
ref: forwardedRef
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
DEV: NavigationRailFooter.displayName = "NavigationRail.Footer";
|
|
203
|
+
export {
|
|
204
|
+
NavigationRailAnchor as Anchor,
|
|
205
|
+
NavigationRailButton as Button,
|
|
206
|
+
NavigationRailContent as Content,
|
|
207
|
+
NavigationRailFooter as Footer,
|
|
208
|
+
NavigationRailHeader as Header,
|
|
209
|
+
NavigationRailList as List,
|
|
210
|
+
NavigationRailListItem as ListItem,
|
|
211
|
+
NavigationRailRoot as Root,
|
|
212
|
+
NavigationRailToggleButton as ToggleButton
|
|
213
|
+
};
|
package/dist/DEV/Table.js
CHANGED
|
@@ -20,7 +20,7 @@ const HtmlTable = forwardRef((props, forwardedRef) => {
|
|
|
20
20
|
render: /* @__PURE__ */ jsx("table", {}),
|
|
21
21
|
...props,
|
|
22
22
|
ref: forwardedRef,
|
|
23
|
-
className: cx("\u{1F95D}
|
|
23
|
+
className: cx("\u{1F95D}Table", props.className)
|
|
24
24
|
}
|
|
25
25
|
) });
|
|
26
26
|
});
|
|
@@ -39,7 +39,7 @@ const CustomTable = forwardRef(
|
|
|
39
39
|
"aria-labelledby": captionId,
|
|
40
40
|
...props,
|
|
41
41
|
ref: forwardedRef,
|
|
42
|
-
className: cx("\u{1F95D}
|
|
42
|
+
className: cx("\u{1F95D}Table", props.className)
|
|
43
43
|
}
|
|
44
44
|
) });
|
|
45
45
|
}
|
|
@@ -57,7 +57,7 @@ const TableHeader = forwardRef(
|
|
|
57
57
|
role,
|
|
58
58
|
...props,
|
|
59
59
|
ref: forwardedRef,
|
|
60
|
-
className: cx("\u{1F95D}
|
|
60
|
+
className: cx("\u{1F95D}TableHeader", props.className)
|
|
61
61
|
}
|
|
62
62
|
) });
|
|
63
63
|
}
|
|
@@ -73,7 +73,7 @@ const TableBody = forwardRef((props, forwardedRef) => {
|
|
|
73
73
|
role: void 0,
|
|
74
74
|
...props,
|
|
75
75
|
ref: forwardedRef,
|
|
76
|
-
className: cx("\u{1F95D}
|
|
76
|
+
className: cx("\u{1F95D}TableBody", props.className)
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
79
|
});
|
|
@@ -89,7 +89,7 @@ const TableRow = forwardRef((props, forwardedRef) => {
|
|
|
89
89
|
role,
|
|
90
90
|
...props,
|
|
91
91
|
ref: forwardedRef,
|
|
92
|
-
className: cx("\u{1F95D}
|
|
92
|
+
className: cx("\u{1F95D}TableRow", props.className)
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
95
|
});
|
|
@@ -113,7 +113,7 @@ const TableCaption = forwardRef(
|
|
|
113
113
|
...rest,
|
|
114
114
|
id,
|
|
115
115
|
ref: useMergedRefs(forwardedRef, captionIdRef),
|
|
116
|
-
className: cx("\u{1F95D}
|
|
116
|
+
className: cx("\u{1F95D}TableCaption", props.className)
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
119
|
}
|
|
@@ -135,7 +135,7 @@ const TableCell = forwardRef((props, forwardedRef) => {
|
|
|
135
135
|
role,
|
|
136
136
|
...props,
|
|
137
137
|
ref: forwardedRef,
|
|
138
|
-
className: cx("\u{1F95D}
|
|
138
|
+
className: cx("\u{1F95D}TableCell", props.className)
|
|
139
139
|
}
|
|
140
140
|
);
|
|
141
141
|
});
|
package/dist/DEV/Tabs.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import cx from "classnames";
|
|
10
10
|
const supportsAnchorPositioning = isBrowser && CSS?.supports("anchor-name: --foo");
|
|
11
11
|
const prefersReducedMotion = () => isBrowser && window.matchMedia("(prefers-reduced-motion)").matches;
|
|
12
|
-
function
|
|
12
|
+
function TabsProvider(props) {
|
|
13
13
|
const {
|
|
14
14
|
defaultSelectedId,
|
|
15
15
|
selectedId,
|
|
@@ -57,15 +57,15 @@ function Tabs(props) {
|
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
|
-
DEV:
|
|
60
|
+
DEV: TabsProvider.displayName = "Tabs.Provider";
|
|
61
61
|
const TabList = forwardRef((props, forwardedRef) => {
|
|
62
62
|
const { tone = "neutral", ...rest } = props;
|
|
63
63
|
return /* @__PURE__ */ jsx(
|
|
64
64
|
AkTab.TabList,
|
|
65
65
|
{
|
|
66
66
|
...rest,
|
|
67
|
-
"data-
|
|
68
|
-
className: cx("\u{1F95D}
|
|
67
|
+
"data-_sk-tone": tone,
|
|
68
|
+
className: cx("\u{1F95D}TabList", props.className),
|
|
69
69
|
ref: forwardedRef
|
|
70
70
|
}
|
|
71
71
|
);
|
|
@@ -77,7 +77,7 @@ const Tab = forwardRef((props, forwardedRef) => {
|
|
|
77
77
|
{
|
|
78
78
|
accessibleWhenDisabled: true,
|
|
79
79
|
...props,
|
|
80
|
-
className: cx("\u{1F95D}
|
|
80
|
+
className: cx("\u{1F95D}Tab", props.className),
|
|
81
81
|
ref: forwardedRef
|
|
82
82
|
}
|
|
83
83
|
);
|
|
@@ -88,14 +88,14 @@ const TabPanel = forwardRef((props, forwardedRef) => {
|
|
|
88
88
|
AkTab.TabPanel,
|
|
89
89
|
{
|
|
90
90
|
...props,
|
|
91
|
-
className: cx("\u{1F95D}
|
|
91
|
+
className: cx("\u{1F95D}TabPanel", props.className),
|
|
92
92
|
ref: forwardedRef
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
95
|
});
|
|
96
96
|
DEV: TabPanel.displayName = "Tabs.TabPanel";
|
|
97
97
|
export {
|
|
98
|
-
|
|
98
|
+
TabsProvider as Provider,
|
|
99
99
|
Tab,
|
|
100
100
|
TabList,
|
|
101
101
|
TabPanel
|
package/dist/DEV/Toolbar.js
CHANGED
|
@@ -1,29 +1,52 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as Toolbar from "@ariakit/react/toolbar";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
IconButtonContext,
|
|
6
|
+
TooltipContext
|
|
7
|
+
} from "@stratakit/bricks/secret-internals";
|
|
5
8
|
import { forwardRef } from "@stratakit/foundations/secret-internals";
|
|
6
9
|
import cx from "classnames";
|
|
7
|
-
const ToolbarGroup = forwardRef(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
const ToolbarGroup = forwardRef(
|
|
11
|
+
(props, forwardedRef) => {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
IconButtonContext.Provider,
|
|
14
|
+
{
|
|
15
|
+
value: React.useMemo(() => ({ iconSize: "large" }), []),
|
|
16
|
+
children: /* @__PURE__ */ jsx(
|
|
17
|
+
TooltipContext.Provider,
|
|
18
|
+
{
|
|
19
|
+
value: React.useMemo(
|
|
20
|
+
() => ({
|
|
21
|
+
placement: props.orientation === "vertical" ? "right" : "top"
|
|
22
|
+
}),
|
|
23
|
+
[props.orientation]
|
|
24
|
+
),
|
|
25
|
+
children: /* @__PURE__ */ jsx(
|
|
26
|
+
Toolbar.Toolbar,
|
|
27
|
+
{
|
|
28
|
+
...props,
|
|
29
|
+
className: cx("\u{1F95D}Toolbar", props.className),
|
|
30
|
+
ref: forwardedRef
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
23
39
|
DEV: ToolbarGroup.displayName = "Toolbar.Group";
|
|
24
40
|
const ToolbarItem = forwardRef(
|
|
25
41
|
(props, forwardedRef) => {
|
|
26
|
-
return /* @__PURE__ */ jsx(
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
Toolbar.ToolbarItem,
|
|
44
|
+
{
|
|
45
|
+
...props,
|
|
46
|
+
className: cx("\u{1F95D}ToolbarItem", props.className),
|
|
47
|
+
ref: forwardedRef
|
|
48
|
+
}
|
|
49
|
+
);
|
|
27
50
|
}
|
|
28
51
|
);
|
|
29
52
|
DEV: ToolbarItem.displayName = "Toolbar.Item";
|
package/dist/DEV/Tree.js
CHANGED
|
@@ -12,7 +12,7 @@ const Tree = forwardRef((props, forwardedRef) => {
|
|
|
12
12
|
role: "tree",
|
|
13
13
|
...props,
|
|
14
14
|
render: /* @__PURE__ */ jsx(Composite, { store: composite }),
|
|
15
|
-
className: cx("\u{1F95D}
|
|
15
|
+
className: cx("\u{1F95D}Tree", props.className),
|
|
16
16
|
ref: forwardedRef,
|
|
17
17
|
children: props.children
|
|
18
18
|
}
|
package/dist/DEV/TreeItem.js
CHANGED
|
@@ -156,7 +156,7 @@ const TreeItemRoot = React.memo(
|
|
|
156
156
|
const style = React.useMemo(
|
|
157
157
|
() => ({
|
|
158
158
|
...styleProp,
|
|
159
|
-
"--\u{1F95D}
|
|
159
|
+
"--\u{1F95D}TreeItem-level": level
|
|
160
160
|
}),
|
|
161
161
|
[styleProp, level]
|
|
162
162
|
);
|
|
@@ -173,7 +173,7 @@ const TreeItemRoot = React.memo(
|
|
|
173
173
|
"aria-labelledby": labelId,
|
|
174
174
|
"aria-describedby": describedBy,
|
|
175
175
|
"aria-level": level,
|
|
176
|
-
className: cx("\u{1F95D}
|
|
176
|
+
className: cx("\u{1F95D}TreeItem", props.className),
|
|
177
177
|
style,
|
|
178
178
|
ref: forwardedRef
|
|
179
179
|
}
|
|
@@ -210,10 +210,10 @@ const TreeItemNode = React.memo((props) => {
|
|
|
210
210
|
return /* @__PURE__ */ jsxs(
|
|
211
211
|
ListItem.Root,
|
|
212
212
|
{
|
|
213
|
-
"data-
|
|
214
|
-
"data-
|
|
215
|
-
"data-
|
|
216
|
-
className: "\u{1F95D}
|
|
213
|
+
"data-_sk-expanded": expanded,
|
|
214
|
+
"data-_sk-selected": selected,
|
|
215
|
+
"data-_sk-error": error ? true : void 0,
|
|
216
|
+
className: "\u{1F95D}TreeItemNode",
|
|
217
217
|
role: void 0,
|
|
218
218
|
ref,
|
|
219
219
|
children: [
|
|
@@ -240,7 +240,7 @@ function TreeItemDecoration() {
|
|
|
240
240
|
return icon || decorations ? /* @__PURE__ */ jsx(
|
|
241
241
|
Role,
|
|
242
242
|
{
|
|
243
|
-
className: "\u{1F95D}
|
|
243
|
+
className: "\u{1F95D}TreeItemDecoration",
|
|
244
244
|
id: decorationId,
|
|
245
245
|
render: React.isValidElement(icon) ? icon : typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { href: icon }) : void 0,
|
|
246
246
|
children: !icon ? decorations : null
|
|
@@ -251,13 +251,13 @@ DEV: TreeItemDecoration.displayName = "TreeItemDecoration";
|
|
|
251
251
|
const TreeItemContent = React.memo(() => {
|
|
252
252
|
const labelId = React.useContext(TreeItemLabelIdContext);
|
|
253
253
|
const label = React.useContext(TreeItemLabelContext);
|
|
254
|
-
return /* @__PURE__ */ jsx(ListItem.Content, { id: labelId, className: "\u{1F95D}
|
|
254
|
+
return /* @__PURE__ */ jsx(ListItem.Content, { id: labelId, className: "\u{1F95D}TreeItemContent", children: label });
|
|
255
255
|
});
|
|
256
256
|
DEV: TreeItemContent.displayName = "TreeItemContent";
|
|
257
257
|
const TreeItemDescription = React.memo(() => {
|
|
258
258
|
const description = React.useContext(TreeItemDescriptionContext);
|
|
259
259
|
const descriptionId = React.useContext(TreeItemDescriptionIdContext);
|
|
260
|
-
return description ? /* @__PURE__ */ jsx(ListItem.Content, { id: descriptionId, className: "\u{1F95D}
|
|
260
|
+
return description ? /* @__PURE__ */ jsx(ListItem.Content, { id: descriptionId, className: "\u{1F95D}TreeItemDescription", children: description }) : void 0;
|
|
261
261
|
});
|
|
262
262
|
DEV: TreeItemDescription.displayName = "TreeItemDescription";
|
|
263
263
|
const TreeItemActions = React.memo(
|
|
@@ -271,7 +271,7 @@ const TreeItemActions = React.memo(
|
|
|
271
271
|
props.onKeyDown,
|
|
272
272
|
(e) => e.stopPropagation()
|
|
273
273
|
),
|
|
274
|
-
className: cx("\u{1F95D}
|
|
274
|
+
className: cx("\u{1F95D}TreeItemActionsContainer", props.className),
|
|
275
275
|
ref: forwardedRef,
|
|
276
276
|
render: /* @__PURE__ */ jsx(Toolbar, { focusLoop: false }),
|
|
277
277
|
children: [
|
|
@@ -305,7 +305,7 @@ const TreeItemActionMenu = React.memo(
|
|
|
305
305
|
}
|
|
306
306
|
}, []);
|
|
307
307
|
if (!displayMenu) return null;
|
|
308
|
-
return /* @__PURE__ */ jsx(PopoverProvider, { placement: "right-start", children: /* @__PURE__ */ jsxs(DropdownMenu.
|
|
308
|
+
return /* @__PURE__ */ jsx(PopoverProvider, { placement: "right-start", children: /* @__PURE__ */ jsxs(DropdownMenu.Provider, { open, setOpen, children: [
|
|
309
309
|
/* @__PURE__ */ jsx(
|
|
310
310
|
DropdownMenu.Button,
|
|
311
311
|
{
|
|
@@ -386,8 +386,8 @@ const TreeItemInlineAction = React.memo(
|
|
|
386
386
|
render: /* @__PURE__ */ jsx(ToolbarItem, { render: props.render }),
|
|
387
387
|
dot,
|
|
388
388
|
variant: "ghost",
|
|
389
|
-
className: cx("\u{1F95D}
|
|
390
|
-
"data-
|
|
389
|
+
className: cx("\u{1F95D}TreeItemAction", props.className),
|
|
390
|
+
"data-_sk-visible": visible,
|
|
391
391
|
ref: forwardedRef
|
|
392
392
|
}
|
|
393
393
|
);
|
|
@@ -403,7 +403,7 @@ const TreeItemExpander = forwardRef(
|
|
|
403
403
|
"aria-hidden": "true",
|
|
404
404
|
...props,
|
|
405
405
|
onClick: useEventHandlers(props.onClick, (e) => e.stopPropagation()),
|
|
406
|
-
className: cx("\u{1F95D}
|
|
406
|
+
className: cx("\u{1F95D}TreeItemExpander", props.className),
|
|
407
407
|
variant: "ghost",
|
|
408
408
|
ref: forwardedRef,
|
|
409
409
|
children: /* @__PURE__ */ jsx(ChevronDown, {})
|
package/dist/DEV/index.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import * as unstable_AccordionItem from "./AccordionItem.js";
|
|
3
3
|
import { default as default2 } from "./Banner.js";
|
|
4
4
|
import { default as default3 } from "./Chip.js";
|
|
5
|
+
import * as unstable_Dialog from "./Dialog.js";
|
|
5
6
|
import * as DropdownMenu from "./DropdownMenu.js";
|
|
6
7
|
import * as unstable_ErrorRegion from "./ErrorRegion.js";
|
|
8
|
+
import * as unstable_NavigationRail from "./NavigationRail.js";
|
|
7
9
|
import * as Table from "./Table.js";
|
|
8
10
|
import * as Tabs from "./Tabs.js";
|
|
9
11
|
import * as unstable_Toolbar from "./Toolbar.js";
|
|
@@ -16,6 +18,8 @@ export {
|
|
|
16
18
|
Tree,
|
|
17
19
|
unstable_AccordionItem,
|
|
18
20
|
default2 as unstable_Banner,
|
|
21
|
+
unstable_Dialog,
|
|
19
22
|
unstable_ErrorRegion,
|
|
23
|
+
unstable_NavigationRail,
|
|
20
24
|
unstable_Toolbar
|
|
21
25
|
};
|