@cloudvoyant/vortex-react 0.17.0-rc.202609040136.45c8986
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 +3480 -0
- package/dist/index.d.cts +611 -0
- package/dist/index.d.ts +611 -0
- package/dist/index.js +3670 -0
- package/package.json +66 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,3480 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
Badge: () => Badge,
|
|
34
|
+
Button: () => Button,
|
|
35
|
+
Card: () => Card,
|
|
36
|
+
CardBody: () => CardBody,
|
|
37
|
+
CardCover: () => CardCover,
|
|
38
|
+
CardDescription: () => CardDescription,
|
|
39
|
+
CardFooter: () => CardFooter,
|
|
40
|
+
CardHeader: () => CardHeader,
|
|
41
|
+
CardTitle: () => CardTitle,
|
|
42
|
+
Center: () => Center,
|
|
43
|
+
Chart: () => Chart,
|
|
44
|
+
Checkbox: () => Checkbox,
|
|
45
|
+
CheckboxControl: () => CheckboxControl,
|
|
46
|
+
CheckboxGroup: () => CheckboxGroup,
|
|
47
|
+
CheckboxIndicator: () => CheckboxIndicator,
|
|
48
|
+
CheckboxLabel: () => CheckboxLabel,
|
|
49
|
+
CodeBlock: () => CodeBlock,
|
|
50
|
+
CodeBlockContent: () => CodeBlockContent,
|
|
51
|
+
CodeBlockCopyButton: () => CodeBlockCopyButton,
|
|
52
|
+
CodeBlockHeader: () => CodeBlockHeader,
|
|
53
|
+
CodeBlockTitle: () => CodeBlockTitle,
|
|
54
|
+
Col: () => Col,
|
|
55
|
+
Combobox: () => Combobox,
|
|
56
|
+
ComboboxClear: () => ComboboxClear,
|
|
57
|
+
ComboboxContent: () => ComboboxContent,
|
|
58
|
+
ComboboxControl: () => ComboboxControl,
|
|
59
|
+
ComboboxEmpty: () => ComboboxEmpty,
|
|
60
|
+
ComboboxInput: () => ComboboxInput,
|
|
61
|
+
ComboboxItem: () => ComboboxItem,
|
|
62
|
+
ComboboxItemGroup: () => ComboboxItemGroup,
|
|
63
|
+
ComboboxItemGroupLabel: () => ComboboxItemGroupLabel,
|
|
64
|
+
ComboboxItemIndicator: () => ComboboxItemIndicator,
|
|
65
|
+
ComboboxItemText: () => ComboboxItemText,
|
|
66
|
+
ComboboxList: () => ComboboxList,
|
|
67
|
+
ComboboxTrigger: () => ComboboxTrigger,
|
|
68
|
+
Container: () => Container,
|
|
69
|
+
CopyButton: () => CopyButton,
|
|
70
|
+
Dialog: () => Dialog,
|
|
71
|
+
DialogBackdrop: () => DialogBackdrop,
|
|
72
|
+
DialogContent: () => DialogContent,
|
|
73
|
+
DialogDescription: () => DialogDescription,
|
|
74
|
+
DialogDismiss: () => DialogDismiss,
|
|
75
|
+
DialogFooter: () => DialogFooter,
|
|
76
|
+
DialogHeader: () => DialogHeader,
|
|
77
|
+
DialogProvider: () => DialogProvider,
|
|
78
|
+
DialogTitle: () => DialogTitle,
|
|
79
|
+
DialogTrigger: () => DialogTrigger,
|
|
80
|
+
Field: () => Field,
|
|
81
|
+
FieldError: () => FieldError,
|
|
82
|
+
FieldHelper: () => FieldHelper,
|
|
83
|
+
FieldLabel: () => FieldLabel,
|
|
84
|
+
FieldRequiredIndicator: () => FieldRequiredIndicator,
|
|
85
|
+
FieldSet: () => FieldSet,
|
|
86
|
+
FieldSetError: () => FieldSetError,
|
|
87
|
+
FieldSetHelper: () => FieldSetHelper,
|
|
88
|
+
FieldSetLegend: () => FieldSetLegend,
|
|
89
|
+
Figure: () => Figure,
|
|
90
|
+
HStack: () => HStack,
|
|
91
|
+
InlineLaTeX: () => InlineLaTeX,
|
|
92
|
+
Input: () => Input2,
|
|
93
|
+
Item: () => Item,
|
|
94
|
+
LaTeX: () => LaTeX,
|
|
95
|
+
LanguageTabsCodeBlock: () => LanguageTabsCodeBlock,
|
|
96
|
+
Manim: () => Manim,
|
|
97
|
+
Mermaid: () => Mermaid,
|
|
98
|
+
MultiFileCodeBlock: () => MultiFileCodeBlock,
|
|
99
|
+
MultipleChoiceQuestion: () => MultipleChoiceQuestion,
|
|
100
|
+
Navbar: () => Navbar,
|
|
101
|
+
NavbarActions: () => NavbarActions,
|
|
102
|
+
NavbarActivationArea: () => NavbarActivationArea,
|
|
103
|
+
NavbarBrand: () => NavbarBrand,
|
|
104
|
+
NavbarMenu: () => NavbarMenu,
|
|
105
|
+
NavbarMenuContent: () => NavbarMenuContent,
|
|
106
|
+
NavbarMenuIndicator: () => NavbarMenuIndicator,
|
|
107
|
+
NavbarMenuItem: () => NavbarMenuItem,
|
|
108
|
+
NavbarMenuLink: () => NavbarMenuLink,
|
|
109
|
+
NavbarMenuList: () => NavbarMenuList,
|
|
110
|
+
NavbarMenuTrigger: () => NavbarMenuTrigger,
|
|
111
|
+
NavbarMenuViewport: () => NavbarMenuViewport,
|
|
112
|
+
NavbarMenuViewportPositioner: () => import_navigation_menu.NavigationMenuViewportPositioner,
|
|
113
|
+
NavbarMobileMenu: () => NavbarMobileMenu,
|
|
114
|
+
NavbarMobileMenuContent: () => NavbarMobileMenuContent,
|
|
115
|
+
NavbarMobileMenuTrigger: () => NavbarMobileMenuTrigger,
|
|
116
|
+
NavbarMobileOverlay: () => NavbarMobileOverlay,
|
|
117
|
+
NavbarProvider: () => NavbarProvider,
|
|
118
|
+
NavbarTrigger: () => NavbarTrigger,
|
|
119
|
+
Notice: () => Notice,
|
|
120
|
+
NumberInput: () => NumberInput,
|
|
121
|
+
NumberInputControl: () => NumberInputControl,
|
|
122
|
+
NumberInputDecrement: () => NumberInputDecrement,
|
|
123
|
+
NumberInputIncrement: () => NumberInputIncrement,
|
|
124
|
+
NumberInputInput: () => NumberInputInput,
|
|
125
|
+
NumericQuestion: () => NumericQuestion,
|
|
126
|
+
Page: () => Page,
|
|
127
|
+
PageContent: () => PageContent,
|
|
128
|
+
PageFooter: () => PageFooter,
|
|
129
|
+
PageGutter: () => PageGutter,
|
|
130
|
+
PageSection: () => PageSection,
|
|
131
|
+
Pagination: () => Pagination,
|
|
132
|
+
PaginationEllipsis: () => PaginationEllipsis,
|
|
133
|
+
PaginationItem: () => PaginationItem,
|
|
134
|
+
PaginationItems: () => PaginationItems,
|
|
135
|
+
PaginationNext: () => PaginationNext,
|
|
136
|
+
PaginationPrevious: () => PaginationPrevious,
|
|
137
|
+
Popover: () => Popover,
|
|
138
|
+
PopoverAnchor: () => PopoverAnchor,
|
|
139
|
+
PopoverContent: () => PopoverContent,
|
|
140
|
+
PopoverDescription: () => PopoverDescription,
|
|
141
|
+
PopoverDismiss: () => PopoverDismiss,
|
|
142
|
+
PopoverIndicator: () => PopoverIndicator,
|
|
143
|
+
PopoverProvider: () => PopoverProvider,
|
|
144
|
+
PopoverTitle: () => PopoverTitle,
|
|
145
|
+
PopoverTrigger: () => PopoverTrigger,
|
|
146
|
+
Portal: () => import_portal5.Portal,
|
|
147
|
+
PrevNext: () => PrevNext,
|
|
148
|
+
Quiz: () => Quiz,
|
|
149
|
+
RadioGroup: () => RadioGroup,
|
|
150
|
+
RadioGroupItem: () => RadioGroupItem,
|
|
151
|
+
Reveal: () => Reveal,
|
|
152
|
+
Row: () => Row,
|
|
153
|
+
Scroll: () => Scroll,
|
|
154
|
+
Select: () => Select,
|
|
155
|
+
SelectClearTrigger: () => SelectClearTrigger,
|
|
156
|
+
SelectContent: () => SelectContent,
|
|
157
|
+
SelectIndicator: () => SelectIndicator,
|
|
158
|
+
SelectItem: () => SelectItem,
|
|
159
|
+
SelectItemGroup: () => SelectItemGroup,
|
|
160
|
+
SelectItemGroupLabel: () => SelectItemGroupLabel,
|
|
161
|
+
SelectItemIndicator: () => SelectItemIndicator,
|
|
162
|
+
SelectItemText: () => SelectItemText,
|
|
163
|
+
SelectNative: () => SelectNative,
|
|
164
|
+
SelectTrigger: () => SelectTrigger,
|
|
165
|
+
SelectValue: () => SelectValue,
|
|
166
|
+
Sidebar: () => Root,
|
|
167
|
+
SidebarContent: () => Content,
|
|
168
|
+
SidebarFooter: () => Footer,
|
|
169
|
+
SidebarGroup: () => Group,
|
|
170
|
+
SidebarGroupAction: () => GroupAction,
|
|
171
|
+
SidebarHeader: () => Header,
|
|
172
|
+
SidebarInput: () => Input,
|
|
173
|
+
SidebarInset: () => Inset,
|
|
174
|
+
SidebarMenu: () => Menu,
|
|
175
|
+
SidebarMenuAction: () => MenuAction,
|
|
176
|
+
SidebarMenuBadge: () => MenuBadge,
|
|
177
|
+
SidebarMenuButton: () => MenuButton,
|
|
178
|
+
SidebarMenuItem: () => MenuItem,
|
|
179
|
+
SidebarMenuLink: () => MenuLink,
|
|
180
|
+
SidebarMenuSkeleton: () => MenuSkeleton,
|
|
181
|
+
SidebarMenuSub: () => MenuSub,
|
|
182
|
+
SidebarMenuSubButton: () => MenuSubButton,
|
|
183
|
+
SidebarMenuSubItem: () => MenuSubItem,
|
|
184
|
+
SidebarProvider: () => Provider,
|
|
185
|
+
SidebarRail: () => Rail,
|
|
186
|
+
SidebarSeparator: () => Separator,
|
|
187
|
+
SidebarTrigger: () => Trigger,
|
|
188
|
+
SingleChoiceQuestion: () => SingleChoiceQuestion,
|
|
189
|
+
Splitter: () => Splitter,
|
|
190
|
+
SplitterPanel: () => SplitterPanel,
|
|
191
|
+
SplitterResizeTrigger: () => SplitterResizeTrigger,
|
|
192
|
+
SplitterResizeTriggerIndicator: () => SplitterResizeTriggerIndicator,
|
|
193
|
+
Stack: () => Stack,
|
|
194
|
+
Switch: () => Switch,
|
|
195
|
+
SwitchControl: () => SwitchControl,
|
|
196
|
+
SwitchLabel: () => SwitchLabel,
|
|
197
|
+
SwitchThumb: () => SwitchThumb,
|
|
198
|
+
Tabs: () => Tabs,
|
|
199
|
+
TabsContent: () => TabsContent,
|
|
200
|
+
TabsList: () => TabsList,
|
|
201
|
+
TabsTrigger: () => TabsTrigger,
|
|
202
|
+
TagInput: () => TagInput,
|
|
203
|
+
TagInputClearTrigger: () => TagInputClearTrigger,
|
|
204
|
+
TagInputContext: () => TagInputContext,
|
|
205
|
+
TagInputControl: () => TagInputControl,
|
|
206
|
+
TagInputInput: () => TagInputInput,
|
|
207
|
+
TagInputItem: () => TagInputItem,
|
|
208
|
+
TagInputItemDeleteTrigger: () => TagInputItemDeleteTrigger,
|
|
209
|
+
TagInputItemInput: () => TagInputItemInput,
|
|
210
|
+
TagInputItemPreview: () => TagInputItemPreview,
|
|
211
|
+
TagInputItemText: () => TagInputItemText,
|
|
212
|
+
Textarea: () => Textarea,
|
|
213
|
+
ToggleButton: () => ToggleButton,
|
|
214
|
+
ToggleButtonIndicator: () => ToggleButtonIndicator,
|
|
215
|
+
Tooltip: () => Tooltip,
|
|
216
|
+
TooltipContent: () => TooltipContent,
|
|
217
|
+
TooltipProvider: () => TooltipProvider,
|
|
218
|
+
TooltipTrigger: () => TooltipTrigger,
|
|
219
|
+
VStack: () => VStack,
|
|
220
|
+
Window: () => Window,
|
|
221
|
+
WindowBody: () => WindowBody,
|
|
222
|
+
WindowControl: () => WindowControl,
|
|
223
|
+
WindowDismiss: () => WindowDismiss,
|
|
224
|
+
WindowDragTrigger: () => WindowDragTrigger,
|
|
225
|
+
WindowHeader: () => WindowHeader,
|
|
226
|
+
WindowProvider: () => WindowProvider,
|
|
227
|
+
WindowResizeTrigger: () => WindowResizeTrigger,
|
|
228
|
+
WindowStageTrigger: () => WindowStageTrigger,
|
|
229
|
+
WindowTitle: () => WindowTitle,
|
|
230
|
+
YouTube: () => YouTube,
|
|
231
|
+
YoutubeTimestampAt: () => YoutubeTimestampAt,
|
|
232
|
+
YoutubeTimestamps: () => YoutubeTimestamps,
|
|
233
|
+
navbarMenuTriggerStyle: () => import_vortex_ui49.navbarMenuTriggerStyle,
|
|
234
|
+
useCheckbox: () => useCheckbox,
|
|
235
|
+
useCombobox: () => useCombobox,
|
|
236
|
+
useDialog: () => import_dialog.useDialog,
|
|
237
|
+
useDialogContext: () => import_dialog.useDialogContext,
|
|
238
|
+
useField: () => useField,
|
|
239
|
+
useMediaQuery: () => useMediaQuery,
|
|
240
|
+
useNavbar: () => useNavbar,
|
|
241
|
+
useNumberInput: () => useNumberInput,
|
|
242
|
+
usePopover: () => import_popover.usePopover,
|
|
243
|
+
usePopoverContext: () => import_popover.usePopoverContext,
|
|
244
|
+
useRadioGroup: () => useRadioGroup,
|
|
245
|
+
useSelect: () => useSelect,
|
|
246
|
+
useSidebar: () => useSidebar,
|
|
247
|
+
useSwitch: () => useSwitch,
|
|
248
|
+
useTabs: () => useTabs,
|
|
249
|
+
useTagInput: () => useTagInput,
|
|
250
|
+
useTooltip: () => import_tooltip.useTooltip,
|
|
251
|
+
useTooltipContext: () => import_tooltip.useTooltipContext,
|
|
252
|
+
useWindow: () => import_floating_panel.useFloatingPanel,
|
|
253
|
+
useWindowContext: () => import_floating_panel.useFloatingPanelContext
|
|
254
|
+
});
|
|
255
|
+
module.exports = __toCommonJS(index_exports);
|
|
256
|
+
|
|
257
|
+
// src/button.tsx
|
|
258
|
+
var import_factory = require("@ark-ui/react/factory");
|
|
259
|
+
var import_vortex_ui = require("@cloudvoyant/vortex-ui");
|
|
260
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
261
|
+
function Button({ className, variant, color, size, type = "button", ...props }) {
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_factory.ark.button, { type, className: (0, import_vortex_ui.cn)((0, import_vortex_ui.buttonVariants)({ variant, color, size }), className), ...props });
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// src/toggle-button.tsx
|
|
266
|
+
var import_toggle = require("@ark-ui/react/toggle");
|
|
267
|
+
var import_vortex_ui2 = require("@cloudvoyant/vortex-ui");
|
|
268
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
269
|
+
function ToggleButton({ className, variant, size, ...props }) {
|
|
270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_toggle.ToggleRoot, { className: (0, import_vortex_ui2.cn)((0, import_vortex_ui2.toggleButtonVariants)({ variant, size }), className), ...props });
|
|
271
|
+
}
|
|
272
|
+
function ToggleButtonIndicator(props) {
|
|
273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_toggle.ToggleIndicator, { ...props });
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// src/tooltip.tsx
|
|
277
|
+
var import_tooltip = require("@ark-ui/react/tooltip");
|
|
278
|
+
var import_portal = require("@ark-ui/react/portal");
|
|
279
|
+
var import_vortex_ui3 = require("@cloudvoyant/vortex-ui");
|
|
280
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
281
|
+
function Tooltip(props) {
|
|
282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_tooltip.TooltipRoot, { ...props });
|
|
283
|
+
}
|
|
284
|
+
function TooltipProvider(props) {
|
|
285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_tooltip.TooltipRootProvider, { ...props });
|
|
286
|
+
}
|
|
287
|
+
function TooltipTrigger({ className, ...props }) {
|
|
288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_tooltip.TooltipTrigger, { className: (0, import_vortex_ui3.cn)(className), ...props });
|
|
289
|
+
}
|
|
290
|
+
function TooltipContent({ arrow = true, className, ...props }) {
|
|
291
|
+
const tooltip = (0, import_tooltip.useTooltipContext)();
|
|
292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_portal.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_tooltip.TooltipPositioner, { className: import_vortex_ui3.tooltipPositionerBase, children: [
|
|
293
|
+
arrow && tooltip.open ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_tooltip.TooltipArrow, { className: import_vortex_ui3.tooltipArrowBase, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_tooltip.TooltipArrowTip, {}) }) : null,
|
|
294
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_tooltip.TooltipContent, { className: (0, import_vortex_ui3.cn)(import_vortex_ui3.tooltipContentBase, className), ...props })
|
|
295
|
+
] }) });
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// src/popover.tsx
|
|
299
|
+
var import_popover = require("@ark-ui/react/popover");
|
|
300
|
+
var import_portal2 = require("@ark-ui/react/portal");
|
|
301
|
+
var import_vortex_ui4 = require("@cloudvoyant/vortex-ui");
|
|
302
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
303
|
+
function Popover(props) {
|
|
304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverRoot, { ...props });
|
|
305
|
+
}
|
|
306
|
+
function PopoverProvider(props) {
|
|
307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverRootProvider, { ...props });
|
|
308
|
+
}
|
|
309
|
+
function PopoverTrigger({ className, ...props }) {
|
|
310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverTrigger, { className: (0, import_vortex_ui4.cn)(className), ...props });
|
|
311
|
+
}
|
|
312
|
+
function PopoverAnchor({ className, ...props }) {
|
|
313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverAnchor, { className: (0, import_vortex_ui4.cn)(className), ...props });
|
|
314
|
+
}
|
|
315
|
+
function PopoverContent({ arrow = false, className, ...props }) {
|
|
316
|
+
const popover = (0, import_popover.usePopoverContext)();
|
|
317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_portal2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_popover.PopoverPositioner, { className: import_vortex_ui4.popoverPositionerBase, children: [
|
|
318
|
+
arrow && popover.open ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverArrow, { className: import_vortex_ui4.popoverArrowBase, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverArrowTip, {}) }) : null,
|
|
319
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverContent, { className: (0, import_vortex_ui4.cn)(import_vortex_ui4.popoverContentBase, className), ...props })
|
|
320
|
+
] }) });
|
|
321
|
+
}
|
|
322
|
+
function PopoverTitle({ className, ...props }) {
|
|
323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverTitle, { className: (0, import_vortex_ui4.cn)(import_vortex_ui4.popoverTitleBase, className), ...props });
|
|
324
|
+
}
|
|
325
|
+
function PopoverDescription({ className, ...props }) {
|
|
326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverDescription, { className: (0, import_vortex_ui4.cn)(import_vortex_ui4.popoverDescriptionBase, className), ...props });
|
|
327
|
+
}
|
|
328
|
+
function PopoverDismiss({ className, ...props }) {
|
|
329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverCloseTrigger, { "aria-label": "Close", className: (0, import_vortex_ui4.cn)(import_vortex_ui4.popoverCloseTriggerBase, className), ...props });
|
|
330
|
+
}
|
|
331
|
+
function PopoverIndicator({ className, ...props }) {
|
|
332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_popover.PopoverIndicator, { className: (0, import_vortex_ui4.cn)(import_vortex_ui4.popoverIndicatorBase, className), ...props });
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// src/dialog.tsx
|
|
336
|
+
var import_dialog = require("@ark-ui/react/dialog");
|
|
337
|
+
var import_portal3 = require("@ark-ui/react/portal");
|
|
338
|
+
var import_vortex_ui5 = require("@cloudvoyant/vortex-ui");
|
|
339
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
340
|
+
function Dialog(props) {
|
|
341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dialog.DialogRoot, { ...props });
|
|
342
|
+
}
|
|
343
|
+
function DialogProvider(props) {
|
|
344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dialog.DialogRootProvider, { ...props });
|
|
345
|
+
}
|
|
346
|
+
function DialogTrigger({ className, ...props }) {
|
|
347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dialog.DialogTrigger, { className: (0, import_vortex_ui5.cn)(className), ...props });
|
|
348
|
+
}
|
|
349
|
+
function DialogBackdrop({ className, ...props }) {
|
|
350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_portal3.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dialog.DialogBackdrop, { className: (0, import_vortex_ui5.cn)(import_vortex_ui5.dialogBackdropBase, className), ...props }) });
|
|
351
|
+
}
|
|
352
|
+
function DialogContent({
|
|
353
|
+
positionerClassName,
|
|
354
|
+
fullscreen,
|
|
355
|
+
className,
|
|
356
|
+
...props
|
|
357
|
+
}) {
|
|
358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_portal3.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dialog.DialogPositioner, { className: (0, import_vortex_ui5.cn)(import_vortex_ui5.dialogPositionerBase, fullscreen && "p-0", positionerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
359
|
+
import_dialog.DialogContent,
|
|
360
|
+
{
|
|
361
|
+
className: (0, import_vortex_ui5.cn)(import_vortex_ui5.dialogContentBase, fullscreen && import_vortex_ui5.dialogFullscreenContentBase, className),
|
|
362
|
+
...props
|
|
363
|
+
}
|
|
364
|
+
) }) });
|
|
365
|
+
}
|
|
366
|
+
function DialogTitle({ className, ...props }) {
|
|
367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dialog.DialogTitle, { className: (0, import_vortex_ui5.cn)(import_vortex_ui5.dialogTitleBase, className), ...props });
|
|
368
|
+
}
|
|
369
|
+
function DialogDescription({ className, ...props }) {
|
|
370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dialog.DialogDescription, { className: (0, import_vortex_ui5.cn)(import_vortex_ui5.dialogDescriptionBase, className), ...props });
|
|
371
|
+
}
|
|
372
|
+
function DialogHeader({ sticky, className, ...props }) {
|
|
373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_vortex_ui5.cn)(import_vortex_ui5.dialogHeaderBase, sticky && import_vortex_ui5.dialogHeaderStickyBase, className), ...props });
|
|
374
|
+
}
|
|
375
|
+
function DialogFooter({ sticky, className, ...props }) {
|
|
376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_vortex_ui5.cn)(import_vortex_ui5.dialogFooterBase, sticky && import_vortex_ui5.dialogFooterStickyBase, className), ...props });
|
|
377
|
+
}
|
|
378
|
+
function DialogDismiss({ className, ...props }) {
|
|
379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dialog.DialogCloseTrigger, { "aria-label": "Close", className: (0, import_vortex_ui5.cn)(import_vortex_ui5.dialogCloseTriggerBase, className), ...props });
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// src/window.tsx
|
|
383
|
+
var import_floating_panel = require("@ark-ui/react/floating-panel");
|
|
384
|
+
var import_portal4 = require("@ark-ui/react/portal");
|
|
385
|
+
var import_vortex_ui6 = require("@cloudvoyant/vortex-ui");
|
|
386
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
387
|
+
function Window({ className, positionerClassName, children, ...props }) {
|
|
388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelRoot, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal4.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelPositioner, { className: (0, import_vortex_ui6.cn)(import_vortex_ui6.windowPositionerBase, positionerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelContent, { className: (0, import_vortex_ui6.cn)(import_vortex_ui6.windowContentBase, className), children }) }) }) });
|
|
389
|
+
}
|
|
390
|
+
function WindowProvider(props) {
|
|
391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelRootProvider, { ...props });
|
|
392
|
+
}
|
|
393
|
+
function WindowDragTrigger({ className, ...props }) {
|
|
394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelDragTrigger, { className: (0, import_vortex_ui6.cn)(import_vortex_ui6.windowDragTriggerBase, className), ...props });
|
|
395
|
+
}
|
|
396
|
+
function WindowHeader({ className, ...props }) {
|
|
397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelHeader, { className: (0, import_vortex_ui6.cn)(import_vortex_ui6.windowHeaderBase, className), ...props });
|
|
398
|
+
}
|
|
399
|
+
function WindowTitle({ className, ...props }) {
|
|
400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelTitle, { className: (0, import_vortex_ui6.cn)(import_vortex_ui6.windowTitleBase, className), ...props });
|
|
401
|
+
}
|
|
402
|
+
function WindowControl({ className, ...props }) {
|
|
403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelControl, { className: (0, import_vortex_ui6.cn)(import_vortex_ui6.windowControlBase, className), ...props });
|
|
404
|
+
}
|
|
405
|
+
function WindowStageTrigger({ className, ...props }) {
|
|
406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelStageTrigger, { className: (0, import_vortex_ui6.cn)(import_vortex_ui6.windowStageTriggerBase, className), ...props });
|
|
407
|
+
}
|
|
408
|
+
function WindowDismiss({ className, ...props }) {
|
|
409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelCloseTrigger, { "aria-label": "Close", className: (0, import_vortex_ui6.cn)(import_vortex_ui6.windowCloseTriggerBase, className), ...props });
|
|
410
|
+
}
|
|
411
|
+
function WindowBody({ className, ...props }) {
|
|
412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelBody, { className: (0, import_vortex_ui6.cn)(import_vortex_ui6.windowBodyBase, className), ...props });
|
|
413
|
+
}
|
|
414
|
+
function WindowResizeTrigger({ axis = "se", className, ...props }) {
|
|
415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_floating_panel.FloatingPanelResizeTrigger, { axis, className: (0, import_vortex_ui6.cn)(import_vortex_ui6.windowResizeTriggerBase, className), ...props });
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// src/badge.tsx
|
|
419
|
+
var import_factory2 = require("@ark-ui/react/factory");
|
|
420
|
+
var import_vortex_ui7 = require("@cloudvoyant/vortex-ui");
|
|
421
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
422
|
+
function Badge({ className, variant, color, size, ...props }) {
|
|
423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_factory2.ark.span, { className: (0, import_vortex_ui7.cn)((0, import_vortex_ui7.badgeVariants)({ variant, color, size }), className), ...props });
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// src/container.tsx
|
|
427
|
+
var import_factory3 = require("@ark-ui/react/factory");
|
|
428
|
+
var import_vortex_ui8 = require("@cloudvoyant/vortex-ui");
|
|
429
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
430
|
+
function Container({ className, ...props }) {
|
|
431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_factory3.ark.div, { className: (0, import_vortex_ui8.cn)(import_vortex_ui8.containerBase, className), ...props });
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// src/row.tsx
|
|
435
|
+
var import_factory4 = require("@ark-ui/react/factory");
|
|
436
|
+
var import_vortex_ui9 = require("@cloudvoyant/vortex-ui");
|
|
437
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
438
|
+
function Row({ className, ...props }) {
|
|
439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_factory4.ark.div, { className: (0, import_vortex_ui9.cn)(import_vortex_ui9.rowBase, className), ...props });
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// src/col.tsx
|
|
443
|
+
var import_factory5 = require("@ark-ui/react/factory");
|
|
444
|
+
var import_vortex_ui10 = require("@cloudvoyant/vortex-ui");
|
|
445
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
446
|
+
function Col({ className, ...props }) {
|
|
447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_factory5.ark.div, { className: (0, import_vortex_ui10.cn)(import_vortex_ui10.colBase, className), ...props });
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// src/center.tsx
|
|
451
|
+
var import_factory6 = require("@ark-ui/react/factory");
|
|
452
|
+
var import_vortex_ui11 = require("@cloudvoyant/vortex-ui");
|
|
453
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
454
|
+
function Center({ className, ...props }) {
|
|
455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_factory6.ark.div, { className: (0, import_vortex_ui11.cn)(import_vortex_ui11.centerBase, className), ...props });
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// src/portal.tsx
|
|
459
|
+
var import_portal5 = require("@ark-ui/react/portal");
|
|
460
|
+
|
|
461
|
+
// src/item.tsx
|
|
462
|
+
var import_factory7 = require("@ark-ui/react/factory");
|
|
463
|
+
var import_vortex_ui12 = require("@cloudvoyant/vortex-ui");
|
|
464
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
465
|
+
function Item({ className, variant, ...props }) {
|
|
466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_factory7.ark.div, { className: (0, import_vortex_ui12.cn)((0, import_vortex_ui12.itemVariants)({ variant }), className), ...props });
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// src/card/root.tsx
|
|
470
|
+
var import_factory8 = require("@ark-ui/react/factory");
|
|
471
|
+
var import_vortex_ui13 = require("@cloudvoyant/vortex-ui");
|
|
472
|
+
|
|
473
|
+
// src/card/context.ts
|
|
474
|
+
var import_react = require("react");
|
|
475
|
+
var CardOrientationContext = (0, import_react.createContext)("vertical");
|
|
476
|
+
function useCardOrientation() {
|
|
477
|
+
return (0, import_react.useContext)(CardOrientationContext);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// src/card/root.tsx
|
|
481
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
482
|
+
function Card({ className, variant, size, orientation, children, ...props }) {
|
|
483
|
+
const resolvedOrientation = orientation ?? "vertical";
|
|
484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CardOrientationContext.Provider, { value: resolvedOrientation, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_factory8.ark.div, { className: (0, import_vortex_ui13.cn)((0, import_vortex_ui13.cardVariants)({ variant, size, orientation: resolvedOrientation }), className), ...props, children }) });
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// src/card/header.tsx
|
|
488
|
+
var import_factory9 = require("@ark-ui/react/factory");
|
|
489
|
+
var import_vortex_ui14 = require("@cloudvoyant/vortex-ui");
|
|
490
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
491
|
+
function CardHeader({ className, ...props }) {
|
|
492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_factory9.ark.div, { className: (0, import_vortex_ui14.cn)(import_vortex_ui14.cardHeaderBase, className), ...props });
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// src/card/body.tsx
|
|
496
|
+
var import_factory10 = require("@ark-ui/react/factory");
|
|
497
|
+
var import_vortex_ui15 = require("@cloudvoyant/vortex-ui");
|
|
498
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
499
|
+
function CardBody({ className, ...props }) {
|
|
500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_factory10.ark.div, { className: (0, import_vortex_ui15.cn)(import_vortex_ui15.cardBodyBase, className), ...props });
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// src/card/footer.tsx
|
|
504
|
+
var import_factory11 = require("@ark-ui/react/factory");
|
|
505
|
+
var import_vortex_ui16 = require("@cloudvoyant/vortex-ui");
|
|
506
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
507
|
+
function CardFooter({ className, ...props }) {
|
|
508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_factory11.ark.div, { className: (0, import_vortex_ui16.cn)(import_vortex_ui16.cardFooterBase, className), ...props });
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// src/card/title.tsx
|
|
512
|
+
var import_factory12 = require("@ark-ui/react/factory");
|
|
513
|
+
var import_vortex_ui17 = require("@cloudvoyant/vortex-ui");
|
|
514
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
515
|
+
function CardTitle({ className, ...props }) {
|
|
516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_factory12.ark.h3, { className: (0, import_vortex_ui17.cn)(import_vortex_ui17.cardTitleBase, className), ...props });
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// src/card/description.tsx
|
|
520
|
+
var import_factory13 = require("@ark-ui/react/factory");
|
|
521
|
+
var import_vortex_ui18 = require("@cloudvoyant/vortex-ui");
|
|
522
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
523
|
+
function CardDescription({ className, ...props }) {
|
|
524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_factory13.ark.p, { className: (0, import_vortex_ui18.cn)(import_vortex_ui18.cardDescriptionBase, className), ...props });
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// src/card/cover.tsx
|
|
528
|
+
var import_factory14 = require("@ark-ui/react/factory");
|
|
529
|
+
var import_vortex_ui19 = require("@cloudvoyant/vortex-ui");
|
|
530
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
531
|
+
function CardCover({ className, variant, orientation, ...props }) {
|
|
532
|
+
const contextOrientation = useCardOrientation();
|
|
533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
534
|
+
import_factory14.ark.div,
|
|
535
|
+
{
|
|
536
|
+
className: (0, import_vortex_ui19.cn)((0, import_vortex_ui19.cardCoverVariants)({ variant, orientation: orientation ?? contextOrientation }), className),
|
|
537
|
+
...props
|
|
538
|
+
}
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// src/stack.tsx
|
|
543
|
+
var import_factory15 = require("@ark-ui/react/factory");
|
|
544
|
+
var import_vortex_ui20 = require("@cloudvoyant/vortex-ui");
|
|
545
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
546
|
+
function Stack({ className, ...props }) {
|
|
547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_factory15.ark.div, { className: (0, import_vortex_ui20.cn)(import_vortex_ui20.stackBase, className), ...props });
|
|
548
|
+
}
|
|
549
|
+
function HStack({ className, ...props }) {
|
|
550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_factory15.ark.div, { className: (0, import_vortex_ui20.cn)(import_vortex_ui20.hstackBase, className), ...props });
|
|
551
|
+
}
|
|
552
|
+
function VStack({ className, ...props }) {
|
|
553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_factory15.ark.div, { className: (0, import_vortex_ui20.cn)(import_vortex_ui20.vstackBase, className), ...props });
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// src/scroll.tsx
|
|
557
|
+
var import_scroll_area = require("@ark-ui/react/scroll-area");
|
|
558
|
+
var import_vortex_ui21 = require("@cloudvoyant/vortex-ui");
|
|
559
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
560
|
+
function Scroll({
|
|
561
|
+
className,
|
|
562
|
+
orientation = "vertical",
|
|
563
|
+
variant = "default",
|
|
564
|
+
contentClassName,
|
|
565
|
+
thumbClassName,
|
|
566
|
+
viewportClassName,
|
|
567
|
+
children,
|
|
568
|
+
...props
|
|
569
|
+
}) {
|
|
570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_scroll_area.ScrollAreaRoot, { className: (0, import_vortex_ui21.cn)(import_vortex_ui21.scrollRootBase, className), ...props, children: [
|
|
571
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_scroll_area.ScrollAreaViewport, { className: (0, import_vortex_ui21.cn)(import_vortex_ui21.scrollViewportBase, viewportClassName), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_scroll_area.ScrollAreaContent, { className: (0, import_vortex_ui21.cn)(import_vortex_ui21.scrollContentBase, contentClassName), children }) }),
|
|
572
|
+
variant === "hidden" ? null : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
573
|
+
(orientation === "vertical" || orientation === "both") && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_scroll_area.ScrollAreaScrollbar, { orientation: "vertical", className: import_vortex_ui21.scrollScrollbarBase, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_scroll_area.ScrollAreaThumb, { className: (0, import_vortex_ui21.cn)(import_vortex_ui21.scrollThumbBase, thumbClassName) }) }),
|
|
574
|
+
(orientation === "horizontal" || orientation === "both") && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_scroll_area.ScrollAreaScrollbar, { orientation: "horizontal", className: import_vortex_ui21.scrollScrollbarBase, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_scroll_area.ScrollAreaThumb, { className: (0, import_vortex_ui21.cn)(import_vortex_ui21.scrollThumbBase, thumbClassName) }) }),
|
|
575
|
+
orientation === "both" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_scroll_area.ScrollAreaCorner, { className: import_vortex_ui21.scrollCornerBase })
|
|
576
|
+
] })
|
|
577
|
+
] });
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// src/page.tsx
|
|
581
|
+
var import_factory16 = require("@ark-ui/react/factory");
|
|
582
|
+
var import_vortex_ui22 = require("@cloudvoyant/vortex-ui");
|
|
583
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
584
|
+
function Page({ variant = "default", className, children, ...props }) {
|
|
585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_factory16.ark.div, { "data-slot": "page", className: (0, import_vortex_ui22.cn)((0, import_vortex_ui22.pageVariants)({ variant }), className), ...props, children });
|
|
586
|
+
}
|
|
587
|
+
function PageGutter({
|
|
588
|
+
side = "left",
|
|
589
|
+
align = "start",
|
|
590
|
+
contentClassName,
|
|
591
|
+
className,
|
|
592
|
+
children,
|
|
593
|
+
...props
|
|
594
|
+
}) {
|
|
595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_factory16.ark.div, { "data-slot": "page-gutter-area", className: (0, import_vortex_ui22.cn)(import_vortex_ui22.pageGutterAreaBase, side === "right" && "[grid-area:right]"), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_factory16.ark.div, { "data-slot": "page-gutter", className: (0, import_vortex_ui22.cn)((0, import_vortex_ui22.pageGutterVariants)({ side }), className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_factory16.ark.div, { "data-slot": "page-gutter-content", className: (0, import_vortex_ui22.cn)((0, import_vortex_ui22.pageGutterContentVariants)({ align }), contentClassName), children }) }) });
|
|
596
|
+
}
|
|
597
|
+
function PageContent({ className, children, ...props }) {
|
|
598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_factory16.ark.main, { "data-slot": "page-content", className: (0, import_vortex_ui22.cn)(import_vortex_ui22.pageContentBase, className), ...props, children });
|
|
599
|
+
}
|
|
600
|
+
function PageFooter({ className, children, ...props }) {
|
|
601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_factory16.ark.footer, { "data-slot": "page-footer", className: (0, import_vortex_ui22.cn)(import_vortex_ui22.pageFooterBase, className), ...props, children });
|
|
602
|
+
}
|
|
603
|
+
function PageSection({ className, children, ...props }) {
|
|
604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_factory16.ark.section, { "data-slot": "page-section", className: (0, import_vortex_ui22.cn)(import_vortex_ui22.pageSectionBase, className), ...props, children });
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// src/splitter.tsx
|
|
608
|
+
var import_splitter = require("@ark-ui/react/splitter");
|
|
609
|
+
var import_vortex_ui23 = require("@cloudvoyant/vortex-ui");
|
|
610
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
611
|
+
function Splitter({ className, ...props }) {
|
|
612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_splitter.SplitterRoot, { className: (0, import_vortex_ui23.cn)(import_vortex_ui23.splitterRootBase, className), ...props });
|
|
613
|
+
}
|
|
614
|
+
function SplitterPanel({ className, ...props }) {
|
|
615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_splitter.SplitterPanel, { className: (0, import_vortex_ui23.cn)(import_vortex_ui23.splitterPanelBase, className), ...props });
|
|
616
|
+
}
|
|
617
|
+
function SplitterResizeTrigger({ className, children, ...props }) {
|
|
618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_splitter.SplitterResizeTrigger, { className: (0, import_vortex_ui23.cn)(import_vortex_ui23.splitterResizeTriggerBase, className), ...props, children: [
|
|
619
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { "aria-hidden": true, "data-part": "separator", className: import_vortex_ui23.splitterResizeTriggerSeparatorBase }),
|
|
620
|
+
children
|
|
621
|
+
] });
|
|
622
|
+
}
|
|
623
|
+
function SplitterResizeTriggerIndicator({ className, ...props }) {
|
|
624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_splitter.SplitterResizeTriggerIndicator, { className: (0, import_vortex_ui23.cn)(import_vortex_ui23.splitterResizeTriggerIndicatorBase, className), ...props });
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// src/sidebar/Provider.tsx
|
|
628
|
+
var React2 = __toESM(require("react"), 1);
|
|
629
|
+
var import_vortex_ui24 = require("@cloudvoyant/vortex-ui");
|
|
630
|
+
|
|
631
|
+
// src/sidebar/context.ts
|
|
632
|
+
var React = __toESM(require("react"), 1);
|
|
633
|
+
var SidebarContext = React.createContext(null);
|
|
634
|
+
function useSidebar() {
|
|
635
|
+
const context = React.useContext(SidebarContext);
|
|
636
|
+
if (!context) {
|
|
637
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
638
|
+
}
|
|
639
|
+
return context;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// src/sidebar/Provider.tsx
|
|
643
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
644
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
645
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
646
|
+
function useIsMobile() {
|
|
647
|
+
const [isMobile, setIsMobile] = React2.useState(false);
|
|
648
|
+
const [isMobileSet, setIsMobileSet] = React2.useState(false);
|
|
649
|
+
React2.useEffect(() => {
|
|
650
|
+
const mql = window.matchMedia("(max-width: 767px)");
|
|
651
|
+
const onChange = () => {
|
|
652
|
+
setIsMobile(window.innerWidth < 768);
|
|
653
|
+
setIsMobileSet(true);
|
|
654
|
+
};
|
|
655
|
+
onChange();
|
|
656
|
+
mql.addEventListener("change", onChange);
|
|
657
|
+
return () => mql.removeEventListener("change", onChange);
|
|
658
|
+
}, []);
|
|
659
|
+
return isMobile && isMobileSet;
|
|
660
|
+
}
|
|
661
|
+
function Provider({
|
|
662
|
+
defaultOpen = true,
|
|
663
|
+
open: openProp,
|
|
664
|
+
onOpenChange: setOpenProp,
|
|
665
|
+
className,
|
|
666
|
+
style,
|
|
667
|
+
children,
|
|
668
|
+
...props
|
|
669
|
+
}) {
|
|
670
|
+
const isMobile = useIsMobile();
|
|
671
|
+
const [openMobile, setOpenMobile] = React2.useState(false);
|
|
672
|
+
const [_open, _setOpen] = React2.useState(defaultOpen);
|
|
673
|
+
const open = openProp ?? _open;
|
|
674
|
+
const setOpen = React2.useCallback(
|
|
675
|
+
(value) => {
|
|
676
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
677
|
+
if (setOpenProp) {
|
|
678
|
+
setOpenProp(openState);
|
|
679
|
+
} else {
|
|
680
|
+
_setOpen(openState);
|
|
681
|
+
}
|
|
682
|
+
if (typeof document !== "undefined") {
|
|
683
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
[setOpenProp, open]
|
|
687
|
+
);
|
|
688
|
+
const toggleSidebar = React2.useCallback(() => {
|
|
689
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
690
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
691
|
+
React2.useEffect(() => {
|
|
692
|
+
if (openProp !== void 0) return;
|
|
693
|
+
if (typeof document === "undefined") return;
|
|
694
|
+
const cookie = document.cookie.split("; ").find((row) => row.startsWith(`${SIDEBAR_COOKIE_NAME}=`));
|
|
695
|
+
if (cookie) {
|
|
696
|
+
_setOpen(cookie.split("=")[1] === "true");
|
|
697
|
+
}
|
|
698
|
+
}, [openProp]);
|
|
699
|
+
React2.useEffect(() => {
|
|
700
|
+
const handleKeyDown = (event) => {
|
|
701
|
+
if (event.key === import_vortex_ui24.SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
702
|
+
event.preventDefault();
|
|
703
|
+
toggleSidebar();
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
707
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
708
|
+
}, [toggleSidebar]);
|
|
709
|
+
const state = open ? "expanded" : "collapsed";
|
|
710
|
+
const contextValue = React2.useMemo(
|
|
711
|
+
() => ({
|
|
712
|
+
state,
|
|
713
|
+
open,
|
|
714
|
+
setOpen,
|
|
715
|
+
isMobile,
|
|
716
|
+
openMobile,
|
|
717
|
+
setOpenMobile,
|
|
718
|
+
toggleSidebar
|
|
719
|
+
}),
|
|
720
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
721
|
+
);
|
|
722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
723
|
+
Row,
|
|
724
|
+
{
|
|
725
|
+
"data-slot": "sidebar-wrapper",
|
|
726
|
+
style: {
|
|
727
|
+
"--sidebar-width": import_vortex_ui24.SIDEBAR_WIDTH,
|
|
728
|
+
"--sidebar-width-icon": import_vortex_ui24.SIDEBAR_WIDTH_ICON,
|
|
729
|
+
...style
|
|
730
|
+
},
|
|
731
|
+
className: (0, import_vortex_ui24.cn)(import_vortex_ui24.sidebarStyles.wrapperClass, className),
|
|
732
|
+
...props,
|
|
733
|
+
children
|
|
734
|
+
}
|
|
735
|
+
) });
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
// src/sidebar/Root.tsx
|
|
739
|
+
var import_drawer = require("@ark-ui/react/drawer");
|
|
740
|
+
var import_vortex_ui25 = require("@cloudvoyant/vortex-ui");
|
|
741
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
742
|
+
function Root({
|
|
743
|
+
side = "left",
|
|
744
|
+
variant = "sidebar",
|
|
745
|
+
collapsible = "offcanvas",
|
|
746
|
+
className,
|
|
747
|
+
children,
|
|
748
|
+
...props
|
|
749
|
+
}) {
|
|
750
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
751
|
+
if (collapsible === "none") {
|
|
752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
753
|
+
Col,
|
|
754
|
+
{
|
|
755
|
+
"data-slot": "sidebar",
|
|
756
|
+
"data-sidebar": "sidebar",
|
|
757
|
+
className: (0, import_vortex_ui25.cn)("h-full w-(--sidebar-width) bg-sidebar text-sidebar-foreground", className),
|
|
758
|
+
...props,
|
|
759
|
+
children
|
|
760
|
+
}
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
if (isMobile) {
|
|
764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
765
|
+
import_drawer.DrawerRoot,
|
|
766
|
+
{
|
|
767
|
+
open: openMobile,
|
|
768
|
+
onOpenChange: (details) => setOpenMobile(details.open),
|
|
769
|
+
...props,
|
|
770
|
+
children: [
|
|
771
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerBackdrop, {}),
|
|
772
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerPositioner, { className: "w-(--sidebar-width)", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
773
|
+
import_drawer.DrawerContent,
|
|
774
|
+
{
|
|
775
|
+
"data-sidebar": "sidebar",
|
|
776
|
+
"data-slot": "sidebar",
|
|
777
|
+
"data-mobile": "true",
|
|
778
|
+
className: (0, import_vortex_ui25.cn)("w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground", className),
|
|
779
|
+
style: { "--sidebar-width": import_vortex_ui25.SIDEBAR_WIDTH_MOBILE },
|
|
780
|
+
children: [
|
|
781
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerTitle, { className: "sr-only", children: "Sidebar" }),
|
|
782
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerDescription, { className: "sr-only", children: "Displays the mobile sidebar." }),
|
|
783
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerCloseTrigger, { className: "hidden" }),
|
|
784
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Col, { className: "h-full w-full", children })
|
|
785
|
+
]
|
|
786
|
+
}
|
|
787
|
+
) })
|
|
788
|
+
]
|
|
789
|
+
}
|
|
790
|
+
);
|
|
791
|
+
}
|
|
792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
793
|
+
"div",
|
|
794
|
+
{
|
|
795
|
+
className: "group peer hidden text-sidebar-foreground md:block",
|
|
796
|
+
"data-state": state,
|
|
797
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
798
|
+
"data-variant": variant,
|
|
799
|
+
"data-side": side,
|
|
800
|
+
"data-slot": "sidebar",
|
|
801
|
+
children: [
|
|
802
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
803
|
+
"div",
|
|
804
|
+
{
|
|
805
|
+
"data-slot": "sidebar-gap",
|
|
806
|
+
className: (0, import_vortex_ui25.cn)(
|
|
807
|
+
import_vortex_ui25.sidebarStyles.gapClass,
|
|
808
|
+
side === "right" && "rotate-180",
|
|
809
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
810
|
+
)
|
|
811
|
+
}
|
|
812
|
+
),
|
|
813
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
814
|
+
"div",
|
|
815
|
+
{
|
|
816
|
+
"data-slot": "sidebar-container",
|
|
817
|
+
className: (0, import_vortex_ui25.cn)(
|
|
818
|
+
import_vortex_ui25.sidebarStyles.containerClass,
|
|
819
|
+
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)]",
|
|
820
|
+
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",
|
|
821
|
+
className
|
|
822
|
+
),
|
|
823
|
+
...props,
|
|
824
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
825
|
+
"div",
|
|
826
|
+
{
|
|
827
|
+
"data-sidebar": "sidebar",
|
|
828
|
+
"data-slot": "sidebar-inner",
|
|
829
|
+
"data-variant": variant,
|
|
830
|
+
className: (0, import_vortex_ui25.cn)(import_vortex_ui25.sidebarStyles.innerClass),
|
|
831
|
+
children
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
}
|
|
835
|
+
)
|
|
836
|
+
]
|
|
837
|
+
}
|
|
838
|
+
);
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
// src/sidebar/Header.tsx
|
|
842
|
+
var import_vortex_ui26 = require("@cloudvoyant/vortex-ui");
|
|
843
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
844
|
+
function Header({ className, ...props }) {
|
|
845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
846
|
+
Col,
|
|
847
|
+
{
|
|
848
|
+
"data-slot": "sidebar-header",
|
|
849
|
+
"data-sidebar": "header",
|
|
850
|
+
className: (0, import_vortex_ui26.cn)(import_vortex_ui26.sidebarStyles.headerClass, className),
|
|
851
|
+
...props
|
|
852
|
+
}
|
|
853
|
+
);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
// src/sidebar/Footer.tsx
|
|
857
|
+
var import_vortex_ui27 = require("@cloudvoyant/vortex-ui");
|
|
858
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
859
|
+
function Footer({ className, ...props }) {
|
|
860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
861
|
+
Col,
|
|
862
|
+
{
|
|
863
|
+
"data-slot": "sidebar-footer",
|
|
864
|
+
"data-sidebar": "footer",
|
|
865
|
+
className: (0, import_vortex_ui27.cn)(import_vortex_ui27.sidebarStyles.footerClass, className),
|
|
866
|
+
...props
|
|
867
|
+
}
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
// src/sidebar/Separator.tsx
|
|
872
|
+
var import_factory17 = require("@ark-ui/react/factory");
|
|
873
|
+
var import_vortex_ui28 = require("@cloudvoyant/vortex-ui");
|
|
874
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
875
|
+
function Separator({ className, ...props }) {
|
|
876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
877
|
+
import_factory17.ark.div,
|
|
878
|
+
{
|
|
879
|
+
"data-slot": "sidebar-separator",
|
|
880
|
+
"data-sidebar": "separator",
|
|
881
|
+
role: "separator",
|
|
882
|
+
className: (0, import_vortex_ui28.cn)(import_vortex_ui28.sidebarStyles.separatorClass, className),
|
|
883
|
+
...props
|
|
884
|
+
}
|
|
885
|
+
);
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
// src/sidebar/Content.tsx
|
|
889
|
+
var import_vortex_ui29 = require("@cloudvoyant/vortex-ui");
|
|
890
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
891
|
+
function Content({ className, ...props }) {
|
|
892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
893
|
+
Col,
|
|
894
|
+
{
|
|
895
|
+
"data-slot": "sidebar-content",
|
|
896
|
+
"data-sidebar": "content",
|
|
897
|
+
className: (0, import_vortex_ui29.cn)(import_vortex_ui29.sidebarStyles.contentClass, className),
|
|
898
|
+
...props
|
|
899
|
+
}
|
|
900
|
+
);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
// src/sidebar/Group.tsx
|
|
904
|
+
var import_vortex_ui30 = require("@cloudvoyant/vortex-ui");
|
|
905
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
906
|
+
function Group({ label, className, children, ...props }) {
|
|
907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Col, { "data-slot": "sidebar-group", "data-sidebar": "group", className: (0, import_vortex_ui30.cn)(import_vortex_ui30.sidebarStyles.groupClass, className), ...props, children: [
|
|
908
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: (0, import_vortex_ui30.cn)(import_vortex_ui30.sidebarStyles.groupLabelClass), children: label }),
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
910
|
+
"div",
|
|
911
|
+
{
|
|
912
|
+
"data-slot": "sidebar-group-content",
|
|
913
|
+
"data-sidebar": "group-content",
|
|
914
|
+
className: (0, import_vortex_ui30.cn)(import_vortex_ui30.sidebarStyles.groupContentClass),
|
|
915
|
+
children
|
|
916
|
+
}
|
|
917
|
+
)
|
|
918
|
+
] });
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
// src/sidebar/GroupAction.tsx
|
|
922
|
+
var import_factory18 = require("@ark-ui/react/factory");
|
|
923
|
+
var import_vortex_ui31 = require("@cloudvoyant/vortex-ui");
|
|
924
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
925
|
+
function GroupAction({ className, asChild = false, ...props }) {
|
|
926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
927
|
+
import_factory18.ark.button,
|
|
928
|
+
{
|
|
929
|
+
"data-slot": "sidebar-group-action",
|
|
930
|
+
"data-sidebar": "group-action",
|
|
931
|
+
asChild,
|
|
932
|
+
type: "button",
|
|
933
|
+
className: (0, import_vortex_ui31.cn)(import_vortex_ui31.sidebarStyles.groupActionClass, className),
|
|
934
|
+
...props
|
|
935
|
+
}
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
// src/sidebar/Menu.tsx
|
|
940
|
+
var import_factory19 = require("@ark-ui/react/factory");
|
|
941
|
+
var import_vortex_ui32 = require("@cloudvoyant/vortex-ui");
|
|
942
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
943
|
+
function Menu({ className, ...props }) {
|
|
944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
945
|
+
import_factory19.ark.ul,
|
|
946
|
+
{
|
|
947
|
+
"data-slot": "sidebar-menu",
|
|
948
|
+
"data-sidebar": "menu",
|
|
949
|
+
className: (0, import_vortex_ui32.cn)(import_vortex_ui32.sidebarStyles.menuClass, className),
|
|
950
|
+
...props
|
|
951
|
+
}
|
|
952
|
+
);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
// src/sidebar/MenuItem.tsx
|
|
956
|
+
var import_factory20 = require("@ark-ui/react/factory");
|
|
957
|
+
var import_vortex_ui33 = require("@cloudvoyant/vortex-ui");
|
|
958
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
959
|
+
function MenuItem({ className, ...props }) {
|
|
960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
961
|
+
import_factory20.ark.li,
|
|
962
|
+
{
|
|
963
|
+
"data-slot": "sidebar-menu-item",
|
|
964
|
+
"data-sidebar": "menu-item",
|
|
965
|
+
className: (0, import_vortex_ui33.cn)(import_vortex_ui33.sidebarStyles.menuItemClass, className),
|
|
966
|
+
...props
|
|
967
|
+
}
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
// src/sidebar/MenuButton.tsx
|
|
972
|
+
var import_factory21 = require("@ark-ui/react/factory");
|
|
973
|
+
var import_tooltip2 = require("@ark-ui/react/tooltip");
|
|
974
|
+
var import_vortex_ui34 = require("@cloudvoyant/vortex-ui");
|
|
975
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
976
|
+
function MenuButton({
|
|
977
|
+
asChild = false,
|
|
978
|
+
isActive = false,
|
|
979
|
+
variant = "default",
|
|
980
|
+
size = "default",
|
|
981
|
+
tooltip,
|
|
982
|
+
className,
|
|
983
|
+
children,
|
|
984
|
+
...props
|
|
985
|
+
}) {
|
|
986
|
+
const { isMobile, state } = useSidebar();
|
|
987
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
988
|
+
import_factory21.ark.button,
|
|
989
|
+
{
|
|
990
|
+
"data-slot": "sidebar-menu-button",
|
|
991
|
+
"data-sidebar": "menu-button",
|
|
992
|
+
"data-size": size,
|
|
993
|
+
"data-active": isActive,
|
|
994
|
+
asChild,
|
|
995
|
+
type: "button",
|
|
996
|
+
className: (0, import_vortex_ui34.cn)((0, import_vortex_ui34.sidebarMenuButtonVariants)({ variant, size }), className),
|
|
997
|
+
...props,
|
|
998
|
+
children
|
|
999
|
+
}
|
|
1000
|
+
);
|
|
1001
|
+
if (!tooltip || state !== "collapsed" || isMobile) {
|
|
1002
|
+
return button;
|
|
1003
|
+
}
|
|
1004
|
+
const tooltipContent = typeof tooltip === "string" ? { children: tooltip } : tooltip;
|
|
1005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_tooltip2.TooltipRoot, { openDelay: 0, positioning: { placement: "right", gutter: 8 }, children: [
|
|
1006
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_tooltip2.TooltipTrigger, { asChild: true, children: button }),
|
|
1007
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_tooltip2.TooltipPositioner, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_tooltip2.TooltipContent, { className: (0, import_vortex_ui34.cn)(import_vortex_ui34.sidebarStyles.tooltipContentClass), ...tooltipContent }) })
|
|
1008
|
+
] });
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
// src/sidebar/MenuLink.tsx
|
|
1012
|
+
var import_vortex_ui35 = require("@cloudvoyant/vortex-ui");
|
|
1013
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1014
|
+
function MenuLink({
|
|
1015
|
+
icon,
|
|
1016
|
+
href,
|
|
1017
|
+
onClick,
|
|
1018
|
+
isActive,
|
|
1019
|
+
variant,
|
|
1020
|
+
size,
|
|
1021
|
+
tooltip,
|
|
1022
|
+
className,
|
|
1023
|
+
children
|
|
1024
|
+
}) {
|
|
1025
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
1026
|
+
icon,
|
|
1027
|
+
children != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children })
|
|
1028
|
+
] });
|
|
1029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: (0, import_vortex_ui35.cn)(import_vortex_ui35.sidebarStyles.menuItemClass), children: href == null ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1030
|
+
MenuButton,
|
|
1031
|
+
{
|
|
1032
|
+
isActive,
|
|
1033
|
+
variant,
|
|
1034
|
+
size,
|
|
1035
|
+
tooltip,
|
|
1036
|
+
className,
|
|
1037
|
+
onClick,
|
|
1038
|
+
children: content
|
|
1039
|
+
}
|
|
1040
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MenuButton, { asChild: true, isActive, variant, size, tooltip, className, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("a", { href, onClick, children: content }) }) });
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
// src/sidebar/MenuAction.tsx
|
|
1044
|
+
var import_factory22 = require("@ark-ui/react/factory");
|
|
1045
|
+
var import_vortex_ui36 = require("@cloudvoyant/vortex-ui");
|
|
1046
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1047
|
+
function MenuAction({
|
|
1048
|
+
className,
|
|
1049
|
+
asChild = false,
|
|
1050
|
+
showOnHover = false,
|
|
1051
|
+
...props
|
|
1052
|
+
}) {
|
|
1053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1054
|
+
import_factory22.ark.button,
|
|
1055
|
+
{
|
|
1056
|
+
"data-slot": "sidebar-menu-action",
|
|
1057
|
+
"data-sidebar": "menu-action",
|
|
1058
|
+
asChild,
|
|
1059
|
+
type: "button",
|
|
1060
|
+
className: (0, import_vortex_ui36.cn)(
|
|
1061
|
+
import_vortex_ui36.sidebarStyles.menuActionClass,
|
|
1062
|
+
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",
|
|
1063
|
+
className
|
|
1064
|
+
),
|
|
1065
|
+
...props
|
|
1066
|
+
}
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
// src/sidebar/MenuBadge.tsx
|
|
1071
|
+
var import_factory23 = require("@ark-ui/react/factory");
|
|
1072
|
+
var import_vortex_ui37 = require("@cloudvoyant/vortex-ui");
|
|
1073
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1074
|
+
function MenuBadge({ className, ...props }) {
|
|
1075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1076
|
+
import_factory23.ark.div,
|
|
1077
|
+
{
|
|
1078
|
+
"data-slot": "sidebar-menu-badge",
|
|
1079
|
+
"data-sidebar": "menu-badge",
|
|
1080
|
+
className: (0, import_vortex_ui37.cn)(import_vortex_ui37.sidebarStyles.menuBadgeClass, className),
|
|
1081
|
+
...props
|
|
1082
|
+
}
|
|
1083
|
+
);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
// src/sidebar/MenuSkeleton.tsx
|
|
1087
|
+
var React3 = __toESM(require("react"), 1);
|
|
1088
|
+
var import_factory24 = require("@ark-ui/react/factory");
|
|
1089
|
+
var import_vortex_ui38 = require("@cloudvoyant/vortex-ui");
|
|
1090
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1091
|
+
function MenuSkeleton({ className, showIcon = false, ...props }) {
|
|
1092
|
+
const width = React3.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
1093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
1094
|
+
import_factory24.ark.div,
|
|
1095
|
+
{
|
|
1096
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
1097
|
+
"data-sidebar": "menu-skeleton",
|
|
1098
|
+
className: (0, import_vortex_ui38.cn)(import_vortex_ui38.sidebarStyles.menuSkeletonClass, className),
|
|
1099
|
+
...props,
|
|
1100
|
+
children: [
|
|
1101
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1102
|
+
import_factory24.ark.div,
|
|
1103
|
+
{
|
|
1104
|
+
className: "size-4 shrink-0 animate-pulse rounded-md bg-sidebar-accent",
|
|
1105
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
1106
|
+
}
|
|
1107
|
+
),
|
|
1108
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1109
|
+
import_factory24.ark.div,
|
|
1110
|
+
{
|
|
1111
|
+
className: "h-4 max-w-(--skeleton-width) flex-1 animate-pulse rounded-md bg-sidebar-accent",
|
|
1112
|
+
"data-sidebar": "menu-skeleton-text",
|
|
1113
|
+
style: { "--skeleton-width": width }
|
|
1114
|
+
}
|
|
1115
|
+
)
|
|
1116
|
+
]
|
|
1117
|
+
}
|
|
1118
|
+
);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
// src/sidebar/MenuSub.tsx
|
|
1122
|
+
var import_factory25 = require("@ark-ui/react/factory");
|
|
1123
|
+
var import_vortex_ui39 = require("@cloudvoyant/vortex-ui");
|
|
1124
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1125
|
+
function MenuSub({ className, ...props }) {
|
|
1126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1127
|
+
import_factory25.ark.ul,
|
|
1128
|
+
{
|
|
1129
|
+
"data-slot": "sidebar-menu-sub",
|
|
1130
|
+
"data-sidebar": "menu-sub",
|
|
1131
|
+
className: (0, import_vortex_ui39.cn)(import_vortex_ui39.sidebarStyles.menuSubClass, className),
|
|
1132
|
+
...props
|
|
1133
|
+
}
|
|
1134
|
+
);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
// src/sidebar/MenuSubItem.tsx
|
|
1138
|
+
var import_factory26 = require("@ark-ui/react/factory");
|
|
1139
|
+
var import_vortex_ui40 = require("@cloudvoyant/vortex-ui");
|
|
1140
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1141
|
+
function MenuSubItem({ className, ...props }) {
|
|
1142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1143
|
+
import_factory26.ark.li,
|
|
1144
|
+
{
|
|
1145
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
1146
|
+
"data-sidebar": "menu-sub-item",
|
|
1147
|
+
className: (0, import_vortex_ui40.cn)(import_vortex_ui40.sidebarStyles.menuSubItemClass, className),
|
|
1148
|
+
...props
|
|
1149
|
+
}
|
|
1150
|
+
);
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
// src/sidebar/MenuSubButton.tsx
|
|
1154
|
+
var import_factory27 = require("@ark-ui/react/factory");
|
|
1155
|
+
var import_vortex_ui41 = require("@cloudvoyant/vortex-ui");
|
|
1156
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1157
|
+
function MenuSubButton({
|
|
1158
|
+
asChild = false,
|
|
1159
|
+
size = "md",
|
|
1160
|
+
isActive = false,
|
|
1161
|
+
className,
|
|
1162
|
+
...props
|
|
1163
|
+
}) {
|
|
1164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1165
|
+
import_factory27.ark.a,
|
|
1166
|
+
{
|
|
1167
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
1168
|
+
"data-sidebar": "menu-sub-button",
|
|
1169
|
+
"data-size": size,
|
|
1170
|
+
"data-active": isActive,
|
|
1171
|
+
asChild,
|
|
1172
|
+
className: (0, import_vortex_ui41.cn)(import_vortex_ui41.sidebarStyles.menuSubButtonClass, className),
|
|
1173
|
+
...props
|
|
1174
|
+
}
|
|
1175
|
+
);
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
// src/sidebar/Trigger.tsx
|
|
1179
|
+
var import_factory28 = require("@ark-ui/react/factory");
|
|
1180
|
+
var import_vortex_ui42 = require("@cloudvoyant/vortex-ui");
|
|
1181
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1182
|
+
function Trigger({ className, onClick, children, ...props }) {
|
|
1183
|
+
const { toggleSidebar } = useSidebar();
|
|
1184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1185
|
+
import_factory28.ark.button,
|
|
1186
|
+
{
|
|
1187
|
+
"data-sidebar": "trigger",
|
|
1188
|
+
"data-slot": "sidebar-trigger",
|
|
1189
|
+
type: "button",
|
|
1190
|
+
"aria-label": "Toggle Sidebar",
|
|
1191
|
+
className: (0, import_vortex_ui42.cn)(import_vortex_ui42.sidebarStyles.triggerClass, className),
|
|
1192
|
+
onClick: (event) => {
|
|
1193
|
+
onClick?.(event);
|
|
1194
|
+
toggleSidebar();
|
|
1195
|
+
},
|
|
1196
|
+
...props,
|
|
1197
|
+
children
|
|
1198
|
+
}
|
|
1199
|
+
);
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
// src/sidebar/Rail.tsx
|
|
1203
|
+
var import_factory29 = require("@ark-ui/react/factory");
|
|
1204
|
+
var import_vortex_ui43 = require("@cloudvoyant/vortex-ui");
|
|
1205
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1206
|
+
function Rail({ className, ...props }) {
|
|
1207
|
+
const { toggleSidebar } = useSidebar();
|
|
1208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1209
|
+
import_factory29.ark.button,
|
|
1210
|
+
{
|
|
1211
|
+
"data-sidebar": "rail",
|
|
1212
|
+
"data-slot": "sidebar-rail",
|
|
1213
|
+
type: "button",
|
|
1214
|
+
"aria-label": "Toggle Sidebar",
|
|
1215
|
+
tabIndex: -1,
|
|
1216
|
+
onClick: toggleSidebar,
|
|
1217
|
+
title: "Toggle Sidebar",
|
|
1218
|
+
className: (0, import_vortex_ui43.cn)(import_vortex_ui43.sidebarStyles.railClass, className),
|
|
1219
|
+
...props
|
|
1220
|
+
}
|
|
1221
|
+
);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
// src/sidebar/Inset.tsx
|
|
1225
|
+
var import_factory30 = require("@ark-ui/react/factory");
|
|
1226
|
+
var import_vortex_ui44 = require("@cloudvoyant/vortex-ui");
|
|
1227
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1228
|
+
function Inset({ className, ...props }) {
|
|
1229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_factory30.ark.main, { "data-slot": "sidebar-inset", className: (0, import_vortex_ui44.cn)(import_vortex_ui44.sidebarStyles.insetClass, className), ...props });
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
// src/sidebar/Input.tsx
|
|
1233
|
+
var import_factory31 = require("@ark-ui/react/factory");
|
|
1234
|
+
var import_vortex_ui45 = require("@cloudvoyant/vortex-ui");
|
|
1235
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1236
|
+
function Input({ className, ...props }) {
|
|
1237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1238
|
+
import_factory31.ark.input,
|
|
1239
|
+
{
|
|
1240
|
+
"data-slot": "sidebar-input",
|
|
1241
|
+
"data-sidebar": "input",
|
|
1242
|
+
className: (0, import_vortex_ui45.cn)(import_vortex_ui45.sidebarStyles.inputClass, className),
|
|
1243
|
+
...props
|
|
1244
|
+
}
|
|
1245
|
+
);
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
// src/tabs.tsx
|
|
1249
|
+
var import_tabs = require("@ark-ui/react/tabs");
|
|
1250
|
+
var import_vortex_ui46 = require("@cloudvoyant/vortex-ui");
|
|
1251
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1252
|
+
function Tabs({ className, lazyMount = true, unmountOnExit = true, ...props }) {
|
|
1253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_tabs.TabsRoot, { lazyMount, unmountOnExit, className: (0, import_vortex_ui46.cn)(import_vortex_ui46.tabsRootBase, className), ...props });
|
|
1254
|
+
}
|
|
1255
|
+
function TabsList({ variant = "default", className, children, ...props }) {
|
|
1256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_tabs.TabList, { className: (0, import_vortex_ui46.cn)(import_vortex_ui46.tabsListBase, (0, import_vortex_ui46.tabsListVariants)({ variant }), className), ...props, children: [
|
|
1257
|
+
children,
|
|
1258
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_tabs.TabIndicator, { className: (0, import_vortex_ui46.cn)(import_vortex_ui46.tabsIndicatorBase, (0, import_vortex_ui46.tabsIndicatorVariants)({ variant })) })
|
|
1259
|
+
] });
|
|
1260
|
+
}
|
|
1261
|
+
function TabsTrigger({ className, ...props }) {
|
|
1262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_tabs.TabTrigger, { className: (0, import_vortex_ui46.cn)(import_vortex_ui46.tabsTriggerBase, className), ...props });
|
|
1263
|
+
}
|
|
1264
|
+
function TabsContent({ className, ...props }) {
|
|
1265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_tabs.TabContent, { className: (0, import_vortex_ui46.cn)(import_vortex_ui46.tabsContentBase, className), ...props });
|
|
1266
|
+
}
|
|
1267
|
+
var useTabs = import_tabs.useTabsContext;
|
|
1268
|
+
|
|
1269
|
+
// src/pagination.tsx
|
|
1270
|
+
var import_pagination = require("@ark-ui/react/pagination");
|
|
1271
|
+
var import_factory32 = require("@ark-ui/react/factory");
|
|
1272
|
+
var import_vortex_ui47 = require("@cloudvoyant/vortex-ui");
|
|
1273
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
1274
|
+
function Pagination({ className, ...props }) {
|
|
1275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_pagination.PaginationRoot, { className: (0, import_vortex_ui47.cn)(import_vortex_ui47.paginationRootBase, className), ...props });
|
|
1276
|
+
}
|
|
1277
|
+
function PaginationPrevious(props) {
|
|
1278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_pagination.PaginationPrevTrigger, { asChild: true, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_factory32.ark.button, { className: (0, import_vortex_ui47.cn)(import_vortex_ui47.paginationTriggerBase), children: [
|
|
1279
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
1280
|
+
"svg",
|
|
1281
|
+
{
|
|
1282
|
+
viewBox: "0 0 24 24",
|
|
1283
|
+
fill: "none",
|
|
1284
|
+
stroke: "currentColor",
|
|
1285
|
+
strokeWidth: "2",
|
|
1286
|
+
strokeLinecap: "round",
|
|
1287
|
+
strokeLinejoin: "round",
|
|
1288
|
+
"aria-hidden": "true",
|
|
1289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "m15 18-6-6 6-6" })
|
|
1290
|
+
}
|
|
1291
|
+
),
|
|
1292
|
+
"Previous"
|
|
1293
|
+
] }) });
|
|
1294
|
+
}
|
|
1295
|
+
function PaginationNext(props) {
|
|
1296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_pagination.PaginationNextTrigger, { asChild: true, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_factory32.ark.button, { className: (0, import_vortex_ui47.cn)(import_vortex_ui47.paginationTriggerBase), children: [
|
|
1297
|
+
"Next",
|
|
1298
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
1299
|
+
"svg",
|
|
1300
|
+
{
|
|
1301
|
+
viewBox: "0 0 24 24",
|
|
1302
|
+
fill: "none",
|
|
1303
|
+
stroke: "currentColor",
|
|
1304
|
+
strokeWidth: "2",
|
|
1305
|
+
strokeLinecap: "round",
|
|
1306
|
+
strokeLinejoin: "round",
|
|
1307
|
+
"aria-hidden": "true",
|
|
1308
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "m9 18 6-6-6-6" })
|
|
1309
|
+
}
|
|
1310
|
+
)
|
|
1311
|
+
] }) });
|
|
1312
|
+
}
|
|
1313
|
+
function PaginationItem({ className, children, ...rest }) {
|
|
1314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_pagination.PaginationItem, { asChild: true, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_factory32.ark.button, { className: (0, import_vortex_ui47.cn)(import_vortex_ui47.paginationItemBase, className), children }) });
|
|
1315
|
+
}
|
|
1316
|
+
function PaginationItems() {
|
|
1317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_pagination.PaginationContext, { children: ({ pages }) => pages.map(
|
|
1318
|
+
(page, index) => page.type === "page" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PaginationItem, { type: "page", value: page.value, children: page.value }, page.value) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PaginationEllipsis, { index }, `ellipsis-${index}`)
|
|
1319
|
+
) });
|
|
1320
|
+
}
|
|
1321
|
+
function PaginationEllipsis({ className, ...rest }) {
|
|
1322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_pagination.PaginationEllipsis, { className: (0, import_vortex_ui47.cn)(import_vortex_ui47.paginationEllipsisBase, className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
1323
|
+
"svg",
|
|
1324
|
+
{
|
|
1325
|
+
viewBox: "0 0 24 24",
|
|
1326
|
+
fill: "none",
|
|
1327
|
+
stroke: "currentColor",
|
|
1328
|
+
strokeWidth: "2",
|
|
1329
|
+
strokeLinecap: "round",
|
|
1330
|
+
strokeLinejoin: "round",
|
|
1331
|
+
"aria-hidden": "true",
|
|
1332
|
+
children: [
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("circle", { cx: "12", cy: "12", r: "1" }),
|
|
1334
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("circle", { cx: "19", cy: "12", r: "1" }),
|
|
1335
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("circle", { cx: "5", cy: "12", r: "1" })
|
|
1336
|
+
]
|
|
1337
|
+
}
|
|
1338
|
+
) });
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
// src/navbar.tsx
|
|
1342
|
+
var React4 = __toESM(require("react"), 1);
|
|
1343
|
+
var import_factory33 = require("@ark-ui/react/factory");
|
|
1344
|
+
var import_portal6 = require("@ark-ui/react/portal");
|
|
1345
|
+
var import_collapsible = require("@ark-ui/react/collapsible");
|
|
1346
|
+
var import_dialog2 = require("@ark-ui/react/dialog");
|
|
1347
|
+
var import_navigation_menu = require("@ark-ui/react/navigation-menu");
|
|
1348
|
+
var import_vortex_ui48 = require("@cloudvoyant/vortex-ui");
|
|
1349
|
+
var import_vortex_ui49 = require("@cloudvoyant/vortex-ui");
|
|
1350
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
1351
|
+
var SCROLL_THRESHOLD = 24;
|
|
1352
|
+
function resolveScrollContainer(el) {
|
|
1353
|
+
for (let n = el; n; n = n.parentElement) {
|
|
1354
|
+
const oy = getComputedStyle(n).overflowY;
|
|
1355
|
+
if (oy === "auto" || oy === "scroll" || oy === "overlay") return n;
|
|
1356
|
+
}
|
|
1357
|
+
return null;
|
|
1358
|
+
}
|
|
1359
|
+
var NavbarContext = React4.createContext(null);
|
|
1360
|
+
function useNavbar() {
|
|
1361
|
+
const context = React4.useContext(NavbarContext);
|
|
1362
|
+
if (!context) {
|
|
1363
|
+
throw new Error("Navbar parts must be used within a NavbarProvider.");
|
|
1364
|
+
}
|
|
1365
|
+
return context;
|
|
1366
|
+
}
|
|
1367
|
+
function useNavbarSlot(key, children) {
|
|
1368
|
+
const { setSlot } = useNavbar();
|
|
1369
|
+
React4.useLayoutEffect(() => {
|
|
1370
|
+
setSlot(key, children);
|
|
1371
|
+
}, [key, children, setSlot]);
|
|
1372
|
+
}
|
|
1373
|
+
var NavbarMenuStyleContext = React4.createContext({
|
|
1374
|
+
density: "relaxed",
|
|
1375
|
+
variant: "default",
|
|
1376
|
+
inContent: false
|
|
1377
|
+
});
|
|
1378
|
+
function NavbarProvider({ defaultOpen = false, children }) {
|
|
1379
|
+
const id = React4.useId();
|
|
1380
|
+
const [open, setOpen] = React4.useState(defaultOpen);
|
|
1381
|
+
const [scrolled, setScrolled] = React4.useState(false);
|
|
1382
|
+
const [hovered, setHovered] = React4.useState(false);
|
|
1383
|
+
const [slots, setSlots] = React4.useState({
|
|
1384
|
+
brand: null,
|
|
1385
|
+
actions: null
|
|
1386
|
+
});
|
|
1387
|
+
const portalRef = React4.useRef(null);
|
|
1388
|
+
const setSlot = React4.useCallback((key, node) => {
|
|
1389
|
+
setSlots((prev) => prev[key] === node ? prev : { ...prev, [key]: node });
|
|
1390
|
+
}, []);
|
|
1391
|
+
const contextValue = React4.useMemo(
|
|
1392
|
+
() => ({
|
|
1393
|
+
id,
|
|
1394
|
+
open,
|
|
1395
|
+
setOpen,
|
|
1396
|
+
scrolled,
|
|
1397
|
+
setScrolled,
|
|
1398
|
+
hovered,
|
|
1399
|
+
setHovered,
|
|
1400
|
+
slots,
|
|
1401
|
+
setSlot,
|
|
1402
|
+
portalRef,
|
|
1403
|
+
// Baseline config; the Navbar header overrides these with its props.
|
|
1404
|
+
variant: "sticky",
|
|
1405
|
+
floating: false,
|
|
1406
|
+
density: "relaxed"
|
|
1407
|
+
}),
|
|
1408
|
+
[id, open, scrolled, hovered, slots, setSlot]
|
|
1409
|
+
);
|
|
1410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(NavbarContext.Provider, { value: contextValue, children });
|
|
1411
|
+
}
|
|
1412
|
+
function Navbar({
|
|
1413
|
+
variant = "sticky",
|
|
1414
|
+
floating = false,
|
|
1415
|
+
density = "relaxed",
|
|
1416
|
+
className,
|
|
1417
|
+
children,
|
|
1418
|
+
...props
|
|
1419
|
+
}) {
|
|
1420
|
+
const base = useNavbar();
|
|
1421
|
+
const headerRef = React4.useRef(null);
|
|
1422
|
+
const { setScrolled, setHovered } = base;
|
|
1423
|
+
React4.useEffect(() => {
|
|
1424
|
+
const target = resolveScrollContainer(headerRef.current) ?? window;
|
|
1425
|
+
const getY = () => target === window ? window.scrollY : target.scrollTop;
|
|
1426
|
+
const onScroll = () => setScrolled(getY() > SCROLL_THRESHOLD);
|
|
1427
|
+
onScroll();
|
|
1428
|
+
target.addEventListener("scroll", onScroll, { passive: true });
|
|
1429
|
+
return () => target.removeEventListener("scroll", onScroll);
|
|
1430
|
+
}, [setScrolled]);
|
|
1431
|
+
const value = React4.useMemo(() => ({ ...base, variant, floating, density }), [base, variant, floating, density]);
|
|
1432
|
+
const hidden = variant === "hide" && base.scrolled && !base.hovered;
|
|
1433
|
+
const shrunk = variant === "shrink" && base.scrolled;
|
|
1434
|
+
React4.useLayoutEffect(() => {
|
|
1435
|
+
base.portalRef.current = headerRef.current?.parentElement ?? null;
|
|
1436
|
+
});
|
|
1437
|
+
React4.useEffect(() => {
|
|
1438
|
+
if (!base.open) return;
|
|
1439
|
+
const el = resolveScrollContainer(headerRef.current) ?? document.documentElement;
|
|
1440
|
+
const prev = el.style.overflow;
|
|
1441
|
+
el.style.overflow = "hidden";
|
|
1442
|
+
return () => {
|
|
1443
|
+
el.style.overflow = prev;
|
|
1444
|
+
};
|
|
1445
|
+
}, [base.open]);
|
|
1446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(NavbarContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1447
|
+
"header",
|
|
1448
|
+
{
|
|
1449
|
+
ref: headerRef,
|
|
1450
|
+
"data-slot": "navbar",
|
|
1451
|
+
"data-scrolled": base.scrolled || void 0,
|
|
1452
|
+
"data-hidden": hidden || void 0,
|
|
1453
|
+
"data-shrunk": shrunk || void 0,
|
|
1454
|
+
className: (0, import_vortex_ui48.cn)(
|
|
1455
|
+
(0, import_vortex_ui48.navbarVariants)({ variant, floating }),
|
|
1456
|
+
import_vortex_ui48.navbarContainerBase,
|
|
1457
|
+
(0, import_vortex_ui48.navbarDensityVariants)({ density }),
|
|
1458
|
+
shrunk && import_vortex_ui48.navbarShrunkBase,
|
|
1459
|
+
className
|
|
1460
|
+
),
|
|
1461
|
+
onMouseEnter: () => setHovered(true),
|
|
1462
|
+
onMouseLeave: () => setHovered(false),
|
|
1463
|
+
...props,
|
|
1464
|
+
children
|
|
1465
|
+
}
|
|
1466
|
+
) });
|
|
1467
|
+
}
|
|
1468
|
+
function NavbarActivationArea({ className, children, ...props }) {
|
|
1469
|
+
const { setHovered } = useNavbar();
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1471
|
+
import_factory33.ark.div,
|
|
1472
|
+
{
|
|
1473
|
+
"data-slot": "navbar-activation-area",
|
|
1474
|
+
className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarActivationAreaBase, className),
|
|
1475
|
+
onMouseEnter: () => setHovered(true),
|
|
1476
|
+
onMouseLeave: () => setHovered(false),
|
|
1477
|
+
...props,
|
|
1478
|
+
children
|
|
1479
|
+
}
|
|
1480
|
+
);
|
|
1481
|
+
}
|
|
1482
|
+
function NavbarBrand({ className, children, ...props }) {
|
|
1483
|
+
useNavbarSlot("brand", children);
|
|
1484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_factory33.ark.div, { "data-slot": "navbar-brand", className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarBrandBase, className), ...props, children });
|
|
1485
|
+
}
|
|
1486
|
+
function NavbarMenu({
|
|
1487
|
+
placement = "center",
|
|
1488
|
+
className,
|
|
1489
|
+
children,
|
|
1490
|
+
...props
|
|
1491
|
+
}) {
|
|
1492
|
+
const { scrolled, density, variant } = useNavbar();
|
|
1493
|
+
const menuDensity = density === "compact" || variant === "shrink" && scrolled ? "compact" : "relaxed";
|
|
1494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(NavbarMenuStyleContext.Provider, { value: { density: menuDensity, variant: "default", inContent: false }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1495
|
+
import_factory33.ark.div,
|
|
1496
|
+
{
|
|
1497
|
+
"data-slot": "navbar-menu",
|
|
1498
|
+
"data-placement": placement,
|
|
1499
|
+
className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMenuBase, (0, import_vortex_ui48.navbarMenuPlacementVariants)({ placement }), className),
|
|
1500
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_navigation_menu.NavigationMenuRoot, { "data-density": menuDensity, className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMenuRootBase), ...props, children: [
|
|
1501
|
+
children,
|
|
1502
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_navigation_menu.NavigationMenuViewportPositioner, { className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMenuViewportPositionerBase), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_navigation_menu.NavigationMenuViewport, { className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMenuViewportBase) }) })
|
|
1503
|
+
] })
|
|
1504
|
+
}
|
|
1505
|
+
) });
|
|
1506
|
+
}
|
|
1507
|
+
function NavbarMenuList({ className, children, ...props }) {
|
|
1508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_navigation_menu.NavigationMenuList, { className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMenuListBase, className), ...props, children });
|
|
1509
|
+
}
|
|
1510
|
+
function NavbarMenuItem({
|
|
1511
|
+
variant = "default",
|
|
1512
|
+
className,
|
|
1513
|
+
...props
|
|
1514
|
+
}) {
|
|
1515
|
+
const { density } = React4.useContext(NavbarMenuStyleContext);
|
|
1516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(NavbarMenuStyleContext.Provider, { value: { density, variant, inContent: false }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_navigation_menu.NavigationMenuItem, { "data-variant": variant, className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMenuItemBase, className), ...props }) });
|
|
1517
|
+
}
|
|
1518
|
+
function NavbarMenuTrigger({ asChild, className, children, ...props }) {
|
|
1519
|
+
const { density, variant } = React4.useContext(NavbarMenuStyleContext);
|
|
1520
|
+
const chevron = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1521
|
+
"svg",
|
|
1522
|
+
{
|
|
1523
|
+
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
1524
|
+
"aria-hidden": "true",
|
|
1525
|
+
viewBox: "0 0 24 24",
|
|
1526
|
+
fill: "none",
|
|
1527
|
+
stroke: "currentColor",
|
|
1528
|
+
strokeWidth: "2",
|
|
1529
|
+
strokeLinecap: "round",
|
|
1530
|
+
strokeLinejoin: "round",
|
|
1531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "m6 9 6 6 6-6" })
|
|
1532
|
+
}
|
|
1533
|
+
);
|
|
1534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1535
|
+
import_navigation_menu.NavigationMenuTrigger,
|
|
1536
|
+
{
|
|
1537
|
+
asChild,
|
|
1538
|
+
className: (0, import_vortex_ui48.cn)((0, import_vortex_ui48.navbarMenuTriggerStyle)({ density, variant }), className),
|
|
1539
|
+
...props,
|
|
1540
|
+
children: asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
1541
|
+
children,
|
|
1542
|
+
chevron
|
|
1543
|
+
] })
|
|
1544
|
+
}
|
|
1545
|
+
);
|
|
1546
|
+
}
|
|
1547
|
+
function NavbarMenuContent({ className, children, ...props }) {
|
|
1548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(NavbarMenuStyleContext.Provider, { value: { density: "relaxed", variant: "default", inContent: true }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_navigation_menu.NavigationMenuContent, { className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMenuContentBase, className), ...props, children }) });
|
|
1549
|
+
}
|
|
1550
|
+
function NavbarMenuLink({ className, children, ...props }) {
|
|
1551
|
+
const { density, variant, inContent } = React4.useContext(NavbarMenuStyleContext);
|
|
1552
|
+
const classes = inContent ? (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMenuLinkBase, className) : (0, import_vortex_ui48.cn)((0, import_vortex_ui48.navbarMenuTriggerStyle)({ density, variant }), className);
|
|
1553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_navigation_menu.NavigationMenuLink, { className: classes, ...props, children });
|
|
1554
|
+
}
|
|
1555
|
+
function NavbarMobileMenu({ className, children, ...props }) {
|
|
1556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_collapsible.CollapsibleRoot, { "data-slot": "navbar-mobile-menu", className: (0, import_vortex_ui48.cn)("group", className), ...props, children });
|
|
1557
|
+
}
|
|
1558
|
+
function NavbarMobileMenuTrigger({ className, children, ...props }) {
|
|
1559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_collapsible.CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
1560
|
+
"button",
|
|
1561
|
+
{
|
|
1562
|
+
type: "button",
|
|
1563
|
+
"data-slot": "navbar-mobile-menu-trigger",
|
|
1564
|
+
className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMobileMenuTriggerBase, className),
|
|
1565
|
+
...props,
|
|
1566
|
+
children: [
|
|
1567
|
+
children,
|
|
1568
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1569
|
+
"svg",
|
|
1570
|
+
{
|
|
1571
|
+
className: "size-4 transition-transform duration-200 group-data-[state=open]:rotate-180",
|
|
1572
|
+
"aria-hidden": "true",
|
|
1573
|
+
viewBox: "0 0 24 24",
|
|
1574
|
+
fill: "none",
|
|
1575
|
+
stroke: "currentColor",
|
|
1576
|
+
strokeWidth: "2",
|
|
1577
|
+
strokeLinecap: "round",
|
|
1578
|
+
strokeLinejoin: "round",
|
|
1579
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "m6 9 6 6 6-6" })
|
|
1580
|
+
}
|
|
1581
|
+
)
|
|
1582
|
+
]
|
|
1583
|
+
}
|
|
1584
|
+
) });
|
|
1585
|
+
}
|
|
1586
|
+
function NavbarMobileMenuContent({ className, children, ...props }) {
|
|
1587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_collapsible.CollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { "data-slot": "navbar-mobile-menu-content", className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMobileMenuContentBase, className), ...props, children }) });
|
|
1588
|
+
}
|
|
1589
|
+
function NavbarMenuViewport({ className, ...props }) {
|
|
1590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_navigation_menu.NavigationMenuViewport, { className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMenuViewportBase, className), ...props });
|
|
1591
|
+
}
|
|
1592
|
+
function NavbarMenuIndicator({ className, ...props }) {
|
|
1593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_navigation_menu.NavigationMenuIndicator, { className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMenuIndicatorBase, className), ...props });
|
|
1594
|
+
}
|
|
1595
|
+
function NavbarActions({ className, children, ...props }) {
|
|
1596
|
+
useNavbarSlot("actions", children);
|
|
1597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_factory33.ark.div, { "data-slot": "navbar-actions", className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarActionsBase, className), ...props, children });
|
|
1598
|
+
}
|
|
1599
|
+
function NavbarTrigger({
|
|
1600
|
+
className,
|
|
1601
|
+
children,
|
|
1602
|
+
"aria-label": ariaLabel,
|
|
1603
|
+
...props
|
|
1604
|
+
}) {
|
|
1605
|
+
const { id, open, setOpen, floating } = useNavbar();
|
|
1606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1607
|
+
"button",
|
|
1608
|
+
{
|
|
1609
|
+
type: "button",
|
|
1610
|
+
"data-slot": "navbar-trigger",
|
|
1611
|
+
"aria-expanded": open,
|
|
1612
|
+
"aria-controls": id,
|
|
1613
|
+
"aria-label": ariaLabel ?? "Toggle navigation menu",
|
|
1614
|
+
className: (0, import_vortex_ui48.cn)((0, import_vortex_ui48.navbarTriggerVariants)({ floating }), "md:hidden", className),
|
|
1615
|
+
onClick: () => setOpen(!open),
|
|
1616
|
+
...props,
|
|
1617
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
1618
|
+
"svg",
|
|
1619
|
+
{
|
|
1620
|
+
className: "size-4",
|
|
1621
|
+
viewBox: "0 0 24 24",
|
|
1622
|
+
fill: "none",
|
|
1623
|
+
stroke: "currentColor",
|
|
1624
|
+
strokeWidth: "2",
|
|
1625
|
+
strokeLinecap: "round",
|
|
1626
|
+
strokeLinejoin: "round",
|
|
1627
|
+
"aria-hidden": "true",
|
|
1628
|
+
children: [
|
|
1629
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("line", { x1: "4", x2: "20", y1: "6", y2: "6" }),
|
|
1630
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("line", { x1: "4", x2: "20", y1: "12", y2: "12" }),
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("line", { x1: "4", x2: "20", y1: "18", y2: "18" })
|
|
1632
|
+
]
|
|
1633
|
+
}
|
|
1634
|
+
)
|
|
1635
|
+
}
|
|
1636
|
+
);
|
|
1637
|
+
}
|
|
1638
|
+
function NavbarMobileOverlay({ className, children, ...props }) {
|
|
1639
|
+
const { id, open, setOpen, slots, floating, portalRef } = useNavbar();
|
|
1640
|
+
React4.useEffect(() => {
|
|
1641
|
+
if (!open) return;
|
|
1642
|
+
const onKeydown = (event) => {
|
|
1643
|
+
if (event.key === "Escape") setOpen(false);
|
|
1644
|
+
};
|
|
1645
|
+
document.addEventListener("keydown", onKeydown);
|
|
1646
|
+
return () => document.removeEventListener("keydown", onKeydown);
|
|
1647
|
+
}, [open, setOpen]);
|
|
1648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_portal6.Portal, { container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_dialog2.DialogRoot, { open, lazyMount: true, unmountOnExit: true, onOpenChange: ({ open: open2 }) => setOpen(open2), preventScroll: false, children: [
|
|
1649
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dialog2.DialogBackdrop, { className: "absolute inset-0 z-[100] bg-background/60 backdrop-blur-sm" }),
|
|
1650
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dialog2.DialogPositioner, { className: "absolute inset-0 z-[100]", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
1651
|
+
import_dialog2.DialogContent,
|
|
1652
|
+
{
|
|
1653
|
+
id,
|
|
1654
|
+
"data-slot": "navbar-mobile-overlay",
|
|
1655
|
+
className: (0, import_vortex_ui48.cn)(import_vortex_ui48.navbarMobileContentBase, className),
|
|
1656
|
+
...props,
|
|
1657
|
+
children: [
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dialog2.DialogTitle, { className: "sr-only", children: "Navigation menu" }),
|
|
1659
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dialog2.DialogDescription, { className: "sr-only", children: "Mobile navigation menu" }),
|
|
1660
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: import_vortex_ui48.navbarMobileHeaderBase, children: [
|
|
1661
|
+
slots.brand,
|
|
1662
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dialog2.DialogCloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1663
|
+
"button",
|
|
1664
|
+
{
|
|
1665
|
+
type: "button",
|
|
1666
|
+
"aria-label": "Close navigation menu",
|
|
1667
|
+
className: (0, import_vortex_ui48.cn)((0, import_vortex_ui48.navbarTriggerVariants)({ floating })),
|
|
1668
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1669
|
+
"svg",
|
|
1670
|
+
{
|
|
1671
|
+
className: "size-4",
|
|
1672
|
+
viewBox: "0 0 24 24",
|
|
1673
|
+
fill: "none",
|
|
1674
|
+
stroke: "currentColor",
|
|
1675
|
+
strokeWidth: "2",
|
|
1676
|
+
strokeLinecap: "round",
|
|
1677
|
+
strokeLinejoin: "round",
|
|
1678
|
+
"aria-hidden": "true",
|
|
1679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
1680
|
+
}
|
|
1681
|
+
)
|
|
1682
|
+
}
|
|
1683
|
+
) })
|
|
1684
|
+
] }),
|
|
1685
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: import_vortex_ui48.navbarMobileMenuBase, children }),
|
|
1686
|
+
slots.actions ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: import_vortex_ui48.navbarMobileActionsBase, children: slots.actions }) : null
|
|
1687
|
+
]
|
|
1688
|
+
}
|
|
1689
|
+
) })
|
|
1690
|
+
] }) });
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
// src/field.tsx
|
|
1694
|
+
var import_field = require("@ark-ui/react/field");
|
|
1695
|
+
var import_fieldset = require("@ark-ui/react/fieldset");
|
|
1696
|
+
var import_vortex_ui50 = require("@cloudvoyant/vortex-ui");
|
|
1697
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
1698
|
+
function Field({ className, ...props }) {
|
|
1699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_field.FieldRoot, { className: (0, import_vortex_ui50.cn)(import_vortex_ui50.fieldRootBase, className), ...props });
|
|
1700
|
+
}
|
|
1701
|
+
function FieldLabel({ className, ...props }) {
|
|
1702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_field.FieldLabel, { className: (0, import_vortex_ui50.cn)(import_vortex_ui50.fieldLabelBase, className), ...props });
|
|
1703
|
+
}
|
|
1704
|
+
function FieldHelper({ className, ...props }) {
|
|
1705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_field.FieldHelperText, { className: (0, import_vortex_ui50.cn)(import_vortex_ui50.fieldHelperBase, className), ...props });
|
|
1706
|
+
}
|
|
1707
|
+
function FieldError({ className, ...props }) {
|
|
1708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_field.FieldErrorText, { className: (0, import_vortex_ui50.cn)(import_vortex_ui50.fieldErrorBase, className), ...props });
|
|
1709
|
+
}
|
|
1710
|
+
function FieldRequiredIndicator({ className, ...props }) {
|
|
1711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_field.FieldRequiredIndicator, { className: (0, import_vortex_ui50.cn)(import_vortex_ui50.fieldRequiredIndicatorBase, className), ...props });
|
|
1712
|
+
}
|
|
1713
|
+
function FieldSet({ className, ...props }) {
|
|
1714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_fieldset.FieldsetRoot, { className: (0, import_vortex_ui50.cn)(import_vortex_ui50.fieldsetRootBase, className), ...props });
|
|
1715
|
+
}
|
|
1716
|
+
function FieldSetLegend({ className, ...props }) {
|
|
1717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_fieldset.FieldsetLegend, { className: (0, import_vortex_ui50.cn)(import_vortex_ui50.fieldsetLegendBase, className), ...props });
|
|
1718
|
+
}
|
|
1719
|
+
function FieldSetHelper({ className, ...props }) {
|
|
1720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_fieldset.FieldsetHelperText, { className: (0, import_vortex_ui50.cn)(import_vortex_ui50.fieldsetHelperBase, className), ...props });
|
|
1721
|
+
}
|
|
1722
|
+
function FieldSetError({ className, ...props }) {
|
|
1723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_fieldset.FieldsetErrorText, { className: (0, import_vortex_ui50.cn)(import_vortex_ui50.fieldsetErrorBase, className), ...props });
|
|
1724
|
+
}
|
|
1725
|
+
var useField = import_field.useFieldContext;
|
|
1726
|
+
|
|
1727
|
+
// src/input.tsx
|
|
1728
|
+
var import_field2 = require("@ark-ui/react/field");
|
|
1729
|
+
var import_vortex_ui51 = require("@cloudvoyant/vortex-ui");
|
|
1730
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
1731
|
+
function Input2({ className, size, ...props }) {
|
|
1732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_field2.FieldInput, { className: (0, import_vortex_ui51.cn)((0, import_vortex_ui51.inputVariants)({ size }), className), ...props });
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
// src/textarea.tsx
|
|
1736
|
+
var import_field3 = require("@ark-ui/react/field");
|
|
1737
|
+
var import_vortex_ui52 = require("@cloudvoyant/vortex-ui");
|
|
1738
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
1739
|
+
function Textarea({ className, ...props }) {
|
|
1740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_field3.FieldTextarea, { className: (0, import_vortex_ui52.cn)(import_vortex_ui52.textareaBase, className), ...props });
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
// src/number-input.tsx
|
|
1744
|
+
var import_number_input = require("@ark-ui/react/number-input");
|
|
1745
|
+
var import_vortex_ui53 = require("@cloudvoyant/vortex-ui");
|
|
1746
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
1747
|
+
function NumberInput({ className, ...props }) {
|
|
1748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_number_input.NumberInputRoot, { className: (0, import_vortex_ui53.cn)(import_vortex_ui53.numberInputRootBase, className), ...props });
|
|
1749
|
+
}
|
|
1750
|
+
function NumberInputControl({ className, ...props }) {
|
|
1751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_number_input.NumberInputControl, { className: (0, import_vortex_ui53.cn)(import_vortex_ui53.numberInputControlBase, className), ...props });
|
|
1752
|
+
}
|
|
1753
|
+
function NumberInputInput({ className, ...props }) {
|
|
1754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_number_input.NumberInputInput, { className: (0, import_vortex_ui53.cn)(import_vortex_ui53.numberInputInputBase, className), ...props });
|
|
1755
|
+
}
|
|
1756
|
+
function NumberInputDecrement({ className, ...props }) {
|
|
1757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
1758
|
+
import_number_input.NumberInputDecrementTrigger,
|
|
1759
|
+
{
|
|
1760
|
+
"aria-label": "Decrement",
|
|
1761
|
+
className: (0, import_vortex_ui53.cn)(import_vortex_ui53.numberInputTriggerBase, className),
|
|
1762
|
+
...props
|
|
1763
|
+
}
|
|
1764
|
+
);
|
|
1765
|
+
}
|
|
1766
|
+
function NumberInputIncrement({ className, ...props }) {
|
|
1767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
1768
|
+
import_number_input.NumberInputIncrementTrigger,
|
|
1769
|
+
{
|
|
1770
|
+
"aria-label": "Increment",
|
|
1771
|
+
className: (0, import_vortex_ui53.cn)(import_vortex_ui53.numberInputTriggerBase, className),
|
|
1772
|
+
...props
|
|
1773
|
+
}
|
|
1774
|
+
);
|
|
1775
|
+
}
|
|
1776
|
+
var useNumberInput = import_number_input.useNumberInputContext;
|
|
1777
|
+
|
|
1778
|
+
// src/checkbox.tsx
|
|
1779
|
+
var import_react2 = require("react");
|
|
1780
|
+
var import_checkbox = require("@ark-ui/react/checkbox");
|
|
1781
|
+
var import_vortex_ui54 = require("@cloudvoyant/vortex-ui");
|
|
1782
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
1783
|
+
var CheckboxSizeContext = (0, import_react2.createContext)("md");
|
|
1784
|
+
function Checkbox({ className, size = "md", children, ...props }) {
|
|
1785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CheckboxSizeContext.Provider, { value: size, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_checkbox.CheckboxRoot, { className: (0, import_vortex_ui54.cn)("flex items-center gap-2", className), ...props, children: [
|
|
1786
|
+
children,
|
|
1787
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_checkbox.CheckboxHiddenInput, {})
|
|
1788
|
+
] }) });
|
|
1789
|
+
}
|
|
1790
|
+
function CheckboxControl({ className, ...props }) {
|
|
1791
|
+
const size = (0, import_react2.useContext)(CheckboxSizeContext);
|
|
1792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_checkbox.CheckboxControl, { className: (0, import_vortex_ui54.cn)((0, import_vortex_ui54.checkboxVariants)({ size }), className), ...props });
|
|
1793
|
+
}
|
|
1794
|
+
function CheckboxIndicator({ className, ...props }) {
|
|
1795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_checkbox.CheckboxIndicator, { className: (0, import_vortex_ui54.cn)(import_vortex_ui54.checkboxIndicatorBase, className), ...props });
|
|
1796
|
+
}
|
|
1797
|
+
function CheckboxLabel({ className, ...props }) {
|
|
1798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_checkbox.CheckboxLabel, { className: (0, import_vortex_ui54.cn)(import_vortex_ui54.checkboxLabelBase, className), ...props });
|
|
1799
|
+
}
|
|
1800
|
+
function CheckboxGroup({ className, ...props }) {
|
|
1801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_checkbox.CheckboxGroup, { className: (0, import_vortex_ui54.cn)(import_vortex_ui54.checkboxGroupBase, className), ...props });
|
|
1802
|
+
}
|
|
1803
|
+
var useCheckbox = import_checkbox.useCheckboxContext;
|
|
1804
|
+
|
|
1805
|
+
// src/switch.tsx
|
|
1806
|
+
var import_react3 = require("react");
|
|
1807
|
+
var import_switch = require("@ark-ui/react/switch");
|
|
1808
|
+
var import_vortex_ui55 = require("@cloudvoyant/vortex-ui");
|
|
1809
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
1810
|
+
var SwitchSizeContext = (0, import_react3.createContext)("md");
|
|
1811
|
+
function Switch({ className, size = "md", children, ...props }) {
|
|
1812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SwitchSizeContext.Provider, { value: size, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_switch.SwitchRoot, { className: (0, import_vortex_ui55.cn)("flex items-center gap-2", className), ...props, children: [
|
|
1813
|
+
children,
|
|
1814
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_switch.SwitchHiddenInput, {})
|
|
1815
|
+
] }) });
|
|
1816
|
+
}
|
|
1817
|
+
function SwitchControl({ className, ...props }) {
|
|
1818
|
+
const size = (0, import_react3.useContext)(SwitchSizeContext);
|
|
1819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_switch.SwitchControl, { className: (0, import_vortex_ui55.cn)((0, import_vortex_ui55.switchVariants)({ size }), import_vortex_ui55.switchControlBase, className), ...props });
|
|
1820
|
+
}
|
|
1821
|
+
function SwitchThumb({ className, ...props }) {
|
|
1822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_switch.SwitchThumb, { className: (0, import_vortex_ui55.cn)(import_vortex_ui55.switchThumbBase, className), ...props });
|
|
1823
|
+
}
|
|
1824
|
+
function SwitchLabel({ className, ...props }) {
|
|
1825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_switch.SwitchLabel, { className: (0, import_vortex_ui55.cn)(import_vortex_ui55.switchLabelBase, className), ...props });
|
|
1826
|
+
}
|
|
1827
|
+
var useSwitch = import_switch.useSwitchContext;
|
|
1828
|
+
|
|
1829
|
+
// src/select.tsx
|
|
1830
|
+
var import_factory34 = require("@ark-ui/react/factory");
|
|
1831
|
+
var import_portal7 = require("@ark-ui/react/portal");
|
|
1832
|
+
var import_react5 = require("react");
|
|
1833
|
+
var import_select = require("@ark-ui/react/select");
|
|
1834
|
+
var import_vortex_ui56 = require("@cloudvoyant/vortex-ui");
|
|
1835
|
+
|
|
1836
|
+
// src/use-media-query.ts
|
|
1837
|
+
var import_react4 = require("react");
|
|
1838
|
+
function useMediaQuery(query) {
|
|
1839
|
+
return (0, import_react4.useSyncExternalStore)(
|
|
1840
|
+
(onStoreChange) => {
|
|
1841
|
+
const mql = window.matchMedia(query);
|
|
1842
|
+
mql.addEventListener("change", onStoreChange);
|
|
1843
|
+
return () => mql.removeEventListener("change", onStoreChange);
|
|
1844
|
+
},
|
|
1845
|
+
() => window.matchMedia(query).matches,
|
|
1846
|
+
() => false
|
|
1847
|
+
);
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
// src/select.tsx
|
|
1851
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
1852
|
+
function Select({ items, collection, size, children, ...props }) {
|
|
1853
|
+
const isCoarse = useMediaQuery("(pointer: coarse)");
|
|
1854
|
+
const resolvedCollection = (0, import_react5.useMemo)(
|
|
1855
|
+
() => collection ?? (0, import_select.createListCollection)({ items: items ?? [] }),
|
|
1856
|
+
[collection, items]
|
|
1857
|
+
);
|
|
1858
|
+
if (isCoarse && items) {
|
|
1859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
1860
|
+
SelectNative,
|
|
1861
|
+
{
|
|
1862
|
+
items,
|
|
1863
|
+
size,
|
|
1864
|
+
value: props.value?.[0],
|
|
1865
|
+
defaultValue: props.defaultValue?.[0],
|
|
1866
|
+
onValueChange: (value) => props.onValueChange?.({ value: [value], items: items.filter((i) => i.value === value) }),
|
|
1867
|
+
invalid: props.invalid,
|
|
1868
|
+
disabled: props.disabled,
|
|
1869
|
+
name: props.name,
|
|
1870
|
+
form: props.form,
|
|
1871
|
+
required: props.required
|
|
1872
|
+
}
|
|
1873
|
+
);
|
|
1874
|
+
}
|
|
1875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_select.SelectRoot, { collection: resolvedCollection, ...props, children: [
|
|
1876
|
+
children,
|
|
1877
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectHiddenSelect, {})
|
|
1878
|
+
] });
|
|
1879
|
+
}
|
|
1880
|
+
function SelectTrigger({ size = "md", className, ...props }) {
|
|
1881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectTrigger, { className: (0, import_vortex_ui56.cn)((0, import_vortex_ui56.inputVariants)({ size }), import_vortex_ui56.selectTriggerBase, className), ...props });
|
|
1882
|
+
}
|
|
1883
|
+
function SelectValue({ className, ...props }) {
|
|
1884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectValueText, { className: (0, import_vortex_ui56.cn)(import_vortex_ui56.selectValueBase, className), ...props });
|
|
1885
|
+
}
|
|
1886
|
+
function SelectIndicator({ className, ...props }) {
|
|
1887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectIndicator, { className: (0, import_vortex_ui56.cn)(import_vortex_ui56.selectIndicatorBase, className), ...props });
|
|
1888
|
+
}
|
|
1889
|
+
function SelectClearTrigger({ className, ...props }) {
|
|
1890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectClearTrigger, { "aria-label": "Clear selection", className: (0, import_vortex_ui56.cn)(import_vortex_ui56.selectClearTriggerBase, className), ...props });
|
|
1891
|
+
}
|
|
1892
|
+
function SelectContent({ className, ...props }) {
|
|
1893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_portal7.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectPositioner, { className: import_vortex_ui56.selectPositionerBase, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectContent, { className: (0, import_vortex_ui56.cn)(import_vortex_ui56.selectContentBase, className), ...props }) }) });
|
|
1894
|
+
}
|
|
1895
|
+
function SelectItemGroup({ className, ...props }) {
|
|
1896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectItemGroup, { className, ...props });
|
|
1897
|
+
}
|
|
1898
|
+
function SelectItemGroupLabel({ className, ...props }) {
|
|
1899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectItemGroupLabel, { className: (0, import_vortex_ui56.cn)(import_vortex_ui56.selectItemGroupLabelBase, className), ...props });
|
|
1900
|
+
}
|
|
1901
|
+
function SelectItem({ item, className, ...props }) {
|
|
1902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectItem, { item, className: (0, import_vortex_ui56.cn)(import_vortex_ui56.selectItemBase, className), ...props });
|
|
1903
|
+
}
|
|
1904
|
+
function SelectItemText({ className, ...props }) {
|
|
1905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectItemText, { className: (0, import_vortex_ui56.cn)(import_vortex_ui56.selectItemTextBase, className), ...props });
|
|
1906
|
+
}
|
|
1907
|
+
function SelectItemIndicator({ className, ...props }) {
|
|
1908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_select.SelectItemIndicator, { className: (0, import_vortex_ui56.cn)(import_vortex_ui56.selectItemIndicatorBase, className), ...props });
|
|
1909
|
+
}
|
|
1910
|
+
var useSelect = import_select.useSelectContext;
|
|
1911
|
+
function ChevronDownIcon() {
|
|
1912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
1913
|
+
"svg",
|
|
1914
|
+
{
|
|
1915
|
+
viewBox: "0 0 24 24",
|
|
1916
|
+
fill: "none",
|
|
1917
|
+
stroke: "currentColor",
|
|
1918
|
+
strokeWidth: "2",
|
|
1919
|
+
strokeLinecap: "round",
|
|
1920
|
+
strokeLinejoin: "round",
|
|
1921
|
+
"aria-hidden": true,
|
|
1922
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("path", { d: "m6 9 6 6 6-6" })
|
|
1923
|
+
}
|
|
1924
|
+
);
|
|
1925
|
+
}
|
|
1926
|
+
function SelectNative({
|
|
1927
|
+
items = [],
|
|
1928
|
+
value,
|
|
1929
|
+
defaultValue,
|
|
1930
|
+
onValueChange,
|
|
1931
|
+
size = "md",
|
|
1932
|
+
invalid,
|
|
1933
|
+
icon,
|
|
1934
|
+
className,
|
|
1935
|
+
...props
|
|
1936
|
+
}) {
|
|
1937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_factory34.ark.div, { className: (0, import_vortex_ui56.cn)(import_vortex_ui56.nativeSelectWrapperBase, className), children: [
|
|
1938
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
1939
|
+
import_factory34.ark.select,
|
|
1940
|
+
{
|
|
1941
|
+
className: (0, import_vortex_ui56.nativeSelectVariants)({ size }),
|
|
1942
|
+
value,
|
|
1943
|
+
defaultValue,
|
|
1944
|
+
onChange: (event) => onValueChange?.(event.currentTarget.value),
|
|
1945
|
+
"aria-invalid": invalid,
|
|
1946
|
+
...props,
|
|
1947
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_factory34.ark.option, { value: item.value, disabled: item.disabled, children: item.label }, item.value))
|
|
1948
|
+
}
|
|
1949
|
+
),
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_factory34.ark.span, { className: import_vortex_ui56.nativeSelectIconBase, "aria-hidden": true, children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ChevronDownIcon, {}) })
|
|
1951
|
+
] });
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
// src/combobox.tsx
|
|
1955
|
+
var import_portal8 = require("@ark-ui/react/portal");
|
|
1956
|
+
var import_react6 = require("react");
|
|
1957
|
+
var import_combobox = require("@ark-ui/react/combobox");
|
|
1958
|
+
var import_vortex_ui57 = require("@cloudvoyant/vortex-ui");
|
|
1959
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
1960
|
+
function Combobox({
|
|
1961
|
+
items,
|
|
1962
|
+
collection,
|
|
1963
|
+
openOnClick = true,
|
|
1964
|
+
lazyMount = true,
|
|
1965
|
+
unmountOnExit = true,
|
|
1966
|
+
...props
|
|
1967
|
+
}) {
|
|
1968
|
+
const resolvedCollection = (0, import_react6.useMemo)(
|
|
1969
|
+
() => collection ?? (0, import_combobox.createListCollection)({ items: items ?? [] }),
|
|
1970
|
+
[collection, items]
|
|
1971
|
+
);
|
|
1972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
1973
|
+
import_combobox.ComboboxRoot,
|
|
1974
|
+
{
|
|
1975
|
+
collection: resolvedCollection,
|
|
1976
|
+
openOnClick,
|
|
1977
|
+
lazyMount,
|
|
1978
|
+
unmountOnExit,
|
|
1979
|
+
...props
|
|
1980
|
+
}
|
|
1981
|
+
);
|
|
1982
|
+
}
|
|
1983
|
+
function ComboboxControl({ className, ...props }) {
|
|
1984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxControl, { className: (0, import_vortex_ui57.cn)(import_vortex_ui57.comboboxControlBase, className), ...props });
|
|
1985
|
+
}
|
|
1986
|
+
function ComboboxInput({ size = "md", className, ...props }) {
|
|
1987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxInput, { className: (0, import_vortex_ui57.cn)((0, import_vortex_ui57.inputVariants)({ size }), import_vortex_ui57.comboboxInputBase, className), ...props });
|
|
1988
|
+
}
|
|
1989
|
+
function ComboboxTrigger({ className, ...props }) {
|
|
1990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxTrigger, { className: (0, import_vortex_ui57.cn)(import_vortex_ui57.comboboxTriggerBase, className), ...props });
|
|
1991
|
+
}
|
|
1992
|
+
function ComboboxClear({ className, ...props }) {
|
|
1993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxClearTrigger, { "aria-label": "Clear", className: (0, import_vortex_ui57.cn)(import_vortex_ui57.comboboxClearTriggerBase, className), ...props });
|
|
1994
|
+
}
|
|
1995
|
+
function ComboboxContent({ className, ...props }) {
|
|
1996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_portal8.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxPositioner, { className: import_vortex_ui57.comboboxPositionerBase, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxContent, { className: (0, import_vortex_ui57.cn)(import_vortex_ui57.comboboxContentBase, className), ...props }) }) });
|
|
1997
|
+
}
|
|
1998
|
+
function ComboboxItemGroup({ className, ...props }) {
|
|
1999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxItemGroup, { className, ...props });
|
|
2000
|
+
}
|
|
2001
|
+
function ComboboxItemGroupLabel({ className, ...props }) {
|
|
2002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxItemGroupLabel, { className: (0, import_vortex_ui57.cn)(import_vortex_ui57.comboboxItemGroupLabelBase, className), ...props });
|
|
2003
|
+
}
|
|
2004
|
+
function ComboboxItem({ item, showIndicator = true, className, ...props }) {
|
|
2005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2006
|
+
import_combobox.ComboboxItem,
|
|
2007
|
+
{
|
|
2008
|
+
item,
|
|
2009
|
+
persistFocus: true,
|
|
2010
|
+
className: (0, import_vortex_ui57.cn)((0, import_vortex_ui57.comboboxItemVariants)({ showIndicator }), className),
|
|
2011
|
+
...props
|
|
2012
|
+
}
|
|
2013
|
+
);
|
|
2014
|
+
}
|
|
2015
|
+
function ComboboxItemText({ className, ...props }) {
|
|
2016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxItemText, { className, ...props });
|
|
2017
|
+
}
|
|
2018
|
+
function ComboboxItemIndicator({ className, ...props }) {
|
|
2019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxItemIndicator, { className: (0, import_vortex_ui57.cn)(import_vortex_ui57.comboboxItemIndicatorBase, className), ...props });
|
|
2020
|
+
}
|
|
2021
|
+
function ComboboxList({ className, ...props }) {
|
|
2022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxList, { className: (0, import_vortex_ui57.cn)(import_vortex_ui57.comboboxListBase, className), ...props });
|
|
2023
|
+
}
|
|
2024
|
+
function ComboboxEmpty({ className, children, ...props }) {
|
|
2025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_combobox.ComboboxEmpty, { className: (0, import_vortex_ui57.cn)(import_vortex_ui57.comboboxEmptyBase, className), ...props, children: children ?? "No results found." });
|
|
2026
|
+
}
|
|
2027
|
+
var useCombobox = import_combobox.useComboboxContext;
|
|
2028
|
+
|
|
2029
|
+
// src/tags-input.tsx
|
|
2030
|
+
var import_tags_input = require("@ark-ui/react/tags-input");
|
|
2031
|
+
var import_vortex_ui58 = require("@cloudvoyant/vortex-ui");
|
|
2032
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2033
|
+
function TagInput({ className, editable = false, children, ...props }) {
|
|
2034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_tags_input.TagsInputRoot, { className: (0, import_vortex_ui58.cn)(import_vortex_ui58.tagsInputRootBase, className), editable, ...props, children: [
|
|
2035
|
+
children,
|
|
2036
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tags_input.TagsInputHiddenInput, {})
|
|
2037
|
+
] });
|
|
2038
|
+
}
|
|
2039
|
+
function TagInputControl({ className, ...props }) {
|
|
2040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tags_input.TagsInputControl, { className: (0, import_vortex_ui58.cn)(import_vortex_ui58.tagsInputControlBase, className), ...props });
|
|
2041
|
+
}
|
|
2042
|
+
function TagInputInput({ className, ...props }) {
|
|
2043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tags_input.TagsInputInput, { className: (0, import_vortex_ui58.cn)(import_vortex_ui58.tagsInputInputBase, className), ...props });
|
|
2044
|
+
}
|
|
2045
|
+
function TagInputItem({ className, ...props }) {
|
|
2046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tags_input.TagsInputItem, { className: (0, import_vortex_ui58.cn)(import_vortex_ui58.tagsInputItemBase, className), ...props });
|
|
2047
|
+
}
|
|
2048
|
+
function TagInputItemPreview({ className, ...props }) {
|
|
2049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tags_input.TagsInputItemPreview, { className, ...props });
|
|
2050
|
+
}
|
|
2051
|
+
function TagInputItemText({ className, ...props }) {
|
|
2052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tags_input.TagsInputItemText, { className: (0, import_vortex_ui58.cn)(import_vortex_ui58.tagsInputItemTextBase, className), ...props });
|
|
2053
|
+
}
|
|
2054
|
+
function TagInputItemInput({ className, ...props }) {
|
|
2055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tags_input.TagsInputItemInput, { className: (0, import_vortex_ui58.cn)(import_vortex_ui58.tagsInputItemInputBase, className), ...props });
|
|
2056
|
+
}
|
|
2057
|
+
function TagInputItemDeleteTrigger({ className, ...props }) {
|
|
2058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2059
|
+
import_tags_input.TagsInputItemDeleteTrigger,
|
|
2060
|
+
{
|
|
2061
|
+
"aria-label": "Remove tag",
|
|
2062
|
+
className: (0, import_vortex_ui58.cn)(import_vortex_ui58.tagsInputItemDeleteTriggerBase, className),
|
|
2063
|
+
...props
|
|
2064
|
+
}
|
|
2065
|
+
);
|
|
2066
|
+
}
|
|
2067
|
+
function TagInputClearTrigger({ className, ...props }) {
|
|
2068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2069
|
+
import_tags_input.TagsInputClearTrigger,
|
|
2070
|
+
{
|
|
2071
|
+
"aria-label": "Clear all tags",
|
|
2072
|
+
className: (0, import_vortex_ui58.cn)(import_vortex_ui58.tagsInputClearTriggerBase, className),
|
|
2073
|
+
...props
|
|
2074
|
+
}
|
|
2075
|
+
);
|
|
2076
|
+
}
|
|
2077
|
+
var TagInputContext = import_tags_input.TagsInputContext;
|
|
2078
|
+
var useTagInput = import_tags_input.useTagsInputContext;
|
|
2079
|
+
|
|
2080
|
+
// src/mermaid.tsx
|
|
2081
|
+
var import_react7 = require("react");
|
|
2082
|
+
var import_factory35 = require("@ark-ui/react/factory");
|
|
2083
|
+
var import_vortex_ui59 = require("@cloudvoyant/vortex-ui");
|
|
2084
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2085
|
+
function Mermaid({ code, svg, className, ...props }) {
|
|
2086
|
+
const [status, setStatus] = (0, import_react7.useState)(svg === void 0 ? "loading" : "done");
|
|
2087
|
+
const [rendered, setRendered] = (0, import_react7.useState)(svg ?? null);
|
|
2088
|
+
const aspectRatio = rendered === null ? void 0 : (0, import_vortex_ui59.mermaidSvgAspectRatio)(rendered);
|
|
2089
|
+
(0, import_react7.useEffect)(() => {
|
|
2090
|
+
if (svg !== void 0) return;
|
|
2091
|
+
let cancelled = false;
|
|
2092
|
+
setStatus("loading");
|
|
2093
|
+
setRendered(null);
|
|
2094
|
+
(0, import_vortex_ui59.renderMermaidSource)(code).then((markup) => {
|
|
2095
|
+
if (!cancelled) {
|
|
2096
|
+
setRendered(markup);
|
|
2097
|
+
setStatus("done");
|
|
2098
|
+
}
|
|
2099
|
+
}).catch(() => {
|
|
2100
|
+
if (!cancelled) setStatus("error");
|
|
2101
|
+
});
|
|
2102
|
+
return () => {
|
|
2103
|
+
cancelled = true;
|
|
2104
|
+
};
|
|
2105
|
+
}, [code, svg]);
|
|
2106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2107
|
+
import_factory35.ark.div,
|
|
2108
|
+
{
|
|
2109
|
+
...props,
|
|
2110
|
+
"data-mermaid-code": JSON.stringify(code),
|
|
2111
|
+
"data-mermaid-src": rendered === null ? void 0 : code,
|
|
2112
|
+
"data-mermaid-state": status,
|
|
2113
|
+
style: aspectRatio === void 0 ? props.style : { ...props.style, aspectRatio },
|
|
2114
|
+
className: (0, import_vortex_ui59.cn)(import_vortex_ui59.mermaidRootBase, className),
|
|
2115
|
+
children: rendered === null ? status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("pre", { className: import_vortex_ui59.mermaidSourceBase, children: code }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: import_vortex_ui59.mermaidLoadingBase, role: "status", "aria-label": "Rendering diagram", "data-mermaid-loading": true, children: [
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2118
|
+
"span",
|
|
2119
|
+
{
|
|
2120
|
+
"aria-hidden": "true",
|
|
2121
|
+
className: "h-5 w-5 shrink-0 animate-spin rounded-full border-2 border-muted-foreground/25 border-t-muted-foreground"
|
|
2122
|
+
}
|
|
2123
|
+
),
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-sm text-muted-foreground", children: "Rendering diagram" })
|
|
2125
|
+
] }),
|
|
2126
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("noscript", { children: [
|
|
2127
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("style", { children: "[data-mermaid-loading]{display:none}" }),
|
|
2128
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("pre", { className: import_vortex_ui59.mermaidSourceBase, children: code })
|
|
2129
|
+
] })
|
|
2130
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: import_vortex_ui59.mermaidSvgBase, dangerouslySetInnerHTML: { __html: rendered } })
|
|
2131
|
+
}
|
|
2132
|
+
);
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
// src/clipboard.tsx
|
|
2136
|
+
var import_clipboard = require("@ark-ui/react/clipboard");
|
|
2137
|
+
var import_vortex_ui60 = require("@cloudvoyant/vortex-ui");
|
|
2138
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2139
|
+
function CopyIcon() {
|
|
2140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
2141
|
+
"svg",
|
|
2142
|
+
{
|
|
2143
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2144
|
+
viewBox: "0 0 24 24",
|
|
2145
|
+
fill: "none",
|
|
2146
|
+
stroke: "currentColor",
|
|
2147
|
+
strokeWidth: "2",
|
|
2148
|
+
strokeLinecap: "round",
|
|
2149
|
+
strokeLinejoin: "round",
|
|
2150
|
+
"aria-hidden": "true",
|
|
2151
|
+
children: [
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
2153
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
2154
|
+
]
|
|
2155
|
+
}
|
|
2156
|
+
);
|
|
2157
|
+
}
|
|
2158
|
+
function CheckIcon() {
|
|
2159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2160
|
+
"svg",
|
|
2161
|
+
{
|
|
2162
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2163
|
+
viewBox: "0 0 24 24",
|
|
2164
|
+
fill: "none",
|
|
2165
|
+
stroke: "currentColor",
|
|
2166
|
+
strokeWidth: "2",
|
|
2167
|
+
strokeLinecap: "round",
|
|
2168
|
+
strokeLinejoin: "round",
|
|
2169
|
+
"aria-hidden": "true",
|
|
2170
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M20 6 9 17l-5-5" })
|
|
2171
|
+
}
|
|
2172
|
+
);
|
|
2173
|
+
}
|
|
2174
|
+
function CopyButton({ value, label = "Copy", className, ...props }) {
|
|
2175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_clipboard.ClipboardRoot, { value, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_clipboard.ClipboardTrigger, { className: (0, import_vortex_ui60.cn)(import_vortex_ui60.clipboardTriggerBase, className), "aria-label": label, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_clipboard.ClipboardIndicator, { copied: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(CheckIcon, {}), children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(CopyIcon, {}) }) }) });
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
// src/radio-group.tsx
|
|
2179
|
+
var import_radio_group = require("@ark-ui/react/radio-group");
|
|
2180
|
+
var import_vortex_ui61 = require("@cloudvoyant/vortex-ui");
|
|
2181
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2182
|
+
function RadioGroup({ className, ...props }) {
|
|
2183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_radio_group.RadioGroupRoot, { className: (0, import_vortex_ui61.cn)(import_vortex_ui61.radioGroupRootBase, className), ...props });
|
|
2184
|
+
}
|
|
2185
|
+
function RadioGroupItem({ className, children, ...props }) {
|
|
2186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_radio_group.RadioGroupItem, { className: (0, import_vortex_ui61.cn)("flex cursor-pointer items-center gap-2.5", className), ...props, children: [
|
|
2187
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_radio_group.RadioGroupItemControl, { className: import_vortex_ui61.radioGroupItemControlBase, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "size-1.5 rounded-full bg-current hidden [[data-state=checked]>&]:block" }) }),
|
|
2188
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_radio_group.RadioGroupItemText, { className: import_vortex_ui61.radioGroupItemTextBase, children }),
|
|
2189
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_radio_group.RadioGroupItemHiddenInput, {})
|
|
2190
|
+
] });
|
|
2191
|
+
}
|
|
2192
|
+
var useRadioGroup = import_radio_group.useRadioGroupContext;
|
|
2193
|
+
|
|
2194
|
+
// src/notice.tsx
|
|
2195
|
+
var import_factory36 = require("@ark-ui/react/factory");
|
|
2196
|
+
var import_vortex_ui62 = require("@cloudvoyant/vortex-ui");
|
|
2197
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2198
|
+
function InfoIcon() {
|
|
2199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
2200
|
+
"svg",
|
|
2201
|
+
{
|
|
2202
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2203
|
+
viewBox: "0 0 24 24",
|
|
2204
|
+
fill: "none",
|
|
2205
|
+
stroke: "currentColor",
|
|
2206
|
+
strokeWidth: "2",
|
|
2207
|
+
strokeLinecap: "round",
|
|
2208
|
+
strokeLinejoin: "round",
|
|
2209
|
+
"aria-hidden": "true",
|
|
2210
|
+
children: [
|
|
2211
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2212
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "M12 16v-4" }),
|
|
2213
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "M12 8h.01" })
|
|
2214
|
+
]
|
|
2215
|
+
}
|
|
2216
|
+
);
|
|
2217
|
+
}
|
|
2218
|
+
function CheckCircleIcon() {
|
|
2219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
2220
|
+
"svg",
|
|
2221
|
+
{
|
|
2222
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2223
|
+
viewBox: "0 0 24 24",
|
|
2224
|
+
fill: "none",
|
|
2225
|
+
stroke: "currentColor",
|
|
2226
|
+
strokeWidth: "2",
|
|
2227
|
+
strokeLinecap: "round",
|
|
2228
|
+
strokeLinejoin: "round",
|
|
2229
|
+
"aria-hidden": "true",
|
|
2230
|
+
children: [
|
|
2231
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2232
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "m9 12 2 2 4-4" })
|
|
2233
|
+
]
|
|
2234
|
+
}
|
|
2235
|
+
);
|
|
2236
|
+
}
|
|
2237
|
+
function TriangleAlertIcon() {
|
|
2238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
2239
|
+
"svg",
|
|
2240
|
+
{
|
|
2241
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2242
|
+
viewBox: "0 0 24 24",
|
|
2243
|
+
fill: "none",
|
|
2244
|
+
stroke: "currentColor",
|
|
2245
|
+
strokeWidth: "2",
|
|
2246
|
+
strokeLinecap: "round",
|
|
2247
|
+
strokeLinejoin: "round",
|
|
2248
|
+
"aria-hidden": "true",
|
|
2249
|
+
children: [
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
2251
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "M12 9v4" }),
|
|
2252
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "M12 17h.01" })
|
|
2253
|
+
]
|
|
2254
|
+
}
|
|
2255
|
+
);
|
|
2256
|
+
}
|
|
2257
|
+
function CircleXIcon() {
|
|
2258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
2259
|
+
"svg",
|
|
2260
|
+
{
|
|
2261
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2262
|
+
viewBox: "0 0 24 24",
|
|
2263
|
+
fill: "none",
|
|
2264
|
+
stroke: "currentColor",
|
|
2265
|
+
strokeWidth: "2",
|
|
2266
|
+
strokeLinecap: "round",
|
|
2267
|
+
strokeLinejoin: "round",
|
|
2268
|
+
"aria-hidden": "true",
|
|
2269
|
+
children: [
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "m15 9-6 6" }),
|
|
2272
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "m9 9 6 6" })
|
|
2273
|
+
]
|
|
2274
|
+
}
|
|
2275
|
+
);
|
|
2276
|
+
}
|
|
2277
|
+
var noticeIcons = {
|
|
2278
|
+
info: InfoIcon,
|
|
2279
|
+
success: CheckCircleIcon,
|
|
2280
|
+
warning: TriangleAlertIcon,
|
|
2281
|
+
error: CircleXIcon
|
|
2282
|
+
};
|
|
2283
|
+
function Notice({ variant = "info", title, children, className, ...props }) {
|
|
2284
|
+
const Icon = variant !== null && variant !== void 0 && variant !== "none" ? noticeIcons[variant] : null;
|
|
2285
|
+
const role = variant === "error" ? "alert" : variant === "none" ? void 0 : "status";
|
|
2286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_factory36.ark.div, { role, className: (0, import_vortex_ui62.cn)((0, import_vortex_ui62.noticeVariants)({ variant }), className), ...props, children: [
|
|
2287
|
+
Icon ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon, {}) : null,
|
|
2288
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_factory36.ark.div, { className: import_vortex_ui62.noticeTitleBase, children: title }) : null,
|
|
2289
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_factory36.ark.div, { className: import_vortex_ui62.noticeDescriptionBase, children }) : null
|
|
2290
|
+
] });
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
// src/figure.tsx
|
|
2294
|
+
var import_factory37 = require("@ark-ui/react/factory");
|
|
2295
|
+
var import_vortex_ui63 = require("@cloudvoyant/vortex-ui");
|
|
2296
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2297
|
+
function Figure({ src, alt, img, caption, className, ...props }) {
|
|
2298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_factory37.ark.figure, { className: (0, import_vortex_ui63.cn)(import_vortex_ui63.figureRootBase, className), ...props, children: [
|
|
2299
|
+
img ?? (src ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_factory37.ark.img, { src, alt, loading: "lazy", className: import_vortex_ui63.figureImageBase }) : null),
|
|
2300
|
+
caption ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_factory37.ark.figcaption, { className: import_vortex_ui63.figureCaptionBase, children: caption }) : null
|
|
2301
|
+
] });
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
// src/reveal.tsx
|
|
2305
|
+
var import_collapsible2 = require("@ark-ui/react/collapsible");
|
|
2306
|
+
var import_vortex_ui64 = require("@cloudvoyant/vortex-ui");
|
|
2307
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2308
|
+
function ChevronRightIcon({ className }) {
|
|
2309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2310
|
+
"svg",
|
|
2311
|
+
{
|
|
2312
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2313
|
+
viewBox: "0 0 24 24",
|
|
2314
|
+
fill: "none",
|
|
2315
|
+
stroke: "currentColor",
|
|
2316
|
+
strokeWidth: "2",
|
|
2317
|
+
strokeLinecap: "round",
|
|
2318
|
+
strokeLinejoin: "round",
|
|
2319
|
+
"aria-hidden": "true",
|
|
2320
|
+
className,
|
|
2321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("path", { d: "m9 18 6-6-6-6" })
|
|
2322
|
+
}
|
|
2323
|
+
);
|
|
2324
|
+
}
|
|
2325
|
+
function Reveal({ question, children, className, ...props }) {
|
|
2326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_collapsible2.CollapsibleRoot, { className: (0, import_vortex_ui64.cn)(import_vortex_ui64.revealRootBase, className), ...props, children: [
|
|
2327
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_collapsible2.CollapsibleTrigger, { className: import_vortex_ui64.revealTriggerBase, children: [
|
|
2328
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ChevronRightIcon, { className: import_vortex_ui64.revealChevronBase }),
|
|
2329
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { children: question })
|
|
2330
|
+
] }),
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_collapsible2.CollapsibleContent, { className: import_vortex_ui64.revealContentBase, children })
|
|
2332
|
+
] });
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
// src/prevnext.tsx
|
|
2336
|
+
var import_factory38 = require("@ark-ui/react/factory");
|
|
2337
|
+
var import_vortex_ui65 = require("@cloudvoyant/vortex-ui");
|
|
2338
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2339
|
+
function PrevNext({ prev, next, className, ...props }) {
|
|
2340
|
+
if (!prev && !next) return null;
|
|
2341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_factory38.ark.nav, { className: (0, import_vortex_ui65.cn)(import_vortex_ui65.prevNextRootBase, className), "aria-label": "Previous and next pages", ...props, children: [
|
|
2342
|
+
prev ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_factory38.ark.a, { href: prev.href, className: import_vortex_ui65.prevNextLinkBase, children: [
|
|
2343
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_factory38.ark.span, { className: import_vortex_ui65.prevNextDirectionBase, children: "Previous" }),
|
|
2344
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_factory38.ark.span, { className: import_vortex_ui65.prevNextTitleBase, children: [
|
|
2345
|
+
"\u2190 ",
|
|
2346
|
+
prev.title
|
|
2347
|
+
] })
|
|
2348
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_factory38.ark.span, { className: import_vortex_ui65.prevNextSpacerBase }),
|
|
2349
|
+
next ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_factory38.ark.a, { href: next.href, className: (0, import_vortex_ui65.cn)(import_vortex_ui65.prevNextLinkBase, import_vortex_ui65.prevNextLinkNextBase), children: [
|
|
2350
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_factory38.ark.span, { className: import_vortex_ui65.prevNextDirectionBase, children: "Next" }),
|
|
2351
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_factory38.ark.span, { className: import_vortex_ui65.prevNextTitleBase, children: [
|
|
2352
|
+
next.title,
|
|
2353
|
+
" \u2192"
|
|
2354
|
+
] })
|
|
2355
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_factory38.ark.span, { className: import_vortex_ui65.prevNextSpacerBase })
|
|
2356
|
+
] });
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
// src/latex.tsx
|
|
2360
|
+
var import_factory39 = require("@ark-ui/react/factory");
|
|
2361
|
+
var import_vortex_ui66 = require("@cloudvoyant/vortex-ui");
|
|
2362
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2363
|
+
function LaTeX({ latex, html, className, ...props }) {
|
|
2364
|
+
let markup;
|
|
2365
|
+
let error = false;
|
|
2366
|
+
if (html === void 0) {
|
|
2367
|
+
try {
|
|
2368
|
+
markup = (0, import_vortex_ui66.toLaTeX)(latex, { displayMode: true });
|
|
2369
|
+
} catch {
|
|
2370
|
+
markup = latex;
|
|
2371
|
+
error = true;
|
|
2372
|
+
}
|
|
2373
|
+
} else {
|
|
2374
|
+
markup = html;
|
|
2375
|
+
}
|
|
2376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2377
|
+
import_factory39.ark.div,
|
|
2378
|
+
{
|
|
2379
|
+
...props,
|
|
2380
|
+
"data-latex-state": error ? "error" : "done",
|
|
2381
|
+
className: (0, import_vortex_ui66.cn)(import_vortex_ui66.latexRootBase, import_vortex_ui66.latexDisplayBase, className),
|
|
2382
|
+
children: error ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("code", { className: import_vortex_ui66.latexErrorBase, children: latex }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { dangerouslySetInnerHTML: { __html: markup } })
|
|
2383
|
+
}
|
|
2384
|
+
);
|
|
2385
|
+
}
|
|
2386
|
+
function InlineLaTeX({ latex, html, className, ...props }) {
|
|
2387
|
+
let markup;
|
|
2388
|
+
let error = false;
|
|
2389
|
+
if (html === void 0) {
|
|
2390
|
+
try {
|
|
2391
|
+
markup = (0, import_vortex_ui66.toLaTeX)(latex);
|
|
2392
|
+
} catch {
|
|
2393
|
+
markup = latex;
|
|
2394
|
+
error = true;
|
|
2395
|
+
}
|
|
2396
|
+
} else {
|
|
2397
|
+
markup = html;
|
|
2398
|
+
}
|
|
2399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2400
|
+
import_factory39.ark.span,
|
|
2401
|
+
{
|
|
2402
|
+
...props,
|
|
2403
|
+
"data-latex-state": error ? "error" : "done",
|
|
2404
|
+
className: (0, import_vortex_ui66.cn)(import_vortex_ui66.latexRootBase, import_vortex_ui66.latexInlineBase, className),
|
|
2405
|
+
children: error ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("code", { className: import_vortex_ui66.latexErrorBase, children: latex }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { dangerouslySetInnerHTML: { __html: markup } })
|
|
2406
|
+
}
|
|
2407
|
+
);
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
// src/code-block.tsx
|
|
2411
|
+
var import_react8 = require("react");
|
|
2412
|
+
var import_factory40 = require("@ark-ui/react/factory");
|
|
2413
|
+
var import_vortex_ui67 = require("@cloudvoyant/vortex-ui");
|
|
2414
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
2415
|
+
var CodeBlockContext = (0, import_react8.createContext)(null);
|
|
2416
|
+
function useCodeBlock() {
|
|
2417
|
+
const ctx = (0, import_react8.useContext)(CodeBlockContext);
|
|
2418
|
+
if (!ctx) throw new Error("CodeBlock parts must be rendered inside a <CodeBlock>.");
|
|
2419
|
+
return ctx;
|
|
2420
|
+
}
|
|
2421
|
+
function CodeRenderer({
|
|
2422
|
+
code,
|
|
2423
|
+
language,
|
|
2424
|
+
html,
|
|
2425
|
+
showLineNumbers,
|
|
2426
|
+
scrollable,
|
|
2427
|
+
maxHeight,
|
|
2428
|
+
highlightLines
|
|
2429
|
+
}) {
|
|
2430
|
+
const [rendered, setRendered] = (0, import_react8.useState)(html ?? null);
|
|
2431
|
+
(0, import_react8.useEffect)(() => {
|
|
2432
|
+
(0, import_vortex_ui67.injectCodeBlockStyles)();
|
|
2433
|
+
}, []);
|
|
2434
|
+
const highlightKey = highlightLines?.join(",");
|
|
2435
|
+
(0, import_react8.useEffect)(() => {
|
|
2436
|
+
if (html !== void 0) return;
|
|
2437
|
+
let cancelled = false;
|
|
2438
|
+
setRendered(null);
|
|
2439
|
+
(0, import_vortex_ui67.renderCodeToHtml)(code, language, highlightLines).then((h) => {
|
|
2440
|
+
if (!cancelled) setRendered(h);
|
|
2441
|
+
});
|
|
2442
|
+
return () => {
|
|
2443
|
+
cancelled = true;
|
|
2444
|
+
};
|
|
2445
|
+
}, [code, language, html, highlightKey]);
|
|
2446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
2447
|
+
"div",
|
|
2448
|
+
{
|
|
2449
|
+
className: (0, import_vortex_ui67.cn)(import_vortex_ui67.codeBlockBodyBase, scrollable && import_vortex_ui67.codeBlockBodyScrollableBase),
|
|
2450
|
+
style: scrollable ? { maxHeight: `${maxHeight}px` } : void 0,
|
|
2451
|
+
children: rendered === null ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: import_vortex_ui67.codeBlockLoadingBase, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: import_vortex_ui67.codeBlockSpinnerBase }) }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
2452
|
+
"div",
|
|
2453
|
+
{
|
|
2454
|
+
dangerouslySetInnerHTML: { __html: rendered },
|
|
2455
|
+
className: (0, import_vortex_ui67.cn)(
|
|
2456
|
+
import_vortex_ui67.codeBlockContentBase,
|
|
2457
|
+
showLineNumbers && import_vortex_ui67.codeBlockLineNumbersBase,
|
|
2458
|
+
highlightLines?.length && import_vortex_ui67.codeBlockHighlightBase
|
|
2459
|
+
)
|
|
2460
|
+
}
|
|
2461
|
+
)
|
|
2462
|
+
}
|
|
2463
|
+
);
|
|
2464
|
+
}
|
|
2465
|
+
function CodeBlock({
|
|
2466
|
+
code,
|
|
2467
|
+
language = "tsx",
|
|
2468
|
+
filename,
|
|
2469
|
+
html,
|
|
2470
|
+
showLineNumbers = false,
|
|
2471
|
+
scrollable = false,
|
|
2472
|
+
maxHeight = 400,
|
|
2473
|
+
highlightLines,
|
|
2474
|
+
className,
|
|
2475
|
+
children,
|
|
2476
|
+
...props
|
|
2477
|
+
}) {
|
|
2478
|
+
const ctx = { code, language, html, showLineNumbers, scrollable, maxHeight, highlightLines };
|
|
2479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CodeBlockContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_factory40.ark.div, { "data-code-block": true, className: (0, import_vortex_ui67.cn)(import_vortex_ui67.codeBlockRootBase, className), ...props, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
2480
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(CodeBlockHeader, { children: [
|
|
2481
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CodeBlockTitle, { children: filename ?? language }),
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "ml-auto", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CodeBlockCopyButton, {}) })
|
|
2483
|
+
] }),
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CodeBlockContent, {})
|
|
2485
|
+
] }) }) });
|
|
2486
|
+
}
|
|
2487
|
+
function CodeBlockHeader({ className, children, ...props }) {
|
|
2488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_factory40.ark.div, { className: (0, import_vortex_ui67.cn)(import_vortex_ui67.codeBlockHeaderBase, className), ...props, children });
|
|
2489
|
+
}
|
|
2490
|
+
function CodeBlockTitle({ className, children, ...props }) {
|
|
2491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_factory40.ark.span, { className: (0, import_vortex_ui67.cn)(import_vortex_ui67.codeBlockTitleBase, className), ...props, children });
|
|
2492
|
+
}
|
|
2493
|
+
function CodeBlockCopyButton({ label = "Copy code", className, ...props }) {
|
|
2494
|
+
const { code } = useCodeBlock();
|
|
2495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_factory40.ark.div, { className, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CopyButton, { value: code, label }) });
|
|
2496
|
+
}
|
|
2497
|
+
function CodeBlockContent({ className, html, ...props }) {
|
|
2498
|
+
const ctx = useCodeBlock();
|
|
2499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_factory40.ark.div, { className, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CodeRenderer, { ...ctx, html: html ?? ctx.html }) });
|
|
2500
|
+
}
|
|
2501
|
+
function MultiFileCodeBlock({
|
|
2502
|
+
files,
|
|
2503
|
+
showLineNumbers = false,
|
|
2504
|
+
scrollable = false,
|
|
2505
|
+
maxHeight = 400,
|
|
2506
|
+
className,
|
|
2507
|
+
...props
|
|
2508
|
+
}) {
|
|
2509
|
+
const [active, setActive] = (0, import_react8.useState)(files[0]?.filename ?? "");
|
|
2510
|
+
const file = files.find((f) => f.filename === active) ?? files[0];
|
|
2511
|
+
(0, import_react8.useEffect)(() => {
|
|
2512
|
+
if (!files.some((f) => f.filename === active)) {
|
|
2513
|
+
setActive(files[0]?.filename ?? "");
|
|
2514
|
+
}
|
|
2515
|
+
}, [files, active]);
|
|
2516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_factory40.ark.div, { "data-code-block": true, className: (0, import_vortex_ui67.cn)(import_vortex_ui67.codeBlockRootBase, className), ...props, children: [
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center justify-between border-b bg-muted/50", children: [
|
|
2518
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { role: "tablist", "aria-label": "Files", className: "flex overflow-x-auto no-scrollbar pl-1", children: files.map((f) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
2519
|
+
"button",
|
|
2520
|
+
{
|
|
2521
|
+
role: "tab",
|
|
2522
|
+
"aria-selected": active === f.filename,
|
|
2523
|
+
onClick: () => setActive(f.filename),
|
|
2524
|
+
className: (0, import_vortex_ui67.cn)(
|
|
2525
|
+
"h-10 shrink-0 border-b-2 px-3 font-mono text-xs transition-colors",
|
|
2526
|
+
active === f.filename ? "border-foreground text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
2527
|
+
),
|
|
2528
|
+
children: f.filename
|
|
2529
|
+
},
|
|
2530
|
+
f.filename
|
|
2531
|
+
)) }),
|
|
2532
|
+
file ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "shrink-0 pr-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CopyButton, { value: file.code, label: "Copy code" }) }) : null
|
|
2533
|
+
] }),
|
|
2534
|
+
file ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
2535
|
+
CodeRenderer,
|
|
2536
|
+
{
|
|
2537
|
+
code: file.code,
|
|
2538
|
+
language: file.language ?? "tsx",
|
|
2539
|
+
html: file.html,
|
|
2540
|
+
showLineNumbers,
|
|
2541
|
+
scrollable,
|
|
2542
|
+
maxHeight
|
|
2543
|
+
}
|
|
2544
|
+
) : null
|
|
2545
|
+
] });
|
|
2546
|
+
}
|
|
2547
|
+
function LanguageTabsCodeBlock({
|
|
2548
|
+
tabs,
|
|
2549
|
+
showLineNumbers = false,
|
|
2550
|
+
scrollable = false,
|
|
2551
|
+
maxHeight = 400,
|
|
2552
|
+
className,
|
|
2553
|
+
...props
|
|
2554
|
+
}) {
|
|
2555
|
+
const [active, setActive] = (0, import_react8.useState)(tabs[0]?.label ?? "");
|
|
2556
|
+
const tab = tabs.find((t) => t.label === active) ?? tabs[0];
|
|
2557
|
+
(0, import_react8.useEffect)(() => {
|
|
2558
|
+
if (!tabs.some((t) => t.label === active)) {
|
|
2559
|
+
setActive(tabs[0]?.label ?? "");
|
|
2560
|
+
}
|
|
2561
|
+
}, [tabs, active]);
|
|
2562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_factory40.ark.div, { "data-code-block": true, className: (0, import_vortex_ui67.cn)(import_vortex_ui67.codeBlockRootBase, className), ...props, children: [
|
|
2563
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(CodeBlockHeader, { children: [
|
|
2564
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CodeBlockTitle, { children: tab?.filename }),
|
|
2565
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "ml-auto", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
2566
|
+
Select,
|
|
2567
|
+
{
|
|
2568
|
+
items: tabs.map((t) => ({ value: t.label, label: t.label })),
|
|
2569
|
+
value: [active],
|
|
2570
|
+
onValueChange: (details) => setActive(details.value[0]),
|
|
2571
|
+
"aria-label": "Language",
|
|
2572
|
+
children: [
|
|
2573
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(SelectTrigger, { size: "sm", className: "min-w-28 justify-between font-mono text-xs", children: [
|
|
2574
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectValue, {}),
|
|
2575
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
2576
|
+
"svg",
|
|
2577
|
+
{
|
|
2578
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2579
|
+
viewBox: "0 0 24 24",
|
|
2580
|
+
fill: "none",
|
|
2581
|
+
stroke: "currentColor",
|
|
2582
|
+
strokeWidth: "2",
|
|
2583
|
+
strokeLinecap: "round",
|
|
2584
|
+
strokeLinejoin: "round",
|
|
2585
|
+
"aria-hidden": "true",
|
|
2586
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { d: "m6 9 6 6 6-6" })
|
|
2587
|
+
}
|
|
2588
|
+
) })
|
|
2589
|
+
] }),
|
|
2590
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectContent, { children: tabs.map((t) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(SelectItem, { item: { value: t.label, label: t.label }, children: [
|
|
2591
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectItemText, { children: t.label }),
|
|
2592
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
2593
|
+
"svg",
|
|
2594
|
+
{
|
|
2595
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2596
|
+
viewBox: "0 0 24 24",
|
|
2597
|
+
fill: "none",
|
|
2598
|
+
stroke: "currentColor",
|
|
2599
|
+
strokeWidth: "2",
|
|
2600
|
+
strokeLinecap: "round",
|
|
2601
|
+
strokeLinejoin: "round",
|
|
2602
|
+
"aria-hidden": "true",
|
|
2603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { d: "M20 6 9 17l-5-5" })
|
|
2604
|
+
}
|
|
2605
|
+
) })
|
|
2606
|
+
] }, t.label)) })
|
|
2607
|
+
]
|
|
2608
|
+
}
|
|
2609
|
+
) })
|
|
2610
|
+
] }),
|
|
2611
|
+
tab ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "relative", children: [
|
|
2612
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
2613
|
+
CodeRenderer,
|
|
2614
|
+
{
|
|
2615
|
+
code: tab.code,
|
|
2616
|
+
language: tab.language ?? "tsx",
|
|
2617
|
+
html: tab.html,
|
|
2618
|
+
showLineNumbers,
|
|
2619
|
+
scrollable,
|
|
2620
|
+
maxHeight
|
|
2621
|
+
}
|
|
2622
|
+
),
|
|
2623
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: import_vortex_ui67.codeBlockCopyFloatBase, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CopyButton, { value: tab.code, label: "Copy code" }) })
|
|
2624
|
+
] }) : null
|
|
2625
|
+
] });
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
// src/manim.tsx
|
|
2629
|
+
var import_react9 = require("react");
|
|
2630
|
+
var import_factory41 = require("@ark-ui/react/factory");
|
|
2631
|
+
var import_vortex_ui68 = require("@cloudvoyant/vortex-ui");
|
|
2632
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
2633
|
+
function Manim({ build, width = 800, height = 450, caption, className, ...props }) {
|
|
2634
|
+
const wrapperRef = (0, import_react9.useRef)(null);
|
|
2635
|
+
const containerRef = (0, import_react9.useRef)(null);
|
|
2636
|
+
const [state, setState] = (0, import_react9.useState)("loading");
|
|
2637
|
+
const [errorMsg, setErrorMsg] = (0, import_react9.useState)("");
|
|
2638
|
+
(0, import_react9.useEffect)(() => {
|
|
2639
|
+
const wrapper = wrapperRef.current;
|
|
2640
|
+
if (!wrapper) return;
|
|
2641
|
+
let disposed = false;
|
|
2642
|
+
let player = null;
|
|
2643
|
+
let resizeTimer;
|
|
2644
|
+
let mountedWidth = 0;
|
|
2645
|
+
let generation = 0;
|
|
2646
|
+
function fail(msg) {
|
|
2647
|
+
if (!disposed) {
|
|
2648
|
+
setErrorMsg(msg);
|
|
2649
|
+
setState("error");
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
async function mount(pixelWidth) {
|
|
2653
|
+
const gen = ++generation;
|
|
2654
|
+
try {
|
|
2655
|
+
const manim = await import("manim-web");
|
|
2656
|
+
if (disposed || gen !== generation || !containerRef.current) return;
|
|
2657
|
+
try {
|
|
2658
|
+
player?.dispose?.();
|
|
2659
|
+
} catch {
|
|
2660
|
+
}
|
|
2661
|
+
containerRef.current.replaceChildren();
|
|
2662
|
+
mountedWidth = pixelWidth;
|
|
2663
|
+
player = new manim.Player(containerRef.current, {
|
|
2664
|
+
width: pixelWidth,
|
|
2665
|
+
height: Math.round(pixelWidth * height / width),
|
|
2666
|
+
backgroundOpacity: 0,
|
|
2667
|
+
autoPlay: true,
|
|
2668
|
+
loop: false
|
|
2669
|
+
});
|
|
2670
|
+
setState("ready");
|
|
2671
|
+
await player.sequence(async (scene) => {
|
|
2672
|
+
await build(manim, scene);
|
|
2673
|
+
});
|
|
2674
|
+
} catch (err) {
|
|
2675
|
+
if (gen === generation) {
|
|
2676
|
+
fail(`Failed to load animation: ${err instanceof Error ? err.message : String(err)}`);
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
const initialWidth = Math.floor(wrapper.getBoundingClientRect().width);
|
|
2681
|
+
if (initialWidth > 0) void mount(initialWidth);
|
|
2682
|
+
const observer = new ResizeObserver((entries) => {
|
|
2683
|
+
const measured = Math.floor(entries[0]?.contentRect.width ?? 0);
|
|
2684
|
+
if (measured <= 0 || measured === mountedWidth) return;
|
|
2685
|
+
clearTimeout(resizeTimer);
|
|
2686
|
+
resizeTimer = setTimeout(() => {
|
|
2687
|
+
if (!disposed) void mount(measured);
|
|
2688
|
+
}, 200);
|
|
2689
|
+
});
|
|
2690
|
+
observer.observe(wrapper);
|
|
2691
|
+
return () => {
|
|
2692
|
+
disposed = true;
|
|
2693
|
+
clearTimeout(resizeTimer);
|
|
2694
|
+
observer.disconnect();
|
|
2695
|
+
try {
|
|
2696
|
+
player?.dispose?.();
|
|
2697
|
+
} catch {
|
|
2698
|
+
}
|
|
2699
|
+
};
|
|
2700
|
+
}, [build, width, height]);
|
|
2701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_factory41.ark.figure, { "data-manim-state": state, className: (0, import_vortex_ui68.cn)(import_vortex_ui68.manimRootBase, className), ...props, children: [
|
|
2702
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { ref: wrapperRef, className: import_vortex_ui68.manimContainerBase, children: [
|
|
2703
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { ref: containerRef, className: "w-full" }),
|
|
2704
|
+
state === "loading" && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: import_vortex_ui68.manimPlaceholderBase, style: { aspectRatio: `${width} / ${height}` }, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: import_vortex_ui68.manimPlaceholderLabelBase, children: "Loading animation\u2026" }) }),
|
|
2705
|
+
state === "error" && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: import_vortex_ui68.manimErrorBase, children: errorMsg })
|
|
2706
|
+
] }),
|
|
2707
|
+
caption ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_factory41.ark.figcaption, { className: import_vortex_ui68.manimCaptionBase, children: caption }) : null
|
|
2708
|
+
] });
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
// src/youtube.tsx
|
|
2712
|
+
var import_react10 = require("react");
|
|
2713
|
+
var import_factory42 = require("@ark-ui/react/factory");
|
|
2714
|
+
var import_vortex_ui69 = require("@cloudvoyant/vortex-ui");
|
|
2715
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
2716
|
+
function PlayIcon() {
|
|
2717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2718
|
+
"svg",
|
|
2719
|
+
{
|
|
2720
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2721
|
+
viewBox: "0 0 24 24",
|
|
2722
|
+
fill: "currentColor",
|
|
2723
|
+
className: "h-8 w-8",
|
|
2724
|
+
"aria-hidden": "true",
|
|
2725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("path", { d: "M8 5v14l11-7z" })
|
|
2726
|
+
}
|
|
2727
|
+
);
|
|
2728
|
+
}
|
|
2729
|
+
function ChevronRightIcon2({ className }) {
|
|
2730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2731
|
+
"svg",
|
|
2732
|
+
{
|
|
2733
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2734
|
+
viewBox: "0 0 24 24",
|
|
2735
|
+
fill: "none",
|
|
2736
|
+
stroke: "currentColor",
|
|
2737
|
+
strokeWidth: "2",
|
|
2738
|
+
strokeLinecap: "round",
|
|
2739
|
+
strokeLinejoin: "round",
|
|
2740
|
+
"aria-hidden": "true",
|
|
2741
|
+
className,
|
|
2742
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("path", { d: "m9 18 6-6-6-6" })
|
|
2743
|
+
}
|
|
2744
|
+
);
|
|
2745
|
+
}
|
|
2746
|
+
var YouTubeContext = (0, import_react10.createContext)(null);
|
|
2747
|
+
function useYouTube() {
|
|
2748
|
+
const ctx = (0, import_react10.useContext)(YouTubeContext);
|
|
2749
|
+
if (!ctx) throw new Error("YoutubeTimestamps must be rendered inside a <YouTube>.");
|
|
2750
|
+
return ctx;
|
|
2751
|
+
}
|
|
2752
|
+
function YouTube({ url, title, description, poster, className, children, ...props }) {
|
|
2753
|
+
const videoId = (0, import_vortex_ui69.extractYouTubeId)(url);
|
|
2754
|
+
const posterUrl = poster ?? `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg`;
|
|
2755
|
+
const [playing, setPlaying] = (0, import_react10.useState)(false);
|
|
2756
|
+
const [startAt, setStartAt] = (0, import_react10.useState)(null);
|
|
2757
|
+
const seek = (t) => {
|
|
2758
|
+
setStartAt(t);
|
|
2759
|
+
setPlaying(true);
|
|
2760
|
+
};
|
|
2761
|
+
const src = `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=1${startAt == null ? "" : `&start=${startAt}`}`;
|
|
2762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(YouTubeContext.Provider, { value: { url, videoId, seek }, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_factory42.ark.div, { "data-youtube-id": videoId, className: (0, import_vortex_ui69.cn)(import_vortex_ui69.youtubeRootBase, className), ...props, children: [
|
|
2763
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_factory42.ark.h3, { className: import_vortex_ui69.youtubeTitleBase, children: title }) : null,
|
|
2764
|
+
playing ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2765
|
+
"iframe",
|
|
2766
|
+
{
|
|
2767
|
+
src,
|
|
2768
|
+
title: title ?? `YouTube video ${videoId}`,
|
|
2769
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
2770
|
+
allowFullScreen: true,
|
|
2771
|
+
className: "aspect-video w-full rounded-md border border-border"
|
|
2772
|
+
}
|
|
2773
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
2774
|
+
import_factory42.ark.button,
|
|
2775
|
+
{
|
|
2776
|
+
type: "button",
|
|
2777
|
+
className: import_vortex_ui69.youtubeFacadeBase,
|
|
2778
|
+
onClick: () => setPlaying(true),
|
|
2779
|
+
"aria-label": title ? `Play video: ${title}` : "Play video",
|
|
2780
|
+
children: [
|
|
2781
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2782
|
+
import_factory42.ark.img,
|
|
2783
|
+
{
|
|
2784
|
+
src: posterUrl,
|
|
2785
|
+
alt: title ?? `YouTube video ${videoId}`,
|
|
2786
|
+
loading: "lazy",
|
|
2787
|
+
className: "h-full w-full object-cover"
|
|
2788
|
+
}
|
|
2789
|
+
),
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_factory42.ark.span, { className: import_vortex_ui69.youtubePlayButtonBase, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_factory42.ark.span, { className: import_vortex_ui69.youtubePlayButtonInnerBase, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(PlayIcon, {}) }) })
|
|
2791
|
+
]
|
|
2792
|
+
}
|
|
2793
|
+
),
|
|
2794
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_factory42.ark.p, { className: import_vortex_ui69.youtubeDescriptionBase, children: description }) : null,
|
|
2795
|
+
children
|
|
2796
|
+
] }) });
|
|
2797
|
+
}
|
|
2798
|
+
function YoutubeTimestampAt({ t, children, className, ...props }) {
|
|
2799
|
+
const { seek } = useYouTube();
|
|
2800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_factory42.ark.li, { className, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_factory42.ark.button, { type: "button", onClick: () => seek(t), className: import_vortex_ui69.youtubeChapterButtonBase, children: [
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_factory42.ark.span, { className: import_vortex_ui69.youtubeChapterTimeBase, children: (0, import_vortex_ui69.formatTime)(t) }),
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_factory42.ark.span, { className: import_vortex_ui69.youtubeChapterLabelBase, children })
|
|
2803
|
+
] }) });
|
|
2804
|
+
}
|
|
2805
|
+
function YoutubeTimestamps({ chapters, children, className, ...props }) {
|
|
2806
|
+
const { url } = useYouTube();
|
|
2807
|
+
const [inferred, setInferred] = (0, import_react10.useState)([]);
|
|
2808
|
+
const [loading, setLoading] = (0, import_react10.useState)(chapters === void 0);
|
|
2809
|
+
(0, import_react10.useEffect)(() => {
|
|
2810
|
+
if (chapters !== void 0) return;
|
|
2811
|
+
let cancelled = false;
|
|
2812
|
+
setLoading(true);
|
|
2813
|
+
(0, import_vortex_ui69.fetchYouTubeMetadata)(url).then((meta) => {
|
|
2814
|
+
if (!cancelled) {
|
|
2815
|
+
setInferred(meta.description ? (0, import_vortex_ui69.parseYouTubeChapters)(meta.description) : []);
|
|
2816
|
+
setLoading(false);
|
|
2817
|
+
}
|
|
2818
|
+
}).catch(() => {
|
|
2819
|
+
if (!cancelled) setLoading(false);
|
|
2820
|
+
});
|
|
2821
|
+
return () => {
|
|
2822
|
+
cancelled = true;
|
|
2823
|
+
};
|
|
2824
|
+
}, [url, chapters]);
|
|
2825
|
+
const resolved = chapters ?? inferred;
|
|
2826
|
+
const hasChildren = children !== void 0 && children !== null;
|
|
2827
|
+
if (!loading && resolved.length === 0 && !hasChildren) return null;
|
|
2828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_factory42.ark.div, { className: (0, import_vortex_ui69.cn)(import_vortex_ui69.youtubeChaptersBase, className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("details", { className: "group", open: true, children: [
|
|
2829
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_factory42.ark.summary, { className: import_vortex_ui69.youtubeChaptersSummaryBase, children: [
|
|
2830
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ChevronRightIcon2, { className: import_vortex_ui69.youtubeChaptersChevronBase }),
|
|
2831
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: "Timestamps" })
|
|
2832
|
+
] }),
|
|
2833
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_factory42.ark.nav, { "aria-label": "Video timestamps", className: import_vortex_ui69.youtubeChaptersListBase, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_factory42.ark.ul, { className: "space-y-1", children: [
|
|
2834
|
+
resolved.map((ch) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(YoutubeTimestampAt, { t: ch.t, children: ch.label }, ch.t)),
|
|
2835
|
+
children
|
|
2836
|
+
] }) })
|
|
2837
|
+
] }) });
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
// src/chart.tsx
|
|
2841
|
+
var import_factory43 = require("@ark-ui/react/factory");
|
|
2842
|
+
var import_react11 = require("@tanstack/charts/react");
|
|
2843
|
+
var import_vortex_ui70 = require("@cloudvoyant/vortex-ui");
|
|
2844
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
2845
|
+
function Chart({ svg, className, ...props }) {
|
|
2846
|
+
const { type, height = 320 } = props;
|
|
2847
|
+
if (svg !== void 0) {
|
|
2848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_factory43.ark.div, { "data-chart-state": "prerendered", "data-chart-type": type, className: (0, import_vortex_ui70.cn)(import_vortex_ui70.chartRootBase, className), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex w-full justify-center [&>svg]:max-w-full", dangerouslySetInnerHTML: { __html: svg } }) });
|
|
2849
|
+
}
|
|
2850
|
+
const definition = (0, import_vortex_ui70.buildChartDefinition)(props);
|
|
2851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_factory43.ark.div, { "data-chart-state": "ready", "data-chart-type": type, className: (0, import_vortex_ui70.cn)(import_vortex_ui70.chartRootBase, className), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react11.Chart, { definition, height, ariaLabel: type === "pie" ? "Pie chart" : "Chart" }) });
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
// src/questions.tsx
|
|
2855
|
+
var import_react12 = require("react");
|
|
2856
|
+
var import_factory44 = require("@ark-ui/react/factory");
|
|
2857
|
+
var import_vortex_ui71 = require("@cloudvoyant/vortex-ui");
|
|
2858
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
2859
|
+
function CheckCircleIcon2() {
|
|
2860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
2861
|
+
"svg",
|
|
2862
|
+
{
|
|
2863
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2864
|
+
viewBox: "0 0 24 24",
|
|
2865
|
+
fill: "none",
|
|
2866
|
+
stroke: "currentColor",
|
|
2867
|
+
strokeWidth: "2",
|
|
2868
|
+
strokeLinecap: "round",
|
|
2869
|
+
strokeLinejoin: "round",
|
|
2870
|
+
"aria-hidden": "true",
|
|
2871
|
+
className: "size-4 shrink-0",
|
|
2872
|
+
children: [
|
|
2873
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2874
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "m9 12 2 2 4-4" })
|
|
2875
|
+
]
|
|
2876
|
+
}
|
|
2877
|
+
);
|
|
2878
|
+
}
|
|
2879
|
+
function CircleXIcon2() {
|
|
2880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
2881
|
+
"svg",
|
|
2882
|
+
{
|
|
2883
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2884
|
+
viewBox: "0 0 24 24",
|
|
2885
|
+
fill: "none",
|
|
2886
|
+
stroke: "currentColor",
|
|
2887
|
+
strokeWidth: "2",
|
|
2888
|
+
strokeLinecap: "round",
|
|
2889
|
+
strokeLinejoin: "round",
|
|
2890
|
+
"aria-hidden": "true",
|
|
2891
|
+
className: "size-4 shrink-0",
|
|
2892
|
+
children: [
|
|
2893
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2894
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "m15 9-6 6" }),
|
|
2895
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "m9 9 6 6" })
|
|
2896
|
+
]
|
|
2897
|
+
}
|
|
2898
|
+
);
|
|
2899
|
+
}
|
|
2900
|
+
function CheckIcon2() {
|
|
2901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
2902
|
+
"svg",
|
|
2903
|
+
{
|
|
2904
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2905
|
+
viewBox: "0 0 24 24",
|
|
2906
|
+
fill: "none",
|
|
2907
|
+
stroke: "currentColor",
|
|
2908
|
+
strokeWidth: "2",
|
|
2909
|
+
strokeLinecap: "round",
|
|
2910
|
+
strokeLinejoin: "round",
|
|
2911
|
+
"aria-hidden": "true",
|
|
2912
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M20 6 9 17l-5-5" })
|
|
2913
|
+
}
|
|
2914
|
+
);
|
|
2915
|
+
}
|
|
2916
|
+
function Feedback({ correct, explanation }) {
|
|
2917
|
+
if (correct === null) return null;
|
|
2918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { "aria-live": "polite", role: "status", className: "mt-3", children: [
|
|
2919
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
2920
|
+
"div",
|
|
2921
|
+
{
|
|
2922
|
+
className: (0, import_vortex_ui71.cn)(
|
|
2923
|
+
"flex items-center gap-2 text-sm font-medium",
|
|
2924
|
+
correct ? import_vortex_ui71.feedbackCorrectBase : import_vortex_ui71.feedbackIncorrectBase
|
|
2925
|
+
),
|
|
2926
|
+
children: correct ? /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
|
|
2927
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(CheckCircleIcon2, {}),
|
|
2928
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { children: "Correct" })
|
|
2929
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
|
|
2930
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(CircleXIcon2, {}),
|
|
2931
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { children: "Incorrect" })
|
|
2932
|
+
] })
|
|
2933
|
+
}
|
|
2934
|
+
),
|
|
2935
|
+
explanation ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: import_vortex_ui71.feedbackExplanationBase, children: explanation }) : null
|
|
2936
|
+
] });
|
|
2937
|
+
}
|
|
2938
|
+
function SingleChoiceRenderer({
|
|
2939
|
+
prompt,
|
|
2940
|
+
choices,
|
|
2941
|
+
correct,
|
|
2942
|
+
explanation,
|
|
2943
|
+
quiz = false,
|
|
2944
|
+
submitted = false,
|
|
2945
|
+
onAnswerChange,
|
|
2946
|
+
onGraded,
|
|
2947
|
+
className,
|
|
2948
|
+
...rest
|
|
2949
|
+
}) {
|
|
2950
|
+
const [selected, setSelected] = (0, import_react12.useState)(null);
|
|
2951
|
+
const [result, setResult] = (0, import_react12.useState)(null);
|
|
2952
|
+
(0, import_react12.useEffect)(() => {
|
|
2953
|
+
if (quiz) {
|
|
2954
|
+
const isAnswered = selected !== null;
|
|
2955
|
+
onAnswerChange?.({ answered: isAnswered, correct: isAnswered && selected === correct });
|
|
2956
|
+
}
|
|
2957
|
+
}, [quiz, selected, correct]);
|
|
2958
|
+
const displayResult = quiz ? submitted ? selected === correct : null : result;
|
|
2959
|
+
const handleCheck = () => {
|
|
2960
|
+
if (selected === null) return;
|
|
2961
|
+
const isCorrect = selected === correct;
|
|
2962
|
+
setResult(isCorrect);
|
|
2963
|
+
onGraded?.(isCorrect);
|
|
2964
|
+
};
|
|
2965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: (0, import_vortex_ui71.cn)(import_vortex_ui71.questionCardBase, className), ...rest, children: [
|
|
2966
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: import_vortex_ui71.questionPromptBase, children: prompt }),
|
|
2967
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
2968
|
+
RadioGroup,
|
|
2969
|
+
{
|
|
2970
|
+
orientation: "vertical",
|
|
2971
|
+
value: selected === null ? null : String(selected),
|
|
2972
|
+
onValueChange: (details) => {
|
|
2973
|
+
if (quiz ? submitted : result !== null) return;
|
|
2974
|
+
setSelected(details.value == null ? null : Number(details.value));
|
|
2975
|
+
},
|
|
2976
|
+
disabled: quiz ? submitted : result !== null,
|
|
2977
|
+
className: import_vortex_ui71.questionGroupBase,
|
|
2978
|
+
children: choices.map((choice, i) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
2979
|
+
RadioGroupItem,
|
|
2980
|
+
{
|
|
2981
|
+
value: String(i),
|
|
2982
|
+
className: (0, import_vortex_ui71.cn)(
|
|
2983
|
+
import_vortex_ui71.questionOptionBase,
|
|
2984
|
+
displayResult !== null && i === correct && import_vortex_ui71.questionOptionCorrectBase,
|
|
2985
|
+
displayResult !== null && i === selected && i !== correct && import_vortex_ui71.questionOptionIncorrectBase
|
|
2986
|
+
),
|
|
2987
|
+
children: choice
|
|
2988
|
+
},
|
|
2989
|
+
i
|
|
2990
|
+
))
|
|
2991
|
+
}
|
|
2992
|
+
),
|
|
2993
|
+
!quiz && result === null && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
2994
|
+
import_factory44.ark.button,
|
|
2995
|
+
{
|
|
2996
|
+
type: "button",
|
|
2997
|
+
onClick: handleCheck,
|
|
2998
|
+
disabled: selected === null,
|
|
2999
|
+
className: import_vortex_ui71.questionCheckButtonBase,
|
|
3000
|
+
children: "Check"
|
|
3001
|
+
}
|
|
3002
|
+
),
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Feedback, { correct: displayResult, explanation: displayResult === null ? void 0 : explanation })
|
|
3004
|
+
] });
|
|
3005
|
+
}
|
|
3006
|
+
function MultipleChoiceRenderer({
|
|
3007
|
+
prompt,
|
|
3008
|
+
choices,
|
|
3009
|
+
correct,
|
|
3010
|
+
explanation,
|
|
3011
|
+
quiz = false,
|
|
3012
|
+
submitted = false,
|
|
3013
|
+
onAnswerChange,
|
|
3014
|
+
onGraded,
|
|
3015
|
+
className,
|
|
3016
|
+
...rest
|
|
3017
|
+
}) {
|
|
3018
|
+
const [selected, setSelected] = (0, import_react12.useState)(/* @__PURE__ */ new Set());
|
|
3019
|
+
const [result, setResult] = (0, import_react12.useState)(null);
|
|
3020
|
+
const computeCorrect = () => {
|
|
3021
|
+
const correctSet = new Set(correct);
|
|
3022
|
+
return selected.size === correctSet.size && [...selected].every((v) => correctSet.has(v));
|
|
3023
|
+
};
|
|
3024
|
+
(0, import_react12.useEffect)(() => {
|
|
3025
|
+
if (quiz) {
|
|
3026
|
+
const isAnswered = selected.size > 0;
|
|
3027
|
+
onAnswerChange?.({ answered: isAnswered, correct: isAnswered && computeCorrect() });
|
|
3028
|
+
}
|
|
3029
|
+
}, [quiz, selected, correct]);
|
|
3030
|
+
const toggleOption = (index) => {
|
|
3031
|
+
if (quiz ? submitted : result !== null) return;
|
|
3032
|
+
setSelected((prev) => {
|
|
3033
|
+
const next = new Set(prev);
|
|
3034
|
+
if (next.has(index)) next.delete(index);
|
|
3035
|
+
else next.add(index);
|
|
3036
|
+
return next;
|
|
3037
|
+
});
|
|
3038
|
+
};
|
|
3039
|
+
const displayResult = quiz ? submitted ? computeCorrect() : null : result;
|
|
3040
|
+
const handleCheck = () => {
|
|
3041
|
+
if (selected.size === 0) return;
|
|
3042
|
+
const isCorrect = computeCorrect();
|
|
3043
|
+
setResult(isCorrect);
|
|
3044
|
+
onGraded?.(isCorrect);
|
|
3045
|
+
};
|
|
3046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: (0, import_vortex_ui71.cn)(import_vortex_ui71.questionCardBase, className), ...rest, children: [
|
|
3047
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: import_vortex_ui71.questionPromptBase, children: prompt }),
|
|
3048
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { role: "group", className: import_vortex_ui71.questionGroupBase, children: choices.map((choice, i) => {
|
|
3049
|
+
const isCorrectOption = correct.includes(i);
|
|
3050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
3051
|
+
Checkbox,
|
|
3052
|
+
{
|
|
3053
|
+
checked: selected.has(i),
|
|
3054
|
+
onCheckedChange: () => toggleOption(i),
|
|
3055
|
+
disabled: quiz ? submitted : result !== null,
|
|
3056
|
+
className: (0, import_vortex_ui71.cn)(
|
|
3057
|
+
import_vortex_ui71.questionOptionBase,
|
|
3058
|
+
displayResult !== null && isCorrectOption && import_vortex_ui71.questionOptionCorrectBase,
|
|
3059
|
+
displayResult !== null && selected.has(i) && !isCorrectOption && import_vortex_ui71.questionOptionIncorrectBase
|
|
3060
|
+
),
|
|
3061
|
+
children: [
|
|
3062
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(CheckboxControl, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(CheckboxIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(CheckIcon2, {}) }) }),
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(CheckboxLabel, { children: choice })
|
|
3064
|
+
]
|
|
3065
|
+
},
|
|
3066
|
+
i
|
|
3067
|
+
);
|
|
3068
|
+
}) }),
|
|
3069
|
+
!quiz && result === null && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3070
|
+
import_factory44.ark.button,
|
|
3071
|
+
{
|
|
3072
|
+
type: "button",
|
|
3073
|
+
onClick: handleCheck,
|
|
3074
|
+
disabled: selected.size === 0,
|
|
3075
|
+
className: import_vortex_ui71.questionCheckButtonBase,
|
|
3076
|
+
children: "Check"
|
|
3077
|
+
}
|
|
3078
|
+
),
|
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Feedback, { correct: displayResult, explanation: displayResult === null ? void 0 : explanation })
|
|
3080
|
+
] });
|
|
3081
|
+
}
|
|
3082
|
+
function NumericRenderer({
|
|
3083
|
+
id,
|
|
3084
|
+
prompt,
|
|
3085
|
+
answer,
|
|
3086
|
+
tolerance = 0,
|
|
3087
|
+
unit,
|
|
3088
|
+
explanation,
|
|
3089
|
+
quiz = false,
|
|
3090
|
+
submitted = false,
|
|
3091
|
+
onAnswerChange,
|
|
3092
|
+
onGraded,
|
|
3093
|
+
className,
|
|
3094
|
+
...rest
|
|
3095
|
+
}) {
|
|
3096
|
+
const inputId = `q-${id}-input`;
|
|
3097
|
+
const [value, setValue] = (0, import_react12.useState)("");
|
|
3098
|
+
const [result, setResult] = (0, import_react12.useState)(null);
|
|
3099
|
+
const computeCorrect = () => {
|
|
3100
|
+
const parsed = parseFloat(value);
|
|
3101
|
+
return !Number.isNaN(parsed) && Math.abs(parsed - answer) <= tolerance;
|
|
3102
|
+
};
|
|
3103
|
+
(0, import_react12.useEffect)(() => {
|
|
3104
|
+
if (quiz) {
|
|
3105
|
+
const parsed = parseFloat(value);
|
|
3106
|
+
const isAnswered = value.trim() !== "" && !Number.isNaN(parsed);
|
|
3107
|
+
onAnswerChange?.({ answered: isAnswered, correct: isAnswered && computeCorrect() });
|
|
3108
|
+
}
|
|
3109
|
+
}, [quiz, value, answer, tolerance]);
|
|
3110
|
+
const displayResult = quiz ? submitted ? computeCorrect() : null : result;
|
|
3111
|
+
const handleCheck = () => {
|
|
3112
|
+
const parsed = parseFloat(value);
|
|
3113
|
+
if (Number.isNaN(parsed)) return;
|
|
3114
|
+
const isCorrect = Math.abs(parsed - answer) <= tolerance;
|
|
3115
|
+
setResult(isCorrect);
|
|
3116
|
+
onGraded?.(isCorrect);
|
|
3117
|
+
};
|
|
3118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: (0, import_vortex_ui71.cn)(import_vortex_ui71.questionCardBase, className), ...rest, children: [
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_factory44.ark.label, { htmlFor: inputId, className: import_vortex_ui71.questionPromptBase, children: prompt }),
|
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3121
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3122
|
+
import_factory44.ark.input,
|
|
3123
|
+
{
|
|
3124
|
+
id: inputId,
|
|
3125
|
+
type: "text",
|
|
3126
|
+
inputMode: "decimal",
|
|
3127
|
+
value,
|
|
3128
|
+
onChange: (e) => {
|
|
3129
|
+
if (quiz ? submitted : result !== null) return;
|
|
3130
|
+
setValue(e.currentTarget.value);
|
|
3131
|
+
},
|
|
3132
|
+
disabled: quiz ? submitted : result !== null,
|
|
3133
|
+
className: import_vortex_ui71.questionInputBase
|
|
3134
|
+
}
|
|
3135
|
+
),
|
|
3136
|
+
unit ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_factory44.ark.span, { className: import_vortex_ui71.questionUnitBase, children: unit }) : null
|
|
3137
|
+
] }),
|
|
3138
|
+
!quiz && result === null && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3139
|
+
import_factory44.ark.button,
|
|
3140
|
+
{
|
|
3141
|
+
type: "button",
|
|
3142
|
+
onClick: handleCheck,
|
|
3143
|
+
disabled: value.trim() === "" || Number.isNaN(parseFloat(value)),
|
|
3144
|
+
className: import_vortex_ui71.questionCheckButtonBase,
|
|
3145
|
+
children: "Check"
|
|
3146
|
+
}
|
|
3147
|
+
),
|
|
3148
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Feedback, { correct: displayResult, explanation: displayResult === null ? void 0 : explanation })
|
|
3149
|
+
] });
|
|
3150
|
+
}
|
|
3151
|
+
function SingleChoiceQuestion(props) {
|
|
3152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(SingleChoiceRenderer, { ...props });
|
|
3153
|
+
}
|
|
3154
|
+
function MultipleChoiceQuestion(props) {
|
|
3155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(MultipleChoiceRenderer, { ...props });
|
|
3156
|
+
}
|
|
3157
|
+
function NumericQuestion(props) {
|
|
3158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(NumericRenderer, { ...props });
|
|
3159
|
+
}
|
|
3160
|
+
function Quiz({ id, title, questions, className, ...props }) {
|
|
3161
|
+
const [answers, setAnswers] = (0, import_react12.useState)({});
|
|
3162
|
+
const [submitted, setSubmitted] = (0, import_react12.useState)(false);
|
|
3163
|
+
const [resetKey, setResetKey] = (0, import_react12.useState)(0);
|
|
3164
|
+
const total = questions.length;
|
|
3165
|
+
const allAnswered = questions.length > 0 && questions.every((q) => answers[q.id]?.answered === true);
|
|
3166
|
+
const score = questions.filter((q) => answers[q.id]?.correct === true).length;
|
|
3167
|
+
const pct = total > 0 ? Math.round(score / total * 100) : 0;
|
|
3168
|
+
const handleAnswerChange = (questionId) => (state) => {
|
|
3169
|
+
setAnswers((prev) => ({ ...prev, [questionId]: state }));
|
|
3170
|
+
};
|
|
3171
|
+
const handleReset = () => {
|
|
3172
|
+
setAnswers({});
|
|
3173
|
+
setSubmitted(false);
|
|
3174
|
+
setResetKey((k) => k + 1);
|
|
3175
|
+
};
|
|
3176
|
+
const renderQuestion = (q) => {
|
|
3177
|
+
const key = `${q.id}-${String(resetKey)}`;
|
|
3178
|
+
const quizProps = {
|
|
3179
|
+
quiz: true,
|
|
3180
|
+
submitted,
|
|
3181
|
+
onAnswerChange: handleAnswerChange(q.id)
|
|
3182
|
+
};
|
|
3183
|
+
switch (q.type) {
|
|
3184
|
+
case "single":
|
|
3185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3186
|
+
SingleChoiceRenderer,
|
|
3187
|
+
{
|
|
3188
|
+
id: q.id,
|
|
3189
|
+
prompt: q.prompt,
|
|
3190
|
+
choices: q.choices,
|
|
3191
|
+
correct: q.correct,
|
|
3192
|
+
explanation: q.explanation,
|
|
3193
|
+
...quizProps
|
|
3194
|
+
},
|
|
3195
|
+
key
|
|
3196
|
+
);
|
|
3197
|
+
case "multiple":
|
|
3198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3199
|
+
MultipleChoiceRenderer,
|
|
3200
|
+
{
|
|
3201
|
+
id: q.id,
|
|
3202
|
+
prompt: q.prompt,
|
|
3203
|
+
choices: q.choices,
|
|
3204
|
+
correct: q.correct,
|
|
3205
|
+
explanation: q.explanation,
|
|
3206
|
+
...quizProps
|
|
3207
|
+
},
|
|
3208
|
+
key
|
|
3209
|
+
);
|
|
3210
|
+
case "numeric":
|
|
3211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3212
|
+
NumericRenderer,
|
|
3213
|
+
{
|
|
3214
|
+
id: q.id,
|
|
3215
|
+
prompt: q.prompt,
|
|
3216
|
+
answer: q.answer,
|
|
3217
|
+
tolerance: q.tolerance,
|
|
3218
|
+
unit: q.unit,
|
|
3219
|
+
explanation: q.explanation,
|
|
3220
|
+
...quizProps
|
|
3221
|
+
},
|
|
3222
|
+
key
|
|
3223
|
+
);
|
|
3224
|
+
default:
|
|
3225
|
+
return null;
|
|
3226
|
+
}
|
|
3227
|
+
};
|
|
3228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { "data-quiz-id": id, className: (0, import_vortex_ui71.cn)(import_vortex_ui71.quizRootBase, className), ...props, children: [
|
|
3229
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: import_vortex_ui71.quizHeaderBase, children: title ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_factory44.ark.h3, { className: import_vortex_ui71.quizTitleBase, children: title }) : null }),
|
|
3230
|
+
questions.map(renderQuestion),
|
|
3231
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "mt-4 flex items-center gap-3", children: [
|
|
3232
|
+
submitted ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_factory44.ark.button, { type: "button", onClick: handleReset, className: import_vortex_ui71.quizResetButtonBase, children: "Reset" }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3233
|
+
import_factory44.ark.button,
|
|
3234
|
+
{
|
|
3235
|
+
type: "button",
|
|
3236
|
+
onClick: () => setSubmitted(true),
|
|
3237
|
+
disabled: !allAnswered,
|
|
3238
|
+
className: import_vortex_ui71.quizSubmitButtonBase,
|
|
3239
|
+
children: "Submit"
|
|
3240
|
+
}
|
|
3241
|
+
),
|
|
3242
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_factory44.ark.span, { role: "status", className: import_vortex_ui71.quizScoreBase, children: submitted ? `${score}/${total} (${pct}%)` : `${total} question${total === 1 ? "" : "s"}` })
|
|
3243
|
+
] }),
|
|
3244
|
+
submitted && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: import_vortex_ui71.quizResultBase, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { "aria-live": "polite", role: "status", className: "text-center", children: [
|
|
3245
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("p", { className: import_vortex_ui71.quizResultTitleBase, children: [
|
|
3246
|
+
score,
|
|
3247
|
+
"/",
|
|
3248
|
+
total,
|
|
3249
|
+
" (",
|
|
3250
|
+
pct,
|
|
3251
|
+
"%)"
|
|
3252
|
+
] }),
|
|
3253
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: import_vortex_ui71.quizResultTextBase, children: pct >= 70 ? "Well done!" : "Keep studying and try again." })
|
|
3254
|
+
] }) })
|
|
3255
|
+
] });
|
|
3256
|
+
}
|
|
3257
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
3258
|
+
0 && (module.exports = {
|
|
3259
|
+
Badge,
|
|
3260
|
+
Button,
|
|
3261
|
+
Card,
|
|
3262
|
+
CardBody,
|
|
3263
|
+
CardCover,
|
|
3264
|
+
CardDescription,
|
|
3265
|
+
CardFooter,
|
|
3266
|
+
CardHeader,
|
|
3267
|
+
CardTitle,
|
|
3268
|
+
Center,
|
|
3269
|
+
Chart,
|
|
3270
|
+
Checkbox,
|
|
3271
|
+
CheckboxControl,
|
|
3272
|
+
CheckboxGroup,
|
|
3273
|
+
CheckboxIndicator,
|
|
3274
|
+
CheckboxLabel,
|
|
3275
|
+
CodeBlock,
|
|
3276
|
+
CodeBlockContent,
|
|
3277
|
+
CodeBlockCopyButton,
|
|
3278
|
+
CodeBlockHeader,
|
|
3279
|
+
CodeBlockTitle,
|
|
3280
|
+
Col,
|
|
3281
|
+
Combobox,
|
|
3282
|
+
ComboboxClear,
|
|
3283
|
+
ComboboxContent,
|
|
3284
|
+
ComboboxControl,
|
|
3285
|
+
ComboboxEmpty,
|
|
3286
|
+
ComboboxInput,
|
|
3287
|
+
ComboboxItem,
|
|
3288
|
+
ComboboxItemGroup,
|
|
3289
|
+
ComboboxItemGroupLabel,
|
|
3290
|
+
ComboboxItemIndicator,
|
|
3291
|
+
ComboboxItemText,
|
|
3292
|
+
ComboboxList,
|
|
3293
|
+
ComboboxTrigger,
|
|
3294
|
+
Container,
|
|
3295
|
+
CopyButton,
|
|
3296
|
+
Dialog,
|
|
3297
|
+
DialogBackdrop,
|
|
3298
|
+
DialogContent,
|
|
3299
|
+
DialogDescription,
|
|
3300
|
+
DialogDismiss,
|
|
3301
|
+
DialogFooter,
|
|
3302
|
+
DialogHeader,
|
|
3303
|
+
DialogProvider,
|
|
3304
|
+
DialogTitle,
|
|
3305
|
+
DialogTrigger,
|
|
3306
|
+
Field,
|
|
3307
|
+
FieldError,
|
|
3308
|
+
FieldHelper,
|
|
3309
|
+
FieldLabel,
|
|
3310
|
+
FieldRequiredIndicator,
|
|
3311
|
+
FieldSet,
|
|
3312
|
+
FieldSetError,
|
|
3313
|
+
FieldSetHelper,
|
|
3314
|
+
FieldSetLegend,
|
|
3315
|
+
Figure,
|
|
3316
|
+
HStack,
|
|
3317
|
+
InlineLaTeX,
|
|
3318
|
+
Input,
|
|
3319
|
+
Item,
|
|
3320
|
+
LaTeX,
|
|
3321
|
+
LanguageTabsCodeBlock,
|
|
3322
|
+
Manim,
|
|
3323
|
+
Mermaid,
|
|
3324
|
+
MultiFileCodeBlock,
|
|
3325
|
+
MultipleChoiceQuestion,
|
|
3326
|
+
Navbar,
|
|
3327
|
+
NavbarActions,
|
|
3328
|
+
NavbarActivationArea,
|
|
3329
|
+
NavbarBrand,
|
|
3330
|
+
NavbarMenu,
|
|
3331
|
+
NavbarMenuContent,
|
|
3332
|
+
NavbarMenuIndicator,
|
|
3333
|
+
NavbarMenuItem,
|
|
3334
|
+
NavbarMenuLink,
|
|
3335
|
+
NavbarMenuList,
|
|
3336
|
+
NavbarMenuTrigger,
|
|
3337
|
+
NavbarMenuViewport,
|
|
3338
|
+
NavbarMenuViewportPositioner,
|
|
3339
|
+
NavbarMobileMenu,
|
|
3340
|
+
NavbarMobileMenuContent,
|
|
3341
|
+
NavbarMobileMenuTrigger,
|
|
3342
|
+
NavbarMobileOverlay,
|
|
3343
|
+
NavbarProvider,
|
|
3344
|
+
NavbarTrigger,
|
|
3345
|
+
Notice,
|
|
3346
|
+
NumberInput,
|
|
3347
|
+
NumberInputControl,
|
|
3348
|
+
NumberInputDecrement,
|
|
3349
|
+
NumberInputIncrement,
|
|
3350
|
+
NumberInputInput,
|
|
3351
|
+
NumericQuestion,
|
|
3352
|
+
Page,
|
|
3353
|
+
PageContent,
|
|
3354
|
+
PageFooter,
|
|
3355
|
+
PageGutter,
|
|
3356
|
+
PageSection,
|
|
3357
|
+
Pagination,
|
|
3358
|
+
PaginationEllipsis,
|
|
3359
|
+
PaginationItem,
|
|
3360
|
+
PaginationItems,
|
|
3361
|
+
PaginationNext,
|
|
3362
|
+
PaginationPrevious,
|
|
3363
|
+
Popover,
|
|
3364
|
+
PopoverAnchor,
|
|
3365
|
+
PopoverContent,
|
|
3366
|
+
PopoverDescription,
|
|
3367
|
+
PopoverDismiss,
|
|
3368
|
+
PopoverIndicator,
|
|
3369
|
+
PopoverProvider,
|
|
3370
|
+
PopoverTitle,
|
|
3371
|
+
PopoverTrigger,
|
|
3372
|
+
Portal,
|
|
3373
|
+
PrevNext,
|
|
3374
|
+
Quiz,
|
|
3375
|
+
RadioGroup,
|
|
3376
|
+
RadioGroupItem,
|
|
3377
|
+
Reveal,
|
|
3378
|
+
Row,
|
|
3379
|
+
Scroll,
|
|
3380
|
+
Select,
|
|
3381
|
+
SelectClearTrigger,
|
|
3382
|
+
SelectContent,
|
|
3383
|
+
SelectIndicator,
|
|
3384
|
+
SelectItem,
|
|
3385
|
+
SelectItemGroup,
|
|
3386
|
+
SelectItemGroupLabel,
|
|
3387
|
+
SelectItemIndicator,
|
|
3388
|
+
SelectItemText,
|
|
3389
|
+
SelectNative,
|
|
3390
|
+
SelectTrigger,
|
|
3391
|
+
SelectValue,
|
|
3392
|
+
Sidebar,
|
|
3393
|
+
SidebarContent,
|
|
3394
|
+
SidebarFooter,
|
|
3395
|
+
SidebarGroup,
|
|
3396
|
+
SidebarGroupAction,
|
|
3397
|
+
SidebarHeader,
|
|
3398
|
+
SidebarInput,
|
|
3399
|
+
SidebarInset,
|
|
3400
|
+
SidebarMenu,
|
|
3401
|
+
SidebarMenuAction,
|
|
3402
|
+
SidebarMenuBadge,
|
|
3403
|
+
SidebarMenuButton,
|
|
3404
|
+
SidebarMenuItem,
|
|
3405
|
+
SidebarMenuLink,
|
|
3406
|
+
SidebarMenuSkeleton,
|
|
3407
|
+
SidebarMenuSub,
|
|
3408
|
+
SidebarMenuSubButton,
|
|
3409
|
+
SidebarMenuSubItem,
|
|
3410
|
+
SidebarProvider,
|
|
3411
|
+
SidebarRail,
|
|
3412
|
+
SidebarSeparator,
|
|
3413
|
+
SidebarTrigger,
|
|
3414
|
+
SingleChoiceQuestion,
|
|
3415
|
+
Splitter,
|
|
3416
|
+
SplitterPanel,
|
|
3417
|
+
SplitterResizeTrigger,
|
|
3418
|
+
SplitterResizeTriggerIndicator,
|
|
3419
|
+
Stack,
|
|
3420
|
+
Switch,
|
|
3421
|
+
SwitchControl,
|
|
3422
|
+
SwitchLabel,
|
|
3423
|
+
SwitchThumb,
|
|
3424
|
+
Tabs,
|
|
3425
|
+
TabsContent,
|
|
3426
|
+
TabsList,
|
|
3427
|
+
TabsTrigger,
|
|
3428
|
+
TagInput,
|
|
3429
|
+
TagInputClearTrigger,
|
|
3430
|
+
TagInputContext,
|
|
3431
|
+
TagInputControl,
|
|
3432
|
+
TagInputInput,
|
|
3433
|
+
TagInputItem,
|
|
3434
|
+
TagInputItemDeleteTrigger,
|
|
3435
|
+
TagInputItemInput,
|
|
3436
|
+
TagInputItemPreview,
|
|
3437
|
+
TagInputItemText,
|
|
3438
|
+
Textarea,
|
|
3439
|
+
ToggleButton,
|
|
3440
|
+
ToggleButtonIndicator,
|
|
3441
|
+
Tooltip,
|
|
3442
|
+
TooltipContent,
|
|
3443
|
+
TooltipProvider,
|
|
3444
|
+
TooltipTrigger,
|
|
3445
|
+
VStack,
|
|
3446
|
+
Window,
|
|
3447
|
+
WindowBody,
|
|
3448
|
+
WindowControl,
|
|
3449
|
+
WindowDismiss,
|
|
3450
|
+
WindowDragTrigger,
|
|
3451
|
+
WindowHeader,
|
|
3452
|
+
WindowProvider,
|
|
3453
|
+
WindowResizeTrigger,
|
|
3454
|
+
WindowStageTrigger,
|
|
3455
|
+
WindowTitle,
|
|
3456
|
+
YouTube,
|
|
3457
|
+
YoutubeTimestampAt,
|
|
3458
|
+
YoutubeTimestamps,
|
|
3459
|
+
navbarMenuTriggerStyle,
|
|
3460
|
+
useCheckbox,
|
|
3461
|
+
useCombobox,
|
|
3462
|
+
useDialog,
|
|
3463
|
+
useDialogContext,
|
|
3464
|
+
useField,
|
|
3465
|
+
useMediaQuery,
|
|
3466
|
+
useNavbar,
|
|
3467
|
+
useNumberInput,
|
|
3468
|
+
usePopover,
|
|
3469
|
+
usePopoverContext,
|
|
3470
|
+
useRadioGroup,
|
|
3471
|
+
useSelect,
|
|
3472
|
+
useSidebar,
|
|
3473
|
+
useSwitch,
|
|
3474
|
+
useTabs,
|
|
3475
|
+
useTagInput,
|
|
3476
|
+
useTooltip,
|
|
3477
|
+
useTooltipContext,
|
|
3478
|
+
useWindow,
|
|
3479
|
+
useWindowContext
|
|
3480
|
+
});
|