@ship-it-ui/ui 0.0.4 → 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 +620 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +154 -8
- package/dist/index.d.ts +154 -8
- package/dist/index.js +604 -273
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/styles/globals.css +26 -0
package/dist/index.cjs
CHANGED
|
@@ -95,6 +95,7 @@ __export(index_exports, {
|
|
|
95
95
|
IconButton: () => IconButton,
|
|
96
96
|
Input: () => Input,
|
|
97
97
|
Kbd: () => Kbd,
|
|
98
|
+
LargeTitle: () => LargeTitle,
|
|
98
99
|
MenuCheckboxItem: () => MenuCheckboxItem,
|
|
99
100
|
MenuItem: () => MenuItem,
|
|
100
101
|
MenuSeparator: () => MenuSeparator,
|
|
@@ -119,6 +120,7 @@ __export(index_exports, {
|
|
|
119
120
|
PopoverRoot: () => PopoverRoot,
|
|
120
121
|
PopoverTrigger: () => PopoverTrigger,
|
|
121
122
|
Progress: () => Progress,
|
|
123
|
+
PullToRefresh: () => PullToRefresh,
|
|
122
124
|
RadialProgress: () => RadialProgress,
|
|
123
125
|
Radio: () => Radio,
|
|
124
126
|
RadioGroup: () => RadioGroup,
|
|
@@ -145,6 +147,7 @@ __export(index_exports, {
|
|
|
145
147
|
Stepper: () => Stepper,
|
|
146
148
|
Switch: () => Switch,
|
|
147
149
|
Tab: () => Tab,
|
|
150
|
+
TabBar: () => TabBar,
|
|
148
151
|
Tabs: () => Tabs,
|
|
149
152
|
TabsContent: () => TabsContent,
|
|
150
153
|
TabsList: () => TabsList,
|
|
@@ -383,14 +386,29 @@ var buttonStyles = (0, import_class_variance_authority.cva)(
|
|
|
383
386
|
md: "h-[32px] px-3 text-[12px] gap-[6px] rounded-md",
|
|
384
387
|
lg: "h-[38px] px-4 text-[13px] gap-[7px] rounded-[7px]"
|
|
385
388
|
},
|
|
389
|
+
density: {
|
|
390
|
+
comfortable: "",
|
|
391
|
+
touch: ""
|
|
392
|
+
},
|
|
386
393
|
fullWidth: {
|
|
387
394
|
true: "w-full",
|
|
388
395
|
false: ""
|
|
389
396
|
}
|
|
390
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
|
+
],
|
|
391
408
|
defaultVariants: {
|
|
392
409
|
variant: "primary",
|
|
393
410
|
size: "md",
|
|
411
|
+
density: "comfortable",
|
|
394
412
|
fullWidth: false
|
|
395
413
|
}
|
|
396
414
|
}
|
|
@@ -405,10 +423,14 @@ function Spinner({ size }) {
|
|
|
405
423
|
}
|
|
406
424
|
);
|
|
407
425
|
}
|
|
408
|
-
var iconSize = {
|
|
426
|
+
var iconSize = {
|
|
427
|
+
comfortable: { sm: 11, md: 12, lg: 13 },
|
|
428
|
+
touch: { sm: 13, md: 15, lg: 16 }
|
|
429
|
+
};
|
|
409
430
|
var Button = (0, import_react8.forwardRef)(function Button2({
|
|
410
431
|
variant,
|
|
411
432
|
size,
|
|
433
|
+
density,
|
|
412
434
|
fullWidth,
|
|
413
435
|
icon,
|
|
414
436
|
trailing,
|
|
@@ -421,8 +443,8 @@ var Button = (0, import_react8.forwardRef)(function Button2({
|
|
|
421
443
|
...props
|
|
422
444
|
}, ref) {
|
|
423
445
|
const isDisabled = disabled || loading;
|
|
424
|
-
const iconPx = iconSize[size ?? "md"];
|
|
425
|
-
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);
|
|
426
448
|
if (asChild) {
|
|
427
449
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
428
450
|
import_react_slot.Slot,
|
|
@@ -483,18 +505,28 @@ var iconButtonStyles = (0, import_class_variance_authority2.cva)(
|
|
|
483
505
|
sm: "h-[26px] w-[26px] text-[12px] rounded-[5px]",
|
|
484
506
|
md: "h-[32px] w-[32px] text-[13px] rounded-md",
|
|
485
507
|
lg: "h-[38px] w-[38px] text-[15px] rounded-[7px]"
|
|
508
|
+
},
|
|
509
|
+
density: {
|
|
510
|
+
comfortable: "",
|
|
511
|
+
touch: ""
|
|
486
512
|
}
|
|
487
513
|
},
|
|
488
|
-
|
|
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" }
|
|
489
521
|
}
|
|
490
522
|
);
|
|
491
|
-
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) {
|
|
492
524
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
493
525
|
"button",
|
|
494
526
|
{
|
|
495
527
|
ref,
|
|
496
528
|
type: type ?? "button",
|
|
497
|
-
className: cn(iconButtonStyles({ variant, size }), className),
|
|
529
|
+
className: cn(iconButtonStyles({ variant, size, density }), className),
|
|
498
530
|
...props,
|
|
499
531
|
children: icon
|
|
500
532
|
}
|
|
@@ -609,14 +641,16 @@ FAB.displayName = "FAB";
|
|
|
609
641
|
var RadixCheckbox = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
610
642
|
var import_react13 = require("react");
|
|
611
643
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
612
|
-
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) {
|
|
613
645
|
const reactId = (0, import_react13.useId)();
|
|
614
646
|
const id = idProp ?? `cb-${reactId}`;
|
|
647
|
+
const isTouch = density === "touch";
|
|
615
648
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
616
649
|
"span",
|
|
617
650
|
{
|
|
618
651
|
className: cn(
|
|
619
|
-
"inline-flex items-center
|
|
652
|
+
"inline-flex items-center select-none",
|
|
653
|
+
isTouch ? "min-h-touch gap-3" : "gap-2",
|
|
620
654
|
props.disabled && "cursor-not-allowed opacity-40",
|
|
621
655
|
className
|
|
622
656
|
),
|
|
@@ -627,18 +661,32 @@ var Checkbox = (0, import_react13.forwardRef)(function Checkbox2({ label, classN
|
|
|
627
661
|
ref,
|
|
628
662
|
id,
|
|
629
663
|
className: cn(
|
|
630
|
-
"grid
|
|
631
|
-
"
|
|
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",
|
|
632
667
|
"data-[state=checked]:bg-accent data-[state=checked]:border-accent",
|
|
633
668
|
"data-[state=indeterminate]:bg-accent data-[state=indeterminate]:border-accent",
|
|
634
669
|
"transition-[background,border-color] duration-(--duration-micro)",
|
|
635
670
|
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]"
|
|
636
671
|
),
|
|
637
672
|
...props,
|
|
638
|
-
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
|
+
)
|
|
639
680
|
}
|
|
640
681
|
),
|
|
641
|
-
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
|
+
)
|
|
642
690
|
]
|
|
643
691
|
}
|
|
644
692
|
);
|
|
@@ -689,17 +737,28 @@ var inputWrapperStyles = (0, import_class_variance_authority3.cva)(
|
|
|
689
737
|
tone: {
|
|
690
738
|
default: "bg-panel border-border focus-within:border-accent focus-within:ring-accent-dim",
|
|
691
739
|
err: "bg-panel border-err focus-within:border-err focus-within:ring-err/30"
|
|
740
|
+
},
|
|
741
|
+
density: {
|
|
742
|
+
comfortable: "",
|
|
743
|
+
touch: ""
|
|
692
744
|
}
|
|
693
745
|
},
|
|
694
|
-
|
|
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" }
|
|
695
754
|
}
|
|
696
755
|
);
|
|
697
|
-
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) {
|
|
698
757
|
const computedTone = error ? "err" : tone;
|
|
699
758
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
700
759
|
"div",
|
|
701
760
|
{
|
|
702
|
-
className: cn(inputWrapperStyles({ size, tone: computedTone }), className),
|
|
761
|
+
className: cn(inputWrapperStyles({ size, tone: computedTone, density }), className),
|
|
703
762
|
style: { width, ...style },
|
|
704
763
|
children: [
|
|
705
764
|
icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-text-dim leading-none", children: icon }),
|
|
@@ -728,27 +787,32 @@ Input.displayName = "Input";
|
|
|
728
787
|
var import_react16 = require("react");
|
|
729
788
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
730
789
|
var SearchInput = (0, import_react16.forwardRef)(function SearchInput2({
|
|
731
|
-
shortcut
|
|
732
|
-
width
|
|
790
|
+
shortcut,
|
|
791
|
+
width,
|
|
792
|
+
density = "comfortable",
|
|
733
793
|
className,
|
|
734
794
|
style,
|
|
735
795
|
placeholder = "Search\u2026",
|
|
736
796
|
"aria-label": ariaLabel,
|
|
737
797
|
...props
|
|
738
798
|
}, ref) {
|
|
799
|
+
const isTouch = density === "touch";
|
|
800
|
+
const resolvedWidth = width ?? (isTouch ? "100%" : 360);
|
|
801
|
+
const resolvedShortcut = shortcut ?? (isTouch ? void 0 : "\u2318K");
|
|
739
802
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
740
803
|
"div",
|
|
741
804
|
{
|
|
742
805
|
className: cn(
|
|
743
|
-
"
|
|
806
|
+
"flex items-center gap-2 font-sans",
|
|
807
|
+
isTouch ? "h-touch rounded-m-tab px-[14px]" : "rounded-base h-9 px-3",
|
|
744
808
|
"bg-panel-2 border-border border",
|
|
745
809
|
"focus-within:border-accent focus-within:ring-accent-dim focus-within:ring-[3px]",
|
|
746
810
|
"transition-[border-color,box-shadow] duration-(--duration-micro)",
|
|
747
811
|
className
|
|
748
812
|
),
|
|
749
|
-
style: { width, ...style },
|
|
813
|
+
style: { width: resolvedWidth, ...style },
|
|
750
814
|
children: [
|
|
751
|
-
/* @__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" }),
|
|
752
816
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
753
817
|
"input",
|
|
754
818
|
{
|
|
@@ -756,11 +820,14 @@ var SearchInput = (0, import_react16.forwardRef)(function SearchInput2({
|
|
|
756
820
|
type: "search",
|
|
757
821
|
placeholder,
|
|
758
822
|
"aria-label": ariaLabel ?? (typeof placeholder === "string" ? placeholder : "Search"),
|
|
759
|
-
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
|
+
),
|
|
760
827
|
...props
|
|
761
828
|
}
|
|
762
829
|
),
|
|
763
|
-
|
|
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 })
|
|
764
831
|
]
|
|
765
832
|
}
|
|
766
833
|
);
|
|
@@ -1088,14 +1155,26 @@ var RadixSwitch = __toESM(require("@radix-ui/react-switch"), 1);
|
|
|
1088
1155
|
var import_react21 = require("react");
|
|
1089
1156
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1090
1157
|
var trackClasses = {
|
|
1091
|
-
|
|
1092
|
-
|
|
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
|
+
}
|
|
1093
1166
|
};
|
|
1094
1167
|
var thumbClasses = {
|
|
1095
|
-
|
|
1096
|
-
|
|
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
|
+
}
|
|
1097
1176
|
};
|
|
1098
|
-
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) {
|
|
1099
1178
|
const reactId = (0, import_react21.useId)();
|
|
1100
1179
|
const id = idProp ?? `sw-${reactId}`;
|
|
1101
1180
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
@@ -1117,7 +1196,7 @@ var Switch = (0, import_react21.forwardRef)(function Switch2({ label, size = "md
|
|
|
1117
1196
|
"bg-panel-2 border-border data-[state=checked]:bg-accent data-[state=checked]:border-accent",
|
|
1118
1197
|
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]",
|
|
1119
1198
|
"disabled:cursor-not-allowed",
|
|
1120
|
-
trackClasses[size]
|
|
1199
|
+
trackClasses[density][size]
|
|
1121
1200
|
),
|
|
1122
1201
|
...props,
|
|
1123
1202
|
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
@@ -1126,13 +1205,20 @@ var Switch = (0, import_react21.forwardRef)(function Switch2({ label, size = "md
|
|
|
1126
1205
|
className: cn(
|
|
1127
1206
|
"bg-text absolute top-1/2 left-[1px] -translate-y-1/2 rounded-full shadow-sm",
|
|
1128
1207
|
"data-[state=checked]:bg-on-accent transition-transform duration-(--duration-micro)",
|
|
1129
|
-
thumbClasses[size]
|
|
1208
|
+
thumbClasses[density][size]
|
|
1130
1209
|
)
|
|
1131
1210
|
}
|
|
1132
1211
|
)
|
|
1133
1212
|
}
|
|
1134
1213
|
),
|
|
1135
|
-
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
|
+
)
|
|
1136
1222
|
]
|
|
1137
1223
|
}
|
|
1138
1224
|
);
|
|
@@ -1400,7 +1486,7 @@ var import_class_variance_authority6 = require("class-variance-authority");
|
|
|
1400
1486
|
var import_react27 = require("react");
|
|
1401
1487
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1402
1488
|
var cardStyles = (0, import_class_variance_authority6.cva)(
|
|
1403
|
-
"block bg-panel border border-border
|
|
1489
|
+
"block bg-panel border border-border transition-[border-color,transform,box-shadow] duration-(--duration-step)",
|
|
1404
1490
|
{
|
|
1405
1491
|
variants: {
|
|
1406
1492
|
variant: {
|
|
@@ -1411,14 +1497,19 @@ var cardStyles = (0, import_class_variance_authority6.cva)(
|
|
|
1411
1497
|
interactive: {
|
|
1412
1498
|
true: "cursor-pointer hover:border-border-strong hover:-translate-y-px hover:shadow",
|
|
1413
1499
|
false: ""
|
|
1500
|
+
},
|
|
1501
|
+
density: {
|
|
1502
|
+
comfortable: "rounded-base",
|
|
1503
|
+
touch: "rounded-m-card"
|
|
1414
1504
|
}
|
|
1415
1505
|
},
|
|
1416
|
-
defaultVariants: { variant: "default", interactive: false }
|
|
1506
|
+
defaultVariants: { variant: "default", interactive: false, density: "comfortable" }
|
|
1417
1507
|
}
|
|
1418
1508
|
);
|
|
1419
1509
|
var Card = (0, import_react27.forwardRef)(function Card2({
|
|
1420
1510
|
variant,
|
|
1421
1511
|
interactive,
|
|
1512
|
+
density,
|
|
1422
1513
|
title,
|
|
1423
1514
|
description,
|
|
1424
1515
|
actions,
|
|
@@ -1455,7 +1546,11 @@ var Card = (0, import_react27.forwardRef)(function Card2({
|
|
|
1455
1546
|
onKeyDown: handleKeyDown,
|
|
1456
1547
|
role: isInteractive ? "button" : void 0,
|
|
1457
1548
|
tabIndex: isInteractive ? 0 : void 0,
|
|
1458
|
-
className: cn(
|
|
1549
|
+
className: cn(
|
|
1550
|
+
cardStyles({ variant, interactive: wantsInteractive, density }),
|
|
1551
|
+
density === "touch" ? "p-4" : "p-[18px]",
|
|
1552
|
+
className
|
|
1553
|
+
),
|
|
1459
1554
|
...props,
|
|
1460
1555
|
children: [
|
|
1461
1556
|
(title || actions) && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex items-start gap-3", (description || children) && "mb-[10px]"), children: [
|
|
@@ -1470,15 +1565,16 @@ var Card = (0, import_react27.forwardRef)(function Card2({
|
|
|
1470
1565
|
);
|
|
1471
1566
|
});
|
|
1472
1567
|
Card.displayName = "Card";
|
|
1473
|
-
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) {
|
|
1474
1569
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1475
1570
|
"a",
|
|
1476
1571
|
{
|
|
1477
1572
|
ref,
|
|
1478
1573
|
href,
|
|
1479
1574
|
className: cn(
|
|
1480
|
-
cardStyles({ variant, interactive: true }),
|
|
1481
|
-
"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]",
|
|
1482
1578
|
className
|
|
1483
1579
|
),
|
|
1484
1580
|
...props,
|
|
@@ -1529,19 +1625,21 @@ StatCard.displayName = "StatCard";
|
|
|
1529
1625
|
// src/components/Chip/Chip.tsx
|
|
1530
1626
|
var import_react29 = require("react");
|
|
1531
1627
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1532
|
-
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";
|
|
1533
1630
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1534
1631
|
"span",
|
|
1535
1632
|
{
|
|
1536
1633
|
ref,
|
|
1537
1634
|
className: cn(
|
|
1538
|
-
"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]",
|
|
1539
1637
|
"bg-panel-2 text-text border-border rounded-full border",
|
|
1540
1638
|
className
|
|
1541
1639
|
),
|
|
1542
1640
|
...props,
|
|
1543
1641
|
children: [
|
|
1544
|
-
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 }),
|
|
1545
1643
|
children,
|
|
1546
1644
|
onRemove && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1547
1645
|
"button",
|
|
@@ -1549,7 +1647,10 @@ var Chip = (0, import_react29.forwardRef)(function Chip2({ icon, onRemove, class
|
|
|
1549
1647
|
type: "button",
|
|
1550
1648
|
onClick: onRemove,
|
|
1551
1649
|
"aria-label": "Remove",
|
|
1552
|
-
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
|
+
),
|
|
1553
1654
|
children: "\xD7"
|
|
1554
1655
|
}
|
|
1555
1656
|
)
|
|
@@ -1852,8 +1953,9 @@ var RadixDialog2 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
|
1852
1953
|
var import_react36 = require("react");
|
|
1853
1954
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1854
1955
|
var sideClasses = {
|
|
1855
|
-
left: "left-0 border-r border-border-strong data-[state=open]:animate-[ship-slide-in-left_220ms_var(--easing-out)]",
|
|
1856
|
-
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)]"
|
|
1857
1959
|
};
|
|
1858
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: [
|
|
1859
1961
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(RadixDialog2.Title, { className: "text-[14px] font-medium", children: title }),
|
|
@@ -1867,7 +1969,12 @@ var DrawerHeader = ({ title, onClose }) => /* @__PURE__ */ (0, import_jsx_runtim
|
|
|
1867
1969
|
}
|
|
1868
1970
|
)
|
|
1869
1971
|
] });
|
|
1870
|
-
var
|
|
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 };
|
|
1871
1978
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogRoot, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(DialogPortal, { children: [
|
|
1872
1979
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogOverlay, {}),
|
|
1873
1980
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
@@ -1876,13 +1983,14 @@ var Drawer = (0, import_react36.forwardRef)(function Drawer2({ side = "right", t
|
|
|
1876
1983
|
ref,
|
|
1877
1984
|
"aria-describedby": void 0,
|
|
1878
1985
|
className: cn(
|
|
1879
|
-
"bg-panel z-modal fixed
|
|
1986
|
+
"bg-panel z-modal fixed flex flex-col shadow-lg outline-none",
|
|
1880
1987
|
sideClasses[side]
|
|
1881
1988
|
),
|
|
1882
|
-
style:
|
|
1989
|
+
style: dimensionStyle,
|
|
1883
1990
|
children: [
|
|
1884
|
-
|
|
1885
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
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 })
|
|
1886
1994
|
]
|
|
1887
1995
|
}
|
|
1888
1996
|
)
|
|
@@ -3756,12 +3864,34 @@ var HealthScore = (0, import_react58.forwardRef)(function HealthScore2({
|
|
|
3756
3864
|
});
|
|
3757
3865
|
HealthScore.displayName = "HealthScore";
|
|
3758
3866
|
|
|
3759
|
-
// src/patterns/
|
|
3760
|
-
var RadixMenubar = __toESM(require("@radix-ui/react-menubar"), 1);
|
|
3867
|
+
// src/patterns/LargeTitle/LargeTitle.tsx
|
|
3761
3868
|
var import_react59 = require("react");
|
|
3762
3869
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3763
|
-
var
|
|
3764
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.
|
|
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)(
|
|
3765
3895
|
RadixMenubar.Root,
|
|
3766
3896
|
{
|
|
3767
3897
|
ref,
|
|
@@ -3775,9 +3905,9 @@ var Menubar = (0, import_react59.forwardRef)(function Menubar2({ className, ...p
|
|
|
3775
3905
|
});
|
|
3776
3906
|
Menubar.displayName = "Menubar";
|
|
3777
3907
|
var MenubarMenu = RadixMenubar.Menu;
|
|
3778
|
-
var MenubarTrigger = (0,
|
|
3908
|
+
var MenubarTrigger = (0, import_react60.forwardRef)(
|
|
3779
3909
|
function MenubarTrigger2({ className, ...props }, ref) {
|
|
3780
|
-
return /* @__PURE__ */ (0,
|
|
3910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3781
3911
|
RadixMenubar.Trigger,
|
|
3782
3912
|
{
|
|
3783
3913
|
ref,
|
|
@@ -3794,9 +3924,9 @@ var MenubarTrigger = (0, import_react59.forwardRef)(
|
|
|
3794
3924
|
}
|
|
3795
3925
|
);
|
|
3796
3926
|
MenubarTrigger.displayName = "MenubarTrigger";
|
|
3797
|
-
var MenubarContent = (0,
|
|
3927
|
+
var MenubarContent = (0, import_react60.forwardRef)(
|
|
3798
3928
|
function MenubarContent2({ className, sideOffset = 6, align = "start", ...props }, ref) {
|
|
3799
|
-
return /* @__PURE__ */ (0,
|
|
3929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(RadixMenubar.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3800
3930
|
RadixMenubar.Content,
|
|
3801
3931
|
{
|
|
3802
3932
|
ref,
|
|
@@ -3818,24 +3948,24 @@ var itemBase3 = cn(
|
|
|
3818
3948
|
"data-[highlighted]:bg-panel-2",
|
|
3819
3949
|
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
3820
3950
|
);
|
|
3821
|
-
var MenubarItem = (0,
|
|
3822
|
-
return /* @__PURE__ */ (0,
|
|
3951
|
+
var MenubarItem = (0, import_react60.forwardRef)(function MenubarItem2({ trailing, destructive, className, children, ...props }, ref) {
|
|
3952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3823
3953
|
RadixMenubar.Item,
|
|
3824
3954
|
{
|
|
3825
3955
|
ref,
|
|
3826
3956
|
className: cn(itemBase3, destructive ? "text-err" : "text-text", className),
|
|
3827
3957
|
...props,
|
|
3828
3958
|
children: [
|
|
3829
|
-
/* @__PURE__ */ (0,
|
|
3830
|
-
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 })
|
|
3831
3961
|
]
|
|
3832
3962
|
}
|
|
3833
3963
|
);
|
|
3834
3964
|
});
|
|
3835
3965
|
MenubarItem.displayName = "MenubarItem";
|
|
3836
|
-
var MenubarSeparator = (0,
|
|
3966
|
+
var MenubarSeparator = (0, import_react60.forwardRef)(
|
|
3837
3967
|
function MenubarSeparator2({ className, ...props }, ref) {
|
|
3838
|
-
return /* @__PURE__ */ (0,
|
|
3968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3839
3969
|
RadixMenubar.Separator,
|
|
3840
3970
|
{
|
|
3841
3971
|
ref,
|
|
@@ -3849,13 +3979,13 @@ MenubarSeparator.displayName = "MenubarSeparator";
|
|
|
3849
3979
|
|
|
3850
3980
|
// src/patterns/NavBar/NavBar.tsx
|
|
3851
3981
|
var RadixNav = __toESM(require("@radix-ui/react-navigation-menu"), 1);
|
|
3852
|
-
var
|
|
3982
|
+
var import_react62 = require("react");
|
|
3853
3983
|
|
|
3854
3984
|
// src/patterns/Sidebar/Sidebar.tsx
|
|
3855
|
-
var
|
|
3856
|
-
var
|
|
3857
|
-
var Sidebar = (0,
|
|
3858
|
-
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)(
|
|
3859
3989
|
"aside",
|
|
3860
3990
|
{
|
|
3861
3991
|
ref,
|
|
@@ -3869,12 +3999,12 @@ var Sidebar = (0, import_react60.forwardRef)(function Sidebar2({ width = 240, cl
|
|
|
3869
3999
|
);
|
|
3870
4000
|
});
|
|
3871
4001
|
Sidebar.displayName = "Sidebar";
|
|
3872
|
-
var NavItem = (0,
|
|
4002
|
+
var NavItem = (0, import_react61.forwardRef)(
|
|
3873
4003
|
function NavItem2({ icon, label, active, badge, href, disabled, className, ...props }, ref) {
|
|
3874
|
-
const inner = /* @__PURE__ */ (0,
|
|
3875
|
-
icon && /* @__PURE__ */ (0,
|
|
3876
|
-
/* @__PURE__ */ (0,
|
|
3877
|
-
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)(
|
|
3878
4008
|
"span",
|
|
3879
4009
|
{
|
|
3880
4010
|
className: cn(
|
|
@@ -3895,7 +4025,7 @@ var NavItem = (0, import_react60.forwardRef)(
|
|
|
3895
4025
|
);
|
|
3896
4026
|
if (href) {
|
|
3897
4027
|
const anchorProps = props;
|
|
3898
|
-
return /* @__PURE__ */ (0,
|
|
4028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3899
4029
|
"a",
|
|
3900
4030
|
{
|
|
3901
4031
|
ref,
|
|
@@ -3909,7 +4039,7 @@ var NavItem = (0, import_react60.forwardRef)(
|
|
|
3909
4039
|
);
|
|
3910
4040
|
}
|
|
3911
4041
|
const buttonProps = props;
|
|
3912
|
-
return /* @__PURE__ */ (0,
|
|
4042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3913
4043
|
"button",
|
|
3914
4044
|
{
|
|
3915
4045
|
ref,
|
|
@@ -3924,7 +4054,7 @@ var NavItem = (0, import_react60.forwardRef)(
|
|
|
3924
4054
|
}
|
|
3925
4055
|
);
|
|
3926
4056
|
NavItem.displayName = "NavItem";
|
|
3927
|
-
var NavSection = (0,
|
|
4057
|
+
var NavSection = (0, import_react61.forwardRef)(function NavSection2({
|
|
3928
4058
|
label,
|
|
3929
4059
|
icon,
|
|
3930
4060
|
action,
|
|
@@ -3938,16 +4068,16 @@ var NavSection = (0, import_react60.forwardRef)(function NavSection2({
|
|
|
3938
4068
|
...props
|
|
3939
4069
|
}, ref) {
|
|
3940
4070
|
const isControlled = open !== void 0;
|
|
3941
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
4071
|
+
const [internalOpen, setInternalOpen] = (0, import_react61.useState)(defaultOpen);
|
|
3942
4072
|
const isOpen = !collapsible || (isControlled ? open : internalOpen);
|
|
3943
|
-
const toggle = (0,
|
|
4073
|
+
const toggle = (0, import_react61.useCallback)(() => {
|
|
3944
4074
|
const next = !isOpen;
|
|
3945
4075
|
if (!isControlled) setInternalOpen(next);
|
|
3946
4076
|
onOpenChange?.(next);
|
|
3947
4077
|
}, [isOpen, isControlled, onOpenChange]);
|
|
3948
4078
|
const eyebrowClass = "text-text-dim flex items-center gap-[6px] px-2 pt-2 font-mono text-[9px] tracking-[1.4px] uppercase";
|
|
3949
|
-
return /* @__PURE__ */ (0,
|
|
3950
|
-
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)(
|
|
3951
4081
|
"button",
|
|
3952
4082
|
{
|
|
3953
4083
|
type: "button",
|
|
@@ -3960,18 +4090,18 @@ var NavSection = (0, import_react60.forwardRef)(function NavSection2({
|
|
|
3960
4090
|
"hover:text-text-muted"
|
|
3961
4091
|
),
|
|
3962
4092
|
children: [
|
|
3963
|
-
icon != null && /* @__PURE__ */ (0,
|
|
3964
|
-
/* @__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 }),
|
|
3965
4095
|
action,
|
|
3966
|
-
/* @__PURE__ */ (0,
|
|
4096
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
3967
4097
|
]
|
|
3968
4098
|
}
|
|
3969
|
-
) : /* @__PURE__ */ (0,
|
|
3970
|
-
icon != null && /* @__PURE__ */ (0,
|
|
3971
|
-
/* @__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 }),
|
|
3972
4102
|
action
|
|
3973
4103
|
] }),
|
|
3974
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4104
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3975
4105
|
"div",
|
|
3976
4106
|
{
|
|
3977
4107
|
className: cn("flex flex-col gap-[2px]", indent > 0 && "border-border ml-2 border-l"),
|
|
@@ -3984,12 +4114,12 @@ var NavSection = (0, import_react60.forwardRef)(function NavSection2({
|
|
|
3984
4114
|
NavSection.displayName = "NavSection";
|
|
3985
4115
|
|
|
3986
4116
|
// src/patterns/NavBar/NavBar.tsx
|
|
3987
|
-
var
|
|
4117
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3988
4118
|
function isActiveTree(item, activeId) {
|
|
3989
4119
|
if (item.id === activeId) return true;
|
|
3990
4120
|
return item.children?.some((c) => isActiveTree(c, activeId)) ?? false;
|
|
3991
4121
|
}
|
|
3992
|
-
var NavBar = (0,
|
|
4122
|
+
var NavBar = (0, import_react62.forwardRef)(function NavBar2({
|
|
3993
4123
|
orientation = "horizontal",
|
|
3994
4124
|
items,
|
|
3995
4125
|
brand,
|
|
@@ -4003,17 +4133,17 @@ var NavBar = (0, import_react61.forwardRef)(function NavBar2({
|
|
|
4003
4133
|
...props
|
|
4004
4134
|
}, ref) {
|
|
4005
4135
|
const isControlled = value !== void 0;
|
|
4006
|
-
const [internalValue, setInternalValue] = (0,
|
|
4136
|
+
const [internalValue, setInternalValue] = (0, import_react62.useState)(defaultValue);
|
|
4007
4137
|
const activeId = isControlled ? value : internalValue;
|
|
4008
|
-
const [drawerOpen, setDrawerOpen] = (0,
|
|
4009
|
-
const select = (0,
|
|
4138
|
+
const [drawerOpen, setDrawerOpen] = (0, import_react62.useState)(false);
|
|
4139
|
+
const select = (0, import_react62.useCallback)(
|
|
4010
4140
|
(id) => {
|
|
4011
4141
|
if (!isControlled) setInternalValue(id);
|
|
4012
4142
|
onValueChange?.(id);
|
|
4013
4143
|
},
|
|
4014
4144
|
[isControlled, onValueChange]
|
|
4015
4145
|
);
|
|
4016
|
-
const handleItemActivate = (0,
|
|
4146
|
+
const handleItemActivate = (0, import_react62.useCallback)(
|
|
4017
4147
|
(id) => {
|
|
4018
4148
|
select(id);
|
|
4019
4149
|
setDrawerOpen(false);
|
|
@@ -4025,7 +4155,7 @@ var NavBar = (0, import_react61.forwardRef)(function NavBar2({
|
|
|
4025
4155
|
// drawer is open on a viewport that's resizing past `md`, both navs can
|
|
4026
4156
|
// sit in the DOM together. Identical accessible names would trip axe's
|
|
4027
4157
|
// `landmark-unique` rule.
|
|
4028
|
-
/* @__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)(
|
|
4029
4159
|
VerticalItem,
|
|
4030
4160
|
{
|
|
4031
4161
|
item,
|
|
@@ -4035,14 +4165,14 @@ var NavBar = (0, import_react61.forwardRef)(function NavBar2({
|
|
|
4035
4165
|
item.id
|
|
4036
4166
|
)) })
|
|
4037
4167
|
);
|
|
4038
|
-
const mobileBar = responsive ? /* @__PURE__ */ (0,
|
|
4168
|
+
const mobileBar = responsive ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
4039
4169
|
"div",
|
|
4040
4170
|
{
|
|
4041
4171
|
className: cn(
|
|
4042
4172
|
"border-border bg-panel z-overlay sticky top-0 flex h-[52px] items-center gap-4 border-b px-5 md:hidden"
|
|
4043
4173
|
),
|
|
4044
4174
|
children: [
|
|
4045
|
-
/* @__PURE__ */ (0,
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4046
4176
|
"button",
|
|
4047
4177
|
{
|
|
4048
4178
|
type: "button",
|
|
@@ -4052,15 +4182,15 @@ var NavBar = (0, import_react61.forwardRef)(function NavBar2({
|
|
|
4052
4182
|
children: "\u2630"
|
|
4053
4183
|
}
|
|
4054
4184
|
),
|
|
4055
|
-
brand && /* @__PURE__ */ (0,
|
|
4056
|
-
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 })
|
|
4057
4187
|
]
|
|
4058
4188
|
}
|
|
4059
4189
|
) : null;
|
|
4060
4190
|
if (orientation === "horizontal") {
|
|
4061
|
-
return /* @__PURE__ */ (0,
|
|
4191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
4062
4192
|
mobileBar,
|
|
4063
|
-
/* @__PURE__ */ (0,
|
|
4193
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
4064
4194
|
"header",
|
|
4065
4195
|
{
|
|
4066
4196
|
ref,
|
|
@@ -4071,10 +4201,10 @@ var NavBar = (0, import_react61.forwardRef)(function NavBar2({
|
|
|
4071
4201
|
),
|
|
4072
4202
|
...props,
|
|
4073
4203
|
children: [
|
|
4074
|
-
brand && /* @__PURE__ */ (0,
|
|
4075
|
-
/* @__PURE__ */ (0,
|
|
4076
|
-
/* @__PURE__ */ (0,
|
|
4077
|
-
(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)(
|
|
4078
4208
|
HorizontalDropdown,
|
|
4079
4209
|
{
|
|
4080
4210
|
item,
|
|
@@ -4083,7 +4213,7 @@ var NavBar = (0, import_react61.forwardRef)(function NavBar2({
|
|
|
4083
4213
|
onActivate: handleItemActivate
|
|
4084
4214
|
},
|
|
4085
4215
|
item.id
|
|
4086
|
-
) : /* @__PURE__ */ (0,
|
|
4216
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4087
4217
|
HorizontalLink,
|
|
4088
4218
|
{
|
|
4089
4219
|
item,
|
|
@@ -4092,13 +4222,13 @@ var NavBar = (0, import_react61.forwardRef)(function NavBar2({
|
|
|
4092
4222
|
}
|
|
4093
4223
|
) }, item.id)
|
|
4094
4224
|
) }),
|
|
4095
|
-
/* @__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)]" }) })
|
|
4096
4226
|
] }),
|
|
4097
|
-
actions && /* @__PURE__ */ (0,
|
|
4227
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex items-center gap-3", children: actions })
|
|
4098
4228
|
]
|
|
4099
4229
|
}
|
|
4100
4230
|
),
|
|
4101
|
-
responsive && /* @__PURE__ */ (0,
|
|
4231
|
+
responsive && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4102
4232
|
Drawer,
|
|
4103
4233
|
{
|
|
4104
4234
|
open: drawerOpen,
|
|
@@ -4111,9 +4241,9 @@ var NavBar = (0, import_react61.forwardRef)(function NavBar2({
|
|
|
4111
4241
|
)
|
|
4112
4242
|
] });
|
|
4113
4243
|
}
|
|
4114
|
-
return /* @__PURE__ */ (0,
|
|
4244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
4115
4245
|
mobileBar,
|
|
4116
|
-
/* @__PURE__ */ (0,
|
|
4246
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
4117
4247
|
"aside",
|
|
4118
4248
|
{
|
|
4119
4249
|
ref,
|
|
@@ -4126,8 +4256,8 @@ var NavBar = (0, import_react61.forwardRef)(function NavBar2({
|
|
|
4126
4256
|
),
|
|
4127
4257
|
...props,
|
|
4128
4258
|
children: [
|
|
4129
|
-
brand && /* @__PURE__ */ (0,
|
|
4130
|
-
/* @__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)(
|
|
4131
4261
|
VerticalItem,
|
|
4132
4262
|
{
|
|
4133
4263
|
item,
|
|
@@ -4136,11 +4266,11 @@ var NavBar = (0, import_react61.forwardRef)(function NavBar2({
|
|
|
4136
4266
|
},
|
|
4137
4267
|
item.id
|
|
4138
4268
|
)) }),
|
|
4139
|
-
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 })
|
|
4140
4270
|
]
|
|
4141
4271
|
}
|
|
4142
4272
|
),
|
|
4143
|
-
responsive && /* @__PURE__ */ (0,
|
|
4273
|
+
responsive && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4144
4274
|
Drawer,
|
|
4145
4275
|
{
|
|
4146
4276
|
open: drawerOpen,
|
|
@@ -4169,13 +4299,13 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
4169
4299
|
}
|
|
4170
4300
|
onActivate(item.id);
|
|
4171
4301
|
};
|
|
4172
|
-
const inner = /* @__PURE__ */ (0,
|
|
4173
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
4174
|
-
/* @__PURE__ */ (0,
|
|
4175
|
-
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 })
|
|
4176
4306
|
] });
|
|
4177
4307
|
if (item.href) {
|
|
4178
|
-
return /* @__PURE__ */ (0,
|
|
4308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4179
4309
|
"a",
|
|
4180
4310
|
{
|
|
4181
4311
|
href: item.href,
|
|
@@ -4187,7 +4317,7 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
4187
4317
|
}
|
|
4188
4318
|
) });
|
|
4189
4319
|
}
|
|
4190
|
-
return /* @__PURE__ */ (0,
|
|
4320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4191
4321
|
"button",
|
|
4192
4322
|
{
|
|
4193
4323
|
type: "button",
|
|
@@ -4200,8 +4330,8 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
4200
4330
|
) });
|
|
4201
4331
|
}
|
|
4202
4332
|
function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
4203
|
-
return /* @__PURE__ */ (0,
|
|
4204
|
-
/* @__PURE__ */ (0,
|
|
4333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(RadixNav.Item, { children: [
|
|
4334
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
4205
4335
|
RadixNav.Trigger,
|
|
4206
4336
|
{
|
|
4207
4337
|
className: cn(
|
|
@@ -4213,9 +4343,9 @@ function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
|
4213
4343
|
),
|
|
4214
4344
|
disabled: item.disabled,
|
|
4215
4345
|
children: [
|
|
4216
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
4217
|
-
/* @__PURE__ */ (0,
|
|
4218
|
-
/* @__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)(
|
|
4219
4349
|
"span",
|
|
4220
4350
|
{
|
|
4221
4351
|
"aria-hidden": true,
|
|
@@ -4226,7 +4356,7 @@ function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
|
4226
4356
|
]
|
|
4227
4357
|
}
|
|
4228
4358
|
),
|
|
4229
|
-
/* @__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)) }) })
|
|
4230
4360
|
] });
|
|
4231
4361
|
}
|
|
4232
4362
|
function DropdownLink({ item, active, onActivate }) {
|
|
@@ -4243,13 +4373,13 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
4243
4373
|
}
|
|
4244
4374
|
onActivate(item.id);
|
|
4245
4375
|
};
|
|
4246
|
-
const inner = /* @__PURE__ */ (0,
|
|
4247
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
4248
|
-
/* @__PURE__ */ (0,
|
|
4249
|
-
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 })
|
|
4250
4380
|
] });
|
|
4251
4381
|
if (item.href) {
|
|
4252
|
-
return /* @__PURE__ */ (0,
|
|
4382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4253
4383
|
"a",
|
|
4254
4384
|
{
|
|
4255
4385
|
href: item.href,
|
|
@@ -4261,7 +4391,7 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
4261
4391
|
}
|
|
4262
4392
|
) });
|
|
4263
4393
|
}
|
|
4264
|
-
return /* @__PURE__ */ (0,
|
|
4394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4265
4395
|
"button",
|
|
4266
4396
|
{
|
|
4267
4397
|
type: "button",
|
|
@@ -4276,9 +4406,9 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
4276
4406
|
function VerticalItem({ item, activeId, onActivate }) {
|
|
4277
4407
|
const hasChildren = (item.children?.length ?? 0) > 0;
|
|
4278
4408
|
const treeActive = isActiveTree(item, activeId);
|
|
4279
|
-
const [open, setOpen] = (0,
|
|
4280
|
-
const prevTreeActive = (0,
|
|
4281
|
-
(0,
|
|
4409
|
+
const [open, setOpen] = (0, import_react62.useState)(treeActive);
|
|
4410
|
+
const prevTreeActive = (0, import_react62.useRef)(treeActive);
|
|
4411
|
+
(0, import_react62.useEffect)(() => {
|
|
4282
4412
|
if (treeActive && !prevTreeActive.current) setOpen(true);
|
|
4283
4413
|
prevTreeActive.current = treeActive;
|
|
4284
4414
|
}, [treeActive]);
|
|
@@ -4290,7 +4420,7 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
4290
4420
|
}
|
|
4291
4421
|
onActivate(item.id);
|
|
4292
4422
|
};
|
|
4293
|
-
return /* @__PURE__ */ (0,
|
|
4423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4294
4424
|
NavItem,
|
|
4295
4425
|
{
|
|
4296
4426
|
icon: item.icon,
|
|
@@ -4303,8 +4433,8 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
4303
4433
|
}
|
|
4304
4434
|
);
|
|
4305
4435
|
}
|
|
4306
|
-
return /* @__PURE__ */ (0,
|
|
4307
|
-
/* @__PURE__ */ (0,
|
|
4436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-col", children: [
|
|
4437
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
4308
4438
|
"button",
|
|
4309
4439
|
{
|
|
4310
4440
|
type: "button",
|
|
@@ -4320,18 +4450,18 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
4320
4450
|
item.disabled && "pointer-events-none opacity-50"
|
|
4321
4451
|
),
|
|
4322
4452
|
children: [
|
|
4323
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
4324
|
-
/* @__PURE__ */ (0,
|
|
4325
|
-
item.badge != null && /* @__PURE__ */ (0,
|
|
4326
|
-
/* @__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" })
|
|
4327
4457
|
]
|
|
4328
4458
|
}
|
|
4329
4459
|
),
|
|
4330
|
-
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)) })
|
|
4331
4461
|
] });
|
|
4332
4462
|
}
|
|
4333
4463
|
function ItemBadge({ active, children }) {
|
|
4334
|
-
return /* @__PURE__ */ (0,
|
|
4464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4335
4465
|
"span",
|
|
4336
4466
|
{
|
|
4337
4467
|
className: cn(
|
|
@@ -4344,8 +4474,8 @@ function ItemBadge({ active, children }) {
|
|
|
4344
4474
|
}
|
|
4345
4475
|
|
|
4346
4476
|
// src/patterns/OnboardingChecklist/OnboardingChecklist.tsx
|
|
4347
|
-
var
|
|
4348
|
-
var
|
|
4477
|
+
var import_react63 = require("react");
|
|
4478
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4349
4479
|
var statusDot = {
|
|
4350
4480
|
pending: "off",
|
|
4351
4481
|
"in-progress": "sync",
|
|
@@ -4356,11 +4486,11 @@ var labelStateClass = {
|
|
|
4356
4486
|
"in-progress": "text-text",
|
|
4357
4487
|
done: "text-text-dim line-through"
|
|
4358
4488
|
};
|
|
4359
|
-
var OnboardingChecklist = (0,
|
|
4489
|
+
var OnboardingChecklist = (0, import_react63.forwardRef)(
|
|
4360
4490
|
function OnboardingChecklist2({ items, onItemClick, title = "Get started", progressLabel, hideProgress, className, ...props }, ref) {
|
|
4361
4491
|
const total = items.length;
|
|
4362
4492
|
const done = items.filter((i) => i.status === "done").length;
|
|
4363
|
-
return /* @__PURE__ */ (0,
|
|
4493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
4364
4494
|
"section",
|
|
4365
4495
|
{
|
|
4366
4496
|
ref,
|
|
@@ -4371,11 +4501,11 @@ var OnboardingChecklist = (0, import_react62.forwardRef)(
|
|
|
4371
4501
|
),
|
|
4372
4502
|
...props,
|
|
4373
4503
|
children: [
|
|
4374
|
-
/* @__PURE__ */ (0,
|
|
4375
|
-
/* @__PURE__ */ (0,
|
|
4376
|
-
/* @__PURE__ */ (0,
|
|
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` })
|
|
4377
4507
|
] }),
|
|
4378
|
-
!hideProgress && total > 0 && /* @__PURE__ */ (0,
|
|
4508
|
+
!hideProgress && total > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4379
4509
|
"div",
|
|
4380
4510
|
{
|
|
4381
4511
|
role: "progressbar",
|
|
@@ -4384,7 +4514,7 @@ var OnboardingChecklist = (0, import_react62.forwardRef)(
|
|
|
4384
4514
|
"aria-valuenow": done,
|
|
4385
4515
|
"aria-label": typeof title === "string" ? `${title} progress` : "Setup progress",
|
|
4386
4516
|
className: "bg-panel-2 h-[3px] w-full overflow-hidden rounded-full",
|
|
4387
|
-
children: /* @__PURE__ */ (0,
|
|
4517
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4388
4518
|
"span",
|
|
4389
4519
|
{
|
|
4390
4520
|
"aria-hidden": true,
|
|
@@ -4397,10 +4527,10 @@ var OnboardingChecklist = (0, import_react62.forwardRef)(
|
|
|
4397
4527
|
)
|
|
4398
4528
|
}
|
|
4399
4529
|
),
|
|
4400
|
-
/* @__PURE__ */ (0,
|
|
4530
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("ul", { className: "m-0 flex list-none flex-col gap-1 p-0", children: items.map((item) => {
|
|
4401
4531
|
const interactive = typeof onItemClick === "function";
|
|
4402
|
-
const labelBlock = /* @__PURE__ */ (0,
|
|
4403
|
-
/* @__PURE__ */ (0,
|
|
4532
|
+
const labelBlock = /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
4533
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4404
4534
|
StatusDot,
|
|
4405
4535
|
{
|
|
4406
4536
|
state: statusDot[item.status],
|
|
@@ -4409,17 +4539,17 @@ var OnboardingChecklist = (0, import_react62.forwardRef)(
|
|
|
4409
4539
|
className: "mt-[3px]"
|
|
4410
4540
|
}
|
|
4411
4541
|
),
|
|
4412
|
-
/* @__PURE__ */ (0,
|
|
4413
|
-
/* @__PURE__ */ (0,
|
|
4414
|
-
item.description && /* @__PURE__ */ (0,
|
|
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 })
|
|
4415
4545
|
] })
|
|
4416
4546
|
] });
|
|
4417
4547
|
const labelRegionClass = cn(
|
|
4418
4548
|
"flex flex-1 items-start gap-3 rounded-md px-2 py-2 text-left transition-colors duration-(--duration-micro)",
|
|
4419
4549
|
interactive && "cursor-pointer outline-none hover:bg-panel-2 focus-visible:ring-[3px] focus-visible:ring-accent-dim"
|
|
4420
4550
|
);
|
|
4421
|
-
return /* @__PURE__ */ (0,
|
|
4422
|
-
interactive ? /* @__PURE__ */ (0,
|
|
4551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("li", { className: "flex items-start gap-2", children: [
|
|
4552
|
+
interactive ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4423
4553
|
"button",
|
|
4424
4554
|
{
|
|
4425
4555
|
type: "button",
|
|
@@ -4428,8 +4558,8 @@ var OnboardingChecklist = (0, import_react62.forwardRef)(
|
|
|
4428
4558
|
className: labelRegionClass,
|
|
4429
4559
|
children: labelBlock
|
|
4430
4560
|
}
|
|
4431
|
-
) : /* @__PURE__ */ (0,
|
|
4432
|
-
item.action && /* @__PURE__ */ (0,
|
|
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 })
|
|
4433
4563
|
] }, item.id);
|
|
4434
4564
|
}) })
|
|
4435
4565
|
]
|
|
@@ -4440,8 +4570,8 @@ var OnboardingChecklist = (0, import_react62.forwardRef)(
|
|
|
4440
4570
|
OnboardingChecklist.displayName = "OnboardingChecklist";
|
|
4441
4571
|
|
|
4442
4572
|
// src/patterns/Pagination/Pagination.tsx
|
|
4443
|
-
var
|
|
4444
|
-
var
|
|
4573
|
+
var import_react64 = require("react");
|
|
4574
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4445
4575
|
function buildRange(page, total, siblings) {
|
|
4446
4576
|
if (total <= 0) return [];
|
|
4447
4577
|
const items = [];
|
|
@@ -4454,9 +4584,9 @@ function buildRange(page, total, siblings) {
|
|
|
4454
4584
|
if (total > 1) items.push(total);
|
|
4455
4585
|
return items;
|
|
4456
4586
|
}
|
|
4457
|
-
var Pagination = (0,
|
|
4587
|
+
var Pagination = (0, import_react64.forwardRef)(function Pagination2({ page, total, onPageChange, siblings = 1, className, ...props }, ref) {
|
|
4458
4588
|
const items = buildRange(page, total, siblings);
|
|
4459
|
-
return /* @__PURE__ */ (0,
|
|
4589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
4460
4590
|
"nav",
|
|
4461
4591
|
{
|
|
4462
4592
|
ref,
|
|
@@ -4464,7 +4594,7 @@ var Pagination = (0, import_react63.forwardRef)(function Pagination2({ page, tot
|
|
|
4464
4594
|
className: cn("inline-flex items-center gap-1", className),
|
|
4465
4595
|
...props,
|
|
4466
4596
|
children: [
|
|
4467
|
-
/* @__PURE__ */ (0,
|
|
4597
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4468
4598
|
IconButton,
|
|
4469
4599
|
{
|
|
4470
4600
|
size: "sm",
|
|
@@ -4477,7 +4607,7 @@ var Pagination = (0, import_react63.forwardRef)(function Pagination2({ page, tot
|
|
|
4477
4607
|
),
|
|
4478
4608
|
items.map((item, i) => {
|
|
4479
4609
|
if (item === "start-ellipsis" || item === "end-ellipsis") {
|
|
4480
|
-
return /* @__PURE__ */ (0,
|
|
4610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4481
4611
|
"span",
|
|
4482
4612
|
{
|
|
4483
4613
|
"aria-hidden": true,
|
|
@@ -4488,7 +4618,7 @@ var Pagination = (0, import_react63.forwardRef)(function Pagination2({ page, tot
|
|
|
4488
4618
|
);
|
|
4489
4619
|
}
|
|
4490
4620
|
const isActive = item === page;
|
|
4491
|
-
return /* @__PURE__ */ (0,
|
|
4621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4492
4622
|
"button",
|
|
4493
4623
|
{
|
|
4494
4624
|
type: "button",
|
|
@@ -4506,7 +4636,7 @@ var Pagination = (0, import_react63.forwardRef)(function Pagination2({ page, tot
|
|
|
4506
4636
|
item
|
|
4507
4637
|
);
|
|
4508
4638
|
}),
|
|
4509
|
-
/* @__PURE__ */ (0,
|
|
4639
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4510
4640
|
IconButton,
|
|
4511
4641
|
{
|
|
4512
4642
|
size: "sm",
|
|
@@ -4525,8 +4655,8 @@ Pagination.displayName = "Pagination";
|
|
|
4525
4655
|
|
|
4526
4656
|
// src/patterns/Progress/Progress.tsx
|
|
4527
4657
|
var import_class_variance_authority11 = require("class-variance-authority");
|
|
4528
|
-
var
|
|
4529
|
-
var
|
|
4658
|
+
var import_react65 = require("react");
|
|
4659
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4530
4660
|
var trackStyles = (0, import_class_variance_authority11.cva)("w-full rounded-full bg-panel-2 overflow-hidden", {
|
|
4531
4661
|
variants: {
|
|
4532
4662
|
size: {
|
|
@@ -4548,7 +4678,7 @@ var fillStyles = (0, import_class_variance_authority11.cva)("h-full rounded-full
|
|
|
4548
4678
|
},
|
|
4549
4679
|
defaultVariants: { tone: "accent" }
|
|
4550
4680
|
});
|
|
4551
|
-
var Progress = (0,
|
|
4681
|
+
var Progress = (0, import_react65.forwardRef)(function Progress2({
|
|
4552
4682
|
value = 0,
|
|
4553
4683
|
max = 100,
|
|
4554
4684
|
indeterminate = false,
|
|
@@ -4562,15 +4692,15 @@ var Progress = (0, import_react64.forwardRef)(function Progress2({
|
|
|
4562
4692
|
const clamped = Math.min(max, Math.max(0, value));
|
|
4563
4693
|
const pct = max > 0 ? clamped / max * 100 : 0;
|
|
4564
4694
|
const display = Math.round(pct);
|
|
4565
|
-
return /* @__PURE__ */ (0,
|
|
4566
|
-
label != null && /* @__PURE__ */ (0,
|
|
4567
|
-
/* @__PURE__ */ (0,
|
|
4568
|
-
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: [
|
|
4569
4699
|
display,
|
|
4570
4700
|
"%"
|
|
4571
4701
|
] })
|
|
4572
4702
|
] }),
|
|
4573
|
-
/* @__PURE__ */ (0,
|
|
4703
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4574
4704
|
"div",
|
|
4575
4705
|
{
|
|
4576
4706
|
role: "progressbar",
|
|
@@ -4579,7 +4709,7 @@ var Progress = (0, import_react64.forwardRef)(function Progress2({
|
|
|
4579
4709
|
"aria-valuenow": indeterminate ? void 0 : display,
|
|
4580
4710
|
"aria-label": typeof label === "string" ? label : void 0,
|
|
4581
4711
|
className: trackStyles({ size }),
|
|
4582
|
-
children: indeterminate ? /* @__PURE__ */ (0,
|
|
4712
|
+
children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4583
4713
|
"span",
|
|
4584
4714
|
{
|
|
4585
4715
|
"aria-hidden": true,
|
|
@@ -4589,16 +4719,61 @@ var Progress = (0, import_react64.forwardRef)(function Progress2({
|
|
|
4589
4719
|
"animate-[ship-indeterminate_1.4s_linear_infinite]"
|
|
4590
4720
|
)
|
|
4591
4721
|
}
|
|
4592
|
-
) : /* @__PURE__ */ (0,
|
|
4722
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { "aria-hidden": true, className: fillStyles({ tone }), style: { width: `${pct}%` } })
|
|
4593
4723
|
}
|
|
4594
4724
|
)
|
|
4595
4725
|
] });
|
|
4596
4726
|
});
|
|
4597
4727
|
Progress.displayName = "Progress";
|
|
4598
4728
|
|
|
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"
|
|
4737
|
+
};
|
|
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]"
|
|
4758
|
+
),
|
|
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";
|
|
4773
|
+
|
|
4599
4774
|
// src/patterns/Sparkline/Sparkline.tsx
|
|
4600
|
-
var
|
|
4601
|
-
var
|
|
4775
|
+
var import_react67 = require("react");
|
|
4776
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4602
4777
|
function buildPath(values, w, h) {
|
|
4603
4778
|
if (values.length === 0) return { line: "", area: "" };
|
|
4604
4779
|
const pad = 2;
|
|
@@ -4617,7 +4792,7 @@ function buildPath(values, w, h) {
|
|
|
4617
4792
|
)} L${pad.toFixed(2)},${(h - pad).toFixed(2)} Z`;
|
|
4618
4793
|
return { line, area };
|
|
4619
4794
|
}
|
|
4620
|
-
var Sparkline = (0,
|
|
4795
|
+
var Sparkline = (0, import_react67.forwardRef)(function Sparkline2({
|
|
4621
4796
|
values,
|
|
4622
4797
|
width = 160,
|
|
4623
4798
|
height = 32,
|
|
@@ -4628,8 +4803,8 @@ var Sparkline = (0, import_react65.forwardRef)(function Sparkline2({
|
|
|
4628
4803
|
"aria-label": ariaLabel = "Trend",
|
|
4629
4804
|
...props
|
|
4630
4805
|
}, ref) {
|
|
4631
|
-
const { line, area } = (0,
|
|
4632
|
-
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)(
|
|
4633
4808
|
"svg",
|
|
4634
4809
|
{
|
|
4635
4810
|
ref,
|
|
@@ -4641,8 +4816,8 @@ var Sparkline = (0, import_react65.forwardRef)(function Sparkline2({
|
|
|
4641
4816
|
className: cn("inline-block", className),
|
|
4642
4817
|
...props,
|
|
4643
4818
|
children: [
|
|
4644
|
-
fill && /* @__PURE__ */ (0,
|
|
4645
|
-
/* @__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)(
|
|
4646
4821
|
"path",
|
|
4647
4822
|
{
|
|
4648
4823
|
d: line,
|
|
@@ -4660,16 +4835,16 @@ var Sparkline = (0, import_react65.forwardRef)(function Sparkline2({
|
|
|
4660
4835
|
Sparkline.displayName = "Sparkline";
|
|
4661
4836
|
|
|
4662
4837
|
// src/patterns/Spinner/Spinner.tsx
|
|
4663
|
-
var
|
|
4664
|
-
var
|
|
4838
|
+
var import_react68 = require("react");
|
|
4839
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4665
4840
|
var sizes = {
|
|
4666
4841
|
sm: { box: "h-3 w-3", border: "border-[2px]" },
|
|
4667
4842
|
md: { box: "h-4 w-4", border: "border-[2px]" },
|
|
4668
4843
|
lg: { box: "h-5 w-5", border: "border-[2px]" }
|
|
4669
4844
|
};
|
|
4670
|
-
var Spinner2 = (0,
|
|
4845
|
+
var Spinner2 = (0, import_react68.forwardRef)(function Spinner3({ size = "md", label = "Loading", className, ...props }, ref) {
|
|
4671
4846
|
const s = sizes[size];
|
|
4672
|
-
return /* @__PURE__ */ (0,
|
|
4847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4673
4848
|
"span",
|
|
4674
4849
|
{
|
|
4675
4850
|
ref,
|
|
@@ -4677,7 +4852,7 @@ var Spinner2 = (0, import_react66.forwardRef)(function Spinner3({ size = "md", l
|
|
|
4677
4852
|
"aria-label": label,
|
|
4678
4853
|
className: cn("inline-block", className),
|
|
4679
4854
|
...props,
|
|
4680
|
-
children: /* @__PURE__ */ (0,
|
|
4855
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4681
4856
|
"span",
|
|
4682
4857
|
{
|
|
4683
4858
|
"aria-hidden": true,
|
|
@@ -4694,8 +4869,8 @@ var Spinner2 = (0, import_react66.forwardRef)(function Spinner3({ size = "md", l
|
|
|
4694
4869
|
Spinner2.displayName = "Spinner";
|
|
4695
4870
|
|
|
4696
4871
|
// src/patterns/Stepper/Stepper.tsx
|
|
4697
|
-
var
|
|
4698
|
-
var
|
|
4872
|
+
var import_react69 = require("react");
|
|
4873
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4699
4874
|
var dotBase = "h-6 w-6 rounded-full grid place-items-center text-[11px] font-mono font-semibold border";
|
|
4700
4875
|
var dotStateClass = {
|
|
4701
4876
|
done: "bg-accent text-on-accent border-accent",
|
|
@@ -4712,8 +4887,8 @@ function stateFor(index, current) {
|
|
|
4712
4887
|
if (index === current) return "current";
|
|
4713
4888
|
return "upcoming";
|
|
4714
4889
|
}
|
|
4715
|
-
var Stepper = (0,
|
|
4716
|
-
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)(
|
|
4717
4892
|
"ol",
|
|
4718
4893
|
{
|
|
4719
4894
|
ref,
|
|
@@ -4725,19 +4900,19 @@ var Stepper = (0, import_react67.forwardRef)(function Stepper2({ steps, current,
|
|
|
4725
4900
|
const id = typeof step === "string" ? void 0 : step.id;
|
|
4726
4901
|
const state = stateFor(i, current);
|
|
4727
4902
|
const connectorActive = i < current;
|
|
4728
|
-
return /* @__PURE__ */ (0,
|
|
4729
|
-
/* @__PURE__ */ (0,
|
|
4903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_react69.Fragment, { children: [
|
|
4904
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
4730
4905
|
"li",
|
|
4731
4906
|
{
|
|
4732
4907
|
"aria-current": state === "current" ? "step" : void 0,
|
|
4733
4908
|
className: "flex items-center gap-2",
|
|
4734
4909
|
children: [
|
|
4735
|
-
/* @__PURE__ */ (0,
|
|
4736
|
-
/* @__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 })
|
|
4737
4912
|
]
|
|
4738
4913
|
}
|
|
4739
4914
|
),
|
|
4740
|
-
i < steps.length - 1 && /* @__PURE__ */ (0,
|
|
4915
|
+
i < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4741
4916
|
"span",
|
|
4742
4917
|
{
|
|
4743
4918
|
"aria-hidden": true,
|
|
@@ -4751,12 +4926,110 @@ var Stepper = (0, import_react67.forwardRef)(function Stepper2({ steps, current,
|
|
|
4751
4926
|
});
|
|
4752
4927
|
Stepper.displayName = "Stepper";
|
|
4753
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
|
+
|
|
4754
5027
|
// src/patterns/Tabs/Tabs.tsx
|
|
4755
5028
|
var RadixTabs = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
4756
5029
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
4757
|
-
var
|
|
4758
|
-
var
|
|
4759
|
-
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");
|
|
4760
5033
|
var tabsListStyles = (0, import_class_variance_authority12.cva)("", {
|
|
4761
5034
|
variants: {
|
|
4762
5035
|
variant: {
|
|
@@ -4786,8 +5059,8 @@ var tabsTriggerStyles = (0, import_class_variance_authority12.cva)(
|
|
|
4786
5059
|
}
|
|
4787
5060
|
}
|
|
4788
5061
|
);
|
|
4789
|
-
var Tabs = (0,
|
|
4790
|
-
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)(
|
|
4791
5064
|
RadixTabs.Root,
|
|
4792
5065
|
{
|
|
4793
5066
|
ref,
|
|
@@ -4797,14 +5070,14 @@ var Tabs = (0, import_react68.forwardRef)(function Tabs2({ variant = "underline"
|
|
|
4797
5070
|
) });
|
|
4798
5071
|
});
|
|
4799
5072
|
Tabs.displayName = "Tabs";
|
|
4800
|
-
var TabsList = (0,
|
|
4801
|
-
const variant = (0,
|
|
4802
|
-
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 });
|
|
4803
5076
|
});
|
|
4804
5077
|
TabsList.displayName = "TabsList";
|
|
4805
|
-
var Tab = (0,
|
|
4806
|
-
const variant = (0,
|
|
4807
|
-
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)(
|
|
4808
5081
|
RadixTabs.Trigger,
|
|
4809
5082
|
{
|
|
4810
5083
|
ref,
|
|
@@ -4814,9 +5087,9 @@ var Tab = (0, import_react68.forwardRef)(function Tab2({ className, ...props },
|
|
|
4814
5087
|
);
|
|
4815
5088
|
});
|
|
4816
5089
|
Tab.displayName = "Tab";
|
|
4817
|
-
var TabsContent = (0,
|
|
5090
|
+
var TabsContent = (0, import_react71.forwardRef)(
|
|
4818
5091
|
function TabsContent2({ className, ...props }, ref) {
|
|
4819
|
-
return /* @__PURE__ */ (0,
|
|
5092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4820
5093
|
RadixTabs.Content,
|
|
4821
5094
|
{
|
|
4822
5095
|
ref,
|
|
@@ -4832,8 +5105,8 @@ var TabsContent = (0, import_react68.forwardRef)(
|
|
|
4832
5105
|
TabsContent.displayName = "TabsContent";
|
|
4833
5106
|
|
|
4834
5107
|
// src/patterns/Timeline/Timeline.tsx
|
|
4835
|
-
var
|
|
4836
|
-
var
|
|
5108
|
+
var import_react72 = require("react");
|
|
5109
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4837
5110
|
var ringClass = {
|
|
4838
5111
|
accent: "border-accent",
|
|
4839
5112
|
ok: "border-ok",
|
|
@@ -4841,8 +5114,8 @@ var ringClass = {
|
|
|
4841
5114
|
err: "border-err",
|
|
4842
5115
|
muted: "border-text-dim"
|
|
4843
5116
|
};
|
|
4844
|
-
var Timeline = (0,
|
|
4845
|
-
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)(
|
|
4846
5119
|
"ol",
|
|
4847
5120
|
{
|
|
4848
5121
|
ref,
|
|
@@ -4852,14 +5125,14 @@ var Timeline = (0, import_react69.forwardRef)(function Timeline2({ events, class
|
|
|
4852
5125
|
className
|
|
4853
5126
|
),
|
|
4854
5127
|
...props,
|
|
4855
|
-
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
|
|
4856
5129
|
}
|
|
4857
5130
|
);
|
|
4858
5131
|
});
|
|
4859
5132
|
Timeline.displayName = "Timeline";
|
|
4860
|
-
var TimelineItem = (0,
|
|
4861
|
-
return /* @__PURE__ */ (0,
|
|
4862
|
-
/* @__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)(
|
|
4863
5136
|
"span",
|
|
4864
5137
|
{
|
|
4865
5138
|
"aria-hidden": true,
|
|
@@ -4869,15 +5142,15 @@ var TimelineItem = (0, import_react69.forwardRef)(function TimelineItem2({ tone
|
|
|
4869
5142
|
)
|
|
4870
5143
|
}
|
|
4871
5144
|
),
|
|
4872
|
-
/* @__PURE__ */ (0,
|
|
4873
|
-
description && /* @__PURE__ */ (0,
|
|
4874
|
-
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 })
|
|
4875
5148
|
] });
|
|
4876
5149
|
});
|
|
4877
5150
|
TimelineItem.displayName = "TimelineItem";
|
|
4878
5151
|
|
|
4879
5152
|
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
4880
|
-
var
|
|
5153
|
+
var import_react73 = require("react");
|
|
4881
5154
|
|
|
4882
5155
|
// src/patterns/Timeline/formatRelative.ts
|
|
4883
5156
|
var SECOND = 1e3;
|
|
@@ -4912,7 +5185,7 @@ function formatRelative(input, now = /* @__PURE__ */ new Date()) {
|
|
|
4912
5185
|
}
|
|
4913
5186
|
|
|
4914
5187
|
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
4915
|
-
var
|
|
5188
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4916
5189
|
var ringClass2 = {
|
|
4917
5190
|
accent: "border-accent",
|
|
4918
5191
|
ok: "border-ok",
|
|
@@ -4920,10 +5193,10 @@ var ringClass2 = {
|
|
|
4920
5193
|
err: "border-err",
|
|
4921
5194
|
muted: "border-text-dim"
|
|
4922
5195
|
};
|
|
4923
|
-
var ActivityTimeline = (0,
|
|
5196
|
+
var ActivityTimeline = (0, import_react73.forwardRef)(
|
|
4924
5197
|
function ActivityTimeline2({ events, relativeNow, className, ...props }, ref) {
|
|
4925
5198
|
const now = relativeNow ?? /* @__PURE__ */ new Date();
|
|
4926
|
-
return /* @__PURE__ */ (0,
|
|
5199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4927
5200
|
"ol",
|
|
4928
5201
|
{
|
|
4929
5202
|
ref,
|
|
@@ -4936,8 +5209,8 @@ var ActivityTimeline = (0, import_react70.forwardRef)(
|
|
|
4936
5209
|
children: events.map((event) => {
|
|
4937
5210
|
const tone = event.tone ?? "accent";
|
|
4938
5211
|
const time = formatRelative(event.at, now);
|
|
4939
|
-
return /* @__PURE__ */ (0,
|
|
4940
|
-
/* @__PURE__ */ (0,
|
|
5212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("li", { className: "relative mb-4 last:mb-0", children: [
|
|
5213
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4941
5214
|
"span",
|
|
4942
5215
|
{
|
|
4943
5216
|
"aria-hidden": true,
|
|
@@ -4947,16 +5220,16 @@ var ActivityTimeline = (0, import_react70.forwardRef)(
|
|
|
4947
5220
|
)
|
|
4948
5221
|
}
|
|
4949
5222
|
),
|
|
4950
|
-
/* @__PURE__ */ (0,
|
|
4951
|
-
event.icon && /* @__PURE__ */ (0,
|
|
4952
|
-
/* @__PURE__ */ (0,
|
|
4953
|
-
time && /* @__PURE__ */ (0,
|
|
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 })
|
|
4954
5227
|
] }),
|
|
4955
|
-
event.actor && /* @__PURE__ */ (0,
|
|
4956
|
-
event.actor.avatar && /* @__PURE__ */ (0,
|
|
4957
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
4958
5231
|
] }),
|
|
4959
|
-
event.payload && /* @__PURE__ */ (0,
|
|
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 })
|
|
4960
5233
|
] }, event.id);
|
|
4961
5234
|
})
|
|
4962
5235
|
}
|
|
@@ -4966,23 +5239,77 @@ var ActivityTimeline = (0, import_react70.forwardRef)(
|
|
|
4966
5239
|
ActivityTimeline.displayName = "ActivityTimeline";
|
|
4967
5240
|
|
|
4968
5241
|
// src/patterns/Topbar/Topbar.tsx
|
|
4969
|
-
var
|
|
4970
|
-
var
|
|
4971
|
-
var Topbar = (0,
|
|
4972
|
-
|
|
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)(
|
|
4973
5259
|
"header",
|
|
4974
5260
|
{
|
|
4975
5261
|
ref,
|
|
4976
5262
|
className: cn(
|
|
4977
|
-
"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",
|
|
4978
5265
|
className
|
|
4979
5266
|
),
|
|
4980
5267
|
...props,
|
|
4981
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
|
+
),
|
|
4982
5298
|
leading,
|
|
4983
|
-
title && /* @__PURE__ */ (0,
|
|
4984
|
-
|
|
4985
|
-
|
|
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 }),
|
|
4986
5313
|
children
|
|
4987
5314
|
]
|
|
4988
5315
|
}
|
|
@@ -4991,8 +5318,8 @@ var Topbar = (0, import_react71.forwardRef)(function Topbar2({ title, leading, a
|
|
|
4991
5318
|
Topbar.displayName = "Topbar";
|
|
4992
5319
|
|
|
4993
5320
|
// src/patterns/Tree/Tree.tsx
|
|
4994
|
-
var
|
|
4995
|
-
var
|
|
5321
|
+
var import_react75 = require("react");
|
|
5322
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4996
5323
|
var EMPTY_SET2 = /* @__PURE__ */ new Set();
|
|
4997
5324
|
function flattenVisible(items, expanded, level, parentId, out) {
|
|
4998
5325
|
for (const item of items) {
|
|
@@ -5003,7 +5330,7 @@ function flattenVisible(items, expanded, level, parentId, out) {
|
|
|
5003
5330
|
}
|
|
5004
5331
|
}
|
|
5005
5332
|
}
|
|
5006
|
-
var Tree = (0,
|
|
5333
|
+
var Tree = (0, import_react75.forwardRef)(function Tree2({
|
|
5007
5334
|
items,
|
|
5008
5335
|
expanded: expandedProp,
|
|
5009
5336
|
defaultExpanded,
|
|
@@ -5026,24 +5353,24 @@ var Tree = (0, import_react72.forwardRef)(function Tree2({
|
|
|
5026
5353
|
onChange: onValueChange
|
|
5027
5354
|
});
|
|
5028
5355
|
const expandedSet = expanded ?? EMPTY_SET2;
|
|
5029
|
-
const flatVisible = (0,
|
|
5356
|
+
const flatVisible = (0, import_react75.useMemo)(() => {
|
|
5030
5357
|
const out = [];
|
|
5031
5358
|
flattenVisible(items, expandedSet, 1, null, out);
|
|
5032
5359
|
return out;
|
|
5033
5360
|
}, [items, expandedSet]);
|
|
5034
|
-
const [activeId, setActiveId] = (0,
|
|
5035
|
-
(0,
|
|
5361
|
+
const [activeId, setActiveId] = (0, import_react75.useState)(null);
|
|
5362
|
+
(0, import_react75.useEffect)(() => {
|
|
5036
5363
|
if (activeId && !flatVisible.some((f) => f.id === activeId)) {
|
|
5037
5364
|
setActiveId(null);
|
|
5038
5365
|
}
|
|
5039
5366
|
}, [activeId, flatVisible]);
|
|
5040
|
-
const tabStopId = (0,
|
|
5367
|
+
const tabStopId = (0, import_react75.useMemo)(() => {
|
|
5041
5368
|
if (activeId && flatVisible.some((f) => f.id === activeId)) return activeId;
|
|
5042
5369
|
if (value && flatVisible.some((f) => f.id === value)) return value;
|
|
5043
5370
|
return flatVisible[0]?.id ?? null;
|
|
5044
5371
|
}, [activeId, flatVisible, value]);
|
|
5045
|
-
const listRef = (0,
|
|
5046
|
-
const setRefs = (0,
|
|
5372
|
+
const listRef = (0, import_react75.useRef)(null);
|
|
5373
|
+
const setRefs = (0, import_react75.useCallback)(
|
|
5047
5374
|
(node) => {
|
|
5048
5375
|
listRef.current = node;
|
|
5049
5376
|
if (typeof ref === "function") ref(node);
|
|
@@ -5051,20 +5378,20 @@ var Tree = (0, import_react72.forwardRef)(function Tree2({
|
|
|
5051
5378
|
},
|
|
5052
5379
|
[ref]
|
|
5053
5380
|
);
|
|
5054
|
-
const focusItem = (0,
|
|
5381
|
+
const focusItem = (0, import_react75.useCallback)((id) => {
|
|
5055
5382
|
const root = listRef.current;
|
|
5056
5383
|
if (!root) return;
|
|
5057
5384
|
const el = root.querySelector(`[data-treeitem-id="${CSS.escape(id)}"]`);
|
|
5058
5385
|
el?.focus();
|
|
5059
5386
|
}, []);
|
|
5060
|
-
const moveActive = (0,
|
|
5387
|
+
const moveActive = (0, import_react75.useCallback)(
|
|
5061
5388
|
(id) => {
|
|
5062
5389
|
setActiveId(id);
|
|
5063
5390
|
queueMicrotask(() => focusItem(id));
|
|
5064
5391
|
},
|
|
5065
5392
|
[focusItem]
|
|
5066
5393
|
);
|
|
5067
|
-
const toggle = (0,
|
|
5394
|
+
const toggle = (0, import_react75.useCallback)(
|
|
5068
5395
|
(id) => {
|
|
5069
5396
|
setExpanded((prev) => {
|
|
5070
5397
|
const next = new Set(prev ?? EMPTY_SET2);
|
|
@@ -5075,7 +5402,7 @@ var Tree = (0, import_react72.forwardRef)(function Tree2({
|
|
|
5075
5402
|
},
|
|
5076
5403
|
[setExpanded]
|
|
5077
5404
|
);
|
|
5078
|
-
const expand = (0,
|
|
5405
|
+
const expand = (0, import_react75.useCallback)(
|
|
5079
5406
|
(id) => {
|
|
5080
5407
|
setExpanded((prev) => {
|
|
5081
5408
|
const base = prev ?? EMPTY_SET2;
|
|
@@ -5087,7 +5414,7 @@ var Tree = (0, import_react72.forwardRef)(function Tree2({
|
|
|
5087
5414
|
},
|
|
5088
5415
|
[setExpanded]
|
|
5089
5416
|
);
|
|
5090
|
-
const collapse = (0,
|
|
5417
|
+
const collapse = (0, import_react75.useCallback)(
|
|
5091
5418
|
(id) => {
|
|
5092
5419
|
setExpanded((prev) => {
|
|
5093
5420
|
const base = prev ?? EMPTY_SET2;
|
|
@@ -5099,13 +5426,13 @@ var Tree = (0, import_react72.forwardRef)(function Tree2({
|
|
|
5099
5426
|
},
|
|
5100
5427
|
[setExpanded]
|
|
5101
5428
|
);
|
|
5102
|
-
const selectItem = (0,
|
|
5429
|
+
const selectItem = (0, import_react75.useCallback)(
|
|
5103
5430
|
(id) => {
|
|
5104
5431
|
setValue(id);
|
|
5105
5432
|
},
|
|
5106
5433
|
[setValue]
|
|
5107
5434
|
);
|
|
5108
|
-
const handleKeyDown = (0,
|
|
5435
|
+
const handleKeyDown = (0, import_react75.useCallback)(
|
|
5109
5436
|
(e) => {
|
|
5110
5437
|
onKeyDown?.(e);
|
|
5111
5438
|
if (e.defaultPrevented) return;
|
|
@@ -5185,7 +5512,7 @@ var Tree = (0, import_react72.forwardRef)(function Tree2({
|
|
|
5185
5512
|
toggle
|
|
5186
5513
|
]
|
|
5187
5514
|
);
|
|
5188
|
-
return /* @__PURE__ */ (0,
|
|
5515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5189
5516
|
"ul",
|
|
5190
5517
|
{
|
|
5191
5518
|
ref: setRefs,
|
|
@@ -5193,7 +5520,7 @@ var Tree = (0, import_react72.forwardRef)(function Tree2({
|
|
|
5193
5520
|
className: cn("flex flex-col gap-px text-[12px]", className),
|
|
5194
5521
|
onKeyDown: handleKeyDown,
|
|
5195
5522
|
...props,
|
|
5196
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
5523
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5197
5524
|
TreeItemRow,
|
|
5198
5525
|
{
|
|
5199
5526
|
item,
|
|
@@ -5228,8 +5555,8 @@ function TreeItemRow({
|
|
|
5228
5555
|
const isExpanded = hasChildren && expanded.has(item.id);
|
|
5229
5556
|
const isSelected = selected === item.id;
|
|
5230
5557
|
const isTabStop = tabStopId === item.id;
|
|
5231
|
-
return /* @__PURE__ */ (0,
|
|
5232
|
-
/* @__PURE__ */ (0,
|
|
5558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("li", { role: "none", children: [
|
|
5559
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5233
5560
|
"div",
|
|
5234
5561
|
{
|
|
5235
5562
|
role: "treeitem",
|
|
@@ -5252,14 +5579,14 @@ function TreeItemRow({
|
|
|
5252
5579
|
isSelected ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2"
|
|
5253
5580
|
),
|
|
5254
5581
|
children: [
|
|
5255
|
-
/* @__PURE__ */ (0,
|
|
5256
|
-
item.icon && /* @__PURE__ */ (0,
|
|
5257
|
-
/* @__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 }),
|
|
5258
5585
|
item.trailing
|
|
5259
5586
|
]
|
|
5260
5587
|
}
|
|
5261
5588
|
),
|
|
5262
|
-
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)(
|
|
5263
5590
|
TreeItemRow,
|
|
5264
5591
|
{
|
|
5265
5592
|
item: child,
|
|
@@ -5278,9 +5605,9 @@ function TreeItemRow({
|
|
|
5278
5605
|
|
|
5279
5606
|
// src/patterns/WizardDialog/WizardDialog.tsx
|
|
5280
5607
|
var RadixDialog5 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
5281
|
-
var
|
|
5282
|
-
var
|
|
5283
|
-
var WizardDialog = (0,
|
|
5608
|
+
var import_react76 = require("react");
|
|
5609
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5610
|
+
var WizardDialog = (0, import_react76.forwardRef)(function WizardDialog2({
|
|
5284
5611
|
open,
|
|
5285
5612
|
defaultOpen,
|
|
5286
5613
|
onOpenChange,
|
|
@@ -5296,19 +5623,19 @@ var WizardDialog = (0, import_react73.forwardRef)(function WizardDialog2({
|
|
|
5296
5623
|
cancelLabel,
|
|
5297
5624
|
onCancel
|
|
5298
5625
|
}, ref) {
|
|
5299
|
-
const [current, setCurrent] = (0,
|
|
5626
|
+
const [current, setCurrent] = (0, import_react76.useState)(initialStep);
|
|
5300
5627
|
const total = steps.length;
|
|
5301
5628
|
const safeCurrent = Math.min(current, Math.max(0, total - 1));
|
|
5302
5629
|
const step = steps[safeCurrent];
|
|
5303
|
-
const goTo = (0,
|
|
5630
|
+
const goTo = (0, import_react76.useCallback)(
|
|
5304
5631
|
(index) => {
|
|
5305
5632
|
setCurrent(Math.min(Math.max(0, index), Math.max(0, total - 1)));
|
|
5306
5633
|
},
|
|
5307
5634
|
[total]
|
|
5308
5635
|
);
|
|
5309
|
-
const goNext = (0,
|
|
5310
|
-
const goBack = (0,
|
|
5311
|
-
const ctx = (0,
|
|
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)(
|
|
5312
5639
|
() => ({
|
|
5313
5640
|
current: safeCurrent,
|
|
5314
5641
|
total,
|
|
@@ -5320,7 +5647,7 @@ var WizardDialog = (0, import_react73.forwardRef)(function WizardDialog2({
|
|
|
5320
5647
|
}),
|
|
5321
5648
|
[safeCurrent, total, goNext, goBack, goTo]
|
|
5322
5649
|
);
|
|
5323
|
-
const stepperSteps = (0,
|
|
5650
|
+
const stepperSteps = (0, import_react76.useMemo)(() => steps.map((s) => ({ id: s.id, label: s.label })), [steps]);
|
|
5324
5651
|
if (!step) return null;
|
|
5325
5652
|
const canAdvance = step.canAdvance ? step.canAdvance(ctx) : true;
|
|
5326
5653
|
const body = typeof step.content === "function" ? step.content(ctx) : step.content;
|
|
@@ -5331,23 +5658,23 @@ var WizardDialog = (0, import_react73.forwardRef)(function WizardDialog2({
|
|
|
5331
5658
|
goNext();
|
|
5332
5659
|
}
|
|
5333
5660
|
};
|
|
5334
|
-
return /* @__PURE__ */ (0,
|
|
5335
|
-
title && /* @__PURE__ */ (0,
|
|
5336
|
-
description && /* @__PURE__ */ (0,
|
|
5337
|
-
/* @__PURE__ */ (0,
|
|
5338
|
-
/* @__PURE__ */ (0,
|
|
5339
|
-
/* @__PURE__ */ (0,
|
|
5340
|
-
cancelLabel && /* @__PURE__ */ (0,
|
|
5341
|
-
/* @__PURE__ */ (0,
|
|
5342
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
5343
5670
|
] })
|
|
5344
5671
|
] }) });
|
|
5345
5672
|
});
|
|
5346
5673
|
function WizardTitle({ children }) {
|
|
5347
|
-
return /* @__PURE__ */ (0,
|
|
5674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(RadixDialog5.Title, { className: "mb-2 text-[16px] font-medium", children });
|
|
5348
5675
|
}
|
|
5349
5676
|
function WizardDescription({ children }) {
|
|
5350
|
-
return /* @__PURE__ */ (0,
|
|
5677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(RadixDialog5.Description, { className: "text-text-muted mb-4 text-[13px] leading-[1.55]", children });
|
|
5351
5678
|
}
|
|
5352
5679
|
WizardDialog.displayName = "WizardDialog";
|
|
5353
5680
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -5415,6 +5742,7 @@ WizardDialog.displayName = "WizardDialog";
|
|
|
5415
5742
|
IconButton,
|
|
5416
5743
|
Input,
|
|
5417
5744
|
Kbd,
|
|
5745
|
+
LargeTitle,
|
|
5418
5746
|
MenuCheckboxItem,
|
|
5419
5747
|
MenuItem,
|
|
5420
5748
|
MenuSeparator,
|
|
@@ -5439,6 +5767,7 @@ WizardDialog.displayName = "WizardDialog";
|
|
|
5439
5767
|
PopoverRoot,
|
|
5440
5768
|
PopoverTrigger,
|
|
5441
5769
|
Progress,
|
|
5770
|
+
PullToRefresh,
|
|
5442
5771
|
RadialProgress,
|
|
5443
5772
|
Radio,
|
|
5444
5773
|
RadioGroup,
|
|
@@ -5465,6 +5794,7 @@ WizardDialog.displayName = "WizardDialog";
|
|
|
5465
5794
|
Stepper,
|
|
5466
5795
|
Switch,
|
|
5467
5796
|
Tab,
|
|
5797
|
+
TabBar,
|
|
5468
5798
|
Tabs,
|
|
5469
5799
|
TabsContent,
|
|
5470
5800
|
TabsList,
|