@kjaniec-dev/ui 0.9.1 → 0.9.3
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 +2339 -1113
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +133 -6
- package/dist/index.d.ts +133 -6
- package/dist/index.js +2338 -1114
- package/dist/index.js.map +1 -1
- package/dist/ui.css +34 -9
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -115,20 +115,17 @@ var Badge = React52__namespace.forwardRef(
|
|
|
115
115
|
] })
|
|
116
116
|
);
|
|
117
117
|
Badge.displayName = "Badge";
|
|
118
|
-
var alertVariants = classVarianceAuthority.cva(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
defaultVariants: { variant: "info" }
|
|
130
|
-
}
|
|
131
|
-
);
|
|
118
|
+
var alertVariants = classVarianceAuthority.cva("flex gap-3 items-start p-[0.9rem_1.1rem] rounded-kj-md border text-sm", {
|
|
119
|
+
variants: {
|
|
120
|
+
variant: {
|
|
121
|
+
info: "bg-info-surface border-info/30",
|
|
122
|
+
success: "bg-success-surface border-success/30",
|
|
123
|
+
warning: "bg-warning-surface border-warning/30",
|
|
124
|
+
danger: "bg-danger-surface border-danger/30"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
defaultVariants: { variant: "info" }
|
|
128
|
+
});
|
|
132
129
|
var iconColor = {
|
|
133
130
|
info: "text-info",
|
|
134
131
|
success: "text-success",
|
|
@@ -137,7 +134,16 @@ var iconColor = {
|
|
|
137
134
|
};
|
|
138
135
|
var Alert = React52__namespace.forwardRef(
|
|
139
136
|
({ className, variant = "info", icon, title, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props, children: [
|
|
140
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
137
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
138
|
+
"span",
|
|
139
|
+
{
|
|
140
|
+
className: cn(
|
|
141
|
+
"shrink-0 mt-0.5 [&_svg]:h-[1.15rem] [&_svg]:w-[1.15rem]",
|
|
142
|
+
iconColor[variant ?? "info"]
|
|
143
|
+
),
|
|
144
|
+
children: icon
|
|
145
|
+
}
|
|
146
|
+
),
|
|
141
147
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-foreground", children: [
|
|
142
148
|
title && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-bold m-0 mb-0.5 text-sm", children: title }),
|
|
143
149
|
children && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "m-0 opacity-85", children })
|
|
@@ -193,10 +199,18 @@ var Progress = React52__namespace.forwardRef(
|
|
|
193
199
|
);
|
|
194
200
|
Progress.displayName = "Progress";
|
|
195
201
|
var Label = React52__namespace.forwardRef(
|
|
196
|
-
({ className, required, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
202
|
+
({ className, required, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
203
|
+
"label",
|
|
204
|
+
{
|
|
205
|
+
ref,
|
|
206
|
+
className: cn("text-[0.8rem] font-semibold text-foreground", className),
|
|
207
|
+
...props,
|
|
208
|
+
children: [
|
|
209
|
+
children,
|
|
210
|
+
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-danger", children: " *" })
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
)
|
|
200
214
|
);
|
|
201
215
|
Label.displayName = "Label";
|
|
202
216
|
var Hint = React52__namespace.forwardRef(
|
|
@@ -222,11 +236,7 @@ var FormField = React52__namespace.forwardRef(
|
|
|
222
236
|
const child = React52__namespace.Children.only(children);
|
|
223
237
|
const clonedChild = React52__namespace.cloneElement(child, {
|
|
224
238
|
id: child.props.id ?? id,
|
|
225
|
-
"aria-describedby": cn(
|
|
226
|
-
hint && hintId,
|
|
227
|
-
error && errorId,
|
|
228
|
-
child.props["aria-describedby"]
|
|
229
|
-
) || void 0,
|
|
239
|
+
"aria-describedby": cn(hint && hintId, error && errorId, child.props["aria-describedby"]) || void 0,
|
|
230
240
|
"aria-invalid": error ? "true" : void 0,
|
|
231
241
|
required: child.props.required ?? required
|
|
232
242
|
});
|
|
@@ -362,11 +372,21 @@ var ProgressRing = React52__namespace.forwardRef(
|
|
|
362
372
|
ProgressRing.displayName = "ProgressRing";
|
|
363
373
|
var ProgressRingField = React52__namespace.forwardRef(
|
|
364
374
|
({ label, hint, error, required, fieldClassName, ...ringProps }, ref) => {
|
|
365
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
375
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
376
|
+
FormField,
|
|
377
|
+
{
|
|
378
|
+
label,
|
|
379
|
+
hint,
|
|
380
|
+
error,
|
|
381
|
+
required,
|
|
382
|
+
className: fieldClassName,
|
|
383
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ProgressRing, { ref, "aria-label": ringProps["aria-label"] ?? label, ...ringProps })
|
|
384
|
+
}
|
|
385
|
+
);
|
|
366
386
|
}
|
|
367
387
|
);
|
|
368
388
|
ProgressRingField.displayName = "ProgressRingField";
|
|
369
|
-
var baseField = "w-full font-sans text-sm text-foreground bg-surface border rounded-kj-md px-[0.85rem] transition-[border-color,box-shadow] duration-150 placeholder:text-muted-foreground focus:outline-none focus:border-ring focus:ring-[3px] focus:ring-ring/30 disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed";
|
|
389
|
+
var baseField = "w-full font-sans text-sm text-foreground bg-surface border rounded-kj-md px-[0.85rem] transition-[border-color,box-shadow] duration-150 placeholder:text-muted-foreground hover:border-control-border-hover focus:outline-none focus:border-ring focus:ring-[3px] focus:ring-ring/30 disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed";
|
|
370
390
|
var Input = React52__namespace.forwardRef(
|
|
371
391
|
({ className, error, leadingIcon, ...props }, ref) => {
|
|
372
392
|
const field = /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -454,11 +474,33 @@ var Checkbox = React52__namespace.forwardRef(
|
|
|
454
474
|
({ className, label, id, ...props }, ref) => {
|
|
455
475
|
const autoId = React52__namespace.useId();
|
|
456
476
|
const inputId = id ?? autoId;
|
|
457
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
477
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
478
|
+
"label",
|
|
479
|
+
{
|
|
480
|
+
htmlFor: inputId,
|
|
481
|
+
className: cn(
|
|
482
|
+
"inline-flex items-center gap-2.5 cursor-pointer text-sm select-none",
|
|
483
|
+
className
|
|
484
|
+
),
|
|
485
|
+
children: [
|
|
486
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { ref, id: inputId, type: "checkbox", className: "peer sr-only", ...props }),
|
|
487
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "grid place-items-center h-[1.15rem] w-[1.15rem] shrink-0 rounded-[0.4rem] border-[1.5px] border-input bg-surface transition-all duration-150 peer-checked:bg-primary peer-checked:border-primary peer-focus-visible:ring-[3px] peer-focus-visible:ring-ring/35 peer-checked:[&_svg]:opacity-100 peer-checked:[&_svg]:scale-100", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
488
|
+
"svg",
|
|
489
|
+
{
|
|
490
|
+
viewBox: "0 0 24 24",
|
|
491
|
+
fill: "none",
|
|
492
|
+
stroke: "currentColor",
|
|
493
|
+
strokeWidth: 3,
|
|
494
|
+
strokeLinecap: "round",
|
|
495
|
+
strokeLinejoin: "round",
|
|
496
|
+
className: "h-3 w-3 text-primary-foreground opacity-0 scale-50 transition-all duration-150",
|
|
497
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" })
|
|
498
|
+
}
|
|
499
|
+
) }),
|
|
500
|
+
label
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
);
|
|
462
504
|
}
|
|
463
505
|
);
|
|
464
506
|
Checkbox.displayName = "Checkbox";
|
|
@@ -466,11 +508,21 @@ var Radio = React52__namespace.forwardRef(
|
|
|
466
508
|
({ className, label, id, ...props }, ref) => {
|
|
467
509
|
const autoId = React52__namespace.useId();
|
|
468
510
|
const inputId = id ?? autoId;
|
|
469
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
511
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
512
|
+
"label",
|
|
513
|
+
{
|
|
514
|
+
htmlFor: inputId,
|
|
515
|
+
className: cn(
|
|
516
|
+
"inline-flex items-center gap-2.5 cursor-pointer text-sm select-none",
|
|
517
|
+
className
|
|
518
|
+
),
|
|
519
|
+
children: [
|
|
520
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { ref, id: inputId, type: "radio", className: "peer sr-only", ...props }),
|
|
521
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "grid place-items-center h-[1.15rem] w-[1.15rem] shrink-0 rounded-full border-[1.5px] border-input bg-surface transition-all duration-150 peer-checked:bg-primary peer-checked:border-primary peer-focus-visible:ring-[3px] peer-focus-visible:ring-ring/35 peer-checked:[&>span]:opacity-100 peer-checked:[&>span]:scale-100", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-2 w-2 rounded-full bg-primary-foreground opacity-0 scale-[0.4] transition-all duration-150" }) }),
|
|
522
|
+
label
|
|
523
|
+
]
|
|
524
|
+
}
|
|
525
|
+
);
|
|
474
526
|
}
|
|
475
527
|
);
|
|
476
528
|
Radio.displayName = "Radio";
|
|
@@ -501,19 +553,37 @@ var Switch = React52__namespace.forwardRef(
|
|
|
501
553
|
({ className, label, id, ...props }, ref) => {
|
|
502
554
|
const autoId = React52__namespace.useId();
|
|
503
555
|
const inputId = id ?? autoId;
|
|
504
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
556
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
557
|
+
"label",
|
|
558
|
+
{
|
|
559
|
+
htmlFor: inputId,
|
|
560
|
+
className: cn(
|
|
561
|
+
"inline-flex items-center gap-2.5 cursor-pointer text-sm select-none",
|
|
562
|
+
className
|
|
563
|
+
),
|
|
564
|
+
children: [
|
|
565
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
566
|
+
"input",
|
|
567
|
+
{
|
|
568
|
+
ref,
|
|
569
|
+
id: inputId,
|
|
570
|
+
type: "checkbox",
|
|
571
|
+
role: "switch",
|
|
572
|
+
className: "peer sr-only",
|
|
573
|
+
...props
|
|
574
|
+
}
|
|
575
|
+
),
|
|
576
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative h-[1.45rem] w-[2.6rem] shrink-0 rounded-full bg-input transition-colors duration-200 peer-checked:bg-primary peer-focus-visible:ring-[3px] peer-focus-visible:ring-ring/35 after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:h-[calc(1.45rem-4px)] after:w-[calc(1.45rem-4px)] after:rounded-full after:bg-white after:shadow-kj-sm after:transition-transform after:duration-200 peer-checked:after:translate-x-[1.15rem]" }),
|
|
577
|
+
label
|
|
578
|
+
]
|
|
579
|
+
}
|
|
580
|
+
);
|
|
509
581
|
}
|
|
510
582
|
);
|
|
511
583
|
Switch.displayName = "Switch";
|
|
512
584
|
var Slider = React52__namespace.forwardRef(
|
|
513
585
|
({ className, style, value, defaultValue, min = 0, max = 100, onChange, ...props }, ref) => {
|
|
514
|
-
const [localValue, setLocalValue] = React52__namespace.useState(
|
|
515
|
-
Number(defaultValue ?? value ?? 50)
|
|
516
|
-
);
|
|
586
|
+
const [localValue, setLocalValue] = React52__namespace.useState(Number(defaultValue ?? value ?? 50));
|
|
517
587
|
const isControlled = value !== void 0;
|
|
518
588
|
const currentVal = isControlled ? Number(value) : localValue;
|
|
519
589
|
const numMin = Number(min);
|
|
@@ -650,13 +720,9 @@ var CardHeader = React52__namespace.forwardRef(
|
|
|
650
720
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-[1.35rem] flex flex-col gap-1", className), ...props })
|
|
651
721
|
);
|
|
652
722
|
CardHeader.displayName = "CardHeader";
|
|
653
|
-
var CardTitle = React52__namespace.forwardRef(
|
|
654
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("h3", { ref, className: cn("m-0 text-base font-bold tracking-[-0.01em]", className), ...props, children })
|
|
655
|
-
);
|
|
723
|
+
var CardTitle = React52__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("h3", { ref, className: cn("m-0 text-base font-bold tracking-[-0.01em]", className), ...props, children }));
|
|
656
724
|
CardTitle.displayName = "CardTitle";
|
|
657
|
-
var CardDescription = React52__namespace.forwardRef(
|
|
658
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("p", { ref, className: cn("m-0 text-[0.85rem] text-muted-foreground", className), ...props })
|
|
659
|
-
);
|
|
725
|
+
var CardDescription = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("p", { ref, className: cn("m-0 text-[0.85rem] text-muted-foreground", className), ...props }));
|
|
660
726
|
CardDescription.displayName = "CardDescription";
|
|
661
727
|
var CardContent = React52__namespace.forwardRef(
|
|
662
728
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("px-[1.35rem] pb-[1.35rem]", className), ...props })
|
|
@@ -667,7 +733,10 @@ var CardFooter = React52__namespace.forwardRef(
|
|
|
667
733
|
"div",
|
|
668
734
|
{
|
|
669
735
|
ref,
|
|
670
|
-
className: cn(
|
|
736
|
+
className: cn(
|
|
737
|
+
"flex gap-2.5 px-[1.35rem] py-[1.1rem] border-t border-border bg-muted/40",
|
|
738
|
+
className
|
|
739
|
+
),
|
|
671
740
|
...props
|
|
672
741
|
}
|
|
673
742
|
)
|
|
@@ -715,7 +784,15 @@ var avatarVariants = classVarianceAuthority.cva(
|
|
|
715
784
|
);
|
|
716
785
|
var Avatar = React52__namespace.forwardRef(
|
|
717
786
|
({ className, size, tone, src, alt, status, children, ...props }, ref) => {
|
|
718
|
-
const node = /* @__PURE__ */ jsxRuntime.jsx(
|
|
787
|
+
const node = /* @__PURE__ */ jsxRuntime.jsx(
|
|
788
|
+
"span",
|
|
789
|
+
{
|
|
790
|
+
ref,
|
|
791
|
+
className: cn(avatarVariants({ size, tone }), "overflow-hidden", className),
|
|
792
|
+
...props,
|
|
793
|
+
children: src ? /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt, className: "h-full w-full object-cover" }) : children
|
|
794
|
+
}
|
|
795
|
+
);
|
|
719
796
|
if (!status) return node;
|
|
720
797
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative inline-flex", children: [
|
|
721
798
|
node,
|
|
@@ -734,7 +811,14 @@ function useTabs() {
|
|
|
734
811
|
if (!ctx) throw new Error("Tabs.* must be used within <Tabs>");
|
|
735
812
|
return ctx;
|
|
736
813
|
}
|
|
737
|
-
function Tabs({
|
|
814
|
+
function Tabs({
|
|
815
|
+
value,
|
|
816
|
+
defaultValue,
|
|
817
|
+
onValueChange,
|
|
818
|
+
className,
|
|
819
|
+
children,
|
|
820
|
+
...props
|
|
821
|
+
}) {
|
|
738
822
|
const [internal, setInternal] = React52__namespace.useState(defaultValue ?? "");
|
|
739
823
|
const uid = React52__namespace.useId();
|
|
740
824
|
const current = value ?? internal;
|
|
@@ -844,7 +928,13 @@ var TabsContent = React52__namespace.forwardRef(
|
|
|
844
928
|
);
|
|
845
929
|
TabsContent.displayName = "TabsContent";
|
|
846
930
|
var AccordionContext = React52__namespace.createContext(null);
|
|
847
|
-
function Accordion({
|
|
931
|
+
function Accordion({
|
|
932
|
+
type = "single",
|
|
933
|
+
defaultValue = [],
|
|
934
|
+
className,
|
|
935
|
+
children,
|
|
936
|
+
...props
|
|
937
|
+
}) {
|
|
848
938
|
const [open, setOpen] = React52__namespace.useState(defaultValue);
|
|
849
939
|
const toggle = React52__namespace.useCallback(
|
|
850
940
|
(v) => {
|
|
@@ -856,72 +946,97 @@ function Accordion({ type = "single", defaultValue = [], className, children, ..
|
|
|
856
946
|
},
|
|
857
947
|
[type]
|
|
858
948
|
);
|
|
859
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AccordionContext.Provider, { value: { open, toggle }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
949
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AccordionContext.Provider, { value: { open, toggle }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
950
|
+
"div",
|
|
951
|
+
{
|
|
952
|
+
className: cn("border border-border rounded-kj-lg overflow-hidden", className),
|
|
953
|
+
...props,
|
|
954
|
+
children
|
|
955
|
+
}
|
|
956
|
+
) });
|
|
860
957
|
}
|
|
861
958
|
var ItemContext = React52__namespace.createContext("");
|
|
862
959
|
var AccordionItem = React52__namespace.forwardRef(
|
|
863
|
-
({ className, value, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(ItemContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
960
|
+
({ className, value, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(ItemContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
961
|
+
"div",
|
|
962
|
+
{
|
|
963
|
+
ref,
|
|
964
|
+
className: cn("border-t border-border first:border-t-0", className),
|
|
965
|
+
...props
|
|
966
|
+
}
|
|
967
|
+
) })
|
|
864
968
|
);
|
|
865
969
|
AccordionItem.displayName = "AccordionItem";
|
|
866
|
-
var AccordionTrigger = React52__namespace.forwardRef(
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
children
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
);
|
|
970
|
+
var AccordionTrigger = React52__namespace.forwardRef(({ className, children, ...props }, ref) => {
|
|
971
|
+
const ctx = React52__namespace.useContext(AccordionContext);
|
|
972
|
+
const value = React52__namespace.useContext(ItemContext);
|
|
973
|
+
const isOpen = ctx.open.includes(value);
|
|
974
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
975
|
+
"button",
|
|
976
|
+
{
|
|
977
|
+
ref,
|
|
978
|
+
type: "button",
|
|
979
|
+
"aria-expanded": isOpen,
|
|
980
|
+
onClick: () => ctx.toggle(value),
|
|
981
|
+
className: cn(
|
|
982
|
+
"w-full flex justify-between items-center gap-4 text-left px-[1.2rem] py-4 bg-card text-foreground text-[0.9rem] font-semibold cursor-pointer hover:bg-muted transition-colors",
|
|
983
|
+
className
|
|
984
|
+
),
|
|
985
|
+
...props,
|
|
986
|
+
children: [
|
|
987
|
+
children,
|
|
988
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
989
|
+
"svg",
|
|
990
|
+
{
|
|
991
|
+
className: cn(
|
|
992
|
+
"shrink-0 text-muted-foreground transition-transform duration-200",
|
|
993
|
+
isOpen && "rotate-180"
|
|
994
|
+
),
|
|
995
|
+
width: 18,
|
|
996
|
+
height: 18,
|
|
997
|
+
viewBox: "0 0 24 24",
|
|
998
|
+
fill: "none",
|
|
999
|
+
stroke: "currentColor",
|
|
1000
|
+
strokeWidth: 2,
|
|
1001
|
+
strokeLinecap: "round",
|
|
1002
|
+
strokeLinejoin: "round",
|
|
1003
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
1004
|
+
}
|
|
1005
|
+
)
|
|
1006
|
+
]
|
|
1007
|
+
}
|
|
1008
|
+
);
|
|
1009
|
+
});
|
|
905
1010
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
906
|
-
var AccordionContent = React52__namespace.forwardRef(
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
1011
|
+
var AccordionContent = React52__namespace.forwardRef(({ className, children, ...props }, ref) => {
|
|
1012
|
+
const ctx = React52__namespace.useContext(AccordionContext);
|
|
1013
|
+
const value = React52__namespace.useContext(ItemContext);
|
|
1014
|
+
const isOpen = ctx.open.includes(value);
|
|
1015
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1016
|
+
"div",
|
|
1017
|
+
{
|
|
1018
|
+
ref,
|
|
1019
|
+
className: cn(
|
|
1020
|
+
"grid transition-[grid-template-rows] duration-200 ease-out",
|
|
1021
|
+
isOpen ? "[grid-template-rows:1fr]" : "[grid-template-rows:0fr]"
|
|
1022
|
+
),
|
|
1023
|
+
...props,
|
|
1024
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1025
|
+
"div",
|
|
1026
|
+
{
|
|
1027
|
+
className: cn("px-[1.2rem] pt-3 pb-4 text-[0.85rem] text-muted-foreground", className),
|
|
1028
|
+
children
|
|
1029
|
+
}
|
|
1030
|
+
) })
|
|
1031
|
+
}
|
|
1032
|
+
);
|
|
1033
|
+
});
|
|
922
1034
|
AccordionContent.displayName = "AccordionContent";
|
|
923
1035
|
var MenuContext = React52__namespace.createContext(null);
|
|
924
|
-
function DropdownMenu({
|
|
1036
|
+
function DropdownMenu({
|
|
1037
|
+
children,
|
|
1038
|
+
className
|
|
1039
|
+
}) {
|
|
925
1040
|
const [open, setOpen] = React52__namespace.useState(false);
|
|
926
1041
|
const ref = React52__namespace.useRef(null);
|
|
927
1042
|
React52__namespace.useEffect(() => {
|
|
@@ -972,14 +1087,21 @@ var DropdownMenuTrigger = React52__namespace.forwardRef(({ onClick, asChild, ...
|
|
|
972
1087
|
);
|
|
973
1088
|
});
|
|
974
1089
|
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
975
|
-
function DropdownMenuContent({
|
|
1090
|
+
function DropdownMenuContent({
|
|
1091
|
+
className,
|
|
1092
|
+
align = "start",
|
|
1093
|
+
children,
|
|
1094
|
+
...props
|
|
1095
|
+
}) {
|
|
976
1096
|
const ctx = React52__namespace.useContext(MenuContext);
|
|
977
1097
|
const ref = React52__namespace.useRef(null);
|
|
978
1098
|
React52__namespace.useEffect(() => {
|
|
979
1099
|
if (!ctx.open) return;
|
|
980
1100
|
const container = ref.current;
|
|
981
1101
|
if (container) {
|
|
982
|
-
const items = Array.from(
|
|
1102
|
+
const items = Array.from(
|
|
1103
|
+
container.querySelectorAll('[role="menuitem"]')
|
|
1104
|
+
);
|
|
983
1105
|
if (items.length > 0) {
|
|
984
1106
|
setTimeout(() => items[0].focus(), 50);
|
|
985
1107
|
}
|
|
@@ -1055,7 +1177,16 @@ function DropdownMenuSeparator({ className }) {
|
|
|
1055
1177
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("h-px bg-border my-1.5", className), role: "separator" });
|
|
1056
1178
|
}
|
|
1057
1179
|
var Breadcrumb = React52__namespace.forwardRef(
|
|
1058
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1180
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1181
|
+
"nav",
|
|
1182
|
+
{
|
|
1183
|
+
ref,
|
|
1184
|
+
"aria-label": "Breadcrumb",
|
|
1185
|
+
className: cn("flex items-center gap-1.5 text-[0.85rem] text-muted-foreground", className),
|
|
1186
|
+
...props,
|
|
1187
|
+
children
|
|
1188
|
+
}
|
|
1189
|
+
)
|
|
1059
1190
|
);
|
|
1060
1191
|
Breadcrumb.displayName = "Breadcrumb";
|
|
1061
1192
|
var BreadcrumbItem = React52__namespace.forwardRef(
|
|
@@ -1063,7 +1194,18 @@ var BreadcrumbItem = React52__namespace.forwardRef(
|
|
|
1063
1194
|
if (current) {
|
|
1064
1195
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-current": "page", className: cn("text-foreground font-semibold", className), children });
|
|
1065
1196
|
}
|
|
1066
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1197
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1198
|
+
"a",
|
|
1199
|
+
{
|
|
1200
|
+
ref,
|
|
1201
|
+
className: cn(
|
|
1202
|
+
"text-inherit no-underline hover:text-foreground transition-colors",
|
|
1203
|
+
className
|
|
1204
|
+
),
|
|
1205
|
+
...props,
|
|
1206
|
+
children
|
|
1207
|
+
}
|
|
1208
|
+
);
|
|
1067
1209
|
}
|
|
1068
1210
|
);
|
|
1069
1211
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
@@ -1084,11 +1226,34 @@ function paginate(page, pageCount) {
|
|
|
1084
1226
|
items.push(pageCount);
|
|
1085
1227
|
return items;
|
|
1086
1228
|
}
|
|
1087
|
-
var Chevron = ({ dir }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1229
|
+
var Chevron = ({ dir }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1230
|
+
"svg",
|
|
1231
|
+
{
|
|
1232
|
+
width: 16,
|
|
1233
|
+
height: 16,
|
|
1234
|
+
viewBox: "0 0 24 24",
|
|
1235
|
+
fill: "none",
|
|
1236
|
+
stroke: "currentColor",
|
|
1237
|
+
strokeWidth: 2,
|
|
1238
|
+
strokeLinecap: "round",
|
|
1239
|
+
strokeLinejoin: "round",
|
|
1240
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: dir === "left" ? "15 18 9 12 15 6" : "9 18 15 12 9 6" })
|
|
1241
|
+
}
|
|
1242
|
+
);
|
|
1088
1243
|
function Pagination({ page, pageCount, onPageChange, className }) {
|
|
1089
1244
|
const items = paginate(page, pageCount);
|
|
1090
1245
|
return /* @__PURE__ */ jsxRuntime.jsxs("nav", { "aria-label": "Paginacja", className: cn("flex items-center gap-1", className), children: [
|
|
1091
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1246
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1247
|
+
Button,
|
|
1248
|
+
{
|
|
1249
|
+
variant: "ghost",
|
|
1250
|
+
size: "icon-sm",
|
|
1251
|
+
"aria-label": "Previous",
|
|
1252
|
+
disabled: page <= 1,
|
|
1253
|
+
onClick: () => onPageChange(page - 1),
|
|
1254
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Chevron, { dir: "left" })
|
|
1255
|
+
}
|
|
1256
|
+
),
|
|
1092
1257
|
items.map(
|
|
1093
1258
|
(it, i) => it === "\u2026" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-1 text-muted-foreground select-none", children: "\u2026" }, `e${i}`) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1094
1259
|
Button,
|
|
@@ -1102,7 +1267,17 @@ function Pagination({ page, pageCount, onPageChange, className }) {
|
|
|
1102
1267
|
it
|
|
1103
1268
|
)
|
|
1104
1269
|
),
|
|
1105
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1270
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1271
|
+
Button,
|
|
1272
|
+
{
|
|
1273
|
+
variant: "ghost",
|
|
1274
|
+
size: "icon-sm",
|
|
1275
|
+
"aria-label": "Next",
|
|
1276
|
+
disabled: page >= pageCount,
|
|
1277
|
+
onClick: () => onPageChange(page + 1),
|
|
1278
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Chevron, { dir: "right" })
|
|
1279
|
+
}
|
|
1280
|
+
)
|
|
1106
1281
|
] });
|
|
1107
1282
|
}
|
|
1108
1283
|
var BottomNavigation = React52__namespace.forwardRef(
|
|
@@ -1178,24 +1353,26 @@ var BottomNavigation = React52__namespace.forwardRef(
|
|
|
1178
1353
|
);
|
|
1179
1354
|
BottomNavigation.displayName = "BottomNavigation";
|
|
1180
1355
|
var TableWrap = React52__namespace.forwardRef(
|
|
1181
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1356
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1357
|
+
"div",
|
|
1358
|
+
{
|
|
1359
|
+
ref,
|
|
1360
|
+
className: cn(
|
|
1361
|
+
"w-full max-w-full overflow-x-auto border border-border rounded-kj-lg",
|
|
1362
|
+
className
|
|
1363
|
+
),
|
|
1364
|
+
...props
|
|
1365
|
+
}
|
|
1366
|
+
)
|
|
1182
1367
|
);
|
|
1183
1368
|
TableWrap.displayName = "TableWrap";
|
|
1184
|
-
var Table = React52__namespace.forwardRef(
|
|
1185
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("table", { ref, className: cn("w-full border-collapse text-[0.85rem]", className), ...props })
|
|
1186
|
-
);
|
|
1369
|
+
var Table = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("table", { ref, className: cn("w-full border-collapse text-[0.85rem]", className), ...props }));
|
|
1187
1370
|
Table.displayName = "Table";
|
|
1188
|
-
var TableHeader = React52__namespace.forwardRef(
|
|
1189
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className, ...props })
|
|
1190
|
-
);
|
|
1371
|
+
var TableHeader = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className, ...props }));
|
|
1191
1372
|
TableHeader.displayName = "TableHeader";
|
|
1192
|
-
var TableBody = React52__namespace.forwardRef(
|
|
1193
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className, ...props })
|
|
1194
|
-
);
|
|
1373
|
+
var TableBody = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className, ...props }));
|
|
1195
1374
|
TableBody.displayName = "TableBody";
|
|
1196
|
-
var TableRow = React52__namespace.forwardRef(
|
|
1197
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className: cn("transition-colors hover:bg-muted/50", className), ...props })
|
|
1198
|
-
);
|
|
1375
|
+
var TableRow = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className: cn("transition-colors hover:bg-muted/50", className), ...props }));
|
|
1199
1376
|
TableRow.displayName = "TableRow";
|
|
1200
1377
|
var TableHead = React52__namespace.forwardRef(
|
|
1201
1378
|
({ className, numeric, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1249,7 +1426,14 @@ function Tooltip({ content, children, className }) {
|
|
|
1249
1426
|
);
|
|
1250
1427
|
}
|
|
1251
1428
|
var ModalContext = React52__namespace.createContext(null);
|
|
1252
|
-
function Modal({
|
|
1429
|
+
function Modal({
|
|
1430
|
+
open,
|
|
1431
|
+
onClose,
|
|
1432
|
+
children,
|
|
1433
|
+
width = 440,
|
|
1434
|
+
className,
|
|
1435
|
+
showClose = true
|
|
1436
|
+
}) {
|
|
1253
1437
|
const titleId = React52__namespace.useId();
|
|
1254
1438
|
const descId = React52__namespace.useId();
|
|
1255
1439
|
const containerRef = React52__namespace.useRef(null);
|
|
@@ -1333,7 +1517,7 @@ function Modal({ open, onClose, children, width = 440, className, showClose = tr
|
|
|
1333
1517
|
tabIndex: -1,
|
|
1334
1518
|
style: { maxWidth: width },
|
|
1335
1519
|
className: cn(
|
|
1336
|
-
"relative w-full p-7 rounded-kj-2xl bg-surface border border-border shadow-kj-lg transition-transform duration-200 outline-none",
|
|
1520
|
+
"relative w-full p-7 rounded-kj-2xl bg-surface text-foreground border border-border shadow-kj-lg transition-transform duration-200 outline-none",
|
|
1337
1521
|
open ? "scale-100 translate-y-0" : "scale-95 translate-y-2",
|
|
1338
1522
|
className
|
|
1339
1523
|
),
|
|
@@ -1345,7 +1529,20 @@ function Modal({ open, onClose, children, width = 440, className, showClose = tr
|
|
|
1345
1529
|
onClick: onClose,
|
|
1346
1530
|
"aria-label": "Close",
|
|
1347
1531
|
className: "absolute top-4 right-4 p-1.5 rounded-kj-sm text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
1348
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1532
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1533
|
+
"svg",
|
|
1534
|
+
{
|
|
1535
|
+
width: 16,
|
|
1536
|
+
height: 16,
|
|
1537
|
+
viewBox: "0 0 24 24",
|
|
1538
|
+
fill: "none",
|
|
1539
|
+
stroke: "currentColor",
|
|
1540
|
+
strokeWidth: 2.5,
|
|
1541
|
+
strokeLinecap: "round",
|
|
1542
|
+
strokeLinejoin: "round",
|
|
1543
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
1544
|
+
}
|
|
1545
|
+
)
|
|
1349
1546
|
}
|
|
1350
1547
|
),
|
|
1351
1548
|
children
|
|
@@ -1355,13 +1552,40 @@ function Modal({ open, onClose, children, width = 440, className, showClose = tr
|
|
|
1355
1552
|
}
|
|
1356
1553
|
);
|
|
1357
1554
|
}
|
|
1358
|
-
function ModalTitle({
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1555
|
+
function ModalTitle({
|
|
1556
|
+
className,
|
|
1557
|
+
id,
|
|
1558
|
+
children,
|
|
1559
|
+
...props
|
|
1560
|
+
}) {
|
|
1363
1561
|
const ctx = React52__namespace.useContext(ModalContext);
|
|
1364
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1562
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1563
|
+
"h3",
|
|
1564
|
+
{
|
|
1565
|
+
id: id ?? ctx?.titleId,
|
|
1566
|
+
className: cn(
|
|
1567
|
+
"m-0 mb-2 text-[1.15rem] font-bold tracking-[-0.01em] text-foreground",
|
|
1568
|
+
className
|
|
1569
|
+
),
|
|
1570
|
+
...props,
|
|
1571
|
+
children
|
|
1572
|
+
}
|
|
1573
|
+
);
|
|
1574
|
+
}
|
|
1575
|
+
function ModalDescription({
|
|
1576
|
+
className,
|
|
1577
|
+
id,
|
|
1578
|
+
...props
|
|
1579
|
+
}) {
|
|
1580
|
+
const ctx = React52__namespace.useContext(ModalContext);
|
|
1581
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1582
|
+
"p",
|
|
1583
|
+
{
|
|
1584
|
+
id: id ?? ctx?.descId,
|
|
1585
|
+
className: cn("m-0 text-[0.9rem] text-muted-foreground", className),
|
|
1586
|
+
...props
|
|
1587
|
+
}
|
|
1588
|
+
);
|
|
1365
1589
|
}
|
|
1366
1590
|
function ModalActions({ className, ...props }) {
|
|
1367
1591
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex gap-2.5 justify-end mt-6", className), ...props });
|
|
@@ -1373,15 +1597,57 @@ function useToast() {
|
|
|
1373
1597
|
return ctx;
|
|
1374
1598
|
}
|
|
1375
1599
|
var icons = {
|
|
1376
|
-
default: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1600
|
+
default: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1601
|
+
"svg",
|
|
1602
|
+
{
|
|
1603
|
+
width: 18,
|
|
1604
|
+
height: 18,
|
|
1605
|
+
viewBox: "0 0 24 24",
|
|
1606
|
+
fill: "none",
|
|
1607
|
+
stroke: "currentColor",
|
|
1608
|
+
strokeWidth: 2,
|
|
1609
|
+
strokeLinecap: "round",
|
|
1610
|
+
strokeLinejoin: "round",
|
|
1611
|
+
className: "text-primary",
|
|
1612
|
+
children: [
|
|
1613
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1614
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 16v-4M12 8h.01" })
|
|
1615
|
+
]
|
|
1616
|
+
}
|
|
1617
|
+
),
|
|
1618
|
+
success: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1619
|
+
"svg",
|
|
1620
|
+
{
|
|
1621
|
+
width: 18,
|
|
1622
|
+
height: 18,
|
|
1623
|
+
viewBox: "0 0 24 24",
|
|
1624
|
+
fill: "none",
|
|
1625
|
+
stroke: "currentColor",
|
|
1626
|
+
strokeWidth: 2,
|
|
1627
|
+
strokeLinecap: "round",
|
|
1628
|
+
strokeLinejoin: "round",
|
|
1629
|
+
className: "text-success",
|
|
1630
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" })
|
|
1631
|
+
}
|
|
1632
|
+
),
|
|
1633
|
+
danger: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1634
|
+
"svg",
|
|
1635
|
+
{
|
|
1636
|
+
width: 18,
|
|
1637
|
+
height: 18,
|
|
1638
|
+
viewBox: "0 0 24 24",
|
|
1639
|
+
fill: "none",
|
|
1640
|
+
stroke: "currentColor",
|
|
1641
|
+
strokeWidth: 2,
|
|
1642
|
+
strokeLinecap: "round",
|
|
1643
|
+
strokeLinejoin: "round",
|
|
1644
|
+
className: "text-danger",
|
|
1645
|
+
children: [
|
|
1646
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1647
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 9-6 6M9 9l6 6" })
|
|
1648
|
+
]
|
|
1649
|
+
}
|
|
1650
|
+
)
|
|
1385
1651
|
};
|
|
1386
1652
|
var toneBorder = {
|
|
1387
1653
|
default: "border-l-primary",
|
|
@@ -1515,20 +1781,11 @@ var SectionHeader = React52__namespace.forwardRef(
|
|
|
1515
1781
|
),
|
|
1516
1782
|
...props,
|
|
1517
1783
|
children: children ? children : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1518
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1519
|
-
|
|
1520
|
-
{
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
isCentered && "flex flex-col items-center"
|
|
1524
|
-
),
|
|
1525
|
-
children: [
|
|
1526
|
-
kicker && /* @__PURE__ */ jsxRuntime.jsx(SectionHeaderKicker, { children: kicker }),
|
|
1527
|
-
title && /* @__PURE__ */ jsxRuntime.jsx(SectionHeaderTitle, { as: headingLevel, children: title }),
|
|
1528
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(SectionHeaderDescription, { children: description })
|
|
1529
|
-
]
|
|
1530
|
-
}
|
|
1531
|
-
),
|
|
1784
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-2", isCentered && "flex flex-col items-center"), children: [
|
|
1785
|
+
kicker && /* @__PURE__ */ jsxRuntime.jsx(SectionHeaderKicker, { children: kicker }),
|
|
1786
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(SectionHeaderTitle, { as: headingLevel, children: title }),
|
|
1787
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(SectionHeaderDescription, { children: description })
|
|
1788
|
+
] }),
|
|
1532
1789
|
actions && /* @__PURE__ */ jsxRuntime.jsx(SectionHeaderActions, { className: cn(isCentered && "justify-center mt-4"), children: actions })
|
|
1533
1790
|
] })
|
|
1534
1791
|
}
|
|
@@ -1574,7 +1831,13 @@ var MetricCard = React52__namespace.forwardRef(
|
|
|
1574
1831
|
] }),
|
|
1575
1832
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-2.5 mb-1.5", children: [
|
|
1576
1833
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-3xl font-bold tracking-tight text-foreground", children: value }),
|
|
1577
|
-
trend && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1834
|
+
trend && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1835
|
+
"span",
|
|
1836
|
+
{
|
|
1837
|
+
className: cn("text-[0.75rem] font-bold px-2 py-0.5 rounded-full border", trendColor),
|
|
1838
|
+
children: trend
|
|
1839
|
+
}
|
|
1840
|
+
)
|
|
1578
1841
|
] }),
|
|
1579
1842
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: description })
|
|
1580
1843
|
] });
|
|
@@ -1648,130 +1911,160 @@ function DataTable({
|
|
|
1648
1911
|
};
|
|
1649
1912
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-4 w-full", className), children: [
|
|
1650
1913
|
toolbar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3", children: toolbar }),
|
|
1651
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
),
|
|
1682
|
-
"aria-sort": ariaSort,
|
|
1683
|
-
children: isSortable ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1684
|
-
"button",
|
|
1914
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1915
|
+
TableWrap,
|
|
1916
|
+
{
|
|
1917
|
+
className: "relative overflow-x-auto overflow-y-hidden [scroll-behavior:smooth] [-webkit-overflow-scrolling:touch]",
|
|
1918
|
+
...props,
|
|
1919
|
+
children: [
|
|
1920
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
|
|
1921
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { children: [
|
|
1922
|
+
isSelectionActive && /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-12 px-4 text-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1923
|
+
"input",
|
|
1924
|
+
{
|
|
1925
|
+
type: "checkbox",
|
|
1926
|
+
ref: headerCheckboxRef,
|
|
1927
|
+
checked: allSelected,
|
|
1928
|
+
onChange: handleSelectAll,
|
|
1929
|
+
"aria-label": "Select all rows",
|
|
1930
|
+
className: "h-4 w-4 rounded border-input text-primary focus:ring-ring"
|
|
1931
|
+
}
|
|
1932
|
+
) }) }),
|
|
1933
|
+
columns.map((col, idx) => {
|
|
1934
|
+
const alignClass = {
|
|
1935
|
+
left: "text-left",
|
|
1936
|
+
center: "text-center",
|
|
1937
|
+
right: "text-right"
|
|
1938
|
+
}[col.align || "left"];
|
|
1939
|
+
const isSortable = col.sortable && onSort && col.sortKey;
|
|
1940
|
+
const isSortedActive = sortBy && col.sortKey === sortBy;
|
|
1941
|
+
const ariaSort = isSortable ? isSortedActive ? sortDirection === "asc" ? "ascending" : "descending" : "none" : void 0;
|
|
1942
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1943
|
+
TableHead,
|
|
1685
1944
|
{
|
|
1686
|
-
type: "button",
|
|
1687
|
-
onClick: () => {
|
|
1688
|
-
if (!col.sortKey) return;
|
|
1689
|
-
const nextDirection = isSortedActive && sortDirection === "asc" ? "desc" : "asc";
|
|
1690
|
-
onSort(col.sortKey, nextDirection);
|
|
1691
|
-
},
|
|
1692
1945
|
className: cn(
|
|
1693
|
-
|
|
1946
|
+
alignClass,
|
|
1947
|
+
isSortable && "p-0 hover:bg-muted/30 transition-colors",
|
|
1948
|
+
col.className
|
|
1949
|
+
),
|
|
1950
|
+
"aria-sort": ariaSort,
|
|
1951
|
+
children: isSortable ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1952
|
+
"button",
|
|
1694
1953
|
{
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1954
|
+
type: "button",
|
|
1955
|
+
onClick: () => {
|
|
1956
|
+
if (!col.sortKey) return;
|
|
1957
|
+
const nextDirection = isSortedActive && sortDirection === "asc" ? "desc" : "asc";
|
|
1958
|
+
onSort(col.sortKey, nextDirection);
|
|
1959
|
+
},
|
|
1960
|
+
className: cn(
|
|
1961
|
+
"w-full px-4 py-3 flex items-center gap-1.5 font-semibold text-[0.72rem] uppercase tracking-[0.05em] text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 transition-colors cursor-pointer",
|
|
1962
|
+
{
|
|
1963
|
+
"justify-start text-left": col.align === "left" || !col.align,
|
|
1964
|
+
"justify-center text-center": col.align === "center",
|
|
1965
|
+
"justify-end text-right": col.align === "right"
|
|
1966
|
+
}
|
|
1967
|
+
),
|
|
1968
|
+
children: [
|
|
1969
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: col.header }),
|
|
1970
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground shrink-0 select-none", children: isSortedActive ? sortDirection === "asc" ? "\u25B2" : "\u25BC" : "\u21C5" })
|
|
1971
|
+
]
|
|
1698
1972
|
}
|
|
1699
|
-
)
|
|
1700
|
-
|
|
1701
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: col.header }),
|
|
1702
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground shrink-0 select-none", children: isSortedActive ? sortDirection === "asc" ? "\u25B2" : "\u25BC" : "\u21C5" })
|
|
1703
|
-
]
|
|
1704
|
-
}
|
|
1705
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("inline-flex items-center gap-1.5", alignClass === "text-right" && "justify-end w-full"), children: col.header })
|
|
1706
|
-
},
|
|
1707
|
-
idx
|
|
1708
|
-
);
|
|
1709
|
-
})
|
|
1710
|
-
] }) }),
|
|
1711
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: loading && data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: columns.length + (isSelectionActive ? 1 : 0), className: "h-64 text-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center gap-3", children: [
|
|
1712
|
-
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 32 }),
|
|
1713
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Loading dataset..." })
|
|
1714
|
-
] }) }) }) : error ? /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: columns.length + (isSelectionActive ? 1 : 0), className: "p-8", children: /* @__PURE__ */ jsxRuntime.jsx(Alert, { variant: "danger", title: "Error loading data", children: error }) }) }) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: columns.length + (isSelectionActive ? 1 : 0), className: "p-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1715
|
-
EmptyState,
|
|
1716
|
-
{
|
|
1717
|
-
title: emptyTitle,
|
|
1718
|
-
description: emptyDescription,
|
|
1719
|
-
action: emptyAction,
|
|
1720
|
-
className: "border-none bg-transparent rounded-none py-16"
|
|
1721
|
-
}
|
|
1722
|
-
) }) }) : data.map((row, rowIdx) => {
|
|
1723
|
-
const rowKey = getRowId(row, rowIdx);
|
|
1724
|
-
const isSelected = isSelectionActive && selectedRows.has(rowKey);
|
|
1725
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1726
|
-
TableRow,
|
|
1727
|
-
{
|
|
1728
|
-
onClick: () => onRowClick && onRowClick(row),
|
|
1729
|
-
className: cn(
|
|
1730
|
-
onRowClick && "cursor-pointer hover:bg-muted/40 transition-colors",
|
|
1731
|
-
isSelected && "bg-primary/5 hover:bg-primary/10"
|
|
1732
|
-
),
|
|
1733
|
-
children: [
|
|
1734
|
-
isSelectionActive && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1735
|
-
TableCell,
|
|
1736
|
-
{
|
|
1737
|
-
className: "w-12 px-4 text-center",
|
|
1738
|
-
onClick: (e) => {
|
|
1739
|
-
e.stopPropagation();
|
|
1740
|
-
},
|
|
1741
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1742
|
-
"input",
|
|
1973
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1974
|
+
"div",
|
|
1743
1975
|
{
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1976
|
+
className: cn(
|
|
1977
|
+
"inline-flex items-center gap-1.5",
|
|
1978
|
+
alignClass === "text-right" && "justify-end w-full"
|
|
1979
|
+
),
|
|
1980
|
+
children: col.header
|
|
1749
1981
|
}
|
|
1750
|
-
)
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1982
|
+
)
|
|
1983
|
+
},
|
|
1984
|
+
idx
|
|
1985
|
+
);
|
|
1986
|
+
})
|
|
1987
|
+
] }) }),
|
|
1988
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: loading && data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1989
|
+
TableCell,
|
|
1990
|
+
{
|
|
1991
|
+
colSpan: columns.length + (isSelectionActive ? 1 : 0),
|
|
1992
|
+
className: "h-64 text-center",
|
|
1993
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center gap-3", children: [
|
|
1994
|
+
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 32 }),
|
|
1995
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Loading dataset..." })
|
|
1996
|
+
] })
|
|
1997
|
+
}
|
|
1998
|
+
) }) : error ? /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: columns.length + (isSelectionActive ? 1 : 0), className: "p-8", children: /* @__PURE__ */ jsxRuntime.jsx(Alert, { variant: "danger", title: "Error loading data", children: error }) }) }) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: columns.length + (isSelectionActive ? 1 : 0), className: "p-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1999
|
+
EmptyState,
|
|
2000
|
+
{
|
|
2001
|
+
title: emptyTitle,
|
|
2002
|
+
description: emptyDescription,
|
|
2003
|
+
action: emptyAction,
|
|
2004
|
+
className: "border-none bg-transparent rounded-none py-16"
|
|
2005
|
+
}
|
|
2006
|
+
) }) }) : data.map((row, rowIdx) => {
|
|
2007
|
+
const rowKey = getRowId(row, rowIdx);
|
|
2008
|
+
const isSelected = isSelectionActive && selectedRows.has(rowKey);
|
|
2009
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2010
|
+
TableRow,
|
|
2011
|
+
{
|
|
2012
|
+
onClick: () => onRowClick && onRowClick(row),
|
|
2013
|
+
className: cn(
|
|
2014
|
+
onRowClick && "cursor-pointer hover:bg-muted/40 transition-colors",
|
|
2015
|
+
isSelected && "bg-primary/5 hover:bg-primary/10"
|
|
2016
|
+
),
|
|
2017
|
+
children: [
|
|
2018
|
+
isSelectionActive && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2019
|
+
TableCell,
|
|
2020
|
+
{
|
|
2021
|
+
className: "w-12 px-4 text-center",
|
|
2022
|
+
onClick: (e) => {
|
|
2023
|
+
e.stopPropagation();
|
|
2024
|
+
},
|
|
2025
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2026
|
+
"input",
|
|
2027
|
+
{
|
|
2028
|
+
type: "checkbox",
|
|
2029
|
+
checked: isSelected,
|
|
2030
|
+
onChange: (e) => handleSelectRow(row, rowIdx, e.target.checked),
|
|
2031
|
+
"aria-label": `Select row ${rowIdx + 1}`,
|
|
2032
|
+
className: "h-4 w-4 rounded border-input text-primary focus:ring-ring"
|
|
2033
|
+
}
|
|
2034
|
+
) })
|
|
2035
|
+
}
|
|
2036
|
+
),
|
|
2037
|
+
columns.map((col, colIdx) => {
|
|
2038
|
+
const alignClass = {
|
|
2039
|
+
left: "text-left",
|
|
2040
|
+
center: "text-center",
|
|
2041
|
+
right: "text-right"
|
|
2042
|
+
}[col.align || "left"];
|
|
2043
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: cn(alignClass, col.className), children: col.accessor(row) }, colIdx);
|
|
2044
|
+
})
|
|
2045
|
+
]
|
|
2046
|
+
},
|
|
2047
|
+
rowKey
|
|
2048
|
+
);
|
|
2049
|
+
}) })
|
|
2050
|
+
] }),
|
|
2051
|
+
loading && data.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-background/50 backdrop-blur-[1px] grid place-items-center z-10 transition-opacity duration-150", children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 36 }) })
|
|
2052
|
+
]
|
|
2053
|
+
}
|
|
2054
|
+
),
|
|
1769
2055
|
pagination && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end w-full", children: pagination })
|
|
1770
2056
|
] });
|
|
1771
2057
|
}
|
|
1772
2058
|
DataTable.displayName = "DataTable";
|
|
1773
2059
|
var ErrorState = React52__namespace.forwardRef(
|
|
1774
|
-
({
|
|
2060
|
+
({
|
|
2061
|
+
className,
|
|
2062
|
+
title = "Wyst\u0105pi\u0142 b\u0142\u0105d",
|
|
2063
|
+
message,
|
|
2064
|
+
onRetry,
|
|
2065
|
+
retryLabel = "Spr\xF3buj ponownie",
|
|
2066
|
+
...props
|
|
2067
|
+
}, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1775
2068
|
"div",
|
|
1776
2069
|
{
|
|
1777
2070
|
ref,
|
|
@@ -1781,7 +2074,24 @@ var ErrorState = React52__namespace.forwardRef(
|
|
|
1781
2074
|
),
|
|
1782
2075
|
...props,
|
|
1783
2076
|
children: [
|
|
1784
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-danger-surface border border-danger/30 text-danger mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2077
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-danger-surface border border-danger/30 text-danger mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2078
|
+
"svg",
|
|
2079
|
+
{
|
|
2080
|
+
fill: "none",
|
|
2081
|
+
stroke: "currentColor",
|
|
2082
|
+
strokeWidth: 2.5,
|
|
2083
|
+
viewBox: "0 0 24 24",
|
|
2084
|
+
className: "h-6 w-6",
|
|
2085
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2086
|
+
"path",
|
|
2087
|
+
{
|
|
2088
|
+
strokeLinecap: "round",
|
|
2089
|
+
strokeLinejoin: "round",
|
|
2090
|
+
d: "M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"
|
|
2091
|
+
}
|
|
2092
|
+
)
|
|
2093
|
+
}
|
|
2094
|
+
) }),
|
|
1785
2095
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-bold text-foreground mb-1", children: title }),
|
|
1786
2096
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground max-w-sm mb-6 leading-relaxed", children: message }),
|
|
1787
2097
|
onRetry && /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "danger", onClick: onRetry, children: retryLabel })
|
|
@@ -1791,12 +2101,14 @@ var ErrorState = React52__namespace.forwardRef(
|
|
|
1791
2101
|
);
|
|
1792
2102
|
ErrorState.displayName = "ErrorState";
|
|
1793
2103
|
var Skeleton = React52__namespace.forwardRef(
|
|
1794
|
-
({ className, variant = "rectangular", width, height, style, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2104
|
+
({ className, variant = "rectangular", animation = "shimmer", width, height, style, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1795
2105
|
"div",
|
|
1796
2106
|
{
|
|
1797
2107
|
ref,
|
|
1798
2108
|
className: cn(
|
|
1799
|
-
"
|
|
2109
|
+
"bg-muted-foreground/15 dark:bg-muted-foreground/20",
|
|
2110
|
+
animation === "pulse" && "animate-pulse",
|
|
2111
|
+
animation === "shimmer" && "relative overflow-hidden after:absolute after:inset-0 after:-translate-x-full after:animate-[kjshimmer_2s_ease-in-out_infinite_alternate] after:bg-gradient-to-r after:from-transparent after:via-foreground/10 after:to-transparent",
|
|
1800
2112
|
variant === "text" && "h-3 w-4/5 rounded-sm my-1.5",
|
|
1801
2113
|
variant === "circular" && "rounded-full",
|
|
1802
2114
|
variant === "rectangular" && "rounded-kj-md",
|
|
@@ -1848,7 +2160,16 @@ var DashboardShell = React52__namespace.forwardRef(
|
|
|
1848
2160
|
mobileSidebar ? "hidden md:flex" : "w-full md:flex",
|
|
1849
2161
|
sidebarWidth
|
|
1850
2162
|
),
|
|
1851
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2163
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2164
|
+
"div",
|
|
2165
|
+
{
|
|
2166
|
+
className: cn(
|
|
2167
|
+
"sticky top-0 w-full flex flex-col",
|
|
2168
|
+
mobileSidebar ? "h-screen" : "h-auto md:h-screen"
|
|
2169
|
+
),
|
|
2170
|
+
children: sidebar
|
|
2171
|
+
}
|
|
2172
|
+
)
|
|
1852
2173
|
}
|
|
1853
2174
|
),
|
|
1854
2175
|
mobileSidebar && mobileOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1870,7 +2191,20 @@ var DashboardShell = React52__namespace.forwardRef(
|
|
|
1870
2191
|
type: "button",
|
|
1871
2192
|
onClick: () => setMobileOpen(false),
|
|
1872
2193
|
className: "p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
1873
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2194
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2195
|
+
"svg",
|
|
2196
|
+
{
|
|
2197
|
+
width: 16,
|
|
2198
|
+
height: 16,
|
|
2199
|
+
viewBox: "0 0 24 24",
|
|
2200
|
+
fill: "none",
|
|
2201
|
+
stroke: "currentColor",
|
|
2202
|
+
strokeWidth: 2.5,
|
|
2203
|
+
strokeLinecap: "round",
|
|
2204
|
+
strokeLinejoin: "round",
|
|
2205
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
2206
|
+
}
|
|
2207
|
+
)
|
|
1874
2208
|
}
|
|
1875
2209
|
)
|
|
1876
2210
|
] }),
|
|
@@ -1896,11 +2230,24 @@ var DashboardShell = React52__namespace.forwardRef(
|
|
|
1896
2230
|
onClick: () => setMobileOpen(true),
|
|
1897
2231
|
className: "md:hidden p-1.5 -ml-1.5 rounded-kj-sm text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
1898
2232
|
"aria-label": "Open navigation",
|
|
1899
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
2233
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2234
|
+
"svg",
|
|
2235
|
+
{
|
|
2236
|
+
width: 20,
|
|
2237
|
+
height: 20,
|
|
2238
|
+
viewBox: "0 0 24 24",
|
|
2239
|
+
fill: "none",
|
|
2240
|
+
stroke: "currentColor",
|
|
2241
|
+
strokeWidth: 2.5,
|
|
2242
|
+
strokeLinecap: "round",
|
|
2243
|
+
strokeLinejoin: "round",
|
|
2244
|
+
children: [
|
|
2245
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
|
|
2246
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
|
|
2247
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
|
|
2248
|
+
]
|
|
2249
|
+
}
|
|
2250
|
+
)
|
|
1904
2251
|
}
|
|
1905
2252
|
),
|
|
1906
2253
|
topbar
|
|
@@ -1931,7 +2278,18 @@ var SettingsLayout = React52__namespace.forwardRef(
|
|
|
1931
2278
|
);
|
|
1932
2279
|
SettingsLayout.displayName = "SettingsLayout";
|
|
1933
2280
|
var DetailPageLayout = React52__namespace.forwardRef(
|
|
1934
|
-
({
|
|
2281
|
+
({
|
|
2282
|
+
className,
|
|
2283
|
+
title,
|
|
2284
|
+
description,
|
|
2285
|
+
backHref,
|
|
2286
|
+
backLabel = "Back",
|
|
2287
|
+
onBackClick,
|
|
2288
|
+
actions,
|
|
2289
|
+
aside,
|
|
2290
|
+
children,
|
|
2291
|
+
...props
|
|
2292
|
+
}, ref) => {
|
|
1935
2293
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-6 w-full", className), ...props, children: [
|
|
1936
2294
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
1937
2295
|
(backHref || onBackClick) && /* @__PURE__ */ jsxRuntime.jsx("div", { children: backHref ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1943,7 +2301,24 @@ var DetailPageLayout = React52__namespace.forwardRef(
|
|
|
1943
2301
|
"-ml-3 h-8 text-muted-foreground hover:text-foreground inline-flex items-center gap-1.5"
|
|
1944
2302
|
),
|
|
1945
2303
|
children: [
|
|
1946
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2304
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2305
|
+
"svg",
|
|
2306
|
+
{
|
|
2307
|
+
viewBox: "0 0 24 24",
|
|
2308
|
+
fill: "none",
|
|
2309
|
+
stroke: "currentColor",
|
|
2310
|
+
strokeWidth: "2.5",
|
|
2311
|
+
className: "h-4 w-4",
|
|
2312
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2313
|
+
"path",
|
|
2314
|
+
{
|
|
2315
|
+
strokeLinecap: "round",
|
|
2316
|
+
strokeLinejoin: "round",
|
|
2317
|
+
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
2318
|
+
}
|
|
2319
|
+
)
|
|
2320
|
+
}
|
|
2321
|
+
),
|
|
1947
2322
|
backLabel
|
|
1948
2323
|
]
|
|
1949
2324
|
}
|
|
@@ -1955,7 +2330,24 @@ var DetailPageLayout = React52__namespace.forwardRef(
|
|
|
1955
2330
|
className: "-ml-3 h-8 text-muted-foreground hover:text-foreground",
|
|
1956
2331
|
onClick: onBackClick,
|
|
1957
2332
|
children: [
|
|
1958
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2333
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2334
|
+
"svg",
|
|
2335
|
+
{
|
|
2336
|
+
viewBox: "0 0 24 24",
|
|
2337
|
+
fill: "none",
|
|
2338
|
+
stroke: "currentColor",
|
|
2339
|
+
strokeWidth: "2.5",
|
|
2340
|
+
className: "h-4 w-4 mr-1.5",
|
|
2341
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2342
|
+
"path",
|
|
2343
|
+
{
|
|
2344
|
+
strokeLinecap: "round",
|
|
2345
|
+
strokeLinejoin: "round",
|
|
2346
|
+
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
2347
|
+
}
|
|
2348
|
+
)
|
|
2349
|
+
}
|
|
2350
|
+
),
|
|
1959
2351
|
backLabel
|
|
1960
2352
|
]
|
|
1961
2353
|
}
|
|
@@ -1977,7 +2369,15 @@ var DetailPageLayout = React52__namespace.forwardRef(
|
|
|
1977
2369
|
);
|
|
1978
2370
|
DetailPageLayout.displayName = "DetailPageLayout";
|
|
1979
2371
|
var TableToolbar = React52__namespace.forwardRef(
|
|
1980
|
-
({
|
|
2372
|
+
({
|
|
2373
|
+
className,
|
|
2374
|
+
searchQuery,
|
|
2375
|
+
onSearchChange,
|
|
2376
|
+
searchPlaceholder = "Search...",
|
|
2377
|
+
actions,
|
|
2378
|
+
filters,
|
|
2379
|
+
...props
|
|
2380
|
+
}, ref) => {
|
|
1981
2381
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1982
2382
|
"div",
|
|
1983
2383
|
{
|
|
@@ -1997,7 +2397,24 @@ var TableToolbar = React52__namespace.forwardRef(
|
|
|
1997
2397
|
value: searchQuery,
|
|
1998
2398
|
onChange: (e) => onSearchChange(e.target.value),
|
|
1999
2399
|
className: "sm:w-64",
|
|
2000
|
-
leadingIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2400
|
+
leadingIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2401
|
+
"svg",
|
|
2402
|
+
{
|
|
2403
|
+
viewBox: "0 0 24 24",
|
|
2404
|
+
fill: "none",
|
|
2405
|
+
stroke: "currentColor",
|
|
2406
|
+
strokeWidth: "2.5",
|
|
2407
|
+
className: "h-4 w-4",
|
|
2408
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2409
|
+
"path",
|
|
2410
|
+
{
|
|
2411
|
+
strokeLinecap: "round",
|
|
2412
|
+
strokeLinejoin: "round",
|
|
2413
|
+
d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
|
|
2414
|
+
}
|
|
2415
|
+
)
|
|
2416
|
+
}
|
|
2417
|
+
)
|
|
2001
2418
|
}
|
|
2002
2419
|
),
|
|
2003
2420
|
filters && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: filters })
|
|
@@ -2107,14 +2524,8 @@ function Drawer({
|
|
|
2107
2524
|
};
|
|
2108
2525
|
}, [open, onClose]);
|
|
2109
2526
|
const sideClasses = {
|
|
2110
|
-
right: cn(
|
|
2111
|
-
|
|
2112
|
-
open ? "translate-x-0" : "translate-x-full"
|
|
2113
|
-
),
|
|
2114
|
-
left: cn(
|
|
2115
|
-
"left-0 h-full border-r",
|
|
2116
|
-
open ? "translate-x-0" : "-translate-x-full"
|
|
2117
|
-
)
|
|
2527
|
+
right: cn("right-0 h-full border-l", open ? "translate-x-0" : "translate-x-full"),
|
|
2528
|
+
left: cn("left-0 h-full border-r", open ? "translate-x-0" : "-translate-x-full")
|
|
2118
2529
|
}[side];
|
|
2119
2530
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2120
2531
|
"div",
|
|
@@ -2153,7 +2564,20 @@ function Drawer({
|
|
|
2153
2564
|
onClick: onClose,
|
|
2154
2565
|
"aria-label": "Close",
|
|
2155
2566
|
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
2156
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2567
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2568
|
+
"svg",
|
|
2569
|
+
{
|
|
2570
|
+
width: 16,
|
|
2571
|
+
height: 16,
|
|
2572
|
+
viewBox: "0 0 24 24",
|
|
2573
|
+
fill: "none",
|
|
2574
|
+
stroke: "currentColor",
|
|
2575
|
+
strokeWidth: 2.5,
|
|
2576
|
+
strokeLinecap: "round",
|
|
2577
|
+
strokeLinejoin: "round",
|
|
2578
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
2579
|
+
}
|
|
2580
|
+
)
|
|
2157
2581
|
}
|
|
2158
2582
|
)
|
|
2159
2583
|
] }),
|
|
@@ -2165,7 +2589,12 @@ function Drawer({
|
|
|
2165
2589
|
);
|
|
2166
2590
|
}
|
|
2167
2591
|
Drawer.displayName = "Drawer";
|
|
2168
|
-
function CommandPalette({
|
|
2592
|
+
function CommandPalette({
|
|
2593
|
+
open,
|
|
2594
|
+
onClose,
|
|
2595
|
+
items,
|
|
2596
|
+
placeholder = "Type a command or search..."
|
|
2597
|
+
}) {
|
|
2169
2598
|
const [search, setSearch] = React52__namespace.useState("");
|
|
2170
2599
|
const [activeIndex, setActiveIndex] = React52__namespace.useState(0);
|
|
2171
2600
|
const containerRef = React52__namespace.useRef(null);
|
|
@@ -2198,10 +2627,14 @@ function CommandPalette({ open, onClose, items, placeholder = "Type a command or
|
|
|
2198
2627
|
}
|
|
2199
2628
|
if (e.key === "ArrowDown") {
|
|
2200
2629
|
e.preventDefault();
|
|
2201
|
-
setActiveIndex(
|
|
2630
|
+
setActiveIndex(
|
|
2631
|
+
(prev) => filteredItems.length === 0 ? 0 : (prev + 1) % filteredItems.length
|
|
2632
|
+
);
|
|
2202
2633
|
} else if (e.key === "ArrowUp") {
|
|
2203
2634
|
e.preventDefault();
|
|
2204
|
-
setActiveIndex(
|
|
2635
|
+
setActiveIndex(
|
|
2636
|
+
(prev) => filteredItems.length === 0 ? 0 : (prev - 1 + filteredItems.length) % filteredItems.length
|
|
2637
|
+
);
|
|
2205
2638
|
} else if (e.key === "Enter") {
|
|
2206
2639
|
e.preventDefault();
|
|
2207
2640
|
if (filteredItems[activeIndex]) {
|
|
@@ -2244,7 +2677,24 @@ function CommandPalette({ open, onClose, items, placeholder = "Type a command or
|
|
|
2244
2677
|
className: "w-[95vw] max-w-lg bg-surface border border-border rounded-kj-xl shadow-kj-lg flex flex-col overflow-hidden max-h-[500px]",
|
|
2245
2678
|
children: [
|
|
2246
2679
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 border-b border-border flex items-center gap-2", children: [
|
|
2247
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2680
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2681
|
+
"svg",
|
|
2682
|
+
{
|
|
2683
|
+
viewBox: "0 0 24 24",
|
|
2684
|
+
fill: "none",
|
|
2685
|
+
stroke: "currentColor",
|
|
2686
|
+
strokeWidth: "2.5",
|
|
2687
|
+
className: "h-5 w-5 text-muted-foreground shrink-0 ml-1",
|
|
2688
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2689
|
+
"path",
|
|
2690
|
+
{
|
|
2691
|
+
strokeLinecap: "round",
|
|
2692
|
+
strokeLinejoin: "round",
|
|
2693
|
+
d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
|
|
2694
|
+
}
|
|
2695
|
+
)
|
|
2696
|
+
}
|
|
2697
|
+
),
|
|
2248
2698
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2249
2699
|
"input",
|
|
2250
2700
|
{
|
|
@@ -2274,54 +2724,72 @@ function CommandPalette({ open, onClose, items, placeholder = "Type a command or
|
|
|
2274
2724
|
role: "listbox",
|
|
2275
2725
|
"aria-label": "Commands",
|
|
2276
2726
|
className: "space-y-4",
|
|
2277
|
-
children: Object.entries(groups).map(([cat, itemsInCat]) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
2305
|
-
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground [&_svg]:h-[1.1rem] [&_svg]:w-[1.1rem]", children: item.icon }),
|
|
2306
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex flex-col", children: [
|
|
2307
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-[0.85rem] font-semibold", isActive ? "text-primary" : "text-foreground"), children: item.title }),
|
|
2308
|
-
item.subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.75rem] text-muted-foreground truncate", children: item.subtitle })
|
|
2309
|
-
] })
|
|
2310
|
-
] }),
|
|
2311
|
-
item.shortcut && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", children: item.shortcut.map((sc, scIdx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2312
|
-
"kbd",
|
|
2313
|
-
{
|
|
2314
|
-
className: "px-1.5 py-0.5 rounded border border-border bg-subtle text-[10px] font-mono leading-none shadow-kj-xs text-muted-foreground",
|
|
2315
|
-
children: sc
|
|
2727
|
+
children: Object.entries(groups).map(([cat, itemsInCat]) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2728
|
+
"div",
|
|
2729
|
+
{
|
|
2730
|
+
role: "group",
|
|
2731
|
+
"aria-labelledby": `cmd-cat-${cat}`,
|
|
2732
|
+
className: "space-y-1",
|
|
2733
|
+
children: [
|
|
2734
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2735
|
+
"div",
|
|
2736
|
+
{
|
|
2737
|
+
id: `cmd-cat-${cat}`,
|
|
2738
|
+
className: "px-3 py-1 text-[0.65rem] font-bold uppercase tracking-wider text-muted-foreground",
|
|
2739
|
+
children: cat
|
|
2740
|
+
}
|
|
2741
|
+
),
|
|
2742
|
+
itemsInCat.map((item) => {
|
|
2743
|
+
const currentIdx = absoluteItemIndex++;
|
|
2744
|
+
const isActive = currentIdx === activeIndex;
|
|
2745
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2746
|
+
"div",
|
|
2747
|
+
{
|
|
2748
|
+
id: `cmd-item-${currentIdx}`,
|
|
2749
|
+
role: "option",
|
|
2750
|
+
"aria-selected": isActive,
|
|
2751
|
+
onClick: () => {
|
|
2752
|
+
item.action();
|
|
2753
|
+
onClose();
|
|
2316
2754
|
},
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2755
|
+
className: cn(
|
|
2756
|
+
"flex items-center justify-between gap-3 px-3 py-2.5 rounded-kj-md cursor-pointer select-none transition-colors",
|
|
2757
|
+
isActive ? "bg-primary/10 text-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
2758
|
+
),
|
|
2759
|
+
children: [
|
|
2760
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
2761
|
+
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground [&_svg]:h-[1.1rem] [&_svg]:w-[1.1rem]", children: item.icon }),
|
|
2762
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex flex-col", children: [
|
|
2763
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2764
|
+
"span",
|
|
2765
|
+
{
|
|
2766
|
+
className: cn(
|
|
2767
|
+
"text-[0.85rem] font-semibold",
|
|
2768
|
+
isActive ? "text-primary" : "text-foreground"
|
|
2769
|
+
),
|
|
2770
|
+
children: item.title
|
|
2771
|
+
}
|
|
2772
|
+
),
|
|
2773
|
+
item.subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.75rem] text-muted-foreground truncate", children: item.subtitle })
|
|
2774
|
+
] })
|
|
2775
|
+
] }),
|
|
2776
|
+
item.shortcut && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", children: item.shortcut.map((sc, scIdx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2777
|
+
"kbd",
|
|
2778
|
+
{
|
|
2779
|
+
className: "px-1.5 py-0.5 rounded border border-border bg-subtle text-[10px] font-mono leading-none shadow-kj-xs text-muted-foreground",
|
|
2780
|
+
children: sc
|
|
2781
|
+
},
|
|
2782
|
+
scIdx
|
|
2783
|
+
)) })
|
|
2784
|
+
]
|
|
2785
|
+
},
|
|
2786
|
+
item.id
|
|
2787
|
+
);
|
|
2788
|
+
})
|
|
2789
|
+
]
|
|
2790
|
+
},
|
|
2791
|
+
cat
|
|
2792
|
+
))
|
|
2325
2793
|
}
|
|
2326
2794
|
) }),
|
|
2327
2795
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-2.5 border-t border-border bg-subtle flex items-center justify-between text-[11px] text-muted-foreground font-medium", children: [
|
|
@@ -2332,7 +2800,8 @@ function CommandPalette({ open, onClose, items, placeholder = "Type a command or
|
|
|
2332
2800
|
] }),
|
|
2333
2801
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1", children: [
|
|
2334
2802
|
/* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "font-mono text-[9px] px-1 border rounded bg-surface", children: "Enter" }),
|
|
2335
|
-
"
|
|
2803
|
+
" ",
|
|
2804
|
+
"Select"
|
|
2336
2805
|
] })
|
|
2337
2806
|
] }),
|
|
2338
2807
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -2354,10 +2823,16 @@ function SidebarNav({ className, groups, currentHref, ...props }) {
|
|
|
2354
2823
|
const isActive = item.active || item.href && currentHref && currentHref === item.href;
|
|
2355
2824
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2356
2825
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2.5 min-w-0", children: [
|
|
2357
|
-
item.icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2358
|
-
"
|
|
2359
|
-
|
|
2360
|
-
|
|
2826
|
+
item.icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2827
|
+
"span",
|
|
2828
|
+
{
|
|
2829
|
+
className: cn(
|
|
2830
|
+
"[&_svg]:h-[1.1rem] [&_svg]:w-[1.1rem] shrink-0",
|
|
2831
|
+
isActive ? "text-primary" : "text-muted-foreground group-hover:text-foreground"
|
|
2832
|
+
),
|
|
2833
|
+
children: item.icon
|
|
2834
|
+
}
|
|
2835
|
+
),
|
|
2361
2836
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: item.label })
|
|
2362
2837
|
] }),
|
|
2363
2838
|
item.badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 flex items-center justify-center", children: item.badge })
|
|
@@ -2369,16 +2844,7 @@ function SidebarNav({ className, groups, currentHref, ...props }) {
|
|
|
2369
2844
|
if (item.href) {
|
|
2370
2845
|
return /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, className: itemClass, children: content }, item.id);
|
|
2371
2846
|
}
|
|
2372
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2373
|
-
"button",
|
|
2374
|
-
{
|
|
2375
|
-
type: "button",
|
|
2376
|
-
onClick: item.onClick,
|
|
2377
|
-
className: itemClass,
|
|
2378
|
-
children: content
|
|
2379
|
-
},
|
|
2380
|
-
item.id
|
|
2381
|
-
);
|
|
2847
|
+
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: item.onClick, className: itemClass, children: content }, item.id);
|
|
2382
2848
|
}) })
|
|
2383
2849
|
] }, groupIdx)) });
|
|
2384
2850
|
}
|
|
@@ -2574,7 +3040,20 @@ function BottomSheet({
|
|
|
2574
3040
|
onClick: onClose,
|
|
2575
3041
|
"aria-label": "Close",
|
|
2576
3042
|
className: "absolute top-4 right-4 p-1.5 rounded-kj-sm text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer z-10",
|
|
2577
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3043
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3044
|
+
"svg",
|
|
3045
|
+
{
|
|
3046
|
+
width: 16,
|
|
3047
|
+
height: 16,
|
|
3048
|
+
viewBox: "0 0 24 24",
|
|
3049
|
+
fill: "none",
|
|
3050
|
+
stroke: "currentColor",
|
|
3051
|
+
strokeWidth: 2.5,
|
|
3052
|
+
strokeLinecap: "round",
|
|
3053
|
+
strokeLinejoin: "round",
|
|
3054
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
3055
|
+
}
|
|
3056
|
+
)
|
|
2578
3057
|
}
|
|
2579
3058
|
),
|
|
2580
3059
|
children
|
|
@@ -2587,19 +3066,49 @@ function BottomSheet({
|
|
|
2587
3066
|
function BottomSheetHeader({ className, ...props }) {
|
|
2588
3067
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("p-6 flex flex-col gap-1.5 border-b border-border", className), ...props });
|
|
2589
3068
|
}
|
|
2590
|
-
function BottomSheetTitle({
|
|
3069
|
+
function BottomSheetTitle({
|
|
3070
|
+
className,
|
|
3071
|
+
id,
|
|
3072
|
+
children,
|
|
3073
|
+
...props
|
|
3074
|
+
}) {
|
|
2591
3075
|
const ctx = React52__namespace.useContext(BottomSheetContext);
|
|
2592
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3076
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3077
|
+
"h2",
|
|
3078
|
+
{
|
|
3079
|
+
id: id ?? ctx?.titleId,
|
|
3080
|
+
className: cn("m-0 text-[1.15rem] font-bold tracking-[-0.01em]", className),
|
|
3081
|
+
...props,
|
|
3082
|
+
children
|
|
3083
|
+
}
|
|
3084
|
+
);
|
|
2593
3085
|
}
|
|
2594
|
-
function BottomSheetDescription({
|
|
3086
|
+
function BottomSheetDescription({
|
|
3087
|
+
className,
|
|
3088
|
+
id,
|
|
3089
|
+
...props
|
|
3090
|
+
}) {
|
|
2595
3091
|
const ctx = React52__namespace.useContext(BottomSheetContext);
|
|
2596
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3092
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3093
|
+
"p",
|
|
3094
|
+
{
|
|
3095
|
+
id: id ?? ctx?.descId,
|
|
3096
|
+
className: cn("m-0 text-[0.9rem] text-muted-foreground", className),
|
|
3097
|
+
...props
|
|
3098
|
+
}
|
|
3099
|
+
);
|
|
2597
3100
|
}
|
|
2598
3101
|
function BottomSheetContent({ className, ...props }) {
|
|
2599
3102
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("p-6 overflow-y-auto flex-1", className), ...props });
|
|
2600
3103
|
}
|
|
2601
3104
|
function BottomSheetFooter({ className, ...props }) {
|
|
2602
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3105
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3106
|
+
"div",
|
|
3107
|
+
{
|
|
3108
|
+
className: cn("p-6 border-t border-border flex gap-2.5 justify-end mt-auto", className),
|
|
3109
|
+
...props
|
|
3110
|
+
}
|
|
3111
|
+
);
|
|
2603
3112
|
}
|
|
2604
3113
|
var kbdVariants = classVarianceAuthority.cva(
|
|
2605
3114
|
"inline-flex items-center justify-center font-mono font-medium text-muted-foreground bg-muted border border-border border-b-2 rounded-kj-sm select-none",
|
|
@@ -2678,7 +3187,11 @@ var CodeBlock = React52__namespace.forwardRef(
|
|
|
2678
3187
|
}
|
|
2679
3188
|
);
|
|
2680
3189
|
CodeBlock.displayName = "CodeBlock";
|
|
2681
|
-
function Separator({
|
|
3190
|
+
function Separator({
|
|
3191
|
+
orientation = "horizontal",
|
|
3192
|
+
decorative = true,
|
|
3193
|
+
className
|
|
3194
|
+
}) {
|
|
2682
3195
|
const semanticProps = decorative ? { role: "none", "aria-hidden": true } : { role: "separator", "aria-orientation": orientation };
|
|
2683
3196
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2684
3197
|
"div",
|
|
@@ -2996,7 +3509,18 @@ var Combobox = React52__namespace.forwardRef(
|
|
|
2996
3509
|
removeValue(value);
|
|
2997
3510
|
},
|
|
2998
3511
|
className: "rounded-full p-0.5 leading-none hover:bg-primary/20",
|
|
2999
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3512
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3513
|
+
"svg",
|
|
3514
|
+
{
|
|
3515
|
+
viewBox: "0 0 24 24",
|
|
3516
|
+
className: "h-3 w-3",
|
|
3517
|
+
fill: "none",
|
|
3518
|
+
stroke: "currentColor",
|
|
3519
|
+
strokeWidth: "2.5",
|
|
3520
|
+
strokeLinecap: "round",
|
|
3521
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
3522
|
+
}
|
|
3523
|
+
)
|
|
3000
3524
|
}
|
|
3001
3525
|
)
|
|
3002
3526
|
]
|
|
@@ -3027,7 +3551,19 @@ var Combobox = React52__namespace.forwardRef(
|
|
|
3027
3551
|
),
|
|
3028
3552
|
name && multiple && selected.map((v) => /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: v }, v)),
|
|
3029
3553
|
name && !multiple && /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: selected[0] ?? "" }),
|
|
3030
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3554
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3555
|
+
"svg",
|
|
3556
|
+
{
|
|
3557
|
+
viewBox: "0 0 24 24",
|
|
3558
|
+
className: "h-4 w-4",
|
|
3559
|
+
fill: "none",
|
|
3560
|
+
stroke: "currentColor",
|
|
3561
|
+
strokeWidth: "2.5",
|
|
3562
|
+
strokeLinecap: "round",
|
|
3563
|
+
strokeLinejoin: "round",
|
|
3564
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 9 6 6 6-6" })
|
|
3565
|
+
}
|
|
3566
|
+
) })
|
|
3031
3567
|
]
|
|
3032
3568
|
}
|
|
3033
3569
|
),
|
|
@@ -3080,7 +3616,19 @@ var Combobox = React52__namespace.forwardRef(
|
|
|
3080
3616
|
),
|
|
3081
3617
|
children: [
|
|
3082
3618
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: opt.label }),
|
|
3083
|
-
isSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3619
|
+
isSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3620
|
+
"svg",
|
|
3621
|
+
{
|
|
3622
|
+
viewBox: "0 0 24 24",
|
|
3623
|
+
className: "h-4 w-4 text-primary shrink-0",
|
|
3624
|
+
fill: "none",
|
|
3625
|
+
stroke: "currentColor",
|
|
3626
|
+
strokeWidth: "2.5",
|
|
3627
|
+
strokeLinecap: "round",
|
|
3628
|
+
strokeLinejoin: "round",
|
|
3629
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m5 12 5 5L20 7" })
|
|
3630
|
+
}
|
|
3631
|
+
)
|
|
3084
3632
|
]
|
|
3085
3633
|
},
|
|
3086
3634
|
opt.value
|
|
@@ -3148,7 +3696,10 @@ function toISODateString(d) {
|
|
|
3148
3696
|
const day = String(d.getDate()).padStart(2, "0");
|
|
3149
3697
|
return `${y}-${m}-${day}`;
|
|
3150
3698
|
}
|
|
3151
|
-
var monthLabelFormat = new Intl.DateTimeFormat(void 0, {
|
|
3699
|
+
var monthLabelFormat = new Intl.DateTimeFormat(void 0, {
|
|
3700
|
+
month: "long",
|
|
3701
|
+
year: "numeric"
|
|
3702
|
+
});
|
|
3152
3703
|
var fullDateFormat = new Intl.DateTimeFormat(void 0, { dateStyle: "full" });
|
|
3153
3704
|
var weekdayShortFormat = new Intl.DateTimeFormat(void 0, { weekday: "short" });
|
|
3154
3705
|
var weekdayLongFormat = new Intl.DateTimeFormat(void 0, { weekday: "long" });
|
|
@@ -3156,334 +3707,387 @@ var weekdayLabels = Array.from({ length: 7 }, (_, i) => {
|
|
|
3156
3707
|
const d = addDays(startOfWeek(/* @__PURE__ */ new Date()), i);
|
|
3157
3708
|
return { key: i, short: weekdayShortFormat.format(d), long: weekdayLongFormat.format(d) };
|
|
3158
3709
|
});
|
|
3159
|
-
var CalendarGrid = React52__namespace.forwardRef(
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
next = addDays(
|
|
3182
|
-
guard
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
const selectDay = (d) => {
|
|
3187
|
-
if (isDayDisabled(d)) return;
|
|
3188
|
-
moveFocusTo(d, false);
|
|
3189
|
-
onSelectDay(d);
|
|
3190
|
-
};
|
|
3191
|
-
const onGridKeyDown = (e) => {
|
|
3192
|
-
switch (e.key) {
|
|
3193
|
-
case "ArrowRight":
|
|
3194
|
-
e.preventDefault();
|
|
3195
|
-
moveFocusTo(step(rovingTarget, 1), true);
|
|
3196
|
-
break;
|
|
3197
|
-
case "ArrowLeft":
|
|
3198
|
-
e.preventDefault();
|
|
3199
|
-
moveFocusTo(step(rovingTarget, -1), true);
|
|
3200
|
-
break;
|
|
3201
|
-
case "ArrowDown":
|
|
3202
|
-
e.preventDefault();
|
|
3203
|
-
moveFocusTo(step(rovingTarget, 7), true);
|
|
3204
|
-
break;
|
|
3205
|
-
case "ArrowUp":
|
|
3206
|
-
e.preventDefault();
|
|
3207
|
-
moveFocusTo(step(rovingTarget, -7), true);
|
|
3208
|
-
break;
|
|
3209
|
-
case "Home": {
|
|
3210
|
-
e.preventDefault();
|
|
3211
|
-
const target = startOfWeek(rovingTarget);
|
|
3212
|
-
moveFocusTo(isDayDisabled(target) ? step(target, 1) : target, true);
|
|
3213
|
-
break;
|
|
3214
|
-
}
|
|
3215
|
-
case "End": {
|
|
3216
|
-
e.preventDefault();
|
|
3217
|
-
const target = addDays(startOfWeek(rovingTarget), 6);
|
|
3218
|
-
moveFocusTo(isDayDisabled(target) ? step(target, -1) : target, true);
|
|
3219
|
-
break;
|
|
3220
|
-
}
|
|
3221
|
-
case "PageUp": {
|
|
3222
|
-
e.preventDefault();
|
|
3223
|
-
const target = e.shiftKey ? addYearsClamped(rovingTarget, -1) : addMonthsClamped(rovingTarget, -1);
|
|
3224
|
-
moveFocusTo(isDayDisabled(target) ? step(target, -1) : target, true);
|
|
3225
|
-
break;
|
|
3710
|
+
var CalendarGrid = React52__namespace.forwardRef(
|
|
3711
|
+
function CalendarGrid2({ viewMonth, isDayDisabled, cellState, onSelectDay, onFocusDay, initialFocusDate, className }, ref) {
|
|
3712
|
+
const gridDays = React52__namespace.useMemo(() => buildGridDays(viewMonth), [viewMonth]);
|
|
3713
|
+
const inViewMonth = (d) => d.getMonth() === viewMonth.getMonth() && d.getFullYear() === viewMonth.getFullYear();
|
|
3714
|
+
const [focusedDate, setFocusedDate] = React52__namespace.useState(() => startOfDay(initialFocusDate));
|
|
3715
|
+
const pendingFocusRef = React52__namespace.useRef(false);
|
|
3716
|
+
const gridRef = React52__namespace.useRef(null);
|
|
3717
|
+
const rovingTarget = inViewMonth(focusedDate) && !isDayDisabled(focusedDate) ? focusedDate : gridDays.find((d) => inViewMonth(d) && !isDayDisabled(d)) ?? gridDays.find((d) => inViewMonth(d)) ?? gridDays[0];
|
|
3718
|
+
const moveFocusTo = (next, viaKeyboard) => {
|
|
3719
|
+
pendingFocusRef.current = viaKeyboard;
|
|
3720
|
+
setFocusedDate(next);
|
|
3721
|
+
onFocusDay?.(next);
|
|
3722
|
+
};
|
|
3723
|
+
React52__namespace.useEffect(() => {
|
|
3724
|
+
if (!pendingFocusRef.current) return;
|
|
3725
|
+
pendingFocusRef.current = false;
|
|
3726
|
+
const el = gridRef.current?.querySelector(
|
|
3727
|
+
`[data-date="${dateKey(rovingTarget)}"]`
|
|
3728
|
+
);
|
|
3729
|
+
el?.focus();
|
|
3730
|
+
}, [rovingTarget]);
|
|
3731
|
+
const step = (from, delta) => {
|
|
3732
|
+
let next = addDays(from, delta);
|
|
3733
|
+
let guard = 0;
|
|
3734
|
+
while (isDayDisabled(next) && guard < 1e3) {
|
|
3735
|
+
next = addDays(next, delta);
|
|
3736
|
+
guard++;
|
|
3226
3737
|
}
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3738
|
+
return isDayDisabled(next) ? from : next;
|
|
3739
|
+
};
|
|
3740
|
+
const selectDay = (d) => {
|
|
3741
|
+
if (isDayDisabled(d)) return;
|
|
3742
|
+
moveFocusTo(d, false);
|
|
3743
|
+
onSelectDay(d);
|
|
3744
|
+
};
|
|
3745
|
+
const onGridKeyDown = (e) => {
|
|
3746
|
+
switch (e.key) {
|
|
3747
|
+
case "ArrowRight":
|
|
3748
|
+
e.preventDefault();
|
|
3749
|
+
moveFocusTo(step(rovingTarget, 1), true);
|
|
3750
|
+
break;
|
|
3751
|
+
case "ArrowLeft":
|
|
3752
|
+
e.preventDefault();
|
|
3753
|
+
moveFocusTo(step(rovingTarget, -1), true);
|
|
3754
|
+
break;
|
|
3755
|
+
case "ArrowDown":
|
|
3756
|
+
e.preventDefault();
|
|
3757
|
+
moveFocusTo(step(rovingTarget, 7), true);
|
|
3758
|
+
break;
|
|
3759
|
+
case "ArrowUp":
|
|
3760
|
+
e.preventDefault();
|
|
3761
|
+
moveFocusTo(step(rovingTarget, -7), true);
|
|
3762
|
+
break;
|
|
3763
|
+
case "Home": {
|
|
3764
|
+
e.preventDefault();
|
|
3765
|
+
const target = startOfWeek(rovingTarget);
|
|
3766
|
+
moveFocusTo(isDayDisabled(target) ? step(target, 1) : target, true);
|
|
3767
|
+
break;
|
|
3768
|
+
}
|
|
3769
|
+
case "End": {
|
|
3770
|
+
e.preventDefault();
|
|
3771
|
+
const target = addDays(startOfWeek(rovingTarget), 6);
|
|
3772
|
+
moveFocusTo(isDayDisabled(target) ? step(target, -1) : target, true);
|
|
3773
|
+
break;
|
|
3774
|
+
}
|
|
3775
|
+
case "PageUp": {
|
|
3776
|
+
e.preventDefault();
|
|
3777
|
+
const target = e.shiftKey ? addYearsClamped(rovingTarget, -1) : addMonthsClamped(rovingTarget, -1);
|
|
3778
|
+
moveFocusTo(isDayDisabled(target) ? step(target, -1) : target, true);
|
|
3779
|
+
break;
|
|
3780
|
+
}
|
|
3781
|
+
case "PageDown": {
|
|
3782
|
+
e.preventDefault();
|
|
3783
|
+
const target = e.shiftKey ? addYearsClamped(rovingTarget, 1) : addMonthsClamped(rovingTarget, 1);
|
|
3784
|
+
moveFocusTo(isDayDisabled(target) ? step(target, 1) : target, true);
|
|
3785
|
+
break;
|
|
3786
|
+
}
|
|
3787
|
+
case "Enter":
|
|
3788
|
+
case " ":
|
|
3789
|
+
e.preventDefault();
|
|
3790
|
+
selectDay(rovingTarget);
|
|
3791
|
+
break;
|
|
3232
3792
|
}
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
e.preventDefault();
|
|
3236
|
-
selectDay(rovingTarget);
|
|
3237
|
-
break;
|
|
3238
|
-
}
|
|
3239
|
-
};
|
|
3240
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn(className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: gridRef, role: "grid", "aria-label": monthLabelFormat.format(viewMonth), onKeyDown: onGridKeyDown, children: [
|
|
3241
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { role: "row", className: "grid grid-cols-7", children: weekdayLabels.map((w) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3793
|
+
};
|
|
3794
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn(className), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3242
3795
|
"div",
|
|
3243
3796
|
{
|
|
3244
|
-
|
|
3245
|
-
"
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3797
|
+
ref: gridRef,
|
|
3798
|
+
role: "grid",
|
|
3799
|
+
"aria-label": monthLabelFormat.format(viewMonth),
|
|
3800
|
+
onKeyDown: onGridKeyDown,
|
|
3801
|
+
children: [
|
|
3802
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { role: "row", className: "grid grid-cols-7", children: weekdayLabels.map((w) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3803
|
+
"div",
|
|
3804
|
+
{
|
|
3805
|
+
role: "columnheader",
|
|
3806
|
+
"aria-label": w.long,
|
|
3807
|
+
className: "h-8 flex items-center justify-center text-xs font-medium text-muted-foreground",
|
|
3808
|
+
children: w.short
|
|
3809
|
+
},
|
|
3810
|
+
w.key
|
|
3811
|
+
)) }),
|
|
3812
|
+
Array.from({ length: 6 }, (_, week) => /* @__PURE__ */ jsxRuntime.jsx("div", { role: "row", className: "grid grid-cols-7", children: gridDays.slice(week * 7, week * 7 + 7).map((day) => {
|
|
3813
|
+
if (!inViewMonth(day)) {
|
|
3814
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "gridcell", "aria-hidden": "true", className: "h-9" }, dateKey(day));
|
|
3815
|
+
}
|
|
3816
|
+
const disabled = isDayDisabled(day);
|
|
3817
|
+
const state = cellState(day);
|
|
3818
|
+
const isRoving = isSameDay(day, rovingTarget);
|
|
3819
|
+
const isEndpoint = !!(state.selected || state.rangeStart || state.rangeEnd);
|
|
3820
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3821
|
+
"button",
|
|
3822
|
+
{
|
|
3823
|
+
type: "button",
|
|
3824
|
+
role: "gridcell",
|
|
3825
|
+
"data-date": dateKey(day),
|
|
3826
|
+
tabIndex: isRoving ? 0 : -1,
|
|
3827
|
+
"aria-selected": isEndpoint,
|
|
3828
|
+
"aria-disabled": disabled || void 0,
|
|
3829
|
+
"aria-label": fullDateFormat.format(day),
|
|
3830
|
+
onMouseEnter: () => onFocusDay?.(day),
|
|
3831
|
+
onClick: () => selectDay(day),
|
|
3832
|
+
className: cn(
|
|
3833
|
+
"h-9 w-9 mx-auto flex items-center justify-center text-sm",
|
|
3834
|
+
state.inRange && !isEndpoint ? "rounded-none" : "rounded-full",
|
|
3835
|
+
"focus:outline-none focus:ring-[3px] focus:ring-ring/30",
|
|
3836
|
+
disabled && "text-muted-foreground opacity-40 cursor-not-allowed",
|
|
3837
|
+
!disabled && isEndpoint && "bg-primary text-primary-foreground",
|
|
3838
|
+
!disabled && state.inRange && !isEndpoint && "bg-primary/15 text-foreground",
|
|
3839
|
+
!disabled && !isEndpoint && !state.inRange && state.today && "ring-1 ring-primary text-primary font-medium",
|
|
3840
|
+
!disabled && !isEndpoint && !state.inRange && !state.today && "text-foreground hover:bg-muted"
|
|
3841
|
+
),
|
|
3842
|
+
children: day.getDate()
|
|
3843
|
+
},
|
|
3844
|
+
dateKey(day)
|
|
3845
|
+
);
|
|
3846
|
+
}) }, week))
|
|
3847
|
+
]
|
|
3254
3848
|
}
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3849
|
+
) });
|
|
3850
|
+
}
|
|
3851
|
+
);
|
|
3852
|
+
CalendarGrid.displayName = "CalendarGrid";
|
|
3853
|
+
var Calendar = React52__namespace.forwardRef(function Calendar2({
|
|
3854
|
+
value,
|
|
3855
|
+
defaultValue,
|
|
3856
|
+
onChange,
|
|
3857
|
+
month,
|
|
3858
|
+
defaultMonth,
|
|
3859
|
+
onMonthChange,
|
|
3860
|
+
min,
|
|
3861
|
+
max,
|
|
3862
|
+
disabledDates,
|
|
3863
|
+
className
|
|
3864
|
+
}, ref) {
|
|
3865
|
+
const controlled = value !== void 0;
|
|
3866
|
+
const [internalValue, setInternalValue] = React52__namespace.useState(defaultValue);
|
|
3867
|
+
const selected = controlled ? value : internalValue;
|
|
3868
|
+
const monthControlled = month !== void 0;
|
|
3869
|
+
const [internalMonth, setInternalMonth] = React52__namespace.useState(
|
|
3870
|
+
() => startOfMonth(month ?? defaultMonth ?? selected ?? /* @__PURE__ */ new Date())
|
|
3871
|
+
);
|
|
3872
|
+
const viewMonth = monthControlled ? startOfMonth(month) : internalMonth;
|
|
3873
|
+
const setViewMonth = (next) => {
|
|
3874
|
+
const normalized = startOfMonth(next);
|
|
3875
|
+
if (!monthControlled) setInternalMonth(normalized);
|
|
3876
|
+
onMonthChange?.(normalized);
|
|
3877
|
+
};
|
|
3878
|
+
const isDayDisabled = React52__namespace.useCallback(
|
|
3879
|
+
(d) => {
|
|
3880
|
+
if (min && d < startOfDay(min)) return true;
|
|
3881
|
+
if (max && d > startOfDay(max)) return true;
|
|
3882
|
+
return disabledDates?.(d) ?? false;
|
|
3883
|
+
},
|
|
3884
|
+
[min, max, disabledDates]
|
|
3885
|
+
);
|
|
3886
|
+
const commitValue = (d) => {
|
|
3887
|
+
if (!controlled) setInternalValue(d);
|
|
3888
|
+
onChange?.(d);
|
|
3889
|
+
};
|
|
3890
|
+
const today = /* @__PURE__ */ new Date();
|
|
3891
|
+
const cellState = (d) => ({
|
|
3892
|
+
selected: selected ? isSameDay(d, selected) : false,
|
|
3893
|
+
today: isSameDay(d, today)
|
|
3894
|
+
});
|
|
3895
|
+
const inViewMonth = (d) => d.getMonth() === viewMonth.getMonth() && d.getFullYear() === viewMonth.getFullYear();
|
|
3896
|
+
const handleFocusDay = (d) => {
|
|
3897
|
+
if (!inViewMonth(d)) setViewMonth(d);
|
|
3898
|
+
};
|
|
3899
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("w-[280px] select-none", className), children: [
|
|
3900
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
3901
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3260
3902
|
"button",
|
|
3261
3903
|
{
|
|
3262
3904
|
type: "button",
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
},
|
|
3283
|
-
dateKey(day)
|
|
3284
|
-
);
|
|
3285
|
-
}) }, week))
|
|
3286
|
-
] }) });
|
|
3287
|
-
});
|
|
3288
|
-
CalendarGrid.displayName = "CalendarGrid";
|
|
3289
|
-
var Calendar = React52__namespace.forwardRef(
|
|
3290
|
-
function Calendar2({ value, defaultValue, onChange, month, defaultMonth, onMonthChange, min, max, disabledDates, className }, ref) {
|
|
3291
|
-
const controlled = value !== void 0;
|
|
3292
|
-
const [internalValue, setInternalValue] = React52__namespace.useState(defaultValue);
|
|
3293
|
-
const selected = controlled ? value : internalValue;
|
|
3294
|
-
const monthControlled = month !== void 0;
|
|
3295
|
-
const [internalMonth, setInternalMonth] = React52__namespace.useState(
|
|
3296
|
-
() => startOfMonth(month ?? defaultMonth ?? selected ?? /* @__PURE__ */ new Date())
|
|
3297
|
-
);
|
|
3298
|
-
const viewMonth = monthControlled ? startOfMonth(month) : internalMonth;
|
|
3299
|
-
const setViewMonth = (next) => {
|
|
3300
|
-
const normalized = startOfMonth(next);
|
|
3301
|
-
if (!monthControlled) setInternalMonth(normalized);
|
|
3302
|
-
onMonthChange?.(normalized);
|
|
3303
|
-
};
|
|
3304
|
-
const isDayDisabled = React52__namespace.useCallback(
|
|
3305
|
-
(d) => {
|
|
3306
|
-
if (min && d < startOfDay(min)) return true;
|
|
3307
|
-
if (max && d > startOfDay(max)) return true;
|
|
3308
|
-
return disabledDates?.(d) ?? false;
|
|
3309
|
-
},
|
|
3310
|
-
[min, max, disabledDates]
|
|
3311
|
-
);
|
|
3312
|
-
const commitValue = (d) => {
|
|
3313
|
-
if (!controlled) setInternalValue(d);
|
|
3314
|
-
onChange?.(d);
|
|
3315
|
-
};
|
|
3316
|
-
const today = /* @__PURE__ */ new Date();
|
|
3317
|
-
const cellState = (d) => ({
|
|
3318
|
-
selected: selected ? isSameDay(d, selected) : false,
|
|
3319
|
-
today: isSameDay(d, today)
|
|
3320
|
-
});
|
|
3321
|
-
const inViewMonth = (d) => d.getMonth() === viewMonth.getMonth() && d.getFullYear() === viewMonth.getFullYear();
|
|
3322
|
-
const handleFocusDay = (d) => {
|
|
3323
|
-
if (!inViewMonth(d)) setViewMonth(d);
|
|
3324
|
-
};
|
|
3325
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("w-[280px] select-none", className), children: [
|
|
3326
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
3327
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3328
|
-
"button",
|
|
3329
|
-
{
|
|
3330
|
-
type: "button",
|
|
3331
|
-
"aria-label": "Previous month",
|
|
3332
|
-
onClick: () => setViewMonth(addMonths(viewMonth, -1)),
|
|
3333
|
-
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3334
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 18-6-6 6-6" }) })
|
|
3335
|
-
}
|
|
3336
|
-
),
|
|
3337
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(viewMonth) }),
|
|
3338
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3339
|
-
"button",
|
|
3340
|
-
{
|
|
3341
|
-
type: "button",
|
|
3342
|
-
"aria-label": "Next month",
|
|
3343
|
-
onClick: () => setViewMonth(addMonths(viewMonth, 1)),
|
|
3344
|
-
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3345
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" }) })
|
|
3346
|
-
}
|
|
3347
|
-
)
|
|
3348
|
-
] }),
|
|
3905
|
+
"aria-label": "Previous month",
|
|
3906
|
+
onClick: () => setViewMonth(addMonths(viewMonth, -1)),
|
|
3907
|
+
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3908
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3909
|
+
"svg",
|
|
3910
|
+
{
|
|
3911
|
+
viewBox: "0 0 24 24",
|
|
3912
|
+
className: "h-4 w-4",
|
|
3913
|
+
fill: "none",
|
|
3914
|
+
stroke: "currentColor",
|
|
3915
|
+
strokeWidth: "2.5",
|
|
3916
|
+
strokeLinecap: "round",
|
|
3917
|
+
strokeLinejoin: "round",
|
|
3918
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 18-6-6 6-6" })
|
|
3919
|
+
}
|
|
3920
|
+
)
|
|
3921
|
+
}
|
|
3922
|
+
),
|
|
3923
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(viewMonth) }),
|
|
3349
3924
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3350
|
-
|
|
3925
|
+
"button",
|
|
3351
3926
|
{
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3927
|
+
type: "button",
|
|
3928
|
+
"aria-label": "Next month",
|
|
3929
|
+
onClick: () => setViewMonth(addMonths(viewMonth, 1)),
|
|
3930
|
+
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3931
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3932
|
+
"svg",
|
|
3933
|
+
{
|
|
3934
|
+
viewBox: "0 0 24 24",
|
|
3935
|
+
className: "h-4 w-4",
|
|
3936
|
+
fill: "none",
|
|
3937
|
+
stroke: "currentColor",
|
|
3938
|
+
strokeWidth: "2.5",
|
|
3939
|
+
strokeLinecap: "round",
|
|
3940
|
+
strokeLinejoin: "round",
|
|
3941
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" })
|
|
3942
|
+
}
|
|
3943
|
+
)
|
|
3358
3944
|
}
|
|
3359
3945
|
)
|
|
3360
|
-
] })
|
|
3361
|
-
|
|
3362
|
-
|
|
3946
|
+
] }),
|
|
3947
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3948
|
+
CalendarGrid,
|
|
3949
|
+
{
|
|
3950
|
+
viewMonth,
|
|
3951
|
+
isDayDisabled,
|
|
3952
|
+
cellState,
|
|
3953
|
+
onSelectDay: commitValue,
|
|
3954
|
+
onFocusDay: handleFocusDay,
|
|
3955
|
+
initialFocusDate: selected ?? /* @__PURE__ */ new Date()
|
|
3956
|
+
}
|
|
3957
|
+
)
|
|
3958
|
+
] });
|
|
3959
|
+
});
|
|
3363
3960
|
Calendar.displayName = "Calendar";
|
|
3364
3961
|
var displayFormat = new Intl.DateTimeFormat(void 0, { dateStyle: "medium" });
|
|
3365
|
-
var DatePicker = React52__namespace.forwardRef(
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3962
|
+
var DatePicker = React52__namespace.forwardRef(function DatePicker2({
|
|
3963
|
+
value,
|
|
3964
|
+
defaultValue,
|
|
3965
|
+
onChange,
|
|
3966
|
+
min,
|
|
3967
|
+
max,
|
|
3968
|
+
disabledDates,
|
|
3969
|
+
placeholder = "Pick a date\u2026",
|
|
3970
|
+
disabled = false,
|
|
3971
|
+
error = false,
|
|
3972
|
+
required = false,
|
|
3973
|
+
className,
|
|
3974
|
+
id,
|
|
3975
|
+
name,
|
|
3976
|
+
"aria-describedby": describedBy
|
|
3977
|
+
}, ref) {
|
|
3978
|
+
const controlled = value !== void 0;
|
|
3979
|
+
const [internalValue, setInternalValue] = React52__namespace.useState(defaultValue);
|
|
3980
|
+
const selected = controlled ? value : internalValue;
|
|
3981
|
+
const [open, setOpen] = React52__namespace.useState(false);
|
|
3982
|
+
const containerRef = React52__namespace.useRef(null);
|
|
3983
|
+
const triggerRef = React52__namespace.useRef(null);
|
|
3984
|
+
const setTriggerRef = (node) => {
|
|
3985
|
+
triggerRef.current = node;
|
|
3986
|
+
if (typeof ref === "function") ref(node);
|
|
3987
|
+
else if (ref) ref.current = node;
|
|
3988
|
+
};
|
|
3989
|
+
const commitValue = (d) => {
|
|
3990
|
+
if (!controlled) setInternalValue(d);
|
|
3991
|
+
onChange?.(d);
|
|
3992
|
+
};
|
|
3993
|
+
const closePopup = React52__namespace.useCallback(() => setOpen(false), []);
|
|
3994
|
+
const openPopup = () => {
|
|
3995
|
+
if (!disabled) setOpen(true);
|
|
3996
|
+
};
|
|
3997
|
+
const handleCalendarChange = (d) => {
|
|
3998
|
+
commitValue(d);
|
|
3999
|
+
closePopup();
|
|
4000
|
+
triggerRef.current?.focus();
|
|
4001
|
+
};
|
|
4002
|
+
React52__namespace.useEffect(() => {
|
|
4003
|
+
if (!open) return;
|
|
4004
|
+
const onDown = (e) => {
|
|
4005
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) closePopup();
|
|
3400
4006
|
};
|
|
3401
|
-
|
|
3402
|
-
|
|
4007
|
+
document.addEventListener("mousedown", onDown);
|
|
4008
|
+
return () => document.removeEventListener("mousedown", onDown);
|
|
4009
|
+
}, [open, closePopup]);
|
|
4010
|
+
const onTriggerKeyDown = (e) => {
|
|
4011
|
+
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
4012
|
+
e.preventDefault();
|
|
4013
|
+
openPopup();
|
|
4014
|
+
} else if (e.key === "Escape" && open) {
|
|
4015
|
+
e.preventDefault();
|
|
4016
|
+
closePopup();
|
|
4017
|
+
}
|
|
4018
|
+
};
|
|
4019
|
+
const onPanelKeyDown = (e) => {
|
|
4020
|
+
if (e.key === "Escape") {
|
|
4021
|
+
e.preventDefault();
|
|
3403
4022
|
closePopup();
|
|
3404
4023
|
triggerRef.current?.focus();
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
closePopup()
|
|
4024
|
+
}
|
|
4025
|
+
};
|
|
4026
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: cn("relative inline-block w-full", className), children: [
|
|
4027
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4028
|
+
"button",
|
|
4029
|
+
{
|
|
4030
|
+
ref: setTriggerRef,
|
|
4031
|
+
type: "button",
|
|
4032
|
+
id,
|
|
4033
|
+
disabled,
|
|
4034
|
+
"aria-haspopup": "grid",
|
|
4035
|
+
"aria-expanded": open,
|
|
4036
|
+
"aria-invalid": error || void 0,
|
|
4037
|
+
"aria-required": required || void 0,
|
|
4038
|
+
"aria-describedby": describedBy,
|
|
4039
|
+
onClick: () => open ? closePopup() : openPopup(),
|
|
4040
|
+
onKeyDown: onTriggerKeyDown,
|
|
4041
|
+
className: cn(
|
|
4042
|
+
"w-full flex items-center justify-between gap-2 border rounded-kj-md bg-surface text-left text-sm",
|
|
4043
|
+
"pl-[0.85rem] pr-3 py-[calc(0.6rem*var(--kj-density,1))]",
|
|
4044
|
+
"transition-[border-color,box-shadow] duration-150",
|
|
4045
|
+
"focus:outline-none focus:border-ring focus:ring-[3px] focus:ring-ring/30",
|
|
4046
|
+
disabled && "bg-muted text-muted-foreground cursor-not-allowed",
|
|
4047
|
+
error ? "border-danger" : "border-input",
|
|
4048
|
+
!selected && "text-muted-foreground"
|
|
4049
|
+
),
|
|
4050
|
+
children: [
|
|
4051
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: selected ? displayFormat.format(selected) : placeholder }),
|
|
4052
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4053
|
+
"svg",
|
|
4054
|
+
{
|
|
4055
|
+
viewBox: "0 0 24 24",
|
|
4056
|
+
className: "h-4 w-4 text-muted-foreground shrink-0",
|
|
4057
|
+
fill: "none",
|
|
4058
|
+
stroke: "currentColor",
|
|
4059
|
+
strokeWidth: "2",
|
|
4060
|
+
strokeLinecap: "round",
|
|
4061
|
+
strokeLinejoin: "round",
|
|
4062
|
+
children: [
|
|
4063
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
4064
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 10h18M8 2v4M16 2v4" })
|
|
4065
|
+
]
|
|
4066
|
+
}
|
|
4067
|
+
)
|
|
4068
|
+
]
|
|
3421
4069
|
}
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
4070
|
+
),
|
|
4071
|
+
name && /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: selected ? toISODateString(selected) : "" }),
|
|
4072
|
+
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4073
|
+
"div",
|
|
4074
|
+
{
|
|
4075
|
+
onKeyDown: onPanelKeyDown,
|
|
4076
|
+
className: "absolute z-40 top-[calc(100%+6px)] left-0 bg-surface border border-border rounded-kj-md shadow-kj-lg p-3 animate-[kjpop_.12s_ease]",
|
|
4077
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4078
|
+
Calendar,
|
|
4079
|
+
{
|
|
4080
|
+
value: selected,
|
|
4081
|
+
onChange: handleCalendarChange,
|
|
4082
|
+
min,
|
|
4083
|
+
max,
|
|
4084
|
+
disabledDates
|
|
4085
|
+
}
|
|
4086
|
+
)
|
|
3428
4087
|
}
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
"button",
|
|
3433
|
-
{
|
|
3434
|
-
ref: setTriggerRef,
|
|
3435
|
-
type: "button",
|
|
3436
|
-
id,
|
|
3437
|
-
disabled,
|
|
3438
|
-
"aria-haspopup": "grid",
|
|
3439
|
-
"aria-expanded": open,
|
|
3440
|
-
"aria-invalid": error || void 0,
|
|
3441
|
-
"aria-required": required || void 0,
|
|
3442
|
-
"aria-describedby": describedBy,
|
|
3443
|
-
onClick: () => open ? closePopup() : openPopup(),
|
|
3444
|
-
onKeyDown: onTriggerKeyDown,
|
|
3445
|
-
className: cn(
|
|
3446
|
-
"w-full flex items-center justify-between gap-2 border rounded-kj-md bg-surface text-left text-sm",
|
|
3447
|
-
"pl-[0.85rem] pr-3 py-[calc(0.6rem*var(--kj-density,1))]",
|
|
3448
|
-
"transition-[border-color,box-shadow] duration-150",
|
|
3449
|
-
"focus:outline-none focus:border-ring focus:ring-[3px] focus:ring-ring/30",
|
|
3450
|
-
disabled && "bg-muted text-muted-foreground cursor-not-allowed",
|
|
3451
|
-
error ? "border-danger" : "border-input",
|
|
3452
|
-
!selected && "text-muted-foreground"
|
|
3453
|
-
),
|
|
3454
|
-
children: [
|
|
3455
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: selected ? displayFormat.format(selected) : placeholder }),
|
|
3456
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3457
|
-
"svg",
|
|
3458
|
-
{
|
|
3459
|
-
viewBox: "0 0 24 24",
|
|
3460
|
-
className: "h-4 w-4 text-muted-foreground shrink-0",
|
|
3461
|
-
fill: "none",
|
|
3462
|
-
stroke: "currentColor",
|
|
3463
|
-
strokeWidth: "2",
|
|
3464
|
-
strokeLinecap: "round",
|
|
3465
|
-
strokeLinejoin: "round",
|
|
3466
|
-
children: [
|
|
3467
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
3468
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 10h18M8 2v4M16 2v4" })
|
|
3469
|
-
]
|
|
3470
|
-
}
|
|
3471
|
-
)
|
|
3472
|
-
]
|
|
3473
|
-
}
|
|
3474
|
-
),
|
|
3475
|
-
name && /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: selected ? toISODateString(selected) : "" }),
|
|
3476
|
-
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3477
|
-
"div",
|
|
3478
|
-
{
|
|
3479
|
-
onKeyDown: onPanelKeyDown,
|
|
3480
|
-
className: "absolute z-40 top-[calc(100%+6px)] left-0 bg-surface border border-border rounded-kj-md shadow-kj-lg p-3 animate-[kjpop_.12s_ease]",
|
|
3481
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Calendar, { value: selected, onChange: handleCalendarChange, min, max, disabledDates })
|
|
3482
|
-
}
|
|
3483
|
-
)
|
|
3484
|
-
] });
|
|
3485
|
-
}
|
|
3486
|
-
);
|
|
4088
|
+
)
|
|
4089
|
+
] });
|
|
4090
|
+
});
|
|
3487
4091
|
DatePicker.displayName = "DatePicker";
|
|
3488
4092
|
var DatePickerField = React52__namespace.forwardRef(
|
|
3489
4093
|
function DatePickerField2({ label, hint, error, required, className, ...props }, ref) {
|
|
@@ -3496,7 +4100,19 @@ function isBetweenExclusive(d, lo, hi) {
|
|
|
3496
4100
|
return t > startOfDay(lo).getTime() && t < startOfDay(hi).getTime();
|
|
3497
4101
|
}
|
|
3498
4102
|
var RangeCalendar = React52__namespace.forwardRef(
|
|
3499
|
-
function RangeCalendar2({
|
|
4103
|
+
function RangeCalendar2({
|
|
4104
|
+
value,
|
|
4105
|
+
defaultValue,
|
|
4106
|
+
onChange,
|
|
4107
|
+
month,
|
|
4108
|
+
defaultMonth,
|
|
4109
|
+
onMonthChange,
|
|
4110
|
+
min,
|
|
4111
|
+
max,
|
|
4112
|
+
disabledDates,
|
|
4113
|
+
singleMonth,
|
|
4114
|
+
className
|
|
4115
|
+
}, ref) {
|
|
3500
4116
|
const controlled = value !== void 0;
|
|
3501
4117
|
const [internalValue, setInternalValue] = React52__namespace.useState(defaultValue ?? {});
|
|
3502
4118
|
const range2 = controlled ? value : internalValue;
|
|
@@ -3581,47 +4197,70 @@ var RangeCalendar = React52__namespace.forwardRef(
|
|
|
3581
4197
|
"aria-label": direction === "prev" ? "Previous month" : "Next month",
|
|
3582
4198
|
onClick: () => setViewMonth(addMonths(leftMonth, direction === "prev" ? -1 : 1)),
|
|
3583
4199
|
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3584
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3585
|
-
|
|
3586
|
-
);
|
|
3587
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("flex gap-6 select-none", className), children: [
|
|
3588
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-[280px]", children: [
|
|
3589
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
3590
|
-
navButton("prev"),
|
|
3591
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(leftMonth) }),
|
|
3592
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-[26px]", "aria-hidden": "true" })
|
|
3593
|
-
] }),
|
|
3594
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3595
|
-
CalendarGrid,
|
|
3596
|
-
{
|
|
3597
|
-
viewMonth: leftMonth,
|
|
3598
|
-
isDayDisabled,
|
|
3599
|
-
cellState,
|
|
3600
|
-
onSelectDay: handleSelectDay,
|
|
3601
|
-
onFocusDay: handleFocusDay,
|
|
3602
|
-
initialFocusDate: pendingStart ?? range2.start ?? /* @__PURE__ */ new Date()
|
|
3603
|
-
}
|
|
3604
|
-
)
|
|
3605
|
-
] }),
|
|
3606
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-[280px]", children: [
|
|
3607
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
3608
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-[26px]", "aria-hidden": "true" }),
|
|
3609
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(rightMonth) }),
|
|
3610
|
-
navButton("next")
|
|
3611
|
-
] }),
|
|
3612
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3613
|
-
CalendarGrid,
|
|
4200
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4201
|
+
"svg",
|
|
3614
4202
|
{
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
4203
|
+
viewBox: "0 0 24 24",
|
|
4204
|
+
className: "h-4 w-4",
|
|
4205
|
+
fill: "none",
|
|
4206
|
+
stroke: "currentColor",
|
|
4207
|
+
strokeWidth: "2.5",
|
|
4208
|
+
strokeLinecap: "round",
|
|
4209
|
+
strokeLinejoin: "round",
|
|
4210
|
+
children: direction === "prev" ? /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 18-6-6 6-6" }) : /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" })
|
|
3621
4211
|
}
|
|
3622
4212
|
)
|
|
3623
|
-
|
|
3624
|
-
|
|
4213
|
+
}
|
|
4214
|
+
);
|
|
4215
|
+
const showSingleMonth = singleMonth;
|
|
4216
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4217
|
+
"div",
|
|
4218
|
+
{
|
|
4219
|
+
ref,
|
|
4220
|
+
className: cn(
|
|
4221
|
+
"flex flex-col sm:flex-row gap-4 sm:gap-6 select-none max-w-full overflow-hidden",
|
|
4222
|
+
className
|
|
4223
|
+
),
|
|
4224
|
+
children: [
|
|
4225
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full sm:w-[280px]", children: [
|
|
4226
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
4227
|
+
navButton("prev"),
|
|
4228
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(leftMonth) }),
|
|
4229
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: showSingleMonth ? "" : "sm:hidden", children: navButton("next") })
|
|
4230
|
+
] }),
|
|
4231
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4232
|
+
CalendarGrid,
|
|
4233
|
+
{
|
|
4234
|
+
viewMonth: leftMonth,
|
|
4235
|
+
isDayDisabled,
|
|
4236
|
+
cellState,
|
|
4237
|
+
onSelectDay: handleSelectDay,
|
|
4238
|
+
onFocusDay: handleFocusDay,
|
|
4239
|
+
initialFocusDate: pendingStart ?? range2.start ?? /* @__PURE__ */ new Date()
|
|
4240
|
+
}
|
|
4241
|
+
)
|
|
4242
|
+
] }),
|
|
4243
|
+
!showSingleMonth && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden sm:block w-[280px]", children: [
|
|
4244
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
4245
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-[26px]", "aria-hidden": "true" }),
|
|
4246
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(rightMonth) }),
|
|
4247
|
+
navButton("next")
|
|
4248
|
+
] }),
|
|
4249
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4250
|
+
CalendarGrid,
|
|
4251
|
+
{
|
|
4252
|
+
viewMonth: rightMonth,
|
|
4253
|
+
isDayDisabled,
|
|
4254
|
+
cellState,
|
|
4255
|
+
onSelectDay: handleSelectDay,
|
|
4256
|
+
onFocusDay: handleFocusDay,
|
|
4257
|
+
initialFocusDate: pendingStart ?? range2.start ?? /* @__PURE__ */ new Date()
|
|
4258
|
+
}
|
|
4259
|
+
)
|
|
4260
|
+
] })
|
|
4261
|
+
]
|
|
4262
|
+
}
|
|
4263
|
+
);
|
|
3625
4264
|
}
|
|
3626
4265
|
);
|
|
3627
4266
|
RangeCalendar.displayName = "RangeCalendar";
|
|
@@ -3743,15 +4382,38 @@ var DateRangePicker = React52__namespace.forwardRef(
|
|
|
3743
4382
|
}
|
|
3744
4383
|
),
|
|
3745
4384
|
name && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3746
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3747
|
-
|
|
4385
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4386
|
+
"input",
|
|
4387
|
+
{
|
|
4388
|
+
type: "hidden",
|
|
4389
|
+
name: `${name}Start`,
|
|
4390
|
+
value: selected.start ? toISODateString(selected.start) : ""
|
|
4391
|
+
}
|
|
4392
|
+
),
|
|
4393
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4394
|
+
"input",
|
|
4395
|
+
{
|
|
4396
|
+
type: "hidden",
|
|
4397
|
+
name: `${name}End`,
|
|
4398
|
+
value: selected.end ? toISODateString(selected.end) : ""
|
|
4399
|
+
}
|
|
4400
|
+
)
|
|
3748
4401
|
] }),
|
|
3749
4402
|
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3750
4403
|
"div",
|
|
3751
4404
|
{
|
|
3752
4405
|
onKeyDown: onPanelKeyDown,
|
|
3753
|
-
className: "absolute z-40 top-[calc(100%+6px)] left-0 bg-surface border border-border rounded-kj-md shadow-kj-lg p-3 animate-[kjpop_.12s_ease]",
|
|
3754
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4406
|
+
className: "absolute z-40 top-[calc(100%+6px)] left-0 sm:left-auto right-0 sm:right-auto max-w-[calc(100vw-2rem)] bg-surface border border-border rounded-kj-md shadow-kj-lg p-3 animate-[kjpop_.12s_ease]",
|
|
4407
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4408
|
+
RangeCalendar,
|
|
4409
|
+
{
|
|
4410
|
+
value: selected,
|
|
4411
|
+
onChange: handleRangeChange,
|
|
4412
|
+
min,
|
|
4413
|
+
max,
|
|
4414
|
+
disabledDates
|
|
4415
|
+
}
|
|
4416
|
+
)
|
|
3755
4417
|
}
|
|
3756
4418
|
)
|
|
3757
4419
|
] });
|
|
@@ -3764,108 +4426,118 @@ var DateRangePickerField = React52__namespace.forwardRef(
|
|
|
3764
4426
|
}
|
|
3765
4427
|
);
|
|
3766
4428
|
DateRangePickerField.displayName = "DateRangePickerField";
|
|
3767
|
-
var Dropzone = React52__namespace.forwardRef(
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
const
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
if (dragCounter.current <= 0) {
|
|
3806
|
-
dragCounter.current = 0;
|
|
3807
|
-
setDragActive(false);
|
|
3808
|
-
}
|
|
3809
|
-
};
|
|
3810
|
-
const handleDrop = (e) => {
|
|
3811
|
-
e.preventDefault();
|
|
4429
|
+
var Dropzone = React52__namespace.forwardRef(function Dropzone2({
|
|
4430
|
+
onFiles,
|
|
4431
|
+
accept,
|
|
4432
|
+
multiple = true,
|
|
4433
|
+
disabled = false,
|
|
4434
|
+
className,
|
|
4435
|
+
children,
|
|
4436
|
+
id,
|
|
4437
|
+
"aria-describedby": describedBy,
|
|
4438
|
+
"aria-invalid": ariaInvalid,
|
|
4439
|
+
"aria-required": ariaRequired
|
|
4440
|
+
}, ref) {
|
|
4441
|
+
const inputRef = React52__namespace.useRef(null);
|
|
4442
|
+
const [dragActive, setDragActive] = React52__namespace.useState(false);
|
|
4443
|
+
const dragCounter = React52__namespace.useRef(0);
|
|
4444
|
+
const invalid = ariaInvalid === true || ariaInvalid === "true";
|
|
4445
|
+
const openPicker = () => {
|
|
4446
|
+
if (!disabled) inputRef.current?.click();
|
|
4447
|
+
};
|
|
4448
|
+
const handleInputChange = (e) => {
|
|
4449
|
+
const files = e.target.files ? Array.from(e.target.files) : [];
|
|
4450
|
+
if (files.length > 0) onFiles(files);
|
|
4451
|
+
e.target.value = "";
|
|
4452
|
+
};
|
|
4453
|
+
const handleDragEnter = (e) => {
|
|
4454
|
+
e.preventDefault();
|
|
4455
|
+
if (disabled) return;
|
|
4456
|
+
dragCounter.current += 1;
|
|
4457
|
+
setDragActive(true);
|
|
4458
|
+
};
|
|
4459
|
+
const handleDragOver = (e) => {
|
|
4460
|
+
e.preventDefault();
|
|
4461
|
+
};
|
|
4462
|
+
const handleDragLeave = (e) => {
|
|
4463
|
+
e.preventDefault();
|
|
4464
|
+
if (disabled) return;
|
|
4465
|
+
dragCounter.current -= 1;
|
|
4466
|
+
if (dragCounter.current <= 0) {
|
|
3812
4467
|
dragCounter.current = 0;
|
|
3813
4468
|
setDragActive(false);
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
4469
|
+
}
|
|
4470
|
+
};
|
|
4471
|
+
const handleDrop = (e) => {
|
|
4472
|
+
e.preventDefault();
|
|
4473
|
+
dragCounter.current = 0;
|
|
4474
|
+
setDragActive(false);
|
|
4475
|
+
if (disabled) return;
|
|
4476
|
+
const files = e.dataTransfer?.files ? Array.from(e.dataTransfer.files) : [];
|
|
4477
|
+
if (files.length > 0) onFiles(files);
|
|
4478
|
+
};
|
|
4479
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), children: [
|
|
4480
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4481
|
+
"button",
|
|
4482
|
+
{
|
|
4483
|
+
ref,
|
|
4484
|
+
type: "button",
|
|
4485
|
+
id,
|
|
4486
|
+
disabled,
|
|
4487
|
+
"aria-describedby": describedBy,
|
|
4488
|
+
"aria-invalid": ariaInvalid,
|
|
4489
|
+
"aria-required": ariaRequired,
|
|
4490
|
+
"data-drag-active": dragActive || void 0,
|
|
4491
|
+
onClick: openPicker,
|
|
4492
|
+
onDragEnter: handleDragEnter,
|
|
4493
|
+
onDragOver: handleDragOver,
|
|
4494
|
+
onDragLeave: handleDragLeave,
|
|
4495
|
+
onDrop: handleDrop,
|
|
4496
|
+
className: cn(
|
|
4497
|
+
"w-full flex flex-col items-center justify-center gap-2 rounded-kj-md border-2 border-dashed px-6 py-8 text-center text-sm transition-colors",
|
|
4498
|
+
"focus:outline-none focus:ring-[3px] focus:ring-ring/30",
|
|
4499
|
+
disabled ? "border-input bg-muted text-muted-foreground cursor-not-allowed" : dragActive ? "border-primary bg-primary/5 text-foreground cursor-pointer" : invalid ? "border-danger bg-surface text-muted-foreground hover:text-foreground cursor-pointer" : "border-input bg-surface text-muted-foreground hover:border-primary hover:text-foreground cursor-pointer"
|
|
4500
|
+
),
|
|
4501
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4502
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4503
|
+
"svg",
|
|
4504
|
+
{
|
|
4505
|
+
viewBox: "0 0 24 24",
|
|
4506
|
+
className: "h-7 w-7",
|
|
4507
|
+
fill: "none",
|
|
4508
|
+
stroke: "currentColor",
|
|
4509
|
+
strokeWidth: "1.5",
|
|
4510
|
+
strokeLinecap: "round",
|
|
4511
|
+
strokeLinejoin: "round",
|
|
4512
|
+
children: [
|
|
4513
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 16V4M7 9l5-5 5 5" }),
|
|
4514
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 16v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-3" })
|
|
4515
|
+
]
|
|
4516
|
+
}
|
|
3839
4517
|
),
|
|
3840
|
-
|
|
3841
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3842
|
-
|
|
3843
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 16v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-3" })
|
|
3844
|
-
] }),
|
|
3845
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
3846
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: "Drag and drop files here" }),
|
|
3847
|
-
", or click to browse"
|
|
3848
|
-
] })
|
|
4518
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
4519
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: "Drag and drop files here" }),
|
|
4520
|
+
", or click to browse"
|
|
3849
4521
|
] })
|
|
3850
|
-
}
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
}
|
|
3868
|
-
);
|
|
4522
|
+
] })
|
|
4523
|
+
}
|
|
4524
|
+
),
|
|
4525
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4526
|
+
"input",
|
|
4527
|
+
{
|
|
4528
|
+
ref: inputRef,
|
|
4529
|
+
type: "file",
|
|
4530
|
+
accept,
|
|
4531
|
+
multiple,
|
|
4532
|
+
disabled,
|
|
4533
|
+
onChange: handleInputChange,
|
|
4534
|
+
className: "sr-only",
|
|
4535
|
+
tabIndex: -1,
|
|
4536
|
+
"aria-hidden": "true"
|
|
4537
|
+
}
|
|
4538
|
+
)
|
|
4539
|
+
] });
|
|
4540
|
+
});
|
|
3869
4541
|
Dropzone.displayName = "Dropzone";
|
|
3870
4542
|
|
|
3871
4543
|
// src/components/file-upload-internals.ts
|
|
@@ -3930,108 +4602,130 @@ function validateFiles(files, { accept, maxSize, maxFiles, existingCount = 0, mu
|
|
|
3930
4602
|
return { accepted, rejected };
|
|
3931
4603
|
}
|
|
3932
4604
|
function FileIcon({ className }) {
|
|
3933
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
4605
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4606
|
+
"svg",
|
|
4607
|
+
{
|
|
4608
|
+
viewBox: "0 0 24 24",
|
|
4609
|
+
className,
|
|
4610
|
+
fill: "none",
|
|
4611
|
+
stroke: "currentColor",
|
|
4612
|
+
strokeWidth: "1.5",
|
|
4613
|
+
strokeLinecap: "round",
|
|
4614
|
+
strokeLinejoin: "round",
|
|
4615
|
+
children: [
|
|
4616
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
4617
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 2v6h6" })
|
|
4618
|
+
]
|
|
4619
|
+
}
|
|
4620
|
+
);
|
|
3937
4621
|
}
|
|
3938
|
-
var FileUpload = React52__namespace.forwardRef(
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
const
|
|
3963
|
-
|
|
4622
|
+
var FileUpload = React52__namespace.forwardRef(function FileUpload2({
|
|
4623
|
+
value,
|
|
4624
|
+
defaultValue,
|
|
4625
|
+
onChange,
|
|
4626
|
+
onReject,
|
|
4627
|
+
accept,
|
|
4628
|
+
maxSize,
|
|
4629
|
+
maxFiles,
|
|
4630
|
+
multiple = true,
|
|
4631
|
+
disabled = false,
|
|
4632
|
+
error = false,
|
|
4633
|
+
required = false,
|
|
4634
|
+
className,
|
|
4635
|
+
id,
|
|
4636
|
+
"aria-describedby": describedBy
|
|
4637
|
+
}, ref) {
|
|
4638
|
+
const controlled = value !== void 0;
|
|
4639
|
+
const [internalItems, setInternalItems] = React52__namespace.useState(defaultValue ?? []);
|
|
4640
|
+
const items = controlled ? value : internalItems;
|
|
4641
|
+
const commit = (next) => {
|
|
4642
|
+
if (!controlled) setInternalItems(next);
|
|
4643
|
+
onChange?.(next);
|
|
4644
|
+
};
|
|
4645
|
+
const handleFiles = (files) => {
|
|
4646
|
+
const { accepted, rejected } = validateFiles(files, {
|
|
4647
|
+
accept,
|
|
4648
|
+
maxSize,
|
|
4649
|
+
maxFiles,
|
|
4650
|
+
existingCount: items.length,
|
|
4651
|
+
multiple
|
|
4652
|
+
});
|
|
4653
|
+
if (rejected.length > 0) onReject?.(rejected);
|
|
4654
|
+
if (accepted.length === 0) return;
|
|
4655
|
+
const newItems = accepted.map((file) => ({
|
|
4656
|
+
id: generateId(),
|
|
4657
|
+
file,
|
|
4658
|
+
status: "pending"
|
|
4659
|
+
}));
|
|
4660
|
+
commit(multiple ? [...items, ...newItems] : newItems.slice(0, 1));
|
|
4661
|
+
};
|
|
4662
|
+
const removeItem = (itemId) => {
|
|
4663
|
+
commit(items.filter((it) => it.id !== itemId));
|
|
4664
|
+
};
|
|
4665
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full flex flex-col gap-3", className), children: [
|
|
4666
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4667
|
+
Dropzone,
|
|
4668
|
+
{
|
|
4669
|
+
ref,
|
|
4670
|
+
onFiles: handleFiles,
|
|
3964
4671
|
accept,
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3984
|
-
Dropzone,
|
|
3985
|
-
{
|
|
3986
|
-
ref,
|
|
3987
|
-
onFiles: handleFiles,
|
|
3988
|
-
accept,
|
|
3989
|
-
multiple,
|
|
3990
|
-
disabled,
|
|
3991
|
-
id,
|
|
3992
|
-
"aria-describedby": describedBy,
|
|
3993
|
-
"aria-invalid": error || void 0,
|
|
3994
|
-
"aria-required": required || void 0
|
|
3995
|
-
}
|
|
3996
|
-
),
|
|
3997
|
-
items.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-2", children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3998
|
-
"li",
|
|
3999
|
-
{
|
|
4000
|
-
className: "flex items-center gap-3 rounded-kj-md border border-border bg-surface px-3 py-2",
|
|
4001
|
-
children: [
|
|
4002
|
-
/* @__PURE__ */ jsxRuntime.jsx(FileIcon, { className: "h-5 w-5 shrink-0 text-muted-foreground" }),
|
|
4003
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
4004
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4005
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm text-foreground", children: item.file.name }),
|
|
4006
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: formatBytes(item.file.size) })
|
|
4007
|
-
] }),
|
|
4008
|
-
item.status === "uploading" && item.progress != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-1.5 flex items-center gap-2", children: [
|
|
4009
|
-
/* @__PURE__ */ jsxRuntime.jsx(Progress, { value: item.progress, className: "h-1.5" }),
|
|
4010
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "shrink-0 text-xs text-muted-foreground", children: [
|
|
4011
|
-
Math.round(item.progress),
|
|
4012
|
-
"%"
|
|
4013
|
-
] })
|
|
4014
|
-
] }),
|
|
4015
|
-
item.status === "success" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block text-xs text-success", children: "Uploaded" }),
|
|
4016
|
-
item.status === "error" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block text-xs text-danger", children: item.error ?? "Upload failed" })
|
|
4672
|
+
multiple,
|
|
4673
|
+
disabled,
|
|
4674
|
+
id,
|
|
4675
|
+
"aria-describedby": describedBy,
|
|
4676
|
+
"aria-invalid": error || void 0,
|
|
4677
|
+
"aria-required": required || void 0
|
|
4678
|
+
}
|
|
4679
|
+
),
|
|
4680
|
+
items.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-2", children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4681
|
+
"li",
|
|
4682
|
+
{
|
|
4683
|
+
className: "flex items-center gap-3 rounded-kj-md border border-border bg-surface px-3 py-2",
|
|
4684
|
+
children: [
|
|
4685
|
+
/* @__PURE__ */ jsxRuntime.jsx(FileIcon, { className: "h-5 w-5 shrink-0 text-muted-foreground" }),
|
|
4686
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
4687
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4688
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm text-foreground", children: item.file.name }),
|
|
4689
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: formatBytes(item.file.size) })
|
|
4017
4690
|
] }),
|
|
4018
|
-
|
|
4019
|
-
"
|
|
4020
|
-
{
|
|
4021
|
-
|
|
4022
|
-
"
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4691
|
+
item.status === "uploading" && item.progress != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-1.5 flex items-center gap-2", children: [
|
|
4692
|
+
/* @__PURE__ */ jsxRuntime.jsx(Progress, { value: item.progress, className: "h-1.5" }),
|
|
4693
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "shrink-0 text-xs text-muted-foreground", children: [
|
|
4694
|
+
Math.round(item.progress),
|
|
4695
|
+
"%"
|
|
4696
|
+
] })
|
|
4697
|
+
] }),
|
|
4698
|
+
item.status === "success" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block text-xs text-success", children: "Uploaded" }),
|
|
4699
|
+
item.status === "error" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block text-xs text-danger", children: item.error ?? "Upload failed" })
|
|
4700
|
+
] }),
|
|
4701
|
+
!disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4702
|
+
"button",
|
|
4703
|
+
{
|
|
4704
|
+
type: "button",
|
|
4705
|
+
"aria-label": `Remove ${item.file.name}`,
|
|
4706
|
+
onClick: () => removeItem(item.id),
|
|
4707
|
+
className: "shrink-0 rounded-kj-sm p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
4708
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4709
|
+
"svg",
|
|
4710
|
+
{
|
|
4711
|
+
viewBox: "0 0 24 24",
|
|
4712
|
+
className: "h-4 w-4",
|
|
4713
|
+
fill: "none",
|
|
4714
|
+
stroke: "currentColor",
|
|
4715
|
+
strokeWidth: "2",
|
|
4716
|
+
strokeLinecap: "round",
|
|
4717
|
+
strokeLinejoin: "round",
|
|
4718
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
4719
|
+
}
|
|
4720
|
+
)
|
|
4721
|
+
}
|
|
4722
|
+
)
|
|
4723
|
+
]
|
|
4724
|
+
},
|
|
4725
|
+
item.id
|
|
4726
|
+
)) })
|
|
4727
|
+
] });
|
|
4728
|
+
});
|
|
4035
4729
|
FileUpload.displayName = "FileUpload";
|
|
4036
4730
|
var FileUploadField = React52__namespace.forwardRef(
|
|
4037
4731
|
function FileUploadField2({ label, hint, error, required, className, ...props }, ref) {
|
|
@@ -4076,16 +4770,7 @@ var TimelineItem = React52__namespace.forwardRef(
|
|
|
4076
4770
|
align === "right" && "grid-cols-[1fr_auto] text-right",
|
|
4077
4771
|
align === "alternate" && "md:grid-cols-[1fr_auto_1fr] grid-cols-[auto_1fr]"
|
|
4078
4772
|
);
|
|
4079
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TimelineItemContext.Provider, { value: { isEven, align, isLast }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4080
|
-
"div",
|
|
4081
|
-
{
|
|
4082
|
-
ref,
|
|
4083
|
-
role: "listitem",
|
|
4084
|
-
className: cn(gridClass, className),
|
|
4085
|
-
...props,
|
|
4086
|
-
children
|
|
4087
|
-
}
|
|
4088
|
-
) });
|
|
4773
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TimelineItemContext.Provider, { value: { isEven, align, isLast }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, role: "listitem", className: cn(gridClass, className), ...props, children }) });
|
|
4089
4774
|
}
|
|
4090
4775
|
);
|
|
4091
4776
|
TimelineItem.displayName = "TimelineItem";
|
|
@@ -4165,51 +4850,53 @@ var TimelineContent = React52__namespace.forwardRef(
|
|
|
4165
4850
|
}
|
|
4166
4851
|
);
|
|
4167
4852
|
TimelineContent.displayName = "TimelineContent";
|
|
4168
|
-
var TimelineTitle = React52__namespace.forwardRef(
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
)
|
|
4178
|
-
);
|
|
4853
|
+
var TimelineTitle = React52__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4854
|
+
"h4",
|
|
4855
|
+
{
|
|
4856
|
+
ref,
|
|
4857
|
+
className: cn("m-0 text-sm font-semibold tracking-[-0.01em] text-foreground", className),
|
|
4858
|
+
...props,
|
|
4859
|
+
children
|
|
4860
|
+
}
|
|
4861
|
+
));
|
|
4179
4862
|
TimelineTitle.displayName = "TimelineTitle";
|
|
4180
|
-
var TimelineTime = React52__namespace.forwardRef(
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
)
|
|
4189
|
-
);
|
|
4863
|
+
var TimelineTime = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4864
|
+
"time",
|
|
4865
|
+
{
|
|
4866
|
+
ref,
|
|
4867
|
+
className: cn("text-[0.75rem] text-muted-foreground font-normal", className),
|
|
4868
|
+
...props
|
|
4869
|
+
}
|
|
4870
|
+
));
|
|
4190
4871
|
TimelineTime.displayName = "TimelineTime";
|
|
4191
4872
|
function useStepper({ initialStep = 0, stepsCount }) {
|
|
4192
4873
|
const safeStepsCount = Math.max(1, stepsCount);
|
|
4193
4874
|
const [activeStep, setActiveStep] = React52__namespace.useState(initialStep);
|
|
4194
4875
|
const [completedSteps, setCompletedSteps] = React52__namespace.useState([]);
|
|
4195
|
-
const setStep = React52__namespace.useCallback(
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4876
|
+
const setStep = React52__namespace.useCallback(
|
|
4877
|
+
(step) => {
|
|
4878
|
+
if (step >= 0 && step < safeStepsCount) {
|
|
4879
|
+
setActiveStep(step);
|
|
4880
|
+
}
|
|
4881
|
+
},
|
|
4882
|
+
[safeStepsCount]
|
|
4883
|
+
);
|
|
4200
4884
|
const nextStep = React52__namespace.useCallback(() => {
|
|
4201
4885
|
setActiveStep((prev) => Math.min(prev + 1, safeStepsCount - 1));
|
|
4202
4886
|
}, [safeStepsCount]);
|
|
4203
4887
|
const prevStep = React52__namespace.useCallback(() => {
|
|
4204
4888
|
setActiveStep((prev) => Math.max(prev - 1, 0));
|
|
4205
4889
|
}, []);
|
|
4206
|
-
const completeStep = React52__namespace.useCallback(
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4890
|
+
const completeStep = React52__namespace.useCallback(
|
|
4891
|
+
(step) => {
|
|
4892
|
+
setCompletedSteps((prev) => {
|
|
4893
|
+
if (step < 0 || step >= safeStepsCount) return prev;
|
|
4894
|
+
if (prev.includes(step)) return prev;
|
|
4895
|
+
return [...prev, step].sort((a, b) => a - b);
|
|
4896
|
+
});
|
|
4897
|
+
},
|
|
4898
|
+
[safeStepsCount]
|
|
4899
|
+
);
|
|
4213
4900
|
const uncompleteStep = React52__namespace.useCallback((step) => {
|
|
4214
4901
|
setCompletedSteps((prev) => prev.filter((s) => s !== step));
|
|
4215
4902
|
}, []);
|
|
@@ -4233,7 +4920,17 @@ function useStepper({ initialStep = 0, stepsCount }) {
|
|
|
4233
4920
|
var StepperContext = React52__namespace.createContext(null);
|
|
4234
4921
|
var StepperItemContext = React52__namespace.createContext(null);
|
|
4235
4922
|
var Stepper = React52__namespace.forwardRef(
|
|
4236
|
-
({
|
|
4923
|
+
({
|
|
4924
|
+
value,
|
|
4925
|
+
defaultValue,
|
|
4926
|
+
onValueChange,
|
|
4927
|
+
orientation = "horizontal",
|
|
4928
|
+
responsive = true,
|
|
4929
|
+
linear = true,
|
|
4930
|
+
children,
|
|
4931
|
+
className,
|
|
4932
|
+
...props
|
|
4933
|
+
}, ref) => {
|
|
4237
4934
|
const [localValue, setLocalValue] = React52__namespace.useState(defaultValue ?? 0);
|
|
4238
4935
|
const isControlled = value !== void 0;
|
|
4239
4936
|
const activeStep = isControlled ? value : localValue;
|
|
@@ -4254,7 +4951,9 @@ var Stepper = React52__namespace.forwardRef(
|
|
|
4254
4951
|
if (linear) {
|
|
4255
4952
|
setCompletedSteps((prev) => {
|
|
4256
4953
|
const priorSteps = steps.filter((s) => s < step);
|
|
4257
|
-
const nextCompleted = Array.from(/* @__PURE__ */ new Set([...prev, ...priorSteps])).sort(
|
|
4954
|
+
const nextCompleted = Array.from(/* @__PURE__ */ new Set([...prev, ...priorSteps])).sort(
|
|
4955
|
+
(a, b) => a - b
|
|
4956
|
+
);
|
|
4258
4957
|
return nextCompleted;
|
|
4259
4958
|
});
|
|
4260
4959
|
}
|
|
@@ -4265,6 +4964,7 @@ var Stepper = React52__namespace.forwardRef(
|
|
|
4265
4964
|
() => ({
|
|
4266
4965
|
activeStep,
|
|
4267
4966
|
orientation,
|
|
4967
|
+
responsive,
|
|
4268
4968
|
linear,
|
|
4269
4969
|
setStep,
|
|
4270
4970
|
completedSteps,
|
|
@@ -4272,7 +4972,17 @@ var Stepper = React52__namespace.forwardRef(
|
|
|
4272
4972
|
unregisterStep,
|
|
4273
4973
|
steps
|
|
4274
4974
|
}),
|
|
4275
|
-
[
|
|
4975
|
+
[
|
|
4976
|
+
activeStep,
|
|
4977
|
+
orientation,
|
|
4978
|
+
responsive,
|
|
4979
|
+
linear,
|
|
4980
|
+
setStep,
|
|
4981
|
+
completedSteps,
|
|
4982
|
+
registerStep,
|
|
4983
|
+
unregisterStep,
|
|
4984
|
+
steps
|
|
4985
|
+
]
|
|
4276
4986
|
);
|
|
4277
4987
|
return /* @__PURE__ */ jsxRuntime.jsx(StepperContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4278
4988
|
"div",
|
|
@@ -4314,16 +5024,15 @@ var StepperList = React52__namespace.forwardRef(
|
|
|
4314
5024
|
({ className, children, ...props }, ref) => {
|
|
4315
5025
|
const ctx = React52__namespace.useContext(StepperContext);
|
|
4316
5026
|
if (!ctx) throw new Error("StepperList must be used within a Stepper");
|
|
5027
|
+
const isResponsiveHorizontal = ctx.orientation === "horizontal" && (ctx.responsive ?? true);
|
|
5028
|
+
const orientationClass = isResponsiveHorizontal ? "flex flex-col sm:flex-row items-start sm:items-center justify-between w-full relative gap-4" : ctx.orientation === "horizontal" ? "flex items-center justify-between w-full relative gap-4" : "flex flex-col items-start gap-6 relative w-full";
|
|
4317
5029
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4318
5030
|
"div",
|
|
4319
5031
|
{
|
|
4320
5032
|
ref,
|
|
4321
5033
|
role: "tablist",
|
|
4322
|
-
"aria-orientation": ctx.orientation,
|
|
4323
|
-
className: cn(
|
|
4324
|
-
ctx.orientation === "horizontal" ? "flex items-center justify-between w-full relative gap-4" : "flex flex-col items-start gap-6 relative w-full",
|
|
4325
|
-
className
|
|
4326
|
-
),
|
|
5034
|
+
"aria-orientation": ctx.orientation,
|
|
5035
|
+
className: cn(orientationClass, className),
|
|
4327
5036
|
...props,
|
|
4328
5037
|
children
|
|
4329
5038
|
}
|
|
@@ -4341,13 +5050,14 @@ var StepperItem = React52__namespace.forwardRef(
|
|
|
4341
5050
|
return () => unregisterStep(value);
|
|
4342
5051
|
}, [value, registerStep, unregisterStep]);
|
|
4343
5052
|
const isLast = ctx.steps[ctx.steps.length - 1] === value;
|
|
5053
|
+
const isResponsiveHorizontal = ctx.orientation === "horizontal" && (ctx.responsive ?? true);
|
|
4344
5054
|
return /* @__PURE__ */ jsxRuntime.jsx(StepperItemContext.Provider, { value: { value, disabled, isLast }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4345
5055
|
"div",
|
|
4346
5056
|
{
|
|
4347
5057
|
ref,
|
|
4348
5058
|
className: cn(
|
|
4349
5059
|
"group relative flex items-center gap-3 z-10",
|
|
4350
|
-
ctx.orientation === "vertical" ? "flex items-start w-full" : "",
|
|
5060
|
+
ctx.orientation === "vertical" ? "flex items-start w-full" : isResponsiveHorizontal ? "w-full sm:w-auto items-start sm:items-center" : "",
|
|
4351
5061
|
className
|
|
4352
5062
|
),
|
|
4353
5063
|
...props,
|
|
@@ -4361,12 +5071,13 @@ var StepperSeparator = React52__namespace.forwardRef(
|
|
|
4361
5071
|
({ className, ...props }, ref) => {
|
|
4362
5072
|
const ctx = React52__namespace.useContext(StepperContext);
|
|
4363
5073
|
if (!ctx) throw new Error("StepperSeparator must be used within a Stepper");
|
|
5074
|
+
const isResponsiveHorizontal = ctx.orientation === "horizontal" && (ctx.responsive ?? true);
|
|
4364
5075
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4365
5076
|
"div",
|
|
4366
5077
|
{
|
|
4367
5078
|
ref,
|
|
4368
5079
|
className: cn(
|
|
4369
|
-
ctx.orientation === "horizontal" ? "flex-1 h-[2px] bg-border transition-all duration-300" : "w-[2px] bg-border absolute left-[17px] top-8 bottom-0 -ml-px z-0",
|
|
5080
|
+
isResponsiveHorizontal ? "hidden sm:block flex-1 h-[2px] bg-border transition-all duration-300" : ctx.orientation === "horizontal" ? "flex-1 h-[2px] bg-border transition-all duration-300" : "w-[2px] bg-border absolute left-[17px] top-8 bottom-0 -ml-px z-0",
|
|
4370
5081
|
className
|
|
4371
5082
|
),
|
|
4372
5083
|
...props
|
|
@@ -4509,7 +5220,11 @@ var AppShellBanner = React52__namespace.forwardRef(
|
|
|
4509
5220
|
"div",
|
|
4510
5221
|
{
|
|
4511
5222
|
ref,
|
|
4512
|
-
className: cn(
|
|
5223
|
+
className: cn(
|
|
5224
|
+
"px-4 py-2 text-sm font-medium text-center flex items-center justify-center relative z-30",
|
|
5225
|
+
variantClass,
|
|
5226
|
+
className
|
|
5227
|
+
),
|
|
4513
5228
|
...props,
|
|
4514
5229
|
children: [
|
|
4515
5230
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children }),
|
|
@@ -4520,7 +5235,20 @@ var AppShellBanner = React52__namespace.forwardRef(
|
|
|
4520
5235
|
onClick: onClose,
|
|
4521
5236
|
className: "p-1 rounded opacity-80 hover:opacity-100 transition-opacity ml-2 cursor-pointer",
|
|
4522
5237
|
"aria-label": "Close banner",
|
|
4523
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5238
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5239
|
+
"svg",
|
|
5240
|
+
{
|
|
5241
|
+
width: 14,
|
|
5242
|
+
height: 14,
|
|
5243
|
+
viewBox: "0 0 24 24",
|
|
5244
|
+
fill: "none",
|
|
5245
|
+
stroke: "currentColor",
|
|
5246
|
+
strokeWidth: 2.5,
|
|
5247
|
+
strokeLinecap: "round",
|
|
5248
|
+
strokeLinejoin: "round",
|
|
5249
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
5250
|
+
}
|
|
5251
|
+
)
|
|
4524
5252
|
}
|
|
4525
5253
|
)
|
|
4526
5254
|
]
|
|
@@ -4549,6 +5277,16 @@ var AppShellHeader = React52__namespace.forwardRef(
|
|
|
4549
5277
|
window.addEventListener("keydown", handleKeyDown);
|
|
4550
5278
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
4551
5279
|
}, [mobileOpen]);
|
|
5280
|
+
React52__namespace.useEffect(() => {
|
|
5281
|
+
if (mobileOpen) {
|
|
5282
|
+
document.body.style.overflow = "hidden";
|
|
5283
|
+
} else {
|
|
5284
|
+
document.body.style.overflow = "";
|
|
5285
|
+
}
|
|
5286
|
+
return () => {
|
|
5287
|
+
document.body.style.overflow = "";
|
|
5288
|
+
};
|
|
5289
|
+
}, [mobileOpen]);
|
|
4552
5290
|
const positionClass = {
|
|
4553
5291
|
sticky: "sticky top-0 z-40",
|
|
4554
5292
|
fixed: "fixed top-0 left-0 right-0 z-40",
|
|
@@ -4580,11 +5318,24 @@ var AppShellHeader = React52__namespace.forwardRef(
|
|
|
4580
5318
|
onClick: () => setMobileOpen(true),
|
|
4581
5319
|
className: "md:hidden p-2 -ml-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
4582
5320
|
"aria-label": "Open navigation",
|
|
4583
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
5321
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5322
|
+
"svg",
|
|
5323
|
+
{
|
|
5324
|
+
width: 20,
|
|
5325
|
+
height: 20,
|
|
5326
|
+
viewBox: "0 0 24 24",
|
|
5327
|
+
fill: "none",
|
|
5328
|
+
stroke: "currentColor",
|
|
5329
|
+
strokeWidth: 2.5,
|
|
5330
|
+
strokeLinecap: "round",
|
|
5331
|
+
strokeLinejoin: "round",
|
|
5332
|
+
children: [
|
|
5333
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
|
|
5334
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
|
|
5335
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
|
|
5336
|
+
]
|
|
5337
|
+
}
|
|
5338
|
+
)
|
|
4588
5339
|
}
|
|
4589
5340
|
),
|
|
4590
5341
|
children
|
|
@@ -4617,7 +5368,20 @@ var AppShellHeader = React52__namespace.forwardRef(
|
|
|
4617
5368
|
onClick: () => setMobileOpen(false),
|
|
4618
5369
|
className: "p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
4619
5370
|
"aria-label": "Close navigation",
|
|
4620
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5371
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5372
|
+
"svg",
|
|
5373
|
+
{
|
|
5374
|
+
width: 16,
|
|
5375
|
+
height: 16,
|
|
5376
|
+
viewBox: "0 0 24 24",
|
|
5377
|
+
fill: "none",
|
|
5378
|
+
stroke: "currentColor",
|
|
5379
|
+
strokeWidth: 2.5,
|
|
5380
|
+
strokeLinecap: "round",
|
|
5381
|
+
strokeLinejoin: "round",
|
|
5382
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
5383
|
+
}
|
|
5384
|
+
)
|
|
4621
5385
|
}
|
|
4622
5386
|
)
|
|
4623
5387
|
] }),
|
|
@@ -4642,7 +5406,12 @@ var AppShellMain = React52__namespace.forwardRef(
|
|
|
4642
5406
|
"main",
|
|
4643
5407
|
{
|
|
4644
5408
|
ref,
|
|
4645
|
-
className: cn(
|
|
5409
|
+
className: cn(
|
|
5410
|
+
"flex-1",
|
|
5411
|
+
padded && "px-4 sm:px-6 lg:px-8 py-4 sm:py-6 md:py-12",
|
|
5412
|
+
widthClass,
|
|
5413
|
+
className
|
|
5414
|
+
),
|
|
4646
5415
|
...props,
|
|
4647
5416
|
children
|
|
4648
5417
|
}
|
|
@@ -4680,19 +5449,24 @@ var AppShell = React52__namespace.forwardRef(
|
|
|
4680
5449
|
headerVariant = "glass",
|
|
4681
5450
|
paddedContent = true,
|
|
4682
5451
|
mobileNav,
|
|
5452
|
+
bottomNav,
|
|
4683
5453
|
...props
|
|
4684
5454
|
}, ref) => {
|
|
4685
5455
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4686
5456
|
"div",
|
|
4687
5457
|
{
|
|
4688
5458
|
ref,
|
|
4689
|
-
className: cn(
|
|
5459
|
+
className: cn(
|
|
5460
|
+
"min-h-screen bg-canvas text-foreground flex flex-col antialiased",
|
|
5461
|
+
className
|
|
5462
|
+
),
|
|
4690
5463
|
...props,
|
|
4691
5464
|
children: [
|
|
4692
5465
|
banner && /* @__PURE__ */ jsxRuntime.jsx(AppShellBanner, { children: banner }),
|
|
4693
5466
|
header && /* @__PURE__ */ jsxRuntime.jsx(AppShellHeader, { variant: headerVariant, position: headerPosition, mobileNav, children: header }),
|
|
4694
5467
|
/* @__PURE__ */ jsxRuntime.jsx(AppShellMain, { width: contentWidth, padded: paddedContent, children }),
|
|
4695
|
-
footer && /* @__PURE__ */ jsxRuntime.jsx(AppShellFooter, { children: footer })
|
|
5468
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx(AppShellFooter, { children: footer }),
|
|
5469
|
+
bottomNav && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:hidden sticky bottom-0 z-30 w-full bg-surface border-t border-border", children: bottomNav })
|
|
4696
5470
|
]
|
|
4697
5471
|
}
|
|
4698
5472
|
);
|
|
@@ -4841,9 +5615,6 @@ var Rating = React52__namespace.forwardRef(
|
|
|
4841
5615
|
ref,
|
|
4842
5616
|
role: readOnly ? "img" : "radiogroup",
|
|
4843
5617
|
tabIndex: disabled || readOnly ? -1 : 0,
|
|
4844
|
-
"aria-valuenow": displayValue,
|
|
4845
|
-
"aria-valuemin": 0,
|
|
4846
|
-
"aria-valuemax": max,
|
|
4847
5618
|
"aria-disabled": disabled || void 0,
|
|
4848
5619
|
"aria-readonly": readOnly || void 0,
|
|
4849
5620
|
"aria-label": ariaLabel || (readOnly ? `Rated ${displayValue} out of ${max}` : "Rating"),
|
|
@@ -4862,10 +5633,7 @@ var Rating = React52__namespace.forwardRef(
|
|
|
4862
5633
|
name && /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: currentValue }),
|
|
4863
5634
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex items-center gap-0.5", children: Array.from({ length: max }, (_, index) => {
|
|
4864
5635
|
const starIndex = index + 1;
|
|
4865
|
-
const fillFraction = Math.max(
|
|
4866
|
-
0,
|
|
4867
|
-
Math.min(1, displayValue - index)
|
|
4868
|
-
);
|
|
5636
|
+
const fillFraction = Math.max(0, Math.min(1, displayValue - index));
|
|
4869
5637
|
const gradientId = `rating-grad-${instanceId}-${index}-${Math.round(
|
|
4870
5638
|
fillFraction * 100
|
|
4871
5639
|
)}`;
|
|
@@ -4904,46 +5672,24 @@ var Rating = React52__namespace.forwardRef(
|
|
|
4904
5672
|
className: "w-full h-full",
|
|
4905
5673
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4906
5674
|
children: [
|
|
4907
|
-
fillFraction > 0 && fillFraction < 1 && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4908
|
-
"
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
offset: `${fillFraction * 100}%`,
|
|
4926
|
-
stopColor: "currentColor",
|
|
4927
|
-
className: color
|
|
4928
|
-
}
|
|
4929
|
-
),
|
|
4930
|
-
isCssColor(emptyColor) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4931
|
-
"stop",
|
|
4932
|
-
{
|
|
4933
|
-
offset: `${fillFraction * 100}%`,
|
|
4934
|
-
stopColor: emptyColor
|
|
4935
|
-
}
|
|
4936
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4937
|
-
"stop",
|
|
4938
|
-
{
|
|
4939
|
-
offset: `${fillFraction * 100}%`,
|
|
4940
|
-
stopColor: "currentColor",
|
|
4941
|
-
className: emptyColor
|
|
4942
|
-
}
|
|
4943
|
-
)
|
|
4944
|
-
]
|
|
4945
|
-
}
|
|
4946
|
-
) }),
|
|
5675
|
+
fillFraction > 0 && fillFraction < 1 && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
|
5676
|
+
isCssColor(color) ? /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: `${fillFraction * 100}%`, stopColor: color }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5677
|
+
"stop",
|
|
5678
|
+
{
|
|
5679
|
+
offset: `${fillFraction * 100}%`,
|
|
5680
|
+
stopColor: "currentColor",
|
|
5681
|
+
className: color
|
|
5682
|
+
}
|
|
5683
|
+
),
|
|
5684
|
+
isCssColor(emptyColor) ? /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: `${fillFraction * 100}%`, stopColor: emptyColor }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5685
|
+
"stop",
|
|
5686
|
+
{
|
|
5687
|
+
offset: `${fillFraction * 100}%`,
|
|
5688
|
+
stopColor: "currentColor",
|
|
5689
|
+
className: emptyColor
|
|
5690
|
+
}
|
|
5691
|
+
)
|
|
5692
|
+
] }) }),
|
|
4947
5693
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4948
5694
|
"path",
|
|
4949
5695
|
{
|
|
@@ -5008,16 +5754,7 @@ var RatingField = React52__namespace.forwardRef(
|
|
|
5008
5754
|
);
|
|
5009
5755
|
RatingField.displayName = "RatingField";
|
|
5010
5756
|
var RatingSummary = React52__namespace.forwardRef(
|
|
5011
|
-
({
|
|
5012
|
-
average,
|
|
5013
|
-
totalCount,
|
|
5014
|
-
distribution,
|
|
5015
|
-
max = 5,
|
|
5016
|
-
size = "md",
|
|
5017
|
-
icon = "star",
|
|
5018
|
-
className,
|
|
5019
|
-
...props
|
|
5020
|
-
}, ref) => {
|
|
5757
|
+
({ average, totalCount, distribution, max = 5, size = "md", icon = "star", className, ...props }, ref) => {
|
|
5021
5758
|
const formattedAverage = Number.isInteger(average) ? average.toString() : average.toFixed(1);
|
|
5022
5759
|
const formattedTotalCount = totalCount.toLocaleString();
|
|
5023
5760
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5130,7 +5867,15 @@ var PricingCard = React52__namespace.forwardRef(
|
|
|
5130
5867
|
children: included ? "\u2713" : "\u2715"
|
|
5131
5868
|
}
|
|
5132
5869
|
),
|
|
5133
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5870
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5871
|
+
"span",
|
|
5872
|
+
{
|
|
5873
|
+
className: cn(
|
|
5874
|
+
included ? "text-foreground" : "text-muted-foreground line-through opacity-70"
|
|
5875
|
+
),
|
|
5876
|
+
children: text
|
|
5877
|
+
}
|
|
5878
|
+
)
|
|
5134
5879
|
] }, idx);
|
|
5135
5880
|
}) }),
|
|
5136
5881
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-auto pt-2", children: cta ? cta : ctaHref ? (
|
|
@@ -5326,9 +6071,7 @@ function useInboxState(initial) {
|
|
|
5326
6071
|
const [items, setItems] = React52__namespace.useState(initial);
|
|
5327
6072
|
const unreadCount = items.filter((i) => !i.read).length;
|
|
5328
6073
|
const markRead = React52__namespace.useCallback((id) => {
|
|
5329
|
-
setItems(
|
|
5330
|
-
(prev) => prev.map((item) => item.id === id ? { ...item, read: true } : item)
|
|
5331
|
-
);
|
|
6074
|
+
setItems((prev) => prev.map((item) => item.id === id ? { ...item, read: true } : item));
|
|
5332
6075
|
}, []);
|
|
5333
6076
|
const markAllRead = React52__namespace.useCallback(() => {
|
|
5334
6077
|
setItems((prev) => prev.map((item) => ({ ...item, read: true })));
|
|
@@ -5461,7 +6204,16 @@ function NotificationItem({ item, onDismiss, className }) {
|
|
|
5461
6204
|
}
|
|
5462
6205
|
) : item.avatarFallback ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-7 h-7 rounded-full bg-primary/20 text-primary text-[10px] font-bold flex items-center justify-center flex-shrink-0 select-none", children: item.avatarFallback }) : item.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-7 h-7 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0 text-primary", children: item.icon }) : null;
|
|
5463
6206
|
const textBlock = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
5464
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6207
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6208
|
+
"p",
|
|
6209
|
+
{
|
|
6210
|
+
className: cn(
|
|
6211
|
+
"text-sm leading-snug",
|
|
6212
|
+
item.read ? "text-muted-foreground" : "text-foreground"
|
|
6213
|
+
),
|
|
6214
|
+
children: item.title
|
|
6215
|
+
}
|
|
6216
|
+
),
|
|
5465
6217
|
item.body && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-0.5 truncate", children: item.body }),
|
|
5466
6218
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: formatRelativeTime(item.timestamp) })
|
|
5467
6219
|
] });
|
|
@@ -5535,6 +6287,7 @@ function InboxContent({
|
|
|
5535
6287
|
viewAllHref,
|
|
5536
6288
|
viewAllLabel = "View all notifications",
|
|
5537
6289
|
emptyState,
|
|
6290
|
+
align = "auto",
|
|
5538
6291
|
width = 360,
|
|
5539
6292
|
maxHeight = 320,
|
|
5540
6293
|
className
|
|
@@ -5547,13 +6300,32 @@ function InboxContent({
|
|
|
5547
6300
|
if (!ctx.open) return null;
|
|
5548
6301
|
const allRead = items.length === 0 || items.every((i) => i.read);
|
|
5549
6302
|
const defaultEmptyState = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-10 px-5 text-center", children: [
|
|
5550
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-10 h-10 rounded-full bg-muted flex items-center justify-center mb-3 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
6303
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-10 h-10 rounded-full bg-muted flex items-center justify-center mb-3 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6304
|
+
"svg",
|
|
6305
|
+
{
|
|
6306
|
+
width: 18,
|
|
6307
|
+
height: 18,
|
|
6308
|
+
viewBox: "0 0 24 24",
|
|
6309
|
+
fill: "none",
|
|
6310
|
+
stroke: "currentColor",
|
|
6311
|
+
strokeWidth: 1.5,
|
|
6312
|
+
strokeLinecap: "round",
|
|
6313
|
+
strokeLinejoin: "round",
|
|
6314
|
+
"aria-hidden": "true",
|
|
6315
|
+
children: [
|
|
6316
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" }),
|
|
6317
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.73 21a2 2 0 0 1-3.46 0" })
|
|
6318
|
+
]
|
|
6319
|
+
}
|
|
6320
|
+
) }),
|
|
5554
6321
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: "All caught up" }),
|
|
5555
6322
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: "No new notifications" })
|
|
5556
6323
|
] });
|
|
6324
|
+
const alignClass = {
|
|
6325
|
+
start: "left-0 top-[calc(100%+6px)]",
|
|
6326
|
+
end: "right-0 top-[calc(100%+6px)]",
|
|
6327
|
+
auto: "right-0 sm:right-0 left-auto top-[calc(100%+6px)] max-sm:left-1/2 max-sm:-translate-x-1/2"
|
|
6328
|
+
}[align ?? "auto"];
|
|
5557
6329
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5558
6330
|
"div",
|
|
5559
6331
|
{
|
|
@@ -5561,11 +6333,12 @@ function InboxContent({
|
|
|
5561
6333
|
role: "dialog",
|
|
5562
6334
|
"aria-label": "Notifications",
|
|
5563
6335
|
tabIndex: -1,
|
|
5564
|
-
style: { width },
|
|
6336
|
+
style: { width: typeof width === "number" ? `${width}px` : width },
|
|
5565
6337
|
className: cn(
|
|
5566
|
-
"absolute
|
|
6338
|
+
"absolute z-40 max-w-[calc(100vw-1.5rem)]",
|
|
5567
6339
|
"bg-surface border border-border rounded-kj-md shadow-kj-lg outline-none",
|
|
5568
6340
|
"animate-[kjpop_.12s_ease]",
|
|
6341
|
+
alignClass,
|
|
5569
6342
|
className
|
|
5570
6343
|
),
|
|
5571
6344
|
children: [
|
|
@@ -5586,21 +6359,7 @@ function InboxContent({
|
|
|
5586
6359
|
}
|
|
5587
6360
|
)
|
|
5588
6361
|
] }),
|
|
5589
|
-
items.length === 0 ? emptyState ?? defaultEmptyState : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5590
|
-
"div",
|
|
5591
|
-
{
|
|
5592
|
-
className: "overflow-y-auto",
|
|
5593
|
-
style: { maxHeight },
|
|
5594
|
-
children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5595
|
-
NotificationItem,
|
|
5596
|
-
{
|
|
5597
|
-
item,
|
|
5598
|
-
onDismiss
|
|
5599
|
-
},
|
|
5600
|
-
item.id
|
|
5601
|
-
))
|
|
5602
|
-
}
|
|
5603
|
-
),
|
|
6362
|
+
items.length === 0 ? emptyState ?? defaultEmptyState : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto", style: { maxHeight }, children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(NotificationItem, { item, onDismiss }, item.id)) }),
|
|
5604
6363
|
items.length > 0 && viewAllHref && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border px-3.5 py-2.5 text-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5605
6364
|
"a",
|
|
5606
6365
|
{
|
|
@@ -5729,30 +6488,32 @@ function hslToHex(h, s, l) {
|
|
|
5729
6488
|
};
|
|
5730
6489
|
return `#${toHex(r)}${toHex(g)}${toHex(b)}`.toUpperCase();
|
|
5731
6490
|
}
|
|
5732
|
-
var ColorPickerSwatch = React52__namespace.forwardRef(
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
6491
|
+
var ColorPickerSwatch = React52__namespace.forwardRef(
|
|
6492
|
+
({ color, selected = false, size = "md", className, style, ...props }, ref) => {
|
|
6493
|
+
const sizeClasses2 = {
|
|
6494
|
+
sm: "w-5 h-5",
|
|
6495
|
+
md: "w-7 h-7",
|
|
6496
|
+
lg: "w-9 h-9"
|
|
6497
|
+
};
|
|
6498
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6499
|
+
"button",
|
|
6500
|
+
{
|
|
6501
|
+
ref,
|
|
6502
|
+
type: "button",
|
|
6503
|
+
"aria-pressed": selected,
|
|
6504
|
+
style: { backgroundColor: color, ...style },
|
|
6505
|
+
className: cn(
|
|
6506
|
+
"relative shrink-0 rounded-full border border-border/50 shadow-sm transition-transform hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary flex items-center justify-center text-white text-xs font-bold",
|
|
6507
|
+
sizeClasses2[size],
|
|
6508
|
+
selected && "ring-2 ring-primary ring-offset-2 ring-offset-surface",
|
|
6509
|
+
className
|
|
6510
|
+
),
|
|
6511
|
+
...props,
|
|
6512
|
+
children: selected && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "\u2713" })
|
|
6513
|
+
}
|
|
6514
|
+
);
|
|
6515
|
+
}
|
|
6516
|
+
);
|
|
5756
6517
|
ColorPickerSwatch.displayName = "ColorPickerSwatch";
|
|
5757
6518
|
var ColorPicker = React52__namespace.forwardRef(
|
|
5758
6519
|
({
|
|
@@ -5766,9 +6527,7 @@ var ColorPicker = React52__namespace.forwardRef(
|
|
|
5766
6527
|
...props
|
|
5767
6528
|
}, ref) => {
|
|
5768
6529
|
const isControlled = value !== void 0;
|
|
5769
|
-
const [localColor, setLocalColor] = React52__namespace.useState(
|
|
5770
|
-
normalizeHex(defaultValue)
|
|
5771
|
-
);
|
|
6530
|
+
const [localColor, setLocalColor] = React52__namespace.useState(normalizeHex(defaultValue));
|
|
5772
6531
|
const color = isControlled ? normalizeHex(value) : localColor;
|
|
5773
6532
|
const [hexInputValue, setHexInputValue] = React52__namespace.useState(color);
|
|
5774
6533
|
React52__namespace.useEffect(() => {
|
|
@@ -5906,14 +6665,16 @@ var ColorPicker = React52__namespace.forwardRef(
|
|
|
5906
6665
|
}
|
|
5907
6666
|
);
|
|
5908
6667
|
ColorPicker.displayName = "ColorPicker";
|
|
5909
|
-
var ColorPickerField = React52__namespace.forwardRef(
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
});
|
|
6668
|
+
var ColorPickerField = React52__namespace.forwardRef(
|
|
6669
|
+
({ label, hint, error, required, ...props }, ref) => {
|
|
6670
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Field, { children: [
|
|
6671
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(Label, { required, children: label }),
|
|
6672
|
+
/* @__PURE__ */ jsxRuntime.jsx(ColorPicker, { ref, ...props }),
|
|
6673
|
+
hint && /* @__PURE__ */ jsxRuntime.jsx(Hint, { children: hint }),
|
|
6674
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(Hint, { error: true, children: error })
|
|
6675
|
+
] });
|
|
6676
|
+
}
|
|
6677
|
+
);
|
|
5917
6678
|
ColorPickerField.displayName = "ColorPickerField";
|
|
5918
6679
|
var COLUMN_CLASSES = {
|
|
5919
6680
|
2: "grid-cols-2",
|
|
@@ -6038,7 +6799,20 @@ function ImageGallery({
|
|
|
6038
6799
|
onClick: handleClose,
|
|
6039
6800
|
"aria-label": "Close",
|
|
6040
6801
|
className: "p-2 rounded-full text-white/80 hover:text-white hover:bg-white/10 transition-colors cursor-pointer",
|
|
6041
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6802
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6803
|
+
"svg",
|
|
6804
|
+
{
|
|
6805
|
+
width: 20,
|
|
6806
|
+
height: 20,
|
|
6807
|
+
viewBox: "0 0 24 24",
|
|
6808
|
+
fill: "none",
|
|
6809
|
+
stroke: "currentColor",
|
|
6810
|
+
strokeWidth: 2.5,
|
|
6811
|
+
strokeLinecap: "round",
|
|
6812
|
+
strokeLinejoin: "round",
|
|
6813
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
6814
|
+
}
|
|
6815
|
+
)
|
|
6042
6816
|
}
|
|
6043
6817
|
)
|
|
6044
6818
|
] }),
|
|
@@ -6050,7 +6824,20 @@ function ImageGallery({
|
|
|
6050
6824
|
onClick: handlePrev,
|
|
6051
6825
|
"aria-label": "Previous image",
|
|
6052
6826
|
className: "p-3 rounded-full text-white/80 hover:text-white hover:bg-white/10 transition-colors cursor-pointer z-10 shrink-0",
|
|
6053
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6827
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6828
|
+
"svg",
|
|
6829
|
+
{
|
|
6830
|
+
width: 24,
|
|
6831
|
+
height: 24,
|
|
6832
|
+
viewBox: "0 0 24 24",
|
|
6833
|
+
fill: "none",
|
|
6834
|
+
stroke: "currentColor",
|
|
6835
|
+
strokeWidth: 2.5,
|
|
6836
|
+
strokeLinecap: "round",
|
|
6837
|
+
strokeLinejoin: "round",
|
|
6838
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 18-6-6 6-6" })
|
|
6839
|
+
}
|
|
6840
|
+
)
|
|
6054
6841
|
}
|
|
6055
6842
|
),
|
|
6056
6843
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex flex-col items-center justify-center h-full min-h-0 px-2 select-none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6068,7 +6855,20 @@ function ImageGallery({
|
|
|
6068
6855
|
onClick: handleNext,
|
|
6069
6856
|
"aria-label": "Next image",
|
|
6070
6857
|
className: "p-3 rounded-full text-white/80 hover:text-white hover:bg-white/10 transition-colors cursor-pointer z-10 shrink-0",
|
|
6071
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6858
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6859
|
+
"svg",
|
|
6860
|
+
{
|
|
6861
|
+
width: 24,
|
|
6862
|
+
height: 24,
|
|
6863
|
+
viewBox: "0 0 24 24",
|
|
6864
|
+
fill: "none",
|
|
6865
|
+
stroke: "currentColor",
|
|
6866
|
+
strokeWidth: 2.5,
|
|
6867
|
+
strokeLinecap: "round",
|
|
6868
|
+
strokeLinejoin: "round",
|
|
6869
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" })
|
|
6870
|
+
}
|
|
6871
|
+
)
|
|
6072
6872
|
}
|
|
6073
6873
|
)
|
|
6074
6874
|
] }),
|
|
@@ -6081,6 +6881,429 @@ function ImageGallery({
|
|
|
6081
6881
|
)
|
|
6082
6882
|
] });
|
|
6083
6883
|
}
|
|
6884
|
+
var OFFICIAL_SCRIPT_URL = "https://geowidget.easypack24.net/js/sdk-for-javascript.js";
|
|
6885
|
+
var OFFICIAL_CSS_URL = "https://geowidget.easypack24.net/css/easypack.css";
|
|
6886
|
+
var scriptPromise = null;
|
|
6887
|
+
function useInPostScript(options = {}) {
|
|
6888
|
+
const [isLoaded, setIsLoaded] = React52.useState(() => {
|
|
6889
|
+
if (typeof window === "undefined") return false;
|
|
6890
|
+
return !!(window.customElements?.get("inpost-geowidget") || window.easyPack);
|
|
6891
|
+
});
|
|
6892
|
+
const [error, setError] = React52.useState(null);
|
|
6893
|
+
const scriptUrl = options.customScriptUrl || OFFICIAL_SCRIPT_URL;
|
|
6894
|
+
const cssUrl = options.customCssUrl || OFFICIAL_CSS_URL;
|
|
6895
|
+
React52.useEffect(() => {
|
|
6896
|
+
if (typeof window === "undefined") return;
|
|
6897
|
+
if (window.customElements?.get("inpost-geowidget") || window.easyPack) {
|
|
6898
|
+
return;
|
|
6899
|
+
}
|
|
6900
|
+
let linkTag = document.querySelector(`link[href="${cssUrl}"]`);
|
|
6901
|
+
if (!linkTag) {
|
|
6902
|
+
linkTag = document.createElement("link");
|
|
6903
|
+
linkTag.rel = "stylesheet";
|
|
6904
|
+
linkTag.href = cssUrl;
|
|
6905
|
+
linkTag.type = "text/css";
|
|
6906
|
+
document.head.appendChild(linkTag);
|
|
6907
|
+
}
|
|
6908
|
+
if (!scriptPromise) {
|
|
6909
|
+
scriptPromise = new Promise((resolve, reject) => {
|
|
6910
|
+
let scriptTag = document.querySelector(
|
|
6911
|
+
`script[src="${scriptUrl}"]`
|
|
6912
|
+
);
|
|
6913
|
+
if (!scriptTag) {
|
|
6914
|
+
scriptTag = document.createElement("script");
|
|
6915
|
+
scriptTag.src = scriptUrl;
|
|
6916
|
+
scriptTag.async = true;
|
|
6917
|
+
document.head.appendChild(scriptTag);
|
|
6918
|
+
}
|
|
6919
|
+
scriptTag.addEventListener("load", () => resolve());
|
|
6920
|
+
scriptTag.addEventListener(
|
|
6921
|
+
"error",
|
|
6922
|
+
(err) => reject(
|
|
6923
|
+
err instanceof Error ? err : new Error("Failed to load InPost GeoWidget SDK script")
|
|
6924
|
+
)
|
|
6925
|
+
);
|
|
6926
|
+
});
|
|
6927
|
+
}
|
|
6928
|
+
scriptPromise.then(async () => {
|
|
6929
|
+
if (typeof window !== "undefined" && window.customElements?.whenDefined) {
|
|
6930
|
+
try {
|
|
6931
|
+
await Promise.race([
|
|
6932
|
+
window.customElements.whenDefined("inpost-geowidget"),
|
|
6933
|
+
new Promise((r) => setTimeout(r, 100))
|
|
6934
|
+
]);
|
|
6935
|
+
} catch {
|
|
6936
|
+
}
|
|
6937
|
+
}
|
|
6938
|
+
setIsLoaded(true);
|
|
6939
|
+
}).catch((err) => {
|
|
6940
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
6941
|
+
});
|
|
6942
|
+
}, [scriptUrl, cssUrl]);
|
|
6943
|
+
return { isLoaded, error };
|
|
6944
|
+
}
|
|
6945
|
+
var MOCK_POINTS = [
|
|
6946
|
+
{
|
|
6947
|
+
name: "WAW01M",
|
|
6948
|
+
address: { line1: "ul. Towarowa 5", line2: "00-838 Warszawa" },
|
|
6949
|
+
address_details: {
|
|
6950
|
+
city: "Warszawa",
|
|
6951
|
+
street: "Towarowa",
|
|
6952
|
+
building_number: "5",
|
|
6953
|
+
post_code: "00-838"
|
|
6954
|
+
},
|
|
6955
|
+
location: { latitude: 52.2297, longitude: 21.0122 },
|
|
6956
|
+
type: ["parcel_locker"],
|
|
6957
|
+
status: "Operating",
|
|
6958
|
+
location_description: "Przy stacji benzynowej BP"
|
|
6959
|
+
},
|
|
6960
|
+
{
|
|
6961
|
+
name: "KRA02N",
|
|
6962
|
+
address: { line1: "ul. Floria\u0144ska 12", line2: "31-021 Krak\xF3w" },
|
|
6963
|
+
address_details: {
|
|
6964
|
+
city: "Krak\xF3w",
|
|
6965
|
+
street: "Floria\u0144ska",
|
|
6966
|
+
building_number: "12",
|
|
6967
|
+
post_code: "31-021"
|
|
6968
|
+
},
|
|
6969
|
+
location: { latitude: 50.0647, longitude: 19.945 },
|
|
6970
|
+
type: ["parcel_locker"],
|
|
6971
|
+
status: "Operating",
|
|
6972
|
+
location_description: "Obok wej\u015Bcia do sklepu"
|
|
6973
|
+
},
|
|
6974
|
+
{
|
|
6975
|
+
name: "GDA03P",
|
|
6976
|
+
address: { line1: "ul. D\u0142uga 8", line2: "80-827 Gda\u0144sk" },
|
|
6977
|
+
address_details: { city: "Gda\u0144sk", street: "D\u0142uga", building_number: "8", post_code: "80-827" },
|
|
6978
|
+
location: { latitude: 54.352, longitude: 18.6466 },
|
|
6979
|
+
type: ["parcel_locker"],
|
|
6980
|
+
status: "Operating",
|
|
6981
|
+
location_description: "R\xF3g ulicy D\u0142ugiej i Tkackiej"
|
|
6982
|
+
},
|
|
6983
|
+
{
|
|
6984
|
+
name: "POZ04S",
|
|
6985
|
+
address: { line1: "ul. P\xF3\u0142wiejska 42", line2: "61-888 Pozna\u0144" },
|
|
6986
|
+
address_details: {
|
|
6987
|
+
city: "Pozna\u0144",
|
|
6988
|
+
street: "P\xF3\u0142wiejska",
|
|
6989
|
+
building_number: "42",
|
|
6990
|
+
post_code: "61-888"
|
|
6991
|
+
},
|
|
6992
|
+
location: { latitude: 52.4064, longitude: 16.9252 },
|
|
6993
|
+
type: ["parcel_locker"],
|
|
6994
|
+
status: "Operating",
|
|
6995
|
+
location_description: "Przy centrum handlowym Stary Browar"
|
|
6996
|
+
}
|
|
6997
|
+
];
|
|
6998
|
+
var InPostGeowidget = ({
|
|
6999
|
+
token,
|
|
7000
|
+
language = "pl",
|
|
7001
|
+
config = "parcelCollect",
|
|
7002
|
+
sandbox = false,
|
|
7003
|
+
onPointSelect,
|
|
7004
|
+
onReady,
|
|
7005
|
+
onError,
|
|
7006
|
+
className,
|
|
7007
|
+
style,
|
|
7008
|
+
customScriptUrl,
|
|
7009
|
+
customCssUrl
|
|
7010
|
+
}) => {
|
|
7011
|
+
const { isLoaded, error } = useInPostScript({
|
|
7012
|
+
customScriptUrl,
|
|
7013
|
+
customCssUrl
|
|
7014
|
+
});
|
|
7015
|
+
const [searchQuery, setSearchQuery] = React52.useState("");
|
|
7016
|
+
const [selectedMock, setSelectedMock] = React52.useState(null);
|
|
7017
|
+
const widgetRef = React52.useRef(null);
|
|
7018
|
+
const callbackNameRef = React52.useRef(`inpost_cb_${Math.random().toString(36).substring(2, 9)}`);
|
|
7019
|
+
React52.useEffect(() => {
|
|
7020
|
+
if (error && onError) {
|
|
7021
|
+
onError(error);
|
|
7022
|
+
}
|
|
7023
|
+
}, [error, onError]);
|
|
7024
|
+
React52.useEffect(() => {
|
|
7025
|
+
if (isLoaded && onReady) {
|
|
7026
|
+
onReady();
|
|
7027
|
+
}
|
|
7028
|
+
}, [isLoaded, onReady]);
|
|
7029
|
+
React52.useEffect(() => {
|
|
7030
|
+
if (!token) return;
|
|
7031
|
+
const cbName = callbackNameRef.current;
|
|
7032
|
+
window[cbName] = (point) => {
|
|
7033
|
+
if (onPointSelect) {
|
|
7034
|
+
onPointSelect(point);
|
|
7035
|
+
}
|
|
7036
|
+
};
|
|
7037
|
+
const el = widgetRef.current;
|
|
7038
|
+
const handlePointSelect = (event) => {
|
|
7039
|
+
const customEv = event;
|
|
7040
|
+
const point = customEv.detail || customEv.point;
|
|
7041
|
+
if (point && onPointSelect) {
|
|
7042
|
+
onPointSelect(point);
|
|
7043
|
+
}
|
|
7044
|
+
};
|
|
7045
|
+
if (el) {
|
|
7046
|
+
el.addEventListener("inpostgeowidget", handlePointSelect);
|
|
7047
|
+
el.addEventListener("onpointselect", handlePointSelect);
|
|
7048
|
+
}
|
|
7049
|
+
document.addEventListener("onpointselect", handlePointSelect);
|
|
7050
|
+
return () => {
|
|
7051
|
+
delete window[cbName];
|
|
7052
|
+
if (el) {
|
|
7053
|
+
el.removeEventListener("inpostgeowidget", handlePointSelect);
|
|
7054
|
+
el.removeEventListener("onpointselect", handlePointSelect);
|
|
7055
|
+
}
|
|
7056
|
+
document.removeEventListener("onpointselect", handlePointSelect);
|
|
7057
|
+
};
|
|
7058
|
+
}, [onPointSelect, isLoaded, token]);
|
|
7059
|
+
if (error) {
|
|
7060
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7061
|
+
"div",
|
|
7062
|
+
{
|
|
7063
|
+
className: `flex flex-col items-center justify-center min-h-[450px] bg-danger/10 border-2 border-danger rounded-xl p-6 text-center ${className || ""}`,
|
|
7064
|
+
style,
|
|
7065
|
+
children: [
|
|
7066
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base font-extrabold text-danger mb-1", children: "B\u0142\u0105d \u0142adowania Geowidget InPost" }),
|
|
7067
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground font-semibold max-w-sm", children: "Nie uda\u0142o si\u0119 pobra\u0107 skryptu mapy z serwera InPost. Sprawd\u017A po\u0142\u0105czenie z sieci\u0105." })
|
|
7068
|
+
]
|
|
7069
|
+
}
|
|
7070
|
+
);
|
|
7071
|
+
}
|
|
7072
|
+
if (!token) {
|
|
7073
|
+
const filteredPoints = MOCK_POINTS.filter(
|
|
7074
|
+
(p) => p.name.toLowerCase().includes(searchQuery.toLowerCase()) || p.address.line1.toLowerCase().includes(searchQuery.toLowerCase()) || p.address_details.city.toLowerCase().includes(searchQuery.toLowerCase())
|
|
7075
|
+
);
|
|
7076
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7077
|
+
"div",
|
|
7078
|
+
{
|
|
7079
|
+
className: `flex flex-col h-full min-h-[500px] bg-surface border-2 border-border rounded-xl p-4 font-sans text-foreground ${className || ""}`,
|
|
7080
|
+
style,
|
|
7081
|
+
children: [
|
|
7082
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-gradient-to-r from-amber-400 via-amber-500 to-yellow-500 text-slate-950 rounded-xl p-4 mb-3.5 shadow-sm flex flex-col gap-1 border border-amber-600/30", children: [
|
|
7083
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
7084
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7085
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-2.5 h-2.5 rounded-full bg-slate-950 animate-pulse" }),
|
|
7086
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-black text-sm tracking-tight uppercase", children: "InPost Paczkomat\xAE" })
|
|
7087
|
+
] }),
|
|
7088
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.7rem] font-black bg-slate-950 text-amber-400 px-2.5 py-0.5 rounded-md uppercase tracking-wider shadow-sm", children: "Tryb Pokazowy" })
|
|
7089
|
+
] }),
|
|
7090
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-slate-950 font-bold leading-relaxed opacity-95", children: [
|
|
7091
|
+
"Wybierz punkt z listy poni\u017Cej. Do za\u0142adowania produkcyjnej mapy przeka\u017C prop",
|
|
7092
|
+
" ",
|
|
7093
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { className: "bg-slate-950 text-amber-400 px-1.5 py-0.5 rounded font-mono text-[0.72rem] font-black", children: 'token="TWOJ_TOKEN"' }),
|
|
7094
|
+
"."
|
|
7095
|
+
] })
|
|
7096
|
+
] }),
|
|
7097
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3.5 relative", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7098
|
+
"input",
|
|
7099
|
+
{
|
|
7100
|
+
type: "text",
|
|
7101
|
+
placeholder: "Szukaj Paczkomatu (np. Warszawa, WAW01M, Towarowa)...",
|
|
7102
|
+
value: searchQuery,
|
|
7103
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
7104
|
+
className: "w-full px-4 py-2.5 text-sm bg-surface border-2 border-border rounded-xl outline-none text-foreground placeholder:text-muted-foreground font-bold focus:border-primary focus:ring-2 focus:ring-primary/20 shadow-sm transition-all"
|
|
7105
|
+
}
|
|
7106
|
+
) }),
|
|
7107
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto space-y-3 pr-1 max-h-[420px]", children: filteredPoints.map((p) => {
|
|
7108
|
+
const isSelected = selectedMock?.name === p.name;
|
|
7109
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7110
|
+
"div",
|
|
7111
|
+
{
|
|
7112
|
+
onClick: () => {
|
|
7113
|
+
setSelectedMock(p);
|
|
7114
|
+
if (onPointSelect) {
|
|
7115
|
+
onPointSelect(p);
|
|
7116
|
+
}
|
|
7117
|
+
},
|
|
7118
|
+
className: `p-4 rounded-xl border-2 transition-all cursor-pointer flex items-center justify-between gap-3 ${isSelected ? "bg-primary text-primary-foreground border-primary shadow-md" : "bg-surface border-border hover:border-primary hover:shadow-md text-foreground"}`,
|
|
7119
|
+
children: [
|
|
7120
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
7121
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-black text-base flex items-center gap-2", children: [
|
|
7122
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7123
|
+
"span",
|
|
7124
|
+
{
|
|
7125
|
+
className: isSelected ? "text-primary-foreground font-black" : "text-foreground font-black",
|
|
7126
|
+
children: [
|
|
7127
|
+
"Paczkomat\xAE ",
|
|
7128
|
+
p.name
|
|
7129
|
+
]
|
|
7130
|
+
}
|
|
7131
|
+
),
|
|
7132
|
+
p.location_description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7133
|
+
"span",
|
|
7134
|
+
{
|
|
7135
|
+
className: `text-[0.72rem] px-2.5 py-0.5 rounded-full font-bold ${isSelected ? "bg-primary-hover text-primary-foreground" : "bg-muted text-primary"}`,
|
|
7136
|
+
children: p.location_description
|
|
7137
|
+
}
|
|
7138
|
+
)
|
|
7139
|
+
] }),
|
|
7140
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7141
|
+
"div",
|
|
7142
|
+
{
|
|
7143
|
+
className: `text-xs font-bold ${isSelected ? "text-primary-foreground/90" : "text-muted-foreground"}`,
|
|
7144
|
+
children: [
|
|
7145
|
+
p.address.line1,
|
|
7146
|
+
", ",
|
|
7147
|
+
p.address.line2
|
|
7148
|
+
]
|
|
7149
|
+
}
|
|
7150
|
+
)
|
|
7151
|
+
] }),
|
|
7152
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7153
|
+
"button",
|
|
7154
|
+
{
|
|
7155
|
+
type: "button",
|
|
7156
|
+
className: `px-4 py-2 rounded-lg text-xs font-black shrink-0 transition-all shadow-sm ${isSelected ? "bg-amber-400 text-slate-950 border border-amber-500" : "bg-primary hover:bg-primary-hover text-primary-foreground"}`,
|
|
7157
|
+
children: isSelected ? "Wybrano \u2713" : "Wybierz"
|
|
7158
|
+
}
|
|
7159
|
+
)
|
|
7160
|
+
]
|
|
7161
|
+
},
|
|
7162
|
+
p.name
|
|
7163
|
+
);
|
|
7164
|
+
}) })
|
|
7165
|
+
]
|
|
7166
|
+
}
|
|
7167
|
+
);
|
|
7168
|
+
}
|
|
7169
|
+
if (!isLoaded) {
|
|
7170
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7171
|
+
"div",
|
|
7172
|
+
{
|
|
7173
|
+
className: `flex items-center justify-center min-h-[450px] bg-surface border-2 border-border rounded-xl p-6 ${className || ""}`,
|
|
7174
|
+
style,
|
|
7175
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 text-muted-foreground", children: [
|
|
7176
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-9 h-9 border-4 border-primary border-t-transparent rounded-full animate-spin" }),
|
|
7177
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-extrabold text-foreground", children: "\u0141adowanie mapy InPost GeoWidget..." })
|
|
7178
|
+
] })
|
|
7179
|
+
}
|
|
7180
|
+
);
|
|
7181
|
+
}
|
|
7182
|
+
const widgetProps = {
|
|
7183
|
+
language,
|
|
7184
|
+
config: String(config).toLowerCase(),
|
|
7185
|
+
// eslint-disable-next-line react-hooks/refs
|
|
7186
|
+
onpointselect: callbackNameRef.current
|
|
7187
|
+
};
|
|
7188
|
+
if (token) {
|
|
7189
|
+
widgetProps.token = token;
|
|
7190
|
+
}
|
|
7191
|
+
if (sandbox) {
|
|
7192
|
+
widgetProps.sandbox = "true";
|
|
7193
|
+
}
|
|
7194
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-full h-full min-h-[450px] relative ${className || ""}`, style, children: React52__namespace.default.createElement("inpost-geowidget", {
|
|
7195
|
+
ref: widgetRef,
|
|
7196
|
+
...widgetProps,
|
|
7197
|
+
style: { width: "100%", height: "100%", display: "block", minHeight: "450px" }
|
|
7198
|
+
}) });
|
|
7199
|
+
};
|
|
7200
|
+
var InPostGeowidgetModal = ({
|
|
7201
|
+
value,
|
|
7202
|
+
onSelect,
|
|
7203
|
+
triggerText = "Wybierz Paczkomat\xAE",
|
|
7204
|
+
modalTitle = "Wybierz punkt odbioru InPost",
|
|
7205
|
+
disabled = false,
|
|
7206
|
+
open: controlledOpen,
|
|
7207
|
+
onOpenChange,
|
|
7208
|
+
showSelectedBadge = true,
|
|
7209
|
+
className = "",
|
|
7210
|
+
buttonVariant = "outline",
|
|
7211
|
+
buttonSize = "md",
|
|
7212
|
+
token,
|
|
7213
|
+
language,
|
|
7214
|
+
config,
|
|
7215
|
+
sandbox,
|
|
7216
|
+
customScriptUrl,
|
|
7217
|
+
customCssUrl
|
|
7218
|
+
}) => {
|
|
7219
|
+
const [internalOpen, setInternalOpen] = React52.useState(false);
|
|
7220
|
+
const [selectedPoint, setSelectedPoint] = React52.useState(
|
|
7221
|
+
typeof value === "object" && value ? value : null
|
|
7222
|
+
);
|
|
7223
|
+
const isControlled = controlledOpen !== void 0;
|
|
7224
|
+
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
7225
|
+
const handleOpenToggle = (newOpen) => {
|
|
7226
|
+
if (!isControlled) {
|
|
7227
|
+
setInternalOpen(newOpen);
|
|
7228
|
+
}
|
|
7229
|
+
if (onOpenChange) {
|
|
7230
|
+
onOpenChange(newOpen);
|
|
7231
|
+
}
|
|
7232
|
+
};
|
|
7233
|
+
const handlePointSelect = (point) => {
|
|
7234
|
+
setSelectedPoint(point);
|
|
7235
|
+
if (onSelect) {
|
|
7236
|
+
onSelect(point);
|
|
7237
|
+
}
|
|
7238
|
+
handleOpenToggle(false);
|
|
7239
|
+
};
|
|
7240
|
+
const selectedCode = selectedPoint?.name || (typeof value === "string" ? value : null);
|
|
7241
|
+
const selectedAddress = selectedPoint ? `${selectedPoint.address?.line1 || ""}, ${selectedPoint.address?.line2 || ""}` : null;
|
|
7242
|
+
const isOutline = buttonVariant === "outline";
|
|
7243
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `inline-flex flex-col gap-3 min-w-[280px] ${className}`, children: [
|
|
7244
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7245
|
+
Button,
|
|
7246
|
+
{
|
|
7247
|
+
type: "button",
|
|
7248
|
+
variant: buttonVariant,
|
|
7249
|
+
size: buttonSize,
|
|
7250
|
+
disabled,
|
|
7251
|
+
onClick: () => handleOpenToggle(true),
|
|
7252
|
+
className: `group w-full justify-between gap-4 text-left font-bold shadow-sm hover:shadow-md transition-all py-2.5 px-3.5 rounded-xl ${isOutline ? "bg-surface hover:bg-muted text-foreground border-2 border-border hover:border-primary" : "border-2 border-transparent"}`,
|
|
7253
|
+
children: [
|
|
7254
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2.5 min-w-0", children: [
|
|
7255
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-black text-[0.7rem] bg-amber-400 text-slate-950 px-2.5 py-1 rounded-md shadow-sm tracking-tight uppercase border border-amber-500/40 shrink-0 group-hover:scale-105 transition-transform", children: "InPost" }),
|
|
7256
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7257
|
+
"span",
|
|
7258
|
+
{
|
|
7259
|
+
className: `truncate font-bold text-sm ${isOutline ? "text-foreground group-hover:text-primary" : ""}`,
|
|
7260
|
+
children: selectedCode ? `Paczkomat\xAE ${selectedCode}` : triggerText
|
|
7261
|
+
}
|
|
7262
|
+
)
|
|
7263
|
+
] }),
|
|
7264
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7265
|
+
"span",
|
|
7266
|
+
{
|
|
7267
|
+
className: `text-xs font-black px-2.5 py-1 rounded-md shrink-0 shadow-sm uppercase tracking-wide transition-all ${isOutline ? "bg-primary text-primary-foreground group-hover:bg-primary-hover" : "bg-amber-400 text-slate-950"}`,
|
|
7268
|
+
children: selectedCode ? "Zmie\u0144" : "Wybierz"
|
|
7269
|
+
}
|
|
7270
|
+
)
|
|
7271
|
+
]
|
|
7272
|
+
}
|
|
7273
|
+
),
|
|
7274
|
+
showSelectedBadge && selectedCode && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs bg-surface text-foreground border-2 border-border p-3.5 rounded-xl flex flex-col gap-1.5 shadow-md", children: [
|
|
7275
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-bold flex items-center justify-between gap-2", children: [
|
|
7276
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2 text-foreground", children: [
|
|
7277
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-2.5 h-2.5 rounded-full bg-primary shadow-sm animate-pulse" }),
|
|
7278
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-black text-sm text-primary", children: [
|
|
7279
|
+
"Paczkomat\xAE ",
|
|
7280
|
+
selectedCode
|
|
7281
|
+
] })
|
|
7282
|
+
] }),
|
|
7283
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.65rem] bg-amber-400 text-slate-950 font-black px-2 py-0.5 rounded uppercase tracking-wider", children: "Wybrany" })
|
|
7284
|
+
] }),
|
|
7285
|
+
selectedAddress && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground text-[0.78rem] font-medium pl-4 border-l-2 border-border", children: selectedAddress })
|
|
7286
|
+
] }),
|
|
7287
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Modal, { open: isOpen, onClose: () => handleOpenToggle(false), width: 850, children: [
|
|
7288
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 pb-3.5 border-b border-border", children: [
|
|
7289
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-black text-xs bg-amber-400 text-slate-950 px-2.5 py-1 rounded-md shadow-sm tracking-tight uppercase border border-amber-500/40 shrink-0", children: "InPost" }),
|
|
7290
|
+
/* @__PURE__ */ jsxRuntime.jsx(ModalTitle, { className: "m-0 text-xl font-black text-primary tracking-tight", children: modalTitle })
|
|
7291
|
+
] }),
|
|
7292
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-[600px] min-h-[500px] mt-3.5 rounded-xl overflow-hidden", children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7293
|
+
InPostGeowidget,
|
|
7294
|
+
{
|
|
7295
|
+
token,
|
|
7296
|
+
language,
|
|
7297
|
+
config,
|
|
7298
|
+
sandbox,
|
|
7299
|
+
customScriptUrl,
|
|
7300
|
+
customCssUrl,
|
|
7301
|
+
onPointSelect: handlePointSelect
|
|
7302
|
+
}
|
|
7303
|
+
) })
|
|
7304
|
+
] })
|
|
7305
|
+
] });
|
|
7306
|
+
};
|
|
6084
7307
|
|
|
6085
7308
|
exports.Accordion = Accordion;
|
|
6086
7309
|
exports.AccordionContent = AccordionContent;
|
|
@@ -6148,6 +7371,8 @@ exports.FileUploadField = FileUploadField;
|
|
|
6148
7371
|
exports.FormField = FormField;
|
|
6149
7372
|
exports.Hint = Hint;
|
|
6150
7373
|
exports.ImageGallery = ImageGallery;
|
|
7374
|
+
exports.InPostGeowidget = InPostGeowidget;
|
|
7375
|
+
exports.InPostGeowidgetModal = InPostGeowidgetModal;
|
|
6151
7376
|
exports.InboxContent = InboxContent;
|
|
6152
7377
|
exports.InboxPopover = InboxPopover;
|
|
6153
7378
|
exports.InboxTrigger = InboxTrigger;
|
|
@@ -6230,6 +7455,7 @@ exports.hslToHex = hslToHex;
|
|
|
6230
7455
|
exports.isValidHex = isValidHex;
|
|
6231
7456
|
exports.normalizeHex = normalizeHex;
|
|
6232
7457
|
exports.sliderThumbCSS = sliderThumbCSS;
|
|
7458
|
+
exports.useInPostScript = useInPostScript;
|
|
6233
7459
|
exports.useInboxState = useInboxState;
|
|
6234
7460
|
exports.useStepper = useStepper;
|
|
6235
7461
|
exports.useToast = useToast;
|