@ship-it-ui/ui 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1504 -630
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +436 -28
- package/dist/index.d.ts +436 -28
- package/dist/index.js +1487 -619
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
- package/src/styles/globals.css +26 -0
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
32
32
|
// src/index.ts
|
|
33
33
|
var index_exports = {};
|
|
34
34
|
__export(index_exports, {
|
|
35
|
+
ActivityTimeline: () => ActivityTimeline,
|
|
35
36
|
Alert: () => Alert,
|
|
36
37
|
AlertDialog: () => AlertDialog,
|
|
37
38
|
AlertDialogAction: () => AlertDialogAction,
|
|
@@ -84,6 +85,8 @@ __export(index_exports, {
|
|
|
84
85
|
FAB: () => FAB,
|
|
85
86
|
Field: () => Field,
|
|
86
87
|
FileChip: () => FileChip,
|
|
88
|
+
FilterPanel: () => FilterPanel,
|
|
89
|
+
HealthScore: () => HealthScore,
|
|
87
90
|
HoverCard: () => HoverCard,
|
|
88
91
|
HoverCardContent: () => HoverCardContent,
|
|
89
92
|
HoverCardPortal: () => HoverCardPortal,
|
|
@@ -92,6 +95,7 @@ __export(index_exports, {
|
|
|
92
95
|
IconButton: () => IconButton,
|
|
93
96
|
Input: () => Input,
|
|
94
97
|
Kbd: () => Kbd,
|
|
98
|
+
LargeTitle: () => LargeTitle,
|
|
95
99
|
MenuCheckboxItem: () => MenuCheckboxItem,
|
|
96
100
|
MenuItem: () => MenuItem,
|
|
97
101
|
MenuSeparator: () => MenuSeparator,
|
|
@@ -105,6 +109,7 @@ __export(index_exports, {
|
|
|
105
109
|
NavItem: () => NavItem,
|
|
106
110
|
NavSection: () => NavSection,
|
|
107
111
|
OTP: () => OTP,
|
|
112
|
+
OnboardingChecklist: () => OnboardingChecklist,
|
|
108
113
|
Pagination: () => Pagination,
|
|
109
114
|
Popover: () => Popover,
|
|
110
115
|
PopoverAnchor: () => PopoverAnchor,
|
|
@@ -115,9 +120,11 @@ __export(index_exports, {
|
|
|
115
120
|
PopoverRoot: () => PopoverRoot,
|
|
116
121
|
PopoverTrigger: () => PopoverTrigger,
|
|
117
122
|
Progress: () => Progress,
|
|
123
|
+
PullToRefresh: () => PullToRefresh,
|
|
118
124
|
RadialProgress: () => RadialProgress,
|
|
119
125
|
Radio: () => Radio,
|
|
120
126
|
RadioGroup: () => RadioGroup,
|
|
127
|
+
ScrollArea: () => ScrollArea,
|
|
121
128
|
SearchInput: () => SearchInput,
|
|
122
129
|
Select: () => Select,
|
|
123
130
|
SelectContent: () => SelectContent,
|
|
@@ -140,6 +147,7 @@ __export(index_exports, {
|
|
|
140
147
|
Stepper: () => Stepper,
|
|
141
148
|
Switch: () => Switch,
|
|
142
149
|
Tab: () => Tab,
|
|
150
|
+
TabBar: () => TabBar,
|
|
143
151
|
Tabs: () => Tabs,
|
|
144
152
|
TabsContent: () => TabsContent,
|
|
145
153
|
TabsList: () => TabsList,
|
|
@@ -158,11 +166,13 @@ __export(index_exports, {
|
|
|
158
166
|
TooltipTrigger: () => TooltipTrigger,
|
|
159
167
|
Topbar: () => Topbar,
|
|
160
168
|
Tree: () => Tree,
|
|
169
|
+
WizardDialog: () => WizardDialog,
|
|
161
170
|
badgeStyles: () => badgeStyles,
|
|
162
171
|
buttonStyles: () => buttonStyles,
|
|
163
172
|
cardStyles: () => cardStyles,
|
|
164
173
|
cn: () => cn,
|
|
165
174
|
filterCommandItems: () => filterCommandItems,
|
|
175
|
+
formatRelative: () => formatRelative,
|
|
166
176
|
iconButtonStyles: () => iconButtonStyles,
|
|
167
177
|
useControllableState: () => useControllableState,
|
|
168
178
|
useDisclosure: () => useDisclosure,
|
|
@@ -376,14 +386,29 @@ var buttonStyles = (0, import_class_variance_authority.cva)(
|
|
|
376
386
|
md: "h-[32px] px-3 text-[12px] gap-[6px] rounded-md",
|
|
377
387
|
lg: "h-[38px] px-4 text-[13px] gap-[7px] rounded-[7px]"
|
|
378
388
|
},
|
|
389
|
+
density: {
|
|
390
|
+
comfortable: "",
|
|
391
|
+
touch: ""
|
|
392
|
+
},
|
|
379
393
|
fullWidth: {
|
|
380
394
|
true: "w-full",
|
|
381
395
|
false: ""
|
|
382
396
|
}
|
|
383
397
|
},
|
|
398
|
+
compoundVariants: [
|
|
399
|
+
// Mobile density — bumps every size to meet 44pt minimum touch target.
|
|
400
|
+
{
|
|
401
|
+
size: "sm",
|
|
402
|
+
density: "touch",
|
|
403
|
+
class: "h-[36px] px-[14px] text-[13px] gap-[7px] rounded-base"
|
|
404
|
+
},
|
|
405
|
+
{ size: "md", density: "touch", class: "h-touch px-[18px] text-m-body gap-2 rounded-base" },
|
|
406
|
+
{ size: "lg", density: "touch", class: "h-[52px] px-[22px] text-[16px] gap-2 rounded-base" }
|
|
407
|
+
],
|
|
384
408
|
defaultVariants: {
|
|
385
409
|
variant: "primary",
|
|
386
410
|
size: "md",
|
|
411
|
+
density: "comfortable",
|
|
387
412
|
fullWidth: false
|
|
388
413
|
}
|
|
389
414
|
}
|
|
@@ -398,10 +423,14 @@ function Spinner({ size }) {
|
|
|
398
423
|
}
|
|
399
424
|
);
|
|
400
425
|
}
|
|
401
|
-
var iconSize = {
|
|
426
|
+
var iconSize = {
|
|
427
|
+
comfortable: { sm: 11, md: 12, lg: 13 },
|
|
428
|
+
touch: { sm: 13, md: 15, lg: 16 }
|
|
429
|
+
};
|
|
402
430
|
var Button = (0, import_react8.forwardRef)(function Button2({
|
|
403
431
|
variant,
|
|
404
432
|
size,
|
|
433
|
+
density,
|
|
405
434
|
fullWidth,
|
|
406
435
|
icon,
|
|
407
436
|
trailing,
|
|
@@ -414,8 +443,8 @@ var Button = (0, import_react8.forwardRef)(function Button2({
|
|
|
414
443
|
...props
|
|
415
444
|
}, ref) {
|
|
416
445
|
const isDisabled = disabled || loading;
|
|
417
|
-
const iconPx = iconSize[size ?? "md"];
|
|
418
|
-
const composedClassName = cn(buttonStyles({ variant, size, fullWidth }), className);
|
|
446
|
+
const iconPx = iconSize[density ?? "comfortable"][size ?? "md"];
|
|
447
|
+
const composedClassName = cn(buttonStyles({ variant, size, density, fullWidth }), className);
|
|
419
448
|
if (asChild) {
|
|
420
449
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
421
450
|
import_react_slot.Slot,
|
|
@@ -476,18 +505,28 @@ var iconButtonStyles = (0, import_class_variance_authority2.cva)(
|
|
|
476
505
|
sm: "h-[26px] w-[26px] text-[12px] rounded-[5px]",
|
|
477
506
|
md: "h-[32px] w-[32px] text-[13px] rounded-md",
|
|
478
507
|
lg: "h-[38px] w-[38px] text-[15px] rounded-[7px]"
|
|
508
|
+
},
|
|
509
|
+
density: {
|
|
510
|
+
comfortable: "",
|
|
511
|
+
touch: ""
|
|
479
512
|
}
|
|
480
513
|
},
|
|
481
|
-
|
|
514
|
+
compoundVariants: [
|
|
515
|
+
// Mobile density — 44pt minimum touch target, circular tap.
|
|
516
|
+
{ size: "sm", density: "touch", class: "h-[36px] w-[36px] text-[14px] rounded-full" },
|
|
517
|
+
{ size: "md", density: "touch", class: "h-touch w-touch text-[16px] rounded-full" },
|
|
518
|
+
{ size: "lg", density: "touch", class: "h-[52px] w-[52px] text-[18px] rounded-full" }
|
|
519
|
+
],
|
|
520
|
+
defaultVariants: { variant: "secondary", size: "md", density: "comfortable" }
|
|
482
521
|
}
|
|
483
522
|
);
|
|
484
|
-
var IconButton = (0, import_react9.forwardRef)(function IconButton2({ variant, size, icon, type, className, ...props }, ref) {
|
|
523
|
+
var IconButton = (0, import_react9.forwardRef)(function IconButton2({ variant, size, density, icon, type, className, ...props }, ref) {
|
|
485
524
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
486
525
|
"button",
|
|
487
526
|
{
|
|
488
527
|
ref,
|
|
489
528
|
type: type ?? "button",
|
|
490
|
-
className: cn(iconButtonStyles({ variant, size }), className),
|
|
529
|
+
className: cn(iconButtonStyles({ variant, size, density }), className),
|
|
491
530
|
...props,
|
|
492
531
|
children: icon
|
|
493
532
|
}
|
|
@@ -602,14 +641,16 @@ FAB.displayName = "FAB";
|
|
|
602
641
|
var RadixCheckbox = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
603
642
|
var import_react13 = require("react");
|
|
604
643
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
605
|
-
var Checkbox = (0, import_react13.forwardRef)(function Checkbox2({ label, className, id: idProp, ...props }, ref) {
|
|
644
|
+
var Checkbox = (0, import_react13.forwardRef)(function Checkbox2({ label, density = "comfortable", className, id: idProp, ...props }, ref) {
|
|
606
645
|
const reactId = (0, import_react13.useId)();
|
|
607
646
|
const id = idProp ?? `cb-${reactId}`;
|
|
647
|
+
const isTouch = density === "touch";
|
|
608
648
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
609
649
|
"span",
|
|
610
650
|
{
|
|
611
651
|
className: cn(
|
|
612
|
-
"inline-flex items-center
|
|
652
|
+
"inline-flex items-center select-none",
|
|
653
|
+
isTouch ? "min-h-touch gap-3" : "gap-2",
|
|
613
654
|
props.disabled && "cursor-not-allowed opacity-40",
|
|
614
655
|
className
|
|
615
656
|
),
|
|
@@ -620,18 +661,32 @@ var Checkbox = (0, import_react13.forwardRef)(function Checkbox2({ label, classN
|
|
|
620
661
|
ref,
|
|
621
662
|
id,
|
|
622
663
|
className: cn(
|
|
623
|
-
"grid
|
|
624
|
-
"
|
|
664
|
+
"grid place-items-center",
|
|
665
|
+
isTouch ? "h-[22px] w-[22px] rounded-sm border-[1.5px]" : "h-4 w-4 rounded-xs border",
|
|
666
|
+
"bg-panel border-border-strong",
|
|
625
667
|
"data-[state=checked]:bg-accent data-[state=checked]:border-accent",
|
|
626
668
|
"data-[state=indeterminate]:bg-accent data-[state=indeterminate]:border-accent",
|
|
627
669
|
"transition-[background,border-color] duration-(--duration-micro)",
|
|
628
670
|
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]"
|
|
629
671
|
),
|
|
630
672
|
...props,
|
|
631
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
674
|
+
RadixCheckbox.Indicator,
|
|
675
|
+
{
|
|
676
|
+
className: cn("text-on-accent leading-none", isTouch ? "text-[14px]" : "text-[11px]"),
|
|
677
|
+
children: props.checked === "indeterminate" ? "\u2212" : "\u2713"
|
|
678
|
+
}
|
|
679
|
+
)
|
|
632
680
|
}
|
|
633
681
|
),
|
|
634
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
682
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
683
|
+
"label",
|
|
684
|
+
{
|
|
685
|
+
htmlFor: id,
|
|
686
|
+
className: cn("cursor-pointer", isTouch ? "text-m-body" : "text-[13px]"),
|
|
687
|
+
children: label
|
|
688
|
+
}
|
|
689
|
+
)
|
|
635
690
|
]
|
|
636
691
|
}
|
|
637
692
|
);
|
|
@@ -682,17 +737,28 @@ var inputWrapperStyles = (0, import_class_variance_authority3.cva)(
|
|
|
682
737
|
tone: {
|
|
683
738
|
default: "bg-panel border-border focus-within:border-accent focus-within:ring-accent-dim",
|
|
684
739
|
err: "bg-panel border-err focus-within:border-err focus-within:ring-err/30"
|
|
740
|
+
},
|
|
741
|
+
density: {
|
|
742
|
+
comfortable: "",
|
|
743
|
+
touch: ""
|
|
685
744
|
}
|
|
686
745
|
},
|
|
687
|
-
|
|
746
|
+
compoundVariants: [
|
|
747
|
+
// Mobile density — 52px standard input height (MInput in the canvas);
|
|
748
|
+
// sm collapses to 44pt min, lg pushes to 56pt for prominent forms.
|
|
749
|
+
{ size: "sm", density: "touch", class: "h-touch px-3 text-m-body rounded-m-tab" },
|
|
750
|
+
{ size: "md", density: "touch", class: "h-[52px] px-[14px] text-m-body rounded-m-tab" },
|
|
751
|
+
{ size: "lg", density: "touch", class: "h-row px-4 text-m-body-lg rounded-m-tab" }
|
|
752
|
+
],
|
|
753
|
+
defaultVariants: { size: "md", tone: "default", density: "comfortable" }
|
|
688
754
|
}
|
|
689
755
|
);
|
|
690
|
-
var Input = (0, import_react15.forwardRef)(function Input2({ size, tone, icon, trailing, error, width, className, style, disabled, ...props }, ref) {
|
|
756
|
+
var Input = (0, import_react15.forwardRef)(function Input2({ size, tone, density, icon, trailing, error, width, className, style, disabled, ...props }, ref) {
|
|
691
757
|
const computedTone = error ? "err" : tone;
|
|
692
758
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
693
759
|
"div",
|
|
694
760
|
{
|
|
695
|
-
className: cn(inputWrapperStyles({ size, tone: computedTone }), className),
|
|
761
|
+
className: cn(inputWrapperStyles({ size, tone: computedTone, density }), className),
|
|
696
762
|
style: { width, ...style },
|
|
697
763
|
children: [
|
|
698
764
|
icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-text-dim leading-none", children: icon }),
|
|
@@ -721,27 +787,32 @@ Input.displayName = "Input";
|
|
|
721
787
|
var import_react16 = require("react");
|
|
722
788
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
723
789
|
var SearchInput = (0, import_react16.forwardRef)(function SearchInput2({
|
|
724
|
-
shortcut
|
|
725
|
-
width
|
|
790
|
+
shortcut,
|
|
791
|
+
width,
|
|
792
|
+
density = "comfortable",
|
|
726
793
|
className,
|
|
727
794
|
style,
|
|
728
795
|
placeholder = "Search\u2026",
|
|
729
796
|
"aria-label": ariaLabel,
|
|
730
797
|
...props
|
|
731
798
|
}, ref) {
|
|
799
|
+
const isTouch = density === "touch";
|
|
800
|
+
const resolvedWidth = width ?? (isTouch ? "100%" : 360);
|
|
801
|
+
const resolvedShortcut = shortcut ?? (isTouch ? void 0 : "\u2318K");
|
|
732
802
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
733
803
|
"div",
|
|
734
804
|
{
|
|
735
805
|
className: cn(
|
|
736
|
-
"
|
|
806
|
+
"flex items-center gap-2 font-sans",
|
|
807
|
+
isTouch ? "h-touch rounded-m-tab px-[14px]" : "rounded-base h-9 px-3",
|
|
737
808
|
"bg-panel-2 border-border border",
|
|
738
809
|
"focus-within:border-accent focus-within:ring-accent-dim focus-within:ring-[3px]",
|
|
739
810
|
"transition-[border-color,box-shadow] duration-(--duration-micro)",
|
|
740
811
|
className
|
|
741
812
|
),
|
|
742
|
-
style: { width, ...style },
|
|
813
|
+
style: { width: resolvedWidth, ...style },
|
|
743
814
|
children: [
|
|
744
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-text-dim leading-none", "aria-hidden": true, children: "\u2315" }),
|
|
815
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cn("text-text-dim leading-none", isTouch && "text-[18px]"), "aria-hidden": true, children: "\u2315" }),
|
|
745
816
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
746
817
|
"input",
|
|
747
818
|
{
|
|
@@ -749,11 +820,14 @@ var SearchInput = (0, import_react16.forwardRef)(function SearchInput2({
|
|
|
749
820
|
type: "search",
|
|
750
821
|
placeholder,
|
|
751
822
|
"aria-label": ariaLabel ?? (typeof placeholder === "string" ? placeholder : "Search"),
|
|
752
|
-
className:
|
|
823
|
+
className: cn(
|
|
824
|
+
"text-text placeholder:text-text-dim min-w-0 flex-1 border-none bg-transparent outline-none",
|
|
825
|
+
isTouch ? "text-m-body" : "text-[13px]"
|
|
826
|
+
),
|
|
753
827
|
...props
|
|
754
828
|
}
|
|
755
829
|
),
|
|
756
|
-
|
|
830
|
+
resolvedShortcut && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("kbd", { className: "text-text-dim border-border rounded-xs border px-[6px] py-[2px] font-mono text-[10px]", children: resolvedShortcut })
|
|
757
831
|
]
|
|
758
832
|
}
|
|
759
833
|
);
|
|
@@ -1081,14 +1155,26 @@ var RadixSwitch = __toESM(require("@radix-ui/react-switch"), 1);
|
|
|
1081
1155
|
var import_react21 = require("react");
|
|
1082
1156
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1083
1157
|
var trackClasses = {
|
|
1084
|
-
|
|
1085
|
-
|
|
1158
|
+
comfortable: {
|
|
1159
|
+
sm: "h-4 w-7",
|
|
1160
|
+
md: "h-5 w-9"
|
|
1161
|
+
},
|
|
1162
|
+
touch: {
|
|
1163
|
+
sm: "h-[26px] w-[44px]",
|
|
1164
|
+
md: "h-[30px] w-[50px]"
|
|
1165
|
+
}
|
|
1086
1166
|
};
|
|
1087
1167
|
var thumbClasses = {
|
|
1088
|
-
|
|
1089
|
-
|
|
1168
|
+
comfortable: {
|
|
1169
|
+
sm: "h-3 w-3 data-[state=checked]:translate-x-3",
|
|
1170
|
+
md: "h-4 w-4 data-[state=checked]:translate-x-4"
|
|
1171
|
+
},
|
|
1172
|
+
touch: {
|
|
1173
|
+
sm: "h-[22px] w-[22px] data-[state=checked]:translate-x-[18px]",
|
|
1174
|
+
md: "h-[26px] w-[26px] data-[state=checked]:translate-x-5"
|
|
1175
|
+
}
|
|
1090
1176
|
};
|
|
1091
|
-
var Switch = (0, import_react21.forwardRef)(function Switch2({ label, size = "md", className, id: idProp, ...props }, ref) {
|
|
1177
|
+
var Switch = (0, import_react21.forwardRef)(function Switch2({ label, size = "md", density = "comfortable", className, id: idProp, ...props }, ref) {
|
|
1092
1178
|
const reactId = (0, import_react21.useId)();
|
|
1093
1179
|
const id = idProp ?? `sw-${reactId}`;
|
|
1094
1180
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
@@ -1110,7 +1196,7 @@ var Switch = (0, import_react21.forwardRef)(function Switch2({ label, size = "md
|
|
|
1110
1196
|
"bg-panel-2 border-border data-[state=checked]:bg-accent data-[state=checked]:border-accent",
|
|
1111
1197
|
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]",
|
|
1112
1198
|
"disabled:cursor-not-allowed",
|
|
1113
|
-
trackClasses[size]
|
|
1199
|
+
trackClasses[density][size]
|
|
1114
1200
|
),
|
|
1115
1201
|
...props,
|
|
1116
1202
|
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
@@ -1119,13 +1205,20 @@ var Switch = (0, import_react21.forwardRef)(function Switch2({ label, size = "md
|
|
|
1119
1205
|
className: cn(
|
|
1120
1206
|
"bg-text absolute top-1/2 left-[1px] -translate-y-1/2 rounded-full shadow-sm",
|
|
1121
1207
|
"data-[state=checked]:bg-on-accent transition-transform duration-(--duration-micro)",
|
|
1122
|
-
thumbClasses[size]
|
|
1208
|
+
thumbClasses[density][size]
|
|
1123
1209
|
)
|
|
1124
1210
|
}
|
|
1125
1211
|
)
|
|
1126
1212
|
}
|
|
1127
1213
|
),
|
|
1128
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1214
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1215
|
+
"label",
|
|
1216
|
+
{
|
|
1217
|
+
htmlFor: id,
|
|
1218
|
+
className: cn("cursor-pointer", density === "touch" ? "text-m-body" : "text-[13px]"),
|
|
1219
|
+
children: label
|
|
1220
|
+
}
|
|
1221
|
+
)
|
|
1129
1222
|
]
|
|
1130
1223
|
}
|
|
1131
1224
|
);
|
|
@@ -1393,7 +1486,7 @@ var import_class_variance_authority6 = require("class-variance-authority");
|
|
|
1393
1486
|
var import_react27 = require("react");
|
|
1394
1487
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1395
1488
|
var cardStyles = (0, import_class_variance_authority6.cva)(
|
|
1396
|
-
"block bg-panel border border-border
|
|
1489
|
+
"block bg-panel border border-border transition-[border-color,transform,box-shadow] duration-(--duration-step)",
|
|
1397
1490
|
{
|
|
1398
1491
|
variants: {
|
|
1399
1492
|
variant: {
|
|
@@ -1404,14 +1497,19 @@ var cardStyles = (0, import_class_variance_authority6.cva)(
|
|
|
1404
1497
|
interactive: {
|
|
1405
1498
|
true: "cursor-pointer hover:border-border-strong hover:-translate-y-px hover:shadow",
|
|
1406
1499
|
false: ""
|
|
1500
|
+
},
|
|
1501
|
+
density: {
|
|
1502
|
+
comfortable: "rounded-base",
|
|
1503
|
+
touch: "rounded-m-card"
|
|
1407
1504
|
}
|
|
1408
1505
|
},
|
|
1409
|
-
defaultVariants: { variant: "default", interactive: false }
|
|
1506
|
+
defaultVariants: { variant: "default", interactive: false, density: "comfortable" }
|
|
1410
1507
|
}
|
|
1411
1508
|
);
|
|
1412
1509
|
var Card = (0, import_react27.forwardRef)(function Card2({
|
|
1413
1510
|
variant,
|
|
1414
1511
|
interactive,
|
|
1512
|
+
density,
|
|
1415
1513
|
title,
|
|
1416
1514
|
description,
|
|
1417
1515
|
actions,
|
|
@@ -1448,7 +1546,11 @@ var Card = (0, import_react27.forwardRef)(function Card2({
|
|
|
1448
1546
|
onKeyDown: handleKeyDown,
|
|
1449
1547
|
role: isInteractive ? "button" : void 0,
|
|
1450
1548
|
tabIndex: isInteractive ? 0 : void 0,
|
|
1451
|
-
className: cn(
|
|
1549
|
+
className: cn(
|
|
1550
|
+
cardStyles({ variant, interactive: wantsInteractive, density }),
|
|
1551
|
+
density === "touch" ? "p-4" : "p-[18px]",
|
|
1552
|
+
className
|
|
1553
|
+
),
|
|
1452
1554
|
...props,
|
|
1453
1555
|
children: [
|
|
1454
1556
|
(title || actions) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex items-start gap-3", (description || children) && "mb-[10px]"), children: [
|
|
@@ -1463,15 +1565,16 @@ var Card = (0, import_react27.forwardRef)(function Card2({
|
|
|
1463
1565
|
);
|
|
1464
1566
|
});
|
|
1465
1567
|
Card.displayName = "Card";
|
|
1466
|
-
var CardLink = (0, import_react27.forwardRef)(function CardLink2({ variant, title, description, footer, className, children, href, ...props }, ref) {
|
|
1568
|
+
var CardLink = (0, import_react27.forwardRef)(function CardLink2({ variant, density, title, description, footer, className, children, href, ...props }, ref) {
|
|
1467
1569
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1468
1570
|
"a",
|
|
1469
1571
|
{
|
|
1470
1572
|
ref,
|
|
1471
1573
|
href,
|
|
1472
1574
|
className: cn(
|
|
1473
|
-
cardStyles({ variant, interactive: true }),
|
|
1474
|
-
"focus-visible:ring-accent-dim
|
|
1575
|
+
cardStyles({ variant, interactive: true, density }),
|
|
1576
|
+
"focus-visible:ring-accent-dim no-underline outline-none focus-visible:ring-[3px]",
|
|
1577
|
+
density === "touch" ? "p-4" : "p-[18px]",
|
|
1475
1578
|
className
|
|
1476
1579
|
),
|
|
1477
1580
|
...props,
|
|
@@ -1522,19 +1625,21 @@ StatCard.displayName = "StatCard";
|
|
|
1522
1625
|
// src/components/Chip/Chip.tsx
|
|
1523
1626
|
var import_react29 = require("react");
|
|
1524
1627
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1525
|
-
var Chip = (0, import_react29.forwardRef)(function Chip2({ icon, onRemove, className, children, ...props }, ref) {
|
|
1628
|
+
var Chip = (0, import_react29.forwardRef)(function Chip2({ icon, onRemove, density = "comfortable", className, children, ...props }, ref) {
|
|
1629
|
+
const isTouch = density === "touch";
|
|
1526
1630
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1527
1631
|
"span",
|
|
1528
1632
|
{
|
|
1529
1633
|
ref,
|
|
1530
1634
|
className: cn(
|
|
1531
|
-
"inline-flex
|
|
1635
|
+
"inline-flex items-center gap-[6px] font-sans",
|
|
1636
|
+
isTouch ? "text-m-mono h-8 py-[5px] pr-[6px] pl-3" : "h-[26px] py-[4px] pr-1 pl-[10px] text-[12px]",
|
|
1532
1637
|
"bg-panel-2 text-text border-border rounded-full border",
|
|
1533
1638
|
className
|
|
1534
1639
|
),
|
|
1535
1640
|
...props,
|
|
1536
1641
|
children: [
|
|
1537
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-text-dim inline-flex text-[10px]", children: icon }),
|
|
1642
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: cn("text-text-dim inline-flex", isTouch ? "text-[12px]" : "text-[10px]"), children: icon }),
|
|
1538
1643
|
children,
|
|
1539
1644
|
onRemove && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1540
1645
|
"button",
|
|
@@ -1542,7 +1647,10 @@ var Chip = (0, import_react29.forwardRef)(function Chip2({ icon, onRemove, class
|
|
|
1542
1647
|
type: "button",
|
|
1543
1648
|
onClick: onRemove,
|
|
1544
1649
|
"aria-label": "Remove",
|
|
1545
|
-
className:
|
|
1650
|
+
className: cn(
|
|
1651
|
+
"bg-panel text-text-dim hover:text-text grid place-items-center rounded-full leading-none",
|
|
1652
|
+
isTouch ? "h-[22px] w-[22px] text-[12px]" : "h-[18px] w-[18px] text-[10px]"
|
|
1653
|
+
),
|
|
1546
1654
|
children: "\xD7"
|
|
1547
1655
|
}
|
|
1548
1656
|
)
|
|
@@ -1573,10 +1681,71 @@ var Kbd = (0, import_react30.forwardRef)(function Kbd2({ className, children, ..
|
|
|
1573
1681
|
});
|
|
1574
1682
|
Kbd.displayName = "Kbd";
|
|
1575
1683
|
|
|
1576
|
-
// src/components/
|
|
1577
|
-
var
|
|
1684
|
+
// src/components/ScrollArea/ScrollArea.tsx
|
|
1685
|
+
var RadixScrollArea = __toESM(require("@radix-ui/react-scroll-area"), 1);
|
|
1578
1686
|
var import_react31 = require("react");
|
|
1579
1687
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1688
|
+
var scrollbarBase = "flex touch-none select-none p-[2px] transition-colors duration-(--duration-micro)";
|
|
1689
|
+
var thumbBase = 'relative flex-1 rounded-full bg-text-muted/40 hover:bg-text-muted/60 before:absolute before:inset-1/2 before:size-full before:min-h-[44px] before:min-w-[44px] before:-translate-x-1/2 before:-translate-y-1/2 before:content-[""]';
|
|
1690
|
+
var ScrollArea = (0, import_react31.forwardRef)(function ScrollArea2({
|
|
1691
|
+
type = "hover",
|
|
1692
|
+
orientation = "vertical",
|
|
1693
|
+
scrollHideDelay = 600,
|
|
1694
|
+
className,
|
|
1695
|
+
viewportClassName,
|
|
1696
|
+
viewportRef,
|
|
1697
|
+
children,
|
|
1698
|
+
...props
|
|
1699
|
+
}, ref) {
|
|
1700
|
+
const showVertical = orientation === "vertical" || orientation === "both";
|
|
1701
|
+
const showHorizontal = orientation === "horizontal" || orientation === "both";
|
|
1702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1703
|
+
RadixScrollArea.Root,
|
|
1704
|
+
{
|
|
1705
|
+
ref,
|
|
1706
|
+
type,
|
|
1707
|
+
scrollHideDelay,
|
|
1708
|
+
className: cn("relative overflow-hidden", className),
|
|
1709
|
+
...props,
|
|
1710
|
+
children: [
|
|
1711
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1712
|
+
RadixScrollArea.Viewport,
|
|
1713
|
+
{
|
|
1714
|
+
ref: viewportRef,
|
|
1715
|
+
className: cn("h-full w-full rounded-[inherit]", viewportClassName),
|
|
1716
|
+
children
|
|
1717
|
+
}
|
|
1718
|
+
),
|
|
1719
|
+
showVertical && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1720
|
+
RadixScrollArea.Scrollbar,
|
|
1721
|
+
{
|
|
1722
|
+
orientation: "vertical",
|
|
1723
|
+
className: cn(scrollbarBase, "bg-panel-2/40 hover:bg-panel-2/80 h-full w-[10px]"),
|
|
1724
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RadixScrollArea.Thumb, { className: thumbBase })
|
|
1725
|
+
}
|
|
1726
|
+
),
|
|
1727
|
+
showHorizontal && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1728
|
+
RadixScrollArea.Scrollbar,
|
|
1729
|
+
{
|
|
1730
|
+
orientation: "horizontal",
|
|
1731
|
+
className: cn(
|
|
1732
|
+
scrollbarBase,
|
|
1733
|
+
"bg-panel-2/40 hover:bg-panel-2/80 h-[10px] w-full flex-col"
|
|
1734
|
+
),
|
|
1735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RadixScrollArea.Thumb, { className: thumbBase })
|
|
1736
|
+
}
|
|
1737
|
+
),
|
|
1738
|
+
orientation === "both" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RadixScrollArea.Corner, { className: "bg-panel-2/60" })
|
|
1739
|
+
]
|
|
1740
|
+
}
|
|
1741
|
+
);
|
|
1742
|
+
});
|
|
1743
|
+
ScrollArea.displayName = "ScrollArea";
|
|
1744
|
+
|
|
1745
|
+
// src/components/Skeleton/Skeleton.tsx
|
|
1746
|
+
var import_class_variance_authority7 = require("class-variance-authority");
|
|
1747
|
+
var import_react32 = require("react");
|
|
1748
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1580
1749
|
var skeletonStyles = (0, import_class_variance_authority7.cva)("block bg-panel-2 animate-[ship-skeleton_1.4s_infinite]", {
|
|
1581
1750
|
variants: {
|
|
1582
1751
|
shape: {
|
|
@@ -1588,11 +1757,11 @@ var skeletonStyles = (0, import_class_variance_authority7.cva)("block bg-panel-2
|
|
|
1588
1757
|
defaultVariants: { shape: "line" }
|
|
1589
1758
|
});
|
|
1590
1759
|
var defaultHeight = { line: 14, block: 80, circle: 40 };
|
|
1591
|
-
var Skeleton = (0,
|
|
1760
|
+
var Skeleton = (0, import_react32.forwardRef)(function Skeleton2({ shape = "line", width = "100%", height, standalone = false, className, style, ...props }, ref) {
|
|
1592
1761
|
const h = height ?? defaultHeight[shape];
|
|
1593
1762
|
const w = shape === "circle" ? h : width;
|
|
1594
1763
|
const a11yProps = standalone ? { role: "status", "aria-busy": true, "aria-label": "Loading" } : { "aria-hidden": true };
|
|
1595
|
-
return /* @__PURE__ */ (0,
|
|
1764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1596
1765
|
"div",
|
|
1597
1766
|
{
|
|
1598
1767
|
ref,
|
|
@@ -1604,11 +1773,11 @@ var Skeleton = (0, import_react31.forwardRef)(function Skeleton2({ shape = "line
|
|
|
1604
1773
|
);
|
|
1605
1774
|
});
|
|
1606
1775
|
Skeleton.displayName = "Skeleton";
|
|
1607
|
-
var SkeletonGroup = (0,
|
|
1776
|
+
var SkeletonGroup = (0, import_react32.forwardRef)(function SkeletonGroup2({ label = "Loading", loading = true, className, children, ...props }, ref) {
|
|
1608
1777
|
if (!loading) {
|
|
1609
|
-
return /* @__PURE__ */ (0,
|
|
1778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, className, ...props, children });
|
|
1610
1779
|
}
|
|
1611
|
-
return /* @__PURE__ */ (0,
|
|
1780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1612
1781
|
"div",
|
|
1613
1782
|
{
|
|
1614
1783
|
ref,
|
|
@@ -1624,10 +1793,10 @@ var SkeletonGroup = (0, import_react31.forwardRef)(function SkeletonGroup2({ lab
|
|
|
1624
1793
|
SkeletonGroup.displayName = "SkeletonGroup";
|
|
1625
1794
|
|
|
1626
1795
|
// src/components/Tag/Tag.tsx
|
|
1627
|
-
var
|
|
1628
|
-
var
|
|
1629
|
-
var Tag = (0,
|
|
1630
|
-
return /* @__PURE__ */ (0,
|
|
1796
|
+
var import_react33 = require("react");
|
|
1797
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1798
|
+
var Tag = (0, import_react33.forwardRef)(function Tag2({ onRemove, icon, size = 22, className, children, ...props }, ref) {
|
|
1799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1631
1800
|
"span",
|
|
1632
1801
|
{
|
|
1633
1802
|
ref,
|
|
@@ -1639,9 +1808,9 @@ var Tag = (0, import_react32.forwardRef)(function Tag2({ onRemove, icon, size =
|
|
|
1639
1808
|
style: { height: size },
|
|
1640
1809
|
...props,
|
|
1641
1810
|
children: [
|
|
1642
|
-
icon && /* @__PURE__ */ (0,
|
|
1811
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-text-dim inline-flex", children: icon }),
|
|
1643
1812
|
children,
|
|
1644
|
-
onRemove && /* @__PURE__ */ (0,
|
|
1813
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1645
1814
|
"button",
|
|
1646
1815
|
{
|
|
1647
1816
|
type: "button",
|
|
@@ -1659,14 +1828,14 @@ Tag.displayName = "Tag";
|
|
|
1659
1828
|
|
|
1660
1829
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
1661
1830
|
var RadixContext = __toESM(require("@radix-ui/react-context-menu"), 1);
|
|
1662
|
-
var
|
|
1663
|
-
var
|
|
1831
|
+
var import_react34 = require("react");
|
|
1832
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1664
1833
|
var ContextMenuRoot = RadixContext.Root;
|
|
1665
1834
|
var ContextMenuTrigger = RadixContext.Trigger;
|
|
1666
1835
|
var ContextMenuPortal = RadixContext.Portal;
|
|
1667
|
-
var ContextMenuContent = (0,
|
|
1836
|
+
var ContextMenuContent = (0, import_react34.forwardRef)(
|
|
1668
1837
|
function ContextMenuContent2({ className, ...props }, ref) {
|
|
1669
|
-
return /* @__PURE__ */ (0,
|
|
1838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(RadixContext.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1670
1839
|
RadixContext.Content,
|
|
1671
1840
|
{
|
|
1672
1841
|
ref,
|
|
@@ -1686,26 +1855,26 @@ var itemBase = cn(
|
|
|
1686
1855
|
"data-[highlighted]:bg-panel-2",
|
|
1687
1856
|
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
1688
1857
|
);
|
|
1689
|
-
var ContextMenuItem = (0,
|
|
1858
|
+
var ContextMenuItem = (0, import_react34.forwardRef)(
|
|
1690
1859
|
function ContextMenuItem2({ icon, trailing, destructive, className, children, ...props }, ref) {
|
|
1691
|
-
return /* @__PURE__ */ (0,
|
|
1860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1692
1861
|
RadixContext.Item,
|
|
1693
1862
|
{
|
|
1694
1863
|
ref,
|
|
1695
1864
|
className: cn(itemBase, destructive ? "text-err" : "text-text", className),
|
|
1696
1865
|
...props,
|
|
1697
1866
|
children: [
|
|
1698
|
-
icon && /* @__PURE__ */ (0,
|
|
1699
|
-
/* @__PURE__ */ (0,
|
|
1700
|
-
trailing && /* @__PURE__ */ (0,
|
|
1867
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "w-[14px] text-[12px] opacity-70", children: icon }),
|
|
1868
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "flex-1", children }),
|
|
1869
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
1701
1870
|
]
|
|
1702
1871
|
}
|
|
1703
1872
|
);
|
|
1704
1873
|
}
|
|
1705
1874
|
);
|
|
1706
1875
|
ContextMenuItem.displayName = "ContextMenuItem";
|
|
1707
|
-
var ContextMenuSeparator = (0,
|
|
1708
|
-
return /* @__PURE__ */ (0,
|
|
1876
|
+
var ContextMenuSeparator = (0, import_react34.forwardRef)(function ContextMenuSeparator2({ className, ...props }, ref) {
|
|
1877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1709
1878
|
RadixContext.Separator,
|
|
1710
1879
|
{
|
|
1711
1880
|
ref,
|
|
@@ -1719,15 +1888,15 @@ var ContextMenu = RadixContext.Root;
|
|
|
1719
1888
|
|
|
1720
1889
|
// src/components/Dialog/Dialog.tsx
|
|
1721
1890
|
var RadixDialog = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
1722
|
-
var
|
|
1723
|
-
var
|
|
1891
|
+
var import_react35 = require("react");
|
|
1892
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1724
1893
|
var DialogRoot = RadixDialog.Root;
|
|
1725
1894
|
var DialogTrigger = RadixDialog.Trigger;
|
|
1726
1895
|
var DialogClose = RadixDialog.Close;
|
|
1727
1896
|
var DialogPortal = RadixDialog.Portal;
|
|
1728
|
-
var DialogOverlay = (0,
|
|
1897
|
+
var DialogOverlay = (0, import_react35.forwardRef)(
|
|
1729
1898
|
function DialogOverlay2({ className, ...props }, ref) {
|
|
1730
|
-
return /* @__PURE__ */ (0,
|
|
1899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1731
1900
|
RadixDialog.Overlay,
|
|
1732
1901
|
{
|
|
1733
1902
|
ref,
|
|
@@ -1742,10 +1911,10 @@ var DialogOverlay = (0, import_react34.forwardRef)(
|
|
|
1742
1911
|
}
|
|
1743
1912
|
);
|
|
1744
1913
|
DialogOverlay.displayName = "DialogOverlay";
|
|
1745
|
-
var DialogContent = (0,
|
|
1746
|
-
return /* @__PURE__ */ (0,
|
|
1747
|
-
/* @__PURE__ */ (0,
|
|
1748
|
-
/* @__PURE__ */ (0,
|
|
1914
|
+
var DialogContent = (0, import_react35.forwardRef)(function DialogContent2({ className, width = 460, style, children, ...props }, ref) {
|
|
1915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(DialogPortal, { children: [
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DialogOverlay, {}),
|
|
1917
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1749
1918
|
RadixDialog.Content,
|
|
1750
1919
|
{
|
|
1751
1920
|
ref,
|
|
@@ -1765,31 +1934,32 @@ var DialogContent = (0, import_react34.forwardRef)(function DialogContent2({ cla
|
|
|
1765
1934
|
});
|
|
1766
1935
|
DialogContent.displayName = "DialogContent";
|
|
1767
1936
|
function Dialog({ title, description, footer, width, children, ...rootProps }) {
|
|
1768
|
-
return /* @__PURE__ */ (0,
|
|
1769
|
-
title && /* @__PURE__ */ (0,
|
|
1937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DialogRoot, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(DialogContent, { width, children: [
|
|
1938
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1770
1939
|
RadixDialog.Title,
|
|
1771
1940
|
{
|
|
1772
1941
|
className: cn("text-[16px] font-medium", description ? "mb-[6px]" : "mb-4"),
|
|
1773
1942
|
children: title
|
|
1774
1943
|
}
|
|
1775
1944
|
),
|
|
1776
|
-
description && /* @__PURE__ */ (0,
|
|
1945
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(RadixDialog.Description, { className: "text-text-muted mb-[18px] text-[13px] leading-[1.55]", children: description }),
|
|
1777
1946
|
children,
|
|
1778
|
-
footer && /* @__PURE__ */ (0,
|
|
1947
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
1779
1948
|
] }) });
|
|
1780
1949
|
}
|
|
1781
1950
|
|
|
1782
1951
|
// src/components/Dialog/Drawer.tsx
|
|
1783
1952
|
var RadixDialog2 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
1784
|
-
var
|
|
1785
|
-
var
|
|
1953
|
+
var import_react36 = require("react");
|
|
1954
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1786
1955
|
var sideClasses = {
|
|
1787
|
-
left: "left-0 border-r border-border-strong data-[state=open]:animate-[ship-slide-in-left_220ms_var(--easing-out)]",
|
|
1788
|
-
right: "right-0 border-l border-border-strong data-[state=open]:animate-[ship-slide-in-right_220ms_var(--easing-out)]"
|
|
1956
|
+
left: "top-0 bottom-0 left-0 border-r border-border-strong data-[state=open]:animate-[ship-slide-in-left_220ms_var(--easing-out)]",
|
|
1957
|
+
right: "top-0 bottom-0 right-0 border-l border-border-strong data-[state=open]:animate-[ship-slide-in-right_220ms_var(--easing-out)]",
|
|
1958
|
+
bottom: "bottom-0 left-0 right-0 border-t border-border-strong rounded-t-m-sheet data-[state=open]:animate-[ship-slide-in-bottom_240ms_var(--easing-out)]"
|
|
1789
1959
|
};
|
|
1790
|
-
var DrawerHeader = ({ title, onClose }) => /* @__PURE__ */ (0,
|
|
1791
|
-
/* @__PURE__ */ (0,
|
|
1792
|
-
/* @__PURE__ */ (0,
|
|
1960
|
+
var DrawerHeader = ({ title, onClose }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "border-border flex items-center justify-between border-b p-[16px] px-5", children: [
|
|
1961
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(RadixDialog2.Title, { className: "text-[14px] font-medium", children: title }),
|
|
1962
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1793
1963
|
RadixDialog2.Close,
|
|
1794
1964
|
{
|
|
1795
1965
|
onClick: onClose,
|
|
@@ -1799,22 +1969,28 @@ var DrawerHeader = ({ title, onClose }) => /* @__PURE__ */ (0, import_jsx_runtim
|
|
|
1799
1969
|
}
|
|
1800
1970
|
)
|
|
1801
1971
|
] });
|
|
1802
|
-
var
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1972
|
+
var SheetHeader = ({ title }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "px-5 pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(RadixDialog2.Title, { className: "text-m-body-lg font-semibold tracking-tight", children: title }) });
|
|
1973
|
+
var DragHandle = () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex justify-center pt-3 pb-2", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "bg-border-strong h-1 w-9 rounded-full" }) });
|
|
1974
|
+
var Drawer = (0, import_react36.forwardRef)(function Drawer2({ side = "right", title, width = 420, height = "85vh", handle, children, ...rootProps }, ref) {
|
|
1975
|
+
const isBottom = side === "bottom";
|
|
1976
|
+
const showHandle = isBottom && (handle ?? true);
|
|
1977
|
+
const dimensionStyle = isBottom ? { height } : { width };
|
|
1978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogRoot, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(DialogPortal, { children: [
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogOverlay, {}),
|
|
1980
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1806
1981
|
RadixDialog2.Content,
|
|
1807
1982
|
{
|
|
1808
1983
|
ref,
|
|
1809
1984
|
"aria-describedby": void 0,
|
|
1810
1985
|
className: cn(
|
|
1811
|
-
"bg-panel z-modal fixed
|
|
1986
|
+
"bg-panel z-modal fixed flex flex-col shadow-lg outline-none",
|
|
1812
1987
|
sideClasses[side]
|
|
1813
1988
|
),
|
|
1814
|
-
style:
|
|
1989
|
+
style: dimensionStyle,
|
|
1815
1990
|
children: [
|
|
1816
|
-
|
|
1817
|
-
/* @__PURE__ */ (0,
|
|
1991
|
+
showHandle && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DragHandle, {}),
|
|
1992
|
+
title ? isBottom ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SheetHeader, { title }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DrawerHeader, { title }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(RadixDialog2.Title, { className: "sr-only", children: isBottom ? "Sheet" : "Drawer" }),
|
|
1993
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("flex-1 overflow-auto", isBottom ? "px-5 pb-6" : "p-5"), children })
|
|
1818
1994
|
]
|
|
1819
1995
|
}
|
|
1820
1996
|
)
|
|
@@ -1824,12 +2000,12 @@ Drawer.displayName = "Drawer";
|
|
|
1824
2000
|
|
|
1825
2001
|
// src/components/Dialog/Sheet.tsx
|
|
1826
2002
|
var RadixDialog3 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
1827
|
-
var
|
|
1828
|
-
var
|
|
1829
|
-
var Sheet = (0,
|
|
1830
|
-
return /* @__PURE__ */ (0,
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
2003
|
+
var import_react37 = require("react");
|
|
2004
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2005
|
+
var Sheet = (0, import_react37.forwardRef)(function Sheet2({ title, width = "min(640px, 90vw)", children, ...rootProps }, ref) {
|
|
2006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogRoot, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(DialogPortal, { children: [
|
|
2007
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogOverlay, {}),
|
|
2008
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1833
2009
|
RadixDialog3.Content,
|
|
1834
2010
|
{
|
|
1835
2011
|
ref,
|
|
@@ -1841,7 +2017,7 @@ var Sheet = (0, import_react36.forwardRef)(function Sheet2({ title, width = "min
|
|
|
1841
2017
|
),
|
|
1842
2018
|
style: { width },
|
|
1843
2019
|
children: [
|
|
1844
|
-
title ? /* @__PURE__ */ (0,
|
|
2020
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(RadixDialog3.Title, { className: "mb-1 text-[15px] font-medium", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(RadixDialog3.Title, { className: "sr-only", children: "Sheet" }),
|
|
1845
2021
|
children
|
|
1846
2022
|
]
|
|
1847
2023
|
}
|
|
@@ -1852,15 +2028,15 @@ Sheet.displayName = "Sheet";
|
|
|
1852
2028
|
|
|
1853
2029
|
// src/components/Dialog/AlertDialog.tsx
|
|
1854
2030
|
var RadixAlert = __toESM(require("@radix-ui/react-alert-dialog"), 1);
|
|
1855
|
-
var
|
|
1856
|
-
var
|
|
2031
|
+
var import_react38 = require("react");
|
|
2032
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1857
2033
|
var AlertDialogRoot = RadixAlert.Root;
|
|
1858
2034
|
var AlertDialogTrigger = RadixAlert.Trigger;
|
|
1859
2035
|
var AlertDialogAction = RadixAlert.Action;
|
|
1860
2036
|
var AlertDialogCancel = RadixAlert.Cancel;
|
|
1861
|
-
var AlertDialog = (0,
|
|
1862
|
-
return /* @__PURE__ */ (0,
|
|
1863
|
-
/* @__PURE__ */ (0,
|
|
2037
|
+
var AlertDialog = (0, import_react38.forwardRef)(function AlertDialog2({ title, description, footer, width = 460, children, ...rootProps }, ref) {
|
|
2038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AlertDialogRoot, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(RadixAlert.Portal, { children: [
|
|
2039
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1864
2040
|
RadixAlert.Overlay,
|
|
1865
2041
|
{
|
|
1866
2042
|
className: cn(
|
|
@@ -1869,7 +2045,7 @@ var AlertDialog = (0, import_react37.forwardRef)(function AlertDialog2({ title,
|
|
|
1869
2045
|
)
|
|
1870
2046
|
}
|
|
1871
2047
|
),
|
|
1872
|
-
/* @__PURE__ */ (0,
|
|
2048
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1873
2049
|
RadixAlert.Content,
|
|
1874
2050
|
{
|
|
1875
2051
|
ref,
|
|
@@ -1880,16 +2056,16 @@ var AlertDialog = (0, import_react37.forwardRef)(function AlertDialog2({ title,
|
|
|
1880
2056
|
"data-[state=open]:animate-[ship-dialog-in_180ms_var(--easing-out)]"
|
|
1881
2057
|
),
|
|
1882
2058
|
children: [
|
|
1883
|
-
/* @__PURE__ */ (0,
|
|
2059
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1884
2060
|
RadixAlert.Title,
|
|
1885
2061
|
{
|
|
1886
2062
|
className: cn("text-[16px] font-medium", description ? "mb-[6px]" : "mb-4"),
|
|
1887
2063
|
children: title
|
|
1888
2064
|
}
|
|
1889
2065
|
),
|
|
1890
|
-
description && /* @__PURE__ */ (0,
|
|
2066
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(RadixAlert.Description, { className: "text-text-muted mb-[18px] text-[13px] leading-[1.55]", children: description }),
|
|
1891
2067
|
children,
|
|
1892
|
-
footer && /* @__PURE__ */ (0,
|
|
2068
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
1893
2069
|
]
|
|
1894
2070
|
}
|
|
1895
2071
|
)
|
|
@@ -1899,17 +2075,17 @@ AlertDialog.displayName = "AlertDialog";
|
|
|
1899
2075
|
|
|
1900
2076
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1901
2077
|
var RadixMenu = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
1902
|
-
var
|
|
1903
|
-
var
|
|
2078
|
+
var import_react39 = require("react");
|
|
2079
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1904
2080
|
var DropdownMenuRoot = RadixMenu.Root;
|
|
1905
2081
|
var DropdownMenuTrigger = RadixMenu.Trigger;
|
|
1906
2082
|
var DropdownMenuPortal = RadixMenu.Portal;
|
|
1907
2083
|
var DropdownMenuGroup = RadixMenu.Group;
|
|
1908
2084
|
var DropdownMenuLabel = RadixMenu.Label;
|
|
1909
2085
|
var DropdownMenuRadioGroup = RadixMenu.RadioGroup;
|
|
1910
|
-
var DropdownMenuContent = (0,
|
|
2086
|
+
var DropdownMenuContent = (0, import_react39.forwardRef)(
|
|
1911
2087
|
function DropdownMenuContent2({ className, sideOffset = 6, align = "start", ...props }, ref) {
|
|
1912
|
-
return /* @__PURE__ */ (0,
|
|
2088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RadixMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1913
2089
|
RadixMenu.Content,
|
|
1914
2090
|
{
|
|
1915
2091
|
ref,
|
|
@@ -1931,32 +2107,32 @@ var itemBase2 = cn(
|
|
|
1931
2107
|
"data-[highlighted]:bg-panel-2",
|
|
1932
2108
|
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
1933
2109
|
);
|
|
1934
|
-
var MenuItem = (0,
|
|
1935
|
-
return /* @__PURE__ */ (0,
|
|
2110
|
+
var MenuItem = (0, import_react39.forwardRef)(function MenuItem2({ icon, trailing, destructive, className, children, ...props }, ref) {
|
|
2111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1936
2112
|
RadixMenu.Item,
|
|
1937
2113
|
{
|
|
1938
2114
|
ref,
|
|
1939
2115
|
className: cn(itemBase2, destructive ? "text-err" : "text-text", className),
|
|
1940
2116
|
...props,
|
|
1941
2117
|
children: [
|
|
1942
|
-
icon && /* @__PURE__ */ (0,
|
|
1943
|
-
/* @__PURE__ */ (0,
|
|
1944
|
-
trailing && /* @__PURE__ */ (0,
|
|
2118
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "w-[14px] text-[12px] opacity-70", children: icon }),
|
|
2119
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "flex-1", children }),
|
|
2120
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
1945
2121
|
]
|
|
1946
2122
|
}
|
|
1947
2123
|
);
|
|
1948
2124
|
});
|
|
1949
2125
|
MenuItem.displayName = "MenuItem";
|
|
1950
|
-
var MenuCheckboxItem = (0,
|
|
2126
|
+
var MenuCheckboxItem = (0, import_react39.forwardRef)(
|
|
1951
2127
|
function MenuCheckboxItem2({ className, children, ...props }, ref) {
|
|
1952
|
-
return /* @__PURE__ */ (0,
|
|
2128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1953
2129
|
RadixMenu.CheckboxItem,
|
|
1954
2130
|
{
|
|
1955
2131
|
ref,
|
|
1956
2132
|
className: cn(itemBase2, "text-text relative pl-[26px]", className),
|
|
1957
2133
|
...props,
|
|
1958
2134
|
children: [
|
|
1959
|
-
/* @__PURE__ */ (0,
|
|
2135
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RadixMenu.ItemIndicator, { className: "text-accent absolute top-1/2 left-2 -translate-y-1/2 text-[10px]", children: "\u2713" }),
|
|
1960
2136
|
children
|
|
1961
2137
|
]
|
|
1962
2138
|
}
|
|
@@ -1964,9 +2140,9 @@ var MenuCheckboxItem = (0, import_react38.forwardRef)(
|
|
|
1964
2140
|
}
|
|
1965
2141
|
);
|
|
1966
2142
|
MenuCheckboxItem.displayName = "MenuCheckboxItem";
|
|
1967
|
-
var MenuSeparator = (0,
|
|
2143
|
+
var MenuSeparator = (0, import_react39.forwardRef)(
|
|
1968
2144
|
function MenuSeparator2({ className, ...props }, ref) {
|
|
1969
|
-
return /* @__PURE__ */ (0,
|
|
2145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1970
2146
|
RadixMenu.Separator,
|
|
1971
2147
|
{
|
|
1972
2148
|
ref,
|
|
@@ -1981,14 +2157,14 @@ var DropdownMenu = RadixMenu.Root;
|
|
|
1981
2157
|
|
|
1982
2158
|
// src/components/HoverCard/HoverCard.tsx
|
|
1983
2159
|
var RadixHoverCard = __toESM(require("@radix-ui/react-hover-card"), 1);
|
|
1984
|
-
var
|
|
1985
|
-
var
|
|
2160
|
+
var import_react40 = require("react");
|
|
2161
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1986
2162
|
var HoverCardRoot = RadixHoverCard.Root;
|
|
1987
2163
|
var HoverCardTrigger = RadixHoverCard.Trigger;
|
|
1988
2164
|
var HoverCardPortal = RadixHoverCard.Portal;
|
|
1989
|
-
var HoverCardContent = (0,
|
|
2165
|
+
var HoverCardContent = (0, import_react40.forwardRef)(
|
|
1990
2166
|
function HoverCardContent2({ className, sideOffset = 4, ...props }, ref) {
|
|
1991
|
-
return /* @__PURE__ */ (0,
|
|
2167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RadixHoverCard.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1992
2168
|
RadixHoverCard.Content,
|
|
1993
2169
|
{
|
|
1994
2170
|
ref,
|
|
@@ -2005,25 +2181,25 @@ var HoverCardContent = (0, import_react39.forwardRef)(
|
|
|
2005
2181
|
);
|
|
2006
2182
|
HoverCardContent.displayName = "HoverCardContent";
|
|
2007
2183
|
function HoverCard({ trigger, content, ...rootProps }) {
|
|
2008
|
-
return /* @__PURE__ */ (0,
|
|
2009
|
-
/* @__PURE__ */ (0,
|
|
2010
|
-
/* @__PURE__ */ (0,
|
|
2184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(RadixHoverCard.Root, { openDelay: 200, closeDelay: 120, ...rootProps, children: [
|
|
2185
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RadixHoverCard.Trigger, { asChild: true, children: trigger }),
|
|
2186
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(HoverCardContent, { children: content })
|
|
2011
2187
|
] });
|
|
2012
2188
|
}
|
|
2013
2189
|
|
|
2014
2190
|
// src/components/Popover/Popover.tsx
|
|
2015
2191
|
var RadixPopover = __toESM(require("@radix-ui/react-popover"), 1);
|
|
2016
|
-
var
|
|
2017
|
-
var
|
|
2192
|
+
var import_react41 = require("react");
|
|
2193
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2018
2194
|
var PopoverRoot = RadixPopover.Root;
|
|
2019
2195
|
var PopoverTrigger = RadixPopover.Trigger;
|
|
2020
2196
|
var PopoverAnchor = RadixPopover.Anchor;
|
|
2021
2197
|
var PopoverPortal = RadixPopover.Portal;
|
|
2022
2198
|
var PopoverClose = RadixPopover.Close;
|
|
2023
2199
|
var PopoverArrow = RadixPopover.Arrow;
|
|
2024
|
-
var PopoverContent = (0,
|
|
2200
|
+
var PopoverContent = (0, import_react41.forwardRef)(
|
|
2025
2201
|
function PopoverContent2({ className, align = "start", sideOffset = 6, ...props }, ref) {
|
|
2026
|
-
return /* @__PURE__ */ (0,
|
|
2202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RadixPopover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2027
2203
|
RadixPopover.Content,
|
|
2028
2204
|
{
|
|
2029
2205
|
ref,
|
|
@@ -2044,9 +2220,9 @@ var Popover = RadixPopover.Root;
|
|
|
2044
2220
|
|
|
2045
2221
|
// src/components/Toast/Toast.tsx
|
|
2046
2222
|
var RadixToast = __toESM(require("@radix-ui/react-toast"), 1);
|
|
2047
|
-
var
|
|
2048
|
-
var
|
|
2049
|
-
var ToastContext = (0,
|
|
2223
|
+
var import_react42 = require("react");
|
|
2224
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2225
|
+
var ToastContext = (0, import_react42.createContext)(null);
|
|
2050
2226
|
var variantIcon = {
|
|
2051
2227
|
default: "\u25CF",
|
|
2052
2228
|
info: "\u2139",
|
|
@@ -2071,8 +2247,8 @@ var variantBorderLeft = {
|
|
|
2071
2247
|
var toastIdCounter = 0;
|
|
2072
2248
|
var nextToastId = () => `toast-${++toastIdCounter}`;
|
|
2073
2249
|
function ToastProvider({ children }) {
|
|
2074
|
-
const [toasts, setToasts] = (0,
|
|
2075
|
-
const toast = (0,
|
|
2250
|
+
const [toasts, setToasts] = (0, import_react42.useState)([]);
|
|
2251
|
+
const toast = (0, import_react42.useCallback)((t) => {
|
|
2076
2252
|
const explicitId = t.id;
|
|
2077
2253
|
const id = explicitId ?? nextToastId();
|
|
2078
2254
|
const entry = { ...t, id };
|
|
@@ -2084,24 +2260,24 @@ function ToastProvider({ children }) {
|
|
|
2084
2260
|
});
|
|
2085
2261
|
return id;
|
|
2086
2262
|
}, []);
|
|
2087
|
-
const dismiss = (0,
|
|
2263
|
+
const dismiss = (0, import_react42.useCallback)((id) => {
|
|
2088
2264
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
2089
2265
|
}, []);
|
|
2090
|
-
const value = (0,
|
|
2091
|
-
return /* @__PURE__ */ (0,
|
|
2266
|
+
const value = (0, import_react42.useMemo)(() => ({ toast, dismiss }), [toast, dismiss]);
|
|
2267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ToastContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(RadixToast.Provider, { swipeDirection: "right", children: [
|
|
2092
2268
|
children,
|
|
2093
|
-
toasts.map((t) => /* @__PURE__ */ (0,
|
|
2094
|
-
/* @__PURE__ */ (0,
|
|
2269
|
+
toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ToastCard, { toast: t, onDismiss: () => dismiss(t.id) }, t.id)),
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RadixToast.Viewport, { className: "z-toast fixed right-5 bottom-5 flex w-[380px] max-w-[calc(100vw-40px)] flex-col gap-2 outline-none" })
|
|
2095
2271
|
] }) });
|
|
2096
2272
|
}
|
|
2097
2273
|
function useToast() {
|
|
2098
|
-
const ctx = (0,
|
|
2274
|
+
const ctx = (0, import_react42.useContext)(ToastContext);
|
|
2099
2275
|
if (!ctx) throw new Error("useToast must be inside <ToastProvider>");
|
|
2100
2276
|
return ctx;
|
|
2101
2277
|
}
|
|
2102
|
-
var ToastCard = (0,
|
|
2278
|
+
var ToastCard = (0, import_react42.forwardRef)(function ToastCard2({ toast, onDismiss }, ref) {
|
|
2103
2279
|
const variant = toast.variant ?? "default";
|
|
2104
|
-
return /* @__PURE__ */ (0,
|
|
2280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2105
2281
|
RadixToast.Root,
|
|
2106
2282
|
{
|
|
2107
2283
|
ref,
|
|
@@ -2116,13 +2292,13 @@ var ToastCard = (0, import_react41.forwardRef)(function ToastCard2({ toast, onDi
|
|
|
2116
2292
|
variantBorderLeft[variant]
|
|
2117
2293
|
),
|
|
2118
2294
|
children: [
|
|
2119
|
-
/* @__PURE__ */ (0,
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
2121
|
-
/* @__PURE__ */ (0,
|
|
2122
|
-
toast.description && /* @__PURE__ */ (0,
|
|
2123
|
-
toast.action && /* @__PURE__ */ (0,
|
|
2295
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: cn("mt-px text-[14px] leading-none", variantTextColor[variant]), children: variantIcon[variant] }),
|
|
2296
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2297
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RadixToast.Title, { className: "text-text text-[13px] font-medium", children: toast.title }),
|
|
2298
|
+
toast.description && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RadixToast.Description, { className: "text-text-muted mt-[2px] text-[12px] leading-[1.5]", children: toast.description }),
|
|
2299
|
+
toast.action && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "mt-2", children: toast.action })
|
|
2124
2300
|
] }),
|
|
2125
|
-
/* @__PURE__ */ (0,
|
|
2301
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2126
2302
|
RadixToast.Close,
|
|
2127
2303
|
{
|
|
2128
2304
|
"aria-label": "Dismiss",
|
|
@@ -2138,16 +2314,16 @@ ToastCard.displayName = "ToastCard";
|
|
|
2138
2314
|
|
|
2139
2315
|
// src/components/Tooltip/Tooltip.tsx
|
|
2140
2316
|
var RadixTooltip = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
2141
|
-
var
|
|
2142
|
-
var
|
|
2317
|
+
var import_react43 = require("react");
|
|
2318
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2143
2319
|
var TooltipProvider = RadixTooltip.Provider;
|
|
2144
2320
|
var TooltipRoot = RadixTooltip.Root;
|
|
2145
2321
|
var TooltipTrigger = RadixTooltip.Trigger;
|
|
2146
2322
|
var TooltipPortal = RadixTooltip.Portal;
|
|
2147
2323
|
var TooltipArrow = RadixTooltip.Arrow;
|
|
2148
|
-
var TooltipContent = (0,
|
|
2324
|
+
var TooltipContent = (0, import_react43.forwardRef)(
|
|
2149
2325
|
function TooltipContent2({ className, sideOffset = 6, ...props }, ref) {
|
|
2150
|
-
return /* @__PURE__ */ (0,
|
|
2326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixTooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2151
2327
|
RadixTooltip.Content,
|
|
2152
2328
|
{
|
|
2153
2329
|
ref,
|
|
@@ -2165,16 +2341,16 @@ var TooltipContent = (0, import_react42.forwardRef)(
|
|
|
2165
2341
|
);
|
|
2166
2342
|
TooltipContent.displayName = "TooltipContent";
|
|
2167
2343
|
function Tooltip({ content, children, side = "top", delayDuration = 400 }) {
|
|
2168
|
-
return /* @__PURE__ */ (0,
|
|
2169
|
-
/* @__PURE__ */ (0,
|
|
2170
|
-
/* @__PURE__ */ (0,
|
|
2344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipProvider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(TooltipRoot, { children: [
|
|
2345
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipTrigger, { asChild: true, children }),
|
|
2346
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipContent, { side, children: content })
|
|
2171
2347
|
] }) });
|
|
2172
2348
|
}
|
|
2173
2349
|
|
|
2174
2350
|
// src/patterns/Alert/Alert.tsx
|
|
2175
2351
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
2176
|
-
var
|
|
2177
|
-
var
|
|
2352
|
+
var import_react44 = require("react");
|
|
2353
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2178
2354
|
var alertStyles = (0, import_class_variance_authority8.cva)("flex items-start gap-3 rounded-base border bg-panel p-3 text-[13px]", {
|
|
2179
2355
|
variants: {
|
|
2180
2356
|
tone: {
|
|
@@ -2198,7 +2374,7 @@ var defaultGlyph = {
|
|
|
2198
2374
|
warn: "!",
|
|
2199
2375
|
err: "\xD7"
|
|
2200
2376
|
};
|
|
2201
|
-
var Alert = (0,
|
|
2377
|
+
var Alert = (0, import_react44.forwardRef)(function Alert2({
|
|
2202
2378
|
tone = "accent",
|
|
2203
2379
|
title,
|
|
2204
2380
|
description,
|
|
@@ -2210,7 +2386,7 @@ var Alert = (0, import_react43.forwardRef)(function Alert2({
|
|
|
2210
2386
|
...props
|
|
2211
2387
|
}, ref) {
|
|
2212
2388
|
const t = tone ?? "accent";
|
|
2213
|
-
return /* @__PURE__ */ (0,
|
|
2389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2214
2390
|
"div",
|
|
2215
2391
|
{
|
|
2216
2392
|
ref,
|
|
@@ -2219,13 +2395,13 @@ var Alert = (0, import_react43.forwardRef)(function Alert2({
|
|
|
2219
2395
|
className: cn(alertStyles({ tone }), className),
|
|
2220
2396
|
...props,
|
|
2221
2397
|
children: [
|
|
2222
|
-
/* @__PURE__ */ (0,
|
|
2223
|
-
/* @__PURE__ */ (0,
|
|
2224
|
-
title && /* @__PURE__ */ (0,
|
|
2225
|
-
description && /* @__PURE__ */ (0,
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { "aria-hidden": true, className: cn("mt-[1px] text-[14px] leading-none", iconColorClass[t]), children: icon ?? defaultGlyph[t] }),
|
|
2399
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2400
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "font-medium", children: title }),
|
|
2401
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "text-text-muted mt-[2px] text-[12px]", children: description }),
|
|
2226
2402
|
children
|
|
2227
2403
|
] }),
|
|
2228
|
-
action && /* @__PURE__ */ (0,
|
|
2404
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ml-1 shrink-0", children: action })
|
|
2229
2405
|
]
|
|
2230
2406
|
}
|
|
2231
2407
|
);
|
|
@@ -2234,8 +2410,8 @@ Alert.displayName = "Alert";
|
|
|
2234
2410
|
|
|
2235
2411
|
// src/patterns/Banner/Banner.tsx
|
|
2236
2412
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
2237
|
-
var
|
|
2238
|
-
var
|
|
2413
|
+
var import_react45 = require("react");
|
|
2414
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2239
2415
|
var bannerStyles = (0, import_class_variance_authority9.cva)(
|
|
2240
2416
|
"flex items-center gap-3 border-b border-border px-[14px] py-2 text-[12px]",
|
|
2241
2417
|
{
|
|
@@ -2260,9 +2436,9 @@ var defaultGlyph2 = {
|
|
|
2260
2436
|
warn: "!",
|
|
2261
2437
|
err: "\xD7"
|
|
2262
2438
|
};
|
|
2263
|
-
var Banner = (0,
|
|
2439
|
+
var Banner = (0, import_react45.forwardRef)(function Banner2({ tone = "accent", sticky, icon, action, live = "polite", className, children, ...props }, ref) {
|
|
2264
2440
|
const t = tone ?? "accent";
|
|
2265
|
-
return /* @__PURE__ */ (0,
|
|
2441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2266
2442
|
"div",
|
|
2267
2443
|
{
|
|
2268
2444
|
ref,
|
|
@@ -2271,9 +2447,9 @@ var Banner = (0, import_react44.forwardRef)(function Banner2({ tone = "accent",
|
|
|
2271
2447
|
className: cn(bannerStyles({ tone, sticky }), className),
|
|
2272
2448
|
...props,
|
|
2273
2449
|
children: [
|
|
2274
|
-
/* @__PURE__ */ (0,
|
|
2275
|
-
/* @__PURE__ */ (0,
|
|
2276
|
-
action && /* @__PURE__ */ (0,
|
|
2450
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { "aria-hidden": true, className: "leading-none", children: icon ?? defaultGlyph2[t] }),
|
|
2451
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "min-w-0 flex-1", children }),
|
|
2452
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ml-auto", children: action })
|
|
2277
2453
|
]
|
|
2278
2454
|
}
|
|
2279
2455
|
);
|
|
@@ -2281,28 +2457,28 @@ var Banner = (0, import_react44.forwardRef)(function Banner2({ tone = "accent",
|
|
|
2281
2457
|
Banner.displayName = "Banner";
|
|
2282
2458
|
|
|
2283
2459
|
// src/patterns/Breadcrumbs/Breadcrumbs.tsx
|
|
2284
|
-
var
|
|
2285
|
-
var
|
|
2286
|
-
var Breadcrumbs = (0,
|
|
2287
|
-
const crumbs =
|
|
2460
|
+
var import_react46 = require("react");
|
|
2461
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2462
|
+
var Breadcrumbs = (0, import_react46.forwardRef)(function Breadcrumbs2({ separator = "/", className, children, ...props }, ref) {
|
|
2463
|
+
const crumbs = import_react46.Children.toArray(children).filter(import_react46.isValidElement);
|
|
2288
2464
|
const last = crumbs.length - 1;
|
|
2289
|
-
return /* @__PURE__ */ (0,
|
|
2465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("nav", { ref, "aria-label": "Breadcrumb", className: cn("text-[13px]", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("ol", { className: "text-text-muted flex flex-wrap items-center gap-[6px]", children: crumbs.map((crumb, i) => {
|
|
2290
2466
|
const isCurrent = i === last;
|
|
2291
|
-
return /* @__PURE__ */ (0,
|
|
2292
|
-
isCurrent ? /* @__PURE__ */ (0,
|
|
2293
|
-
!isCurrent && /* @__PURE__ */ (0,
|
|
2467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("li", { className: "inline-flex items-center gap-[6px]", children: [
|
|
2468
|
+
isCurrent ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Crumb, { ...crumb.props, current: true }) : crumb,
|
|
2469
|
+
!isCurrent && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { "aria-hidden": true, className: "text-text-dim", children: separator })
|
|
2294
2470
|
] }, i);
|
|
2295
2471
|
}) }) });
|
|
2296
2472
|
});
|
|
2297
2473
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
2298
|
-
var Crumb = (0,
|
|
2474
|
+
var Crumb = (0, import_react46.forwardRef)(function Crumb2({ current, className, href, children, ...props }, ref) {
|
|
2299
2475
|
if (current) {
|
|
2300
|
-
return /* @__PURE__ */ (0,
|
|
2476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { "aria-current": "page", className: cn("text-text", className), children });
|
|
2301
2477
|
}
|
|
2302
2478
|
if (href === void 0) {
|
|
2303
|
-
return /* @__PURE__ */ (0,
|
|
2479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: cn("text-text-dim", className), children });
|
|
2304
2480
|
}
|
|
2305
|
-
return /* @__PURE__ */ (0,
|
|
2481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2306
2482
|
"a",
|
|
2307
2483
|
{
|
|
2308
2484
|
ref,
|
|
@@ -2316,8 +2492,8 @@ var Crumb = (0, import_react45.forwardRef)(function Crumb2({ current, className,
|
|
|
2316
2492
|
Crumb.displayName = "Crumb";
|
|
2317
2493
|
|
|
2318
2494
|
// src/patterns/Combobox/Combobox.tsx
|
|
2319
|
-
var
|
|
2320
|
-
var
|
|
2495
|
+
var import_react47 = require("react");
|
|
2496
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2321
2497
|
function normalize(option) {
|
|
2322
2498
|
if (typeof option === "string") {
|
|
2323
2499
|
return { value: option, label: option, searchText: option.toLowerCase() };
|
|
@@ -2333,7 +2509,7 @@ function normalize(option) {
|
|
|
2333
2509
|
};
|
|
2334
2510
|
}
|
|
2335
2511
|
var defaultFilter = (option, query) => option.searchText.includes(query.toLowerCase());
|
|
2336
|
-
var Combobox = (0,
|
|
2512
|
+
var Combobox = (0, import_react47.forwardRef)(function Combobox2({
|
|
2337
2513
|
options,
|
|
2338
2514
|
value: valueProp,
|
|
2339
2515
|
defaultValue,
|
|
@@ -2350,16 +2526,16 @@ var Combobox = (0, import_react46.forwardRef)(function Combobox2({
|
|
|
2350
2526
|
id,
|
|
2351
2527
|
"aria-label": ariaLabel
|
|
2352
2528
|
}, ref) {
|
|
2353
|
-
const reactId = (0,
|
|
2529
|
+
const reactId = (0, import_react47.useId)();
|
|
2354
2530
|
const listboxId = `${id ?? reactId}-listbox`;
|
|
2355
2531
|
const inputId = id ?? `${reactId}-input`;
|
|
2356
|
-
const normalized = (0,
|
|
2532
|
+
const normalized = (0, import_react47.useMemo)(() => options.map(normalize), [options]);
|
|
2357
2533
|
const [value, setValue] = useControllableState({
|
|
2358
2534
|
value: valueProp,
|
|
2359
2535
|
defaultValue,
|
|
2360
2536
|
onChange: onValueChange
|
|
2361
2537
|
});
|
|
2362
|
-
const initialQuery = (0,
|
|
2538
|
+
const initialQuery = (0, import_react47.useMemo)(() => {
|
|
2363
2539
|
if (defaultQuery !== void 0) return defaultQuery;
|
|
2364
2540
|
if (defaultValue !== void 0) {
|
|
2365
2541
|
const opt = normalized.find((o) => o.value === defaultValue);
|
|
@@ -2372,10 +2548,10 @@ var Combobox = (0, import_react46.forwardRef)(function Combobox2({
|
|
|
2372
2548
|
defaultValue: initialQuery,
|
|
2373
2549
|
onChange: onQueryChange
|
|
2374
2550
|
});
|
|
2375
|
-
const [open, setOpen] = (0,
|
|
2376
|
-
const wrapperRef = (0,
|
|
2551
|
+
const [open, setOpen] = (0, import_react47.useState)(false);
|
|
2552
|
+
const wrapperRef = (0, import_react47.useRef)(null);
|
|
2377
2553
|
useOutsideClick(wrapperRef, () => setOpen(false));
|
|
2378
|
-
const filtered = (0,
|
|
2554
|
+
const filtered = (0, import_react47.useMemo)(
|
|
2379
2555
|
() => query ? normalized.filter((o) => filter(o, query)) : normalized,
|
|
2380
2556
|
[normalized, query, filter]
|
|
2381
2557
|
);
|
|
@@ -2387,7 +2563,7 @@ var Combobox = (0, import_react46.forwardRef)(function Combobox2({
|
|
|
2387
2563
|
if (item && !item.disabled) commit(item);
|
|
2388
2564
|
}
|
|
2389
2565
|
});
|
|
2390
|
-
(0,
|
|
2566
|
+
(0, import_react47.useEffect)(() => {
|
|
2391
2567
|
setCursor(0);
|
|
2392
2568
|
}, [query, setCursor]);
|
|
2393
2569
|
function commit(option) {
|
|
@@ -2410,8 +2586,8 @@ var Combobox = (0, import_react46.forwardRef)(function Combobox2({
|
|
|
2410
2586
|
setOpen(false);
|
|
2411
2587
|
}
|
|
2412
2588
|
};
|
|
2413
|
-
return /* @__PURE__ */ (0,
|
|
2414
|
-
/* @__PURE__ */ (0,
|
|
2589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { ref: wrapperRef, className: "relative", style: { width }, children: [
|
|
2590
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2415
2591
|
"input",
|
|
2416
2592
|
{
|
|
2417
2593
|
ref,
|
|
@@ -2445,7 +2621,7 @@ var Combobox = (0, import_react46.forwardRef)(function Combobox2({
|
|
|
2445
2621
|
)
|
|
2446
2622
|
}
|
|
2447
2623
|
),
|
|
2448
|
-
open && /* @__PURE__ */ (0,
|
|
2624
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2449
2625
|
"ul",
|
|
2450
2626
|
{
|
|
2451
2627
|
id: listboxId,
|
|
@@ -2455,9 +2631,9 @@ var Combobox = (0, import_react46.forwardRef)(function Combobox2({
|
|
|
2455
2631
|
"z-dropdown absolute top-full right-0 left-0 mt-1 max-h-[220px] overflow-auto",
|
|
2456
2632
|
"border-border bg-panel rounded-md border p-1 shadow-lg"
|
|
2457
2633
|
),
|
|
2458
|
-
children: filtered.length === 0 ? /* @__PURE__ */ (0,
|
|
2634
|
+
children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("li", { className: "text-text-dim px-2 py-3 text-center text-[12px]", role: "presentation", children: emptyState ?? "No matches" }) : filtered.map((option, i) => {
|
|
2459
2635
|
const isActive = i === cursor;
|
|
2460
|
-
return /* @__PURE__ */ (0,
|
|
2636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2461
2637
|
"li",
|
|
2462
2638
|
{
|
|
2463
2639
|
id: `${listboxId}-option-${i}`,
|
|
@@ -2475,8 +2651,8 @@ var Combobox = (0, import_react46.forwardRef)(function Combobox2({
|
|
|
2475
2651
|
option.disabled && "pointer-events-none opacity-40"
|
|
2476
2652
|
),
|
|
2477
2653
|
children: [
|
|
2478
|
-
/* @__PURE__ */ (0,
|
|
2479
|
-
option.description && /* @__PURE__ */ (0,
|
|
2654
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: option.label }),
|
|
2655
|
+
option.description && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "text-text-dim text-[11px]", children: option.description })
|
|
2480
2656
|
]
|
|
2481
2657
|
},
|
|
2482
2658
|
option.value
|
|
@@ -2484,19 +2660,19 @@ var Combobox = (0, import_react46.forwardRef)(function Combobox2({
|
|
|
2484
2660
|
})
|
|
2485
2661
|
}
|
|
2486
2662
|
),
|
|
2487
|
-
name && /* @__PURE__ */ (0,
|
|
2663
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("input", { type: "hidden", name, value: value ?? "", readOnly: true })
|
|
2488
2664
|
] });
|
|
2489
2665
|
});
|
|
2490
2666
|
Combobox.displayName = "Combobox";
|
|
2491
2667
|
|
|
2492
2668
|
// src/patterns/CommandPalette/CommandPalette.tsx
|
|
2493
2669
|
var RadixDialog4 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
2494
|
-
var
|
|
2495
|
-
var
|
|
2670
|
+
var import_react48 = require("react");
|
|
2671
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2496
2672
|
function flatItems(groups) {
|
|
2497
2673
|
return groups.flatMap((g) => g.items);
|
|
2498
2674
|
}
|
|
2499
|
-
var CommandPalette = (0,
|
|
2675
|
+
var CommandPalette = (0, import_react48.forwardRef)(
|
|
2500
2676
|
function CommandPalette2({
|
|
2501
2677
|
open,
|
|
2502
2678
|
onOpenChange,
|
|
@@ -2509,7 +2685,7 @@ var CommandPalette = (0, import_react47.forwardRef)(
|
|
|
2509
2685
|
emptyState,
|
|
2510
2686
|
width = 540
|
|
2511
2687
|
}, ref) {
|
|
2512
|
-
const flat = (0,
|
|
2688
|
+
const flat = (0, import_react48.useMemo)(() => flatItems(groups), [groups]);
|
|
2513
2689
|
const { cursor, setCursor, onKeyDown } = useKeyboardList({
|
|
2514
2690
|
count: flat.length,
|
|
2515
2691
|
defaultCursor: 0,
|
|
@@ -2518,15 +2694,15 @@ var CommandPalette = (0, import_react47.forwardRef)(
|
|
|
2518
2694
|
if (item) onSelect(item.id);
|
|
2519
2695
|
}
|
|
2520
2696
|
});
|
|
2521
|
-
const reactId = (0,
|
|
2697
|
+
const reactId = (0, import_react48.useId)();
|
|
2522
2698
|
const listboxId = `${reactId}-listbox`;
|
|
2523
2699
|
const optionId = (i) => `${listboxId}-option-${i}`;
|
|
2524
2700
|
const hasMatches = flat.length > 0;
|
|
2525
|
-
(0,
|
|
2701
|
+
(0, import_react48.useEffect)(() => {
|
|
2526
2702
|
setCursor(0);
|
|
2527
2703
|
}, [query, groups, setCursor]);
|
|
2528
|
-
return /* @__PURE__ */ (0,
|
|
2529
|
-
/* @__PURE__ */ (0,
|
|
2704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(RadixDialog4.Root, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(RadixDialog4.Portal, { children: [
|
|
2705
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2530
2706
|
RadixDialog4.Overlay,
|
|
2531
2707
|
{
|
|
2532
2708
|
className: cn(
|
|
@@ -2535,7 +2711,7 @@ var CommandPalette = (0, import_react47.forwardRef)(
|
|
|
2535
2711
|
)
|
|
2536
2712
|
}
|
|
2537
2713
|
),
|
|
2538
|
-
/* @__PURE__ */ (0,
|
|
2714
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2539
2715
|
RadixDialog4.Content,
|
|
2540
2716
|
{
|
|
2541
2717
|
ref,
|
|
@@ -2549,10 +2725,10 @@ var CommandPalette = (0, import_react47.forwardRef)(
|
|
|
2549
2725
|
),
|
|
2550
2726
|
onKeyDown,
|
|
2551
2727
|
children: [
|
|
2552
|
-
/* @__PURE__ */ (0,
|
|
2553
|
-
/* @__PURE__ */ (0,
|
|
2554
|
-
/* @__PURE__ */ (0,
|
|
2555
|
-
/* @__PURE__ */ (0,
|
|
2728
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(RadixDialog4.Title, { className: "sr-only", children: "Command palette" }),
|
|
2729
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "border-border flex items-center gap-[10px] border-b px-4 py-[14px]", children: [
|
|
2730
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { "aria-hidden": true, className: "text-text-dim", children: "\u2315" }),
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2556
2732
|
"input",
|
|
2557
2733
|
{
|
|
2558
2734
|
autoFocus: true,
|
|
@@ -2569,9 +2745,9 @@ var CommandPalette = (0, import_react47.forwardRef)(
|
|
|
2569
2745
|
className: "text-text placeholder:text-text-dim flex-1 border-0 bg-transparent text-[14px] outline-none"
|
|
2570
2746
|
}
|
|
2571
2747
|
),
|
|
2572
|
-
/* @__PURE__ */ (0,
|
|
2748
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "border-border text-text-dim rounded-xs border px-[6px] py-[2px] font-mono text-[10px]", children: "ESC" })
|
|
2573
2749
|
] }),
|
|
2574
|
-
/* @__PURE__ */ (0,
|
|
2750
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { id: listboxId, className: "min-h-[220px] p-2", role: "listbox", "aria-label": "Results", children: flat.length === 0 ? emptyState ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "text-text-dim px-3 py-5 text-center text-[12px]", children: "No matches" }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2575
2751
|
CommandGroups,
|
|
2576
2752
|
{
|
|
2577
2753
|
groups,
|
|
@@ -2581,7 +2757,7 @@ var CommandPalette = (0, import_react47.forwardRef)(
|
|
|
2581
2757
|
optionId
|
|
2582
2758
|
}
|
|
2583
2759
|
) }),
|
|
2584
|
-
footer && /* @__PURE__ */ (0,
|
|
2760
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "border-border text-text-dim flex gap-4 border-t px-[14px] py-[10px] font-mono text-[10px]", children: footer })
|
|
2585
2761
|
]
|
|
2586
2762
|
}
|
|
2587
2763
|
)
|
|
@@ -2591,10 +2767,10 @@ var CommandPalette = (0, import_react47.forwardRef)(
|
|
|
2591
2767
|
CommandPalette.displayName = "CommandPalette";
|
|
2592
2768
|
function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
2593
2769
|
let runningIndex = 0;
|
|
2594
|
-
return /* @__PURE__ */ (0,
|
|
2770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: groups.map((group, gIdx) => {
|
|
2595
2771
|
if (group.items.length === 0) return null;
|
|
2596
|
-
return /* @__PURE__ */ (0,
|
|
2597
|
-
group.label && /* @__PURE__ */ (0,
|
|
2772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
2773
|
+
group.label && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "text-text-dim px-2 pt-2 pb-1 font-mono text-[9px] tracking-[1.4px] uppercase", children: [
|
|
2598
2774
|
group.label,
|
|
2599
2775
|
" \xB7 ",
|
|
2600
2776
|
group.items.length
|
|
@@ -2602,7 +2778,7 @@ function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
|
2602
2778
|
group.items.map((item) => {
|
|
2603
2779
|
const myIndex = runningIndex++;
|
|
2604
2780
|
const isActive = cursor === myIndex;
|
|
2605
|
-
return /* @__PURE__ */ (0,
|
|
2781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2606
2782
|
"button",
|
|
2607
2783
|
{
|
|
2608
2784
|
id: optionId(myIndex),
|
|
@@ -2616,7 +2792,7 @@ function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
|
2616
2792
|
isActive ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2"
|
|
2617
2793
|
),
|
|
2618
2794
|
children: [
|
|
2619
|
-
item.glyph != null && /* @__PURE__ */ (0,
|
|
2795
|
+
item.glyph != null && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2620
2796
|
"span",
|
|
2621
2797
|
{
|
|
2622
2798
|
"aria-hidden": true,
|
|
@@ -2627,11 +2803,11 @@ function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
|
2627
2803
|
children: item.glyph
|
|
2628
2804
|
}
|
|
2629
2805
|
),
|
|
2630
|
-
/* @__PURE__ */ (0,
|
|
2631
|
-
/* @__PURE__ */ (0,
|
|
2632
|
-
item.description && /* @__PURE__ */ (0,
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "block truncate text-[13px]", children: item.label }),
|
|
2808
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-text-dim block truncate text-[11px]", children: item.description })
|
|
2633
2809
|
] }),
|
|
2634
|
-
item.trailing && /* @__PURE__ */ (0,
|
|
2810
|
+
item.trailing && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-text-dim font-mono text-[10px]", children: item.trailing })
|
|
2635
2811
|
]
|
|
2636
2812
|
},
|
|
2637
2813
|
item.id
|
|
@@ -2653,8 +2829,8 @@ function filterCommandItems(query, groups) {
|
|
|
2653
2829
|
}
|
|
2654
2830
|
|
|
2655
2831
|
// src/patterns/DataTable/DataTable.tsx
|
|
2656
|
-
var
|
|
2657
|
-
var
|
|
2832
|
+
var import_react49 = require("react");
|
|
2833
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2658
2834
|
var alignClass = {
|
|
2659
2835
|
left: "text-left",
|
|
2660
2836
|
right: "text-right",
|
|
@@ -2689,12 +2865,12 @@ function DataTable(props) {
|
|
|
2689
2865
|
defaultValue: new Set(defaultSelected ?? []),
|
|
2690
2866
|
onChange: onSelectionChange
|
|
2691
2867
|
});
|
|
2692
|
-
const sortableMap = (0,
|
|
2868
|
+
const sortableMap = (0, import_react49.useMemo)(() => {
|
|
2693
2869
|
const m = /* @__PURE__ */ new Map();
|
|
2694
2870
|
for (const c of columns) if (c.accessor) m.set(c.key, c);
|
|
2695
2871
|
return m;
|
|
2696
2872
|
}, [columns]);
|
|
2697
|
-
const sortedData = (0,
|
|
2873
|
+
const sortedData = (0, import_react49.useMemo)(() => {
|
|
2698
2874
|
if (!sort) return [...data];
|
|
2699
2875
|
const col = sortableMap.get(sort.key);
|
|
2700
2876
|
if (!col || !col.accessor) return [...data];
|
|
@@ -2706,12 +2882,12 @@ function DataTable(props) {
|
|
|
2706
2882
|
return String(av).localeCompare(String(bv)) * factor;
|
|
2707
2883
|
});
|
|
2708
2884
|
}, [data, sort, sortableMap]);
|
|
2709
|
-
const allIds = (0,
|
|
2885
|
+
const allIds = (0, import_react49.useMemo)(() => sortedData.map(rowKey), [sortedData, rowKey]);
|
|
2710
2886
|
const selectedSet = selected ?? EMPTY_SET;
|
|
2711
2887
|
const allSelected = allIds.length > 0 && allIds.every((id) => selectedSet.has(id));
|
|
2712
2888
|
const someSelected = !allSelected && allIds.some((id) => selectedSet.has(id));
|
|
2713
|
-
const headerCheckRef = (0,
|
|
2714
|
-
(0,
|
|
2889
|
+
const headerCheckRef = (0, import_react49.useRef)(null);
|
|
2890
|
+
(0, import_react49.useEffect)(() => {
|
|
2715
2891
|
if (headerCheckRef.current) headerCheckRef.current.indeterminate = someSelected;
|
|
2716
2892
|
}, [someSelected]);
|
|
2717
2893
|
const toggleSort = (key) => {
|
|
@@ -2742,10 +2918,10 @@ function DataTable(props) {
|
|
|
2742
2918
|
return next;
|
|
2743
2919
|
});
|
|
2744
2920
|
};
|
|
2745
|
-
return /* @__PURE__ */ (0,
|
|
2746
|
-
caption && /* @__PURE__ */ (0,
|
|
2747
|
-
/* @__PURE__ */ (0,
|
|
2748
|
-
selectable && /* @__PURE__ */ (0,
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("table", { ref, className: cn("w-full border-collapse text-[12px]", className), children: [
|
|
2922
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("caption", { className: "sr-only", children: caption }),
|
|
2923
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("thead", { className: cn("bg-panel-2", stickyHeader && "z-raised sticky top-0"), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("tr", { children: [
|
|
2924
|
+
selectable && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("th", { scope: "col", className: "border-border w-8 border-b px-3 py-2 text-left", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2749
2925
|
"input",
|
|
2750
2926
|
{
|
|
2751
2927
|
ref: headerCheckRef,
|
|
@@ -2761,8 +2937,8 @@ function DataTable(props) {
|
|
|
2761
2937
|
const isSorted = sort?.key === col.key;
|
|
2762
2938
|
const ariaSort = !sortable ? void 0 : isSorted ? sort?.direction === "asc" ? "ascending" : "descending" : "none";
|
|
2763
2939
|
const align = col.align ?? "left";
|
|
2764
|
-
const indicator = sortable && isSorted && /* @__PURE__ */ (0,
|
|
2765
|
-
return /* @__PURE__ */ (0,
|
|
2940
|
+
const indicator = sortable && isSorted && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { "aria-hidden": true, className: "ml-1", children: sort?.direction === "asc" ? "\u2191" : "\u2193" });
|
|
2941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2766
2942
|
"th",
|
|
2767
2943
|
{
|
|
2768
2944
|
scope: "col",
|
|
@@ -2774,7 +2950,7 @@ function DataTable(props) {
|
|
|
2774
2950
|
sortable && "cursor-pointer",
|
|
2775
2951
|
isSorted ? "text-accent" : "text-text-dim"
|
|
2776
2952
|
),
|
|
2777
|
-
children: sortable ? /* @__PURE__ */ (0,
|
|
2953
|
+
children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2778
2954
|
"button",
|
|
2779
2955
|
{
|
|
2780
2956
|
type: "button",
|
|
@@ -2791,8 +2967,8 @@ function DataTable(props) {
|
|
|
2791
2967
|
);
|
|
2792
2968
|
})
|
|
2793
2969
|
] }) }),
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2795
|
-
sortedData.length === 0 && /* @__PURE__ */ (0,
|
|
2970
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("tbody", { children: [
|
|
2971
|
+
sortedData.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2796
2972
|
"td",
|
|
2797
2973
|
{
|
|
2798
2974
|
colSpan: columns.length + (selectable ? 1 : 0),
|
|
@@ -2803,7 +2979,7 @@ function DataTable(props) {
|
|
|
2803
2979
|
sortedData.map((row) => {
|
|
2804
2980
|
const id = rowKey(row);
|
|
2805
2981
|
const isSelected = selectedSet.has(id);
|
|
2806
|
-
return /* @__PURE__ */ (0,
|
|
2982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2807
2983
|
"tr",
|
|
2808
2984
|
{
|
|
2809
2985
|
"data-state": isSelected ? "selected" : void 0,
|
|
@@ -2812,7 +2988,7 @@ function DataTable(props) {
|
|
|
2812
2988
|
isSelected ? "bg-accent-dim/50" : "hover:bg-panel-2"
|
|
2813
2989
|
),
|
|
2814
2990
|
children: [
|
|
2815
|
-
selectable && /* @__PURE__ */ (0,
|
|
2991
|
+
selectable && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-3 py-[10px]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2816
2992
|
"input",
|
|
2817
2993
|
{
|
|
2818
2994
|
type: "checkbox",
|
|
@@ -2822,7 +2998,7 @@ function DataTable(props) {
|
|
|
2822
2998
|
className: "cursor-pointer accent-[var(--color-accent)]"
|
|
2823
2999
|
}
|
|
2824
3000
|
) }),
|
|
2825
|
-
columns.map((col) => /* @__PURE__ */ (0,
|
|
3001
|
+
columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: cn("px-3 py-[10px]", alignClass[col.align ?? "left"]), children: col.cell ? col.cell(row) : col.accessor ? String(col.accessor(row)) : null }, col.key))
|
|
2826
3002
|
]
|
|
2827
3003
|
},
|
|
2828
3004
|
id
|
|
@@ -2833,8 +3009,8 @@ function DataTable(props) {
|
|
|
2833
3009
|
}
|
|
2834
3010
|
|
|
2835
3011
|
// src/patterns/DatePicker/Calendar.tsx
|
|
2836
|
-
var
|
|
2837
|
-
var
|
|
3012
|
+
var import_react50 = require("react");
|
|
3013
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2838
3014
|
var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
2839
3015
|
var DAYS = ["S", "M", "T", "W", "T", "F", "S"];
|
|
2840
3016
|
function isSameDay(a, b) {
|
|
@@ -2845,7 +3021,7 @@ function clampDay(year, month, day) {
|
|
|
2845
3021
|
const max = new Date(year, month + 1, 0).getDate();
|
|
2846
3022
|
return Math.min(Math.max(1, day), max);
|
|
2847
3023
|
}
|
|
2848
|
-
var Calendar = (0,
|
|
3024
|
+
var Calendar = (0, import_react50.forwardRef)(function Calendar2({
|
|
2849
3025
|
value,
|
|
2850
3026
|
defaultValue,
|
|
2851
3027
|
onValueChange,
|
|
@@ -2858,9 +3034,9 @@ var Calendar = (0, import_react49.forwardRef)(function Calendar2({
|
|
|
2858
3034
|
className,
|
|
2859
3035
|
...props
|
|
2860
3036
|
}, ref) {
|
|
2861
|
-
const [today] = (0,
|
|
2862
|
-
const [hydrated, setHydrated] = (0,
|
|
2863
|
-
(0,
|
|
3037
|
+
const [today] = (0, import_react50.useState)(() => /* @__PURE__ */ new Date());
|
|
3038
|
+
const [hydrated, setHydrated] = (0, import_react50.useState)(false);
|
|
3039
|
+
(0, import_react50.useEffect)(() => setHydrated(true), []);
|
|
2864
3040
|
const [selectedDate, setSelectedDate] = useControllableState({
|
|
2865
3041
|
value,
|
|
2866
3042
|
defaultValue,
|
|
@@ -2868,12 +3044,12 @@ var Calendar = (0, import_react49.forwardRef)(function Calendar2({
|
|
|
2868
3044
|
});
|
|
2869
3045
|
const initialMonth = defaultMonth ?? defaultValue?.getMonth() ?? today.getMonth();
|
|
2870
3046
|
const initialYear = defaultYear ?? defaultValue?.getFullYear() ?? today.getFullYear();
|
|
2871
|
-
const [internalMonth, setInternalMonth] = (0,
|
|
2872
|
-
const [internalYear, setInternalYear] = (0,
|
|
3047
|
+
const [internalMonth, setInternalMonth] = (0, import_react50.useState)(initialMonth);
|
|
3048
|
+
const [internalYear, setInternalYear] = (0, import_react50.useState)(initialYear);
|
|
2873
3049
|
const month = monthProp ?? internalMonth;
|
|
2874
3050
|
const year = yearProp ?? internalYear;
|
|
2875
3051
|
const isControlled = monthProp !== void 0 && yearProp !== void 0;
|
|
2876
|
-
const setVisible = (0,
|
|
3052
|
+
const setVisible = (0, import_react50.useCallback)(
|
|
2877
3053
|
(m, y) => {
|
|
2878
3054
|
if (!isControlled) {
|
|
2879
3055
|
setInternalMonth(m);
|
|
@@ -2883,36 +3059,36 @@ var Calendar = (0, import_react49.forwardRef)(function Calendar2({
|
|
|
2883
3059
|
},
|
|
2884
3060
|
[isControlled, onVisibleMonthChange]
|
|
2885
3061
|
);
|
|
2886
|
-
const goPrev = (0,
|
|
3062
|
+
const goPrev = (0, import_react50.useCallback)(() => {
|
|
2887
3063
|
const m = month === 0 ? 11 : month - 1;
|
|
2888
3064
|
const y = month === 0 ? year - 1 : year;
|
|
2889
3065
|
setVisible(m, y);
|
|
2890
3066
|
}, [month, year, setVisible]);
|
|
2891
|
-
const goNext = (0,
|
|
3067
|
+
const goNext = (0, import_react50.useCallback)(() => {
|
|
2892
3068
|
const m = month === 11 ? 0 : month + 1;
|
|
2893
3069
|
const y = month === 11 ? year + 1 : year;
|
|
2894
3070
|
setVisible(m, y);
|
|
2895
3071
|
}, [month, year, setVisible]);
|
|
2896
3072
|
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
2897
3073
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
2898
|
-
const [focusedDate, setFocusedDate] = (0,
|
|
3074
|
+
const [focusedDate, setFocusedDate] = (0, import_react50.useState)(() => {
|
|
2899
3075
|
if (selectedDate) return selectedDate;
|
|
2900
3076
|
return new Date(initialYear, initialMonth, 1);
|
|
2901
3077
|
});
|
|
2902
|
-
(0,
|
|
3078
|
+
(0, import_react50.useEffect)(() => {
|
|
2903
3079
|
if (selectedDate) setFocusedDate(selectedDate);
|
|
2904
3080
|
}, [selectedDate]);
|
|
2905
3081
|
const focusedInVisibleMonth = focusedDate.getMonth() === month && focusedDate.getFullYear() === year;
|
|
2906
3082
|
const effectiveFocusDay = focusedInVisibleMonth ? focusedDate.getDate() : clampDay(year, month, focusedDate.getDate());
|
|
2907
|
-
const dayRefs = (0,
|
|
2908
|
-
const shouldFocusRef = (0,
|
|
2909
|
-
(0,
|
|
3083
|
+
const dayRefs = (0, import_react50.useRef)(/* @__PURE__ */ new Map());
|
|
3084
|
+
const shouldFocusRef = (0, import_react50.useRef)(false);
|
|
3085
|
+
(0, import_react50.useEffect)(() => {
|
|
2910
3086
|
if (!shouldFocusRef.current) return;
|
|
2911
3087
|
shouldFocusRef.current = false;
|
|
2912
3088
|
const node = dayRefs.current.get(effectiveFocusDay);
|
|
2913
3089
|
node?.focus();
|
|
2914
3090
|
}, [effectiveFocusDay, month, year]);
|
|
2915
|
-
const moveFocus = (0,
|
|
3091
|
+
const moveFocus = (0, import_react50.useCallback)(
|
|
2916
3092
|
(next) => {
|
|
2917
3093
|
setFocusedDate(next);
|
|
2918
3094
|
shouldFocusRef.current = true;
|
|
@@ -2924,7 +3100,7 @@ var Calendar = (0, import_react49.forwardRef)(function Calendar2({
|
|
|
2924
3100
|
},
|
|
2925
3101
|
[month, year, setVisible]
|
|
2926
3102
|
);
|
|
2927
|
-
const onCellKeyDown = (0,
|
|
3103
|
+
const onCellKeyDown = (0, import_react50.useCallback)(
|
|
2928
3104
|
(e, day) => {
|
|
2929
3105
|
const current = new Date(year, month, day);
|
|
2930
3106
|
let next = null;
|
|
@@ -2976,7 +3152,7 @@ var Calendar = (0, import_react49.forwardRef)(function Calendar2({
|
|
|
2976
3152
|
},
|
|
2977
3153
|
[month, year, moveFocus]
|
|
2978
3154
|
);
|
|
2979
|
-
return /* @__PURE__ */ (0,
|
|
3155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
2980
3156
|
"div",
|
|
2981
3157
|
{
|
|
2982
3158
|
ref,
|
|
@@ -2988,14 +3164,14 @@ var Calendar = (0, import_react49.forwardRef)(function Calendar2({
|
|
|
2988
3164
|
),
|
|
2989
3165
|
...props,
|
|
2990
3166
|
children: [
|
|
2991
|
-
/* @__PURE__ */ (0,
|
|
2992
|
-
/* @__PURE__ */ (0,
|
|
3167
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
3168
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "text-[13px] font-medium", "aria-live": "polite", children: [
|
|
2993
3169
|
MONTHS[month],
|
|
2994
3170
|
" ",
|
|
2995
3171
|
year
|
|
2996
3172
|
] }),
|
|
2997
|
-
/* @__PURE__ */ (0,
|
|
2998
|
-
/* @__PURE__ */ (0,
|
|
3173
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex gap-1", children: [
|
|
3174
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2999
3175
|
IconButton,
|
|
3000
3176
|
{
|
|
3001
3177
|
size: "sm",
|
|
@@ -3005,11 +3181,11 @@ var Calendar = (0, import_react49.forwardRef)(function Calendar2({
|
|
|
3005
3181
|
onClick: goPrev
|
|
3006
3182
|
}
|
|
3007
3183
|
),
|
|
3008
|
-
/* @__PURE__ */ (0,
|
|
3184
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(IconButton, { size: "sm", variant: "ghost", icon: "\u203A", "aria-label": "Next month", onClick: goNext })
|
|
3009
3185
|
] })
|
|
3010
3186
|
] }),
|
|
3011
|
-
/* @__PURE__ */ (0,
|
|
3012
|
-
/* @__PURE__ */ (0,
|
|
3187
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { role: "grid", "aria-label": `${MONTHS[month]} ${year}`, className: "flex flex-col gap-[2px]", children: [
|
|
3188
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { role: "row", className: "grid grid-cols-7 gap-[2px]", children: DAYS.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3013
3189
|
"div",
|
|
3014
3190
|
{
|
|
3015
3191
|
role: "columnheader",
|
|
@@ -3029,7 +3205,7 @@ var Calendar = (0, import_react49.forwardRef)(function Calendar2({
|
|
|
3029
3205
|
const cellIndex = r * 7 + c;
|
|
3030
3206
|
const dayNum = cellIndex - firstDayOfMonth + 1;
|
|
3031
3207
|
if (dayNum < 1 || dayNum > daysInMonth) {
|
|
3032
|
-
cells.push(/* @__PURE__ */ (0,
|
|
3208
|
+
cells.push(/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { role: "gridcell", "aria-hidden": true }, `pad-${r}-${c}`));
|
|
3033
3209
|
continue;
|
|
3034
3210
|
}
|
|
3035
3211
|
const date = new Date(year, month, dayNum);
|
|
@@ -3039,7 +3215,7 @@ var Calendar = (0, import_react49.forwardRef)(function Calendar2({
|
|
|
3039
3215
|
const isFocused = dayNum === effectiveFocusDay;
|
|
3040
3216
|
const day = dayNum;
|
|
3041
3217
|
cells.push(
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
3218
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { role: "gridcell", "aria-selected": isSelected, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3043
3219
|
"button",
|
|
3044
3220
|
{
|
|
3045
3221
|
ref: (node) => {
|
|
@@ -3070,7 +3246,7 @@ var Calendar = (0, import_react49.forwardRef)(function Calendar2({
|
|
|
3070
3246
|
);
|
|
3071
3247
|
}
|
|
3072
3248
|
rows.push(
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
3249
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { role: "row", className: "grid grid-cols-7 gap-[2px]", children: cells }, `row-${r}`)
|
|
3074
3250
|
);
|
|
3075
3251
|
}
|
|
3076
3252
|
return rows;
|
|
@@ -3084,10 +3260,10 @@ Calendar.displayName = "Calendar";
|
|
|
3084
3260
|
|
|
3085
3261
|
// src/patterns/DatePicker/DatePicker.tsx
|
|
3086
3262
|
var RadixPopover2 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
3087
|
-
var
|
|
3088
|
-
var
|
|
3263
|
+
var import_react51 = require("react");
|
|
3264
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3089
3265
|
var defaultFormat = (d) => d.toLocaleDateString();
|
|
3090
|
-
var DatePicker = (0,
|
|
3266
|
+
var DatePicker = (0, import_react51.forwardRef)(function DatePicker2({
|
|
3091
3267
|
value: valueProp,
|
|
3092
3268
|
defaultValue,
|
|
3093
3269
|
onValueChange,
|
|
@@ -3101,14 +3277,14 @@ var DatePicker = (0, import_react50.forwardRef)(function DatePicker2({
|
|
|
3101
3277
|
id,
|
|
3102
3278
|
name
|
|
3103
3279
|
}, ref) {
|
|
3104
|
-
const [open, setOpen] = (0,
|
|
3280
|
+
const [open, setOpen] = (0, import_react51.useState)(false);
|
|
3105
3281
|
const [value, setValue] = useControllableState({
|
|
3106
3282
|
value: valueProp,
|
|
3107
3283
|
defaultValue,
|
|
3108
3284
|
onChange: onValueChange
|
|
3109
3285
|
});
|
|
3110
|
-
return /* @__PURE__ */ (0,
|
|
3111
|
-
/* @__PURE__ */ (0,
|
|
3286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(RadixPopover2.Root, { open, onOpenChange: setOpen, children: [
|
|
3287
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadixPopover2.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3112
3288
|
"button",
|
|
3113
3289
|
{
|
|
3114
3290
|
ref,
|
|
@@ -3125,18 +3301,18 @@ var DatePicker = (0, import_react50.forwardRef)(function DatePicker2({
|
|
|
3125
3301
|
),
|
|
3126
3302
|
style: { width },
|
|
3127
3303
|
children: [
|
|
3128
|
-
/* @__PURE__ */ (0,
|
|
3129
|
-
/* @__PURE__ */ (0,
|
|
3304
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { "aria-hidden": true, className: "text-text-dim", children: "\u25A2" }),
|
|
3305
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: cn("flex-1 truncate", !value && "text-text-dim"), children: value ? format(value) : emptyLabel ?? placeholder })
|
|
3130
3306
|
]
|
|
3131
3307
|
}
|
|
3132
3308
|
) }),
|
|
3133
|
-
/* @__PURE__ */ (0,
|
|
3309
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadixPopover2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3134
3310
|
RadixPopover2.Content,
|
|
3135
3311
|
{
|
|
3136
3312
|
align: "start",
|
|
3137
3313
|
sideOffset: 6,
|
|
3138
3314
|
className: "z-popover outline-none data-[state=open]:animate-[ship-pop-in_140ms_var(--easing-out)]",
|
|
3139
|
-
children: /* @__PURE__ */ (0,
|
|
3315
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3140
3316
|
Calendar,
|
|
3141
3317
|
{
|
|
3142
3318
|
value,
|
|
@@ -3151,17 +3327,17 @@ var DatePicker = (0, import_react50.forwardRef)(function DatePicker2({
|
|
|
3151
3327
|
)
|
|
3152
3328
|
}
|
|
3153
3329
|
) }),
|
|
3154
|
-
name && /* @__PURE__ */ (0,
|
|
3330
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { type: "hidden", name, value: value ? value.toISOString() : "", readOnly: true })
|
|
3155
3331
|
] });
|
|
3156
3332
|
});
|
|
3157
3333
|
DatePicker.displayName = "DatePicker";
|
|
3158
3334
|
|
|
3159
3335
|
// src/patterns/Dots/Dots.tsx
|
|
3160
|
-
var
|
|
3161
|
-
var
|
|
3162
|
-
var Dots = (0,
|
|
3336
|
+
var import_react52 = require("react");
|
|
3337
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3338
|
+
var Dots = (0, import_react52.forwardRef)(function Dots2({ total, current, onChange, className, "aria-label": ariaLabel = "Progress", ...props }, ref) {
|
|
3163
3339
|
const interactive = typeof onChange === "function";
|
|
3164
|
-
return /* @__PURE__ */ (0,
|
|
3340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3165
3341
|
"nav",
|
|
3166
3342
|
{
|
|
3167
3343
|
ref,
|
|
@@ -3175,7 +3351,7 @@ var Dots = (0, import_react51.forwardRef)(function Dots2({ total, current, onCha
|
|
|
3175
3351
|
isActive ? "w-[18px] bg-accent" : "w-[6px] bg-panel-2"
|
|
3176
3352
|
);
|
|
3177
3353
|
if (interactive) {
|
|
3178
|
-
return /* @__PURE__ */ (0,
|
|
3354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3179
3355
|
"button",
|
|
3180
3356
|
{
|
|
3181
3357
|
type: "button",
|
|
@@ -3192,7 +3368,7 @@ var Dots = (0, import_react51.forwardRef)(function Dots2({ total, current, onCha
|
|
|
3192
3368
|
i
|
|
3193
3369
|
);
|
|
3194
3370
|
}
|
|
3195
|
-
return /* @__PURE__ */ (0,
|
|
3371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { "aria-hidden": true, className: sharedClass }, i);
|
|
3196
3372
|
})
|
|
3197
3373
|
}
|
|
3198
3374
|
);
|
|
@@ -3200,13 +3376,13 @@ var Dots = (0, import_react51.forwardRef)(function Dots2({ total, current, onCha
|
|
|
3200
3376
|
Dots.displayName = "Dots";
|
|
3201
3377
|
|
|
3202
3378
|
// src/patterns/Dropzone/Dropzone.tsx
|
|
3203
|
-
var
|
|
3204
|
-
var
|
|
3379
|
+
var import_react53 = require("react");
|
|
3380
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3205
3381
|
function listToArray(list) {
|
|
3206
3382
|
if (!list) return [];
|
|
3207
3383
|
return Array.from(list);
|
|
3208
3384
|
}
|
|
3209
|
-
var Dropzone = (0,
|
|
3385
|
+
var Dropzone = (0, import_react53.forwardRef)(function Dropzone2({
|
|
3210
3386
|
onFiles,
|
|
3211
3387
|
accept,
|
|
3212
3388
|
multiple = true,
|
|
@@ -3217,7 +3393,7 @@ var Dropzone = (0, import_react52.forwardRef)(function Dropzone2({
|
|
|
3217
3393
|
className,
|
|
3218
3394
|
...props
|
|
3219
3395
|
}, ref) {
|
|
3220
|
-
const [isDragging, setIsDragging] = (0,
|
|
3396
|
+
const [isDragging, setIsDragging] = (0, import_react53.useState)(false);
|
|
3221
3397
|
const onDragOver = (e) => {
|
|
3222
3398
|
if (disabled) return;
|
|
3223
3399
|
e.preventDefault();
|
|
@@ -3231,7 +3407,7 @@ var Dropzone = (0, import_react52.forwardRef)(function Dropzone2({
|
|
|
3231
3407
|
const files = listToArray(e.dataTransfer.files);
|
|
3232
3408
|
if (files.length) onFiles?.(files);
|
|
3233
3409
|
};
|
|
3234
|
-
return /* @__PURE__ */ (0,
|
|
3410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3235
3411
|
"label",
|
|
3236
3412
|
{
|
|
3237
3413
|
ref,
|
|
@@ -3248,7 +3424,7 @@ var Dropzone = (0, import_react52.forwardRef)(function Dropzone2({
|
|
|
3248
3424
|
),
|
|
3249
3425
|
...props,
|
|
3250
3426
|
children: [
|
|
3251
|
-
/* @__PURE__ */ (0,
|
|
3427
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3252
3428
|
"input",
|
|
3253
3429
|
{
|
|
3254
3430
|
type: "file",
|
|
@@ -3264,7 +3440,7 @@ var Dropzone = (0, import_react52.forwardRef)(function Dropzone2({
|
|
|
3264
3440
|
}
|
|
3265
3441
|
}
|
|
3266
3442
|
),
|
|
3267
|
-
/* @__PURE__ */ (0,
|
|
3443
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3268
3444
|
"div",
|
|
3269
3445
|
{
|
|
3270
3446
|
"aria-hidden": true,
|
|
@@ -3272,8 +3448,8 @@ var Dropzone = (0, import_react52.forwardRef)(function Dropzone2({
|
|
|
3272
3448
|
children: icon
|
|
3273
3449
|
}
|
|
3274
3450
|
),
|
|
3275
|
-
/* @__PURE__ */ (0,
|
|
3276
|
-
description && /* @__PURE__ */ (0,
|
|
3451
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "mb-1 text-[13px] font-medium", children: title }),
|
|
3452
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-text-dim text-[11px]", children: description })
|
|
3277
3453
|
]
|
|
3278
3454
|
}
|
|
3279
3455
|
);
|
|
@@ -3282,8 +3458,8 @@ Dropzone.displayName = "Dropzone";
|
|
|
3282
3458
|
|
|
3283
3459
|
// src/patterns/EmptyState/EmptyState.tsx
|
|
3284
3460
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
3285
|
-
var
|
|
3286
|
-
var
|
|
3461
|
+
var import_react54 = require("react");
|
|
3462
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3287
3463
|
var plateStyles = (0, import_class_variance_authority10.cva)("grid h-12 w-12 place-items-center rounded-base text-[22px]", {
|
|
3288
3464
|
variants: {
|
|
3289
3465
|
tone: {
|
|
@@ -3296,8 +3472,8 @@ var plateStyles = (0, import_class_variance_authority10.cva)("grid h-12 w-12 pla
|
|
|
3296
3472
|
},
|
|
3297
3473
|
defaultVariants: { tone: "neutral" }
|
|
3298
3474
|
});
|
|
3299
|
-
var EmptyState = (0,
|
|
3300
|
-
return /* @__PURE__ */ (0,
|
|
3475
|
+
var EmptyState = (0, import_react54.forwardRef)(function EmptyState2({ icon, title, description, action, chips, tone, className, ...props }, ref) {
|
|
3476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
3301
3477
|
"div",
|
|
3302
3478
|
{
|
|
3303
3479
|
ref,
|
|
@@ -3307,10 +3483,10 @@ var EmptyState = (0, import_react53.forwardRef)(function EmptyState2({ icon, tit
|
|
|
3307
3483
|
),
|
|
3308
3484
|
...props,
|
|
3309
3485
|
children: [
|
|
3310
|
-
icon != null && /* @__PURE__ */ (0,
|
|
3311
|
-
/* @__PURE__ */ (0,
|
|
3312
|
-
description && /* @__PURE__ */ (0,
|
|
3313
|
-
chips && chips.length > 0 && /* @__PURE__ */ (0,
|
|
3486
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { "aria-hidden": true, className: plateStyles({ tone: tone ?? "neutral" }), children: icon }),
|
|
3487
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-[14px] font-medium", children: title }),
|
|
3488
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-text-muted max-w-[260px] text-[12px] leading-[1.5]", children: description }),
|
|
3489
|
+
chips && chips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex w-full flex-col gap-1", children: chips.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3314
3490
|
"button",
|
|
3315
3491
|
{
|
|
3316
3492
|
type: "button",
|
|
@@ -3332,18 +3508,18 @@ var EmptyState = (0, import_react53.forwardRef)(function EmptyState2({ icon, tit
|
|
|
3332
3508
|
EmptyState.displayName = "EmptyState";
|
|
3333
3509
|
|
|
3334
3510
|
// src/patterns/FileChip/FileChip.tsx
|
|
3335
|
-
var
|
|
3336
|
-
var
|
|
3511
|
+
var import_react55 = require("react");
|
|
3512
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3337
3513
|
function deriveExt(name) {
|
|
3338
3514
|
const dot = name.lastIndexOf(".");
|
|
3339
3515
|
if (dot < 0) return "FILE";
|
|
3340
3516
|
return name.slice(dot + 1).slice(0, 4).toUpperCase();
|
|
3341
3517
|
}
|
|
3342
|
-
var FileChip = (0,
|
|
3518
|
+
var FileChip = (0, import_react55.forwardRef)(function FileChip2({ name, size, progress, icon, onRemove, failed, className, ...props }, ref) {
|
|
3343
3519
|
const ext = deriveExt(name);
|
|
3344
3520
|
const showProgress = typeof progress === "number";
|
|
3345
3521
|
const isComplete = showProgress && progress >= 100;
|
|
3346
|
-
return /* @__PURE__ */ (0,
|
|
3522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3347
3523
|
"div",
|
|
3348
3524
|
{
|
|
3349
3525
|
ref,
|
|
@@ -3353,7 +3529,7 @@ var FileChip = (0, import_react54.forwardRef)(function FileChip2({ name, size, p
|
|
|
3353
3529
|
),
|
|
3354
3530
|
...props,
|
|
3355
3531
|
children: [
|
|
3356
|
-
/* @__PURE__ */ (0,
|
|
3532
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3357
3533
|
"span",
|
|
3358
3534
|
{
|
|
3359
3535
|
"aria-hidden": true,
|
|
@@ -3361,17 +3537,17 @@ var FileChip = (0, import_react54.forwardRef)(function FileChip2({ name, size, p
|
|
|
3361
3537
|
children: icon ?? ext
|
|
3362
3538
|
}
|
|
3363
3539
|
),
|
|
3364
|
-
/* @__PURE__ */ (0,
|
|
3365
|
-
/* @__PURE__ */ (0,
|
|
3366
|
-
/* @__PURE__ */ (0,
|
|
3540
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
3541
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "truncate text-[12px] font-medium", children: name }),
|
|
3542
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("font-mono text-[10px]", failed ? "text-err" : "text-text-dim"), children: [
|
|
3367
3543
|
size,
|
|
3368
|
-
showProgress && !isComplete && /* @__PURE__ */ (0,
|
|
3544
|
+
showProgress && !isComplete && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
3369
3545
|
" \xB7 ",
|
|
3370
3546
|
Math.round(progress),
|
|
3371
3547
|
"%"
|
|
3372
3548
|
] })
|
|
3373
3549
|
] }),
|
|
3374
|
-
showProgress && !isComplete && /* @__PURE__ */ (0,
|
|
3550
|
+
showProgress && !isComplete && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "bg-panel mt-1 h-[2px] overflow-hidden rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3375
3551
|
"div",
|
|
3376
3552
|
{
|
|
3377
3553
|
className: cn(
|
|
@@ -3382,7 +3558,7 @@ var FileChip = (0, import_react54.forwardRef)(function FileChip2({ name, size, p
|
|
|
3382
3558
|
}
|
|
3383
3559
|
) })
|
|
3384
3560
|
] }),
|
|
3385
|
-
onRemove && /* @__PURE__ */ (0,
|
|
3561
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3386
3562
|
"button",
|
|
3387
3563
|
{
|
|
3388
3564
|
type: "button",
|
|
@@ -3401,86 +3577,395 @@ var FileChip = (0, import_react54.forwardRef)(function FileChip2({ name, size, p
|
|
|
3401
3577
|
});
|
|
3402
3578
|
FileChip.displayName = "FileChip";
|
|
3403
3579
|
|
|
3404
|
-
// src/patterns/
|
|
3405
|
-
var
|
|
3406
|
-
var
|
|
3407
|
-
var
|
|
3408
|
-
var
|
|
3409
|
-
|
|
3410
|
-
|
|
3580
|
+
// src/patterns/FilterPanel/FilterPanel.tsx
|
|
3581
|
+
var import_react56 = require("react");
|
|
3582
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3583
|
+
var EMPTY = Object.freeze({});
|
|
3584
|
+
var FilterPanel = (0, import_react56.forwardRef)(function FilterPanel2({
|
|
3585
|
+
facets,
|
|
3586
|
+
value,
|
|
3587
|
+
defaultValue,
|
|
3588
|
+
onValueChange,
|
|
3589
|
+
onReset,
|
|
3590
|
+
counts,
|
|
3591
|
+
title = "Filter",
|
|
3592
|
+
resetLabel = "Reset",
|
|
3593
|
+
className,
|
|
3594
|
+
...props
|
|
3595
|
+
}, ref) {
|
|
3596
|
+
const [selection, setSelection] = useControllableState({
|
|
3597
|
+
value,
|
|
3598
|
+
defaultValue: defaultValue ?? EMPTY,
|
|
3599
|
+
onChange: onValueChange
|
|
3600
|
+
});
|
|
3601
|
+
const total = facets.reduce((sum, facet) => sum + (selection[facet.id]?.length ?? 0), 0);
|
|
3602
|
+
const toggle = (0, import_react56.useCallback)(
|
|
3603
|
+
(facetId, optionValue, next) => {
|
|
3604
|
+
setSelection((prev) => {
|
|
3605
|
+
const current = prev?.[facetId] ?? [];
|
|
3606
|
+
const filtered = current.filter((v) => v !== optionValue);
|
|
3607
|
+
const updated = next ? [...filtered, optionValue] : filtered;
|
|
3608
|
+
return { ...prev ?? {}, [facetId]: updated };
|
|
3609
|
+
});
|
|
3610
|
+
},
|
|
3611
|
+
[setSelection]
|
|
3612
|
+
);
|
|
3613
|
+
const handleReset = (0, import_react56.useCallback)(() => {
|
|
3614
|
+
setSelection(EMPTY);
|
|
3615
|
+
onReset?.();
|
|
3616
|
+
}, [setSelection, onReset]);
|
|
3617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3618
|
+
"div",
|
|
3411
3619
|
{
|
|
3412
3620
|
ref,
|
|
3621
|
+
role: "group",
|
|
3622
|
+
"aria-label": typeof title === "string" ? title : void 0,
|
|
3413
3623
|
className: cn(
|
|
3414
|
-
"border-border bg-panel flex
|
|
3624
|
+
"rounded-base border-border bg-panel flex w-[260px] flex-col gap-3 border p-4",
|
|
3415
3625
|
className
|
|
3416
3626
|
),
|
|
3417
|
-
...props
|
|
3627
|
+
...props,
|
|
3628
|
+
children: [
|
|
3629
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3630
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-text-dim font-mono text-[10px] tracking-[1.4px] uppercase", children: title }),
|
|
3631
|
+
total > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Badge, { size: "sm", variant: "accent", children: total }),
|
|
3632
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3633
|
+
Button,
|
|
3634
|
+
{
|
|
3635
|
+
type: "button",
|
|
3636
|
+
variant: "ghost",
|
|
3637
|
+
size: "sm",
|
|
3638
|
+
onClick: handleReset,
|
|
3639
|
+
disabled: total === 0,
|
|
3640
|
+
className: "ml-auto",
|
|
3641
|
+
children: resetLabel
|
|
3642
|
+
}
|
|
3643
|
+
)
|
|
3644
|
+
] }),
|
|
3645
|
+
facets.map((facet) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3646
|
+
FilterFacetGroup,
|
|
3647
|
+
{
|
|
3648
|
+
facet,
|
|
3649
|
+
selected: selection[facet.id] ?? [],
|
|
3650
|
+
counts: counts?.[facet.id],
|
|
3651
|
+
onToggle: toggle
|
|
3652
|
+
},
|
|
3653
|
+
facet.id
|
|
3654
|
+
))
|
|
3655
|
+
]
|
|
3418
3656
|
}
|
|
3419
3657
|
);
|
|
3420
3658
|
});
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3659
|
+
FilterPanel.displayName = "FilterPanel";
|
|
3660
|
+
function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
3661
|
+
const collapsible = facet.collapsible ?? true;
|
|
3662
|
+
const [open, setOpen] = (0, import_react56.useState)(facet.defaultOpen ?? true);
|
|
3663
|
+
const isOpen = !collapsible || open;
|
|
3664
|
+
const selectedCount = selected.length;
|
|
3665
|
+
const headingClass = "text-text-muted flex items-center gap-[6px] font-mono text-[10px] tracking-[1.4px] uppercase";
|
|
3666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { className: "flex flex-col gap-1", children: [
|
|
3667
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3668
|
+
"button",
|
|
3427
3669
|
{
|
|
3428
|
-
|
|
3670
|
+
type: "button",
|
|
3671
|
+
"aria-expanded": isOpen,
|
|
3672
|
+
onClick: () => setOpen((v) => !v),
|
|
3429
3673
|
className: cn(
|
|
3430
|
-
|
|
3431
|
-
"
|
|
3432
|
-
"data-[state=open]:bg-panel-2 hover:bg-panel-2",
|
|
3674
|
+
headingClass,
|
|
3675
|
+
"cursor-pointer rounded-xs px-1 py-[2px] outline-none",
|
|
3433
3676
|
"focus-visible:ring-accent-dim focus-visible:ring-[3px]",
|
|
3434
|
-
|
|
3677
|
+
"hover:text-text"
|
|
3435
3678
|
),
|
|
3436
|
-
|
|
3679
|
+
children: [
|
|
3680
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "flex-1 text-left", children: facet.label }),
|
|
3681
|
+
selectedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Badge, { size: "sm", variant: "neutral", children: selectedCount }),
|
|
3682
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
3683
|
+
]
|
|
3437
3684
|
}
|
|
3438
|
-
)
|
|
3439
|
-
|
|
3440
|
-
)
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
className
|
|
3685
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn(headingClass, "px-1 py-[2px]"), children: [
|
|
3686
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "flex-1", children: facet.label }),
|
|
3687
|
+
selectedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Badge, { size: "sm", variant: "neutral", children: selectedCount })
|
|
3688
|
+
] }),
|
|
3689
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ul", { className: "m-0 flex list-none flex-col gap-[2px] p-0", children: facet.options.map((option) => {
|
|
3690
|
+
const isSelected = selected.includes(option.value);
|
|
3691
|
+
const count = counts?.[option.value];
|
|
3692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("li", { className: "flex items-center gap-2 px-1 py-[3px]", children: [
|
|
3693
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3694
|
+
Checkbox,
|
|
3695
|
+
{
|
|
3696
|
+
checked: isSelected,
|
|
3697
|
+
onCheckedChange: (next) => onToggle(facet.id, option.value, next === true),
|
|
3698
|
+
label: option.label
|
|
3699
|
+
}
|
|
3454
3700
|
),
|
|
3455
|
-
|
|
3456
|
-
}
|
|
3457
|
-
) })
|
|
3458
|
-
}
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
);
|
|
3466
|
-
var
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3701
|
+
typeof count === "number" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-text-dim ml-auto font-mono text-[10px] tabular-nums", children: count })
|
|
3702
|
+
] }, option.value);
|
|
3703
|
+
}) })
|
|
3704
|
+
] });
|
|
3705
|
+
}
|
|
3706
|
+
|
|
3707
|
+
// src/patterns/HealthScore/HealthScore.tsx
|
|
3708
|
+
var import_react58 = require("react");
|
|
3709
|
+
|
|
3710
|
+
// src/patterns/RadialProgress/RadialProgress.tsx
|
|
3711
|
+
var import_react57 = require("react");
|
|
3712
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3713
|
+
var toneStrokeClass = {
|
|
3714
|
+
accent: "stroke-accent",
|
|
3715
|
+
ok: "stroke-ok",
|
|
3716
|
+
warn: "stroke-warn",
|
|
3717
|
+
err: "stroke-err"
|
|
3718
|
+
};
|
|
3719
|
+
var RadialProgress = (0, import_react57.forwardRef)(
|
|
3720
|
+
function RadialProgress2({
|
|
3721
|
+
value,
|
|
3722
|
+
max = 100,
|
|
3723
|
+
size = 64,
|
|
3724
|
+
thickness = 4,
|
|
3725
|
+
tone,
|
|
3726
|
+
children,
|
|
3727
|
+
className,
|
|
3728
|
+
"aria-label": ariaLabel,
|
|
3729
|
+
...props
|
|
3730
|
+
}, ref) {
|
|
3731
|
+
const clamped = Math.min(max, Math.max(0, value));
|
|
3732
|
+
const pct = max > 0 ? clamped / max * 100 : 0;
|
|
3733
|
+
const r = (size - thickness) / 2;
|
|
3734
|
+
const c = 2 * Math.PI * r;
|
|
3735
|
+
const dash = pct / 100 * c;
|
|
3736
|
+
const resolvedTone = tone ?? (clamped >= max ? "ok" : "accent");
|
|
3737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
3738
|
+
"div",
|
|
3739
|
+
{
|
|
3740
|
+
ref,
|
|
3741
|
+
role: "progressbar",
|
|
3742
|
+
"aria-valuemin": 0,
|
|
3743
|
+
"aria-valuemax": max,
|
|
3744
|
+
"aria-valuenow": Math.round(pct),
|
|
3745
|
+
"aria-label": ariaLabel ?? `${Math.round(pct)}%`,
|
|
3746
|
+
className: cn("relative inline-grid place-items-center", className),
|
|
3747
|
+
style: { width: size, height: size },
|
|
3748
|
+
...props,
|
|
3749
|
+
children: [
|
|
3750
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: [
|
|
3751
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3752
|
+
"circle",
|
|
3753
|
+
{
|
|
3754
|
+
cx: size / 2,
|
|
3755
|
+
cy: size / 2,
|
|
3756
|
+
r,
|
|
3757
|
+
fill: "none",
|
|
3758
|
+
strokeWidth: thickness,
|
|
3759
|
+
className: "stroke-panel-2"
|
|
3760
|
+
}
|
|
3761
|
+
),
|
|
3762
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3763
|
+
"circle",
|
|
3764
|
+
{
|
|
3765
|
+
cx: size / 2,
|
|
3766
|
+
cy: size / 2,
|
|
3767
|
+
r,
|
|
3768
|
+
fill: "none",
|
|
3769
|
+
strokeWidth: thickness,
|
|
3770
|
+
strokeLinecap: "round",
|
|
3771
|
+
strokeDasharray: `${dash} ${c}`,
|
|
3772
|
+
transform: `rotate(-90 ${size / 2} ${size / 2})`,
|
|
3773
|
+
className: cn(
|
|
3774
|
+
"transition-[stroke-dasharray] duration-(--duration-step)",
|
|
3775
|
+
toneStrokeClass[resolvedTone]
|
|
3776
|
+
)
|
|
3777
|
+
}
|
|
3778
|
+
)
|
|
3779
|
+
] }),
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "absolute inset-0 grid place-items-center font-mono text-[11px] font-medium tabular-nums", children: children ?? `${Math.round(pct)}%` })
|
|
3781
|
+
]
|
|
3782
|
+
}
|
|
3783
|
+
);
|
|
3784
|
+
}
|
|
3785
|
+
);
|
|
3786
|
+
RadialProgress.displayName = "RadialProgress";
|
|
3787
|
+
|
|
3788
|
+
// src/patterns/HealthScore/HealthScore.tsx
|
|
3789
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3790
|
+
function deltaTone(delta) {
|
|
3791
|
+
if (delta > 0) return "ok";
|
|
3792
|
+
if (delta < 0) return "err";
|
|
3793
|
+
return "accent";
|
|
3794
|
+
}
|
|
3795
|
+
function deltaGlyph(delta) {
|
|
3796
|
+
if (delta > 0) return "\u2191";
|
|
3797
|
+
if (delta < 0) return "\u2193";
|
|
3798
|
+
return "\xB7";
|
|
3799
|
+
}
|
|
3800
|
+
var toneTextClass = {
|
|
3801
|
+
accent: "text-text-muted",
|
|
3802
|
+
ok: "text-ok",
|
|
3803
|
+
warn: "text-warn",
|
|
3804
|
+
err: "text-err"
|
|
3805
|
+
};
|
|
3806
|
+
var HealthScore = (0, import_react58.forwardRef)(function HealthScore2({
|
|
3807
|
+
value,
|
|
3808
|
+
max = 100,
|
|
3809
|
+
delta,
|
|
3810
|
+
label,
|
|
3811
|
+
breakdown,
|
|
3812
|
+
size = 72,
|
|
3813
|
+
tone,
|
|
3814
|
+
className,
|
|
3815
|
+
"aria-label": ariaLabel,
|
|
3816
|
+
...props
|
|
3817
|
+
}, ref) {
|
|
3818
|
+
const pct = max > 0 ? Math.round(Math.min(max, Math.max(0, value)) / max * 100) : 0;
|
|
3819
|
+
const resolvedTone = tone ?? (pct >= 80 ? "ok" : pct >= 50 ? "accent" : "warn");
|
|
3820
|
+
const indicatorTone = typeof delta === "number" ? deltaTone(delta) : "accent";
|
|
3821
|
+
const core = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
3822
|
+
"div",
|
|
3823
|
+
{
|
|
3824
|
+
ref,
|
|
3825
|
+
className: cn("inline-flex flex-col items-center gap-1", className),
|
|
3826
|
+
"aria-label": ariaLabel ?? `${pct}% health`,
|
|
3827
|
+
...props,
|
|
3828
|
+
children: [
|
|
3829
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadialProgress, { value, max, size, tone: resolvedTone }),
|
|
3830
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-text-muted mt-1 text-[12px] leading-tight", children: label }),
|
|
3831
|
+
typeof delta === "number" && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: cn("font-mono text-[11px] tabular-nums", toneTextClass[indicatorTone]), children: [
|
|
3832
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { "aria-hidden": true, children: deltaGlyph(delta) }),
|
|
3833
|
+
" ",
|
|
3834
|
+
Math.abs(delta)
|
|
3835
|
+
] })
|
|
3836
|
+
]
|
|
3837
|
+
}
|
|
3838
|
+
);
|
|
3839
|
+
if (!breakdown || breakdown.length === 0) {
|
|
3840
|
+
return core;
|
|
3841
|
+
}
|
|
3842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3843
|
+
HoverCard,
|
|
3844
|
+
{
|
|
3845
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "inline-flex", children: core }),
|
|
3846
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex min-w-[180px] flex-col gap-2", children: [
|
|
3847
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-text-dim font-mono text-[9px] tracking-[1.4px] uppercase", children: "Breakdown" }),
|
|
3848
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("ul", { className: "m-0 flex list-none flex-col gap-1 p-0 text-[12px]", children: breakdown.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("li", { className: "flex items-center gap-2", children: [
|
|
3849
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-text-muted flex-1 truncate", children: entry.label }),
|
|
3850
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3851
|
+
"span",
|
|
3852
|
+
{
|
|
3853
|
+
className: cn(
|
|
3854
|
+
"font-mono tabular-nums",
|
|
3855
|
+
entry.tone ? toneTextClass[entry.tone] : "text-text"
|
|
3856
|
+
),
|
|
3857
|
+
children: entry.value
|
|
3858
|
+
}
|
|
3859
|
+
)
|
|
3860
|
+
] }, i)) })
|
|
3861
|
+
] })
|
|
3862
|
+
}
|
|
3863
|
+
);
|
|
3864
|
+
});
|
|
3865
|
+
HealthScore.displayName = "HealthScore";
|
|
3866
|
+
|
|
3867
|
+
// src/patterns/LargeTitle/LargeTitle.tsx
|
|
3868
|
+
var import_react59 = require("react");
|
|
3869
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3870
|
+
var LargeTitle = (0, import_react59.forwardRef)(function LargeTitle2({ title, eyebrow, trailing, className, ...props }, ref) {
|
|
3871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3872
|
+
"header",
|
|
3873
|
+
{
|
|
3874
|
+
ref,
|
|
3875
|
+
className: cn("px-screen flex items-end justify-between gap-3 py-3 pb-4", className),
|
|
3876
|
+
...props,
|
|
3877
|
+
children: [
|
|
3878
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
3879
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "text-m-eyebrow text-accent mb-[6px] font-mono tracking-wide uppercase", children: eyebrow }),
|
|
3880
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h1", { className: "text-m-h1 m-0 truncate leading-tight font-medium tracking-tight", children: title })
|
|
3881
|
+
] }),
|
|
3882
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "shrink-0", children: trailing })
|
|
3883
|
+
]
|
|
3884
|
+
}
|
|
3885
|
+
);
|
|
3886
|
+
});
|
|
3887
|
+
LargeTitle.displayName = "LargeTitle";
|
|
3888
|
+
|
|
3889
|
+
// src/patterns/Menubar/Menubar.tsx
|
|
3890
|
+
var RadixMenubar = __toESM(require("@radix-ui/react-menubar"), 1);
|
|
3891
|
+
var import_react60 = require("react");
|
|
3892
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3893
|
+
var Menubar = (0, import_react60.forwardRef)(function Menubar2({ className, ...props }, ref) {
|
|
3894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3895
|
+
RadixMenubar.Root,
|
|
3896
|
+
{
|
|
3897
|
+
ref,
|
|
3898
|
+
className: cn(
|
|
3899
|
+
"border-border bg-panel flex h-[30px] items-center gap-[2px] border-b px-3",
|
|
3900
|
+
className
|
|
3901
|
+
),
|
|
3902
|
+
...props
|
|
3903
|
+
}
|
|
3904
|
+
);
|
|
3905
|
+
});
|
|
3906
|
+
Menubar.displayName = "Menubar";
|
|
3907
|
+
var MenubarMenu = RadixMenubar.Menu;
|
|
3908
|
+
var MenubarTrigger = (0, import_react60.forwardRef)(
|
|
3909
|
+
function MenubarTrigger2({ className, ...props }, ref) {
|
|
3910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3911
|
+
RadixMenubar.Trigger,
|
|
3912
|
+
{
|
|
3913
|
+
ref,
|
|
3914
|
+
className: cn(
|
|
3915
|
+
"text-text cursor-pointer rounded-xs border-0 bg-transparent px-[10px] py-1 text-[12px] outline-none",
|
|
3916
|
+
"transition-colors duration-(--duration-micro)",
|
|
3917
|
+
"data-[state=open]:bg-panel-2 hover:bg-panel-2",
|
|
3918
|
+
"focus-visible:ring-accent-dim focus-visible:ring-[3px]",
|
|
3919
|
+
className
|
|
3920
|
+
),
|
|
3921
|
+
...props
|
|
3922
|
+
}
|
|
3923
|
+
);
|
|
3924
|
+
}
|
|
3925
|
+
);
|
|
3926
|
+
MenubarTrigger.displayName = "MenubarTrigger";
|
|
3927
|
+
var MenubarContent = (0, import_react60.forwardRef)(
|
|
3928
|
+
function MenubarContent2({ className, sideOffset = 6, align = "start", ...props }, ref) {
|
|
3929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(RadixMenubar.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3930
|
+
RadixMenubar.Content,
|
|
3931
|
+
{
|
|
3932
|
+
ref,
|
|
3933
|
+
sideOffset,
|
|
3934
|
+
align,
|
|
3935
|
+
className: cn(
|
|
3936
|
+
"border-border-strong bg-panel z-popover min-w-[180px] rounded-md border p-1 shadow-lg outline-none",
|
|
3937
|
+
"data-[state=open]:animate-[ship-pop-in_140ms_var(--easing-out)]",
|
|
3938
|
+
className
|
|
3939
|
+
),
|
|
3940
|
+
...props
|
|
3941
|
+
}
|
|
3942
|
+
) });
|
|
3943
|
+
}
|
|
3944
|
+
);
|
|
3945
|
+
MenubarContent.displayName = "MenubarContent";
|
|
3946
|
+
var itemBase3 = cn(
|
|
3947
|
+
"flex items-center gap-2 rounded-sm px-[10px] py-[6px] text-[12px] cursor-pointer outline-none",
|
|
3948
|
+
"data-[highlighted]:bg-panel-2",
|
|
3949
|
+
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
3950
|
+
);
|
|
3951
|
+
var MenubarItem = (0, import_react60.forwardRef)(function MenubarItem2({ trailing, destructive, className, children, ...props }, ref) {
|
|
3952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3953
|
+
RadixMenubar.Item,
|
|
3954
|
+
{
|
|
3470
3955
|
ref,
|
|
3471
3956
|
className: cn(itemBase3, destructive ? "text-err" : "text-text", className),
|
|
3472
3957
|
...props,
|
|
3473
3958
|
children: [
|
|
3474
|
-
/* @__PURE__ */ (0,
|
|
3475
|
-
trailing && /* @__PURE__ */ (0,
|
|
3959
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "flex-1", children }),
|
|
3960
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
3476
3961
|
]
|
|
3477
3962
|
}
|
|
3478
3963
|
);
|
|
3479
3964
|
});
|
|
3480
3965
|
MenubarItem.displayName = "MenubarItem";
|
|
3481
|
-
var MenubarSeparator = (0,
|
|
3966
|
+
var MenubarSeparator = (0, import_react60.forwardRef)(
|
|
3482
3967
|
function MenubarSeparator2({ className, ...props }, ref) {
|
|
3483
|
-
return /* @__PURE__ */ (0,
|
|
3968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3484
3969
|
RadixMenubar.Separator,
|
|
3485
3970
|
{
|
|
3486
3971
|
ref,
|
|
@@ -3494,13 +3979,13 @@ MenubarSeparator.displayName = "MenubarSeparator";
|
|
|
3494
3979
|
|
|
3495
3980
|
// src/patterns/NavBar/NavBar.tsx
|
|
3496
3981
|
var RadixNav = __toESM(require("@radix-ui/react-navigation-menu"), 1);
|
|
3497
|
-
var
|
|
3982
|
+
var import_react62 = require("react");
|
|
3498
3983
|
|
|
3499
3984
|
// src/patterns/Sidebar/Sidebar.tsx
|
|
3500
|
-
var
|
|
3501
|
-
var
|
|
3502
|
-
var Sidebar = (0,
|
|
3503
|
-
return /* @__PURE__ */ (0,
|
|
3985
|
+
var import_react61 = require("react");
|
|
3986
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3987
|
+
var Sidebar = (0, import_react61.forwardRef)(function Sidebar2({ width = 240, className, style, ...props }, ref) {
|
|
3988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3504
3989
|
"aside",
|
|
3505
3990
|
{
|
|
3506
3991
|
ref,
|
|
@@ -3514,12 +3999,12 @@ var Sidebar = (0, import_react56.forwardRef)(function Sidebar2({ width = 240, cl
|
|
|
3514
3999
|
);
|
|
3515
4000
|
});
|
|
3516
4001
|
Sidebar.displayName = "Sidebar";
|
|
3517
|
-
var NavItem = (0,
|
|
4002
|
+
var NavItem = (0, import_react61.forwardRef)(
|
|
3518
4003
|
function NavItem2({ icon, label, active, badge, href, disabled, className, ...props }, ref) {
|
|
3519
|
-
const inner = /* @__PURE__ */ (0,
|
|
3520
|
-
icon && /* @__PURE__ */ (0,
|
|
3521
|
-
/* @__PURE__ */ (0,
|
|
3522
|
-
badge != null && /* @__PURE__ */ (0,
|
|
4004
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
4005
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: icon }),
|
|
4006
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "flex-1 truncate", children: label }),
|
|
4007
|
+
badge != null && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3523
4008
|
"span",
|
|
3524
4009
|
{
|
|
3525
4010
|
className: cn(
|
|
@@ -3540,7 +4025,7 @@ var NavItem = (0, import_react56.forwardRef)(
|
|
|
3540
4025
|
);
|
|
3541
4026
|
if (href) {
|
|
3542
4027
|
const anchorProps = props;
|
|
3543
|
-
return /* @__PURE__ */ (0,
|
|
4028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3544
4029
|
"a",
|
|
3545
4030
|
{
|
|
3546
4031
|
ref,
|
|
@@ -3554,7 +4039,7 @@ var NavItem = (0, import_react56.forwardRef)(
|
|
|
3554
4039
|
);
|
|
3555
4040
|
}
|
|
3556
4041
|
const buttonProps = props;
|
|
3557
|
-
return /* @__PURE__ */ (0,
|
|
4042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3558
4043
|
"button",
|
|
3559
4044
|
{
|
|
3560
4045
|
ref,
|
|
@@ -3569,7 +4054,7 @@ var NavItem = (0, import_react56.forwardRef)(
|
|
|
3569
4054
|
}
|
|
3570
4055
|
);
|
|
3571
4056
|
NavItem.displayName = "NavItem";
|
|
3572
|
-
var NavSection = (0,
|
|
4057
|
+
var NavSection = (0, import_react61.forwardRef)(function NavSection2({
|
|
3573
4058
|
label,
|
|
3574
4059
|
icon,
|
|
3575
4060
|
action,
|
|
@@ -3583,16 +4068,16 @@ var NavSection = (0, import_react56.forwardRef)(function NavSection2({
|
|
|
3583
4068
|
...props
|
|
3584
4069
|
}, ref) {
|
|
3585
4070
|
const isControlled = open !== void 0;
|
|
3586
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
4071
|
+
const [internalOpen, setInternalOpen] = (0, import_react61.useState)(defaultOpen);
|
|
3587
4072
|
const isOpen = !collapsible || (isControlled ? open : internalOpen);
|
|
3588
|
-
const toggle = (0,
|
|
4073
|
+
const toggle = (0, import_react61.useCallback)(() => {
|
|
3589
4074
|
const next = !isOpen;
|
|
3590
4075
|
if (!isControlled) setInternalOpen(next);
|
|
3591
4076
|
onOpenChange?.(next);
|
|
3592
4077
|
}, [isOpen, isControlled, onOpenChange]);
|
|
3593
4078
|
const eyebrowClass = "text-text-dim flex items-center gap-[6px] px-2 pt-2 font-mono text-[9px] tracking-[1.4px] uppercase";
|
|
3594
|
-
return /* @__PURE__ */ (0,
|
|
3595
|
-
collapsible ? /* @__PURE__ */ (0,
|
|
4079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
|
|
4080
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
3596
4081
|
"button",
|
|
3597
4082
|
{
|
|
3598
4083
|
type: "button",
|
|
@@ -3605,18 +4090,18 @@ var NavSection = (0, import_react56.forwardRef)(function NavSection2({
|
|
|
3605
4090
|
"hover:text-text-muted"
|
|
3606
4091
|
),
|
|
3607
4092
|
children: [
|
|
3608
|
-
icon != null && /* @__PURE__ */ (0,
|
|
3609
|
-
/* @__PURE__ */ (0,
|
|
4093
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "aria-hidden": true, className: "opacity-80", children: icon }),
|
|
4094
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "flex-1 text-left", children: label }),
|
|
3610
4095
|
action,
|
|
3611
|
-
/* @__PURE__ */ (0,
|
|
4096
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
3612
4097
|
]
|
|
3613
4098
|
}
|
|
3614
|
-
) : /* @__PURE__ */ (0,
|
|
3615
|
-
icon != null && /* @__PURE__ */ (0,
|
|
3616
|
-
/* @__PURE__ */ (0,
|
|
4099
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: eyebrowClass, children: [
|
|
4100
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "aria-hidden": true, className: "opacity-80", children: icon }),
|
|
4101
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "flex-1", children: label }),
|
|
3617
4102
|
action
|
|
3618
4103
|
] }),
|
|
3619
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4104
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3620
4105
|
"div",
|
|
3621
4106
|
{
|
|
3622
4107
|
className: cn("flex flex-col gap-[2px]", indent > 0 && "border-border ml-2 border-l"),
|
|
@@ -3629,12 +4114,12 @@ var NavSection = (0, import_react56.forwardRef)(function NavSection2({
|
|
|
3629
4114
|
NavSection.displayName = "NavSection";
|
|
3630
4115
|
|
|
3631
4116
|
// src/patterns/NavBar/NavBar.tsx
|
|
3632
|
-
var
|
|
4117
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3633
4118
|
function isActiveTree(item, activeId) {
|
|
3634
4119
|
if (item.id === activeId) return true;
|
|
3635
4120
|
return item.children?.some((c) => isActiveTree(c, activeId)) ?? false;
|
|
3636
4121
|
}
|
|
3637
|
-
var NavBar = (0,
|
|
4122
|
+
var NavBar = (0, import_react62.forwardRef)(function NavBar2({
|
|
3638
4123
|
orientation = "horizontal",
|
|
3639
4124
|
items,
|
|
3640
4125
|
brand,
|
|
@@ -3648,17 +4133,17 @@ var NavBar = (0, import_react57.forwardRef)(function NavBar2({
|
|
|
3648
4133
|
...props
|
|
3649
4134
|
}, ref) {
|
|
3650
4135
|
const isControlled = value !== void 0;
|
|
3651
|
-
const [internalValue, setInternalValue] = (0,
|
|
4136
|
+
const [internalValue, setInternalValue] = (0, import_react62.useState)(defaultValue);
|
|
3652
4137
|
const activeId = isControlled ? value : internalValue;
|
|
3653
|
-
const [drawerOpen, setDrawerOpen] = (0,
|
|
3654
|
-
const select = (0,
|
|
4138
|
+
const [drawerOpen, setDrawerOpen] = (0, import_react62.useState)(false);
|
|
4139
|
+
const select = (0, import_react62.useCallback)(
|
|
3655
4140
|
(id) => {
|
|
3656
4141
|
if (!isControlled) setInternalValue(id);
|
|
3657
4142
|
onValueChange?.(id);
|
|
3658
4143
|
},
|
|
3659
4144
|
[isControlled, onValueChange]
|
|
3660
4145
|
);
|
|
3661
|
-
const handleItemActivate = (0,
|
|
4146
|
+
const handleItemActivate = (0, import_react62.useCallback)(
|
|
3662
4147
|
(id) => {
|
|
3663
4148
|
select(id);
|
|
3664
4149
|
setDrawerOpen(false);
|
|
@@ -3670,7 +4155,7 @@ var NavBar = (0, import_react57.forwardRef)(function NavBar2({
|
|
|
3670
4155
|
// drawer is open on a viewport that's resizing past `md`, both navs can
|
|
3671
4156
|
// sit in the DOM together. Identical accessible names would trip axe's
|
|
3672
4157
|
// `landmark-unique` rule.
|
|
3673
|
-
/* @__PURE__ */ (0,
|
|
4158
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("nav", { "aria-label": "Mobile navigation", className: "flex flex-col gap-1", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3674
4159
|
VerticalItem,
|
|
3675
4160
|
{
|
|
3676
4161
|
item,
|
|
@@ -3680,14 +4165,14 @@ var NavBar = (0, import_react57.forwardRef)(function NavBar2({
|
|
|
3680
4165
|
item.id
|
|
3681
4166
|
)) })
|
|
3682
4167
|
);
|
|
3683
|
-
const mobileBar = responsive ? /* @__PURE__ */ (0,
|
|
4168
|
+
const mobileBar = responsive ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
3684
4169
|
"div",
|
|
3685
4170
|
{
|
|
3686
4171
|
className: cn(
|
|
3687
4172
|
"border-border bg-panel z-overlay sticky top-0 flex h-[52px] items-center gap-4 border-b px-5 md:hidden"
|
|
3688
4173
|
),
|
|
3689
4174
|
children: [
|
|
3690
|
-
/* @__PURE__ */ (0,
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3691
4176
|
"button",
|
|
3692
4177
|
{
|
|
3693
4178
|
type: "button",
|
|
@@ -3697,15 +4182,15 @@ var NavBar = (0, import_react57.forwardRef)(function NavBar2({
|
|
|
3697
4182
|
children: "\u2630"
|
|
3698
4183
|
}
|
|
3699
4184
|
),
|
|
3700
|
-
brand && /* @__PURE__ */ (0,
|
|
3701
|
-
actions && /* @__PURE__ */ (0,
|
|
4185
|
+
brand && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex flex-1 items-center text-[13px] font-medium whitespace-nowrap", children: brand }),
|
|
4186
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex items-center gap-3", children: actions })
|
|
3702
4187
|
]
|
|
3703
4188
|
}
|
|
3704
4189
|
) : null;
|
|
3705
4190
|
if (orientation === "horizontal") {
|
|
3706
|
-
return /* @__PURE__ */ (0,
|
|
4191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
3707
4192
|
mobileBar,
|
|
3708
|
-
/* @__PURE__ */ (0,
|
|
4193
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
3709
4194
|
"header",
|
|
3710
4195
|
{
|
|
3711
4196
|
ref,
|
|
@@ -3716,10 +4201,10 @@ var NavBar = (0, import_react57.forwardRef)(function NavBar2({
|
|
|
3716
4201
|
),
|
|
3717
4202
|
...props,
|
|
3718
4203
|
children: [
|
|
3719
|
-
brand && /* @__PURE__ */ (0,
|
|
3720
|
-
/* @__PURE__ */ (0,
|
|
3721
|
-
/* @__PURE__ */ (0,
|
|
3722
|
-
(item) => item.children?.length ? /* @__PURE__ */ (0,
|
|
4204
|
+
brand && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "shrink-0 text-[13px] font-medium whitespace-nowrap", children: brand }),
|
|
4205
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(RadixNav.Root, { className: "relative flex-1", delayDuration: 120, children: [
|
|
4206
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.List, { className: "m-0! flex list-none! items-center gap-1 p-0! [&_li]:m-0!", children: items.map(
|
|
4207
|
+
(item) => item.children?.length ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3723
4208
|
HorizontalDropdown,
|
|
3724
4209
|
{
|
|
3725
4210
|
item,
|
|
@@ -3728,7 +4213,7 @@ var NavBar = (0, import_react57.forwardRef)(function NavBar2({
|
|
|
3728
4213
|
onActivate: handleItemActivate
|
|
3729
4214
|
},
|
|
3730
4215
|
item.id
|
|
3731
|
-
) : /* @__PURE__ */ (0,
|
|
4216
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3732
4217
|
HorizontalLink,
|
|
3733
4218
|
{
|
|
3734
4219
|
item,
|
|
@@ -3737,13 +4222,13 @@ var NavBar = (0, import_react57.forwardRef)(function NavBar2({
|
|
|
3737
4222
|
}
|
|
3738
4223
|
) }, item.id)
|
|
3739
4224
|
) }),
|
|
3740
|
-
/* @__PURE__ */ (0,
|
|
4225
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "z-popover absolute top-full left-0 flex justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Viewport, { className: "origin-top-left data-[state=open]:animate-[ship-fade-in_120ms_var(--easing-out)]" }) })
|
|
3741
4226
|
] }),
|
|
3742
|
-
actions && /* @__PURE__ */ (0,
|
|
4227
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex items-center gap-3", children: actions })
|
|
3743
4228
|
]
|
|
3744
4229
|
}
|
|
3745
4230
|
),
|
|
3746
|
-
responsive && /* @__PURE__ */ (0,
|
|
4231
|
+
responsive && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3747
4232
|
Drawer,
|
|
3748
4233
|
{
|
|
3749
4234
|
open: drawerOpen,
|
|
@@ -3756,9 +4241,9 @@ var NavBar = (0, import_react57.forwardRef)(function NavBar2({
|
|
|
3756
4241
|
)
|
|
3757
4242
|
] });
|
|
3758
4243
|
}
|
|
3759
|
-
return /* @__PURE__ */ (0,
|
|
4244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
3760
4245
|
mobileBar,
|
|
3761
|
-
/* @__PURE__ */ (0,
|
|
4246
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
3762
4247
|
"aside",
|
|
3763
4248
|
{
|
|
3764
4249
|
ref,
|
|
@@ -3771,8 +4256,8 @@ var NavBar = (0, import_react57.forwardRef)(function NavBar2({
|
|
|
3771
4256
|
),
|
|
3772
4257
|
...props,
|
|
3773
4258
|
children: [
|
|
3774
|
-
brand && /* @__PURE__ */ (0,
|
|
3775
|
-
/* @__PURE__ */ (0,
|
|
4259
|
+
brand && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "px-2 py-1 text-[13px] font-medium", children: brand }),
|
|
4260
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("nav", { "aria-label": "Sidebar navigation", className: "flex flex-1 flex-col gap-1 overflow-y-auto", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3776
4261
|
VerticalItem,
|
|
3777
4262
|
{
|
|
3778
4263
|
item,
|
|
@@ -3781,11 +4266,11 @@ var NavBar = (0, import_react57.forwardRef)(function NavBar2({
|
|
|
3781
4266
|
},
|
|
3782
4267
|
item.id
|
|
3783
4268
|
)) }),
|
|
3784
|
-
actions && /* @__PURE__ */ (0,
|
|
4269
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "border-border mt-auto flex flex-col gap-2 border-t pt-3", children: actions })
|
|
3785
4270
|
]
|
|
3786
4271
|
}
|
|
3787
4272
|
),
|
|
3788
|
-
responsive && /* @__PURE__ */ (0,
|
|
4273
|
+
responsive && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3789
4274
|
Drawer,
|
|
3790
4275
|
{
|
|
3791
4276
|
open: drawerOpen,
|
|
@@ -3814,13 +4299,13 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
3814
4299
|
}
|
|
3815
4300
|
onActivate(item.id);
|
|
3816
4301
|
};
|
|
3817
|
-
const inner = /* @__PURE__ */ (0,
|
|
3818
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
3819
|
-
/* @__PURE__ */ (0,
|
|
3820
|
-
item.badge != null && /* @__PURE__ */ (0,
|
|
4302
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
4303
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
4304
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: item.label }),
|
|
4305
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ItemBadge, { active, children: item.badge })
|
|
3821
4306
|
] });
|
|
3822
4307
|
if (item.href) {
|
|
3823
|
-
return /* @__PURE__ */ (0,
|
|
4308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3824
4309
|
"a",
|
|
3825
4310
|
{
|
|
3826
4311
|
href: item.href,
|
|
@@ -3832,7 +4317,7 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
3832
4317
|
}
|
|
3833
4318
|
) });
|
|
3834
4319
|
}
|
|
3835
|
-
return /* @__PURE__ */ (0,
|
|
4320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3836
4321
|
"button",
|
|
3837
4322
|
{
|
|
3838
4323
|
type: "button",
|
|
@@ -3845,8 +4330,8 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
3845
4330
|
) });
|
|
3846
4331
|
}
|
|
3847
4332
|
function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
3848
|
-
return /* @__PURE__ */ (0,
|
|
3849
|
-
/* @__PURE__ */ (0,
|
|
4333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(RadixNav.Item, { children: [
|
|
4334
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
3850
4335
|
RadixNav.Trigger,
|
|
3851
4336
|
{
|
|
3852
4337
|
className: cn(
|
|
@@ -3858,9 +4343,9 @@ function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
|
3858
4343
|
),
|
|
3859
4344
|
disabled: item.disabled,
|
|
3860
4345
|
children: [
|
|
3861
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
3862
|
-
/* @__PURE__ */ (0,
|
|
3863
|
-
/* @__PURE__ */ (0,
|
|
4346
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
4347
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: item.label }),
|
|
4348
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3864
4349
|
"span",
|
|
3865
4350
|
{
|
|
3866
4351
|
"aria-hidden": true,
|
|
@@ -3871,7 +4356,7 @@ function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
|
3871
4356
|
]
|
|
3872
4357
|
}
|
|
3873
4358
|
),
|
|
3874
|
-
/* @__PURE__ */ (0,
|
|
4359
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Content, { className: "border-border bg-panel min-w-[220px] rounded-xs border p-2 shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("ul", { className: "m-0! flex list-none! flex-col gap-[2px] p-0! [&_li]:m-0!", children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DropdownLink, { item: child, active: child.id === activeId, onActivate }) }, child.id)) }) })
|
|
3875
4360
|
] });
|
|
3876
4361
|
}
|
|
3877
4362
|
function DropdownLink({ item, active, onActivate }) {
|
|
@@ -3888,13 +4373,13 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
3888
4373
|
}
|
|
3889
4374
|
onActivate(item.id);
|
|
3890
4375
|
};
|
|
3891
|
-
const inner = /* @__PURE__ */ (0,
|
|
3892
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
3893
|
-
/* @__PURE__ */ (0,
|
|
3894
|
-
item.badge != null && /* @__PURE__ */ (0,
|
|
4376
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
4377
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
4378
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "flex-1", children: item.label }),
|
|
4379
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ItemBadge, { active, children: item.badge })
|
|
3895
4380
|
] });
|
|
3896
4381
|
if (item.href) {
|
|
3897
|
-
return /* @__PURE__ */ (0,
|
|
4382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3898
4383
|
"a",
|
|
3899
4384
|
{
|
|
3900
4385
|
href: item.href,
|
|
@@ -3906,7 +4391,7 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
3906
4391
|
}
|
|
3907
4392
|
) });
|
|
3908
4393
|
}
|
|
3909
|
-
return /* @__PURE__ */ (0,
|
|
4394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3910
4395
|
"button",
|
|
3911
4396
|
{
|
|
3912
4397
|
type: "button",
|
|
@@ -3921,9 +4406,9 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
3921
4406
|
function VerticalItem({ item, activeId, onActivate }) {
|
|
3922
4407
|
const hasChildren = (item.children?.length ?? 0) > 0;
|
|
3923
4408
|
const treeActive = isActiveTree(item, activeId);
|
|
3924
|
-
const [open, setOpen] = (0,
|
|
3925
|
-
const prevTreeActive = (0,
|
|
3926
|
-
(0,
|
|
4409
|
+
const [open, setOpen] = (0, import_react62.useState)(treeActive);
|
|
4410
|
+
const prevTreeActive = (0, import_react62.useRef)(treeActive);
|
|
4411
|
+
(0, import_react62.useEffect)(() => {
|
|
3927
4412
|
if (treeActive && !prevTreeActive.current) setOpen(true);
|
|
3928
4413
|
prevTreeActive.current = treeActive;
|
|
3929
4414
|
}, [treeActive]);
|
|
@@ -3935,7 +4420,7 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
3935
4420
|
}
|
|
3936
4421
|
onActivate(item.id);
|
|
3937
4422
|
};
|
|
3938
|
-
return /* @__PURE__ */ (0,
|
|
4423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3939
4424
|
NavItem,
|
|
3940
4425
|
{
|
|
3941
4426
|
icon: item.icon,
|
|
@@ -3948,8 +4433,8 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
3948
4433
|
}
|
|
3949
4434
|
);
|
|
3950
4435
|
}
|
|
3951
|
-
return /* @__PURE__ */ (0,
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
4436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-col", children: [
|
|
4437
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
3953
4438
|
"button",
|
|
3954
4439
|
{
|
|
3955
4440
|
type: "button",
|
|
@@ -3965,18 +4450,18 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
3965
4450
|
item.disabled && "pointer-events-none opacity-50"
|
|
3966
4451
|
),
|
|
3967
4452
|
children: [
|
|
3968
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
3969
|
-
/* @__PURE__ */ (0,
|
|
3970
|
-
item.badge != null && /* @__PURE__ */ (0,
|
|
3971
|
-
/* @__PURE__ */ (0,
|
|
4453
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: item.icon }),
|
|
4454
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "flex-1 truncate", children: item.label }),
|
|
4455
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ItemBadge, { active: treeActive, children: item.badge }),
|
|
4456
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { "aria-hidden": true, className: "text-[10px] opacity-60", children: open ? "\u25BE" : "\u25B8" })
|
|
3972
4457
|
]
|
|
3973
4458
|
}
|
|
3974
4459
|
),
|
|
3975
|
-
open && /* @__PURE__ */ (0,
|
|
4460
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "border-border mt-1 ml-[18px] flex flex-col gap-[2px] border-l pl-3", children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(VerticalItem, { item: child, activeId, onActivate }, child.id)) })
|
|
3976
4461
|
] });
|
|
3977
4462
|
}
|
|
3978
4463
|
function ItemBadge({ active, children }) {
|
|
3979
|
-
return /* @__PURE__ */ (0,
|
|
4464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3980
4465
|
"span",
|
|
3981
4466
|
{
|
|
3982
4467
|
className: cn(
|
|
@@ -3988,9 +4473,105 @@ function ItemBadge({ active, children }) {
|
|
|
3988
4473
|
);
|
|
3989
4474
|
}
|
|
3990
4475
|
|
|
4476
|
+
// src/patterns/OnboardingChecklist/OnboardingChecklist.tsx
|
|
4477
|
+
var import_react63 = require("react");
|
|
4478
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4479
|
+
var statusDot = {
|
|
4480
|
+
pending: "off",
|
|
4481
|
+
"in-progress": "sync",
|
|
4482
|
+
done: "ok"
|
|
4483
|
+
};
|
|
4484
|
+
var labelStateClass = {
|
|
4485
|
+
pending: "text-text",
|
|
4486
|
+
"in-progress": "text-text",
|
|
4487
|
+
done: "text-text-dim line-through"
|
|
4488
|
+
};
|
|
4489
|
+
var OnboardingChecklist = (0, import_react63.forwardRef)(
|
|
4490
|
+
function OnboardingChecklist2({ items, onItemClick, title = "Get started", progressLabel, hideProgress, className, ...props }, ref) {
|
|
4491
|
+
const total = items.length;
|
|
4492
|
+
const done = items.filter((i) => i.status === "done").length;
|
|
4493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
4494
|
+
"section",
|
|
4495
|
+
{
|
|
4496
|
+
ref,
|
|
4497
|
+
"aria-label": typeof title === "string" ? title : void 0,
|
|
4498
|
+
className: cn(
|
|
4499
|
+
"rounded-base border-border bg-panel flex flex-col gap-3 border p-5",
|
|
4500
|
+
className
|
|
4501
|
+
),
|
|
4502
|
+
...props,
|
|
4503
|
+
children: [
|
|
4504
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("header", { className: "flex items-center gap-2", children: [
|
|
4505
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-[14px] font-medium", children: title }),
|
|
4506
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text-dim ml-auto font-mono text-[11px] tabular-nums", children: progressLabel ?? `${done} of ${total} complete` })
|
|
4507
|
+
] }),
|
|
4508
|
+
!hideProgress && total > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4509
|
+
"div",
|
|
4510
|
+
{
|
|
4511
|
+
role: "progressbar",
|
|
4512
|
+
"aria-valuemin": 0,
|
|
4513
|
+
"aria-valuemax": total,
|
|
4514
|
+
"aria-valuenow": done,
|
|
4515
|
+
"aria-label": typeof title === "string" ? `${title} progress` : "Setup progress",
|
|
4516
|
+
className: "bg-panel-2 h-[3px] w-full overflow-hidden rounded-full",
|
|
4517
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4518
|
+
"span",
|
|
4519
|
+
{
|
|
4520
|
+
"aria-hidden": true,
|
|
4521
|
+
className: cn(
|
|
4522
|
+
"block h-full rounded-full transition-[width] duration-(--duration-step)",
|
|
4523
|
+
done === total ? "bg-ok" : "bg-accent"
|
|
4524
|
+
),
|
|
4525
|
+
style: { width: `${total > 0 ? done / total * 100 : 0}%` }
|
|
4526
|
+
}
|
|
4527
|
+
)
|
|
4528
|
+
}
|
|
4529
|
+
),
|
|
4530
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("ul", { className: "m-0 flex list-none flex-col gap-1 p-0", children: items.map((item) => {
|
|
4531
|
+
const interactive = typeof onItemClick === "function";
|
|
4532
|
+
const labelBlock = /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
4533
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4534
|
+
StatusDot,
|
|
4535
|
+
{
|
|
4536
|
+
state: statusDot[item.status],
|
|
4537
|
+
pulse: item.status === "in-progress",
|
|
4538
|
+
size: 10,
|
|
4539
|
+
className: "mt-[3px]"
|
|
4540
|
+
}
|
|
4541
|
+
),
|
|
4542
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
|
|
4543
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: cn("text-[13px]", labelStateClass[item.status]), children: item.label }),
|
|
4544
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text-muted text-[12px] leading-[1.45]", children: item.description })
|
|
4545
|
+
] })
|
|
4546
|
+
] });
|
|
4547
|
+
const labelRegionClass = cn(
|
|
4548
|
+
"flex flex-1 items-start gap-3 rounded-md px-2 py-2 text-left transition-colors duration-(--duration-micro)",
|
|
4549
|
+
interactive && "cursor-pointer outline-none hover:bg-panel-2 focus-visible:ring-[3px] focus-visible:ring-accent-dim"
|
|
4550
|
+
);
|
|
4551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("li", { className: "flex items-start gap-2", children: [
|
|
4552
|
+
interactive ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4553
|
+
"button",
|
|
4554
|
+
{
|
|
4555
|
+
type: "button",
|
|
4556
|
+
"aria-current": item.status === "in-progress" ? "step" : void 0,
|
|
4557
|
+
onClick: () => onItemClick(item.id),
|
|
4558
|
+
className: labelRegionClass,
|
|
4559
|
+
children: labelBlock
|
|
4560
|
+
}
|
|
4561
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: labelRegionClass, children: labelBlock }),
|
|
4562
|
+
item.action && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "shrink-0 self-center", children: item.action })
|
|
4563
|
+
] }, item.id);
|
|
4564
|
+
}) })
|
|
4565
|
+
]
|
|
4566
|
+
}
|
|
4567
|
+
);
|
|
4568
|
+
}
|
|
4569
|
+
);
|
|
4570
|
+
OnboardingChecklist.displayName = "OnboardingChecklist";
|
|
4571
|
+
|
|
3991
4572
|
// src/patterns/Pagination/Pagination.tsx
|
|
3992
|
-
var
|
|
3993
|
-
var
|
|
4573
|
+
var import_react64 = require("react");
|
|
4574
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3994
4575
|
function buildRange(page, total, siblings) {
|
|
3995
4576
|
if (total <= 0) return [];
|
|
3996
4577
|
const items = [];
|
|
@@ -4003,9 +4584,9 @@ function buildRange(page, total, siblings) {
|
|
|
4003
4584
|
if (total > 1) items.push(total);
|
|
4004
4585
|
return items;
|
|
4005
4586
|
}
|
|
4006
|
-
var Pagination = (0,
|
|
4587
|
+
var Pagination = (0, import_react64.forwardRef)(function Pagination2({ page, total, onPageChange, siblings = 1, className, ...props }, ref) {
|
|
4007
4588
|
const items = buildRange(page, total, siblings);
|
|
4008
|
-
return /* @__PURE__ */ (0,
|
|
4589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
4009
4590
|
"nav",
|
|
4010
4591
|
{
|
|
4011
4592
|
ref,
|
|
@@ -4013,7 +4594,7 @@ var Pagination = (0, import_react58.forwardRef)(function Pagination2({ page, tot
|
|
|
4013
4594
|
className: cn("inline-flex items-center gap-1", className),
|
|
4014
4595
|
...props,
|
|
4015
4596
|
children: [
|
|
4016
|
-
/* @__PURE__ */ (0,
|
|
4597
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4017
4598
|
IconButton,
|
|
4018
4599
|
{
|
|
4019
4600
|
size: "sm",
|
|
@@ -4026,7 +4607,7 @@ var Pagination = (0, import_react58.forwardRef)(function Pagination2({ page, tot
|
|
|
4026
4607
|
),
|
|
4027
4608
|
items.map((item, i) => {
|
|
4028
4609
|
if (item === "start-ellipsis" || item === "end-ellipsis") {
|
|
4029
|
-
return /* @__PURE__ */ (0,
|
|
4610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4030
4611
|
"span",
|
|
4031
4612
|
{
|
|
4032
4613
|
"aria-hidden": true,
|
|
@@ -4037,7 +4618,7 @@ var Pagination = (0, import_react58.forwardRef)(function Pagination2({ page, tot
|
|
|
4037
4618
|
);
|
|
4038
4619
|
}
|
|
4039
4620
|
const isActive = item === page;
|
|
4040
|
-
return /* @__PURE__ */ (0,
|
|
4621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4041
4622
|
"button",
|
|
4042
4623
|
{
|
|
4043
4624
|
type: "button",
|
|
@@ -4055,7 +4636,7 @@ var Pagination = (0, import_react58.forwardRef)(function Pagination2({ page, tot
|
|
|
4055
4636
|
item
|
|
4056
4637
|
);
|
|
4057
4638
|
}),
|
|
4058
|
-
/* @__PURE__ */ (0,
|
|
4639
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4059
4640
|
IconButton,
|
|
4060
4641
|
{
|
|
4061
4642
|
size: "sm",
|
|
@@ -4074,8 +4655,8 @@ Pagination.displayName = "Pagination";
|
|
|
4074
4655
|
|
|
4075
4656
|
// src/patterns/Progress/Progress.tsx
|
|
4076
4657
|
var import_class_variance_authority11 = require("class-variance-authority");
|
|
4077
|
-
var
|
|
4078
|
-
var
|
|
4658
|
+
var import_react65 = require("react");
|
|
4659
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4079
4660
|
var trackStyles = (0, import_class_variance_authority11.cva)("w-full rounded-full bg-panel-2 overflow-hidden", {
|
|
4080
4661
|
variants: {
|
|
4081
4662
|
size: {
|
|
@@ -4097,7 +4678,7 @@ var fillStyles = (0, import_class_variance_authority11.cva)("h-full rounded-full
|
|
|
4097
4678
|
},
|
|
4098
4679
|
defaultVariants: { tone: "accent" }
|
|
4099
4680
|
});
|
|
4100
|
-
var Progress = (0,
|
|
4681
|
+
var Progress = (0, import_react65.forwardRef)(function Progress2({
|
|
4101
4682
|
value = 0,
|
|
4102
4683
|
max = 100,
|
|
4103
4684
|
indeterminate = false,
|
|
@@ -4111,15 +4692,15 @@ var Progress = (0, import_react59.forwardRef)(function Progress2({
|
|
|
4111
4692
|
const clamped = Math.min(max, Math.max(0, value));
|
|
4112
4693
|
const pct = max > 0 ? clamped / max * 100 : 0;
|
|
4113
4694
|
const display = Math.round(pct);
|
|
4114
|
-
return /* @__PURE__ */ (0,
|
|
4115
|
-
label != null && /* @__PURE__ */ (0,
|
|
4116
|
-
/* @__PURE__ */ (0,
|
|
4117
|
-
showValue && !indeterminate && /* @__PURE__ */ (0,
|
|
4695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
|
|
4696
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex text-[12px]", children: [
|
|
4697
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-text-muted", children: label }),
|
|
4698
|
+
showValue && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "text-text ml-auto font-mono tabular-nums", children: [
|
|
4118
4699
|
display,
|
|
4119
4700
|
"%"
|
|
4120
4701
|
] })
|
|
4121
4702
|
] }),
|
|
4122
|
-
/* @__PURE__ */ (0,
|
|
4703
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4123
4704
|
"div",
|
|
4124
4705
|
{
|
|
4125
4706
|
role: "progressbar",
|
|
@@ -4128,7 +4709,7 @@ var Progress = (0, import_react59.forwardRef)(function Progress2({
|
|
|
4128
4709
|
"aria-valuenow": indeterminate ? void 0 : display,
|
|
4129
4710
|
"aria-label": typeof label === "string" ? label : void 0,
|
|
4130
4711
|
className: trackStyles({ size }),
|
|
4131
|
-
children: indeterminate ? /* @__PURE__ */ (0,
|
|
4712
|
+
children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4132
4713
|
"span",
|
|
4133
4714
|
{
|
|
4134
4715
|
"aria-hidden": true,
|
|
@@ -4138,94 +4719,61 @@ var Progress = (0, import_react59.forwardRef)(function Progress2({
|
|
|
4138
4719
|
"animate-[ship-indeterminate_1.4s_linear_infinite]"
|
|
4139
4720
|
)
|
|
4140
4721
|
}
|
|
4141
|
-
) : /* @__PURE__ */ (0,
|
|
4722
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { "aria-hidden": true, className: fillStyles({ tone }), style: { width: `${pct}%` } })
|
|
4142
4723
|
}
|
|
4143
4724
|
)
|
|
4144
4725
|
] });
|
|
4145
4726
|
});
|
|
4146
4727
|
Progress.displayName = "Progress";
|
|
4147
4728
|
|
|
4148
|
-
// src/patterns/
|
|
4149
|
-
var
|
|
4150
|
-
var
|
|
4151
|
-
var
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4729
|
+
// src/patterns/PullToRefresh/PullToRefresh.tsx
|
|
4730
|
+
var import_react66 = require("react");
|
|
4731
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4732
|
+
var labels = {
|
|
4733
|
+
idle: "Pull to refresh",
|
|
4734
|
+
pulling: "Pull to refresh",
|
|
4735
|
+
ready: "Release to refresh",
|
|
4736
|
+
loading: "Refreshing\u2026"
|
|
4156
4737
|
};
|
|
4157
|
-
var
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
{
|
|
4178
|
-
ref,
|
|
4179
|
-
role: "progressbar",
|
|
4180
|
-
"aria-valuemin": 0,
|
|
4181
|
-
"aria-valuemax": max,
|
|
4182
|
-
"aria-valuenow": Math.round(pct),
|
|
4183
|
-
"aria-label": ariaLabel ?? `${Math.round(pct)}%`,
|
|
4184
|
-
className: cn("relative inline-grid place-items-center", className),
|
|
4185
|
-
style: { width: size, height: size },
|
|
4186
|
-
...props,
|
|
4187
|
-
children: [
|
|
4188
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: [
|
|
4189
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4190
|
-
"circle",
|
|
4191
|
-
{
|
|
4192
|
-
cx: size / 2,
|
|
4193
|
-
cy: size / 2,
|
|
4194
|
-
r,
|
|
4195
|
-
fill: "none",
|
|
4196
|
-
strokeWidth: thickness,
|
|
4197
|
-
className: "stroke-panel-2"
|
|
4198
|
-
}
|
|
4738
|
+
var PullToRefresh = (0, import_react66.forwardRef)(function PullToRefresh2({ state = "idle", label, className, ...props }, ref) {
|
|
4739
|
+
const isLoading = state === "loading";
|
|
4740
|
+
const transform = state === "ready" ? "rotate(180deg)" : state === "pulling" ? "rotate(90deg)" : "rotate(0deg)";
|
|
4741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
4742
|
+
"div",
|
|
4743
|
+
{
|
|
4744
|
+
ref,
|
|
4745
|
+
role: "status",
|
|
4746
|
+
"aria-live": "polite",
|
|
4747
|
+
"aria-busy": isLoading || void 0,
|
|
4748
|
+
className: cn("text-text-muted flex flex-col items-center gap-[6px] py-3", className),
|
|
4749
|
+
...props,
|
|
4750
|
+
children: [
|
|
4751
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4752
|
+
"div",
|
|
4753
|
+
{
|
|
4754
|
+
"aria-hidden": true,
|
|
4755
|
+
className: cn(
|
|
4756
|
+
"border-border border-t-accent rounded-full border-2",
|
|
4757
|
+
isLoading && "animate-[ship-spin_700ms_linear_infinite]"
|
|
4199
4758
|
),
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
)
|
|
4215
|
-
}
|
|
4216
|
-
)
|
|
4217
|
-
] }),
|
|
4218
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "absolute inset-0 grid place-items-center font-mono text-[11px] font-medium tabular-nums", children: children ?? `${Math.round(pct)}%` })
|
|
4219
|
-
]
|
|
4220
|
-
}
|
|
4221
|
-
);
|
|
4222
|
-
}
|
|
4223
|
-
);
|
|
4224
|
-
RadialProgress.displayName = "RadialProgress";
|
|
4759
|
+
style: {
|
|
4760
|
+
width: 22,
|
|
4761
|
+
height: 22,
|
|
4762
|
+
transform: isLoading ? void 0 : transform,
|
|
4763
|
+
transition: isLoading ? void 0 : "transform 200ms var(--easing-out)"
|
|
4764
|
+
}
|
|
4765
|
+
}
|
|
4766
|
+
),
|
|
4767
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-m-eyebrow font-mono tracking-wide uppercase", children: label ?? labels[state] })
|
|
4768
|
+
]
|
|
4769
|
+
}
|
|
4770
|
+
);
|
|
4771
|
+
});
|
|
4772
|
+
PullToRefresh.displayName = "PullToRefresh";
|
|
4225
4773
|
|
|
4226
4774
|
// src/patterns/Sparkline/Sparkline.tsx
|
|
4227
|
-
var
|
|
4228
|
-
var
|
|
4775
|
+
var import_react67 = require("react");
|
|
4776
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4229
4777
|
function buildPath(values, w, h) {
|
|
4230
4778
|
if (values.length === 0) return { line: "", area: "" };
|
|
4231
4779
|
const pad = 2;
|
|
@@ -4244,7 +4792,7 @@ function buildPath(values, w, h) {
|
|
|
4244
4792
|
)} L${pad.toFixed(2)},${(h - pad).toFixed(2)} Z`;
|
|
4245
4793
|
return { line, area };
|
|
4246
4794
|
}
|
|
4247
|
-
var Sparkline = (0,
|
|
4795
|
+
var Sparkline = (0, import_react67.forwardRef)(function Sparkline2({
|
|
4248
4796
|
values,
|
|
4249
4797
|
width = 160,
|
|
4250
4798
|
height = 32,
|
|
@@ -4255,8 +4803,8 @@ var Sparkline = (0, import_react61.forwardRef)(function Sparkline2({
|
|
|
4255
4803
|
"aria-label": ariaLabel = "Trend",
|
|
4256
4804
|
...props
|
|
4257
4805
|
}, ref) {
|
|
4258
|
-
const { line, area } = (0,
|
|
4259
|
-
return /* @__PURE__ */ (0,
|
|
4806
|
+
const { line, area } = (0, import_react67.useMemo)(() => buildPath(values, width, height), [values, width, height]);
|
|
4807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
4260
4808
|
"svg",
|
|
4261
4809
|
{
|
|
4262
4810
|
ref,
|
|
@@ -4268,8 +4816,8 @@ var Sparkline = (0, import_react61.forwardRef)(function Sparkline2({
|
|
|
4268
4816
|
className: cn("inline-block", className),
|
|
4269
4817
|
...props,
|
|
4270
4818
|
children: [
|
|
4271
|
-
fill && /* @__PURE__ */ (0,
|
|
4272
|
-
/* @__PURE__ */ (0,
|
|
4819
|
+
fill && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("path", { d: area, fill: stroke, fillOpacity: 0.16, stroke: "none" }),
|
|
4820
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4273
4821
|
"path",
|
|
4274
4822
|
{
|
|
4275
4823
|
d: line,
|
|
@@ -4287,16 +4835,16 @@ var Sparkline = (0, import_react61.forwardRef)(function Sparkline2({
|
|
|
4287
4835
|
Sparkline.displayName = "Sparkline";
|
|
4288
4836
|
|
|
4289
4837
|
// src/patterns/Spinner/Spinner.tsx
|
|
4290
|
-
var
|
|
4291
|
-
var
|
|
4838
|
+
var import_react68 = require("react");
|
|
4839
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4292
4840
|
var sizes = {
|
|
4293
4841
|
sm: { box: "h-3 w-3", border: "border-[2px]" },
|
|
4294
4842
|
md: { box: "h-4 w-4", border: "border-[2px]" },
|
|
4295
4843
|
lg: { box: "h-5 w-5", border: "border-[2px]" }
|
|
4296
4844
|
};
|
|
4297
|
-
var Spinner2 = (0,
|
|
4845
|
+
var Spinner2 = (0, import_react68.forwardRef)(function Spinner3({ size = "md", label = "Loading", className, ...props }, ref) {
|
|
4298
4846
|
const s = sizes[size];
|
|
4299
|
-
return /* @__PURE__ */ (0,
|
|
4847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4300
4848
|
"span",
|
|
4301
4849
|
{
|
|
4302
4850
|
ref,
|
|
@@ -4304,7 +4852,7 @@ var Spinner2 = (0, import_react62.forwardRef)(function Spinner3({ size = "md", l
|
|
|
4304
4852
|
"aria-label": label,
|
|
4305
4853
|
className: cn("inline-block", className),
|
|
4306
4854
|
...props,
|
|
4307
|
-
children: /* @__PURE__ */ (0,
|
|
4855
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4308
4856
|
"span",
|
|
4309
4857
|
{
|
|
4310
4858
|
"aria-hidden": true,
|
|
@@ -4321,15 +4869,15 @@ var Spinner2 = (0, import_react62.forwardRef)(function Spinner3({ size = "md", l
|
|
|
4321
4869
|
Spinner2.displayName = "Spinner";
|
|
4322
4870
|
|
|
4323
4871
|
// src/patterns/Stepper/Stepper.tsx
|
|
4324
|
-
var
|
|
4325
|
-
var
|
|
4872
|
+
var import_react69 = require("react");
|
|
4873
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4326
4874
|
var dotBase = "h-6 w-6 rounded-full grid place-items-center text-[11px] font-mono font-semibold border";
|
|
4327
4875
|
var dotStateClass = {
|
|
4328
4876
|
done: "bg-accent text-on-accent border-accent",
|
|
4329
4877
|
current: "bg-accent-dim text-accent border-accent",
|
|
4330
4878
|
upcoming: "bg-panel text-text-dim border-border"
|
|
4331
4879
|
};
|
|
4332
|
-
var
|
|
4880
|
+
var labelStateClass2 = {
|
|
4333
4881
|
done: "text-text",
|
|
4334
4882
|
current: "text-text font-medium",
|
|
4335
4883
|
upcoming: "text-text-dim"
|
|
@@ -4339,8 +4887,8 @@ function stateFor(index, current) {
|
|
|
4339
4887
|
if (index === current) return "current";
|
|
4340
4888
|
return "upcoming";
|
|
4341
4889
|
}
|
|
4342
|
-
var Stepper = (0,
|
|
4343
|
-
return /* @__PURE__ */ (0,
|
|
4890
|
+
var Stepper = (0, import_react69.forwardRef)(function Stepper2({ steps, current, className, ...props }, ref) {
|
|
4891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4344
4892
|
"ol",
|
|
4345
4893
|
{
|
|
4346
4894
|
ref,
|
|
@@ -4352,19 +4900,19 @@ var Stepper = (0, import_react63.forwardRef)(function Stepper2({ steps, current,
|
|
|
4352
4900
|
const id = typeof step === "string" ? void 0 : step.id;
|
|
4353
4901
|
const state = stateFor(i, current);
|
|
4354
4902
|
const connectorActive = i < current;
|
|
4355
|
-
return /* @__PURE__ */ (0,
|
|
4356
|
-
/* @__PURE__ */ (0,
|
|
4903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_react69.Fragment, { children: [
|
|
4904
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
4357
4905
|
"li",
|
|
4358
4906
|
{
|
|
4359
4907
|
"aria-current": state === "current" ? "step" : void 0,
|
|
4360
4908
|
className: "flex items-center gap-2",
|
|
4361
4909
|
children: [
|
|
4362
|
-
/* @__PURE__ */ (0,
|
|
4363
|
-
/* @__PURE__ */ (0,
|
|
4910
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { "aria-hidden": true, className: cn(dotBase, dotStateClass[state]), children: state === "done" ? "\u2713" : i + 1 }),
|
|
4911
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: cn("text-[12px]", labelStateClass2[state]), children: label })
|
|
4364
4912
|
]
|
|
4365
4913
|
}
|
|
4366
4914
|
),
|
|
4367
|
-
i < steps.length - 1 && /* @__PURE__ */ (0,
|
|
4915
|
+
i < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4368
4916
|
"span",
|
|
4369
4917
|
{
|
|
4370
4918
|
"aria-hidden": true,
|
|
@@ -4378,12 +4926,110 @@ var Stepper = (0, import_react63.forwardRef)(function Stepper2({ steps, current,
|
|
|
4378
4926
|
});
|
|
4379
4927
|
Stepper.displayName = "Stepper";
|
|
4380
4928
|
|
|
4929
|
+
// src/patterns/TabBar/TabBar.tsx
|
|
4930
|
+
var import_react70 = require("react");
|
|
4931
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4932
|
+
var TabBar = (0, import_react70.forwardRef)(function TabBar2({ items, value, defaultValue, onValueChange, className, ...props }, ref) {
|
|
4933
|
+
const isControlled = value !== void 0;
|
|
4934
|
+
const [internalValue, setInternalValue] = (0, import_react70.useState)(defaultValue);
|
|
4935
|
+
const activeId = isControlled ? value : internalValue;
|
|
4936
|
+
const handleSelect = (0, import_react70.useCallback)(
|
|
4937
|
+
(id, e) => {
|
|
4938
|
+
if (!isControlled) setInternalValue(id);
|
|
4939
|
+
onValueChange?.(id);
|
|
4940
|
+
e.stopPropagation();
|
|
4941
|
+
},
|
|
4942
|
+
[isControlled, onValueChange]
|
|
4943
|
+
);
|
|
4944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4945
|
+
"nav",
|
|
4946
|
+
{
|
|
4947
|
+
ref,
|
|
4948
|
+
"aria-label": "Primary",
|
|
4949
|
+
className: cn(
|
|
4950
|
+
"border-border bg-panel h-tabbar grid items-center border-t",
|
|
4951
|
+
"pb-[env(safe-area-inset-bottom)]",
|
|
4952
|
+
className
|
|
4953
|
+
),
|
|
4954
|
+
style: { gridTemplateColumns: `repeat(${items.length}, minmax(0, 1fr))` },
|
|
4955
|
+
...props,
|
|
4956
|
+
children: items.map((item) => {
|
|
4957
|
+
const isActive = item.id === activeId;
|
|
4958
|
+
if (item.elevated) {
|
|
4959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "grid place-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
4960
|
+
"button",
|
|
4961
|
+
{
|
|
4962
|
+
type: "button",
|
|
4963
|
+
"aria-current": isActive ? "page" : void 0,
|
|
4964
|
+
disabled: item.disabled,
|
|
4965
|
+
onClick: (e) => handleSelect(item.id, e),
|
|
4966
|
+
className: cn(
|
|
4967
|
+
"bg-accent text-on-accent grid place-items-center rounded-2xl shadow-lg",
|
|
4968
|
+
"-mt-[10px] h-[52px] w-[52px]",
|
|
4969
|
+
"transition-[filter,transform] duration-(--duration-micro)",
|
|
4970
|
+
"hover:brightness-110 active:scale-95",
|
|
4971
|
+
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]",
|
|
4972
|
+
"disabled:cursor-not-allowed disabled:opacity-40"
|
|
4973
|
+
),
|
|
4974
|
+
children: [
|
|
4975
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { "aria-hidden": true, children: item.icon }),
|
|
4976
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "sr-only", children: item.label })
|
|
4977
|
+
]
|
|
4978
|
+
}
|
|
4979
|
+
) }, item.id);
|
|
4980
|
+
}
|
|
4981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
4982
|
+
"button",
|
|
4983
|
+
{
|
|
4984
|
+
type: "button",
|
|
4985
|
+
"aria-current": isActive ? "page" : void 0,
|
|
4986
|
+
disabled: item.disabled,
|
|
4987
|
+
onClick: (e) => handleSelect(item.id, e),
|
|
4988
|
+
className: cn(
|
|
4989
|
+
"flex flex-col items-center justify-center gap-[3px] border-0 bg-transparent",
|
|
4990
|
+
"h-full cursor-pointer outline-none",
|
|
4991
|
+
"focus-visible:ring-accent-dim focus-visible:ring-[3px]",
|
|
4992
|
+
"disabled:cursor-not-allowed disabled:opacity-40",
|
|
4993
|
+
isActive ? "text-accent-text" : "text-text-muted hover:text-text"
|
|
4994
|
+
),
|
|
4995
|
+
children: [
|
|
4996
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "relative inline-flex", "aria-hidden": true, children: [
|
|
4997
|
+
item.icon,
|
|
4998
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4999
|
+
"span",
|
|
5000
|
+
{
|
|
5001
|
+
className: cn(
|
|
5002
|
+
"absolute -top-1 -right-2 rounded-full font-mono leading-none",
|
|
5003
|
+
"bg-err text-on-accent min-w-[16px] px-[5px] py-[2px] text-center text-[9px]"
|
|
5004
|
+
),
|
|
5005
|
+
children: item.badge
|
|
5006
|
+
}
|
|
5007
|
+
)
|
|
5008
|
+
] }),
|
|
5009
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "text-[10px] font-medium tracking-tight", children: [
|
|
5010
|
+
item.label,
|
|
5011
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "sr-only", children: [
|
|
5012
|
+
", ",
|
|
5013
|
+
item.badge,
|
|
5014
|
+
" unread"
|
|
5015
|
+
] })
|
|
5016
|
+
] })
|
|
5017
|
+
]
|
|
5018
|
+
},
|
|
5019
|
+
item.id
|
|
5020
|
+
);
|
|
5021
|
+
})
|
|
5022
|
+
}
|
|
5023
|
+
);
|
|
5024
|
+
});
|
|
5025
|
+
TabBar.displayName = "TabBar";
|
|
5026
|
+
|
|
4381
5027
|
// src/patterns/Tabs/Tabs.tsx
|
|
4382
5028
|
var RadixTabs = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
4383
5029
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
4384
|
-
var
|
|
4385
|
-
var
|
|
4386
|
-
var TabsVariantContext = (0,
|
|
5030
|
+
var import_react71 = require("react");
|
|
5031
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5032
|
+
var TabsVariantContext = (0, import_react71.createContext)("underline");
|
|
4387
5033
|
var tabsListStyles = (0, import_class_variance_authority12.cva)("", {
|
|
4388
5034
|
variants: {
|
|
4389
5035
|
variant: {
|
|
@@ -4413,8 +5059,8 @@ var tabsTriggerStyles = (0, import_class_variance_authority12.cva)(
|
|
|
4413
5059
|
}
|
|
4414
5060
|
}
|
|
4415
5061
|
);
|
|
4416
|
-
var Tabs = (0,
|
|
4417
|
-
return /* @__PURE__ */ (0,
|
|
5062
|
+
var Tabs = (0, import_react71.forwardRef)(function Tabs2({ variant = "underline", className, ...props }, ref) {
|
|
5063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(TabsVariantContext.Provider, { value: variant, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4418
5064
|
RadixTabs.Root,
|
|
4419
5065
|
{
|
|
4420
5066
|
ref,
|
|
@@ -4424,14 +5070,14 @@ var Tabs = (0, import_react64.forwardRef)(function Tabs2({ variant = "underline"
|
|
|
4424
5070
|
) });
|
|
4425
5071
|
});
|
|
4426
5072
|
Tabs.displayName = "Tabs";
|
|
4427
|
-
var TabsList = (0,
|
|
4428
|
-
const variant = (0,
|
|
4429
|
-
return /* @__PURE__ */ (0,
|
|
5073
|
+
var TabsList = (0, import_react71.forwardRef)(function TabsList2({ className, ...props }, ref) {
|
|
5074
|
+
const variant = (0, import_react71.useContext)(TabsVariantContext);
|
|
5075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(RadixTabs.List, { ref, className: cn(tabsListStyles({ variant }), className), ...props });
|
|
4430
5076
|
});
|
|
4431
5077
|
TabsList.displayName = "TabsList";
|
|
4432
|
-
var Tab = (0,
|
|
4433
|
-
const variant = (0,
|
|
4434
|
-
return /* @__PURE__ */ (0,
|
|
5078
|
+
var Tab = (0, import_react71.forwardRef)(function Tab2({ className, ...props }, ref) {
|
|
5079
|
+
const variant = (0, import_react71.useContext)(TabsVariantContext);
|
|
5080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4435
5081
|
RadixTabs.Trigger,
|
|
4436
5082
|
{
|
|
4437
5083
|
ref,
|
|
@@ -4441,9 +5087,9 @@ var Tab = (0, import_react64.forwardRef)(function Tab2({ className, ...props },
|
|
|
4441
5087
|
);
|
|
4442
5088
|
});
|
|
4443
5089
|
Tab.displayName = "Tab";
|
|
4444
|
-
var TabsContent = (0,
|
|
5090
|
+
var TabsContent = (0, import_react71.forwardRef)(
|
|
4445
5091
|
function TabsContent2({ className, ...props }, ref) {
|
|
4446
|
-
return /* @__PURE__ */ (0,
|
|
5092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4447
5093
|
RadixTabs.Content,
|
|
4448
5094
|
{
|
|
4449
5095
|
ref,
|
|
@@ -4459,8 +5105,8 @@ var TabsContent = (0, import_react64.forwardRef)(
|
|
|
4459
5105
|
TabsContent.displayName = "TabsContent";
|
|
4460
5106
|
|
|
4461
5107
|
// src/patterns/Timeline/Timeline.tsx
|
|
4462
|
-
var
|
|
4463
|
-
var
|
|
5108
|
+
var import_react72 = require("react");
|
|
5109
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4464
5110
|
var ringClass = {
|
|
4465
5111
|
accent: "border-accent",
|
|
4466
5112
|
ok: "border-ok",
|
|
@@ -4468,8 +5114,8 @@ var ringClass = {
|
|
|
4468
5114
|
err: "border-err",
|
|
4469
5115
|
muted: "border-text-dim"
|
|
4470
5116
|
};
|
|
4471
|
-
var Timeline = (0,
|
|
4472
|
-
return /* @__PURE__ */ (0,
|
|
5117
|
+
var Timeline = (0, import_react72.forwardRef)(function Timeline2({ events, className, children, ...props }, ref) {
|
|
5118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4473
5119
|
"ol",
|
|
4474
5120
|
{
|
|
4475
5121
|
ref,
|
|
@@ -4479,14 +5125,14 @@ var Timeline = (0, import_react65.forwardRef)(function Timeline2({ events, class
|
|
|
4479
5125
|
className
|
|
4480
5126
|
),
|
|
4481
5127
|
...props,
|
|
4482
|
-
children: events ? events.map((e, i) => /* @__PURE__ */ (0,
|
|
5128
|
+
children: events ? events.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TimelineItem, { tone: e.tone, time: e.time, description: e.description, children: e.title }, i)) : children
|
|
4483
5129
|
}
|
|
4484
5130
|
);
|
|
4485
5131
|
});
|
|
4486
5132
|
Timeline.displayName = "Timeline";
|
|
4487
|
-
var TimelineItem = (0,
|
|
4488
|
-
return /* @__PURE__ */ (0,
|
|
4489
|
-
/* @__PURE__ */ (0,
|
|
5133
|
+
var TimelineItem = (0, import_react72.forwardRef)(function TimelineItem2({ tone = "accent", description, time, className, children, ...props }, ref) {
|
|
5134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("li", { ref, className: cn("relative mb-[18px] last:mb-0", className), ...props, children: [
|
|
5135
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4490
5136
|
"span",
|
|
4491
5137
|
{
|
|
4492
5138
|
"aria-hidden": true,
|
|
@@ -4496,31 +5142,174 @@ var TimelineItem = (0, import_react65.forwardRef)(function TimelineItem2({ tone
|
|
|
4496
5142
|
)
|
|
4497
5143
|
}
|
|
4498
5144
|
),
|
|
4499
|
-
/* @__PURE__ */ (0,
|
|
4500
|
-
description && /* @__PURE__ */ (0,
|
|
4501
|
-
time && /* @__PURE__ */ (0,
|
|
5145
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "text-[13px] font-medium", children }),
|
|
5146
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "text-text-muted text-[12px]", children: description }),
|
|
5147
|
+
time && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "text-text-dim mt-[2px] font-mono text-[10px]", children: time })
|
|
4502
5148
|
] });
|
|
4503
5149
|
});
|
|
4504
5150
|
TimelineItem.displayName = "TimelineItem";
|
|
4505
5151
|
|
|
5152
|
+
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
5153
|
+
var import_react73 = require("react");
|
|
5154
|
+
|
|
5155
|
+
// src/patterns/Timeline/formatRelative.ts
|
|
5156
|
+
var SECOND = 1e3;
|
|
5157
|
+
var MINUTE = 60 * SECOND;
|
|
5158
|
+
var HOUR = 60 * MINUTE;
|
|
5159
|
+
var DAY = 24 * HOUR;
|
|
5160
|
+
var WEEK = 7 * DAY;
|
|
5161
|
+
var MONTH = 30 * DAY;
|
|
5162
|
+
var YEAR = 365 * DAY;
|
|
5163
|
+
var UNITS = [
|
|
5164
|
+
{ ms: YEAR, short: "y" },
|
|
5165
|
+
{ ms: MONTH, short: "mo" },
|
|
5166
|
+
{ ms: WEEK, short: "w" },
|
|
5167
|
+
{ ms: DAY, short: "d" },
|
|
5168
|
+
{ ms: HOUR, short: "h" },
|
|
5169
|
+
{ ms: MINUTE, short: "m" },
|
|
5170
|
+
{ ms: SECOND, short: "s" }
|
|
5171
|
+
];
|
|
5172
|
+
function formatRelative(input, now = /* @__PURE__ */ new Date()) {
|
|
5173
|
+
const target = input instanceof Date ? input : new Date(input);
|
|
5174
|
+
if (Number.isNaN(target.getTime())) return "";
|
|
5175
|
+
const diffMs = now.getTime() - target.getTime();
|
|
5176
|
+
const abs = Math.abs(diffMs);
|
|
5177
|
+
if (abs < 5 * SECOND) return "just now";
|
|
5178
|
+
for (const unit of UNITS) {
|
|
5179
|
+
if (abs >= unit.ms) {
|
|
5180
|
+
const n = Math.floor(abs / unit.ms);
|
|
5181
|
+
return diffMs >= 0 ? `${n}${unit.short} ago` : `in ${n}${unit.short}`;
|
|
5182
|
+
}
|
|
5183
|
+
}
|
|
5184
|
+
return "just now";
|
|
5185
|
+
}
|
|
5186
|
+
|
|
5187
|
+
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
5188
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5189
|
+
var ringClass2 = {
|
|
5190
|
+
accent: "border-accent",
|
|
5191
|
+
ok: "border-ok",
|
|
5192
|
+
warn: "border-warn",
|
|
5193
|
+
err: "border-err",
|
|
5194
|
+
muted: "border-text-dim"
|
|
5195
|
+
};
|
|
5196
|
+
var ActivityTimeline = (0, import_react73.forwardRef)(
|
|
5197
|
+
function ActivityTimeline2({ events, relativeNow, className, ...props }, ref) {
|
|
5198
|
+
const now = relativeNow ?? /* @__PURE__ */ new Date();
|
|
5199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5200
|
+
"ol",
|
|
5201
|
+
{
|
|
5202
|
+
ref,
|
|
5203
|
+
className: cn(
|
|
5204
|
+
"relative m-0 list-none p-0 pl-6",
|
|
5205
|
+
"before:bg-border before:absolute before:top-[6px] before:bottom-[6px] before:left-[7px] before:w-px",
|
|
5206
|
+
className
|
|
5207
|
+
),
|
|
5208
|
+
...props,
|
|
5209
|
+
children: events.map((event) => {
|
|
5210
|
+
const tone = event.tone ?? "accent";
|
|
5211
|
+
const time = formatRelative(event.at, now);
|
|
5212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("li", { className: "relative mb-4 last:mb-0", children: [
|
|
5213
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5214
|
+
"span",
|
|
5215
|
+
{
|
|
5216
|
+
"aria-hidden": true,
|
|
5217
|
+
className: cn(
|
|
5218
|
+
"bg-bg absolute top-[4px] -left-6 h-[14px] w-[14px] rounded-full border-2",
|
|
5219
|
+
ringClass2[tone]
|
|
5220
|
+
)
|
|
5221
|
+
}
|
|
5222
|
+
),
|
|
5223
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-baseline gap-2", children: [
|
|
5224
|
+
event.icon && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { "aria-hidden": true, className: "text-text-muted font-mono text-[12px]", children: event.icon }),
|
|
5225
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "text-[13px] font-medium", children: event.title }),
|
|
5226
|
+
time && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("time", { className: "text-text-dim ml-auto font-mono text-[10px]", children: time })
|
|
5227
|
+
] }),
|
|
5228
|
+
event.actor && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "text-text-muted mt-[2px] flex items-center gap-[6px] text-[12px]", children: [
|
|
5229
|
+
event.actor.avatar && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { "aria-hidden": true, className: "inline-flex", children: event.actor.avatar }),
|
|
5230
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { children: event.actor.name })
|
|
5231
|
+
] }),
|
|
5232
|
+
event.payload && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "border-border bg-panel-2 mt-2 rounded-md border px-3 py-2 font-mono text-[11px] leading-[1.5]", children: event.payload })
|
|
5233
|
+
] }, event.id);
|
|
5234
|
+
})
|
|
5235
|
+
}
|
|
5236
|
+
);
|
|
5237
|
+
}
|
|
5238
|
+
);
|
|
5239
|
+
ActivityTimeline.displayName = "ActivityTimeline";
|
|
5240
|
+
|
|
4506
5241
|
// src/patterns/Topbar/Topbar.tsx
|
|
4507
|
-
var
|
|
4508
|
-
var
|
|
4509
|
-
var Topbar = (0,
|
|
4510
|
-
|
|
5242
|
+
var import_react74 = require("react");
|
|
5243
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5244
|
+
var Topbar = (0, import_react74.forwardRef)(function Topbar2({
|
|
5245
|
+
title,
|
|
5246
|
+
eyebrow,
|
|
5247
|
+
leading,
|
|
5248
|
+
back,
|
|
5249
|
+
onBack,
|
|
5250
|
+
actions,
|
|
5251
|
+
density = "comfortable",
|
|
5252
|
+
className,
|
|
5253
|
+
children,
|
|
5254
|
+
...props
|
|
5255
|
+
}, ref) {
|
|
5256
|
+
const isTouch = density === "touch";
|
|
5257
|
+
const backHandler = typeof back === "function" ? back : back ? onBack : void 0;
|
|
5258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
4511
5259
|
"header",
|
|
4512
5260
|
{
|
|
4513
5261
|
ref,
|
|
4514
5262
|
className: cn(
|
|
4515
|
-
"border-border bg-panel flex
|
|
5263
|
+
"border-border bg-panel flex items-center border-b",
|
|
5264
|
+
isTouch ? "h-navbar gap-2 px-3" : "h-[52px] gap-4 px-5",
|
|
4516
5265
|
className
|
|
4517
5266
|
),
|
|
4518
5267
|
...props,
|
|
4519
5268
|
children: [
|
|
5269
|
+
isTouch && back && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5270
|
+
"button",
|
|
5271
|
+
{
|
|
5272
|
+
type: "button",
|
|
5273
|
+
onClick: backHandler,
|
|
5274
|
+
"aria-label": "Back",
|
|
5275
|
+
className: cn(
|
|
5276
|
+
"text-text inline-grid place-items-center rounded-md bg-transparent",
|
|
5277
|
+
// The back button is only rendered in touch density — use the
|
|
5278
|
+
// touch token (44pt) instead of `h-9 w-9` (36px) so it meets the
|
|
5279
|
+
// HIG minimum the rest of the touch surface enforces.
|
|
5280
|
+
"hover:bg-panel-2 h-touch w-touch",
|
|
5281
|
+
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]"
|
|
5282
|
+
),
|
|
5283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5284
|
+
"svg",
|
|
5285
|
+
{
|
|
5286
|
+
width: "20",
|
|
5287
|
+
height: "20",
|
|
5288
|
+
viewBox: "0 0 24 24",
|
|
5289
|
+
fill: "none",
|
|
5290
|
+
stroke: "currentColor",
|
|
5291
|
+
strokeWidth: "2",
|
|
5292
|
+
"aria-hidden": true,
|
|
5293
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("path", { d: "m15 18-6-6 6-6" })
|
|
5294
|
+
}
|
|
5295
|
+
)
|
|
5296
|
+
}
|
|
5297
|
+
),
|
|
4520
5298
|
leading,
|
|
4521
|
-
title && /* @__PURE__ */ (0,
|
|
4522
|
-
|
|
4523
|
-
|
|
5299
|
+
(title || isTouch && eyebrow) && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: cn("min-w-0", isTouch && "flex-1"), children: [
|
|
5300
|
+
isTouch && eyebrow && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "text-m-eyebrow text-accent font-mono tracking-wide uppercase", children: eyebrow }),
|
|
5301
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5302
|
+
"div",
|
|
5303
|
+
{
|
|
5304
|
+
className: cn(
|
|
5305
|
+
isTouch ? "text-m-body-lg truncate font-semibold tracking-tight" : "text-[13px] font-medium"
|
|
5306
|
+
),
|
|
5307
|
+
children: title
|
|
5308
|
+
}
|
|
5309
|
+
)
|
|
5310
|
+
] }),
|
|
5311
|
+
!isTouch && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex flex-1 items-center" }),
|
|
5312
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: cn("flex items-center", isTouch ? "gap-1" : "gap-3"), children: actions }),
|
|
4524
5313
|
children
|
|
4525
5314
|
]
|
|
4526
5315
|
}
|
|
@@ -4529,8 +5318,8 @@ var Topbar = (0, import_react66.forwardRef)(function Topbar2({ title, leading, a
|
|
|
4529
5318
|
Topbar.displayName = "Topbar";
|
|
4530
5319
|
|
|
4531
5320
|
// src/patterns/Tree/Tree.tsx
|
|
4532
|
-
var
|
|
4533
|
-
var
|
|
5321
|
+
var import_react75 = require("react");
|
|
5322
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4534
5323
|
var EMPTY_SET2 = /* @__PURE__ */ new Set();
|
|
4535
5324
|
function flattenVisible(items, expanded, level, parentId, out) {
|
|
4536
5325
|
for (const item of items) {
|
|
@@ -4541,7 +5330,7 @@ function flattenVisible(items, expanded, level, parentId, out) {
|
|
|
4541
5330
|
}
|
|
4542
5331
|
}
|
|
4543
5332
|
}
|
|
4544
|
-
var Tree = (0,
|
|
5333
|
+
var Tree = (0, import_react75.forwardRef)(function Tree2({
|
|
4545
5334
|
items,
|
|
4546
5335
|
expanded: expandedProp,
|
|
4547
5336
|
defaultExpanded,
|
|
@@ -4564,24 +5353,24 @@ var Tree = (0, import_react67.forwardRef)(function Tree2({
|
|
|
4564
5353
|
onChange: onValueChange
|
|
4565
5354
|
});
|
|
4566
5355
|
const expandedSet = expanded ?? EMPTY_SET2;
|
|
4567
|
-
const flatVisible = (0,
|
|
5356
|
+
const flatVisible = (0, import_react75.useMemo)(() => {
|
|
4568
5357
|
const out = [];
|
|
4569
5358
|
flattenVisible(items, expandedSet, 1, null, out);
|
|
4570
5359
|
return out;
|
|
4571
5360
|
}, [items, expandedSet]);
|
|
4572
|
-
const [activeId, setActiveId] = (0,
|
|
4573
|
-
(0,
|
|
5361
|
+
const [activeId, setActiveId] = (0, import_react75.useState)(null);
|
|
5362
|
+
(0, import_react75.useEffect)(() => {
|
|
4574
5363
|
if (activeId && !flatVisible.some((f) => f.id === activeId)) {
|
|
4575
5364
|
setActiveId(null);
|
|
4576
5365
|
}
|
|
4577
5366
|
}, [activeId, flatVisible]);
|
|
4578
|
-
const tabStopId = (0,
|
|
5367
|
+
const tabStopId = (0, import_react75.useMemo)(() => {
|
|
4579
5368
|
if (activeId && flatVisible.some((f) => f.id === activeId)) return activeId;
|
|
4580
5369
|
if (value && flatVisible.some((f) => f.id === value)) return value;
|
|
4581
5370
|
return flatVisible[0]?.id ?? null;
|
|
4582
5371
|
}, [activeId, flatVisible, value]);
|
|
4583
|
-
const listRef = (0,
|
|
4584
|
-
const setRefs = (0,
|
|
5372
|
+
const listRef = (0, import_react75.useRef)(null);
|
|
5373
|
+
const setRefs = (0, import_react75.useCallback)(
|
|
4585
5374
|
(node) => {
|
|
4586
5375
|
listRef.current = node;
|
|
4587
5376
|
if (typeof ref === "function") ref(node);
|
|
@@ -4589,20 +5378,20 @@ var Tree = (0, import_react67.forwardRef)(function Tree2({
|
|
|
4589
5378
|
},
|
|
4590
5379
|
[ref]
|
|
4591
5380
|
);
|
|
4592
|
-
const focusItem = (0,
|
|
5381
|
+
const focusItem = (0, import_react75.useCallback)((id) => {
|
|
4593
5382
|
const root = listRef.current;
|
|
4594
5383
|
if (!root) return;
|
|
4595
5384
|
const el = root.querySelector(`[data-treeitem-id="${CSS.escape(id)}"]`);
|
|
4596
5385
|
el?.focus();
|
|
4597
5386
|
}, []);
|
|
4598
|
-
const moveActive = (0,
|
|
5387
|
+
const moveActive = (0, import_react75.useCallback)(
|
|
4599
5388
|
(id) => {
|
|
4600
5389
|
setActiveId(id);
|
|
4601
5390
|
queueMicrotask(() => focusItem(id));
|
|
4602
5391
|
},
|
|
4603
5392
|
[focusItem]
|
|
4604
5393
|
);
|
|
4605
|
-
const toggle = (0,
|
|
5394
|
+
const toggle = (0, import_react75.useCallback)(
|
|
4606
5395
|
(id) => {
|
|
4607
5396
|
setExpanded((prev) => {
|
|
4608
5397
|
const next = new Set(prev ?? EMPTY_SET2);
|
|
@@ -4613,7 +5402,7 @@ var Tree = (0, import_react67.forwardRef)(function Tree2({
|
|
|
4613
5402
|
},
|
|
4614
5403
|
[setExpanded]
|
|
4615
5404
|
);
|
|
4616
|
-
const expand = (0,
|
|
5405
|
+
const expand = (0, import_react75.useCallback)(
|
|
4617
5406
|
(id) => {
|
|
4618
5407
|
setExpanded((prev) => {
|
|
4619
5408
|
const base = prev ?? EMPTY_SET2;
|
|
@@ -4625,7 +5414,7 @@ var Tree = (0, import_react67.forwardRef)(function Tree2({
|
|
|
4625
5414
|
},
|
|
4626
5415
|
[setExpanded]
|
|
4627
5416
|
);
|
|
4628
|
-
const collapse = (0,
|
|
5417
|
+
const collapse = (0, import_react75.useCallback)(
|
|
4629
5418
|
(id) => {
|
|
4630
5419
|
setExpanded((prev) => {
|
|
4631
5420
|
const base = prev ?? EMPTY_SET2;
|
|
@@ -4637,13 +5426,13 @@ var Tree = (0, import_react67.forwardRef)(function Tree2({
|
|
|
4637
5426
|
},
|
|
4638
5427
|
[setExpanded]
|
|
4639
5428
|
);
|
|
4640
|
-
const selectItem = (0,
|
|
5429
|
+
const selectItem = (0, import_react75.useCallback)(
|
|
4641
5430
|
(id) => {
|
|
4642
5431
|
setValue(id);
|
|
4643
5432
|
},
|
|
4644
5433
|
[setValue]
|
|
4645
5434
|
);
|
|
4646
|
-
const handleKeyDown = (0,
|
|
5435
|
+
const handleKeyDown = (0, import_react75.useCallback)(
|
|
4647
5436
|
(e) => {
|
|
4648
5437
|
onKeyDown?.(e);
|
|
4649
5438
|
if (e.defaultPrevented) return;
|
|
@@ -4723,7 +5512,7 @@ var Tree = (0, import_react67.forwardRef)(function Tree2({
|
|
|
4723
5512
|
toggle
|
|
4724
5513
|
]
|
|
4725
5514
|
);
|
|
4726
|
-
return /* @__PURE__ */ (0,
|
|
5515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4727
5516
|
"ul",
|
|
4728
5517
|
{
|
|
4729
5518
|
ref: setRefs,
|
|
@@ -4731,7 +5520,7 @@ var Tree = (0, import_react67.forwardRef)(function Tree2({
|
|
|
4731
5520
|
className: cn("flex flex-col gap-px text-[12px]", className),
|
|
4732
5521
|
onKeyDown: handleKeyDown,
|
|
4733
5522
|
...props,
|
|
4734
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
5523
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4735
5524
|
TreeItemRow,
|
|
4736
5525
|
{
|
|
4737
5526
|
item,
|
|
@@ -4766,8 +5555,8 @@ function TreeItemRow({
|
|
|
4766
5555
|
const isExpanded = hasChildren && expanded.has(item.id);
|
|
4767
5556
|
const isSelected = selected === item.id;
|
|
4768
5557
|
const isTabStop = tabStopId === item.id;
|
|
4769
|
-
return /* @__PURE__ */ (0,
|
|
4770
|
-
/* @__PURE__ */ (0,
|
|
5558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("li", { role: "none", children: [
|
|
5559
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
4771
5560
|
"div",
|
|
4772
5561
|
{
|
|
4773
5562
|
role: "treeitem",
|
|
@@ -4790,14 +5579,14 @@ function TreeItemRow({
|
|
|
4790
5579
|
isSelected ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2"
|
|
4791
5580
|
),
|
|
4792
5581
|
children: [
|
|
4793
|
-
/* @__PURE__ */ (0,
|
|
4794
|
-
item.icon && /* @__PURE__ */ (0,
|
|
4795
|
-
/* @__PURE__ */ (0,
|
|
5582
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { "aria-hidden": true, className: "text-text-dim grid w-3 place-items-center text-[10px]", children: hasChildren ? isExpanded ? "\u25BE" : "\u25B8" : "" }),
|
|
5583
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { "aria-hidden": true, className: "text-[12px] opacity-80", children: item.icon }),
|
|
5584
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "flex-1 truncate", children: item.label }),
|
|
4796
5585
|
item.trailing
|
|
4797
5586
|
]
|
|
4798
5587
|
}
|
|
4799
5588
|
),
|
|
4800
|
-
hasChildren && isExpanded && /* @__PURE__ */ (0,
|
|
5589
|
+
hasChildren && isExpanded && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("ul", { role: "group", className: "flex flex-col gap-px", children: (item.children ?? []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4801
5590
|
TreeItemRow,
|
|
4802
5591
|
{
|
|
4803
5592
|
item: child,
|
|
@@ -4813,8 +5602,84 @@ function TreeItemRow({
|
|
|
4813
5602
|
)) })
|
|
4814
5603
|
] });
|
|
4815
5604
|
}
|
|
5605
|
+
|
|
5606
|
+
// src/patterns/WizardDialog/WizardDialog.tsx
|
|
5607
|
+
var RadixDialog5 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
5608
|
+
var import_react76 = require("react");
|
|
5609
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5610
|
+
var WizardDialog = (0, import_react76.forwardRef)(function WizardDialog2({
|
|
5611
|
+
open,
|
|
5612
|
+
defaultOpen,
|
|
5613
|
+
onOpenChange,
|
|
5614
|
+
steps,
|
|
5615
|
+
initialStep = 0,
|
|
5616
|
+
onComplete,
|
|
5617
|
+
title,
|
|
5618
|
+
description,
|
|
5619
|
+
width = 560,
|
|
5620
|
+
nextLabel = "Next",
|
|
5621
|
+
completeLabel = "Done",
|
|
5622
|
+
backLabel = "Back",
|
|
5623
|
+
cancelLabel,
|
|
5624
|
+
onCancel
|
|
5625
|
+
}, ref) {
|
|
5626
|
+
const [current, setCurrent] = (0, import_react76.useState)(initialStep);
|
|
5627
|
+
const total = steps.length;
|
|
5628
|
+
const safeCurrent = Math.min(current, Math.max(0, total - 1));
|
|
5629
|
+
const step = steps[safeCurrent];
|
|
5630
|
+
const goTo = (0, import_react76.useCallback)(
|
|
5631
|
+
(index) => {
|
|
5632
|
+
setCurrent(Math.min(Math.max(0, index), Math.max(0, total - 1)));
|
|
5633
|
+
},
|
|
5634
|
+
[total]
|
|
5635
|
+
);
|
|
5636
|
+
const goNext = (0, import_react76.useCallback)(() => setCurrent((c) => Math.min(c + 1, total - 1)), [total]);
|
|
5637
|
+
const goBack = (0, import_react76.useCallback)(() => setCurrent((c) => Math.max(c - 1, 0)), []);
|
|
5638
|
+
const ctx = (0, import_react76.useMemo)(
|
|
5639
|
+
() => ({
|
|
5640
|
+
current: safeCurrent,
|
|
5641
|
+
total,
|
|
5642
|
+
goNext,
|
|
5643
|
+
goBack,
|
|
5644
|
+
goTo,
|
|
5645
|
+
isFirst: safeCurrent === 0,
|
|
5646
|
+
isLast: safeCurrent >= total - 1
|
|
5647
|
+
}),
|
|
5648
|
+
[safeCurrent, total, goNext, goBack, goTo]
|
|
5649
|
+
);
|
|
5650
|
+
const stepperSteps = (0, import_react76.useMemo)(() => steps.map((s) => ({ id: s.id, label: s.label })), [steps]);
|
|
5651
|
+
if (!step) return null;
|
|
5652
|
+
const canAdvance = step.canAdvance ? step.canAdvance(ctx) : true;
|
|
5653
|
+
const body = typeof step.content === "function" ? step.content(ctx) : step.content;
|
|
5654
|
+
const handlePrimary = () => {
|
|
5655
|
+
if (ctx.isLast) {
|
|
5656
|
+
onComplete?.();
|
|
5657
|
+
} else {
|
|
5658
|
+
goNext();
|
|
5659
|
+
}
|
|
5660
|
+
};
|
|
5661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DialogRoot, { open, defaultOpen, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(DialogContent, { ref, width, children: [
|
|
5662
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WizardTitle, { children: title }),
|
|
5663
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WizardDescription, { children: description }),
|
|
5664
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Stepper, { steps: stepperSteps, current: safeCurrent }) }),
|
|
5665
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "mb-5", children: body }),
|
|
5666
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
5667
|
+
cancelLabel && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Button, { type: "button", variant: "ghost", onClick: onCancel, children: cancelLabel }),
|
|
5668
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Button, { type: "button", variant: "secondary", onClick: goBack, disabled: ctx.isFirst, children: backLabel }),
|
|
5669
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Button, { type: "button", variant: "primary", onClick: handlePrimary, disabled: !canAdvance, children: ctx.isLast ? completeLabel : nextLabel })
|
|
5670
|
+
] })
|
|
5671
|
+
] }) });
|
|
5672
|
+
});
|
|
5673
|
+
function WizardTitle({ children }) {
|
|
5674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(RadixDialog5.Title, { className: "mb-2 text-[16px] font-medium", children });
|
|
5675
|
+
}
|
|
5676
|
+
function WizardDescription({ children }) {
|
|
5677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(RadixDialog5.Description, { className: "text-text-muted mb-4 text-[13px] leading-[1.55]", children });
|
|
5678
|
+
}
|
|
5679
|
+
WizardDialog.displayName = "WizardDialog";
|
|
4816
5680
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4817
5681
|
0 && (module.exports = {
|
|
5682
|
+
ActivityTimeline,
|
|
4818
5683
|
Alert,
|
|
4819
5684
|
AlertDialog,
|
|
4820
5685
|
AlertDialogAction,
|
|
@@ -4867,6 +5732,8 @@ function TreeItemRow({
|
|
|
4867
5732
|
FAB,
|
|
4868
5733
|
Field,
|
|
4869
5734
|
FileChip,
|
|
5735
|
+
FilterPanel,
|
|
5736
|
+
HealthScore,
|
|
4870
5737
|
HoverCard,
|
|
4871
5738
|
HoverCardContent,
|
|
4872
5739
|
HoverCardPortal,
|
|
@@ -4875,6 +5742,7 @@ function TreeItemRow({
|
|
|
4875
5742
|
IconButton,
|
|
4876
5743
|
Input,
|
|
4877
5744
|
Kbd,
|
|
5745
|
+
LargeTitle,
|
|
4878
5746
|
MenuCheckboxItem,
|
|
4879
5747
|
MenuItem,
|
|
4880
5748
|
MenuSeparator,
|
|
@@ -4888,6 +5756,7 @@ function TreeItemRow({
|
|
|
4888
5756
|
NavItem,
|
|
4889
5757
|
NavSection,
|
|
4890
5758
|
OTP,
|
|
5759
|
+
OnboardingChecklist,
|
|
4891
5760
|
Pagination,
|
|
4892
5761
|
Popover,
|
|
4893
5762
|
PopoverAnchor,
|
|
@@ -4898,9 +5767,11 @@ function TreeItemRow({
|
|
|
4898
5767
|
PopoverRoot,
|
|
4899
5768
|
PopoverTrigger,
|
|
4900
5769
|
Progress,
|
|
5770
|
+
PullToRefresh,
|
|
4901
5771
|
RadialProgress,
|
|
4902
5772
|
Radio,
|
|
4903
5773
|
RadioGroup,
|
|
5774
|
+
ScrollArea,
|
|
4904
5775
|
SearchInput,
|
|
4905
5776
|
Select,
|
|
4906
5777
|
SelectContent,
|
|
@@ -4923,6 +5794,7 @@ function TreeItemRow({
|
|
|
4923
5794
|
Stepper,
|
|
4924
5795
|
Switch,
|
|
4925
5796
|
Tab,
|
|
5797
|
+
TabBar,
|
|
4926
5798
|
Tabs,
|
|
4927
5799
|
TabsContent,
|
|
4928
5800
|
TabsList,
|
|
@@ -4941,11 +5813,13 @@ function TreeItemRow({
|
|
|
4941
5813
|
TooltipTrigger,
|
|
4942
5814
|
Topbar,
|
|
4943
5815
|
Tree,
|
|
5816
|
+
WizardDialog,
|
|
4944
5817
|
badgeStyles,
|
|
4945
5818
|
buttonStyles,
|
|
4946
5819
|
cardStyles,
|
|
4947
5820
|
cn,
|
|
4948
5821
|
filterCommandItems,
|
|
5822
|
+
formatRelative,
|
|
4949
5823
|
iconButtonStyles,
|
|
4950
5824
|
useControllableState,
|
|
4951
5825
|
useDisclosure,
|