@underverse-ui/underverse 0.2.13 → 0.2.15
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 +1002 -1084
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +765 -847
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2687,90 +2687,201 @@ var import_react_dom3 = require("react-dom");
|
|
|
2687
2687
|
|
|
2688
2688
|
// ../../lib/utils/shadcn-animations.ts
|
|
2689
2689
|
var shadcnAnimationStyles = `
|
|
2690
|
+
/* ============================================
|
|
2691
|
+
* DROPDOWN / POPOVER ANIMATIONS
|
|
2692
|
+
* Uses spring-like cubic-bezier for natural feel
|
|
2693
|
+
* ============================================ */
|
|
2694
|
+
|
|
2695
|
+
/* Native-like Combobox Animation - Mimics browser default select */
|
|
2696
|
+
[data-state="open"][data-combobox-dropdown] {
|
|
2697
|
+
animation: comboboxOpen 150ms cubic-bezier(0.2, 0, 0, 1);
|
|
2698
|
+
transform-origin: top center;
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
[data-state="closed"][data-combobox-dropdown] {
|
|
2702
|
+
animation: comboboxClose 120ms cubic-bezier(0.4, 0, 1, 1);
|
|
2703
|
+
transform-origin: top center;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
@keyframes comboboxOpen {
|
|
2707
|
+
0% {
|
|
2708
|
+
opacity: 0;
|
|
2709
|
+
transform: translateY(-4px) scaleY(0.9);
|
|
2710
|
+
}
|
|
2711
|
+
100% {
|
|
2712
|
+
opacity: 1;
|
|
2713
|
+
transform: translateY(0) scaleY(1);
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
@keyframes comboboxClose {
|
|
2718
|
+
0% {
|
|
2719
|
+
opacity: 1;
|
|
2720
|
+
transform: translateY(0) scaleY(1);
|
|
2721
|
+
}
|
|
2722
|
+
100% {
|
|
2723
|
+
opacity: 0;
|
|
2724
|
+
transform: translateY(-4px) scaleY(0.9);
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
/* Generic dropdown open/close */
|
|
2690
2729
|
[data-state="open"] {
|
|
2691
|
-
animation: slideDownAndFade
|
|
2730
|
+
animation: slideDownAndFade 220ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
2692
2731
|
}
|
|
2693
2732
|
|
|
2694
2733
|
[data-state="closed"] {
|
|
2695
|
-
animation: slideUpAndFade
|
|
2734
|
+
animation: slideUpAndFade 180ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
2696
2735
|
}
|
|
2697
2736
|
|
|
2698
2737
|
@keyframes slideDownAndFade {
|
|
2699
2738
|
from {
|
|
2700
2739
|
opacity: 0;
|
|
2701
|
-
transform: translateY(-
|
|
2740
|
+
transform: translateY(-4px) scale(0.98);
|
|
2702
2741
|
}
|
|
2703
2742
|
to {
|
|
2704
2743
|
opacity: 1;
|
|
2705
|
-
transform: translateY(0);
|
|
2744
|
+
transform: translateY(0) scale(1);
|
|
2706
2745
|
}
|
|
2707
2746
|
}
|
|
2708
2747
|
|
|
2709
2748
|
@keyframes slideUpAndFade {
|
|
2710
2749
|
from {
|
|
2711
2750
|
opacity: 1;
|
|
2712
|
-
transform: translateY(0);
|
|
2751
|
+
transform: translateY(0) scale(1);
|
|
2713
2752
|
}
|
|
2714
2753
|
to {
|
|
2715
2754
|
opacity: 0;
|
|
2716
|
-
transform: translateY(-
|
|
2755
|
+
transform: translateY(-4px) scale(0.98);
|
|
2717
2756
|
}
|
|
2718
2757
|
}
|
|
2719
2758
|
|
|
2759
|
+
/* ============================================
|
|
2760
|
+
* DROPDOWN ITEMS - Native-like instant appearance
|
|
2761
|
+
* ============================================ */
|
|
2762
|
+
|
|
2763
|
+
/* Fast staggered animation for native feel */
|
|
2720
2764
|
.dropdown-item {
|
|
2721
2765
|
opacity: 0;
|
|
2722
|
-
animation:
|
|
2766
|
+
animation: itemFadeIn 120ms cubic-bezier(0.2, 0, 0, 1) forwards;
|
|
2723
2767
|
}
|
|
2724
|
-
|
|
2725
|
-
@keyframes
|
|
2726
|
-
|
|
2768
|
+
|
|
2769
|
+
@keyframes itemFadeIn {
|
|
2770
|
+
0% {
|
|
2727
2771
|
opacity: 0;
|
|
2728
|
-
transform: translateY(
|
|
2772
|
+
transform: translateY(-2px);
|
|
2729
2773
|
}
|
|
2730
|
-
|
|
2774
|
+
100% {
|
|
2731
2775
|
opacity: 1;
|
|
2732
2776
|
transform: translateY(0);
|
|
2733
2777
|
}
|
|
2734
2778
|
}
|
|
2779
|
+
|
|
2780
|
+
/* Subtle hover effect */
|
|
2781
|
+
.dropdown-item {
|
|
2782
|
+
transition: background-color 100ms ease;
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
/* ============================================
|
|
2786
|
+
* TOOLTIP / SIDE ANIMATIONS
|
|
2787
|
+
* ============================================ */
|
|
2735
2788
|
|
|
2736
|
-
/* Tooltip specific animations */
|
|
2737
2789
|
[data-side="top"] {
|
|
2738
|
-
animation:
|
|
2790
|
+
animation: slideFromBottom 200ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
2739
2791
|
}
|
|
2740
2792
|
|
|
2741
2793
|
[data-side="bottom"] {
|
|
2742
|
-
animation:
|
|
2794
|
+
animation: slideFromTop 200ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
2743
2795
|
}
|
|
2744
2796
|
|
|
2745
2797
|
[data-side="left"] {
|
|
2746
|
-
animation:
|
|
2798
|
+
animation: slideFromRight 200ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
2747
2799
|
}
|
|
2748
2800
|
|
|
2749
2801
|
[data-side="right"] {
|
|
2750
|
-
animation:
|
|
2802
|
+
animation: slideFromLeft 200ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
@keyframes slideFromTop {
|
|
2806
|
+
from {
|
|
2807
|
+
opacity: 0;
|
|
2808
|
+
transform: translateY(-6px) scale(0.96);
|
|
2809
|
+
}
|
|
2810
|
+
to {
|
|
2811
|
+
opacity: 1;
|
|
2812
|
+
transform: translateY(0) scale(1);
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
@keyframes slideFromBottom {
|
|
2817
|
+
from {
|
|
2818
|
+
opacity: 0;
|
|
2819
|
+
transform: translateY(6px) scale(0.96);
|
|
2820
|
+
}
|
|
2821
|
+
to {
|
|
2822
|
+
opacity: 1;
|
|
2823
|
+
transform: translateY(0) scale(1);
|
|
2824
|
+
}
|
|
2751
2825
|
}
|
|
2752
2826
|
|
|
2753
|
-
@keyframes
|
|
2827
|
+
@keyframes slideFromLeft {
|
|
2754
2828
|
from {
|
|
2755
2829
|
opacity: 0;
|
|
2756
|
-
transform: translateX(
|
|
2830
|
+
transform: translateX(-6px) scale(0.96);
|
|
2757
2831
|
}
|
|
2758
2832
|
to {
|
|
2759
2833
|
opacity: 1;
|
|
2760
|
-
transform: translateX(0);
|
|
2834
|
+
transform: translateX(0) scale(1);
|
|
2761
2835
|
}
|
|
2762
2836
|
}
|
|
2763
2837
|
|
|
2764
|
-
@keyframes
|
|
2838
|
+
@keyframes slideFromRight {
|
|
2765
2839
|
from {
|
|
2766
2840
|
opacity: 0;
|
|
2767
|
-
transform: translateX(
|
|
2841
|
+
transform: translateX(6px) scale(0.96);
|
|
2768
2842
|
}
|
|
2769
2843
|
to {
|
|
2770
2844
|
opacity: 1;
|
|
2771
|
-
transform: translateX(0);
|
|
2845
|
+
transform: translateX(0) scale(1);
|
|
2846
|
+
}
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
/* ============================================
|
|
2850
|
+
* UTILITY ANIMATIONS
|
|
2851
|
+
* ============================================ */
|
|
2852
|
+
|
|
2853
|
+
.animate-bounce-subtle {
|
|
2854
|
+
animation: bounceSubtle 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
2855
|
+
}
|
|
2856
|
+
|
|
2857
|
+
@keyframes bounceSubtle {
|
|
2858
|
+
0%, 100% {
|
|
2859
|
+
transform: translateY(0);
|
|
2860
|
+
}
|
|
2861
|
+
50% {
|
|
2862
|
+
transform: translateY(-4px);
|
|
2772
2863
|
}
|
|
2773
2864
|
}
|
|
2865
|
+
|
|
2866
|
+
.animate-scale-in {
|
|
2867
|
+
animation: scaleIn 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
@keyframes scaleIn {
|
|
2871
|
+
from {
|
|
2872
|
+
opacity: 0;
|
|
2873
|
+
transform: scale(0.9);
|
|
2874
|
+
}
|
|
2875
|
+
to {
|
|
2876
|
+
opacity: 1;
|
|
2877
|
+
transform: scale(1);
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
/* Smooth backdrop blur transition */
|
|
2882
|
+
.backdrop-animate {
|
|
2883
|
+
transition: backdrop-filter 200ms ease, background-color 200ms ease;
|
|
2884
|
+
}
|
|
2774
2885
|
`;
|
|
2775
2886
|
var useShadCNAnimations = () => {
|
|
2776
2887
|
if (typeof document !== "undefined") {
|
|
@@ -3166,25 +3277,7 @@ var SidebarSheet = ({ navigation, children, ...props }) => {
|
|
|
3166
3277
|
|
|
3167
3278
|
// ../../components/ui/Alert.tsx
|
|
3168
3279
|
var import_react8 = require("react");
|
|
3169
|
-
|
|
3170
|
-
// ../../components/icons/AlertIcons.tsx
|
|
3171
3280
|
var import_lucide_react8 = require("lucide-react");
|
|
3172
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3173
|
-
function InfoIcon(props) {
|
|
3174
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Info, { "aria-hidden": true, className: props.className });
|
|
3175
|
-
}
|
|
3176
|
-
function WarningIcon(props) {
|
|
3177
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.AlertTriangle, { "aria-hidden": true, className: props.className });
|
|
3178
|
-
}
|
|
3179
|
-
function CheckCircleIcon(props) {
|
|
3180
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.CheckCircle2, { "aria-hidden": true, className: props.className });
|
|
3181
|
-
}
|
|
3182
|
-
function ErrorIcon(props) {
|
|
3183
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.OctagonX, { "aria-hidden": true, className: props.className });
|
|
3184
|
-
}
|
|
3185
|
-
|
|
3186
|
-
// ../../components/ui/Alert.tsx
|
|
3187
|
-
var import_lucide_react9 = require("lucide-react");
|
|
3188
3281
|
var import_next_intl2 = require("next-intl");
|
|
3189
3282
|
|
|
3190
3283
|
// ../../lib/constants/constants-ui/alert.ts
|
|
@@ -3198,13 +3291,13 @@ var VARIANT_STYLES_ALERT = {
|
|
|
3198
3291
|
};
|
|
3199
3292
|
|
|
3200
3293
|
// ../../components/ui/Alert.tsx
|
|
3201
|
-
var
|
|
3294
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3202
3295
|
var variantIcons = {
|
|
3203
|
-
default: /* @__PURE__ */ (0,
|
|
3204
|
-
info: /* @__PURE__ */ (0,
|
|
3205
|
-
success: /* @__PURE__ */ (0,
|
|
3206
|
-
warning: /* @__PURE__ */ (0,
|
|
3207
|
-
error: /* @__PURE__ */ (0,
|
|
3296
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Info, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3297
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Info, { className: "h-4 w-4 text-info" }),
|
|
3298
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.CheckCircle, { className: "h-4 w-4 text-success" }),
|
|
3299
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.AlertTriangle, { className: "h-4 w-4 text-warning" }),
|
|
3300
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.XCircle, { className: "h-4 w-4 text-destructive" })
|
|
3208
3301
|
};
|
|
3209
3302
|
var Alert = ({ title, description, variant = "default", className, icon, dismissible = false, onClose, actions, closeAriaLabel }) => {
|
|
3210
3303
|
const [open, setOpen] = (0, import_react8.useState)(true);
|
|
@@ -3214,26 +3307,26 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
3214
3307
|
setOpen(false);
|
|
3215
3308
|
onClose?.();
|
|
3216
3309
|
};
|
|
3217
|
-
return /* @__PURE__ */ (0,
|
|
3310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3218
3311
|
"div",
|
|
3219
3312
|
{
|
|
3220
3313
|
className: cn("w-full p-4 rounded-md flex items-start gap-3", VARIANT_STYLES_ALERT[variant], className),
|
|
3221
3314
|
role: "alert",
|
|
3222
3315
|
"aria-live": variant === "error" ? "assertive" : "polite",
|
|
3223
3316
|
children: [
|
|
3224
|
-
/* @__PURE__ */ (0,
|
|
3225
|
-
/* @__PURE__ */ (0,
|
|
3226
|
-
title && /* @__PURE__ */ (0,
|
|
3227
|
-
description && (typeof description === "string" ? /* @__PURE__ */ (0,
|
|
3228
|
-
actions && /* @__PURE__ */ (0,
|
|
3317
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "pt-1", children: icon ?? variantIcons[variant] }),
|
|
3318
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3319
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "font-semibold text-sm leading-none mb-1 text-foreground", children: title }),
|
|
3320
|
+
description && (typeof description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground leading-relaxed break-words", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-sm text-muted-foreground leading-relaxed break-words", children: description })),
|
|
3321
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mt-2 flex flex-wrap gap-2", children: actions })
|
|
3229
3322
|
] }),
|
|
3230
|
-
dismissible && /* @__PURE__ */ (0,
|
|
3323
|
+
dismissible && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3231
3324
|
"button",
|
|
3232
3325
|
{
|
|
3233
3326
|
onClick: handleClose,
|
|
3234
3327
|
className: "rounded-md p-1 hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3235
3328
|
"aria-label": closeAriaLabel || t("closeAlert"),
|
|
3236
|
-
children: /* @__PURE__ */ (0,
|
|
3329
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.X, { className: "h-4 w-4" })
|
|
3237
3330
|
}
|
|
3238
3331
|
)
|
|
3239
3332
|
]
|
|
@@ -3244,7 +3337,7 @@ var Alert_default = Alert;
|
|
|
3244
3337
|
|
|
3245
3338
|
// ../../components/ui/GlobalLoading.tsx
|
|
3246
3339
|
var import_react9 = __toESM(require("react"), 1);
|
|
3247
|
-
var
|
|
3340
|
+
var import_lucide_react9 = require("lucide-react");
|
|
3248
3341
|
|
|
3249
3342
|
// ../../lib/utils/loading.ts
|
|
3250
3343
|
var LoadingManager = class {
|
|
@@ -3289,7 +3382,7 @@ var loading = new LoadingManager();
|
|
|
3289
3382
|
|
|
3290
3383
|
// ../../components/ui/GlobalLoading.tsx
|
|
3291
3384
|
var import_next_intl3 = require("next-intl");
|
|
3292
|
-
var
|
|
3385
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3293
3386
|
var GlobalLoading = ({
|
|
3294
3387
|
className,
|
|
3295
3388
|
backdrop = true,
|
|
@@ -3302,7 +3395,7 @@ var GlobalLoading = ({
|
|
|
3302
3395
|
return unsubscribe;
|
|
3303
3396
|
}, []);
|
|
3304
3397
|
if (!state.isVisible) return null;
|
|
3305
|
-
return /* @__PURE__ */ (0,
|
|
3398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3306
3399
|
"div",
|
|
3307
3400
|
{
|
|
3308
3401
|
className: cn(
|
|
@@ -3314,9 +3407,9 @@ var GlobalLoading = ({
|
|
|
3314
3407
|
role: "dialog",
|
|
3315
3408
|
"aria-modal": true,
|
|
3316
3409
|
"aria-label": "Loading",
|
|
3317
|
-
children: /* @__PURE__ */ (0,
|
|
3318
|
-
/* @__PURE__ */ (0,
|
|
3319
|
-
state.text && /* @__PURE__ */ (0,
|
|
3410
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center justify-center space-x-3 backdrop-blur-sm rounded-lg px-6 py-4 shadow-lg", role: "status", "aria-live": "assertive", "aria-busy": true, children: [
|
|
3411
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.Activity, { className: "w-6 h-6 animate-spin text-primary-background", "aria-hidden": true }),
|
|
3412
|
+
state.text && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-base font-medium text-foreground", children: state.text })
|
|
3320
3413
|
] })
|
|
3321
3414
|
}
|
|
3322
3415
|
);
|
|
@@ -3327,14 +3420,14 @@ var PageLoading = ({
|
|
|
3327
3420
|
}) => {
|
|
3328
3421
|
const t = (0, import_next_intl3.useTranslations)("Loading");
|
|
3329
3422
|
const defaultMessage = message || t("loadingPage");
|
|
3330
|
-
return /* @__PURE__ */ (0,
|
|
3423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn(
|
|
3331
3424
|
"min-h-screen flex items-center justify-center bg-background",
|
|
3332
3425
|
className
|
|
3333
|
-
), children: /* @__PURE__ */ (0,
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3336
|
-
/* @__PURE__ */ (0,
|
|
3337
|
-
/* @__PURE__ */ (0,
|
|
3426
|
+
), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "text-center space-y-4", children: [
|
|
3427
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.Activity, { className: "w-8 h-8 animate-spin text-primary mx-auto" }),
|
|
3428
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
3429
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-lg font-medium text-foreground", children: defaultMessage }),
|
|
3430
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-muted-foreground mt-2", children: t("pleaseWait") })
|
|
3338
3431
|
] })
|
|
3339
3432
|
] }) });
|
|
3340
3433
|
};
|
|
@@ -3350,9 +3443,9 @@ var InlineLoading = ({
|
|
|
3350
3443
|
md: "w-6 h-6",
|
|
3351
3444
|
lg: "w-8 h-8"
|
|
3352
3445
|
};
|
|
3353
|
-
return /* @__PURE__ */ (0,
|
|
3354
|
-
/* @__PURE__ */ (0,
|
|
3355
|
-
text && /* @__PURE__ */ (0,
|
|
3446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cn("flex items-center justify-center space-x-2", className), children: [
|
|
3447
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.Activity, { className: cn("animate-spin text-primary", sizeClasses2[size]) }),
|
|
3448
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm text-muted-foreground animate-pulse", children: text })
|
|
3356
3449
|
] });
|
|
3357
3450
|
};
|
|
3358
3451
|
var ButtonLoading = ({
|
|
@@ -3366,7 +3459,7 @@ var ButtonLoading = ({
|
|
|
3366
3459
|
disabled: (children.props?.disabled ?? false) || disabled || isLoading,
|
|
3367
3460
|
"aria-busy": isLoading || void 0
|
|
3368
3461
|
}) : children;
|
|
3369
|
-
return /* @__PURE__ */ (0,
|
|
3462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3370
3463
|
"div",
|
|
3371
3464
|
{
|
|
3372
3465
|
className: cn(
|
|
@@ -3375,11 +3468,11 @@ var ButtonLoading = ({
|
|
|
3375
3468
|
className
|
|
3376
3469
|
),
|
|
3377
3470
|
children: [
|
|
3378
|
-
isLoading && /* @__PURE__ */ (0,
|
|
3379
|
-
/* @__PURE__ */ (0,
|
|
3380
|
-
loadingText && /* @__PURE__ */ (0,
|
|
3471
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: [
|
|
3472
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.Activity, { className: "w-4 h-4 animate-spin text-primary-foreground" }),
|
|
3473
|
+
loadingText && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ml-2 text-sm", children: loadingText })
|
|
3381
3474
|
] }),
|
|
3382
|
-
/* @__PURE__ */ (0,
|
|
3475
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn(isLoading && "opacity-50 pointer-events-none"), children: child })
|
|
3383
3476
|
]
|
|
3384
3477
|
}
|
|
3385
3478
|
);
|
|
@@ -3388,8 +3481,8 @@ var ButtonLoading = ({
|
|
|
3388
3481
|
// ../../components/ui/Breadcrumb.tsx
|
|
3389
3482
|
var React15 = __toESM(require("react"), 1);
|
|
3390
3483
|
var import_link = __toESM(require("next/link"), 1);
|
|
3391
|
-
var
|
|
3392
|
-
var
|
|
3484
|
+
var import_lucide_react10 = require("lucide-react");
|
|
3485
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3393
3486
|
var sizeStyles5 = {
|
|
3394
3487
|
sm: {
|
|
3395
3488
|
text: "text-xs",
|
|
@@ -3420,7 +3513,7 @@ var variantStyles4 = {
|
|
|
3420
3513
|
var Breadcrumb = ({
|
|
3421
3514
|
items,
|
|
3422
3515
|
className,
|
|
3423
|
-
separator =
|
|
3516
|
+
separator = import_lucide_react10.ChevronRight,
|
|
3424
3517
|
size = "md",
|
|
3425
3518
|
variant = "default",
|
|
3426
3519
|
maxItems = 5,
|
|
@@ -3436,16 +3529,16 @@ var Breadcrumb = ({
|
|
|
3436
3529
|
}, [items.length, maxItems, collapsible]);
|
|
3437
3530
|
const getSeparator = () => {
|
|
3438
3531
|
if (typeof separator === "string") {
|
|
3439
|
-
return /* @__PURE__ */ (0,
|
|
3532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-muted-foreground", children: separator });
|
|
3440
3533
|
}
|
|
3441
3534
|
if (variant === "slash") {
|
|
3442
|
-
return /* @__PURE__ */ (0,
|
|
3535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-muted-foreground", children: "/" });
|
|
3443
3536
|
}
|
|
3444
3537
|
if (variant === "arrow") {
|
|
3445
|
-
return /* @__PURE__ */ (0,
|
|
3538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-muted-foreground", children: "\u2192" });
|
|
3446
3539
|
}
|
|
3447
3540
|
const SeparatorComponent = separator;
|
|
3448
|
-
return /* @__PURE__ */ (0,
|
|
3541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SeparatorComponent, { className: cn("text-muted-foreground", sizeStyles5[size].icon) });
|
|
3449
3542
|
};
|
|
3450
3543
|
const processedItems = React15.useMemo(() => {
|
|
3451
3544
|
let finalItems = [...items];
|
|
@@ -3453,7 +3546,7 @@ var Breadcrumb = ({
|
|
|
3453
3546
|
finalItems.unshift({
|
|
3454
3547
|
label: "Home",
|
|
3455
3548
|
href: homeHref,
|
|
3456
|
-
icon:
|
|
3549
|
+
icon: import_lucide_react10.Home
|
|
3457
3550
|
});
|
|
3458
3551
|
}
|
|
3459
3552
|
if (isCollapsed && finalItems.length > maxItems) {
|
|
@@ -3466,17 +3559,17 @@ var Breadcrumb = ({
|
|
|
3466
3559
|
const handleCollapseToggle = () => {
|
|
3467
3560
|
setIsCollapsed(!isCollapsed);
|
|
3468
3561
|
};
|
|
3469
|
-
return /* @__PURE__ */ (0,
|
|
3562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3470
3563
|
"nav",
|
|
3471
3564
|
{
|
|
3472
3565
|
className: cn("flex w-full items-center", sizeStyles5[size].text, className),
|
|
3473
3566
|
"aria-label": "Breadcrumb navigation",
|
|
3474
|
-
children: /* @__PURE__ */ (0,
|
|
3567
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ol", { className: cn("flex items-center", sizeStyles5[size].spacing), children: processedItems.map((item, index) => {
|
|
3475
3568
|
const isLast = index === processedItems.length - 1;
|
|
3476
3569
|
const isCollapsedIndicator = item.label === "...";
|
|
3477
3570
|
const Icon = item.icon;
|
|
3478
|
-
return /* @__PURE__ */ (0,
|
|
3479
|
-
isCollapsedIndicator ? /* @__PURE__ */ (0,
|
|
3571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("li", { className: "flex items-center", children: [
|
|
3572
|
+
isCollapsedIndicator ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3480
3573
|
"button",
|
|
3481
3574
|
{
|
|
3482
3575
|
onClick: handleCollapseToggle,
|
|
@@ -3487,9 +3580,9 @@ var Breadcrumb = ({
|
|
|
3487
3580
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
|
|
3488
3581
|
),
|
|
3489
3582
|
"aria-label": "Show all breadcrumb items",
|
|
3490
|
-
children: /* @__PURE__ */ (0,
|
|
3583
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.MoreHorizontal, { className: sizeStyles5[size].icon })
|
|
3491
3584
|
}
|
|
3492
|
-
) : item.href && !isLast && !item.disabled ? /* @__PURE__ */ (0,
|
|
3585
|
+
) : item.href && !isLast && !item.disabled ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3493
3586
|
import_link.default,
|
|
3494
3587
|
{
|
|
3495
3588
|
href: item.href,
|
|
@@ -3500,11 +3593,11 @@ var Breadcrumb = ({
|
|
|
3500
3593
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 rounded-sm"
|
|
3501
3594
|
),
|
|
3502
3595
|
children: [
|
|
3503
|
-
Icon && /* @__PURE__ */ (0,
|
|
3504
|
-
/* @__PURE__ */ (0,
|
|
3596
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { className: sizeStyles5[size].icon }),
|
|
3597
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: item.label })
|
|
3505
3598
|
]
|
|
3506
3599
|
}
|
|
3507
|
-
) : /* @__PURE__ */ (0,
|
|
3600
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3508
3601
|
"span",
|
|
3509
3602
|
{
|
|
3510
3603
|
className: cn(
|
|
@@ -3514,12 +3607,12 @@ var Breadcrumb = ({
|
|
|
3514
3607
|
),
|
|
3515
3608
|
"aria-current": isLast ? "page" : void 0,
|
|
3516
3609
|
children: [
|
|
3517
|
-
Icon && /* @__PURE__ */ (0,
|
|
3518
|
-
/* @__PURE__ */ (0,
|
|
3610
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { className: sizeStyles5[size].icon }),
|
|
3611
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: item.label })
|
|
3519
3612
|
]
|
|
3520
3613
|
}
|
|
3521
3614
|
),
|
|
3522
|
-
!isLast && /* @__PURE__ */ (0,
|
|
3615
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3523
3616
|
"span",
|
|
3524
3617
|
{
|
|
3525
3618
|
className: cn("mx-1", sizeStyles5[size].spacing),
|
|
@@ -3537,7 +3630,7 @@ var Breadcrumb_default = Breadcrumb;
|
|
|
3537
3630
|
|
|
3538
3631
|
// ../../components/ui/Tab.tsx
|
|
3539
3632
|
var React16 = __toESM(require("react"), 1);
|
|
3540
|
-
var
|
|
3633
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3541
3634
|
var sizeStyles6 = {
|
|
3542
3635
|
sm: {
|
|
3543
3636
|
tab: "py-1.5 px-3 text-xs",
|
|
@@ -3625,14 +3718,14 @@ var Tabs = ({
|
|
|
3625
3718
|
className
|
|
3626
3719
|
);
|
|
3627
3720
|
const activeTab = tabs.find((tab) => tab.value === active);
|
|
3628
|
-
return /* @__PURE__ */ (0,
|
|
3629
|
-
/* @__PURE__ */ (0,
|
|
3721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("w-full", orientation === "vertical" && "flex gap-6"), children: [
|
|
3722
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: containerClasses, role: "tablist", "aria-orientation": orientation, children: [
|
|
3630
3723
|
tabs.map((tab, index) => {
|
|
3631
3724
|
const isActive = active === tab.value;
|
|
3632
3725
|
const Icon = tab.icon;
|
|
3633
3726
|
const tabId = `${baseId}-tab-${index}`;
|
|
3634
3727
|
const panelId = `${baseId}-panel-${index}`;
|
|
3635
|
-
return /* @__PURE__ */ (0,
|
|
3728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3636
3729
|
"button",
|
|
3637
3730
|
{
|
|
3638
3731
|
ref: (el) => {
|
|
@@ -3684,14 +3777,14 @@ var Tabs = ({
|
|
|
3684
3777
|
}
|
|
3685
3778
|
},
|
|
3686
3779
|
children: [
|
|
3687
|
-
Icon && /* @__PURE__ */ (0,
|
|
3780
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { className: "h-4 w-4" }),
|
|
3688
3781
|
tab.label
|
|
3689
3782
|
]
|
|
3690
3783
|
},
|
|
3691
3784
|
tab.value
|
|
3692
3785
|
);
|
|
3693
3786
|
}),
|
|
3694
|
-
variant === "underline" && orientation === "horizontal" && /* @__PURE__ */ (0,
|
|
3787
|
+
variant === "underline" && orientation === "horizontal" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3695
3788
|
"div",
|
|
3696
3789
|
{
|
|
3697
3790
|
className: "absolute bottom-0 h-0.5 bg-primary transition-all duration-300 ease-out",
|
|
@@ -3699,7 +3792,7 @@ var Tabs = ({
|
|
|
3699
3792
|
}
|
|
3700
3793
|
)
|
|
3701
3794
|
] }),
|
|
3702
|
-
/* @__PURE__ */ (0,
|
|
3795
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3703
3796
|
"div",
|
|
3704
3797
|
{
|
|
3705
3798
|
role: "tabpanel",
|
|
@@ -3717,7 +3810,7 @@ var Tabs = ({
|
|
|
3717
3810
|
] });
|
|
3718
3811
|
};
|
|
3719
3812
|
var SimpleTabs = ({ tabs, defaultValue, className }) => {
|
|
3720
|
-
return /* @__PURE__ */ (0,
|
|
3813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3721
3814
|
Tabs,
|
|
3722
3815
|
{
|
|
3723
3816
|
tabs,
|
|
@@ -3729,7 +3822,7 @@ var SimpleTabs = ({ tabs, defaultValue, className }) => {
|
|
|
3729
3822
|
);
|
|
3730
3823
|
};
|
|
3731
3824
|
var PillTabs = ({ contained = true, ...props }) => {
|
|
3732
|
-
return /* @__PURE__ */ (0,
|
|
3825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3733
3826
|
Tabs,
|
|
3734
3827
|
{
|
|
3735
3828
|
...props,
|
|
@@ -3743,7 +3836,7 @@ var VerticalTabs = ({
|
|
|
3743
3836
|
className,
|
|
3744
3837
|
...props
|
|
3745
3838
|
}) => {
|
|
3746
|
-
return /* @__PURE__ */ (0,
|
|
3839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("flex gap-6", className), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn(sidebarWidth, "flex-shrink-0"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3747
3840
|
Tabs,
|
|
3748
3841
|
{
|
|
3749
3842
|
...props,
|
|
@@ -3757,7 +3850,7 @@ var VerticalTabs = ({
|
|
|
3757
3850
|
// ../../components/ui/DropdownMenu.tsx
|
|
3758
3851
|
var import_react10 = __toESM(require("react"), 1);
|
|
3759
3852
|
var import_react_dom5 = require("react-dom");
|
|
3760
|
-
var
|
|
3853
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3761
3854
|
var DropdownMenu = ({
|
|
3762
3855
|
trigger,
|
|
3763
3856
|
children,
|
|
@@ -3879,28 +3972,24 @@ var DropdownMenu = ({
|
|
|
3879
3972
|
setOpen(false);
|
|
3880
3973
|
}
|
|
3881
3974
|
};
|
|
3882
|
-
const dropdownContent = open ? /* @__PURE__ */ (0,
|
|
3975
|
+
const dropdownContent = open ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3883
3976
|
"div",
|
|
3884
3977
|
{
|
|
3885
3978
|
"data-dropdown-menu": true,
|
|
3979
|
+
"data-combobox-dropdown": true,
|
|
3886
3980
|
ref: contentRef,
|
|
3887
3981
|
style: {
|
|
3888
3982
|
position: "absolute",
|
|
3889
3983
|
top: position?.top ?? -9999,
|
|
3890
3984
|
left: position?.left ?? -9999,
|
|
3891
3985
|
zIndex: 9999,
|
|
3892
|
-
visibility: position ? "visible" : "hidden"
|
|
3986
|
+
visibility: position ? "visible" : "hidden",
|
|
3987
|
+
transformOrigin: "top center"
|
|
3893
3988
|
},
|
|
3894
3989
|
"data-state": open ? "open" : "closed",
|
|
3895
3990
|
role: "menu",
|
|
3896
|
-
className: cn(
|
|
3897
|
-
|
|
3898
|
-
// shadcn-like enter/exit animations
|
|
3899
|
-
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
3900
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3901
|
-
className
|
|
3902
|
-
),
|
|
3903
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3991
|
+
className: cn("z-9999 min-w-40", className),
|
|
3992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3904
3993
|
"div",
|
|
3905
3994
|
{
|
|
3906
3995
|
className: cn(
|
|
@@ -3910,7 +3999,7 @@ var DropdownMenu = ({
|
|
|
3910
3999
|
),
|
|
3911
4000
|
children: items ? items.map((item, index) => {
|
|
3912
4001
|
const IconComponent = item.icon;
|
|
3913
|
-
return /* @__PURE__ */ (0,
|
|
4002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3914
4003
|
"button",
|
|
3915
4004
|
{
|
|
3916
4005
|
ref: (el) => {
|
|
@@ -3921,7 +4010,7 @@ var DropdownMenu = ({
|
|
|
3921
4010
|
role: "menuitem",
|
|
3922
4011
|
tabIndex: -1,
|
|
3923
4012
|
style: {
|
|
3924
|
-
animationDelay: open ? `${index *
|
|
4013
|
+
animationDelay: open ? `${Math.min(index * 20, 200)}ms` : "0ms"
|
|
3925
4014
|
},
|
|
3926
4015
|
className: cn(
|
|
3927
4016
|
"dropdown-item flex w-full items-center gap-2 px-2.5 py-1.5 text-sm rounded-sm",
|
|
@@ -3932,7 +4021,7 @@ var DropdownMenu = ({
|
|
|
3932
4021
|
item.destructive && "text-destructive hover:bg-destructive/10 focus:bg-destructive/10"
|
|
3933
4022
|
),
|
|
3934
4023
|
children: [
|
|
3935
|
-
IconComponent && /* @__PURE__ */ (0,
|
|
4024
|
+
IconComponent && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(IconComponent, { className: "h-4 w-4" }),
|
|
3936
4025
|
item.label
|
|
3937
4026
|
]
|
|
3938
4027
|
},
|
|
@@ -3943,7 +4032,7 @@ var DropdownMenu = ({
|
|
|
3943
4032
|
)
|
|
3944
4033
|
}
|
|
3945
4034
|
) : null;
|
|
3946
|
-
return /* @__PURE__ */ (0,
|
|
4035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
3947
4036
|
import_react10.default.cloneElement(trigger, {
|
|
3948
4037
|
ref: triggerRef,
|
|
3949
4038
|
onClick: handleTriggerClick,
|
|
@@ -3959,7 +4048,7 @@ var DropdownMenu = ({
|
|
|
3959
4048
|
dropdownContent && typeof window !== "undefined" && (0, import_react_dom5.createPortal)(dropdownContent, document.body)
|
|
3960
4049
|
] });
|
|
3961
4050
|
};
|
|
3962
|
-
var DropdownMenuItem = ({ children, onClick, disabled, destructive, className }) => /* @__PURE__ */ (0,
|
|
4051
|
+
var DropdownMenuItem = ({ children, onClick, disabled, destructive, className }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3963
4052
|
"button",
|
|
3964
4053
|
{
|
|
3965
4054
|
onClick,
|
|
@@ -3975,11 +4064,11 @@ var DropdownMenuItem = ({ children, onClick, disabled, destructive, className })
|
|
|
3975
4064
|
children
|
|
3976
4065
|
}
|
|
3977
4066
|
);
|
|
3978
|
-
var DropdownMenuSeparator = ({ className }) => /* @__PURE__ */ (0,
|
|
3979
|
-
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className }) => /* @__PURE__ */ (0,
|
|
4067
|
+
var DropdownMenuSeparator = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cn("h-px bg-border my-1", className) });
|
|
4068
|
+
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3980
4069
|
DropdownMenu,
|
|
3981
4070
|
{
|
|
3982
|
-
trigger: /* @__PURE__ */ (0,
|
|
4071
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3983
4072
|
"button",
|
|
3984
4073
|
{
|
|
3985
4074
|
className: cn(
|
|
@@ -3989,8 +4078,8 @@ var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", cla
|
|
|
3989
4078
|
className
|
|
3990
4079
|
),
|
|
3991
4080
|
children: [
|
|
3992
|
-
/* @__PURE__ */ (0,
|
|
3993
|
-
/* @__PURE__ */ (0,
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "truncate max-w-64 text-foreground/90", children: value || placeholder }),
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", className: "opacity-70", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M6 8l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3994
4083
|
]
|
|
3995
4084
|
}
|
|
3996
4085
|
),
|
|
@@ -4004,14 +4093,14 @@ var DropdownMenu_default = DropdownMenu;
|
|
|
4004
4093
|
|
|
4005
4094
|
// ../../components/ui/Pagination.tsx
|
|
4006
4095
|
var React19 = __toESM(require("react"), 1);
|
|
4007
|
-
var
|
|
4096
|
+
var import_lucide_react12 = require("lucide-react");
|
|
4008
4097
|
|
|
4009
4098
|
// ../../components/ui/Combobox.tsx
|
|
4010
4099
|
var React18 = __toESM(require("react"), 1);
|
|
4011
4100
|
var import_react11 = require("react");
|
|
4012
4101
|
var import_react_dom6 = require("react-dom");
|
|
4013
|
-
var
|
|
4014
|
-
var
|
|
4102
|
+
var import_lucide_react11 = require("lucide-react");
|
|
4103
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4015
4104
|
var getOptionLabel = (option) => {
|
|
4016
4105
|
return typeof option === "string" ? option : option.label;
|
|
4017
4106
|
};
|
|
@@ -4128,7 +4217,7 @@ var Combobox = ({
|
|
|
4128
4217
|
}, [open, enableSearch]);
|
|
4129
4218
|
const selectedOption = findOptionByValue(options, value);
|
|
4130
4219
|
const displayValue = selectedOption ? getOptionLabel(selectedOption) : "";
|
|
4131
|
-
const dropdownContent = /* @__PURE__ */ (0,
|
|
4220
|
+
const dropdownContent = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4132
4221
|
"div",
|
|
4133
4222
|
{
|
|
4134
4223
|
"data-combobox-dropdown": true,
|
|
@@ -4138,20 +4227,17 @@ var Combobox = ({
|
|
|
4138
4227
|
top: dropdownPosition?.top || 0,
|
|
4139
4228
|
left: dropdownPosition?.left || 0,
|
|
4140
4229
|
width: dropdownPosition?.width || 200,
|
|
4141
|
-
zIndex: 9999
|
|
4230
|
+
zIndex: 9999,
|
|
4231
|
+
transformOrigin: "top center"
|
|
4142
4232
|
},
|
|
4143
4233
|
"data-state": open ? "open" : "closed",
|
|
4144
4234
|
role: "listbox",
|
|
4145
4235
|
id: `${resolvedId}-listbox`,
|
|
4146
|
-
className:
|
|
4147
|
-
|
|
4148
|
-
"
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("rounded-md border bg-popover text-popover-foreground shadow-md", "backdrop-blur-sm bg-popover/95 border-border/60"), children: [
|
|
4152
|
-
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative p-3 border-b border-border/50 bg-muted/20", children: [
|
|
4153
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Search, { className: "absolute left-6 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground transition-colors" }),
|
|
4154
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4236
|
+
className: "z-9999",
|
|
4237
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cn("rounded-md border bg-popover text-popover-foreground shadow-md", "backdrop-blur-sm bg-popover/95 border-border/60"), children: [
|
|
4238
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative p-3 border-b border-border/50 bg-muted/20", children: [
|
|
4239
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Search, { className: "absolute left-6 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground transition-colors" }),
|
|
4240
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4155
4241
|
"input",
|
|
4156
4242
|
{
|
|
4157
4243
|
ref: inputRef,
|
|
@@ -4190,14 +4276,14 @@ var Combobox = ({
|
|
|
4190
4276
|
}
|
|
4191
4277
|
)
|
|
4192
4278
|
] }),
|
|
4193
|
-
/* @__PURE__ */ (0,
|
|
4194
|
-
/* @__PURE__ */ (0,
|
|
4195
|
-
/* @__PURE__ */ (0,
|
|
4279
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "max-h-64 overflow-y-auto overscroll-contain", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("ul", { className: "p-1 space-y-1", children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { className: "px-3 py-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col items-center gap-2 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
4280
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Loader2, { className: "h-6 w-6 animate-spin text-primary" }),
|
|
4281
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-sm text-muted-foreground", children: loadingText || "Loading..." })
|
|
4196
4282
|
] }) }) : filteredOptions.length > 0 ? filteredOptions.map((item, index) => {
|
|
4197
4283
|
const itemValue = getOptionValue(item);
|
|
4198
4284
|
const itemLabel = getOptionLabel(item);
|
|
4199
4285
|
const isSelected = itemValue === value;
|
|
4200
|
-
return /* @__PURE__ */ (0,
|
|
4286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4201
4287
|
"li",
|
|
4202
4288
|
{
|
|
4203
4289
|
ref: (node) => {
|
|
@@ -4209,7 +4295,7 @@ var Combobox = ({
|
|
|
4209
4295
|
"aria-selected": isSelected,
|
|
4210
4296
|
onClick: () => handleSelect(item),
|
|
4211
4297
|
style: {
|
|
4212
|
-
animationDelay: open ? `${index *
|
|
4298
|
+
animationDelay: open ? `${Math.min(index * 20, 200)}ms` : "0ms"
|
|
4213
4299
|
},
|
|
4214
4300
|
className: cn(
|
|
4215
4301
|
"dropdown-item group flex cursor-pointer items-center justify-between rounded-sm px-2.5 py-1.5 text-sm",
|
|
@@ -4221,24 +4307,16 @@ var Combobox = ({
|
|
|
4221
4307
|
isSelected && "bg-accent text-accent-foreground"
|
|
4222
4308
|
),
|
|
4223
4309
|
children: [
|
|
4224
|
-
/* @__PURE__ */ (0,
|
|
4225
|
-
isSelected && /* @__PURE__ */ (0,
|
|
4310
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "truncate", children: itemLabel }),
|
|
4311
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Check, { className: "h-4 w-4 text-primary" })
|
|
4226
4312
|
]
|
|
4227
4313
|
},
|
|
4228
4314
|
`${itemValue}-${index}`
|
|
4229
4315
|
);
|
|
4230
|
-
}) : /* @__PURE__ */ (0,
|
|
4231
|
-
/* @__PURE__ */ (0,
|
|
4232
|
-
/* @__PURE__ */ (0,
|
|
4233
|
-
query && /* @__PURE__ */ (0,
|
|
4234
|
-
"button",
|
|
4235
|
-
{
|
|
4236
|
-
type: "button",
|
|
4237
|
-
onClick: () => setQuery(""),
|
|
4238
|
-
className: "text-xs text-primary hover:underline",
|
|
4239
|
-
children: "Clear search"
|
|
4240
|
-
}
|
|
4241
|
-
)
|
|
4316
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { className: "px-3 py-8 text-center text-muted-foreground text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col items-center gap-2 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.SearchX, { className: "h-8 w-8 opacity-40 text-muted-foreground" }),
|
|
4318
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-sm", children: emptyText }),
|
|
4319
|
+
query && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { type: "button", onClick: () => setQuery(""), className: "text-xs text-primary hover:underline", children: "Clear search" })
|
|
4242
4320
|
] }) }) }) })
|
|
4243
4321
|
] })
|
|
4244
4322
|
}
|
|
@@ -4252,8 +4330,8 @@ var Combobox = ({
|
|
|
4252
4330
|
const labelSize = size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm";
|
|
4253
4331
|
const radiusClass = size === "sm" ? "rounded-md" : "rounded-lg";
|
|
4254
4332
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
4255
|
-
return /* @__PURE__ */ (0,
|
|
4256
|
-
label && /* @__PURE__ */ (0,
|
|
4333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cn("w-full group", verticalGap), children: [
|
|
4334
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4257
4335
|
"label",
|
|
4258
4336
|
{
|
|
4259
4337
|
id: labelId,
|
|
@@ -4265,11 +4343,11 @@ var Combobox = ({
|
|
|
4265
4343
|
),
|
|
4266
4344
|
children: [
|
|
4267
4345
|
label,
|
|
4268
|
-
required && /* @__PURE__ */ (0,
|
|
4346
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
4269
4347
|
]
|
|
4270
4348
|
}
|
|
4271
4349
|
) }),
|
|
4272
|
-
/* @__PURE__ */ (0,
|
|
4350
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4273
4351
|
"button",
|
|
4274
4352
|
{
|
|
4275
4353
|
ref: triggerRef,
|
|
@@ -4299,10 +4377,10 @@ var Combobox = ({
|
|
|
4299
4377
|
className
|
|
4300
4378
|
),
|
|
4301
4379
|
children: [
|
|
4302
|
-
/* @__PURE__ */ (0,
|
|
4303
|
-
/* @__PURE__ */ (0,
|
|
4380
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: cn("truncate", !displayValue && "text-muted-foreground", fontBold && "font-bold"), children: displayValue || placeholder }),
|
|
4381
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-1 ml-2", children: [
|
|
4304
4382
|
allowClear && value && !disabled && // FIX: Use a div instead of a nested button
|
|
4305
|
-
/* @__PURE__ */ (0,
|
|
4383
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4306
4384
|
"div",
|
|
4307
4385
|
{
|
|
4308
4386
|
role: "button",
|
|
@@ -4311,18 +4389,10 @@ var Combobox = ({
|
|
|
4311
4389
|
onClick: handleClear,
|
|
4312
4390
|
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && handleClear(e),
|
|
4313
4391
|
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
|
|
4314
|
-
children: /* @__PURE__ */ (0,
|
|
4392
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.X, { className: "h-3 w-3" })
|
|
4315
4393
|
}
|
|
4316
4394
|
),
|
|
4317
|
-
/* @__PURE__ */ (0,
|
|
4318
|
-
import_lucide_react12.ChevronDown,
|
|
4319
|
-
{
|
|
4320
|
-
className: cn(
|
|
4321
|
-
"h-4 w-4 text-muted-foreground transition-all duration-200",
|
|
4322
|
-
open && "rotate-180 scale-110 text-primary"
|
|
4323
|
-
)
|
|
4324
|
-
}
|
|
4325
|
-
)
|
|
4395
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.ChevronDown, { className: cn("h-4 w-4 text-muted-foreground transition-all duration-200", open && "rotate-180 scale-110 text-primary") })
|
|
4326
4396
|
] })
|
|
4327
4397
|
]
|
|
4328
4398
|
}
|
|
@@ -4333,7 +4403,7 @@ var Combobox = ({
|
|
|
4333
4403
|
|
|
4334
4404
|
// ../../components/ui/Pagination.tsx
|
|
4335
4405
|
var import_next_intl4 = require("next-intl");
|
|
4336
|
-
var
|
|
4406
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4337
4407
|
var Pagination = ({
|
|
4338
4408
|
page,
|
|
4339
4409
|
totalPages,
|
|
@@ -4416,18 +4486,18 @@ var Pagination = ({
|
|
|
4416
4486
|
}
|
|
4417
4487
|
};
|
|
4418
4488
|
if (totalPages <= 1) return null;
|
|
4419
|
-
return /* @__PURE__ */ (0,
|
|
4420
|
-
showInfo && totalItems && /* @__PURE__ */ (0,
|
|
4421
|
-
/* @__PURE__ */ (0,
|
|
4489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("nav", { className: cn("flex flex-col gap-4", className), "aria-label": labels?.navigationLabel || t("navigationLabel"), children: [
|
|
4490
|
+
showInfo && totalItems && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("text-sm text-muted-foreground", textAlignmentClass), children: labels?.showingResults ? labels.showingResults({ startItem: startItem || 0, endItem: endItem || 0, totalItems }) : t("showingResults", { startItem: startItem || 0, endItem: endItem || 0, totalItems }) }),
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex items-center justify-between", {
|
|
4422
4492
|
"flex-row-reverse": alignment === "right" || alignment === "center"
|
|
4423
4493
|
}), children: [
|
|
4424
|
-
/* @__PURE__ */ (0,
|
|
4425
|
-
showFirstLast && /* @__PURE__ */ (0,
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex items-center gap-1"), children: [
|
|
4495
|
+
showFirstLast && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4426
4496
|
Button_default,
|
|
4427
4497
|
{
|
|
4428
4498
|
variant: getButtonVariant(false),
|
|
4429
4499
|
size,
|
|
4430
|
-
icon:
|
|
4500
|
+
icon: import_lucide_react12.ChevronsLeft,
|
|
4431
4501
|
onClick: () => onChange(1),
|
|
4432
4502
|
disabled: disabled || page === 1,
|
|
4433
4503
|
className: "hidden sm:flex",
|
|
@@ -4436,27 +4506,27 @@ var Pagination = ({
|
|
|
4436
4506
|
"aria-disabled": disabled || page === 1
|
|
4437
4507
|
}
|
|
4438
4508
|
),
|
|
4439
|
-
showPrevNext && /* @__PURE__ */ (0,
|
|
4509
|
+
showPrevNext && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4440
4510
|
Button_default,
|
|
4441
4511
|
{
|
|
4442
4512
|
variant: getButtonVariant(false),
|
|
4443
4513
|
size,
|
|
4444
|
-
icon:
|
|
4514
|
+
icon: import_lucide_react12.ChevronLeft,
|
|
4445
4515
|
onClick: () => onChange(Math.max(1, page - 1)),
|
|
4446
4516
|
disabled: disabled || page === 1,
|
|
4447
4517
|
title: labels?.previousPage || t("previousPage"),
|
|
4448
4518
|
"aria-label": labels?.previousPage || t("previousPage"),
|
|
4449
4519
|
"aria-disabled": disabled || page === 1,
|
|
4450
|
-
children: /* @__PURE__ */ (0,
|
|
4520
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "hidden sm:inline", children: labels?.previous || t("previous") })
|
|
4451
4521
|
}
|
|
4452
4522
|
),
|
|
4453
4523
|
showPageNumbers && createPageArray().map((p, i) => {
|
|
4454
4524
|
if (p === "...") {
|
|
4455
|
-
return /* @__PURE__ */ (0,
|
|
4525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button_default, { variant: "ghost", size, disabled: true, icon: import_lucide_react12.MoreHorizontal, className: "cursor-default" }, i);
|
|
4456
4526
|
}
|
|
4457
4527
|
const pageNumber = p;
|
|
4458
4528
|
const isActive = page === pageNumber;
|
|
4459
|
-
return /* @__PURE__ */ (0,
|
|
4529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4460
4530
|
Button_default,
|
|
4461
4531
|
{
|
|
4462
4532
|
variant: getButtonVariant(isActive),
|
|
@@ -4471,26 +4541,26 @@ var Pagination = ({
|
|
|
4471
4541
|
i
|
|
4472
4542
|
);
|
|
4473
4543
|
}),
|
|
4474
|
-
showPrevNext && /* @__PURE__ */ (0,
|
|
4544
|
+
showPrevNext && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4475
4545
|
Button_default,
|
|
4476
4546
|
{
|
|
4477
4547
|
variant: getButtonVariant(false),
|
|
4478
4548
|
size,
|
|
4479
|
-
iconRight:
|
|
4549
|
+
iconRight: import_lucide_react12.ChevronRight,
|
|
4480
4550
|
onClick: () => onChange(Math.min(totalPages, page + 1)),
|
|
4481
4551
|
disabled: disabled || page === totalPages,
|
|
4482
4552
|
title: labels?.nextPage || t("nextPage"),
|
|
4483
4553
|
"aria-label": labels?.nextPage || t("nextPage"),
|
|
4484
4554
|
"aria-disabled": disabled || page === totalPages,
|
|
4485
|
-
children: /* @__PURE__ */ (0,
|
|
4555
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "hidden sm:inline", children: labels?.next || t("next") })
|
|
4486
4556
|
}
|
|
4487
4557
|
),
|
|
4488
|
-
showFirstLast && /* @__PURE__ */ (0,
|
|
4558
|
+
showFirstLast && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4489
4559
|
Button_default,
|
|
4490
4560
|
{
|
|
4491
4561
|
variant: getButtonVariant(false),
|
|
4492
4562
|
size,
|
|
4493
|
-
icon:
|
|
4563
|
+
icon: import_lucide_react12.ChevronsRight,
|
|
4494
4564
|
onClick: () => onChange(totalPages),
|
|
4495
4565
|
disabled: disabled || page === totalPages,
|
|
4496
4566
|
className: "hidden sm:flex",
|
|
@@ -4500,12 +4570,12 @@ var Pagination = ({
|
|
|
4500
4570
|
}
|
|
4501
4571
|
)
|
|
4502
4572
|
] }),
|
|
4503
|
-
pageSizeOptions && onPageSizeChange && /* @__PURE__ */ (0,
|
|
4504
|
-
/* @__PURE__ */ (0,
|
|
4573
|
+
pageSizeOptions && onPageSizeChange && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex items-center gap-2 text-sm"), children: [
|
|
4574
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "text-muted-foreground", children: [
|
|
4505
4575
|
labels?.itemsPerPage || t("itemsPerPage"),
|
|
4506
4576
|
":"
|
|
4507
4577
|
] }),
|
|
4508
|
-
/* @__PURE__ */ (0,
|
|
4578
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-20", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4509
4579
|
Combobox,
|
|
4510
4580
|
{
|
|
4511
4581
|
options: pageSizeOptionsStrings,
|
|
@@ -4534,8 +4604,8 @@ var SimplePagination = ({
|
|
|
4534
4604
|
pageSize = 10
|
|
4535
4605
|
}) => {
|
|
4536
4606
|
if (totalPages <= 1) return null;
|
|
4537
|
-
return /* @__PURE__ */ (0,
|
|
4538
|
-
showInfo && totalItems && /* @__PURE__ */ (0,
|
|
4607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
4608
|
+
showInfo && totalItems && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "text-sm text-muted-foreground text-center", children: [
|
|
4539
4609
|
"Page ",
|
|
4540
4610
|
page,
|
|
4541
4611
|
" of ",
|
|
@@ -4544,20 +4614,20 @@ var SimplePagination = ({
|
|
|
4544
4614
|
totalItems,
|
|
4545
4615
|
" total items)"
|
|
4546
4616
|
] }),
|
|
4547
|
-
/* @__PURE__ */ (0,
|
|
4548
|
-
/* @__PURE__ */ (0,
|
|
4549
|
-
/* @__PURE__ */ (0,
|
|
4550
|
-
/* @__PURE__ */ (0,
|
|
4551
|
-
/* @__PURE__ */ (0,
|
|
4552
|
-
/* @__PURE__ */ (0,
|
|
4553
|
-
/* @__PURE__ */ (0,
|
|
4617
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button_default, { variant, size, icon: import_lucide_react12.ChevronLeft, onClick: () => onChange(Math.max(1, page - 1)), disabled: disabled || page === 1, children: "Previous" }),
|
|
4619
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
4620
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Page" }),
|
|
4621
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "font-medium text-foreground", children: page }),
|
|
4622
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "of" }),
|
|
4623
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "font-medium text-foreground", children: totalPages })
|
|
4554
4624
|
] }),
|
|
4555
|
-
/* @__PURE__ */ (0,
|
|
4625
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4556
4626
|
Button_default,
|
|
4557
4627
|
{
|
|
4558
4628
|
variant,
|
|
4559
4629
|
size,
|
|
4560
|
-
iconRight:
|
|
4630
|
+
iconRight: import_lucide_react12.ChevronRight,
|
|
4561
4631
|
onClick: () => onChange(Math.min(totalPages, page + 1)),
|
|
4562
4632
|
disabled: disabled || page === totalPages,
|
|
4563
4633
|
children: "Next"
|
|
@@ -4575,52 +4645,52 @@ var CompactPagination = ({
|
|
|
4575
4645
|
disabled = false
|
|
4576
4646
|
}) => {
|
|
4577
4647
|
if (totalPages <= 1) return null;
|
|
4578
|
-
return /* @__PURE__ */ (0,
|
|
4579
|
-
/* @__PURE__ */ (0,
|
|
4648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("nav", { className: cn("flex items-center gap-1", className), "aria-label": "Compact Pagination", children: [
|
|
4649
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4580
4650
|
Button_default,
|
|
4581
4651
|
{
|
|
4582
4652
|
variant,
|
|
4583
4653
|
size: "icon",
|
|
4584
|
-
icon:
|
|
4654
|
+
icon: import_lucide_react12.ChevronsLeft,
|
|
4585
4655
|
onClick: () => onChange(1),
|
|
4586
4656
|
disabled: disabled || page === 1,
|
|
4587
4657
|
title: "First page",
|
|
4588
4658
|
"aria-label": "First page"
|
|
4589
4659
|
}
|
|
4590
4660
|
),
|
|
4591
|
-
/* @__PURE__ */ (0,
|
|
4661
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4592
4662
|
Button_default,
|
|
4593
4663
|
{
|
|
4594
4664
|
variant,
|
|
4595
4665
|
size: "icon",
|
|
4596
|
-
icon:
|
|
4666
|
+
icon: import_lucide_react12.ChevronLeft,
|
|
4597
4667
|
onClick: () => onChange(Math.max(1, page - 1)),
|
|
4598
4668
|
disabled: disabled || page === 1,
|
|
4599
4669
|
title: "Previous page"
|
|
4600
4670
|
}
|
|
4601
4671
|
),
|
|
4602
|
-
/* @__PURE__ */ (0,
|
|
4672
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "px-2 py-1 text-sm text-muted-foreground min-w-[4rem] text-center", children: [
|
|
4603
4673
|
page,
|
|
4604
4674
|
" / ",
|
|
4605
4675
|
totalPages
|
|
4606
4676
|
] }),
|
|
4607
|
-
/* @__PURE__ */ (0,
|
|
4677
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4608
4678
|
Button_default,
|
|
4609
4679
|
{
|
|
4610
4680
|
variant,
|
|
4611
4681
|
size: "icon",
|
|
4612
|
-
icon:
|
|
4682
|
+
icon: import_lucide_react12.ChevronRight,
|
|
4613
4683
|
onClick: () => onChange(Math.min(totalPages, page + 1)),
|
|
4614
4684
|
disabled: disabled || page === totalPages,
|
|
4615
4685
|
title: "Next page"
|
|
4616
4686
|
}
|
|
4617
4687
|
),
|
|
4618
|
-
/* @__PURE__ */ (0,
|
|
4688
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4619
4689
|
Button_default,
|
|
4620
4690
|
{
|
|
4621
4691
|
variant,
|
|
4622
4692
|
size: "icon",
|
|
4623
|
-
icon:
|
|
4693
|
+
icon: import_lucide_react12.ChevronsRight,
|
|
4624
4694
|
onClick: () => onChange(totalPages),
|
|
4625
4695
|
disabled: disabled || page === totalPages,
|
|
4626
4696
|
title: "Last page"
|
|
@@ -4631,7 +4701,7 @@ var CompactPagination = ({
|
|
|
4631
4701
|
|
|
4632
4702
|
// ../../components/ui/Section.tsx
|
|
4633
4703
|
var import_react12 = __toESM(require("react"), 1);
|
|
4634
|
-
var
|
|
4704
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4635
4705
|
var Section = import_react12.default.forwardRef(
|
|
4636
4706
|
({
|
|
4637
4707
|
children,
|
|
@@ -4654,7 +4724,7 @@ var Section = import_react12.default.forwardRef(
|
|
|
4654
4724
|
lg: "py-12",
|
|
4655
4725
|
xl: "py-16"
|
|
4656
4726
|
};
|
|
4657
|
-
return /* @__PURE__ */ (0,
|
|
4727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4658
4728
|
"section",
|
|
4659
4729
|
{
|
|
4660
4730
|
ref,
|
|
@@ -4676,9 +4746,9 @@ var Section_default = Section;
|
|
|
4676
4746
|
|
|
4677
4747
|
// ../../components/ui/ScrollArea.tsx
|
|
4678
4748
|
var import_react13 = require("react");
|
|
4679
|
-
var
|
|
4749
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4680
4750
|
var ScrollArea = (0, import_react13.forwardRef)(({ className, children, ...props }, ref) => {
|
|
4681
|
-
return /* @__PURE__ */ (0,
|
|
4751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref, className: cn("relative overflow-hidden bg-background", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cn("h-full w-full overflow-y-auto scroll-area-viewport"), children }) });
|
|
4682
4752
|
});
|
|
4683
4753
|
ScrollArea.displayName = "ScrollArea";
|
|
4684
4754
|
|
|
@@ -4686,7 +4756,7 @@ ScrollArea.displayName = "ScrollArea";
|
|
|
4686
4756
|
var React21 = __toESM(require("react"), 1);
|
|
4687
4757
|
var import_react14 = require("react");
|
|
4688
4758
|
var import_react_dom7 = require("react-dom");
|
|
4689
|
-
var
|
|
4759
|
+
var import_lucide_react13 = require("lucide-react");
|
|
4690
4760
|
var import_next_intl5 = require("next-intl");
|
|
4691
4761
|
|
|
4692
4762
|
// ../../lib/utils/date.ts
|
|
@@ -4869,7 +4939,7 @@ function formatDateWithDay(date) {
|
|
|
4869
4939
|
}
|
|
4870
4940
|
|
|
4871
4941
|
// ../../components/ui/DatePicker.tsx
|
|
4872
|
-
var
|
|
4942
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4873
4943
|
var DatePicker = ({
|
|
4874
4944
|
id,
|
|
4875
4945
|
value,
|
|
@@ -4980,7 +5050,7 @@ var DatePicker = ({
|
|
|
4980
5050
|
const firstDayOfMonth = getFirstDayOfMonth(viewDate);
|
|
4981
5051
|
const days = [];
|
|
4982
5052
|
for (let i = 0; i < firstDayOfMonth; i++) {
|
|
4983
|
-
days.push(/* @__PURE__ */ (0,
|
|
5053
|
+
days.push(/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-8 h-8" }, `empty-${i}`));
|
|
4984
5054
|
}
|
|
4985
5055
|
for (let day = 1; day <= daysInMonth; day++) {
|
|
4986
5056
|
const date = new Date(viewDate.getFullYear(), viewDate.getMonth(), day);
|
|
@@ -4989,7 +5059,7 @@ var DatePicker = ({
|
|
|
4989
5059
|
const totalDaysFromStart = firstDayOfMonth + day - 1;
|
|
4990
5060
|
const rowIndex = Math.floor(totalDaysFromStart / 7);
|
|
4991
5061
|
days.push(
|
|
4992
|
-
/* @__PURE__ */ (0,
|
|
5062
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4993
5063
|
"button",
|
|
4994
5064
|
{
|
|
4995
5065
|
onClick: () => handleDateSelect(date),
|
|
@@ -5011,7 +5081,7 @@ var DatePicker = ({
|
|
|
5011
5081
|
}
|
|
5012
5082
|
return days;
|
|
5013
5083
|
};
|
|
5014
|
-
const datePickerContent = isOpen && dropdownPosition ? /* @__PURE__ */ (0,
|
|
5084
|
+
const datePickerContent = isOpen && dropdownPosition ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5015
5085
|
"div",
|
|
5016
5086
|
{
|
|
5017
5087
|
"data-datepicker": true,
|
|
@@ -5029,7 +5099,7 @@ var DatePicker = ({
|
|
|
5029
5099
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
5030
5100
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
5031
5101
|
),
|
|
5032
|
-
children: /* @__PURE__ */ (0,
|
|
5102
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
5033
5103
|
"div",
|
|
5034
5104
|
{
|
|
5035
5105
|
ref: dropdownRef,
|
|
@@ -5040,14 +5110,14 @@ var DatePicker = ({
|
|
|
5040
5110
|
),
|
|
5041
5111
|
style: { pointerEvents: "auto" },
|
|
5042
5112
|
children: [
|
|
5043
|
-
/* @__PURE__ */ (0,
|
|
5044
|
-
/* @__PURE__ */ (0,
|
|
5045
|
-
/* @__PURE__ */ (0,
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
5113
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
|
|
5114
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("prev"), className: "p-1 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.ChevronLeft, { className: "h-4 w-4" }) }),
|
|
5115
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
5116
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("next"), className: "p-1 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.ChevronRight, { className: "h-4 w-4" }) })
|
|
5047
5117
|
] }),
|
|
5048
|
-
/* @__PURE__ */ (0,
|
|
5049
|
-
/* @__PURE__ */ (0,
|
|
5050
|
-
/* @__PURE__ */ (0,
|
|
5118
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("grid grid-cols-7 gap-1", size === "sm" ? "mb-1" : "mb-2"), children: (weekdayLabels || ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]).map((day) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("text-muted-foreground text-center font-medium", size === "sm" ? "text-[10px] py-0.5" : "text-xs py-1"), children: day }, day)) }),
|
|
5119
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "grid grid-cols-7 gap-1", children: renderCalendar() }),
|
|
5120
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center justify-end mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5051
5121
|
Button_default,
|
|
5052
5122
|
{
|
|
5053
5123
|
variant: "outline",
|
|
@@ -5071,8 +5141,8 @@ var DatePicker = ({
|
|
|
5071
5141
|
const labelSize = size === "sm" ? "text-xs" : "text-sm";
|
|
5072
5142
|
const radiusClass = size === "sm" ? "rounded-md" : "rounded-lg";
|
|
5073
5143
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
5074
|
-
return /* @__PURE__ */ (0,
|
|
5075
|
-
label && /* @__PURE__ */ (0,
|
|
5144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cn("w-full group", verticalGap), children: [
|
|
5145
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
5076
5146
|
"label",
|
|
5077
5147
|
{
|
|
5078
5148
|
id: labelId,
|
|
@@ -5084,11 +5154,11 @@ var DatePicker = ({
|
|
|
5084
5154
|
),
|
|
5085
5155
|
children: [
|
|
5086
5156
|
label,
|
|
5087
|
-
required && /* @__PURE__ */ (0,
|
|
5157
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
5088
5158
|
]
|
|
5089
5159
|
}
|
|
5090
5160
|
) }),
|
|
5091
|
-
/* @__PURE__ */ (0,
|
|
5161
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
5092
5162
|
"button",
|
|
5093
5163
|
{
|
|
5094
5164
|
ref: triggerRef,
|
|
@@ -5116,8 +5186,8 @@ var DatePicker = ({
|
|
|
5116
5186
|
className
|
|
5117
5187
|
),
|
|
5118
5188
|
children: [
|
|
5119
|
-
/* @__PURE__ */ (0,
|
|
5120
|
-
value && /* @__PURE__ */ (0,
|
|
5189
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: cn("truncate", !value && "text-muted-foreground"), children: value ? formatDateDisplay(value) : placeholder || t("placeholder") }),
|
|
5190
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5121
5191
|
"span",
|
|
5122
5192
|
{
|
|
5123
5193
|
role: "button",
|
|
@@ -5139,10 +5209,10 @@ var DatePicker = ({
|
|
|
5139
5209
|
},
|
|
5140
5210
|
className: "absolute right-8 inline-flex items-center justify-center rounded-sm text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors cursor-pointer",
|
|
5141
5211
|
style: { width: 20, height: 20 },
|
|
5142
|
-
children: /* @__PURE__ */ (0,
|
|
5212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.X, { className: "h-3.5 w-3.5" })
|
|
5143
5213
|
}
|
|
5144
5214
|
),
|
|
5145
|
-
/* @__PURE__ */ (0,
|
|
5215
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Calendar, { className: "h-4 w-4 text-muted-foreground ml-2" })
|
|
5146
5216
|
]
|
|
5147
5217
|
}
|
|
5148
5218
|
),
|
|
@@ -5227,7 +5297,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5227
5297
|
const nodes = [];
|
|
5228
5298
|
const daysInMonth = getDaysInMonth(viewDate);
|
|
5229
5299
|
const firstDay = getFirstDayOfMonth(viewDate);
|
|
5230
|
-
for (let i = 0; i < firstDay; i++) nodes.push(/* @__PURE__ */ (0,
|
|
5300
|
+
for (let i = 0; i < firstDay; i++) nodes.push(/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-8 h-8" }, `e-${i}`));
|
|
5231
5301
|
for (let d = 1; d <= daysInMonth; d++) {
|
|
5232
5302
|
const date = new Date(viewDate.getFullYear(), viewDate.getMonth(), d);
|
|
5233
5303
|
const isSelectedStart = isSameDay2(date, tempStart);
|
|
@@ -5252,7 +5322,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5252
5322
|
}
|
|
5253
5323
|
}
|
|
5254
5324
|
nodes.push(
|
|
5255
|
-
/* @__PURE__ */ (0,
|
|
5325
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5256
5326
|
"button",
|
|
5257
5327
|
{
|
|
5258
5328
|
onClick: () => handleSelect(date),
|
|
@@ -5282,7 +5352,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5282
5352
|
}
|
|
5283
5353
|
return nodes;
|
|
5284
5354
|
};
|
|
5285
|
-
const panel = isOpen && dropdownPosition ? /* @__PURE__ */ (0,
|
|
5355
|
+
const panel = isOpen && dropdownPosition ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5286
5356
|
"div",
|
|
5287
5357
|
{
|
|
5288
5358
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width || 256, zIndex: 9999 },
|
|
@@ -5292,37 +5362,37 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5292
5362
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
5293
5363
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
5294
5364
|
),
|
|
5295
|
-
children: /* @__PURE__ */ (0,
|
|
5365
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
5296
5366
|
"div",
|
|
5297
5367
|
{
|
|
5298
5368
|
ref: panelRef,
|
|
5299
5369
|
className: cn("rounded-md border bg-popover text-popover-foreground shadow-md", "backdrop-blur-sm bg-popover/95 border-border/60 p-4 w-64"),
|
|
5300
5370
|
children: [
|
|
5301
|
-
/* @__PURE__ */ (0,
|
|
5302
|
-
/* @__PURE__ */ (0,
|
|
5371
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [
|
|
5372
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5303
5373
|
Button_default,
|
|
5304
5374
|
{
|
|
5305
5375
|
variant: "ghost",
|
|
5306
5376
|
size: "sm",
|
|
5307
5377
|
onClick: () => setViewDate(new Date(viewDate.getFullYear(), viewDate.getMonth() - 1, 1)),
|
|
5308
5378
|
className: "p-1 h-auto",
|
|
5309
|
-
children: /* @__PURE__ */ (0,
|
|
5379
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.ChevronLeft, { className: "h-4 w-4" })
|
|
5310
5380
|
}
|
|
5311
5381
|
),
|
|
5312
|
-
/* @__PURE__ */ (0,
|
|
5313
|
-
/* @__PURE__ */ (0,
|
|
5382
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
5383
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5314
5384
|
Button_default,
|
|
5315
5385
|
{
|
|
5316
5386
|
variant: "ghost",
|
|
5317
5387
|
size: "sm",
|
|
5318
5388
|
onClick: () => setViewDate(new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 1)),
|
|
5319
5389
|
className: "p-1 h-auto",
|
|
5320
|
-
children: /* @__PURE__ */ (0,
|
|
5390
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.ChevronRight, { className: "h-4 w-4" })
|
|
5321
5391
|
}
|
|
5322
5392
|
)
|
|
5323
5393
|
] }),
|
|
5324
|
-
/* @__PURE__ */ (0,
|
|
5325
|
-
/* @__PURE__ */ (0,
|
|
5394
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((d) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-xs text-muted-foreground text-center py-1 font-medium", children: d }, d)) }),
|
|
5395
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "grid grid-cols-7", children: renderGrid() })
|
|
5326
5396
|
]
|
|
5327
5397
|
}
|
|
5328
5398
|
)
|
|
@@ -5330,8 +5400,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5330
5400
|
) : null;
|
|
5331
5401
|
const displayFormat = (date) => formatDateShort(date);
|
|
5332
5402
|
const label = tempStart && tempEnd ? `${displayFormat(tempStart)} - ${displayFormat(tempEnd)}` : tempStart ? `${displayFormat(tempStart)} - ...` : placeholder;
|
|
5333
|
-
return /* @__PURE__ */ (0,
|
|
5334
|
-
/* @__PURE__ */ (0,
|
|
5403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
5404
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
5335
5405
|
"button",
|
|
5336
5406
|
{
|
|
5337
5407
|
ref: triggerRef,
|
|
@@ -5350,8 +5420,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5350
5420
|
className
|
|
5351
5421
|
),
|
|
5352
5422
|
children: [
|
|
5353
|
-
/* @__PURE__ */ (0,
|
|
5354
|
-
/* @__PURE__ */ (0,
|
|
5423
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: cn("truncate", !tempStart && !tempEnd && "text-muted-foreground"), children: label }),
|
|
5424
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react13.Calendar, { className: "h-4 w-4 text-muted-foreground ml-2" })
|
|
5355
5425
|
]
|
|
5356
5426
|
}
|
|
5357
5427
|
),
|
|
@@ -5361,8 +5431,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5361
5431
|
|
|
5362
5432
|
// ../../components/ui/TimePicker.tsx
|
|
5363
5433
|
var React22 = __toESM(require("react"), 1);
|
|
5364
|
-
var
|
|
5365
|
-
var
|
|
5434
|
+
var import_lucide_react14 = require("lucide-react");
|
|
5435
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5366
5436
|
var pad = (n) => n.toString().padStart(2, "0");
|
|
5367
5437
|
function parseTime(input, fmt = "24", includeSeconds) {
|
|
5368
5438
|
if (!input) return null;
|
|
@@ -5605,7 +5675,7 @@ function TimePicker({
|
|
|
5605
5675
|
const sz = sizeClasses2[size];
|
|
5606
5676
|
const radiusClass = size === "sm" ? "rounded-md" : "rounded-lg";
|
|
5607
5677
|
const display = formatTime2(parts, format, includeSeconds);
|
|
5608
|
-
const trigger = variant === "inline" ? null : /* @__PURE__ */ (0,
|
|
5678
|
+
const trigger = variant === "inline" ? null : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5609
5679
|
"button",
|
|
5610
5680
|
{
|
|
5611
5681
|
type: "button",
|
|
@@ -5629,17 +5699,17 @@ function TimePicker({
|
|
|
5629
5699
|
className
|
|
5630
5700
|
),
|
|
5631
5701
|
children: [
|
|
5632
|
-
/* @__PURE__ */ (0,
|
|
5633
|
-
/* @__PURE__ */ (0,
|
|
5634
|
-
/* @__PURE__ */ (0,
|
|
5702
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5703
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.Clock, { className: cn(sz.icon, error ? "text-destructive" : success ? "text-green-500" : "text-muted-foreground") }),
|
|
5704
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: cn("truncate", !value && !defaultValue && "text-muted-foreground"), children: value || defaultValue ? display : placeholder })
|
|
5635
5705
|
] }),
|
|
5636
|
-
/* @__PURE__ */ (0,
|
|
5706
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: cn("ml-2 transition-transform duration-200", open && "rotate-180"), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("svg", { className: sz.icon, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) })
|
|
5637
5707
|
]
|
|
5638
5708
|
}
|
|
5639
5709
|
);
|
|
5640
5710
|
const contentWidth = variant === "compact" ? 240 : variant === "inline" ? 320 : includeSeconds ? 340 : 300;
|
|
5641
|
-
const timePickerContent = /* @__PURE__ */ (0,
|
|
5642
|
-
allowManualInput && /* @__PURE__ */ (0,
|
|
5711
|
+
const timePickerContent = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "space-y-3", children: [
|
|
5712
|
+
allowManualInput && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5643
5713
|
Input_default,
|
|
5644
5714
|
{
|
|
5645
5715
|
placeholder: format === "12" ? "02:30 PM" : "14:30",
|
|
@@ -5649,7 +5719,7 @@ function TimePicker({
|
|
|
5649
5719
|
variant: "outlined"
|
|
5650
5720
|
}
|
|
5651
5721
|
) }),
|
|
5652
|
-
showPresets && /* @__PURE__ */ (0,
|
|
5722
|
+
showPresets && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-2 gap-2", children: Object.keys(PRESETS).map((preset) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5653
5723
|
"button",
|
|
5654
5724
|
{
|
|
5655
5725
|
type: "button",
|
|
@@ -5663,7 +5733,7 @@ function TimePicker({
|
|
|
5663
5733
|
},
|
|
5664
5734
|
preset
|
|
5665
5735
|
)) }),
|
|
5666
|
-
customPresets && customPresets.length > 0 && /* @__PURE__ */ (0,
|
|
5736
|
+
customPresets && customPresets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-2 gap-2", children: customPresets.map((preset, idx) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5667
5737
|
"button",
|
|
5668
5738
|
{
|
|
5669
5739
|
type: "button",
|
|
@@ -5677,10 +5747,10 @@ function TimePicker({
|
|
|
5677
5747
|
},
|
|
5678
5748
|
idx
|
|
5679
5749
|
)) }),
|
|
5680
|
-
/* @__PURE__ */ (0,
|
|
5681
|
-
/* @__PURE__ */ (0,
|
|
5682
|
-
/* @__PURE__ */ (0,
|
|
5683
|
-
/* @__PURE__ */ (0,
|
|
5750
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex gap-3", children: [
|
|
5751
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex-1 min-w-[70px]", children: [
|
|
5752
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-xs font-semibold text-muted-foreground mb-2 text-center", children: "Hour" }),
|
|
5753
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5684
5754
|
"div",
|
|
5685
5755
|
{
|
|
5686
5756
|
ref: hourScrollRef,
|
|
@@ -5692,7 +5762,7 @@ function TimePicker({
|
|
|
5692
5762
|
onFocus: () => setFocusedColumn("hour"),
|
|
5693
5763
|
children: hours.map((h) => {
|
|
5694
5764
|
const isSelected = format === "24" && parts.h === h || format === "12" && (parts.h % 12 || 12) === (h % 12 || 12);
|
|
5695
|
-
return /* @__PURE__ */ (0,
|
|
5765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5696
5766
|
"button",
|
|
5697
5767
|
{
|
|
5698
5768
|
type: "button",
|
|
@@ -5719,10 +5789,10 @@ function TimePicker({
|
|
|
5719
5789
|
}
|
|
5720
5790
|
)
|
|
5721
5791
|
] }),
|
|
5722
|
-
/* @__PURE__ */ (0,
|
|
5723
|
-
/* @__PURE__ */ (0,
|
|
5724
|
-
/* @__PURE__ */ (0,
|
|
5725
|
-
/* @__PURE__ */ (0,
|
|
5792
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-px bg-border/50 self-stretch my-8" }),
|
|
5793
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex-1 min-w-[70px]", children: [
|
|
5794
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-xs font-semibold text-muted-foreground mb-2 text-center", children: "Min" }),
|
|
5795
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5726
5796
|
"div",
|
|
5727
5797
|
{
|
|
5728
5798
|
ref: minuteScrollRef,
|
|
@@ -5734,7 +5804,7 @@ function TimePicker({
|
|
|
5734
5804
|
onFocus: () => setFocusedColumn("minute"),
|
|
5735
5805
|
children: minutes.map((m) => {
|
|
5736
5806
|
const isSelected = parts.m === m;
|
|
5737
|
-
return /* @__PURE__ */ (0,
|
|
5807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5738
5808
|
"button",
|
|
5739
5809
|
{
|
|
5740
5810
|
type: "button",
|
|
@@ -5760,11 +5830,11 @@ function TimePicker({
|
|
|
5760
5830
|
}
|
|
5761
5831
|
)
|
|
5762
5832
|
] }),
|
|
5763
|
-
/* @__PURE__ */ (0,
|
|
5764
|
-
includeSeconds && /* @__PURE__ */ (0,
|
|
5765
|
-
/* @__PURE__ */ (0,
|
|
5766
|
-
/* @__PURE__ */ (0,
|
|
5767
|
-
/* @__PURE__ */ (0,
|
|
5833
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-px bg-border/50 self-stretch my-8" }),
|
|
5834
|
+
includeSeconds && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
5835
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex-1 min-w-[70px]", children: [
|
|
5836
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-xs font-semibold text-muted-foreground mb-2 text-center", children: "Sec" }),
|
|
5837
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5768
5838
|
"div",
|
|
5769
5839
|
{
|
|
5770
5840
|
ref: secondScrollRef,
|
|
@@ -5776,7 +5846,7 @@ function TimePicker({
|
|
|
5776
5846
|
onFocus: () => setFocusedColumn("second"),
|
|
5777
5847
|
children: seconds.map((s) => {
|
|
5778
5848
|
const isSelected = parts.s === s;
|
|
5779
|
-
return /* @__PURE__ */ (0,
|
|
5849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5780
5850
|
"button",
|
|
5781
5851
|
{
|
|
5782
5852
|
type: "button",
|
|
@@ -5802,11 +5872,11 @@ function TimePicker({
|
|
|
5802
5872
|
}
|
|
5803
5873
|
)
|
|
5804
5874
|
] }),
|
|
5805
|
-
/* @__PURE__ */ (0,
|
|
5875
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-px bg-border/50 self-stretch my-8" })
|
|
5806
5876
|
] }),
|
|
5807
|
-
format === "12" && /* @__PURE__ */ (0,
|
|
5808
|
-
/* @__PURE__ */ (0,
|
|
5809
|
-
/* @__PURE__ */ (0,
|
|
5877
|
+
format === "12" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-20", children: [
|
|
5878
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-xs font-semibold text-muted-foreground mb-2 text-center", children: "Period" }),
|
|
5879
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5810
5880
|
"div",
|
|
5811
5881
|
{
|
|
5812
5882
|
className: "flex flex-col gap-2",
|
|
@@ -5817,7 +5887,7 @@ function TimePicker({
|
|
|
5817
5887
|
onFocus: () => setFocusedColumn("period"),
|
|
5818
5888
|
children: ["AM", "PM"].map((p) => {
|
|
5819
5889
|
const isSelected = parts.p === p;
|
|
5820
|
-
return /* @__PURE__ */ (0,
|
|
5890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5821
5891
|
"button",
|
|
5822
5892
|
{
|
|
5823
5893
|
type: "button",
|
|
@@ -5848,8 +5918,8 @@ function TimePicker({
|
|
|
5848
5918
|
)
|
|
5849
5919
|
] })
|
|
5850
5920
|
] }),
|
|
5851
|
-
(showNow || clearable) && /* @__PURE__ */ (0,
|
|
5852
|
-
showNow && /* @__PURE__ */ (0,
|
|
5921
|
+
(showNow || clearable) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between gap-2 pt-3 border-t border-border", children: [
|
|
5922
|
+
showNow && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5853
5923
|
"button",
|
|
5854
5924
|
{
|
|
5855
5925
|
type: "button",
|
|
@@ -5863,13 +5933,13 @@ function TimePicker({
|
|
|
5863
5933
|
},
|
|
5864
5934
|
"aria-label": "Set current time",
|
|
5865
5935
|
children: [
|
|
5866
|
-
/* @__PURE__ */ (0,
|
|
5936
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.Clock, { className: "w-3.5 h-3.5" }),
|
|
5867
5937
|
"Now"
|
|
5868
5938
|
]
|
|
5869
5939
|
}
|
|
5870
5940
|
),
|
|
5871
|
-
/* @__PURE__ */ (0,
|
|
5872
|
-
clearable && /* @__PURE__ */ (0,
|
|
5941
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1" }),
|
|
5942
|
+
clearable && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5873
5943
|
"button",
|
|
5874
5944
|
{
|
|
5875
5945
|
type: "button",
|
|
@@ -5884,7 +5954,7 @@ function TimePicker({
|
|
|
5884
5954
|
},
|
|
5885
5955
|
"aria-label": "Clear selected time",
|
|
5886
5956
|
children: [
|
|
5887
|
-
/* @__PURE__ */ (0,
|
|
5957
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.X, { className: "w-3.5 h-3.5" }),
|
|
5888
5958
|
"Clear"
|
|
5889
5959
|
]
|
|
5890
5960
|
}
|
|
@@ -5892,27 +5962,27 @@ function TimePicker({
|
|
|
5892
5962
|
] })
|
|
5893
5963
|
] });
|
|
5894
5964
|
if (variant === "inline") {
|
|
5895
|
-
return /* @__PURE__ */ (0,
|
|
5896
|
-
label && /* @__PURE__ */ (0,
|
|
5965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-full", ...rest, children: [
|
|
5966
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-between mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: cn(sz.label, "font-medium", disabled ? "text-muted-foreground" : "text-foreground"), children: [
|
|
5897
5967
|
label,
|
|
5898
|
-
required && /* @__PURE__ */ (0,
|
|
5968
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
5899
5969
|
] }) }),
|
|
5900
|
-
/* @__PURE__ */ (0,
|
|
5970
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("p-3 rounded-lg border border-border bg-card shadow-sm", className), children: timePickerContent })
|
|
5901
5971
|
] });
|
|
5902
5972
|
}
|
|
5903
|
-
return /* @__PURE__ */ (0,
|
|
5904
|
-
label && /* @__PURE__ */ (0,
|
|
5973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-full", ...rest, children: [
|
|
5974
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-between mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5905
5975
|
"label",
|
|
5906
5976
|
{
|
|
5907
5977
|
className: cn(sz.label, "font-medium", disabled ? "text-muted-foreground" : "text-foreground", "cursor-pointer"),
|
|
5908
5978
|
onClick: () => !disabled && handleOpenChange(true),
|
|
5909
5979
|
children: [
|
|
5910
5980
|
label,
|
|
5911
|
-
required && /* @__PURE__ */ (0,
|
|
5981
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
5912
5982
|
]
|
|
5913
5983
|
}
|
|
5914
5984
|
) }),
|
|
5915
|
-
/* @__PURE__ */ (0,
|
|
5985
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5916
5986
|
Popover,
|
|
5917
5987
|
{
|
|
5918
5988
|
trigger,
|
|
@@ -5931,24 +6001,24 @@ function TimePicker({
|
|
|
5931
6001
|
children: timePickerContent
|
|
5932
6002
|
}
|
|
5933
6003
|
),
|
|
5934
|
-
(error || success || helperText) && /* @__PURE__ */ (0,
|
|
5935
|
-
error && /* @__PURE__ */ (0,
|
|
5936
|
-
/* @__PURE__ */ (0,
|
|
5937
|
-
/* @__PURE__ */ (0,
|
|
6004
|
+
(error || success || helperText) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cn("mt-1.5 flex items-start gap-1.5", sz.label), children: [
|
|
6005
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-1.5 text-destructive", children: [
|
|
6006
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.X, { className: "w-3.5 h-3.5 flex-shrink-0" }),
|
|
6007
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: error })
|
|
5938
6008
|
] }),
|
|
5939
|
-
success && !error && /* @__PURE__ */ (0,
|
|
5940
|
-
/* @__PURE__ */ (0,
|
|
5941
|
-
/* @__PURE__ */ (0,
|
|
6009
|
+
success && !error && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-1.5 text-green-600", children: [
|
|
6010
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.Check, { className: "w-3.5 h-3.5 flex-shrink-0" }),
|
|
6011
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "Valid time selected" })
|
|
5942
6012
|
] }),
|
|
5943
|
-
helperText && !error && !success && /* @__PURE__ */ (0,
|
|
6013
|
+
helperText && !error && !success && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-muted-foreground", children: helperText })
|
|
5944
6014
|
] })
|
|
5945
6015
|
] });
|
|
5946
6016
|
}
|
|
5947
6017
|
|
|
5948
6018
|
// ../../components/ui/Calendar.tsx
|
|
5949
6019
|
var React23 = __toESM(require("react"), 1);
|
|
5950
|
-
var
|
|
5951
|
-
var
|
|
6020
|
+
var import_lucide_react15 = require("lucide-react");
|
|
6021
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5952
6022
|
function startOfMonth(d) {
|
|
5953
6023
|
return new Date(d.getFullYear(), d.getMonth(), 1);
|
|
5954
6024
|
}
|
|
@@ -6129,17 +6199,17 @@ function Calendar2({
|
|
|
6129
6199
|
const renderMonth = (monthDate) => {
|
|
6130
6200
|
const monthDays = getMonthGrid(monthDate, weekStartsOn);
|
|
6131
6201
|
const monthLabel = labels?.month ? labels.month(monthDate) : monthDate.toLocaleDateString("en-US", { month: "long", year: "numeric" });
|
|
6132
|
-
return /* @__PURE__ */ (0,
|
|
6133
|
-
months > 1 && /* @__PURE__ */ (0,
|
|
6134
|
-
showWeekdays && /* @__PURE__ */ (0,
|
|
6135
|
-
/* @__PURE__ */ (0,
|
|
6202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
6203
|
+
months > 1 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex items-center justify-center mb-2 text-sm font-semibold", children: monthLabel }),
|
|
6204
|
+
showWeekdays && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("grid grid-cols-7", sz.grid, "mb-1 text-center text-muted-foreground font-medium"), children: weekdays.map((w) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn(sz.head), children: w }, `${monthLabel}-${w}`)) }),
|
|
6205
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("grid grid-cols-7", sz.grid), children: monthDays.map((d, idx) => {
|
|
6136
6206
|
const inMonth = d.getMonth() === monthDate.getMonth();
|
|
6137
6207
|
const isToday2 = isSameDay(d, today);
|
|
6138
6208
|
const selectedDay = isSelected(d);
|
|
6139
6209
|
const k = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
6140
6210
|
const dayEvents = byDay.get(k) || [];
|
|
6141
6211
|
const disabled = isDateDisabled(d);
|
|
6142
|
-
return /* @__PURE__ */ (0,
|
|
6212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
6143
6213
|
"button",
|
|
6144
6214
|
{
|
|
6145
6215
|
onClick: () => handleClickDay(d),
|
|
@@ -6156,7 +6226,7 @@ function Calendar2({
|
|
|
6156
6226
|
title: d.toDateString(),
|
|
6157
6227
|
children: [
|
|
6158
6228
|
d.getDate(),
|
|
6159
|
-
dayEvents.length > 0 && /* @__PURE__ */ (0,
|
|
6229
|
+
dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "absolute -bottom-1 inline-flex gap-0.5", children: dayEvents.slice(0, 3).map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "h-1.5 w-1.5 rounded-full", style: { backgroundColor: e.color || "hsl(var(--primary))" } }, i)) })
|
|
6160
6230
|
]
|
|
6161
6231
|
},
|
|
6162
6232
|
`${monthLabel}-${idx}`
|
|
@@ -6186,22 +6256,22 @@ function Calendar2({
|
|
|
6186
6256
|
const nextStart = startOfMonth(addMonths(view, 1));
|
|
6187
6257
|
return nextStart > maxBound;
|
|
6188
6258
|
}, [display, view, weekStartsOn, maxBound]);
|
|
6189
|
-
return /* @__PURE__ */ (0,
|
|
6190
|
-
showHeader && /* @__PURE__ */ (0,
|
|
6191
|
-
/* @__PURE__ */ (0,
|
|
6192
|
-
/* @__PURE__ */ (0,
|
|
6193
|
-
/* @__PURE__ */ (0,
|
|
6259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("w-full", className), ...rest, children: [
|
|
6260
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [
|
|
6261
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { onClick: () => goByView(-1), disabled: prevDisabled, className: cn("p-1 rounded-md hover:bg-accent", prevDisabled && "opacity-40 cursor-not-allowed hover:bg-transparent"), "aria-label": labels?.prev || (display === "week" ? "Previous week" : "Previous month"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ChevronLeft, { className: "h-4 w-4" }) }),
|
|
6262
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "text-sm font-semibold", children: display === "week" ? `${labels?.month ? labels.month(weekDays[0]) : weekDays[0].toLocaleDateString("en-US", { month: "short" })} ${weekDays[0].getDate()} \u2013 ${labels?.month ? labels.month(weekDays[6]) : weekDays[6].toLocaleDateString("en-US", { month: "short" })} ${weekDays[6].getDate()}` : labels?.month ? labels.month(view) : view.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
6263
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { onClick: () => goByView(1), disabled: nextDisabled, className: cn("p-1 rounded-md hover:bg-accent", nextDisabled && "opacity-40 cursor-not-allowed hover:bg-transparent"), "aria-label": labels?.next || (display === "week" ? "Next week" : "Next month"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ChevronRight, { className: "h-4 w-4" }) })
|
|
6194
6264
|
] }),
|
|
6195
|
-
display === "week" ? /* @__PURE__ */ (0,
|
|
6196
|
-
showWeekdays && /* @__PURE__ */ (0,
|
|
6197
|
-
/* @__PURE__ */ (0,
|
|
6265
|
+
display === "week" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
6266
|
+
showWeekdays && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("grid grid-cols-7", sz.grid, "mb-1 text-center text-muted-foreground font-medium"), children: weekdays.map((w) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn(sz.head), children: w }, `w-${w}`)) }),
|
|
6267
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("grid grid-cols-7", sz.grid), children: weekDays.map((d, idx) => {
|
|
6198
6268
|
const inMonth = true;
|
|
6199
6269
|
const isToday2 = isSameDay(d, today);
|
|
6200
6270
|
const selectedDay = isSelected(d);
|
|
6201
6271
|
const k = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
6202
6272
|
const dayEvents = byDay.get(k) || [];
|
|
6203
6273
|
const disabled = isDateDisabled(d);
|
|
6204
|
-
return /* @__PURE__ */ (0,
|
|
6274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
6205
6275
|
"button",
|
|
6206
6276
|
{
|
|
6207
6277
|
onClick: () => handleClickDay(d),
|
|
@@ -6217,13 +6287,13 @@ function Calendar2({
|
|
|
6217
6287
|
title: d.toDateString(),
|
|
6218
6288
|
children: [
|
|
6219
6289
|
d.getDate(),
|
|
6220
|
-
dayEvents.length > 0 && /* @__PURE__ */ (0,
|
|
6290
|
+
dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "absolute -bottom-1 inline-flex gap-0.5", children: dayEvents.slice(0, 3).map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "h-1.5 w-1.5 rounded-full", style: { backgroundColor: e.color || "hsl(var(--primary))" } }, i)) })
|
|
6221
6291
|
]
|
|
6222
6292
|
},
|
|
6223
6293
|
`wd-${idx}`
|
|
6224
6294
|
);
|
|
6225
6295
|
}) })
|
|
6226
|
-
] }) : /* @__PURE__ */ (0,
|
|
6296
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn(months > 1 ? "grid md:grid-cols-2 lg:grid-cols-3 gap-4" : ""), children: Array.from({ length: Math.max(1, months) }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(React23.Fragment, { children: renderMonth(addMonths(view, i)) }, `cal-month-${view.getFullYear()}-${view.getMonth()}-${i}`)) })
|
|
6227
6297
|
] });
|
|
6228
6298
|
}
|
|
6229
6299
|
|
|
@@ -6231,8 +6301,8 @@ function Calendar2({
|
|
|
6231
6301
|
var React24 = __toESM(require("react"), 1);
|
|
6232
6302
|
var import_react15 = require("react");
|
|
6233
6303
|
var import_react_dom8 = require("react-dom");
|
|
6234
|
-
var
|
|
6235
|
-
var
|
|
6304
|
+
var import_lucide_react16 = require("lucide-react");
|
|
6305
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
6236
6306
|
var MultiCombobox = ({
|
|
6237
6307
|
id,
|
|
6238
6308
|
options,
|
|
@@ -6377,8 +6447,8 @@ var MultiCombobox = ({
|
|
|
6377
6447
|
const resolvedId = id ? String(id) : `multicombobox-${autoId}`;
|
|
6378
6448
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
6379
6449
|
const labelSize = size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm";
|
|
6380
|
-
return /* @__PURE__ */ (0,
|
|
6381
|
-
title && /* @__PURE__ */ (0,
|
|
6450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("w-full space-y-2 group", className), children: [
|
|
6451
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6382
6452
|
"label",
|
|
6383
6453
|
{
|
|
6384
6454
|
className: cn(
|
|
@@ -6388,11 +6458,11 @@ var MultiCombobox = ({
|
|
|
6388
6458
|
),
|
|
6389
6459
|
children: [
|
|
6390
6460
|
title,
|
|
6391
|
-
required && /* @__PURE__ */ (0,
|
|
6461
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
6392
6462
|
]
|
|
6393
6463
|
}
|
|
6394
6464
|
) }),
|
|
6395
|
-
label && /* @__PURE__ */ (0,
|
|
6465
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6396
6466
|
"label",
|
|
6397
6467
|
{
|
|
6398
6468
|
id: labelId,
|
|
@@ -6404,12 +6474,12 @@ var MultiCombobox = ({
|
|
|
6404
6474
|
),
|
|
6405
6475
|
children: [
|
|
6406
6476
|
label,
|
|
6407
|
-
required && /* @__PURE__ */ (0,
|
|
6477
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
6408
6478
|
]
|
|
6409
6479
|
}
|
|
6410
6480
|
),
|
|
6411
|
-
/* @__PURE__ */ (0,
|
|
6412
|
-
/* @__PURE__ */ (0,
|
|
6481
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "relative w-full" }),
|
|
6482
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6413
6483
|
"button",
|
|
6414
6484
|
{
|
|
6415
6485
|
ref: triggerRef,
|
|
@@ -6432,11 +6502,11 @@ var MultiCombobox = ({
|
|
|
6432
6502
|
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
6433
6503
|
),
|
|
6434
6504
|
children: [
|
|
6435
|
-
/* @__PURE__ */ (0,
|
|
6505
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex items-center gap-1 flex-wrap min-h-[1.5rem] flex-1", children: value.length > 0 ? showTags ? value.map((itemValue) => {
|
|
6436
6506
|
const option = normalizedOptions.find((o) => o.value === itemValue);
|
|
6437
|
-
return /* @__PURE__ */ (0,
|
|
6438
|
-
/* @__PURE__ */ (0,
|
|
6439
|
-
/* @__PURE__ */ (0,
|
|
6507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "inline-flex items-center gap-1 bg-accent text-accent-foreground rounded px-2 py-1 text-xs", children: [
|
|
6508
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "truncate max-w-[120px]", children: option ? displayFormat(option) : itemValue }),
|
|
6509
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6440
6510
|
"span",
|
|
6441
6511
|
{
|
|
6442
6512
|
role: "button",
|
|
@@ -6459,12 +6529,12 @@ var MultiCombobox = ({
|
|
|
6459
6529
|
}
|
|
6460
6530
|
)
|
|
6461
6531
|
] }, itemValue);
|
|
6462
|
-
}) : /* @__PURE__ */ (0,
|
|
6532
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "truncate text-sm", children: [
|
|
6463
6533
|
value.length,
|
|
6464
6534
|
" selected"
|
|
6465
|
-
] }) : /* @__PURE__ */ (0,
|
|
6466
|
-
/* @__PURE__ */ (0,
|
|
6467
|
-
|
|
6535
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-muted-foreground", children: placeholder || "Select..." }) }),
|
|
6536
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6537
|
+
import_lucide_react16.ChevronDown,
|
|
6468
6538
|
{
|
|
6469
6539
|
className: cn("opacity-50 transition-all duration-200", sizeStyles8[size].icon, open && "rotate-180 scale-110 text-primary opacity-100")
|
|
6470
6540
|
}
|
|
@@ -6473,30 +6543,27 @@ var MultiCombobox = ({
|
|
|
6473
6543
|
}
|
|
6474
6544
|
),
|
|
6475
6545
|
open && dropdownPosition && typeof window !== "undefined" ? (0, import_react_dom8.createPortal)(
|
|
6476
|
-
/* @__PURE__ */ (0,
|
|
6546
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6477
6547
|
"div",
|
|
6478
6548
|
{
|
|
6479
6549
|
ref: dropdownRef,
|
|
6480
|
-
"data-dropdown":
|
|
6550
|
+
"data-combobox-dropdown": true,
|
|
6481
6551
|
style: {
|
|
6482
6552
|
position: "absolute",
|
|
6483
6553
|
top: dropdownPosition?.top || 0,
|
|
6484
6554
|
left: dropdownPosition?.left || 0,
|
|
6485
6555
|
width: dropdownPosition?.width || 200,
|
|
6486
|
-
zIndex: 9999
|
|
6556
|
+
zIndex: 9999,
|
|
6557
|
+
transformOrigin: "top center"
|
|
6487
6558
|
},
|
|
6488
6559
|
"data-state": open ? "open" : "closed",
|
|
6489
|
-
className:
|
|
6490
|
-
|
|
6491
|
-
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
6492
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
6493
|
-
),
|
|
6494
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
6560
|
+
className: "z-9999",
|
|
6561
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6495
6562
|
"div",
|
|
6496
6563
|
{
|
|
6497
6564
|
className: cn("rounded-md border bg-popover text-popover-foreground shadow-md", "backdrop-blur-sm bg-popover/95 border-border/60"),
|
|
6498
6565
|
children: [
|
|
6499
|
-
showClear && value.length > 0 && /* @__PURE__ */ (0,
|
|
6566
|
+
showClear && value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "px-3 py-2 border-b border-border/60 flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6500
6567
|
"button",
|
|
6501
6568
|
{
|
|
6502
6569
|
type: "button",
|
|
@@ -6509,9 +6576,9 @@ var MultiCombobox = ({
|
|
|
6509
6576
|
children: "Clear all"
|
|
6510
6577
|
}
|
|
6511
6578
|
) }),
|
|
6512
|
-
enableSearch && /* @__PURE__ */ (0,
|
|
6513
|
-
/* @__PURE__ */ (0,
|
|
6514
|
-
/* @__PURE__ */ (0,
|
|
6579
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "relative border-b border-border/60", children: [
|
|
6580
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Search, { className: cn("absolute left-2 top-2.5 text-muted-foreground", sizeStyles8[size].icon) }),
|
|
6581
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6515
6582
|
"input",
|
|
6516
6583
|
{
|
|
6517
6584
|
ref: inputRef,
|
|
@@ -6526,13 +6593,13 @@ var MultiCombobox = ({
|
|
|
6526
6593
|
}
|
|
6527
6594
|
)
|
|
6528
6595
|
] }),
|
|
6529
|
-
/* @__PURE__ */ (0,
|
|
6530
|
-
/* @__PURE__ */ (0,
|
|
6531
|
-
/* @__PURE__ */ (0,
|
|
6596
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ul", { className: cn("max-h-60 overflow-y-auto p-1", size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"), children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("li", { className: "px-3 py-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col items-center gap-2 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
6597
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Loader2, { className: "h-6 w-6 animate-spin text-primary" }),
|
|
6598
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-muted-foreground", children: loadingText })
|
|
6532
6599
|
] }) }) : filtered.length ? filtered.map((item, index) => {
|
|
6533
6600
|
const isSelected = value.includes(item.value);
|
|
6534
6601
|
const isDisabled = disabledOptions.includes(item.value);
|
|
6535
|
-
return /* @__PURE__ */ (0,
|
|
6602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6536
6603
|
"li",
|
|
6537
6604
|
{
|
|
6538
6605
|
ref: (node) => {
|
|
@@ -6545,7 +6612,7 @@ var MultiCombobox = ({
|
|
|
6545
6612
|
inputRef.current?.focus();
|
|
6546
6613
|
},
|
|
6547
6614
|
style: {
|
|
6548
|
-
animationDelay: open ? `${index *
|
|
6615
|
+
animationDelay: open ? `${Math.min(index * 20, 200)}ms` : "0ms"
|
|
6549
6616
|
},
|
|
6550
6617
|
className: cn(
|
|
6551
6618
|
"dropdown-item flex cursor-pointer items-center justify-between rounded-sm transition-colors",
|
|
@@ -6556,22 +6623,22 @@ var MultiCombobox = ({
|
|
|
6556
6623
|
),
|
|
6557
6624
|
children: [
|
|
6558
6625
|
item.label,
|
|
6559
|
-
isSelected && /* @__PURE__ */ (0,
|
|
6626
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Check, { className: sizeStyles8[size].icon })
|
|
6560
6627
|
]
|
|
6561
6628
|
},
|
|
6562
6629
|
item.value
|
|
6563
6630
|
);
|
|
6564
|
-
}) : /* @__PURE__ */ (0,
|
|
6631
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6565
6632
|
"li",
|
|
6566
6633
|
{
|
|
6567
6634
|
className: cn(
|
|
6568
6635
|
"px-3 py-8 text-center text-muted-foreground",
|
|
6569
6636
|
size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"
|
|
6570
6637
|
),
|
|
6571
|
-
children: /* @__PURE__ */ (0,
|
|
6572
|
-
/* @__PURE__ */ (0,
|
|
6573
|
-
/* @__PURE__ */ (0,
|
|
6574
|
-
query && /* @__PURE__ */ (0,
|
|
6638
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col items-center gap-2 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
6639
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.SearchX, { className: "h-8 w-8 opacity-40 text-muted-foreground" }),
|
|
6640
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: emptyText }),
|
|
6641
|
+
query && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", onClick: () => setQuery(""), className: "text-xs text-primary hover:underline", children: "Clear search" })
|
|
6575
6642
|
] })
|
|
6576
6643
|
}
|
|
6577
6644
|
) })
|
|
@@ -6587,7 +6654,7 @@ var MultiCombobox = ({
|
|
|
6587
6654
|
|
|
6588
6655
|
// ../../components/ui/RadioGroup.tsx
|
|
6589
6656
|
var React25 = __toESM(require("react"), 1);
|
|
6590
|
-
var
|
|
6657
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
6591
6658
|
var RadioGroupContext = React25.createContext(void 0);
|
|
6592
6659
|
var useRadioGroup = () => {
|
|
6593
6660
|
const context = React25.useContext(RadioGroupContext);
|
|
@@ -6625,7 +6692,7 @@ var RadioGroup = React25.forwardRef(
|
|
|
6625
6692
|
};
|
|
6626
6693
|
const uniqueId = React25.useId();
|
|
6627
6694
|
const radioName = name || `radio-group-${uniqueId}`;
|
|
6628
|
-
return /* @__PURE__ */ (0,
|
|
6695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6629
6696
|
RadioGroupContext.Provider,
|
|
6630
6697
|
{
|
|
6631
6698
|
value: {
|
|
@@ -6636,8 +6703,8 @@ var RadioGroup = React25.forwardRef(
|
|
|
6636
6703
|
size,
|
|
6637
6704
|
variant
|
|
6638
6705
|
},
|
|
6639
|
-
children: /* @__PURE__ */ (0,
|
|
6640
|
-
/* @__PURE__ */ (0,
|
|
6706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "space-y-2", children: [
|
|
6707
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6641
6708
|
"div",
|
|
6642
6709
|
{
|
|
6643
6710
|
ref,
|
|
@@ -6654,7 +6721,7 @@ var RadioGroup = React25.forwardRef(
|
|
|
6654
6721
|
children
|
|
6655
6722
|
}
|
|
6656
6723
|
),
|
|
6657
|
-
error && errorMessage && /* @__PURE__ */ (0,
|
|
6724
|
+
error && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-sm text-destructive mt-1", children: errorMessage })
|
|
6658
6725
|
] })
|
|
6659
6726
|
}
|
|
6660
6727
|
);
|
|
@@ -6696,7 +6763,7 @@ var RadioGroupItem = React25.forwardRef(
|
|
|
6696
6763
|
const Icon = icon;
|
|
6697
6764
|
const radioId = id || `radio-${value}`;
|
|
6698
6765
|
if (variant === "card") {
|
|
6699
|
-
return /* @__PURE__ */ (0,
|
|
6766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
6700
6767
|
"div",
|
|
6701
6768
|
{
|
|
6702
6769
|
className: cn(
|
|
@@ -6708,8 +6775,8 @@ var RadioGroupItem = React25.forwardRef(
|
|
|
6708
6775
|
className
|
|
6709
6776
|
),
|
|
6710
6777
|
children: [
|
|
6711
|
-
/* @__PURE__ */ (0,
|
|
6712
|
-
/* @__PURE__ */ (0,
|
|
6778
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
6779
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6713
6780
|
"button",
|
|
6714
6781
|
{
|
|
6715
6782
|
ref,
|
|
@@ -6728,22 +6795,22 @@ var RadioGroupItem = React25.forwardRef(
|
|
|
6728
6795
|
sizeStyles7[size].radio
|
|
6729
6796
|
),
|
|
6730
6797
|
onClick: () => onValueChange?.(value),
|
|
6731
|
-
children: /* @__PURE__ */ (0,
|
|
6798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6732
6799
|
"span",
|
|
6733
6800
|
{
|
|
6734
6801
|
className: cn(
|
|
6735
6802
|
"flex items-center justify-center w-full h-full rounded-full transition-all duration-200",
|
|
6736
6803
|
isSelected && "bg-primary"
|
|
6737
6804
|
),
|
|
6738
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
6805
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) })
|
|
6739
6806
|
}
|
|
6740
6807
|
)
|
|
6741
6808
|
}
|
|
6742
6809
|
),
|
|
6743
|
-
/* @__PURE__ */ (0,
|
|
6744
|
-
/* @__PURE__ */ (0,
|
|
6745
|
-
Icon && /* @__PURE__ */ (0,
|
|
6746
|
-
/* @__PURE__ */ (0,
|
|
6810
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
6811
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6812
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { className: "h-4 w-4 text-foreground" }),
|
|
6813
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6747
6814
|
"label",
|
|
6748
6815
|
{
|
|
6749
6816
|
htmlFor: radioId,
|
|
@@ -6755,10 +6822,10 @@ var RadioGroupItem = React25.forwardRef(
|
|
|
6755
6822
|
}
|
|
6756
6823
|
)
|
|
6757
6824
|
] }),
|
|
6758
|
-
description && /* @__PURE__ */ (0,
|
|
6825
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-muted-foreground mt-1 text-xs", children: description })
|
|
6759
6826
|
] })
|
|
6760
6827
|
] }),
|
|
6761
|
-
/* @__PURE__ */ (0,
|
|
6828
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6762
6829
|
"input",
|
|
6763
6830
|
{
|
|
6764
6831
|
type: "radio",
|
|
@@ -6776,7 +6843,7 @@ var RadioGroupItem = React25.forwardRef(
|
|
|
6776
6843
|
);
|
|
6777
6844
|
}
|
|
6778
6845
|
if (variant === "button") {
|
|
6779
|
-
return /* @__PURE__ */ (0,
|
|
6846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
6780
6847
|
"button",
|
|
6781
6848
|
{
|
|
6782
6849
|
ref,
|
|
@@ -6798,9 +6865,9 @@ var RadioGroupItem = React25.forwardRef(
|
|
|
6798
6865
|
),
|
|
6799
6866
|
onClick: () => onValueChange?.(value),
|
|
6800
6867
|
children: [
|
|
6801
|
-
Icon && /* @__PURE__ */ (0,
|
|
6868
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { className: "h-4 w-4" }),
|
|
6802
6869
|
label || children,
|
|
6803
|
-
/* @__PURE__ */ (0,
|
|
6870
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6804
6871
|
"input",
|
|
6805
6872
|
{
|
|
6806
6873
|
type: "radio",
|
|
@@ -6817,8 +6884,8 @@ var RadioGroupItem = React25.forwardRef(
|
|
|
6817
6884
|
}
|
|
6818
6885
|
);
|
|
6819
6886
|
}
|
|
6820
|
-
return /* @__PURE__ */ (0,
|
|
6821
|
-
/* @__PURE__ */ (0,
|
|
6887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("flex items-center gap-2", className), children: [
|
|
6888
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6822
6889
|
"button",
|
|
6823
6890
|
{
|
|
6824
6891
|
ref,
|
|
@@ -6837,19 +6904,19 @@ var RadioGroupItem = React25.forwardRef(
|
|
|
6837
6904
|
sizeStyles7[size].radio
|
|
6838
6905
|
),
|
|
6839
6906
|
onClick: () => onValueChange?.(value),
|
|
6840
|
-
children: /* @__PURE__ */ (0,
|
|
6907
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6841
6908
|
"span",
|
|
6842
6909
|
{
|
|
6843
6910
|
className: cn(
|
|
6844
6911
|
"flex items-center justify-center w-full h-full rounded-full transition-all duration-200",
|
|
6845
6912
|
isSelected && "bg-primary"
|
|
6846
6913
|
),
|
|
6847
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
6914
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) })
|
|
6848
6915
|
}
|
|
6849
6916
|
)
|
|
6850
6917
|
}
|
|
6851
6918
|
),
|
|
6852
|
-
(label || children) && /* @__PURE__ */ (0,
|
|
6919
|
+
(label || children) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
6853
6920
|
"label",
|
|
6854
6921
|
{
|
|
6855
6922
|
htmlFor: radioId,
|
|
@@ -6860,15 +6927,15 @@ var RadioGroupItem = React25.forwardRef(
|
|
|
6860
6927
|
isDisabled && "cursor-not-allowed opacity-50"
|
|
6861
6928
|
),
|
|
6862
6929
|
children: [
|
|
6863
|
-
/* @__PURE__ */ (0,
|
|
6864
|
-
Icon && /* @__PURE__ */ (0,
|
|
6865
|
-
/* @__PURE__ */ (0,
|
|
6930
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6931
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { className: "h-4 w-4" }),
|
|
6932
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: label || children })
|
|
6866
6933
|
] }),
|
|
6867
|
-
description && /* @__PURE__ */ (0,
|
|
6934
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-muted-foreground mt-0.5 text-xs", children: description })
|
|
6868
6935
|
]
|
|
6869
6936
|
}
|
|
6870
6937
|
),
|
|
6871
|
-
/* @__PURE__ */ (0,
|
|
6938
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6872
6939
|
"input",
|
|
6873
6940
|
{
|
|
6874
6941
|
type: "radio",
|
|
@@ -6888,7 +6955,7 @@ RadioGroupItem.displayName = "RadioGroupItem";
|
|
|
6888
6955
|
|
|
6889
6956
|
// ../../components/ui/Slider.tsx
|
|
6890
6957
|
var React26 = __toESM(require("react"), 1);
|
|
6891
|
-
var
|
|
6958
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
6892
6959
|
var SIZE_STYLES = {
|
|
6893
6960
|
sm: {
|
|
6894
6961
|
track: "h-1",
|
|
@@ -6948,20 +7015,20 @@ var Slider = React26.forwardRef(
|
|
|
6948
7015
|
const displayValue = formatValue ? formatValue(currentValue) : currentValue.toString();
|
|
6949
7016
|
if (orientation === "vertical") {
|
|
6950
7017
|
}
|
|
6951
|
-
return /* @__PURE__ */ (0,
|
|
6952
|
-
(label || showValue) && /* @__PURE__ */ (0,
|
|
6953
|
-
label && /* @__PURE__ */ (0,
|
|
6954
|
-
showValue && /* @__PURE__ */ (0,
|
|
7018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("w-full space-y-2", containerClassName), children: [
|
|
7019
|
+
(label || showValue) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
7020
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("label", { className: cn("text-sm font-medium text-foreground", labelClassName), children: label }),
|
|
7021
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: cn("text-xs font-mono text-muted-foreground min-w-[2rem] text-right", valueClassName), children: displayValue })
|
|
6955
7022
|
] }),
|
|
6956
|
-
/* @__PURE__ */ (0,
|
|
6957
|
-
/* @__PURE__ */ (0,
|
|
7023
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("relative flex items-center", sizeStyles8.container), children: [
|
|
7024
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("w-full rounded-full bg-secondary relative overflow-hidden", sizeStyles8.track, trackClassName), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6958
7025
|
"div",
|
|
6959
7026
|
{
|
|
6960
7027
|
className: "absolute left-0 top-0 h-full bg-primary rounded-full transition-all duration-150 ease-out",
|
|
6961
7028
|
style: { width: `${percentage}%` }
|
|
6962
7029
|
}
|
|
6963
7030
|
) }),
|
|
6964
|
-
/* @__PURE__ */ (0,
|
|
7031
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6965
7032
|
"input",
|
|
6966
7033
|
{
|
|
6967
7034
|
ref,
|
|
@@ -7025,9 +7092,9 @@ var Slider = React26.forwardRef(
|
|
|
7025
7092
|
Slider.displayName = "Slider";
|
|
7026
7093
|
|
|
7027
7094
|
// ../../components/ui/OverlayControls.tsx
|
|
7028
|
-
var
|
|
7095
|
+
var import_lucide_react17 = require("lucide-react");
|
|
7029
7096
|
var import_react16 = __toESM(require("react"), 1);
|
|
7030
|
-
var
|
|
7097
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
7031
7098
|
function OverlayControls({
|
|
7032
7099
|
mode,
|
|
7033
7100
|
value,
|
|
@@ -7250,41 +7317,41 @@ function OverlayControls({
|
|
|
7250
7317
|
const handleSliderMouseLeave = () => {
|
|
7251
7318
|
setPreviewData(null);
|
|
7252
7319
|
};
|
|
7253
|
-
return /* @__PURE__ */ (0,
|
|
7254
|
-
keyboardFeedback && /* @__PURE__ */ (0,
|
|
7320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
7321
|
+
keyboardFeedback && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7255
7322
|
"div",
|
|
7256
7323
|
{
|
|
7257
7324
|
className: cn(
|
|
7258
7325
|
"absolute inset-0 flex items-center pointer-events-none z-50",
|
|
7259
7326
|
keyboardFeedback.type === "seek" && (keyboardFeedback.value ?? 0) > 0 ? "justify-end pr-32" : keyboardFeedback.type === "seek" && (keyboardFeedback.value ?? 0) < 0 ? "justify-start pl-32" : "justify-center"
|
|
7260
7327
|
),
|
|
7261
|
-
children: /* @__PURE__ */ (0,
|
|
7262
|
-
keyboardFeedback.type === "play" && /* @__PURE__ */ (0,
|
|
7263
|
-
keyboardFeedback.type === "pause" && /* @__PURE__ */ (0,
|
|
7264
|
-
keyboardFeedback.type === "seek" && /* @__PURE__ */ (0,
|
|
7265
|
-
(keyboardFeedback.value ?? 0) > 0 ? /* @__PURE__ */ (0,
|
|
7266
|
-
/* @__PURE__ */ (0,
|
|
7328
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "bg-black/50 backdrop-blur-sm rounded-xl px-6 py-4 shadow-xl border border-white/10 animate-in fade-in zoom-in duration-200", children: [
|
|
7329
|
+
keyboardFeedback.type === "play" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Play, { className: "w-16 h-16 text-white", fill: "white" }),
|
|
7330
|
+
keyboardFeedback.type === "pause" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Pause, { className: "w-16 h-16 text-white", fill: "white" }),
|
|
7331
|
+
keyboardFeedback.type === "seek" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
7332
|
+
(keyboardFeedback.value ?? 0) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.RotateCw, { className: "w-12 h-12 text-white" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.RotateCcw, { className: "w-12 h-12 text-white" }),
|
|
7333
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "text-3xl font-bold text-white", children: [
|
|
7267
7334
|
keyboardFeedback.value && keyboardFeedback.value > 0 ? "+" : "",
|
|
7268
7335
|
keyboardFeedback.value,
|
|
7269
7336
|
"s"
|
|
7270
7337
|
] })
|
|
7271
7338
|
] }),
|
|
7272
|
-
keyboardFeedback.type === "volume" && /* @__PURE__ */ (0,
|
|
7273
|
-
/* @__PURE__ */ (0,
|
|
7274
|
-
/* @__PURE__ */ (0,
|
|
7275
|
-
/* @__PURE__ */ (0,
|
|
7339
|
+
keyboardFeedback.type === "volume" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
7340
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Volume2, { className: "w-12 h-12 text-white" }),
|
|
7341
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
7342
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "text-2xl font-bold text-white", children: [
|
|
7276
7343
|
keyboardFeedback.value,
|
|
7277
7344
|
"%"
|
|
7278
7345
|
] }),
|
|
7279
|
-
/* @__PURE__ */ (0,
|
|
7346
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-32 h-1.5 bg-white/30 rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "h-full bg-white rounded-full transition-all", style: { width: `${keyboardFeedback.value}%` } }) })
|
|
7280
7347
|
] })
|
|
7281
7348
|
] }),
|
|
7282
|
-
keyboardFeedback.type === "mute" && /* @__PURE__ */ (0,
|
|
7283
|
-
keyboardFeedback.type === "unmute" && /* @__PURE__ */ (0,
|
|
7349
|
+
keyboardFeedback.type === "mute" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.VolumeX, { className: "w-16 h-16 text-white" }),
|
|
7350
|
+
keyboardFeedback.type === "unmute" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Volume2, { className: "w-16 h-16 text-white" })
|
|
7284
7351
|
] })
|
|
7285
7352
|
}
|
|
7286
7353
|
),
|
|
7287
|
-
/* @__PURE__ */ (0,
|
|
7354
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7288
7355
|
"div",
|
|
7289
7356
|
{
|
|
7290
7357
|
className: cn(
|
|
@@ -7293,9 +7360,9 @@ function OverlayControls({
|
|
|
7293
7360
|
autoHide && !controlsVisible && "opacity-0 pointer-events-none",
|
|
7294
7361
|
className
|
|
7295
7362
|
),
|
|
7296
|
-
children: /* @__PURE__ */ (0,
|
|
7297
|
-
/* @__PURE__ */ (0,
|
|
7298
|
-
/* @__PURE__ */ (0,
|
|
7363
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "px-4", children: [
|
|
7364
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ref: sliderRef, onMouseMove: handleSliderMouseMove, onMouseLeave: handleSliderMouseLeave, className: "relative", children: [
|
|
7365
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7299
7366
|
Slider,
|
|
7300
7367
|
{
|
|
7301
7368
|
min: 0,
|
|
@@ -7320,14 +7387,14 @@ function OverlayControls({
|
|
|
7320
7387
|
noFocus: true
|
|
7321
7388
|
}
|
|
7322
7389
|
),
|
|
7323
|
-
previewData && /* @__PURE__ */ (0,
|
|
7324
|
-
/* @__PURE__ */ (0,
|
|
7325
|
-
/* @__PURE__ */ (0,
|
|
7326
|
-
] }) : /* @__PURE__ */ (0,
|
|
7390
|
+
previewData && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "absolute bottom-full mb-2 transform -translate-x-1/2 pointer-events-none z-30", style: { left: `${previewData.x}px` }, children: previewData.url ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "bg-background/95 backdrop-blur rounded-md border border-border shadow-lg overflow-hidden", children: [
|
|
7391
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("img", { src: previewData.url, alt: "Preview", className: "w-40 h-24 object-cover" }),
|
|
7392
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "px-2 py-1 text-xs font-mono text-center bg-background/80", children: formatTime3(previewData.time) })
|
|
7393
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "px-3 py-1.5 rounded-md bg-background/90 backdrop-blur border border-border shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-xs font-mono text-center", children: formatTime3(previewData.time) }) }) })
|
|
7327
7394
|
] }),
|
|
7328
|
-
showControlsBar && /* @__PURE__ */ (0,
|
|
7329
|
-
/* @__PURE__ */ (0,
|
|
7330
|
-
/* @__PURE__ */ (0,
|
|
7395
|
+
showControlsBar && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mt-2 flex items-center justify-between gap-2", children: [
|
|
7396
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7397
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7331
7398
|
Button_default,
|
|
7332
7399
|
{
|
|
7333
7400
|
variant: "ghost",
|
|
@@ -7335,10 +7402,10 @@ function OverlayControls({
|
|
|
7335
7402
|
onClick: onTogglePlay,
|
|
7336
7403
|
title: playing ? "T\u1EA1m d\u1EEBng" : "Ph\xE1t",
|
|
7337
7404
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
7338
|
-
children: playing ? /* @__PURE__ */ (0,
|
|
7405
|
+
children: playing ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Pause, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Play, { className: "w-4 h-4" })
|
|
7339
7406
|
}
|
|
7340
7407
|
),
|
|
7341
|
-
onSkip && /* @__PURE__ */ (0,
|
|
7408
|
+
onSkip && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7342
7409
|
Button_default,
|
|
7343
7410
|
{
|
|
7344
7411
|
variant: "ghost",
|
|
@@ -7346,10 +7413,10 @@ function OverlayControls({
|
|
|
7346
7413
|
onClick: () => onSkip(-skipSeconds),
|
|
7347
7414
|
title: `L\xF9i ${skipSeconds}s`,
|
|
7348
7415
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
7349
|
-
children: /* @__PURE__ */ (0,
|
|
7416
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.RotateCcw, { className: "w-4 h-4" })
|
|
7350
7417
|
}
|
|
7351
7418
|
),
|
|
7352
|
-
onSkip && /* @__PURE__ */ (0,
|
|
7419
|
+
onSkip && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7353
7420
|
Button_default,
|
|
7354
7421
|
{
|
|
7355
7422
|
variant: "ghost",
|
|
@@ -7357,16 +7424,16 @@ function OverlayControls({
|
|
|
7357
7424
|
onClick: () => onSkip(skipSeconds),
|
|
7358
7425
|
title: `Tua ${skipSeconds}s`,
|
|
7359
7426
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
7360
|
-
children: /* @__PURE__ */ (0,
|
|
7427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.RotateCw, { className: "w-4 h-4" })
|
|
7361
7428
|
}
|
|
7362
7429
|
),
|
|
7363
|
-
(showTime ?? true) && /* @__PURE__ */ (0,
|
|
7430
|
+
(showTime ?? true) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "px-3 py-1 rounded-full text-xs font-mono bg-background/60 text-foreground shadow-sm border border-border whitespace-nowrap", children: [
|
|
7364
7431
|
formatTime3(dragValue),
|
|
7365
7432
|
" / ",
|
|
7366
7433
|
formatTime3(max)
|
|
7367
7434
|
] }),
|
|
7368
|
-
/* @__PURE__ */ (0,
|
|
7369
|
-
/* @__PURE__ */ (0,
|
|
7435
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7436
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7370
7437
|
Button_default,
|
|
7371
7438
|
{
|
|
7372
7439
|
variant: "ghost",
|
|
@@ -7374,10 +7441,10 @@ function OverlayControls({
|
|
|
7374
7441
|
onClick: onToggleMute,
|
|
7375
7442
|
title: muted ? "B\u1EADt ti\u1EBFng" : "T\u1EAFt ti\u1EBFng",
|
|
7376
7443
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
7377
|
-
children: muted || (volume ?? 1) === 0 ? /* @__PURE__ */ (0,
|
|
7444
|
+
children: muted || (volume ?? 1) === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.VolumeX, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Volume2, { className: "w-4 h-4" })
|
|
7378
7445
|
}
|
|
7379
7446
|
),
|
|
7380
|
-
/* @__PURE__ */ (0,
|
|
7447
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-24", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7381
7448
|
Slider,
|
|
7382
7449
|
{
|
|
7383
7450
|
min: 0,
|
|
@@ -7392,8 +7459,8 @@ function OverlayControls({
|
|
|
7392
7459
|
) })
|
|
7393
7460
|
] })
|
|
7394
7461
|
] }),
|
|
7395
|
-
/* @__PURE__ */ (0,
|
|
7396
|
-
onGoLive && /* @__PURE__ */ (0,
|
|
7462
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2 relative", children: [
|
|
7463
|
+
onGoLive && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
7397
7464
|
Button_default,
|
|
7398
7465
|
{
|
|
7399
7466
|
variant: "ghost",
|
|
@@ -7402,13 +7469,13 @@ function OverlayControls({
|
|
|
7402
7469
|
title: "Tr\u1EF1c ti\u1EBFp (v\u1EC1 Live)",
|
|
7403
7470
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
7404
7471
|
children: [
|
|
7405
|
-
/* @__PURE__ */ (0,
|
|
7472
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Dot, { className: "w-10 h-10 text-destructive" }),
|
|
7406
7473
|
"Tr\u1EF1c ti\u1EBFp"
|
|
7407
7474
|
]
|
|
7408
7475
|
}
|
|
7409
7476
|
),
|
|
7410
|
-
onChangeRate && /* @__PURE__ */ (0,
|
|
7411
|
-
/* @__PURE__ */ (0,
|
|
7477
|
+
onChangeRate && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative", ref: rateWrapRef, children: [
|
|
7478
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
7412
7479
|
Button_default,
|
|
7413
7480
|
{
|
|
7414
7481
|
variant: "ghost",
|
|
@@ -7422,7 +7489,7 @@ function OverlayControls({
|
|
|
7422
7489
|
]
|
|
7423
7490
|
}
|
|
7424
7491
|
),
|
|
7425
|
-
rateOpen && /* @__PURE__ */ (0,
|
|
7492
|
+
rateOpen && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "absolute bottom-9 right-0 bg-background/90 backdrop-blur rounded-md border border-border shadow-lg p-1 z-30", children: [0.5, 0.75, 1, 1.25, 1.5].map((r) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
7426
7493
|
"button",
|
|
7427
7494
|
{
|
|
7428
7495
|
onClick: () => {
|
|
@@ -7438,7 +7505,7 @@ function OverlayControls({
|
|
|
7438
7505
|
r
|
|
7439
7506
|
)) })
|
|
7440
7507
|
] }),
|
|
7441
|
-
onToggleFullscreen && /* @__PURE__ */ (0,
|
|
7508
|
+
onToggleFullscreen && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7442
7509
|
Button_default,
|
|
7443
7510
|
{
|
|
7444
7511
|
variant: "ghost",
|
|
@@ -7446,7 +7513,7 @@ function OverlayControls({
|
|
|
7446
7513
|
onClick: onToggleFullscreen,
|
|
7447
7514
|
title: "To\xE0n m\xE0n h\xECnh",
|
|
7448
7515
|
className: "px-3 bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
7449
|
-
children: /* @__PURE__ */ (0,
|
|
7516
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Maximize2, { className: "w-4 h-4" })
|
|
7450
7517
|
}
|
|
7451
7518
|
)
|
|
7452
7519
|
] })
|
|
@@ -7459,8 +7526,8 @@ function OverlayControls({
|
|
|
7459
7526
|
|
|
7460
7527
|
// ../../components/ui/CategoryTreeSelect.tsx
|
|
7461
7528
|
var import_react17 = require("react");
|
|
7462
|
-
var
|
|
7463
|
-
var
|
|
7529
|
+
var import_lucide_react18 = require("lucide-react");
|
|
7530
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
7464
7531
|
function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1ECDn danh m\u1EE5c", disabled }) {
|
|
7465
7532
|
const [isOpen, setIsOpen] = (0, import_react17.useState)(false);
|
|
7466
7533
|
const [expandedNodes, setExpandedNodes] = (0, import_react17.useState)(/* @__PURE__ */ new Set());
|
|
@@ -7502,8 +7569,8 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
7502
7569
|
const hasChildren = children.length > 0;
|
|
7503
7570
|
const isExpanded = expandedNodes.has(category.id);
|
|
7504
7571
|
const isSelected = value.includes(category.id);
|
|
7505
|
-
return /* @__PURE__ */ (0,
|
|
7506
|
-
/* @__PURE__ */ (0,
|
|
7572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
|
|
7573
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
7507
7574
|
"div",
|
|
7508
7575
|
{
|
|
7509
7576
|
className: cn(
|
|
@@ -7514,14 +7581,14 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
7514
7581
|
),
|
|
7515
7582
|
style: { paddingLeft: `${level * 1.5 + 0.75}rem` },
|
|
7516
7583
|
children: [
|
|
7517
|
-
isSelected && /* @__PURE__ */ (0,
|
|
7584
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7518
7585
|
"span",
|
|
7519
7586
|
{
|
|
7520
7587
|
"aria-hidden": true,
|
|
7521
7588
|
className: "absolute left-0 top-0 bottom-0 w-1 bg-primary"
|
|
7522
7589
|
}
|
|
7523
7590
|
),
|
|
7524
|
-
hasChildren ? /* @__PURE__ */ (0,
|
|
7591
|
+
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7525
7592
|
"button",
|
|
7526
7593
|
{
|
|
7527
7594
|
type: "button",
|
|
@@ -7530,39 +7597,39 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
7530
7597
|
toggleExpand(category.id);
|
|
7531
7598
|
},
|
|
7532
7599
|
className: "p-0.5 hover:bg-accent rounded",
|
|
7533
|
-
children: isExpanded ? /* @__PURE__ */ (0,
|
|
7600
|
+
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.ChevronDown, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.ChevronRight, { className: "w-4 h-4" })
|
|
7534
7601
|
}
|
|
7535
|
-
) : /* @__PURE__ */ (0,
|
|
7536
|
-
/* @__PURE__ */ (0,
|
|
7602
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "w-5" }),
|
|
7603
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
7537
7604
|
"div",
|
|
7538
7605
|
{
|
|
7539
7606
|
onClick: () => handleSelect(category.id, category),
|
|
7540
7607
|
className: "flex items-center gap-2 flex-1",
|
|
7541
7608
|
children: [
|
|
7542
|
-
/* @__PURE__ */ (0,
|
|
7609
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7543
7610
|
"div",
|
|
7544
7611
|
{
|
|
7545
7612
|
className: cn(
|
|
7546
7613
|
"w-4 h-4 border-2 rounded flex items-center justify-center transition-colors",
|
|
7547
7614
|
isSelected ? "bg-primary border-primary" : "border-muted-foreground/30"
|
|
7548
7615
|
),
|
|
7549
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
7616
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.Check, { className: "w-3 h-3 text-primary-foreground" })
|
|
7550
7617
|
}
|
|
7551
7618
|
),
|
|
7552
|
-
/* @__PURE__ */ (0,
|
|
7619
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: cn("text-sm", isSelected && "font-medium text-primary"), children: category.name })
|
|
7553
7620
|
]
|
|
7554
7621
|
}
|
|
7555
7622
|
)
|
|
7556
7623
|
]
|
|
7557
7624
|
}
|
|
7558
7625
|
),
|
|
7559
|
-
hasChildren && isExpanded && /* @__PURE__ */ (0,
|
|
7626
|
+
hasChildren && isExpanded && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: children.map((child) => renderCategory(child, level + 1)) })
|
|
7560
7627
|
] }, category.id);
|
|
7561
7628
|
};
|
|
7562
7629
|
const selectedCount = value.length;
|
|
7563
7630
|
const displayText = selectedCount > 0 ? `\u0110\xE3 ch\u1ECDn ${selectedCount} danh m\u1EE5c` : placeholder;
|
|
7564
|
-
return /* @__PURE__ */ (0,
|
|
7565
|
-
/* @__PURE__ */ (0,
|
|
7631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "relative", children: [
|
|
7632
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
7566
7633
|
"button",
|
|
7567
7634
|
{
|
|
7568
7635
|
type: "button",
|
|
@@ -7578,14 +7645,14 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
7578
7645
|
isOpen && "border-primary"
|
|
7579
7646
|
),
|
|
7580
7647
|
children: [
|
|
7581
|
-
/* @__PURE__ */ (0,
|
|
7582
|
-
/* @__PURE__ */ (0,
|
|
7648
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: cn("text-sm", selectedCount === 0 && "text-muted-foreground"), children: displayText }),
|
|
7649
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.ChevronDown, { className: cn("w-4 h-4 transition-transform", isOpen && "transform rotate-180") })
|
|
7583
7650
|
]
|
|
7584
7651
|
}
|
|
7585
7652
|
),
|
|
7586
|
-
isOpen && !disabled && /* @__PURE__ */ (0,
|
|
7587
|
-
/* @__PURE__ */ (0,
|
|
7588
|
-
/* @__PURE__ */ (0,
|
|
7653
|
+
isOpen && !disabled && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
7654
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "fixed inset-0 z-10", onClick: () => setIsOpen(false) }),
|
|
7655
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7589
7656
|
"div",
|
|
7590
7657
|
{
|
|
7591
7658
|
className: cn(
|
|
@@ -7593,7 +7660,7 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
7593
7660
|
"rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
7594
7661
|
"backdrop-blur-sm bg-popover/95 border-border/60"
|
|
7595
7662
|
),
|
|
7596
|
-
children: /* @__PURE__ */ (0,
|
|
7663
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "p-1", children: parentCategories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "px-3 py-2 text-sm text-muted-foreground", children: "Kh\xF4ng c\xF3 danh m\u1EE5c n\xE0o" }) : parentCategories.map((cat) => renderCategory(cat)) })
|
|
7597
7664
|
}
|
|
7598
7665
|
)
|
|
7599
7666
|
] })
|
|
@@ -7602,9 +7669,9 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
7602
7669
|
|
|
7603
7670
|
// ../../components/ui/ImageUpload.tsx
|
|
7604
7671
|
var import_react18 = require("react");
|
|
7605
|
-
var
|
|
7672
|
+
var import_lucide_react19 = require("lucide-react");
|
|
7606
7673
|
var import_next_intl6 = require("next-intl");
|
|
7607
|
-
var
|
|
7674
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
7608
7675
|
function ImageUpload({
|
|
7609
7676
|
onUpload,
|
|
7610
7677
|
onRemove,
|
|
@@ -7631,94 +7698,106 @@ function ImageUpload({
|
|
|
7631
7698
|
md: "w-24 h-24",
|
|
7632
7699
|
lg: "w-32 h-32"
|
|
7633
7700
|
};
|
|
7634
|
-
const handleDragOver = (0, import_react18.useCallback)(
|
|
7635
|
-
e
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7701
|
+
const handleDragOver = (0, import_react18.useCallback)(
|
|
7702
|
+
(e) => {
|
|
7703
|
+
e.preventDefault();
|
|
7704
|
+
if (!disabled) {
|
|
7705
|
+
setIsDragging(true);
|
|
7706
|
+
}
|
|
7707
|
+
},
|
|
7708
|
+
[disabled]
|
|
7709
|
+
);
|
|
7640
7710
|
const handleDragLeave = (0, import_react18.useCallback)((e) => {
|
|
7641
7711
|
e.preventDefault();
|
|
7642
7712
|
setIsDragging(false);
|
|
7643
7713
|
}, []);
|
|
7644
|
-
const handleFiles = (0, import_react18.useCallback)(
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7714
|
+
const handleFiles = (0, import_react18.useCallback)(
|
|
7715
|
+
async (files) => {
|
|
7716
|
+
if (files.length === 0) return;
|
|
7717
|
+
const validFiles = files.filter((file) => {
|
|
7718
|
+
if (file.size > maxSize * 1024 * 1024) {
|
|
7719
|
+
addToast({
|
|
7720
|
+
type: "error",
|
|
7721
|
+
message: `File "${file.name}" is too large. Max size: ${maxSize}MB`
|
|
7722
|
+
});
|
|
7723
|
+
return false;
|
|
7724
|
+
}
|
|
7725
|
+
if (!file.type.startsWith("image/")) {
|
|
7726
|
+
addToast({
|
|
7727
|
+
type: "error",
|
|
7728
|
+
message: `File "${file.name}" is not a valid image`
|
|
7729
|
+
});
|
|
7730
|
+
return false;
|
|
7731
|
+
}
|
|
7732
|
+
return true;
|
|
7733
|
+
});
|
|
7734
|
+
if (validFiles.length === 0) return;
|
|
7735
|
+
setUploading(true);
|
|
7736
|
+
try {
|
|
7737
|
+
for (const file of validFiles) {
|
|
7738
|
+
const formData = new FormData();
|
|
7739
|
+
formData.append("file", file);
|
|
7740
|
+
const response = {
|
|
7741
|
+
id: Date.now(),
|
|
7742
|
+
path: "",
|
|
7743
|
+
url: URL.createObjectURL(file),
|
|
7744
|
+
originalName: file.name,
|
|
7745
|
+
size: file.size,
|
|
7746
|
+
mimeType: file.type,
|
|
7747
|
+
width: 0,
|
|
7748
|
+
height: 0,
|
|
7749
|
+
formattedSize: `${(file.size / 1024).toFixed(1)} KB`
|
|
7750
|
+
};
|
|
7751
|
+
const newImage = {
|
|
7752
|
+
id: response.id,
|
|
7753
|
+
path: response.path,
|
|
7754
|
+
url: response.url,
|
|
7755
|
+
originalName: response.originalName,
|
|
7756
|
+
size: response.size,
|
|
7757
|
+
mimeType: response.mimeType,
|
|
7758
|
+
width: response.width,
|
|
7759
|
+
height: response.height,
|
|
7760
|
+
formattedSize: response.formattedSize
|
|
7761
|
+
};
|
|
7762
|
+
setUploadedImages((prev) => [...prev, newImage]);
|
|
7763
|
+
onUpload?.(newImage);
|
|
7764
|
+
addToast({
|
|
7765
|
+
type: "success",
|
|
7766
|
+
message: `"${file.name}" uploaded successfully`
|
|
7767
|
+
});
|
|
7768
|
+
}
|
|
7769
|
+
} catch (error) {
|
|
7770
|
+
console.error("Upload error:", error);
|
|
7655
7771
|
addToast({
|
|
7656
7772
|
type: "error",
|
|
7657
|
-
message:
|
|
7773
|
+
message: error.message || "Upload failed"
|
|
7658
7774
|
});
|
|
7659
|
-
|
|
7775
|
+
} finally {
|
|
7776
|
+
setUploading(false);
|
|
7660
7777
|
}
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
const newImage = {
|
|
7681
|
-
id: response.id,
|
|
7682
|
-
path: response.path,
|
|
7683
|
-
url: response.url,
|
|
7684
|
-
originalName: response.originalName,
|
|
7685
|
-
size: response.size,
|
|
7686
|
-
mimeType: response.mimeType,
|
|
7687
|
-
width: response.width,
|
|
7688
|
-
height: response.height,
|
|
7689
|
-
formattedSize: response.formattedSize
|
|
7690
|
-
};
|
|
7691
|
-
setUploadedImages((prev) => [...prev, newImage]);
|
|
7692
|
-
onUpload?.(newImage);
|
|
7693
|
-
addToast({
|
|
7694
|
-
type: "success",
|
|
7695
|
-
message: `"${file.name}" uploaded successfully`
|
|
7696
|
-
});
|
|
7778
|
+
},
|
|
7779
|
+
[maxSize, addToast, onUpload]
|
|
7780
|
+
);
|
|
7781
|
+
const handleDrop = (0, import_react18.useCallback)(
|
|
7782
|
+
(e) => {
|
|
7783
|
+
e.preventDefault();
|
|
7784
|
+
setIsDragging(false);
|
|
7785
|
+
if (disabled) return;
|
|
7786
|
+
const files = Array.from(e.dataTransfer.files);
|
|
7787
|
+
handleFiles(files);
|
|
7788
|
+
},
|
|
7789
|
+
[disabled, handleFiles]
|
|
7790
|
+
);
|
|
7791
|
+
const handleFileSelect = (0, import_react18.useCallback)(
|
|
7792
|
+
(e) => {
|
|
7793
|
+
const files = Array.from(e.target.files || []);
|
|
7794
|
+
handleFiles(files);
|
|
7795
|
+
if (fileInputRef.current) {
|
|
7796
|
+
fileInputRef.current.value = "";
|
|
7697
7797
|
}
|
|
7698
|
-
}
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
type: "error",
|
|
7702
|
-
message: error.message || "Upload failed"
|
|
7703
|
-
});
|
|
7704
|
-
} finally {
|
|
7705
|
-
setUploading(false);
|
|
7706
|
-
}
|
|
7707
|
-
}, [maxSize, addToast, onUpload]);
|
|
7708
|
-
const handleDrop = (0, import_react18.useCallback)((e) => {
|
|
7709
|
-
e.preventDefault();
|
|
7710
|
-
setIsDragging(false);
|
|
7711
|
-
if (disabled) return;
|
|
7712
|
-
const files = Array.from(e.dataTransfer.files);
|
|
7713
|
-
handleFiles(files);
|
|
7714
|
-
}, [disabled, handleFiles]);
|
|
7715
|
-
const handleFileSelect = (0, import_react18.useCallback)((e) => {
|
|
7716
|
-
const files = Array.from(e.target.files || []);
|
|
7717
|
-
handleFiles(files);
|
|
7718
|
-
if (fileInputRef.current) {
|
|
7719
|
-
fileInputRef.current.value = "";
|
|
7720
|
-
}
|
|
7721
|
-
}, [handleFiles]);
|
|
7798
|
+
},
|
|
7799
|
+
[handleFiles]
|
|
7800
|
+
);
|
|
7722
7801
|
const handleRemoveImage = (imageId) => {
|
|
7723
7802
|
setUploadedImages((prev) => prev.filter((img) => img.id !== Number(imageId)));
|
|
7724
7803
|
onRemove?.(String(imageId));
|
|
@@ -7726,8 +7805,8 @@ function ImageUpload({
|
|
|
7726
7805
|
const handleBrowseClick = () => {
|
|
7727
7806
|
fileInputRef.current?.click();
|
|
7728
7807
|
};
|
|
7729
|
-
return /* @__PURE__ */ (0,
|
|
7730
|
-
/* @__PURE__ */ (0,
|
|
7808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: cn("space-y-4", className), children: [
|
|
7809
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
7731
7810
|
"div",
|
|
7732
7811
|
{
|
|
7733
7812
|
className: cn(
|
|
@@ -7740,29 +7819,19 @@ function ImageUpload({
|
|
|
7740
7819
|
onDragLeave: handleDragLeave,
|
|
7741
7820
|
onDrop: handleDrop,
|
|
7742
7821
|
children: [
|
|
7743
|
-
uploading && /* @__PURE__ */ (0,
|
|
7744
|
-
/* @__PURE__ */ (0,
|
|
7745
|
-
/* @__PURE__ */ (0,
|
|
7822
|
+
uploading && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "absolute inset-0 bg-background/80 flex items-center justify-center rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
7823
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react19.Loader2, { className: "w-6 h-6 animate-spin text-primary" }),
|
|
7824
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm font-medium", children: "Uploading..." })
|
|
7746
7825
|
] }) }),
|
|
7747
|
-
/* @__PURE__ */ (0,
|
|
7748
|
-
/* @__PURE__ */ (0,
|
|
7749
|
-
/* @__PURE__ */ (0,
|
|
7750
|
-
/* @__PURE__ */ (0,
|
|
7751
|
-
/* @__PURE__ */ (0,
|
|
7752
|
-
Button_default,
|
|
7753
|
-
{
|
|
7754
|
-
type: "button",
|
|
7755
|
-
variant: "outline",
|
|
7756
|
-
size: "sm",
|
|
7757
|
-
onClick: handleBrowseClick,
|
|
7758
|
-
disabled: disabled || uploading,
|
|
7759
|
-
children: browseText || t("browseFiles")
|
|
7760
|
-
}
|
|
7761
|
-
)
|
|
7826
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-4", children: [
|
|
7827
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "mx-auto w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react19.Upload, { className: "w-6 h-6 text-primary" }) }),
|
|
7828
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-2", children: [
|
|
7829
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-muted-foreground", children: dragDropText || t("dragDropText") }),
|
|
7830
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button_default, { type: "button", variant: "outline", size: "sm", onClick: handleBrowseClick, disabled: disabled || uploading, children: browseText || t("browseFiles") })
|
|
7762
7831
|
] }),
|
|
7763
|
-
/* @__PURE__ */ (0,
|
|
7832
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-muted-foreground", children: supportedFormatsText || t("supportedFormats") })
|
|
7764
7833
|
] }),
|
|
7765
|
-
/* @__PURE__ */ (0,
|
|
7834
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7766
7835
|
"input",
|
|
7767
7836
|
{
|
|
7768
7837
|
ref: fileInputRef,
|
|
@@ -7777,61 +7846,54 @@ function ImageUpload({
|
|
|
7777
7846
|
]
|
|
7778
7847
|
}
|
|
7779
7848
|
),
|
|
7780
|
-
showPreview && uploadedImages.length > 0 && /* @__PURE__ */ (0,
|
|
7781
|
-
/* @__PURE__ */ (0,
|
|
7782
|
-
/* @__PURE__ */ (0,
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7849
|
+
showPreview && uploadedImages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-3", children: [
|
|
7850
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h4", { className: "text-sm font-medium", children: "Uploaded Images" }),
|
|
7851
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4", children: uploadedImages.map((image) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative group bg-card border border-border rounded-lg p-3", children: [
|
|
7852
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7853
|
+
Button_default,
|
|
7854
|
+
{
|
|
7855
|
+
variant: "danger",
|
|
7856
|
+
size: "icon",
|
|
7857
|
+
className: "absolute -top-2 -right-2 w-6 h-6 opacity-0 group-hover:opacity-100 transition-opacity z-10",
|
|
7858
|
+
onClick: () => handleRemoveImage(image.id),
|
|
7859
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react19.X, { className: "w-3 h-3" })
|
|
7860
|
+
}
|
|
7861
|
+
),
|
|
7862
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: cn("mx-auto mb-2 overflow-hidden rounded-md", previewSizes[previewSize]), children: [
|
|
7863
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7864
|
+
"img",
|
|
7865
|
+
{
|
|
7866
|
+
src: image.url,
|
|
7867
|
+
alt: image.originalName,
|
|
7868
|
+
className: "w-full h-full object-cover",
|
|
7869
|
+
onError: (e) => {
|
|
7870
|
+
const target = e.target;
|
|
7871
|
+
target.style.display = "none";
|
|
7872
|
+
target.nextElementSibling?.classList.remove("hidden");
|
|
7795
7873
|
}
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "hidden w-full h-full bg-muted flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react20.Image, { className: "w-8 h-8 text-muted-foreground" }) })
|
|
7812
|
-
] }),
|
|
7813
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-1", children: [
|
|
7814
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs font-medium truncate", title: image.originalName, children: image.originalName }),
|
|
7815
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-muted-foreground", children: image.formattedSize }),
|
|
7816
|
-
image.width && image.height && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
7817
|
-
image.width,
|
|
7818
|
-
" \xD7 ",
|
|
7819
|
-
image.height
|
|
7820
|
-
] })
|
|
7821
|
-
] }),
|
|
7822
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "absolute top-1 left-1 w-5 h-5 bg-success rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react20.Check, { className: "w-3 h-3 text-success-foreground" }) })
|
|
7823
|
-
]
|
|
7824
|
-
},
|
|
7825
|
-
image.id
|
|
7826
|
-
)) })
|
|
7874
|
+
}
|
|
7875
|
+
),
|
|
7876
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "hidden w-full h-full bg-muted flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react19.Image, { className: "w-8 h-8 text-muted-foreground" }) })
|
|
7877
|
+
] }),
|
|
7878
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-1", children: [
|
|
7879
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs font-medium truncate", title: image.originalName, children: image.originalName }),
|
|
7880
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-muted-foreground", children: image.formattedSize }),
|
|
7881
|
+
image.width && image.height && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
7882
|
+
image.width,
|
|
7883
|
+
" \xD7 ",
|
|
7884
|
+
image.height
|
|
7885
|
+
] })
|
|
7886
|
+
] }),
|
|
7887
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "absolute top-1 left-1 w-5 h-5 bg-success rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react19.Check, { className: "w-3 h-3 text-success-foreground" }) })
|
|
7888
|
+
] }, image.id)) })
|
|
7827
7889
|
] })
|
|
7828
7890
|
] });
|
|
7829
7891
|
}
|
|
7830
7892
|
|
|
7831
7893
|
// ../../components/ui/Carousel.tsx
|
|
7832
7894
|
var React29 = __toESM(require("react"), 1);
|
|
7833
|
-
var
|
|
7834
|
-
var
|
|
7895
|
+
var import_lucide_react20 = require("lucide-react");
|
|
7896
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
7835
7897
|
function Carousel({
|
|
7836
7898
|
children,
|
|
7837
7899
|
autoScroll = true,
|
|
@@ -7989,7 +8051,7 @@ function Carousel({
|
|
|
7989
8051
|
};
|
|
7990
8052
|
};
|
|
7991
8053
|
const slideWidth = 100 / slidesToShow;
|
|
7992
|
-
return /* @__PURE__ */ (0,
|
|
8054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7993
8055
|
"div",
|
|
7994
8056
|
{
|
|
7995
8057
|
ref: carouselRef,
|
|
@@ -8001,8 +8063,8 @@ function Carousel({
|
|
|
8001
8063
|
"aria-roledescription": "carousel",
|
|
8002
8064
|
tabIndex: 0,
|
|
8003
8065
|
children: [
|
|
8004
|
-
showProgress && autoScroll && /* @__PURE__ */ (0,
|
|
8005
|
-
/* @__PURE__ */ (0,
|
|
8066
|
+
showProgress && autoScroll && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "absolute top-0 left-0 right-0 h-1 bg-muted z-20", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref: progressElRef, className: "h-full bg-primary", style: { width: "0%" } }) }),
|
|
8067
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8006
8068
|
"div",
|
|
8007
8069
|
{
|
|
8008
8070
|
className: cn("flex", isHorizontal ? "flex-row" : "flex-col", containerClassName),
|
|
@@ -8017,7 +8079,7 @@ function Carousel({
|
|
|
8017
8079
|
role: "group",
|
|
8018
8080
|
"aria-atomic": "false",
|
|
8019
8081
|
"aria-live": autoScroll ? "off" : "polite",
|
|
8020
|
-
children: React29.Children.map(children, (child, idx) => /* @__PURE__ */ (0,
|
|
8082
|
+
children: React29.Children.map(children, (child, idx) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8021
8083
|
"div",
|
|
8022
8084
|
{
|
|
8023
8085
|
className: cn(
|
|
@@ -8040,14 +8102,14 @@ function Carousel({
|
|
|
8040
8102
|
))
|
|
8041
8103
|
}
|
|
8042
8104
|
),
|
|
8043
|
-
showArrows && totalSlides > slidesToShow && /* @__PURE__ */ (0,
|
|
8044
|
-
/* @__PURE__ */ (0,
|
|
8105
|
+
showArrows && totalSlides > slidesToShow && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
8106
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8045
8107
|
Button_default,
|
|
8046
8108
|
{
|
|
8047
8109
|
onClick: scrollPrev,
|
|
8048
8110
|
variant: "ghost",
|
|
8049
8111
|
size: "icon",
|
|
8050
|
-
icon:
|
|
8112
|
+
icon: import_lucide_react20.ChevronLeft,
|
|
8051
8113
|
noHoverOverlay: true,
|
|
8052
8114
|
disabled: !loop && currentIndex === 0,
|
|
8053
8115
|
className: cn(
|
|
@@ -8057,13 +8119,13 @@ function Carousel({
|
|
|
8057
8119
|
"aria-label": "Previous slide"
|
|
8058
8120
|
}
|
|
8059
8121
|
),
|
|
8060
|
-
/* @__PURE__ */ (0,
|
|
8122
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8061
8123
|
Button_default,
|
|
8062
8124
|
{
|
|
8063
8125
|
onClick: scrollNext,
|
|
8064
8126
|
variant: "ghost",
|
|
8065
8127
|
size: "icon",
|
|
8066
|
-
icon:
|
|
8128
|
+
icon: import_lucide_react20.ChevronRight,
|
|
8067
8129
|
noHoverOverlay: true,
|
|
8068
8130
|
disabled: !loop && currentIndex >= maxIndex,
|
|
8069
8131
|
className: cn(
|
|
@@ -8074,7 +8136,7 @@ function Carousel({
|
|
|
8074
8136
|
}
|
|
8075
8137
|
)
|
|
8076
8138
|
] }),
|
|
8077
|
-
showDots && totalSlides > slidesToShow && /* @__PURE__ */ (0,
|
|
8139
|
+
showDots && totalSlides > slidesToShow && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8078
8140
|
"div",
|
|
8079
8141
|
{
|
|
8080
8142
|
className: cn(
|
|
@@ -8083,7 +8145,7 @@ function Carousel({
|
|
|
8083
8145
|
),
|
|
8084
8146
|
role: "tablist",
|
|
8085
8147
|
"aria-label": "Carousel pagination",
|
|
8086
|
-
children: Array.from({ length: maxIndex + 1 }, (_, idx) => /* @__PURE__ */ (0,
|
|
8148
|
+
children: Array.from({ length: maxIndex + 1 }, (_, idx) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8087
8149
|
"button",
|
|
8088
8150
|
{
|
|
8089
8151
|
onClick: () => scrollTo(idx),
|
|
@@ -8100,14 +8162,14 @@ function Carousel({
|
|
|
8100
8162
|
))
|
|
8101
8163
|
}
|
|
8102
8164
|
),
|
|
8103
|
-
showThumbnails && totalSlides > slidesToShow && /* @__PURE__ */ (0,
|
|
8165
|
+
showThumbnails && totalSlides > slidesToShow && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8104
8166
|
"div",
|
|
8105
8167
|
{
|
|
8106
8168
|
className: cn(
|
|
8107
8169
|
"absolute bottom-0 left-0 right-0 flex gap-2 p-4 bg-gradient-to-t from-black/50 to-transparent overflow-x-auto",
|
|
8108
8170
|
isHorizontal ? "flex-row" : "flex-col"
|
|
8109
8171
|
),
|
|
8110
|
-
children: React29.Children.map(children, (child, idx) => /* @__PURE__ */ (0,
|
|
8172
|
+
children: React29.Children.map(children, (child, idx) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8111
8173
|
"button",
|
|
8112
8174
|
{
|
|
8113
8175
|
onClick: () => scrollTo(idx),
|
|
@@ -8129,7 +8191,7 @@ function Carousel({
|
|
|
8129
8191
|
|
|
8130
8192
|
// ../../components/ui/FallingIcons.tsx
|
|
8131
8193
|
var import_react19 = __toESM(require("react"), 1);
|
|
8132
|
-
var
|
|
8194
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
8133
8195
|
var DEFAULT_COUNT = 24;
|
|
8134
8196
|
var DEFAULT_SPEED_RANGE = [6, 14];
|
|
8135
8197
|
var DEFAULT_SIZE_RANGE = [14, 28];
|
|
@@ -8224,8 +8286,8 @@ function FallingIcons({
|
|
|
8224
8286
|
filter: `drop-shadow(0 0 ${4 * intensity}px ${glowColor}) drop-shadow(0 0 ${8 * intensity}px ${glowColor})`
|
|
8225
8287
|
};
|
|
8226
8288
|
}, [glow, glowColor, glowIntensity]);
|
|
8227
|
-
const FallbackIcon = import_react19.default.useMemo(() => (props) => /* @__PURE__ */ (0,
|
|
8228
|
-
const TheIcon = imageUrl ? ({ className: imgClassName }) => /* @__PURE__ */ (0,
|
|
8289
|
+
const FallbackIcon = import_react19.default.useMemo(() => (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("circle", { cx: "12", cy: "12", r: "10" }) }), []);
|
|
8290
|
+
const TheIcon = imageUrl ? ({ className: imgClassName }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8229
8291
|
"img",
|
|
8230
8292
|
{
|
|
8231
8293
|
src: imageUrl,
|
|
@@ -8234,7 +8296,7 @@ function FallingIcons({
|
|
|
8234
8296
|
draggable: false
|
|
8235
8297
|
}
|
|
8236
8298
|
) : Icon || FallbackIcon;
|
|
8237
|
-
return /* @__PURE__ */ (0,
|
|
8299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
8238
8300
|
"div",
|
|
8239
8301
|
{
|
|
8240
8302
|
ref: containerRef,
|
|
@@ -8244,7 +8306,7 @@ function FallingIcons({
|
|
|
8244
8306
|
),
|
|
8245
8307
|
style: { zIndex },
|
|
8246
8308
|
children: [
|
|
8247
|
-
/* @__PURE__ */ (0,
|
|
8309
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("style", { children: `
|
|
8248
8310
|
@keyframes ${FallName} {
|
|
8249
8311
|
0% { transform: translate3d(0, -10vh, 0); opacity: 0; }
|
|
8250
8312
|
10% { opacity: 1; }
|
|
@@ -8277,7 +8339,7 @@ function FallingIcons({
|
|
|
8277
8339
|
}
|
|
8278
8340
|
}
|
|
8279
8341
|
` }),
|
|
8280
|
-
/* @__PURE__ */ (0,
|
|
8342
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8281
8343
|
"div",
|
|
8282
8344
|
{
|
|
8283
8345
|
className: cn(
|
|
@@ -8298,12 +8360,12 @@ function FallingIcons({
|
|
|
8298
8360
|
});
|
|
8299
8361
|
};
|
|
8300
8362
|
const trailParticles = trail ? Array.from({ length: Math.min(5, Math.max(1, trailLength)) }) : [];
|
|
8301
|
-
return /* @__PURE__ */ (0,
|
|
8363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react19.default.Fragment, { children: [
|
|
8302
8364
|
trail && trailParticles.map((_, trailIndex) => {
|
|
8303
8365
|
const trailDelay = p.delay - (trailIndex + 1) * 0.15;
|
|
8304
8366
|
const trailOpacity = 1 - (trailIndex + 1) * (1 / (trailParticles.length + 1));
|
|
8305
8367
|
const trailScale = 1 - (trailIndex + 1) * 0.15;
|
|
8306
|
-
return /* @__PURE__ */ (0,
|
|
8368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8307
8369
|
"span",
|
|
8308
8370
|
{
|
|
8309
8371
|
className: cn("absolute top-0 will-change-transform pointer-events-none uv-falling-particle", colorClassName),
|
|
@@ -8317,7 +8379,7 @@ function FallingIcons({
|
|
|
8317
8379
|
opacity: trailOpacity * 0.4,
|
|
8318
8380
|
["--fall"]: `${fallDist ?? (typeof window !== "undefined" ? window.innerHeight + 200 : 1200)}px`
|
|
8319
8381
|
},
|
|
8320
|
-
children: /* @__PURE__ */ (0,
|
|
8382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8321
8383
|
"span",
|
|
8322
8384
|
{
|
|
8323
8385
|
className: "inline-block uv-sway",
|
|
@@ -8329,7 +8391,7 @@ function FallingIcons({
|
|
|
8329
8391
|
animationIterationCount: "infinite",
|
|
8330
8392
|
["--amp"]: `${Math.round(p.driftAmp)}px`
|
|
8331
8393
|
},
|
|
8332
|
-
children: /* @__PURE__ */ (0,
|
|
8394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8333
8395
|
"span",
|
|
8334
8396
|
{
|
|
8335
8397
|
className: "block",
|
|
@@ -8338,7 +8400,7 @@ function FallingIcons({
|
|
|
8338
8400
|
height: p.size,
|
|
8339
8401
|
...glowStyles
|
|
8340
8402
|
},
|
|
8341
|
-
children: /* @__PURE__ */ (0,
|
|
8403
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TheIcon, { className: cn("w-full h-full text-primary/70", colorClassName) })
|
|
8342
8404
|
}
|
|
8343
8405
|
)
|
|
8344
8406
|
}
|
|
@@ -8347,7 +8409,7 @@ function FallingIcons({
|
|
|
8347
8409
|
`${p.key}-trail-${trailIndex}`
|
|
8348
8410
|
);
|
|
8349
8411
|
}),
|
|
8350
|
-
/* @__PURE__ */ (0,
|
|
8412
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8351
8413
|
"span",
|
|
8352
8414
|
{
|
|
8353
8415
|
className: cn("absolute top-0 will-change-transform pointer-events-auto uv-falling-particle", colorClassName),
|
|
@@ -8373,7 +8435,7 @@ function FallingIcons({
|
|
|
8373
8435
|
return next;
|
|
8374
8436
|
});
|
|
8375
8437
|
},
|
|
8376
|
-
children: /* @__PURE__ */ (0,
|
|
8438
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8377
8439
|
"span",
|
|
8378
8440
|
{
|
|
8379
8441
|
className: "inline-block uv-sway",
|
|
@@ -8385,7 +8447,7 @@ function FallingIcons({
|
|
|
8385
8447
|
animationIterationCount: "infinite",
|
|
8386
8448
|
["--amp"]: `${Math.round(p.driftAmp)}px`
|
|
8387
8449
|
},
|
|
8388
|
-
children: /* @__PURE__ */ (0,
|
|
8450
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8389
8451
|
"span",
|
|
8390
8452
|
{
|
|
8391
8453
|
className: cn(
|
|
@@ -8401,7 +8463,7 @@ function FallingIcons({
|
|
|
8401
8463
|
["--popName"]: PopName,
|
|
8402
8464
|
...glowStyles
|
|
8403
8465
|
},
|
|
8404
|
-
children: /* @__PURE__ */ (0,
|
|
8466
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TheIcon, { className: cn("w-full h-full text-primary/70", colorClassName) })
|
|
8405
8467
|
}
|
|
8406
8468
|
)
|
|
8407
8469
|
}
|
|
@@ -8419,8 +8481,8 @@ function FallingIcons({
|
|
|
8419
8481
|
|
|
8420
8482
|
// ../../components/ui/List.tsx
|
|
8421
8483
|
var React31 = __toESM(require("react"), 1);
|
|
8422
|
-
var
|
|
8423
|
-
var
|
|
8484
|
+
var import_lucide_react21 = require("lucide-react");
|
|
8485
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
8424
8486
|
var SIZE_STYLES2 = {
|
|
8425
8487
|
xs: { itemPad: "px-2 py-1.5", densePad: "px-2 py-1", label: "text-xs", desc: "text-[11px]", icon: "h-3.5 w-3.5", avatar: "h-6 w-6" },
|
|
8426
8488
|
sm: { itemPad: "px-3 py-2", densePad: "px-3 py-1.5", label: "text-[13px]", desc: "text-[12px]", icon: "h-4 w-4", avatar: "h-8 w-8" },
|
|
@@ -8436,11 +8498,11 @@ var BADGE_VARIANTS = {
|
|
|
8436
8498
|
};
|
|
8437
8499
|
var ListItemSkeleton = ({ size }) => {
|
|
8438
8500
|
const sz = SIZE_STYLES2[size];
|
|
8439
|
-
return /* @__PURE__ */ (0,
|
|
8440
|
-
/* @__PURE__ */ (0,
|
|
8441
|
-
/* @__PURE__ */ (0,
|
|
8442
|
-
/* @__PURE__ */ (0,
|
|
8443
|
-
/* @__PURE__ */ (0,
|
|
8501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("flex items-center gap-3 animate-pulse", sz.itemPad), children: [
|
|
8502
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: cn("rounded-full bg-muted shrink-0", sz.avatar) }),
|
|
8503
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
8504
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-4 bg-muted rounded w-3/4" }),
|
|
8505
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-3 bg-muted rounded w-1/2" })
|
|
8444
8506
|
] })
|
|
8445
8507
|
] });
|
|
8446
8508
|
};
|
|
@@ -8474,12 +8536,12 @@ var ListRoot = React31.forwardRef(
|
|
|
8474
8536
|
striped: "rounded-lg border border-border overflow-hidden"
|
|
8475
8537
|
};
|
|
8476
8538
|
if (loading2) {
|
|
8477
|
-
return /* @__PURE__ */ (0,
|
|
8539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, { ref, className: cn("group/list", variantClasses[variant], inset && "p-1.5 md:p-2", divided && "divide-y divide-border/60", className), ...rest, children: Array.from({ length: loadingCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ListItemSkeleton, { size }, i)) });
|
|
8478
8540
|
}
|
|
8479
8541
|
if (!hasChildren && emptyText) {
|
|
8480
|
-
return /* @__PURE__ */ (0,
|
|
8542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, { ref, className: cn("group/list", variantClasses[variant], inset && "p-1.5 md:p-2", className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "text-center py-8 text-muted-foreground text-sm", children: emptyText }) });
|
|
8481
8543
|
}
|
|
8482
|
-
return /* @__PURE__ */ (0,
|
|
8544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8483
8545
|
Comp,
|
|
8484
8546
|
{
|
|
8485
8547
|
ref,
|
|
@@ -8562,25 +8624,25 @@ var ListItem = React31.forwardRef(
|
|
|
8562
8624
|
}
|
|
8563
8625
|
}
|
|
8564
8626
|
} : {};
|
|
8565
|
-
const inner = /* @__PURE__ */ (0,
|
|
8566
|
-
/* @__PURE__ */ (0,
|
|
8627
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
8628
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8567
8629
|
"div",
|
|
8568
8630
|
{
|
|
8569
8631
|
className: cn("flex items-center gap-3", padding, "group/item relative"),
|
|
8570
8632
|
...headerProps,
|
|
8571
8633
|
children: [
|
|
8572
|
-
avatar && /* @__PURE__ */ (0,
|
|
8573
|
-
Left && !avatar && /* @__PURE__ */ (0,
|
|
8574
|
-
/* @__PURE__ */ (0,
|
|
8575
|
-
/* @__PURE__ */ (0,
|
|
8576
|
-
label && /* @__PURE__ */ (0,
|
|
8577
|
-
badge && /* @__PURE__ */ (0,
|
|
8634
|
+
avatar && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: cn("shrink-0", sz.avatar), children: typeof avatar === "string" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("img", { src: avatar, alt: "", className: cn("rounded-full object-cover", sz.avatar) }) : avatar }),
|
|
8635
|
+
Left && !avatar && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn("text-muted-foreground shrink-0", sz.icon), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Left, { className: cn(sz.icon) }) }),
|
|
8636
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
8637
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8638
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: cn(sz.label, "text-foreground font-medium truncate"), children: label }),
|
|
8639
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn("px-2 py-0.5 rounded-full text-[11px] font-medium shrink-0", BADGE_VARIANTS[badgeVariant]), children: badge })
|
|
8578
8640
|
] }),
|
|
8579
|
-
description && /* @__PURE__ */ (0,
|
|
8580
|
-
children && /* @__PURE__ */ (0,
|
|
8641
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: cn(sz.desc, "text-muted-foreground truncate mt-0.5"), children: description }),
|
|
8642
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "mt-1", children })
|
|
8581
8643
|
] }),
|
|
8582
|
-
action && /* @__PURE__ */ (0,
|
|
8583
|
-
collapsible ? /* @__PURE__ */ (0,
|
|
8644
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "opacity-0 group-hover/item:opacity-100 transition-opacity shrink-0", children: action }),
|
|
8645
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8584
8646
|
"span",
|
|
8585
8647
|
{
|
|
8586
8648
|
className: cn(
|
|
@@ -8588,13 +8650,13 @@ var ListItem = React31.forwardRef(
|
|
|
8588
8650
|
sz.icon,
|
|
8589
8651
|
isExpanded && "rotate-90"
|
|
8590
8652
|
),
|
|
8591
|
-
children: /* @__PURE__ */ (0,
|
|
8653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.ChevronRight, { className: cn(sz.icon) })
|
|
8592
8654
|
}
|
|
8593
|
-
) : Right && /* @__PURE__ */ (0,
|
|
8655
|
+
) : Right && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn("text-muted-foreground shrink-0", sz.icon), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Right, { className: cn(sz.icon) }) })
|
|
8594
8656
|
]
|
|
8595
8657
|
}
|
|
8596
8658
|
),
|
|
8597
|
-
collapsible && isExpanded && expandContent && /* @__PURE__ */ (0,
|
|
8659
|
+
collapsible && isExpanded && expandContent && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: cn("border-t border-border/50 bg-muted/20", padding, "pt-3"), children: expandContent })
|
|
8598
8660
|
] });
|
|
8599
8661
|
const baseCls = cn(
|
|
8600
8662
|
"relative w-full",
|
|
@@ -8604,10 +8666,10 @@ var ListItem = React31.forwardRef(
|
|
|
8604
8666
|
);
|
|
8605
8667
|
if (href) {
|
|
8606
8668
|
const A = as === "a" ? "a" : "a";
|
|
8607
|
-
return /* @__PURE__ */ (0,
|
|
8669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(A, { ref, href, className: cn(baseCls, "block"), ...rest, children: inner });
|
|
8608
8670
|
}
|
|
8609
8671
|
if (as === "button" && !collapsible) {
|
|
8610
|
-
return /* @__PURE__ */ (0,
|
|
8672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8611
8673
|
"button",
|
|
8612
8674
|
{
|
|
8613
8675
|
ref,
|
|
@@ -8619,7 +8681,7 @@ var ListItem = React31.forwardRef(
|
|
|
8619
8681
|
);
|
|
8620
8682
|
}
|
|
8621
8683
|
if (collapsible) {
|
|
8622
|
-
return /* @__PURE__ */ (0,
|
|
8684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8623
8685
|
"div",
|
|
8624
8686
|
{
|
|
8625
8687
|
ref,
|
|
@@ -8630,7 +8692,7 @@ var ListItem = React31.forwardRef(
|
|
|
8630
8692
|
);
|
|
8631
8693
|
}
|
|
8632
8694
|
const Comp = as;
|
|
8633
|
-
return /* @__PURE__ */ (0,
|
|
8695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, { ref, className: baseCls, ...rest, children: inner });
|
|
8634
8696
|
}
|
|
8635
8697
|
);
|
|
8636
8698
|
ListItem.displayName = "List.Item";
|
|
@@ -8640,7 +8702,7 @@ var List_default = List;
|
|
|
8640
8702
|
// ../../components/ui/Watermark.tsx
|
|
8641
8703
|
var React32 = __toESM(require("react"), 1);
|
|
8642
8704
|
var import_react_dom9 = require("react-dom");
|
|
8643
|
-
var
|
|
8705
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
8644
8706
|
var PRESETS2 = {
|
|
8645
8707
|
confidential: { text: "CONFIDENTIAL", color: "rgba(220, 38, 38, 0.15)", rotate: -22, fontSize: 16, fontWeight: "bold" },
|
|
8646
8708
|
draft: { text: "DRAFT", color: "rgba(59, 130, 246, 0.15)", rotate: -22, fontSize: 18, fontWeight: "bold" },
|
|
@@ -8895,7 +8957,7 @@ var Watermark = ({
|
|
|
8895
8957
|
if (dataURL) overlayStyle.backgroundImage = `url(${dataURL})`;
|
|
8896
8958
|
const animationClass = animate ? getAnimationClass(animationVariant, visible) : "";
|
|
8897
8959
|
const blurClass = blur ? `backdrop-blur-[${blurAmount}px]` : "";
|
|
8898
|
-
const overlay = /* @__PURE__ */ (0,
|
|
8960
|
+
const overlay = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
8899
8961
|
"div",
|
|
8900
8962
|
{
|
|
8901
8963
|
role: interactive ? "button" : void 0,
|
|
@@ -8919,12 +8981,12 @@ var Watermark = ({
|
|
|
8919
8981
|
}
|
|
8920
8982
|
);
|
|
8921
8983
|
if (fullPage) {
|
|
8922
|
-
return /* @__PURE__ */ (0,
|
|
8984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
8923
8985
|
children,
|
|
8924
8986
|
typeof window !== "undefined" ? (0, import_react_dom9.createPortal)(overlay, document.body) : null
|
|
8925
8987
|
] });
|
|
8926
8988
|
}
|
|
8927
|
-
return /* @__PURE__ */ (0,
|
|
8989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("relative", className), style, ...rest, children: [
|
|
8928
8990
|
children,
|
|
8929
8991
|
overlay
|
|
8930
8992
|
] });
|
|
@@ -8933,8 +8995,8 @@ var Watermark_default = Watermark;
|
|
|
8933
8995
|
|
|
8934
8996
|
// ../../components/ui/Timeline.tsx
|
|
8935
8997
|
var React33 = __toESM(require("react"), 1);
|
|
8936
|
-
var
|
|
8937
|
-
var
|
|
8998
|
+
var import_lucide_react22 = require("lucide-react");
|
|
8999
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
8938
9000
|
var SIZE_STYLE = {
|
|
8939
9001
|
sm: { dot: "h-2.5 w-2.5", iconDot: "h-6 w-6", padY: "py-3", densePadY: "py-2", title: "text-sm", desc: "text-xs", time: "text-[11px]", icon: "h-3.5 w-3.5" },
|
|
8940
9002
|
md: { dot: "h-3 w-3", iconDot: "h-8 w-8", padY: "py-4", densePadY: "py-2.5", title: "text-base", desc: "text-sm", time: "text-xs", icon: "h-4 w-4" },
|
|
@@ -8959,22 +9021,22 @@ var Marker = ({ index, last, size, color, status = "default", lineColor, lineSty
|
|
|
8959
9021
|
const sz = SIZE_STYLE[size];
|
|
8960
9022
|
const dotColor = color ? `background:${color}` : void 0;
|
|
8961
9023
|
const cls = color ? void 0 : STATUS_COLOR[status];
|
|
8962
|
-
return /* @__PURE__ */ (0,
|
|
8963
|
-
dot ? /* @__PURE__ */ (0,
|
|
9024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
9025
|
+
dot ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex items-center justify-center", children: dot }) : Icon ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8964
9026
|
"div",
|
|
8965
9027
|
{
|
|
8966
9028
|
className: cn("rounded-full ring-2 ring-background flex items-center justify-center", sz.iconDot, cls, active && "ring-primary/40 ring-4"),
|
|
8967
9029
|
style: dotColor ? { background: color } : void 0,
|
|
8968
|
-
children: /* @__PURE__ */ (0,
|
|
9030
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { className: cn("text-white", sz.icon) })
|
|
8969
9031
|
}
|
|
8970
|
-
) : /* @__PURE__ */ (0,
|
|
9032
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8971
9033
|
"div",
|
|
8972
9034
|
{
|
|
8973
9035
|
className: cn("rounded-full ring-2 ring-background", sz.dot, cls, active && "ring-primary/40 ring-4 scale-125"),
|
|
8974
9036
|
style: dotColor ? { background: color } : void 0
|
|
8975
9037
|
}
|
|
8976
9038
|
),
|
|
8977
|
-
!last && showLine && /* @__PURE__ */ (0,
|
|
9039
|
+
!last && showLine && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8978
9040
|
"div",
|
|
8979
9041
|
{
|
|
8980
9042
|
className: cn("flex-1 border-l-2", LINE_STYLE_MAP[lineStyle]),
|
|
@@ -9000,8 +9062,8 @@ var TimelineRoot = React33.forwardRef(
|
|
|
9000
9062
|
children,
|
|
9001
9063
|
...rest
|
|
9002
9064
|
}, ref) => {
|
|
9003
|
-
const content = items ? items.map((it, i) => /* @__PURE__ */ (0,
|
|
9004
|
-
return /* @__PURE__ */ (0,
|
|
9065
|
+
const content = items ? items.map((it, i) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TimelineItem, { ...it, className: cn(itemClassName, it.className), "data-index": i, "data-last": i === (items?.length ?? 0) - 1 }, i)) : children;
|
|
9066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TimelineContext.Provider, { value: { align, variant, size, mode, lineColor, lineStyle, itemClassName, animate, dense, showLine }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9005
9067
|
"div",
|
|
9006
9068
|
{
|
|
9007
9069
|
ref,
|
|
@@ -9012,7 +9074,7 @@ var TimelineRoot = React33.forwardRef(
|
|
|
9012
9074
|
className
|
|
9013
9075
|
),
|
|
9014
9076
|
...rest,
|
|
9015
|
-
children: mode === "vertical" ? /* @__PURE__ */ (0,
|
|
9077
|
+
children: mode === "vertical" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "space-y-0", children: content }) : content
|
|
9016
9078
|
}
|
|
9017
9079
|
) });
|
|
9018
9080
|
}
|
|
@@ -9060,39 +9122,39 @@ var TimelineItem = React33.forwardRef(
|
|
|
9060
9122
|
modern: "rounded-lg bg-gradient-to-r from-card to-muted/20 border border-border/50 px-5 py-4 backdrop-blur-sm",
|
|
9061
9123
|
gradient: "rounded-xl bg-gradient-to-br from-primary/10 via-card to-accent/10 border border-primary/20 px-5 py-4 shadow-lg"
|
|
9062
9124
|
};
|
|
9063
|
-
const contentBox = /* @__PURE__ */ (0,
|
|
9064
|
-
/* @__PURE__ */ (0,
|
|
9065
|
-
/* @__PURE__ */ (0,
|
|
9066
|
-
title && /* @__PURE__ */ (0,
|
|
9067
|
-
/* @__PURE__ */ (0,
|
|
9068
|
-
badge && /* @__PURE__ */ (0,
|
|
9125
|
+
const contentBox = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("min-w-0 flex-1", variantClasses[ctx.variant]), children: [
|
|
9126
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
9127
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
9128
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9129
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("font-semibold text-foreground", sz.title), children: title }),
|
|
9130
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "px-2 py-0.5 rounded-full text-[10px] font-medium bg-primary/10 text-primary", children: badge })
|
|
9069
9131
|
] }),
|
|
9070
|
-
description && /* @__PURE__ */ (0,
|
|
9071
|
-
children && /* @__PURE__ */ (0,
|
|
9132
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("text-muted-foreground mt-1", sz.desc), children: description }),
|
|
9133
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "mt-2", children })
|
|
9072
9134
|
] }),
|
|
9073
|
-
collapsible && /* @__PURE__ */ (0,
|
|
9135
|
+
collapsible && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
9074
9136
|
"button",
|
|
9075
9137
|
{
|
|
9076
9138
|
type: "button",
|
|
9077
9139
|
onClick: toggleExpanded,
|
|
9078
9140
|
className: cn("text-muted-foreground hover:text-foreground transition-transform p-1", isExpanded && "rotate-180"),
|
|
9079
|
-
children: /* @__PURE__ */ (0,
|
|
9141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.ChevronDown, { className: "h-4 w-4" })
|
|
9080
9142
|
}
|
|
9081
9143
|
)
|
|
9082
9144
|
] }),
|
|
9083
|
-
time && /* @__PURE__ */ (0,
|
|
9084
|
-
collapsible && isExpanded && expandContent && /* @__PURE__ */ (0,
|
|
9145
|
+
time && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("mt-2 text-muted-foreground flex items-center gap-1", sz.time), children: time }),
|
|
9146
|
+
collapsible && isExpanded && expandContent && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "mt-3 pt-3 border-t border-border/50 text-sm", children: expandContent })
|
|
9085
9147
|
] });
|
|
9086
9148
|
const markerWidth = Icon || dot ? "w-auto" : "w-6";
|
|
9087
|
-
const leftSide = /* @__PURE__ */ (0,
|
|
9088
|
-
/* @__PURE__ */ (0,
|
|
9089
|
-
/* @__PURE__ */ (0,
|
|
9149
|
+
const leftSide = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("flex items-stretch gap-4", padding, ctx.animate && "animate-in slide-in-from-left duration-500"), style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 }, children: [
|
|
9150
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("flex-shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Marker, { index: idx ?? 0, last: isLast, size: ctx.size, color, status, lineColor: ctx.lineColor, lineStyle: ctx.lineStyle, active, dot, icon: Icon, showLine: ctx.showLine }) }),
|
|
9151
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1", children: contentBox })
|
|
9090
9152
|
] });
|
|
9091
|
-
const rightSide = /* @__PURE__ */ (0,
|
|
9092
|
-
/* @__PURE__ */ (0,
|
|
9093
|
-
/* @__PURE__ */ (0,
|
|
9153
|
+
const rightSide = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("flex items-stretch gap-4", padding, ctx.animate && "animate-in slide-in-from-right duration-500"), style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 }, children: [
|
|
9154
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1 flex justify-end", children: contentBox }),
|
|
9155
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("flex-shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Marker, { index: idx ?? 0, last: isLast, size: ctx.size, color, status, lineColor: ctx.lineColor, lineStyle: ctx.lineStyle, active, dot, icon: Icon, showLine: ctx.showLine }) })
|
|
9094
9156
|
] });
|
|
9095
|
-
const horizontalItem = /* @__PURE__ */ (0,
|
|
9157
|
+
const horizontalItem = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
9096
9158
|
"div",
|
|
9097
9159
|
{
|
|
9098
9160
|
className: cn(
|
|
@@ -9101,19 +9163,19 @@ var TimelineItem = React33.forwardRef(
|
|
|
9101
9163
|
),
|
|
9102
9164
|
style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 },
|
|
9103
9165
|
children: [
|
|
9104
|
-
/* @__PURE__ */ (0,
|
|
9105
|
-
!isLast && ctx.showLine && /* @__PURE__ */ (0,
|
|
9166
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Marker, { index: idx ?? 0, last: isLast, size: ctx.size, color, status, lineColor: ctx.lineColor, lineStyle: ctx.lineStyle, active, dot, icon: Icon, showLine: false }),
|
|
9167
|
+
!isLast && ctx.showLine && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("h-px w-full border-t-2", LINE_STYLE_MAP[ctx.lineStyle]), style: { borderColor: ctx.lineColor || "hsl(var(--border))" } }),
|
|
9106
9168
|
contentBox
|
|
9107
9169
|
]
|
|
9108
9170
|
}
|
|
9109
9171
|
);
|
|
9110
9172
|
if (ctx.mode === "horizontal") {
|
|
9111
|
-
return /* @__PURE__ */ (0,
|
|
9173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { ref, className: cn("relative", className), ...rest, children: horizontalItem });
|
|
9112
9174
|
}
|
|
9113
9175
|
let row = leftSide;
|
|
9114
9176
|
if (ctx.align === "right") row = rightSide;
|
|
9115
9177
|
if (ctx.align === "alternate") row = (idx ?? 0) % 2 === 0 ? leftSide : rightSide;
|
|
9116
|
-
return /* @__PURE__ */ (0,
|
|
9178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { ref, className: cn("relative", className), ...rest, children: row });
|
|
9117
9179
|
}
|
|
9118
9180
|
);
|
|
9119
9181
|
TimelineItem.displayName = "Timeline.Item";
|
|
@@ -9122,8 +9184,8 @@ var Timeline_default = Timeline;
|
|
|
9122
9184
|
|
|
9123
9185
|
// ../../components/ui/ColorPicker.tsx
|
|
9124
9186
|
var React34 = __toESM(require("react"), 1);
|
|
9125
|
-
var
|
|
9126
|
-
var
|
|
9187
|
+
var import_lucide_react23 = require("lucide-react");
|
|
9188
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
9127
9189
|
var clamp = (n, min, max) => Math.max(min, Math.min(max, n));
|
|
9128
9190
|
function hexToRgb(hex) {
|
|
9129
9191
|
const str = hex.replace(/^#/, "").trim();
|
|
@@ -9282,7 +9344,7 @@ var Swatch = ({
|
|
|
9282
9344
|
md: "h-6 w-6",
|
|
9283
9345
|
lg: "h-8 w-8"
|
|
9284
9346
|
};
|
|
9285
|
-
return /* @__PURE__ */ (0,
|
|
9347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9286
9348
|
"button",
|
|
9287
9349
|
{
|
|
9288
9350
|
type: "button",
|
|
@@ -9406,7 +9468,7 @@ function ColorPicker({
|
|
|
9406
9468
|
lg: "h-12 text-base"
|
|
9407
9469
|
};
|
|
9408
9470
|
const swatchSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "md";
|
|
9409
|
-
const trigger = /* @__PURE__ */ (0,
|
|
9471
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
9410
9472
|
"button",
|
|
9411
9473
|
{
|
|
9412
9474
|
type: "button",
|
|
@@ -9420,8 +9482,8 @@ function ColorPicker({
|
|
|
9420
9482
|
),
|
|
9421
9483
|
"aria-label": "Open color picker",
|
|
9422
9484
|
children: [
|
|
9423
|
-
/* @__PURE__ */ (0,
|
|
9424
|
-
/* @__PURE__ */ (0,
|
|
9485
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9486
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9425
9487
|
"span",
|
|
9426
9488
|
{
|
|
9427
9489
|
className: cn(
|
|
@@ -9431,9 +9493,9 @@ function ColorPicker({
|
|
|
9431
9493
|
style: { backgroundColor: withAlpha ? `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})` : hexForInput }
|
|
9432
9494
|
}
|
|
9433
9495
|
),
|
|
9434
|
-
/* @__PURE__ */ (0,
|
|
9496
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "font-mono text-muted-foreground", children: text })
|
|
9435
9497
|
] }),
|
|
9436
|
-
/* @__PURE__ */ (0,
|
|
9498
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Pipette, { className: cn(size === "sm" ? "w-3.5 h-3.5" : size === "lg" ? "w-5 h-5" : "w-4 h-4", "text-muted-foreground") })
|
|
9437
9499
|
]
|
|
9438
9500
|
}
|
|
9439
9501
|
);
|
|
@@ -9443,7 +9505,7 @@ function ColorPicker({
|
|
|
9443
9505
|
default: 320,
|
|
9444
9506
|
full: 360
|
|
9445
9507
|
};
|
|
9446
|
-
return /* @__PURE__ */ (0,
|
|
9508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: cn("inline-block w-full", className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9447
9509
|
Popover,
|
|
9448
9510
|
{
|
|
9449
9511
|
trigger,
|
|
@@ -9453,22 +9515,22 @@ function ColorPicker({
|
|
|
9453
9515
|
matchTriggerWidth: variant === "minimal",
|
|
9454
9516
|
contentWidth: contentWidthByVariant[variant],
|
|
9455
9517
|
contentClassName: cn("p-3 rounded-lg border border-border bg-card shadow-lg", contentClassName),
|
|
9456
|
-
children: /* @__PURE__ */ (0,
|
|
9457
|
-
variant !== "minimal" && /* @__PURE__ */ (0,
|
|
9458
|
-
/* @__PURE__ */ (0,
|
|
9459
|
-
/* @__PURE__ */ (0,
|
|
9518
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "space-y-3", children: [
|
|
9519
|
+
variant !== "minimal" && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9520
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("input", { type: "color", value: hexForInput, onChange: handleNativeChange, className: "h-9 w-9 rounded-md cursor-pointer border border-border" }),
|
|
9521
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
9460
9522
|
"button",
|
|
9461
9523
|
{
|
|
9462
9524
|
type: "button",
|
|
9463
9525
|
onClick: tryEyedropper,
|
|
9464
9526
|
className: cn("h-9 px-3 rounded-md border border-border text-xs hover:bg-accent/10 transition-colors flex items-center gap-1.5"),
|
|
9465
9527
|
children: [
|
|
9466
|
-
/* @__PURE__ */ (0,
|
|
9528
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Pipette, { className: "w-3.5 h-3.5" }),
|
|
9467
9529
|
variant === "full" && "Pick"
|
|
9468
9530
|
]
|
|
9469
9531
|
}
|
|
9470
9532
|
),
|
|
9471
|
-
copyable && /* @__PURE__ */ (0,
|
|
9533
|
+
copyable && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
9472
9534
|
"button",
|
|
9473
9535
|
{
|
|
9474
9536
|
type: "button",
|
|
@@ -9478,26 +9540,26 @@ function ColorPicker({
|
|
|
9478
9540
|
copied && "bg-green-500/10 border-green-500/30"
|
|
9479
9541
|
),
|
|
9480
9542
|
children: [
|
|
9481
|
-
copied ? /* @__PURE__ */ (0,
|
|
9543
|
+
copied ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Check, { className: "w-3.5 h-3.5 text-green-600" }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Copy, { className: "w-3.5 h-3.5" }),
|
|
9482
9544
|
variant === "full" && (copied ? "Copied!" : "Copy")
|
|
9483
9545
|
]
|
|
9484
9546
|
}
|
|
9485
9547
|
),
|
|
9486
|
-
clearable && /* @__PURE__ */ (0,
|
|
9548
|
+
clearable && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
9487
9549
|
"button",
|
|
9488
9550
|
{
|
|
9489
9551
|
type: "button",
|
|
9490
9552
|
onClick: clear,
|
|
9491
9553
|
className: "ml-auto h-9 px-2 rounded-md border border-border text-xs hover:bg-destructive/10 transition-colors flex items-center gap-1",
|
|
9492
9554
|
children: [
|
|
9493
|
-
/* @__PURE__ */ (0,
|
|
9555
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.X, { className: "w-3.5 h-3.5" }),
|
|
9494
9556
|
variant === "full" && "Clear"
|
|
9495
9557
|
]
|
|
9496
9558
|
}
|
|
9497
9559
|
)
|
|
9498
9560
|
] }),
|
|
9499
|
-
/* @__PURE__ */ (0,
|
|
9500
|
-
/* @__PURE__ */ (0,
|
|
9561
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9562
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9501
9563
|
Input_default,
|
|
9502
9564
|
{
|
|
9503
9565
|
value: text,
|
|
@@ -9508,7 +9570,7 @@ function ColorPicker({
|
|
|
9508
9570
|
className: "flex-1"
|
|
9509
9571
|
}
|
|
9510
9572
|
),
|
|
9511
|
-
variant === "minimal" && copyable && /* @__PURE__ */ (0,
|
|
9573
|
+
variant === "minimal" && copyable && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9512
9574
|
"button",
|
|
9513
9575
|
{
|
|
9514
9576
|
type: "button",
|
|
@@ -9517,17 +9579,17 @@ function ColorPicker({
|
|
|
9517
9579
|
"h-9 w-9 rounded-md border border-border hover:bg-accent/10 transition-colors flex items-center justify-center",
|
|
9518
9580
|
copied && "bg-green-500/10 border-green-500/30"
|
|
9519
9581
|
),
|
|
9520
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
9582
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Check, { className: "w-3.5 h-3.5 text-green-600" }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Copy, { className: "w-3.5 h-3.5" })
|
|
9521
9583
|
}
|
|
9522
9584
|
)
|
|
9523
9585
|
] }),
|
|
9524
|
-
withAlpha && /* @__PURE__ */ (0,
|
|
9525
|
-
variant !== "minimal" && /* @__PURE__ */ (0,
|
|
9526
|
-
/* @__PURE__ */ (0,
|
|
9527
|
-
/* @__PURE__ */ (0,
|
|
9586
|
+
withAlpha && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "pt-1", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Slider, { min: 0, max: 100, step: 1, value: alphaPct, onChange: (v) => setAlpha(v), label: "Alpha", showValue: true, formatValue: (v) => `${v}%`, size: "sm" }) }),
|
|
9587
|
+
variant !== "minimal" && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
9588
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1.5", children: [
|
|
9589
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Palette, { className: "w-3.5 h-3.5" }),
|
|
9528
9590
|
" Presets"
|
|
9529
9591
|
] }),
|
|
9530
|
-
/* @__PURE__ */ (0,
|
|
9592
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "grid grid-cols-8 gap-2", children: swatches.map((c) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9531
9593
|
Swatch,
|
|
9532
9594
|
{
|
|
9533
9595
|
color: c,
|
|
@@ -9543,12 +9605,12 @@ function ColorPicker({
|
|
|
9543
9605
|
c
|
|
9544
9606
|
)) })
|
|
9545
9607
|
] }),
|
|
9546
|
-
showRecent && recentColors.length > 0 && /* @__PURE__ */ (0,
|
|
9547
|
-
/* @__PURE__ */ (0,
|
|
9548
|
-
/* @__PURE__ */ (0,
|
|
9608
|
+
showRecent && recentColors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
9609
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1.5", children: [
|
|
9610
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.History, { className: "w-3.5 h-3.5" }),
|
|
9549
9611
|
" Recent"
|
|
9550
9612
|
] }),
|
|
9551
|
-
/* @__PURE__ */ (0,
|
|
9613
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex gap-2 flex-wrap", children: recentColors.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9552
9614
|
Swatch,
|
|
9553
9615
|
{
|
|
9554
9616
|
color: c,
|
|
@@ -9564,12 +9626,12 @@ function ColorPicker({
|
|
|
9564
9626
|
`${c}-${i}`
|
|
9565
9627
|
)) })
|
|
9566
9628
|
] }),
|
|
9567
|
-
showHarmony && harmony && variant !== "minimal" && /* @__PURE__ */ (0,
|
|
9568
|
-
/* @__PURE__ */ (0,
|
|
9569
|
-
/* @__PURE__ */ (0,
|
|
9570
|
-
/* @__PURE__ */ (0,
|
|
9571
|
-
/* @__PURE__ */ (0,
|
|
9572
|
-
/* @__PURE__ */ (0,
|
|
9629
|
+
showHarmony && harmony && variant !== "minimal" && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
9630
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "text-xs font-medium text-muted-foreground mb-2", children: "Harmony" }),
|
|
9631
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "space-y-2", children: [
|
|
9632
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9633
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs text-muted-foreground w-24", children: "Complementary" }),
|
|
9634
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9573
9635
|
Swatch,
|
|
9574
9636
|
{
|
|
9575
9637
|
color: harmony.complementary,
|
|
@@ -9583,11 +9645,11 @@ function ColorPicker({
|
|
|
9583
9645
|
}
|
|
9584
9646
|
}
|
|
9585
9647
|
),
|
|
9586
|
-
/* @__PURE__ */ (0,
|
|
9648
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs font-mono text-muted-foreground", children: harmony.complementary })
|
|
9587
9649
|
] }),
|
|
9588
|
-
/* @__PURE__ */ (0,
|
|
9589
|
-
/* @__PURE__ */ (0,
|
|
9590
|
-
/* @__PURE__ */ (0,
|
|
9650
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9651
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs text-muted-foreground w-24", children: "Triadic" }),
|
|
9652
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex gap-2", children: harmony.triadic.map((c) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9591
9653
|
Swatch,
|
|
9592
9654
|
{
|
|
9593
9655
|
color: c,
|
|
@@ -9603,9 +9665,9 @@ function ColorPicker({
|
|
|
9603
9665
|
c
|
|
9604
9666
|
)) })
|
|
9605
9667
|
] }),
|
|
9606
|
-
/* @__PURE__ */ (0,
|
|
9607
|
-
/* @__PURE__ */ (0,
|
|
9608
|
-
/* @__PURE__ */ (0,
|
|
9668
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9669
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs text-muted-foreground w-24", children: "Analogous" }),
|
|
9670
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex gap-2", children: harmony.analogous.map((c) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9609
9671
|
Swatch,
|
|
9610
9672
|
{
|
|
9611
9673
|
color: c,
|
|
@@ -9630,7 +9692,7 @@ function ColorPicker({
|
|
|
9630
9692
|
|
|
9631
9693
|
// ../../components/ui/Grid.tsx
|
|
9632
9694
|
var import_react20 = __toESM(require("react"), 1);
|
|
9633
|
-
var
|
|
9695
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
9634
9696
|
var BP_MIN = {
|
|
9635
9697
|
sm: 640,
|
|
9636
9698
|
md: 768,
|
|
@@ -9737,7 +9799,7 @@ var GridRoot = import_react20.default.forwardRef(
|
|
|
9737
9799
|
css += `}}`;
|
|
9738
9800
|
});
|
|
9739
9801
|
}
|
|
9740
|
-
return /* @__PURE__ */ (0,
|
|
9802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
9741
9803
|
"div",
|
|
9742
9804
|
{
|
|
9743
9805
|
ref,
|
|
@@ -9750,7 +9812,7 @@ var GridRoot = import_react20.default.forwardRef(
|
|
|
9750
9812
|
style,
|
|
9751
9813
|
...rest,
|
|
9752
9814
|
children: [
|
|
9753
|
-
/* @__PURE__ */ (0,
|
|
9815
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("style", { dangerouslySetInnerHTML: { __html: css } }),
|
|
9754
9816
|
children
|
|
9755
9817
|
]
|
|
9756
9818
|
}
|
|
@@ -9792,8 +9854,8 @@ var GridItem = import_react20.default.forwardRef(
|
|
|
9792
9854
|
st.opacity = 0;
|
|
9793
9855
|
st.animation = `uvGridItemFadeIn 0.5s ease-out forwards`;
|
|
9794
9856
|
}
|
|
9795
|
-
return /* @__PURE__ */ (0,
|
|
9796
|
-
animationDelay != null && /* @__PURE__ */ (0,
|
|
9857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
9858
|
+
animationDelay != null && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
9797
9859
|
"style",
|
|
9798
9860
|
{
|
|
9799
9861
|
dangerouslySetInnerHTML: {
|
|
@@ -9801,7 +9863,7 @@ var GridItem = import_react20.default.forwardRef(
|
|
|
9801
9863
|
}
|
|
9802
9864
|
}
|
|
9803
9865
|
),
|
|
9804
|
-
/* @__PURE__ */ (0,
|
|
9866
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
9805
9867
|
"div",
|
|
9806
9868
|
{
|
|
9807
9869
|
ref,
|
|
@@ -9822,21 +9884,21 @@ var Grid_default = Grid;
|
|
|
9822
9884
|
|
|
9823
9885
|
// ../../components/ui/ClientOnly.tsx
|
|
9824
9886
|
var import_react21 = require("react");
|
|
9825
|
-
var
|
|
9887
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
9826
9888
|
function ClientOnly({ children, fallback = null }) {
|
|
9827
9889
|
const [hasMounted, setHasMounted] = (0, import_react21.useState)(false);
|
|
9828
9890
|
(0, import_react21.useEffect)(() => {
|
|
9829
9891
|
setHasMounted(true);
|
|
9830
9892
|
}, []);
|
|
9831
9893
|
if (!hasMounted) {
|
|
9832
|
-
return /* @__PURE__ */ (0,
|
|
9894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_jsx_runtime43.Fragment, { children: fallback });
|
|
9833
9895
|
}
|
|
9834
|
-
return /* @__PURE__ */ (0,
|
|
9896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_jsx_runtime43.Fragment, { children });
|
|
9835
9897
|
}
|
|
9836
9898
|
|
|
9837
9899
|
// ../../components/ui/Loading.tsx
|
|
9838
|
-
var
|
|
9839
|
-
var
|
|
9900
|
+
var import_lucide_react24 = require("lucide-react");
|
|
9901
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
9840
9902
|
var LoadingSpinner = ({
|
|
9841
9903
|
size = "md",
|
|
9842
9904
|
className,
|
|
@@ -9852,8 +9914,8 @@ var LoadingSpinner = ({
|
|
|
9852
9914
|
foreground: "text-foreground",
|
|
9853
9915
|
muted: "text-muted-foreground"
|
|
9854
9916
|
};
|
|
9855
|
-
return /* @__PURE__ */ (0,
|
|
9856
|
-
|
|
9917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9918
|
+
import_lucide_react24.Activity,
|
|
9857
9919
|
{
|
|
9858
9920
|
className: cn(
|
|
9859
9921
|
"animate-spin",
|
|
@@ -9873,7 +9935,7 @@ var LoadingDots = ({
|
|
|
9873
9935
|
foreground: "bg-foreground",
|
|
9874
9936
|
muted: "bg-muted-foreground"
|
|
9875
9937
|
};
|
|
9876
|
-
return /* @__PURE__ */ (0,
|
|
9938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cn("flex items-center space-x-1", className), children: [0, 1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9877
9939
|
"div",
|
|
9878
9940
|
{
|
|
9879
9941
|
className: cn(
|
|
@@ -9895,7 +9957,7 @@ var LoadingBar = ({
|
|
|
9895
9957
|
label
|
|
9896
9958
|
}) => {
|
|
9897
9959
|
const pct = progress ? Math.min(Math.max(progress, 0), 100) : void 0;
|
|
9898
|
-
return /* @__PURE__ */ (0,
|
|
9960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9899
9961
|
"div",
|
|
9900
9962
|
{
|
|
9901
9963
|
className: cn("w-full bg-muted rounded-full h-2", className),
|
|
@@ -9904,7 +9966,7 @@ var LoadingBar = ({
|
|
|
9904
9966
|
"aria-valuemax": pct === void 0 ? void 0 : 100,
|
|
9905
9967
|
"aria-valuenow": pct === void 0 ? void 0 : Math.round(pct),
|
|
9906
9968
|
"aria-label": label || "Loading",
|
|
9907
|
-
children: /* @__PURE__ */ (0,
|
|
9969
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9908
9970
|
"div",
|
|
9909
9971
|
{
|
|
9910
9972
|
className: cn(
|
|
@@ -9922,9 +9984,9 @@ var LoadingBar = ({
|
|
|
9922
9984
|
|
|
9923
9985
|
// ../../components/ui/Table.tsx
|
|
9924
9986
|
var import_react22 = __toESM(require("react"), 1);
|
|
9925
|
-
var
|
|
9987
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
9926
9988
|
var Table = import_react22.default.forwardRef(
|
|
9927
|
-
({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0,
|
|
9989
|
+
({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9928
9990
|
"div",
|
|
9929
9991
|
{
|
|
9930
9992
|
className: cn(
|
|
@@ -9934,7 +9996,7 @@ var Table = import_react22.default.forwardRef(
|
|
|
9934
9996
|
"backdrop-blur-sm transition-all duration-300",
|
|
9935
9997
|
containerClassName
|
|
9936
9998
|
),
|
|
9937
|
-
children: /* @__PURE__ */ (0,
|
|
9999
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9938
10000
|
"table",
|
|
9939
10001
|
{
|
|
9940
10002
|
ref,
|
|
@@ -9947,7 +10009,7 @@ var Table = import_react22.default.forwardRef(
|
|
|
9947
10009
|
);
|
|
9948
10010
|
Table.displayName = "Table";
|
|
9949
10011
|
var TableHeader = import_react22.default.forwardRef(
|
|
9950
|
-
({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10012
|
+
({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
9951
10013
|
"thead",
|
|
9952
10014
|
{
|
|
9953
10015
|
ref,
|
|
@@ -9965,7 +10027,7 @@ var TableHeader = import_react22.default.forwardRef(
|
|
|
9965
10027
|
)
|
|
9966
10028
|
);
|
|
9967
10029
|
TableHeader.displayName = "TableHeader";
|
|
9968
|
-
var TableBody = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10030
|
+
var TableBody = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9969
10031
|
"tbody",
|
|
9970
10032
|
{
|
|
9971
10033
|
ref,
|
|
@@ -9974,7 +10036,7 @@ var TableBody = import_react22.default.forwardRef(({ className, ...props }, ref)
|
|
|
9974
10036
|
}
|
|
9975
10037
|
));
|
|
9976
10038
|
TableBody.displayName = "TableBody";
|
|
9977
|
-
var TableFooter = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10039
|
+
var TableFooter = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9978
10040
|
"tfoot",
|
|
9979
10041
|
{
|
|
9980
10042
|
ref,
|
|
@@ -9986,7 +10048,7 @@ var TableFooter = import_react22.default.forwardRef(({ className, ...props }, re
|
|
|
9986
10048
|
}
|
|
9987
10049
|
));
|
|
9988
10050
|
TableFooter.displayName = "TableFooter";
|
|
9989
|
-
var TableRow = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10051
|
+
var TableRow = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9990
10052
|
"tr",
|
|
9991
10053
|
{
|
|
9992
10054
|
ref,
|
|
@@ -10000,7 +10062,7 @@ var TableRow = import_react22.default.forwardRef(({ className, ...props }, ref)
|
|
|
10000
10062
|
}
|
|
10001
10063
|
));
|
|
10002
10064
|
TableRow.displayName = "TableRow";
|
|
10003
|
-
var TableHead = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10065
|
+
var TableHead = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
10004
10066
|
"th",
|
|
10005
10067
|
{
|
|
10006
10068
|
ref,
|
|
@@ -10012,7 +10074,7 @@ var TableHead = import_react22.default.forwardRef(({ className, ...props }, ref)
|
|
|
10012
10074
|
}
|
|
10013
10075
|
));
|
|
10014
10076
|
TableHead.displayName = "TableHead";
|
|
10015
|
-
var TableCell = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10077
|
+
var TableCell = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
10016
10078
|
"td",
|
|
10017
10079
|
{
|
|
10018
10080
|
ref,
|
|
@@ -10021,7 +10083,7 @@ var TableCell = import_react22.default.forwardRef(({ className, ...props }, ref)
|
|
|
10021
10083
|
}
|
|
10022
10084
|
));
|
|
10023
10085
|
TableCell.displayName = "TableCell";
|
|
10024
|
-
var TableCaption = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10086
|
+
var TableCaption = import_react22.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
10025
10087
|
"caption",
|
|
10026
10088
|
{
|
|
10027
10089
|
ref,
|
|
@@ -10032,10 +10094,10 @@ var TableCaption = import_react22.default.forwardRef(({ className, ...props }, r
|
|
|
10032
10094
|
TableCaption.displayName = "TableCaption";
|
|
10033
10095
|
|
|
10034
10096
|
// ../../components/ui/DataTable.tsx
|
|
10035
|
-
var
|
|
10097
|
+
var import_lucide_react25 = require("lucide-react");
|
|
10036
10098
|
var import_react23 = __toESM(require("react"), 1);
|
|
10037
10099
|
var import_next_intl7 = require("next-intl");
|
|
10038
|
-
var
|
|
10100
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
10039
10101
|
function useDebounced(value, delay = 300) {
|
|
10040
10102
|
const [debounced, setDebounced] = import_react23.default.useState(value);
|
|
10041
10103
|
import_react23.default.useEffect(() => {
|
|
@@ -10099,7 +10161,7 @@ function DataTable({
|
|
|
10099
10161
|
className: "h-8 w-full text-sm"
|
|
10100
10162
|
};
|
|
10101
10163
|
if (col.filter.type === "text") {
|
|
10102
|
-
return /* @__PURE__ */ (0,
|
|
10164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10103
10165
|
Input_default,
|
|
10104
10166
|
{
|
|
10105
10167
|
...commonProps,
|
|
@@ -10114,7 +10176,7 @@ function DataTable({
|
|
|
10114
10176
|
}
|
|
10115
10177
|
if (col.filter.type === "select") {
|
|
10116
10178
|
const options = col.filter.options || [];
|
|
10117
|
-
return /* @__PURE__ */ (0,
|
|
10179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10118
10180
|
Combobox,
|
|
10119
10181
|
{
|
|
10120
10182
|
options: ["", ...options],
|
|
@@ -10130,7 +10192,7 @@ function DataTable({
|
|
|
10130
10192
|
);
|
|
10131
10193
|
}
|
|
10132
10194
|
if (col.filter.type === "date") {
|
|
10133
|
-
return /* @__PURE__ */ (0,
|
|
10195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10134
10196
|
DatePicker,
|
|
10135
10197
|
{
|
|
10136
10198
|
placeholder: col.filter.placeholder || `Select ${String(col.title)}`,
|
|
@@ -10144,7 +10206,7 @@ function DataTable({
|
|
|
10144
10206
|
}
|
|
10145
10207
|
return null;
|
|
10146
10208
|
};
|
|
10147
|
-
const renderHeader = /* @__PURE__ */ (0,
|
|
10209
|
+
const renderHeader = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableRow, { children: visibleColumns.map((col, colIdx) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10148
10210
|
TableHead,
|
|
10149
10211
|
{
|
|
10150
10212
|
style: { width: col.width },
|
|
@@ -10157,9 +10219,9 @@ function DataTable({
|
|
|
10157
10219
|
children: (() => {
|
|
10158
10220
|
const isRightAlign = col.align === "right" || !col.align && headerAlign === "right";
|
|
10159
10221
|
const isCenterAlign = col.align === "center" || !col.align && headerAlign === "center";
|
|
10160
|
-
const titleContent = /* @__PURE__ */ (0,
|
|
10161
|
-
/* @__PURE__ */ (0,
|
|
10162
|
-
col.sortable && /* @__PURE__ */ (0,
|
|
10222
|
+
const titleContent = /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-1 min-w-0 flex-shrink", children: [
|
|
10223
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate font-medium text-sm", children: col.title }),
|
|
10224
|
+
col.sortable && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10163
10225
|
"button",
|
|
10164
10226
|
{
|
|
10165
10227
|
className: cn(
|
|
@@ -10176,8 +10238,8 @@ function DataTable({
|
|
|
10176
10238
|
},
|
|
10177
10239
|
"aria-label": "Sort",
|
|
10178
10240
|
title: `Sort by ${String(col.title)}`,
|
|
10179
|
-
children: /* @__PURE__ */ (0,
|
|
10180
|
-
/* @__PURE__ */ (0,
|
|
10241
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "none", className: "inline-block", children: [
|
|
10242
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10181
10243
|
"path",
|
|
10182
10244
|
{
|
|
10183
10245
|
d: "M7 8l3-3 3 3",
|
|
@@ -10188,7 +10250,7 @@ function DataTable({
|
|
|
10188
10250
|
opacity: sort?.key === col.key && sort.order === "asc" ? 1 : 0.4
|
|
10189
10251
|
}
|
|
10190
10252
|
),
|
|
10191
|
-
/* @__PURE__ */ (0,
|
|
10253
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10192
10254
|
"path",
|
|
10193
10255
|
{
|
|
10194
10256
|
d: "M7 12l3 3 3-3",
|
|
@@ -10203,11 +10265,11 @@ function DataTable({
|
|
|
10203
10265
|
}
|
|
10204
10266
|
)
|
|
10205
10267
|
] });
|
|
10206
|
-
const filterContent = col.filter && /* @__PURE__ */ (0,
|
|
10268
|
+
const filterContent = col.filter && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10207
10269
|
Popover,
|
|
10208
10270
|
{
|
|
10209
10271
|
placement: isRightAlign ? "bottom-end" : "bottom-start",
|
|
10210
|
-
trigger: /* @__PURE__ */ (0,
|
|
10272
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10211
10273
|
"button",
|
|
10212
10274
|
{
|
|
10213
10275
|
className: cn(
|
|
@@ -10217,16 +10279,16 @@ function DataTable({
|
|
|
10217
10279
|
),
|
|
10218
10280
|
"aria-label": "Filter",
|
|
10219
10281
|
title: "Filter",
|
|
10220
|
-
children: /* @__PURE__ */ (0,
|
|
10282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react25.Filter, { className: "h-4 w-4" })
|
|
10221
10283
|
}
|
|
10222
10284
|
),
|
|
10223
|
-
children: /* @__PURE__ */ (0,
|
|
10224
|
-
/* @__PURE__ */ (0,
|
|
10285
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "w-48 p-2 space-y-2", children: [
|
|
10286
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "text-xs font-medium text-muted-foreground mb-2", children: [
|
|
10225
10287
|
"Filter ",
|
|
10226
10288
|
col.title
|
|
10227
10289
|
] }),
|
|
10228
10290
|
renderFilterControl(col),
|
|
10229
|
-
filters[col.key] && /* @__PURE__ */ (0,
|
|
10291
|
+
filters[col.key] && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10230
10292
|
"button",
|
|
10231
10293
|
{
|
|
10232
10294
|
onClick: () => {
|
|
@@ -10244,7 +10306,7 @@ function DataTable({
|
|
|
10244
10306
|
] })
|
|
10245
10307
|
}
|
|
10246
10308
|
);
|
|
10247
|
-
return /* @__PURE__ */ (0,
|
|
10309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10248
10310
|
"div",
|
|
10249
10311
|
{
|
|
10250
10312
|
className: cn(
|
|
@@ -10253,10 +10315,10 @@ function DataTable({
|
|
|
10253
10315
|
isCenterAlign && "justify-center",
|
|
10254
10316
|
!isRightAlign && !isCenterAlign && "justify-between"
|
|
10255
10317
|
),
|
|
10256
|
-
children: isRightAlign ? /* @__PURE__ */ (0,
|
|
10318
|
+
children: isRightAlign ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
10257
10319
|
filterContent,
|
|
10258
10320
|
titleContent
|
|
10259
|
-
] }) : /* @__PURE__ */ (0,
|
|
10321
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
10260
10322
|
titleContent,
|
|
10261
10323
|
filterContent
|
|
10262
10324
|
] })
|
|
@@ -10305,15 +10367,15 @@ function DataTable({
|
|
|
10305
10367
|
}
|
|
10306
10368
|
return processedData.slice(start, start + curPageSize);
|
|
10307
10369
|
}, [processedData, curPage, curPageSize]);
|
|
10308
|
-
return /* @__PURE__ */ (0,
|
|
10309
|
-
/* @__PURE__ */ (0,
|
|
10310
|
-
/* @__PURE__ */ (0,
|
|
10311
|
-
/* @__PURE__ */ (0,
|
|
10312
|
-
enableDensityToggle && /* @__PURE__ */ (0,
|
|
10370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: cn("space-y-2", className), children: [
|
|
10371
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center justify-between gap-4 mb-1", children: [
|
|
10372
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-sm text-muted-foreground", children: caption }),
|
|
10373
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10374
|
+
enableDensityToggle && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10313
10375
|
DropdownMenu_default,
|
|
10314
10376
|
{
|
|
10315
|
-
trigger: /* @__PURE__ */ (0,
|
|
10316
|
-
/* @__PURE__ */ (0,
|
|
10377
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Button_default, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
10378
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("svg", { className: "w-4 h-4 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }),
|
|
10317
10379
|
labels?.density || t("density")
|
|
10318
10380
|
] }),
|
|
10319
10381
|
items: [
|
|
@@ -10323,11 +10385,11 @@ function DataTable({
|
|
|
10323
10385
|
]
|
|
10324
10386
|
}
|
|
10325
10387
|
),
|
|
10326
|
-
enableColumnVisibilityToggle && /* @__PURE__ */ (0,
|
|
10388
|
+
enableColumnVisibilityToggle && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10327
10389
|
DropdownMenu_default,
|
|
10328
10390
|
{
|
|
10329
|
-
trigger: /* @__PURE__ */ (0,
|
|
10330
|
-
/* @__PURE__ */ (0,
|
|
10391
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Button_default, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
10392
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("svg", { className: "w-4 h-4 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10331
10393
|
"path",
|
|
10332
10394
|
{
|
|
10333
10395
|
strokeLinecap: "round",
|
|
@@ -10338,26 +10400,26 @@ function DataTable({
|
|
|
10338
10400
|
) }),
|
|
10339
10401
|
labels?.columns || t("columns")
|
|
10340
10402
|
] }),
|
|
10341
|
-
children: columns.map((c) => /* @__PURE__ */ (0,
|
|
10403
|
+
children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
10342
10404
|
DropdownMenuItem,
|
|
10343
10405
|
{
|
|
10344
10406
|
onClick: () => {
|
|
10345
10407
|
setVisibleCols((prev) => prev.includes(c.key) ? prev.filter((k) => k !== c.key) : [...prev, c.key]);
|
|
10346
10408
|
},
|
|
10347
10409
|
children: [
|
|
10348
|
-
/* @__PURE__ */ (0,
|
|
10349
|
-
/* @__PURE__ */ (0,
|
|
10410
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("input", { type: "checkbox", className: "mr-2 rounded border-border", readOnly: true, checked: visibleCols.includes(c.key) }),
|
|
10411
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate", children: c.title })
|
|
10350
10412
|
]
|
|
10351
10413
|
},
|
|
10352
10414
|
c.key
|
|
10353
10415
|
))
|
|
10354
10416
|
}
|
|
10355
10417
|
),
|
|
10356
|
-
enableHeaderAlignToggle && /* @__PURE__ */ (0,
|
|
10418
|
+
enableHeaderAlignToggle && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10357
10419
|
DropdownMenu_default,
|
|
10358
10420
|
{
|
|
10359
|
-
trigger: /* @__PURE__ */ (0,
|
|
10360
|
-
/* @__PURE__ */ (0,
|
|
10421
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Button_default, { variant: "ghost", size: "sm", className: "h-8 px-2", children: [
|
|
10422
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("svg", { className: "w-4 h-4 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h10M4 18h16" }) }),
|
|
10361
10423
|
labels?.headerAlign || t("headerAlign")
|
|
10362
10424
|
] }),
|
|
10363
10425
|
items: [
|
|
@@ -10370,17 +10432,17 @@ function DataTable({
|
|
|
10370
10432
|
toolbar
|
|
10371
10433
|
] })
|
|
10372
10434
|
] }),
|
|
10373
|
-
/* @__PURE__ */ (0,
|
|
10435
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: cn("relative rounded-md border border-border/50 overflow-hidden", loading2 && "opacity-60 pointer-events-none"), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
10374
10436
|
Table,
|
|
10375
10437
|
{
|
|
10376
10438
|
containerClassName: "border-0 md:border-0 rounded-none md:rounded-none shadow-none bg-transparent",
|
|
10377
10439
|
className: "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-[5] [&_thead]:bg-background [&_thead]:backdrop-blur-sm",
|
|
10378
10440
|
children: [
|
|
10379
|
-
/* @__PURE__ */ (0,
|
|
10380
|
-
/* @__PURE__ */ (0,
|
|
10381
|
-
/* @__PURE__ */ (0,
|
|
10382
|
-
/* @__PURE__ */ (0,
|
|
10383
|
-
/* @__PURE__ */ (0,
|
|
10441
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableHeader, { children: renderHeader }),
|
|
10442
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableBody, { children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableCell, { colSpan: visibleColumns.length, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center justify-center gap-2 text-muted-foreground", children: [
|
|
10443
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("svg", { className: "animate-spin h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
10444
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
10445
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10384
10446
|
"path",
|
|
10385
10447
|
{
|
|
10386
10448
|
className: "opacity-75",
|
|
@@ -10389,12 +10451,12 @@ function DataTable({
|
|
|
10389
10451
|
}
|
|
10390
10452
|
)
|
|
10391
10453
|
] }),
|
|
10392
|
-
/* @__PURE__ */ (0,
|
|
10393
|
-
] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ (0,
|
|
10454
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm", children: "Loading..." })
|
|
10455
|
+
] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : displayedData.map((row, idx) => {
|
|
10394
10456
|
const isLastRow = idx === displayedData.length - 1;
|
|
10395
|
-
return /* @__PURE__ */ (0,
|
|
10457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col, colIdx) => {
|
|
10396
10458
|
const value = col.dataIndex ? row[col.dataIndex] : void 0;
|
|
10397
|
-
return /* @__PURE__ */ (0,
|
|
10459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10398
10460
|
TableCell,
|
|
10399
10461
|
{
|
|
10400
10462
|
className: cn(
|
|
@@ -10414,7 +10476,7 @@ function DataTable({
|
|
|
10414
10476
|
]
|
|
10415
10477
|
}
|
|
10416
10478
|
) }),
|
|
10417
|
-
totalItems > 0 && /* @__PURE__ */ (0,
|
|
10479
|
+
totalItems > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "border-t bg-muted/30 p-4 rounded-b-md", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10418
10480
|
Pagination,
|
|
10419
10481
|
{
|
|
10420
10482
|
page: curPage,
|
|
@@ -12204,7 +12266,7 @@ function useForm(props = {}) {
|
|
|
12204
12266
|
|
|
12205
12267
|
// ../../components/ui/Form.tsx
|
|
12206
12268
|
var import_next_intl8 = require("next-intl");
|
|
12207
|
-
var
|
|
12269
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
12208
12270
|
var FormConfigContext = React39.createContext({ size: "md" });
|
|
12209
12271
|
var FormWrapper = ({
|
|
12210
12272
|
children,
|
|
@@ -12224,14 +12286,14 @@ var FormWrapper = ({
|
|
|
12224
12286
|
}
|
|
12225
12287
|
}, [JSON.stringify(initialValues)]);
|
|
12226
12288
|
const { validationSchema: _, ...formProps } = props;
|
|
12227
|
-
return /* @__PURE__ */ (0,
|
|
12289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormProvider, { ...methods, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormConfigContext.Provider, { value: { size }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("form", { onSubmit: methods.handleSubmit(onSubmit), className, ...formProps, children }) }) });
|
|
12228
12290
|
};
|
|
12229
12291
|
var Form = FormWrapper;
|
|
12230
12292
|
var FormFieldContext = React39.createContext({});
|
|
12231
12293
|
var FormField = ({
|
|
12232
12294
|
...props
|
|
12233
12295
|
}) => {
|
|
12234
|
-
return /* @__PURE__ */ (0,
|
|
12296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Controller, { ...props }) });
|
|
12235
12297
|
};
|
|
12236
12298
|
var useFormField = () => {
|
|
12237
12299
|
const fieldContext = React39.useContext(FormFieldContext);
|
|
@@ -12259,14 +12321,14 @@ var useFormField = () => {
|
|
|
12259
12321
|
var FormItemContext = React39.createContext({});
|
|
12260
12322
|
var FormItem = React39.forwardRef(({ className, ...props }, ref) => {
|
|
12261
12323
|
const id = React39.useId();
|
|
12262
|
-
return /* @__PURE__ */ (0,
|
|
12324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref, className: cn("space-y-2", className), ...props }) });
|
|
12263
12325
|
});
|
|
12264
12326
|
FormItem.displayName = "FormItem";
|
|
12265
12327
|
var FormLabel = React39.forwardRef(({ className, children, required, ...props }, ref) => {
|
|
12266
12328
|
const { error, formItemId } = useFormField();
|
|
12267
12329
|
const config = React39.useContext(FormConfigContext);
|
|
12268
12330
|
const sizeClass = config.size === "sm" ? "text-xs" : config.size === "lg" ? "text-base" : "text-sm";
|
|
12269
|
-
return /* @__PURE__ */ (0,
|
|
12331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
12270
12332
|
Label,
|
|
12271
12333
|
{
|
|
12272
12334
|
ref,
|
|
@@ -12275,7 +12337,7 @@ var FormLabel = React39.forwardRef(({ className, children, required, ...props },
|
|
|
12275
12337
|
...props,
|
|
12276
12338
|
children: [
|
|
12277
12339
|
children,
|
|
12278
|
-
required && /* @__PURE__ */ (0,
|
|
12340
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
12279
12341
|
]
|
|
12280
12342
|
}
|
|
12281
12343
|
);
|
|
@@ -12283,7 +12345,7 @@ var FormLabel = React39.forwardRef(({ className, children, required, ...props },
|
|
|
12283
12345
|
FormLabel.displayName = "FormLabel";
|
|
12284
12346
|
var FormControl = React39.forwardRef(({ ...props }, ref) => {
|
|
12285
12347
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
12286
|
-
return /* @__PURE__ */ (0,
|
|
12348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12287
12349
|
"div",
|
|
12288
12350
|
{
|
|
12289
12351
|
ref,
|
|
@@ -12297,7 +12359,7 @@ var FormControl = React39.forwardRef(({ ...props }, ref) => {
|
|
|
12297
12359
|
FormControl.displayName = "FormControl";
|
|
12298
12360
|
var FormDescription = React39.forwardRef(({ className, ...props }, ref) => {
|
|
12299
12361
|
const { formDescriptionId } = useFormField();
|
|
12300
|
-
return /* @__PURE__ */ (0,
|
|
12362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { ref, id: formDescriptionId, className: cn("text-sm text-muted-foreground", className), ...props });
|
|
12301
12363
|
});
|
|
12302
12364
|
FormDescription.displayName = "FormDescription";
|
|
12303
12365
|
var FormMessage = React39.forwardRef(({ className, children, ...props }, ref) => {
|
|
@@ -12306,26 +12368,26 @@ var FormMessage = React39.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
12306
12368
|
if (!body) {
|
|
12307
12369
|
return null;
|
|
12308
12370
|
}
|
|
12309
|
-
return /* @__PURE__ */ (0,
|
|
12371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { ref, id: formMessageId, className: cn("text-sm font-medium text-destructive", className), ...props, children: body });
|
|
12310
12372
|
});
|
|
12311
12373
|
FormMessage.displayName = "FormMessage";
|
|
12312
|
-
var FormInput = React39.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ (0,
|
|
12374
|
+
var FormInput = React39.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12313
12375
|
FormField,
|
|
12314
12376
|
{
|
|
12315
12377
|
name,
|
|
12316
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
12317
|
-
/* @__PURE__ */ (0,
|
|
12318
|
-
/* @__PURE__ */ (0,
|
|
12378
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(FormItem, { children: [
|
|
12379
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Input_default, { size: props.size ?? size, ...field, ...props }) }),
|
|
12380
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormMessage, {})
|
|
12319
12381
|
] })
|
|
12320
12382
|
}
|
|
12321
12383
|
) }));
|
|
12322
12384
|
FormInput.displayName = "FormInput";
|
|
12323
|
-
var FormCheckbox = React39.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ (0,
|
|
12385
|
+
var FormCheckbox = React39.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12324
12386
|
FormField,
|
|
12325
12387
|
{
|
|
12326
12388
|
name,
|
|
12327
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
12328
|
-
/* @__PURE__ */ (0,
|
|
12389
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(FormItem, { children: [
|
|
12390
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12329
12391
|
Checkbox,
|
|
12330
12392
|
{
|
|
12331
12393
|
ref,
|
|
@@ -12339,20 +12401,20 @@ var FormCheckbox = React39.forwardRef(({ name, ...props }, ref) => /* @__PURE__
|
|
|
12339
12401
|
...props
|
|
12340
12402
|
}
|
|
12341
12403
|
) }),
|
|
12342
|
-
/* @__PURE__ */ (0,
|
|
12404
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormMessage, {})
|
|
12343
12405
|
] })
|
|
12344
12406
|
}
|
|
12345
12407
|
) }));
|
|
12346
12408
|
FormCheckbox.displayName = "FormCheckbox";
|
|
12347
|
-
var FormActions = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
12409
|
+
var FormActions = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref, className: cn("flex gap-2 justify-end", className), ...props }));
|
|
12348
12410
|
FormActions.displayName = "FormActions";
|
|
12349
|
-
var FormSubmitButton = React39.forwardRef(({ children, loading: loading2, ...props }, ref) => /* @__PURE__ */ (0,
|
|
12411
|
+
var FormSubmitButton = React39.forwardRef(({ children, loading: loading2, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Button_default, { ref, type: "submit", size: props.size ?? size, disabled: loading2, ...props, children }) }));
|
|
12350
12412
|
FormSubmitButton.displayName = "FormSubmitButton";
|
|
12351
12413
|
|
|
12352
12414
|
// ../../components/ui/NotificationModal.tsx
|
|
12353
|
-
var
|
|
12415
|
+
var import_lucide_react26 = require("lucide-react");
|
|
12354
12416
|
var import_next_intl9 = require("next-intl");
|
|
12355
|
-
var
|
|
12417
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12356
12418
|
function NotificationModal({ isOpen, onClose, notification, titleText, openLinkText, closeText }) {
|
|
12357
12419
|
const t = (0, import_next_intl9.useTranslations)("Common");
|
|
12358
12420
|
if (!notification) return null;
|
|
@@ -12373,26 +12435,26 @@ function NotificationModal({ isOpen, onClose, notification, titleText, openLinkT
|
|
|
12373
12435
|
onClose();
|
|
12374
12436
|
}
|
|
12375
12437
|
};
|
|
12376
|
-
return /* @__PURE__ */ (0,
|
|
12438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12377
12439
|
Modal_default,
|
|
12378
12440
|
{
|
|
12379
12441
|
isOpen,
|
|
12380
12442
|
onClose,
|
|
12381
12443
|
title: titleText || t("notifications"),
|
|
12382
12444
|
size: "md",
|
|
12383
|
-
children: /* @__PURE__ */ (0,
|
|
12384
|
-
/* @__PURE__ */ (0,
|
|
12385
|
-
/* @__PURE__ */ (0,
|
|
12445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "space-y-4", children: [
|
|
12446
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2 pb-2 border-b border-border", children: [
|
|
12447
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: cn(
|
|
12386
12448
|
"w-2 h-2 rounded-full",
|
|
12387
12449
|
!notification.is_read ? "bg-primary" : "bg-border"
|
|
12388
12450
|
) }),
|
|
12389
|
-
/* @__PURE__ */ (0,
|
|
12451
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-xs text-muted-foreground", children: !notification.is_read ? t("newNotification") : t("readStatus") })
|
|
12390
12452
|
] }),
|
|
12391
|
-
notification.title && /* @__PURE__ */ (0,
|
|
12392
|
-
notification.body && /* @__PURE__ */ (0,
|
|
12393
|
-
/* @__PURE__ */ (0,
|
|
12394
|
-
/* @__PURE__ */ (0,
|
|
12395
|
-
hasLink && /* @__PURE__ */ (0,
|
|
12453
|
+
notification.title && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h3", { className: "text-lg font-semibold text-foreground", children: notification.title }),
|
|
12454
|
+
notification.body && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "text-sm text-muted-foreground whitespace-pre-wrap leading-relaxed", children: notification.body }),
|
|
12455
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "text-xs text-muted-foreground border-t border-border pt-2", children: formatTime3(notification.created_at) }),
|
|
12456
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex gap-2 justify-end pt-2", children: [
|
|
12457
|
+
hasLink && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
12396
12458
|
Button_default,
|
|
12397
12459
|
{
|
|
12398
12460
|
variant: "primary",
|
|
@@ -12400,12 +12462,12 @@ function NotificationModal({ isOpen, onClose, notification, titleText, openLinkT
|
|
|
12400
12462
|
onClick: handleLinkClick,
|
|
12401
12463
|
className: "gap-2",
|
|
12402
12464
|
children: [
|
|
12403
|
-
/* @__PURE__ */ (0,
|
|
12465
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react26.ExternalLink, { className: "w-4 h-4" }),
|
|
12404
12466
|
openLinkText || t("openLink")
|
|
12405
12467
|
]
|
|
12406
12468
|
}
|
|
12407
12469
|
),
|
|
12408
|
-
/* @__PURE__ */ (0,
|
|
12470
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12409
12471
|
Button_default,
|
|
12410
12472
|
{
|
|
12411
12473
|
variant: "ghost",
|
|
@@ -12424,160 +12486,10 @@ var NotificationModal_default = NotificationModal;
|
|
|
12424
12486
|
// ../../components/ui/FloatingContacts.tsx
|
|
12425
12487
|
var import_link2 = __toESM(require("next/link"), 1);
|
|
12426
12488
|
var import_navigation = require("next/navigation");
|
|
12427
|
-
var
|
|
12428
|
-
|
|
12429
|
-
// ../../node_modules/react-icons/lib/iconBase.mjs
|
|
12430
|
-
var import_react26 = __toESM(require("react"), 1);
|
|
12431
|
-
|
|
12432
|
-
// ../../node_modules/react-icons/lib/iconContext.mjs
|
|
12433
|
-
var import_react25 = __toESM(require("react"), 1);
|
|
12434
|
-
var DefaultContext = {
|
|
12435
|
-
color: void 0,
|
|
12436
|
-
size: void 0,
|
|
12437
|
-
className: void 0,
|
|
12438
|
-
style: void 0,
|
|
12439
|
-
attr: void 0
|
|
12440
|
-
};
|
|
12441
|
-
var IconContext = import_react25.default.createContext && /* @__PURE__ */ import_react25.default.createContext(DefaultContext);
|
|
12442
|
-
|
|
12443
|
-
// ../../node_modules/react-icons/lib/iconBase.mjs
|
|
12444
|
-
var _excluded = ["attr", "size", "title"];
|
|
12445
|
-
function _objectWithoutProperties(source, excluded) {
|
|
12446
|
-
if (source == null) return {};
|
|
12447
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
12448
|
-
var key, i;
|
|
12449
|
-
if (Object.getOwnPropertySymbols) {
|
|
12450
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
12451
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
12452
|
-
key = sourceSymbolKeys[i];
|
|
12453
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
12454
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
12455
|
-
target[key] = source[key];
|
|
12456
|
-
}
|
|
12457
|
-
}
|
|
12458
|
-
return target;
|
|
12459
|
-
}
|
|
12460
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
12461
|
-
if (source == null) return {};
|
|
12462
|
-
var target = {};
|
|
12463
|
-
for (var key in source) {
|
|
12464
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12465
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
12466
|
-
target[key] = source[key];
|
|
12467
|
-
}
|
|
12468
|
-
}
|
|
12469
|
-
return target;
|
|
12470
|
-
}
|
|
12471
|
-
function _extends() {
|
|
12472
|
-
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
12473
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
12474
|
-
var source = arguments[i];
|
|
12475
|
-
for (var key in source) {
|
|
12476
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12477
|
-
target[key] = source[key];
|
|
12478
|
-
}
|
|
12479
|
-
}
|
|
12480
|
-
}
|
|
12481
|
-
return target;
|
|
12482
|
-
};
|
|
12483
|
-
return _extends.apply(this, arguments);
|
|
12484
|
-
}
|
|
12485
|
-
function ownKeys(e, r) {
|
|
12486
|
-
var t = Object.keys(e);
|
|
12487
|
-
if (Object.getOwnPropertySymbols) {
|
|
12488
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
12489
|
-
r && (o = o.filter(function(r2) {
|
|
12490
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
12491
|
-
})), t.push.apply(t, o);
|
|
12492
|
-
}
|
|
12493
|
-
return t;
|
|
12494
|
-
}
|
|
12495
|
-
function _objectSpread(e) {
|
|
12496
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
12497
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
12498
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
12499
|
-
_defineProperty(e, r2, t[r2]);
|
|
12500
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
12501
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
12502
|
-
});
|
|
12503
|
-
}
|
|
12504
|
-
return e;
|
|
12505
|
-
}
|
|
12506
|
-
function _defineProperty(obj, key, value) {
|
|
12507
|
-
key = _toPropertyKey(key);
|
|
12508
|
-
if (key in obj) {
|
|
12509
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
12510
|
-
} else {
|
|
12511
|
-
obj[key] = value;
|
|
12512
|
-
}
|
|
12513
|
-
return obj;
|
|
12514
|
-
}
|
|
12515
|
-
function _toPropertyKey(t) {
|
|
12516
|
-
var i = _toPrimitive(t, "string");
|
|
12517
|
-
return "symbol" == typeof i ? i : i + "";
|
|
12518
|
-
}
|
|
12519
|
-
function _toPrimitive(t, r) {
|
|
12520
|
-
if ("object" != typeof t || !t) return t;
|
|
12521
|
-
var e = t[Symbol.toPrimitive];
|
|
12522
|
-
if (void 0 !== e) {
|
|
12523
|
-
var i = e.call(t, r || "default");
|
|
12524
|
-
if ("object" != typeof i) return i;
|
|
12525
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
12526
|
-
}
|
|
12527
|
-
return ("string" === r ? String : Number)(t);
|
|
12528
|
-
}
|
|
12529
|
-
function Tree2Element(tree) {
|
|
12530
|
-
return tree && tree.map((node, i) => /* @__PURE__ */ import_react26.default.createElement(node.tag, _objectSpread({
|
|
12531
|
-
key: i
|
|
12532
|
-
}, node.attr), Tree2Element(node.child)));
|
|
12533
|
-
}
|
|
12534
|
-
function GenIcon(data) {
|
|
12535
|
-
return (props) => /* @__PURE__ */ import_react26.default.createElement(IconBase, _extends({
|
|
12536
|
-
attr: _objectSpread({}, data.attr)
|
|
12537
|
-
}, props), Tree2Element(data.child));
|
|
12538
|
-
}
|
|
12539
|
-
function IconBase(props) {
|
|
12540
|
-
var elem = (conf) => {
|
|
12541
|
-
var {
|
|
12542
|
-
attr,
|
|
12543
|
-
size,
|
|
12544
|
-
title
|
|
12545
|
-
} = props, svgProps = _objectWithoutProperties(props, _excluded);
|
|
12546
|
-
var computedSize = size || conf.size || "1em";
|
|
12547
|
-
var className;
|
|
12548
|
-
if (conf.className) className = conf.className;
|
|
12549
|
-
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
12550
|
-
return /* @__PURE__ */ import_react26.default.createElement("svg", _extends({
|
|
12551
|
-
stroke: "currentColor",
|
|
12552
|
-
fill: "currentColor",
|
|
12553
|
-
strokeWidth: "0"
|
|
12554
|
-
}, conf.attr, attr, svgProps, {
|
|
12555
|
-
className,
|
|
12556
|
-
style: _objectSpread(_objectSpread({
|
|
12557
|
-
color: props.color || conf.color
|
|
12558
|
-
}, conf.style), props.style),
|
|
12559
|
-
height: computedSize,
|
|
12560
|
-
width: computedSize,
|
|
12561
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
12562
|
-
}), title && /* @__PURE__ */ import_react26.default.createElement("title", null, title), props.children);
|
|
12563
|
-
};
|
|
12564
|
-
return IconContext !== void 0 ? /* @__PURE__ */ import_react26.default.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
|
12565
|
-
}
|
|
12566
|
-
|
|
12567
|
-
// ../../node_modules/react-icons/fa/index.mjs
|
|
12568
|
-
function FaInstagram(props) {
|
|
12569
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z" }, "child": [] }] })(props);
|
|
12570
|
-
}
|
|
12571
|
-
|
|
12572
|
-
// ../../node_modules/react-icons/si/index.mjs
|
|
12573
|
-
function SiZalo(props) {
|
|
12574
|
-
return GenIcon({ "tag": "svg", "attr": { "role": "img", "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M12.49 10.2722v-.4496h1.3467v6.3218h-.7704a.576.576 0 01-.5763-.5729l-.0006.0005a3.273 3.273 0 01-1.9372.6321c-1.8138 0-3.2844-1.4697-3.2844-3.2823 0-1.8125 1.4706-3.2822 3.2844-3.2822a3.273 3.273 0 011.9372.6321l.0006.0005zM6.9188 7.7896v.205c0 .3823-.051.6944-.2995 1.0605l-.03.0343c-.0542.0615-.1815.206-.2421.2843L2.024 14.8h4.8948v.7682a.5764.5764 0 01-.5767.5761H0v-.3622c0-.4436.1102-.6414.2495-.8476L4.8582 9.23H.1922V7.7896h6.7266zm8.5513 8.3548a.4805.4805 0 01-.4803-.4798v-7.875h1.4416v8.3548H15.47zM20.6934 9.6C22.52 9.6 24 11.0807 24 12.9044c0 1.8252-1.4801 3.306-3.3066 3.306-1.8264 0-3.3066-1.4808-3.3066-3.306 0-1.8237 1.4802-3.3044 3.3066-3.3044zm-10.1412 5.253c1.0675 0 1.9324-.8645 1.9324-1.9312 0-1.065-.865-1.9295-1.9324-1.9295s-1.9324.8644-1.9324 1.9295c0 1.0667.865 1.9312 1.9324 1.9312zm10.1412-.0033c1.0737 0 1.945-.8707 1.945-1.9453 0-1.073-.8713-1.9436-1.945-1.9436-1.0753 0-1.945.8706-1.945 1.9436 0 1.0746.8697 1.9453 1.945 1.9453z" }, "child": [] }] })(props);
|
|
12575
|
-
}
|
|
12576
|
-
|
|
12577
|
-
// ../../components/ui/FloatingContacts.tsx
|
|
12578
|
-
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12489
|
+
var import_lucide_react27 = require("lucide-react");
|
|
12490
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
12579
12491
|
function MessengerIcon(props) {
|
|
12580
|
-
return /* @__PURE__ */ (0,
|
|
12492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("svg", { viewBox: "0 0 24 24", width: 24, height: 24, "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12581
12493
|
"path",
|
|
12582
12494
|
{
|
|
12583
12495
|
d: "M12 2C6.477 2 2 6.145 2 11.235c0 2.93 1.35 5.542 3.464 7.25v3.515l3.344-1.836c.894.247 1.843.375 2.192.375 5.523 0 10-4.145 10-9.235S17.523 2 12 2zm.994 12.444l-2.563-2.73-5.004 2.73 5.507-5.84 2.626 2.729 4.942-2.729-5.508 5.84z",
|
|
@@ -12586,10 +12498,16 @@ function MessengerIcon(props) {
|
|
|
12586
12498
|
) });
|
|
12587
12499
|
}
|
|
12588
12500
|
function ZaloIcon(props) {
|
|
12589
|
-
return /* @__PURE__ */ (0,
|
|
12501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("svg", { viewBox: "0 0 48 48", width: 20, height: 20, "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12502
|
+
"path",
|
|
12503
|
+
{
|
|
12504
|
+
fill: "white",
|
|
12505
|
+
d: "M24 4C12.954 4 4 12.954 4 24s8.954 20 20 20 20-8.954 20-20S35.046 4 24 4zm6.164 27.602h-4.239c-.405 0-.732-.328-.732-.732v-7.596l-2.646 7.933c-.096.288-.366.482-.67.482h-1.773c-.304 0-.574-.194-.67-.482l-2.647-7.933v7.596c0 .405-.327.732-.732.732h-2.873c-.405 0-.732-.328-.732-.732V17.134c0-.405.327-.732.732-.732h3.91c.32 0 .602.208.698.514l2.68 8.042 2.68-8.042c.096-.306.378-.514.698-.514h3.91c.405 0 .732.327.732.732v14.466c0 .404-.327.732-.732.732z"
|
|
12506
|
+
}
|
|
12507
|
+
) });
|
|
12590
12508
|
}
|
|
12591
12509
|
function InstagramIcon(props) {
|
|
12592
|
-
return /* @__PURE__ */ (0,
|
|
12510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("svg", { viewBox: "0 0 24 24", width: 20, height: 20, "aria-hidden": "true", fill: "white", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z" }) });
|
|
12593
12511
|
}
|
|
12594
12512
|
function FloatingContacts({ className }) {
|
|
12595
12513
|
const pathname = (0, import_navigation.usePathname)();
|
|
@@ -12624,8 +12542,8 @@ function FloatingContacts({ className }) {
|
|
|
12624
12542
|
external: true
|
|
12625
12543
|
}
|
|
12626
12544
|
];
|
|
12627
|
-
return /* @__PURE__ */ (0,
|
|
12628
|
-
/* @__PURE__ */ (0,
|
|
12545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("fixed bottom-6 right-4 z-[100000]", "flex flex-col items-end gap-3", className), "aria-label": "Quick contacts", children: [
|
|
12546
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12629
12547
|
import_link2.default,
|
|
12630
12548
|
{
|
|
12631
12549
|
href: `tel:${hotline.replace(/\D/g, "")}`,
|
|
@@ -12636,10 +12554,10 @@ function FloatingContacts({ className }) {
|
|
|
12636
12554
|
"hover:scale-105 active:scale-95 transition-transform",
|
|
12637
12555
|
"bg-[#22c55e]"
|
|
12638
12556
|
),
|
|
12639
|
-
children: /* @__PURE__ */ (0,
|
|
12557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react27.Phone, { className: "w-6 h-6" })
|
|
12640
12558
|
}
|
|
12641
12559
|
),
|
|
12642
|
-
moreItems.map(({ key, href, label, bg, Icon, external }) => /* @__PURE__ */ (0,
|
|
12560
|
+
moreItems.map(({ key, href, label, bg, Icon, external }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12643
12561
|
import_link2.default,
|
|
12644
12562
|
{
|
|
12645
12563
|
href,
|
|
@@ -12651,7 +12569,7 @@ function FloatingContacts({ className }) {
|
|
|
12651
12569
|
"hover:scale-105 active:scale-95 transition-transform",
|
|
12652
12570
|
bg
|
|
12653
12571
|
),
|
|
12654
|
-
children: /* @__PURE__ */ (0,
|
|
12572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { className: "w-6 h-6" })
|
|
12655
12573
|
},
|
|
12656
12574
|
key
|
|
12657
12575
|
))
|
|
@@ -12659,17 +12577,17 @@ function FloatingContacts({ className }) {
|
|
|
12659
12577
|
}
|
|
12660
12578
|
|
|
12661
12579
|
// ../../components/ui/AccessDenied.tsx
|
|
12662
|
-
var
|
|
12663
|
-
var
|
|
12580
|
+
var import_lucide_react28 = require("lucide-react");
|
|
12581
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12664
12582
|
var VARIANT_STYLES = {
|
|
12665
12583
|
destructive: { bg: "bg-destructive/5", border: "border-destructive/20", text: "text-destructive" },
|
|
12666
12584
|
warning: { bg: "bg-warning/5", border: "border-warning/20", text: "text-warning" },
|
|
12667
12585
|
info: { bg: "bg-info/5", border: "border-info/20", text: "text-info" }
|
|
12668
12586
|
};
|
|
12669
12587
|
var DEFAULT_ICONS = {
|
|
12670
|
-
destructive:
|
|
12671
|
-
warning:
|
|
12672
|
-
info:
|
|
12588
|
+
destructive: import_lucide_react28.ShieldAlert,
|
|
12589
|
+
warning: import_lucide_react28.Ban,
|
|
12590
|
+
info: import_lucide_react28.Lock
|
|
12673
12591
|
};
|
|
12674
12592
|
function AccessDenied({
|
|
12675
12593
|
title = "Access Restricted",
|
|
@@ -12681,36 +12599,36 @@ function AccessDenied({
|
|
|
12681
12599
|
}) {
|
|
12682
12600
|
const styles = VARIANT_STYLES[variant];
|
|
12683
12601
|
const UsedIcon = Icon || DEFAULT_ICONS[variant];
|
|
12684
|
-
return /* @__PURE__ */ (0,
|
|
12685
|
-
/* @__PURE__ */ (0,
|
|
12686
|
-
/* @__PURE__ */ (0,
|
|
12687
|
-
/* @__PURE__ */ (0,
|
|
12688
|
-
/* @__PURE__ */ (0,
|
|
12602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Card_default, { className: cn("p-8 text-center shadow-sm", styles.bg, styles.border, className), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
|
|
12603
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: cn("p-3 rounded-lg", styles.bg.replace("/5", "/10")), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(UsedIcon, { className: cn("w-8 h-8", styles.text) }) }),
|
|
12604
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { children: [
|
|
12605
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h3", { className: cn("font-semibold mb-2", styles.text), children: title }),
|
|
12606
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: cn(styles.text.replace("text-", "text-") + "/80", "text-sm"), children: description })
|
|
12689
12607
|
] }),
|
|
12690
|
-
children && /* @__PURE__ */ (0,
|
|
12608
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mt-2 flex flex-wrap gap-2 justify-center", children })
|
|
12691
12609
|
] }) });
|
|
12692
12610
|
}
|
|
12693
12611
|
|
|
12694
12612
|
// ../../components/ui/ThemeToggleHeadless.tsx
|
|
12695
|
-
var
|
|
12696
|
-
var
|
|
12613
|
+
var import_lucide_react29 = require("lucide-react");
|
|
12614
|
+
var import_react25 = require("react");
|
|
12697
12615
|
var import_react_dom10 = require("react-dom");
|
|
12698
|
-
var
|
|
12616
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12699
12617
|
function ThemeToggleHeadless({
|
|
12700
12618
|
theme,
|
|
12701
12619
|
onChange,
|
|
12702
12620
|
labels,
|
|
12703
12621
|
className
|
|
12704
12622
|
}) {
|
|
12705
|
-
const [isOpen, setIsOpen] = (0,
|
|
12706
|
-
const [mounted, setMounted] = (0,
|
|
12707
|
-
const triggerRef = (0,
|
|
12708
|
-
const [dropdownPosition, setDropdownPosition] = (0,
|
|
12709
|
-
(0,
|
|
12623
|
+
const [isOpen, setIsOpen] = (0, import_react25.useState)(false);
|
|
12624
|
+
const [mounted, setMounted] = (0, import_react25.useState)(false);
|
|
12625
|
+
const triggerRef = (0, import_react25.useRef)(null);
|
|
12626
|
+
const [dropdownPosition, setDropdownPosition] = (0, import_react25.useState)(null);
|
|
12627
|
+
(0, import_react25.useEffect)(() => setMounted(true), []);
|
|
12710
12628
|
const themes = [
|
|
12711
|
-
{ value: "light", label: labels?.light ?? "Light", icon:
|
|
12712
|
-
{ value: "dark", label: labels?.dark ?? "Dark", icon:
|
|
12713
|
-
{ value: "system", label: labels?.system ?? "System", icon:
|
|
12629
|
+
{ value: "light", label: labels?.light ?? "Light", icon: import_lucide_react29.Sun },
|
|
12630
|
+
{ value: "dark", label: labels?.dark ?? "Dark", icon: import_lucide_react29.Moon },
|
|
12631
|
+
{ value: "system", label: labels?.system ?? "System", icon: import_lucide_react29.Monitor }
|
|
12714
12632
|
];
|
|
12715
12633
|
const current = mounted ? themes.find((t) => t.value === theme) || themes[2] : themes[2];
|
|
12716
12634
|
const CurrentIcon = current.icon;
|
|
@@ -12724,8 +12642,8 @@ function ThemeToggleHeadless({
|
|
|
12724
12642
|
const top = rect.bottom + scrollTop + 8;
|
|
12725
12643
|
return { top, left, width };
|
|
12726
12644
|
};
|
|
12727
|
-
return /* @__PURE__ */ (0,
|
|
12728
|
-
/* @__PURE__ */ (0,
|
|
12645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: cn("relative", className), children: [
|
|
12646
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12729
12647
|
Button_default,
|
|
12730
12648
|
{
|
|
12731
12649
|
variant: "ghost",
|
|
@@ -12743,25 +12661,25 @@ function ThemeToggleHeadless({
|
|
|
12743
12661
|
"aria-haspopup": "menu",
|
|
12744
12662
|
"aria-expanded": isOpen,
|
|
12745
12663
|
"aria-label": labels?.heading ?? "Theme",
|
|
12746
|
-
children: /* @__PURE__ */ (0,
|
|
12664
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CurrentIcon, { className: "h-5 w-5" })
|
|
12747
12665
|
}
|
|
12748
12666
|
),
|
|
12749
|
-
isOpen && /* @__PURE__ */ (0,
|
|
12750
|
-
typeof window !== "undefined" && (0, import_react_dom10.createPortal)(/* @__PURE__ */ (0,
|
|
12667
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
12668
|
+
typeof window !== "undefined" && (0, import_react_dom10.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "fixed inset-0 z-[9998]", onClick: () => setIsOpen(false) }), document.body),
|
|
12751
12669
|
typeof window !== "undefined" && dropdownPosition && (0, import_react_dom10.createPortal)(
|
|
12752
|
-
/* @__PURE__ */ (0,
|
|
12670
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12753
12671
|
"div",
|
|
12754
12672
|
{
|
|
12755
12673
|
className: "z-[9999] bg-card border border-border rounded-lg shadow-lg overflow-hidden",
|
|
12756
12674
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width },
|
|
12757
12675
|
onMouseDown: (e) => e.stopPropagation(),
|
|
12758
12676
|
role: "menu",
|
|
12759
|
-
children: /* @__PURE__ */ (0,
|
|
12760
|
-
/* @__PURE__ */ (0,
|
|
12677
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "p-2", children: [
|
|
12678
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "px-3 py-2 text-sm font-medium text-muted-foreground border-b border-border mb-2", children: labels?.heading ?? "Theme" }),
|
|
12761
12679
|
themes.map((opt) => {
|
|
12762
12680
|
const Icon = opt.icon;
|
|
12763
12681
|
const active = theme === opt.value;
|
|
12764
|
-
return /* @__PURE__ */ (0,
|
|
12682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
12765
12683
|
Button_default,
|
|
12766
12684
|
{
|
|
12767
12685
|
variant: "ghost",
|
|
@@ -12777,9 +12695,9 @@ function ThemeToggleHeadless({
|
|
|
12777
12695
|
role: "menuitemradio",
|
|
12778
12696
|
"aria-checked": active,
|
|
12779
12697
|
children: [
|
|
12780
|
-
/* @__PURE__ */ (0,
|
|
12781
|
-
/* @__PURE__ */ (0,
|
|
12782
|
-
active && /* @__PURE__ */ (0,
|
|
12698
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Icon, { className: "h-4 w-4" }),
|
|
12699
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "flex-1 text-left", children: opt.label }),
|
|
12700
|
+
active && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "w-2 h-2 rounded-full bg-primary" })
|
|
12783
12701
|
]
|
|
12784
12702
|
},
|
|
12785
12703
|
opt.value
|
|
@@ -12795,10 +12713,10 @@ function ThemeToggleHeadless({
|
|
|
12795
12713
|
}
|
|
12796
12714
|
|
|
12797
12715
|
// ../../components/ui/LanguageSwitcherHeadless.tsx
|
|
12798
|
-
var
|
|
12716
|
+
var import_react26 = require("react");
|
|
12799
12717
|
var import_react_dom11 = require("react-dom");
|
|
12800
|
-
var
|
|
12801
|
-
var
|
|
12718
|
+
var import_lucide_react30 = require("lucide-react");
|
|
12719
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12802
12720
|
function LanguageSwitcherHeadless({
|
|
12803
12721
|
locales,
|
|
12804
12722
|
currentLocale,
|
|
@@ -12806,9 +12724,9 @@ function LanguageSwitcherHeadless({
|
|
|
12806
12724
|
labels,
|
|
12807
12725
|
className
|
|
12808
12726
|
}) {
|
|
12809
|
-
const [isOpen, setIsOpen] = (0,
|
|
12810
|
-
const [dropdownPosition, setDropdownPosition] = (0,
|
|
12811
|
-
const triggerButtonRef = (0,
|
|
12727
|
+
const [isOpen, setIsOpen] = (0, import_react26.useState)(false);
|
|
12728
|
+
const [dropdownPosition, setDropdownPosition] = (0, import_react26.useState)(null);
|
|
12729
|
+
const triggerButtonRef = (0, import_react26.useRef)(null);
|
|
12812
12730
|
const currentLanguage = locales.find((l) => l.code === currentLocale) || locales[0];
|
|
12813
12731
|
const calculatePosition = () => {
|
|
12814
12732
|
const rect = triggerButtonRef.current?.getBoundingClientRect();
|
|
@@ -12820,8 +12738,8 @@ function LanguageSwitcherHeadless({
|
|
|
12820
12738
|
const top = rect.bottom + scrollTop + 8;
|
|
12821
12739
|
return { top, left, width };
|
|
12822
12740
|
};
|
|
12823
|
-
return /* @__PURE__ */ (0,
|
|
12824
|
-
/* @__PURE__ */ (0,
|
|
12741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: cn("relative", className), children: [
|
|
12742
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12825
12743
|
Button_default,
|
|
12826
12744
|
{
|
|
12827
12745
|
variant: "ghost",
|
|
@@ -12840,22 +12758,22 @@ function LanguageSwitcherHeadless({
|
|
|
12840
12758
|
"aria-expanded": isOpen,
|
|
12841
12759
|
"aria-label": labels?.heading ?? "Language",
|
|
12842
12760
|
title: labels?.heading ?? "Language",
|
|
12843
|
-
children: /* @__PURE__ */ (0,
|
|
12761
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react30.Globe, { className: "h-5 w-5" })
|
|
12844
12762
|
}
|
|
12845
12763
|
),
|
|
12846
|
-
isOpen && /* @__PURE__ */ (0,
|
|
12847
|
-
typeof window !== "undefined" && (0, import_react_dom11.createPortal)(/* @__PURE__ */ (0,
|
|
12764
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
12765
|
+
typeof window !== "undefined" && (0, import_react_dom11.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "fixed inset-0 z-[9998]", onClick: () => setIsOpen(false) }), document.body),
|
|
12848
12766
|
typeof window !== "undefined" && dropdownPosition && (0, import_react_dom11.createPortal)(
|
|
12849
|
-
/* @__PURE__ */ (0,
|
|
12767
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12850
12768
|
"div",
|
|
12851
12769
|
{
|
|
12852
12770
|
className: "z-[9999] bg-card border border-border rounded-lg shadow-lg overflow-hidden",
|
|
12853
12771
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width },
|
|
12854
12772
|
onMouseDown: (e) => e.stopPropagation(),
|
|
12855
12773
|
role: "menu",
|
|
12856
|
-
children: /* @__PURE__ */ (0,
|
|
12857
|
-
/* @__PURE__ */ (0,
|
|
12858
|
-
locales.map((language) => /* @__PURE__ */ (0,
|
|
12774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "p-2", children: [
|
|
12775
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "px-3 py-2 text-sm font-medium text-muted-foreground border-b border-border mb-2", children: labels?.heading ?? "Language" }),
|
|
12776
|
+
locales.map((language) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
12859
12777
|
Button_default,
|
|
12860
12778
|
{
|
|
12861
12779
|
variant: "ghost",
|
|
@@ -12868,9 +12786,9 @@ function LanguageSwitcherHeadless({
|
|
|
12868
12786
|
role: "menuitemradio",
|
|
12869
12787
|
"aria-checked": currentLocale === language.code,
|
|
12870
12788
|
children: [
|
|
12871
|
-
language.flag && /* @__PURE__ */ (0,
|
|
12872
|
-
/* @__PURE__ */ (0,
|
|
12873
|
-
currentLocale === language.code && /* @__PURE__ */ (0,
|
|
12789
|
+
language.flag && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-lg", children: language.flag }),
|
|
12790
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "flex-1 text-left", children: language.name }),
|
|
12791
|
+
currentLocale === language.code && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "w-2 h-2 rounded-full bg-primary" })
|
|
12874
12792
|
]
|
|
12875
12793
|
},
|
|
12876
12794
|
language.code
|