@x12i/ui 0.0.0-stage → 1.1.0

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.js ADDED
@@ -0,0 +1,2554 @@
1
+ "use client";
2
+
3
+ // src/utils/cx.ts
4
+ function cx(...values) {
5
+ const joined = values.filter(Boolean).join(" ");
6
+ return joined === "" ? void 0 : joined;
7
+ }
8
+
9
+ // src/components/badge.tsx
10
+ import { jsx } from "react/jsx-runtime";
11
+ function Badge({
12
+ variant = "soft",
13
+ tone = "neutral",
14
+ size = "md",
15
+ className,
16
+ ...props
17
+ }) {
18
+ return /* @__PURE__ */ jsx(
19
+ "span",
20
+ {
21
+ "data-kit": "badge",
22
+ "data-variant": variant,
23
+ "data-tone": tone,
24
+ "data-size": size,
25
+ className: cx(className),
26
+ ...props
27
+ }
28
+ );
29
+ }
30
+
31
+ // src/utils/slot.tsx
32
+ import {
33
+ cloneElement,
34
+ isValidElement
35
+ } from "react";
36
+ function composeRefs(...refs) {
37
+ return (node) => {
38
+ for (const ref of refs) {
39
+ if (typeof ref === "function") ref(node);
40
+ else if (ref) ref.current = node;
41
+ }
42
+ };
43
+ }
44
+ function mergeProps(slotProps, childProps) {
45
+ const merged = { ...slotProps, ...childProps };
46
+ for (const key of Object.keys(slotProps)) {
47
+ const slotValue = slotProps[key];
48
+ const childValue = childProps[key];
49
+ if (/^on[A-Z]/.test(key) && typeof slotValue === "function" && typeof childValue === "function") {
50
+ merged[key] = (...args) => {
51
+ childValue(...args);
52
+ slotValue(...args);
53
+ };
54
+ } else if (key === "style") {
55
+ merged[key] = { ...slotValue, ...childValue };
56
+ } else if (key === "className") {
57
+ merged[key] = cx(slotValue, childValue);
58
+ }
59
+ }
60
+ return merged;
61
+ }
62
+ function Slot({ children, ref, ...slotProps }) {
63
+ if (!isValidElement(children)) return null;
64
+ const child = children;
65
+ const { ref: childRef, ...childProps } = child.props;
66
+ return cloneElement(child, {
67
+ ...mergeProps(slotProps, childProps),
68
+ ref: composeRefs(ref, childRef)
69
+ });
70
+ }
71
+
72
+ // src/components/visually-hidden.tsx
73
+ import { jsx as jsx2 } from "react/jsx-runtime";
74
+ function VisuallyHidden({ asChild = false, className, ...props }) {
75
+ const Component = asChild ? Slot : "span";
76
+ return /* @__PURE__ */ jsx2(Component, { "data-kit": "visually-hidden", className: cx(className), ...props });
77
+ }
78
+
79
+ // src/components/spinner.tsx
80
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
81
+ function Spinner({ size = "md", label, className, ref, ...props }) {
82
+ const decorative = label === void 0;
83
+ return /* @__PURE__ */ jsxs(
84
+ "span",
85
+ {
86
+ ref,
87
+ "data-kit": "spinner",
88
+ "data-size": size,
89
+ role: decorative ? void 0 : "status",
90
+ "aria-hidden": decorative ? true : void 0,
91
+ className: cx(className),
92
+ ...props,
93
+ children: [
94
+ /* @__PURE__ */ jsxs("svg", { "data-kit-slot": "spinner-graphic", viewBox: "0 0 24 24", focusable: "false", "aria-hidden": "true", children: [
95
+ /* @__PURE__ */ jsx3("circle", { "data-kit-slot": "spinner-track", cx: "12", cy: "12", r: "9", fill: "none" }),
96
+ /* @__PURE__ */ jsx3("circle", { "data-kit-slot": "spinner-arc", cx: "12", cy: "12", r: "9", fill: "none" })
97
+ ] }),
98
+ decorative ? null : /* @__PURE__ */ jsx3(VisuallyHidden, { children: label })
99
+ ]
100
+ }
101
+ );
102
+ }
103
+
104
+ // src/components/button.tsx
105
+ import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
106
+ function Button({
107
+ variant = "solid",
108
+ tone = "accent",
109
+ size = "md",
110
+ loading = false,
111
+ loadingLabel,
112
+ asChild = false,
113
+ disabled = false,
114
+ type,
115
+ className,
116
+ children,
117
+ onClick,
118
+ ref,
119
+ ...props
120
+ }) {
121
+ const inactive = disabled || loading;
122
+ const handleClick = (event) => {
123
+ if (inactive) {
124
+ event.preventDefault();
125
+ return;
126
+ }
127
+ onClick?.(event);
128
+ };
129
+ const shared = {
130
+ ref,
131
+ "data-kit": "button",
132
+ "data-variant": variant,
133
+ "data-tone": tone,
134
+ "data-size": size,
135
+ "data-loading": loading ? "" : void 0,
136
+ "data-disabled": inactive ? "" : void 0,
137
+ "aria-busy": loading ? true : void 0,
138
+ className: cx(className),
139
+ onClick: handleClick,
140
+ ...props
141
+ };
142
+ if (asChild) {
143
+ return /* @__PURE__ */ jsx4(Slot, { ...shared, "aria-disabled": inactive ? true : void 0, children });
144
+ }
145
+ const content = /* @__PURE__ */ jsxs2(Fragment, { children: [
146
+ /* @__PURE__ */ jsx4("span", { "data-kit-slot": "content", children }),
147
+ loading ? /* @__PURE__ */ jsx4("span", { "data-kit-slot": "spinner", children: /* @__PURE__ */ jsx4(Spinner, { size: "sm", ...loadingLabel === void 0 ? {} : { label: loadingLabel } }) }) : null
148
+ ] });
149
+ return /* @__PURE__ */ jsx4(
150
+ "button",
151
+ {
152
+ ...shared,
153
+ type: type ?? "button",
154
+ disabled,
155
+ "aria-disabled": loading && !disabled ? true : void 0,
156
+ children: content
157
+ }
158
+ );
159
+ }
160
+
161
+ // src/components/button-group.tsx
162
+ import { jsx as jsx5 } from "react/jsx-runtime";
163
+ function ButtonGroup({
164
+ orientation = "horizontal",
165
+ attached = true,
166
+ ...props
167
+ }) {
168
+ return /* @__PURE__ */ jsx5(
169
+ "div",
170
+ {
171
+ role: "group",
172
+ "data-kit": "button-group",
173
+ "data-orientation": orientation,
174
+ "data-attached": attached ? "" : void 0,
175
+ ...props
176
+ }
177
+ );
178
+ }
179
+
180
+ // src/components/copy-button.tsx
181
+ import { Icon } from "@x12i/icons";
182
+ import { useCallback, useEffect, useRef, useState } from "react";
183
+
184
+ // src/components/icon-button.tsx
185
+ import { jsx as jsx6 } from "react/jsx-runtime";
186
+ function IconButton({ label, children, ...props }) {
187
+ return /* @__PURE__ */ jsx6(Button, { ...props, "aria-label": label, "data-icon-only": "", children });
188
+ }
189
+
190
+ // src/components/copy-button.tsx
191
+ import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
192
+ function CopyButton({
193
+ text: source,
194
+ label,
195
+ copiedLabel,
196
+ failedLabel,
197
+ timeout = 2e3,
198
+ onCopied,
199
+ onCopyError,
200
+ children,
201
+ variant = "ghost",
202
+ tone = "neutral",
203
+ ...props
204
+ }) {
205
+ const [status, setStatus] = useState("idle");
206
+ const timer = useRef(void 0);
207
+ useEffect(() => () => clearTimeout(timer.current), []);
208
+ const settle = useCallback(
209
+ (next) => {
210
+ setStatus(next);
211
+ clearTimeout(timer.current);
212
+ timer.current = setTimeout(() => setStatus("idle"), timeout);
213
+ },
214
+ [timeout]
215
+ );
216
+ const copy = async () => {
217
+ const text = typeof source === "function" ? source() : source;
218
+ try {
219
+ if (!navigator.clipboard) throw new Error("Clipboard API is not available");
220
+ await navigator.clipboard.writeText(text);
221
+ onCopied?.(text);
222
+ settle("copied");
223
+ } catch (error) {
224
+ onCopyError?.(error);
225
+ settle("failed");
226
+ }
227
+ };
228
+ const glyph = /* @__PURE__ */ jsx7(Icon, { name: status === "copied" ? "check" : status === "failed" ? "alert-circle" : "copy" });
229
+ const announcement = status === "copied" ? copiedLabel : status === "failed" ? failedLabel ?? "" : "";
230
+ return /* @__PURE__ */ jsxs3(Fragment2, { children: [
231
+ children === void 0 ? /* @__PURE__ */ jsx7(
232
+ IconButton,
233
+ {
234
+ label,
235
+ variant,
236
+ tone,
237
+ "data-kit-copy": "",
238
+ "data-status": status,
239
+ onClick: () => void copy(),
240
+ ...props,
241
+ children: glyph
242
+ }
243
+ ) : /* @__PURE__ */ jsxs3(
244
+ Button,
245
+ {
246
+ variant,
247
+ tone,
248
+ "data-kit-copy": "",
249
+ "data-status": status,
250
+ onClick: () => void copy(),
251
+ ...props,
252
+ children: [
253
+ glyph,
254
+ children
255
+ ]
256
+ }
257
+ ),
258
+ /* @__PURE__ */ jsx7(VisuallyHidden, { role: "status", "aria-live": "polite", children: announcement })
259
+ ] });
260
+ }
261
+
262
+ // src/components/kbd.tsx
263
+ import { Children } from "react";
264
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
265
+ function Kbd(props) {
266
+ return /* @__PURE__ */ jsx8("kbd", { "data-kit": "kbd", ...props });
267
+ }
268
+ function KbdGroup({ separator = "+", children, ...props }) {
269
+ const keys = Children.toArray(children);
270
+ return /* @__PURE__ */ jsx8("span", { "data-kit": "kbd-group", ...props, children: keys.map((key, index) => (
271
+ // The keys are static markup the caller wrote, so the index is stable.
272
+ /* @__PURE__ */ jsxs4("span", { "data-kit-slot": "kbd-item", children: [
273
+ index > 0 ? /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", "data-kit-slot": "kbd-separator", children: separator }) : null,
274
+ key
275
+ ] }, index)
276
+ )) });
277
+ }
278
+
279
+ // src/components/link.tsx
280
+ import { Icon as Icon2 } from "@x12i/icons";
281
+ import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
282
+ function Link({
283
+ tone = "accent",
284
+ underline = "always",
285
+ external = false,
286
+ externalLabel,
287
+ asChild = false,
288
+ children,
289
+ ...props
290
+ }) {
291
+ const shared = {
292
+ "data-kit": "link",
293
+ "data-tone": tone,
294
+ "data-underline": underline,
295
+ "data-external": external ? "" : void 0,
296
+ ...external ? { target: "_blank", rel: "noopener noreferrer" } : {},
297
+ ...props
298
+ };
299
+ if (asChild) return /* @__PURE__ */ jsx9(Slot, { ...shared, children });
300
+ return /* @__PURE__ */ jsxs5("a", { ...shared, children: [
301
+ children,
302
+ external ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
303
+ /* @__PURE__ */ jsx9(Icon2, { name: "external-link", size: 12, "data-kit-slot": "external-icon" }),
304
+ externalLabel ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
305
+ " ",
306
+ /* @__PURE__ */ jsx9(VisuallyHidden, { children: externalLabel })
307
+ ] }) : null
308
+ ] }) : null
309
+ ] });
310
+ }
311
+
312
+ // src/components/toggle.tsx
313
+ import { Toggle as BaseToggle } from "@base-ui/react/toggle";
314
+ import { ToggleGroup as BaseToggleGroup } from "@base-ui/react/toggle-group";
315
+ import { jsx as jsx10 } from "react/jsx-runtime";
316
+ function Toggle({
317
+ variant = "outline",
318
+ size = "md",
319
+ ...props
320
+ }) {
321
+ return /* @__PURE__ */ jsx10(BaseToggle, { "data-kit": "toggle", "data-variant": variant, "data-size": size, ...props });
322
+ }
323
+ function ToggleGroup({
324
+ attached = true,
325
+ orientation = "horizontal",
326
+ ...props
327
+ }) {
328
+ return /* @__PURE__ */ jsx10(
329
+ BaseToggleGroup,
330
+ {
331
+ "data-kit": "toggle-group",
332
+ "data-attached": attached ? "" : void 0,
333
+ orientation,
334
+ ...props
335
+ }
336
+ );
337
+ }
338
+
339
+ // src/components/checkbox.tsx
340
+ import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox";
341
+ import { CheckboxGroup as BaseCheckboxGroup } from "@base-ui/react/checkbox-group";
342
+ import { Icon as Icon3 } from "@x12i/icons";
343
+
344
+ // src/components/choice.tsx
345
+ import { useId } from "react";
346
+ import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
347
+ function useChoiceIds(label, description) {
348
+ const labelId = useId();
349
+ const descriptionId = useId();
350
+ return {
351
+ labelId,
352
+ descriptionId,
353
+ controlAria: {
354
+ "aria-labelledby": label ? labelId : void 0,
355
+ "aria-describedby": description ? descriptionId : void 0
356
+ }
357
+ };
358
+ }
359
+ function ChoiceRow({
360
+ kind,
361
+ control,
362
+ label,
363
+ description,
364
+ labelId,
365
+ descriptionId,
366
+ disabled
367
+ }) {
368
+ if (!label && !description) return /* @__PURE__ */ jsx11(Fragment4, { children: control });
369
+ return /* @__PURE__ */ jsxs6("label", { "data-kit": "choice", "data-choice": kind, "data-disabled": disabled ? "" : void 0, children: [
370
+ control,
371
+ /* @__PURE__ */ jsxs6("span", { "data-kit-slot": "choice-text", children: [
372
+ label ? /* @__PURE__ */ jsx11("span", { id: labelId, "data-kit-slot": "choice-label", children: label }) : null,
373
+ description ? /* @__PURE__ */ jsx11("span", { id: descriptionId, "data-kit-slot": "choice-description", children: description }) : null
374
+ ] })
375
+ ] });
376
+ }
377
+
378
+ // src/components/checkbox.tsx
379
+ import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
380
+ function Checkbox({ label, description, disabled, ...props }) {
381
+ const { labelId, descriptionId, controlAria } = useChoiceIds(label, description);
382
+ const control = /* @__PURE__ */ jsx12(BaseCheckbox.Root, { "data-kit": "checkbox", disabled, ...controlAria, ...props, children: /* @__PURE__ */ jsxs7(BaseCheckbox.Indicator, { "data-kit-slot": "checkbox-indicator", children: [
383
+ /* @__PURE__ */ jsx12(Icon3, { name: "check", size: 12, "data-kit-slot": "checkbox-check" }),
384
+ /* @__PURE__ */ jsx12(Icon3, { name: "minus", size: 12, "data-kit-slot": "checkbox-dash" })
385
+ ] }) });
386
+ return /* @__PURE__ */ jsx12(
387
+ ChoiceRow,
388
+ {
389
+ kind: "checkbox",
390
+ control,
391
+ label,
392
+ description,
393
+ labelId,
394
+ descriptionId,
395
+ disabled
396
+ }
397
+ );
398
+ }
399
+ function CheckboxGroup(props) {
400
+ return /* @__PURE__ */ jsx12(BaseCheckboxGroup, { "data-kit": "checkbox-group", ...props });
401
+ }
402
+
403
+ // src/components/combobox.tsx
404
+ import { Combobox as BaseCombobox } from "@base-ui/react/combobox";
405
+ import { Icon as Icon4 } from "@x12i/icons";
406
+ import { useId as useId2, useRef as useRef2 } from "react";
407
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
408
+ var itemToStringLabel = (option) => option.label;
409
+ var itemToStringValue = (option) => option.value;
410
+ var isItemEqualToValue = (a, b) => a.value === b.value;
411
+ function OpenButton({ label }) {
412
+ const id = useId2();
413
+ return /* @__PURE__ */ jsx13(BaseCombobox.Trigger, { id, "aria-labelledby": id, "aria-label": label, "data-kit-slot": "combobox-trigger", children: /* @__PURE__ */ jsx13(Icon4, { name: "chevron-down" }) });
414
+ }
415
+ function Options({ emptyLabel }) {
416
+ return /* @__PURE__ */ jsx13(BaseCombobox.Portal, { children: /* @__PURE__ */ jsx13(BaseCombobox.Positioner, { sideOffset: 4, "data-kit": "combobox-positioner", children: /* @__PURE__ */ jsxs8(BaseCombobox.Popup, { "data-kit": "combobox-popup", children: [
417
+ /* @__PURE__ */ jsx13(BaseCombobox.Empty, { "data-kit-slot": "combobox-empty", children: emptyLabel }),
418
+ /* @__PURE__ */ jsx13(BaseCombobox.List, { "data-kit-slot": "combobox-list", children: (option) => /* @__PURE__ */ jsxs8(
419
+ BaseCombobox.Item,
420
+ {
421
+ value: option,
422
+ disabled: option.disabled,
423
+ "data-kit": "combobox-item",
424
+ children: [
425
+ /* @__PURE__ */ jsx13(BaseCombobox.ItemIndicator, { "data-kit-slot": "combobox-item-indicator", children: /* @__PURE__ */ jsx13(Icon4, { name: "check", size: 16 }) }),
426
+ /* @__PURE__ */ jsx13("span", { "data-kit-slot": "combobox-item-text", children: option.label })
427
+ ]
428
+ },
429
+ option.value
430
+ ) })
431
+ ] }) }) });
432
+ }
433
+ function Combobox({
434
+ options,
435
+ value,
436
+ defaultValue,
437
+ onValueChange,
438
+ placeholder,
439
+ size = "md",
440
+ invalid,
441
+ disabled,
442
+ readOnly,
443
+ required,
444
+ name,
445
+ className,
446
+ style,
447
+ emptyLabel,
448
+ clearLabel,
449
+ openLabel,
450
+ "aria-label": ariaLabel,
451
+ "aria-labelledby": ariaLabelledBy,
452
+ "aria-describedby": ariaDescribedBy
453
+ }) {
454
+ const find = (key) => key === void 0 ? void 0 : options.find((option) => option.value === key) ?? null;
455
+ return /* @__PURE__ */ jsxs8(
456
+ BaseCombobox.Root,
457
+ {
458
+ items: options,
459
+ value: find(value),
460
+ defaultValue: find(defaultValue),
461
+ onValueChange: (option) => onValueChange?.(option?.value ?? null),
462
+ itemToStringLabel,
463
+ itemToStringValue,
464
+ isItemEqualToValue,
465
+ disabled,
466
+ readOnly,
467
+ required,
468
+ name,
469
+ children: [
470
+ /* @__PURE__ */ jsxs8(
471
+ BaseCombobox.InputGroup,
472
+ {
473
+ "data-kit": "combobox",
474
+ "data-size": size,
475
+ "data-invalid": invalid ? "" : void 0,
476
+ className,
477
+ style,
478
+ children: [
479
+ /* @__PURE__ */ jsx13(
480
+ BaseCombobox.Input,
481
+ {
482
+ "data-kit-slot": "combobox-input",
483
+ placeholder,
484
+ "aria-label": ariaLabel,
485
+ "aria-labelledby": ariaLabelledBy,
486
+ "aria-describedby": ariaDescribedBy,
487
+ "aria-invalid": invalid ? true : void 0
488
+ }
489
+ ),
490
+ /* @__PURE__ */ jsx13(BaseCombobox.Clear, { "data-kit-slot": "combobox-clear", "aria-label": clearLabel, children: /* @__PURE__ */ jsx13(Icon4, { name: "close", size: 16 }) }),
491
+ /* @__PURE__ */ jsx13(OpenButton, { label: openLabel })
492
+ ]
493
+ }
494
+ ),
495
+ /* @__PURE__ */ jsx13(Options, { emptyLabel })
496
+ ]
497
+ }
498
+ );
499
+ }
500
+ function MultiCombobox({
501
+ options,
502
+ value,
503
+ defaultValue,
504
+ onValueChange,
505
+ placeholder,
506
+ size = "md",
507
+ invalid,
508
+ disabled,
509
+ readOnly,
510
+ required,
511
+ name,
512
+ className,
513
+ style,
514
+ emptyLabel,
515
+ clearLabel,
516
+ openLabel,
517
+ removeLabel,
518
+ "aria-label": ariaLabel,
519
+ "aria-labelledby": ariaLabelledBy,
520
+ "aria-describedby": ariaDescribedBy
521
+ }) {
522
+ const anchor = useRef2(null);
523
+ const find = (keys) => keys === void 0 ? void 0 : keys.flatMap((key) => options.filter((option) => option.value === key));
524
+ return /* @__PURE__ */ jsxs8(
525
+ BaseCombobox.Root,
526
+ {
527
+ multiple: true,
528
+ items: options,
529
+ value: find(value),
530
+ defaultValue: find(defaultValue),
531
+ onValueChange: (selected) => onValueChange?.(selected.map((option) => option.value)),
532
+ itemToStringLabel,
533
+ itemToStringValue,
534
+ isItemEqualToValue,
535
+ disabled,
536
+ readOnly,
537
+ required,
538
+ name,
539
+ children: [
540
+ /* @__PURE__ */ jsxs8(
541
+ BaseCombobox.Chips,
542
+ {
543
+ ref: anchor,
544
+ "data-kit": "combobox",
545
+ "data-multiple": "",
546
+ "data-size": size,
547
+ "data-invalid": invalid ? "" : void 0,
548
+ className,
549
+ style,
550
+ children: [
551
+ /* @__PURE__ */ jsx13(BaseCombobox.Value, { children: (selected) => /* @__PURE__ */ jsxs8(Fragment5, { children: [
552
+ selected.map((option) => /* @__PURE__ */ jsxs8(BaseCombobox.Chip, { "data-kit-slot": "combobox-chip", children: [
553
+ /* @__PURE__ */ jsx13("span", { "data-kit-slot": "combobox-chip-text", children: option.label }),
554
+ /* @__PURE__ */ jsx13(
555
+ BaseCombobox.ChipRemove,
556
+ {
557
+ "data-kit-slot": "combobox-chip-remove",
558
+ "aria-label": removeLabel(option.label),
559
+ children: /* @__PURE__ */ jsx13(Icon4, { name: "close", size: 12 })
560
+ }
561
+ )
562
+ ] }, option.value)),
563
+ /* @__PURE__ */ jsx13(
564
+ BaseCombobox.Input,
565
+ {
566
+ "data-kit-slot": "combobox-input",
567
+ placeholder: selected.length === 0 ? placeholder : void 0,
568
+ "aria-label": ariaLabel,
569
+ "aria-labelledby": ariaLabelledBy,
570
+ "aria-describedby": ariaDescribedBy,
571
+ "aria-invalid": invalid ? true : void 0
572
+ }
573
+ )
574
+ ] }) }),
575
+ /* @__PURE__ */ jsx13(BaseCombobox.Clear, { "data-kit-slot": "combobox-clear", "aria-label": clearLabel, children: /* @__PURE__ */ jsx13(Icon4, { name: "close", size: 16 }) }),
576
+ /* @__PURE__ */ jsx13(OpenButton, { label: openLabel })
577
+ ]
578
+ }
579
+ ),
580
+ /* @__PURE__ */ jsx13(BaseCombobox.Portal, { children: /* @__PURE__ */ jsx13(BaseCombobox.Positioner, { anchor, sideOffset: 4, "data-kit": "combobox-positioner", children: /* @__PURE__ */ jsxs8(BaseCombobox.Popup, { "data-kit": "combobox-popup", children: [
581
+ /* @__PURE__ */ jsx13(BaseCombobox.Empty, { "data-kit-slot": "combobox-empty", children: emptyLabel }),
582
+ /* @__PURE__ */ jsx13(BaseCombobox.List, { "data-kit-slot": "combobox-list", children: (option) => /* @__PURE__ */ jsxs8(
583
+ BaseCombobox.Item,
584
+ {
585
+ value: option,
586
+ disabled: option.disabled,
587
+ "data-kit": "combobox-item",
588
+ children: [
589
+ /* @__PURE__ */ jsx13(BaseCombobox.ItemIndicator, { "data-kit-slot": "combobox-item-indicator", children: /* @__PURE__ */ jsx13(Icon4, { name: "check", size: 16 }) }),
590
+ /* @__PURE__ */ jsx13("span", { "data-kit-slot": "combobox-item-text", children: option.label })
591
+ ]
592
+ },
593
+ option.value
594
+ ) })
595
+ ] }) }) })
596
+ ]
597
+ }
598
+ );
599
+ }
600
+
601
+ // src/components/field.tsx
602
+ import { Field as BaseField } from "@base-ui/react/field";
603
+ import { Fieldset as BaseFieldset } from "@base-ui/react/fieldset";
604
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
605
+ function Field({
606
+ label,
607
+ description,
608
+ error,
609
+ required = false,
610
+ orientation = "vertical",
611
+ invalid,
612
+ children,
613
+ ...props
614
+ }) {
615
+ const hasError = error !== void 0 && error !== null && error !== false && error !== "";
616
+ return /* @__PURE__ */ jsxs9(
617
+ BaseField.Root,
618
+ {
619
+ "data-kit": "field",
620
+ "data-orientation": orientation,
621
+ "data-required": required ? "" : void 0,
622
+ invalid: invalid ?? (hasError ? true : void 0),
623
+ ...props,
624
+ children: [
625
+ label ? /* @__PURE__ */ jsxs9(BaseField.Label, { "data-kit-slot": "field-label", children: [
626
+ label,
627
+ required ? /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", "data-kit-slot": "field-required", children: "*" }) : null
628
+ ] }) : null,
629
+ description ? /* @__PURE__ */ jsx14(BaseField.Description, { "data-kit-slot": "field-description", children: description }) : null,
630
+ /* @__PURE__ */ jsx14("div", { "data-kit-slot": "field-control", children }),
631
+ hasError ? /* @__PURE__ */ jsx14(BaseField.Error, { match: true, "data-kit-slot": "field-error", "aria-live": "polite", children: error }) : null
632
+ ]
633
+ }
634
+ );
635
+ }
636
+ function FieldLabel(props) {
637
+ return /* @__PURE__ */ jsx14(BaseField.Label, { "data-kit-slot": "field-label", ...props });
638
+ }
639
+ function FieldDescription(props) {
640
+ return /* @__PURE__ */ jsx14(BaseField.Description, { "data-kit-slot": "field-description", ...props });
641
+ }
642
+ function FieldError(props) {
643
+ return /* @__PURE__ */ jsx14(BaseField.Error, { "data-kit-slot": "field-error", "aria-live": "polite", ...props });
644
+ }
645
+ function Fieldset({ legend, description, children, ...props }) {
646
+ return /* @__PURE__ */ jsxs9(BaseFieldset.Root, { "data-kit": "fieldset", ...props, children: [
647
+ /* @__PURE__ */ jsx14(BaseFieldset.Legend, { "data-kit-slot": "fieldset-legend", children: legend }),
648
+ description ? /* @__PURE__ */ jsx14("p", { "data-kit-slot": "fieldset-description", children: description }) : null,
649
+ /* @__PURE__ */ jsx14("div", { "data-kit-slot": "fieldset-body", children })
650
+ ] });
651
+ }
652
+
653
+ // src/components/input.tsx
654
+ import { Input as BaseInput } from "@base-ui/react/input";
655
+ import { Icon as Icon5 } from "@x12i/icons";
656
+ import { useState as useState2 } from "react";
657
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
658
+ function Input({ size = "md", invalid, ...props }) {
659
+ return /* @__PURE__ */ jsx15(
660
+ BaseInput,
661
+ {
662
+ "data-kit": "input",
663
+ "data-size": size,
664
+ "data-invalid": invalid ? "" : void 0,
665
+ "aria-invalid": invalid ? true : void 0,
666
+ ...props
667
+ }
668
+ );
669
+ }
670
+ function InputGroup({ size = "md", invalid, disabled, ...props }) {
671
+ return /* @__PURE__ */ jsx15(
672
+ "div",
673
+ {
674
+ "data-kit": "input-group",
675
+ "data-size": size,
676
+ "data-invalid": invalid ? "" : void 0,
677
+ "data-disabled": disabled ? "" : void 0,
678
+ ...props
679
+ }
680
+ );
681
+ }
682
+ function InputAddon(props) {
683
+ return /* @__PURE__ */ jsx15("span", { "data-kit": "input-addon", ...props });
684
+ }
685
+ function PasswordInput({
686
+ showLabel,
687
+ hideLabel,
688
+ startAddon,
689
+ size = "md",
690
+ invalid,
691
+ disabled,
692
+ ...props
693
+ }) {
694
+ const [visible, setVisible] = useState2(false);
695
+ return /* @__PURE__ */ jsxs10(InputGroup, { size, invalid, disabled, children: [
696
+ startAddon ? /* @__PURE__ */ jsx15(InputAddon, { "aria-hidden": "true", children: startAddon }) : null,
697
+ /* @__PURE__ */ jsx15(
698
+ Input,
699
+ {
700
+ size,
701
+ invalid,
702
+ disabled,
703
+ autoComplete: "current-password",
704
+ ...props,
705
+ type: visible ? "text" : "password"
706
+ }
707
+ ),
708
+ /* @__PURE__ */ jsx15(
709
+ IconButton,
710
+ {
711
+ label: visible ? hideLabel : showLabel,
712
+ variant: "ghost",
713
+ tone: "neutral",
714
+ size: size === "xl" ? "lg" : "sm",
715
+ disabled,
716
+ onClick: () => setVisible((current) => !current),
717
+ children: /* @__PURE__ */ jsx15(Icon5, { name: visible ? "eye-off" : "eye" })
718
+ }
719
+ )
720
+ ] });
721
+ }
722
+
723
+ // src/components/number-input.tsx
724
+ import { NumberField as BaseNumberField } from "@base-ui/react/number-field";
725
+ import { Icon as Icon6 } from "@x12i/icons";
726
+ import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
727
+ function NumberInput({
728
+ size = "md",
729
+ invalid,
730
+ decrementLabel,
731
+ incrementLabel,
732
+ placeholder,
733
+ "aria-label": ariaLabel,
734
+ "aria-labelledby": ariaLabelledBy,
735
+ "aria-describedby": ariaDescribedBy,
736
+ ...props
737
+ }) {
738
+ return /* @__PURE__ */ jsx16(BaseNumberField.Root, { ...props, children: /* @__PURE__ */ jsxs11(
739
+ BaseNumberField.Group,
740
+ {
741
+ "data-kit": "number-input",
742
+ "data-size": size,
743
+ "data-invalid": invalid ? "" : void 0,
744
+ children: [
745
+ /* @__PURE__ */ jsx16(BaseNumberField.Decrement, { "data-kit-slot": "number-decrement", "aria-label": decrementLabel, children: /* @__PURE__ */ jsx16(Icon6, { name: "minus", size: size === "xs" || size === "sm" ? 12 : 16 }) }),
746
+ /* @__PURE__ */ jsx16(
747
+ BaseNumberField.Input,
748
+ {
749
+ "data-kit-slot": "number-control",
750
+ placeholder,
751
+ "aria-label": ariaLabel,
752
+ "aria-labelledby": ariaLabelledBy,
753
+ "aria-describedby": ariaDescribedBy,
754
+ "aria-invalid": invalid ? true : void 0
755
+ }
756
+ ),
757
+ /* @__PURE__ */ jsx16(BaseNumberField.Increment, { "data-kit-slot": "number-increment", "aria-label": incrementLabel, children: /* @__PURE__ */ jsx16(Icon6, { name: "plus", size: size === "xs" || size === "sm" ? 12 : 16 }) })
758
+ ]
759
+ }
760
+ ) });
761
+ }
762
+
763
+ // src/components/otp-input.tsx
764
+ import { OTPField as BaseOTPField } from "@base-ui/react/otp-field";
765
+ import { useId as useId3 } from "react";
766
+ import { Fragment as Fragment6, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
767
+ function OTPInput({
768
+ size = "md",
769
+ invalid,
770
+ length,
771
+ label,
772
+ getInputLabel,
773
+ id,
774
+ ...props
775
+ }) {
776
+ const generatedId = useId3();
777
+ const firstId = id ?? generatedId;
778
+ return /* @__PURE__ */ jsxs12(Fragment6, { children: [
779
+ label ? /* @__PURE__ */ jsx17(VisuallyHidden, { children: /* @__PURE__ */ jsx17("label", { htmlFor: firstId, children: label }) }) : null,
780
+ /* @__PURE__ */ jsx17(
781
+ BaseOTPField.Root,
782
+ {
783
+ "data-kit": "otp-input",
784
+ "data-size": size,
785
+ "data-invalid": invalid ? "" : void 0,
786
+ id: firstId,
787
+ length,
788
+ ...props,
789
+ children: Array.from({ length }, (_, index) => /* @__PURE__ */ jsx17(
790
+ BaseOTPField.Input,
791
+ {
792
+ "data-kit-slot": "otp-box",
793
+ "aria-label": index === 0 ? void 0 : getInputLabel(index, length),
794
+ "aria-invalid": invalid ? true : void 0
795
+ },
796
+ index
797
+ ))
798
+ }
799
+ )
800
+ ] });
801
+ }
802
+
803
+ // src/components/radio-group.tsx
804
+ import { Radio as BaseRadio } from "@base-ui/react/radio";
805
+ import { RadioGroup as BaseRadioGroup } from "@base-ui/react/radio-group";
806
+ import { jsx as jsx18 } from "react/jsx-runtime";
807
+ function RadioGroup({
808
+ orientation = "vertical",
809
+ ...props
810
+ }) {
811
+ return /* @__PURE__ */ jsx18(BaseRadioGroup, { "data-kit": "radio-group", "data-orientation": orientation, ...props });
812
+ }
813
+ function Radio({
814
+ label,
815
+ description,
816
+ disabled,
817
+ ...props
818
+ }) {
819
+ const { labelId, descriptionId, controlAria } = useChoiceIds(label, description);
820
+ const control = /* @__PURE__ */ jsx18(BaseRadio.Root, { "data-kit": "radio", disabled, ...controlAria, ...props, children: /* @__PURE__ */ jsx18(BaseRadio.Indicator, { "data-kit-slot": "radio-indicator" }) });
821
+ return /* @__PURE__ */ jsx18(
822
+ ChoiceRow,
823
+ {
824
+ kind: "radio",
825
+ control,
826
+ label,
827
+ description,
828
+ labelId,
829
+ descriptionId,
830
+ disabled
831
+ }
832
+ );
833
+ }
834
+
835
+ // src/components/select.tsx
836
+ import { Select as BaseSelect } from "@base-ui/react/select";
837
+ import { Icon as Icon7 } from "@x12i/icons";
838
+ import { Fragment as Fragment7 } from "react";
839
+ import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
840
+ function isGroup(item) {
841
+ return "options" in item;
842
+ }
843
+ function flatten(items) {
844
+ return items.flatMap((item) => isGroup(item) ? item.options : [item]);
845
+ }
846
+ function Select({
847
+ options,
848
+ placeholder,
849
+ size = "md",
850
+ invalid,
851
+ className,
852
+ style,
853
+ "aria-label": ariaLabel,
854
+ "aria-labelledby": ariaLabelledBy,
855
+ "aria-describedby": ariaDescribedBy,
856
+ ...props
857
+ }) {
858
+ const flat = flatten(options);
859
+ const renderOption = (option) => /* @__PURE__ */ jsxs13(
860
+ BaseSelect.Item,
861
+ {
862
+ value: option.value,
863
+ disabled: option.disabled,
864
+ label: option.textValue ?? (typeof option.label === "string" ? option.label : String(option.value)),
865
+ "data-kit": "select-item",
866
+ children: [
867
+ /* @__PURE__ */ jsx19(BaseSelect.ItemIndicator, { "data-kit-slot": "select-item-indicator", children: /* @__PURE__ */ jsx19(Icon7, { name: "check", size: 16 }) }),
868
+ /* @__PURE__ */ jsx19(BaseSelect.ItemText, { "data-kit-slot": "select-item-text", children: option.label })
869
+ ]
870
+ },
871
+ option.value
872
+ );
873
+ return /* @__PURE__ */ jsxs13(
874
+ BaseSelect.Root,
875
+ {
876
+ items: flat.map((option) => ({ value: option.value, label: option.label })),
877
+ ...props,
878
+ children: [
879
+ /* @__PURE__ */ jsxs13(
880
+ BaseSelect.Trigger,
881
+ {
882
+ "data-kit": "select",
883
+ "data-size": size,
884
+ "data-invalid": invalid ? "" : void 0,
885
+ "aria-invalid": invalid ? true : void 0,
886
+ "aria-label": ariaLabel,
887
+ "aria-labelledby": ariaLabelledBy,
888
+ "aria-describedby": ariaDescribedBy,
889
+ className,
890
+ style,
891
+ children: [
892
+ /* @__PURE__ */ jsx19(BaseSelect.Value, { "data-kit-slot": "select-value", placeholder }),
893
+ /* @__PURE__ */ jsx19(BaseSelect.Icon, { "data-kit-slot": "select-icon", children: /* @__PURE__ */ jsx19(Icon7, { name: "chevron-down" }) })
894
+ ]
895
+ }
896
+ ),
897
+ /* @__PURE__ */ jsx19(BaseSelect.Portal, { children: /* @__PURE__ */ jsx19(BaseSelect.Positioner, { sideOffset: 4, alignItemWithTrigger: false, "data-kit": "select-positioner", children: /* @__PURE__ */ jsx19(BaseSelect.Popup, { "data-kit": "select-popup", children: /* @__PURE__ */ jsx19(BaseSelect.List, { "data-kit-slot": "select-list", children: options.map(
898
+ (item, index) => isGroup(item) ? /* @__PURE__ */ jsxs13(BaseSelect.Group, { "data-kit-slot": "select-group", children: [
899
+ /* @__PURE__ */ jsx19(BaseSelect.GroupLabel, { "data-kit-slot": "select-group-label", children: item.label }),
900
+ item.options.map(renderOption)
901
+ ] }, `group-${index}`) : /* @__PURE__ */ jsx19(Fragment7, { children: renderOption(item) }, item.value)
902
+ ) }) }) }) })
903
+ ]
904
+ }
905
+ );
906
+ }
907
+
908
+ // src/components/slider.tsx
909
+ import { Slider as BaseSlider } from "@base-ui/react/slider";
910
+ import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
911
+ function thumbCount(value) {
912
+ return Array.isArray(value) ? value.length : 1;
913
+ }
914
+ function Slider({
915
+ getThumbLabel,
916
+ showValue = false,
917
+ "aria-label": ariaLabel,
918
+ ...props
919
+ }) {
920
+ const count = thumbCount(props.value ?? props.defaultValue);
921
+ return (
922
+ // Center alignment needs no layout measurement, so the thumb is visible on
923
+ // the server and on first paint instead of appearing after hydration.
924
+ /* @__PURE__ */ jsxs14(BaseSlider.Root, { "data-kit": "slider", ...props, children: [
925
+ /* @__PURE__ */ jsx20(BaseSlider.Control, { "data-kit-slot": "slider-control", children: /* @__PURE__ */ jsxs14(BaseSlider.Track, { "data-kit-slot": "slider-track", children: [
926
+ /* @__PURE__ */ jsx20(BaseSlider.Indicator, { "data-kit-slot": "slider-indicator" }),
927
+ Array.from({ length: count }, (_, index) => {
928
+ const label = getThumbLabel?.(index, count) ?? ariaLabel;
929
+ return /* @__PURE__ */ jsx20(
930
+ BaseSlider.Thumb,
931
+ {
932
+ index,
933
+ "data-kit-slot": "slider-thumb",
934
+ getAriaLabel: label === void 0 ? void 0 : () => label
935
+ },
936
+ index
937
+ );
938
+ })
939
+ ] }) }),
940
+ showValue ? /* @__PURE__ */ jsx20(BaseSlider.Value, { "data-kit-slot": "slider-value" }) : null
941
+ ] })
942
+ );
943
+ }
944
+
945
+ // src/components/switch.tsx
946
+ import { Switch as BaseSwitch } from "@base-ui/react/switch";
947
+ import { jsx as jsx21 } from "react/jsx-runtime";
948
+ function Switch({ label, description, disabled, ...props }) {
949
+ const { labelId, descriptionId, controlAria } = useChoiceIds(label, description);
950
+ const control = /* @__PURE__ */ jsx21(BaseSwitch.Root, { "data-kit": "switch", disabled, ...controlAria, ...props, children: /* @__PURE__ */ jsx21(BaseSwitch.Thumb, { "data-kit-slot": "switch-thumb" }) });
951
+ return /* @__PURE__ */ jsx21(
952
+ ChoiceRow,
953
+ {
954
+ kind: "switch",
955
+ control,
956
+ label,
957
+ description,
958
+ labelId,
959
+ descriptionId,
960
+ disabled
961
+ }
962
+ );
963
+ }
964
+
965
+ // src/components/textarea.tsx
966
+ import { Field as BaseField2 } from "@base-ui/react/field";
967
+ import { jsx as jsx22 } from "react/jsx-runtime";
968
+ function Textarea({
969
+ size = "md",
970
+ invalid,
971
+ rows = 3,
972
+ autoResize = false,
973
+ ...props
974
+ }) {
975
+ return /* @__PURE__ */ jsx22(
976
+ BaseField2.Control,
977
+ {
978
+ "data-kit": "textarea",
979
+ "data-size": size,
980
+ "data-invalid": invalid ? "" : void 0,
981
+ "data-auto-resize": autoResize ? "" : void 0,
982
+ "aria-invalid": invalid ? true : void 0,
983
+ render: (controlProps) => /* @__PURE__ */ jsx22("textarea", { ...controlProps, rows }),
984
+ ...props
985
+ }
986
+ );
987
+ }
988
+
989
+ // src/components/divider.tsx
990
+ import { jsx as jsx23 } from "react/jsx-runtime";
991
+ function Divider({
992
+ orientation = "horizontal",
993
+ decorative = false,
994
+ className,
995
+ ...props
996
+ }) {
997
+ return /* @__PURE__ */ jsx23(
998
+ "hr",
999
+ {
1000
+ "data-kit": "divider",
1001
+ "data-orientation": orientation,
1002
+ role: decorative ? "presentation" : void 0,
1003
+ "aria-orientation": !decorative && orientation === "vertical" ? "vertical" : void 0,
1004
+ className: cx(className),
1005
+ ...props
1006
+ }
1007
+ );
1008
+ }
1009
+
1010
+ // src/components/stack.tsx
1011
+ import { cssVar } from "@x12i/tokens";
1012
+ import { jsx as jsx24 } from "react/jsx-runtime";
1013
+ function Flex({
1014
+ kind,
1015
+ gap,
1016
+ align,
1017
+ justify,
1018
+ wrap,
1019
+ asChild = false,
1020
+ className,
1021
+ style,
1022
+ ...props
1023
+ }) {
1024
+ const Component = asChild ? Slot : "div";
1025
+ const gapStyle = gap === void 0 ? void 0 : { gap: cssVar(`space.${gap}`) };
1026
+ return /* @__PURE__ */ jsx24(
1027
+ Component,
1028
+ {
1029
+ "data-kit": kind,
1030
+ "data-align": align,
1031
+ "data-justify": justify,
1032
+ "data-wrap": wrap ? "" : void 0,
1033
+ className: cx(className),
1034
+ style: { ...gapStyle, ...style },
1035
+ ...props
1036
+ }
1037
+ );
1038
+ }
1039
+ function Stack({ gap = "3", ...props }) {
1040
+ return /* @__PURE__ */ jsx24(Flex, { kind: "stack", gap, ...props });
1041
+ }
1042
+ function Inline({ gap = "2", align = "center", wrap = true, ...props }) {
1043
+ return /* @__PURE__ */ jsx24(Flex, { kind: "inline", gap, align, wrap, ...props });
1044
+ }
1045
+
1046
+ // src/components/alert.tsx
1047
+ import { Icon as Icon8 } from "@x12i/icons";
1048
+ import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
1049
+ var toneIcons = {
1050
+ neutral: "info",
1051
+ accent: "info",
1052
+ info: "info",
1053
+ success: "check-circle",
1054
+ warning: "alert-triangle",
1055
+ danger: "alert-circle"
1056
+ };
1057
+ function Alert({
1058
+ tone = "info",
1059
+ title,
1060
+ icon,
1061
+ action,
1062
+ onDismiss,
1063
+ dismissLabel,
1064
+ role,
1065
+ children,
1066
+ ...props
1067
+ }) {
1068
+ const glyph = icon === false ? null : icon ?? /* @__PURE__ */ jsx25(Icon8, { name: toneIcons[tone], size: 20 });
1069
+ return /* @__PURE__ */ jsxs15(
1070
+ "div",
1071
+ {
1072
+ "data-kit": "alert",
1073
+ "data-tone": tone,
1074
+ role: role ?? (tone === "danger" ? "alert" : "status"),
1075
+ ...props,
1076
+ children: [
1077
+ glyph ? /* @__PURE__ */ jsx25("span", { "data-kit-slot": "alert-icon", "aria-hidden": "true", children: glyph }) : null,
1078
+ /* @__PURE__ */ jsxs15("div", { "data-kit-slot": "alert-body", children: [
1079
+ title ? /* @__PURE__ */ jsx25("div", { "data-kit-slot": "alert-title", children: title }) : null,
1080
+ children ? /* @__PURE__ */ jsx25("div", { "data-kit-slot": "alert-message", children }) : null
1081
+ ] }),
1082
+ action ? /* @__PURE__ */ jsx25("div", { "data-kit-slot": "alert-action", children: action }) : null,
1083
+ onDismiss ? /* @__PURE__ */ jsx25(IconButton, { label: dismissLabel, variant: "ghost", tone: "neutral", size: "sm", onClick: onDismiss, children: /* @__PURE__ */ jsx25(Icon8, { name: "close" }) }) : null
1084
+ ]
1085
+ }
1086
+ );
1087
+ }
1088
+ function Callout({ tone = "info", title, icon, children, ...props }) {
1089
+ const glyph = icon === false ? null : icon ?? /* @__PURE__ */ jsx25(Icon8, { name: toneIcons[tone], size: 20 });
1090
+ return /* @__PURE__ */ jsxs15("aside", { "data-kit": "callout", "data-tone": tone, ...props, children: [
1091
+ glyph ? /* @__PURE__ */ jsx25("span", { "data-kit-slot": "callout-icon", "aria-hidden": "true", children: glyph }) : null,
1092
+ /* @__PURE__ */ jsxs15("div", { "data-kit-slot": "callout-body", children: [
1093
+ title ? /* @__PURE__ */ jsx25("div", { "data-kit-slot": "callout-title", children: title }) : null,
1094
+ children ? /* @__PURE__ */ jsx25("div", { "data-kit-slot": "callout-content", children }) : null
1095
+ ] })
1096
+ ] });
1097
+ }
1098
+
1099
+ // src/components/progress.tsx
1100
+ import { Meter as BaseMeter } from "@base-ui/react/meter";
1101
+ import { Progress as BaseProgress } from "@base-ui/react/progress";
1102
+ import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
1103
+ function Progress({
1104
+ label,
1105
+ showValue = false,
1106
+ size = "md",
1107
+ tone = "accent",
1108
+ ...props
1109
+ }) {
1110
+ return /* @__PURE__ */ jsxs16(BaseProgress.Root, { "data-kit": "progress", "data-size": size, "data-tone": tone, ...props, children: [
1111
+ label || showValue ? /* @__PURE__ */ jsxs16("div", { "data-kit-slot": "progress-header", children: [
1112
+ label ? /* @__PURE__ */ jsx26(BaseProgress.Label, { "data-kit-slot": "progress-label", children: label }) : null,
1113
+ showValue ? /* @__PURE__ */ jsx26(BaseProgress.Value, { "data-kit-slot": "progress-value" }) : null
1114
+ ] }) : null,
1115
+ /* @__PURE__ */ jsx26(BaseProgress.Track, { "data-kit-slot": "progress-track", children: /* @__PURE__ */ jsx26(BaseProgress.Indicator, { "data-kit-slot": "progress-indicator" }) })
1116
+ ] });
1117
+ }
1118
+ function Meter({ label, showValue = false, size = "md", tone = "accent", ...props }) {
1119
+ return /* @__PURE__ */ jsxs16(BaseMeter.Root, { "data-kit": "meter", "data-size": size, "data-tone": tone, ...props, children: [
1120
+ label || showValue ? /* @__PURE__ */ jsxs16("div", { "data-kit-slot": "progress-header", children: [
1121
+ label ? /* @__PURE__ */ jsx26(BaseMeter.Label, { "data-kit-slot": "progress-label", children: label }) : null,
1122
+ showValue ? /* @__PURE__ */ jsx26(BaseMeter.Value, { "data-kit-slot": "progress-value" }) : null
1123
+ ] }) : null,
1124
+ /* @__PURE__ */ jsx26(BaseMeter.Track, { "data-kit-slot": "progress-track", children: /* @__PURE__ */ jsx26(BaseMeter.Indicator, { "data-kit-slot": "progress-indicator" }) })
1125
+ ] });
1126
+ }
1127
+
1128
+ // src/components/progress-circle.tsx
1129
+ import { Progress as BaseProgress2 } from "@base-ui/react/progress";
1130
+ import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
1131
+ var RADIUS = 45;
1132
+ var INDETERMINATE_PERCENT = 25;
1133
+ function percentOf(value, min, max) {
1134
+ if (value === null || !Number.isFinite(value) || max <= min) return 0;
1135
+ const percent = (value - min) / (max - min) * 100;
1136
+ return Math.round(Math.min(100, Math.max(0, percent)) * 100) / 100;
1137
+ }
1138
+ function ProgressCircle({
1139
+ label,
1140
+ showValue = false,
1141
+ children,
1142
+ size = "md",
1143
+ tone = "accent",
1144
+ value,
1145
+ min = 0,
1146
+ max = 100,
1147
+ ...props
1148
+ }) {
1149
+ const percent = value === null ? INDETERMINATE_PERCENT : percentOf(value, min, max);
1150
+ const center = children ?? (showValue && size !== "sm" ? /* @__PURE__ */ jsx27(BaseProgress2.Value, {}) : null);
1151
+ return /* @__PURE__ */ jsxs17(
1152
+ BaseProgress2.Root,
1153
+ {
1154
+ "data-kit": "progress-circle",
1155
+ "data-size": size,
1156
+ "data-tone": tone,
1157
+ value,
1158
+ min,
1159
+ max,
1160
+ ...props,
1161
+ children: [
1162
+ /* @__PURE__ */ jsxs17("div", { "data-kit-slot": "progress-circle-ring", style: { "--_percent": percent }, children: [
1163
+ /* @__PURE__ */ jsxs17("svg", { viewBox: "0 0 100 100", "aria-hidden": "true", focusable: "false", "data-kit-slot": "progress-circle-svg", children: [
1164
+ /* @__PURE__ */ jsx27("circle", { "data-kit-slot": "progress-circle-track", cx: 50, cy: 50, r: RADIUS }),
1165
+ /* @__PURE__ */ jsx27("circle", { "data-kit-slot": "progress-circle-indicator", cx: 50, cy: 50, r: RADIUS, pathLength: 100 })
1166
+ ] }),
1167
+ center ? /* @__PURE__ */ jsx27("span", { "data-kit-slot": "progress-circle-center", children: center }) : null
1168
+ ] }),
1169
+ label ? /* @__PURE__ */ jsx27(BaseProgress2.Label, { "data-kit-slot": "progress-circle-label", children: label }) : null
1170
+ ]
1171
+ }
1172
+ );
1173
+ }
1174
+
1175
+ // src/components/animated-number.tsx
1176
+ import { useEffect as useEffect2, useMemo, useRef as useRef3, useState as useState3 } from "react";
1177
+ import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
1178
+ var FALLBACK_DURATION = 400;
1179
+ var DEFAULT_MAX_DECIMALS = 3;
1180
+ var REDUCED_MOTION = "(prefers-reduced-motion: reduce)";
1181
+ var easeOut = (t) => 1 - (1 - t) ** 3;
1182
+ function prefersReducedMotion() {
1183
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(REDUCED_MOTION).matches;
1184
+ }
1185
+ function themeDuration(element) {
1186
+ if (!element || typeof getComputedStyle !== "function") return FALLBACK_DURATION;
1187
+ const raw = getComputedStyle(element).getPropertyValue("--kit-duration-slow").trim();
1188
+ const match = /^(\d*\.?\d+)(ms|s)$/.exec(raw);
1189
+ if (!match) return FALLBACK_DURATION;
1190
+ return Number(match[1]) * (match[2] === "s" ? 1e3 : 1);
1191
+ }
1192
+ function decimalsOf(value) {
1193
+ if (!Number.isFinite(value)) return 0;
1194
+ const [, decimals = ""] = value.toFixed(DEFAULT_MAX_DECIMALS).replace(/0+$/, "").split(".");
1195
+ return decimals.length;
1196
+ }
1197
+ function stableFormat(format, digits) {
1198
+ const plain = (format.style === void 0 || format.style === "decimal" || format.style === "unit") && (format.notation === void 0 || format.notation === "standard") && format.minimumFractionDigits === void 0 && format.maximumFractionDigits === void 0 && format.minimumSignificantDigits === void 0 && format.maximumSignificantDigits === void 0;
1199
+ return plain ? { ...format, minimumFractionDigits: digits, maximumFractionDigits: digits } : format;
1200
+ }
1201
+ function AnimatedNumber({ value, format, locale, duration, from, ...props }) {
1202
+ const [shown, setShown] = useState3(from ?? value);
1203
+ const shownRef = useRef3(shown);
1204
+ const visualRef = useRef3(null);
1205
+ const formatKey = JSON.stringify(format ?? {});
1206
+ const localeKey = locale === void 0 ? "" : String(locale);
1207
+ const digits = decimalsOf(value);
1208
+ const formatter = useMemo(
1209
+ () => new Intl.NumberFormat(
1210
+ localeKey === "" ? void 0 : localeKey.split(","),
1211
+ stableFormat(JSON.parse(formatKey), digits)
1212
+ ),
1213
+ [localeKey, formatKey, digits]
1214
+ );
1215
+ useEffect2(() => {
1216
+ const start = shownRef.current;
1217
+ if (Object.is(start, value)) return;
1218
+ const settle = () => {
1219
+ shownRef.current = value;
1220
+ setShown(value);
1221
+ };
1222
+ const ms = duration ?? themeDuration(visualRef.current);
1223
+ if (!Number.isFinite(value) || !Number.isFinite(start) || ms <= 0 || prefersReducedMotion()) {
1224
+ settle();
1225
+ return;
1226
+ }
1227
+ const startedAt = performance.now();
1228
+ let frame = 0;
1229
+ const tick = (now) => {
1230
+ const progress = Math.max(0, Math.min(1, (now - startedAt) / ms));
1231
+ if (progress === 1) {
1232
+ settle();
1233
+ return;
1234
+ }
1235
+ const next = start + (value - start) * easeOut(progress);
1236
+ shownRef.current = next;
1237
+ setShown(next);
1238
+ frame = requestAnimationFrame(tick);
1239
+ };
1240
+ frame = requestAnimationFrame(tick);
1241
+ return () => cancelAnimationFrame(frame);
1242
+ }, [value, duration]);
1243
+ return /* @__PURE__ */ jsxs18("span", { "data-kit": "animated-number", "data-animating": Object.is(shown, value) ? void 0 : "", ...props, children: [
1244
+ /* @__PURE__ */ jsx28("span", { ref: visualRef, "aria-hidden": "true", "data-kit-slot": "animated-number-visual", children: formatter.format(shown) }),
1245
+ /* @__PURE__ */ jsx28(VisuallyHidden, { children: formatter.format(value) })
1246
+ ] });
1247
+ }
1248
+
1249
+ // src/components/skeleton.tsx
1250
+ import { jsx as jsx29 } from "react/jsx-runtime";
1251
+ function Skeleton({ variant = "text", width, height, style, ...props }) {
1252
+ return /* @__PURE__ */ jsx29(
1253
+ "div",
1254
+ {
1255
+ "aria-hidden": "true",
1256
+ "data-kit": "skeleton",
1257
+ "data-variant": variant,
1258
+ style: { inlineSize: width, blockSize: height, ...style },
1259
+ ...props
1260
+ }
1261
+ );
1262
+ }
1263
+ function SkeletonText({ lines = 3, ...props }) {
1264
+ return /* @__PURE__ */ jsx29("div", { "data-kit": "skeleton-text", "aria-hidden": "true", ...props, children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ jsx29(
1265
+ Skeleton,
1266
+ {
1267
+ variant: "text",
1268
+ width: index === lines - 1 && lines > 1 ? "60%" : void 0
1269
+ },
1270
+ index
1271
+ )) });
1272
+ }
1273
+
1274
+ // src/components/empty-state.tsx
1275
+ import { jsx as jsx30, jsxs as jsxs19 } from "react/jsx-runtime";
1276
+ function EmptyState({
1277
+ icon,
1278
+ title,
1279
+ description,
1280
+ action,
1281
+ headingLevel = 3,
1282
+ ...props
1283
+ }) {
1284
+ const Heading = `h${headingLevel}`;
1285
+ return /* @__PURE__ */ jsxs19("div", { "data-kit": "empty-state", ...props, children: [
1286
+ icon ? /* @__PURE__ */ jsx30("div", { "data-kit-slot": "empty-icon", "aria-hidden": "true", children: icon }) : null,
1287
+ /* @__PURE__ */ jsx30(Heading, { "data-kit-slot": "empty-title", children: title }),
1288
+ description ? /* @__PURE__ */ jsx30("p", { "data-kit-slot": "empty-description", children: description }) : null,
1289
+ action ? /* @__PURE__ */ jsx30("div", { "data-kit-slot": "empty-action", children: action }) : null
1290
+ ] });
1291
+ }
1292
+
1293
+ // src/components/card.tsx
1294
+ import { jsx as jsx31 } from "react/jsx-runtime";
1295
+ function Card({
1296
+ variant = "outlined",
1297
+ padding = "md",
1298
+ interactive = false,
1299
+ asChild = false,
1300
+ ...props
1301
+ }) {
1302
+ const shared = {
1303
+ "data-kit": "card",
1304
+ "data-variant": variant,
1305
+ "data-padding": padding,
1306
+ "data-interactive": interactive ? "" : void 0,
1307
+ ...props
1308
+ };
1309
+ return asChild ? /* @__PURE__ */ jsx31(Slot, { ...shared }) : /* @__PURE__ */ jsx31("div", { ...shared });
1310
+ }
1311
+ function CardHeader(props) {
1312
+ return /* @__PURE__ */ jsx31("div", { "data-kit-slot": "card-header", ...props });
1313
+ }
1314
+ function CardTitle({ level = 3, ...props }) {
1315
+ const Heading = `h${level}`;
1316
+ return /* @__PURE__ */ jsx31(Heading, { "data-kit-slot": "card-title", ...props });
1317
+ }
1318
+ function CardDescription(props) {
1319
+ return /* @__PURE__ */ jsx31("p", { "data-kit-slot": "card-description", ...props });
1320
+ }
1321
+ function CardContent(props) {
1322
+ return /* @__PURE__ */ jsx31("div", { "data-kit-slot": "card-content", ...props });
1323
+ }
1324
+ function CardFooter(props) {
1325
+ return /* @__PURE__ */ jsx31("div", { "data-kit-slot": "card-footer", ...props });
1326
+ }
1327
+
1328
+ // src/components/avatar.tsx
1329
+ import { Avatar as BaseAvatar } from "@base-ui/react/avatar";
1330
+ import { Children as Children2 } from "react";
1331
+ import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
1332
+ function getInitials(name) {
1333
+ const words = name.trim().split(/\s+/).filter(Boolean);
1334
+ if (words.length === 0) return "";
1335
+ const first = Array.from(words[0] ?? "")[0] ?? "";
1336
+ const last = words.length > 1 ? Array.from(words[words.length - 1] ?? "")[0] ?? "" : "";
1337
+ return `${first}${last}`.toLocaleUpperCase();
1338
+ }
1339
+ function Avatar({
1340
+ src,
1341
+ name,
1342
+ alt,
1343
+ size = "md",
1344
+ shape = "circle",
1345
+ fallback,
1346
+ ...props
1347
+ }) {
1348
+ const label = alt ?? name ?? "";
1349
+ const decorative = label === "";
1350
+ return /* @__PURE__ */ jsxs20(
1351
+ BaseAvatar.Root,
1352
+ {
1353
+ "data-kit": "avatar",
1354
+ "data-size": size,
1355
+ "data-shape": shape,
1356
+ role: decorative ? void 0 : "img",
1357
+ "aria-label": decorative ? void 0 : label,
1358
+ ...props,
1359
+ children: [
1360
+ src ? /* @__PURE__ */ jsx32(BaseAvatar.Image, { "data-kit-slot": "avatar-image", src, alt: "" }) : null,
1361
+ /* @__PURE__ */ jsx32(BaseAvatar.Fallback, { "data-kit-slot": "avatar-fallback", "aria-hidden": "true", children: fallback ?? (name ? getInitials(name) : null) })
1362
+ ]
1363
+ }
1364
+ );
1365
+ }
1366
+ function AvatarGroup({
1367
+ max = 4,
1368
+ overflowLabel,
1369
+ size = "md",
1370
+ children,
1371
+ ...props
1372
+ }) {
1373
+ const avatars = Children2.toArray(children);
1374
+ const shown = avatars.slice(0, max);
1375
+ const hidden = avatars.length - shown.length;
1376
+ return /* @__PURE__ */ jsxs20("div", { role: "group", "data-kit": "avatar-group", "data-size": size, ...props, children: [
1377
+ shown,
1378
+ hidden > 0 ? /* @__PURE__ */ jsx32(
1379
+ "span",
1380
+ {
1381
+ "data-kit": "avatar",
1382
+ "data-size": size,
1383
+ "data-shape": "circle",
1384
+ "data-overflow": "",
1385
+ role: "img",
1386
+ "aria-label": overflowLabel?.(hidden) ?? `+${hidden}`,
1387
+ children: /* @__PURE__ */ jsx32("span", { "aria-hidden": "true", "data-kit-slot": "avatar-fallback", children: `+${hidden}` })
1388
+ }
1389
+ ) : null
1390
+ ] });
1391
+ }
1392
+
1393
+ // src/components/tag.tsx
1394
+ import { Icon as Icon9 } from "@x12i/icons";
1395
+ import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
1396
+ function Tag({
1397
+ tone = "neutral",
1398
+ size = "md",
1399
+ icon,
1400
+ onRemove,
1401
+ removeLabel,
1402
+ children,
1403
+ ...props
1404
+ }) {
1405
+ return /* @__PURE__ */ jsxs21("span", { "data-kit": "tag", "data-tone": tone, "data-size": size, ...props, children: [
1406
+ icon ? /* @__PURE__ */ jsx33("span", { "data-kit-slot": "tag-icon", "aria-hidden": "true", children: icon }) : null,
1407
+ /* @__PURE__ */ jsx33("span", { "data-kit-slot": "tag-text", children }),
1408
+ onRemove ? /* @__PURE__ */ jsx33("button", { type: "button", "data-kit-slot": "tag-remove", "aria-label": removeLabel, onClick: onRemove, children: /* @__PURE__ */ jsx33(Icon9, { name: "close", size: 12 }) }) : null
1409
+ ] });
1410
+ }
1411
+
1412
+ // src/components/stat.tsx
1413
+ import { Icon as Icon10 } from "@x12i/icons";
1414
+ import { jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
1415
+ var trendIcon = {
1416
+ up: "chevron-up",
1417
+ down: "chevron-down",
1418
+ flat: "minus"
1419
+ };
1420
+ function Stat({
1421
+ label,
1422
+ value,
1423
+ delta,
1424
+ trend = "flat",
1425
+ intent,
1426
+ trendLabel,
1427
+ help,
1428
+ ...props
1429
+ }) {
1430
+ const resolvedIntent = intent ?? (trend === "up" ? "positive" : trend === "down" ? "negative" : "neutral");
1431
+ return /* @__PURE__ */ jsxs22("dl", { "data-kit": "stat", ...props, children: [
1432
+ /* @__PURE__ */ jsx34("dt", { "data-kit-slot": "stat-label", children: label }),
1433
+ /* @__PURE__ */ jsx34("dd", { "data-kit-slot": "stat-value", children: value }),
1434
+ delta ? /* @__PURE__ */ jsxs22("dd", { "data-kit-slot": "stat-delta", "data-trend": trend, "data-intent": resolvedIntent, children: [
1435
+ /* @__PURE__ */ jsx34(Icon10, { name: trendIcon[trend], size: 16 }),
1436
+ trendLabel ? /* @__PURE__ */ jsx34(VisuallyHidden, { children: `${trendLabel} ` }) : null,
1437
+ delta
1438
+ ] }) : null,
1439
+ help ? /* @__PURE__ */ jsx34("dd", { "data-kit-slot": "stat-help", children: help }) : null
1440
+ ] });
1441
+ }
1442
+
1443
+ // src/components/table.tsx
1444
+ import { jsx as jsx35 } from "react/jsx-runtime";
1445
+ function TableContainer({ label, ...props }) {
1446
+ return /* @__PURE__ */ jsx35("div", { "data-kit": "table-container", role: "region", "aria-label": label, tabIndex: 0, ...props });
1447
+ }
1448
+ function Table({ striped, stickyHeader, density, ...props }) {
1449
+ return /* @__PURE__ */ jsx35(
1450
+ "table",
1451
+ {
1452
+ "data-kit": "table",
1453
+ "data-striped": striped ? "" : void 0,
1454
+ "data-sticky-header": stickyHeader ? "" : void 0,
1455
+ "data-density": density,
1456
+ ...props
1457
+ }
1458
+ );
1459
+ }
1460
+ function TableCaption(props) {
1461
+ return /* @__PURE__ */ jsx35("caption", { "data-kit-slot": "table-caption", ...props });
1462
+ }
1463
+ function TableHead(props) {
1464
+ return /* @__PURE__ */ jsx35("thead", { "data-kit-slot": "table-head", ...props });
1465
+ }
1466
+ function TableBody(props) {
1467
+ return /* @__PURE__ */ jsx35("tbody", { "data-kit-slot": "table-body", ...props });
1468
+ }
1469
+ function TableFoot(props) {
1470
+ return /* @__PURE__ */ jsx35("tfoot", { "data-kit-slot": "table-foot", ...props });
1471
+ }
1472
+ function TableRow({ selected, ...props }) {
1473
+ return /* @__PURE__ */ jsx35("tr", { "data-kit-slot": "table-row", "data-selected": selected ? "" : void 0, ...props });
1474
+ }
1475
+ function TableHeaderCell({ align = "start", sort, scope = "col", ...props }) {
1476
+ return /* @__PURE__ */ jsx35(
1477
+ "th",
1478
+ {
1479
+ "data-kit-slot": "table-header-cell",
1480
+ "data-align": align,
1481
+ "data-sort": sort && sort !== "none" ? sort : void 0,
1482
+ "aria-sort": sort,
1483
+ scope,
1484
+ ...props
1485
+ }
1486
+ );
1487
+ }
1488
+ function TableCell({ align = "start", ...props }) {
1489
+ return /* @__PURE__ */ jsx35("td", { "data-kit-slot": "table-cell", "data-align": align, ...props });
1490
+ }
1491
+
1492
+ // src/components/scroll-area.tsx
1493
+ import { ScrollArea as BaseScrollArea } from "@base-ui/react/scroll-area";
1494
+ import { jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
1495
+ function ScrollArea({
1496
+ label,
1497
+ orientation = "vertical",
1498
+ children,
1499
+ ...props
1500
+ }) {
1501
+ return /* @__PURE__ */ jsxs23(BaseScrollArea.Root, { "data-kit": "scroll-area", ...props, children: [
1502
+ /* @__PURE__ */ jsx36(
1503
+ BaseScrollArea.Viewport,
1504
+ {
1505
+ "data-kit-slot": "scroll-viewport",
1506
+ role: "region",
1507
+ "aria-label": label,
1508
+ tabIndex: 0,
1509
+ children: /* @__PURE__ */ jsx36(BaseScrollArea.Content, { "data-kit-slot": "scroll-content", children })
1510
+ }
1511
+ ),
1512
+ orientation !== "horizontal" ? /* @__PURE__ */ jsx36(BaseScrollArea.Scrollbar, { orientation: "vertical", "data-kit-slot": "scrollbar", children: /* @__PURE__ */ jsx36(BaseScrollArea.Thumb, { "data-kit-slot": "scroll-thumb" }) }) : null,
1513
+ orientation !== "vertical" ? /* @__PURE__ */ jsx36(BaseScrollArea.Scrollbar, { orientation: "horizontal", "data-kit-slot": "scrollbar", children: /* @__PURE__ */ jsx36(BaseScrollArea.Thumb, { "data-kit-slot": "scroll-thumb" }) }) : null,
1514
+ orientation === "both" ? /* @__PURE__ */ jsx36(BaseScrollArea.Corner, { "data-kit-slot": "scroll-corner" }) : null
1515
+ ] });
1516
+ }
1517
+
1518
+ // src/components/collapsible.tsx
1519
+ import { Collapsible as BaseCollapsible } from "@base-ui/react/collapsible";
1520
+ import { Icon as Icon11 } from "@x12i/icons";
1521
+ import { jsx as jsx37, jsxs as jsxs24 } from "react/jsx-runtime";
1522
+ function Collapsible(props) {
1523
+ return /* @__PURE__ */ jsx37(BaseCollapsible.Root, { "data-kit": "collapsible", ...props });
1524
+ }
1525
+ function CollapsibleTrigger({ children, ...props }) {
1526
+ return /* @__PURE__ */ jsxs24(BaseCollapsible.Trigger, { "data-kit-slot": "collapsible-trigger", ...props, children: [
1527
+ /* @__PURE__ */ jsx37(Icon11, { name: "chevron-right", "data-kit-slot": "collapsible-chevron" }),
1528
+ children
1529
+ ] });
1530
+ }
1531
+ function CollapsiblePanel(props) {
1532
+ return /* @__PURE__ */ jsx37(BaseCollapsible.Panel, { "data-kit-slot": "collapsible-panel", ...props });
1533
+ }
1534
+
1535
+ // src/components/tabs.tsx
1536
+ import { Tabs as BaseTabs } from "@base-ui/react/tabs";
1537
+ import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
1538
+ function Tabs({ variant = "line", ...props }) {
1539
+ return /* @__PURE__ */ jsx38(BaseTabs.Root, { "data-kit": "tabs", "data-variant": variant, ...props });
1540
+ }
1541
+ function TabList({ children, ...props }) {
1542
+ return /* @__PURE__ */ jsxs25(BaseTabs.List, { "data-kit-slot": "tab-list", ...props, children: [
1543
+ children,
1544
+ /* @__PURE__ */ jsx38(BaseTabs.Indicator, { "data-kit-slot": "tab-indicator" })
1545
+ ] });
1546
+ }
1547
+ function Tab(props) {
1548
+ return /* @__PURE__ */ jsx38(BaseTabs.Tab, { "data-kit-slot": "tab", ...props });
1549
+ }
1550
+ function TabPanel(props) {
1551
+ return /* @__PURE__ */ jsx38(BaseTabs.Panel, { "data-kit-slot": "tab-panel", ...props });
1552
+ }
1553
+
1554
+ // src/components/breadcrumb.tsx
1555
+ import { Icon as Icon12 } from "@x12i/icons";
1556
+ import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
1557
+ function Breadcrumb({ label, items, renderLink, ...props }) {
1558
+ return /* @__PURE__ */ jsx39("nav", { "data-kit": "breadcrumb", "aria-label": label, ...props, children: /* @__PURE__ */ jsx39("ol", { "data-kit-slot": "breadcrumb-list", children: items.map((item, index) => {
1559
+ const isLast = index === items.length - 1;
1560
+ return /* @__PURE__ */ jsxs26("li", { "data-kit-slot": "breadcrumb-item", children: [
1561
+ item.href && !isLast ? renderLink?.({ href: item.href, label: item.label }) ?? /* @__PURE__ */ jsx39(Link, { href: item.href, tone: "neutral", underline: "hover", children: item.label }) : /* @__PURE__ */ jsx39("span", { "data-kit-slot": "breadcrumb-page", "aria-current": isLast ? "page" : void 0, children: item.label }),
1562
+ isLast ? null : /* @__PURE__ */ jsx39("span", { "data-kit-slot": "breadcrumb-separator", "aria-hidden": "true", children: /* @__PURE__ */ jsx39(Icon12, { name: "chevron-right", size: 12 }) })
1563
+ ] }, index);
1564
+ }) }) });
1565
+ }
1566
+
1567
+ // src/components/pagination.tsx
1568
+ import { Icon as Icon13 } from "@x12i/icons";
1569
+ import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
1570
+ function getPaginationRange(page, pageCount, siblingCount = 1) {
1571
+ const range = (from, to) => Array.from({ length: Math.max(0, to - from + 1) }, (_, index) => from + index);
1572
+ const slots = siblingCount * 2 + 5;
1573
+ if (pageCount <= slots) return range(1, pageCount);
1574
+ const current = Math.min(Math.max(page, 1), pageCount);
1575
+ const left = Math.max(current - siblingCount, 1);
1576
+ const right = Math.min(current + siblingCount, pageCount);
1577
+ const showLeftEllipsis = left > 2;
1578
+ const showRightEllipsis = right < pageCount - 1;
1579
+ const edgeCount = 3 + siblingCount * 2;
1580
+ if (!showLeftEllipsis && showRightEllipsis) {
1581
+ return [...range(1, edgeCount), "ellipsis-end", pageCount];
1582
+ }
1583
+ if (showLeftEllipsis && !showRightEllipsis) {
1584
+ return [1, "ellipsis-start", ...range(pageCount - edgeCount + 1, pageCount)];
1585
+ }
1586
+ return [1, "ellipsis-start", ...range(left, right), "ellipsis-end", pageCount];
1587
+ }
1588
+ function Pagination({
1589
+ page,
1590
+ pageCount,
1591
+ onPageChange,
1592
+ siblingCount = 1,
1593
+ label,
1594
+ previousLabel,
1595
+ nextLabel,
1596
+ getPageLabel,
1597
+ ...props
1598
+ }) {
1599
+ const items = getPaginationRange(page, pageCount, siblingCount);
1600
+ return /* @__PURE__ */ jsx40("nav", { "data-kit": "pagination", "aria-label": label, ...props, children: /* @__PURE__ */ jsxs27("ul", { "data-kit-slot": "pagination-list", children: [
1601
+ /* @__PURE__ */ jsx40("li", { children: /* @__PURE__ */ jsx40(
1602
+ "button",
1603
+ {
1604
+ type: "button",
1605
+ "data-kit-slot": "pagination-step",
1606
+ "data-direction": "previous",
1607
+ "aria-label": previousLabel,
1608
+ disabled: page <= 1,
1609
+ onClick: () => onPageChange(page - 1),
1610
+ children: /* @__PURE__ */ jsx40(Icon13, { name: "chevron-left" })
1611
+ }
1612
+ ) }),
1613
+ items.map(
1614
+ (item) => typeof item === "number" ? /* @__PURE__ */ jsx40("li", { children: /* @__PURE__ */ jsx40(
1615
+ "button",
1616
+ {
1617
+ type: "button",
1618
+ "data-kit-slot": "pagination-page",
1619
+ "data-current": item === page ? "" : void 0,
1620
+ "aria-label": getPageLabel(item),
1621
+ "aria-current": item === page ? "page" : void 0,
1622
+ onClick: () => onPageChange(item),
1623
+ children: item
1624
+ }
1625
+ ) }, item) : /* @__PURE__ */ jsx40("li", { "data-kit-slot": "pagination-ellipsis", "aria-hidden": "true", children: "\u2026" }, item)
1626
+ ),
1627
+ /* @__PURE__ */ jsx40("li", { children: /* @__PURE__ */ jsx40(
1628
+ "button",
1629
+ {
1630
+ type: "button",
1631
+ "data-kit-slot": "pagination-step",
1632
+ "data-direction": "next",
1633
+ "aria-label": nextLabel,
1634
+ disabled: page >= pageCount,
1635
+ onClick: () => onPageChange(page + 1),
1636
+ children: /* @__PURE__ */ jsx40(Icon13, { name: "chevron-right" })
1637
+ }
1638
+ ) })
1639
+ ] }) });
1640
+ }
1641
+
1642
+ // src/components/accordion.tsx
1643
+ import { Accordion as BaseAccordion } from "@base-ui/react/accordion";
1644
+ import { Icon as Icon14 } from "@x12i/icons";
1645
+ import { createElement } from "react";
1646
+ import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
1647
+ function Accordion(props) {
1648
+ return /* @__PURE__ */ jsx41(BaseAccordion.Root, { "data-kit": "accordion", ...props });
1649
+ }
1650
+ function AccordionItem({ title, children, headingLevel = 3, ...props }) {
1651
+ return /* @__PURE__ */ jsxs28(BaseAccordion.Item, { "data-kit-slot": "accordion-item", ...props, children: [
1652
+ /* @__PURE__ */ jsx41(BaseAccordion.Header, { "data-kit-slot": "accordion-header", render: createElement(`h${headingLevel}`), children: /* @__PURE__ */ jsxs28(BaseAccordion.Trigger, { "data-kit-slot": "accordion-trigger", children: [
1653
+ /* @__PURE__ */ jsx41("span", { "data-kit-slot": "accordion-title", children: title }),
1654
+ /* @__PURE__ */ jsx41(Icon14, { name: "chevron-down", "data-kit-slot": "accordion-chevron" })
1655
+ ] }) }),
1656
+ /* @__PURE__ */ jsx41(BaseAccordion.Panel, { "data-kit-slot": "accordion-panel", children: /* @__PURE__ */ jsx41("div", { "data-kit-slot": "accordion-content", children }) })
1657
+ ] });
1658
+ }
1659
+
1660
+ // src/components/segmented-control.tsx
1661
+ import { Radio as BaseRadio2 } from "@base-ui/react/radio";
1662
+ import { RadioGroup as BaseRadioGroup2 } from "@base-ui/react/radio-group";
1663
+ import { jsx as jsx42 } from "react/jsx-runtime";
1664
+ function SegmentedControl({
1665
+ options,
1666
+ size = "md",
1667
+ fullWidth = false,
1668
+ ...props
1669
+ }) {
1670
+ return /* @__PURE__ */ jsx42(
1671
+ BaseRadioGroup2,
1672
+ {
1673
+ "data-kit": "segmented-control",
1674
+ "data-size": size,
1675
+ "data-full-width": fullWidth ? "" : void 0,
1676
+ ...props,
1677
+ children: options.map((option) => /* @__PURE__ */ jsx42(
1678
+ BaseRadio2.Root,
1679
+ {
1680
+ value: option.value,
1681
+ disabled: option.disabled,
1682
+ "data-kit-slot": "segment",
1683
+ children: option.label
1684
+ },
1685
+ option.value
1686
+ ))
1687
+ }
1688
+ );
1689
+ }
1690
+
1691
+ // src/components/stepper.tsx
1692
+ import { Icon as Icon15 } from "@x12i/icons";
1693
+ import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
1694
+ function Stepper({
1695
+ steps,
1696
+ current,
1697
+ orientation = "horizontal",
1698
+ getStatusLabel,
1699
+ ...props
1700
+ }) {
1701
+ return /* @__PURE__ */ jsx43("ol", { "data-kit": "stepper", "data-orientation": orientation, ...props, children: steps.map((step, index) => {
1702
+ const status = index < current ? "complete" : index === current ? "current" : "upcoming";
1703
+ return /* @__PURE__ */ jsxs29(
1704
+ "li",
1705
+ {
1706
+ "data-kit-slot": "step",
1707
+ "data-status": status,
1708
+ "aria-current": status === "current" ? "step" : void 0,
1709
+ children: [
1710
+ /* @__PURE__ */ jsx43("span", { "data-kit-slot": "step-marker", "aria-hidden": "true", children: status === "complete" ? /* @__PURE__ */ jsx43(Icon15, { name: "check", size: 16 }) : index + 1 }),
1711
+ /* @__PURE__ */ jsxs29("span", { "data-kit-slot": "step-text", children: [
1712
+ /* @__PURE__ */ jsxs29("span", { "data-kit-slot": "step-label", children: [
1713
+ step.label,
1714
+ /* @__PURE__ */ jsx43(VisuallyHidden, { children: `. ${getStatusLabel(status)}` })
1715
+ ] }),
1716
+ step.description ? /* @__PURE__ */ jsx43("span", { "data-kit-slot": "step-description", children: step.description }) : null
1717
+ ] })
1718
+ ]
1719
+ },
1720
+ step.id
1721
+ );
1722
+ }) });
1723
+ }
1724
+
1725
+ // src/components/toolbar.tsx
1726
+ import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
1727
+ import { jsx as jsx44 } from "react/jsx-runtime";
1728
+ function Toolbar(props) {
1729
+ return /* @__PURE__ */ jsx44(BaseToolbar.Root, { "data-kit": "toolbar", ...props });
1730
+ }
1731
+ function ToolbarGroup(props) {
1732
+ return /* @__PURE__ */ jsx44(BaseToolbar.Group, { "data-kit-slot": "toolbar-group", ...props });
1733
+ }
1734
+ function ToolbarButton({
1735
+ variant = "ghost",
1736
+ tone = "neutral",
1737
+ size = "sm",
1738
+ ...props
1739
+ }) {
1740
+ return /* @__PURE__ */ jsx44(BaseToolbar.Button, { render: /* @__PURE__ */ jsx44(Button, { variant, tone, size }), ...props });
1741
+ }
1742
+ function ToolbarSeparator(props) {
1743
+ return /* @__PURE__ */ jsx44(BaseToolbar.Separator, { "data-kit-slot": "toolbar-separator", ...props });
1744
+ }
1745
+
1746
+ // src/components/dialog.tsx
1747
+ import { AlertDialog as BaseAlertDialog } from "@base-ui/react/alert-dialog";
1748
+ import { Dialog as BaseDialog } from "@base-ui/react/dialog";
1749
+ import { Icon as Icon16 } from "@x12i/icons";
1750
+ import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
1751
+ var Dialog = BaseDialog.Root;
1752
+ function DialogTrigger(props) {
1753
+ return /* @__PURE__ */ jsx45(BaseDialog.Trigger, { ...props });
1754
+ }
1755
+ function DialogContent({ size = "md", closeLabel, children, ...props }) {
1756
+ return /* @__PURE__ */ jsxs30(BaseDialog.Portal, { children: [
1757
+ /* @__PURE__ */ jsx45(BaseDialog.Backdrop, { "data-kit": "dialog-backdrop" }),
1758
+ /* @__PURE__ */ jsx45(BaseDialog.Viewport, { "data-kit": "dialog-viewport", children: /* @__PURE__ */ jsxs30(BaseDialog.Popup, { "data-kit": "dialog", "data-size": size, ...props, children: [
1759
+ children,
1760
+ closeLabel ? /* @__PURE__ */ jsx45(
1761
+ BaseDialog.Close,
1762
+ {
1763
+ "data-kit-slot": "dialog-close",
1764
+ render: /* @__PURE__ */ jsx45(IconButton, { label: closeLabel, variant: "ghost", tone: "neutral", size: "sm", children: /* @__PURE__ */ jsx45(Icon16, { name: "close" }) })
1765
+ }
1766
+ ) : null
1767
+ ] }) })
1768
+ ] });
1769
+ }
1770
+ function DialogTitle(props) {
1771
+ return /* @__PURE__ */ jsx45(BaseDialog.Title, { "data-kit-slot": "dialog-title", ...props });
1772
+ }
1773
+ function DialogDescription(props) {
1774
+ return /* @__PURE__ */ jsx45(BaseDialog.Description, { "data-kit-slot": "dialog-description", ...props });
1775
+ }
1776
+ function DialogHeader(props) {
1777
+ return /* @__PURE__ */ jsx45("div", { "data-kit-slot": "dialog-header", ...props });
1778
+ }
1779
+ function DialogBody(props) {
1780
+ return /* @__PURE__ */ jsx45("div", { "data-kit-slot": "dialog-body", ...props });
1781
+ }
1782
+ function DialogFooter(props) {
1783
+ return /* @__PURE__ */ jsx45("div", { "data-kit-slot": "dialog-footer", ...props });
1784
+ }
1785
+ function DialogClose(props) {
1786
+ return /* @__PURE__ */ jsx45(BaseDialog.Close, { ...props });
1787
+ }
1788
+ var AlertDialog = BaseAlertDialog.Root;
1789
+ function AlertDialogTrigger(props) {
1790
+ return /* @__PURE__ */ jsx45(BaseAlertDialog.Trigger, { ...props });
1791
+ }
1792
+ function AlertDialogContent({ size = "sm", ...props }) {
1793
+ return /* @__PURE__ */ jsxs30(BaseAlertDialog.Portal, { children: [
1794
+ /* @__PURE__ */ jsx45(BaseAlertDialog.Backdrop, { "data-kit": "dialog-backdrop" }),
1795
+ /* @__PURE__ */ jsx45(BaseAlertDialog.Viewport, { "data-kit": "dialog-viewport", children: /* @__PURE__ */ jsx45(BaseAlertDialog.Popup, { "data-kit": "dialog", "data-kind": "alert", "data-size": size, ...props }) })
1796
+ ] });
1797
+ }
1798
+ function AlertDialogTitle(props) {
1799
+ return /* @__PURE__ */ jsx45(BaseAlertDialog.Title, { "data-kit-slot": "dialog-title", ...props });
1800
+ }
1801
+ function AlertDialogDescription(props) {
1802
+ return /* @__PURE__ */ jsx45(BaseAlertDialog.Description, { "data-kit-slot": "dialog-description", ...props });
1803
+ }
1804
+ function AlertDialogFooter(props) {
1805
+ return /* @__PURE__ */ jsx45("div", { "data-kit-slot": "dialog-footer", ...props });
1806
+ }
1807
+ function AlertDialogClose(props) {
1808
+ return /* @__PURE__ */ jsx45(BaseAlertDialog.Close, { ...props });
1809
+ }
1810
+
1811
+ // src/components/drawer.tsx
1812
+ import { Drawer as BaseDrawer } from "@base-ui/react/drawer";
1813
+ import { Icon as Icon17 } from "@x12i/icons";
1814
+ import { jsx as jsx46, jsxs as jsxs31 } from "react/jsx-runtime";
1815
+ function isRtl() {
1816
+ return typeof document !== "undefined" && getComputedStyle(document.documentElement).direction === "rtl";
1817
+ }
1818
+ function swipeDirection(side) {
1819
+ if (side === "top") return "up";
1820
+ if (side === "bottom") return "down";
1821
+ const rtl = isRtl();
1822
+ return side === "start" !== rtl ? "left" : "right";
1823
+ }
1824
+ function Drawer({ side = "end", ...props }) {
1825
+ return /* @__PURE__ */ jsx46(BaseDrawer.Root, { swipeDirection: swipeDirection(side), ...props });
1826
+ }
1827
+ function DrawerTrigger(props) {
1828
+ return /* @__PURE__ */ jsx46(BaseDrawer.Trigger, { ...props });
1829
+ }
1830
+ function DrawerContent({ side = "end", closeLabel, children, ...props }) {
1831
+ return /* @__PURE__ */ jsxs31(BaseDrawer.Portal, { children: [
1832
+ /* @__PURE__ */ jsx46(BaseDrawer.Backdrop, { "data-kit": "drawer-backdrop" }),
1833
+ /* @__PURE__ */ jsx46(BaseDrawer.Viewport, { "data-kit": "drawer-viewport", children: /* @__PURE__ */ jsxs31(BaseDrawer.Popup, { "data-kit": "drawer", "data-side": side, ...props, children: [
1834
+ children,
1835
+ closeLabel ? /* @__PURE__ */ jsx46(
1836
+ BaseDrawer.Close,
1837
+ {
1838
+ "data-kit-slot": "drawer-close",
1839
+ render: /* @__PURE__ */ jsx46(IconButton, { label: closeLabel, variant: "ghost", tone: "neutral", size: "sm", children: /* @__PURE__ */ jsx46(Icon17, { name: "close" }) })
1840
+ }
1841
+ ) : null
1842
+ ] }) })
1843
+ ] });
1844
+ }
1845
+ function DrawerTitle(props) {
1846
+ return /* @__PURE__ */ jsx46(BaseDrawer.Title, { "data-kit-slot": "drawer-title", ...props });
1847
+ }
1848
+ function DrawerDescription(props) {
1849
+ return /* @__PURE__ */ jsx46(BaseDrawer.Description, { "data-kit-slot": "drawer-description", ...props });
1850
+ }
1851
+ function DrawerHeader(props) {
1852
+ return /* @__PURE__ */ jsx46("div", { "data-kit-slot": "drawer-header", ...props });
1853
+ }
1854
+ function DrawerBody(props) {
1855
+ return /* @__PURE__ */ jsx46("div", { "data-kit-slot": "drawer-body", ...props });
1856
+ }
1857
+ function DrawerFooter(props) {
1858
+ return /* @__PURE__ */ jsx46("div", { "data-kit-slot": "drawer-footer", ...props });
1859
+ }
1860
+ function DrawerClose(props) {
1861
+ return /* @__PURE__ */ jsx46(BaseDrawer.Close, { ...props });
1862
+ }
1863
+
1864
+ // src/components/popover.tsx
1865
+ import { Popover as BasePopover } from "@base-ui/react/popover";
1866
+ import { jsx as jsx47, jsxs as jsxs32 } from "react/jsx-runtime";
1867
+ var Popover = BasePopover.Root;
1868
+ function PopoverTrigger(props) {
1869
+ return /* @__PURE__ */ jsx47(BasePopover.Trigger, { ...props });
1870
+ }
1871
+ function PopoverContent({
1872
+ side = "bottom",
1873
+ align = "center",
1874
+ sideOffset = 8,
1875
+ alignOffset,
1876
+ collisionPadding = 8,
1877
+ anchor,
1878
+ arrow = false,
1879
+ children,
1880
+ ...props
1881
+ }) {
1882
+ return /* @__PURE__ */ jsx47(BasePopover.Portal, { children: /* @__PURE__ */ jsx47(
1883
+ BasePopover.Positioner,
1884
+ {
1885
+ "data-kit": "popover-positioner",
1886
+ side,
1887
+ align,
1888
+ sideOffset,
1889
+ alignOffset,
1890
+ collisionPadding,
1891
+ anchor,
1892
+ children: /* @__PURE__ */ jsxs32(BasePopover.Popup, { "data-kit": "popover", ...props, children: [
1893
+ arrow ? /* @__PURE__ */ jsx47(BasePopover.Arrow, { "data-kit-slot": "popup-arrow" }) : null,
1894
+ children
1895
+ ] })
1896
+ }
1897
+ ) });
1898
+ }
1899
+ function PopoverTitle(props) {
1900
+ return /* @__PURE__ */ jsx47(BasePopover.Title, { "data-kit-slot": "popover-title", ...props });
1901
+ }
1902
+ function PopoverDescription(props) {
1903
+ return /* @__PURE__ */ jsx47(BasePopover.Description, { "data-kit-slot": "popover-description", ...props });
1904
+ }
1905
+ function PopoverClose(props) {
1906
+ return /* @__PURE__ */ jsx47(BasePopover.Close, { ...props });
1907
+ }
1908
+
1909
+ // src/components/tooltip.tsx
1910
+ import { Tooltip as BaseTooltip } from "@base-ui/react/tooltip";
1911
+ import { useId as useId4, useState as useState4 } from "react";
1912
+ import { jsx as jsx48, jsxs as jsxs33 } from "react/jsx-runtime";
1913
+ var TooltipProvider = BaseTooltip.Provider;
1914
+ function Tooltip({
1915
+ content,
1916
+ children,
1917
+ side = "top",
1918
+ align = "center",
1919
+ sideOffset = 6,
1920
+ alignOffset,
1921
+ collisionPadding = 8,
1922
+ delay = 600,
1923
+ closeDelay,
1924
+ disabled,
1925
+ open,
1926
+ defaultOpen = false,
1927
+ onOpenChange
1928
+ }) {
1929
+ const id = useId4();
1930
+ const [internalOpen, setInternalOpen] = useState4(defaultOpen);
1931
+ const isOpen = open ?? internalOpen;
1932
+ const own = children.props["aria-describedby"];
1933
+ const describedBy = isOpen ? [own, id].filter(Boolean).join(" ") : own;
1934
+ return /* @__PURE__ */ jsxs33(
1935
+ BaseTooltip.Root,
1936
+ {
1937
+ open: isOpen,
1938
+ onOpenChange: (next) => {
1939
+ setInternalOpen(next);
1940
+ onOpenChange?.(next);
1941
+ },
1942
+ disabled,
1943
+ children: [
1944
+ /* @__PURE__ */ jsx48(
1945
+ BaseTooltip.Trigger,
1946
+ {
1947
+ render: children,
1948
+ delay,
1949
+ closeDelay,
1950
+ "aria-describedby": describedBy
1951
+ }
1952
+ ),
1953
+ /* @__PURE__ */ jsx48(BaseTooltip.Portal, { children: /* @__PURE__ */ jsx48(
1954
+ BaseTooltip.Positioner,
1955
+ {
1956
+ "data-kit": "tooltip-positioner",
1957
+ side,
1958
+ align,
1959
+ sideOffset,
1960
+ alignOffset,
1961
+ collisionPadding,
1962
+ children: /* @__PURE__ */ jsx48(BaseTooltip.Popup, { "data-kit": "tooltip", id, role: "tooltip", children: content })
1963
+ }
1964
+ ) })
1965
+ ]
1966
+ }
1967
+ );
1968
+ }
1969
+
1970
+ // src/components/menu.tsx
1971
+ import { ContextMenu as BaseContextMenu } from "@base-ui/react/context-menu";
1972
+ import { Menu as BaseMenu } from "@base-ui/react/menu";
1973
+ import { Icon as Icon18 } from "@x12i/icons";
1974
+ import { jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
1975
+ var Menu = BaseMenu.Root;
1976
+ function MenuTrigger(props) {
1977
+ return /* @__PURE__ */ jsx49(BaseMenu.Trigger, { ...props });
1978
+ }
1979
+ function MenuContent({
1980
+ side = "bottom",
1981
+ align = "start",
1982
+ sideOffset = 4,
1983
+ alignOffset,
1984
+ collisionPadding = 8,
1985
+ anchor,
1986
+ ...props
1987
+ }) {
1988
+ return /* @__PURE__ */ jsx49(BaseMenu.Portal, { children: /* @__PURE__ */ jsx49(
1989
+ BaseMenu.Positioner,
1990
+ {
1991
+ "data-kit": "menu-positioner",
1992
+ side,
1993
+ align,
1994
+ sideOffset,
1995
+ alignOffset,
1996
+ collisionPadding,
1997
+ anchor,
1998
+ children: /* @__PURE__ */ jsx49(BaseMenu.Popup, { "data-kit": "menu", ...props })
1999
+ }
2000
+ ) });
2001
+ }
2002
+ function MenuItem({ icon, shortcut, tone = "default", children, ...props }) {
2003
+ return /* @__PURE__ */ jsxs34(BaseMenu.Item, { "data-kit": "menu-item", "data-tone": tone, ...props, children: [
2004
+ icon ? /* @__PURE__ */ jsx49("span", { "data-kit-slot": "menu-item-icon", "aria-hidden": "true", children: icon }) : null,
2005
+ /* @__PURE__ */ jsx49("span", { "data-kit-slot": "menu-item-text", children }),
2006
+ shortcut ? /* @__PURE__ */ jsx49("span", { "data-kit-slot": "menu-item-shortcut", "aria-hidden": "true", children: shortcut }) : null
2007
+ ] });
2008
+ }
2009
+ function MenuCheckboxItem({ children, ...props }) {
2010
+ return /* @__PURE__ */ jsxs34(BaseMenu.CheckboxItem, { "data-kit": "menu-item", "data-choice": "checkbox", ...props, children: [
2011
+ /* @__PURE__ */ jsx49("span", { "data-kit-slot": "menu-item-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx49(BaseMenu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx49(Icon18, { name: "check" }) }) }),
2012
+ /* @__PURE__ */ jsx49("span", { "data-kit-slot": "menu-item-text", children })
2013
+ ] });
2014
+ }
2015
+ function MenuRadioGroup(props) {
2016
+ return /* @__PURE__ */ jsx49(BaseMenu.RadioGroup, { ...props });
2017
+ }
2018
+ function MenuRadioItem({ children, ...props }) {
2019
+ return /* @__PURE__ */ jsxs34(BaseMenu.RadioItem, { "data-kit": "menu-item", "data-choice": "radio", ...props, children: [
2020
+ /* @__PURE__ */ jsx49("span", { "data-kit-slot": "menu-item-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx49(BaseMenu.RadioItemIndicator, { "data-kit-slot": "menu-radio-dot" }) }),
2021
+ /* @__PURE__ */ jsx49("span", { "data-kit-slot": "menu-item-text", children })
2022
+ ] });
2023
+ }
2024
+ function MenuGroup(props) {
2025
+ return /* @__PURE__ */ jsx49(BaseMenu.Group, { "data-kit-slot": "menu-group", ...props });
2026
+ }
2027
+ function MenuLabel(props) {
2028
+ return /* @__PURE__ */ jsx49(BaseMenu.GroupLabel, { "data-kit-slot": "menu-label", ...props });
2029
+ }
2030
+ function MenuSeparator(props) {
2031
+ return /* @__PURE__ */ jsx49(BaseMenu.Separator, { "data-kit-slot": "menu-separator", ...props });
2032
+ }
2033
+ var SubMenu = BaseMenu.SubmenuRoot;
2034
+ function SubMenuTrigger({ icon, children, ...props }) {
2035
+ return /* @__PURE__ */ jsxs34(BaseMenu.SubmenuTrigger, { "data-kit": "menu-item", "data-submenu": "", ...props, children: [
2036
+ icon ? /* @__PURE__ */ jsx49("span", { "data-kit-slot": "menu-item-icon", "aria-hidden": "true", children: icon }) : null,
2037
+ /* @__PURE__ */ jsx49("span", { "data-kit-slot": "menu-item-text", children }),
2038
+ /* @__PURE__ */ jsx49("span", { "data-kit-slot": "menu-item-chevron", "aria-hidden": "true", children: /* @__PURE__ */ jsx49(Icon18, { name: "chevron-right" }) })
2039
+ ] });
2040
+ }
2041
+ function SubMenuContent({
2042
+ side = "inline-end",
2043
+ align = "start",
2044
+ sideOffset = 2,
2045
+ alignOffset,
2046
+ collisionPadding = 8,
2047
+ ...props
2048
+ }) {
2049
+ return /* @__PURE__ */ jsx49(BaseMenu.Portal, { children: /* @__PURE__ */ jsx49(
2050
+ BaseMenu.Positioner,
2051
+ {
2052
+ "data-kit": "menu-positioner",
2053
+ side,
2054
+ align,
2055
+ sideOffset,
2056
+ alignOffset,
2057
+ collisionPadding,
2058
+ children: /* @__PURE__ */ jsx49(BaseMenu.Popup, { "data-kit": "menu", ...props })
2059
+ }
2060
+ ) });
2061
+ }
2062
+ var ContextMenu = BaseContextMenu.Root;
2063
+ function ContextMenuTrigger(props) {
2064
+ return /* @__PURE__ */ jsx49(BaseContextMenu.Trigger, { "data-kit-slot": "context-trigger", ...props });
2065
+ }
2066
+ function ContextMenuContent({
2067
+ side,
2068
+ align,
2069
+ sideOffset,
2070
+ alignOffset,
2071
+ collisionPadding = 8,
2072
+ ...props
2073
+ }) {
2074
+ return /* @__PURE__ */ jsx49(BaseContextMenu.Portal, { children: /* @__PURE__ */ jsx49(
2075
+ BaseContextMenu.Positioner,
2076
+ {
2077
+ "data-kit": "menu-positioner",
2078
+ side,
2079
+ align,
2080
+ sideOffset,
2081
+ alignOffset,
2082
+ collisionPadding,
2083
+ children: /* @__PURE__ */ jsx49(BaseContextMenu.Popup, { "data-kit": "menu", ...props })
2084
+ }
2085
+ ) });
2086
+ }
2087
+
2088
+ // src/components/toast.tsx
2089
+ import { Toast as BaseToast } from "@base-ui/react/toast";
2090
+ import { Icon as Icon19 } from "@x12i/icons";
2091
+ import { Fragment as Fragment8, jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
2092
+ var tones = /* @__PURE__ */ new Set([
2093
+ "neutral",
2094
+ "accent",
2095
+ "success",
2096
+ "warning",
2097
+ "danger",
2098
+ "info"
2099
+ ]);
2100
+ function toneOf(type) {
2101
+ if (type === "error") return "danger";
2102
+ return type && tones.has(type) ? type : "neutral";
2103
+ }
2104
+ function ToastList({ closeLabel }) {
2105
+ const { toasts } = BaseToast.useToastManager();
2106
+ return /* @__PURE__ */ jsx50(Fragment8, { children: toasts.map((toast) => {
2107
+ const loading = toast.type === "loading";
2108
+ const tone = toneOf(toast.type);
2109
+ return /* @__PURE__ */ jsxs35(
2110
+ BaseToast.Root,
2111
+ {
2112
+ toast,
2113
+ "data-kit": "toast",
2114
+ "data-tone": tone,
2115
+ "data-loading": loading ? "" : void 0,
2116
+ children: [
2117
+ /* @__PURE__ */ jsx50("span", { "data-kit-slot": "toast-icon", "aria-hidden": "true", children: loading ? /* @__PURE__ */ jsx50(Spinner, { size: "sm" }) : /* @__PURE__ */ jsx50(Icon19, { name: toneIcons[tone], size: 20 }) }),
2118
+ /* @__PURE__ */ jsxs35(BaseToast.Content, { "data-kit-slot": "toast-content", children: [
2119
+ toast.title ? /* @__PURE__ */ jsx50(BaseToast.Title, { "data-kit-slot": "toast-title" }) : null,
2120
+ toast.description ? /* @__PURE__ */ jsx50(BaseToast.Description, { "data-kit-slot": "toast-description" }) : null,
2121
+ toast.actionProps ? /* @__PURE__ */ jsx50(BaseToast.Action, { "data-kit-slot": "toast-action" }) : null
2122
+ ] }),
2123
+ /* @__PURE__ */ jsx50(
2124
+ BaseToast.Close,
2125
+ {
2126
+ "data-kit-slot": "toast-close",
2127
+ "aria-hidden": false,
2128
+ render: /* @__PURE__ */ jsx50(IconButton, { label: closeLabel, variant: "ghost", tone: "neutral", size: "sm", children: /* @__PURE__ */ jsx50(Icon19, { name: "close" }) })
2129
+ }
2130
+ )
2131
+ ]
2132
+ },
2133
+ toast.id
2134
+ );
2135
+ }) });
2136
+ }
2137
+ function ToastProvider({
2138
+ children,
2139
+ closeLabel,
2140
+ regionLabel,
2141
+ timeout = 5e3,
2142
+ limit = 3,
2143
+ placement = "bottom-end"
2144
+ }) {
2145
+ return /* @__PURE__ */ jsxs35(BaseToast.Provider, { timeout, limit, children: [
2146
+ children,
2147
+ /* @__PURE__ */ jsx50(BaseToast.Portal, { children: /* @__PURE__ */ jsx50(
2148
+ BaseToast.Viewport,
2149
+ {
2150
+ "data-kit": "toast-viewport",
2151
+ "data-placement": placement,
2152
+ "aria-label": regionLabel,
2153
+ children: /* @__PURE__ */ jsx50(ToastList, { closeLabel })
2154
+ }
2155
+ ) })
2156
+ ] });
2157
+ }
2158
+ function toManagerOptions(options) {
2159
+ const { tone, action, ...rest } = options;
2160
+ return {
2161
+ ...rest,
2162
+ ...tone ? { type: tone } : {},
2163
+ ...action ? { actionProps: { children: action.label, onClick: action.onClick } } : {}
2164
+ };
2165
+ }
2166
+ function useToast() {
2167
+ const manager = BaseToast.useToastManager();
2168
+ return {
2169
+ show: (options) => manager.add(toManagerOptions(options)),
2170
+ update: (id, options) => manager.update(id, toManagerOptions(options)),
2171
+ close: (id) => manager.close(id),
2172
+ promise: (promise, messages) => manager.promise(promise, {
2173
+ loading: toManagerOptions(messages.loading),
2174
+ success: (value) => toManagerOptions(typeof messages.success === "function" ? messages.success(value) : messages.success),
2175
+ error: (error) => toManagerOptions(typeof messages.error === "function" ? messages.error(error) : messages.error)
2176
+ })
2177
+ };
2178
+ }
2179
+
2180
+ // src/components/split-button.tsx
2181
+ import { Icon as Icon20 } from "@x12i/icons";
2182
+ import { jsx as jsx51, jsxs as jsxs36 } from "react/jsx-runtime";
2183
+ function SplitButton({
2184
+ children,
2185
+ menuLabel,
2186
+ menu,
2187
+ variant = "solid",
2188
+ tone = "accent",
2189
+ size = "md",
2190
+ disabled,
2191
+ loading,
2192
+ loadingLabel,
2193
+ onClick,
2194
+ type
2195
+ }) {
2196
+ return /* @__PURE__ */ jsxs36(ButtonGroup, { "data-kit-split": "", children: [
2197
+ /* @__PURE__ */ jsx51(
2198
+ Button,
2199
+ {
2200
+ variant,
2201
+ tone,
2202
+ size,
2203
+ disabled,
2204
+ loading,
2205
+ loadingLabel,
2206
+ onClick,
2207
+ type,
2208
+ children
2209
+ }
2210
+ ),
2211
+ /* @__PURE__ */ jsxs36(Menu, { children: [
2212
+ /* @__PURE__ */ jsx51(
2213
+ MenuTrigger,
2214
+ {
2215
+ disabled: disabled || loading,
2216
+ render: /* @__PURE__ */ jsx51(IconButton, { label: menuLabel, variant, tone, size, children: /* @__PURE__ */ jsx51(Icon20, { name: "chevron-down" }) })
2217
+ }
2218
+ ),
2219
+ /* @__PURE__ */ jsx51(MenuContent, { align: "end", children: menu })
2220
+ ] })
2221
+ ] });
2222
+ }
2223
+
2224
+ // src/providers/density-provider.tsx
2225
+ import {
2226
+ DENSITY_ATTRIBUTE,
2227
+ DENSITY_STORAGE_KEY,
2228
+ densityNames
2229
+ } from "@x12i/tokens";
2230
+ import {
2231
+ createContext,
2232
+ useContext,
2233
+ useEffect as useEffect4,
2234
+ useMemo as useMemo2
2235
+ } from "react";
2236
+
2237
+ // src/utils/use-persisted-choice.ts
2238
+ import { useCallback as useCallback2, useEffect as useEffect3, useState as useState5 } from "react";
2239
+ function read(key) {
2240
+ try {
2241
+ return window.localStorage.getItem(key);
2242
+ } catch {
2243
+ return null;
2244
+ }
2245
+ }
2246
+ function write(key, value) {
2247
+ try {
2248
+ window.localStorage.setItem(key, value);
2249
+ } catch {
2250
+ }
2251
+ }
2252
+ function usePersistedChoice({
2253
+ value: controlled,
2254
+ defaultValue,
2255
+ onChange,
2256
+ storageKey,
2257
+ isValid
2258
+ }) {
2259
+ const isControlled = controlled !== void 0;
2260
+ const [internal, setInternal] = useState5(defaultValue);
2261
+ useEffect3(() => {
2262
+ if (isControlled || storageKey === null) return;
2263
+ const stored = read(storageKey);
2264
+ if (stored !== null && isValid(stored)) setInternal(stored);
2265
+ }, [isControlled, storageKey, isValid]);
2266
+ const setValue = useCallback2(
2267
+ (next) => {
2268
+ if (!isControlled) setInternal(next);
2269
+ if (storageKey !== null) write(storageKey, next);
2270
+ onChange?.(next);
2271
+ },
2272
+ [isControlled, storageKey, onChange]
2273
+ );
2274
+ return [isControlled ? controlled : internal, setValue];
2275
+ }
2276
+
2277
+ // src/providers/density-provider.tsx
2278
+ import { jsx as jsx52 } from "react/jsx-runtime";
2279
+ var DensityContext = createContext(null);
2280
+ function isDensity(value) {
2281
+ return densityNames.includes(value);
2282
+ }
2283
+ function DensityProvider({
2284
+ children,
2285
+ density: densityProp,
2286
+ defaultDensity = "default",
2287
+ onDensityChange,
2288
+ scope = "subtree",
2289
+ storageKey,
2290
+ className,
2291
+ ...props
2292
+ }) {
2293
+ const [density, setDensity] = usePersistedChoice({
2294
+ value: densityProp,
2295
+ defaultValue: defaultDensity,
2296
+ onChange: onDensityChange,
2297
+ storageKey: storageKey === void 0 ? scope === "root" ? DENSITY_STORAGE_KEY : null : storageKey,
2298
+ isValid: isDensity
2299
+ });
2300
+ useEffect4(() => {
2301
+ if (scope !== "root") return;
2302
+ const root = document.documentElement;
2303
+ const previous = root.getAttribute(DENSITY_ATTRIBUTE);
2304
+ root.setAttribute(DENSITY_ATTRIBUTE, density);
2305
+ return () => {
2306
+ if (previous === null) root.removeAttribute(DENSITY_ATTRIBUTE);
2307
+ else root.setAttribute(DENSITY_ATTRIBUTE, previous);
2308
+ };
2309
+ }, [scope, density]);
2310
+ const value = useMemo2(
2311
+ () => ({ density, setDensity }),
2312
+ [density, setDensity]
2313
+ );
2314
+ return /* @__PURE__ */ jsx52(DensityContext, { value, children: scope === "root" ? children : /* @__PURE__ */ jsx52(
2315
+ "div",
2316
+ {
2317
+ "data-kit": "density-provider",
2318
+ ...{ [DENSITY_ATTRIBUTE]: density },
2319
+ className: cx(className),
2320
+ ...props,
2321
+ children
2322
+ }
2323
+ ) });
2324
+ }
2325
+ function useDensity() {
2326
+ const context = useContext(DensityContext);
2327
+ if (context === null) {
2328
+ throw new Error("useDensity must be used inside a DensityProvider.");
2329
+ }
2330
+ return context;
2331
+ }
2332
+
2333
+ // src/providers/theme-provider.tsx
2334
+ import {
2335
+ THEME_ATTRIBUTE,
2336
+ THEME_STORAGE_KEY,
2337
+ themeNames
2338
+ } from "@x12i/tokens";
2339
+ import {
2340
+ createContext as createContext2,
2341
+ useContext as useContext2,
2342
+ useEffect as useEffect5,
2343
+ useMemo as useMemo3,
2344
+ useSyncExternalStore
2345
+ } from "react";
2346
+ import { jsx as jsx53 } from "react/jsx-runtime";
2347
+ var ThemeContext = createContext2(null);
2348
+ var DARK_QUERY = "(prefers-color-scheme: dark)";
2349
+ function subscribeToSystemTheme(onChange) {
2350
+ const query = window.matchMedia(DARK_QUERY);
2351
+ query.addEventListener("change", onChange);
2352
+ return () => query.removeEventListener("change", onChange);
2353
+ }
2354
+ var prefersDark = () => window.matchMedia(DARK_QUERY).matches;
2355
+ var serverPrefersDark = () => false;
2356
+ function isThemeChoice(value) {
2357
+ return value === "system" || themeNames.includes(value);
2358
+ }
2359
+ function ThemeProvider({
2360
+ children,
2361
+ theme: themeProp,
2362
+ defaultTheme = "system",
2363
+ onThemeChange,
2364
+ scope = "subtree",
2365
+ storageKey,
2366
+ className,
2367
+ ...props
2368
+ }) {
2369
+ const [theme, setTheme] = usePersistedChoice({
2370
+ value: themeProp,
2371
+ defaultValue: defaultTheme,
2372
+ onChange: onThemeChange,
2373
+ storageKey: storageKey === void 0 ? scope === "root" ? THEME_STORAGE_KEY : null : storageKey,
2374
+ isValid: isThemeChoice
2375
+ });
2376
+ const systemIsDark = useSyncExternalStore(subscribeToSystemTheme, prefersDark, serverPrefersDark);
2377
+ const resolvedTheme = theme === "system" ? systemIsDark ? "dark" : "light" : theme;
2378
+ const attribute = theme === "system" ? void 0 : theme;
2379
+ useEffect5(() => {
2380
+ if (scope !== "root") return;
2381
+ const root = document.documentElement;
2382
+ const previous = root.getAttribute(THEME_ATTRIBUTE);
2383
+ if (attribute === void 0) root.removeAttribute(THEME_ATTRIBUTE);
2384
+ else root.setAttribute(THEME_ATTRIBUTE, attribute);
2385
+ return () => {
2386
+ if (previous === null) root.removeAttribute(THEME_ATTRIBUTE);
2387
+ else root.setAttribute(THEME_ATTRIBUTE, previous);
2388
+ };
2389
+ }, [scope, attribute]);
2390
+ const value = useMemo3(
2391
+ () => ({ theme, resolvedTheme, setTheme }),
2392
+ [theme, resolvedTheme, setTheme]
2393
+ );
2394
+ return /* @__PURE__ */ jsx53(ThemeContext, { value, children: scope === "root" ? children : /* @__PURE__ */ jsx53(
2395
+ "div",
2396
+ {
2397
+ "data-kit": "theme-provider",
2398
+ ...{ [THEME_ATTRIBUTE]: attribute },
2399
+ className: cx(className),
2400
+ ...props,
2401
+ children
2402
+ }
2403
+ ) });
2404
+ }
2405
+ function useTheme() {
2406
+ const context = useContext2(ThemeContext);
2407
+ if (context === null) {
2408
+ throw new Error("useTheme must be used inside a ThemeProvider.");
2409
+ }
2410
+ return context;
2411
+ }
2412
+ export {
2413
+ Accordion,
2414
+ AccordionItem,
2415
+ Alert,
2416
+ AlertDialog,
2417
+ AlertDialogClose,
2418
+ AlertDialogContent,
2419
+ AlertDialogDescription,
2420
+ AlertDialogFooter,
2421
+ AlertDialogTitle,
2422
+ AlertDialogTrigger,
2423
+ AnimatedNumber,
2424
+ Avatar,
2425
+ AvatarGroup,
2426
+ Badge,
2427
+ Breadcrumb,
2428
+ Button,
2429
+ ButtonGroup,
2430
+ Callout,
2431
+ Card,
2432
+ CardContent,
2433
+ CardDescription,
2434
+ CardFooter,
2435
+ CardHeader,
2436
+ CardTitle,
2437
+ Checkbox,
2438
+ CheckboxGroup,
2439
+ Collapsible,
2440
+ CollapsiblePanel,
2441
+ CollapsibleTrigger,
2442
+ Combobox,
2443
+ ContextMenu,
2444
+ ContextMenuContent,
2445
+ ContextMenuTrigger,
2446
+ CopyButton,
2447
+ DensityProvider,
2448
+ Dialog,
2449
+ DialogBody,
2450
+ DialogClose,
2451
+ DialogContent,
2452
+ DialogDescription,
2453
+ DialogFooter,
2454
+ DialogHeader,
2455
+ DialogTitle,
2456
+ DialogTrigger,
2457
+ Divider,
2458
+ Drawer,
2459
+ DrawerBody,
2460
+ DrawerClose,
2461
+ DrawerContent,
2462
+ DrawerDescription,
2463
+ DrawerFooter,
2464
+ DrawerHeader,
2465
+ DrawerTitle,
2466
+ DrawerTrigger,
2467
+ EmptyState,
2468
+ Field,
2469
+ FieldDescription,
2470
+ FieldError,
2471
+ FieldLabel,
2472
+ Fieldset,
2473
+ IconButton,
2474
+ Inline,
2475
+ Input,
2476
+ InputAddon,
2477
+ InputGroup,
2478
+ Kbd,
2479
+ KbdGroup,
2480
+ Link,
2481
+ Menu,
2482
+ MenuCheckboxItem,
2483
+ MenuContent,
2484
+ MenuGroup,
2485
+ MenuItem,
2486
+ MenuLabel,
2487
+ MenuRadioGroup,
2488
+ MenuRadioItem,
2489
+ MenuSeparator,
2490
+ MenuTrigger,
2491
+ Meter,
2492
+ MultiCombobox,
2493
+ NumberInput,
2494
+ OTPInput,
2495
+ Pagination,
2496
+ PasswordInput,
2497
+ Popover,
2498
+ PopoverClose,
2499
+ PopoverContent,
2500
+ PopoverDescription,
2501
+ PopoverTitle,
2502
+ PopoverTrigger,
2503
+ Progress,
2504
+ ProgressCircle,
2505
+ Radio,
2506
+ RadioGroup,
2507
+ ScrollArea,
2508
+ SegmentedControl,
2509
+ Select,
2510
+ Skeleton,
2511
+ SkeletonText,
2512
+ Slider,
2513
+ Spinner,
2514
+ SplitButton,
2515
+ Stack,
2516
+ Stat,
2517
+ Stepper,
2518
+ SubMenu,
2519
+ SubMenuContent,
2520
+ SubMenuTrigger,
2521
+ Switch,
2522
+ Tab,
2523
+ TabList,
2524
+ TabPanel,
2525
+ Table,
2526
+ TableBody,
2527
+ TableCaption,
2528
+ TableCell,
2529
+ TableContainer,
2530
+ TableFoot,
2531
+ TableHead,
2532
+ TableHeaderCell,
2533
+ TableRow,
2534
+ Tabs,
2535
+ Tag,
2536
+ Textarea,
2537
+ ThemeProvider,
2538
+ ToastProvider,
2539
+ Toggle,
2540
+ ToggleGroup,
2541
+ Toolbar,
2542
+ ToolbarButton,
2543
+ ToolbarGroup,
2544
+ ToolbarSeparator,
2545
+ Tooltip,
2546
+ TooltipProvider,
2547
+ VisuallyHidden,
2548
+ getInitials,
2549
+ getPaginationRange,
2550
+ useDensity,
2551
+ useTheme,
2552
+ useToast
2553
+ };
2554
+ //# sourceMappingURL=index.js.map