@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.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
import * as React52 from 'react';
|
|
5
|
+
import React52__default, { useState, useEffect, useRef } from 'react';
|
|
5
6
|
import { cva } from 'class-variance-authority';
|
|
6
7
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
8
|
|
|
@@ -93,20 +94,17 @@ var Badge = React52.forwardRef(
|
|
|
93
94
|
] })
|
|
94
95
|
);
|
|
95
96
|
Badge.displayName = "Badge";
|
|
96
|
-
var alertVariants = cva(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
defaultVariants: { variant: "info" }
|
|
108
|
-
}
|
|
109
|
-
);
|
|
97
|
+
var alertVariants = cva("flex gap-3 items-start p-[0.9rem_1.1rem] rounded-kj-md border text-sm", {
|
|
98
|
+
variants: {
|
|
99
|
+
variant: {
|
|
100
|
+
info: "bg-info-surface border-info/30",
|
|
101
|
+
success: "bg-success-surface border-success/30",
|
|
102
|
+
warning: "bg-warning-surface border-warning/30",
|
|
103
|
+
danger: "bg-danger-surface border-danger/30"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
defaultVariants: { variant: "info" }
|
|
107
|
+
});
|
|
110
108
|
var iconColor = {
|
|
111
109
|
info: "text-info",
|
|
112
110
|
success: "text-success",
|
|
@@ -115,7 +113,16 @@ var iconColor = {
|
|
|
115
113
|
};
|
|
116
114
|
var Alert = React52.forwardRef(
|
|
117
115
|
({ className, variant = "info", icon, title, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", { ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props, children: [
|
|
118
|
-
icon && /* @__PURE__ */ jsx(
|
|
116
|
+
icon && /* @__PURE__ */ jsx(
|
|
117
|
+
"span",
|
|
118
|
+
{
|
|
119
|
+
className: cn(
|
|
120
|
+
"shrink-0 mt-0.5 [&_svg]:h-[1.15rem] [&_svg]:w-[1.15rem]",
|
|
121
|
+
iconColor[variant ?? "info"]
|
|
122
|
+
),
|
|
123
|
+
children: icon
|
|
124
|
+
}
|
|
125
|
+
),
|
|
119
126
|
/* @__PURE__ */ jsxs("div", { className: "text-foreground", children: [
|
|
120
127
|
title && /* @__PURE__ */ jsx("p", { className: "font-bold m-0 mb-0.5 text-sm", children: title }),
|
|
121
128
|
children && /* @__PURE__ */ jsx("p", { className: "m-0 opacity-85", children })
|
|
@@ -171,10 +178,18 @@ var Progress = React52.forwardRef(
|
|
|
171
178
|
);
|
|
172
179
|
Progress.displayName = "Progress";
|
|
173
180
|
var Label = React52.forwardRef(
|
|
174
|
-
({ className, required, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
181
|
+
({ className, required, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
182
|
+
"label",
|
|
183
|
+
{
|
|
184
|
+
ref,
|
|
185
|
+
className: cn("text-[0.8rem] font-semibold text-foreground", className),
|
|
186
|
+
...props,
|
|
187
|
+
children: [
|
|
188
|
+
children,
|
|
189
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-danger", children: " *" })
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
)
|
|
178
193
|
);
|
|
179
194
|
Label.displayName = "Label";
|
|
180
195
|
var Hint = React52.forwardRef(
|
|
@@ -200,11 +215,7 @@ var FormField = React52.forwardRef(
|
|
|
200
215
|
const child = React52.Children.only(children);
|
|
201
216
|
const clonedChild = React52.cloneElement(child, {
|
|
202
217
|
id: child.props.id ?? id,
|
|
203
|
-
"aria-describedby": cn(
|
|
204
|
-
hint && hintId,
|
|
205
|
-
error && errorId,
|
|
206
|
-
child.props["aria-describedby"]
|
|
207
|
-
) || void 0,
|
|
218
|
+
"aria-describedby": cn(hint && hintId, error && errorId, child.props["aria-describedby"]) || void 0,
|
|
208
219
|
"aria-invalid": error ? "true" : void 0,
|
|
209
220
|
required: child.props.required ?? required
|
|
210
221
|
});
|
|
@@ -340,11 +351,21 @@ var ProgressRing = React52.forwardRef(
|
|
|
340
351
|
ProgressRing.displayName = "ProgressRing";
|
|
341
352
|
var ProgressRingField = React52.forwardRef(
|
|
342
353
|
({ label, hint, error, required, fieldClassName, ...ringProps }, ref) => {
|
|
343
|
-
return /* @__PURE__ */ jsx(
|
|
354
|
+
return /* @__PURE__ */ jsx(
|
|
355
|
+
FormField,
|
|
356
|
+
{
|
|
357
|
+
label,
|
|
358
|
+
hint,
|
|
359
|
+
error,
|
|
360
|
+
required,
|
|
361
|
+
className: fieldClassName,
|
|
362
|
+
children: /* @__PURE__ */ jsx(ProgressRing, { ref, "aria-label": ringProps["aria-label"] ?? label, ...ringProps })
|
|
363
|
+
}
|
|
364
|
+
);
|
|
344
365
|
}
|
|
345
366
|
);
|
|
346
367
|
ProgressRingField.displayName = "ProgressRingField";
|
|
347
|
-
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";
|
|
368
|
+
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";
|
|
348
369
|
var Input = React52.forwardRef(
|
|
349
370
|
({ className, error, leadingIcon, ...props }, ref) => {
|
|
350
371
|
const field = /* @__PURE__ */ jsx(
|
|
@@ -432,11 +453,33 @@ var Checkbox = React52.forwardRef(
|
|
|
432
453
|
({ className, label, id, ...props }, ref) => {
|
|
433
454
|
const autoId = React52.useId();
|
|
434
455
|
const inputId = id ?? autoId;
|
|
435
|
-
return /* @__PURE__ */ jsxs(
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
456
|
+
return /* @__PURE__ */ jsxs(
|
|
457
|
+
"label",
|
|
458
|
+
{
|
|
459
|
+
htmlFor: inputId,
|
|
460
|
+
className: cn(
|
|
461
|
+
"inline-flex items-center gap-2.5 cursor-pointer text-sm select-none",
|
|
462
|
+
className
|
|
463
|
+
),
|
|
464
|
+
children: [
|
|
465
|
+
/* @__PURE__ */ jsx("input", { ref, id: inputId, type: "checkbox", className: "peer sr-only", ...props }),
|
|
466
|
+
/* @__PURE__ */ 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__ */ jsx(
|
|
467
|
+
"svg",
|
|
468
|
+
{
|
|
469
|
+
viewBox: "0 0 24 24",
|
|
470
|
+
fill: "none",
|
|
471
|
+
stroke: "currentColor",
|
|
472
|
+
strokeWidth: 3,
|
|
473
|
+
strokeLinecap: "round",
|
|
474
|
+
strokeLinejoin: "round",
|
|
475
|
+
className: "h-3 w-3 text-primary-foreground opacity-0 scale-50 transition-all duration-150",
|
|
476
|
+
children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
|
|
477
|
+
}
|
|
478
|
+
) }),
|
|
479
|
+
label
|
|
480
|
+
]
|
|
481
|
+
}
|
|
482
|
+
);
|
|
440
483
|
}
|
|
441
484
|
);
|
|
442
485
|
Checkbox.displayName = "Checkbox";
|
|
@@ -444,11 +487,21 @@ var Radio = React52.forwardRef(
|
|
|
444
487
|
({ className, label, id, ...props }, ref) => {
|
|
445
488
|
const autoId = React52.useId();
|
|
446
489
|
const inputId = id ?? autoId;
|
|
447
|
-
return /* @__PURE__ */ jsxs(
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
490
|
+
return /* @__PURE__ */ jsxs(
|
|
491
|
+
"label",
|
|
492
|
+
{
|
|
493
|
+
htmlFor: inputId,
|
|
494
|
+
className: cn(
|
|
495
|
+
"inline-flex items-center gap-2.5 cursor-pointer text-sm select-none",
|
|
496
|
+
className
|
|
497
|
+
),
|
|
498
|
+
children: [
|
|
499
|
+
/* @__PURE__ */ jsx("input", { ref, id: inputId, type: "radio", className: "peer sr-only", ...props }),
|
|
500
|
+
/* @__PURE__ */ 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__ */ jsx("span", { className: "h-2 w-2 rounded-full bg-primary-foreground opacity-0 scale-[0.4] transition-all duration-150" }) }),
|
|
501
|
+
label
|
|
502
|
+
]
|
|
503
|
+
}
|
|
504
|
+
);
|
|
452
505
|
}
|
|
453
506
|
);
|
|
454
507
|
Radio.displayName = "Radio";
|
|
@@ -479,19 +532,37 @@ var Switch = React52.forwardRef(
|
|
|
479
532
|
({ className, label, id, ...props }, ref) => {
|
|
480
533
|
const autoId = React52.useId();
|
|
481
534
|
const inputId = id ?? autoId;
|
|
482
|
-
return /* @__PURE__ */ jsxs(
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
535
|
+
return /* @__PURE__ */ jsxs(
|
|
536
|
+
"label",
|
|
537
|
+
{
|
|
538
|
+
htmlFor: inputId,
|
|
539
|
+
className: cn(
|
|
540
|
+
"inline-flex items-center gap-2.5 cursor-pointer text-sm select-none",
|
|
541
|
+
className
|
|
542
|
+
),
|
|
543
|
+
children: [
|
|
544
|
+
/* @__PURE__ */ jsx(
|
|
545
|
+
"input",
|
|
546
|
+
{
|
|
547
|
+
ref,
|
|
548
|
+
id: inputId,
|
|
549
|
+
type: "checkbox",
|
|
550
|
+
role: "switch",
|
|
551
|
+
className: "peer sr-only",
|
|
552
|
+
...props
|
|
553
|
+
}
|
|
554
|
+
),
|
|
555
|
+
/* @__PURE__ */ 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]" }),
|
|
556
|
+
label
|
|
557
|
+
]
|
|
558
|
+
}
|
|
559
|
+
);
|
|
487
560
|
}
|
|
488
561
|
);
|
|
489
562
|
Switch.displayName = "Switch";
|
|
490
563
|
var Slider = React52.forwardRef(
|
|
491
564
|
({ className, style, value, defaultValue, min = 0, max = 100, onChange, ...props }, ref) => {
|
|
492
|
-
const [localValue, setLocalValue] = React52.useState(
|
|
493
|
-
Number(defaultValue ?? value ?? 50)
|
|
494
|
-
);
|
|
565
|
+
const [localValue, setLocalValue] = React52.useState(Number(defaultValue ?? value ?? 50));
|
|
495
566
|
const isControlled = value !== void 0;
|
|
496
567
|
const currentVal = isControlled ? Number(value) : localValue;
|
|
497
568
|
const numMin = Number(min);
|
|
@@ -628,13 +699,9 @@ var CardHeader = React52.forwardRef(
|
|
|
628
699
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-[1.35rem] flex flex-col gap-1", className), ...props })
|
|
629
700
|
);
|
|
630
701
|
CardHeader.displayName = "CardHeader";
|
|
631
|
-
var CardTitle = React52.forwardRef(
|
|
632
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("h3", { ref, className: cn("m-0 text-base font-bold tracking-[-0.01em]", className), ...props, children })
|
|
633
|
-
);
|
|
702
|
+
var CardTitle = React52.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("h3", { ref, className: cn("m-0 text-base font-bold tracking-[-0.01em]", className), ...props, children }));
|
|
634
703
|
CardTitle.displayName = "CardTitle";
|
|
635
|
-
var CardDescription = React52.forwardRef(
|
|
636
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("m-0 text-[0.85rem] text-muted-foreground", className), ...props })
|
|
637
|
-
);
|
|
704
|
+
var CardDescription = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("m-0 text-[0.85rem] text-muted-foreground", className), ...props }));
|
|
638
705
|
CardDescription.displayName = "CardDescription";
|
|
639
706
|
var CardContent = React52.forwardRef(
|
|
640
707
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("px-[1.35rem] pb-[1.35rem]", className), ...props })
|
|
@@ -645,7 +712,10 @@ var CardFooter = React52.forwardRef(
|
|
|
645
712
|
"div",
|
|
646
713
|
{
|
|
647
714
|
ref,
|
|
648
|
-
className: cn(
|
|
715
|
+
className: cn(
|
|
716
|
+
"flex gap-2.5 px-[1.35rem] py-[1.1rem] border-t border-border bg-muted/40",
|
|
717
|
+
className
|
|
718
|
+
),
|
|
649
719
|
...props
|
|
650
720
|
}
|
|
651
721
|
)
|
|
@@ -693,7 +763,15 @@ var avatarVariants = cva(
|
|
|
693
763
|
);
|
|
694
764
|
var Avatar = React52.forwardRef(
|
|
695
765
|
({ className, size, tone, src, alt, status, children, ...props }, ref) => {
|
|
696
|
-
const node = /* @__PURE__ */ jsx(
|
|
766
|
+
const node = /* @__PURE__ */ jsx(
|
|
767
|
+
"span",
|
|
768
|
+
{
|
|
769
|
+
ref,
|
|
770
|
+
className: cn(avatarVariants({ size, tone }), "overflow-hidden", className),
|
|
771
|
+
...props,
|
|
772
|
+
children: src ? /* @__PURE__ */ jsx("img", { src, alt, className: "h-full w-full object-cover" }) : children
|
|
773
|
+
}
|
|
774
|
+
);
|
|
697
775
|
if (!status) return node;
|
|
698
776
|
return /* @__PURE__ */ jsxs("span", { className: "relative inline-flex", children: [
|
|
699
777
|
node,
|
|
@@ -712,7 +790,14 @@ function useTabs() {
|
|
|
712
790
|
if (!ctx) throw new Error("Tabs.* must be used within <Tabs>");
|
|
713
791
|
return ctx;
|
|
714
792
|
}
|
|
715
|
-
function Tabs({
|
|
793
|
+
function Tabs({
|
|
794
|
+
value,
|
|
795
|
+
defaultValue,
|
|
796
|
+
onValueChange,
|
|
797
|
+
className,
|
|
798
|
+
children,
|
|
799
|
+
...props
|
|
800
|
+
}) {
|
|
716
801
|
const [internal, setInternal] = React52.useState(defaultValue ?? "");
|
|
717
802
|
const uid = React52.useId();
|
|
718
803
|
const current = value ?? internal;
|
|
@@ -822,7 +907,13 @@ var TabsContent = React52.forwardRef(
|
|
|
822
907
|
);
|
|
823
908
|
TabsContent.displayName = "TabsContent";
|
|
824
909
|
var AccordionContext = React52.createContext(null);
|
|
825
|
-
function Accordion({
|
|
910
|
+
function Accordion({
|
|
911
|
+
type = "single",
|
|
912
|
+
defaultValue = [],
|
|
913
|
+
className,
|
|
914
|
+
children,
|
|
915
|
+
...props
|
|
916
|
+
}) {
|
|
826
917
|
const [open, setOpen] = React52.useState(defaultValue);
|
|
827
918
|
const toggle = React52.useCallback(
|
|
828
919
|
(v) => {
|
|
@@ -834,72 +925,97 @@ function Accordion({ type = "single", defaultValue = [], className, children, ..
|
|
|
834
925
|
},
|
|
835
926
|
[type]
|
|
836
927
|
);
|
|
837
|
-
return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: { open, toggle }, children: /* @__PURE__ */ jsx(
|
|
928
|
+
return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: { open, toggle }, children: /* @__PURE__ */ jsx(
|
|
929
|
+
"div",
|
|
930
|
+
{
|
|
931
|
+
className: cn("border border-border rounded-kj-lg overflow-hidden", className),
|
|
932
|
+
...props,
|
|
933
|
+
children
|
|
934
|
+
}
|
|
935
|
+
) });
|
|
838
936
|
}
|
|
839
937
|
var ItemContext = React52.createContext("");
|
|
840
938
|
var AccordionItem = React52.forwardRef(
|
|
841
|
-
({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(ItemContext.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
939
|
+
({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(ItemContext.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
940
|
+
"div",
|
|
941
|
+
{
|
|
942
|
+
ref,
|
|
943
|
+
className: cn("border-t border-border first:border-t-0", className),
|
|
944
|
+
...props
|
|
945
|
+
}
|
|
946
|
+
) })
|
|
842
947
|
);
|
|
843
948
|
AccordionItem.displayName = "AccordionItem";
|
|
844
|
-
var AccordionTrigger = React52.forwardRef(
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
children
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
);
|
|
949
|
+
var AccordionTrigger = React52.forwardRef(({ className, children, ...props }, ref) => {
|
|
950
|
+
const ctx = React52.useContext(AccordionContext);
|
|
951
|
+
const value = React52.useContext(ItemContext);
|
|
952
|
+
const isOpen = ctx.open.includes(value);
|
|
953
|
+
return /* @__PURE__ */ jsxs(
|
|
954
|
+
"button",
|
|
955
|
+
{
|
|
956
|
+
ref,
|
|
957
|
+
type: "button",
|
|
958
|
+
"aria-expanded": isOpen,
|
|
959
|
+
onClick: () => ctx.toggle(value),
|
|
960
|
+
className: cn(
|
|
961
|
+
"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",
|
|
962
|
+
className
|
|
963
|
+
),
|
|
964
|
+
...props,
|
|
965
|
+
children: [
|
|
966
|
+
children,
|
|
967
|
+
/* @__PURE__ */ jsx(
|
|
968
|
+
"svg",
|
|
969
|
+
{
|
|
970
|
+
className: cn(
|
|
971
|
+
"shrink-0 text-muted-foreground transition-transform duration-200",
|
|
972
|
+
isOpen && "rotate-180"
|
|
973
|
+
),
|
|
974
|
+
width: 18,
|
|
975
|
+
height: 18,
|
|
976
|
+
viewBox: "0 0 24 24",
|
|
977
|
+
fill: "none",
|
|
978
|
+
stroke: "currentColor",
|
|
979
|
+
strokeWidth: 2,
|
|
980
|
+
strokeLinecap: "round",
|
|
981
|
+
strokeLinejoin: "round",
|
|
982
|
+
children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
983
|
+
}
|
|
984
|
+
)
|
|
985
|
+
]
|
|
986
|
+
}
|
|
987
|
+
);
|
|
988
|
+
});
|
|
883
989
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
884
|
-
var AccordionContent = React52.forwardRef(
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
990
|
+
var AccordionContent = React52.forwardRef(({ className, children, ...props }, ref) => {
|
|
991
|
+
const ctx = React52.useContext(AccordionContext);
|
|
992
|
+
const value = React52.useContext(ItemContext);
|
|
993
|
+
const isOpen = ctx.open.includes(value);
|
|
994
|
+
return /* @__PURE__ */ jsx(
|
|
995
|
+
"div",
|
|
996
|
+
{
|
|
997
|
+
ref,
|
|
998
|
+
className: cn(
|
|
999
|
+
"grid transition-[grid-template-rows] duration-200 ease-out",
|
|
1000
|
+
isOpen ? "[grid-template-rows:1fr]" : "[grid-template-rows:0fr]"
|
|
1001
|
+
),
|
|
1002
|
+
...props,
|
|
1003
|
+
children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
1004
|
+
"div",
|
|
1005
|
+
{
|
|
1006
|
+
className: cn("px-[1.2rem] pt-3 pb-4 text-[0.85rem] text-muted-foreground", className),
|
|
1007
|
+
children
|
|
1008
|
+
}
|
|
1009
|
+
) })
|
|
1010
|
+
}
|
|
1011
|
+
);
|
|
1012
|
+
});
|
|
900
1013
|
AccordionContent.displayName = "AccordionContent";
|
|
901
1014
|
var MenuContext = React52.createContext(null);
|
|
902
|
-
function DropdownMenu({
|
|
1015
|
+
function DropdownMenu({
|
|
1016
|
+
children,
|
|
1017
|
+
className
|
|
1018
|
+
}) {
|
|
903
1019
|
const [open, setOpen] = React52.useState(false);
|
|
904
1020
|
const ref = React52.useRef(null);
|
|
905
1021
|
React52.useEffect(() => {
|
|
@@ -950,14 +1066,21 @@ var DropdownMenuTrigger = React52.forwardRef(({ onClick, asChild, ...props }, re
|
|
|
950
1066
|
);
|
|
951
1067
|
});
|
|
952
1068
|
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
953
|
-
function DropdownMenuContent({
|
|
1069
|
+
function DropdownMenuContent({
|
|
1070
|
+
className,
|
|
1071
|
+
align = "start",
|
|
1072
|
+
children,
|
|
1073
|
+
...props
|
|
1074
|
+
}) {
|
|
954
1075
|
const ctx = React52.useContext(MenuContext);
|
|
955
1076
|
const ref = React52.useRef(null);
|
|
956
1077
|
React52.useEffect(() => {
|
|
957
1078
|
if (!ctx.open) return;
|
|
958
1079
|
const container = ref.current;
|
|
959
1080
|
if (container) {
|
|
960
|
-
const items = Array.from(
|
|
1081
|
+
const items = Array.from(
|
|
1082
|
+
container.querySelectorAll('[role="menuitem"]')
|
|
1083
|
+
);
|
|
961
1084
|
if (items.length > 0) {
|
|
962
1085
|
setTimeout(() => items[0].focus(), 50);
|
|
963
1086
|
}
|
|
@@ -1033,7 +1156,16 @@ function DropdownMenuSeparator({ className }) {
|
|
|
1033
1156
|
return /* @__PURE__ */ jsx("div", { className: cn("h-px bg-border my-1.5", className), role: "separator" });
|
|
1034
1157
|
}
|
|
1035
1158
|
var Breadcrumb = React52.forwardRef(
|
|
1036
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1159
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1160
|
+
"nav",
|
|
1161
|
+
{
|
|
1162
|
+
ref,
|
|
1163
|
+
"aria-label": "Breadcrumb",
|
|
1164
|
+
className: cn("flex items-center gap-1.5 text-[0.85rem] text-muted-foreground", className),
|
|
1165
|
+
...props,
|
|
1166
|
+
children
|
|
1167
|
+
}
|
|
1168
|
+
)
|
|
1037
1169
|
);
|
|
1038
1170
|
Breadcrumb.displayName = "Breadcrumb";
|
|
1039
1171
|
var BreadcrumbItem = React52.forwardRef(
|
|
@@ -1041,7 +1173,18 @@ var BreadcrumbItem = React52.forwardRef(
|
|
|
1041
1173
|
if (current) {
|
|
1042
1174
|
return /* @__PURE__ */ jsx("span", { "aria-current": "page", className: cn("text-foreground font-semibold", className), children });
|
|
1043
1175
|
}
|
|
1044
|
-
return /* @__PURE__ */ jsx(
|
|
1176
|
+
return /* @__PURE__ */ jsx(
|
|
1177
|
+
"a",
|
|
1178
|
+
{
|
|
1179
|
+
ref,
|
|
1180
|
+
className: cn(
|
|
1181
|
+
"text-inherit no-underline hover:text-foreground transition-colors",
|
|
1182
|
+
className
|
|
1183
|
+
),
|
|
1184
|
+
...props,
|
|
1185
|
+
children
|
|
1186
|
+
}
|
|
1187
|
+
);
|
|
1045
1188
|
}
|
|
1046
1189
|
);
|
|
1047
1190
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
@@ -1062,11 +1205,34 @@ function paginate(page, pageCount) {
|
|
|
1062
1205
|
items.push(pageCount);
|
|
1063
1206
|
return items;
|
|
1064
1207
|
}
|
|
1065
|
-
var Chevron = ({ dir }) => /* @__PURE__ */ jsx(
|
|
1208
|
+
var Chevron = ({ dir }) => /* @__PURE__ */ jsx(
|
|
1209
|
+
"svg",
|
|
1210
|
+
{
|
|
1211
|
+
width: 16,
|
|
1212
|
+
height: 16,
|
|
1213
|
+
viewBox: "0 0 24 24",
|
|
1214
|
+
fill: "none",
|
|
1215
|
+
stroke: "currentColor",
|
|
1216
|
+
strokeWidth: 2,
|
|
1217
|
+
strokeLinecap: "round",
|
|
1218
|
+
strokeLinejoin: "round",
|
|
1219
|
+
children: /* @__PURE__ */ jsx("polyline", { points: dir === "left" ? "15 18 9 12 15 6" : "9 18 15 12 9 6" })
|
|
1220
|
+
}
|
|
1221
|
+
);
|
|
1066
1222
|
function Pagination({ page, pageCount, onPageChange, className }) {
|
|
1067
1223
|
const items = paginate(page, pageCount);
|
|
1068
1224
|
return /* @__PURE__ */ jsxs("nav", { "aria-label": "Paginacja", className: cn("flex items-center gap-1", className), children: [
|
|
1069
|
-
/* @__PURE__ */ jsx(
|
|
1225
|
+
/* @__PURE__ */ jsx(
|
|
1226
|
+
Button,
|
|
1227
|
+
{
|
|
1228
|
+
variant: "ghost",
|
|
1229
|
+
size: "icon-sm",
|
|
1230
|
+
"aria-label": "Previous",
|
|
1231
|
+
disabled: page <= 1,
|
|
1232
|
+
onClick: () => onPageChange(page - 1),
|
|
1233
|
+
children: /* @__PURE__ */ jsx(Chevron, { dir: "left" })
|
|
1234
|
+
}
|
|
1235
|
+
),
|
|
1070
1236
|
items.map(
|
|
1071
1237
|
(it, i) => it === "\u2026" ? /* @__PURE__ */ jsx("span", { className: "px-1 text-muted-foreground select-none", children: "\u2026" }, `e${i}`) : /* @__PURE__ */ jsx(
|
|
1072
1238
|
Button,
|
|
@@ -1080,7 +1246,17 @@ function Pagination({ page, pageCount, onPageChange, className }) {
|
|
|
1080
1246
|
it
|
|
1081
1247
|
)
|
|
1082
1248
|
),
|
|
1083
|
-
/* @__PURE__ */ jsx(
|
|
1249
|
+
/* @__PURE__ */ jsx(
|
|
1250
|
+
Button,
|
|
1251
|
+
{
|
|
1252
|
+
variant: "ghost",
|
|
1253
|
+
size: "icon-sm",
|
|
1254
|
+
"aria-label": "Next",
|
|
1255
|
+
disabled: page >= pageCount,
|
|
1256
|
+
onClick: () => onPageChange(page + 1),
|
|
1257
|
+
children: /* @__PURE__ */ jsx(Chevron, { dir: "right" })
|
|
1258
|
+
}
|
|
1259
|
+
)
|
|
1084
1260
|
] });
|
|
1085
1261
|
}
|
|
1086
1262
|
var BottomNavigation = React52.forwardRef(
|
|
@@ -1156,24 +1332,26 @@ var BottomNavigation = React52.forwardRef(
|
|
|
1156
1332
|
);
|
|
1157
1333
|
BottomNavigation.displayName = "BottomNavigation";
|
|
1158
1334
|
var TableWrap = React52.forwardRef(
|
|
1159
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1335
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1336
|
+
"div",
|
|
1337
|
+
{
|
|
1338
|
+
ref,
|
|
1339
|
+
className: cn(
|
|
1340
|
+
"w-full max-w-full overflow-x-auto border border-border rounded-kj-lg",
|
|
1341
|
+
className
|
|
1342
|
+
),
|
|
1343
|
+
...props
|
|
1344
|
+
}
|
|
1345
|
+
)
|
|
1160
1346
|
);
|
|
1161
1347
|
TableWrap.displayName = "TableWrap";
|
|
1162
|
-
var Table = React52.forwardRef(
|
|
1163
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx("table", { ref, className: cn("w-full border-collapse text-[0.85rem]", className), ...props })
|
|
1164
|
-
);
|
|
1348
|
+
var Table = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("table", { ref, className: cn("w-full border-collapse text-[0.85rem]", className), ...props }));
|
|
1165
1349
|
Table.displayName = "Table";
|
|
1166
|
-
var TableHeader = React52.forwardRef(
|
|
1167
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className, ...props })
|
|
1168
|
-
);
|
|
1350
|
+
var TableHeader = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className, ...props }));
|
|
1169
1351
|
TableHeader.displayName = "TableHeader";
|
|
1170
|
-
var TableBody = React52.forwardRef(
|
|
1171
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className, ...props })
|
|
1172
|
-
);
|
|
1352
|
+
var TableBody = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className, ...props }));
|
|
1173
1353
|
TableBody.displayName = "TableBody";
|
|
1174
|
-
var TableRow = React52.forwardRef(
|
|
1175
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", { ref, className: cn("transition-colors hover:bg-muted/50", className), ...props })
|
|
1176
|
-
);
|
|
1354
|
+
var TableRow = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", { ref, className: cn("transition-colors hover:bg-muted/50", className), ...props }));
|
|
1177
1355
|
TableRow.displayName = "TableRow";
|
|
1178
1356
|
var TableHead = React52.forwardRef(
|
|
1179
1357
|
({ className, numeric, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
@@ -1227,7 +1405,14 @@ function Tooltip({ content, children, className }) {
|
|
|
1227
1405
|
);
|
|
1228
1406
|
}
|
|
1229
1407
|
var ModalContext = React52.createContext(null);
|
|
1230
|
-
function Modal({
|
|
1408
|
+
function Modal({
|
|
1409
|
+
open,
|
|
1410
|
+
onClose,
|
|
1411
|
+
children,
|
|
1412
|
+
width = 440,
|
|
1413
|
+
className,
|
|
1414
|
+
showClose = true
|
|
1415
|
+
}) {
|
|
1231
1416
|
const titleId = React52.useId();
|
|
1232
1417
|
const descId = React52.useId();
|
|
1233
1418
|
const containerRef = React52.useRef(null);
|
|
@@ -1311,7 +1496,7 @@ function Modal({ open, onClose, children, width = 440, className, showClose = tr
|
|
|
1311
1496
|
tabIndex: -1,
|
|
1312
1497
|
style: { maxWidth: width },
|
|
1313
1498
|
className: cn(
|
|
1314
|
-
"relative w-full p-7 rounded-kj-2xl bg-surface border border-border shadow-kj-lg transition-transform duration-200 outline-none",
|
|
1499
|
+
"relative w-full p-7 rounded-kj-2xl bg-surface text-foreground border border-border shadow-kj-lg transition-transform duration-200 outline-none",
|
|
1315
1500
|
open ? "scale-100 translate-y-0" : "scale-95 translate-y-2",
|
|
1316
1501
|
className
|
|
1317
1502
|
),
|
|
@@ -1323,7 +1508,20 @@ function Modal({ open, onClose, children, width = 440, className, showClose = tr
|
|
|
1323
1508
|
onClick: onClose,
|
|
1324
1509
|
"aria-label": "Close",
|
|
1325
1510
|
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",
|
|
1326
|
-
children: /* @__PURE__ */ jsx(
|
|
1511
|
+
children: /* @__PURE__ */ jsx(
|
|
1512
|
+
"svg",
|
|
1513
|
+
{
|
|
1514
|
+
width: 16,
|
|
1515
|
+
height: 16,
|
|
1516
|
+
viewBox: "0 0 24 24",
|
|
1517
|
+
fill: "none",
|
|
1518
|
+
stroke: "currentColor",
|
|
1519
|
+
strokeWidth: 2.5,
|
|
1520
|
+
strokeLinecap: "round",
|
|
1521
|
+
strokeLinejoin: "round",
|
|
1522
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
1523
|
+
}
|
|
1524
|
+
)
|
|
1327
1525
|
}
|
|
1328
1526
|
),
|
|
1329
1527
|
children
|
|
@@ -1333,13 +1531,40 @@ function Modal({ open, onClose, children, width = 440, className, showClose = tr
|
|
|
1333
1531
|
}
|
|
1334
1532
|
);
|
|
1335
1533
|
}
|
|
1336
|
-
function ModalTitle({
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1534
|
+
function ModalTitle({
|
|
1535
|
+
className,
|
|
1536
|
+
id,
|
|
1537
|
+
children,
|
|
1538
|
+
...props
|
|
1539
|
+
}) {
|
|
1341
1540
|
const ctx = React52.useContext(ModalContext);
|
|
1342
|
-
return /* @__PURE__ */ jsx(
|
|
1541
|
+
return /* @__PURE__ */ jsx(
|
|
1542
|
+
"h3",
|
|
1543
|
+
{
|
|
1544
|
+
id: id ?? ctx?.titleId,
|
|
1545
|
+
className: cn(
|
|
1546
|
+
"m-0 mb-2 text-[1.15rem] font-bold tracking-[-0.01em] text-foreground",
|
|
1547
|
+
className
|
|
1548
|
+
),
|
|
1549
|
+
...props,
|
|
1550
|
+
children
|
|
1551
|
+
}
|
|
1552
|
+
);
|
|
1553
|
+
}
|
|
1554
|
+
function ModalDescription({
|
|
1555
|
+
className,
|
|
1556
|
+
id,
|
|
1557
|
+
...props
|
|
1558
|
+
}) {
|
|
1559
|
+
const ctx = React52.useContext(ModalContext);
|
|
1560
|
+
return /* @__PURE__ */ jsx(
|
|
1561
|
+
"p",
|
|
1562
|
+
{
|
|
1563
|
+
id: id ?? ctx?.descId,
|
|
1564
|
+
className: cn("m-0 text-[0.9rem] text-muted-foreground", className),
|
|
1565
|
+
...props
|
|
1566
|
+
}
|
|
1567
|
+
);
|
|
1343
1568
|
}
|
|
1344
1569
|
function ModalActions({ className, ...props }) {
|
|
1345
1570
|
return /* @__PURE__ */ jsx("div", { className: cn("flex gap-2.5 justify-end mt-6", className), ...props });
|
|
@@ -1351,15 +1576,57 @@ function useToast() {
|
|
|
1351
1576
|
return ctx;
|
|
1352
1577
|
}
|
|
1353
1578
|
var icons = {
|
|
1354
|
-
default: /* @__PURE__ */ jsxs(
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1579
|
+
default: /* @__PURE__ */ jsxs(
|
|
1580
|
+
"svg",
|
|
1581
|
+
{
|
|
1582
|
+
width: 18,
|
|
1583
|
+
height: 18,
|
|
1584
|
+
viewBox: "0 0 24 24",
|
|
1585
|
+
fill: "none",
|
|
1586
|
+
stroke: "currentColor",
|
|
1587
|
+
strokeWidth: 2,
|
|
1588
|
+
strokeLinecap: "round",
|
|
1589
|
+
strokeLinejoin: "round",
|
|
1590
|
+
className: "text-primary",
|
|
1591
|
+
children: [
|
|
1592
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1593
|
+
/* @__PURE__ */ jsx("path", { d: "M12 16v-4M12 8h.01" })
|
|
1594
|
+
]
|
|
1595
|
+
}
|
|
1596
|
+
),
|
|
1597
|
+
success: /* @__PURE__ */ jsx(
|
|
1598
|
+
"svg",
|
|
1599
|
+
{
|
|
1600
|
+
width: 18,
|
|
1601
|
+
height: 18,
|
|
1602
|
+
viewBox: "0 0 24 24",
|
|
1603
|
+
fill: "none",
|
|
1604
|
+
stroke: "currentColor",
|
|
1605
|
+
strokeWidth: 2,
|
|
1606
|
+
strokeLinecap: "round",
|
|
1607
|
+
strokeLinejoin: "round",
|
|
1608
|
+
className: "text-success",
|
|
1609
|
+
children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
|
|
1610
|
+
}
|
|
1611
|
+
),
|
|
1612
|
+
danger: /* @__PURE__ */ jsxs(
|
|
1613
|
+
"svg",
|
|
1614
|
+
{
|
|
1615
|
+
width: 18,
|
|
1616
|
+
height: 18,
|
|
1617
|
+
viewBox: "0 0 24 24",
|
|
1618
|
+
fill: "none",
|
|
1619
|
+
stroke: "currentColor",
|
|
1620
|
+
strokeWidth: 2,
|
|
1621
|
+
strokeLinecap: "round",
|
|
1622
|
+
strokeLinejoin: "round",
|
|
1623
|
+
className: "text-danger",
|
|
1624
|
+
children: [
|
|
1625
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1626
|
+
/* @__PURE__ */ jsx("path", { d: "m15 9-6 6M9 9l6 6" })
|
|
1627
|
+
]
|
|
1628
|
+
}
|
|
1629
|
+
)
|
|
1363
1630
|
};
|
|
1364
1631
|
var toneBorder = {
|
|
1365
1632
|
default: "border-l-primary",
|
|
@@ -1493,20 +1760,11 @@ var SectionHeader = React52.forwardRef(
|
|
|
1493
1760
|
),
|
|
1494
1761
|
...props,
|
|
1495
1762
|
children: children ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1496
|
-
/* @__PURE__ */ jsxs(
|
|
1497
|
-
|
|
1498
|
-
{
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
isCentered && "flex flex-col items-center"
|
|
1502
|
-
),
|
|
1503
|
-
children: [
|
|
1504
|
-
kicker && /* @__PURE__ */ jsx(SectionHeaderKicker, { children: kicker }),
|
|
1505
|
-
title && /* @__PURE__ */ jsx(SectionHeaderTitle, { as: headingLevel, children: title }),
|
|
1506
|
-
description && /* @__PURE__ */ jsx(SectionHeaderDescription, { children: description })
|
|
1507
|
-
]
|
|
1508
|
-
}
|
|
1509
|
-
),
|
|
1763
|
+
/* @__PURE__ */ jsxs("div", { className: cn("space-y-2", isCentered && "flex flex-col items-center"), children: [
|
|
1764
|
+
kicker && /* @__PURE__ */ jsx(SectionHeaderKicker, { children: kicker }),
|
|
1765
|
+
title && /* @__PURE__ */ jsx(SectionHeaderTitle, { as: headingLevel, children: title }),
|
|
1766
|
+
description && /* @__PURE__ */ jsx(SectionHeaderDescription, { children: description })
|
|
1767
|
+
] }),
|
|
1510
1768
|
actions && /* @__PURE__ */ jsx(SectionHeaderActions, { className: cn(isCentered && "justify-center mt-4"), children: actions })
|
|
1511
1769
|
] })
|
|
1512
1770
|
}
|
|
@@ -1552,7 +1810,13 @@ var MetricCard = React52.forwardRef(
|
|
|
1552
1810
|
] }),
|
|
1553
1811
|
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2.5 mb-1.5", children: [
|
|
1554
1812
|
/* @__PURE__ */ jsx("span", { className: "text-3xl font-bold tracking-tight text-foreground", children: value }),
|
|
1555
|
-
trend && /* @__PURE__ */ jsx(
|
|
1813
|
+
trend && /* @__PURE__ */ jsx(
|
|
1814
|
+
"span",
|
|
1815
|
+
{
|
|
1816
|
+
className: cn("text-[0.75rem] font-bold px-2 py-0.5 rounded-full border", trendColor),
|
|
1817
|
+
children: trend
|
|
1818
|
+
}
|
|
1819
|
+
)
|
|
1556
1820
|
] }),
|
|
1557
1821
|
description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: description })
|
|
1558
1822
|
] });
|
|
@@ -1626,130 +1890,160 @@ function DataTable({
|
|
|
1626
1890
|
};
|
|
1627
1891
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-4 w-full", className), children: [
|
|
1628
1892
|
toolbar && /* @__PURE__ */ jsx("div", { className: "flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3", children: toolbar }),
|
|
1629
|
-
/* @__PURE__ */ jsxs(
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
),
|
|
1660
|
-
"aria-sort": ariaSort,
|
|
1661
|
-
children: isSortable ? /* @__PURE__ */ jsxs(
|
|
1662
|
-
"button",
|
|
1893
|
+
/* @__PURE__ */ jsxs(
|
|
1894
|
+
TableWrap,
|
|
1895
|
+
{
|
|
1896
|
+
className: "relative overflow-x-auto overflow-y-hidden [scroll-behavior:smooth] [-webkit-overflow-scrolling:touch]",
|
|
1897
|
+
...props,
|
|
1898
|
+
children: [
|
|
1899
|
+
/* @__PURE__ */ jsxs(Table, { children: [
|
|
1900
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
1901
|
+
isSelectionActive && /* @__PURE__ */ jsx(TableHead, { className: "w-12 px-4 text-center", children: /* @__PURE__ */ jsx("div", { className: "inline-flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
1902
|
+
"input",
|
|
1903
|
+
{
|
|
1904
|
+
type: "checkbox",
|
|
1905
|
+
ref: headerCheckboxRef,
|
|
1906
|
+
checked: allSelected,
|
|
1907
|
+
onChange: handleSelectAll,
|
|
1908
|
+
"aria-label": "Select all rows",
|
|
1909
|
+
className: "h-4 w-4 rounded border-input text-primary focus:ring-ring"
|
|
1910
|
+
}
|
|
1911
|
+
) }) }),
|
|
1912
|
+
columns.map((col, idx) => {
|
|
1913
|
+
const alignClass = {
|
|
1914
|
+
left: "text-left",
|
|
1915
|
+
center: "text-center",
|
|
1916
|
+
right: "text-right"
|
|
1917
|
+
}[col.align || "left"];
|
|
1918
|
+
const isSortable = col.sortable && onSort && col.sortKey;
|
|
1919
|
+
const isSortedActive = sortBy && col.sortKey === sortBy;
|
|
1920
|
+
const ariaSort = isSortable ? isSortedActive ? sortDirection === "asc" ? "ascending" : "descending" : "none" : void 0;
|
|
1921
|
+
return /* @__PURE__ */ jsx(
|
|
1922
|
+
TableHead,
|
|
1663
1923
|
{
|
|
1664
|
-
type: "button",
|
|
1665
|
-
onClick: () => {
|
|
1666
|
-
if (!col.sortKey) return;
|
|
1667
|
-
const nextDirection = isSortedActive && sortDirection === "asc" ? "desc" : "asc";
|
|
1668
|
-
onSort(col.sortKey, nextDirection);
|
|
1669
|
-
},
|
|
1670
1924
|
className: cn(
|
|
1671
|
-
|
|
1925
|
+
alignClass,
|
|
1926
|
+
isSortable && "p-0 hover:bg-muted/30 transition-colors",
|
|
1927
|
+
col.className
|
|
1928
|
+
),
|
|
1929
|
+
"aria-sort": ariaSort,
|
|
1930
|
+
children: isSortable ? /* @__PURE__ */ jsxs(
|
|
1931
|
+
"button",
|
|
1672
1932
|
{
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1933
|
+
type: "button",
|
|
1934
|
+
onClick: () => {
|
|
1935
|
+
if (!col.sortKey) return;
|
|
1936
|
+
const nextDirection = isSortedActive && sortDirection === "asc" ? "desc" : "asc";
|
|
1937
|
+
onSort(col.sortKey, nextDirection);
|
|
1938
|
+
},
|
|
1939
|
+
className: cn(
|
|
1940
|
+
"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",
|
|
1941
|
+
{
|
|
1942
|
+
"justify-start text-left": col.align === "left" || !col.align,
|
|
1943
|
+
"justify-center text-center": col.align === "center",
|
|
1944
|
+
"justify-end text-right": col.align === "right"
|
|
1945
|
+
}
|
|
1946
|
+
),
|
|
1947
|
+
children: [
|
|
1948
|
+
/* @__PURE__ */ jsx("span", { children: col.header }),
|
|
1949
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground shrink-0 select-none", children: isSortedActive ? sortDirection === "asc" ? "\u25B2" : "\u25BC" : "\u21C5" })
|
|
1950
|
+
]
|
|
1676
1951
|
}
|
|
1677
|
-
)
|
|
1678
|
-
|
|
1679
|
-
/* @__PURE__ */ jsx("span", { children: col.header }),
|
|
1680
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground shrink-0 select-none", children: isSortedActive ? sortDirection === "asc" ? "\u25B2" : "\u25BC" : "\u21C5" })
|
|
1681
|
-
]
|
|
1682
|
-
}
|
|
1683
|
-
) : /* @__PURE__ */ jsx("div", { className: cn("inline-flex items-center gap-1.5", alignClass === "text-right" && "justify-end w-full"), children: col.header })
|
|
1684
|
-
},
|
|
1685
|
-
idx
|
|
1686
|
-
);
|
|
1687
|
-
})
|
|
1688
|
-
] }) }),
|
|
1689
|
-
/* @__PURE__ */ jsx(TableBody, { children: loading && data.length === 0 ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: columns.length + (isSelectionActive ? 1 : 0), className: "h-64 text-center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-3", children: [
|
|
1690
|
-
/* @__PURE__ */ jsx(Spinner, { size: 32 }),
|
|
1691
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Loading dataset..." })
|
|
1692
|
-
] }) }) }) : error ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: columns.length + (isSelectionActive ? 1 : 0), className: "p-8", children: /* @__PURE__ */ jsx(Alert, { variant: "danger", title: "Error loading data", children: error }) }) }) : data.length === 0 ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: columns.length + (isSelectionActive ? 1 : 0), className: "p-0", children: /* @__PURE__ */ jsx(
|
|
1693
|
-
EmptyState,
|
|
1694
|
-
{
|
|
1695
|
-
title: emptyTitle,
|
|
1696
|
-
description: emptyDescription,
|
|
1697
|
-
action: emptyAction,
|
|
1698
|
-
className: "border-none bg-transparent rounded-none py-16"
|
|
1699
|
-
}
|
|
1700
|
-
) }) }) : data.map((row, rowIdx) => {
|
|
1701
|
-
const rowKey = getRowId(row, rowIdx);
|
|
1702
|
-
const isSelected = isSelectionActive && selectedRows.has(rowKey);
|
|
1703
|
-
return /* @__PURE__ */ jsxs(
|
|
1704
|
-
TableRow,
|
|
1705
|
-
{
|
|
1706
|
-
onClick: () => onRowClick && onRowClick(row),
|
|
1707
|
-
className: cn(
|
|
1708
|
-
onRowClick && "cursor-pointer hover:bg-muted/40 transition-colors",
|
|
1709
|
-
isSelected && "bg-primary/5 hover:bg-primary/10"
|
|
1710
|
-
),
|
|
1711
|
-
children: [
|
|
1712
|
-
isSelectionActive && /* @__PURE__ */ jsx(
|
|
1713
|
-
TableCell,
|
|
1714
|
-
{
|
|
1715
|
-
className: "w-12 px-4 text-center",
|
|
1716
|
-
onClick: (e) => {
|
|
1717
|
-
e.stopPropagation();
|
|
1718
|
-
},
|
|
1719
|
-
children: /* @__PURE__ */ jsx("div", { className: "inline-flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
1720
|
-
"input",
|
|
1952
|
+
) : /* @__PURE__ */ jsx(
|
|
1953
|
+
"div",
|
|
1721
1954
|
{
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1955
|
+
className: cn(
|
|
1956
|
+
"inline-flex items-center gap-1.5",
|
|
1957
|
+
alignClass === "text-right" && "justify-end w-full"
|
|
1958
|
+
),
|
|
1959
|
+
children: col.header
|
|
1727
1960
|
}
|
|
1728
|
-
)
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1961
|
+
)
|
|
1962
|
+
},
|
|
1963
|
+
idx
|
|
1964
|
+
);
|
|
1965
|
+
})
|
|
1966
|
+
] }) }),
|
|
1967
|
+
/* @__PURE__ */ jsx(TableBody, { children: loading && data.length === 0 ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
|
|
1968
|
+
TableCell,
|
|
1969
|
+
{
|
|
1970
|
+
colSpan: columns.length + (isSelectionActive ? 1 : 0),
|
|
1971
|
+
className: "h-64 text-center",
|
|
1972
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-3", children: [
|
|
1973
|
+
/* @__PURE__ */ jsx(Spinner, { size: 32 }),
|
|
1974
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Loading dataset..." })
|
|
1975
|
+
] })
|
|
1976
|
+
}
|
|
1977
|
+
) }) : error ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: columns.length + (isSelectionActive ? 1 : 0), className: "p-8", children: /* @__PURE__ */ jsx(Alert, { variant: "danger", title: "Error loading data", children: error }) }) }) : data.length === 0 ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: columns.length + (isSelectionActive ? 1 : 0), className: "p-0", children: /* @__PURE__ */ jsx(
|
|
1978
|
+
EmptyState,
|
|
1979
|
+
{
|
|
1980
|
+
title: emptyTitle,
|
|
1981
|
+
description: emptyDescription,
|
|
1982
|
+
action: emptyAction,
|
|
1983
|
+
className: "border-none bg-transparent rounded-none py-16"
|
|
1984
|
+
}
|
|
1985
|
+
) }) }) : data.map((row, rowIdx) => {
|
|
1986
|
+
const rowKey = getRowId(row, rowIdx);
|
|
1987
|
+
const isSelected = isSelectionActive && selectedRows.has(rowKey);
|
|
1988
|
+
return /* @__PURE__ */ jsxs(
|
|
1989
|
+
TableRow,
|
|
1990
|
+
{
|
|
1991
|
+
onClick: () => onRowClick && onRowClick(row),
|
|
1992
|
+
className: cn(
|
|
1993
|
+
onRowClick && "cursor-pointer hover:bg-muted/40 transition-colors",
|
|
1994
|
+
isSelected && "bg-primary/5 hover:bg-primary/10"
|
|
1995
|
+
),
|
|
1996
|
+
children: [
|
|
1997
|
+
isSelectionActive && /* @__PURE__ */ jsx(
|
|
1998
|
+
TableCell,
|
|
1999
|
+
{
|
|
2000
|
+
className: "w-12 px-4 text-center",
|
|
2001
|
+
onClick: (e) => {
|
|
2002
|
+
e.stopPropagation();
|
|
2003
|
+
},
|
|
2004
|
+
children: /* @__PURE__ */ jsx("div", { className: "inline-flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
2005
|
+
"input",
|
|
2006
|
+
{
|
|
2007
|
+
type: "checkbox",
|
|
2008
|
+
checked: isSelected,
|
|
2009
|
+
onChange: (e) => handleSelectRow(row, rowIdx, e.target.checked),
|
|
2010
|
+
"aria-label": `Select row ${rowIdx + 1}`,
|
|
2011
|
+
className: "h-4 w-4 rounded border-input text-primary focus:ring-ring"
|
|
2012
|
+
}
|
|
2013
|
+
) })
|
|
2014
|
+
}
|
|
2015
|
+
),
|
|
2016
|
+
columns.map((col, colIdx) => {
|
|
2017
|
+
const alignClass = {
|
|
2018
|
+
left: "text-left",
|
|
2019
|
+
center: "text-center",
|
|
2020
|
+
right: "text-right"
|
|
2021
|
+
}[col.align || "left"];
|
|
2022
|
+
return /* @__PURE__ */ jsx(TableCell, { className: cn(alignClass, col.className), children: col.accessor(row) }, colIdx);
|
|
2023
|
+
})
|
|
2024
|
+
]
|
|
2025
|
+
},
|
|
2026
|
+
rowKey
|
|
2027
|
+
);
|
|
2028
|
+
}) })
|
|
2029
|
+
] }),
|
|
2030
|
+
loading && data.length > 0 && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-background/50 backdrop-blur-[1px] grid place-items-center z-10 transition-opacity duration-150", children: /* @__PURE__ */ jsx(Spinner, { size: 36 }) })
|
|
2031
|
+
]
|
|
2032
|
+
}
|
|
2033
|
+
),
|
|
1747
2034
|
pagination && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end w-full", children: pagination })
|
|
1748
2035
|
] });
|
|
1749
2036
|
}
|
|
1750
2037
|
DataTable.displayName = "DataTable";
|
|
1751
2038
|
var ErrorState = React52.forwardRef(
|
|
1752
|
-
({
|
|
2039
|
+
({
|
|
2040
|
+
className,
|
|
2041
|
+
title = "Wyst\u0105pi\u0142 b\u0142\u0105d",
|
|
2042
|
+
message,
|
|
2043
|
+
onRetry,
|
|
2044
|
+
retryLabel = "Spr\xF3buj ponownie",
|
|
2045
|
+
...props
|
|
2046
|
+
}, ref) => /* @__PURE__ */ jsxs(
|
|
1753
2047
|
"div",
|
|
1754
2048
|
{
|
|
1755
2049
|
ref,
|
|
@@ -1759,7 +2053,24 @@ var ErrorState = React52.forwardRef(
|
|
|
1759
2053
|
),
|
|
1760
2054
|
...props,
|
|
1761
2055
|
children: [
|
|
1762
|
-
/* @__PURE__ */ 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__ */ jsx(
|
|
2056
|
+
/* @__PURE__ */ 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__ */ jsx(
|
|
2057
|
+
"svg",
|
|
2058
|
+
{
|
|
2059
|
+
fill: "none",
|
|
2060
|
+
stroke: "currentColor",
|
|
2061
|
+
strokeWidth: 2.5,
|
|
2062
|
+
viewBox: "0 0 24 24",
|
|
2063
|
+
className: "h-6 w-6",
|
|
2064
|
+
children: /* @__PURE__ */ jsx(
|
|
2065
|
+
"path",
|
|
2066
|
+
{
|
|
2067
|
+
strokeLinecap: "round",
|
|
2068
|
+
strokeLinejoin: "round",
|
|
2069
|
+
d: "M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"
|
|
2070
|
+
}
|
|
2071
|
+
)
|
|
2072
|
+
}
|
|
2073
|
+
) }),
|
|
1763
2074
|
/* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground mb-1", children: title }),
|
|
1764
2075
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground max-w-sm mb-6 leading-relaxed", children: message }),
|
|
1765
2076
|
onRetry && /* @__PURE__ */ jsx(Button, { size: "sm", variant: "danger", onClick: onRetry, children: retryLabel })
|
|
@@ -1769,12 +2080,14 @@ var ErrorState = React52.forwardRef(
|
|
|
1769
2080
|
);
|
|
1770
2081
|
ErrorState.displayName = "ErrorState";
|
|
1771
2082
|
var Skeleton = React52.forwardRef(
|
|
1772
|
-
({ className, variant = "rectangular", width, height, style, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2083
|
+
({ className, variant = "rectangular", animation = "shimmer", width, height, style, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1773
2084
|
"div",
|
|
1774
2085
|
{
|
|
1775
2086
|
ref,
|
|
1776
2087
|
className: cn(
|
|
1777
|
-
"
|
|
2088
|
+
"bg-muted-foreground/15 dark:bg-muted-foreground/20",
|
|
2089
|
+
animation === "pulse" && "animate-pulse",
|
|
2090
|
+
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",
|
|
1778
2091
|
variant === "text" && "h-3 w-4/5 rounded-sm my-1.5",
|
|
1779
2092
|
variant === "circular" && "rounded-full",
|
|
1780
2093
|
variant === "rectangular" && "rounded-kj-md",
|
|
@@ -1826,7 +2139,16 @@ var DashboardShell = React52.forwardRef(
|
|
|
1826
2139
|
mobileSidebar ? "hidden md:flex" : "w-full md:flex",
|
|
1827
2140
|
sidebarWidth
|
|
1828
2141
|
),
|
|
1829
|
-
children: /* @__PURE__ */ jsx(
|
|
2142
|
+
children: /* @__PURE__ */ jsx(
|
|
2143
|
+
"div",
|
|
2144
|
+
{
|
|
2145
|
+
className: cn(
|
|
2146
|
+
"sticky top-0 w-full flex flex-col",
|
|
2147
|
+
mobileSidebar ? "h-screen" : "h-auto md:h-screen"
|
|
2148
|
+
),
|
|
2149
|
+
children: sidebar
|
|
2150
|
+
}
|
|
2151
|
+
)
|
|
1830
2152
|
}
|
|
1831
2153
|
),
|
|
1832
2154
|
mobileSidebar && mobileOpen && /* @__PURE__ */ jsx(
|
|
@@ -1848,7 +2170,20 @@ var DashboardShell = React52.forwardRef(
|
|
|
1848
2170
|
type: "button",
|
|
1849
2171
|
onClick: () => setMobileOpen(false),
|
|
1850
2172
|
className: "p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
1851
|
-
children: /* @__PURE__ */ jsx(
|
|
2173
|
+
children: /* @__PURE__ */ jsx(
|
|
2174
|
+
"svg",
|
|
2175
|
+
{
|
|
2176
|
+
width: 16,
|
|
2177
|
+
height: 16,
|
|
2178
|
+
viewBox: "0 0 24 24",
|
|
2179
|
+
fill: "none",
|
|
2180
|
+
stroke: "currentColor",
|
|
2181
|
+
strokeWidth: 2.5,
|
|
2182
|
+
strokeLinecap: "round",
|
|
2183
|
+
strokeLinejoin: "round",
|
|
2184
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
2185
|
+
}
|
|
2186
|
+
)
|
|
1852
2187
|
}
|
|
1853
2188
|
)
|
|
1854
2189
|
] }),
|
|
@@ -1874,11 +2209,24 @@ var DashboardShell = React52.forwardRef(
|
|
|
1874
2209
|
onClick: () => setMobileOpen(true),
|
|
1875
2210
|
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",
|
|
1876
2211
|
"aria-label": "Open navigation",
|
|
1877
|
-
children: /* @__PURE__ */ jsxs(
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
2212
|
+
children: /* @__PURE__ */ jsxs(
|
|
2213
|
+
"svg",
|
|
2214
|
+
{
|
|
2215
|
+
width: 20,
|
|
2216
|
+
height: 20,
|
|
2217
|
+
viewBox: "0 0 24 24",
|
|
2218
|
+
fill: "none",
|
|
2219
|
+
stroke: "currentColor",
|
|
2220
|
+
strokeWidth: 2.5,
|
|
2221
|
+
strokeLinecap: "round",
|
|
2222
|
+
strokeLinejoin: "round",
|
|
2223
|
+
children: [
|
|
2224
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
|
|
2225
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
|
|
2226
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
|
|
2227
|
+
]
|
|
2228
|
+
}
|
|
2229
|
+
)
|
|
1882
2230
|
}
|
|
1883
2231
|
),
|
|
1884
2232
|
topbar
|
|
@@ -1909,7 +2257,18 @@ var SettingsLayout = React52.forwardRef(
|
|
|
1909
2257
|
);
|
|
1910
2258
|
SettingsLayout.displayName = "SettingsLayout";
|
|
1911
2259
|
var DetailPageLayout = React52.forwardRef(
|
|
1912
|
-
({
|
|
2260
|
+
({
|
|
2261
|
+
className,
|
|
2262
|
+
title,
|
|
2263
|
+
description,
|
|
2264
|
+
backHref,
|
|
2265
|
+
backLabel = "Back",
|
|
2266
|
+
onBackClick,
|
|
2267
|
+
actions,
|
|
2268
|
+
aside,
|
|
2269
|
+
children,
|
|
2270
|
+
...props
|
|
2271
|
+
}, ref) => {
|
|
1913
2272
|
return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-6 w-full", className), ...props, children: [
|
|
1914
2273
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
1915
2274
|
(backHref || onBackClick) && /* @__PURE__ */ jsx("div", { children: backHref ? /* @__PURE__ */ jsxs(
|
|
@@ -1921,7 +2280,24 @@ var DetailPageLayout = React52.forwardRef(
|
|
|
1921
2280
|
"-ml-3 h-8 text-muted-foreground hover:text-foreground inline-flex items-center gap-1.5"
|
|
1922
2281
|
),
|
|
1923
2282
|
children: [
|
|
1924
|
-
/* @__PURE__ */ jsx(
|
|
2283
|
+
/* @__PURE__ */ jsx(
|
|
2284
|
+
"svg",
|
|
2285
|
+
{
|
|
2286
|
+
viewBox: "0 0 24 24",
|
|
2287
|
+
fill: "none",
|
|
2288
|
+
stroke: "currentColor",
|
|
2289
|
+
strokeWidth: "2.5",
|
|
2290
|
+
className: "h-4 w-4",
|
|
2291
|
+
children: /* @__PURE__ */ jsx(
|
|
2292
|
+
"path",
|
|
2293
|
+
{
|
|
2294
|
+
strokeLinecap: "round",
|
|
2295
|
+
strokeLinejoin: "round",
|
|
2296
|
+
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
2297
|
+
}
|
|
2298
|
+
)
|
|
2299
|
+
}
|
|
2300
|
+
),
|
|
1925
2301
|
backLabel
|
|
1926
2302
|
]
|
|
1927
2303
|
}
|
|
@@ -1933,7 +2309,24 @@ var DetailPageLayout = React52.forwardRef(
|
|
|
1933
2309
|
className: "-ml-3 h-8 text-muted-foreground hover:text-foreground",
|
|
1934
2310
|
onClick: onBackClick,
|
|
1935
2311
|
children: [
|
|
1936
|
-
/* @__PURE__ */ jsx(
|
|
2312
|
+
/* @__PURE__ */ jsx(
|
|
2313
|
+
"svg",
|
|
2314
|
+
{
|
|
2315
|
+
viewBox: "0 0 24 24",
|
|
2316
|
+
fill: "none",
|
|
2317
|
+
stroke: "currentColor",
|
|
2318
|
+
strokeWidth: "2.5",
|
|
2319
|
+
className: "h-4 w-4 mr-1.5",
|
|
2320
|
+
children: /* @__PURE__ */ jsx(
|
|
2321
|
+
"path",
|
|
2322
|
+
{
|
|
2323
|
+
strokeLinecap: "round",
|
|
2324
|
+
strokeLinejoin: "round",
|
|
2325
|
+
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
2326
|
+
}
|
|
2327
|
+
)
|
|
2328
|
+
}
|
|
2329
|
+
),
|
|
1937
2330
|
backLabel
|
|
1938
2331
|
]
|
|
1939
2332
|
}
|
|
@@ -1955,7 +2348,15 @@ var DetailPageLayout = React52.forwardRef(
|
|
|
1955
2348
|
);
|
|
1956
2349
|
DetailPageLayout.displayName = "DetailPageLayout";
|
|
1957
2350
|
var TableToolbar = React52.forwardRef(
|
|
1958
|
-
({
|
|
2351
|
+
({
|
|
2352
|
+
className,
|
|
2353
|
+
searchQuery,
|
|
2354
|
+
onSearchChange,
|
|
2355
|
+
searchPlaceholder = "Search...",
|
|
2356
|
+
actions,
|
|
2357
|
+
filters,
|
|
2358
|
+
...props
|
|
2359
|
+
}, ref) => {
|
|
1959
2360
|
return /* @__PURE__ */ jsxs(
|
|
1960
2361
|
"div",
|
|
1961
2362
|
{
|
|
@@ -1975,7 +2376,24 @@ var TableToolbar = React52.forwardRef(
|
|
|
1975
2376
|
value: searchQuery,
|
|
1976
2377
|
onChange: (e) => onSearchChange(e.target.value),
|
|
1977
2378
|
className: "sm:w-64",
|
|
1978
|
-
leadingIcon: /* @__PURE__ */ jsx(
|
|
2379
|
+
leadingIcon: /* @__PURE__ */ jsx(
|
|
2380
|
+
"svg",
|
|
2381
|
+
{
|
|
2382
|
+
viewBox: "0 0 24 24",
|
|
2383
|
+
fill: "none",
|
|
2384
|
+
stroke: "currentColor",
|
|
2385
|
+
strokeWidth: "2.5",
|
|
2386
|
+
className: "h-4 w-4",
|
|
2387
|
+
children: /* @__PURE__ */ jsx(
|
|
2388
|
+
"path",
|
|
2389
|
+
{
|
|
2390
|
+
strokeLinecap: "round",
|
|
2391
|
+
strokeLinejoin: "round",
|
|
2392
|
+
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"
|
|
2393
|
+
}
|
|
2394
|
+
)
|
|
2395
|
+
}
|
|
2396
|
+
)
|
|
1979
2397
|
}
|
|
1980
2398
|
),
|
|
1981
2399
|
filters && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: filters })
|
|
@@ -2085,14 +2503,8 @@ function Drawer({
|
|
|
2085
2503
|
};
|
|
2086
2504
|
}, [open, onClose]);
|
|
2087
2505
|
const sideClasses = {
|
|
2088
|
-
right: cn(
|
|
2089
|
-
|
|
2090
|
-
open ? "translate-x-0" : "translate-x-full"
|
|
2091
|
-
),
|
|
2092
|
-
left: cn(
|
|
2093
|
-
"left-0 h-full border-r",
|
|
2094
|
-
open ? "translate-x-0" : "-translate-x-full"
|
|
2095
|
-
)
|
|
2506
|
+
right: cn("right-0 h-full border-l", open ? "translate-x-0" : "translate-x-full"),
|
|
2507
|
+
left: cn("left-0 h-full border-r", open ? "translate-x-0" : "-translate-x-full")
|
|
2096
2508
|
}[side];
|
|
2097
2509
|
return /* @__PURE__ */ jsx(
|
|
2098
2510
|
"div",
|
|
@@ -2131,7 +2543,20 @@ function Drawer({
|
|
|
2131
2543
|
onClick: onClose,
|
|
2132
2544
|
"aria-label": "Close",
|
|
2133
2545
|
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
2134
|
-
children: /* @__PURE__ */ jsx(
|
|
2546
|
+
children: /* @__PURE__ */ jsx(
|
|
2547
|
+
"svg",
|
|
2548
|
+
{
|
|
2549
|
+
width: 16,
|
|
2550
|
+
height: 16,
|
|
2551
|
+
viewBox: "0 0 24 24",
|
|
2552
|
+
fill: "none",
|
|
2553
|
+
stroke: "currentColor",
|
|
2554
|
+
strokeWidth: 2.5,
|
|
2555
|
+
strokeLinecap: "round",
|
|
2556
|
+
strokeLinejoin: "round",
|
|
2557
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
2558
|
+
}
|
|
2559
|
+
)
|
|
2135
2560
|
}
|
|
2136
2561
|
)
|
|
2137
2562
|
] }),
|
|
@@ -2143,7 +2568,12 @@ function Drawer({
|
|
|
2143
2568
|
);
|
|
2144
2569
|
}
|
|
2145
2570
|
Drawer.displayName = "Drawer";
|
|
2146
|
-
function CommandPalette({
|
|
2571
|
+
function CommandPalette({
|
|
2572
|
+
open,
|
|
2573
|
+
onClose,
|
|
2574
|
+
items,
|
|
2575
|
+
placeholder = "Type a command or search..."
|
|
2576
|
+
}) {
|
|
2147
2577
|
const [search, setSearch] = React52.useState("");
|
|
2148
2578
|
const [activeIndex, setActiveIndex] = React52.useState(0);
|
|
2149
2579
|
const containerRef = React52.useRef(null);
|
|
@@ -2176,10 +2606,14 @@ function CommandPalette({ open, onClose, items, placeholder = "Type a command or
|
|
|
2176
2606
|
}
|
|
2177
2607
|
if (e.key === "ArrowDown") {
|
|
2178
2608
|
e.preventDefault();
|
|
2179
|
-
setActiveIndex(
|
|
2609
|
+
setActiveIndex(
|
|
2610
|
+
(prev) => filteredItems.length === 0 ? 0 : (prev + 1) % filteredItems.length
|
|
2611
|
+
);
|
|
2180
2612
|
} else if (e.key === "ArrowUp") {
|
|
2181
2613
|
e.preventDefault();
|
|
2182
|
-
setActiveIndex(
|
|
2614
|
+
setActiveIndex(
|
|
2615
|
+
(prev) => filteredItems.length === 0 ? 0 : (prev - 1 + filteredItems.length) % filteredItems.length
|
|
2616
|
+
);
|
|
2183
2617
|
} else if (e.key === "Enter") {
|
|
2184
2618
|
e.preventDefault();
|
|
2185
2619
|
if (filteredItems[activeIndex]) {
|
|
@@ -2222,7 +2656,24 @@ function CommandPalette({ open, onClose, items, placeholder = "Type a command or
|
|
|
2222
2656
|
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]",
|
|
2223
2657
|
children: [
|
|
2224
2658
|
/* @__PURE__ */ jsxs("div", { className: "p-4 border-b border-border flex items-center gap-2", children: [
|
|
2225
|
-
/* @__PURE__ */ jsx(
|
|
2659
|
+
/* @__PURE__ */ jsx(
|
|
2660
|
+
"svg",
|
|
2661
|
+
{
|
|
2662
|
+
viewBox: "0 0 24 24",
|
|
2663
|
+
fill: "none",
|
|
2664
|
+
stroke: "currentColor",
|
|
2665
|
+
strokeWidth: "2.5",
|
|
2666
|
+
className: "h-5 w-5 text-muted-foreground shrink-0 ml-1",
|
|
2667
|
+
children: /* @__PURE__ */ jsx(
|
|
2668
|
+
"path",
|
|
2669
|
+
{
|
|
2670
|
+
strokeLinecap: "round",
|
|
2671
|
+
strokeLinejoin: "round",
|
|
2672
|
+
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"
|
|
2673
|
+
}
|
|
2674
|
+
)
|
|
2675
|
+
}
|
|
2676
|
+
),
|
|
2226
2677
|
/* @__PURE__ */ jsx(
|
|
2227
2678
|
"input",
|
|
2228
2679
|
{
|
|
@@ -2252,54 +2703,72 @@ function CommandPalette({ open, onClose, items, placeholder = "Type a command or
|
|
|
2252
2703
|
role: "listbox",
|
|
2253
2704
|
"aria-label": "Commands",
|
|
2254
2705
|
className: "space-y-4",
|
|
2255
|
-
children: Object.entries(groups).map(([cat, itemsInCat]) => /* @__PURE__ */ jsxs(
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
2283
|
-
item.icon && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground [&_svg]:h-[1.1rem] [&_svg]:w-[1.1rem]", children: item.icon }),
|
|
2284
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex flex-col", children: [
|
|
2285
|
-
/* @__PURE__ */ jsx("span", { className: cn("text-[0.85rem] font-semibold", isActive ? "text-primary" : "text-foreground"), children: item.title }),
|
|
2286
|
-
item.subtitle && /* @__PURE__ */ jsx("span", { className: "text-[0.75rem] text-muted-foreground truncate", children: item.subtitle })
|
|
2287
|
-
] })
|
|
2288
|
-
] }),
|
|
2289
|
-
item.shortcut && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: item.shortcut.map((sc, scIdx) => /* @__PURE__ */ jsx(
|
|
2290
|
-
"kbd",
|
|
2291
|
-
{
|
|
2292
|
-
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",
|
|
2293
|
-
children: sc
|
|
2706
|
+
children: Object.entries(groups).map(([cat, itemsInCat]) => /* @__PURE__ */ jsxs(
|
|
2707
|
+
"div",
|
|
2708
|
+
{
|
|
2709
|
+
role: "group",
|
|
2710
|
+
"aria-labelledby": `cmd-cat-${cat}`,
|
|
2711
|
+
className: "space-y-1",
|
|
2712
|
+
children: [
|
|
2713
|
+
/* @__PURE__ */ jsx(
|
|
2714
|
+
"div",
|
|
2715
|
+
{
|
|
2716
|
+
id: `cmd-cat-${cat}`,
|
|
2717
|
+
className: "px-3 py-1 text-[0.65rem] font-bold uppercase tracking-wider text-muted-foreground",
|
|
2718
|
+
children: cat
|
|
2719
|
+
}
|
|
2720
|
+
),
|
|
2721
|
+
itemsInCat.map((item) => {
|
|
2722
|
+
const currentIdx = absoluteItemIndex++;
|
|
2723
|
+
const isActive = currentIdx === activeIndex;
|
|
2724
|
+
return /* @__PURE__ */ jsxs(
|
|
2725
|
+
"div",
|
|
2726
|
+
{
|
|
2727
|
+
id: `cmd-item-${currentIdx}`,
|
|
2728
|
+
role: "option",
|
|
2729
|
+
"aria-selected": isActive,
|
|
2730
|
+
onClick: () => {
|
|
2731
|
+
item.action();
|
|
2732
|
+
onClose();
|
|
2294
2733
|
},
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2734
|
+
className: cn(
|
|
2735
|
+
"flex items-center justify-between gap-3 px-3 py-2.5 rounded-kj-md cursor-pointer select-none transition-colors",
|
|
2736
|
+
isActive ? "bg-primary/10 text-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
2737
|
+
),
|
|
2738
|
+
children: [
|
|
2739
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
2740
|
+
item.icon && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground [&_svg]:h-[1.1rem] [&_svg]:w-[1.1rem]", children: item.icon }),
|
|
2741
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex flex-col", children: [
|
|
2742
|
+
/* @__PURE__ */ jsx(
|
|
2743
|
+
"span",
|
|
2744
|
+
{
|
|
2745
|
+
className: cn(
|
|
2746
|
+
"text-[0.85rem] font-semibold",
|
|
2747
|
+
isActive ? "text-primary" : "text-foreground"
|
|
2748
|
+
),
|
|
2749
|
+
children: item.title
|
|
2750
|
+
}
|
|
2751
|
+
),
|
|
2752
|
+
item.subtitle && /* @__PURE__ */ jsx("span", { className: "text-[0.75rem] text-muted-foreground truncate", children: item.subtitle })
|
|
2753
|
+
] })
|
|
2754
|
+
] }),
|
|
2755
|
+
item.shortcut && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: item.shortcut.map((sc, scIdx) => /* @__PURE__ */ jsx(
|
|
2756
|
+
"kbd",
|
|
2757
|
+
{
|
|
2758
|
+
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",
|
|
2759
|
+
children: sc
|
|
2760
|
+
},
|
|
2761
|
+
scIdx
|
|
2762
|
+
)) })
|
|
2763
|
+
]
|
|
2764
|
+
},
|
|
2765
|
+
item.id
|
|
2766
|
+
);
|
|
2767
|
+
})
|
|
2768
|
+
]
|
|
2769
|
+
},
|
|
2770
|
+
cat
|
|
2771
|
+
))
|
|
2303
2772
|
}
|
|
2304
2773
|
) }),
|
|
2305
2774
|
/* @__PURE__ */ 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: [
|
|
@@ -2310,7 +2779,8 @@ function CommandPalette({ open, onClose, items, placeholder = "Type a command or
|
|
|
2310
2779
|
] }),
|
|
2311
2780
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
2312
2781
|
/* @__PURE__ */ jsx("kbd", { className: "font-mono text-[9px] px-1 border rounded bg-surface", children: "Enter" }),
|
|
2313
|
-
"
|
|
2782
|
+
" ",
|
|
2783
|
+
"Select"
|
|
2314
2784
|
] })
|
|
2315
2785
|
] }),
|
|
2316
2786
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -2332,10 +2802,16 @@ function SidebarNav({ className, groups, currentHref, ...props }) {
|
|
|
2332
2802
|
const isActive = item.active || item.href && currentHref && currentHref === item.href;
|
|
2333
2803
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2334
2804
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2.5 min-w-0", children: [
|
|
2335
|
-
item.icon && /* @__PURE__ */ jsx(
|
|
2336
|
-
"
|
|
2337
|
-
|
|
2338
|
-
|
|
2805
|
+
item.icon && /* @__PURE__ */ jsx(
|
|
2806
|
+
"span",
|
|
2807
|
+
{
|
|
2808
|
+
className: cn(
|
|
2809
|
+
"[&_svg]:h-[1.1rem] [&_svg]:w-[1.1rem] shrink-0",
|
|
2810
|
+
isActive ? "text-primary" : "text-muted-foreground group-hover:text-foreground"
|
|
2811
|
+
),
|
|
2812
|
+
children: item.icon
|
|
2813
|
+
}
|
|
2814
|
+
),
|
|
2339
2815
|
/* @__PURE__ */ jsx("span", { className: "truncate", children: item.label })
|
|
2340
2816
|
] }),
|
|
2341
2817
|
item.badge && /* @__PURE__ */ jsx("span", { className: "shrink-0 flex items-center justify-center", children: item.badge })
|
|
@@ -2347,16 +2823,7 @@ function SidebarNav({ className, groups, currentHref, ...props }) {
|
|
|
2347
2823
|
if (item.href) {
|
|
2348
2824
|
return /* @__PURE__ */ jsx("a", { href: item.href, className: itemClass, children: content }, item.id);
|
|
2349
2825
|
}
|
|
2350
|
-
return /* @__PURE__ */ jsx(
|
|
2351
|
-
"button",
|
|
2352
|
-
{
|
|
2353
|
-
type: "button",
|
|
2354
|
-
onClick: item.onClick,
|
|
2355
|
-
className: itemClass,
|
|
2356
|
-
children: content
|
|
2357
|
-
},
|
|
2358
|
-
item.id
|
|
2359
|
-
);
|
|
2826
|
+
return /* @__PURE__ */ jsx("button", { type: "button", onClick: item.onClick, className: itemClass, children: content }, item.id);
|
|
2360
2827
|
}) })
|
|
2361
2828
|
] }, groupIdx)) });
|
|
2362
2829
|
}
|
|
@@ -2552,7 +3019,20 @@ function BottomSheet({
|
|
|
2552
3019
|
onClick: onClose,
|
|
2553
3020
|
"aria-label": "Close",
|
|
2554
3021
|
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",
|
|
2555
|
-
children: /* @__PURE__ */ jsx(
|
|
3022
|
+
children: /* @__PURE__ */ jsx(
|
|
3023
|
+
"svg",
|
|
3024
|
+
{
|
|
3025
|
+
width: 16,
|
|
3026
|
+
height: 16,
|
|
3027
|
+
viewBox: "0 0 24 24",
|
|
3028
|
+
fill: "none",
|
|
3029
|
+
stroke: "currentColor",
|
|
3030
|
+
strokeWidth: 2.5,
|
|
3031
|
+
strokeLinecap: "round",
|
|
3032
|
+
strokeLinejoin: "round",
|
|
3033
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
3034
|
+
}
|
|
3035
|
+
)
|
|
2556
3036
|
}
|
|
2557
3037
|
),
|
|
2558
3038
|
children
|
|
@@ -2565,19 +3045,49 @@ function BottomSheet({
|
|
|
2565
3045
|
function BottomSheetHeader({ className, ...props }) {
|
|
2566
3046
|
return /* @__PURE__ */ jsx("div", { className: cn("p-6 flex flex-col gap-1.5 border-b border-border", className), ...props });
|
|
2567
3047
|
}
|
|
2568
|
-
function BottomSheetTitle({
|
|
3048
|
+
function BottomSheetTitle({
|
|
3049
|
+
className,
|
|
3050
|
+
id,
|
|
3051
|
+
children,
|
|
3052
|
+
...props
|
|
3053
|
+
}) {
|
|
2569
3054
|
const ctx = React52.useContext(BottomSheetContext);
|
|
2570
|
-
return /* @__PURE__ */ jsx(
|
|
3055
|
+
return /* @__PURE__ */ jsx(
|
|
3056
|
+
"h2",
|
|
3057
|
+
{
|
|
3058
|
+
id: id ?? ctx?.titleId,
|
|
3059
|
+
className: cn("m-0 text-[1.15rem] font-bold tracking-[-0.01em]", className),
|
|
3060
|
+
...props,
|
|
3061
|
+
children
|
|
3062
|
+
}
|
|
3063
|
+
);
|
|
2571
3064
|
}
|
|
2572
|
-
function BottomSheetDescription({
|
|
3065
|
+
function BottomSheetDescription({
|
|
3066
|
+
className,
|
|
3067
|
+
id,
|
|
3068
|
+
...props
|
|
3069
|
+
}) {
|
|
2573
3070
|
const ctx = React52.useContext(BottomSheetContext);
|
|
2574
|
-
return /* @__PURE__ */ jsx(
|
|
3071
|
+
return /* @__PURE__ */ jsx(
|
|
3072
|
+
"p",
|
|
3073
|
+
{
|
|
3074
|
+
id: id ?? ctx?.descId,
|
|
3075
|
+
className: cn("m-0 text-[0.9rem] text-muted-foreground", className),
|
|
3076
|
+
...props
|
|
3077
|
+
}
|
|
3078
|
+
);
|
|
2575
3079
|
}
|
|
2576
3080
|
function BottomSheetContent({ className, ...props }) {
|
|
2577
3081
|
return /* @__PURE__ */ jsx("div", { className: cn("p-6 overflow-y-auto flex-1", className), ...props });
|
|
2578
3082
|
}
|
|
2579
3083
|
function BottomSheetFooter({ className, ...props }) {
|
|
2580
|
-
return /* @__PURE__ */ jsx(
|
|
3084
|
+
return /* @__PURE__ */ jsx(
|
|
3085
|
+
"div",
|
|
3086
|
+
{
|
|
3087
|
+
className: cn("p-6 border-t border-border flex gap-2.5 justify-end mt-auto", className),
|
|
3088
|
+
...props
|
|
3089
|
+
}
|
|
3090
|
+
);
|
|
2581
3091
|
}
|
|
2582
3092
|
var kbdVariants = cva(
|
|
2583
3093
|
"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",
|
|
@@ -2656,7 +3166,11 @@ var CodeBlock = React52.forwardRef(
|
|
|
2656
3166
|
}
|
|
2657
3167
|
);
|
|
2658
3168
|
CodeBlock.displayName = "CodeBlock";
|
|
2659
|
-
function Separator({
|
|
3169
|
+
function Separator({
|
|
3170
|
+
orientation = "horizontal",
|
|
3171
|
+
decorative = true,
|
|
3172
|
+
className
|
|
3173
|
+
}) {
|
|
2660
3174
|
const semanticProps = decorative ? { role: "none", "aria-hidden": true } : { role: "separator", "aria-orientation": orientation };
|
|
2661
3175
|
return /* @__PURE__ */ jsx(
|
|
2662
3176
|
"div",
|
|
@@ -2974,7 +3488,18 @@ var Combobox = React52.forwardRef(
|
|
|
2974
3488
|
removeValue(value);
|
|
2975
3489
|
},
|
|
2976
3490
|
className: "rounded-full p-0.5 leading-none hover:bg-primary/20",
|
|
2977
|
-
children: /* @__PURE__ */ jsx(
|
|
3491
|
+
children: /* @__PURE__ */ jsx(
|
|
3492
|
+
"svg",
|
|
3493
|
+
{
|
|
3494
|
+
viewBox: "0 0 24 24",
|
|
3495
|
+
className: "h-3 w-3",
|
|
3496
|
+
fill: "none",
|
|
3497
|
+
stroke: "currentColor",
|
|
3498
|
+
strokeWidth: "2.5",
|
|
3499
|
+
strokeLinecap: "round",
|
|
3500
|
+
children: /* @__PURE__ */ jsx("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
3501
|
+
}
|
|
3502
|
+
)
|
|
2978
3503
|
}
|
|
2979
3504
|
)
|
|
2980
3505
|
]
|
|
@@ -3005,7 +3530,19 @@ var Combobox = React52.forwardRef(
|
|
|
3005
3530
|
),
|
|
3006
3531
|
name && multiple && selected.map((v) => /* @__PURE__ */ jsx("input", { type: "hidden", name, value: v }, v)),
|
|
3007
3532
|
name && !multiple && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: selected[0] ?? "" }),
|
|
3008
|
-
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: /* @__PURE__ */ jsx(
|
|
3533
|
+
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: /* @__PURE__ */ jsx(
|
|
3534
|
+
"svg",
|
|
3535
|
+
{
|
|
3536
|
+
viewBox: "0 0 24 24",
|
|
3537
|
+
className: "h-4 w-4",
|
|
3538
|
+
fill: "none",
|
|
3539
|
+
stroke: "currentColor",
|
|
3540
|
+
strokeWidth: "2.5",
|
|
3541
|
+
strokeLinecap: "round",
|
|
3542
|
+
strokeLinejoin: "round",
|
|
3543
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
3544
|
+
}
|
|
3545
|
+
) })
|
|
3009
3546
|
]
|
|
3010
3547
|
}
|
|
3011
3548
|
),
|
|
@@ -3058,7 +3595,19 @@ var Combobox = React52.forwardRef(
|
|
|
3058
3595
|
),
|
|
3059
3596
|
children: [
|
|
3060
3597
|
/* @__PURE__ */ jsx("span", { children: opt.label }),
|
|
3061
|
-
isSelected && /* @__PURE__ */ jsx(
|
|
3598
|
+
isSelected && /* @__PURE__ */ jsx(
|
|
3599
|
+
"svg",
|
|
3600
|
+
{
|
|
3601
|
+
viewBox: "0 0 24 24",
|
|
3602
|
+
className: "h-4 w-4 text-primary shrink-0",
|
|
3603
|
+
fill: "none",
|
|
3604
|
+
stroke: "currentColor",
|
|
3605
|
+
strokeWidth: "2.5",
|
|
3606
|
+
strokeLinecap: "round",
|
|
3607
|
+
strokeLinejoin: "round",
|
|
3608
|
+
children: /* @__PURE__ */ jsx("path", { d: "m5 12 5 5L20 7" })
|
|
3609
|
+
}
|
|
3610
|
+
)
|
|
3062
3611
|
]
|
|
3063
3612
|
},
|
|
3064
3613
|
opt.value
|
|
@@ -3126,7 +3675,10 @@ function toISODateString(d) {
|
|
|
3126
3675
|
const day = String(d.getDate()).padStart(2, "0");
|
|
3127
3676
|
return `${y}-${m}-${day}`;
|
|
3128
3677
|
}
|
|
3129
|
-
var monthLabelFormat = new Intl.DateTimeFormat(void 0, {
|
|
3678
|
+
var monthLabelFormat = new Intl.DateTimeFormat(void 0, {
|
|
3679
|
+
month: "long",
|
|
3680
|
+
year: "numeric"
|
|
3681
|
+
});
|
|
3130
3682
|
var fullDateFormat = new Intl.DateTimeFormat(void 0, { dateStyle: "full" });
|
|
3131
3683
|
var weekdayShortFormat = new Intl.DateTimeFormat(void 0, { weekday: "short" });
|
|
3132
3684
|
var weekdayLongFormat = new Intl.DateTimeFormat(void 0, { weekday: "long" });
|
|
@@ -3134,334 +3686,387 @@ var weekdayLabels = Array.from({ length: 7 }, (_, i) => {
|
|
|
3134
3686
|
const d = addDays(startOfWeek(/* @__PURE__ */ new Date()), i);
|
|
3135
3687
|
return { key: i, short: weekdayShortFormat.format(d), long: weekdayLongFormat.format(d) };
|
|
3136
3688
|
});
|
|
3137
|
-
var CalendarGrid = React52.forwardRef(
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
next = addDays(
|
|
3160
|
-
guard
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
const selectDay = (d) => {
|
|
3165
|
-
if (isDayDisabled(d)) return;
|
|
3166
|
-
moveFocusTo(d, false);
|
|
3167
|
-
onSelectDay(d);
|
|
3168
|
-
};
|
|
3169
|
-
const onGridKeyDown = (e) => {
|
|
3170
|
-
switch (e.key) {
|
|
3171
|
-
case "ArrowRight":
|
|
3172
|
-
e.preventDefault();
|
|
3173
|
-
moveFocusTo(step(rovingTarget, 1), true);
|
|
3174
|
-
break;
|
|
3175
|
-
case "ArrowLeft":
|
|
3176
|
-
e.preventDefault();
|
|
3177
|
-
moveFocusTo(step(rovingTarget, -1), true);
|
|
3178
|
-
break;
|
|
3179
|
-
case "ArrowDown":
|
|
3180
|
-
e.preventDefault();
|
|
3181
|
-
moveFocusTo(step(rovingTarget, 7), true);
|
|
3182
|
-
break;
|
|
3183
|
-
case "ArrowUp":
|
|
3184
|
-
e.preventDefault();
|
|
3185
|
-
moveFocusTo(step(rovingTarget, -7), true);
|
|
3186
|
-
break;
|
|
3187
|
-
case "Home": {
|
|
3188
|
-
e.preventDefault();
|
|
3189
|
-
const target = startOfWeek(rovingTarget);
|
|
3190
|
-
moveFocusTo(isDayDisabled(target) ? step(target, 1) : target, true);
|
|
3191
|
-
break;
|
|
3192
|
-
}
|
|
3193
|
-
case "End": {
|
|
3194
|
-
e.preventDefault();
|
|
3195
|
-
const target = addDays(startOfWeek(rovingTarget), 6);
|
|
3196
|
-
moveFocusTo(isDayDisabled(target) ? step(target, -1) : target, true);
|
|
3197
|
-
break;
|
|
3198
|
-
}
|
|
3199
|
-
case "PageUp": {
|
|
3200
|
-
e.preventDefault();
|
|
3201
|
-
const target = e.shiftKey ? addYearsClamped(rovingTarget, -1) : addMonthsClamped(rovingTarget, -1);
|
|
3202
|
-
moveFocusTo(isDayDisabled(target) ? step(target, -1) : target, true);
|
|
3203
|
-
break;
|
|
3689
|
+
var CalendarGrid = React52.forwardRef(
|
|
3690
|
+
function CalendarGrid2({ viewMonth, isDayDisabled, cellState, onSelectDay, onFocusDay, initialFocusDate, className }, ref) {
|
|
3691
|
+
const gridDays = React52.useMemo(() => buildGridDays(viewMonth), [viewMonth]);
|
|
3692
|
+
const inViewMonth = (d) => d.getMonth() === viewMonth.getMonth() && d.getFullYear() === viewMonth.getFullYear();
|
|
3693
|
+
const [focusedDate, setFocusedDate] = React52.useState(() => startOfDay(initialFocusDate));
|
|
3694
|
+
const pendingFocusRef = React52.useRef(false);
|
|
3695
|
+
const gridRef = React52.useRef(null);
|
|
3696
|
+
const rovingTarget = inViewMonth(focusedDate) && !isDayDisabled(focusedDate) ? focusedDate : gridDays.find((d) => inViewMonth(d) && !isDayDisabled(d)) ?? gridDays.find((d) => inViewMonth(d)) ?? gridDays[0];
|
|
3697
|
+
const moveFocusTo = (next, viaKeyboard) => {
|
|
3698
|
+
pendingFocusRef.current = viaKeyboard;
|
|
3699
|
+
setFocusedDate(next);
|
|
3700
|
+
onFocusDay?.(next);
|
|
3701
|
+
};
|
|
3702
|
+
React52.useEffect(() => {
|
|
3703
|
+
if (!pendingFocusRef.current) return;
|
|
3704
|
+
pendingFocusRef.current = false;
|
|
3705
|
+
const el = gridRef.current?.querySelector(
|
|
3706
|
+
`[data-date="${dateKey(rovingTarget)}"]`
|
|
3707
|
+
);
|
|
3708
|
+
el?.focus();
|
|
3709
|
+
}, [rovingTarget]);
|
|
3710
|
+
const step = (from, delta) => {
|
|
3711
|
+
let next = addDays(from, delta);
|
|
3712
|
+
let guard = 0;
|
|
3713
|
+
while (isDayDisabled(next) && guard < 1e3) {
|
|
3714
|
+
next = addDays(next, delta);
|
|
3715
|
+
guard++;
|
|
3204
3716
|
}
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3717
|
+
return isDayDisabled(next) ? from : next;
|
|
3718
|
+
};
|
|
3719
|
+
const selectDay = (d) => {
|
|
3720
|
+
if (isDayDisabled(d)) return;
|
|
3721
|
+
moveFocusTo(d, false);
|
|
3722
|
+
onSelectDay(d);
|
|
3723
|
+
};
|
|
3724
|
+
const onGridKeyDown = (e) => {
|
|
3725
|
+
switch (e.key) {
|
|
3726
|
+
case "ArrowRight":
|
|
3727
|
+
e.preventDefault();
|
|
3728
|
+
moveFocusTo(step(rovingTarget, 1), true);
|
|
3729
|
+
break;
|
|
3730
|
+
case "ArrowLeft":
|
|
3731
|
+
e.preventDefault();
|
|
3732
|
+
moveFocusTo(step(rovingTarget, -1), true);
|
|
3733
|
+
break;
|
|
3734
|
+
case "ArrowDown":
|
|
3735
|
+
e.preventDefault();
|
|
3736
|
+
moveFocusTo(step(rovingTarget, 7), true);
|
|
3737
|
+
break;
|
|
3738
|
+
case "ArrowUp":
|
|
3739
|
+
e.preventDefault();
|
|
3740
|
+
moveFocusTo(step(rovingTarget, -7), true);
|
|
3741
|
+
break;
|
|
3742
|
+
case "Home": {
|
|
3743
|
+
e.preventDefault();
|
|
3744
|
+
const target = startOfWeek(rovingTarget);
|
|
3745
|
+
moveFocusTo(isDayDisabled(target) ? step(target, 1) : target, true);
|
|
3746
|
+
break;
|
|
3747
|
+
}
|
|
3748
|
+
case "End": {
|
|
3749
|
+
e.preventDefault();
|
|
3750
|
+
const target = addDays(startOfWeek(rovingTarget), 6);
|
|
3751
|
+
moveFocusTo(isDayDisabled(target) ? step(target, -1) : target, true);
|
|
3752
|
+
break;
|
|
3753
|
+
}
|
|
3754
|
+
case "PageUp": {
|
|
3755
|
+
e.preventDefault();
|
|
3756
|
+
const target = e.shiftKey ? addYearsClamped(rovingTarget, -1) : addMonthsClamped(rovingTarget, -1);
|
|
3757
|
+
moveFocusTo(isDayDisabled(target) ? step(target, -1) : target, true);
|
|
3758
|
+
break;
|
|
3759
|
+
}
|
|
3760
|
+
case "PageDown": {
|
|
3761
|
+
e.preventDefault();
|
|
3762
|
+
const target = e.shiftKey ? addYearsClamped(rovingTarget, 1) : addMonthsClamped(rovingTarget, 1);
|
|
3763
|
+
moveFocusTo(isDayDisabled(target) ? step(target, 1) : target, true);
|
|
3764
|
+
break;
|
|
3765
|
+
}
|
|
3766
|
+
case "Enter":
|
|
3767
|
+
case " ":
|
|
3768
|
+
e.preventDefault();
|
|
3769
|
+
selectDay(rovingTarget);
|
|
3770
|
+
break;
|
|
3210
3771
|
}
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
e.preventDefault();
|
|
3214
|
-
selectDay(rovingTarget);
|
|
3215
|
-
break;
|
|
3216
|
-
}
|
|
3217
|
-
};
|
|
3218
|
-
return /* @__PURE__ */ jsx("div", { ref, className: cn(className), children: /* @__PURE__ */ jsxs("div", { ref: gridRef, role: "grid", "aria-label": monthLabelFormat.format(viewMonth), onKeyDown: onGridKeyDown, children: [
|
|
3219
|
-
/* @__PURE__ */ jsx("div", { role: "row", className: "grid grid-cols-7", children: weekdayLabels.map((w) => /* @__PURE__ */ jsx(
|
|
3772
|
+
};
|
|
3773
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn(className), children: /* @__PURE__ */ jsxs(
|
|
3220
3774
|
"div",
|
|
3221
3775
|
{
|
|
3222
|
-
|
|
3223
|
-
"
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3776
|
+
ref: gridRef,
|
|
3777
|
+
role: "grid",
|
|
3778
|
+
"aria-label": monthLabelFormat.format(viewMonth),
|
|
3779
|
+
onKeyDown: onGridKeyDown,
|
|
3780
|
+
children: [
|
|
3781
|
+
/* @__PURE__ */ jsx("div", { role: "row", className: "grid grid-cols-7", children: weekdayLabels.map((w) => /* @__PURE__ */ jsx(
|
|
3782
|
+
"div",
|
|
3783
|
+
{
|
|
3784
|
+
role: "columnheader",
|
|
3785
|
+
"aria-label": w.long,
|
|
3786
|
+
className: "h-8 flex items-center justify-center text-xs font-medium text-muted-foreground",
|
|
3787
|
+
children: w.short
|
|
3788
|
+
},
|
|
3789
|
+
w.key
|
|
3790
|
+
)) }),
|
|
3791
|
+
Array.from({ length: 6 }, (_, week) => /* @__PURE__ */ jsx("div", { role: "row", className: "grid grid-cols-7", children: gridDays.slice(week * 7, week * 7 + 7).map((day) => {
|
|
3792
|
+
if (!inViewMonth(day)) {
|
|
3793
|
+
return /* @__PURE__ */ jsx("div", { role: "gridcell", "aria-hidden": "true", className: "h-9" }, dateKey(day));
|
|
3794
|
+
}
|
|
3795
|
+
const disabled = isDayDisabled(day);
|
|
3796
|
+
const state = cellState(day);
|
|
3797
|
+
const isRoving = isSameDay(day, rovingTarget);
|
|
3798
|
+
const isEndpoint = !!(state.selected || state.rangeStart || state.rangeEnd);
|
|
3799
|
+
return /* @__PURE__ */ jsx(
|
|
3800
|
+
"button",
|
|
3801
|
+
{
|
|
3802
|
+
type: "button",
|
|
3803
|
+
role: "gridcell",
|
|
3804
|
+
"data-date": dateKey(day),
|
|
3805
|
+
tabIndex: isRoving ? 0 : -1,
|
|
3806
|
+
"aria-selected": isEndpoint,
|
|
3807
|
+
"aria-disabled": disabled || void 0,
|
|
3808
|
+
"aria-label": fullDateFormat.format(day),
|
|
3809
|
+
onMouseEnter: () => onFocusDay?.(day),
|
|
3810
|
+
onClick: () => selectDay(day),
|
|
3811
|
+
className: cn(
|
|
3812
|
+
"h-9 w-9 mx-auto flex items-center justify-center text-sm",
|
|
3813
|
+
state.inRange && !isEndpoint ? "rounded-none" : "rounded-full",
|
|
3814
|
+
"focus:outline-none focus:ring-[3px] focus:ring-ring/30",
|
|
3815
|
+
disabled && "text-muted-foreground opacity-40 cursor-not-allowed",
|
|
3816
|
+
!disabled && isEndpoint && "bg-primary text-primary-foreground",
|
|
3817
|
+
!disabled && state.inRange && !isEndpoint && "bg-primary/15 text-foreground",
|
|
3818
|
+
!disabled && !isEndpoint && !state.inRange && state.today && "ring-1 ring-primary text-primary font-medium",
|
|
3819
|
+
!disabled && !isEndpoint && !state.inRange && !state.today && "text-foreground hover:bg-muted"
|
|
3820
|
+
),
|
|
3821
|
+
children: day.getDate()
|
|
3822
|
+
},
|
|
3823
|
+
dateKey(day)
|
|
3824
|
+
);
|
|
3825
|
+
}) }, week))
|
|
3826
|
+
]
|
|
3232
3827
|
}
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3828
|
+
) });
|
|
3829
|
+
}
|
|
3830
|
+
);
|
|
3831
|
+
CalendarGrid.displayName = "CalendarGrid";
|
|
3832
|
+
var Calendar = React52.forwardRef(function Calendar2({
|
|
3833
|
+
value,
|
|
3834
|
+
defaultValue,
|
|
3835
|
+
onChange,
|
|
3836
|
+
month,
|
|
3837
|
+
defaultMonth,
|
|
3838
|
+
onMonthChange,
|
|
3839
|
+
min,
|
|
3840
|
+
max,
|
|
3841
|
+
disabledDates,
|
|
3842
|
+
className
|
|
3843
|
+
}, ref) {
|
|
3844
|
+
const controlled = value !== void 0;
|
|
3845
|
+
const [internalValue, setInternalValue] = React52.useState(defaultValue);
|
|
3846
|
+
const selected = controlled ? value : internalValue;
|
|
3847
|
+
const monthControlled = month !== void 0;
|
|
3848
|
+
const [internalMonth, setInternalMonth] = React52.useState(
|
|
3849
|
+
() => startOfMonth(month ?? defaultMonth ?? selected ?? /* @__PURE__ */ new Date())
|
|
3850
|
+
);
|
|
3851
|
+
const viewMonth = monthControlled ? startOfMonth(month) : internalMonth;
|
|
3852
|
+
const setViewMonth = (next) => {
|
|
3853
|
+
const normalized = startOfMonth(next);
|
|
3854
|
+
if (!monthControlled) setInternalMonth(normalized);
|
|
3855
|
+
onMonthChange?.(normalized);
|
|
3856
|
+
};
|
|
3857
|
+
const isDayDisabled = React52.useCallback(
|
|
3858
|
+
(d) => {
|
|
3859
|
+
if (min && d < startOfDay(min)) return true;
|
|
3860
|
+
if (max && d > startOfDay(max)) return true;
|
|
3861
|
+
return disabledDates?.(d) ?? false;
|
|
3862
|
+
},
|
|
3863
|
+
[min, max, disabledDates]
|
|
3864
|
+
);
|
|
3865
|
+
const commitValue = (d) => {
|
|
3866
|
+
if (!controlled) setInternalValue(d);
|
|
3867
|
+
onChange?.(d);
|
|
3868
|
+
};
|
|
3869
|
+
const today = /* @__PURE__ */ new Date();
|
|
3870
|
+
const cellState = (d) => ({
|
|
3871
|
+
selected: selected ? isSameDay(d, selected) : false,
|
|
3872
|
+
today: isSameDay(d, today)
|
|
3873
|
+
});
|
|
3874
|
+
const inViewMonth = (d) => d.getMonth() === viewMonth.getMonth() && d.getFullYear() === viewMonth.getFullYear();
|
|
3875
|
+
const handleFocusDay = (d) => {
|
|
3876
|
+
if (!inViewMonth(d)) setViewMonth(d);
|
|
3877
|
+
};
|
|
3878
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("w-[280px] select-none", className), children: [
|
|
3879
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
3880
|
+
/* @__PURE__ */ jsx(
|
|
3238
3881
|
"button",
|
|
3239
3882
|
{
|
|
3240
3883
|
type: "button",
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
},
|
|
3261
|
-
dateKey(day)
|
|
3262
|
-
);
|
|
3263
|
-
}) }, week))
|
|
3264
|
-
] }) });
|
|
3265
|
-
});
|
|
3266
|
-
CalendarGrid.displayName = "CalendarGrid";
|
|
3267
|
-
var Calendar = React52.forwardRef(
|
|
3268
|
-
function Calendar2({ value, defaultValue, onChange, month, defaultMonth, onMonthChange, min, max, disabledDates, className }, ref) {
|
|
3269
|
-
const controlled = value !== void 0;
|
|
3270
|
-
const [internalValue, setInternalValue] = React52.useState(defaultValue);
|
|
3271
|
-
const selected = controlled ? value : internalValue;
|
|
3272
|
-
const monthControlled = month !== void 0;
|
|
3273
|
-
const [internalMonth, setInternalMonth] = React52.useState(
|
|
3274
|
-
() => startOfMonth(month ?? defaultMonth ?? selected ?? /* @__PURE__ */ new Date())
|
|
3275
|
-
);
|
|
3276
|
-
const viewMonth = monthControlled ? startOfMonth(month) : internalMonth;
|
|
3277
|
-
const setViewMonth = (next) => {
|
|
3278
|
-
const normalized = startOfMonth(next);
|
|
3279
|
-
if (!monthControlled) setInternalMonth(normalized);
|
|
3280
|
-
onMonthChange?.(normalized);
|
|
3281
|
-
};
|
|
3282
|
-
const isDayDisabled = React52.useCallback(
|
|
3283
|
-
(d) => {
|
|
3284
|
-
if (min && d < startOfDay(min)) return true;
|
|
3285
|
-
if (max && d > startOfDay(max)) return true;
|
|
3286
|
-
return disabledDates?.(d) ?? false;
|
|
3287
|
-
},
|
|
3288
|
-
[min, max, disabledDates]
|
|
3289
|
-
);
|
|
3290
|
-
const commitValue = (d) => {
|
|
3291
|
-
if (!controlled) setInternalValue(d);
|
|
3292
|
-
onChange?.(d);
|
|
3293
|
-
};
|
|
3294
|
-
const today = /* @__PURE__ */ new Date();
|
|
3295
|
-
const cellState = (d) => ({
|
|
3296
|
-
selected: selected ? isSameDay(d, selected) : false,
|
|
3297
|
-
today: isSameDay(d, today)
|
|
3298
|
-
});
|
|
3299
|
-
const inViewMonth = (d) => d.getMonth() === viewMonth.getMonth() && d.getFullYear() === viewMonth.getFullYear();
|
|
3300
|
-
const handleFocusDay = (d) => {
|
|
3301
|
-
if (!inViewMonth(d)) setViewMonth(d);
|
|
3302
|
-
};
|
|
3303
|
-
return /* @__PURE__ */ jsxs("div", { ref, className: cn("w-[280px] select-none", className), children: [
|
|
3304
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
3305
|
-
/* @__PURE__ */ jsx(
|
|
3306
|
-
"button",
|
|
3307
|
-
{
|
|
3308
|
-
type: "button",
|
|
3309
|
-
"aria-label": "Previous month",
|
|
3310
|
-
onClick: () => setViewMonth(addMonths(viewMonth, -1)),
|
|
3311
|
-
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3312
|
-
children: /* @__PURE__ */ 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__ */ jsx("path", { d: "m15 18-6-6 6-6" }) })
|
|
3313
|
-
}
|
|
3314
|
-
),
|
|
3315
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(viewMonth) }),
|
|
3316
|
-
/* @__PURE__ */ jsx(
|
|
3317
|
-
"button",
|
|
3318
|
-
{
|
|
3319
|
-
type: "button",
|
|
3320
|
-
"aria-label": "Next month",
|
|
3321
|
-
onClick: () => setViewMonth(addMonths(viewMonth, 1)),
|
|
3322
|
-
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3323
|
-
children: /* @__PURE__ */ 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__ */ jsx("path", { d: "m9 18 6-6-6-6" }) })
|
|
3324
|
-
}
|
|
3325
|
-
)
|
|
3326
|
-
] }),
|
|
3884
|
+
"aria-label": "Previous month",
|
|
3885
|
+
onClick: () => setViewMonth(addMonths(viewMonth, -1)),
|
|
3886
|
+
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3887
|
+
children: /* @__PURE__ */ jsx(
|
|
3888
|
+
"svg",
|
|
3889
|
+
{
|
|
3890
|
+
viewBox: "0 0 24 24",
|
|
3891
|
+
className: "h-4 w-4",
|
|
3892
|
+
fill: "none",
|
|
3893
|
+
stroke: "currentColor",
|
|
3894
|
+
strokeWidth: "2.5",
|
|
3895
|
+
strokeLinecap: "round",
|
|
3896
|
+
strokeLinejoin: "round",
|
|
3897
|
+
children: /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" })
|
|
3898
|
+
}
|
|
3899
|
+
)
|
|
3900
|
+
}
|
|
3901
|
+
),
|
|
3902
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(viewMonth) }),
|
|
3327
3903
|
/* @__PURE__ */ jsx(
|
|
3328
|
-
|
|
3904
|
+
"button",
|
|
3329
3905
|
{
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3906
|
+
type: "button",
|
|
3907
|
+
"aria-label": "Next month",
|
|
3908
|
+
onClick: () => setViewMonth(addMonths(viewMonth, 1)),
|
|
3909
|
+
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3910
|
+
children: /* @__PURE__ */ jsx(
|
|
3911
|
+
"svg",
|
|
3912
|
+
{
|
|
3913
|
+
viewBox: "0 0 24 24",
|
|
3914
|
+
className: "h-4 w-4",
|
|
3915
|
+
fill: "none",
|
|
3916
|
+
stroke: "currentColor",
|
|
3917
|
+
strokeWidth: "2.5",
|
|
3918
|
+
strokeLinecap: "round",
|
|
3919
|
+
strokeLinejoin: "round",
|
|
3920
|
+
children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
3921
|
+
}
|
|
3922
|
+
)
|
|
3336
3923
|
}
|
|
3337
3924
|
)
|
|
3338
|
-
] })
|
|
3339
|
-
|
|
3340
|
-
|
|
3925
|
+
] }),
|
|
3926
|
+
/* @__PURE__ */ jsx(
|
|
3927
|
+
CalendarGrid,
|
|
3928
|
+
{
|
|
3929
|
+
viewMonth,
|
|
3930
|
+
isDayDisabled,
|
|
3931
|
+
cellState,
|
|
3932
|
+
onSelectDay: commitValue,
|
|
3933
|
+
onFocusDay: handleFocusDay,
|
|
3934
|
+
initialFocusDate: selected ?? /* @__PURE__ */ new Date()
|
|
3935
|
+
}
|
|
3936
|
+
)
|
|
3937
|
+
] });
|
|
3938
|
+
});
|
|
3341
3939
|
Calendar.displayName = "Calendar";
|
|
3342
3940
|
var displayFormat = new Intl.DateTimeFormat(void 0, { dateStyle: "medium" });
|
|
3343
|
-
var DatePicker = React52.forwardRef(
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3941
|
+
var DatePicker = React52.forwardRef(function DatePicker2({
|
|
3942
|
+
value,
|
|
3943
|
+
defaultValue,
|
|
3944
|
+
onChange,
|
|
3945
|
+
min,
|
|
3946
|
+
max,
|
|
3947
|
+
disabledDates,
|
|
3948
|
+
placeholder = "Pick a date\u2026",
|
|
3949
|
+
disabled = false,
|
|
3950
|
+
error = false,
|
|
3951
|
+
required = false,
|
|
3952
|
+
className,
|
|
3953
|
+
id,
|
|
3954
|
+
name,
|
|
3955
|
+
"aria-describedby": describedBy
|
|
3956
|
+
}, ref) {
|
|
3957
|
+
const controlled = value !== void 0;
|
|
3958
|
+
const [internalValue, setInternalValue] = React52.useState(defaultValue);
|
|
3959
|
+
const selected = controlled ? value : internalValue;
|
|
3960
|
+
const [open, setOpen] = React52.useState(false);
|
|
3961
|
+
const containerRef = React52.useRef(null);
|
|
3962
|
+
const triggerRef = React52.useRef(null);
|
|
3963
|
+
const setTriggerRef = (node) => {
|
|
3964
|
+
triggerRef.current = node;
|
|
3965
|
+
if (typeof ref === "function") ref(node);
|
|
3966
|
+
else if (ref) ref.current = node;
|
|
3967
|
+
};
|
|
3968
|
+
const commitValue = (d) => {
|
|
3969
|
+
if (!controlled) setInternalValue(d);
|
|
3970
|
+
onChange?.(d);
|
|
3971
|
+
};
|
|
3972
|
+
const closePopup = React52.useCallback(() => setOpen(false), []);
|
|
3973
|
+
const openPopup = () => {
|
|
3974
|
+
if (!disabled) setOpen(true);
|
|
3975
|
+
};
|
|
3976
|
+
const handleCalendarChange = (d) => {
|
|
3977
|
+
commitValue(d);
|
|
3978
|
+
closePopup();
|
|
3979
|
+
triggerRef.current?.focus();
|
|
3980
|
+
};
|
|
3981
|
+
React52.useEffect(() => {
|
|
3982
|
+
if (!open) return;
|
|
3983
|
+
const onDown = (e) => {
|
|
3984
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) closePopup();
|
|
3378
3985
|
};
|
|
3379
|
-
|
|
3380
|
-
|
|
3986
|
+
document.addEventListener("mousedown", onDown);
|
|
3987
|
+
return () => document.removeEventListener("mousedown", onDown);
|
|
3988
|
+
}, [open, closePopup]);
|
|
3989
|
+
const onTriggerKeyDown = (e) => {
|
|
3990
|
+
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
3991
|
+
e.preventDefault();
|
|
3992
|
+
openPopup();
|
|
3993
|
+
} else if (e.key === "Escape" && open) {
|
|
3994
|
+
e.preventDefault();
|
|
3995
|
+
closePopup();
|
|
3996
|
+
}
|
|
3997
|
+
};
|
|
3998
|
+
const onPanelKeyDown = (e) => {
|
|
3999
|
+
if (e.key === "Escape") {
|
|
4000
|
+
e.preventDefault();
|
|
3381
4001
|
closePopup();
|
|
3382
4002
|
triggerRef.current?.focus();
|
|
3383
|
-
}
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
closePopup()
|
|
4003
|
+
}
|
|
4004
|
+
};
|
|
4005
|
+
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: cn("relative inline-block w-full", className), children: [
|
|
4006
|
+
/* @__PURE__ */ jsxs(
|
|
4007
|
+
"button",
|
|
4008
|
+
{
|
|
4009
|
+
ref: setTriggerRef,
|
|
4010
|
+
type: "button",
|
|
4011
|
+
id,
|
|
4012
|
+
disabled,
|
|
4013
|
+
"aria-haspopup": "grid",
|
|
4014
|
+
"aria-expanded": open,
|
|
4015
|
+
"aria-invalid": error || void 0,
|
|
4016
|
+
"aria-required": required || void 0,
|
|
4017
|
+
"aria-describedby": describedBy,
|
|
4018
|
+
onClick: () => open ? closePopup() : openPopup(),
|
|
4019
|
+
onKeyDown: onTriggerKeyDown,
|
|
4020
|
+
className: cn(
|
|
4021
|
+
"w-full flex items-center justify-between gap-2 border rounded-kj-md bg-surface text-left text-sm",
|
|
4022
|
+
"pl-[0.85rem] pr-3 py-[calc(0.6rem*var(--kj-density,1))]",
|
|
4023
|
+
"transition-[border-color,box-shadow] duration-150",
|
|
4024
|
+
"focus:outline-none focus:border-ring focus:ring-[3px] focus:ring-ring/30",
|
|
4025
|
+
disabled && "bg-muted text-muted-foreground cursor-not-allowed",
|
|
4026
|
+
error ? "border-danger" : "border-input",
|
|
4027
|
+
!selected && "text-muted-foreground"
|
|
4028
|
+
),
|
|
4029
|
+
children: [
|
|
4030
|
+
/* @__PURE__ */ jsx("span", { children: selected ? displayFormat.format(selected) : placeholder }),
|
|
4031
|
+
/* @__PURE__ */ jsxs(
|
|
4032
|
+
"svg",
|
|
4033
|
+
{
|
|
4034
|
+
viewBox: "0 0 24 24",
|
|
4035
|
+
className: "h-4 w-4 text-muted-foreground shrink-0",
|
|
4036
|
+
fill: "none",
|
|
4037
|
+
stroke: "currentColor",
|
|
4038
|
+
strokeWidth: "2",
|
|
4039
|
+
strokeLinecap: "round",
|
|
4040
|
+
strokeLinejoin: "round",
|
|
4041
|
+
children: [
|
|
4042
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
4043
|
+
/* @__PURE__ */ jsx("path", { d: "M3 10h18M8 2v4M16 2v4" })
|
|
4044
|
+
]
|
|
4045
|
+
}
|
|
4046
|
+
)
|
|
4047
|
+
]
|
|
3399
4048
|
}
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
4049
|
+
),
|
|
4050
|
+
name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: selected ? toISODateString(selected) : "" }),
|
|
4051
|
+
open && /* @__PURE__ */ jsx(
|
|
4052
|
+
"div",
|
|
4053
|
+
{
|
|
4054
|
+
onKeyDown: onPanelKeyDown,
|
|
4055
|
+
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]",
|
|
4056
|
+
children: /* @__PURE__ */ jsx(
|
|
4057
|
+
Calendar,
|
|
4058
|
+
{
|
|
4059
|
+
value: selected,
|
|
4060
|
+
onChange: handleCalendarChange,
|
|
4061
|
+
min,
|
|
4062
|
+
max,
|
|
4063
|
+
disabledDates
|
|
4064
|
+
}
|
|
4065
|
+
)
|
|
3406
4066
|
}
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
"button",
|
|
3411
|
-
{
|
|
3412
|
-
ref: setTriggerRef,
|
|
3413
|
-
type: "button",
|
|
3414
|
-
id,
|
|
3415
|
-
disabled,
|
|
3416
|
-
"aria-haspopup": "grid",
|
|
3417
|
-
"aria-expanded": open,
|
|
3418
|
-
"aria-invalid": error || void 0,
|
|
3419
|
-
"aria-required": required || void 0,
|
|
3420
|
-
"aria-describedby": describedBy,
|
|
3421
|
-
onClick: () => open ? closePopup() : openPopup(),
|
|
3422
|
-
onKeyDown: onTriggerKeyDown,
|
|
3423
|
-
className: cn(
|
|
3424
|
-
"w-full flex items-center justify-between gap-2 border rounded-kj-md bg-surface text-left text-sm",
|
|
3425
|
-
"pl-[0.85rem] pr-3 py-[calc(0.6rem*var(--kj-density,1))]",
|
|
3426
|
-
"transition-[border-color,box-shadow] duration-150",
|
|
3427
|
-
"focus:outline-none focus:border-ring focus:ring-[3px] focus:ring-ring/30",
|
|
3428
|
-
disabled && "bg-muted text-muted-foreground cursor-not-allowed",
|
|
3429
|
-
error ? "border-danger" : "border-input",
|
|
3430
|
-
!selected && "text-muted-foreground"
|
|
3431
|
-
),
|
|
3432
|
-
children: [
|
|
3433
|
-
/* @__PURE__ */ jsx("span", { children: selected ? displayFormat.format(selected) : placeholder }),
|
|
3434
|
-
/* @__PURE__ */ jsxs(
|
|
3435
|
-
"svg",
|
|
3436
|
-
{
|
|
3437
|
-
viewBox: "0 0 24 24",
|
|
3438
|
-
className: "h-4 w-4 text-muted-foreground shrink-0",
|
|
3439
|
-
fill: "none",
|
|
3440
|
-
stroke: "currentColor",
|
|
3441
|
-
strokeWidth: "2",
|
|
3442
|
-
strokeLinecap: "round",
|
|
3443
|
-
strokeLinejoin: "round",
|
|
3444
|
-
children: [
|
|
3445
|
-
/* @__PURE__ */ jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
3446
|
-
/* @__PURE__ */ jsx("path", { d: "M3 10h18M8 2v4M16 2v4" })
|
|
3447
|
-
]
|
|
3448
|
-
}
|
|
3449
|
-
)
|
|
3450
|
-
]
|
|
3451
|
-
}
|
|
3452
|
-
),
|
|
3453
|
-
name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: selected ? toISODateString(selected) : "" }),
|
|
3454
|
-
open && /* @__PURE__ */ jsx(
|
|
3455
|
-
"div",
|
|
3456
|
-
{
|
|
3457
|
-
onKeyDown: onPanelKeyDown,
|
|
3458
|
-
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]",
|
|
3459
|
-
children: /* @__PURE__ */ jsx(Calendar, { value: selected, onChange: handleCalendarChange, min, max, disabledDates })
|
|
3460
|
-
}
|
|
3461
|
-
)
|
|
3462
|
-
] });
|
|
3463
|
-
}
|
|
3464
|
-
);
|
|
4067
|
+
)
|
|
4068
|
+
] });
|
|
4069
|
+
});
|
|
3465
4070
|
DatePicker.displayName = "DatePicker";
|
|
3466
4071
|
var DatePickerField = React52.forwardRef(
|
|
3467
4072
|
function DatePickerField2({ label, hint, error, required, className, ...props }, ref) {
|
|
@@ -3474,7 +4079,19 @@ function isBetweenExclusive(d, lo, hi) {
|
|
|
3474
4079
|
return t > startOfDay(lo).getTime() && t < startOfDay(hi).getTime();
|
|
3475
4080
|
}
|
|
3476
4081
|
var RangeCalendar = React52.forwardRef(
|
|
3477
|
-
function RangeCalendar2({
|
|
4082
|
+
function RangeCalendar2({
|
|
4083
|
+
value,
|
|
4084
|
+
defaultValue,
|
|
4085
|
+
onChange,
|
|
4086
|
+
month,
|
|
4087
|
+
defaultMonth,
|
|
4088
|
+
onMonthChange,
|
|
4089
|
+
min,
|
|
4090
|
+
max,
|
|
4091
|
+
disabledDates,
|
|
4092
|
+
singleMonth,
|
|
4093
|
+
className
|
|
4094
|
+
}, ref) {
|
|
3478
4095
|
const controlled = value !== void 0;
|
|
3479
4096
|
const [internalValue, setInternalValue] = React52.useState(defaultValue ?? {});
|
|
3480
4097
|
const range2 = controlled ? value : internalValue;
|
|
@@ -3559,47 +4176,70 @@ var RangeCalendar = React52.forwardRef(
|
|
|
3559
4176
|
"aria-label": direction === "prev" ? "Previous month" : "Next month",
|
|
3560
4177
|
onClick: () => setViewMonth(addMonths(leftMonth, direction === "prev" ? -1 : 1)),
|
|
3561
4178
|
className: "p-1.5 rounded-kj-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3562
|
-
children: /* @__PURE__ */ jsx(
|
|
3563
|
-
|
|
3564
|
-
);
|
|
3565
|
-
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex gap-6 select-none", className), children: [
|
|
3566
|
-
/* @__PURE__ */ jsxs("div", { className: "w-[280px]", children: [
|
|
3567
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
3568
|
-
navButton("prev"),
|
|
3569
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(leftMonth) }),
|
|
3570
|
-
/* @__PURE__ */ jsx("span", { className: "w-[26px]", "aria-hidden": "true" })
|
|
3571
|
-
] }),
|
|
3572
|
-
/* @__PURE__ */ jsx(
|
|
3573
|
-
CalendarGrid,
|
|
3574
|
-
{
|
|
3575
|
-
viewMonth: leftMonth,
|
|
3576
|
-
isDayDisabled,
|
|
3577
|
-
cellState,
|
|
3578
|
-
onSelectDay: handleSelectDay,
|
|
3579
|
-
onFocusDay: handleFocusDay,
|
|
3580
|
-
initialFocusDate: pendingStart ?? range2.start ?? /* @__PURE__ */ new Date()
|
|
3581
|
-
}
|
|
3582
|
-
)
|
|
3583
|
-
] }),
|
|
3584
|
-
/* @__PURE__ */ jsxs("div", { className: "w-[280px]", children: [
|
|
3585
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
3586
|
-
/* @__PURE__ */ jsx("span", { className: "w-[26px]", "aria-hidden": "true" }),
|
|
3587
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(rightMonth) }),
|
|
3588
|
-
navButton("next")
|
|
3589
|
-
] }),
|
|
3590
|
-
/* @__PURE__ */ jsx(
|
|
3591
|
-
CalendarGrid,
|
|
4179
|
+
children: /* @__PURE__ */ jsx(
|
|
4180
|
+
"svg",
|
|
3592
4181
|
{
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
4182
|
+
viewBox: "0 0 24 24",
|
|
4183
|
+
className: "h-4 w-4",
|
|
4184
|
+
fill: "none",
|
|
4185
|
+
stroke: "currentColor",
|
|
4186
|
+
strokeWidth: "2.5",
|
|
4187
|
+
strokeLinecap: "round",
|
|
4188
|
+
strokeLinejoin: "round",
|
|
4189
|
+
children: direction === "prev" ? /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" }) : /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
3599
4190
|
}
|
|
3600
4191
|
)
|
|
3601
|
-
|
|
3602
|
-
|
|
4192
|
+
}
|
|
4193
|
+
);
|
|
4194
|
+
const showSingleMonth = singleMonth;
|
|
4195
|
+
return /* @__PURE__ */ jsxs(
|
|
4196
|
+
"div",
|
|
4197
|
+
{
|
|
4198
|
+
ref,
|
|
4199
|
+
className: cn(
|
|
4200
|
+
"flex flex-col sm:flex-row gap-4 sm:gap-6 select-none max-w-full overflow-hidden",
|
|
4201
|
+
className
|
|
4202
|
+
),
|
|
4203
|
+
children: [
|
|
4204
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full sm:w-[280px]", children: [
|
|
4205
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
4206
|
+
navButton("prev"),
|
|
4207
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(leftMonth) }),
|
|
4208
|
+
/* @__PURE__ */ jsx("span", { className: showSingleMonth ? "" : "sm:hidden", children: navButton("next") })
|
|
4209
|
+
] }),
|
|
4210
|
+
/* @__PURE__ */ jsx(
|
|
4211
|
+
CalendarGrid,
|
|
4212
|
+
{
|
|
4213
|
+
viewMonth: leftMonth,
|
|
4214
|
+
isDayDisabled,
|
|
4215
|
+
cellState,
|
|
4216
|
+
onSelectDay: handleSelectDay,
|
|
4217
|
+
onFocusDay: handleFocusDay,
|
|
4218
|
+
initialFocusDate: pendingStart ?? range2.start ?? /* @__PURE__ */ new Date()
|
|
4219
|
+
}
|
|
4220
|
+
)
|
|
4221
|
+
] }),
|
|
4222
|
+
!showSingleMonth && /* @__PURE__ */ jsxs("div", { className: "hidden sm:block w-[280px]", children: [
|
|
4223
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
4224
|
+
/* @__PURE__ */ jsx("span", { className: "w-[26px]", "aria-hidden": "true" }),
|
|
4225
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: monthLabelFormat.format(rightMonth) }),
|
|
4226
|
+
navButton("next")
|
|
4227
|
+
] }),
|
|
4228
|
+
/* @__PURE__ */ jsx(
|
|
4229
|
+
CalendarGrid,
|
|
4230
|
+
{
|
|
4231
|
+
viewMonth: rightMonth,
|
|
4232
|
+
isDayDisabled,
|
|
4233
|
+
cellState,
|
|
4234
|
+
onSelectDay: handleSelectDay,
|
|
4235
|
+
onFocusDay: handleFocusDay,
|
|
4236
|
+
initialFocusDate: pendingStart ?? range2.start ?? /* @__PURE__ */ new Date()
|
|
4237
|
+
}
|
|
4238
|
+
)
|
|
4239
|
+
] })
|
|
4240
|
+
]
|
|
4241
|
+
}
|
|
4242
|
+
);
|
|
3603
4243
|
}
|
|
3604
4244
|
);
|
|
3605
4245
|
RangeCalendar.displayName = "RangeCalendar";
|
|
@@ -3721,15 +4361,38 @@ var DateRangePicker = React52.forwardRef(
|
|
|
3721
4361
|
}
|
|
3722
4362
|
),
|
|
3723
4363
|
name && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3724
|
-
/* @__PURE__ */ jsx(
|
|
3725
|
-
|
|
4364
|
+
/* @__PURE__ */ jsx(
|
|
4365
|
+
"input",
|
|
4366
|
+
{
|
|
4367
|
+
type: "hidden",
|
|
4368
|
+
name: `${name}Start`,
|
|
4369
|
+
value: selected.start ? toISODateString(selected.start) : ""
|
|
4370
|
+
}
|
|
4371
|
+
),
|
|
4372
|
+
/* @__PURE__ */ jsx(
|
|
4373
|
+
"input",
|
|
4374
|
+
{
|
|
4375
|
+
type: "hidden",
|
|
4376
|
+
name: `${name}End`,
|
|
4377
|
+
value: selected.end ? toISODateString(selected.end) : ""
|
|
4378
|
+
}
|
|
4379
|
+
)
|
|
3726
4380
|
] }),
|
|
3727
4381
|
open && /* @__PURE__ */ jsx(
|
|
3728
4382
|
"div",
|
|
3729
4383
|
{
|
|
3730
4384
|
onKeyDown: onPanelKeyDown,
|
|
3731
|
-
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]",
|
|
3732
|
-
children: /* @__PURE__ */ jsx(
|
|
4385
|
+
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]",
|
|
4386
|
+
children: /* @__PURE__ */ jsx(
|
|
4387
|
+
RangeCalendar,
|
|
4388
|
+
{
|
|
4389
|
+
value: selected,
|
|
4390
|
+
onChange: handleRangeChange,
|
|
4391
|
+
min,
|
|
4392
|
+
max,
|
|
4393
|
+
disabledDates
|
|
4394
|
+
}
|
|
4395
|
+
)
|
|
3733
4396
|
}
|
|
3734
4397
|
)
|
|
3735
4398
|
] });
|
|
@@ -3742,108 +4405,118 @@ var DateRangePickerField = React52.forwardRef(
|
|
|
3742
4405
|
}
|
|
3743
4406
|
);
|
|
3744
4407
|
DateRangePickerField.displayName = "DateRangePickerField";
|
|
3745
|
-
var Dropzone = React52.forwardRef(
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
const
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
if (dragCounter.current <= 0) {
|
|
3784
|
-
dragCounter.current = 0;
|
|
3785
|
-
setDragActive(false);
|
|
3786
|
-
}
|
|
3787
|
-
};
|
|
3788
|
-
const handleDrop = (e) => {
|
|
3789
|
-
e.preventDefault();
|
|
4408
|
+
var Dropzone = React52.forwardRef(function Dropzone2({
|
|
4409
|
+
onFiles,
|
|
4410
|
+
accept,
|
|
4411
|
+
multiple = true,
|
|
4412
|
+
disabled = false,
|
|
4413
|
+
className,
|
|
4414
|
+
children,
|
|
4415
|
+
id,
|
|
4416
|
+
"aria-describedby": describedBy,
|
|
4417
|
+
"aria-invalid": ariaInvalid,
|
|
4418
|
+
"aria-required": ariaRequired
|
|
4419
|
+
}, ref) {
|
|
4420
|
+
const inputRef = React52.useRef(null);
|
|
4421
|
+
const [dragActive, setDragActive] = React52.useState(false);
|
|
4422
|
+
const dragCounter = React52.useRef(0);
|
|
4423
|
+
const invalid = ariaInvalid === true || ariaInvalid === "true";
|
|
4424
|
+
const openPicker = () => {
|
|
4425
|
+
if (!disabled) inputRef.current?.click();
|
|
4426
|
+
};
|
|
4427
|
+
const handleInputChange = (e) => {
|
|
4428
|
+
const files = e.target.files ? Array.from(e.target.files) : [];
|
|
4429
|
+
if (files.length > 0) onFiles(files);
|
|
4430
|
+
e.target.value = "";
|
|
4431
|
+
};
|
|
4432
|
+
const handleDragEnter = (e) => {
|
|
4433
|
+
e.preventDefault();
|
|
4434
|
+
if (disabled) return;
|
|
4435
|
+
dragCounter.current += 1;
|
|
4436
|
+
setDragActive(true);
|
|
4437
|
+
};
|
|
4438
|
+
const handleDragOver = (e) => {
|
|
4439
|
+
e.preventDefault();
|
|
4440
|
+
};
|
|
4441
|
+
const handleDragLeave = (e) => {
|
|
4442
|
+
e.preventDefault();
|
|
4443
|
+
if (disabled) return;
|
|
4444
|
+
dragCounter.current -= 1;
|
|
4445
|
+
if (dragCounter.current <= 0) {
|
|
3790
4446
|
dragCounter.current = 0;
|
|
3791
4447
|
setDragActive(false);
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
4448
|
+
}
|
|
4449
|
+
};
|
|
4450
|
+
const handleDrop = (e) => {
|
|
4451
|
+
e.preventDefault();
|
|
4452
|
+
dragCounter.current = 0;
|
|
4453
|
+
setDragActive(false);
|
|
4454
|
+
if (disabled) return;
|
|
4455
|
+
const files = e.dataTransfer?.files ? Array.from(e.dataTransfer.files) : [];
|
|
4456
|
+
if (files.length > 0) onFiles(files);
|
|
4457
|
+
};
|
|
4458
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
|
|
4459
|
+
/* @__PURE__ */ jsx(
|
|
4460
|
+
"button",
|
|
4461
|
+
{
|
|
4462
|
+
ref,
|
|
4463
|
+
type: "button",
|
|
4464
|
+
id,
|
|
4465
|
+
disabled,
|
|
4466
|
+
"aria-describedby": describedBy,
|
|
4467
|
+
"aria-invalid": ariaInvalid,
|
|
4468
|
+
"aria-required": ariaRequired,
|
|
4469
|
+
"data-drag-active": dragActive || void 0,
|
|
4470
|
+
onClick: openPicker,
|
|
4471
|
+
onDragEnter: handleDragEnter,
|
|
4472
|
+
onDragOver: handleDragOver,
|
|
4473
|
+
onDragLeave: handleDragLeave,
|
|
4474
|
+
onDrop: handleDrop,
|
|
4475
|
+
className: cn(
|
|
4476
|
+
"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",
|
|
4477
|
+
"focus:outline-none focus:ring-[3px] focus:ring-ring/30",
|
|
4478
|
+
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"
|
|
4479
|
+
),
|
|
4480
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4481
|
+
/* @__PURE__ */ jsxs(
|
|
4482
|
+
"svg",
|
|
4483
|
+
{
|
|
4484
|
+
viewBox: "0 0 24 24",
|
|
4485
|
+
className: "h-7 w-7",
|
|
4486
|
+
fill: "none",
|
|
4487
|
+
stroke: "currentColor",
|
|
4488
|
+
strokeWidth: "1.5",
|
|
4489
|
+
strokeLinecap: "round",
|
|
4490
|
+
strokeLinejoin: "round",
|
|
4491
|
+
children: [
|
|
4492
|
+
/* @__PURE__ */ jsx("path", { d: "M12 16V4M7 9l5-5 5 5" }),
|
|
4493
|
+
/* @__PURE__ */ jsx("path", { d: "M20 16v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-3" })
|
|
4494
|
+
]
|
|
4495
|
+
}
|
|
3817
4496
|
),
|
|
3818
|
-
|
|
3819
|
-
/* @__PURE__ */
|
|
3820
|
-
|
|
3821
|
-
/* @__PURE__ */ jsx("path", { d: "M20 16v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-3" })
|
|
3822
|
-
] }),
|
|
3823
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
3824
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: "Drag and drop files here" }),
|
|
3825
|
-
", or click to browse"
|
|
3826
|
-
] })
|
|
4497
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
4498
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: "Drag and drop files here" }),
|
|
4499
|
+
", or click to browse"
|
|
3827
4500
|
] })
|
|
3828
|
-
}
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
}
|
|
3846
|
-
);
|
|
4501
|
+
] })
|
|
4502
|
+
}
|
|
4503
|
+
),
|
|
4504
|
+
/* @__PURE__ */ jsx(
|
|
4505
|
+
"input",
|
|
4506
|
+
{
|
|
4507
|
+
ref: inputRef,
|
|
4508
|
+
type: "file",
|
|
4509
|
+
accept,
|
|
4510
|
+
multiple,
|
|
4511
|
+
disabled,
|
|
4512
|
+
onChange: handleInputChange,
|
|
4513
|
+
className: "sr-only",
|
|
4514
|
+
tabIndex: -1,
|
|
4515
|
+
"aria-hidden": "true"
|
|
4516
|
+
}
|
|
4517
|
+
)
|
|
4518
|
+
] });
|
|
4519
|
+
});
|
|
3847
4520
|
Dropzone.displayName = "Dropzone";
|
|
3848
4521
|
|
|
3849
4522
|
// src/components/file-upload-internals.ts
|
|
@@ -3908,108 +4581,130 @@ function validateFiles(files, { accept, maxSize, maxFiles, existingCount = 0, mu
|
|
|
3908
4581
|
return { accepted, rejected };
|
|
3909
4582
|
}
|
|
3910
4583
|
function FileIcon({ className }) {
|
|
3911
|
-
return /* @__PURE__ */ jsxs(
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
4584
|
+
return /* @__PURE__ */ jsxs(
|
|
4585
|
+
"svg",
|
|
4586
|
+
{
|
|
4587
|
+
viewBox: "0 0 24 24",
|
|
4588
|
+
className,
|
|
4589
|
+
fill: "none",
|
|
4590
|
+
stroke: "currentColor",
|
|
4591
|
+
strokeWidth: "1.5",
|
|
4592
|
+
strokeLinecap: "round",
|
|
4593
|
+
strokeLinejoin: "round",
|
|
4594
|
+
children: [
|
|
4595
|
+
/* @__PURE__ */ jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
4596
|
+
/* @__PURE__ */ jsx("path", { d: "M14 2v6h6" })
|
|
4597
|
+
]
|
|
4598
|
+
}
|
|
4599
|
+
);
|
|
3915
4600
|
}
|
|
3916
|
-
var FileUpload = React52.forwardRef(
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
const
|
|
3941
|
-
|
|
4601
|
+
var FileUpload = React52.forwardRef(function FileUpload2({
|
|
4602
|
+
value,
|
|
4603
|
+
defaultValue,
|
|
4604
|
+
onChange,
|
|
4605
|
+
onReject,
|
|
4606
|
+
accept,
|
|
4607
|
+
maxSize,
|
|
4608
|
+
maxFiles,
|
|
4609
|
+
multiple = true,
|
|
4610
|
+
disabled = false,
|
|
4611
|
+
error = false,
|
|
4612
|
+
required = false,
|
|
4613
|
+
className,
|
|
4614
|
+
id,
|
|
4615
|
+
"aria-describedby": describedBy
|
|
4616
|
+
}, ref) {
|
|
4617
|
+
const controlled = value !== void 0;
|
|
4618
|
+
const [internalItems, setInternalItems] = React52.useState(defaultValue ?? []);
|
|
4619
|
+
const items = controlled ? value : internalItems;
|
|
4620
|
+
const commit = (next) => {
|
|
4621
|
+
if (!controlled) setInternalItems(next);
|
|
4622
|
+
onChange?.(next);
|
|
4623
|
+
};
|
|
4624
|
+
const handleFiles = (files) => {
|
|
4625
|
+
const { accepted, rejected } = validateFiles(files, {
|
|
4626
|
+
accept,
|
|
4627
|
+
maxSize,
|
|
4628
|
+
maxFiles,
|
|
4629
|
+
existingCount: items.length,
|
|
4630
|
+
multiple
|
|
4631
|
+
});
|
|
4632
|
+
if (rejected.length > 0) onReject?.(rejected);
|
|
4633
|
+
if (accepted.length === 0) return;
|
|
4634
|
+
const newItems = accepted.map((file) => ({
|
|
4635
|
+
id: generateId(),
|
|
4636
|
+
file,
|
|
4637
|
+
status: "pending"
|
|
4638
|
+
}));
|
|
4639
|
+
commit(multiple ? [...items, ...newItems] : newItems.slice(0, 1));
|
|
4640
|
+
};
|
|
4641
|
+
const removeItem = (itemId) => {
|
|
4642
|
+
commit(items.filter((it) => it.id !== itemId));
|
|
4643
|
+
};
|
|
4644
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full flex flex-col gap-3", className), children: [
|
|
4645
|
+
/* @__PURE__ */ jsx(
|
|
4646
|
+
Dropzone,
|
|
4647
|
+
{
|
|
4648
|
+
ref,
|
|
4649
|
+
onFiles: handleFiles,
|
|
3942
4650
|
accept,
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
/* @__PURE__ */ jsx(
|
|
3962
|
-
Dropzone,
|
|
3963
|
-
{
|
|
3964
|
-
ref,
|
|
3965
|
-
onFiles: handleFiles,
|
|
3966
|
-
accept,
|
|
3967
|
-
multiple,
|
|
3968
|
-
disabled,
|
|
3969
|
-
id,
|
|
3970
|
-
"aria-describedby": describedBy,
|
|
3971
|
-
"aria-invalid": error || void 0,
|
|
3972
|
-
"aria-required": required || void 0
|
|
3973
|
-
}
|
|
3974
|
-
),
|
|
3975
|
-
items.length > 0 && /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-2", children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
3976
|
-
"li",
|
|
3977
|
-
{
|
|
3978
|
-
className: "flex items-center gap-3 rounded-kj-md border border-border bg-surface px-3 py-2",
|
|
3979
|
-
children: [
|
|
3980
|
-
/* @__PURE__ */ jsx(FileIcon, { className: "h-5 w-5 shrink-0 text-muted-foreground" }),
|
|
3981
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
3982
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
3983
|
-
/* @__PURE__ */ jsx("span", { className: "truncate text-sm text-foreground", children: item.file.name }),
|
|
3984
|
-
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: formatBytes(item.file.size) })
|
|
3985
|
-
] }),
|
|
3986
|
-
item.status === "uploading" && item.progress != null && /* @__PURE__ */ jsxs("div", { className: "mt-1.5 flex items-center gap-2", children: [
|
|
3987
|
-
/* @__PURE__ */ jsx(Progress, { value: item.progress, className: "h-1.5" }),
|
|
3988
|
-
/* @__PURE__ */ jsxs("span", { className: "shrink-0 text-xs text-muted-foreground", children: [
|
|
3989
|
-
Math.round(item.progress),
|
|
3990
|
-
"%"
|
|
3991
|
-
] })
|
|
3992
|
-
] }),
|
|
3993
|
-
item.status === "success" && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block text-xs text-success", children: "Uploaded" }),
|
|
3994
|
-
item.status === "error" && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block text-xs text-danger", children: item.error ?? "Upload failed" })
|
|
4651
|
+
multiple,
|
|
4652
|
+
disabled,
|
|
4653
|
+
id,
|
|
4654
|
+
"aria-describedby": describedBy,
|
|
4655
|
+
"aria-invalid": error || void 0,
|
|
4656
|
+
"aria-required": required || void 0
|
|
4657
|
+
}
|
|
4658
|
+
),
|
|
4659
|
+
items.length > 0 && /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-2", children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
4660
|
+
"li",
|
|
4661
|
+
{
|
|
4662
|
+
className: "flex items-center gap-3 rounded-kj-md border border-border bg-surface px-3 py-2",
|
|
4663
|
+
children: [
|
|
4664
|
+
/* @__PURE__ */ jsx(FileIcon, { className: "h-5 w-5 shrink-0 text-muted-foreground" }),
|
|
4665
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
4666
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4667
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-sm text-foreground", children: item.file.name }),
|
|
4668
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: formatBytes(item.file.size) })
|
|
3995
4669
|
] }),
|
|
3996
|
-
|
|
3997
|
-
"
|
|
3998
|
-
{
|
|
3999
|
-
|
|
4000
|
-
"
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4670
|
+
item.status === "uploading" && item.progress != null && /* @__PURE__ */ jsxs("div", { className: "mt-1.5 flex items-center gap-2", children: [
|
|
4671
|
+
/* @__PURE__ */ jsx(Progress, { value: item.progress, className: "h-1.5" }),
|
|
4672
|
+
/* @__PURE__ */ jsxs("span", { className: "shrink-0 text-xs text-muted-foreground", children: [
|
|
4673
|
+
Math.round(item.progress),
|
|
4674
|
+
"%"
|
|
4675
|
+
] })
|
|
4676
|
+
] }),
|
|
4677
|
+
item.status === "success" && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block text-xs text-success", children: "Uploaded" }),
|
|
4678
|
+
item.status === "error" && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block text-xs text-danger", children: item.error ?? "Upload failed" })
|
|
4679
|
+
] }),
|
|
4680
|
+
!disabled && /* @__PURE__ */ jsx(
|
|
4681
|
+
"button",
|
|
4682
|
+
{
|
|
4683
|
+
type: "button",
|
|
4684
|
+
"aria-label": `Remove ${item.file.name}`,
|
|
4685
|
+
onClick: () => removeItem(item.id),
|
|
4686
|
+
className: "shrink-0 rounded-kj-sm p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
4687
|
+
children: /* @__PURE__ */ jsx(
|
|
4688
|
+
"svg",
|
|
4689
|
+
{
|
|
4690
|
+
viewBox: "0 0 24 24",
|
|
4691
|
+
className: "h-4 w-4",
|
|
4692
|
+
fill: "none",
|
|
4693
|
+
stroke: "currentColor",
|
|
4694
|
+
strokeWidth: "2",
|
|
4695
|
+
strokeLinecap: "round",
|
|
4696
|
+
strokeLinejoin: "round",
|
|
4697
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
4698
|
+
}
|
|
4699
|
+
)
|
|
4700
|
+
}
|
|
4701
|
+
)
|
|
4702
|
+
]
|
|
4703
|
+
},
|
|
4704
|
+
item.id
|
|
4705
|
+
)) })
|
|
4706
|
+
] });
|
|
4707
|
+
});
|
|
4013
4708
|
FileUpload.displayName = "FileUpload";
|
|
4014
4709
|
var FileUploadField = React52.forwardRef(
|
|
4015
4710
|
function FileUploadField2({ label, hint, error, required, className, ...props }, ref) {
|
|
@@ -4054,16 +4749,7 @@ var TimelineItem = React52.forwardRef(
|
|
|
4054
4749
|
align === "right" && "grid-cols-[1fr_auto] text-right",
|
|
4055
4750
|
align === "alternate" && "md:grid-cols-[1fr_auto_1fr] grid-cols-[auto_1fr]"
|
|
4056
4751
|
);
|
|
4057
|
-
return /* @__PURE__ */ jsx(TimelineItemContext.Provider, { value: { isEven, align, isLast }, children: /* @__PURE__ */ jsx(
|
|
4058
|
-
"div",
|
|
4059
|
-
{
|
|
4060
|
-
ref,
|
|
4061
|
-
role: "listitem",
|
|
4062
|
-
className: cn(gridClass, className),
|
|
4063
|
-
...props,
|
|
4064
|
-
children
|
|
4065
|
-
}
|
|
4066
|
-
) });
|
|
4752
|
+
return /* @__PURE__ */ jsx(TimelineItemContext.Provider, { value: { isEven, align, isLast }, children: /* @__PURE__ */ jsx("div", { ref, role: "listitem", className: cn(gridClass, className), ...props, children }) });
|
|
4067
4753
|
}
|
|
4068
4754
|
);
|
|
4069
4755
|
TimelineItem.displayName = "TimelineItem";
|
|
@@ -4143,51 +4829,53 @@ var TimelineContent = React52.forwardRef(
|
|
|
4143
4829
|
}
|
|
4144
4830
|
);
|
|
4145
4831
|
TimelineContent.displayName = "TimelineContent";
|
|
4146
|
-
var TimelineTitle = React52.forwardRef(
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
)
|
|
4156
|
-
);
|
|
4832
|
+
var TimelineTitle = React52.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4833
|
+
"h4",
|
|
4834
|
+
{
|
|
4835
|
+
ref,
|
|
4836
|
+
className: cn("m-0 text-sm font-semibold tracking-[-0.01em] text-foreground", className),
|
|
4837
|
+
...props,
|
|
4838
|
+
children
|
|
4839
|
+
}
|
|
4840
|
+
));
|
|
4157
4841
|
TimelineTitle.displayName = "TimelineTitle";
|
|
4158
|
-
var TimelineTime = React52.forwardRef(
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
)
|
|
4167
|
-
);
|
|
4842
|
+
var TimelineTime = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4843
|
+
"time",
|
|
4844
|
+
{
|
|
4845
|
+
ref,
|
|
4846
|
+
className: cn("text-[0.75rem] text-muted-foreground font-normal", className),
|
|
4847
|
+
...props
|
|
4848
|
+
}
|
|
4849
|
+
));
|
|
4168
4850
|
TimelineTime.displayName = "TimelineTime";
|
|
4169
4851
|
function useStepper({ initialStep = 0, stepsCount }) {
|
|
4170
4852
|
const safeStepsCount = Math.max(1, stepsCount);
|
|
4171
4853
|
const [activeStep, setActiveStep] = React52.useState(initialStep);
|
|
4172
4854
|
const [completedSteps, setCompletedSteps] = React52.useState([]);
|
|
4173
|
-
const setStep = React52.useCallback(
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4855
|
+
const setStep = React52.useCallback(
|
|
4856
|
+
(step) => {
|
|
4857
|
+
if (step >= 0 && step < safeStepsCount) {
|
|
4858
|
+
setActiveStep(step);
|
|
4859
|
+
}
|
|
4860
|
+
},
|
|
4861
|
+
[safeStepsCount]
|
|
4862
|
+
);
|
|
4178
4863
|
const nextStep = React52.useCallback(() => {
|
|
4179
4864
|
setActiveStep((prev) => Math.min(prev + 1, safeStepsCount - 1));
|
|
4180
4865
|
}, [safeStepsCount]);
|
|
4181
4866
|
const prevStep = React52.useCallback(() => {
|
|
4182
4867
|
setActiveStep((prev) => Math.max(prev - 1, 0));
|
|
4183
4868
|
}, []);
|
|
4184
|
-
const completeStep = React52.useCallback(
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4869
|
+
const completeStep = React52.useCallback(
|
|
4870
|
+
(step) => {
|
|
4871
|
+
setCompletedSteps((prev) => {
|
|
4872
|
+
if (step < 0 || step >= safeStepsCount) return prev;
|
|
4873
|
+
if (prev.includes(step)) return prev;
|
|
4874
|
+
return [...prev, step].sort((a, b) => a - b);
|
|
4875
|
+
});
|
|
4876
|
+
},
|
|
4877
|
+
[safeStepsCount]
|
|
4878
|
+
);
|
|
4191
4879
|
const uncompleteStep = React52.useCallback((step) => {
|
|
4192
4880
|
setCompletedSteps((prev) => prev.filter((s) => s !== step));
|
|
4193
4881
|
}, []);
|
|
@@ -4211,7 +4899,17 @@ function useStepper({ initialStep = 0, stepsCount }) {
|
|
|
4211
4899
|
var StepperContext = React52.createContext(null);
|
|
4212
4900
|
var StepperItemContext = React52.createContext(null);
|
|
4213
4901
|
var Stepper = React52.forwardRef(
|
|
4214
|
-
({
|
|
4902
|
+
({
|
|
4903
|
+
value,
|
|
4904
|
+
defaultValue,
|
|
4905
|
+
onValueChange,
|
|
4906
|
+
orientation = "horizontal",
|
|
4907
|
+
responsive = true,
|
|
4908
|
+
linear = true,
|
|
4909
|
+
children,
|
|
4910
|
+
className,
|
|
4911
|
+
...props
|
|
4912
|
+
}, ref) => {
|
|
4215
4913
|
const [localValue, setLocalValue] = React52.useState(defaultValue ?? 0);
|
|
4216
4914
|
const isControlled = value !== void 0;
|
|
4217
4915
|
const activeStep = isControlled ? value : localValue;
|
|
@@ -4232,7 +4930,9 @@ var Stepper = React52.forwardRef(
|
|
|
4232
4930
|
if (linear) {
|
|
4233
4931
|
setCompletedSteps((prev) => {
|
|
4234
4932
|
const priorSteps = steps.filter((s) => s < step);
|
|
4235
|
-
const nextCompleted = Array.from(/* @__PURE__ */ new Set([...prev, ...priorSteps])).sort(
|
|
4933
|
+
const nextCompleted = Array.from(/* @__PURE__ */ new Set([...prev, ...priorSteps])).sort(
|
|
4934
|
+
(a, b) => a - b
|
|
4935
|
+
);
|
|
4236
4936
|
return nextCompleted;
|
|
4237
4937
|
});
|
|
4238
4938
|
}
|
|
@@ -4243,6 +4943,7 @@ var Stepper = React52.forwardRef(
|
|
|
4243
4943
|
() => ({
|
|
4244
4944
|
activeStep,
|
|
4245
4945
|
orientation,
|
|
4946
|
+
responsive,
|
|
4246
4947
|
linear,
|
|
4247
4948
|
setStep,
|
|
4248
4949
|
completedSteps,
|
|
@@ -4250,7 +4951,17 @@ var Stepper = React52.forwardRef(
|
|
|
4250
4951
|
unregisterStep,
|
|
4251
4952
|
steps
|
|
4252
4953
|
}),
|
|
4253
|
-
[
|
|
4954
|
+
[
|
|
4955
|
+
activeStep,
|
|
4956
|
+
orientation,
|
|
4957
|
+
responsive,
|
|
4958
|
+
linear,
|
|
4959
|
+
setStep,
|
|
4960
|
+
completedSteps,
|
|
4961
|
+
registerStep,
|
|
4962
|
+
unregisterStep,
|
|
4963
|
+
steps
|
|
4964
|
+
]
|
|
4254
4965
|
);
|
|
4255
4966
|
return /* @__PURE__ */ jsx(StepperContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
4256
4967
|
"div",
|
|
@@ -4292,16 +5003,15 @@ var StepperList = React52.forwardRef(
|
|
|
4292
5003
|
({ className, children, ...props }, ref) => {
|
|
4293
5004
|
const ctx = React52.useContext(StepperContext);
|
|
4294
5005
|
if (!ctx) throw new Error("StepperList must be used within a Stepper");
|
|
5006
|
+
const isResponsiveHorizontal = ctx.orientation === "horizontal" && (ctx.responsive ?? true);
|
|
5007
|
+
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";
|
|
4295
5008
|
return /* @__PURE__ */ jsx(
|
|
4296
5009
|
"div",
|
|
4297
5010
|
{
|
|
4298
5011
|
ref,
|
|
4299
5012
|
role: "tablist",
|
|
4300
|
-
"aria-orientation": ctx.orientation,
|
|
4301
|
-
className: cn(
|
|
4302
|
-
ctx.orientation === "horizontal" ? "flex items-center justify-between w-full relative gap-4" : "flex flex-col items-start gap-6 relative w-full",
|
|
4303
|
-
className
|
|
4304
|
-
),
|
|
5013
|
+
"aria-orientation": ctx.orientation,
|
|
5014
|
+
className: cn(orientationClass, className),
|
|
4305
5015
|
...props,
|
|
4306
5016
|
children
|
|
4307
5017
|
}
|
|
@@ -4319,13 +5029,14 @@ var StepperItem = React52.forwardRef(
|
|
|
4319
5029
|
return () => unregisterStep(value);
|
|
4320
5030
|
}, [value, registerStep, unregisterStep]);
|
|
4321
5031
|
const isLast = ctx.steps[ctx.steps.length - 1] === value;
|
|
5032
|
+
const isResponsiveHorizontal = ctx.orientation === "horizontal" && (ctx.responsive ?? true);
|
|
4322
5033
|
return /* @__PURE__ */ jsx(StepperItemContext.Provider, { value: { value, disabled, isLast }, children: /* @__PURE__ */ jsx(
|
|
4323
5034
|
"div",
|
|
4324
5035
|
{
|
|
4325
5036
|
ref,
|
|
4326
5037
|
className: cn(
|
|
4327
5038
|
"group relative flex items-center gap-3 z-10",
|
|
4328
|
-
ctx.orientation === "vertical" ? "flex items-start w-full" : "",
|
|
5039
|
+
ctx.orientation === "vertical" ? "flex items-start w-full" : isResponsiveHorizontal ? "w-full sm:w-auto items-start sm:items-center" : "",
|
|
4329
5040
|
className
|
|
4330
5041
|
),
|
|
4331
5042
|
...props,
|
|
@@ -4339,12 +5050,13 @@ var StepperSeparator = React52.forwardRef(
|
|
|
4339
5050
|
({ className, ...props }, ref) => {
|
|
4340
5051
|
const ctx = React52.useContext(StepperContext);
|
|
4341
5052
|
if (!ctx) throw new Error("StepperSeparator must be used within a Stepper");
|
|
5053
|
+
const isResponsiveHorizontal = ctx.orientation === "horizontal" && (ctx.responsive ?? true);
|
|
4342
5054
|
return /* @__PURE__ */ jsx(
|
|
4343
5055
|
"div",
|
|
4344
5056
|
{
|
|
4345
5057
|
ref,
|
|
4346
5058
|
className: cn(
|
|
4347
|
-
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",
|
|
5059
|
+
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",
|
|
4348
5060
|
className
|
|
4349
5061
|
),
|
|
4350
5062
|
...props
|
|
@@ -4487,7 +5199,11 @@ var AppShellBanner = React52.forwardRef(
|
|
|
4487
5199
|
"div",
|
|
4488
5200
|
{
|
|
4489
5201
|
ref,
|
|
4490
|
-
className: cn(
|
|
5202
|
+
className: cn(
|
|
5203
|
+
"px-4 py-2 text-sm font-medium text-center flex items-center justify-center relative z-30",
|
|
5204
|
+
variantClass,
|
|
5205
|
+
className
|
|
5206
|
+
),
|
|
4491
5207
|
...props,
|
|
4492
5208
|
children: [
|
|
4493
5209
|
/* @__PURE__ */ jsx("div", { className: "flex-1", children }),
|
|
@@ -4498,7 +5214,20 @@ var AppShellBanner = React52.forwardRef(
|
|
|
4498
5214
|
onClick: onClose,
|
|
4499
5215
|
className: "p-1 rounded opacity-80 hover:opacity-100 transition-opacity ml-2 cursor-pointer",
|
|
4500
5216
|
"aria-label": "Close banner",
|
|
4501
|
-
children: /* @__PURE__ */ jsx(
|
|
5217
|
+
children: /* @__PURE__ */ jsx(
|
|
5218
|
+
"svg",
|
|
5219
|
+
{
|
|
5220
|
+
width: 14,
|
|
5221
|
+
height: 14,
|
|
5222
|
+
viewBox: "0 0 24 24",
|
|
5223
|
+
fill: "none",
|
|
5224
|
+
stroke: "currentColor",
|
|
5225
|
+
strokeWidth: 2.5,
|
|
5226
|
+
strokeLinecap: "round",
|
|
5227
|
+
strokeLinejoin: "round",
|
|
5228
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
5229
|
+
}
|
|
5230
|
+
)
|
|
4502
5231
|
}
|
|
4503
5232
|
)
|
|
4504
5233
|
]
|
|
@@ -4527,6 +5256,16 @@ var AppShellHeader = React52.forwardRef(
|
|
|
4527
5256
|
window.addEventListener("keydown", handleKeyDown);
|
|
4528
5257
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
4529
5258
|
}, [mobileOpen]);
|
|
5259
|
+
React52.useEffect(() => {
|
|
5260
|
+
if (mobileOpen) {
|
|
5261
|
+
document.body.style.overflow = "hidden";
|
|
5262
|
+
} else {
|
|
5263
|
+
document.body.style.overflow = "";
|
|
5264
|
+
}
|
|
5265
|
+
return () => {
|
|
5266
|
+
document.body.style.overflow = "";
|
|
5267
|
+
};
|
|
5268
|
+
}, [mobileOpen]);
|
|
4530
5269
|
const positionClass = {
|
|
4531
5270
|
sticky: "sticky top-0 z-40",
|
|
4532
5271
|
fixed: "fixed top-0 left-0 right-0 z-40",
|
|
@@ -4558,11 +5297,24 @@ var AppShellHeader = React52.forwardRef(
|
|
|
4558
5297
|
onClick: () => setMobileOpen(true),
|
|
4559
5298
|
className: "md:hidden p-2 -ml-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
4560
5299
|
"aria-label": "Open navigation",
|
|
4561
|
-
children: /* @__PURE__ */ jsxs(
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
5300
|
+
children: /* @__PURE__ */ jsxs(
|
|
5301
|
+
"svg",
|
|
5302
|
+
{
|
|
5303
|
+
width: 20,
|
|
5304
|
+
height: 20,
|
|
5305
|
+
viewBox: "0 0 24 24",
|
|
5306
|
+
fill: "none",
|
|
5307
|
+
stroke: "currentColor",
|
|
5308
|
+
strokeWidth: 2.5,
|
|
5309
|
+
strokeLinecap: "round",
|
|
5310
|
+
strokeLinejoin: "round",
|
|
5311
|
+
children: [
|
|
5312
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
|
|
5313
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
|
|
5314
|
+
/* @__PURE__ */ jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
|
|
5315
|
+
]
|
|
5316
|
+
}
|
|
5317
|
+
)
|
|
4566
5318
|
}
|
|
4567
5319
|
),
|
|
4568
5320
|
children
|
|
@@ -4595,7 +5347,20 @@ var AppShellHeader = React52.forwardRef(
|
|
|
4595
5347
|
onClick: () => setMobileOpen(false),
|
|
4596
5348
|
className: "p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
4597
5349
|
"aria-label": "Close navigation",
|
|
4598
|
-
children: /* @__PURE__ */ jsx(
|
|
5350
|
+
children: /* @__PURE__ */ jsx(
|
|
5351
|
+
"svg",
|
|
5352
|
+
{
|
|
5353
|
+
width: 16,
|
|
5354
|
+
height: 16,
|
|
5355
|
+
viewBox: "0 0 24 24",
|
|
5356
|
+
fill: "none",
|
|
5357
|
+
stroke: "currentColor",
|
|
5358
|
+
strokeWidth: 2.5,
|
|
5359
|
+
strokeLinecap: "round",
|
|
5360
|
+
strokeLinejoin: "round",
|
|
5361
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
5362
|
+
}
|
|
5363
|
+
)
|
|
4599
5364
|
}
|
|
4600
5365
|
)
|
|
4601
5366
|
] }),
|
|
@@ -4620,7 +5385,12 @@ var AppShellMain = React52.forwardRef(
|
|
|
4620
5385
|
"main",
|
|
4621
5386
|
{
|
|
4622
5387
|
ref,
|
|
4623
|
-
className: cn(
|
|
5388
|
+
className: cn(
|
|
5389
|
+
"flex-1",
|
|
5390
|
+
padded && "px-4 sm:px-6 lg:px-8 py-4 sm:py-6 md:py-12",
|
|
5391
|
+
widthClass,
|
|
5392
|
+
className
|
|
5393
|
+
),
|
|
4624
5394
|
...props,
|
|
4625
5395
|
children
|
|
4626
5396
|
}
|
|
@@ -4658,19 +5428,24 @@ var AppShell = React52.forwardRef(
|
|
|
4658
5428
|
headerVariant = "glass",
|
|
4659
5429
|
paddedContent = true,
|
|
4660
5430
|
mobileNav,
|
|
5431
|
+
bottomNav,
|
|
4661
5432
|
...props
|
|
4662
5433
|
}, ref) => {
|
|
4663
5434
|
return /* @__PURE__ */ jsxs(
|
|
4664
5435
|
"div",
|
|
4665
5436
|
{
|
|
4666
5437
|
ref,
|
|
4667
|
-
className: cn(
|
|
5438
|
+
className: cn(
|
|
5439
|
+
"min-h-screen bg-canvas text-foreground flex flex-col antialiased",
|
|
5440
|
+
className
|
|
5441
|
+
),
|
|
4668
5442
|
...props,
|
|
4669
5443
|
children: [
|
|
4670
5444
|
banner && /* @__PURE__ */ jsx(AppShellBanner, { children: banner }),
|
|
4671
5445
|
header && /* @__PURE__ */ jsx(AppShellHeader, { variant: headerVariant, position: headerPosition, mobileNav, children: header }),
|
|
4672
5446
|
/* @__PURE__ */ jsx(AppShellMain, { width: contentWidth, padded: paddedContent, children }),
|
|
4673
|
-
footer && /* @__PURE__ */ jsx(AppShellFooter, { children: footer })
|
|
5447
|
+
footer && /* @__PURE__ */ jsx(AppShellFooter, { children: footer }),
|
|
5448
|
+
bottomNav && /* @__PURE__ */ jsx("div", { className: "md:hidden sticky bottom-0 z-30 w-full bg-surface border-t border-border", children: bottomNav })
|
|
4674
5449
|
]
|
|
4675
5450
|
}
|
|
4676
5451
|
);
|
|
@@ -4819,9 +5594,6 @@ var Rating = React52.forwardRef(
|
|
|
4819
5594
|
ref,
|
|
4820
5595
|
role: readOnly ? "img" : "radiogroup",
|
|
4821
5596
|
tabIndex: disabled || readOnly ? -1 : 0,
|
|
4822
|
-
"aria-valuenow": displayValue,
|
|
4823
|
-
"aria-valuemin": 0,
|
|
4824
|
-
"aria-valuemax": max,
|
|
4825
5597
|
"aria-disabled": disabled || void 0,
|
|
4826
5598
|
"aria-readonly": readOnly || void 0,
|
|
4827
5599
|
"aria-label": ariaLabel || (readOnly ? `Rated ${displayValue} out of ${max}` : "Rating"),
|
|
@@ -4840,10 +5612,7 @@ var Rating = React52.forwardRef(
|
|
|
4840
5612
|
name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: currentValue }),
|
|
4841
5613
|
/* @__PURE__ */ jsx("div", { className: "inline-flex items-center gap-0.5", children: Array.from({ length: max }, (_, index) => {
|
|
4842
5614
|
const starIndex = index + 1;
|
|
4843
|
-
const fillFraction = Math.max(
|
|
4844
|
-
0,
|
|
4845
|
-
Math.min(1, displayValue - index)
|
|
4846
|
-
);
|
|
5615
|
+
const fillFraction = Math.max(0, Math.min(1, displayValue - index));
|
|
4847
5616
|
const gradientId = `rating-grad-${instanceId}-${index}-${Math.round(
|
|
4848
5617
|
fillFraction * 100
|
|
4849
5618
|
)}`;
|
|
@@ -4882,46 +5651,24 @@ var Rating = React52.forwardRef(
|
|
|
4882
5651
|
className: "w-full h-full",
|
|
4883
5652
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4884
5653
|
children: [
|
|
4885
|
-
fillFraction > 0 && fillFraction < 1 && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
4886
|
-
"
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
offset: `${fillFraction * 100}%`,
|
|
4904
|
-
stopColor: "currentColor",
|
|
4905
|
-
className: color
|
|
4906
|
-
}
|
|
4907
|
-
),
|
|
4908
|
-
isCssColor(emptyColor) ? /* @__PURE__ */ jsx(
|
|
4909
|
-
"stop",
|
|
4910
|
-
{
|
|
4911
|
-
offset: `${fillFraction * 100}%`,
|
|
4912
|
-
stopColor: emptyColor
|
|
4913
|
-
}
|
|
4914
|
-
) : /* @__PURE__ */ jsx(
|
|
4915
|
-
"stop",
|
|
4916
|
-
{
|
|
4917
|
-
offset: `${fillFraction * 100}%`,
|
|
4918
|
-
stopColor: "currentColor",
|
|
4919
|
-
className: emptyColor
|
|
4920
|
-
}
|
|
4921
|
-
)
|
|
4922
|
-
]
|
|
4923
|
-
}
|
|
4924
|
-
) }),
|
|
5654
|
+
fillFraction > 0 && fillFraction < 1 && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
|
5655
|
+
isCssColor(color) ? /* @__PURE__ */ jsx("stop", { offset: `${fillFraction * 100}%`, stopColor: color }) : /* @__PURE__ */ jsx(
|
|
5656
|
+
"stop",
|
|
5657
|
+
{
|
|
5658
|
+
offset: `${fillFraction * 100}%`,
|
|
5659
|
+
stopColor: "currentColor",
|
|
5660
|
+
className: color
|
|
5661
|
+
}
|
|
5662
|
+
),
|
|
5663
|
+
isCssColor(emptyColor) ? /* @__PURE__ */ jsx("stop", { offset: `${fillFraction * 100}%`, stopColor: emptyColor }) : /* @__PURE__ */ jsx(
|
|
5664
|
+
"stop",
|
|
5665
|
+
{
|
|
5666
|
+
offset: `${fillFraction * 100}%`,
|
|
5667
|
+
stopColor: "currentColor",
|
|
5668
|
+
className: emptyColor
|
|
5669
|
+
}
|
|
5670
|
+
)
|
|
5671
|
+
] }) }),
|
|
4925
5672
|
/* @__PURE__ */ jsx(
|
|
4926
5673
|
"path",
|
|
4927
5674
|
{
|
|
@@ -4986,16 +5733,7 @@ var RatingField = React52.forwardRef(
|
|
|
4986
5733
|
);
|
|
4987
5734
|
RatingField.displayName = "RatingField";
|
|
4988
5735
|
var RatingSummary = React52.forwardRef(
|
|
4989
|
-
({
|
|
4990
|
-
average,
|
|
4991
|
-
totalCount,
|
|
4992
|
-
distribution,
|
|
4993
|
-
max = 5,
|
|
4994
|
-
size = "md",
|
|
4995
|
-
icon = "star",
|
|
4996
|
-
className,
|
|
4997
|
-
...props
|
|
4998
|
-
}, ref) => {
|
|
5736
|
+
({ average, totalCount, distribution, max = 5, size = "md", icon = "star", className, ...props }, ref) => {
|
|
4999
5737
|
const formattedAverage = Number.isInteger(average) ? average.toString() : average.toFixed(1);
|
|
5000
5738
|
const formattedTotalCount = totalCount.toLocaleString();
|
|
5001
5739
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5108,7 +5846,15 @@ var PricingCard = React52.forwardRef(
|
|
|
5108
5846
|
children: included ? "\u2713" : "\u2715"
|
|
5109
5847
|
}
|
|
5110
5848
|
),
|
|
5111
|
-
/* @__PURE__ */ jsx(
|
|
5849
|
+
/* @__PURE__ */ jsx(
|
|
5850
|
+
"span",
|
|
5851
|
+
{
|
|
5852
|
+
className: cn(
|
|
5853
|
+
included ? "text-foreground" : "text-muted-foreground line-through opacity-70"
|
|
5854
|
+
),
|
|
5855
|
+
children: text
|
|
5856
|
+
}
|
|
5857
|
+
)
|
|
5112
5858
|
] }, idx);
|
|
5113
5859
|
}) }),
|
|
5114
5860
|
/* @__PURE__ */ jsx("div", { className: "mt-auto pt-2", children: cta ? cta : ctaHref ? (
|
|
@@ -5304,9 +6050,7 @@ function useInboxState(initial) {
|
|
|
5304
6050
|
const [items, setItems] = React52.useState(initial);
|
|
5305
6051
|
const unreadCount = items.filter((i) => !i.read).length;
|
|
5306
6052
|
const markRead = React52.useCallback((id) => {
|
|
5307
|
-
setItems(
|
|
5308
|
-
(prev) => prev.map((item) => item.id === id ? { ...item, read: true } : item)
|
|
5309
|
-
);
|
|
6053
|
+
setItems((prev) => prev.map((item) => item.id === id ? { ...item, read: true } : item));
|
|
5310
6054
|
}, []);
|
|
5311
6055
|
const markAllRead = React52.useCallback(() => {
|
|
5312
6056
|
setItems((prev) => prev.map((item) => ({ ...item, read: true })));
|
|
@@ -5439,7 +6183,16 @@ function NotificationItem({ item, onDismiss, className }) {
|
|
|
5439
6183
|
}
|
|
5440
6184
|
) : item.avatarFallback ? /* @__PURE__ */ 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__ */ 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;
|
|
5441
6185
|
const textBlock = /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
5442
|
-
/* @__PURE__ */ jsx(
|
|
6186
|
+
/* @__PURE__ */ jsx(
|
|
6187
|
+
"p",
|
|
6188
|
+
{
|
|
6189
|
+
className: cn(
|
|
6190
|
+
"text-sm leading-snug",
|
|
6191
|
+
item.read ? "text-muted-foreground" : "text-foreground"
|
|
6192
|
+
),
|
|
6193
|
+
children: item.title
|
|
6194
|
+
}
|
|
6195
|
+
),
|
|
5443
6196
|
item.body && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5 truncate", children: item.body }),
|
|
5444
6197
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: formatRelativeTime(item.timestamp) })
|
|
5445
6198
|
] });
|
|
@@ -5513,6 +6266,7 @@ function InboxContent({
|
|
|
5513
6266
|
viewAllHref,
|
|
5514
6267
|
viewAllLabel = "View all notifications",
|
|
5515
6268
|
emptyState,
|
|
6269
|
+
align = "auto",
|
|
5516
6270
|
width = 360,
|
|
5517
6271
|
maxHeight = 320,
|
|
5518
6272
|
className
|
|
@@ -5525,13 +6279,32 @@ function InboxContent({
|
|
|
5525
6279
|
if (!ctx.open) return null;
|
|
5526
6280
|
const allRead = items.length === 0 || items.every((i) => i.read);
|
|
5527
6281
|
const defaultEmptyState = /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-10 px-5 text-center", children: [
|
|
5528
|
-
/* @__PURE__ */ jsx("span", { className: "w-10 h-10 rounded-full bg-muted flex items-center justify-center mb-3 text-muted-foreground", children: /* @__PURE__ */ jsxs(
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
6282
|
+
/* @__PURE__ */ jsx("span", { className: "w-10 h-10 rounded-full bg-muted flex items-center justify-center mb-3 text-muted-foreground", children: /* @__PURE__ */ jsxs(
|
|
6283
|
+
"svg",
|
|
6284
|
+
{
|
|
6285
|
+
width: 18,
|
|
6286
|
+
height: 18,
|
|
6287
|
+
viewBox: "0 0 24 24",
|
|
6288
|
+
fill: "none",
|
|
6289
|
+
stroke: "currentColor",
|
|
6290
|
+
strokeWidth: 1.5,
|
|
6291
|
+
strokeLinecap: "round",
|
|
6292
|
+
strokeLinejoin: "round",
|
|
6293
|
+
"aria-hidden": "true",
|
|
6294
|
+
children: [
|
|
6295
|
+
/* @__PURE__ */ jsx("path", { d: "M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" }),
|
|
6296
|
+
/* @__PURE__ */ jsx("path", { d: "M13.73 21a2 2 0 0 1-3.46 0" })
|
|
6297
|
+
]
|
|
6298
|
+
}
|
|
6299
|
+
) }),
|
|
5532
6300
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: "All caught up" }),
|
|
5533
6301
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: "No new notifications" })
|
|
5534
6302
|
] });
|
|
6303
|
+
const alignClass = {
|
|
6304
|
+
start: "left-0 top-[calc(100%+6px)]",
|
|
6305
|
+
end: "right-0 top-[calc(100%+6px)]",
|
|
6306
|
+
auto: "right-0 sm:right-0 left-auto top-[calc(100%+6px)] max-sm:left-1/2 max-sm:-translate-x-1/2"
|
|
6307
|
+
}[align ?? "auto"];
|
|
5535
6308
|
return /* @__PURE__ */ jsxs(
|
|
5536
6309
|
"div",
|
|
5537
6310
|
{
|
|
@@ -5539,11 +6312,12 @@ function InboxContent({
|
|
|
5539
6312
|
role: "dialog",
|
|
5540
6313
|
"aria-label": "Notifications",
|
|
5541
6314
|
tabIndex: -1,
|
|
5542
|
-
style: { width },
|
|
6315
|
+
style: { width: typeof width === "number" ? `${width}px` : width },
|
|
5543
6316
|
className: cn(
|
|
5544
|
-
"absolute
|
|
6317
|
+
"absolute z-40 max-w-[calc(100vw-1.5rem)]",
|
|
5545
6318
|
"bg-surface border border-border rounded-kj-md shadow-kj-lg outline-none",
|
|
5546
6319
|
"animate-[kjpop_.12s_ease]",
|
|
6320
|
+
alignClass,
|
|
5547
6321
|
className
|
|
5548
6322
|
),
|
|
5549
6323
|
children: [
|
|
@@ -5564,21 +6338,7 @@ function InboxContent({
|
|
|
5564
6338
|
}
|
|
5565
6339
|
)
|
|
5566
6340
|
] }),
|
|
5567
|
-
items.length === 0 ? emptyState ?? defaultEmptyState : /* @__PURE__ */ jsx(
|
|
5568
|
-
"div",
|
|
5569
|
-
{
|
|
5570
|
-
className: "overflow-y-auto",
|
|
5571
|
-
style: { maxHeight },
|
|
5572
|
-
children: items.map((item) => /* @__PURE__ */ jsx(
|
|
5573
|
-
NotificationItem,
|
|
5574
|
-
{
|
|
5575
|
-
item,
|
|
5576
|
-
onDismiss
|
|
5577
|
-
},
|
|
5578
|
-
item.id
|
|
5579
|
-
))
|
|
5580
|
-
}
|
|
5581
|
-
),
|
|
6341
|
+
items.length === 0 ? emptyState ?? defaultEmptyState : /* @__PURE__ */ jsx("div", { className: "overflow-y-auto", style: { maxHeight }, children: items.map((item) => /* @__PURE__ */ jsx(NotificationItem, { item, onDismiss }, item.id)) }),
|
|
5582
6342
|
items.length > 0 && viewAllHref && /* @__PURE__ */ jsx("div", { className: "border-t border-border px-3.5 py-2.5 text-center", children: /* @__PURE__ */ jsxs(
|
|
5583
6343
|
"a",
|
|
5584
6344
|
{
|
|
@@ -5707,30 +6467,32 @@ function hslToHex(h, s, l) {
|
|
|
5707
6467
|
};
|
|
5708
6468
|
return `#${toHex(r)}${toHex(g)}${toHex(b)}`.toUpperCase();
|
|
5709
6469
|
}
|
|
5710
|
-
var ColorPickerSwatch = React52.forwardRef(
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
6470
|
+
var ColorPickerSwatch = React52.forwardRef(
|
|
6471
|
+
({ color, selected = false, size = "md", className, style, ...props }, ref) => {
|
|
6472
|
+
const sizeClasses2 = {
|
|
6473
|
+
sm: "w-5 h-5",
|
|
6474
|
+
md: "w-7 h-7",
|
|
6475
|
+
lg: "w-9 h-9"
|
|
6476
|
+
};
|
|
6477
|
+
return /* @__PURE__ */ jsx(
|
|
6478
|
+
"button",
|
|
6479
|
+
{
|
|
6480
|
+
ref,
|
|
6481
|
+
type: "button",
|
|
6482
|
+
"aria-pressed": selected,
|
|
6483
|
+
style: { backgroundColor: color, ...style },
|
|
6484
|
+
className: cn(
|
|
6485
|
+
"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",
|
|
6486
|
+
sizeClasses2[size],
|
|
6487
|
+
selected && "ring-2 ring-primary ring-offset-2 ring-offset-surface",
|
|
6488
|
+
className
|
|
6489
|
+
),
|
|
6490
|
+
...props,
|
|
6491
|
+
children: selected && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2713" })
|
|
6492
|
+
}
|
|
6493
|
+
);
|
|
6494
|
+
}
|
|
6495
|
+
);
|
|
5734
6496
|
ColorPickerSwatch.displayName = "ColorPickerSwatch";
|
|
5735
6497
|
var ColorPicker = React52.forwardRef(
|
|
5736
6498
|
({
|
|
@@ -5744,9 +6506,7 @@ var ColorPicker = React52.forwardRef(
|
|
|
5744
6506
|
...props
|
|
5745
6507
|
}, ref) => {
|
|
5746
6508
|
const isControlled = value !== void 0;
|
|
5747
|
-
const [localColor, setLocalColor] = React52.useState(
|
|
5748
|
-
normalizeHex(defaultValue)
|
|
5749
|
-
);
|
|
6509
|
+
const [localColor, setLocalColor] = React52.useState(normalizeHex(defaultValue));
|
|
5750
6510
|
const color = isControlled ? normalizeHex(value) : localColor;
|
|
5751
6511
|
const [hexInputValue, setHexInputValue] = React52.useState(color);
|
|
5752
6512
|
React52.useEffect(() => {
|
|
@@ -5884,14 +6644,16 @@ var ColorPicker = React52.forwardRef(
|
|
|
5884
6644
|
}
|
|
5885
6645
|
);
|
|
5886
6646
|
ColorPicker.displayName = "ColorPicker";
|
|
5887
|
-
var ColorPickerField = React52.forwardRef(
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
});
|
|
6647
|
+
var ColorPickerField = React52.forwardRef(
|
|
6648
|
+
({ label, hint, error, required, ...props }, ref) => {
|
|
6649
|
+
return /* @__PURE__ */ jsxs(Field, { children: [
|
|
6650
|
+
label && /* @__PURE__ */ jsx(Label, { required, children: label }),
|
|
6651
|
+
/* @__PURE__ */ jsx(ColorPicker, { ref, ...props }),
|
|
6652
|
+
hint && /* @__PURE__ */ jsx(Hint, { children: hint }),
|
|
6653
|
+
error && /* @__PURE__ */ jsx(Hint, { error: true, children: error })
|
|
6654
|
+
] });
|
|
6655
|
+
}
|
|
6656
|
+
);
|
|
5895
6657
|
ColorPickerField.displayName = "ColorPickerField";
|
|
5896
6658
|
var COLUMN_CLASSES = {
|
|
5897
6659
|
2: "grid-cols-2",
|
|
@@ -6016,7 +6778,20 @@ function ImageGallery({
|
|
|
6016
6778
|
onClick: handleClose,
|
|
6017
6779
|
"aria-label": "Close",
|
|
6018
6780
|
className: "p-2 rounded-full text-white/80 hover:text-white hover:bg-white/10 transition-colors cursor-pointer",
|
|
6019
|
-
children: /* @__PURE__ */ jsx(
|
|
6781
|
+
children: /* @__PURE__ */ jsx(
|
|
6782
|
+
"svg",
|
|
6783
|
+
{
|
|
6784
|
+
width: 20,
|
|
6785
|
+
height: 20,
|
|
6786
|
+
viewBox: "0 0 24 24",
|
|
6787
|
+
fill: "none",
|
|
6788
|
+
stroke: "currentColor",
|
|
6789
|
+
strokeWidth: 2.5,
|
|
6790
|
+
strokeLinecap: "round",
|
|
6791
|
+
strokeLinejoin: "round",
|
|
6792
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
6793
|
+
}
|
|
6794
|
+
)
|
|
6020
6795
|
}
|
|
6021
6796
|
)
|
|
6022
6797
|
] }),
|
|
@@ -6028,7 +6803,20 @@ function ImageGallery({
|
|
|
6028
6803
|
onClick: handlePrev,
|
|
6029
6804
|
"aria-label": "Previous image",
|
|
6030
6805
|
className: "p-3 rounded-full text-white/80 hover:text-white hover:bg-white/10 transition-colors cursor-pointer z-10 shrink-0",
|
|
6031
|
-
children: /* @__PURE__ */ jsx(
|
|
6806
|
+
children: /* @__PURE__ */ jsx(
|
|
6807
|
+
"svg",
|
|
6808
|
+
{
|
|
6809
|
+
width: 24,
|
|
6810
|
+
height: 24,
|
|
6811
|
+
viewBox: "0 0 24 24",
|
|
6812
|
+
fill: "none",
|
|
6813
|
+
stroke: "currentColor",
|
|
6814
|
+
strokeWidth: 2.5,
|
|
6815
|
+
strokeLinecap: "round",
|
|
6816
|
+
strokeLinejoin: "round",
|
|
6817
|
+
children: /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" })
|
|
6818
|
+
}
|
|
6819
|
+
)
|
|
6032
6820
|
}
|
|
6033
6821
|
),
|
|
6034
6822
|
/* @__PURE__ */ jsx("div", { className: "flex-1 flex flex-col items-center justify-center h-full min-h-0 px-2 select-none", children: /* @__PURE__ */ jsx(
|
|
@@ -6046,7 +6834,20 @@ function ImageGallery({
|
|
|
6046
6834
|
onClick: handleNext,
|
|
6047
6835
|
"aria-label": "Next image",
|
|
6048
6836
|
className: "p-3 rounded-full text-white/80 hover:text-white hover:bg-white/10 transition-colors cursor-pointer z-10 shrink-0",
|
|
6049
|
-
children: /* @__PURE__ */ jsx(
|
|
6837
|
+
children: /* @__PURE__ */ jsx(
|
|
6838
|
+
"svg",
|
|
6839
|
+
{
|
|
6840
|
+
width: 24,
|
|
6841
|
+
height: 24,
|
|
6842
|
+
viewBox: "0 0 24 24",
|
|
6843
|
+
fill: "none",
|
|
6844
|
+
stroke: "currentColor",
|
|
6845
|
+
strokeWidth: 2.5,
|
|
6846
|
+
strokeLinecap: "round",
|
|
6847
|
+
strokeLinejoin: "round",
|
|
6848
|
+
children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
6849
|
+
}
|
|
6850
|
+
)
|
|
6050
6851
|
}
|
|
6051
6852
|
)
|
|
6052
6853
|
] }),
|
|
@@ -6059,7 +6860,430 @@ function ImageGallery({
|
|
|
6059
6860
|
)
|
|
6060
6861
|
] });
|
|
6061
6862
|
}
|
|
6863
|
+
var OFFICIAL_SCRIPT_URL = "https://geowidget.easypack24.net/js/sdk-for-javascript.js";
|
|
6864
|
+
var OFFICIAL_CSS_URL = "https://geowidget.easypack24.net/css/easypack.css";
|
|
6865
|
+
var scriptPromise = null;
|
|
6866
|
+
function useInPostScript(options = {}) {
|
|
6867
|
+
const [isLoaded, setIsLoaded] = useState(() => {
|
|
6868
|
+
if (typeof window === "undefined") return false;
|
|
6869
|
+
return !!(window.customElements?.get("inpost-geowidget") || window.easyPack);
|
|
6870
|
+
});
|
|
6871
|
+
const [error, setError] = useState(null);
|
|
6872
|
+
const scriptUrl = options.customScriptUrl || OFFICIAL_SCRIPT_URL;
|
|
6873
|
+
const cssUrl = options.customCssUrl || OFFICIAL_CSS_URL;
|
|
6874
|
+
useEffect(() => {
|
|
6875
|
+
if (typeof window === "undefined") return;
|
|
6876
|
+
if (window.customElements?.get("inpost-geowidget") || window.easyPack) {
|
|
6877
|
+
return;
|
|
6878
|
+
}
|
|
6879
|
+
let linkTag = document.querySelector(`link[href="${cssUrl}"]`);
|
|
6880
|
+
if (!linkTag) {
|
|
6881
|
+
linkTag = document.createElement("link");
|
|
6882
|
+
linkTag.rel = "stylesheet";
|
|
6883
|
+
linkTag.href = cssUrl;
|
|
6884
|
+
linkTag.type = "text/css";
|
|
6885
|
+
document.head.appendChild(linkTag);
|
|
6886
|
+
}
|
|
6887
|
+
if (!scriptPromise) {
|
|
6888
|
+
scriptPromise = new Promise((resolve, reject) => {
|
|
6889
|
+
let scriptTag = document.querySelector(
|
|
6890
|
+
`script[src="${scriptUrl}"]`
|
|
6891
|
+
);
|
|
6892
|
+
if (!scriptTag) {
|
|
6893
|
+
scriptTag = document.createElement("script");
|
|
6894
|
+
scriptTag.src = scriptUrl;
|
|
6895
|
+
scriptTag.async = true;
|
|
6896
|
+
document.head.appendChild(scriptTag);
|
|
6897
|
+
}
|
|
6898
|
+
scriptTag.addEventListener("load", () => resolve());
|
|
6899
|
+
scriptTag.addEventListener(
|
|
6900
|
+
"error",
|
|
6901
|
+
(err) => reject(
|
|
6902
|
+
err instanceof Error ? err : new Error("Failed to load InPost GeoWidget SDK script")
|
|
6903
|
+
)
|
|
6904
|
+
);
|
|
6905
|
+
});
|
|
6906
|
+
}
|
|
6907
|
+
scriptPromise.then(async () => {
|
|
6908
|
+
if (typeof window !== "undefined" && window.customElements?.whenDefined) {
|
|
6909
|
+
try {
|
|
6910
|
+
await Promise.race([
|
|
6911
|
+
window.customElements.whenDefined("inpost-geowidget"),
|
|
6912
|
+
new Promise((r) => setTimeout(r, 100))
|
|
6913
|
+
]);
|
|
6914
|
+
} catch {
|
|
6915
|
+
}
|
|
6916
|
+
}
|
|
6917
|
+
setIsLoaded(true);
|
|
6918
|
+
}).catch((err) => {
|
|
6919
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
6920
|
+
});
|
|
6921
|
+
}, [scriptUrl, cssUrl]);
|
|
6922
|
+
return { isLoaded, error };
|
|
6923
|
+
}
|
|
6924
|
+
var MOCK_POINTS = [
|
|
6925
|
+
{
|
|
6926
|
+
name: "WAW01M",
|
|
6927
|
+
address: { line1: "ul. Towarowa 5", line2: "00-838 Warszawa" },
|
|
6928
|
+
address_details: {
|
|
6929
|
+
city: "Warszawa",
|
|
6930
|
+
street: "Towarowa",
|
|
6931
|
+
building_number: "5",
|
|
6932
|
+
post_code: "00-838"
|
|
6933
|
+
},
|
|
6934
|
+
location: { latitude: 52.2297, longitude: 21.0122 },
|
|
6935
|
+
type: ["parcel_locker"],
|
|
6936
|
+
status: "Operating",
|
|
6937
|
+
location_description: "Przy stacji benzynowej BP"
|
|
6938
|
+
},
|
|
6939
|
+
{
|
|
6940
|
+
name: "KRA02N",
|
|
6941
|
+
address: { line1: "ul. Floria\u0144ska 12", line2: "31-021 Krak\xF3w" },
|
|
6942
|
+
address_details: {
|
|
6943
|
+
city: "Krak\xF3w",
|
|
6944
|
+
street: "Floria\u0144ska",
|
|
6945
|
+
building_number: "12",
|
|
6946
|
+
post_code: "31-021"
|
|
6947
|
+
},
|
|
6948
|
+
location: { latitude: 50.0647, longitude: 19.945 },
|
|
6949
|
+
type: ["parcel_locker"],
|
|
6950
|
+
status: "Operating",
|
|
6951
|
+
location_description: "Obok wej\u015Bcia do sklepu"
|
|
6952
|
+
},
|
|
6953
|
+
{
|
|
6954
|
+
name: "GDA03P",
|
|
6955
|
+
address: { line1: "ul. D\u0142uga 8", line2: "80-827 Gda\u0144sk" },
|
|
6956
|
+
address_details: { city: "Gda\u0144sk", street: "D\u0142uga", building_number: "8", post_code: "80-827" },
|
|
6957
|
+
location: { latitude: 54.352, longitude: 18.6466 },
|
|
6958
|
+
type: ["parcel_locker"],
|
|
6959
|
+
status: "Operating",
|
|
6960
|
+
location_description: "R\xF3g ulicy D\u0142ugiej i Tkackiej"
|
|
6961
|
+
},
|
|
6962
|
+
{
|
|
6963
|
+
name: "POZ04S",
|
|
6964
|
+
address: { line1: "ul. P\xF3\u0142wiejska 42", line2: "61-888 Pozna\u0144" },
|
|
6965
|
+
address_details: {
|
|
6966
|
+
city: "Pozna\u0144",
|
|
6967
|
+
street: "P\xF3\u0142wiejska",
|
|
6968
|
+
building_number: "42",
|
|
6969
|
+
post_code: "61-888"
|
|
6970
|
+
},
|
|
6971
|
+
location: { latitude: 52.4064, longitude: 16.9252 },
|
|
6972
|
+
type: ["parcel_locker"],
|
|
6973
|
+
status: "Operating",
|
|
6974
|
+
location_description: "Przy centrum handlowym Stary Browar"
|
|
6975
|
+
}
|
|
6976
|
+
];
|
|
6977
|
+
var InPostGeowidget = ({
|
|
6978
|
+
token,
|
|
6979
|
+
language = "pl",
|
|
6980
|
+
config = "parcelCollect",
|
|
6981
|
+
sandbox = false,
|
|
6982
|
+
onPointSelect,
|
|
6983
|
+
onReady,
|
|
6984
|
+
onError,
|
|
6985
|
+
className,
|
|
6986
|
+
style,
|
|
6987
|
+
customScriptUrl,
|
|
6988
|
+
customCssUrl
|
|
6989
|
+
}) => {
|
|
6990
|
+
const { isLoaded, error } = useInPostScript({
|
|
6991
|
+
customScriptUrl,
|
|
6992
|
+
customCssUrl
|
|
6993
|
+
});
|
|
6994
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
6995
|
+
const [selectedMock, setSelectedMock] = useState(null);
|
|
6996
|
+
const widgetRef = useRef(null);
|
|
6997
|
+
const callbackNameRef = useRef(`inpost_cb_${Math.random().toString(36).substring(2, 9)}`);
|
|
6998
|
+
useEffect(() => {
|
|
6999
|
+
if (error && onError) {
|
|
7000
|
+
onError(error);
|
|
7001
|
+
}
|
|
7002
|
+
}, [error, onError]);
|
|
7003
|
+
useEffect(() => {
|
|
7004
|
+
if (isLoaded && onReady) {
|
|
7005
|
+
onReady();
|
|
7006
|
+
}
|
|
7007
|
+
}, [isLoaded, onReady]);
|
|
7008
|
+
useEffect(() => {
|
|
7009
|
+
if (!token) return;
|
|
7010
|
+
const cbName = callbackNameRef.current;
|
|
7011
|
+
window[cbName] = (point) => {
|
|
7012
|
+
if (onPointSelect) {
|
|
7013
|
+
onPointSelect(point);
|
|
7014
|
+
}
|
|
7015
|
+
};
|
|
7016
|
+
const el = widgetRef.current;
|
|
7017
|
+
const handlePointSelect = (event) => {
|
|
7018
|
+
const customEv = event;
|
|
7019
|
+
const point = customEv.detail || customEv.point;
|
|
7020
|
+
if (point && onPointSelect) {
|
|
7021
|
+
onPointSelect(point);
|
|
7022
|
+
}
|
|
7023
|
+
};
|
|
7024
|
+
if (el) {
|
|
7025
|
+
el.addEventListener("inpostgeowidget", handlePointSelect);
|
|
7026
|
+
el.addEventListener("onpointselect", handlePointSelect);
|
|
7027
|
+
}
|
|
7028
|
+
document.addEventListener("onpointselect", handlePointSelect);
|
|
7029
|
+
return () => {
|
|
7030
|
+
delete window[cbName];
|
|
7031
|
+
if (el) {
|
|
7032
|
+
el.removeEventListener("inpostgeowidget", handlePointSelect);
|
|
7033
|
+
el.removeEventListener("onpointselect", handlePointSelect);
|
|
7034
|
+
}
|
|
7035
|
+
document.removeEventListener("onpointselect", handlePointSelect);
|
|
7036
|
+
};
|
|
7037
|
+
}, [onPointSelect, isLoaded, token]);
|
|
7038
|
+
if (error) {
|
|
7039
|
+
return /* @__PURE__ */ jsxs(
|
|
7040
|
+
"div",
|
|
7041
|
+
{
|
|
7042
|
+
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 || ""}`,
|
|
7043
|
+
style,
|
|
7044
|
+
children: [
|
|
7045
|
+
/* @__PURE__ */ jsx("p", { className: "text-base font-extrabold text-danger mb-1", children: "B\u0142\u0105d \u0142adowania Geowidget InPost" }),
|
|
7046
|
+
/* @__PURE__ */ 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." })
|
|
7047
|
+
]
|
|
7048
|
+
}
|
|
7049
|
+
);
|
|
7050
|
+
}
|
|
7051
|
+
if (!token) {
|
|
7052
|
+
const filteredPoints = MOCK_POINTS.filter(
|
|
7053
|
+
(p) => p.name.toLowerCase().includes(searchQuery.toLowerCase()) || p.address.line1.toLowerCase().includes(searchQuery.toLowerCase()) || p.address_details.city.toLowerCase().includes(searchQuery.toLowerCase())
|
|
7054
|
+
);
|
|
7055
|
+
return /* @__PURE__ */ jsxs(
|
|
7056
|
+
"div",
|
|
7057
|
+
{
|
|
7058
|
+
className: `flex flex-col h-full min-h-[500px] bg-surface border-2 border-border rounded-xl p-4 font-sans text-foreground ${className || ""}`,
|
|
7059
|
+
style,
|
|
7060
|
+
children: [
|
|
7061
|
+
/* @__PURE__ */ 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: [
|
|
7062
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
7063
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7064
|
+
/* @__PURE__ */ jsx("span", { className: "w-2.5 h-2.5 rounded-full bg-slate-950 animate-pulse" }),
|
|
7065
|
+
/* @__PURE__ */ jsx("span", { className: "font-black text-sm tracking-tight uppercase", children: "InPost Paczkomat\xAE" })
|
|
7066
|
+
] }),
|
|
7067
|
+
/* @__PURE__ */ 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" })
|
|
7068
|
+
] }),
|
|
7069
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-slate-950 font-bold leading-relaxed opacity-95", children: [
|
|
7070
|
+
"Wybierz punkt z listy poni\u017Cej. Do za\u0142adowania produkcyjnej mapy przeka\u017C prop",
|
|
7071
|
+
" ",
|
|
7072
|
+
/* @__PURE__ */ 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"' }),
|
|
7073
|
+
"."
|
|
7074
|
+
] })
|
|
7075
|
+
] }),
|
|
7076
|
+
/* @__PURE__ */ jsx("div", { className: "mb-3.5 relative", children: /* @__PURE__ */ jsx(
|
|
7077
|
+
"input",
|
|
7078
|
+
{
|
|
7079
|
+
type: "text",
|
|
7080
|
+
placeholder: "Szukaj Paczkomatu (np. Warszawa, WAW01M, Towarowa)...",
|
|
7081
|
+
value: searchQuery,
|
|
7082
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
7083
|
+
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"
|
|
7084
|
+
}
|
|
7085
|
+
) }),
|
|
7086
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto space-y-3 pr-1 max-h-[420px]", children: filteredPoints.map((p) => {
|
|
7087
|
+
const isSelected = selectedMock?.name === p.name;
|
|
7088
|
+
return /* @__PURE__ */ jsxs(
|
|
7089
|
+
"div",
|
|
7090
|
+
{
|
|
7091
|
+
onClick: () => {
|
|
7092
|
+
setSelectedMock(p);
|
|
7093
|
+
if (onPointSelect) {
|
|
7094
|
+
onPointSelect(p);
|
|
7095
|
+
}
|
|
7096
|
+
},
|
|
7097
|
+
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"}`,
|
|
7098
|
+
children: [
|
|
7099
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
7100
|
+
/* @__PURE__ */ jsxs("div", { className: "font-black text-base flex items-center gap-2", children: [
|
|
7101
|
+
/* @__PURE__ */ jsxs(
|
|
7102
|
+
"span",
|
|
7103
|
+
{
|
|
7104
|
+
className: isSelected ? "text-primary-foreground font-black" : "text-foreground font-black",
|
|
7105
|
+
children: [
|
|
7106
|
+
"Paczkomat\xAE ",
|
|
7107
|
+
p.name
|
|
7108
|
+
]
|
|
7109
|
+
}
|
|
7110
|
+
),
|
|
7111
|
+
p.location_description && /* @__PURE__ */ jsx(
|
|
7112
|
+
"span",
|
|
7113
|
+
{
|
|
7114
|
+
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"}`,
|
|
7115
|
+
children: p.location_description
|
|
7116
|
+
}
|
|
7117
|
+
)
|
|
7118
|
+
] }),
|
|
7119
|
+
/* @__PURE__ */ jsxs(
|
|
7120
|
+
"div",
|
|
7121
|
+
{
|
|
7122
|
+
className: `text-xs font-bold ${isSelected ? "text-primary-foreground/90" : "text-muted-foreground"}`,
|
|
7123
|
+
children: [
|
|
7124
|
+
p.address.line1,
|
|
7125
|
+
", ",
|
|
7126
|
+
p.address.line2
|
|
7127
|
+
]
|
|
7128
|
+
}
|
|
7129
|
+
)
|
|
7130
|
+
] }),
|
|
7131
|
+
/* @__PURE__ */ jsx(
|
|
7132
|
+
"button",
|
|
7133
|
+
{
|
|
7134
|
+
type: "button",
|
|
7135
|
+
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"}`,
|
|
7136
|
+
children: isSelected ? "Wybrano \u2713" : "Wybierz"
|
|
7137
|
+
}
|
|
7138
|
+
)
|
|
7139
|
+
]
|
|
7140
|
+
},
|
|
7141
|
+
p.name
|
|
7142
|
+
);
|
|
7143
|
+
}) })
|
|
7144
|
+
]
|
|
7145
|
+
}
|
|
7146
|
+
);
|
|
7147
|
+
}
|
|
7148
|
+
if (!isLoaded) {
|
|
7149
|
+
return /* @__PURE__ */ jsx(
|
|
7150
|
+
"div",
|
|
7151
|
+
{
|
|
7152
|
+
className: `flex items-center justify-center min-h-[450px] bg-surface border-2 border-border rounded-xl p-6 ${className || ""}`,
|
|
7153
|
+
style,
|
|
7154
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-3 text-muted-foreground", children: [
|
|
7155
|
+
/* @__PURE__ */ jsx("div", { className: "w-9 h-9 border-4 border-primary border-t-transparent rounded-full animate-spin" }),
|
|
7156
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-extrabold text-foreground", children: "\u0141adowanie mapy InPost GeoWidget..." })
|
|
7157
|
+
] })
|
|
7158
|
+
}
|
|
7159
|
+
);
|
|
7160
|
+
}
|
|
7161
|
+
const widgetProps = {
|
|
7162
|
+
language,
|
|
7163
|
+
config: String(config).toLowerCase(),
|
|
7164
|
+
// eslint-disable-next-line react-hooks/refs
|
|
7165
|
+
onpointselect: callbackNameRef.current
|
|
7166
|
+
};
|
|
7167
|
+
if (token) {
|
|
7168
|
+
widgetProps.token = token;
|
|
7169
|
+
}
|
|
7170
|
+
if (sandbox) {
|
|
7171
|
+
widgetProps.sandbox = "true";
|
|
7172
|
+
}
|
|
7173
|
+
return /* @__PURE__ */ jsx("div", { className: `w-full h-full min-h-[450px] relative ${className || ""}`, style, children: React52__default.createElement("inpost-geowidget", {
|
|
7174
|
+
ref: widgetRef,
|
|
7175
|
+
...widgetProps,
|
|
7176
|
+
style: { width: "100%", height: "100%", display: "block", minHeight: "450px" }
|
|
7177
|
+
}) });
|
|
7178
|
+
};
|
|
7179
|
+
var InPostGeowidgetModal = ({
|
|
7180
|
+
value,
|
|
7181
|
+
onSelect,
|
|
7182
|
+
triggerText = "Wybierz Paczkomat\xAE",
|
|
7183
|
+
modalTitle = "Wybierz punkt odbioru InPost",
|
|
7184
|
+
disabled = false,
|
|
7185
|
+
open: controlledOpen,
|
|
7186
|
+
onOpenChange,
|
|
7187
|
+
showSelectedBadge = true,
|
|
7188
|
+
className = "",
|
|
7189
|
+
buttonVariant = "outline",
|
|
7190
|
+
buttonSize = "md",
|
|
7191
|
+
token,
|
|
7192
|
+
language,
|
|
7193
|
+
config,
|
|
7194
|
+
sandbox,
|
|
7195
|
+
customScriptUrl,
|
|
7196
|
+
customCssUrl
|
|
7197
|
+
}) => {
|
|
7198
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
7199
|
+
const [selectedPoint, setSelectedPoint] = useState(
|
|
7200
|
+
typeof value === "object" && value ? value : null
|
|
7201
|
+
);
|
|
7202
|
+
const isControlled = controlledOpen !== void 0;
|
|
7203
|
+
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
7204
|
+
const handleOpenToggle = (newOpen) => {
|
|
7205
|
+
if (!isControlled) {
|
|
7206
|
+
setInternalOpen(newOpen);
|
|
7207
|
+
}
|
|
7208
|
+
if (onOpenChange) {
|
|
7209
|
+
onOpenChange(newOpen);
|
|
7210
|
+
}
|
|
7211
|
+
};
|
|
7212
|
+
const handlePointSelect = (point) => {
|
|
7213
|
+
setSelectedPoint(point);
|
|
7214
|
+
if (onSelect) {
|
|
7215
|
+
onSelect(point);
|
|
7216
|
+
}
|
|
7217
|
+
handleOpenToggle(false);
|
|
7218
|
+
};
|
|
7219
|
+
const selectedCode = selectedPoint?.name || (typeof value === "string" ? value : null);
|
|
7220
|
+
const selectedAddress = selectedPoint ? `${selectedPoint.address?.line1 || ""}, ${selectedPoint.address?.line2 || ""}` : null;
|
|
7221
|
+
const isOutline = buttonVariant === "outline";
|
|
7222
|
+
return /* @__PURE__ */ jsxs("div", { className: `inline-flex flex-col gap-3 min-w-[280px] ${className}`, children: [
|
|
7223
|
+
/* @__PURE__ */ jsxs(
|
|
7224
|
+
Button,
|
|
7225
|
+
{
|
|
7226
|
+
type: "button",
|
|
7227
|
+
variant: buttonVariant,
|
|
7228
|
+
size: buttonSize,
|
|
7229
|
+
disabled,
|
|
7230
|
+
onClick: () => handleOpenToggle(true),
|
|
7231
|
+
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"}`,
|
|
7232
|
+
children: [
|
|
7233
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2.5 min-w-0", children: [
|
|
7234
|
+
/* @__PURE__ */ 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" }),
|
|
7235
|
+
/* @__PURE__ */ jsx(
|
|
7236
|
+
"span",
|
|
7237
|
+
{
|
|
7238
|
+
className: `truncate font-bold text-sm ${isOutline ? "text-foreground group-hover:text-primary" : ""}`,
|
|
7239
|
+
children: selectedCode ? `Paczkomat\xAE ${selectedCode}` : triggerText
|
|
7240
|
+
}
|
|
7241
|
+
)
|
|
7242
|
+
] }),
|
|
7243
|
+
/* @__PURE__ */ jsx(
|
|
7244
|
+
"span",
|
|
7245
|
+
{
|
|
7246
|
+
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"}`,
|
|
7247
|
+
children: selectedCode ? "Zmie\u0144" : "Wybierz"
|
|
7248
|
+
}
|
|
7249
|
+
)
|
|
7250
|
+
]
|
|
7251
|
+
}
|
|
7252
|
+
),
|
|
7253
|
+
showSelectedBadge && selectedCode && /* @__PURE__ */ 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: [
|
|
7254
|
+
/* @__PURE__ */ jsxs("div", { className: "font-bold flex items-center justify-between gap-2", children: [
|
|
7255
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-foreground", children: [
|
|
7256
|
+
/* @__PURE__ */ jsx("span", { className: "w-2.5 h-2.5 rounded-full bg-primary shadow-sm animate-pulse" }),
|
|
7257
|
+
/* @__PURE__ */ jsxs("span", { className: "font-black text-sm text-primary", children: [
|
|
7258
|
+
"Paczkomat\xAE ",
|
|
7259
|
+
selectedCode
|
|
7260
|
+
] })
|
|
7261
|
+
] }),
|
|
7262
|
+
/* @__PURE__ */ 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" })
|
|
7263
|
+
] }),
|
|
7264
|
+
selectedAddress && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground text-[0.78rem] font-medium pl-4 border-l-2 border-border", children: selectedAddress })
|
|
7265
|
+
] }),
|
|
7266
|
+
/* @__PURE__ */ jsxs(Modal, { open: isOpen, onClose: () => handleOpenToggle(false), width: 850, children: [
|
|
7267
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 pb-3.5 border-b border-border", children: [
|
|
7268
|
+
/* @__PURE__ */ 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" }),
|
|
7269
|
+
/* @__PURE__ */ jsx(ModalTitle, { className: "m-0 text-xl font-black text-primary tracking-tight", children: modalTitle })
|
|
7270
|
+
] }),
|
|
7271
|
+
/* @__PURE__ */ jsx("div", { className: "w-full h-[600px] min-h-[500px] mt-3.5 rounded-xl overflow-hidden", children: isOpen && /* @__PURE__ */ jsx(
|
|
7272
|
+
InPostGeowidget,
|
|
7273
|
+
{
|
|
7274
|
+
token,
|
|
7275
|
+
language,
|
|
7276
|
+
config,
|
|
7277
|
+
sandbox,
|
|
7278
|
+
customScriptUrl,
|
|
7279
|
+
customCssUrl,
|
|
7280
|
+
onPointSelect: handlePointSelect
|
|
7281
|
+
}
|
|
7282
|
+
) })
|
|
7283
|
+
] })
|
|
7284
|
+
] });
|
|
7285
|
+
};
|
|
6062
7286
|
|
|
6063
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AppShell, AppShellBanner, AppShellFooter, AppShellHeader, AppShellMain, Avatar, AvatarGroup, Badge, BlogCard, BottomNavigation, BottomSheet, BottomSheetContent, BottomSheetDescription, BottomSheetFooter, BottomSheetHeader, BottomSheetTitle, Breadcrumb, BreadcrumbItem, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxField, CodeBlock, ColorPicker, ColorPickerField, ColorPickerSwatch, Combobox, ComboboxField, CommandPalette, ConfirmDialog, DEFAULT_COLOR_SWATCHES, DashboardShell, DataTable, DatePicker, DatePickerField, DateRangePicker, DateRangePickerField, DetailPageLayout, Drawer, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, Dropzone, EmptyState, ErrorState, Fab, Field, FileUpload, FileUploadField, FormField, Hint, ImageGallery, InboxContent, InboxPopover, InboxTrigger, Input, Kbd, Label, MetricCard, Modal, ModalActions, ModalDescription, ModalTitle, NotificationItem, PageHeader, Pagination, Popover, PopoverContent, PopoverTrigger, PricingCard, Progress, ProgressRing, ProgressRingField, ProjectCard, Radio, RangeCalendar, Rating, RatingField, RatingSummary, SectionHeader, Segmented, Select, SelectField, Separator, SettingsLayout, SidebarNav, Skeleton, Slider, Spinner, Stat, Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperList, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, TableToolbar, TableWrap, Tabs, TabsContent, TabsList, TabsTrigger, TextField, Textarea, Timeline, TimelineConnector, TimelineContent, TimelineDot, TimelineItem, TimelineSeparator, TimelineTime, TimelineTitle, ToastProvider, ToggleGroup, Tooltip, badgeVariants, buttonVariants, cn, formatRelativeTime, hexToHsl, hslToHex, isValidHex, normalizeHex, sliderThumbCSS, useInboxState, useStepper, useToast };
|
|
7287
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AppShell, AppShellBanner, AppShellFooter, AppShellHeader, AppShellMain, Avatar, AvatarGroup, Badge, BlogCard, BottomNavigation, BottomSheet, BottomSheetContent, BottomSheetDescription, BottomSheetFooter, BottomSheetHeader, BottomSheetTitle, Breadcrumb, BreadcrumbItem, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxField, CodeBlock, ColorPicker, ColorPickerField, ColorPickerSwatch, Combobox, ComboboxField, CommandPalette, ConfirmDialog, DEFAULT_COLOR_SWATCHES, DashboardShell, DataTable, DatePicker, DatePickerField, DateRangePicker, DateRangePickerField, DetailPageLayout, Drawer, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, Dropzone, EmptyState, ErrorState, Fab, Field, FileUpload, FileUploadField, FormField, Hint, ImageGallery, InPostGeowidget, InPostGeowidgetModal, InboxContent, InboxPopover, InboxTrigger, Input, Kbd, Label, MetricCard, Modal, ModalActions, ModalDescription, ModalTitle, NotificationItem, PageHeader, Pagination, Popover, PopoverContent, PopoverTrigger, PricingCard, Progress, ProgressRing, ProgressRingField, ProjectCard, Radio, RangeCalendar, Rating, RatingField, RatingSummary, SectionHeader, Segmented, Select, SelectField, Separator, SettingsLayout, SidebarNav, Skeleton, Slider, Spinner, Stat, Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperList, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, TableToolbar, TableWrap, Tabs, TabsContent, TabsList, TabsTrigger, TextField, Textarea, Timeline, TimelineConnector, TimelineContent, TimelineDot, TimelineItem, TimelineSeparator, TimelineTime, TimelineTitle, ToastProvider, ToggleGroup, Tooltip, badgeVariants, buttonVariants, cn, formatRelativeTime, hexToHsl, hslToHex, isValidHex, normalizeHex, sliderThumbCSS, useInPostScript, useInboxState, useStepper, useToast };
|
|
6064
7288
|
//# sourceMappingURL=index.js.map
|
|
6065
7289
|
//# sourceMappingURL=index.js.map
|