@underverse-ui/underverse 0.1.31 → 0.1.33
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 +1222 -1197
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.js +1133 -1108
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -469,583 +469,557 @@ import React4, { forwardRef as forwardRef3, useId, useState as useState4 } from
|
|
|
469
469
|
import { useTranslations } from "next-intl";
|
|
470
470
|
import { Eye, EyeOff, Search, X, AlertCircle, CheckCircle, Loader2 } from "lucide-react";
|
|
471
471
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
472
|
-
var Input = forwardRef3(
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
/* @__PURE__ */ jsxs5(
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
"text-foreground group-focus-within:text-primary",
|
|
603
|
-
|
|
472
|
+
var Input = forwardRef3(
|
|
473
|
+
({
|
|
474
|
+
label,
|
|
475
|
+
error,
|
|
476
|
+
description,
|
|
477
|
+
className,
|
|
478
|
+
required,
|
|
479
|
+
variant = "default",
|
|
480
|
+
size = "md",
|
|
481
|
+
leftIcon: LeftIcon,
|
|
482
|
+
rightIcon: RightIcon,
|
|
483
|
+
clearable = false,
|
|
484
|
+
loading: loading2 = false,
|
|
485
|
+
success = false,
|
|
486
|
+
onClear,
|
|
487
|
+
hint,
|
|
488
|
+
counter = false,
|
|
489
|
+
type = "text",
|
|
490
|
+
value,
|
|
491
|
+
maxLength,
|
|
492
|
+
...rest
|
|
493
|
+
}, ref) => {
|
|
494
|
+
const [localError, setLocalError] = useState4(error);
|
|
495
|
+
const [showPassword, setShowPassword] = useState4(false);
|
|
496
|
+
const [isFocused, setIsFocused] = useState4(false);
|
|
497
|
+
const tv = useTranslations("ValidationInput");
|
|
498
|
+
const autoId = useId();
|
|
499
|
+
const needsId = !!(label || description || hint || error);
|
|
500
|
+
const resolvedId = rest.id || (needsId ? `input-${autoId}` : void 0);
|
|
501
|
+
const errMsg = error || localError;
|
|
502
|
+
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
503
|
+
const charCount = typeof value === "string" ? value.length : 0;
|
|
504
|
+
const errorId = errMsg && resolvedId ? `${resolvedId}-error` : void 0;
|
|
505
|
+
const descId = !errMsg && (description || hint) && resolvedId ? `${resolvedId}-desc` : void 0;
|
|
506
|
+
const containerSpacing = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
507
|
+
const variantStyles6 = {
|
|
508
|
+
default: {
|
|
509
|
+
container: "bg-background border border-input hover:border-accent-foreground/20",
|
|
510
|
+
focus: "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
511
|
+
error: "border-destructive focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-destructive focus-visible:ring-offset-1 focus-visible:ring-offset-background focus-visible:border-transparent"
|
|
512
|
+
},
|
|
513
|
+
filled: {
|
|
514
|
+
container: "bg-muted/50 border border-transparent hover:bg-muted/70",
|
|
515
|
+
focus: "focus-visible:outline-none focus-visible:bg-background focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
516
|
+
error: "bg-destructive/10 border-destructive focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-destructive focus-visible:ring-offset-1 focus-visible:ring-offset-background focus-visible:border-transparent"
|
|
517
|
+
},
|
|
518
|
+
outlined: {
|
|
519
|
+
container: "bg-transparent border border-border hover:border-accent-foreground/30",
|
|
520
|
+
focus: "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
521
|
+
error: "border-destructive focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-destructive focus-visible:ring-offset-1 focus-visible:ring-offset-background focus-visible:border-transparent"
|
|
522
|
+
},
|
|
523
|
+
minimal: {
|
|
524
|
+
container: "bg-transparent border-0 border-b border-border hover:border-accent-foreground/30",
|
|
525
|
+
focus: "focus-visible:outline-none focus-visible:border-ring focus-visible:ring-0 rounded-none",
|
|
526
|
+
error: "border-destructive focus-visible:outline-none focus-visible:border-destructive"
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
const sizeStyles8 = {
|
|
530
|
+
sm: {
|
|
531
|
+
input: "px-3 py-1.5 text-sm h-8 md:h-7 md:py-1 md:text-xs",
|
|
532
|
+
icon: "w-4 h-4",
|
|
533
|
+
button: "h-7 w-7"
|
|
534
|
+
},
|
|
535
|
+
md: {
|
|
536
|
+
input: "px-4 py-2 text-sm h-10",
|
|
537
|
+
icon: "w-5 h-5",
|
|
538
|
+
button: "h-8 w-8"
|
|
539
|
+
},
|
|
540
|
+
lg: {
|
|
541
|
+
input: "px-5 py-4 text-base h-12",
|
|
542
|
+
icon: "w-6 h-6",
|
|
543
|
+
button: "h-10 w-10"
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
const getErrorKey = (v) => {
|
|
547
|
+
if (v.valueMissing) return "required";
|
|
548
|
+
if (v.typeMismatch) return "typeMismatch";
|
|
549
|
+
if (v.patternMismatch) return "pattern";
|
|
550
|
+
if (v.tooShort) return "tooShort";
|
|
551
|
+
if (v.tooLong) return "tooLong";
|
|
552
|
+
if (v.rangeUnderflow) return "rangeUnderflow";
|
|
553
|
+
if (v.rangeOverflow) return "rangeOverflow";
|
|
554
|
+
if (v.stepMismatch) return "stepMismatch";
|
|
555
|
+
if (v.badInput) return "badInput";
|
|
556
|
+
return "invalid";
|
|
557
|
+
};
|
|
558
|
+
const getStatusIcon = () => {
|
|
559
|
+
if (loading2) return /* @__PURE__ */ jsx5(Loader2, { className: cn("animate-spin text-muted-foreground", sizeStyles8[size].icon) });
|
|
560
|
+
if (success) return /* @__PURE__ */ jsx5(CheckCircle, { className: cn("text-success", sizeStyles8[size].icon) });
|
|
561
|
+
if (errMsg) return /* @__PURE__ */ jsx5(AlertCircle, { className: cn("text-destructive", sizeStyles8[size].icon) });
|
|
562
|
+
return null;
|
|
563
|
+
};
|
|
564
|
+
const showPasswordToggle = type === "password";
|
|
565
|
+
const actualType = showPasswordToggle && showPassword ? "text" : type;
|
|
566
|
+
const { onFocus: onFocusProp, onBlur: onBlurProp, disabled } = rest;
|
|
567
|
+
const {
|
|
568
|
+
label: _label,
|
|
569
|
+
error: _error,
|
|
570
|
+
description: _description,
|
|
571
|
+
variant: _variant,
|
|
572
|
+
size: _size,
|
|
573
|
+
leftIcon: _leftIcon,
|
|
574
|
+
rightIcon: _rightIcon,
|
|
575
|
+
clearable: _clearable,
|
|
576
|
+
loading: _loading,
|
|
577
|
+
success: _success,
|
|
578
|
+
onClear: _onClear,
|
|
579
|
+
hint: _hint,
|
|
580
|
+
counter: _counter,
|
|
581
|
+
...restInput
|
|
582
|
+
} = rest;
|
|
583
|
+
const handleFocus = (e) => {
|
|
584
|
+
setIsFocused(true);
|
|
585
|
+
onFocusProp?.(e);
|
|
586
|
+
};
|
|
587
|
+
const handleBlur = (e) => {
|
|
588
|
+
setIsFocused(false);
|
|
589
|
+
onBlurProp?.(e);
|
|
590
|
+
};
|
|
591
|
+
const radiusClass = size === "sm" ? "rounded-md" : "rounded-lg";
|
|
592
|
+
return /* @__PURE__ */ jsxs5("div", { className: cn("w-full group", containerSpacing), children: [
|
|
593
|
+
label && /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
|
|
594
|
+
/* @__PURE__ */ jsxs5(
|
|
595
|
+
"label",
|
|
596
|
+
{
|
|
597
|
+
className: cn(
|
|
598
|
+
// Label size follows input size
|
|
599
|
+
size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm",
|
|
600
|
+
"font-medium transition-colors duration-200",
|
|
601
|
+
// default color and highlight while any descendant focused
|
|
602
|
+
disabled ? "text-muted-foreground" : cn("text-foreground group-focus-within:text-primary", success && "text-primary"),
|
|
603
|
+
errMsg && "text-destructive"
|
|
604
604
|
),
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
/* @__PURE__ */ jsx5(
|
|
631
|
-
"input",
|
|
632
|
-
{
|
|
633
|
-
ref,
|
|
634
|
-
type: actualType,
|
|
635
|
-
...value !== void 0 ? { value } : {},
|
|
636
|
-
maxLength,
|
|
637
|
-
required,
|
|
638
|
-
id: resolvedId,
|
|
639
|
-
autoComplete: type === "password" ? "current-password" : type === "email" ? "email" : rest.autoComplete,
|
|
640
|
-
onFocus: handleFocus,
|
|
641
|
-
onBlur: handleBlur,
|
|
642
|
-
onInvalid: (e) => {
|
|
643
|
-
e.preventDefault();
|
|
644
|
-
const key = getErrorKey(e.currentTarget.validity);
|
|
645
|
-
setLocalError(tv(key));
|
|
646
|
-
},
|
|
647
|
-
onInput: () => setLocalError(void 0),
|
|
648
|
-
"aria-invalid": !!errMsg,
|
|
649
|
-
"aria-describedby": [errorId, descId].filter(Boolean).join(" ") || void 0,
|
|
650
|
-
className: cn(
|
|
651
|
-
"w-full text-foreground transition-all duration-200 ease-out",
|
|
652
|
-
"placeholder:text-muted-foreground focus:outline-none focus-visible:outline-none",
|
|
653
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
654
|
-
// Size styles
|
|
655
|
-
sizeStyles8[size].input,
|
|
656
|
-
radiusClass,
|
|
657
|
-
// Icon padding adjustments
|
|
658
|
-
LeftIcon && "pl-10",
|
|
659
|
-
(RightIcon || showPasswordToggle || clearable || loading2 || success || errMsg) && "pr-10",
|
|
660
|
-
// Variant styles
|
|
661
|
-
variantStyles6[variant].container,
|
|
662
|
-
errMsg ? variantStyles6[variant].error : variantStyles6[variant].focus,
|
|
663
|
-
// Reduce visual weight for sm: no default drop shadows
|
|
664
|
-
size !== "sm" && variant !== "minimal" && "shadow-sm",
|
|
665
|
-
size !== "sm" && isFocused && "shadow-md",
|
|
666
|
-
className
|
|
667
|
-
),
|
|
668
|
-
disabled,
|
|
669
|
-
...restInput
|
|
670
|
-
}
|
|
671
|
-
),
|
|
672
|
-
/* @__PURE__ */ jsxs5("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1", children: [
|
|
673
|
-
getStatusIcon(),
|
|
674
|
-
RightIcon && !loading2 && !success && !errMsg && /* @__PURE__ */ jsx5(RightIcon, { className: cn("text-muted-foreground", sizeStyles8[size].icon) }),
|
|
675
|
-
clearable && hasValue && !loading2 && /* @__PURE__ */ jsx5(
|
|
676
|
-
"button",
|
|
605
|
+
children: [
|
|
606
|
+
label,
|
|
607
|
+
required && /* @__PURE__ */ jsx5("span", { className: "text-destructive ml-1", children: "*" })
|
|
608
|
+
]
|
|
609
|
+
}
|
|
610
|
+
),
|
|
611
|
+
counter && maxLength && /* @__PURE__ */ jsxs5(
|
|
612
|
+
"span",
|
|
613
|
+
{
|
|
614
|
+
className: cn(
|
|
615
|
+
"text-xs transition-colors duration-200",
|
|
616
|
+
charCount > maxLength * 0.9 ? "text-warning" : "text-muted-foreground",
|
|
617
|
+
charCount >= maxLength && "text-destructive"
|
|
618
|
+
),
|
|
619
|
+
children: [
|
|
620
|
+
charCount,
|
|
621
|
+
"/",
|
|
622
|
+
maxLength
|
|
623
|
+
]
|
|
624
|
+
}
|
|
625
|
+
)
|
|
626
|
+
] }),
|
|
627
|
+
/* @__PURE__ */ jsxs5("div", { className: "relative group", children: [
|
|
628
|
+
LeftIcon && /* @__PURE__ */ jsx5(
|
|
629
|
+
"div",
|
|
677
630
|
{
|
|
678
|
-
type: "button",
|
|
679
|
-
onClick: () => {
|
|
680
|
-
if (onClear) return onClear();
|
|
681
|
-
rest.onChange?.({ target: { value: "" } });
|
|
682
|
-
},
|
|
683
631
|
className: cn(
|
|
684
|
-
"
|
|
685
|
-
"
|
|
686
|
-
|
|
687
|
-
|
|
632
|
+
"absolute left-3 top-1/2 -translate-y-1/2 z-10",
|
|
633
|
+
"text-muted-foreground transition-colors duration-200",
|
|
634
|
+
// highlight icon when input (or controls) focused
|
|
635
|
+
"group-focus-within:text-primary"
|
|
688
636
|
),
|
|
689
|
-
|
|
690
|
-
"aria-label": "Clear input",
|
|
691
|
-
children: /* @__PURE__ */ jsx5(X, { className: sizeStyles8[size].icon })
|
|
637
|
+
children: /* @__PURE__ */ jsx5(LeftIcon, { className: sizeStyles8[size].icon })
|
|
692
638
|
}
|
|
693
639
|
),
|
|
694
|
-
|
|
695
|
-
"
|
|
640
|
+
/* @__PURE__ */ jsx5(
|
|
641
|
+
"input",
|
|
696
642
|
{
|
|
697
|
-
|
|
698
|
-
|
|
643
|
+
ref,
|
|
644
|
+
type: actualType,
|
|
645
|
+
...value !== void 0 ? { value } : {},
|
|
646
|
+
maxLength,
|
|
647
|
+
required,
|
|
648
|
+
id: resolvedId,
|
|
649
|
+
autoComplete: type === "password" ? "current-password" : type === "email" ? "email" : rest.autoComplete,
|
|
650
|
+
onFocus: handleFocus,
|
|
651
|
+
onBlur: handleBlur,
|
|
652
|
+
onInvalid: (e) => {
|
|
653
|
+
e.preventDefault();
|
|
654
|
+
const key = getErrorKey(e.currentTarget.validity);
|
|
655
|
+
setLocalError(tv(key));
|
|
656
|
+
},
|
|
657
|
+
onInput: () => setLocalError(void 0),
|
|
658
|
+
"aria-invalid": !!errMsg,
|
|
659
|
+
"aria-describedby": [errorId, descId].filter(Boolean).join(" ") || void 0,
|
|
699
660
|
className: cn(
|
|
700
|
-
"
|
|
701
|
-
"
|
|
702
|
-
"
|
|
703
|
-
|
|
661
|
+
"w-full text-foreground transition-all duration-200 ease-out",
|
|
662
|
+
"placeholder:text-muted-foreground focus:outline-none focus-visible:outline-none",
|
|
663
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
664
|
+
// Size styles
|
|
665
|
+
sizeStyles8[size].input,
|
|
666
|
+
radiusClass,
|
|
667
|
+
// Icon padding adjustments
|
|
668
|
+
LeftIcon && "pl-10",
|
|
669
|
+
(RightIcon || showPasswordToggle || clearable || loading2 || success || errMsg) && "pr-10",
|
|
670
|
+
// Variant styles
|
|
671
|
+
variantStyles6[variant].container,
|
|
672
|
+
errMsg ? variantStyles6[variant].error : variantStyles6[variant].focus,
|
|
673
|
+
// Reduce visual weight for sm: no default drop shadows
|
|
674
|
+
size !== "sm" && variant !== "minimal" && "shadow-sm",
|
|
675
|
+
size !== "sm" && isFocused && "shadow-md",
|
|
676
|
+
className
|
|
704
677
|
),
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
678
|
+
disabled,
|
|
679
|
+
...restInput
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
/* @__PURE__ */ jsxs5("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1", children: [
|
|
683
|
+
getStatusIcon(),
|
|
684
|
+
RightIcon && !loading2 && !success && !errMsg && /* @__PURE__ */ jsx5(RightIcon, { className: cn("text-muted-foreground", sizeStyles8[size].icon) }),
|
|
685
|
+
clearable && hasValue && !loading2 && /* @__PURE__ */ jsx5(
|
|
686
|
+
"button",
|
|
687
|
+
{
|
|
688
|
+
type: "button",
|
|
689
|
+
onClick: () => {
|
|
690
|
+
if (onClear) return onClear();
|
|
691
|
+
rest.onChange?.({ target: { value: "" } });
|
|
692
|
+
},
|
|
693
|
+
className: cn(
|
|
694
|
+
"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors rounded-sm",
|
|
695
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
|
|
696
|
+
"active:bg-accent active:text-accent-foreground",
|
|
697
|
+
sizeStyles8[size].button
|
|
698
|
+
),
|
|
699
|
+
tabIndex: 0,
|
|
700
|
+
"aria-label": "Clear input",
|
|
701
|
+
children: /* @__PURE__ */ jsx5(X, { className: sizeStyles8[size].icon })
|
|
702
|
+
}
|
|
703
|
+
),
|
|
704
|
+
showPasswordToggle && /* @__PURE__ */ jsx5(
|
|
705
|
+
"button",
|
|
706
|
+
{
|
|
707
|
+
type: "button",
|
|
708
|
+
onClick: () => setShowPassword(!showPassword),
|
|
709
|
+
className: cn(
|
|
710
|
+
"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors rounded-full",
|
|
711
|
+
"focus:outline-none focus-visible:ring-1 focus-visible:ring-ring/40",
|
|
712
|
+
"active:bg-accent/50 active:text-accent-foreground",
|
|
713
|
+
sizeStyles8[size].button
|
|
714
|
+
),
|
|
715
|
+
tabIndex: 0,
|
|
716
|
+
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
717
|
+
children: showPassword ? /* @__PURE__ */ jsx5(EyeOff, { className: sizeStyles8[size].icon }) : /* @__PURE__ */ jsx5(Eye, { className: sizeStyles8[size].icon })
|
|
718
|
+
}
|
|
719
|
+
)
|
|
720
|
+
] }),
|
|
721
|
+
variant === "minimal" && /* @__PURE__ */ jsx5(
|
|
722
|
+
"div",
|
|
723
|
+
{
|
|
724
|
+
className: cn(
|
|
725
|
+
"absolute bottom-0 left-0 h-0.5 bg-gradient-to-r from-primary to-primary/60 transition-all duration-300",
|
|
726
|
+
// default hidden
|
|
727
|
+
"w-0 opacity-0",
|
|
728
|
+
// expand underline when focused within input container
|
|
729
|
+
"group-focus-within:w-full group-focus-within:opacity-100"
|
|
730
|
+
)
|
|
708
731
|
}
|
|
709
732
|
)
|
|
710
733
|
] }),
|
|
711
|
-
|
|
712
|
-
"
|
|
734
|
+
errMsg && /* @__PURE__ */ jsxs5("div", { id: errorId, className: "flex items-center gap-2 text-sm text-destructive animate-in slide-in-from-top-1 duration-200", children: [
|
|
735
|
+
/* @__PURE__ */ jsx5(AlertCircle, { className: "w-4 h-4 flex-shrink-0" }),
|
|
736
|
+
/* @__PURE__ */ jsx5("span", { children: errMsg })
|
|
737
|
+
] }),
|
|
738
|
+
(description || hint) && !errMsg && /* @__PURE__ */ jsx5(
|
|
739
|
+
"p",
|
|
713
740
|
{
|
|
741
|
+
id: descId,
|
|
714
742
|
className: cn(
|
|
715
|
-
"
|
|
716
|
-
//
|
|
717
|
-
"
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
)
|
|
743
|
+
"text-xs transition-colors duration-200",
|
|
744
|
+
// follow focus state of the whole field area
|
|
745
|
+
"text-muted-foreground group-focus-within:text-primary/70"
|
|
746
|
+
),
|
|
747
|
+
children: hint || description
|
|
721
748
|
}
|
|
722
749
|
)
|
|
723
|
-
] })
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
/* @__PURE__ */ jsx5("span", { children: errMsg })
|
|
727
|
-
] }),
|
|
728
|
-
(description || hint) && !errMsg && /* @__PURE__ */ jsx5("p", { id: descId, className: cn(
|
|
729
|
-
"text-xs transition-colors duration-200",
|
|
730
|
-
// follow focus state of the whole field area
|
|
731
|
-
"text-muted-foreground group-focus-within:text-primary/70"
|
|
732
|
-
), children: hint || description })
|
|
733
|
-
] });
|
|
734
|
-
});
|
|
750
|
+
] });
|
|
751
|
+
}
|
|
752
|
+
);
|
|
735
753
|
Input.displayName = "Input";
|
|
736
|
-
var SearchInput = forwardRef3(
|
|
737
|
-
onSearch,
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
}, searchDelay);
|
|
748
|
-
return () => clearTimeout(timer);
|
|
749
|
-
}, [searchValue, onSearch, searchDelay]);
|
|
750
|
-
return /* @__PURE__ */ jsx5(
|
|
751
|
-
Input,
|
|
752
|
-
{
|
|
753
|
-
ref,
|
|
754
|
-
type: "search",
|
|
755
|
-
leftIcon: Search,
|
|
756
|
-
placeholder,
|
|
757
|
-
clearable: true,
|
|
758
|
-
value: searchValue,
|
|
759
|
-
onChange: (e) => setSearchValue(e.target.value),
|
|
760
|
-
onClear: () => setSearchValue(""),
|
|
761
|
-
...props
|
|
762
|
-
}
|
|
763
|
-
);
|
|
764
|
-
});
|
|
765
|
-
SearchInput.displayName = "SearchInput";
|
|
766
|
-
var PasswordInput = forwardRef3(({
|
|
767
|
-
showStrength = false,
|
|
768
|
-
strengthLabels = ["Weak", "Fair", "Good", "Strong"],
|
|
769
|
-
...props
|
|
770
|
-
}, ref) => {
|
|
771
|
-
const getPasswordStrength = (password) => {
|
|
772
|
-
let score = 0;
|
|
773
|
-
if (password.length >= 8) score++;
|
|
774
|
-
if (/[a-z]/.test(password)) score++;
|
|
775
|
-
if (/[A-Z]/.test(password)) score++;
|
|
776
|
-
if (/[0-9]/.test(password)) score++;
|
|
777
|
-
if (/[^A-Za-z0-9]/.test(password)) score++;
|
|
778
|
-
return Math.min(score, 4);
|
|
779
|
-
};
|
|
780
|
-
const strength = showStrength && typeof props.value === "string" ? getPasswordStrength(props.value) : 0;
|
|
781
|
-
const strengthColors = ["bg-destructive", "bg-warning", "bg-warning", "bg-success"];
|
|
782
|
-
const strengthLabel = strengthLabels[strength - 1];
|
|
783
|
-
return /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
784
|
-
/* @__PURE__ */ jsx5(Input, { ref, type: "password", ...props }),
|
|
785
|
-
showStrength && props.value && /* @__PURE__ */ jsxs5("div", { className: "space-y-1", children: [
|
|
786
|
-
/* @__PURE__ */ jsx5("div", { className: "flex gap-1", children: [1, 2, 3, 4].map((level) => /* @__PURE__ */ jsx5(
|
|
787
|
-
"div",
|
|
788
|
-
{
|
|
789
|
-
className: cn(
|
|
790
|
-
"h-1 flex-1 rounded-full transition-colors duration-300",
|
|
791
|
-
level <= strength ? strengthColors[strength - 1] : "bg-muted"
|
|
792
|
-
)
|
|
793
|
-
},
|
|
794
|
-
level
|
|
795
|
-
)) }),
|
|
796
|
-
strengthLabel && /* @__PURE__ */ jsx5("p", { className: cn(
|
|
797
|
-
"text-xs font-medium",
|
|
798
|
-
strength <= 1 ? "text-destructive" : strength <= 2 ? "text-warning" : strength <= 3 ? "text-warning" : "text-success"
|
|
799
|
-
), children: strengthLabel })
|
|
800
|
-
] })
|
|
801
|
-
] });
|
|
802
|
-
});
|
|
803
|
-
PasswordInput.displayName = "PasswordInput";
|
|
804
|
-
var NumberInput = forwardRef3(({
|
|
805
|
-
min,
|
|
806
|
-
max,
|
|
807
|
-
step = 1,
|
|
808
|
-
showSteppers = true,
|
|
809
|
-
onIncrement,
|
|
810
|
-
onDecrement,
|
|
811
|
-
formatThousands = false,
|
|
812
|
-
locale = "vi-VN",
|
|
813
|
-
value,
|
|
814
|
-
onChange,
|
|
815
|
-
...props
|
|
816
|
-
}, ref) => {
|
|
817
|
-
const toNumber = (v) => {
|
|
818
|
-
if (v === "" || v === void 0 || v === null) return 0;
|
|
819
|
-
const n = Number(v);
|
|
820
|
-
return Number.isFinite(n) ? n : 0;
|
|
821
|
-
};
|
|
822
|
-
const format = React4.useCallback(
|
|
823
|
-
(n) => new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(n),
|
|
824
|
-
[locale]
|
|
825
|
-
);
|
|
826
|
-
const parse = (s) => {
|
|
827
|
-
const digits = (s || "").replace(/\D+/g, "");
|
|
828
|
-
return digits ? Number(digits) : NaN;
|
|
829
|
-
};
|
|
830
|
-
const [displayValue, setDisplayValue] = React4.useState(
|
|
831
|
-
formatThousands ? value !== void 0 && value !== null && value !== "" ? format(toNumber(value)) : "" : String(value ?? "")
|
|
832
|
-
);
|
|
833
|
-
const currentValue = toNumber(value);
|
|
834
|
-
React4.useEffect(() => {
|
|
835
|
-
if (formatThousands) {
|
|
836
|
-
const next = value === "" || value === void 0 || value === null ? "" : format(toNumber(value));
|
|
837
|
-
setDisplayValue((prev) => prev === next ? prev : next);
|
|
838
|
-
} else {
|
|
839
|
-
const next = String(value ?? "");
|
|
840
|
-
setDisplayValue((prev) => prev === next ? prev : next);
|
|
841
|
-
}
|
|
842
|
-
}, [value, formatThousands, locale, format]);
|
|
843
|
-
const handleIncrement = () => {
|
|
844
|
-
if (onIncrement) {
|
|
845
|
-
onIncrement();
|
|
846
|
-
} else if (onChange) {
|
|
847
|
-
const newValue = Math.min(currentValue + step, max ?? Infinity);
|
|
848
|
-
if (formatThousands) setDisplayValue(format(newValue));
|
|
849
|
-
onChange({ target: { value: newValue.toString() } });
|
|
850
|
-
}
|
|
851
|
-
};
|
|
852
|
-
const handleDecrement = () => {
|
|
853
|
-
if (onDecrement) {
|
|
854
|
-
onDecrement();
|
|
855
|
-
} else if (onChange) {
|
|
856
|
-
const newValue = Math.max(currentValue - step, min ?? -Infinity);
|
|
857
|
-
if (formatThousands) setDisplayValue(format(newValue));
|
|
858
|
-
onChange({ target: { value: newValue.toString() } });
|
|
859
|
-
}
|
|
860
|
-
};
|
|
861
|
-
return /* @__PURE__ */ jsxs5("div", { className: "relative", children: [
|
|
862
|
-
/* @__PURE__ */ jsx5(
|
|
754
|
+
var SearchInput = forwardRef3(
|
|
755
|
+
({ onSearch, searchDelay = 300, placeholder = "Search...", ...props }, ref) => {
|
|
756
|
+
const [searchValue, setSearchValue] = useState4(props.value || "");
|
|
757
|
+
React4.useEffect(() => {
|
|
758
|
+
if (!onSearch) return;
|
|
759
|
+
const timer = setTimeout(() => {
|
|
760
|
+
onSearch(searchValue);
|
|
761
|
+
}, searchDelay);
|
|
762
|
+
return () => clearTimeout(timer);
|
|
763
|
+
}, [searchValue, onSearch, searchDelay]);
|
|
764
|
+
return /* @__PURE__ */ jsx5(
|
|
863
765
|
Input,
|
|
864
766
|
{
|
|
865
767
|
ref,
|
|
866
|
-
type:
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
768
|
+
type: "search",
|
|
769
|
+
leftIcon: Search,
|
|
770
|
+
placeholder,
|
|
771
|
+
clearable: true,
|
|
772
|
+
value: searchValue,
|
|
773
|
+
onChange: (e) => setSearchValue(e.target.value),
|
|
774
|
+
onClear: () => setSearchValue(""),
|
|
775
|
+
...props
|
|
776
|
+
}
|
|
777
|
+
);
|
|
778
|
+
}
|
|
779
|
+
);
|
|
780
|
+
SearchInput.displayName = "SearchInput";
|
|
781
|
+
var PasswordInput = forwardRef3(
|
|
782
|
+
({ showStrength = false, strengthLabels = ["Weak", "Fair", "Good", "Strong"], ...props }, ref) => {
|
|
783
|
+
const getPasswordStrength = (password) => {
|
|
784
|
+
let score = 0;
|
|
785
|
+
if (password.length >= 8) score++;
|
|
786
|
+
if (/[a-z]/.test(password)) score++;
|
|
787
|
+
if (/[A-Z]/.test(password)) score++;
|
|
788
|
+
if (/[0-9]/.test(password)) score++;
|
|
789
|
+
if (/[^A-Za-z0-9]/.test(password)) score++;
|
|
790
|
+
return Math.min(score, 4);
|
|
791
|
+
};
|
|
792
|
+
const strength = showStrength && typeof props.value === "string" ? getPasswordStrength(props.value) : 0;
|
|
793
|
+
const strengthColors = ["bg-destructive", "bg-warning", "bg-warning", "bg-success"];
|
|
794
|
+
const strengthLabel = strengthLabels[strength - 1];
|
|
795
|
+
return /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
796
|
+
/* @__PURE__ */ jsx5(Input, { ref, type: "password", ...props }),
|
|
797
|
+
showStrength && props.value && /* @__PURE__ */ jsxs5("div", { className: "space-y-1", children: [
|
|
798
|
+
/* @__PURE__ */ jsx5("div", { className: "flex gap-1", children: [1, 2, 3, 4].map((level) => /* @__PURE__ */ jsx5(
|
|
799
|
+
"div",
|
|
800
|
+
{
|
|
801
|
+
className: cn(
|
|
802
|
+
"h-1 flex-1 rounded-full transition-colors duration-300",
|
|
803
|
+
level <= strength ? strengthColors[strength - 1] : "bg-muted"
|
|
804
|
+
)
|
|
805
|
+
},
|
|
806
|
+
level
|
|
807
|
+
)) }),
|
|
808
|
+
strengthLabel && /* @__PURE__ */ jsx5(
|
|
809
|
+
"p",
|
|
810
|
+
{
|
|
811
|
+
className: cn(
|
|
812
|
+
"text-xs font-medium",
|
|
813
|
+
strength <= 1 ? "text-destructive" : strength <= 2 ? "text-warning" : strength <= 3 ? "text-warning" : "text-success"
|
|
814
|
+
),
|
|
815
|
+
children: strengthLabel
|
|
884
816
|
}
|
|
885
|
-
},
|
|
886
|
-
...props,
|
|
887
|
-
className: cn(
|
|
888
|
-
showSteppers && [
|
|
889
|
-
"pr-12",
|
|
890
|
-
// Hide native browser steppers
|
|
891
|
-
"[&::-webkit-outer-spin-button]:appearance-none",
|
|
892
|
-
"[&::-webkit-inner-spin-button]:appearance-none",
|
|
893
|
-
"[&::-webkit-inner-spin-button]:m-0",
|
|
894
|
-
"appearance-none"
|
|
895
|
-
],
|
|
896
|
-
props.className
|
|
897
817
|
)
|
|
818
|
+
] })
|
|
819
|
+
] });
|
|
820
|
+
}
|
|
821
|
+
);
|
|
822
|
+
PasswordInput.displayName = "PasswordInput";
|
|
823
|
+
var NumberInput = forwardRef3(
|
|
824
|
+
({ min, max, step = 1, showSteppers = true, onIncrement, onDecrement, formatThousands = false, locale = "vi-VN", value, onChange, ...props }, ref) => {
|
|
825
|
+
const toNumber = (v) => {
|
|
826
|
+
if (v === "" || v === void 0 || v === null) return 0;
|
|
827
|
+
const n = Number(v);
|
|
828
|
+
return Number.isFinite(n) ? n : 0;
|
|
829
|
+
};
|
|
830
|
+
const format = React4.useCallback((n) => new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(n), [locale]);
|
|
831
|
+
const parse = (s) => {
|
|
832
|
+
const digits = (s || "").replace(/\D+/g, "");
|
|
833
|
+
return digits ? Number(digits) : NaN;
|
|
834
|
+
};
|
|
835
|
+
const [displayValue, setDisplayValue] = React4.useState(
|
|
836
|
+
formatThousands ? value !== void 0 && value !== null && value !== "" ? format(toNumber(value)) : "" : String(value ?? "")
|
|
837
|
+
);
|
|
838
|
+
const currentValue = toNumber(value);
|
|
839
|
+
React4.useEffect(() => {
|
|
840
|
+
if (formatThousands) {
|
|
841
|
+
const next = value === "" || value === void 0 || value === null ? "" : format(toNumber(value));
|
|
842
|
+
setDisplayValue((prev) => prev === next ? prev : next);
|
|
843
|
+
} else {
|
|
844
|
+
const next = String(value ?? "");
|
|
845
|
+
setDisplayValue((prev) => prev === next ? prev : next);
|
|
846
|
+
}
|
|
847
|
+
}, [value, formatThousands, locale, format]);
|
|
848
|
+
const handleIncrement = () => {
|
|
849
|
+
if (onIncrement) {
|
|
850
|
+
onIncrement();
|
|
851
|
+
} else if (onChange) {
|
|
852
|
+
const newValue = Math.min(currentValue + step, max ?? Infinity);
|
|
853
|
+
if (formatThousands) setDisplayValue(format(newValue));
|
|
854
|
+
onChange({ target: { value: newValue.toString() } });
|
|
898
855
|
}
|
|
899
|
-
|
|
900
|
-
|
|
856
|
+
};
|
|
857
|
+
const handleDecrement = () => {
|
|
858
|
+
if (onDecrement) {
|
|
859
|
+
onDecrement();
|
|
860
|
+
} else if (onChange) {
|
|
861
|
+
const newValue = Math.max(currentValue - step, min ?? -Infinity);
|
|
862
|
+
if (formatThousands) setDisplayValue(format(newValue));
|
|
863
|
+
onChange({ target: { value: newValue.toString() } });
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
return /* @__PURE__ */ jsxs5("div", { className: "relative", children: [
|
|
901
867
|
/* @__PURE__ */ jsx5(
|
|
902
|
-
|
|
868
|
+
Input,
|
|
903
869
|
{
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
{
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
"path",
|
|
924
|
-
{
|
|
925
|
-
d: "M4 2L6 6H2L4 2Z",
|
|
926
|
-
fill: "currentColor"
|
|
927
|
-
}
|
|
928
|
-
)
|
|
870
|
+
ref,
|
|
871
|
+
type: formatThousands ? "text" : "number",
|
|
872
|
+
min,
|
|
873
|
+
max,
|
|
874
|
+
step,
|
|
875
|
+
rightIcon: showSteppers ? void 0 : props.rightIcon,
|
|
876
|
+
value: displayValue,
|
|
877
|
+
onChange: (e) => {
|
|
878
|
+
if (!onChange) return;
|
|
879
|
+
if (!formatThousands) return onChange(e);
|
|
880
|
+
const raw = e.target.value;
|
|
881
|
+
const parsed = parse(raw);
|
|
882
|
+
if (Number.isNaN(parsed)) {
|
|
883
|
+
setDisplayValue("");
|
|
884
|
+
onChange({ target: { value: "" } });
|
|
885
|
+
} else {
|
|
886
|
+
const bounded = Math.min(Math.max(parsed, min ?? -Infinity), max ?? Infinity);
|
|
887
|
+
setDisplayValue(format(bounded));
|
|
888
|
+
onChange({ target: { value: bounded.toString() } });
|
|
929
889
|
}
|
|
890
|
+
},
|
|
891
|
+
...props,
|
|
892
|
+
className: cn(
|
|
893
|
+
showSteppers && [
|
|
894
|
+
"pr-12",
|
|
895
|
+
// Hide native browser steppers
|
|
896
|
+
"[&::-webkit-outer-spin-button]:appearance-none",
|
|
897
|
+
"[&::-webkit-inner-spin-button]:appearance-none",
|
|
898
|
+
"[&::-webkit-inner-spin-button]:m-0",
|
|
899
|
+
"appearance-none"
|
|
900
|
+
],
|
|
901
|
+
props.className
|
|
930
902
|
)
|
|
931
903
|
}
|
|
932
904
|
),
|
|
905
|
+
showSteppers && /* @__PURE__ */ jsxs5("div", { className: "absolute right-2 top-1/2 -translate-y-1/2 flex flex-col gap-0.5", children: [
|
|
906
|
+
/* @__PURE__ */ jsx5(
|
|
907
|
+
"button",
|
|
908
|
+
{
|
|
909
|
+
type: "button",
|
|
910
|
+
onClick: handleIncrement,
|
|
911
|
+
disabled: max !== void 0 && currentValue >= max,
|
|
912
|
+
className: cn(
|
|
913
|
+
"flex items-center justify-center w-4 h-4 rounded-sm transition-colors",
|
|
914
|
+
"hover:bg-accent focus:outline-none focus:bg-accent",
|
|
915
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
916
|
+
"text-muted-foreground hover:text-foreground"
|
|
917
|
+
),
|
|
918
|
+
"aria-label": "Increase value",
|
|
919
|
+
children: /* @__PURE__ */ jsx5("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", className: "flex-shrink-0", children: /* @__PURE__ */ jsx5("path", { d: "M4 2L6 6H2L4 2Z", fill: "currentColor" }) })
|
|
920
|
+
}
|
|
921
|
+
),
|
|
922
|
+
/* @__PURE__ */ jsx5(
|
|
923
|
+
"button",
|
|
924
|
+
{
|
|
925
|
+
type: "button",
|
|
926
|
+
onClick: handleDecrement,
|
|
927
|
+
disabled: min !== void 0 && currentValue <= min,
|
|
928
|
+
className: cn(
|
|
929
|
+
"flex items-center justify-center w-4 h-4 rounded-sm transition-colors",
|
|
930
|
+
"hover:bg-accent focus:outline-none focus:bg-accent",
|
|
931
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
932
|
+
"text-muted-foreground hover:text-foreground"
|
|
933
|
+
),
|
|
934
|
+
"aria-label": "Decrease value",
|
|
935
|
+
children: /* @__PURE__ */ jsx5("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", className: "flex-shrink-0", children: /* @__PURE__ */ jsx5("path", { d: "M4 6L2 2H6L4 6Z", fill: "currentColor" }) })
|
|
936
|
+
}
|
|
937
|
+
)
|
|
938
|
+
] })
|
|
939
|
+
] });
|
|
940
|
+
}
|
|
941
|
+
);
|
|
942
|
+
NumberInput.displayName = "NumberInput";
|
|
943
|
+
var Textarea = forwardRef3(
|
|
944
|
+
({ label, error, description, variant = "default", resize = "vertical", counter = false, className, required, value, maxLength, ...props }, ref) => {
|
|
945
|
+
const [isFocused, setIsFocused] = useState4(false);
|
|
946
|
+
const charCount = typeof value === "string" ? value.length : 0;
|
|
947
|
+
const variantStyles6 = {
|
|
948
|
+
default: "bg-background border border-input hover:border-accent-foreground/20 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
949
|
+
filled: "bg-muted/50 border border-transparent hover:bg-muted/70 focus-visible:outline-none focus-visible:bg-background focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
950
|
+
outlined: "bg-transparent border border-border hover:border-accent-foreground/30 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
951
|
+
minimal: "bg-transparent border-0 border-b border-border hover:border-accent-foreground/30 focus-visible:outline-none focus-visible:border-ring focus-visible:ring-0 rounded-none"
|
|
952
|
+
};
|
|
953
|
+
const resizeClasses = {
|
|
954
|
+
none: "resize-none",
|
|
955
|
+
vertical: "resize-y",
|
|
956
|
+
horizontal: "resize-x",
|
|
957
|
+
both: "resize"
|
|
958
|
+
};
|
|
959
|
+
return /* @__PURE__ */ jsxs5("div", { className: "w-full space-y-2", children: [
|
|
960
|
+
label && /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
|
|
961
|
+
/* @__PURE__ */ jsxs5(
|
|
962
|
+
"label",
|
|
963
|
+
{
|
|
964
|
+
className: cn(
|
|
965
|
+
"text-sm font-medium transition-colors duration-200",
|
|
966
|
+
isFocused ? "text-primary" : "text-foreground",
|
|
967
|
+
error && "text-destructive"
|
|
968
|
+
),
|
|
969
|
+
children: [
|
|
970
|
+
label,
|
|
971
|
+
required && /* @__PURE__ */ jsx5("span", { className: "text-destructive ml-1", children: "*" })
|
|
972
|
+
]
|
|
973
|
+
}
|
|
974
|
+
),
|
|
975
|
+
counter && maxLength && /* @__PURE__ */ jsxs5(
|
|
976
|
+
"span",
|
|
977
|
+
{
|
|
978
|
+
className: cn(
|
|
979
|
+
"text-xs transition-colors duration-200",
|
|
980
|
+
charCount > maxLength * 0.9 ? "text-warning" : "text-muted-foreground",
|
|
981
|
+
charCount >= maxLength && "text-destructive"
|
|
982
|
+
),
|
|
983
|
+
children: [
|
|
984
|
+
charCount,
|
|
985
|
+
"/",
|
|
986
|
+
maxLength
|
|
987
|
+
]
|
|
988
|
+
}
|
|
989
|
+
)
|
|
990
|
+
] }),
|
|
933
991
|
/* @__PURE__ */ jsx5(
|
|
934
|
-
"
|
|
992
|
+
"textarea",
|
|
935
993
|
{
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
994
|
+
ref,
|
|
995
|
+
value,
|
|
996
|
+
maxLength,
|
|
997
|
+
required,
|
|
998
|
+
onFocus: () => setIsFocused(true),
|
|
999
|
+
onBlur: () => setIsFocused(false),
|
|
939
1000
|
className: cn(
|
|
940
|
-
"
|
|
941
|
-
"
|
|
942
|
-
"disabled:
|
|
943
|
-
|
|
1001
|
+
"w-full rounded-lg px-4 py-3 text-sm text-foreground transition-all duration-200",
|
|
1002
|
+
"placeholder:text-muted-foreground focus:outline-none min-h-[80px]",
|
|
1003
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1004
|
+
variantStyles6[variant],
|
|
1005
|
+
// DÒNG NÀY ĐÃ ĐƯỢC CẬP NHẬT:
|
|
1006
|
+
error && "border-destructive focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-destructive focus-visible:ring-offset-1 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
1007
|
+
resizeClasses[resize],
|
|
1008
|
+
isFocused && "shadow-md",
|
|
1009
|
+
variant !== "minimal" && "shadow-sm",
|
|
1010
|
+
className
|
|
944
1011
|
),
|
|
945
|
-
|
|
946
|
-
children: /* @__PURE__ */ jsx5(
|
|
947
|
-
"svg",
|
|
948
|
-
{
|
|
949
|
-
width: "8",
|
|
950
|
-
height: "8",
|
|
951
|
-
viewBox: "0 0 8 8",
|
|
952
|
-
fill: "none",
|
|
953
|
-
className: "flex-shrink-0",
|
|
954
|
-
children: /* @__PURE__ */ jsx5(
|
|
955
|
-
"path",
|
|
956
|
-
{
|
|
957
|
-
d: "M4 6L2 2H6L4 6Z",
|
|
958
|
-
fill: "currentColor"
|
|
959
|
-
}
|
|
960
|
-
)
|
|
961
|
-
}
|
|
962
|
-
)
|
|
1012
|
+
...props
|
|
963
1013
|
}
|
|
964
|
-
)
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
})
|
|
968
|
-
NumberInput.displayName = "NumberInput";
|
|
969
|
-
var Textarea = forwardRef3(({
|
|
970
|
-
label,
|
|
971
|
-
error,
|
|
972
|
-
description,
|
|
973
|
-
variant = "default",
|
|
974
|
-
resize = "vertical",
|
|
975
|
-
counter = false,
|
|
976
|
-
className,
|
|
977
|
-
required,
|
|
978
|
-
value,
|
|
979
|
-
maxLength,
|
|
980
|
-
...props
|
|
981
|
-
}, ref) => {
|
|
982
|
-
const [isFocused, setIsFocused] = useState4(false);
|
|
983
|
-
const charCount = typeof value === "string" ? value.length : 0;
|
|
984
|
-
const variantStyles6 = {
|
|
985
|
-
default: "bg-background border border-input hover:border-accent-foreground/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
986
|
-
filled: "bg-muted/50 border border-transparent hover:bg-muted/70 focus-visible:outline-none focus-visible:bg-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
987
|
-
outlined: "bg-transparent border border-border hover:border-accent-foreground/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
988
|
-
minimal: "bg-transparent border-0 border-b border-border hover:border-accent-foreground/30 focus-visible:outline-none focus-visible:border-ring focus-visible:ring-0 rounded-none"
|
|
989
|
-
};
|
|
990
|
-
const resizeClasses = {
|
|
991
|
-
none: "resize-none",
|
|
992
|
-
vertical: "resize-y",
|
|
993
|
-
horizontal: "resize-x",
|
|
994
|
-
both: "resize"
|
|
995
|
-
};
|
|
996
|
-
return /* @__PURE__ */ jsxs5("div", { className: "w-full space-y-2", children: [
|
|
997
|
-
label && /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
|
|
998
|
-
/* @__PURE__ */ jsxs5("label", { className: cn(
|
|
999
|
-
"text-sm font-medium transition-colors duration-200",
|
|
1000
|
-
isFocused ? "text-primary" : "text-foreground",
|
|
1001
|
-
error && "text-destructive"
|
|
1002
|
-
), children: [
|
|
1003
|
-
label,
|
|
1004
|
-
required && /* @__PURE__ */ jsx5("span", { className: "text-destructive ml-1", children: "*" })
|
|
1014
|
+
),
|
|
1015
|
+
error && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 text-sm text-destructive animate-in slide-in-from-top-1 duration-200", children: [
|
|
1016
|
+
/* @__PURE__ */ jsx5(AlertCircle, { className: "w-4 h-4 flex-shrink-0" }),
|
|
1017
|
+
/* @__PURE__ */ jsx5("span", { children: error })
|
|
1005
1018
|
] }),
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
), children: [
|
|
1011
|
-
charCount,
|
|
1012
|
-
"/",
|
|
1013
|
-
maxLength
|
|
1014
|
-
] })
|
|
1015
|
-
] }),
|
|
1016
|
-
/* @__PURE__ */ jsx5(
|
|
1017
|
-
"textarea",
|
|
1018
|
-
{
|
|
1019
|
-
ref,
|
|
1020
|
-
value,
|
|
1021
|
-
maxLength,
|
|
1022
|
-
required,
|
|
1023
|
-
onFocus: () => setIsFocused(true),
|
|
1024
|
-
onBlur: () => setIsFocused(false),
|
|
1025
|
-
className: cn(
|
|
1026
|
-
"w-full rounded-lg px-4 py-3 text-sm text-foreground transition-all duration-200",
|
|
1027
|
-
"placeholder:text-muted-foreground focus:outline-none min-h-[80px]",
|
|
1028
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1029
|
-
variantStyles6[variant],
|
|
1030
|
-
error && "border-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-destructive focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:border-transparent",
|
|
1031
|
-
resizeClasses[resize],
|
|
1032
|
-
isFocused && "shadow-md",
|
|
1033
|
-
variant !== "minimal" && "shadow-sm",
|
|
1034
|
-
className
|
|
1035
|
-
),
|
|
1036
|
-
...props
|
|
1037
|
-
}
|
|
1038
|
-
),
|
|
1039
|
-
error && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 text-sm text-destructive animate-in slide-in-from-top-1 duration-200", children: [
|
|
1040
|
-
/* @__PURE__ */ jsx5(AlertCircle, { className: "w-4 h-4 flex-shrink-0" }),
|
|
1041
|
-
/* @__PURE__ */ jsx5("span", { children: error })
|
|
1042
|
-
] }),
|
|
1043
|
-
description && !error && /* @__PURE__ */ jsx5("p", { className: cn(
|
|
1044
|
-
"text-xs transition-colors duration-200",
|
|
1045
|
-
isFocused ? "text-primary/70" : "text-muted-foreground"
|
|
1046
|
-
), children: description })
|
|
1047
|
-
] });
|
|
1048
|
-
});
|
|
1019
|
+
description && !error && /* @__PURE__ */ jsx5("p", { className: cn("text-xs transition-colors duration-200", isFocused ? "text-primary/70" : "text-muted-foreground"), children: description })
|
|
1020
|
+
] });
|
|
1021
|
+
}
|
|
1022
|
+
);
|
|
1049
1023
|
Textarea.displayName = "Textarea";
|
|
1050
1024
|
var Input_default = Input;
|
|
1051
1025
|
|
|
@@ -1315,35 +1289,124 @@ var Label = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1315
1289
|
));
|
|
1316
1290
|
Label.displayName = "Label";
|
|
1317
1291
|
|
|
1292
|
+
// ../../components/ui/SmartImage.tsx
|
|
1293
|
+
import Image from "next/image";
|
|
1294
|
+
import React7 from "react";
|
|
1295
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1296
|
+
var DEFAULT_FALLBACK = "/images/products/hoa-hong-do.png";
|
|
1297
|
+
var FAILED_SRCS = /* @__PURE__ */ new Set();
|
|
1298
|
+
function SmartImage({
|
|
1299
|
+
src,
|
|
1300
|
+
alt,
|
|
1301
|
+
className,
|
|
1302
|
+
ratioClass,
|
|
1303
|
+
roundedClass = "rounded-lg",
|
|
1304
|
+
fill = true,
|
|
1305
|
+
width,
|
|
1306
|
+
height,
|
|
1307
|
+
sizes = "(max-width: 768px) 100vw, 33vw",
|
|
1308
|
+
priority = false,
|
|
1309
|
+
quality = 80,
|
|
1310
|
+
fit = "cover",
|
|
1311
|
+
objectPosition,
|
|
1312
|
+
fallbackSrc = DEFAULT_FALLBACK
|
|
1313
|
+
}) {
|
|
1314
|
+
const normalize = (input) => {
|
|
1315
|
+
if (!input || input.length === 0) return fallbackSrc;
|
|
1316
|
+
const raw = input.trim();
|
|
1317
|
+
if (raw.startsWith("/images/products/") && /\.(jpg|jpeg)($|\?)/i.test(raw)) {
|
|
1318
|
+
return raw.replace(/\.(jpg|jpeg)(?=$|\?)/i, ".png");
|
|
1319
|
+
}
|
|
1320
|
+
if (raw.startsWith("//")) {
|
|
1321
|
+
return `https:${raw}`;
|
|
1322
|
+
}
|
|
1323
|
+
if (/^(https?:|data:|blob:)/i.test(raw)) {
|
|
1324
|
+
return FAILED_SRCS.has(raw) ? fallbackSrc : raw;
|
|
1325
|
+
}
|
|
1326
|
+
if (raw.startsWith("/")) {
|
|
1327
|
+
return FAILED_SRCS.has(raw) ? fallbackSrc : raw;
|
|
1328
|
+
}
|
|
1329
|
+
const normalized = `/${raw.replace(/^\.\/?/, "")}`;
|
|
1330
|
+
return FAILED_SRCS.has(normalized) ? fallbackSrc : normalized;
|
|
1331
|
+
};
|
|
1332
|
+
const [resolvedSrc, setResolvedSrc] = React7.useState(() => normalize(src));
|
|
1333
|
+
React7.useEffect(() => {
|
|
1334
|
+
setResolvedSrc(normalize(src));
|
|
1335
|
+
}, [src]);
|
|
1336
|
+
const handleError = () => {
|
|
1337
|
+
if (resolvedSrc && resolvedSrc !== fallbackSrc) FAILED_SRCS.add(resolvedSrc);
|
|
1338
|
+
if (resolvedSrc.endsWith(".jpg")) {
|
|
1339
|
+
const next = resolvedSrc.replace(/\.jpg($|\?)/, ".png$1");
|
|
1340
|
+
setResolvedSrc(next);
|
|
1341
|
+
} else if (resolvedSrc !== fallbackSrc) {
|
|
1342
|
+
setResolvedSrc(fallbackSrc);
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
const Wrapper = ({ children }) => /* @__PURE__ */ jsx9(
|
|
1346
|
+
"div",
|
|
1347
|
+
{
|
|
1348
|
+
className: cn(
|
|
1349
|
+
"relative overflow-hidden bg-muted/30",
|
|
1350
|
+
// remove any default focus outline/ring for visual consistency with Card
|
|
1351
|
+
"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0",
|
|
1352
|
+
ratioClass,
|
|
1353
|
+
roundedClass,
|
|
1354
|
+
className
|
|
1355
|
+
),
|
|
1356
|
+
children
|
|
1357
|
+
}
|
|
1358
|
+
);
|
|
1359
|
+
if (fill) {
|
|
1360
|
+
return /* @__PURE__ */ jsx9(Wrapper, { children: /* @__PURE__ */ jsx9(
|
|
1361
|
+
Image,
|
|
1362
|
+
{
|
|
1363
|
+
src: resolvedSrc,
|
|
1364
|
+
alt,
|
|
1365
|
+
fill: true,
|
|
1366
|
+
sizes,
|
|
1367
|
+
onError: handleError,
|
|
1368
|
+
priority,
|
|
1369
|
+
quality,
|
|
1370
|
+
style: { objectFit: fit, objectPosition }
|
|
1371
|
+
}
|
|
1372
|
+
) });
|
|
1373
|
+
}
|
|
1374
|
+
return /* @__PURE__ */ jsx9(
|
|
1375
|
+
"div",
|
|
1376
|
+
{
|
|
1377
|
+
className: cn(
|
|
1378
|
+
"relative overflow-hidden bg-muted/30",
|
|
1379
|
+
"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0",
|
|
1380
|
+
roundedClass,
|
|
1381
|
+
className
|
|
1382
|
+
),
|
|
1383
|
+
children: /* @__PURE__ */ jsx9(
|
|
1384
|
+
Image,
|
|
1385
|
+
{
|
|
1386
|
+
src: resolvedSrc,
|
|
1387
|
+
alt,
|
|
1388
|
+
width,
|
|
1389
|
+
height,
|
|
1390
|
+
sizes,
|
|
1391
|
+
onError: handleError,
|
|
1392
|
+
priority,
|
|
1393
|
+
quality,
|
|
1394
|
+
style: { objectFit: fit, objectPosition, width: "100%", height: "100%" }
|
|
1395
|
+
}
|
|
1396
|
+
)
|
|
1397
|
+
}
|
|
1398
|
+
);
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1318
1401
|
// ../../components/ui/Avatar.tsx
|
|
1319
|
-
import
|
|
1320
|
-
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1402
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1321
1403
|
var sizeClasses = {
|
|
1322
1404
|
sm: "h-8 w-8 text-sm",
|
|
1323
1405
|
md: "h-10 w-10 text-base",
|
|
1324
1406
|
lg: "h-14 w-14 text-lg"
|
|
1325
1407
|
};
|
|
1326
1408
|
var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onClick, ...props }) => {
|
|
1327
|
-
const
|
|
1328
|
-
const [isImageLoading, setIsImageLoading] = React7.useState(!!src);
|
|
1329
|
-
const [imageError, setImageError] = React7.useState(false);
|
|
1330
|
-
React7.useEffect(() => {
|
|
1331
|
-
if (src) {
|
|
1332
|
-
setIsImageLoading(true);
|
|
1333
|
-
setImageError(false);
|
|
1334
|
-
setLoaded(false);
|
|
1335
|
-
}
|
|
1336
|
-
}, [src]);
|
|
1337
|
-
const handleImageLoad = () => {
|
|
1338
|
-
setLoaded(true);
|
|
1339
|
-
setIsImageLoading(false);
|
|
1340
|
-
};
|
|
1341
|
-
const handleImageError = () => {
|
|
1342
|
-
setLoaded(false);
|
|
1343
|
-
setIsImageLoading(false);
|
|
1344
|
-
setImageError(true);
|
|
1345
|
-
};
|
|
1346
|
-
const hasValidSrc = src && src.trim().length > 0;
|
|
1409
|
+
const hasValidSrc = !!(src && src.trim().length > 0);
|
|
1347
1410
|
return /* @__PURE__ */ jsxs8(
|
|
1348
1411
|
"div",
|
|
1349
1412
|
{
|
|
@@ -1356,23 +1419,21 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
|
|
|
1356
1419
|
onClick,
|
|
1357
1420
|
...props,
|
|
1358
1421
|
children: [
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
hasValidSrc && !imageError && // eslint-disable-next-line @next/next/no-img-element
|
|
1362
|
-
/* @__PURE__ */ jsx9(
|
|
1363
|
-
"img",
|
|
1422
|
+
hasValidSrc && /* @__PURE__ */ jsx10("div", { className: "absolute inset-0", children: /* @__PURE__ */ jsx10(
|
|
1423
|
+
SmartImage,
|
|
1364
1424
|
{
|
|
1365
1425
|
src,
|
|
1366
1426
|
alt,
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
className:
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1427
|
+
fill: true,
|
|
1428
|
+
ratioClass: void 0,
|
|
1429
|
+
className: "h-full w-full",
|
|
1430
|
+
roundedClass: "rounded-full",
|
|
1431
|
+
fit: "cover",
|
|
1432
|
+
objectPosition: "center",
|
|
1433
|
+
quality: 80
|
|
1373
1434
|
}
|
|
1374
|
-
),
|
|
1375
|
-
|
|
1435
|
+
) }),
|
|
1436
|
+
!hasValidSrc && /* @__PURE__ */ jsx10(
|
|
1376
1437
|
"span",
|
|
1377
1438
|
{
|
|
1378
1439
|
className: cn(
|
|
@@ -1382,7 +1443,7 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
|
|
|
1382
1443
|
children: fallback
|
|
1383
1444
|
}
|
|
1384
1445
|
),
|
|
1385
|
-
/* @__PURE__ */
|
|
1446
|
+
/* @__PURE__ */ jsx10("div", { className: "absolute bottom-0 right-0 w-3 h-3 bg-success border-2 border-background rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-200" })
|
|
1386
1447
|
]
|
|
1387
1448
|
}
|
|
1388
1449
|
);
|
|
@@ -1390,7 +1451,7 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
|
|
|
1390
1451
|
var Avatar_default = Avatar;
|
|
1391
1452
|
|
|
1392
1453
|
// ../../components/ui/Skeleton.tsx
|
|
1393
|
-
import { jsx as
|
|
1454
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1394
1455
|
var Skeleton = ({
|
|
1395
1456
|
className,
|
|
1396
1457
|
width,
|
|
@@ -1411,7 +1472,7 @@ var Skeleton = ({
|
|
|
1411
1472
|
none: ""
|
|
1412
1473
|
};
|
|
1413
1474
|
if (variant === "text" && lines > 1) {
|
|
1414
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ jsx11("div", { className: cn("space-y-2", className), children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx11(
|
|
1415
1476
|
"div",
|
|
1416
1477
|
{
|
|
1417
1478
|
className: cn(
|
|
@@ -1429,7 +1490,7 @@ var Skeleton = ({
|
|
|
1429
1490
|
index
|
|
1430
1491
|
)) });
|
|
1431
1492
|
}
|
|
1432
|
-
return /* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ jsx11(
|
|
1433
1494
|
"div",
|
|
1434
1495
|
{
|
|
1435
1496
|
className: cn(
|
|
@@ -1451,7 +1512,7 @@ var SkeletonAvatar = ({
|
|
|
1451
1512
|
md: "w-10 h-10",
|
|
1452
1513
|
lg: "w-12 h-12"
|
|
1453
1514
|
};
|
|
1454
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ jsx11(
|
|
1455
1516
|
Skeleton,
|
|
1456
1517
|
{
|
|
1457
1518
|
variant: "circular",
|
|
@@ -1468,7 +1529,7 @@ var SkeletonButton = ({
|
|
|
1468
1529
|
md: "h-10 w-24",
|
|
1469
1530
|
lg: "h-12 w-28"
|
|
1470
1531
|
};
|
|
1471
|
-
return /* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ jsx11(
|
|
1472
1533
|
Skeleton,
|
|
1473
1534
|
{
|
|
1474
1535
|
variant: "rounded",
|
|
@@ -1481,7 +1542,7 @@ var SkeletonText = ({
|
|
|
1481
1542
|
className,
|
|
1482
1543
|
width = "100%"
|
|
1483
1544
|
}) => {
|
|
1484
|
-
return /* @__PURE__ */
|
|
1545
|
+
return /* @__PURE__ */ jsx11(
|
|
1485
1546
|
Skeleton,
|
|
1486
1547
|
{
|
|
1487
1548
|
variant: "text",
|
|
@@ -1497,42 +1558,42 @@ var SkeletonCard = ({
|
|
|
1497
1558
|
textLines = 3,
|
|
1498
1559
|
className
|
|
1499
1560
|
}) => {
|
|
1500
|
-
return /* @__PURE__ */ jsxs9("div", { className: cn("p-4 space-y-4 rounded-lg
|
|
1561
|
+
return /* @__PURE__ */ jsxs9("div", { className: cn("p-4 space-y-4 rounded-lg bg-card outline-none focus:outline-none", className), children: [
|
|
1501
1562
|
showAvatar && /* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-3", children: [
|
|
1502
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ jsx11(SkeletonAvatar, {}),
|
|
1503
1564
|
/* @__PURE__ */ jsxs9("div", { className: "space-y-2", children: [
|
|
1504
|
-
/* @__PURE__ */
|
|
1505
|
-
/* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-4 w-24" }),
|
|
1566
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-16" })
|
|
1506
1567
|
] })
|
|
1507
1568
|
] }),
|
|
1508
|
-
showImage && /* @__PURE__ */
|
|
1509
|
-
/* @__PURE__ */
|
|
1569
|
+
showImage && /* @__PURE__ */ jsx11(Skeleton, { className: "h-48 w-full rounded-md" }),
|
|
1570
|
+
/* @__PURE__ */ jsx11(SkeletonText, { lines: textLines }),
|
|
1510
1571
|
/* @__PURE__ */ jsxs9("div", { className: "flex space-x-2", children: [
|
|
1511
|
-
/* @__PURE__ */
|
|
1512
|
-
/* @__PURE__ */
|
|
1572
|
+
/* @__PURE__ */ jsx11(SkeletonButton, { size: "sm" }),
|
|
1573
|
+
/* @__PURE__ */ jsx11(SkeletonButton, { size: "sm" })
|
|
1513
1574
|
] })
|
|
1514
1575
|
] });
|
|
1515
1576
|
};
|
|
1516
1577
|
var SkeletonPost = ({ className }) => {
|
|
1517
|
-
return /* @__PURE__ */ jsxs9("div", { className: cn("p-6 space-y-4 rounded-xl
|
|
1578
|
+
return /* @__PURE__ */ jsxs9("div", { className: cn("p-6 space-y-4 rounded-xl bg-card outline-none focus:outline-none", className), children: [
|
|
1518
1579
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-3", children: [
|
|
1519
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ jsx11(SkeletonAvatar, { size: "lg" }),
|
|
1520
1581
|
/* @__PURE__ */ jsxs9("div", { className: "space-y-2", children: [
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
/* @__PURE__ */
|
|
1582
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-4 w-32" }),
|
|
1583
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-20" })
|
|
1523
1584
|
] })
|
|
1524
1585
|
] }),
|
|
1525
|
-
/* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ jsx11(SkeletonText, { lines: 2 }),
|
|
1587
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-64 w-full rounded-lg" }),
|
|
1527
1588
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-4", children: [
|
|
1528
|
-
/* @__PURE__ */
|
|
1529
|
-
/* @__PURE__ */
|
|
1530
|
-
/* @__PURE__ */
|
|
1589
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-16" }),
|
|
1590
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-20" }),
|
|
1591
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-12" })
|
|
1531
1592
|
] }),
|
|
1532
|
-
/* @__PURE__ */
|
|
1533
|
-
/* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1593
|
+
/* @__PURE__ */ jsx11("div", { className: "flex items-center justify-between pt-2", children: /* @__PURE__ */ jsxs9("div", { className: "flex space-x-4", children: [
|
|
1594
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-8 w-16" }),
|
|
1595
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-8 w-20" }),
|
|
1596
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-8 w-16" })
|
|
1536
1597
|
] }) })
|
|
1537
1598
|
] });
|
|
1538
1599
|
};
|
|
@@ -1546,16 +1607,16 @@ var SkeletonMessage = ({
|
|
|
1546
1607
|
own && "flex-row-reverse space-x-reverse",
|
|
1547
1608
|
className
|
|
1548
1609
|
), children: [
|
|
1549
|
-
showAvatar && !own && /* @__PURE__ */
|
|
1610
|
+
showAvatar && !own && /* @__PURE__ */ jsx11(SkeletonAvatar, { size: "sm" }),
|
|
1550
1611
|
/* @__PURE__ */ jsxs9("div", { className: cn(
|
|
1551
1612
|
"max-w-xs space-y-1",
|
|
1552
1613
|
own ? "items-end" : "items-start"
|
|
1553
1614
|
), children: [
|
|
1554
|
-
/* @__PURE__ */
|
|
1615
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: cn(
|
|
1555
1616
|
"h-10 rounded-2xl",
|
|
1556
1617
|
own ? "w-32 bg-primary/20" : "w-40 bg-muted"
|
|
1557
1618
|
) }),
|
|
1558
|
-
/* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-12" })
|
|
1559
1620
|
] })
|
|
1560
1621
|
] });
|
|
1561
1622
|
};
|
|
@@ -1565,13 +1626,13 @@ var SkeletonList = ({
|
|
|
1565
1626
|
showAvatar = true,
|
|
1566
1627
|
className
|
|
1567
1628
|
}) => {
|
|
1568
|
-
return /* @__PURE__ */
|
|
1569
|
-
showAvatar && /* @__PURE__ */
|
|
1629
|
+
return /* @__PURE__ */ jsx11("div", { className: cn("space-y-3", className), children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-3 p-3 rounded-lg", children: [
|
|
1630
|
+
showAvatar && /* @__PURE__ */ jsx11(SkeletonAvatar, {}),
|
|
1570
1631
|
/* @__PURE__ */ jsxs9("div", { className: "flex-1 space-y-2", children: [
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1632
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-4 w-3/4" }),
|
|
1633
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-3 w-1/2" })
|
|
1573
1634
|
] }),
|
|
1574
|
-
/* @__PURE__ */
|
|
1635
|
+
/* @__PURE__ */ jsx11(Skeleton, { className: "h-6 w-16" })
|
|
1575
1636
|
] }, index)) });
|
|
1576
1637
|
};
|
|
1577
1638
|
var SkeletonTable = ({
|
|
@@ -1580,8 +1641,8 @@ var SkeletonTable = ({
|
|
|
1580
1641
|
className
|
|
1581
1642
|
}) => {
|
|
1582
1643
|
return /* @__PURE__ */ jsxs9("div", { className: cn("space-y-3", className), children: [
|
|
1583
|
-
/* @__PURE__ */
|
|
1584
|
-
Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ jsx11("div", { className: "flex space-x-4 p-3", children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsx11(Skeleton, { className: "h-4 flex-1" }, index)) }),
|
|
1645
|
+
Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ jsx11("div", { className: "flex space-x-4 p-3", children: Array.from({ length: columns }).map((_2, colIndex) => /* @__PURE__ */ jsx11(Skeleton, { className: "h-4 flex-1" }, colIndex)) }, rowIndex))
|
|
1585
1646
|
] });
|
|
1586
1647
|
};
|
|
1587
1648
|
var Skeleton_default = Skeleton;
|
|
@@ -1589,7 +1650,7 @@ var Skeleton_default = Skeleton;
|
|
|
1589
1650
|
// ../../components/ui/Progress.tsx
|
|
1590
1651
|
import React8 from "react";
|
|
1591
1652
|
import { Check as Check2, X as X2, Clock } from "lucide-react";
|
|
1592
|
-
import { Fragment as Fragment2, jsx as
|
|
1653
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1593
1654
|
var variantStyles2 = {
|
|
1594
1655
|
default: "bg-muted-foreground",
|
|
1595
1656
|
primary: "bg-gradient-to-r from-primary via-primary/90 to-primary",
|
|
@@ -1624,26 +1685,26 @@ var Progress = ({
|
|
|
1624
1685
|
const labelId = React8.useId();
|
|
1625
1686
|
const descId = React8.useId();
|
|
1626
1687
|
const getStatusIcon = () => {
|
|
1627
|
-
if (isComplete) return /* @__PURE__ */
|
|
1628
|
-
if (isError) return /* @__PURE__ */
|
|
1629
|
-
if (animated || indeterminate) return /* @__PURE__ */
|
|
1688
|
+
if (isComplete) return /* @__PURE__ */ jsx12(Check2, { className: "w-4 h-4 text-success" });
|
|
1689
|
+
if (isError) return /* @__PURE__ */ jsx12(X2, { className: "w-4 h-4 text-destructive" });
|
|
1690
|
+
if (animated || indeterminate) return /* @__PURE__ */ jsx12(Clock, { className: "w-4 h-4 text-muted-foreground animate-spin" });
|
|
1630
1691
|
return null;
|
|
1631
1692
|
};
|
|
1632
1693
|
return /* @__PURE__ */ jsxs10("div", { className: cn("w-full space-y-3", className), children: [
|
|
1633
1694
|
(label || showValue || description) && /* @__PURE__ */ jsxs10("div", { className: "space-y-1", children: [
|
|
1634
1695
|
/* @__PURE__ */ jsxs10("div", { className: "flex justify-between items-center", children: [
|
|
1635
1696
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
1636
|
-
label && /* @__PURE__ */
|
|
1697
|
+
label && /* @__PURE__ */ jsx12("span", { id: labelId, className: "font-medium text-foreground", children: label }),
|
|
1637
1698
|
getStatusIcon()
|
|
1638
1699
|
] }),
|
|
1639
|
-
showValue && !indeterminate && /* @__PURE__ */
|
|
1700
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx12("span", { className: cn(
|
|
1640
1701
|
"text-sm font-medium",
|
|
1641
1702
|
isComplete ? "text-success" : isError ? "text-destructive" : "text-muted-foreground"
|
|
1642
1703
|
), children: isComplete ? "Complete" : isError ? "Error" : `${Math.round(percentage)}%` })
|
|
1643
1704
|
] }),
|
|
1644
|
-
description && /* @__PURE__ */
|
|
1705
|
+
description && /* @__PURE__ */ jsx12("p", { id: descId, className: "text-sm text-muted-foreground", children: description })
|
|
1645
1706
|
] }),
|
|
1646
|
-
/* @__PURE__ */
|
|
1707
|
+
/* @__PURE__ */ jsx12(
|
|
1647
1708
|
"div",
|
|
1648
1709
|
{
|
|
1649
1710
|
role: "progressbar",
|
|
@@ -1657,7 +1718,7 @@ var Progress = ({
|
|
|
1657
1718
|
"border border-border/50",
|
|
1658
1719
|
sizeStyles2[size]
|
|
1659
1720
|
),
|
|
1660
|
-
children: /* @__PURE__ */
|
|
1721
|
+
children: /* @__PURE__ */ jsx12(
|
|
1661
1722
|
"div",
|
|
1662
1723
|
{
|
|
1663
1724
|
className: cn(
|
|
@@ -1710,8 +1771,8 @@ var CircularProgress = ({
|
|
|
1710
1771
|
info: "stroke-info"
|
|
1711
1772
|
};
|
|
1712
1773
|
const getContentIcon = () => {
|
|
1713
|
-
if (isComplete) return /* @__PURE__ */
|
|
1714
|
-
if (isError) return /* @__PURE__ */
|
|
1774
|
+
if (isComplete) return /* @__PURE__ */ jsx12(Check2, { className: "w-5 h-5 text-success" });
|
|
1775
|
+
if (isError) return /* @__PURE__ */ jsx12(X2, { className: "w-5 h-5 text-destructive" });
|
|
1715
1776
|
return null;
|
|
1716
1777
|
};
|
|
1717
1778
|
return /* @__PURE__ */ jsxs10(
|
|
@@ -1735,7 +1796,7 @@ var CircularProgress = ({
|
|
|
1735
1796
|
),
|
|
1736
1797
|
style: { animationDuration: indeterminate ? "2s" : void 0 },
|
|
1737
1798
|
children: [
|
|
1738
|
-
/* @__PURE__ */
|
|
1799
|
+
/* @__PURE__ */ jsx12(
|
|
1739
1800
|
"circle",
|
|
1740
1801
|
{
|
|
1741
1802
|
cx: size / 2,
|
|
@@ -1747,7 +1808,7 @@ var CircularProgress = ({
|
|
|
1747
1808
|
className: trackColor
|
|
1748
1809
|
}
|
|
1749
1810
|
),
|
|
1750
|
-
/* @__PURE__ */
|
|
1811
|
+
/* @__PURE__ */ jsx12(
|
|
1751
1812
|
"circle",
|
|
1752
1813
|
{
|
|
1753
1814
|
cx: size / 2,
|
|
@@ -1771,13 +1832,13 @@ var CircularProgress = ({
|
|
|
1771
1832
|
]
|
|
1772
1833
|
}
|
|
1773
1834
|
),
|
|
1774
|
-
/* @__PURE__ */
|
|
1835
|
+
/* @__PURE__ */ jsx12("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center", children: children ? children : /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
1775
1836
|
getContentIcon(),
|
|
1776
|
-
showValue && !indeterminate && /* @__PURE__ */
|
|
1837
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx12("span", { className: cn(
|
|
1777
1838
|
"text-sm font-semibold",
|
|
1778
1839
|
isComplete ? "text-success" : isError ? "text-destructive" : "text-foreground"
|
|
1779
1840
|
), children: isComplete ? "\u2713" : isError ? "\u2717" : `${Math.round(percentage)}%` }),
|
|
1780
|
-
indeterminate && /* @__PURE__ */
|
|
1841
|
+
indeterminate && /* @__PURE__ */ jsx12(Clock, { className: "w-4 h-4 text-muted-foreground animate-pulse" })
|
|
1781
1842
|
] }) })
|
|
1782
1843
|
]
|
|
1783
1844
|
}
|
|
@@ -1800,10 +1861,10 @@ var StepProgress = ({
|
|
|
1800
1861
|
if (stepIndex === currentStep) return "current";
|
|
1801
1862
|
return "upcoming";
|
|
1802
1863
|
};
|
|
1803
|
-
return /* @__PURE__ */
|
|
1864
|
+
return /* @__PURE__ */ jsx12("div", { className: cn("w-full", className), role: "list", "aria-label": "Progress steps", children: /* @__PURE__ */ jsx12("div", { className: "flex items-center justify-between", children: steps.map((step, index) => {
|
|
1804
1865
|
const status = getStepStatus(index);
|
|
1805
1866
|
return /* @__PURE__ */ jsxs10("div", { className: "flex items-center", role: "listitem", "aria-current": status === "current" ? "step" : void 0, children: [
|
|
1806
|
-
/* @__PURE__ */
|
|
1867
|
+
/* @__PURE__ */ jsx12(
|
|
1807
1868
|
"div",
|
|
1808
1869
|
{
|
|
1809
1870
|
className: cn(
|
|
@@ -1824,10 +1885,10 @@ var StepProgress = ({
|
|
|
1824
1885
|
"hover:border-muted-foreground/50"
|
|
1825
1886
|
]
|
|
1826
1887
|
),
|
|
1827
|
-
children: status === "completed" ? /* @__PURE__ */
|
|
1888
|
+
children: status === "completed" ? /* @__PURE__ */ jsx12(Check2, { className: "w-3 h-3" }) : index + 1
|
|
1828
1889
|
}
|
|
1829
1890
|
),
|
|
1830
|
-
/* @__PURE__ */
|
|
1891
|
+
/* @__PURE__ */ jsx12(
|
|
1831
1892
|
"span",
|
|
1832
1893
|
{
|
|
1833
1894
|
className: cn(
|
|
@@ -1839,7 +1900,7 @@ var StepProgress = ({
|
|
|
1839
1900
|
children: step
|
|
1840
1901
|
}
|
|
1841
1902
|
),
|
|
1842
|
-
index < steps.length - 1 && /* @__PURE__ */
|
|
1903
|
+
index < steps.length - 1 && /* @__PURE__ */ jsx12(
|
|
1843
1904
|
"div",
|
|
1844
1905
|
{
|
|
1845
1906
|
className: cn(
|
|
@@ -1860,7 +1921,7 @@ var MiniProgress = ({
|
|
|
1860
1921
|
}) => {
|
|
1861
1922
|
const percentage = Math.min(Math.max(value / max * 100, 0), 100);
|
|
1862
1923
|
return /* @__PURE__ */ jsxs10("div", { className: cn("flex items-center gap-2", className), children: [
|
|
1863
|
-
/* @__PURE__ */
|
|
1924
|
+
/* @__PURE__ */ jsx12(
|
|
1864
1925
|
"div",
|
|
1865
1926
|
{
|
|
1866
1927
|
className: "flex-1 h-1.5 bg-muted/50 rounded-full overflow-hidden",
|
|
@@ -1868,7 +1929,7 @@ var MiniProgress = ({
|
|
|
1868
1929
|
"aria-valuemin": 0,
|
|
1869
1930
|
"aria-valuemax": max,
|
|
1870
1931
|
"aria-valuenow": Math.round(percentage),
|
|
1871
|
-
children: /* @__PURE__ */
|
|
1932
|
+
children: /* @__PURE__ */ jsx12(
|
|
1872
1933
|
"div",
|
|
1873
1934
|
{
|
|
1874
1935
|
className: cn(
|
|
@@ -1903,8 +1964,8 @@ var BatteryProgress = ({
|
|
|
1903
1964
|
return /* @__PURE__ */ jsxs10("div", { className: cn("flex items-center gap-2", className), children: [
|
|
1904
1965
|
/* @__PURE__ */ jsxs10("div", { className: "relative", role: "progressbar", "aria-label": "Battery level", "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": Math.round(percentage), children: [
|
|
1905
1966
|
/* @__PURE__ */ jsxs10("div", { className: "w-6 h-3 border-2 border-foreground/20 rounded-sm relative", children: [
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__PURE__ */ jsx12("div", { className: "absolute -right-1 top-0.5 w-0.5 h-1 bg-foreground/20 rounded-r-sm" }),
|
|
1968
|
+
/* @__PURE__ */ jsx12(
|
|
1908
1969
|
"div",
|
|
1909
1970
|
{
|
|
1910
1971
|
className: cn(
|
|
@@ -1916,7 +1977,7 @@ var BatteryProgress = ({
|
|
|
1916
1977
|
}
|
|
1917
1978
|
)
|
|
1918
1979
|
] }),
|
|
1919
|
-
charging && /* @__PURE__ */
|
|
1980
|
+
charging && /* @__PURE__ */ jsx12("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx12("div", { className: "w-2 h-2 text-info-foreground", children: "\u26A1" }) })
|
|
1920
1981
|
] }),
|
|
1921
1982
|
showValue && /* @__PURE__ */ jsxs10("span", { className: cn(
|
|
1922
1983
|
"text-xs font-medium",
|
|
@@ -1939,7 +2000,7 @@ var SegmentedProgress = ({
|
|
|
1939
2000
|
md: "h-2",
|
|
1940
2001
|
lg: "h-3"
|
|
1941
2002
|
};
|
|
1942
|
-
return /* @__PURE__ */
|
|
2003
|
+
return /* @__PURE__ */ jsx12(
|
|
1943
2004
|
"div",
|
|
1944
2005
|
{
|
|
1945
2006
|
className: cn("flex gap-1", className),
|
|
@@ -1947,7 +2008,7 @@ var SegmentedProgress = ({
|
|
|
1947
2008
|
"aria-valuemin": 0,
|
|
1948
2009
|
"aria-valuemax": segments,
|
|
1949
2010
|
"aria-valuenow": activeSegments,
|
|
1950
|
-
children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */
|
|
2011
|
+
children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */ jsx12(
|
|
1951
2012
|
"div",
|
|
1952
2013
|
{
|
|
1953
2014
|
className: cn(
|
|
@@ -1975,13 +2036,13 @@ var LoadingProgress = ({
|
|
|
1975
2036
|
const getStatusIcon = () => {
|
|
1976
2037
|
switch (status) {
|
|
1977
2038
|
case "complete":
|
|
1978
|
-
return /* @__PURE__ */
|
|
2039
|
+
return /* @__PURE__ */ jsx12(Check2, { className: "w-4 h-4 text-success" });
|
|
1979
2040
|
case "error":
|
|
1980
|
-
return /* @__PURE__ */
|
|
2041
|
+
return /* @__PURE__ */ jsx12(X2, { className: "w-4 h-4 text-destructive" });
|
|
1981
2042
|
case "paused":
|
|
1982
|
-
return /* @__PURE__ */
|
|
2043
|
+
return /* @__PURE__ */ jsx12(Clock, { className: "w-4 h-4 text-warning" });
|
|
1983
2044
|
default:
|
|
1984
|
-
return /* @__PURE__ */
|
|
2045
|
+
return /* @__PURE__ */ jsx12("div", { className: "w-2 h-2 bg-primary rounded-full animate-bounce" });
|
|
1985
2046
|
}
|
|
1986
2047
|
};
|
|
1987
2048
|
const getStatusColor = () => {
|
|
@@ -2000,11 +2061,11 @@ var LoadingProgress = ({
|
|
|
2000
2061
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between text-sm", children: [
|
|
2001
2062
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
2002
2063
|
getStatusIcon(),
|
|
2003
|
-
label && /* @__PURE__ */
|
|
2064
|
+
label && /* @__PURE__ */ jsx12("span", { className: "font-medium text-foreground", children: label })
|
|
2004
2065
|
] }),
|
|
2005
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground", children: status === "complete" ? "Complete" : `${Math.round(percentage)}%` })
|
|
2006
2067
|
] }),
|
|
2007
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ jsx12(
|
|
2008
2069
|
"div",
|
|
2009
2070
|
{
|
|
2010
2071
|
className: "w-full h-2 bg-muted/50 rounded-full overflow-hidden",
|
|
@@ -2013,7 +2074,7 @@ var LoadingProgress = ({
|
|
|
2013
2074
|
"aria-valuemax": max,
|
|
2014
2075
|
"aria-valuenow": Math.round(percentage),
|
|
2015
2076
|
"aria-label": label || "Loading progress",
|
|
2016
|
-
children: /* @__PURE__ */
|
|
2077
|
+
children: /* @__PURE__ */ jsx12(
|
|
2017
2078
|
"div",
|
|
2018
2079
|
{
|
|
2019
2080
|
className: cn(
|
|
@@ -2027,8 +2088,8 @@ var LoadingProgress = ({
|
|
|
2027
2088
|
}
|
|
2028
2089
|
),
|
|
2029
2090
|
(speed || timeRemaining) && /* @__PURE__ */ jsxs10("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
|
|
2030
|
-
speed && /* @__PURE__ */
|
|
2031
|
-
timeRemaining && /* @__PURE__ */
|
|
2091
|
+
speed && /* @__PURE__ */ jsx12("span", { children: speed }),
|
|
2092
|
+
timeRemaining && /* @__PURE__ */ jsx12("span", { children: timeRemaining })
|
|
2032
2093
|
] })
|
|
2033
2094
|
] });
|
|
2034
2095
|
};
|
|
@@ -2037,7 +2098,7 @@ var LoadingProgress = ({
|
|
|
2037
2098
|
import * as React9 from "react";
|
|
2038
2099
|
import { createPortal } from "react-dom";
|
|
2039
2100
|
import { X as X3 } from "lucide-react";
|
|
2040
|
-
import { jsx as
|
|
2101
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2041
2102
|
var sizeStyles3 = {
|
|
2042
2103
|
sm: "max-w-sm",
|
|
2043
2104
|
md: "max-w-md",
|
|
@@ -2109,7 +2170,7 @@ var Modal = ({
|
|
|
2109
2170
|
return null;
|
|
2110
2171
|
}
|
|
2111
2172
|
const modalContent = /* @__PURE__ */ jsxs11("div", { className: cn("fixed inset-0 z-[9999] flex items-center justify-center", overlayClassName), onClick: handleOverlayClick, children: [
|
|
2112
|
-
/* @__PURE__ */
|
|
2173
|
+
/* @__PURE__ */ jsx13(
|
|
2113
2174
|
"div",
|
|
2114
2175
|
{
|
|
2115
2176
|
className: "absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-200 ease-out",
|
|
@@ -2137,10 +2198,10 @@ var Modal = ({
|
|
|
2137
2198
|
children: [
|
|
2138
2199
|
(title || description || showCloseButton) && /* @__PURE__ */ jsxs11("div", { className: "flex items-start justify-between p-6 pb-0", children: [
|
|
2139
2200
|
/* @__PURE__ */ jsxs11("div", { className: "space-y-1.5", children: [
|
|
2140
|
-
title && /* @__PURE__ */
|
|
2141
|
-
description && /* @__PURE__ */
|
|
2201
|
+
title && /* @__PURE__ */ jsx13("h2", { className: "text-lg font-semibold leading-none tracking-tight", children: title }),
|
|
2202
|
+
description && /* @__PURE__ */ jsx13("p", { className: "text-sm text-muted-foreground", children: description })
|
|
2142
2203
|
] }),
|
|
2143
|
-
showCloseButton && /* @__PURE__ */
|
|
2204
|
+
showCloseButton && /* @__PURE__ */ jsx13(
|
|
2144
2205
|
"button",
|
|
2145
2206
|
{
|
|
2146
2207
|
onClick: onClose,
|
|
@@ -2149,11 +2210,11 @@ var Modal = ({
|
|
|
2149
2210
|
"hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
2150
2211
|
"disabled:pointer-events-none "
|
|
2151
2212
|
),
|
|
2152
|
-
children: /* @__PURE__ */
|
|
2213
|
+
children: /* @__PURE__ */ jsx13(X3, { className: "h-4 w-4 cursor-pointer" })
|
|
2153
2214
|
}
|
|
2154
2215
|
)
|
|
2155
2216
|
] }),
|
|
2156
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx13("div", { className: "p-6", children })
|
|
2157
2218
|
]
|
|
2158
2219
|
}
|
|
2159
2220
|
)
|
|
@@ -2163,9 +2224,9 @@ var Modal = ({
|
|
|
2163
2224
|
var Modal_default = Modal;
|
|
2164
2225
|
|
|
2165
2226
|
// ../../components/ui/Toast.tsx
|
|
2166
|
-
import { createContext, useContext, useState as
|
|
2227
|
+
import { createContext, useContext, useState as useState8, useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
2167
2228
|
import { X as X4, CheckCircle as CheckCircle2, AlertCircle as AlertCircle2, Info, AlertTriangle as AlertTriangle2 } from "lucide-react";
|
|
2168
|
-
import { jsx as
|
|
2229
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2169
2230
|
var ToastContext = createContext(void 0);
|
|
2170
2231
|
var useToast = () => {
|
|
2171
2232
|
const context = useContext(ToastContext);
|
|
@@ -2179,7 +2240,7 @@ var ToastProvider = ({
|
|
|
2179
2240
|
position = "top-right",
|
|
2180
2241
|
maxToasts = 5
|
|
2181
2242
|
}) => {
|
|
2182
|
-
const [toasts, setToasts] =
|
|
2243
|
+
const [toasts, setToasts] = useState8([]);
|
|
2183
2244
|
const idRef = useRef2(0);
|
|
2184
2245
|
const removeToast = useCallback2((id) => {
|
|
2185
2246
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
@@ -2207,17 +2268,17 @@ var ToastProvider = ({
|
|
|
2207
2268
|
};
|
|
2208
2269
|
return /* @__PURE__ */ jsxs12(ToastContext.Provider, { value: { addToast, removeToast, toasts }, children: [
|
|
2209
2270
|
children,
|
|
2210
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ jsx14("div", { className: cn("fixed z-50 flex flex-col gap-2 pointer-events-none", positionClasses[position]), "aria-live": "polite", "aria-atomic": true, children: toasts.map((toast) => /* @__PURE__ */ jsx14(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
|
|
2211
2272
|
] });
|
|
2212
2273
|
};
|
|
2213
2274
|
var ToastComponent = ({ toast, onRemove }) => {
|
|
2214
|
-
const [isVisible, setIsVisible] =
|
|
2215
|
-
const [progress, setProgress] =
|
|
2216
|
-
const [paused, setPaused] =
|
|
2217
|
-
const [startTs] =
|
|
2275
|
+
const [isVisible, setIsVisible] = useState8(false);
|
|
2276
|
+
const [progress, setProgress] = useState8(100);
|
|
2277
|
+
const [paused, setPaused] = useState8(false);
|
|
2278
|
+
const [startTs] = useState8(() => Date.now());
|
|
2218
2279
|
const total = toast.duration && toast.duration > 0 ? toast.duration : 5e3;
|
|
2219
|
-
const [remaining, setRemaining] =
|
|
2220
|
-
|
|
2280
|
+
const [remaining, setRemaining] = useState8(total);
|
|
2281
|
+
useEffect2(() => {
|
|
2221
2282
|
setIsVisible(true);
|
|
2222
2283
|
if (toast.duration === 0) return;
|
|
2223
2284
|
let raf;
|
|
@@ -2280,11 +2341,11 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2280
2341
|
onMouseLeave: () => setPaused(false),
|
|
2281
2342
|
children: [
|
|
2282
2343
|
/* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-3 p-4", children: [
|
|
2283
|
-
/* @__PURE__ */
|
|
2344
|
+
/* @__PURE__ */ jsx14(Icon, { className: cn("h-5 w-5 mt-0.5 shrink-0", config.iconClassName) }),
|
|
2284
2345
|
/* @__PURE__ */ jsxs12("div", { className: "flex-1 space-y-1", children: [
|
|
2285
|
-
toast.title && /* @__PURE__ */
|
|
2286
|
-
/* @__PURE__ */
|
|
2287
|
-
toast.action && /* @__PURE__ */
|
|
2346
|
+
toast.title && /* @__PURE__ */ jsx14("h4", { className: "font-medium text-sm leading-none", children: toast.title }),
|
|
2347
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sm text-muted-foreground leading-relaxed", children: toast.message }),
|
|
2348
|
+
toast.action && /* @__PURE__ */ jsx14(
|
|
2288
2349
|
"button",
|
|
2289
2350
|
{
|
|
2290
2351
|
onClick: () => {
|
|
@@ -2296,7 +2357,7 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2296
2357
|
}
|
|
2297
2358
|
)
|
|
2298
2359
|
] }),
|
|
2299
|
-
(toast.dismissible ?? true) && /* @__PURE__ */
|
|
2360
|
+
(toast.dismissible ?? true) && /* @__PURE__ */ jsx14(
|
|
2300
2361
|
"button",
|
|
2301
2362
|
{
|
|
2302
2363
|
onClick: handleRemove,
|
|
@@ -2305,11 +2366,11 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2305
2366
|
"transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-primary/50"
|
|
2306
2367
|
),
|
|
2307
2368
|
"aria-label": "Close toast",
|
|
2308
|
-
children: /* @__PURE__ */
|
|
2369
|
+
children: /* @__PURE__ */ jsx14(X4, { className: "h-4 w-4" })
|
|
2309
2370
|
}
|
|
2310
2371
|
)
|
|
2311
2372
|
] }),
|
|
2312
|
-
toast.duration !== 0 && /* @__PURE__ */
|
|
2373
|
+
toast.duration !== 0 && /* @__PURE__ */ jsx14("div", { className: "absolute left-0 right-0 bottom-0 h-1 bg-transparent", children: /* @__PURE__ */ jsx14(
|
|
2313
2374
|
"div",
|
|
2314
2375
|
{
|
|
2315
2376
|
className: cn(
|
|
@@ -2331,7 +2392,7 @@ var Toast_default = ToastProvider;
|
|
|
2331
2392
|
// ../../components/ui/Tooltip.tsx
|
|
2332
2393
|
import * as React11 from "react";
|
|
2333
2394
|
import { createPortal as createPortal2 } from "react-dom";
|
|
2334
|
-
import { Fragment as Fragment3, jsx as
|
|
2395
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2335
2396
|
var variantStyles3 = {
|
|
2336
2397
|
default: "bg-popover text-popover-foreground border-border",
|
|
2337
2398
|
info: "bg-info text-info-foreground border-info/20",
|
|
@@ -2426,7 +2487,7 @@ var Tooltip = ({
|
|
|
2426
2487
|
onBlur: handleBlur
|
|
2427
2488
|
}),
|
|
2428
2489
|
isMounted && isOpen && position && createPortal2(
|
|
2429
|
-
/* @__PURE__ */
|
|
2490
|
+
/* @__PURE__ */ jsx15(
|
|
2430
2491
|
"div",
|
|
2431
2492
|
{
|
|
2432
2493
|
style: {
|
|
@@ -2557,7 +2618,7 @@ var useShadCNAnimations = () => {
|
|
|
2557
2618
|
};
|
|
2558
2619
|
|
|
2559
2620
|
// ../../components/ui/Popover.tsx
|
|
2560
|
-
import { Fragment as Fragment4, jsx as
|
|
2621
|
+
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2561
2622
|
var Popover = ({
|
|
2562
2623
|
trigger,
|
|
2563
2624
|
children,
|
|
@@ -2669,7 +2730,7 @@ var Popover = ({
|
|
|
2669
2730
|
setIsOpen(next);
|
|
2670
2731
|
}
|
|
2671
2732
|
};
|
|
2672
|
-
const popoverContent = isOpen && dropdownPosition ? /* @__PURE__ */
|
|
2733
|
+
const popoverContent = isOpen && dropdownPosition ? /* @__PURE__ */ jsx16(
|
|
2673
2734
|
"div",
|
|
2674
2735
|
{
|
|
2675
2736
|
"data-popover": true,
|
|
@@ -2690,7 +2751,7 @@ var Popover = ({
|
|
|
2690
2751
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
2691
2752
|
className
|
|
2692
2753
|
),
|
|
2693
|
-
children: /* @__PURE__ */
|
|
2754
|
+
children: /* @__PURE__ */ jsx16(
|
|
2694
2755
|
"div",
|
|
2695
2756
|
{
|
|
2696
2757
|
className: cn(
|
|
@@ -2733,7 +2794,7 @@ var Popover = ({
|
|
|
2733
2794
|
import * as React13 from "react";
|
|
2734
2795
|
import { createPortal as createPortal4 } from "react-dom";
|
|
2735
2796
|
import { X as X5 } from "lucide-react";
|
|
2736
|
-
import { jsx as
|
|
2797
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2737
2798
|
var sizeStyles4 = {
|
|
2738
2799
|
sm: {
|
|
2739
2800
|
right: "w-[300px]",
|
|
@@ -2861,7 +2922,7 @@ var Sheet = ({
|
|
|
2861
2922
|
};
|
|
2862
2923
|
if (!mounted || !open && !isVisible) return null;
|
|
2863
2924
|
const sheetContent = /* @__PURE__ */ jsxs15("div", { className: "fixed inset-0 z-50", children: [
|
|
2864
|
-
/* @__PURE__ */
|
|
2925
|
+
/* @__PURE__ */ jsx17(
|
|
2865
2926
|
"div",
|
|
2866
2927
|
{
|
|
2867
2928
|
className: cn(
|
|
@@ -2894,14 +2955,14 @@ var Sheet = ({
|
|
|
2894
2955
|
transition: "transform 300ms cubic-bezier(0.4, 0, 0.2, 1)"
|
|
2895
2956
|
},
|
|
2896
2957
|
children: [
|
|
2897
|
-
(title || description || header || showClose) && /* @__PURE__ */
|
|
2958
|
+
(title || description || header || showClose) && /* @__PURE__ */ jsx17("div", { className: "flex-shrink-0 border-b border-border", children: header || /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between p-4", children: [
|
|
2898
2959
|
/* @__PURE__ */ jsxs15("div", { className: "flex-1", children: [
|
|
2899
|
-
title && /* @__PURE__ */
|
|
2900
|
-
description && /* @__PURE__ */
|
|
2960
|
+
title && /* @__PURE__ */ jsx17("h2", { className: "text-lg font-semibold text-foreground", children: title }),
|
|
2961
|
+
description && /* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground mt-1", children: description })
|
|
2901
2962
|
] }),
|
|
2902
|
-
showClose && /* @__PURE__ */
|
|
2963
|
+
showClose && /* @__PURE__ */ jsx17(Button_default, { variant: "ghost", size: "sm", onClick: handleClose, className: "h-8 w-8 p-0 rounded-md cursor-pointer", icon: X5 })
|
|
2903
2964
|
] }) }),
|
|
2904
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ jsx17(
|
|
2905
2966
|
"div",
|
|
2906
2967
|
{
|
|
2907
2968
|
className: "flex-1 overflow-auto p-4",
|
|
@@ -2913,7 +2974,7 @@ var Sheet = ({
|
|
|
2913
2974
|
children
|
|
2914
2975
|
}
|
|
2915
2976
|
),
|
|
2916
|
-
footer && /* @__PURE__ */
|
|
2977
|
+
footer && /* @__PURE__ */ jsx17("div", { className: "flex-shrink-0 border-t border-border p-4", children: footer })
|
|
2917
2978
|
]
|
|
2918
2979
|
}
|
|
2919
2980
|
)
|
|
@@ -2921,38 +2982,38 @@ var Sheet = ({
|
|
|
2921
2982
|
return typeof window !== "undefined" ? createPortal4(sheetContent, document.body) : null;
|
|
2922
2983
|
};
|
|
2923
2984
|
var Drawer = ({ placement = "right", ...props }) => {
|
|
2924
|
-
return /* @__PURE__ */
|
|
2985
|
+
return /* @__PURE__ */ jsx17(Sheet, { ...props, side: placement, variant: "overlay" });
|
|
2925
2986
|
};
|
|
2926
2987
|
var SlideOver = (props) => {
|
|
2927
|
-
return /* @__PURE__ */
|
|
2988
|
+
return /* @__PURE__ */ jsx17(Sheet, { ...props, side: "right", variant: "overlay", size: "lg" });
|
|
2928
2989
|
};
|
|
2929
2990
|
var BottomSheet = ({ snapPoints = ["25%", "50%", "90%"], defaultSnap = 1, ...props }) => {
|
|
2930
|
-
return /* @__PURE__ */
|
|
2991
|
+
return /* @__PURE__ */ jsx17(Sheet, { ...props, side: "bottom", variant: "overlay", className: cn("rounded-t-lg", props.className) });
|
|
2931
2992
|
};
|
|
2932
2993
|
var SidebarSheet = ({ navigation, children, ...props }) => {
|
|
2933
2994
|
return /* @__PURE__ */ jsxs15(Sheet, { ...props, side: "left", variant: "push", size: "md", children: [
|
|
2934
|
-
navigation && /* @__PURE__ */
|
|
2995
|
+
navigation && /* @__PURE__ */ jsx17("div", { className: "border-b border-border pb-4 mb-4", children: navigation }),
|
|
2935
2996
|
children
|
|
2936
2997
|
] });
|
|
2937
2998
|
};
|
|
2938
2999
|
|
|
2939
3000
|
// ../../components/ui/Alert.tsx
|
|
2940
|
-
import { useState as
|
|
3001
|
+
import { useState as useState12 } from "react";
|
|
2941
3002
|
|
|
2942
3003
|
// ../../components/icons/AlertIcons.tsx
|
|
2943
3004
|
import { Info as Info2, AlertTriangle as AlertTriangle3, CheckCircle2 as CheckCircle22, OctagonX } from "lucide-react";
|
|
2944
|
-
import { jsx as
|
|
3005
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2945
3006
|
function InfoIcon(props) {
|
|
2946
|
-
return /* @__PURE__ */
|
|
3007
|
+
return /* @__PURE__ */ jsx18(Info2, { "aria-hidden": true, className: props.className });
|
|
2947
3008
|
}
|
|
2948
3009
|
function WarningIcon(props) {
|
|
2949
|
-
return /* @__PURE__ */
|
|
3010
|
+
return /* @__PURE__ */ jsx18(AlertTriangle3, { "aria-hidden": true, className: props.className });
|
|
2950
3011
|
}
|
|
2951
3012
|
function CheckCircleIcon(props) {
|
|
2952
|
-
return /* @__PURE__ */
|
|
3013
|
+
return /* @__PURE__ */ jsx18(CheckCircle22, { "aria-hidden": true, className: props.className });
|
|
2953
3014
|
}
|
|
2954
3015
|
function ErrorIcon(props) {
|
|
2955
|
-
return /* @__PURE__ */
|
|
3016
|
+
return /* @__PURE__ */ jsx18(OctagonX, { "aria-hidden": true, className: props.className });
|
|
2956
3017
|
}
|
|
2957
3018
|
|
|
2958
3019
|
// ../../components/ui/Alert.tsx
|
|
@@ -2970,16 +3031,16 @@ var VARIANT_STYLES_ALERT = {
|
|
|
2970
3031
|
};
|
|
2971
3032
|
|
|
2972
3033
|
// ../../components/ui/Alert.tsx
|
|
2973
|
-
import { jsx as
|
|
3034
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2974
3035
|
var variantIcons = {
|
|
2975
|
-
default: /* @__PURE__ */
|
|
2976
|
-
info: /* @__PURE__ */
|
|
2977
|
-
success: /* @__PURE__ */
|
|
2978
|
-
warning: /* @__PURE__ */
|
|
2979
|
-
error: /* @__PURE__ */
|
|
3036
|
+
default: /* @__PURE__ */ jsx19(InfoIcon, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3037
|
+
info: /* @__PURE__ */ jsx19(InfoIcon, { className: "h-4 w-4 text-info" }),
|
|
3038
|
+
success: /* @__PURE__ */ jsx19(CheckCircleIcon, { className: "h-4 w-4 text-success" }),
|
|
3039
|
+
warning: /* @__PURE__ */ jsx19(WarningIcon, { className: "h-4 w-4 text-warning" }),
|
|
3040
|
+
error: /* @__PURE__ */ jsx19(ErrorIcon, { className: "h-4 w-4 text-destructive" })
|
|
2980
3041
|
};
|
|
2981
3042
|
var Alert = ({ title, description, variant = "default", className, icon, dismissible = false, onClose, actions, closeAriaLabel }) => {
|
|
2982
|
-
const [open, setOpen] =
|
|
3043
|
+
const [open, setOpen] = useState12(true);
|
|
2983
3044
|
const t = useTranslations2("Common");
|
|
2984
3045
|
if (!open) return null;
|
|
2985
3046
|
const handleClose = () => {
|
|
@@ -2993,19 +3054,19 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
2993
3054
|
role: "alert",
|
|
2994
3055
|
"aria-live": variant === "error" ? "assertive" : "polite",
|
|
2995
3056
|
children: [
|
|
2996
|
-
/* @__PURE__ */
|
|
3057
|
+
/* @__PURE__ */ jsx19("div", { className: "pt-1", children: icon ?? variantIcons[variant] }),
|
|
2997
3058
|
/* @__PURE__ */ jsxs16("div", { className: "flex-1 min-w-0", children: [
|
|
2998
|
-
title && /* @__PURE__ */
|
|
2999
|
-
description && (typeof description === "string" ? /* @__PURE__ */
|
|
3000
|
-
actions && /* @__PURE__ */
|
|
3059
|
+
title && /* @__PURE__ */ jsx19("p", { className: "font-semibold text-sm leading-none mb-1 text-foreground", children: title }),
|
|
3060
|
+
description && (typeof description === "string" ? /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground leading-relaxed break-words", children: description }) : /* @__PURE__ */ jsx19("div", { className: "text-sm text-muted-foreground leading-relaxed break-words", children: description })),
|
|
3061
|
+
actions && /* @__PURE__ */ jsx19("div", { className: "mt-2 flex flex-wrap gap-2", children: actions })
|
|
3001
3062
|
] }),
|
|
3002
|
-
dismissible && /* @__PURE__ */
|
|
3063
|
+
dismissible && /* @__PURE__ */ jsx19(
|
|
3003
3064
|
"button",
|
|
3004
3065
|
{
|
|
3005
3066
|
onClick: handleClose,
|
|
3006
3067
|
className: "rounded-md p-1 hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3007
3068
|
"aria-label": closeAriaLabel || t("closeAlert"),
|
|
3008
|
-
children: /* @__PURE__ */
|
|
3069
|
+
children: /* @__PURE__ */ jsx19(X6, { className: "h-4 w-4" })
|
|
3009
3070
|
}
|
|
3010
3071
|
)
|
|
3011
3072
|
]
|
|
@@ -3015,7 +3076,7 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
3015
3076
|
var Alert_default = Alert;
|
|
3016
3077
|
|
|
3017
3078
|
// ../../components/ui/GlobalLoading.tsx
|
|
3018
|
-
import React14, { useEffect as
|
|
3079
|
+
import React14, { useEffect as useEffect6, useState as useState13 } from "react";
|
|
3019
3080
|
import { Activity as Activity2 } from "lucide-react";
|
|
3020
3081
|
|
|
3021
3082
|
// ../../lib/utils/loading.ts
|
|
@@ -3061,20 +3122,20 @@ var loading = new LoadingManager();
|
|
|
3061
3122
|
|
|
3062
3123
|
// ../../components/ui/GlobalLoading.tsx
|
|
3063
3124
|
import { useTranslations as useTranslations3 } from "next-intl";
|
|
3064
|
-
import { jsx as
|
|
3125
|
+
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3065
3126
|
var GlobalLoading = ({
|
|
3066
3127
|
className,
|
|
3067
3128
|
backdrop = true,
|
|
3068
3129
|
position = "fixed",
|
|
3069
3130
|
size = "lg"
|
|
3070
3131
|
}) => {
|
|
3071
|
-
const [state, setState] =
|
|
3072
|
-
|
|
3132
|
+
const [state, setState] = useState13(() => loading.getState());
|
|
3133
|
+
useEffect6(() => {
|
|
3073
3134
|
const unsubscribe = loading.subscribe(setState);
|
|
3074
3135
|
return unsubscribe;
|
|
3075
3136
|
}, []);
|
|
3076
3137
|
if (!state.isVisible) return null;
|
|
3077
|
-
return /* @__PURE__ */
|
|
3138
|
+
return /* @__PURE__ */ jsx20(
|
|
3078
3139
|
"div",
|
|
3079
3140
|
{
|
|
3080
3141
|
className: cn(
|
|
@@ -3087,8 +3148,8 @@ var GlobalLoading = ({
|
|
|
3087
3148
|
"aria-modal": true,
|
|
3088
3149
|
"aria-label": "Loading",
|
|
3089
3150
|
children: /* @__PURE__ */ jsxs17("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: [
|
|
3090
|
-
/* @__PURE__ */
|
|
3091
|
-
state.text && /* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ jsx20(Activity2, { className: "w-6 h-6 animate-spin text-primary-background", "aria-hidden": true }),
|
|
3152
|
+
state.text && /* @__PURE__ */ jsx20("span", { className: "text-base font-medium text-foreground", children: state.text })
|
|
3092
3153
|
] })
|
|
3093
3154
|
}
|
|
3094
3155
|
);
|
|
@@ -3099,14 +3160,14 @@ var PageLoading = ({
|
|
|
3099
3160
|
}) => {
|
|
3100
3161
|
const t = useTranslations3("Loading");
|
|
3101
3162
|
const defaultMessage = message || t("loadingPage");
|
|
3102
|
-
return /* @__PURE__ */
|
|
3163
|
+
return /* @__PURE__ */ jsx20("div", { className: cn(
|
|
3103
3164
|
"min-h-screen flex items-center justify-center bg-background",
|
|
3104
3165
|
className
|
|
3105
3166
|
), children: /* @__PURE__ */ jsxs17("div", { className: "text-center space-y-4", children: [
|
|
3106
|
-
/* @__PURE__ */
|
|
3167
|
+
/* @__PURE__ */ jsx20(Activity2, { className: "w-8 h-8 animate-spin text-primary mx-auto" }),
|
|
3107
3168
|
/* @__PURE__ */ jsxs17("div", { children: [
|
|
3108
|
-
/* @__PURE__ */
|
|
3109
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ jsx20("p", { className: "text-lg font-medium text-foreground", children: defaultMessage }),
|
|
3170
|
+
/* @__PURE__ */ jsx20("p", { className: "text-sm text-muted-foreground mt-2", children: t("pleaseWait") })
|
|
3110
3171
|
] })
|
|
3111
3172
|
] }) });
|
|
3112
3173
|
};
|
|
@@ -3123,8 +3184,8 @@ var InlineLoading = ({
|
|
|
3123
3184
|
lg: "w-8 h-8"
|
|
3124
3185
|
};
|
|
3125
3186
|
return /* @__PURE__ */ jsxs17("div", { className: cn("flex items-center justify-center space-x-2", className), children: [
|
|
3126
|
-
/* @__PURE__ */
|
|
3127
|
-
text && /* @__PURE__ */
|
|
3187
|
+
/* @__PURE__ */ jsx20(Activity2, { className: cn("animate-spin text-primary", sizeClasses2[size]) }),
|
|
3188
|
+
text && /* @__PURE__ */ jsx20("span", { className: "text-sm text-muted-foreground animate-pulse", children: text })
|
|
3128
3189
|
] });
|
|
3129
3190
|
};
|
|
3130
3191
|
var ButtonLoading = ({
|
|
@@ -3148,10 +3209,10 @@ var ButtonLoading = ({
|
|
|
3148
3209
|
),
|
|
3149
3210
|
children: [
|
|
3150
3211
|
isLoading && /* @__PURE__ */ jsxs17("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: [
|
|
3151
|
-
/* @__PURE__ */
|
|
3152
|
-
loadingText && /* @__PURE__ */
|
|
3212
|
+
/* @__PURE__ */ jsx20(Activity2, { className: "w-4 h-4 animate-spin text-primary-foreground" }),
|
|
3213
|
+
loadingText && /* @__PURE__ */ jsx20("span", { className: "ml-2 text-sm", children: loadingText })
|
|
3153
3214
|
] }),
|
|
3154
|
-
/* @__PURE__ */
|
|
3215
|
+
/* @__PURE__ */ jsx20("div", { className: cn(isLoading && "opacity-50 pointer-events-none"), children: child })
|
|
3155
3216
|
]
|
|
3156
3217
|
}
|
|
3157
3218
|
);
|
|
@@ -3161,7 +3222,7 @@ var ButtonLoading = ({
|
|
|
3161
3222
|
import * as React15 from "react";
|
|
3162
3223
|
import Link from "next/link";
|
|
3163
3224
|
import { ChevronRight, Home, MoreHorizontal } from "lucide-react";
|
|
3164
|
-
import { jsx as
|
|
3225
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3165
3226
|
var sizeStyles5 = {
|
|
3166
3227
|
sm: {
|
|
3167
3228
|
text: "text-xs",
|
|
@@ -3208,16 +3269,16 @@ var Breadcrumb = ({
|
|
|
3208
3269
|
}, [items.length, maxItems, collapsible]);
|
|
3209
3270
|
const getSeparator = () => {
|
|
3210
3271
|
if (typeof separator === "string") {
|
|
3211
|
-
return /* @__PURE__ */
|
|
3272
|
+
return /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: separator });
|
|
3212
3273
|
}
|
|
3213
3274
|
if (variant === "slash") {
|
|
3214
|
-
return /* @__PURE__ */
|
|
3275
|
+
return /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "/" });
|
|
3215
3276
|
}
|
|
3216
3277
|
if (variant === "arrow") {
|
|
3217
|
-
return /* @__PURE__ */
|
|
3278
|
+
return /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "\u2192" });
|
|
3218
3279
|
}
|
|
3219
3280
|
const SeparatorComponent = separator;
|
|
3220
|
-
return /* @__PURE__ */
|
|
3281
|
+
return /* @__PURE__ */ jsx21(SeparatorComponent, { className: cn("text-muted-foreground", sizeStyles5[size].icon) });
|
|
3221
3282
|
};
|
|
3222
3283
|
const processedItems = React15.useMemo(() => {
|
|
3223
3284
|
let finalItems = [...items];
|
|
@@ -3238,17 +3299,17 @@ var Breadcrumb = ({
|
|
|
3238
3299
|
const handleCollapseToggle = () => {
|
|
3239
3300
|
setIsCollapsed(!isCollapsed);
|
|
3240
3301
|
};
|
|
3241
|
-
return /* @__PURE__ */
|
|
3302
|
+
return /* @__PURE__ */ jsx21(
|
|
3242
3303
|
"nav",
|
|
3243
3304
|
{
|
|
3244
3305
|
className: cn("flex w-full items-center", sizeStyles5[size].text, className),
|
|
3245
3306
|
"aria-label": "Breadcrumb navigation",
|
|
3246
|
-
children: /* @__PURE__ */
|
|
3307
|
+
children: /* @__PURE__ */ jsx21("ol", { className: cn("flex items-center", sizeStyles5[size].spacing), children: processedItems.map((item, index) => {
|
|
3247
3308
|
const isLast = index === processedItems.length - 1;
|
|
3248
3309
|
const isCollapsedIndicator = item.label === "...";
|
|
3249
3310
|
const Icon = item.icon;
|
|
3250
3311
|
return /* @__PURE__ */ jsxs18("li", { className: "flex items-center", children: [
|
|
3251
|
-
isCollapsedIndicator ? /* @__PURE__ */
|
|
3312
|
+
isCollapsedIndicator ? /* @__PURE__ */ jsx21(
|
|
3252
3313
|
"button",
|
|
3253
3314
|
{
|
|
3254
3315
|
onClick: handleCollapseToggle,
|
|
@@ -3259,7 +3320,7 @@ var Breadcrumb = ({
|
|
|
3259
3320
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
|
|
3260
3321
|
),
|
|
3261
3322
|
"aria-label": "Show all breadcrumb items",
|
|
3262
|
-
children: /* @__PURE__ */
|
|
3323
|
+
children: /* @__PURE__ */ jsx21(MoreHorizontal, { className: sizeStyles5[size].icon })
|
|
3263
3324
|
}
|
|
3264
3325
|
) : item.href && !isLast && !item.disabled ? /* @__PURE__ */ jsxs18(
|
|
3265
3326
|
Link,
|
|
@@ -3272,8 +3333,8 @@ var Breadcrumb = ({
|
|
|
3272
3333
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 rounded-sm"
|
|
3273
3334
|
),
|
|
3274
3335
|
children: [
|
|
3275
|
-
Icon && /* @__PURE__ */
|
|
3276
|
-
/* @__PURE__ */
|
|
3336
|
+
Icon && /* @__PURE__ */ jsx21(Icon, { className: sizeStyles5[size].icon }),
|
|
3337
|
+
/* @__PURE__ */ jsx21("span", { children: item.label })
|
|
3277
3338
|
]
|
|
3278
3339
|
}
|
|
3279
3340
|
) : /* @__PURE__ */ jsxs18(
|
|
@@ -3286,12 +3347,12 @@ var Breadcrumb = ({
|
|
|
3286
3347
|
),
|
|
3287
3348
|
"aria-current": isLast ? "page" : void 0,
|
|
3288
3349
|
children: [
|
|
3289
|
-
Icon && /* @__PURE__ */
|
|
3290
|
-
/* @__PURE__ */
|
|
3350
|
+
Icon && /* @__PURE__ */ jsx21(Icon, { className: sizeStyles5[size].icon }),
|
|
3351
|
+
/* @__PURE__ */ jsx21("span", { children: item.label })
|
|
3291
3352
|
]
|
|
3292
3353
|
}
|
|
3293
3354
|
),
|
|
3294
|
-
!isLast && /* @__PURE__ */
|
|
3355
|
+
!isLast && /* @__PURE__ */ jsx21(
|
|
3295
3356
|
"span",
|
|
3296
3357
|
{
|
|
3297
3358
|
className: cn("mx-1", sizeStyles5[size].spacing),
|
|
@@ -3309,7 +3370,7 @@ var Breadcrumb_default = Breadcrumb;
|
|
|
3309
3370
|
|
|
3310
3371
|
// ../../components/ui/Tab.tsx
|
|
3311
3372
|
import * as React16 from "react";
|
|
3312
|
-
import { jsx as
|
|
3373
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3313
3374
|
var sizeStyles6 = {
|
|
3314
3375
|
sm: {
|
|
3315
3376
|
tab: "py-1.5 px-3 text-xs",
|
|
@@ -3456,14 +3517,14 @@ var Tabs = ({
|
|
|
3456
3517
|
}
|
|
3457
3518
|
},
|
|
3458
3519
|
children: [
|
|
3459
|
-
Icon && /* @__PURE__ */
|
|
3520
|
+
Icon && /* @__PURE__ */ jsx22(Icon, { className: "h-4 w-4" }),
|
|
3460
3521
|
tab.label
|
|
3461
3522
|
]
|
|
3462
3523
|
},
|
|
3463
3524
|
tab.value
|
|
3464
3525
|
);
|
|
3465
3526
|
}),
|
|
3466
|
-
variant === "underline" && orientation === "horizontal" && /* @__PURE__ */
|
|
3527
|
+
variant === "underline" && orientation === "horizontal" && /* @__PURE__ */ jsx22(
|
|
3467
3528
|
"div",
|
|
3468
3529
|
{
|
|
3469
3530
|
className: "absolute bottom-0 h-0.5 bg-primary transition-all duration-300 ease-out",
|
|
@@ -3471,7 +3532,7 @@ var Tabs = ({
|
|
|
3471
3532
|
}
|
|
3472
3533
|
)
|
|
3473
3534
|
] }),
|
|
3474
|
-
/* @__PURE__ */
|
|
3535
|
+
/* @__PURE__ */ jsx22(
|
|
3475
3536
|
"div",
|
|
3476
3537
|
{
|
|
3477
3538
|
role: "tabpanel",
|
|
@@ -3489,7 +3550,7 @@ var Tabs = ({
|
|
|
3489
3550
|
] });
|
|
3490
3551
|
};
|
|
3491
3552
|
var SimpleTabs = ({ tabs, defaultValue, className }) => {
|
|
3492
|
-
return /* @__PURE__ */
|
|
3553
|
+
return /* @__PURE__ */ jsx22(
|
|
3493
3554
|
Tabs,
|
|
3494
3555
|
{
|
|
3495
3556
|
tabs,
|
|
@@ -3501,7 +3562,7 @@ var SimpleTabs = ({ tabs, defaultValue, className }) => {
|
|
|
3501
3562
|
);
|
|
3502
3563
|
};
|
|
3503
3564
|
var PillTabs = ({ contained = true, ...props }) => {
|
|
3504
|
-
return /* @__PURE__ */
|
|
3565
|
+
return /* @__PURE__ */ jsx22(
|
|
3505
3566
|
Tabs,
|
|
3506
3567
|
{
|
|
3507
3568
|
...props,
|
|
@@ -3515,7 +3576,7 @@ var VerticalTabs = ({
|
|
|
3515
3576
|
className,
|
|
3516
3577
|
...props
|
|
3517
3578
|
}) => {
|
|
3518
|
-
return /* @__PURE__ */
|
|
3579
|
+
return /* @__PURE__ */ jsx22("div", { className: cn("flex gap-6", className), children: /* @__PURE__ */ jsx22("div", { className: cn(sidebarWidth, "flex-shrink-0"), children: /* @__PURE__ */ jsx22(
|
|
3519
3580
|
Tabs,
|
|
3520
3581
|
{
|
|
3521
3582
|
...props,
|
|
@@ -3527,9 +3588,9 @@ var VerticalTabs = ({
|
|
|
3527
3588
|
};
|
|
3528
3589
|
|
|
3529
3590
|
// ../../components/ui/DropdownMenu.tsx
|
|
3530
|
-
import React17, { useState as
|
|
3591
|
+
import React17, { useState as useState16 } from "react";
|
|
3531
3592
|
import { createPortal as createPortal5 } from "react-dom";
|
|
3532
|
-
import { Fragment as Fragment5, jsx as
|
|
3593
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3533
3594
|
var DropdownMenu = ({
|
|
3534
3595
|
trigger,
|
|
3535
3596
|
children,
|
|
@@ -3542,12 +3603,12 @@ var DropdownMenu = ({
|
|
|
3542
3603
|
onOpenChange,
|
|
3543
3604
|
items
|
|
3544
3605
|
}) => {
|
|
3545
|
-
const [internalOpen, setInternalOpen] =
|
|
3546
|
-
const [position, setPosition] =
|
|
3606
|
+
const [internalOpen, setInternalOpen] = useState16(false);
|
|
3607
|
+
const [position, setPosition] = useState16(null);
|
|
3547
3608
|
const triggerRef = React17.useRef(null);
|
|
3548
3609
|
const contentRef = React17.useRef(null);
|
|
3549
3610
|
const itemsRef = React17.useRef([]);
|
|
3550
|
-
const [activeIndex, setActiveIndex] =
|
|
3611
|
+
const [activeIndex, setActiveIndex] = useState16(-1);
|
|
3551
3612
|
useShadCNAnimations();
|
|
3552
3613
|
const open = isOpen !== void 0 ? isOpen : internalOpen;
|
|
3553
3614
|
const setOpen = onOpenChange || setInternalOpen;
|
|
@@ -3651,7 +3712,7 @@ var DropdownMenu = ({
|
|
|
3651
3712
|
setOpen(false);
|
|
3652
3713
|
}
|
|
3653
3714
|
};
|
|
3654
|
-
const dropdownContent = open ? /* @__PURE__ */
|
|
3715
|
+
const dropdownContent = open ? /* @__PURE__ */ jsx23(
|
|
3655
3716
|
"div",
|
|
3656
3717
|
{
|
|
3657
3718
|
"data-dropdown-menu": true,
|
|
@@ -3672,7 +3733,7 @@ var DropdownMenu = ({
|
|
|
3672
3733
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3673
3734
|
className
|
|
3674
3735
|
),
|
|
3675
|
-
children: /* @__PURE__ */
|
|
3736
|
+
children: /* @__PURE__ */ jsx23(
|
|
3676
3737
|
"div",
|
|
3677
3738
|
{
|
|
3678
3739
|
className: cn(
|
|
@@ -3704,7 +3765,7 @@ var DropdownMenu = ({
|
|
|
3704
3765
|
item.destructive && "text-destructive hover:bg-destructive/10 focus:bg-destructive/10"
|
|
3705
3766
|
),
|
|
3706
3767
|
children: [
|
|
3707
|
-
IconComponent && /* @__PURE__ */
|
|
3768
|
+
IconComponent && /* @__PURE__ */ jsx23(IconComponent, { className: "h-4 w-4" }),
|
|
3708
3769
|
item.label
|
|
3709
3770
|
]
|
|
3710
3771
|
},
|
|
@@ -3731,7 +3792,7 @@ var DropdownMenu = ({
|
|
|
3731
3792
|
dropdownContent && typeof window !== "undefined" && createPortal5(dropdownContent, document.body)
|
|
3732
3793
|
] });
|
|
3733
3794
|
};
|
|
3734
|
-
var DropdownMenuItem = ({ children, onClick, disabled, destructive, className }) => /* @__PURE__ */
|
|
3795
|
+
var DropdownMenuItem = ({ children, onClick, disabled, destructive, className }) => /* @__PURE__ */ jsx23(
|
|
3735
3796
|
"button",
|
|
3736
3797
|
{
|
|
3737
3798
|
onClick,
|
|
@@ -3747,22 +3808,22 @@ var DropdownMenuItem = ({ children, onClick, disabled, destructive, className })
|
|
|
3747
3808
|
children
|
|
3748
3809
|
}
|
|
3749
3810
|
);
|
|
3750
|
-
var DropdownMenuSeparator = ({ className }) => /* @__PURE__ */
|
|
3751
|
-
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className }) => /* @__PURE__ */
|
|
3811
|
+
var DropdownMenuSeparator = ({ className }) => /* @__PURE__ */ jsx23("div", { className: cn("h-px bg-border my-1", className) });
|
|
3812
|
+
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className }) => /* @__PURE__ */ jsx23(
|
|
3752
3813
|
DropdownMenu,
|
|
3753
3814
|
{
|
|
3754
3815
|
trigger: /* @__PURE__ */ jsxs20(
|
|
3755
3816
|
"button",
|
|
3756
3817
|
{
|
|
3757
3818
|
className: cn(
|
|
3758
|
-
"inline-flex items-center justify-between gap-2 px-3 py-2 text-sm rounded-md border bg-background",
|
|
3819
|
+
"inline-flex items-center justify-between gap-2 px-3 py-2 text-sm rounded-md border bg-background border-border/60",
|
|
3759
3820
|
"hover:bg-accent/50",
|
|
3760
3821
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
3761
3822
|
className
|
|
3762
3823
|
),
|
|
3763
3824
|
children: [
|
|
3764
|
-
/* @__PURE__ */
|
|
3765
|
-
/* @__PURE__ */
|
|
3825
|
+
/* @__PURE__ */ jsx23("span", { className: "truncate max-w-[16rem] text-foreground/90", children: value || placeholder }),
|
|
3826
|
+
/* @__PURE__ */ jsx23("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", className: "opacity-70", children: /* @__PURE__ */ jsx23("path", { d: "M6 8l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3766
3827
|
]
|
|
3767
3828
|
}
|
|
3768
3829
|
),
|
|
@@ -3783,7 +3844,7 @@ import * as React18 from "react";
|
|
|
3783
3844
|
import { useId as useId2 } from "react";
|
|
3784
3845
|
import { createPortal as createPortal6 } from "react-dom";
|
|
3785
3846
|
import { ChevronDown, Search as Search2, Check as Check3, X as X7 } from "lucide-react";
|
|
3786
|
-
import { jsx as
|
|
3847
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3787
3848
|
var getOptionLabel = (option) => {
|
|
3788
3849
|
return typeof option === "string" ? option : option.label;
|
|
3789
3850
|
};
|
|
@@ -3898,7 +3959,7 @@ var Combobox = ({
|
|
|
3898
3959
|
}, [open, enableSearch]);
|
|
3899
3960
|
const selectedOption = findOptionByValue(options, value);
|
|
3900
3961
|
const displayValue = selectedOption ? getOptionLabel(selectedOption) : "";
|
|
3901
|
-
const dropdownContent = /* @__PURE__ */
|
|
3962
|
+
const dropdownContent = /* @__PURE__ */ jsx24(
|
|
3902
3963
|
"div",
|
|
3903
3964
|
{
|
|
3904
3965
|
"data-combobox-dropdown": true,
|
|
@@ -3919,8 +3980,8 @@ var Combobox = ({
|
|
|
3919
3980
|
),
|
|
3920
3981
|
children: /* @__PURE__ */ jsxs21("div", { className: cn("rounded-md border bg-popover text-popover-foreground shadow-md", "backdrop-blur-sm bg-popover/95 border-border/60"), children: [
|
|
3921
3982
|
enableSearch && /* @__PURE__ */ jsxs21("div", { className: "relative p-3 border-b border-border/50 bg-muted/20", children: [
|
|
3922
|
-
/* @__PURE__ */
|
|
3923
|
-
/* @__PURE__ */
|
|
3983
|
+
/* @__PURE__ */ jsx24(Search2, { className: "absolute left-6 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground transition-colors" }),
|
|
3984
|
+
/* @__PURE__ */ jsx24(
|
|
3924
3985
|
"input",
|
|
3925
3986
|
{
|
|
3926
3987
|
ref: inputRef,
|
|
@@ -3959,7 +4020,7 @@ var Combobox = ({
|
|
|
3959
4020
|
}
|
|
3960
4021
|
)
|
|
3961
4022
|
] }),
|
|
3962
|
-
/* @__PURE__ */
|
|
4023
|
+
/* @__PURE__ */ jsx24("div", { className: "max-h-64 overflow-y-auto overscroll-contain", children: /* @__PURE__ */ jsx24("ul", { className: "p-1 space-y-1", children: filteredOptions.length > 0 ? filteredOptions.map((item, index) => {
|
|
3963
4024
|
const itemValue = getOptionValue(item);
|
|
3964
4025
|
const itemLabel = getOptionLabel(item);
|
|
3965
4026
|
const isSelected = itemValue === value;
|
|
@@ -3987,15 +4048,15 @@ var Combobox = ({
|
|
|
3987
4048
|
isSelected && "bg-accent text-accent-foreground"
|
|
3988
4049
|
),
|
|
3989
4050
|
children: [
|
|
3990
|
-
/* @__PURE__ */
|
|
3991
|
-
isSelected && /* @__PURE__ */
|
|
4051
|
+
/* @__PURE__ */ jsx24("span", { className: "truncate", children: itemLabel }),
|
|
4052
|
+
isSelected && /* @__PURE__ */ jsx24(Check3, { className: "h-4 w-4 text-primary" })
|
|
3992
4053
|
]
|
|
3993
4054
|
},
|
|
3994
4055
|
`${itemValue}-${index}`
|
|
3995
4056
|
);
|
|
3996
|
-
}) : /* @__PURE__ */
|
|
3997
|
-
/* @__PURE__ */
|
|
3998
|
-
/* @__PURE__ */
|
|
4057
|
+
}) : /* @__PURE__ */ jsx24("li", { className: "px-3 py-8 text-center text-muted-foreground text-sm", children: /* @__PURE__ */ jsxs21("div", { className: "flex flex-col items-center gap-2", children: [
|
|
4058
|
+
/* @__PURE__ */ jsx24(Search2, { className: "h-6 w-6 opacity-50" }),
|
|
4059
|
+
/* @__PURE__ */ jsx24("span", { children: emptyText })
|
|
3999
4060
|
] }) }) }) })
|
|
4000
4061
|
] })
|
|
4001
4062
|
}
|
|
@@ -4010,7 +4071,7 @@ var Combobox = ({
|
|
|
4010
4071
|
const radiusClass = size === "sm" ? "rounded-md" : "rounded-lg";
|
|
4011
4072
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
4012
4073
|
return /* @__PURE__ */ jsxs21("div", { className: cn("w-full group", verticalGap), children: [
|
|
4013
|
-
label && /* @__PURE__ */
|
|
4074
|
+
label && /* @__PURE__ */ jsx24("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs21(
|
|
4014
4075
|
"label",
|
|
4015
4076
|
{
|
|
4016
4077
|
id: labelId,
|
|
@@ -4022,7 +4083,7 @@ var Combobox = ({
|
|
|
4022
4083
|
),
|
|
4023
4084
|
children: [
|
|
4024
4085
|
label,
|
|
4025
|
-
required && /* @__PURE__ */
|
|
4086
|
+
required && /* @__PURE__ */ jsx24("span", { className: "text-destructive ml-1", children: "*" })
|
|
4026
4087
|
]
|
|
4027
4088
|
}
|
|
4028
4089
|
) }),
|
|
@@ -4056,10 +4117,10 @@ var Combobox = ({
|
|
|
4056
4117
|
className
|
|
4057
4118
|
),
|
|
4058
4119
|
children: [
|
|
4059
|
-
/* @__PURE__ */
|
|
4120
|
+
/* @__PURE__ */ jsx24("span", { className: cn("truncate", !displayValue && "text-muted-foreground", fontBold && "font-bold"), children: displayValue || placeholder }),
|
|
4060
4121
|
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1 ml-2", children: [
|
|
4061
4122
|
allowClear && value && !disabled && // FIX: Use a div instead of a nested button
|
|
4062
|
-
/* @__PURE__ */
|
|
4123
|
+
/* @__PURE__ */ jsx24(
|
|
4063
4124
|
"div",
|
|
4064
4125
|
{
|
|
4065
4126
|
role: "button",
|
|
@@ -4068,10 +4129,10 @@ var Combobox = ({
|
|
|
4068
4129
|
onClick: handleClear,
|
|
4069
4130
|
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && handleClear(e),
|
|
4070
4131
|
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
|
|
4071
|
-
children: /* @__PURE__ */
|
|
4132
|
+
children: /* @__PURE__ */ jsx24(X7, { className: "h-3 w-3" })
|
|
4072
4133
|
}
|
|
4073
4134
|
),
|
|
4074
|
-
/* @__PURE__ */
|
|
4135
|
+
/* @__PURE__ */ jsx24(ChevronDown, { className: cn("h-4 w-4 text-muted-foreground transition-transform duration-200", open && "rotate-180") })
|
|
4075
4136
|
] })
|
|
4076
4137
|
]
|
|
4077
4138
|
}
|
|
@@ -4082,7 +4143,7 @@ var Combobox = ({
|
|
|
4082
4143
|
|
|
4083
4144
|
// ../../components/ui/Pagination.tsx
|
|
4084
4145
|
import { useTranslations as useTranslations4 } from "next-intl";
|
|
4085
|
-
import { jsx as
|
|
4146
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4086
4147
|
var Pagination = ({
|
|
4087
4148
|
page,
|
|
4088
4149
|
totalPages,
|
|
@@ -4166,12 +4227,12 @@ var Pagination = ({
|
|
|
4166
4227
|
};
|
|
4167
4228
|
if (totalPages <= 1) return null;
|
|
4168
4229
|
return /* @__PURE__ */ jsxs22("nav", { className: cn("flex flex-col gap-4", className), "aria-label": labels?.navigationLabel || t("navigationLabel"), children: [
|
|
4169
|
-
showInfo && totalItems && /* @__PURE__ */
|
|
4230
|
+
showInfo && totalItems && /* @__PURE__ */ jsx25("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 }) }),
|
|
4170
4231
|
/* @__PURE__ */ jsxs22("div", { className: cn("flex items-center justify-between", {
|
|
4171
4232
|
"flex-row-reverse": alignment === "right" || alignment === "center"
|
|
4172
4233
|
}), children: [
|
|
4173
4234
|
/* @__PURE__ */ jsxs22("div", { className: cn("flex items-center gap-1"), children: [
|
|
4174
|
-
showFirstLast && /* @__PURE__ */
|
|
4235
|
+
showFirstLast && /* @__PURE__ */ jsx25(
|
|
4175
4236
|
Button_default,
|
|
4176
4237
|
{
|
|
4177
4238
|
variant: getButtonVariant(false),
|
|
@@ -4185,7 +4246,7 @@ var Pagination = ({
|
|
|
4185
4246
|
"aria-disabled": disabled || page === 1
|
|
4186
4247
|
}
|
|
4187
4248
|
),
|
|
4188
|
-
showPrevNext && /* @__PURE__ */
|
|
4249
|
+
showPrevNext && /* @__PURE__ */ jsx25(
|
|
4189
4250
|
Button_default,
|
|
4190
4251
|
{
|
|
4191
4252
|
variant: getButtonVariant(false),
|
|
@@ -4196,16 +4257,16 @@ var Pagination = ({
|
|
|
4196
4257
|
title: labels?.previousPage || t("previousPage"),
|
|
4197
4258
|
"aria-label": labels?.previousPage || t("previousPage"),
|
|
4198
4259
|
"aria-disabled": disabled || page === 1,
|
|
4199
|
-
children: /* @__PURE__ */
|
|
4260
|
+
children: /* @__PURE__ */ jsx25("span", { className: "hidden sm:inline", children: labels?.previous || t("previous") })
|
|
4200
4261
|
}
|
|
4201
4262
|
),
|
|
4202
4263
|
showPageNumbers && createPageArray().map((p, i) => {
|
|
4203
4264
|
if (p === "...") {
|
|
4204
|
-
return /* @__PURE__ */
|
|
4265
|
+
return /* @__PURE__ */ jsx25(Button_default, { variant: "ghost", size, disabled: true, icon: MoreHorizontal2, className: "cursor-default" }, i);
|
|
4205
4266
|
}
|
|
4206
4267
|
const pageNumber = p;
|
|
4207
4268
|
const isActive = page === pageNumber;
|
|
4208
|
-
return /* @__PURE__ */
|
|
4269
|
+
return /* @__PURE__ */ jsx25(
|
|
4209
4270
|
Button_default,
|
|
4210
4271
|
{
|
|
4211
4272
|
variant: getButtonVariant(isActive),
|
|
@@ -4220,7 +4281,7 @@ var Pagination = ({
|
|
|
4220
4281
|
i
|
|
4221
4282
|
);
|
|
4222
4283
|
}),
|
|
4223
|
-
showPrevNext && /* @__PURE__ */
|
|
4284
|
+
showPrevNext && /* @__PURE__ */ jsx25(
|
|
4224
4285
|
Button_default,
|
|
4225
4286
|
{
|
|
4226
4287
|
variant: getButtonVariant(false),
|
|
@@ -4231,10 +4292,10 @@ var Pagination = ({
|
|
|
4231
4292
|
title: labels?.nextPage || t("nextPage"),
|
|
4232
4293
|
"aria-label": labels?.nextPage || t("nextPage"),
|
|
4233
4294
|
"aria-disabled": disabled || page === totalPages,
|
|
4234
|
-
children: /* @__PURE__ */
|
|
4295
|
+
children: /* @__PURE__ */ jsx25("span", { className: "hidden sm:inline", children: labels?.next || t("next") })
|
|
4235
4296
|
}
|
|
4236
4297
|
),
|
|
4237
|
-
showFirstLast && /* @__PURE__ */
|
|
4298
|
+
showFirstLast && /* @__PURE__ */ jsx25(
|
|
4238
4299
|
Button_default,
|
|
4239
4300
|
{
|
|
4240
4301
|
variant: getButtonVariant(false),
|
|
@@ -4254,7 +4315,7 @@ var Pagination = ({
|
|
|
4254
4315
|
labels?.itemsPerPage || t("itemsPerPage"),
|
|
4255
4316
|
":"
|
|
4256
4317
|
] }),
|
|
4257
|
-
/* @__PURE__ */
|
|
4318
|
+
/* @__PURE__ */ jsx25("div", { className: "w-20", children: /* @__PURE__ */ jsx25(
|
|
4258
4319
|
Combobox,
|
|
4259
4320
|
{
|
|
4260
4321
|
options: pageSizeOptionsStrings,
|
|
@@ -4294,14 +4355,14 @@ var SimplePagination = ({
|
|
|
4294
4355
|
" total items)"
|
|
4295
4356
|
] }),
|
|
4296
4357
|
/* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
|
|
4297
|
-
/* @__PURE__ */
|
|
4358
|
+
/* @__PURE__ */ jsx25(Button_default, { variant, size, icon: ChevronLeft, onClick: () => onChange(Math.max(1, page - 1)), disabled: disabled || page === 1, children: "Previous" }),
|
|
4298
4359
|
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
4299
|
-
/* @__PURE__ */
|
|
4300
|
-
/* @__PURE__ */
|
|
4301
|
-
/* @__PURE__ */
|
|
4302
|
-
/* @__PURE__ */
|
|
4360
|
+
/* @__PURE__ */ jsx25("span", { children: "Page" }),
|
|
4361
|
+
/* @__PURE__ */ jsx25("span", { className: "font-medium text-foreground", children: page }),
|
|
4362
|
+
/* @__PURE__ */ jsx25("span", { children: "of" }),
|
|
4363
|
+
/* @__PURE__ */ jsx25("span", { className: "font-medium text-foreground", children: totalPages })
|
|
4303
4364
|
] }),
|
|
4304
|
-
/* @__PURE__ */
|
|
4365
|
+
/* @__PURE__ */ jsx25(
|
|
4305
4366
|
Button_default,
|
|
4306
4367
|
{
|
|
4307
4368
|
variant,
|
|
@@ -4325,7 +4386,7 @@ var CompactPagination = ({
|
|
|
4325
4386
|
}) => {
|
|
4326
4387
|
if (totalPages <= 1) return null;
|
|
4327
4388
|
return /* @__PURE__ */ jsxs22("nav", { className: cn("flex items-center gap-1", className), "aria-label": "Compact Pagination", children: [
|
|
4328
|
-
/* @__PURE__ */
|
|
4389
|
+
/* @__PURE__ */ jsx25(
|
|
4329
4390
|
Button_default,
|
|
4330
4391
|
{
|
|
4331
4392
|
variant,
|
|
@@ -4337,7 +4398,7 @@ var CompactPagination = ({
|
|
|
4337
4398
|
"aria-label": "First page"
|
|
4338
4399
|
}
|
|
4339
4400
|
),
|
|
4340
|
-
/* @__PURE__ */
|
|
4401
|
+
/* @__PURE__ */ jsx25(
|
|
4341
4402
|
Button_default,
|
|
4342
4403
|
{
|
|
4343
4404
|
variant,
|
|
@@ -4353,7 +4414,7 @@ var CompactPagination = ({
|
|
|
4353
4414
|
" / ",
|
|
4354
4415
|
totalPages
|
|
4355
4416
|
] }),
|
|
4356
|
-
/* @__PURE__ */
|
|
4417
|
+
/* @__PURE__ */ jsx25(
|
|
4357
4418
|
Button_default,
|
|
4358
4419
|
{
|
|
4359
4420
|
variant,
|
|
@@ -4364,7 +4425,7 @@ var CompactPagination = ({
|
|
|
4364
4425
|
title: "Next page"
|
|
4365
4426
|
}
|
|
4366
4427
|
),
|
|
4367
|
-
/* @__PURE__ */
|
|
4428
|
+
/* @__PURE__ */ jsx25(
|
|
4368
4429
|
Button_default,
|
|
4369
4430
|
{
|
|
4370
4431
|
variant,
|
|
@@ -4380,7 +4441,7 @@ var CompactPagination = ({
|
|
|
4380
4441
|
|
|
4381
4442
|
// ../../components/ui/Section.tsx
|
|
4382
4443
|
import React20 from "react";
|
|
4383
|
-
import { jsx as
|
|
4444
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
4384
4445
|
var Section = React20.forwardRef(
|
|
4385
4446
|
({
|
|
4386
4447
|
children,
|
|
@@ -4388,6 +4449,7 @@ var Section = React20.forwardRef(
|
|
|
4388
4449
|
variant = "default",
|
|
4389
4450
|
spacing = "lg",
|
|
4390
4451
|
fullWidth = false,
|
|
4452
|
+
outlined = false,
|
|
4391
4453
|
...props
|
|
4392
4454
|
}, ref) => {
|
|
4393
4455
|
const variantClasses = {
|
|
@@ -4402,13 +4464,14 @@ var Section = React20.forwardRef(
|
|
|
4402
4464
|
lg: "py-12",
|
|
4403
4465
|
xl: "py-16"
|
|
4404
4466
|
};
|
|
4405
|
-
return /* @__PURE__ */
|
|
4467
|
+
return /* @__PURE__ */ jsx26(
|
|
4406
4468
|
"section",
|
|
4407
4469
|
{
|
|
4408
4470
|
ref,
|
|
4409
4471
|
className: cn(
|
|
4410
4472
|
variantClasses[variant],
|
|
4411
4473
|
spacingClasses[spacing],
|
|
4474
|
+
outlined && "rounded-lg border border-border/60",
|
|
4412
4475
|
!fullWidth && "container mx-auto px-4 md:px-6",
|
|
4413
4476
|
className
|
|
4414
4477
|
),
|
|
@@ -4423,9 +4486,9 @@ var Section_default = Section;
|
|
|
4423
4486
|
|
|
4424
4487
|
// ../../components/ui/ScrollArea.tsx
|
|
4425
4488
|
import { forwardRef as forwardRef6 } from "react";
|
|
4426
|
-
import { jsx as
|
|
4489
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
4427
4490
|
var ScrollArea = forwardRef6(({ className, children, ...props }, ref) => {
|
|
4428
|
-
return /* @__PURE__ */
|
|
4491
|
+
return /* @__PURE__ */ jsx27("div", { ref, className: cn("relative overflow-hidden bg-background", className), ...props, children: /* @__PURE__ */ jsx27("div", { className: cn("h-full w-full overflow-y-auto scroll-area-viewport"), children }) });
|
|
4429
4492
|
});
|
|
4430
4493
|
ScrollArea.displayName = "ScrollArea";
|
|
4431
4494
|
|
|
@@ -4616,7 +4679,7 @@ function formatDateWithDay(date) {
|
|
|
4616
4679
|
}
|
|
4617
4680
|
|
|
4618
4681
|
// ../../components/ui/DatePicker.tsx
|
|
4619
|
-
import { Fragment as Fragment6, jsx as
|
|
4682
|
+
import { Fragment as Fragment6, jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4620
4683
|
var DatePicker = ({
|
|
4621
4684
|
id,
|
|
4622
4685
|
value,
|
|
@@ -4727,7 +4790,7 @@ var DatePicker = ({
|
|
|
4727
4790
|
const firstDayOfMonth = getFirstDayOfMonth(viewDate);
|
|
4728
4791
|
const days = [];
|
|
4729
4792
|
for (let i = 0; i < firstDayOfMonth; i++) {
|
|
4730
|
-
days.push(/* @__PURE__ */
|
|
4793
|
+
days.push(/* @__PURE__ */ jsx28("div", { className: "w-8 h-8" }, `empty-${i}`));
|
|
4731
4794
|
}
|
|
4732
4795
|
for (let day = 1; day <= daysInMonth; day++) {
|
|
4733
4796
|
const date = new Date(viewDate.getFullYear(), viewDate.getMonth(), day);
|
|
@@ -4736,7 +4799,7 @@ var DatePicker = ({
|
|
|
4736
4799
|
const totalDaysFromStart = firstDayOfMonth + day - 1;
|
|
4737
4800
|
const rowIndex = Math.floor(totalDaysFromStart / 7);
|
|
4738
4801
|
days.push(
|
|
4739
|
-
/* @__PURE__ */
|
|
4802
|
+
/* @__PURE__ */ jsx28(
|
|
4740
4803
|
"button",
|
|
4741
4804
|
{
|
|
4742
4805
|
onClick: () => handleDateSelect(date),
|
|
@@ -4759,7 +4822,7 @@ var DatePicker = ({
|
|
|
4759
4822
|
}
|
|
4760
4823
|
return days;
|
|
4761
4824
|
};
|
|
4762
|
-
const datePickerContent = isOpen && dropdownPosition ? /* @__PURE__ */
|
|
4825
|
+
const datePickerContent = isOpen && dropdownPosition ? /* @__PURE__ */ jsx28(
|
|
4763
4826
|
"div",
|
|
4764
4827
|
{
|
|
4765
4828
|
"data-datepicker": true,
|
|
@@ -4789,13 +4852,13 @@ var DatePicker = ({
|
|
|
4789
4852
|
style: { pointerEvents: "auto" },
|
|
4790
4853
|
children: [
|
|
4791
4854
|
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4792
|
-
/* @__PURE__ */
|
|
4793
|
-
/* @__PURE__ */
|
|
4794
|
-
/* @__PURE__ */
|
|
4855
|
+
/* @__PURE__ */ jsx28(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("prev"), className: "p-1 h-auto", children: /* @__PURE__ */ jsx28(ChevronLeft2, { className: "h-4 w-4" }) }),
|
|
4856
|
+
/* @__PURE__ */ jsx28("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
4857
|
+
/* @__PURE__ */ jsx28(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("next"), className: "p-1 h-auto", children: /* @__PURE__ */ jsx28(ChevronRight3, { className: "h-4 w-4" }) })
|
|
4795
4858
|
] }),
|
|
4796
|
-
/* @__PURE__ */
|
|
4797
|
-
/* @__PURE__ */
|
|
4798
|
-
/* @__PURE__ */
|
|
4859
|
+
/* @__PURE__ */ jsx28("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__ */ jsx28("div", { className: cn("text-muted-foreground text-center font-medium", size === "sm" ? "text-[10px] py-0.5" : "text-xs py-1"), children: day }, day)) }),
|
|
4860
|
+
/* @__PURE__ */ jsx28("div", { className: "grid grid-cols-7 gap-1", children: renderCalendar() }),
|
|
4861
|
+
/* @__PURE__ */ jsx28("div", { className: "flex items-center justify-end mt-2", children: /* @__PURE__ */ jsx28(
|
|
4799
4862
|
Button_default,
|
|
4800
4863
|
{
|
|
4801
4864
|
variant: "outline",
|
|
@@ -4820,7 +4883,7 @@ var DatePicker = ({
|
|
|
4820
4883
|
const radiusClass = size === "sm" ? "rounded-md" : "rounded-lg";
|
|
4821
4884
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
4822
4885
|
return /* @__PURE__ */ jsxs23("div", { className: cn("w-full group", verticalGap), children: [
|
|
4823
|
-
label && /* @__PURE__ */
|
|
4886
|
+
label && /* @__PURE__ */ jsx28("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs23(
|
|
4824
4887
|
"label",
|
|
4825
4888
|
{
|
|
4826
4889
|
id: labelId,
|
|
@@ -4832,7 +4895,7 @@ var DatePicker = ({
|
|
|
4832
4895
|
),
|
|
4833
4896
|
children: [
|
|
4834
4897
|
label,
|
|
4835
|
-
required && /* @__PURE__ */
|
|
4898
|
+
required && /* @__PURE__ */ jsx28("span", { className: "text-destructive ml-1", children: "*" })
|
|
4836
4899
|
]
|
|
4837
4900
|
}
|
|
4838
4901
|
) }),
|
|
@@ -4864,8 +4927,8 @@ var DatePicker = ({
|
|
|
4864
4927
|
className
|
|
4865
4928
|
),
|
|
4866
4929
|
children: [
|
|
4867
|
-
/* @__PURE__ */
|
|
4868
|
-
value && /* @__PURE__ */
|
|
4930
|
+
/* @__PURE__ */ jsx28("span", { className: cn("truncate", !value && "text-muted-foreground"), children: value ? formatDateDisplay(value) : placeholder || t("placeholder") }),
|
|
4931
|
+
value && /* @__PURE__ */ jsx28(
|
|
4869
4932
|
"span",
|
|
4870
4933
|
{
|
|
4871
4934
|
role: "button",
|
|
@@ -4887,10 +4950,10 @@ var DatePicker = ({
|
|
|
4887
4950
|
},
|
|
4888
4951
|
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",
|
|
4889
4952
|
style: { width: 20, height: 20 },
|
|
4890
|
-
children: /* @__PURE__ */
|
|
4953
|
+
children: /* @__PURE__ */ jsx28(XIcon, { className: "h-3.5 w-3.5" })
|
|
4891
4954
|
}
|
|
4892
4955
|
),
|
|
4893
|
-
/* @__PURE__ */
|
|
4956
|
+
/* @__PURE__ */ jsx28(Calendar, { className: "h-4 w-4 text-muted-foreground ml-2" })
|
|
4894
4957
|
]
|
|
4895
4958
|
}
|
|
4896
4959
|
),
|
|
@@ -4975,7 +5038,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
4975
5038
|
const nodes = [];
|
|
4976
5039
|
const daysInMonth = getDaysInMonth(viewDate);
|
|
4977
5040
|
const firstDay = getFirstDayOfMonth(viewDate);
|
|
4978
|
-
for (let i = 0; i < firstDay; i++) nodes.push(/* @__PURE__ */
|
|
5041
|
+
for (let i = 0; i < firstDay; i++) nodes.push(/* @__PURE__ */ jsx28("div", { className: "w-8 h-8" }, `e-${i}`));
|
|
4979
5042
|
for (let d = 1; d <= daysInMonth; d++) {
|
|
4980
5043
|
const date = new Date(viewDate.getFullYear(), viewDate.getMonth(), d);
|
|
4981
5044
|
const isSelectedStart = isSameDay(date, tempStart);
|
|
@@ -5000,7 +5063,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5000
5063
|
}
|
|
5001
5064
|
}
|
|
5002
5065
|
nodes.push(
|
|
5003
|
-
/* @__PURE__ */
|
|
5066
|
+
/* @__PURE__ */ jsx28(
|
|
5004
5067
|
"button",
|
|
5005
5068
|
{
|
|
5006
5069
|
onClick: () => handleSelect(date),
|
|
@@ -5030,7 +5093,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5030
5093
|
}
|
|
5031
5094
|
return nodes;
|
|
5032
5095
|
};
|
|
5033
|
-
const panel = isOpen && dropdownPosition ? /* @__PURE__ */
|
|
5096
|
+
const panel = isOpen && dropdownPosition ? /* @__PURE__ */ jsx28(
|
|
5034
5097
|
"div",
|
|
5035
5098
|
{
|
|
5036
5099
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width || 256, zIndex: 9999 },
|
|
@@ -5047,30 +5110,30 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5047
5110
|
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"),
|
|
5048
5111
|
children: [
|
|
5049
5112
|
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between mb-3", children: [
|
|
5050
|
-
/* @__PURE__ */
|
|
5113
|
+
/* @__PURE__ */ jsx28(
|
|
5051
5114
|
Button_default,
|
|
5052
5115
|
{
|
|
5053
5116
|
variant: "ghost",
|
|
5054
5117
|
size: "sm",
|
|
5055
5118
|
onClick: () => setViewDate(new Date(viewDate.getFullYear(), viewDate.getMonth() - 1, 1)),
|
|
5056
5119
|
className: "p-1 h-auto",
|
|
5057
|
-
children: /* @__PURE__ */
|
|
5120
|
+
children: /* @__PURE__ */ jsx28(ChevronLeft2, { className: "h-4 w-4" })
|
|
5058
5121
|
}
|
|
5059
5122
|
),
|
|
5060
|
-
/* @__PURE__ */
|
|
5061
|
-
/* @__PURE__ */
|
|
5123
|
+
/* @__PURE__ */ jsx28("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
5124
|
+
/* @__PURE__ */ jsx28(
|
|
5062
5125
|
Button_default,
|
|
5063
5126
|
{
|
|
5064
5127
|
variant: "ghost",
|
|
5065
5128
|
size: "sm",
|
|
5066
5129
|
onClick: () => setViewDate(new Date(viewDate.getFullYear(), viewDate.getMonth() + 1, 1)),
|
|
5067
5130
|
className: "p-1 h-auto",
|
|
5068
|
-
children: /* @__PURE__ */
|
|
5131
|
+
children: /* @__PURE__ */ jsx28(ChevronRight3, { className: "h-4 w-4" })
|
|
5069
5132
|
}
|
|
5070
5133
|
)
|
|
5071
5134
|
] }),
|
|
5072
|
-
/* @__PURE__ */
|
|
5073
|
-
/* @__PURE__ */
|
|
5135
|
+
/* @__PURE__ */ jsx28("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((d) => /* @__PURE__ */ jsx28("div", { className: "text-xs text-muted-foreground text-center py-1 font-medium", children: d }, d)) }),
|
|
5136
|
+
/* @__PURE__ */ jsx28("div", { className: "grid grid-cols-7", children: renderGrid() })
|
|
5074
5137
|
]
|
|
5075
5138
|
}
|
|
5076
5139
|
)
|
|
@@ -5098,8 +5161,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5098
5161
|
className
|
|
5099
5162
|
),
|
|
5100
5163
|
children: [
|
|
5101
|
-
/* @__PURE__ */
|
|
5102
|
-
/* @__PURE__ */
|
|
5164
|
+
/* @__PURE__ */ jsx28("span", { className: cn("truncate", !tempStart && !tempEnd && "text-muted-foreground"), children: label }),
|
|
5165
|
+
/* @__PURE__ */ jsx28(Calendar, { className: "h-4 w-4 text-muted-foreground ml-2" })
|
|
5103
5166
|
]
|
|
5104
5167
|
}
|
|
5105
5168
|
),
|
|
@@ -5112,7 +5175,7 @@ import * as React22 from "react";
|
|
|
5112
5175
|
import { useId as useId4 } from "react";
|
|
5113
5176
|
import { createPortal as createPortal8 } from "react-dom";
|
|
5114
5177
|
import { ChevronDown as ChevronDown2, Search as Search3, Check as Check4 } from "lucide-react";
|
|
5115
|
-
import { jsx as
|
|
5178
|
+
import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5116
5179
|
var MultiCombobox = ({
|
|
5117
5180
|
id,
|
|
5118
5181
|
options,
|
|
@@ -5255,7 +5318,7 @@ var MultiCombobox = ({
|
|
|
5255
5318
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
5256
5319
|
const labelSize = size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm";
|
|
5257
5320
|
return /* @__PURE__ */ jsxs24("div", { className: cn("w-full space-y-2 group", className), children: [
|
|
5258
|
-
title && /* @__PURE__ */
|
|
5321
|
+
title && /* @__PURE__ */ jsx29("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs24(
|
|
5259
5322
|
"label",
|
|
5260
5323
|
{
|
|
5261
5324
|
className: cn(
|
|
@@ -5265,7 +5328,7 @@ var MultiCombobox = ({
|
|
|
5265
5328
|
),
|
|
5266
5329
|
children: [
|
|
5267
5330
|
title,
|
|
5268
|
-
required && /* @__PURE__ */
|
|
5331
|
+
required && /* @__PURE__ */ jsx29("span", { className: "text-destructive ml-1", children: "*" })
|
|
5269
5332
|
]
|
|
5270
5333
|
}
|
|
5271
5334
|
) }),
|
|
@@ -5281,11 +5344,11 @@ var MultiCombobox = ({
|
|
|
5281
5344
|
),
|
|
5282
5345
|
children: [
|
|
5283
5346
|
label,
|
|
5284
|
-
required && /* @__PURE__ */
|
|
5347
|
+
required && /* @__PURE__ */ jsx29("span", { className: "text-destructive ml-1", children: "*" })
|
|
5285
5348
|
]
|
|
5286
5349
|
}
|
|
5287
5350
|
),
|
|
5288
|
-
/* @__PURE__ */
|
|
5351
|
+
/* @__PURE__ */ jsx29("div", { className: "relative w-full" }),
|
|
5289
5352
|
/* @__PURE__ */ jsxs24(
|
|
5290
5353
|
"button",
|
|
5291
5354
|
{
|
|
@@ -5309,11 +5372,11 @@ var MultiCombobox = ({
|
|
|
5309
5372
|
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
5310
5373
|
),
|
|
5311
5374
|
children: [
|
|
5312
|
-
/* @__PURE__ */
|
|
5375
|
+
/* @__PURE__ */ jsx29("div", { className: "flex items-center gap-1 flex-wrap min-h-[1.5rem] flex-1", children: value.length > 0 ? showTags ? value.map((itemValue) => {
|
|
5313
5376
|
const option = normalizedOptions.find((o) => o.value === itemValue);
|
|
5314
5377
|
return /* @__PURE__ */ jsxs24("span", { className: "inline-flex items-center gap-1 bg-accent text-accent-foreground rounded px-2 py-1 text-xs", children: [
|
|
5315
|
-
/* @__PURE__ */
|
|
5316
|
-
/* @__PURE__ */
|
|
5378
|
+
/* @__PURE__ */ jsx29("span", { className: "truncate max-w-[120px]", children: option ? displayFormat(option) : itemValue }),
|
|
5379
|
+
/* @__PURE__ */ jsx29(
|
|
5317
5380
|
"span",
|
|
5318
5381
|
{
|
|
5319
5382
|
role: "button",
|
|
@@ -5339,13 +5402,13 @@ var MultiCombobox = ({
|
|
|
5339
5402
|
}) : /* @__PURE__ */ jsxs24("span", { className: "truncate text-sm", children: [
|
|
5340
5403
|
value.length,
|
|
5341
5404
|
" selected"
|
|
5342
|
-
] }) : /* @__PURE__ */
|
|
5343
|
-
/* @__PURE__ */
|
|
5405
|
+
] }) : /* @__PURE__ */ jsx29("span", { className: "text-muted-foreground", children: placeholder || "Select..." }) }),
|
|
5406
|
+
/* @__PURE__ */ jsx29(ChevronDown2, { className: cn("opacity-50 transition-transform", sizeStyles8[size].icon, open && "rotate-180") })
|
|
5344
5407
|
]
|
|
5345
5408
|
}
|
|
5346
5409
|
),
|
|
5347
5410
|
open && dropdownPosition && typeof window !== "undefined" ? createPortal8(
|
|
5348
|
-
/* @__PURE__ */
|
|
5411
|
+
/* @__PURE__ */ jsx29(
|
|
5349
5412
|
"div",
|
|
5350
5413
|
{
|
|
5351
5414
|
"data-dropdown": "multicombobox",
|
|
@@ -5370,7 +5433,7 @@ var MultiCombobox = ({
|
|
|
5370
5433
|
"backdrop-blur-sm bg-popover/95 border-border/60"
|
|
5371
5434
|
),
|
|
5372
5435
|
children: [
|
|
5373
|
-
showClear && value.length > 0 && /* @__PURE__ */
|
|
5436
|
+
showClear && value.length > 0 && /* @__PURE__ */ jsx29("div", { className: "px-3 py-2 border-b border-border/60 flex justify-end", children: /* @__PURE__ */ jsx29(
|
|
5374
5437
|
"button",
|
|
5375
5438
|
{
|
|
5376
5439
|
type: "button",
|
|
@@ -5384,8 +5447,8 @@ var MultiCombobox = ({
|
|
|
5384
5447
|
}
|
|
5385
5448
|
) }),
|
|
5386
5449
|
enableSearch && /* @__PURE__ */ jsxs24("div", { className: "relative border-b border-border/60", children: [
|
|
5387
|
-
/* @__PURE__ */
|
|
5388
|
-
/* @__PURE__ */
|
|
5450
|
+
/* @__PURE__ */ jsx29(Search3, { className: cn("absolute left-2 top-2.5 text-muted-foreground", sizeStyles8[size].icon) }),
|
|
5451
|
+
/* @__PURE__ */ jsx29(
|
|
5389
5452
|
"input",
|
|
5390
5453
|
{
|
|
5391
5454
|
ref: inputRef,
|
|
@@ -5400,7 +5463,7 @@ var MultiCombobox = ({
|
|
|
5400
5463
|
}
|
|
5401
5464
|
)
|
|
5402
5465
|
] }),
|
|
5403
|
-
/* @__PURE__ */
|
|
5466
|
+
/* @__PURE__ */ jsx29("ul", { className: cn("max-h-60 overflow-y-auto p-1", size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"), children: filtered.length ? filtered.map((item, index) => {
|
|
5404
5467
|
const isSelected = value.includes(item.value);
|
|
5405
5468
|
const isDisabled = disabledOptions.includes(item.value);
|
|
5406
5469
|
return /* @__PURE__ */ jsxs24(
|
|
@@ -5427,12 +5490,12 @@ var MultiCombobox = ({
|
|
|
5427
5490
|
),
|
|
5428
5491
|
children: [
|
|
5429
5492
|
item.label,
|
|
5430
|
-
isSelected && /* @__PURE__ */
|
|
5493
|
+
isSelected && /* @__PURE__ */ jsx29(Check4, { className: sizeStyles8[size].icon })
|
|
5431
5494
|
]
|
|
5432
5495
|
},
|
|
5433
5496
|
item.value
|
|
5434
5497
|
);
|
|
5435
|
-
}) : /* @__PURE__ */
|
|
5498
|
+
}) : /* @__PURE__ */ jsx29("li", { className: cn("px-3 py-2 text-muted-foreground", size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"), children: "No result." }) })
|
|
5436
5499
|
]
|
|
5437
5500
|
}
|
|
5438
5501
|
)
|
|
@@ -5445,7 +5508,7 @@ var MultiCombobox = ({
|
|
|
5445
5508
|
|
|
5446
5509
|
// ../../components/ui/RadioGroup.tsx
|
|
5447
5510
|
import * as React23 from "react";
|
|
5448
|
-
import { jsx as
|
|
5511
|
+
import { jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5449
5512
|
var RadioGroupContext = React23.createContext(void 0);
|
|
5450
5513
|
var useRadioGroup = () => {
|
|
5451
5514
|
const context = React23.useContext(RadioGroupContext);
|
|
@@ -5483,7 +5546,7 @@ var RadioGroup = React23.forwardRef(
|
|
|
5483
5546
|
};
|
|
5484
5547
|
const uniqueId = React23.useId();
|
|
5485
5548
|
const radioName = name || `radio-group-${uniqueId}`;
|
|
5486
|
-
return /* @__PURE__ */
|
|
5549
|
+
return /* @__PURE__ */ jsx30(
|
|
5487
5550
|
RadioGroupContext.Provider,
|
|
5488
5551
|
{
|
|
5489
5552
|
value: {
|
|
@@ -5495,7 +5558,7 @@ var RadioGroup = React23.forwardRef(
|
|
|
5495
5558
|
variant
|
|
5496
5559
|
},
|
|
5497
5560
|
children: /* @__PURE__ */ jsxs25("div", { className: "space-y-2", children: [
|
|
5498
|
-
/* @__PURE__ */
|
|
5561
|
+
/* @__PURE__ */ jsx30(
|
|
5499
5562
|
"div",
|
|
5500
5563
|
{
|
|
5501
5564
|
ref,
|
|
@@ -5512,7 +5575,7 @@ var RadioGroup = React23.forwardRef(
|
|
|
5512
5575
|
children
|
|
5513
5576
|
}
|
|
5514
5577
|
),
|
|
5515
|
-
error && errorMessage && /* @__PURE__ */
|
|
5578
|
+
error && errorMessage && /* @__PURE__ */ jsx30("p", { className: "text-sm text-destructive mt-1", children: errorMessage })
|
|
5516
5579
|
] })
|
|
5517
5580
|
}
|
|
5518
5581
|
);
|
|
@@ -5567,7 +5630,7 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5567
5630
|
),
|
|
5568
5631
|
children: [
|
|
5569
5632
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-start gap-3", children: [
|
|
5570
|
-
/* @__PURE__ */
|
|
5633
|
+
/* @__PURE__ */ jsx30(
|
|
5571
5634
|
"button",
|
|
5572
5635
|
{
|
|
5573
5636
|
ref,
|
|
@@ -5586,22 +5649,22 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5586
5649
|
sizeStyles7[size].radio
|
|
5587
5650
|
),
|
|
5588
5651
|
onClick: () => onValueChange?.(value),
|
|
5589
|
-
children: /* @__PURE__ */
|
|
5652
|
+
children: /* @__PURE__ */ jsx30(
|
|
5590
5653
|
"span",
|
|
5591
5654
|
{
|
|
5592
5655
|
className: cn(
|
|
5593
5656
|
"flex items-center justify-center w-full h-full rounded-full transition-all duration-200",
|
|
5594
5657
|
isSelected && "bg-primary"
|
|
5595
5658
|
),
|
|
5596
|
-
children: isSelected && /* @__PURE__ */
|
|
5659
|
+
children: isSelected && /* @__PURE__ */ jsx30("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) })
|
|
5597
5660
|
}
|
|
5598
5661
|
)
|
|
5599
5662
|
}
|
|
5600
5663
|
),
|
|
5601
5664
|
/* @__PURE__ */ jsxs25("div", { className: "flex-1 min-w-0", children: [
|
|
5602
5665
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
5603
|
-
Icon && /* @__PURE__ */
|
|
5604
|
-
/* @__PURE__ */
|
|
5666
|
+
Icon && /* @__PURE__ */ jsx30(Icon, { className: "h-4 w-4 text-foreground" }),
|
|
5667
|
+
/* @__PURE__ */ jsx30(
|
|
5605
5668
|
"label",
|
|
5606
5669
|
{
|
|
5607
5670
|
htmlFor: radioId,
|
|
@@ -5613,10 +5676,10 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5613
5676
|
}
|
|
5614
5677
|
)
|
|
5615
5678
|
] }),
|
|
5616
|
-
description && /* @__PURE__ */
|
|
5679
|
+
description && /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground mt-1 text-xs", children: description })
|
|
5617
5680
|
] })
|
|
5618
5681
|
] }),
|
|
5619
|
-
/* @__PURE__ */
|
|
5682
|
+
/* @__PURE__ */ jsx30(
|
|
5620
5683
|
"input",
|
|
5621
5684
|
{
|
|
5622
5685
|
type: "radio",
|
|
@@ -5656,9 +5719,9 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5656
5719
|
),
|
|
5657
5720
|
onClick: () => onValueChange?.(value),
|
|
5658
5721
|
children: [
|
|
5659
|
-
Icon && /* @__PURE__ */
|
|
5722
|
+
Icon && /* @__PURE__ */ jsx30(Icon, { className: "h-4 w-4" }),
|
|
5660
5723
|
label || children,
|
|
5661
|
-
/* @__PURE__ */
|
|
5724
|
+
/* @__PURE__ */ jsx30(
|
|
5662
5725
|
"input",
|
|
5663
5726
|
{
|
|
5664
5727
|
type: "radio",
|
|
@@ -5676,7 +5739,7 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5676
5739
|
);
|
|
5677
5740
|
}
|
|
5678
5741
|
return /* @__PURE__ */ jsxs25("div", { className: cn("flex items-center gap-2", className), children: [
|
|
5679
|
-
/* @__PURE__ */
|
|
5742
|
+
/* @__PURE__ */ jsx30(
|
|
5680
5743
|
"button",
|
|
5681
5744
|
{
|
|
5682
5745
|
ref,
|
|
@@ -5695,14 +5758,14 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5695
5758
|
sizeStyles7[size].radio
|
|
5696
5759
|
),
|
|
5697
5760
|
onClick: () => onValueChange?.(value),
|
|
5698
|
-
children: /* @__PURE__ */
|
|
5761
|
+
children: /* @__PURE__ */ jsx30(
|
|
5699
5762
|
"span",
|
|
5700
5763
|
{
|
|
5701
5764
|
className: cn(
|
|
5702
5765
|
"flex items-center justify-center w-full h-full rounded-full transition-all duration-200",
|
|
5703
5766
|
isSelected && "bg-primary"
|
|
5704
5767
|
),
|
|
5705
|
-
children: isSelected && /* @__PURE__ */
|
|
5768
|
+
children: isSelected && /* @__PURE__ */ jsx30("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) })
|
|
5706
5769
|
}
|
|
5707
5770
|
)
|
|
5708
5771
|
}
|
|
@@ -5719,14 +5782,14 @@ var RadioGroupItem = React23.forwardRef(
|
|
|
5719
5782
|
),
|
|
5720
5783
|
children: [
|
|
5721
5784
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
5722
|
-
Icon && /* @__PURE__ */
|
|
5723
|
-
/* @__PURE__ */
|
|
5785
|
+
Icon && /* @__PURE__ */ jsx30(Icon, { className: "h-4 w-4" }),
|
|
5786
|
+
/* @__PURE__ */ jsx30("span", { children: label || children })
|
|
5724
5787
|
] }),
|
|
5725
|
-
description && /* @__PURE__ */
|
|
5788
|
+
description && /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground mt-0.5 text-xs", children: description })
|
|
5726
5789
|
]
|
|
5727
5790
|
}
|
|
5728
5791
|
),
|
|
5729
|
-
/* @__PURE__ */
|
|
5792
|
+
/* @__PURE__ */ jsx30(
|
|
5730
5793
|
"input",
|
|
5731
5794
|
{
|
|
5732
5795
|
type: "radio",
|
|
@@ -5746,7 +5809,7 @@ RadioGroupItem.displayName = "RadioGroupItem";
|
|
|
5746
5809
|
|
|
5747
5810
|
// ../../components/ui/Slider.tsx
|
|
5748
5811
|
import * as React24 from "react";
|
|
5749
|
-
import { jsx as
|
|
5812
|
+
import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5750
5813
|
var SIZE_STYLES = {
|
|
5751
5814
|
sm: {
|
|
5752
5815
|
track: "h-1",
|
|
@@ -5808,18 +5871,18 @@ var Slider = React24.forwardRef(
|
|
|
5808
5871
|
}
|
|
5809
5872
|
return /* @__PURE__ */ jsxs26("div", { className: cn("w-full space-y-2", containerClassName), children: [
|
|
5810
5873
|
(label || showValue) && /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between", children: [
|
|
5811
|
-
label && /* @__PURE__ */
|
|
5812
|
-
showValue && /* @__PURE__ */
|
|
5874
|
+
label && /* @__PURE__ */ jsx31("label", { className: cn("text-sm font-medium text-foreground", labelClassName), children: label }),
|
|
5875
|
+
showValue && /* @__PURE__ */ jsx31("span", { className: cn("text-xs font-mono text-muted-foreground min-w-[2rem] text-right", valueClassName), children: displayValue })
|
|
5813
5876
|
] }),
|
|
5814
5877
|
/* @__PURE__ */ jsxs26("div", { className: cn("relative flex items-center", sizeStyles8.container), children: [
|
|
5815
|
-
/* @__PURE__ */
|
|
5878
|
+
/* @__PURE__ */ jsx31("div", { className: cn("w-full rounded-full bg-secondary relative overflow-hidden", sizeStyles8.track, trackClassName), children: /* @__PURE__ */ jsx31(
|
|
5816
5879
|
"div",
|
|
5817
5880
|
{
|
|
5818
5881
|
className: "absolute left-0 top-0 h-full bg-primary rounded-full transition-all duration-150 ease-out",
|
|
5819
5882
|
style: { width: `${percentage}%` }
|
|
5820
5883
|
}
|
|
5821
5884
|
) }),
|
|
5822
|
-
/* @__PURE__ */
|
|
5885
|
+
/* @__PURE__ */ jsx31(
|
|
5823
5886
|
"input",
|
|
5824
5887
|
{
|
|
5825
5888
|
ref,
|
|
@@ -5885,7 +5948,7 @@ Slider.displayName = "Slider";
|
|
|
5885
5948
|
// ../../components/ui/OverlayControls.tsx
|
|
5886
5949
|
import { Dot, Maximize2, Pause, Play, RotateCcw, RotateCw, Volume2, VolumeX } from "lucide-react";
|
|
5887
5950
|
import React25 from "react";
|
|
5888
|
-
import { Fragment as Fragment7, jsx as
|
|
5951
|
+
import { Fragment as Fragment7, jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5889
5952
|
function OverlayControls({
|
|
5890
5953
|
mode,
|
|
5891
5954
|
value,
|
|
@@ -6038,8 +6101,10 @@ function OverlayControls({
|
|
|
6038
6101
|
break;
|
|
6039
6102
|
case "f":
|
|
6040
6103
|
case "F":
|
|
6041
|
-
e.
|
|
6042
|
-
|
|
6104
|
+
if (!e.ctrlKey && !e.metaKey) {
|
|
6105
|
+
e.preventDefault();
|
|
6106
|
+
onToggleFullscreen?.();
|
|
6107
|
+
}
|
|
6043
6108
|
break;
|
|
6044
6109
|
case "m":
|
|
6045
6110
|
case "M":
|
|
@@ -6107,7 +6172,7 @@ function OverlayControls({
|
|
|
6107
6172
|
setPreviewData(null);
|
|
6108
6173
|
};
|
|
6109
6174
|
return /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
6110
|
-
keyboardFeedback && /* @__PURE__ */
|
|
6175
|
+
keyboardFeedback && /* @__PURE__ */ jsx32(
|
|
6111
6176
|
"div",
|
|
6112
6177
|
{
|
|
6113
6178
|
className: cn(
|
|
@@ -6115,10 +6180,10 @@ function OverlayControls({
|
|
|
6115
6180
|
keyboardFeedback.type === "seek" && (keyboardFeedback.value ?? 0) > 0 ? "justify-end pr-32" : keyboardFeedback.type === "seek" && (keyboardFeedback.value ?? 0) < 0 ? "justify-start pl-32" : "justify-center"
|
|
6116
6181
|
),
|
|
6117
6182
|
children: /* @__PURE__ */ jsxs27("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: [
|
|
6118
|
-
keyboardFeedback.type === "play" && /* @__PURE__ */
|
|
6119
|
-
keyboardFeedback.type === "pause" && /* @__PURE__ */
|
|
6183
|
+
keyboardFeedback.type === "play" && /* @__PURE__ */ jsx32(Play, { className: "w-16 h-16 text-white", fill: "white" }),
|
|
6184
|
+
keyboardFeedback.type === "pause" && /* @__PURE__ */ jsx32(Pause, { className: "w-16 h-16 text-white", fill: "white" }),
|
|
6120
6185
|
keyboardFeedback.type === "seek" && /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-3", children: [
|
|
6121
|
-
(keyboardFeedback.value ?? 0) > 0 ? /* @__PURE__ */
|
|
6186
|
+
(keyboardFeedback.value ?? 0) > 0 ? /* @__PURE__ */ jsx32(RotateCw, { className: "w-12 h-12 text-white" }) : /* @__PURE__ */ jsx32(RotateCcw, { className: "w-12 h-12 text-white" }),
|
|
6122
6187
|
/* @__PURE__ */ jsxs27("span", { className: "text-3xl font-bold text-white", children: [
|
|
6123
6188
|
keyboardFeedback.value && keyboardFeedback.value > 0 ? "+" : "",
|
|
6124
6189
|
keyboardFeedback.value,
|
|
@@ -6126,21 +6191,21 @@ function OverlayControls({
|
|
|
6126
6191
|
] })
|
|
6127
6192
|
] }),
|
|
6128
6193
|
keyboardFeedback.type === "volume" && /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-3", children: [
|
|
6129
|
-
/* @__PURE__ */
|
|
6194
|
+
/* @__PURE__ */ jsx32(Volume2, { className: "w-12 h-12 text-white" }),
|
|
6130
6195
|
/* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-1.5", children: [
|
|
6131
6196
|
/* @__PURE__ */ jsxs27("span", { className: "text-2xl font-bold text-white", children: [
|
|
6132
6197
|
keyboardFeedback.value,
|
|
6133
6198
|
"%"
|
|
6134
6199
|
] }),
|
|
6135
|
-
/* @__PURE__ */
|
|
6200
|
+
/* @__PURE__ */ jsx32("div", { className: "w-32 h-1.5 bg-white/30 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx32("div", { className: "h-full bg-white rounded-full transition-all", style: { width: `${keyboardFeedback.value}%` } }) })
|
|
6136
6201
|
] })
|
|
6137
6202
|
] }),
|
|
6138
|
-
keyboardFeedback.type === "mute" && /* @__PURE__ */
|
|
6139
|
-
keyboardFeedback.type === "unmute" && /* @__PURE__ */
|
|
6203
|
+
keyboardFeedback.type === "mute" && /* @__PURE__ */ jsx32(VolumeX, { className: "w-16 h-16 text-white" }),
|
|
6204
|
+
keyboardFeedback.type === "unmute" && /* @__PURE__ */ jsx32(Volume2, { className: "w-16 h-16 text-white" })
|
|
6140
6205
|
] })
|
|
6141
6206
|
}
|
|
6142
6207
|
),
|
|
6143
|
-
/* @__PURE__ */
|
|
6208
|
+
/* @__PURE__ */ jsx32(
|
|
6144
6209
|
"div",
|
|
6145
6210
|
{
|
|
6146
6211
|
className: cn(
|
|
@@ -6151,7 +6216,7 @@ function OverlayControls({
|
|
|
6151
6216
|
),
|
|
6152
6217
|
children: /* @__PURE__ */ jsxs27("div", { className: "px-4", children: [
|
|
6153
6218
|
/* @__PURE__ */ jsxs27("div", { ref: sliderRef, onMouseMove: handleSliderMouseMove, onMouseLeave: handleSliderMouseLeave, className: "relative", children: [
|
|
6154
|
-
/* @__PURE__ */
|
|
6219
|
+
/* @__PURE__ */ jsx32(
|
|
6155
6220
|
Slider,
|
|
6156
6221
|
{
|
|
6157
6222
|
min: 0,
|
|
@@ -6176,14 +6241,14 @@ function OverlayControls({
|
|
|
6176
6241
|
noFocus: true
|
|
6177
6242
|
}
|
|
6178
6243
|
),
|
|
6179
|
-
previewData && /* @__PURE__ */
|
|
6180
|
-
/* @__PURE__ */
|
|
6181
|
-
/* @__PURE__ */
|
|
6182
|
-
] }) : /* @__PURE__ */
|
|
6244
|
+
previewData && /* @__PURE__ */ jsx32("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__ */ jsxs27("div", { className: "bg-background/95 backdrop-blur rounded-md border border-border shadow-lg overflow-hidden", children: [
|
|
6245
|
+
/* @__PURE__ */ jsx32("img", { src: previewData.url, alt: "Preview", className: "w-40 h-24 object-cover" }),
|
|
6246
|
+
/* @__PURE__ */ jsx32("div", { className: "px-2 py-1 text-xs font-mono text-center bg-background/80", children: formatTime2(previewData.time) })
|
|
6247
|
+
] }) : /* @__PURE__ */ jsx32("div", { className: "px-3 py-1.5 rounded-md bg-background/90 backdrop-blur border border-border shadow-lg", children: /* @__PURE__ */ jsx32("div", { className: "text-xs font-mono text-center", children: formatTime2(previewData.time) }) }) })
|
|
6183
6248
|
] }),
|
|
6184
6249
|
showControlsBar && /* @__PURE__ */ jsxs27("div", { className: "mt-2 flex items-center justify-between gap-2", children: [
|
|
6185
6250
|
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", children: [
|
|
6186
|
-
/* @__PURE__ */
|
|
6251
|
+
/* @__PURE__ */ jsx32(
|
|
6187
6252
|
Button_default,
|
|
6188
6253
|
{
|
|
6189
6254
|
variant: "ghost",
|
|
@@ -6191,10 +6256,10 @@ function OverlayControls({
|
|
|
6191
6256
|
onClick: onTogglePlay,
|
|
6192
6257
|
title: playing ? "T\u1EA1m d\u1EEBng" : "Ph\xE1t",
|
|
6193
6258
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6194
|
-
children: playing ? /* @__PURE__ */
|
|
6259
|
+
children: playing ? /* @__PURE__ */ jsx32(Pause, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx32(Play, { className: "w-4 h-4" })
|
|
6195
6260
|
}
|
|
6196
6261
|
),
|
|
6197
|
-
onSkip && /* @__PURE__ */
|
|
6262
|
+
onSkip && /* @__PURE__ */ jsx32(
|
|
6198
6263
|
Button_default,
|
|
6199
6264
|
{
|
|
6200
6265
|
variant: "ghost",
|
|
@@ -6202,10 +6267,10 @@ function OverlayControls({
|
|
|
6202
6267
|
onClick: () => onSkip(-skipSeconds),
|
|
6203
6268
|
title: `L\xF9i ${skipSeconds}s`,
|
|
6204
6269
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6205
|
-
children: /* @__PURE__ */
|
|
6270
|
+
children: /* @__PURE__ */ jsx32(RotateCcw, { className: "w-4 h-4" })
|
|
6206
6271
|
}
|
|
6207
6272
|
),
|
|
6208
|
-
onSkip && /* @__PURE__ */
|
|
6273
|
+
onSkip && /* @__PURE__ */ jsx32(
|
|
6209
6274
|
Button_default,
|
|
6210
6275
|
{
|
|
6211
6276
|
variant: "ghost",
|
|
@@ -6213,7 +6278,7 @@ function OverlayControls({
|
|
|
6213
6278
|
onClick: () => onSkip(skipSeconds),
|
|
6214
6279
|
title: `Tua ${skipSeconds}s`,
|
|
6215
6280
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6216
|
-
children: /* @__PURE__ */
|
|
6281
|
+
children: /* @__PURE__ */ jsx32(RotateCw, { className: "w-4 h-4" })
|
|
6217
6282
|
}
|
|
6218
6283
|
),
|
|
6219
6284
|
(showTime ?? true) && /* @__PURE__ */ jsxs27("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: [
|
|
@@ -6222,7 +6287,7 @@ function OverlayControls({
|
|
|
6222
6287
|
formatTime2(max)
|
|
6223
6288
|
] }),
|
|
6224
6289
|
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", children: [
|
|
6225
|
-
/* @__PURE__ */
|
|
6290
|
+
/* @__PURE__ */ jsx32(
|
|
6226
6291
|
Button_default,
|
|
6227
6292
|
{
|
|
6228
6293
|
variant: "ghost",
|
|
@@ -6230,10 +6295,10 @@ function OverlayControls({
|
|
|
6230
6295
|
onClick: onToggleMute,
|
|
6231
6296
|
title: muted ? "B\u1EADt ti\u1EBFng" : "T\u1EAFt ti\u1EBFng",
|
|
6232
6297
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6233
|
-
children: muted || (volume ?? 1) === 0 ? /* @__PURE__ */
|
|
6298
|
+
children: muted || (volume ?? 1) === 0 ? /* @__PURE__ */ jsx32(VolumeX, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx32(Volume2, { className: "w-4 h-4" })
|
|
6234
6299
|
}
|
|
6235
6300
|
),
|
|
6236
|
-
/* @__PURE__ */
|
|
6301
|
+
/* @__PURE__ */ jsx32("div", { className: "w-24", children: /* @__PURE__ */ jsx32(
|
|
6237
6302
|
Slider,
|
|
6238
6303
|
{
|
|
6239
6304
|
min: 0,
|
|
@@ -6258,7 +6323,7 @@ function OverlayControls({
|
|
|
6258
6323
|
title: "Tr\u1EF1c ti\u1EBFp (v\u1EC1 Live)",
|
|
6259
6324
|
className: "bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6260
6325
|
children: [
|
|
6261
|
-
/* @__PURE__ */
|
|
6326
|
+
/* @__PURE__ */ jsx32(Dot, { className: "w-10 h-10 text-destructive" }),
|
|
6262
6327
|
"Tr\u1EF1c ti\u1EBFp"
|
|
6263
6328
|
]
|
|
6264
6329
|
}
|
|
@@ -6278,7 +6343,7 @@ function OverlayControls({
|
|
|
6278
6343
|
]
|
|
6279
6344
|
}
|
|
6280
6345
|
),
|
|
6281
|
-
rateOpen && /* @__PURE__ */
|
|
6346
|
+
rateOpen && /* @__PURE__ */ jsx32("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__ */ jsxs27(
|
|
6282
6347
|
"button",
|
|
6283
6348
|
{
|
|
6284
6349
|
onClick: () => {
|
|
@@ -6294,7 +6359,7 @@ function OverlayControls({
|
|
|
6294
6359
|
r
|
|
6295
6360
|
)) })
|
|
6296
6361
|
] }),
|
|
6297
|
-
onToggleFullscreen && /* @__PURE__ */
|
|
6362
|
+
onToggleFullscreen && /* @__PURE__ */ jsx32(
|
|
6298
6363
|
Button_default,
|
|
6299
6364
|
{
|
|
6300
6365
|
variant: "ghost",
|
|
@@ -6302,7 +6367,7 @@ function OverlayControls({
|
|
|
6302
6367
|
onClick: onToggleFullscreen,
|
|
6303
6368
|
title: "To\xE0n m\xE0n h\xECnh",
|
|
6304
6369
|
className: "px-3 bg-background/60 hover:bg-background/80 border-transparent shadow-sm outline-none focus:outline-none focus:ring-0",
|
|
6305
|
-
children: /* @__PURE__ */
|
|
6370
|
+
children: /* @__PURE__ */ jsx32(Maximize2, { className: "w-4 h-4" })
|
|
6306
6371
|
}
|
|
6307
6372
|
)
|
|
6308
6373
|
] })
|
|
@@ -6314,12 +6379,12 @@ function OverlayControls({
|
|
|
6314
6379
|
}
|
|
6315
6380
|
|
|
6316
6381
|
// ../../components/ui/CategoryTreeSelect.tsx
|
|
6317
|
-
import { useState as
|
|
6382
|
+
import { useState as useState22 } from "react";
|
|
6318
6383
|
import { ChevronRight as ChevronRight4, ChevronDown as ChevronDown3, Check as Check5 } from "lucide-react";
|
|
6319
|
-
import { Fragment as Fragment8, jsx as
|
|
6384
|
+
import { Fragment as Fragment8, jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6320
6385
|
function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1ECDn danh m\u1EE5c", disabled }) {
|
|
6321
|
-
const [isOpen, setIsOpen] =
|
|
6322
|
-
const [expandedNodes, setExpandedNodes] =
|
|
6386
|
+
const [isOpen, setIsOpen] = useState22(false);
|
|
6387
|
+
const [expandedNodes, setExpandedNodes] = useState22(/* @__PURE__ */ new Set());
|
|
6323
6388
|
const parentCategories = categories.filter((c) => !c.parent_id);
|
|
6324
6389
|
const childrenMap = /* @__PURE__ */ new Map();
|
|
6325
6390
|
categories.forEach((cat) => {
|
|
@@ -6363,13 +6428,21 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
6363
6428
|
"div",
|
|
6364
6429
|
{
|
|
6365
6430
|
className: cn(
|
|
6366
|
-
"flex items-center gap-2 px-3 py-2 cursor-pointer rounded-md transition-colors",
|
|
6431
|
+
"relative flex items-center gap-2 px-3 py-2 cursor-pointer rounded-md transition-colors",
|
|
6367
6432
|
"hover:bg-accent",
|
|
6368
|
-
|
|
6433
|
+
// Selected state: subtle bg + square left indicator, avoid left rounding
|
|
6434
|
+
isSelected && "bg-primary/10 rounded-r-md"
|
|
6369
6435
|
),
|
|
6370
6436
|
style: { paddingLeft: `${level * 1.5 + 0.75}rem` },
|
|
6371
6437
|
children: [
|
|
6372
|
-
|
|
6438
|
+
isSelected && /* @__PURE__ */ jsx33(
|
|
6439
|
+
"span",
|
|
6440
|
+
{
|
|
6441
|
+
"aria-hidden": true,
|
|
6442
|
+
className: "absolute left-0 top-0 bottom-0 w-1 bg-primary"
|
|
6443
|
+
}
|
|
6444
|
+
),
|
|
6445
|
+
hasChildren ? /* @__PURE__ */ jsx33(
|
|
6373
6446
|
"button",
|
|
6374
6447
|
{
|
|
6375
6448
|
type: "button",
|
|
@@ -6378,33 +6451,33 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
6378
6451
|
toggleExpand(category.id);
|
|
6379
6452
|
},
|
|
6380
6453
|
className: "p-0.5 hover:bg-accent rounded",
|
|
6381
|
-
children: isExpanded ? /* @__PURE__ */
|
|
6454
|
+
children: isExpanded ? /* @__PURE__ */ jsx33(ChevronDown3, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx33(ChevronRight4, { className: "w-4 h-4" })
|
|
6382
6455
|
}
|
|
6383
|
-
) : /* @__PURE__ */
|
|
6456
|
+
) : /* @__PURE__ */ jsx33("span", { className: "w-5" }),
|
|
6384
6457
|
/* @__PURE__ */ jsxs28(
|
|
6385
6458
|
"div",
|
|
6386
6459
|
{
|
|
6387
6460
|
onClick: () => handleSelect(category.id, category),
|
|
6388
6461
|
className: "flex items-center gap-2 flex-1",
|
|
6389
6462
|
children: [
|
|
6390
|
-
/* @__PURE__ */
|
|
6463
|
+
/* @__PURE__ */ jsx33(
|
|
6391
6464
|
"div",
|
|
6392
6465
|
{
|
|
6393
6466
|
className: cn(
|
|
6394
6467
|
"w-4 h-4 border-2 rounded flex items-center justify-center transition-colors",
|
|
6395
6468
|
isSelected ? "bg-primary border-primary" : "border-muted-foreground/30"
|
|
6396
6469
|
),
|
|
6397
|
-
children: isSelected && /* @__PURE__ */
|
|
6470
|
+
children: isSelected && /* @__PURE__ */ jsx33(Check5, { className: "w-3 h-3 text-primary-foreground" })
|
|
6398
6471
|
}
|
|
6399
6472
|
),
|
|
6400
|
-
/* @__PURE__ */
|
|
6473
|
+
/* @__PURE__ */ jsx33("span", { className: cn("text-sm", isSelected && "font-medium text-primary"), children: category.name })
|
|
6401
6474
|
]
|
|
6402
6475
|
}
|
|
6403
6476
|
)
|
|
6404
6477
|
]
|
|
6405
6478
|
}
|
|
6406
6479
|
),
|
|
6407
|
-
hasChildren && isExpanded && /* @__PURE__ */
|
|
6480
|
+
hasChildren && isExpanded && /* @__PURE__ */ jsx33("div", { children: children.map((child) => renderCategory(child, level + 1)) })
|
|
6408
6481
|
] }, category.id);
|
|
6409
6482
|
};
|
|
6410
6483
|
const selectedCount = value.length;
|
|
@@ -6417,93 +6490,39 @@ function CategoryTreeSelect({ categories, value, onChange, placeholder = "Ch\u1E
|
|
|
6417
6490
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
6418
6491
|
disabled,
|
|
6419
6492
|
className: cn(
|
|
6420
|
-
|
|
6421
|
-
"
|
|
6493
|
+
// Match Combobox trigger outline + focus styles
|
|
6494
|
+
"flex w-full items-center justify-between px-3 bg-background border border-input",
|
|
6495
|
+
"rounded-md h-10 py-2 text-sm",
|
|
6496
|
+
"hover:bg-accent/5 transition-colors hover:border-primary/40 focus:border-primary",
|
|
6497
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
6422
6498
|
disabled && "opacity-50 cursor-not-allowed",
|
|
6423
|
-
isOpen && "border-primary
|
|
6499
|
+
isOpen && "border-primary"
|
|
6424
6500
|
),
|
|
6425
6501
|
children: [
|
|
6426
|
-
/* @__PURE__ */
|
|
6427
|
-
/* @__PURE__ */
|
|
6502
|
+
/* @__PURE__ */ jsx33("span", { className: cn("text-sm", selectedCount === 0 && "text-muted-foreground"), children: displayText }),
|
|
6503
|
+
/* @__PURE__ */ jsx33(ChevronDown3, { className: cn("w-4 h-4 transition-transform", isOpen && "transform rotate-180") })
|
|
6428
6504
|
]
|
|
6429
6505
|
}
|
|
6430
6506
|
),
|
|
6431
6507
|
isOpen && !disabled && /* @__PURE__ */ jsxs28(Fragment8, { children: [
|
|
6432
|
-
/* @__PURE__ */
|
|
6433
|
-
/* @__PURE__ */
|
|
6508
|
+
/* @__PURE__ */ jsx33("div", { className: "fixed inset-0 z-10", onClick: () => setIsOpen(false) }),
|
|
6509
|
+
/* @__PURE__ */ jsx33(
|
|
6510
|
+
"div",
|
|
6511
|
+
{
|
|
6512
|
+
className: cn(
|
|
6513
|
+
"absolute z-20 mt-1 w-full max-h-80 overflow-auto",
|
|
6514
|
+
"rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
6515
|
+
"backdrop-blur-sm bg-popover/95 border-border/60"
|
|
6516
|
+
),
|
|
6517
|
+
children: /* @__PURE__ */ jsx33("div", { className: "p-1", children: parentCategories.length === 0 ? /* @__PURE__ */ jsx33("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)) })
|
|
6518
|
+
}
|
|
6519
|
+
)
|
|
6434
6520
|
] })
|
|
6435
6521
|
] });
|
|
6436
6522
|
}
|
|
6437
6523
|
|
|
6438
|
-
// ../../components/ui/SmartImage.tsx
|
|
6439
|
-
import Image from "next/image";
|
|
6440
|
-
import React27 from "react";
|
|
6441
|
-
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
6442
|
-
var DEFAULT_FALLBACK = "/images/products/hoa-hong-do.png";
|
|
6443
|
-
function SmartImage({
|
|
6444
|
-
src,
|
|
6445
|
-
alt,
|
|
6446
|
-
className,
|
|
6447
|
-
ratioClass,
|
|
6448
|
-
roundedClass = "rounded-lg",
|
|
6449
|
-
fill = true,
|
|
6450
|
-
width,
|
|
6451
|
-
height,
|
|
6452
|
-
sizes = "(max-width: 768px) 100vw, 33vw",
|
|
6453
|
-
priority = false,
|
|
6454
|
-
quality = 80,
|
|
6455
|
-
fit = "cover",
|
|
6456
|
-
fallbackSrc = DEFAULT_FALLBACK
|
|
6457
|
-
}) {
|
|
6458
|
-
const normalize = (input) => {
|
|
6459
|
-
if (!input || input.length === 0) return fallbackSrc;
|
|
6460
|
-
if (input.startsWith("/images/products/") && /\.(jpg|jpeg)($|\?)/i.test(input)) {
|
|
6461
|
-
return input.replace(/\.(jpg|jpeg)(?=$|\?)/i, ".png");
|
|
6462
|
-
}
|
|
6463
|
-
return input;
|
|
6464
|
-
};
|
|
6465
|
-
const [resolvedSrc, setResolvedSrc] = React27.useState(() => normalize(src));
|
|
6466
|
-
const handleError = () => {
|
|
6467
|
-
if (resolvedSrc.endsWith(".jpg")) {
|
|
6468
|
-
setResolvedSrc(resolvedSrc.replace(/\.jpg($|\?)/, ".png$1"));
|
|
6469
|
-
} else if (resolvedSrc !== fallbackSrc) {
|
|
6470
|
-
setResolvedSrc(fallbackSrc);
|
|
6471
|
-
}
|
|
6472
|
-
};
|
|
6473
|
-
const Wrapper = ({ children }) => /* @__PURE__ */ jsx33("div", { className: cn("relative overflow-hidden bg-muted/30", ratioClass, roundedClass, className), children });
|
|
6474
|
-
if (fill) {
|
|
6475
|
-
return /* @__PURE__ */ jsx33(Wrapper, { children: /* @__PURE__ */ jsx33(
|
|
6476
|
-
Image,
|
|
6477
|
-
{
|
|
6478
|
-
src: resolvedSrc,
|
|
6479
|
-
alt,
|
|
6480
|
-
fill: true,
|
|
6481
|
-
sizes,
|
|
6482
|
-
onError: handleError,
|
|
6483
|
-
priority,
|
|
6484
|
-
quality,
|
|
6485
|
-
style: { objectFit: fit }
|
|
6486
|
-
}
|
|
6487
|
-
) });
|
|
6488
|
-
}
|
|
6489
|
-
return /* @__PURE__ */ jsx33("div", { className: cn("relative overflow-hidden bg-muted/30", roundedClass, className), children: /* @__PURE__ */ jsx33(
|
|
6490
|
-
Image,
|
|
6491
|
-
{
|
|
6492
|
-
src: resolvedSrc,
|
|
6493
|
-
alt,
|
|
6494
|
-
width,
|
|
6495
|
-
height,
|
|
6496
|
-
sizes,
|
|
6497
|
-
onError: handleError,
|
|
6498
|
-
priority,
|
|
6499
|
-
quality,
|
|
6500
|
-
style: { objectFit: fit, width: "100%", height: "100%" }
|
|
6501
|
-
}
|
|
6502
|
-
) });
|
|
6503
|
-
}
|
|
6504
|
-
|
|
6505
6524
|
// ../../components/ui/ImageUpload.tsx
|
|
6506
|
-
import { useState as
|
|
6525
|
+
import { useState as useState23, useRef as useRef9, useCallback as useCallback7 } from "react";
|
|
6507
6526
|
import { Upload, X as X8, Image as ImageIcon, Loader2 as Loader22, Check as Check6 } from "lucide-react";
|
|
6508
6527
|
import { useTranslations as useTranslations6 } from "next-intl";
|
|
6509
6528
|
import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
@@ -6522,9 +6541,9 @@ function ImageUpload({
|
|
|
6522
6541
|
browseText,
|
|
6523
6542
|
supportedFormatsText
|
|
6524
6543
|
}) {
|
|
6525
|
-
const [isDragging, setIsDragging] =
|
|
6526
|
-
const [uploading, setUploading] =
|
|
6527
|
-
const [uploadedImages, setUploadedImages] =
|
|
6544
|
+
const [isDragging, setIsDragging] = useState23(false);
|
|
6545
|
+
const [uploading, setUploading] = useState23(false);
|
|
6546
|
+
const [uploadedImages, setUploadedImages] = useState23([]);
|
|
6528
6547
|
const fileInputRef = useRef9(null);
|
|
6529
6548
|
const { addToast } = useToast();
|
|
6530
6549
|
const t = useTranslations6("OCR.imageUpload");
|
|
@@ -6731,20 +6750,20 @@ function ImageUpload({
|
|
|
6731
6750
|
}
|
|
6732
6751
|
|
|
6733
6752
|
// ../../components/ui/Carousel.tsx
|
|
6734
|
-
import * as
|
|
6753
|
+
import * as React27 from "react";
|
|
6735
6754
|
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
6736
6755
|
import { Fragment as Fragment9, jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6737
6756
|
function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
6738
|
-
const [currentIndex, setCurrentIndex] =
|
|
6739
|
-
const totalSlides =
|
|
6740
|
-
const [isPaused, setIsPaused] =
|
|
6741
|
-
const scrollPrev =
|
|
6757
|
+
const [currentIndex, setCurrentIndex] = React27.useState(0);
|
|
6758
|
+
const totalSlides = React27.Children.count(children);
|
|
6759
|
+
const [isPaused, setIsPaused] = React27.useState(false);
|
|
6760
|
+
const scrollPrev = React27.useCallback(() => {
|
|
6742
6761
|
setCurrentIndex((prev) => prev > 0 ? prev - 1 : totalSlides - 1);
|
|
6743
6762
|
}, [totalSlides]);
|
|
6744
|
-
const scrollNext =
|
|
6763
|
+
const scrollNext = React27.useCallback(() => {
|
|
6745
6764
|
setCurrentIndex((prev) => prev < totalSlides - 1 ? prev + 1 : 0);
|
|
6746
6765
|
}, [totalSlides]);
|
|
6747
|
-
|
|
6766
|
+
React27.useEffect(() => {
|
|
6748
6767
|
if (!autoScroll || isPaused || totalSlides <= 1) return;
|
|
6749
6768
|
const interval = setInterval(() => {
|
|
6750
6769
|
scrollNext();
|
|
@@ -6752,7 +6771,7 @@ function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
|
6752
6771
|
return () => clearInterval(interval);
|
|
6753
6772
|
}, [autoScroll, isPaused, totalSlides, autoScrollInterval, scrollNext]);
|
|
6754
6773
|
return /* @__PURE__ */ jsxs30("div", { className: "relative w-full overflow-hidden", onMouseEnter: () => setIsPaused(true), onMouseLeave: () => setIsPaused(false), children: [
|
|
6755
|
-
/* @__PURE__ */ jsx35("div", { className: "flex transition-transform duration-500 ease-in-out", style: { transform: `translateX(-${currentIndex * 100}%)` }, children:
|
|
6774
|
+
/* @__PURE__ */ jsx35("div", { className: "flex transition-transform duration-500 ease-in-out", style: { transform: `translateX(-${currentIndex * 100}%)` }, children: React27.Children.map(children, (child, idx) => /* @__PURE__ */ jsx35("div", { className: "flex-shrink-0 w-full h-full", children: child }, idx)) }),
|
|
6756
6775
|
totalSlides > 1 && /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
6757
6776
|
/* @__PURE__ */ jsx35(
|
|
6758
6777
|
Button_default,
|
|
@@ -6788,11 +6807,11 @@ function Carousel({ children, autoScroll = true, autoScrollInterval = 5e3 }) {
|
|
|
6788
6807
|
}
|
|
6789
6808
|
|
|
6790
6809
|
// ../../components/ui/ClientOnly.tsx
|
|
6791
|
-
import { useEffect as
|
|
6810
|
+
import { useEffect as useEffect14, useState as useState25 } from "react";
|
|
6792
6811
|
import { Fragment as Fragment10, jsx as jsx36 } from "react/jsx-runtime";
|
|
6793
6812
|
function ClientOnly({ children, fallback = null }) {
|
|
6794
|
-
const [hasMounted, setHasMounted] =
|
|
6795
|
-
|
|
6813
|
+
const [hasMounted, setHasMounted] = useState25(false);
|
|
6814
|
+
useEffect14(() => {
|
|
6796
6815
|
setHasMounted(true);
|
|
6797
6816
|
}, []);
|
|
6798
6817
|
if (!hasMounted) {
|
|
@@ -6888,9 +6907,9 @@ var LoadingBar = ({
|
|
|
6888
6907
|
};
|
|
6889
6908
|
|
|
6890
6909
|
// ../../components/ui/Table.tsx
|
|
6891
|
-
import
|
|
6910
|
+
import React28 from "react";
|
|
6892
6911
|
import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6893
|
-
var Table =
|
|
6912
|
+
var Table = React28.forwardRef(
|
|
6894
6913
|
({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6895
6914
|
"div",
|
|
6896
6915
|
{
|
|
@@ -6913,7 +6932,7 @@ var Table = React29.forwardRef(
|
|
|
6913
6932
|
)
|
|
6914
6933
|
);
|
|
6915
6934
|
Table.displayName = "Table";
|
|
6916
|
-
var TableHeader =
|
|
6935
|
+
var TableHeader = React28.forwardRef(
|
|
6917
6936
|
({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ jsxs32(
|
|
6918
6937
|
"thead",
|
|
6919
6938
|
{
|
|
@@ -6932,7 +6951,7 @@ var TableHeader = React29.forwardRef(
|
|
|
6932
6951
|
)
|
|
6933
6952
|
);
|
|
6934
6953
|
TableHeader.displayName = "TableHeader";
|
|
6935
|
-
var TableBody =
|
|
6954
|
+
var TableBody = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6936
6955
|
"tbody",
|
|
6937
6956
|
{
|
|
6938
6957
|
ref,
|
|
@@ -6941,7 +6960,7 @@ var TableBody = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
6941
6960
|
}
|
|
6942
6961
|
));
|
|
6943
6962
|
TableBody.displayName = "TableBody";
|
|
6944
|
-
var TableFooter =
|
|
6963
|
+
var TableFooter = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6945
6964
|
"tfoot",
|
|
6946
6965
|
{
|
|
6947
6966
|
ref,
|
|
@@ -6953,7 +6972,7 @@ var TableFooter = React29.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6953
6972
|
}
|
|
6954
6973
|
));
|
|
6955
6974
|
TableFooter.displayName = "TableFooter";
|
|
6956
|
-
var TableRow =
|
|
6975
|
+
var TableRow = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6957
6976
|
"tr",
|
|
6958
6977
|
{
|
|
6959
6978
|
ref,
|
|
@@ -6967,7 +6986,7 @@ var TableRow = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
6967
6986
|
}
|
|
6968
6987
|
));
|
|
6969
6988
|
TableRow.displayName = "TableRow";
|
|
6970
|
-
var TableHead =
|
|
6989
|
+
var TableHead = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6971
6990
|
"th",
|
|
6972
6991
|
{
|
|
6973
6992
|
ref,
|
|
@@ -6979,7 +6998,7 @@ var TableHead = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
6979
6998
|
}
|
|
6980
6999
|
));
|
|
6981
7000
|
TableHead.displayName = "TableHead";
|
|
6982
|
-
var TableCell =
|
|
7001
|
+
var TableCell = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6983
7002
|
"td",
|
|
6984
7003
|
{
|
|
6985
7004
|
ref,
|
|
@@ -6988,7 +7007,7 @@ var TableCell = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
6988
7007
|
}
|
|
6989
7008
|
));
|
|
6990
7009
|
TableCell.displayName = "TableCell";
|
|
6991
|
-
var TableCaption =
|
|
7010
|
+
var TableCaption = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6992
7011
|
"caption",
|
|
6993
7012
|
{
|
|
6994
7013
|
ref,
|
|
@@ -7000,12 +7019,12 @@ TableCaption.displayName = "TableCaption";
|
|
|
7000
7019
|
|
|
7001
7020
|
// ../../components/ui/DataTable.tsx
|
|
7002
7021
|
import { Filter as FilterIcon } from "lucide-react";
|
|
7003
|
-
import
|
|
7022
|
+
import React29 from "react";
|
|
7004
7023
|
import { useTranslations as useTranslations7 } from "next-intl";
|
|
7005
7024
|
import { jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
7006
7025
|
function useDebounced(value, delay = 300) {
|
|
7007
|
-
const [debounced, setDebounced] =
|
|
7008
|
-
|
|
7026
|
+
const [debounced, setDebounced] = React29.useState(value);
|
|
7027
|
+
React29.useEffect(() => {
|
|
7009
7028
|
const id = setTimeout(() => setDebounced(value), delay);
|
|
7010
7029
|
return () => clearTimeout(id);
|
|
7011
7030
|
}, [value, delay]);
|
|
@@ -7027,24 +7046,25 @@ function DataTable({
|
|
|
7027
7046
|
enableDensityToggle = true,
|
|
7028
7047
|
striped = true,
|
|
7029
7048
|
// Mặc định bật màu nền sẽn kẽ cho các dòng
|
|
7049
|
+
columnDividers = false,
|
|
7030
7050
|
className,
|
|
7031
7051
|
labels
|
|
7032
7052
|
}) {
|
|
7033
7053
|
const t = useTranslations7("Common");
|
|
7034
|
-
const [visibleCols, setVisibleCols] =
|
|
7035
|
-
const [filters, setFilters] =
|
|
7036
|
-
const [sort, setSort] =
|
|
7037
|
-
const [density, setDensity] =
|
|
7038
|
-
const [curPage, setCurPage] =
|
|
7039
|
-
const [curPageSize, setCurPageSize] =
|
|
7054
|
+
const [visibleCols, setVisibleCols] = React29.useState(() => columns.filter((c) => c.visible !== false).map((c) => c.key));
|
|
7055
|
+
const [filters, setFilters] = React29.useState({});
|
|
7056
|
+
const [sort, setSort] = React29.useState(null);
|
|
7057
|
+
const [density, setDensity] = React29.useState("normal");
|
|
7058
|
+
const [curPage, setCurPage] = React29.useState(page);
|
|
7059
|
+
const [curPageSize, setCurPageSize] = React29.useState(pageSize);
|
|
7040
7060
|
const debouncedFilters = useDebounced(filters, 350);
|
|
7041
|
-
|
|
7061
|
+
React29.useEffect(() => {
|
|
7042
7062
|
setCurPage(page);
|
|
7043
7063
|
}, [page]);
|
|
7044
|
-
|
|
7064
|
+
React29.useEffect(() => {
|
|
7045
7065
|
setCurPageSize(pageSize);
|
|
7046
7066
|
}, [pageSize]);
|
|
7047
|
-
|
|
7067
|
+
React29.useEffect(() => {
|
|
7048
7068
|
if (!onQueryChange) return;
|
|
7049
7069
|
onQueryChange({ filters: debouncedFilters, sort, page: curPage, pageSize: curPageSize });
|
|
7050
7070
|
}, [debouncedFilters, sort, curPage, curPageSize]);
|
|
@@ -7108,11 +7128,15 @@ function DataTable({
|
|
|
7108
7128
|
}
|
|
7109
7129
|
return null;
|
|
7110
7130
|
};
|
|
7111
|
-
const renderHeader = /* @__PURE__ */ jsx39(TableRow, { children: visibleColumns.map((col) => /* @__PURE__ */ jsx39(
|
|
7131
|
+
const renderHeader = /* @__PURE__ */ jsx39(TableRow, { children: visibleColumns.map((col, colIdx) => /* @__PURE__ */ jsx39(
|
|
7112
7132
|
TableHead,
|
|
7113
7133
|
{
|
|
7114
7134
|
style: { width: col.width },
|
|
7115
|
-
className: cn(
|
|
7135
|
+
className: cn(
|
|
7136
|
+
col.align === "right" && "text-right",
|
|
7137
|
+
col.align === "center" && "text-center",
|
|
7138
|
+
columnDividers && colIdx > 0 && "border-l border-border/60"
|
|
7139
|
+
),
|
|
7116
7140
|
children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center justify-between gap-2 select-none min-h-[2.5rem]", children: [
|
|
7117
7141
|
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-1 min-w-0 flex-1", children: [
|
|
7118
7142
|
/* @__PURE__ */ jsx39("span", { className: "truncate font-medium text-sm", children: col.title }),
|
|
@@ -7206,7 +7230,7 @@ function DataTable({
|
|
|
7206
7230
|
col.key
|
|
7207
7231
|
)) });
|
|
7208
7232
|
const isServerMode = Boolean(onQueryChange);
|
|
7209
|
-
const displayedData = isServerMode ? data :
|
|
7233
|
+
const displayedData = isServerMode ? data : React29.useMemo(() => {
|
|
7210
7234
|
const start = (curPage - 1) * curPageSize;
|
|
7211
7235
|
return data.slice(start, start + curPageSize);
|
|
7212
7236
|
}, [data, curPage, curPageSize]);
|
|
@@ -7262,10 +7286,10 @@ function DataTable({
|
|
|
7262
7286
|
toolbar
|
|
7263
7287
|
] })
|
|
7264
7288
|
] }),
|
|
7265
|
-
/* @__PURE__ */ jsx39("div", { className: cn("relative rounded-
|
|
7289
|
+
/* @__PURE__ */ jsx39("div", { className: cn("relative rounded-md border border-border/50 overflow-hidden", loading2 && "opacity-60 pointer-events-none"), children: /* @__PURE__ */ jsxs33(
|
|
7266
7290
|
Table,
|
|
7267
7291
|
{
|
|
7268
|
-
containerClassName: "border-0 rounded-none shadow-none",
|
|
7292
|
+
containerClassName: "border-0 md:border-0 rounded-none md:rounded-none shadow-none bg-transparent",
|
|
7269
7293
|
className: "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-[5] [&_thead]:bg-background [&_thead]:backdrop-blur-sm",
|
|
7270
7294
|
children: [
|
|
7271
7295
|
/* @__PURE__ */ jsx39(TableHeader, { children: renderHeader }),
|
|
@@ -7282,7 +7306,7 @@ function DataTable({
|
|
|
7282
7306
|
)
|
|
7283
7307
|
] }),
|
|
7284
7308
|
/* @__PURE__ */ jsx39("span", { className: "text-sm", children: "Loading..." })
|
|
7285
|
-
] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ jsx39(TableRow, { children: /* @__PURE__ */ jsx39(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : displayedData.map((row, idx) => /* @__PURE__ */ jsx39(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col) => {
|
|
7309
|
+
] }) }) }) : !displayedData || displayedData.length === 0 ? /* @__PURE__ */ jsx39(TableRow, { children: /* @__PURE__ */ jsx39(TableCell, { colSpan: visibleColumns.length, className: "text-center py-6 text-muted-foreground", children: "No data" }) }) : displayedData.map((row, idx) => /* @__PURE__ */ jsx39(TableRow, { className: cn(densityRowClass, striped && idx % 2 === 0 && "bg-muted/30"), children: visibleColumns.map((col, colIdx) => {
|
|
7286
7310
|
const value = col.dataIndex ? row[col.dataIndex] : void 0;
|
|
7287
7311
|
return /* @__PURE__ */ jsx39(
|
|
7288
7312
|
TableCell,
|
|
@@ -7291,8 +7315,9 @@ function DataTable({
|
|
|
7291
7315
|
cellPadding,
|
|
7292
7316
|
col.align === "right" && "text-right",
|
|
7293
7317
|
col.align === "center" && "text-center",
|
|
7294
|
-
|
|
7295
|
-
idx === data.length - 1 && col === visibleColumns[
|
|
7318
|
+
columnDividers && colIdx > 0 && "border-l border-border/60",
|
|
7319
|
+
idx === data.length - 1 && col === visibleColumns[0] && "rounded-bl-md",
|
|
7320
|
+
idx === data.length - 1 && col === visibleColumns[visibleColumns.length - 1] && "rounded-br-md"
|
|
7296
7321
|
),
|
|
7297
7322
|
children: col.render ? col.render(value, row, idx) : String(value ?? "")
|
|
7298
7323
|
},
|
|
@@ -7302,7 +7327,7 @@ function DataTable({
|
|
|
7302
7327
|
]
|
|
7303
7328
|
}
|
|
7304
7329
|
) }),
|
|
7305
|
-
totalItems > 0 && /* @__PURE__ */ jsx39("div", { className: "border-t bg-muted/30 p-4 rounded-b-
|
|
7330
|
+
totalItems > 0 && /* @__PURE__ */ jsx39("div", { className: "border-t bg-muted/30 p-4 rounded-b-md", children: /* @__PURE__ */ jsx39(
|
|
7306
7331
|
Pagination,
|
|
7307
7332
|
{
|
|
7308
7333
|
page: curPage,
|
|
@@ -7324,10 +7349,10 @@ function DataTable({
|
|
|
7324
7349
|
var DataTable_default = DataTable;
|
|
7325
7350
|
|
|
7326
7351
|
// ../../components/ui/Form.tsx
|
|
7327
|
-
import * as
|
|
7352
|
+
import * as React31 from "react";
|
|
7328
7353
|
|
|
7329
7354
|
// ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
7330
|
-
import
|
|
7355
|
+
import React30 from "react";
|
|
7331
7356
|
var isCheckBoxInput = (element) => element.type === "checkbox";
|
|
7332
7357
|
var isDateObject = (value) => value instanceof Date;
|
|
7333
7358
|
var isNullOrUndefined = (value) => value == null;
|
|
@@ -7415,12 +7440,12 @@ var INPUT_VALIDATION_RULES = {
|
|
|
7415
7440
|
required: "required",
|
|
7416
7441
|
validate: "validate"
|
|
7417
7442
|
};
|
|
7418
|
-
var HookFormContext =
|
|
7443
|
+
var HookFormContext = React30.createContext(null);
|
|
7419
7444
|
HookFormContext.displayName = "HookFormContext";
|
|
7420
|
-
var useFormContext = () =>
|
|
7445
|
+
var useFormContext = () => React30.useContext(HookFormContext);
|
|
7421
7446
|
var FormProvider = (props) => {
|
|
7422
7447
|
const { children, ...data } = props;
|
|
7423
|
-
return
|
|
7448
|
+
return React30.createElement(HookFormContext.Provider, { value: data }, children);
|
|
7424
7449
|
};
|
|
7425
7450
|
var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
|
|
7426
7451
|
const result = {
|
|
@@ -7440,12 +7465,12 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
|
7440
7465
|
}
|
|
7441
7466
|
return result;
|
|
7442
7467
|
};
|
|
7443
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
7468
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React30.useLayoutEffect : React30.useEffect;
|
|
7444
7469
|
function useFormState(props) {
|
|
7445
7470
|
const methods = useFormContext();
|
|
7446
7471
|
const { control = methods.control, disabled, name, exact } = props || {};
|
|
7447
|
-
const [formState, updateFormState] =
|
|
7448
|
-
const _localProxyFormState =
|
|
7472
|
+
const [formState, updateFormState] = React30.useState(control._formState);
|
|
7473
|
+
const _localProxyFormState = React30.useRef({
|
|
7449
7474
|
isDirty: false,
|
|
7450
7475
|
isLoading: false,
|
|
7451
7476
|
dirtyFields: false,
|
|
@@ -7466,10 +7491,10 @@ function useFormState(props) {
|
|
|
7466
7491
|
});
|
|
7467
7492
|
}
|
|
7468
7493
|
}), [name, disabled, exact]);
|
|
7469
|
-
|
|
7494
|
+
React30.useEffect(() => {
|
|
7470
7495
|
_localProxyFormState.current.isValid && control._setValid(true);
|
|
7471
7496
|
}, [control]);
|
|
7472
|
-
return
|
|
7497
|
+
return React30.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);
|
|
7473
7498
|
}
|
|
7474
7499
|
var isString = (value) => typeof value === "string";
|
|
7475
7500
|
var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {
|
|
@@ -7518,12 +7543,12 @@ function deepEqual(object1, object2, _internal_visited = /* @__PURE__ */ new Wea
|
|
|
7518
7543
|
function useWatch(props) {
|
|
7519
7544
|
const methods = useFormContext();
|
|
7520
7545
|
const { control = methods.control, name, defaultValue, disabled, exact, compute } = props || {};
|
|
7521
|
-
const _defaultValue =
|
|
7522
|
-
const _compute =
|
|
7523
|
-
const _computeFormValues =
|
|
7546
|
+
const _defaultValue = React30.useRef(defaultValue);
|
|
7547
|
+
const _compute = React30.useRef(compute);
|
|
7548
|
+
const _computeFormValues = React30.useRef(void 0);
|
|
7524
7549
|
_compute.current = compute;
|
|
7525
|
-
const defaultValueMemo =
|
|
7526
|
-
const [value, updateValue] =
|
|
7550
|
+
const defaultValueMemo = React30.useMemo(() => control._getWatch(name, _defaultValue.current), [control, name]);
|
|
7551
|
+
const [value, updateValue] = React30.useState(_compute.current ? _compute.current(defaultValueMemo) : defaultValueMemo);
|
|
7527
7552
|
useIsomorphicLayoutEffect(() => control._subscribe({
|
|
7528
7553
|
name,
|
|
7529
7554
|
formState: {
|
|
@@ -7545,14 +7570,14 @@ function useWatch(props) {
|
|
|
7545
7570
|
}
|
|
7546
7571
|
}
|
|
7547
7572
|
}), [control, disabled, name, exact]);
|
|
7548
|
-
|
|
7573
|
+
React30.useEffect(() => control._removeUnmounted());
|
|
7549
7574
|
return value;
|
|
7550
7575
|
}
|
|
7551
7576
|
function useController(props) {
|
|
7552
7577
|
const methods = useFormContext();
|
|
7553
7578
|
const { name, disabled, control = methods.control, shouldUnregister, defaultValue } = props;
|
|
7554
7579
|
const isArrayField = isNameInFieldArray(control._names.array, name);
|
|
7555
|
-
const defaultValueMemo =
|
|
7580
|
+
const defaultValueMemo = React30.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
|
|
7556
7581
|
const value = useWatch({
|
|
7557
7582
|
control,
|
|
7558
7583
|
name,
|
|
@@ -7564,15 +7589,15 @@ function useController(props) {
|
|
|
7564
7589
|
name,
|
|
7565
7590
|
exact: true
|
|
7566
7591
|
});
|
|
7567
|
-
const _props =
|
|
7568
|
-
const _previousNameRef =
|
|
7569
|
-
const _registerProps =
|
|
7592
|
+
const _props = React30.useRef(props);
|
|
7593
|
+
const _previousNameRef = React30.useRef(void 0);
|
|
7594
|
+
const _registerProps = React30.useRef(control.register(name, {
|
|
7570
7595
|
...props.rules,
|
|
7571
7596
|
value,
|
|
7572
7597
|
...isBoolean(props.disabled) ? { disabled: props.disabled } : {}
|
|
7573
7598
|
}));
|
|
7574
7599
|
_props.current = props;
|
|
7575
|
-
const fieldState =
|
|
7600
|
+
const fieldState = React30.useMemo(() => Object.defineProperties({}, {
|
|
7576
7601
|
invalid: {
|
|
7577
7602
|
enumerable: true,
|
|
7578
7603
|
get: () => !!get(formState.errors, name)
|
|
@@ -7594,21 +7619,21 @@ function useController(props) {
|
|
|
7594
7619
|
get: () => get(formState.errors, name)
|
|
7595
7620
|
}
|
|
7596
7621
|
}), [formState, name]);
|
|
7597
|
-
const onChange =
|
|
7622
|
+
const onChange = React30.useCallback((event) => _registerProps.current.onChange({
|
|
7598
7623
|
target: {
|
|
7599
7624
|
value: getEventValue(event),
|
|
7600
7625
|
name
|
|
7601
7626
|
},
|
|
7602
7627
|
type: EVENTS.CHANGE
|
|
7603
7628
|
}), [name]);
|
|
7604
|
-
const onBlur =
|
|
7629
|
+
const onBlur = React30.useCallback(() => _registerProps.current.onBlur({
|
|
7605
7630
|
target: {
|
|
7606
7631
|
value: get(control._formValues, name),
|
|
7607
7632
|
name
|
|
7608
7633
|
},
|
|
7609
7634
|
type: EVENTS.BLUR
|
|
7610
7635
|
}), [name, control._formValues]);
|
|
7611
|
-
const ref =
|
|
7636
|
+
const ref = React30.useCallback((elm) => {
|
|
7612
7637
|
const field2 = get(control._fields, name);
|
|
7613
7638
|
if (field2 && elm) {
|
|
7614
7639
|
field2._f.ref = {
|
|
@@ -7619,7 +7644,7 @@ function useController(props) {
|
|
|
7619
7644
|
};
|
|
7620
7645
|
}
|
|
7621
7646
|
}, [control._fields, name]);
|
|
7622
|
-
const field =
|
|
7647
|
+
const field = React30.useMemo(() => ({
|
|
7623
7648
|
name,
|
|
7624
7649
|
value,
|
|
7625
7650
|
...isBoolean(disabled) || formState.disabled ? { disabled: formState.disabled || disabled } : {},
|
|
@@ -7627,7 +7652,7 @@ function useController(props) {
|
|
|
7627
7652
|
onBlur,
|
|
7628
7653
|
ref
|
|
7629
7654
|
}), [name, disabled, formState.disabled, onChange, onBlur, ref, value]);
|
|
7630
|
-
|
|
7655
|
+
React30.useEffect(() => {
|
|
7631
7656
|
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
|
7632
7657
|
const previousName = _previousNameRef.current;
|
|
7633
7658
|
if (previousName && previousName !== name && !isArrayField) {
|
|
@@ -7657,13 +7682,13 @@ function useController(props) {
|
|
|
7657
7682
|
(isArrayField ? _shouldUnregisterField && !control._state.action : _shouldUnregisterField) ? control.unregister(name) : updateMounted(name, false);
|
|
7658
7683
|
};
|
|
7659
7684
|
}, [name, control, isArrayField, shouldUnregister]);
|
|
7660
|
-
|
|
7685
|
+
React30.useEffect(() => {
|
|
7661
7686
|
control._setDisabledField({
|
|
7662
7687
|
disabled,
|
|
7663
7688
|
name
|
|
7664
7689
|
});
|
|
7665
7690
|
}, [disabled, name, control]);
|
|
7666
|
-
return
|
|
7691
|
+
return React30.useMemo(() => ({
|
|
7667
7692
|
field,
|
|
7668
7693
|
formState,
|
|
7669
7694
|
fieldState
|
|
@@ -8982,9 +9007,9 @@ function createFormControl(props = {}) {
|
|
|
8982
9007
|
};
|
|
8983
9008
|
}
|
|
8984
9009
|
function useForm(props = {}) {
|
|
8985
|
-
const _formControl =
|
|
8986
|
-
const _values =
|
|
8987
|
-
const [formState, updateFormState] =
|
|
9010
|
+
const _formControl = React30.useRef(void 0);
|
|
9011
|
+
const _values = React30.useRef(void 0);
|
|
9012
|
+
const [formState, updateFormState] = React30.useState({
|
|
8988
9013
|
isDirty: false,
|
|
8989
9014
|
isValidating: false,
|
|
8990
9015
|
isLoading: isFunction(props.defaultValues),
|
|
@@ -9033,8 +9058,8 @@ function useForm(props = {}) {
|
|
|
9033
9058
|
control._formState.isReady = true;
|
|
9034
9059
|
return sub;
|
|
9035
9060
|
}, [control]);
|
|
9036
|
-
|
|
9037
|
-
|
|
9061
|
+
React30.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
|
|
9062
|
+
React30.useEffect(() => {
|
|
9038
9063
|
if (props.mode) {
|
|
9039
9064
|
control._options.mode = props.mode;
|
|
9040
9065
|
}
|
|
@@ -9042,18 +9067,18 @@ function useForm(props = {}) {
|
|
|
9042
9067
|
control._options.reValidateMode = props.reValidateMode;
|
|
9043
9068
|
}
|
|
9044
9069
|
}, [control, props.mode, props.reValidateMode]);
|
|
9045
|
-
|
|
9070
|
+
React30.useEffect(() => {
|
|
9046
9071
|
if (props.errors) {
|
|
9047
9072
|
control._setErrors(props.errors);
|
|
9048
9073
|
control._focusError();
|
|
9049
9074
|
}
|
|
9050
9075
|
}, [control, props.errors]);
|
|
9051
|
-
|
|
9076
|
+
React30.useEffect(() => {
|
|
9052
9077
|
props.shouldUnregister && control._subjects.state.next({
|
|
9053
9078
|
values: control._getWatch()
|
|
9054
9079
|
});
|
|
9055
9080
|
}, [control, props.shouldUnregister]);
|
|
9056
|
-
|
|
9081
|
+
React30.useEffect(() => {
|
|
9057
9082
|
if (control._proxyFormState.isDirty) {
|
|
9058
9083
|
const isDirty = control._getDirty();
|
|
9059
9084
|
if (isDirty !== formState.isDirty) {
|
|
@@ -9063,7 +9088,7 @@ function useForm(props = {}) {
|
|
|
9063
9088
|
}
|
|
9064
9089
|
}
|
|
9065
9090
|
}, [control, formState.isDirty]);
|
|
9066
|
-
|
|
9091
|
+
React30.useEffect(() => {
|
|
9067
9092
|
if (props.values && !deepEqual(props.values, _values.current)) {
|
|
9068
9093
|
control._reset(props.values, {
|
|
9069
9094
|
keepFieldsRef: true,
|
|
@@ -9075,7 +9100,7 @@ function useForm(props = {}) {
|
|
|
9075
9100
|
control._resetDefaultValues();
|
|
9076
9101
|
}
|
|
9077
9102
|
}, [control, props.values]);
|
|
9078
|
-
|
|
9103
|
+
React30.useEffect(() => {
|
|
9079
9104
|
if (!control._state.mount) {
|
|
9080
9105
|
control._setValid();
|
|
9081
9106
|
control._state.mount = true;
|
|
@@ -9093,7 +9118,7 @@ function useForm(props = {}) {
|
|
|
9093
9118
|
// ../../components/ui/Form.tsx
|
|
9094
9119
|
import { useTranslations as useTranslations8 } from "next-intl";
|
|
9095
9120
|
import { jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
9096
|
-
var FormConfigContext =
|
|
9121
|
+
var FormConfigContext = React31.createContext({ size: "md" });
|
|
9097
9122
|
var FormWrapper = ({
|
|
9098
9123
|
children,
|
|
9099
9124
|
onSubmit,
|
|
@@ -9106,7 +9131,7 @@ var FormWrapper = ({
|
|
|
9106
9131
|
const methods = useForm({
|
|
9107
9132
|
defaultValues: initialValues
|
|
9108
9133
|
});
|
|
9109
|
-
|
|
9134
|
+
React31.useEffect(() => {
|
|
9110
9135
|
if (initialValues) {
|
|
9111
9136
|
methods.reset(initialValues);
|
|
9112
9137
|
}
|
|
@@ -9115,15 +9140,15 @@ var FormWrapper = ({
|
|
|
9115
9140
|
return /* @__PURE__ */ jsx40(FormProvider, { ...methods, children: /* @__PURE__ */ jsx40(FormConfigContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx40("form", { onSubmit: methods.handleSubmit(onSubmit), className, ...formProps, children }) }) });
|
|
9116
9141
|
};
|
|
9117
9142
|
var Form = FormWrapper;
|
|
9118
|
-
var FormFieldContext =
|
|
9143
|
+
var FormFieldContext = React31.createContext({});
|
|
9119
9144
|
var FormField = ({
|
|
9120
9145
|
...props
|
|
9121
9146
|
}) => {
|
|
9122
9147
|
return /* @__PURE__ */ jsx40(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx40(Controller, { ...props }) });
|
|
9123
9148
|
};
|
|
9124
9149
|
var useFormField = () => {
|
|
9125
|
-
const fieldContext =
|
|
9126
|
-
const itemContext =
|
|
9150
|
+
const fieldContext = React31.useContext(FormFieldContext);
|
|
9151
|
+
const itemContext = React31.useContext(FormItemContext);
|
|
9127
9152
|
const { getFieldState, formState } = useFormContext();
|
|
9128
9153
|
if (!fieldContext) {
|
|
9129
9154
|
try {
|
|
@@ -9144,20 +9169,20 @@ var useFormField = () => {
|
|
|
9144
9169
|
...fieldState
|
|
9145
9170
|
};
|
|
9146
9171
|
};
|
|
9147
|
-
var FormItemContext =
|
|
9148
|
-
var FormItem =
|
|
9149
|
-
const id =
|
|
9172
|
+
var FormItemContext = React31.createContext({});
|
|
9173
|
+
var FormItem = React31.forwardRef(({ className, ...props }, ref) => {
|
|
9174
|
+
const id = React31.useId();
|
|
9150
9175
|
return /* @__PURE__ */ jsx40(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx40("div", { ref, className: cn("space-y-2", className), ...props }) });
|
|
9151
9176
|
});
|
|
9152
9177
|
FormItem.displayName = "FormItem";
|
|
9153
|
-
var FormLabel =
|
|
9178
|
+
var FormLabel = React31.forwardRef(({ className, ...props }, ref) => {
|
|
9154
9179
|
const { error, formItemId } = useFormField();
|
|
9155
|
-
const config =
|
|
9180
|
+
const config = React31.useContext(FormConfigContext);
|
|
9156
9181
|
const sizeClass = config.size === "sm" ? "text-xs" : config.size === "lg" ? "text-base" : "text-sm";
|
|
9157
9182
|
return /* @__PURE__ */ jsx40(Label, { ref, className: cn(sizeClass, error && "text-destructive", className), htmlFor: formItemId, ...props });
|
|
9158
9183
|
});
|
|
9159
9184
|
FormLabel.displayName = "FormLabel";
|
|
9160
|
-
var FormControl =
|
|
9185
|
+
var FormControl = React31.forwardRef(({ ...props }, ref) => {
|
|
9161
9186
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
9162
9187
|
return /* @__PURE__ */ jsx40(
|
|
9163
9188
|
"div",
|
|
@@ -9171,12 +9196,12 @@ var FormControl = React32.forwardRef(({ ...props }, ref) => {
|
|
|
9171
9196
|
);
|
|
9172
9197
|
});
|
|
9173
9198
|
FormControl.displayName = "FormControl";
|
|
9174
|
-
var FormDescription =
|
|
9199
|
+
var FormDescription = React31.forwardRef(({ className, ...props }, ref) => {
|
|
9175
9200
|
const { formDescriptionId } = useFormField();
|
|
9176
9201
|
return /* @__PURE__ */ jsx40("p", { ref, id: formDescriptionId, className: cn("text-sm text-muted-foreground", className), ...props });
|
|
9177
9202
|
});
|
|
9178
9203
|
FormDescription.displayName = "FormDescription";
|
|
9179
|
-
var FormMessage =
|
|
9204
|
+
var FormMessage = React31.forwardRef(({ className, children, ...props }, ref) => {
|
|
9180
9205
|
const { error, formMessageId } = useFormField();
|
|
9181
9206
|
const body = error ? String(error?.message) : children;
|
|
9182
9207
|
if (!body) {
|
|
@@ -9185,7 +9210,7 @@ var FormMessage = React32.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
9185
9210
|
return /* @__PURE__ */ jsx40("p", { ref, id: formMessageId, className: cn("text-sm font-medium text-destructive", className), ...props, children: body });
|
|
9186
9211
|
});
|
|
9187
9212
|
FormMessage.displayName = "FormMessage";
|
|
9188
|
-
var FormInput =
|
|
9213
|
+
var FormInput = React31.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ jsx40(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx40(
|
|
9189
9214
|
FormField,
|
|
9190
9215
|
{
|
|
9191
9216
|
name,
|
|
@@ -9196,7 +9221,7 @@ var FormInput = React32.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */
|
|
|
9196
9221
|
}
|
|
9197
9222
|
) }));
|
|
9198
9223
|
FormInput.displayName = "FormInput";
|
|
9199
|
-
var FormCheckbox =
|
|
9224
|
+
var FormCheckbox = React31.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ jsx40(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx40(
|
|
9200
9225
|
FormField,
|
|
9201
9226
|
{
|
|
9202
9227
|
name,
|
|
@@ -9220,9 +9245,9 @@ var FormCheckbox = React32.forwardRef(({ name, ...props }, ref) => /* @__PURE__
|
|
|
9220
9245
|
}
|
|
9221
9246
|
) }));
|
|
9222
9247
|
FormCheckbox.displayName = "FormCheckbox";
|
|
9223
|
-
var FormActions =
|
|
9248
|
+
var FormActions = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40("div", { ref, className: cn("flex gap-2 justify-end", className), ...props }));
|
|
9224
9249
|
FormActions.displayName = "FormActions";
|
|
9225
|
-
var FormSubmitButton =
|
|
9250
|
+
var FormSubmitButton = React31.forwardRef(({ children, loading: loading2, ...props }, ref) => /* @__PURE__ */ jsx40(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx40(Button_default, { ref, type: "submit", size: props.size ?? size, disabled: loading2, ...props, children }) }));
|
|
9226
9251
|
FormSubmitButton.displayName = "FormSubmitButton";
|
|
9227
9252
|
|
|
9228
9253
|
// ../../components/ui/NotificationModal.tsx
|
|
@@ -9303,10 +9328,10 @@ import { usePathname } from "next/navigation";
|
|
|
9303
9328
|
import { Phone } from "lucide-react";
|
|
9304
9329
|
|
|
9305
9330
|
// ../../node_modules/react-icons/lib/iconBase.mjs
|
|
9306
|
-
import
|
|
9331
|
+
import React33 from "react";
|
|
9307
9332
|
|
|
9308
9333
|
// ../../node_modules/react-icons/lib/iconContext.mjs
|
|
9309
|
-
import
|
|
9334
|
+
import React32 from "react";
|
|
9310
9335
|
var DefaultContext = {
|
|
9311
9336
|
color: void 0,
|
|
9312
9337
|
size: void 0,
|
|
@@ -9314,7 +9339,7 @@ var DefaultContext = {
|
|
|
9314
9339
|
style: void 0,
|
|
9315
9340
|
attr: void 0
|
|
9316
9341
|
};
|
|
9317
|
-
var IconContext =
|
|
9342
|
+
var IconContext = React32.createContext && /* @__PURE__ */ React32.createContext(DefaultContext);
|
|
9318
9343
|
|
|
9319
9344
|
// ../../node_modules/react-icons/lib/iconBase.mjs
|
|
9320
9345
|
var _excluded = ["attr", "size", "title"];
|
|
@@ -9403,12 +9428,12 @@ function _toPrimitive(t, r) {
|
|
|
9403
9428
|
return ("string" === r ? String : Number)(t);
|
|
9404
9429
|
}
|
|
9405
9430
|
function Tree2Element(tree) {
|
|
9406
|
-
return tree && tree.map((node, i) => /* @__PURE__ */
|
|
9431
|
+
return tree && tree.map((node, i) => /* @__PURE__ */ React33.createElement(node.tag, _objectSpread({
|
|
9407
9432
|
key: i
|
|
9408
9433
|
}, node.attr), Tree2Element(node.child)));
|
|
9409
9434
|
}
|
|
9410
9435
|
function GenIcon(data) {
|
|
9411
|
-
return (props) => /* @__PURE__ */
|
|
9436
|
+
return (props) => /* @__PURE__ */ React33.createElement(IconBase, _extends({
|
|
9412
9437
|
attr: _objectSpread({}, data.attr)
|
|
9413
9438
|
}, props), Tree2Element(data.child));
|
|
9414
9439
|
}
|
|
@@ -9423,7 +9448,7 @@ function IconBase(props) {
|
|
|
9423
9448
|
var className;
|
|
9424
9449
|
if (conf.className) className = conf.className;
|
|
9425
9450
|
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
9426
|
-
return /* @__PURE__ */
|
|
9451
|
+
return /* @__PURE__ */ React33.createElement("svg", _extends({
|
|
9427
9452
|
stroke: "currentColor",
|
|
9428
9453
|
fill: "currentColor",
|
|
9429
9454
|
strokeWidth: "0"
|
|
@@ -9435,9 +9460,9 @@ function IconBase(props) {
|
|
|
9435
9460
|
height: computedSize,
|
|
9436
9461
|
width: computedSize,
|
|
9437
9462
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9438
|
-
}), title && /* @__PURE__ */
|
|
9463
|
+
}), title && /* @__PURE__ */ React33.createElement("title", null, title), props.children);
|
|
9439
9464
|
};
|
|
9440
|
-
return IconContext !== void 0 ? /* @__PURE__ */
|
|
9465
|
+
return IconContext !== void 0 ? /* @__PURE__ */ React33.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
|
9441
9466
|
}
|
|
9442
9467
|
|
|
9443
9468
|
// ../../node_modules/react-icons/fa/index.mjs
|
|
@@ -9569,7 +9594,7 @@ function AccessDenied({
|
|
|
9569
9594
|
|
|
9570
9595
|
// ../../components/ui/ThemeToggleHeadless.tsx
|
|
9571
9596
|
import { Moon, Sun, Monitor } from "lucide-react";
|
|
9572
|
-
import { useEffect as
|
|
9597
|
+
import { useEffect as useEffect16, useRef as useRef10, useState as useState26 } from "react";
|
|
9573
9598
|
import { createPortal as createPortal9 } from "react-dom";
|
|
9574
9599
|
import { Fragment as Fragment11, jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
9575
9600
|
function ThemeToggleHeadless({
|
|
@@ -9578,11 +9603,11 @@ function ThemeToggleHeadless({
|
|
|
9578
9603
|
labels,
|
|
9579
9604
|
className
|
|
9580
9605
|
}) {
|
|
9581
|
-
const [isOpen, setIsOpen] =
|
|
9582
|
-
const [mounted, setMounted] =
|
|
9606
|
+
const [isOpen, setIsOpen] = useState26(false);
|
|
9607
|
+
const [mounted, setMounted] = useState26(false);
|
|
9583
9608
|
const triggerRef = useRef10(null);
|
|
9584
|
-
const [dropdownPosition, setDropdownPosition] =
|
|
9585
|
-
|
|
9609
|
+
const [dropdownPosition, setDropdownPosition] = useState26(null);
|
|
9610
|
+
useEffect16(() => setMounted(true), []);
|
|
9586
9611
|
const themes = [
|
|
9587
9612
|
{ value: "light", label: labels?.light ?? "Light", icon: Sun },
|
|
9588
9613
|
{ value: "dark", label: labels?.dark ?? "Dark", icon: Moon },
|
|
@@ -9671,7 +9696,7 @@ function ThemeToggleHeadless({
|
|
|
9671
9696
|
}
|
|
9672
9697
|
|
|
9673
9698
|
// ../../components/ui/LanguageSwitcherHeadless.tsx
|
|
9674
|
-
import { useRef as useRef11, useState as
|
|
9699
|
+
import { useRef as useRef11, useState as useState27 } from "react";
|
|
9675
9700
|
import { createPortal as createPortal10 } from "react-dom";
|
|
9676
9701
|
import { Globe } from "lucide-react";
|
|
9677
9702
|
import { Fragment as Fragment12, jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
@@ -9682,8 +9707,8 @@ function LanguageSwitcherHeadless({
|
|
|
9682
9707
|
labels,
|
|
9683
9708
|
className
|
|
9684
9709
|
}) {
|
|
9685
|
-
const [isOpen, setIsOpen] =
|
|
9686
|
-
const [dropdownPosition, setDropdownPosition] =
|
|
9710
|
+
const [isOpen, setIsOpen] = useState27(false);
|
|
9711
|
+
const [dropdownPosition, setDropdownPosition] = useState27(null);
|
|
9687
9712
|
const triggerButtonRef = useRef11(null);
|
|
9688
9713
|
const currentLanguage = locales.find((l) => l.code === currentLocale) || locales[0];
|
|
9689
9714
|
const calculatePosition = () => {
|