@cloudvoyant/helix-react 0.11.0-rc.202608270956.10f653f
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/dist/index.cjs +1425 -0
- package/dist/index.d.cts +250 -0
- package/dist/index.d.ts +250 -0
- package/dist/index.js +1418 -0
- package/package.json +46 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1418 @@
|
|
|
1
|
+
// src/button.tsx
|
|
2
|
+
import { ark } from "@ark-ui/react/factory";
|
|
3
|
+
import { buttonVariants, cn } from "@cloudvoyant/helix";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function Button({ className, variant, color, size, type = "button", ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(ark.button, { type, className: cn(buttonVariants({ variant, color, size }), className), ...props });
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// src/toggle-button.tsx
|
|
10
|
+
import { ToggleRoot, ToggleIndicator } from "@ark-ui/react/toggle";
|
|
11
|
+
import { toggleButtonVariants, cn as cn2 } from "@cloudvoyant/helix";
|
|
12
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
13
|
+
function ToggleButton({ className, variant, size, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx2(ToggleRoot, { className: cn2(toggleButtonVariants({ variant, size }), className), ...props });
|
|
15
|
+
}
|
|
16
|
+
function ToggleButtonIndicator(props) {
|
|
17
|
+
return /* @__PURE__ */ jsx2(ToggleIndicator, { ...props });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/badge.tsx
|
|
21
|
+
import { ark as ark2 } from "@ark-ui/react/factory";
|
|
22
|
+
import { badgeVariants, cn as cn3 } from "@cloudvoyant/helix";
|
|
23
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
24
|
+
function Badge({ className, variant, color, size, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx3(ark2.span, { className: cn3(badgeVariants({ variant, color, size }), className), ...props });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/container.tsx
|
|
29
|
+
import { ark as ark3 } from "@ark-ui/react/factory";
|
|
30
|
+
import { containerBase, cn as cn4 } from "@cloudvoyant/helix";
|
|
31
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
32
|
+
function Container({ className, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx4(ark3.div, { className: cn4(containerBase, className), ...props });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/row.tsx
|
|
37
|
+
import { ark as ark4 } from "@ark-ui/react/factory";
|
|
38
|
+
import { rowBase, cn as cn5 } from "@cloudvoyant/helix";
|
|
39
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
40
|
+
function Row({ className, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsx5(ark4.div, { className: cn5(rowBase, className), ...props });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/col.tsx
|
|
45
|
+
import { ark as ark5 } from "@ark-ui/react/factory";
|
|
46
|
+
import { colBase, cn as cn6 } from "@cloudvoyant/helix";
|
|
47
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
48
|
+
function Col({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx6(ark5.div, { className: cn6(colBase, className), ...props });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/center.tsx
|
|
53
|
+
import { ark as ark6 } from "@ark-ui/react/factory";
|
|
54
|
+
import { centerBase, cn as cn7 } from "@cloudvoyant/helix";
|
|
55
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
56
|
+
function Center({ className, ...props }) {
|
|
57
|
+
return /* @__PURE__ */ jsx7(ark6.div, { className: cn7(centerBase, className), ...props });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// src/item.tsx
|
|
61
|
+
import { ark as ark7 } from "@ark-ui/react/factory";
|
|
62
|
+
import { itemVariants, cn as cn8 } from "@cloudvoyant/helix";
|
|
63
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
64
|
+
function Item({ className, variant, ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx8(ark7.div, { className: cn8(itemVariants({ variant }), className), ...props });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/card/root.tsx
|
|
69
|
+
import { ark as ark8 } from "@ark-ui/react/factory";
|
|
70
|
+
import { cardVariants, cn as cn9 } from "@cloudvoyant/helix";
|
|
71
|
+
|
|
72
|
+
// src/card/context.ts
|
|
73
|
+
import { createContext, useContext } from "react";
|
|
74
|
+
var CardOrientationContext = createContext("vertical");
|
|
75
|
+
function useCardOrientation() {
|
|
76
|
+
return useContext(CardOrientationContext);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/card/root.tsx
|
|
80
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
81
|
+
function Card({ className, variant, size, orientation, children, ...props }) {
|
|
82
|
+
const resolvedOrientation = orientation ?? "vertical";
|
|
83
|
+
return /* @__PURE__ */ jsx9(CardOrientationContext.Provider, { value: resolvedOrientation, children: /* @__PURE__ */ jsx9(ark8.div, { className: cn9(cardVariants({ variant, size, orientation: resolvedOrientation }), className), ...props, children }) });
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/card/header.tsx
|
|
87
|
+
import { ark as ark9 } from "@ark-ui/react/factory";
|
|
88
|
+
import { cardHeaderBase, cn as cn10 } from "@cloudvoyant/helix";
|
|
89
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
90
|
+
function CardHeader({ className, ...props }) {
|
|
91
|
+
return /* @__PURE__ */ jsx10(ark9.div, { className: cn10(cardHeaderBase, className), ...props });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// src/card/body.tsx
|
|
95
|
+
import { ark as ark10 } from "@ark-ui/react/factory";
|
|
96
|
+
import { cardBodyBase, cn as cn11 } from "@cloudvoyant/helix";
|
|
97
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
98
|
+
function CardBody({ className, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsx11(ark10.div, { className: cn11(cardBodyBase, className), ...props });
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// src/card/footer.tsx
|
|
103
|
+
import { ark as ark11 } from "@ark-ui/react/factory";
|
|
104
|
+
import { cardFooterBase, cn as cn12 } from "@cloudvoyant/helix";
|
|
105
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
106
|
+
function CardFooter({ className, ...props }) {
|
|
107
|
+
return /* @__PURE__ */ jsx12(ark11.div, { className: cn12(cardFooterBase, className), ...props });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// src/card/title.tsx
|
|
111
|
+
import { ark as ark12 } from "@ark-ui/react/factory";
|
|
112
|
+
import { cardTitleBase, cn as cn13 } from "@cloudvoyant/helix";
|
|
113
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
114
|
+
function CardTitle({ className, ...props }) {
|
|
115
|
+
return /* @__PURE__ */ jsx13(ark12.h3, { className: cn13(cardTitleBase, className), ...props });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// src/card/description.tsx
|
|
119
|
+
import { ark as ark13 } from "@ark-ui/react/factory";
|
|
120
|
+
import { cardDescriptionBase, cn as cn14 } from "@cloudvoyant/helix";
|
|
121
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
122
|
+
function CardDescription({ className, ...props }) {
|
|
123
|
+
return /* @__PURE__ */ jsx14(ark13.p, { className: cn14(cardDescriptionBase, className), ...props });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// src/card/cover.tsx
|
|
127
|
+
import { ark as ark14 } from "@ark-ui/react/factory";
|
|
128
|
+
import { cardCoverVariants, cn as cn15 } from "@cloudvoyant/helix";
|
|
129
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
130
|
+
function CardCover({ className, variant, orientation, ...props }) {
|
|
131
|
+
const contextOrientation = useCardOrientation();
|
|
132
|
+
return /* @__PURE__ */ jsx15(
|
|
133
|
+
ark14.div,
|
|
134
|
+
{
|
|
135
|
+
className: cn15(cardCoverVariants({ variant, orientation: orientation ?? contextOrientation }), className),
|
|
136
|
+
...props
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// src/stack.tsx
|
|
142
|
+
import { ark as ark15 } from "@ark-ui/react/factory";
|
|
143
|
+
import { stackBase, hstackBase, vstackBase, cn as cn16 } from "@cloudvoyant/helix";
|
|
144
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
145
|
+
function Stack({ className, ...props }) {
|
|
146
|
+
return /* @__PURE__ */ jsx16(ark15.div, { className: cn16(stackBase, className), ...props });
|
|
147
|
+
}
|
|
148
|
+
function HStack({ className, ...props }) {
|
|
149
|
+
return /* @__PURE__ */ jsx16(ark15.div, { className: cn16(hstackBase, className), ...props });
|
|
150
|
+
}
|
|
151
|
+
function VStack({ className, ...props }) {
|
|
152
|
+
return /* @__PURE__ */ jsx16(ark15.div, { className: cn16(vstackBase, className), ...props });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// src/scroll.tsx
|
|
156
|
+
import {
|
|
157
|
+
ScrollAreaRoot as ArkRoot,
|
|
158
|
+
ScrollAreaViewport as ArkViewport,
|
|
159
|
+
ScrollAreaContent as ArkContent,
|
|
160
|
+
ScrollAreaScrollbar as ArkScrollbar,
|
|
161
|
+
ScrollAreaThumb as ArkThumb,
|
|
162
|
+
ScrollAreaCorner as ArkCorner
|
|
163
|
+
} from "@ark-ui/react/scroll-area";
|
|
164
|
+
import {
|
|
165
|
+
scrollRootBase,
|
|
166
|
+
scrollViewportBase,
|
|
167
|
+
scrollContentBase,
|
|
168
|
+
scrollScrollbarBase,
|
|
169
|
+
scrollThumbBase,
|
|
170
|
+
scrollCornerBase,
|
|
171
|
+
cn as cn17
|
|
172
|
+
} from "@cloudvoyant/helix";
|
|
173
|
+
import { jsx as jsx17, jsxs } from "react/jsx-runtime";
|
|
174
|
+
function Scroll({
|
|
175
|
+
className,
|
|
176
|
+
orientation = "vertical",
|
|
177
|
+
contentClassName,
|
|
178
|
+
thumbClassName,
|
|
179
|
+
viewportClassName,
|
|
180
|
+
children,
|
|
181
|
+
...props
|
|
182
|
+
}) {
|
|
183
|
+
return /* @__PURE__ */ jsxs(ArkRoot, { className: cn17(scrollRootBase, className), ...props, children: [
|
|
184
|
+
/* @__PURE__ */ jsx17(ArkViewport, { className: cn17(scrollViewportBase, viewportClassName), children: /* @__PURE__ */ jsx17(ArkContent, { className: cn17(scrollContentBase, contentClassName), children }) }),
|
|
185
|
+
(orientation === "vertical" || orientation === "both") && /* @__PURE__ */ jsx17(ArkScrollbar, { orientation: "vertical", className: scrollScrollbarBase, children: /* @__PURE__ */ jsx17(ArkThumb, { className: cn17(scrollThumbBase, thumbClassName) }) }),
|
|
186
|
+
(orientation === "horizontal" || orientation === "both") && /* @__PURE__ */ jsx17(ArkScrollbar, { orientation: "horizontal", className: scrollScrollbarBase, children: /* @__PURE__ */ jsx17(ArkThumb, { className: cn17(scrollThumbBase, thumbClassName) }) }),
|
|
187
|
+
orientation === "both" && /* @__PURE__ */ jsx17(ArkCorner, { className: scrollCornerBase })
|
|
188
|
+
] });
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// src/splitter.tsx
|
|
192
|
+
import {
|
|
193
|
+
SplitterRoot as ArkSplitterRoot,
|
|
194
|
+
SplitterPanel as ArkSplitterPanel,
|
|
195
|
+
SplitterResizeTrigger as ArkSplitterResizeTrigger,
|
|
196
|
+
SplitterResizeTriggerIndicator as ArkSplitterResizeTriggerIndicator
|
|
197
|
+
} from "@ark-ui/react/splitter";
|
|
198
|
+
import {
|
|
199
|
+
splitterRootBase,
|
|
200
|
+
splitterPanelBase,
|
|
201
|
+
splitterResizeTriggerBase,
|
|
202
|
+
splitterResizeTriggerSeparatorBase,
|
|
203
|
+
splitterResizeTriggerIndicatorBase,
|
|
204
|
+
cn as cn18
|
|
205
|
+
} from "@cloudvoyant/helix";
|
|
206
|
+
import { jsx as jsx18, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
207
|
+
function Splitter({ className, ...props }) {
|
|
208
|
+
return /* @__PURE__ */ jsx18(ArkSplitterRoot, { className: cn18(splitterRootBase, className), ...props });
|
|
209
|
+
}
|
|
210
|
+
function SplitterPanel({ className, ...props }) {
|
|
211
|
+
return /* @__PURE__ */ jsx18(ArkSplitterPanel, { className: cn18(splitterPanelBase, className), ...props });
|
|
212
|
+
}
|
|
213
|
+
function SplitterResizeTrigger({ className, children, ...props }) {
|
|
214
|
+
return /* @__PURE__ */ jsxs2(ArkSplitterResizeTrigger, { className: cn18(splitterResizeTriggerBase, className), ...props, children: [
|
|
215
|
+
/* @__PURE__ */ jsx18("span", { "aria-hidden": true, "data-part": "separator", className: splitterResizeTriggerSeparatorBase }),
|
|
216
|
+
children
|
|
217
|
+
] });
|
|
218
|
+
}
|
|
219
|
+
function SplitterResizeTriggerIndicator({
|
|
220
|
+
className,
|
|
221
|
+
...props
|
|
222
|
+
}) {
|
|
223
|
+
return /* @__PURE__ */ jsx18(
|
|
224
|
+
ArkSplitterResizeTriggerIndicator,
|
|
225
|
+
{
|
|
226
|
+
className: cn18(splitterResizeTriggerIndicatorBase, className),
|
|
227
|
+
...props
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// src/sidebar/Provider.tsx
|
|
233
|
+
import * as React2 from "react";
|
|
234
|
+
import { SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_KEYBOARD_SHORTCUT, sidebarStyles, cn as cn19 } from "@cloudvoyant/helix";
|
|
235
|
+
|
|
236
|
+
// src/sidebar/context.ts
|
|
237
|
+
import * as React from "react";
|
|
238
|
+
var SidebarContext = React.createContext(null);
|
|
239
|
+
function useSidebar() {
|
|
240
|
+
const context = React.useContext(SidebarContext);
|
|
241
|
+
if (!context) {
|
|
242
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
243
|
+
}
|
|
244
|
+
return context;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// src/sidebar/Provider.tsx
|
|
248
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
249
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
250
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
251
|
+
function useIsMobile() {
|
|
252
|
+
const [isMobile, setIsMobile] = React2.useState(false);
|
|
253
|
+
const [isMobileSet, setIsMobileSet] = React2.useState(false);
|
|
254
|
+
React2.useEffect(() => {
|
|
255
|
+
const mql = window.matchMedia("(max-width: 767px)");
|
|
256
|
+
const onChange = () => {
|
|
257
|
+
setIsMobile(window.innerWidth < 768);
|
|
258
|
+
setIsMobileSet(true);
|
|
259
|
+
};
|
|
260
|
+
onChange();
|
|
261
|
+
mql.addEventListener("change", onChange);
|
|
262
|
+
return () => mql.removeEventListener("change", onChange);
|
|
263
|
+
}, []);
|
|
264
|
+
return isMobile && isMobileSet;
|
|
265
|
+
}
|
|
266
|
+
function Provider({
|
|
267
|
+
defaultOpen = true,
|
|
268
|
+
open: openProp,
|
|
269
|
+
onOpenChange: setOpenProp,
|
|
270
|
+
className,
|
|
271
|
+
style,
|
|
272
|
+
children,
|
|
273
|
+
...props
|
|
274
|
+
}) {
|
|
275
|
+
const isMobile = useIsMobile();
|
|
276
|
+
const [openMobile, setOpenMobile] = React2.useState(false);
|
|
277
|
+
const [_open, _setOpen] = React2.useState(defaultOpen);
|
|
278
|
+
const open = openProp ?? _open;
|
|
279
|
+
const setOpen = React2.useCallback(
|
|
280
|
+
(value) => {
|
|
281
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
282
|
+
if (setOpenProp) {
|
|
283
|
+
setOpenProp(openState);
|
|
284
|
+
} else {
|
|
285
|
+
_setOpen(openState);
|
|
286
|
+
}
|
|
287
|
+
if (typeof document !== "undefined") {
|
|
288
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
[setOpenProp, open]
|
|
292
|
+
);
|
|
293
|
+
const toggleSidebar = React2.useCallback(() => {
|
|
294
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
295
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
296
|
+
React2.useEffect(() => {
|
|
297
|
+
if (openProp !== void 0) return;
|
|
298
|
+
if (typeof document === "undefined") return;
|
|
299
|
+
const cookie = document.cookie.split("; ").find((row) => row.startsWith(`${SIDEBAR_COOKIE_NAME}=`));
|
|
300
|
+
if (cookie) {
|
|
301
|
+
_setOpen(cookie.split("=")[1] === "true");
|
|
302
|
+
}
|
|
303
|
+
}, [openProp]);
|
|
304
|
+
React2.useEffect(() => {
|
|
305
|
+
const handleKeyDown = (event) => {
|
|
306
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
toggleSidebar();
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
312
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
313
|
+
}, [toggleSidebar]);
|
|
314
|
+
const state = open ? "expanded" : "collapsed";
|
|
315
|
+
const contextValue = React2.useMemo(
|
|
316
|
+
() => ({
|
|
317
|
+
state,
|
|
318
|
+
open,
|
|
319
|
+
setOpen,
|
|
320
|
+
isMobile,
|
|
321
|
+
openMobile,
|
|
322
|
+
setOpenMobile,
|
|
323
|
+
toggleSidebar
|
|
324
|
+
}),
|
|
325
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
326
|
+
);
|
|
327
|
+
return /* @__PURE__ */ jsx19(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx19(
|
|
328
|
+
Row,
|
|
329
|
+
{
|
|
330
|
+
"data-slot": "sidebar-wrapper",
|
|
331
|
+
style: {
|
|
332
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
333
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
334
|
+
...style
|
|
335
|
+
},
|
|
336
|
+
className: cn19(sidebarStyles.wrapperClass, className),
|
|
337
|
+
...props,
|
|
338
|
+
children
|
|
339
|
+
}
|
|
340
|
+
) });
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// src/sidebar/Root.tsx
|
|
344
|
+
import {
|
|
345
|
+
DrawerRoot,
|
|
346
|
+
DrawerBackdrop,
|
|
347
|
+
DrawerPositioner,
|
|
348
|
+
DrawerContent,
|
|
349
|
+
DrawerTitle,
|
|
350
|
+
DrawerDescription,
|
|
351
|
+
DrawerCloseTrigger
|
|
352
|
+
} from "@ark-ui/react/drawer";
|
|
353
|
+
import { SIDEBAR_WIDTH_MOBILE, sidebarStyles as sidebarStyles2, cn as cn20 } from "@cloudvoyant/helix";
|
|
354
|
+
import { jsx as jsx20, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
355
|
+
function Root({
|
|
356
|
+
side = "left",
|
|
357
|
+
variant = "sidebar",
|
|
358
|
+
collapsible = "offcanvas",
|
|
359
|
+
className,
|
|
360
|
+
children,
|
|
361
|
+
...props
|
|
362
|
+
}) {
|
|
363
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
364
|
+
if (collapsible === "none") {
|
|
365
|
+
return /* @__PURE__ */ jsx20(
|
|
366
|
+
Col,
|
|
367
|
+
{
|
|
368
|
+
"data-slot": "sidebar",
|
|
369
|
+
"data-sidebar": "sidebar",
|
|
370
|
+
className: cn20("h-full w-(--sidebar-width) bg-sidebar text-sidebar-foreground", className),
|
|
371
|
+
...props,
|
|
372
|
+
children
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
if (isMobile) {
|
|
377
|
+
return /* @__PURE__ */ jsxs3(
|
|
378
|
+
DrawerRoot,
|
|
379
|
+
{
|
|
380
|
+
open: openMobile,
|
|
381
|
+
onOpenChange: (details) => setOpenMobile(details.open),
|
|
382
|
+
...props,
|
|
383
|
+
children: [
|
|
384
|
+
/* @__PURE__ */ jsx20(DrawerBackdrop, {}),
|
|
385
|
+
/* @__PURE__ */ jsx20(DrawerPositioner, { className: "w-(--sidebar-width)", children: /* @__PURE__ */ jsxs3(
|
|
386
|
+
DrawerContent,
|
|
387
|
+
{
|
|
388
|
+
"data-sidebar": "sidebar",
|
|
389
|
+
"data-slot": "sidebar",
|
|
390
|
+
"data-mobile": "true",
|
|
391
|
+
className: cn20("w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground", className),
|
|
392
|
+
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
393
|
+
children: [
|
|
394
|
+
/* @__PURE__ */ jsx20(DrawerTitle, { className: "sr-only", children: "Sidebar" }),
|
|
395
|
+
/* @__PURE__ */ jsx20(DrawerDescription, { className: "sr-only", children: "Displays the mobile sidebar." }),
|
|
396
|
+
/* @__PURE__ */ jsx20(DrawerCloseTrigger, { className: "hidden" }),
|
|
397
|
+
/* @__PURE__ */ jsx20(Col, { className: "h-full w-full", children })
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
) })
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
return /* @__PURE__ */ jsxs3(
|
|
406
|
+
"div",
|
|
407
|
+
{
|
|
408
|
+
className: "group peer hidden text-sidebar-foreground md:block",
|
|
409
|
+
"data-state": state,
|
|
410
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
411
|
+
"data-variant": variant,
|
|
412
|
+
"data-side": side,
|
|
413
|
+
"data-slot": "sidebar",
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ jsx20(
|
|
416
|
+
"div",
|
|
417
|
+
{
|
|
418
|
+
"data-slot": "sidebar-gap",
|
|
419
|
+
className: cn20(
|
|
420
|
+
sidebarStyles2.gapClass,
|
|
421
|
+
side === "right" && "rotate-180",
|
|
422
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
423
|
+
)
|
|
424
|
+
}
|
|
425
|
+
),
|
|
426
|
+
/* @__PURE__ */ jsx20(
|
|
427
|
+
"div",
|
|
428
|
+
{
|
|
429
|
+
"data-slot": "sidebar-container",
|
|
430
|
+
className: cn20(
|
|
431
|
+
sidebarStyles2.containerClass,
|
|
432
|
+
side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
433
|
+
variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
434
|
+
className
|
|
435
|
+
),
|
|
436
|
+
...props,
|
|
437
|
+
children: /* @__PURE__ */ jsx20(
|
|
438
|
+
"div",
|
|
439
|
+
{
|
|
440
|
+
"data-sidebar": "sidebar",
|
|
441
|
+
"data-slot": "sidebar-inner",
|
|
442
|
+
"data-variant": variant,
|
|
443
|
+
className: cn20(sidebarStyles2.innerClass),
|
|
444
|
+
children
|
|
445
|
+
}
|
|
446
|
+
)
|
|
447
|
+
}
|
|
448
|
+
)
|
|
449
|
+
]
|
|
450
|
+
}
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// src/sidebar/Header.tsx
|
|
455
|
+
import { sidebarStyles as sidebarStyles3, cn as cn21 } from "@cloudvoyant/helix";
|
|
456
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
457
|
+
function Header({ className, ...props }) {
|
|
458
|
+
return /* @__PURE__ */ jsx21(
|
|
459
|
+
Col,
|
|
460
|
+
{
|
|
461
|
+
"data-slot": "sidebar-header",
|
|
462
|
+
"data-sidebar": "header",
|
|
463
|
+
className: cn21(sidebarStyles3.headerClass, className),
|
|
464
|
+
...props
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// src/sidebar/Footer.tsx
|
|
470
|
+
import { sidebarStyles as sidebarStyles4, cn as cn22 } from "@cloudvoyant/helix";
|
|
471
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
472
|
+
function Footer({ className, ...props }) {
|
|
473
|
+
return /* @__PURE__ */ jsx22(
|
|
474
|
+
Col,
|
|
475
|
+
{
|
|
476
|
+
"data-slot": "sidebar-footer",
|
|
477
|
+
"data-sidebar": "footer",
|
|
478
|
+
className: cn22(sidebarStyles4.footerClass, className),
|
|
479
|
+
...props
|
|
480
|
+
}
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// src/sidebar/Separator.tsx
|
|
485
|
+
import { ark as ark16 } from "@ark-ui/react/factory";
|
|
486
|
+
import { sidebarStyles as sidebarStyles5, cn as cn23 } from "@cloudvoyant/helix";
|
|
487
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
488
|
+
function Separator({ className, ...props }) {
|
|
489
|
+
return /* @__PURE__ */ jsx23(
|
|
490
|
+
ark16.div,
|
|
491
|
+
{
|
|
492
|
+
"data-slot": "sidebar-separator",
|
|
493
|
+
"data-sidebar": "separator",
|
|
494
|
+
role: "separator",
|
|
495
|
+
className: cn23(sidebarStyles5.separatorClass, className),
|
|
496
|
+
...props
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// src/sidebar/Content.tsx
|
|
502
|
+
import { sidebarStyles as sidebarStyles6, cn as cn24 } from "@cloudvoyant/helix";
|
|
503
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
504
|
+
function Content({ className, ...props }) {
|
|
505
|
+
return /* @__PURE__ */ jsx24(
|
|
506
|
+
Col,
|
|
507
|
+
{
|
|
508
|
+
"data-slot": "sidebar-content",
|
|
509
|
+
"data-sidebar": "content",
|
|
510
|
+
className: cn24(sidebarStyles6.contentClass, className),
|
|
511
|
+
...props
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// src/sidebar/Group.tsx
|
|
517
|
+
import { sidebarStyles as sidebarStyles7, cn as cn25 } from "@cloudvoyant/helix";
|
|
518
|
+
import { jsx as jsx25, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
519
|
+
function Group({ label, className, children, ...props }) {
|
|
520
|
+
return /* @__PURE__ */ jsxs4(Col, { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn25(sidebarStyles7.groupClass, className), ...props, children: [
|
|
521
|
+
label && /* @__PURE__ */ jsx25("div", { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn25(sidebarStyles7.groupLabelClass), children: label }),
|
|
522
|
+
/* @__PURE__ */ jsx25("div", { "data-slot": "sidebar-group-content", "data-sidebar": "group-content", className: cn25(sidebarStyles7.groupContentClass), children })
|
|
523
|
+
] });
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// src/sidebar/GroupAction.tsx
|
|
527
|
+
import { ark as ark17 } from "@ark-ui/react/factory";
|
|
528
|
+
import { sidebarStyles as sidebarStyles8, cn as cn26 } from "@cloudvoyant/helix";
|
|
529
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
530
|
+
function GroupAction({ className, asChild = false, ...props }) {
|
|
531
|
+
return /* @__PURE__ */ jsx26(
|
|
532
|
+
ark17.button,
|
|
533
|
+
{
|
|
534
|
+
"data-slot": "sidebar-group-action",
|
|
535
|
+
"data-sidebar": "group-action",
|
|
536
|
+
asChild,
|
|
537
|
+
type: "button",
|
|
538
|
+
className: cn26(sidebarStyles8.groupActionClass, className),
|
|
539
|
+
...props
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
// src/sidebar/Menu.tsx
|
|
545
|
+
import { ark as ark18 } from "@ark-ui/react/factory";
|
|
546
|
+
import { sidebarStyles as sidebarStyles9, cn as cn27 } from "@cloudvoyant/helix";
|
|
547
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
548
|
+
function Menu({ className, ...props }) {
|
|
549
|
+
return /* @__PURE__ */ jsx27(
|
|
550
|
+
ark18.ul,
|
|
551
|
+
{
|
|
552
|
+
"data-slot": "sidebar-menu",
|
|
553
|
+
"data-sidebar": "menu",
|
|
554
|
+
className: cn27(sidebarStyles9.menuClass, className),
|
|
555
|
+
...props
|
|
556
|
+
}
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// src/sidebar/MenuItem.tsx
|
|
561
|
+
import { ark as ark19 } from "@ark-ui/react/factory";
|
|
562
|
+
import { sidebarStyles as sidebarStyles10, cn as cn28 } from "@cloudvoyant/helix";
|
|
563
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
564
|
+
function MenuItem({ className, ...props }) {
|
|
565
|
+
return /* @__PURE__ */ jsx28(
|
|
566
|
+
ark19.li,
|
|
567
|
+
{
|
|
568
|
+
"data-slot": "sidebar-menu-item",
|
|
569
|
+
"data-sidebar": "menu-item",
|
|
570
|
+
className: cn28(sidebarStyles10.menuItemClass, className),
|
|
571
|
+
...props
|
|
572
|
+
}
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// src/sidebar/MenuButton.tsx
|
|
577
|
+
import { ark as ark20 } from "@ark-ui/react/factory";
|
|
578
|
+
import {
|
|
579
|
+
TooltipRoot,
|
|
580
|
+
TooltipTrigger,
|
|
581
|
+
TooltipPositioner,
|
|
582
|
+
TooltipContent as ArkTooltipContent
|
|
583
|
+
} from "@ark-ui/react/tooltip";
|
|
584
|
+
import { sidebarMenuButtonVariants, sidebarStyles as sidebarStyles11, cn as cn29 } from "@cloudvoyant/helix";
|
|
585
|
+
import { jsx as jsx29, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
586
|
+
function MenuButton({
|
|
587
|
+
asChild = false,
|
|
588
|
+
isActive = false,
|
|
589
|
+
variant = "default",
|
|
590
|
+
size = "default",
|
|
591
|
+
tooltip,
|
|
592
|
+
className,
|
|
593
|
+
children,
|
|
594
|
+
...props
|
|
595
|
+
}) {
|
|
596
|
+
const { isMobile, state } = useSidebar();
|
|
597
|
+
const button = /* @__PURE__ */ jsx29(
|
|
598
|
+
ark20.button,
|
|
599
|
+
{
|
|
600
|
+
"data-slot": "sidebar-menu-button",
|
|
601
|
+
"data-sidebar": "menu-button",
|
|
602
|
+
"data-size": size,
|
|
603
|
+
"data-active": isActive,
|
|
604
|
+
asChild,
|
|
605
|
+
type: "button",
|
|
606
|
+
className: cn29(sidebarMenuButtonVariants({ variant, size }), className),
|
|
607
|
+
...props,
|
|
608
|
+
children
|
|
609
|
+
}
|
|
610
|
+
);
|
|
611
|
+
if (!tooltip || state !== "collapsed" || isMobile) {
|
|
612
|
+
return button;
|
|
613
|
+
}
|
|
614
|
+
const tooltipContent = typeof tooltip === "string" ? { children: tooltip } : tooltip;
|
|
615
|
+
return /* @__PURE__ */ jsxs5(TooltipRoot, { openDelay: 0, positioning: { placement: "right", gutter: 8 }, children: [
|
|
616
|
+
/* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: button }),
|
|
617
|
+
/* @__PURE__ */ jsx29(TooltipPositioner, { children: /* @__PURE__ */ jsx29(ArkTooltipContent, { className: cn29(sidebarStyles11.tooltipContentClass), ...tooltipContent }) })
|
|
618
|
+
] });
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
// src/sidebar/MenuLink.tsx
|
|
622
|
+
import { sidebarStyles as sidebarStyles12, cn as cn30 } from "@cloudvoyant/helix";
|
|
623
|
+
import { Fragment, jsx as jsx30, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
624
|
+
function MenuLink({ icon, href, onClick, isActive, variant, size, tooltip, className, children }) {
|
|
625
|
+
const content = /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
626
|
+
icon,
|
|
627
|
+
children != null && /* @__PURE__ */ jsx30("span", { children })
|
|
628
|
+
] });
|
|
629
|
+
return /* @__PURE__ */ jsx30("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn30(sidebarStyles12.menuItemClass), children: href != null ? /* @__PURE__ */ jsx30(MenuButton, { asChild: true, isActive, variant, size, tooltip, className, children: /* @__PURE__ */ jsx30("a", { href, onClick, children: content }) }) : /* @__PURE__ */ jsx30(MenuButton, { isActive, variant, size, tooltip, className, onClick, children: content }) });
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// src/sidebar/MenuAction.tsx
|
|
633
|
+
import { ark as ark21 } from "@ark-ui/react/factory";
|
|
634
|
+
import { sidebarStyles as sidebarStyles13, cn as cn31 } from "@cloudvoyant/helix";
|
|
635
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
636
|
+
function MenuAction({
|
|
637
|
+
className,
|
|
638
|
+
asChild = false,
|
|
639
|
+
showOnHover = false,
|
|
640
|
+
...props
|
|
641
|
+
}) {
|
|
642
|
+
return /* @__PURE__ */ jsx31(
|
|
643
|
+
ark21.button,
|
|
644
|
+
{
|
|
645
|
+
"data-slot": "sidebar-menu-action",
|
|
646
|
+
"data-sidebar": "menu-action",
|
|
647
|
+
asChild,
|
|
648
|
+
type: "button",
|
|
649
|
+
className: cn31(
|
|
650
|
+
sidebarStyles13.menuActionClass,
|
|
651
|
+
showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0",
|
|
652
|
+
className
|
|
653
|
+
),
|
|
654
|
+
...props
|
|
655
|
+
}
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
// src/sidebar/MenuBadge.tsx
|
|
660
|
+
import { ark as ark22 } from "@ark-ui/react/factory";
|
|
661
|
+
import { sidebarStyles as sidebarStyles14, cn as cn32 } from "@cloudvoyant/helix";
|
|
662
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
663
|
+
function MenuBadge({ className, ...props }) {
|
|
664
|
+
return /* @__PURE__ */ jsx32(
|
|
665
|
+
ark22.div,
|
|
666
|
+
{
|
|
667
|
+
"data-slot": "sidebar-menu-badge",
|
|
668
|
+
"data-sidebar": "menu-badge",
|
|
669
|
+
className: cn32(sidebarStyles14.menuBadgeClass, className),
|
|
670
|
+
...props
|
|
671
|
+
}
|
|
672
|
+
);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
// src/sidebar/MenuSkeleton.tsx
|
|
676
|
+
import * as React3 from "react";
|
|
677
|
+
import { ark as ark23 } from "@ark-ui/react/factory";
|
|
678
|
+
import { sidebarStyles as sidebarStyles15, cn as cn33 } from "@cloudvoyant/helix";
|
|
679
|
+
import { jsx as jsx33, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
680
|
+
function MenuSkeleton({ className, showIcon = false, ...props }) {
|
|
681
|
+
const width = React3.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
682
|
+
return /* @__PURE__ */ jsxs7(
|
|
683
|
+
ark23.div,
|
|
684
|
+
{
|
|
685
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
686
|
+
"data-sidebar": "menu-skeleton",
|
|
687
|
+
className: cn33(sidebarStyles15.menuSkeletonClass, className),
|
|
688
|
+
...props,
|
|
689
|
+
children: [
|
|
690
|
+
showIcon && /* @__PURE__ */ jsx33(
|
|
691
|
+
ark23.div,
|
|
692
|
+
{
|
|
693
|
+
className: "size-4 shrink-0 animate-pulse rounded-md bg-sidebar-accent",
|
|
694
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
695
|
+
}
|
|
696
|
+
),
|
|
697
|
+
/* @__PURE__ */ jsx33(
|
|
698
|
+
ark23.div,
|
|
699
|
+
{
|
|
700
|
+
className: "h-4 max-w-(--skeleton-width) flex-1 animate-pulse rounded-md bg-sidebar-accent",
|
|
701
|
+
"data-sidebar": "menu-skeleton-text",
|
|
702
|
+
style: { "--skeleton-width": width }
|
|
703
|
+
}
|
|
704
|
+
)
|
|
705
|
+
]
|
|
706
|
+
}
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// src/sidebar/MenuSub.tsx
|
|
711
|
+
import { ark as ark24 } from "@ark-ui/react/factory";
|
|
712
|
+
import { sidebarStyles as sidebarStyles16, cn as cn34 } from "@cloudvoyant/helix";
|
|
713
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
714
|
+
function MenuSub({ className, ...props }) {
|
|
715
|
+
return /* @__PURE__ */ jsx34(
|
|
716
|
+
ark24.ul,
|
|
717
|
+
{
|
|
718
|
+
"data-slot": "sidebar-menu-sub",
|
|
719
|
+
"data-sidebar": "menu-sub",
|
|
720
|
+
className: cn34(sidebarStyles16.menuSubClass, className),
|
|
721
|
+
...props
|
|
722
|
+
}
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// src/sidebar/MenuSubItem.tsx
|
|
727
|
+
import { ark as ark25 } from "@ark-ui/react/factory";
|
|
728
|
+
import { sidebarStyles as sidebarStyles17, cn as cn35 } from "@cloudvoyant/helix";
|
|
729
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
730
|
+
function MenuSubItem({ className, ...props }) {
|
|
731
|
+
return /* @__PURE__ */ jsx35(
|
|
732
|
+
ark25.li,
|
|
733
|
+
{
|
|
734
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
735
|
+
"data-sidebar": "menu-sub-item",
|
|
736
|
+
className: cn35(sidebarStyles17.menuSubItemClass, className),
|
|
737
|
+
...props
|
|
738
|
+
}
|
|
739
|
+
);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
// src/sidebar/MenuSubButton.tsx
|
|
743
|
+
import { ark as ark26 } from "@ark-ui/react/factory";
|
|
744
|
+
import { sidebarStyles as sidebarStyles18, cn as cn36 } from "@cloudvoyant/helix";
|
|
745
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
746
|
+
function MenuSubButton({
|
|
747
|
+
asChild = false,
|
|
748
|
+
size = "md",
|
|
749
|
+
isActive = false,
|
|
750
|
+
className,
|
|
751
|
+
...props
|
|
752
|
+
}) {
|
|
753
|
+
return /* @__PURE__ */ jsx36(
|
|
754
|
+
ark26.a,
|
|
755
|
+
{
|
|
756
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
757
|
+
"data-sidebar": "menu-sub-button",
|
|
758
|
+
"data-size": size,
|
|
759
|
+
"data-active": isActive,
|
|
760
|
+
asChild,
|
|
761
|
+
className: cn36(sidebarStyles18.menuSubButtonClass, className),
|
|
762
|
+
...props
|
|
763
|
+
}
|
|
764
|
+
);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// src/sidebar/Trigger.tsx
|
|
768
|
+
import { ark as ark27 } from "@ark-ui/react/factory";
|
|
769
|
+
import { sidebarStyles as sidebarStyles19, cn as cn37 } from "@cloudvoyant/helix";
|
|
770
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
771
|
+
function Trigger({ className, onClick, children, ...props }) {
|
|
772
|
+
const { toggleSidebar } = useSidebar();
|
|
773
|
+
return /* @__PURE__ */ jsx37(
|
|
774
|
+
ark27.button,
|
|
775
|
+
{
|
|
776
|
+
"data-sidebar": "trigger",
|
|
777
|
+
"data-slot": "sidebar-trigger",
|
|
778
|
+
type: "button",
|
|
779
|
+
"aria-label": "Toggle Sidebar",
|
|
780
|
+
className: cn37(sidebarStyles19.triggerClass, className),
|
|
781
|
+
onClick: (event) => {
|
|
782
|
+
onClick?.(event);
|
|
783
|
+
toggleSidebar();
|
|
784
|
+
},
|
|
785
|
+
...props,
|
|
786
|
+
children
|
|
787
|
+
}
|
|
788
|
+
);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
// src/sidebar/Rail.tsx
|
|
792
|
+
import { ark as ark28 } from "@ark-ui/react/factory";
|
|
793
|
+
import { sidebarStyles as sidebarStyles20, cn as cn38 } from "@cloudvoyant/helix";
|
|
794
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
795
|
+
function Rail({ className, ...props }) {
|
|
796
|
+
const { toggleSidebar } = useSidebar();
|
|
797
|
+
return /* @__PURE__ */ jsx38(
|
|
798
|
+
ark28.button,
|
|
799
|
+
{
|
|
800
|
+
"data-sidebar": "rail",
|
|
801
|
+
"data-slot": "sidebar-rail",
|
|
802
|
+
type: "button",
|
|
803
|
+
"aria-label": "Toggle Sidebar",
|
|
804
|
+
tabIndex: -1,
|
|
805
|
+
onClick: toggleSidebar,
|
|
806
|
+
title: "Toggle Sidebar",
|
|
807
|
+
className: cn38(sidebarStyles20.railClass, className),
|
|
808
|
+
...props
|
|
809
|
+
}
|
|
810
|
+
);
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
// src/sidebar/Inset.tsx
|
|
814
|
+
import { ark as ark29 } from "@ark-ui/react/factory";
|
|
815
|
+
import { sidebarStyles as sidebarStyles21, cn as cn39 } from "@cloudvoyant/helix";
|
|
816
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
817
|
+
function Inset({ className, ...props }) {
|
|
818
|
+
return /* @__PURE__ */ jsx39(ark29.main, { "data-slot": "sidebar-inset", className: cn39(sidebarStyles21.insetClass, className), ...props });
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
// src/sidebar/Input.tsx
|
|
822
|
+
import { ark as ark30 } from "@ark-ui/react/factory";
|
|
823
|
+
import { sidebarStyles as sidebarStyles22, cn as cn40 } from "@cloudvoyant/helix";
|
|
824
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
825
|
+
function Input({ className, ...props }) {
|
|
826
|
+
return /* @__PURE__ */ jsx40(
|
|
827
|
+
ark30.input,
|
|
828
|
+
{
|
|
829
|
+
"data-slot": "sidebar-input",
|
|
830
|
+
"data-sidebar": "input",
|
|
831
|
+
className: cn40(sidebarStyles22.inputClass, className),
|
|
832
|
+
...props
|
|
833
|
+
}
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
// src/tabs.tsx
|
|
838
|
+
import {
|
|
839
|
+
TabsRoot,
|
|
840
|
+
TabList,
|
|
841
|
+
TabIndicator,
|
|
842
|
+
TabTrigger,
|
|
843
|
+
TabContent,
|
|
844
|
+
useTabsContext
|
|
845
|
+
} from "@ark-ui/react/tabs";
|
|
846
|
+
import {
|
|
847
|
+
tabsRootBase,
|
|
848
|
+
tabsListBase,
|
|
849
|
+
tabsListVariants,
|
|
850
|
+
tabsIndicatorBase,
|
|
851
|
+
tabsIndicatorVariants,
|
|
852
|
+
tabsTriggerBase,
|
|
853
|
+
tabsContentBase,
|
|
854
|
+
cn as cn41
|
|
855
|
+
} from "@cloudvoyant/helix";
|
|
856
|
+
import { jsx as jsx41, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
857
|
+
function Tabs({ className, lazyMount = true, unmountOnExit = true, ...props }) {
|
|
858
|
+
return /* @__PURE__ */ jsx41(
|
|
859
|
+
TabsRoot,
|
|
860
|
+
{
|
|
861
|
+
lazyMount,
|
|
862
|
+
unmountOnExit,
|
|
863
|
+
className: cn41(tabsRootBase, className),
|
|
864
|
+
...props
|
|
865
|
+
}
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
function TabsList({ variant = "default", className, children, ...props }) {
|
|
869
|
+
return /* @__PURE__ */ jsxs8(TabList, { className: cn41(tabsListBase, tabsListVariants({ variant }), className), ...props, children: [
|
|
870
|
+
children,
|
|
871
|
+
/* @__PURE__ */ jsx41(TabIndicator, { className: cn41(tabsIndicatorBase, tabsIndicatorVariants({ variant })) })
|
|
872
|
+
] });
|
|
873
|
+
}
|
|
874
|
+
function TabsTrigger({ className, ...props }) {
|
|
875
|
+
return /* @__PURE__ */ jsx41(TabTrigger, { className: cn41(tabsTriggerBase, className), ...props });
|
|
876
|
+
}
|
|
877
|
+
function TabsContent({ className, ...props }) {
|
|
878
|
+
return /* @__PURE__ */ jsx41(TabContent, { className: cn41(tabsContentBase, className), ...props });
|
|
879
|
+
}
|
|
880
|
+
var useTabs = useTabsContext;
|
|
881
|
+
|
|
882
|
+
// src/pagination.tsx
|
|
883
|
+
import {
|
|
884
|
+
PaginationRoot as ArkPaginationRoot,
|
|
885
|
+
PaginationContext as ArkPaginationContext,
|
|
886
|
+
PaginationItem as ArkPaginationItem,
|
|
887
|
+
PaginationPrevTrigger,
|
|
888
|
+
PaginationNextTrigger,
|
|
889
|
+
PaginationEllipsis as ArkPaginationEllipsis
|
|
890
|
+
} from "@ark-ui/react/pagination";
|
|
891
|
+
import { ark as ark31 } from "@ark-ui/react/factory";
|
|
892
|
+
import { paginationRootBase, paginationTriggerBase, paginationItemBase, paginationEllipsisBase, cn as cn42 } from "@cloudvoyant/helix";
|
|
893
|
+
import { jsx as jsx42, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
894
|
+
function Pagination({ className, ...props }) {
|
|
895
|
+
return /* @__PURE__ */ jsx42(ArkPaginationRoot, { className: cn42(paginationRootBase, className), ...props });
|
|
896
|
+
}
|
|
897
|
+
function PaginationPrevious(props) {
|
|
898
|
+
return /* @__PURE__ */ jsx42(PaginationPrevTrigger, { asChild: true, ...props, children: /* @__PURE__ */ jsxs9(ark31.button, { className: cn42(paginationTriggerBase), children: [
|
|
899
|
+
/* @__PURE__ */ jsx42(
|
|
900
|
+
"svg",
|
|
901
|
+
{
|
|
902
|
+
viewBox: "0 0 24 24",
|
|
903
|
+
fill: "none",
|
|
904
|
+
stroke: "currentColor",
|
|
905
|
+
strokeWidth: "2",
|
|
906
|
+
strokeLinecap: "round",
|
|
907
|
+
strokeLinejoin: "round",
|
|
908
|
+
"aria-hidden": "true",
|
|
909
|
+
children: /* @__PURE__ */ jsx42("path", { d: "m15 18-6-6 6-6" })
|
|
910
|
+
}
|
|
911
|
+
),
|
|
912
|
+
"Previous"
|
|
913
|
+
] }) });
|
|
914
|
+
}
|
|
915
|
+
function PaginationNext(props) {
|
|
916
|
+
return /* @__PURE__ */ jsx42(PaginationNextTrigger, { asChild: true, ...props, children: /* @__PURE__ */ jsxs9(ark31.button, { className: cn42(paginationTriggerBase), children: [
|
|
917
|
+
"Next",
|
|
918
|
+
/* @__PURE__ */ jsx42(
|
|
919
|
+
"svg",
|
|
920
|
+
{
|
|
921
|
+
viewBox: "0 0 24 24",
|
|
922
|
+
fill: "none",
|
|
923
|
+
stroke: "currentColor",
|
|
924
|
+
strokeWidth: "2",
|
|
925
|
+
strokeLinecap: "round",
|
|
926
|
+
strokeLinejoin: "round",
|
|
927
|
+
"aria-hidden": "true",
|
|
928
|
+
children: /* @__PURE__ */ jsx42("path", { d: "m9 18 6-6-6-6" })
|
|
929
|
+
}
|
|
930
|
+
)
|
|
931
|
+
] }) });
|
|
932
|
+
}
|
|
933
|
+
function PaginationItem({ className, children, ...rest }) {
|
|
934
|
+
return /* @__PURE__ */ jsx42(ArkPaginationItem, { asChild: true, ...rest, children: /* @__PURE__ */ jsx42(ark31.button, { className: cn42(paginationItemBase, className), children }) });
|
|
935
|
+
}
|
|
936
|
+
function PaginationItems() {
|
|
937
|
+
return /* @__PURE__ */ jsx42(ArkPaginationContext, { children: ({ pages }) => pages.map(
|
|
938
|
+
(page, index) => page.type === "page" ? /* @__PURE__ */ jsx42(PaginationItem, { type: "page", value: page.value, children: page.value }, page.value) : /* @__PURE__ */ jsx42(PaginationEllipsis, { index }, `ellipsis-${index}`)
|
|
939
|
+
) });
|
|
940
|
+
}
|
|
941
|
+
function PaginationEllipsis({ className, ...rest }) {
|
|
942
|
+
return /* @__PURE__ */ jsx42(ArkPaginationEllipsis, { className: cn42(paginationEllipsisBase, className), ...rest, children: /* @__PURE__ */ jsxs9(
|
|
943
|
+
"svg",
|
|
944
|
+
{
|
|
945
|
+
viewBox: "0 0 24 24",
|
|
946
|
+
fill: "none",
|
|
947
|
+
stroke: "currentColor",
|
|
948
|
+
strokeWidth: "2",
|
|
949
|
+
strokeLinecap: "round",
|
|
950
|
+
strokeLinejoin: "round",
|
|
951
|
+
"aria-hidden": "true",
|
|
952
|
+
children: [
|
|
953
|
+
/* @__PURE__ */ jsx42("circle", { cx: "12", cy: "12", r: "1" }),
|
|
954
|
+
/* @__PURE__ */ jsx42("circle", { cx: "19", cy: "12", r: "1" }),
|
|
955
|
+
/* @__PURE__ */ jsx42("circle", { cx: "5", cy: "12", r: "1" })
|
|
956
|
+
]
|
|
957
|
+
}
|
|
958
|
+
) });
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
// src/navbar.tsx
|
|
962
|
+
import * as React4 from "react";
|
|
963
|
+
import { ark as ark32 } from "@ark-ui/react/factory";
|
|
964
|
+
import { Portal } from "@ark-ui/react/portal";
|
|
965
|
+
import { CollapsibleRoot, CollapsibleTrigger, CollapsibleContent } from "@ark-ui/react/collapsible";
|
|
966
|
+
import {
|
|
967
|
+
DialogRoot,
|
|
968
|
+
DialogBackdrop,
|
|
969
|
+
DialogPositioner,
|
|
970
|
+
DialogContent,
|
|
971
|
+
DialogCloseTrigger,
|
|
972
|
+
DialogTitle,
|
|
973
|
+
DialogDescription
|
|
974
|
+
} from "@ark-ui/react/dialog";
|
|
975
|
+
import {
|
|
976
|
+
NavigationMenuRoot as ArkNavMenuRoot,
|
|
977
|
+
NavigationMenuList as ArkNavMenuList,
|
|
978
|
+
NavigationMenuItem as ArkNavMenuItem,
|
|
979
|
+
NavigationMenuTrigger as ArkNavMenuTrigger,
|
|
980
|
+
NavigationMenuContent as ArkNavMenuContent,
|
|
981
|
+
NavigationMenuLink as ArkNavMenuLink,
|
|
982
|
+
NavigationMenuViewport as ArkNavMenuViewport,
|
|
983
|
+
NavigationMenuViewportPositioner as ArkNavMenuViewportPositioner,
|
|
984
|
+
NavigationMenuIndicator as ArkNavMenuIndicator
|
|
985
|
+
} from "@ark-ui/react/navigation-menu";
|
|
986
|
+
import {
|
|
987
|
+
navbarVariants,
|
|
988
|
+
navbarContainerBase,
|
|
989
|
+
navbarDensityVariants,
|
|
990
|
+
navbarShrunkBase,
|
|
991
|
+
navbarBrandBase,
|
|
992
|
+
navbarMenuBase,
|
|
993
|
+
navbarMenuPlacementVariants,
|
|
994
|
+
navbarActionsBase,
|
|
995
|
+
navbarTriggerVariants,
|
|
996
|
+
navbarActivationAreaBase,
|
|
997
|
+
navbarMobileContentBase,
|
|
998
|
+
navbarMobileHeaderBase,
|
|
999
|
+
navbarMobileMenuBase,
|
|
1000
|
+
navbarMobileActionsBase,
|
|
1001
|
+
navbarMenuRootBase,
|
|
1002
|
+
navbarMenuListBase,
|
|
1003
|
+
navbarMenuItemBase,
|
|
1004
|
+
navbarMenuTriggerStyle,
|
|
1005
|
+
navbarMenuContentBase,
|
|
1006
|
+
navbarMenuLinkBase,
|
|
1007
|
+
navbarMobileMenuContentBase,
|
|
1008
|
+
navbarMobileMenuTriggerBase,
|
|
1009
|
+
navbarMenuViewportPositionerBase,
|
|
1010
|
+
navbarMenuViewportBase,
|
|
1011
|
+
navbarMenuIndicatorBase,
|
|
1012
|
+
cn as cn43
|
|
1013
|
+
} from "@cloudvoyant/helix";
|
|
1014
|
+
import { navbarMenuTriggerStyle as navbarMenuTriggerStyle2 } from "@cloudvoyant/helix";
|
|
1015
|
+
import { Fragment as Fragment2, jsx as jsx43, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1016
|
+
var SCROLL_THRESHOLD = 24;
|
|
1017
|
+
function resolveScrollContainer(el) {
|
|
1018
|
+
for (let n = el; n; n = n.parentElement) {
|
|
1019
|
+
const oy = getComputedStyle(n).overflowY;
|
|
1020
|
+
if (oy === "auto" || oy === "scroll" || oy === "overlay") return n;
|
|
1021
|
+
}
|
|
1022
|
+
return null;
|
|
1023
|
+
}
|
|
1024
|
+
var NavbarContext = React4.createContext(null);
|
|
1025
|
+
function useNavbar() {
|
|
1026
|
+
const context = React4.useContext(NavbarContext);
|
|
1027
|
+
if (!context) {
|
|
1028
|
+
throw new Error("Navbar parts must be used within a NavbarProvider.");
|
|
1029
|
+
}
|
|
1030
|
+
return context;
|
|
1031
|
+
}
|
|
1032
|
+
function useNavbarSlot(key, children) {
|
|
1033
|
+
const { setSlot } = useNavbar();
|
|
1034
|
+
React4.useLayoutEffect(() => {
|
|
1035
|
+
setSlot(key, children);
|
|
1036
|
+
}, [key, children, setSlot]);
|
|
1037
|
+
}
|
|
1038
|
+
var NavbarMenuStyleContext = React4.createContext({
|
|
1039
|
+
density: "relaxed",
|
|
1040
|
+
variant: "default",
|
|
1041
|
+
inContent: false
|
|
1042
|
+
});
|
|
1043
|
+
function NavbarProvider({
|
|
1044
|
+
defaultOpen = false,
|
|
1045
|
+
children
|
|
1046
|
+
}) {
|
|
1047
|
+
const id = React4.useId();
|
|
1048
|
+
const [open, setOpen] = React4.useState(defaultOpen);
|
|
1049
|
+
const [scrolled, setScrolled] = React4.useState(false);
|
|
1050
|
+
const [hovered, setHovered] = React4.useState(false);
|
|
1051
|
+
const [slots, setSlots] = React4.useState({
|
|
1052
|
+
brand: null,
|
|
1053
|
+
actions: null
|
|
1054
|
+
});
|
|
1055
|
+
const portalRef = React4.useRef(null);
|
|
1056
|
+
const setSlot = React4.useCallback((key, node) => {
|
|
1057
|
+
setSlots((prev) => prev[key] === node ? prev : { ...prev, [key]: node });
|
|
1058
|
+
}, []);
|
|
1059
|
+
const contextValue = React4.useMemo(
|
|
1060
|
+
() => ({
|
|
1061
|
+
id,
|
|
1062
|
+
open,
|
|
1063
|
+
setOpen,
|
|
1064
|
+
scrolled,
|
|
1065
|
+
setScrolled,
|
|
1066
|
+
hovered,
|
|
1067
|
+
setHovered,
|
|
1068
|
+
slots,
|
|
1069
|
+
setSlot,
|
|
1070
|
+
portalRef,
|
|
1071
|
+
// Baseline config; the Navbar header overrides these with its props.
|
|
1072
|
+
variant: "sticky",
|
|
1073
|
+
floating: false,
|
|
1074
|
+
density: "relaxed"
|
|
1075
|
+
}),
|
|
1076
|
+
[id, open, scrolled, hovered, slots, setSlot]
|
|
1077
|
+
);
|
|
1078
|
+
return /* @__PURE__ */ jsx43(NavbarContext.Provider, { value: contextValue, children });
|
|
1079
|
+
}
|
|
1080
|
+
function Navbar({
|
|
1081
|
+
variant = "sticky",
|
|
1082
|
+
floating = false,
|
|
1083
|
+
density = "relaxed",
|
|
1084
|
+
className,
|
|
1085
|
+
children,
|
|
1086
|
+
...props
|
|
1087
|
+
}) {
|
|
1088
|
+
const base = useNavbar();
|
|
1089
|
+
const headerRef = React4.useRef(null);
|
|
1090
|
+
const { setScrolled, setHovered } = base;
|
|
1091
|
+
React4.useEffect(() => {
|
|
1092
|
+
const target = resolveScrollContainer(headerRef.current) ?? window;
|
|
1093
|
+
const getY = () => target === window ? window.scrollY : target.scrollTop;
|
|
1094
|
+
const onScroll = () => setScrolled(getY() > SCROLL_THRESHOLD);
|
|
1095
|
+
onScroll();
|
|
1096
|
+
target.addEventListener("scroll", onScroll, { passive: true });
|
|
1097
|
+
return () => target.removeEventListener("scroll", onScroll);
|
|
1098
|
+
}, [setScrolled]);
|
|
1099
|
+
const value = React4.useMemo(
|
|
1100
|
+
() => ({ ...base, variant, floating, density }),
|
|
1101
|
+
[base, variant, floating, density]
|
|
1102
|
+
);
|
|
1103
|
+
const hidden = variant === "hide" && base.scrolled && !base.hovered;
|
|
1104
|
+
const shrunk = variant === "shrink" && base.scrolled;
|
|
1105
|
+
React4.useLayoutEffect(() => {
|
|
1106
|
+
base.portalRef.current = headerRef.current?.parentElement ?? null;
|
|
1107
|
+
});
|
|
1108
|
+
React4.useEffect(() => {
|
|
1109
|
+
if (!base.open) return;
|
|
1110
|
+
const el = resolveScrollContainer(headerRef.current) ?? document.documentElement;
|
|
1111
|
+
const prev = el.style.overflow;
|
|
1112
|
+
el.style.overflow = "hidden";
|
|
1113
|
+
return () => {
|
|
1114
|
+
el.style.overflow = prev;
|
|
1115
|
+
};
|
|
1116
|
+
}, [base.open]);
|
|
1117
|
+
return /* @__PURE__ */ jsx43(NavbarContext.Provider, { value, children: /* @__PURE__ */ jsx43(
|
|
1118
|
+
"header",
|
|
1119
|
+
{
|
|
1120
|
+
ref: headerRef,
|
|
1121
|
+
"data-slot": "navbar",
|
|
1122
|
+
"data-scrolled": base.scrolled || void 0,
|
|
1123
|
+
"data-hidden": hidden || void 0,
|
|
1124
|
+
"data-shrunk": shrunk || void 0,
|
|
1125
|
+
className: cn43(
|
|
1126
|
+
navbarVariants({ variant, floating }),
|
|
1127
|
+
navbarContainerBase,
|
|
1128
|
+
navbarDensityVariants({ density }),
|
|
1129
|
+
shrunk && navbarShrunkBase,
|
|
1130
|
+
className
|
|
1131
|
+
),
|
|
1132
|
+
onMouseEnter: () => setHovered(true),
|
|
1133
|
+
onMouseLeave: () => setHovered(false),
|
|
1134
|
+
...props,
|
|
1135
|
+
children
|
|
1136
|
+
}
|
|
1137
|
+
) });
|
|
1138
|
+
}
|
|
1139
|
+
function NavbarActivationArea({ className, children, ...props }) {
|
|
1140
|
+
const { setHovered } = useNavbar();
|
|
1141
|
+
return /* @__PURE__ */ jsx43(
|
|
1142
|
+
ark32.div,
|
|
1143
|
+
{
|
|
1144
|
+
"data-slot": "navbar-activation-area",
|
|
1145
|
+
className: cn43(navbarActivationAreaBase, className),
|
|
1146
|
+
onMouseEnter: () => setHovered(true),
|
|
1147
|
+
onMouseLeave: () => setHovered(false),
|
|
1148
|
+
...props,
|
|
1149
|
+
children
|
|
1150
|
+
}
|
|
1151
|
+
);
|
|
1152
|
+
}
|
|
1153
|
+
function NavbarBrand({ className, children, ...props }) {
|
|
1154
|
+
useNavbarSlot("brand", children);
|
|
1155
|
+
return /* @__PURE__ */ jsx43(ark32.div, { "data-slot": "navbar-brand", className: cn43(navbarBrandBase, className), ...props, children });
|
|
1156
|
+
}
|
|
1157
|
+
function NavbarMenu({
|
|
1158
|
+
placement = "center",
|
|
1159
|
+
className,
|
|
1160
|
+
children,
|
|
1161
|
+
...props
|
|
1162
|
+
}) {
|
|
1163
|
+
const { scrolled, density, variant } = useNavbar();
|
|
1164
|
+
const menuDensity = density === "compact" || variant === "shrink" && scrolled ? "compact" : "relaxed";
|
|
1165
|
+
return /* @__PURE__ */ jsx43(NavbarMenuStyleContext.Provider, { value: { density: menuDensity, variant: "default", inContent: false }, children: /* @__PURE__ */ jsx43(
|
|
1166
|
+
ark32.div,
|
|
1167
|
+
{
|
|
1168
|
+
"data-slot": "navbar-menu",
|
|
1169
|
+
"data-placement": placement,
|
|
1170
|
+
className: cn43(navbarMenuBase, navbarMenuPlacementVariants({ placement }), className),
|
|
1171
|
+
children: /* @__PURE__ */ jsxs10(ArkNavMenuRoot, { "data-density": menuDensity, className: cn43(navbarMenuRootBase), ...props, children: [
|
|
1172
|
+
children,
|
|
1173
|
+
/* @__PURE__ */ jsx43(ArkNavMenuViewportPositioner, { className: cn43(navbarMenuViewportPositionerBase), children: /* @__PURE__ */ jsx43(ArkNavMenuViewport, { className: cn43(navbarMenuViewportBase) }) })
|
|
1174
|
+
] })
|
|
1175
|
+
}
|
|
1176
|
+
) });
|
|
1177
|
+
}
|
|
1178
|
+
function NavbarMenuList({ className, children, ...props }) {
|
|
1179
|
+
return /* @__PURE__ */ jsx43(ArkNavMenuList, { className: cn43(navbarMenuListBase, className), ...props, children });
|
|
1180
|
+
}
|
|
1181
|
+
function NavbarMenuItem({
|
|
1182
|
+
variant = "default",
|
|
1183
|
+
className,
|
|
1184
|
+
...props
|
|
1185
|
+
}) {
|
|
1186
|
+
const { density } = React4.useContext(NavbarMenuStyleContext);
|
|
1187
|
+
return /* @__PURE__ */ jsx43(NavbarMenuStyleContext.Provider, { value: { density, variant, inContent: false }, children: /* @__PURE__ */ jsx43(ArkNavMenuItem, { "data-variant": variant, className: cn43(navbarMenuItemBase, className), ...props }) });
|
|
1188
|
+
}
|
|
1189
|
+
function NavbarMenuTrigger({ asChild, className, children, ...props }) {
|
|
1190
|
+
const { density, variant } = React4.useContext(NavbarMenuStyleContext);
|
|
1191
|
+
const chevron = /* @__PURE__ */ jsx43(
|
|
1192
|
+
"svg",
|
|
1193
|
+
{
|
|
1194
|
+
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
1195
|
+
"aria-hidden": "true",
|
|
1196
|
+
viewBox: "0 0 24 24",
|
|
1197
|
+
fill: "none",
|
|
1198
|
+
stroke: "currentColor",
|
|
1199
|
+
strokeWidth: "2",
|
|
1200
|
+
strokeLinecap: "round",
|
|
1201
|
+
strokeLinejoin: "round",
|
|
1202
|
+
children: /* @__PURE__ */ jsx43("path", { d: "m6 9 6 6 6-6" })
|
|
1203
|
+
}
|
|
1204
|
+
);
|
|
1205
|
+
return /* @__PURE__ */ jsx43(ArkNavMenuTrigger, { asChild, className: cn43(navbarMenuTriggerStyle({ density, variant }), className), ...props, children: asChild ? children : /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
1206
|
+
children,
|
|
1207
|
+
chevron
|
|
1208
|
+
] }) });
|
|
1209
|
+
}
|
|
1210
|
+
function NavbarMenuContent({ className, children, ...props }) {
|
|
1211
|
+
return /* @__PURE__ */ jsx43(NavbarMenuStyleContext.Provider, { value: { density: "relaxed", variant: "default", inContent: true }, children: /* @__PURE__ */ jsx43(ArkNavMenuContent, { className: cn43(navbarMenuContentBase, className), ...props, children }) });
|
|
1212
|
+
}
|
|
1213
|
+
function NavbarMenuLink({ className, children, ...props }) {
|
|
1214
|
+
const { density, variant, inContent } = React4.useContext(NavbarMenuStyleContext);
|
|
1215
|
+
const classes = inContent ? cn43(navbarMenuLinkBase, className) : cn43(navbarMenuTriggerStyle({ density, variant }), className);
|
|
1216
|
+
return /* @__PURE__ */ jsx43(ArkNavMenuLink, { className: classes, ...props, children });
|
|
1217
|
+
}
|
|
1218
|
+
function NavbarMobileMenu({ className, children, ...props }) {
|
|
1219
|
+
return /* @__PURE__ */ jsx43(CollapsibleRoot, { "data-slot": "navbar-mobile-menu", className: cn43("group", className), ...props, children });
|
|
1220
|
+
}
|
|
1221
|
+
function NavbarMobileMenuTrigger({ className, children, ...props }) {
|
|
1222
|
+
return /* @__PURE__ */ jsx43(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs10(
|
|
1223
|
+
"button",
|
|
1224
|
+
{
|
|
1225
|
+
type: "button",
|
|
1226
|
+
"data-slot": "navbar-mobile-menu-trigger",
|
|
1227
|
+
className: cn43(navbarMobileMenuTriggerBase, className),
|
|
1228
|
+
...props,
|
|
1229
|
+
children: [
|
|
1230
|
+
children,
|
|
1231
|
+
/* @__PURE__ */ jsx43(
|
|
1232
|
+
"svg",
|
|
1233
|
+
{
|
|
1234
|
+
className: "size-4 transition-transform duration-200 group-data-[state=open]:rotate-180",
|
|
1235
|
+
"aria-hidden": "true",
|
|
1236
|
+
viewBox: "0 0 24 24",
|
|
1237
|
+
fill: "none",
|
|
1238
|
+
stroke: "currentColor",
|
|
1239
|
+
strokeWidth: "2",
|
|
1240
|
+
strokeLinecap: "round",
|
|
1241
|
+
strokeLinejoin: "round",
|
|
1242
|
+
children: /* @__PURE__ */ jsx43("path", { d: "m6 9 6 6 6-6" })
|
|
1243
|
+
}
|
|
1244
|
+
)
|
|
1245
|
+
]
|
|
1246
|
+
}
|
|
1247
|
+
) });
|
|
1248
|
+
}
|
|
1249
|
+
function NavbarMobileMenuContent({ className, children, ...props }) {
|
|
1250
|
+
return /* @__PURE__ */ jsx43(CollapsibleContent, { children: /* @__PURE__ */ jsx43("div", { "data-slot": "navbar-mobile-menu-content", className: cn43(navbarMobileMenuContentBase, className), ...props, children }) });
|
|
1251
|
+
}
|
|
1252
|
+
function NavbarMenuViewport({ className, ...props }) {
|
|
1253
|
+
return /* @__PURE__ */ jsx43(ArkNavMenuViewport, { className: cn43(navbarMenuViewportBase, className), ...props });
|
|
1254
|
+
}
|
|
1255
|
+
function NavbarMenuIndicator({ className, ...props }) {
|
|
1256
|
+
return /* @__PURE__ */ jsx43(ArkNavMenuIndicator, { className: cn43(navbarMenuIndicatorBase, className), ...props });
|
|
1257
|
+
}
|
|
1258
|
+
function NavbarActions({ className, children, ...props }) {
|
|
1259
|
+
useNavbarSlot("actions", children);
|
|
1260
|
+
return /* @__PURE__ */ jsx43(ark32.div, { "data-slot": "navbar-actions", className: cn43(navbarActionsBase, className), ...props, children });
|
|
1261
|
+
}
|
|
1262
|
+
function NavbarTrigger({
|
|
1263
|
+
className,
|
|
1264
|
+
children,
|
|
1265
|
+
"aria-label": ariaLabel,
|
|
1266
|
+
...props
|
|
1267
|
+
}) {
|
|
1268
|
+
const { id, open, setOpen, floating } = useNavbar();
|
|
1269
|
+
return /* @__PURE__ */ jsx43(
|
|
1270
|
+
"button",
|
|
1271
|
+
{
|
|
1272
|
+
type: "button",
|
|
1273
|
+
"data-slot": "navbar-trigger",
|
|
1274
|
+
"aria-expanded": open,
|
|
1275
|
+
"aria-controls": id,
|
|
1276
|
+
"aria-label": ariaLabel ?? "Toggle navigation menu",
|
|
1277
|
+
className: cn43(navbarTriggerVariants({ floating }), "md:hidden", className),
|
|
1278
|
+
onClick: () => setOpen(!open),
|
|
1279
|
+
...props,
|
|
1280
|
+
children: children ?? /* @__PURE__ */ jsxs10(
|
|
1281
|
+
"svg",
|
|
1282
|
+
{
|
|
1283
|
+
className: "size-4",
|
|
1284
|
+
viewBox: "0 0 24 24",
|
|
1285
|
+
fill: "none",
|
|
1286
|
+
stroke: "currentColor",
|
|
1287
|
+
strokeWidth: "2",
|
|
1288
|
+
strokeLinecap: "round",
|
|
1289
|
+
strokeLinejoin: "round",
|
|
1290
|
+
"aria-hidden": "true",
|
|
1291
|
+
children: [
|
|
1292
|
+
/* @__PURE__ */ jsx43("line", { x1: "4", x2: "20", y1: "6", y2: "6" }),
|
|
1293
|
+
/* @__PURE__ */ jsx43("line", { x1: "4", x2: "20", y1: "12", y2: "12" }),
|
|
1294
|
+
/* @__PURE__ */ jsx43("line", { x1: "4", x2: "20", y1: "18", y2: "18" })
|
|
1295
|
+
]
|
|
1296
|
+
}
|
|
1297
|
+
)
|
|
1298
|
+
}
|
|
1299
|
+
);
|
|
1300
|
+
}
|
|
1301
|
+
function NavbarMobileOverlay({ className, children, ...props }) {
|
|
1302
|
+
const { id, open, setOpen, slots, floating, portalRef } = useNavbar();
|
|
1303
|
+
React4.useEffect(() => {
|
|
1304
|
+
if (!open) return;
|
|
1305
|
+
const onKeydown = (event) => {
|
|
1306
|
+
if (event.key === "Escape") setOpen(false);
|
|
1307
|
+
};
|
|
1308
|
+
document.addEventListener("keydown", onKeydown);
|
|
1309
|
+
return () => document.removeEventListener("keydown", onKeydown);
|
|
1310
|
+
}, [open, setOpen]);
|
|
1311
|
+
return /* @__PURE__ */ jsx43(Portal, { container: portalRef, children: /* @__PURE__ */ jsxs10(DialogRoot, { open, lazyMount: true, unmountOnExit: true, onOpenChange: ({ open: open2 }) => setOpen(open2), preventScroll: false, children: [
|
|
1312
|
+
/* @__PURE__ */ jsx43(DialogBackdrop, { className: "absolute inset-0 z-[100] bg-background/60 backdrop-blur-sm" }),
|
|
1313
|
+
/* @__PURE__ */ jsx43(DialogPositioner, { className: "absolute inset-0 z-[100]", children: /* @__PURE__ */ jsxs10(DialogContent, { id, "data-slot": "navbar-mobile-overlay", className: cn43(navbarMobileContentBase, className), ...props, children: [
|
|
1314
|
+
/* @__PURE__ */ jsx43(DialogTitle, { className: "sr-only", children: "Navigation menu" }),
|
|
1315
|
+
/* @__PURE__ */ jsx43(DialogDescription, { className: "sr-only", children: "Mobile navigation menu" }),
|
|
1316
|
+
/* @__PURE__ */ jsxs10("div", { className: navbarMobileHeaderBase, children: [
|
|
1317
|
+
slots.brand,
|
|
1318
|
+
/* @__PURE__ */ jsx43(DialogCloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx43("button", { type: "button", "aria-label": "Close navigation menu", className: cn43(navbarTriggerVariants({ floating })), children: /* @__PURE__ */ jsx43(
|
|
1319
|
+
"svg",
|
|
1320
|
+
{
|
|
1321
|
+
className: "size-4",
|
|
1322
|
+
viewBox: "0 0 24 24",
|
|
1323
|
+
fill: "none",
|
|
1324
|
+
stroke: "currentColor",
|
|
1325
|
+
strokeWidth: "2",
|
|
1326
|
+
strokeLinecap: "round",
|
|
1327
|
+
strokeLinejoin: "round",
|
|
1328
|
+
"aria-hidden": "true",
|
|
1329
|
+
children: /* @__PURE__ */ jsx43("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
1330
|
+
}
|
|
1331
|
+
) }) })
|
|
1332
|
+
] }),
|
|
1333
|
+
/* @__PURE__ */ jsx43("div", { className: navbarMobileMenuBase, children }),
|
|
1334
|
+
slots.actions ? /* @__PURE__ */ jsx43("div", { className: navbarMobileActionsBase, children: slots.actions }) : null
|
|
1335
|
+
] }) })
|
|
1336
|
+
] }) });
|
|
1337
|
+
}
|
|
1338
|
+
export {
|
|
1339
|
+
Badge,
|
|
1340
|
+
Button,
|
|
1341
|
+
Card,
|
|
1342
|
+
CardBody,
|
|
1343
|
+
CardCover,
|
|
1344
|
+
CardDescription,
|
|
1345
|
+
CardFooter,
|
|
1346
|
+
CardHeader,
|
|
1347
|
+
CardTitle,
|
|
1348
|
+
Center,
|
|
1349
|
+
Col,
|
|
1350
|
+
Container,
|
|
1351
|
+
HStack,
|
|
1352
|
+
Item,
|
|
1353
|
+
Navbar,
|
|
1354
|
+
NavbarActions,
|
|
1355
|
+
NavbarActivationArea,
|
|
1356
|
+
NavbarBrand,
|
|
1357
|
+
NavbarMenu,
|
|
1358
|
+
NavbarMenuContent,
|
|
1359
|
+
NavbarMenuIndicator,
|
|
1360
|
+
NavbarMenuItem,
|
|
1361
|
+
NavbarMenuLink,
|
|
1362
|
+
NavbarMenuList,
|
|
1363
|
+
NavbarMenuTrigger,
|
|
1364
|
+
NavbarMenuViewport,
|
|
1365
|
+
ArkNavMenuViewportPositioner as NavbarMenuViewportPositioner,
|
|
1366
|
+
NavbarMobileMenu,
|
|
1367
|
+
NavbarMobileMenuContent,
|
|
1368
|
+
NavbarMobileMenuTrigger,
|
|
1369
|
+
NavbarMobileOverlay,
|
|
1370
|
+
NavbarProvider,
|
|
1371
|
+
NavbarTrigger,
|
|
1372
|
+
Pagination,
|
|
1373
|
+
PaginationEllipsis,
|
|
1374
|
+
PaginationItem,
|
|
1375
|
+
PaginationItems,
|
|
1376
|
+
PaginationNext,
|
|
1377
|
+
PaginationPrevious,
|
|
1378
|
+
Row,
|
|
1379
|
+
Scroll,
|
|
1380
|
+
Root as Sidebar,
|
|
1381
|
+
Content as SidebarContent,
|
|
1382
|
+
Footer as SidebarFooter,
|
|
1383
|
+
Group as SidebarGroup,
|
|
1384
|
+
GroupAction as SidebarGroupAction,
|
|
1385
|
+
Header as SidebarHeader,
|
|
1386
|
+
Input as SidebarInput,
|
|
1387
|
+
Inset as SidebarInset,
|
|
1388
|
+
Menu as SidebarMenu,
|
|
1389
|
+
MenuAction as SidebarMenuAction,
|
|
1390
|
+
MenuBadge as SidebarMenuBadge,
|
|
1391
|
+
MenuButton as SidebarMenuButton,
|
|
1392
|
+
MenuItem as SidebarMenuItem,
|
|
1393
|
+
MenuLink as SidebarMenuLink,
|
|
1394
|
+
MenuSkeleton as SidebarMenuSkeleton,
|
|
1395
|
+
MenuSub as SidebarMenuSub,
|
|
1396
|
+
MenuSubButton as SidebarMenuSubButton,
|
|
1397
|
+
MenuSubItem as SidebarMenuSubItem,
|
|
1398
|
+
Provider as SidebarProvider,
|
|
1399
|
+
Rail as SidebarRail,
|
|
1400
|
+
Separator as SidebarSeparator,
|
|
1401
|
+
Trigger as SidebarTrigger,
|
|
1402
|
+
Splitter,
|
|
1403
|
+
SplitterPanel,
|
|
1404
|
+
SplitterResizeTrigger,
|
|
1405
|
+
SplitterResizeTriggerIndicator,
|
|
1406
|
+
Stack,
|
|
1407
|
+
Tabs,
|
|
1408
|
+
TabsContent,
|
|
1409
|
+
TabsList,
|
|
1410
|
+
TabsTrigger,
|
|
1411
|
+
ToggleButton,
|
|
1412
|
+
ToggleButtonIndicator,
|
|
1413
|
+
VStack,
|
|
1414
|
+
navbarMenuTriggerStyle2 as navbarMenuTriggerStyle,
|
|
1415
|
+
useNavbar,
|
|
1416
|
+
useSidebar,
|
|
1417
|
+
useTabs
|
|
1418
|
+
};
|