@underverse-ui/underverse 0.2.31 → 0.2.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 +94 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +94 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2736,23 +2736,31 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2736
2736
|
const typeConfig = {
|
|
2737
2737
|
success: {
|
|
2738
2738
|
icon: import_lucide_react7.CheckCircle,
|
|
2739
|
-
|
|
2740
|
-
iconClassName: "text-success"
|
|
2739
|
+
containerClassName: "bg-success/5 border-success/30",
|
|
2740
|
+
iconClassName: "text-success",
|
|
2741
|
+
iconBgClassName: "bg-success/15",
|
|
2742
|
+
accentBarClassName: "bg-success"
|
|
2741
2743
|
},
|
|
2742
2744
|
error: {
|
|
2743
2745
|
icon: import_lucide_react7.AlertCircle,
|
|
2744
|
-
|
|
2745
|
-
iconClassName: "text-destructive"
|
|
2746
|
+
containerClassName: "bg-destructive/5 border-destructive/30",
|
|
2747
|
+
iconClassName: "text-destructive",
|
|
2748
|
+
iconBgClassName: "bg-destructive/15",
|
|
2749
|
+
accentBarClassName: "bg-destructive"
|
|
2746
2750
|
},
|
|
2747
2751
|
warning: {
|
|
2748
2752
|
icon: import_lucide_react7.AlertTriangle,
|
|
2749
|
-
|
|
2750
|
-
iconClassName: "text-warning"
|
|
2753
|
+
containerClassName: "bg-warning/5 border-warning/30",
|
|
2754
|
+
iconClassName: "text-warning",
|
|
2755
|
+
iconBgClassName: "bg-warning/15",
|
|
2756
|
+
accentBarClassName: "bg-warning"
|
|
2751
2757
|
},
|
|
2752
2758
|
info: {
|
|
2753
2759
|
icon: import_lucide_react7.Info,
|
|
2754
|
-
|
|
2755
|
-
iconClassName: "text-info"
|
|
2760
|
+
containerClassName: "bg-info/5 border-info/30",
|
|
2761
|
+
iconClassName: "text-info",
|
|
2762
|
+
iconBgClassName: "bg-info/15",
|
|
2763
|
+
accentBarClassName: "bg-info"
|
|
2756
2764
|
}
|
|
2757
2765
|
};
|
|
2758
2766
|
const config = typeConfig[toast.type];
|
|
@@ -2761,9 +2769,10 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2761
2769
|
"div",
|
|
2762
2770
|
{
|
|
2763
2771
|
className: cn(
|
|
2764
|
-
"relative w-80 rounded-lg border backdrop-blur-
|
|
2765
|
-
"bg-card
|
|
2766
|
-
|
|
2772
|
+
"relative w-80 rounded-r-lg border border-l-0 backdrop-blur-md transition-all duration-300 pointer-events-auto overflow-hidden",
|
|
2773
|
+
"bg-card shadow-xl",
|
|
2774
|
+
"animate-in slide-in-from-right-full",
|
|
2775
|
+
config.containerClassName,
|
|
2767
2776
|
isVisible ? "opacity-100 translate-x-0" : "opacity-0 translate-x-full"
|
|
2768
2777
|
),
|
|
2769
2778
|
role: "status",
|
|
@@ -2781,8 +2790,9 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
2781
2790
|
setPaused(false);
|
|
2782
2791
|
},
|
|
2783
2792
|
children: [
|
|
2784
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.
|
|
2785
|
-
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: cn("absolute left-0 top-0 bottom-0 w-1", config.accentBarClassName) }),
|
|
2794
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-start gap-3 p-4 pl-5", children: [
|
|
2795
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: cn("flex items-center justify-center w-8 h-8 rounded-full shrink-0", config.iconBgClassName), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { className: cn("h-4 w-4", config.iconClassName) }) }),
|
|
2786
2796
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex-1 space-y-1", children: [
|
|
2787
2797
|
toast.title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h4", { className: "font-medium text-sm leading-none", children: toast.title }),
|
|
2788
2798
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm text-muted-foreground leading-relaxed", children: toast.message }),
|
|
@@ -3553,25 +3563,43 @@ var SidebarSheet = ({ navigation, children, ...props }) => {
|
|
|
3553
3563
|
var import_react9 = require("react");
|
|
3554
3564
|
var import_lucide_react9 = require("lucide-react");
|
|
3555
3565
|
var import_next_intl2 = require("next-intl");
|
|
3556
|
-
|
|
3557
|
-
// ../../lib/constants/constants-ui/alert.ts
|
|
3558
|
-
var VARIANT_STYLES_ALERT = {
|
|
3559
|
-
// Use system colors for background + border; leave text colors to content
|
|
3560
|
-
default: "border border-border bg-card/60 backdrop-blur-sm",
|
|
3561
|
-
info: "border border-info/30 bg-info/10 backdrop-blur-sm",
|
|
3562
|
-
success: "border border-success/30 bg-success/10 backdrop-blur-sm",
|
|
3563
|
-
warning: "border border-warning/30 bg-warning/10 backdrop-blur-sm",
|
|
3564
|
-
error: "border border-destructive/30 bg-destructive/10 backdrop-blur-sm"
|
|
3565
|
-
};
|
|
3566
|
-
|
|
3567
|
-
// ../../components/ui/Alert.tsx
|
|
3568
3566
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3569
|
-
var
|
|
3570
|
-
default:
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3567
|
+
var variantConfig = {
|
|
3568
|
+
default: {
|
|
3569
|
+
icon: import_lucide_react9.Info,
|
|
3570
|
+
containerClassName: "bg-muted/50 border-border",
|
|
3571
|
+
iconClassName: "text-muted-foreground",
|
|
3572
|
+
iconBgClassName: "bg-muted",
|
|
3573
|
+
accentBarClassName: "bg-muted-foreground"
|
|
3574
|
+
},
|
|
3575
|
+
info: {
|
|
3576
|
+
icon: import_lucide_react9.Info,
|
|
3577
|
+
containerClassName: "bg-info/5 border-info/30",
|
|
3578
|
+
iconClassName: "text-info",
|
|
3579
|
+
iconBgClassName: "bg-info/15",
|
|
3580
|
+
accentBarClassName: "bg-info"
|
|
3581
|
+
},
|
|
3582
|
+
success: {
|
|
3583
|
+
icon: import_lucide_react9.CheckCircle,
|
|
3584
|
+
containerClassName: "bg-success/5 border-success/30",
|
|
3585
|
+
iconClassName: "text-success",
|
|
3586
|
+
iconBgClassName: "bg-success/15",
|
|
3587
|
+
accentBarClassName: "bg-success"
|
|
3588
|
+
},
|
|
3589
|
+
warning: {
|
|
3590
|
+
icon: import_lucide_react9.AlertTriangle,
|
|
3591
|
+
containerClassName: "bg-warning/5 border-warning/30",
|
|
3592
|
+
iconClassName: "text-warning",
|
|
3593
|
+
iconBgClassName: "bg-warning/15",
|
|
3594
|
+
accentBarClassName: "bg-warning"
|
|
3595
|
+
},
|
|
3596
|
+
error: {
|
|
3597
|
+
icon: import_lucide_react9.XCircle,
|
|
3598
|
+
containerClassName: "bg-destructive/5 border-destructive/30",
|
|
3599
|
+
iconClassName: "text-destructive",
|
|
3600
|
+
iconBgClassName: "bg-destructive/15",
|
|
3601
|
+
accentBarClassName: "bg-destructive"
|
|
3602
|
+
}
|
|
3575
3603
|
};
|
|
3576
3604
|
var Alert = ({ title, description, variant = "default", className, icon, dismissible = false, onClose, actions, closeAriaLabel }) => {
|
|
3577
3605
|
const [open, setOpen] = (0, import_react9.useState)(true);
|
|
@@ -3581,14 +3609,23 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
3581
3609
|
setOpen(false);
|
|
3582
3610
|
onClose?.();
|
|
3583
3611
|
};
|
|
3612
|
+
const config = variantConfig[variant];
|
|
3613
|
+
const Icon = config.icon;
|
|
3584
3614
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3585
3615
|
"div",
|
|
3586
3616
|
{
|
|
3587
|
-
className: cn(
|
|
3617
|
+
className: cn(
|
|
3618
|
+
"relative w-full rounded-r-lg border border-l-0 overflow-hidden",
|
|
3619
|
+
"flex items-start gap-3 p-4 pl-5",
|
|
3620
|
+
"backdrop-blur-md",
|
|
3621
|
+
config.containerClassName,
|
|
3622
|
+
className
|
|
3623
|
+
),
|
|
3588
3624
|
role: "alert",
|
|
3589
3625
|
"aria-live": variant === "error" ? "assertive" : "polite",
|
|
3590
3626
|
children: [
|
|
3591
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "
|
|
3627
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("absolute left-0 top-0 bottom-0 w-1", config.accentBarClassName) }),
|
|
3628
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("flex items-center justify-center w-8 h-8 rounded-full shrink-0", config.iconBgClassName), children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { className: cn("h-4 w-4", config.iconClassName) }) }),
|
|
3592
3629
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3593
3630
|
title && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "font-semibold text-sm leading-none mb-1 text-foreground", children: title }),
|
|
3594
3631
|
description && (typeof description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-muted-foreground leading-relaxed wrap-break-word", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-sm text-muted-foreground leading-relaxed wrap-break-word", children: description })),
|
|
@@ -5302,7 +5339,11 @@ var DatePicker = ({
|
|
|
5302
5339
|
setIsOpen(false);
|
|
5303
5340
|
};
|
|
5304
5341
|
const formatDateDisplay = (date) => {
|
|
5305
|
-
return
|
|
5342
|
+
return date.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", {
|
|
5343
|
+
day: "numeric",
|
|
5344
|
+
month: "long",
|
|
5345
|
+
year: "numeric"
|
|
5346
|
+
});
|
|
5306
5347
|
};
|
|
5307
5348
|
const getDaysInMonth = (date) => {
|
|
5308
5349
|
return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
|
|
@@ -5384,10 +5425,12 @@ var DatePicker = ({
|
|
|
5384
5425
|
children: [
|
|
5385
5426
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
|
|
5386
5427
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("prev"), className: "p-1 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" }) }),
|
|
5387
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
5428
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", { month: "long", year: "numeric" }) }),
|
|
5388
5429
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button_default, { variant: "ghost", size: "sm", onClick: () => navigateMonth("next"), className: "p-1 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ChevronRight, { className: "h-4 w-4" }) })
|
|
5389
5430
|
] }),
|
|
5390
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("grid grid-cols-7 gap-1", size === "sm" ? "mb-1" : "mb-2"), children: (weekdayLabels || ["
|
|
5431
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("grid grid-cols-7 gap-1", size === "sm" ? "mb-1" : "mb-2"), children: (weekdayLabels || (locale === "vi" ? ["CN", "T2", "T3", "T4", "T5", "T6", "T7"] : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"])).map(
|
|
5432
|
+
(day) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("text-muted-foreground text-center font-medium", size === "sm" ? "text-[10px] py-0.5" : "text-xs py-1"), children: day }, day)
|
|
5433
|
+
) }),
|
|
5391
5434
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7 gap-1", children: renderCalendar() }),
|
|
5392
5435
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-end mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5393
5436
|
Button_default,
|
|
@@ -5492,6 +5535,7 @@ var DatePicker = ({
|
|
|
5492
5535
|
] });
|
|
5493
5536
|
};
|
|
5494
5537
|
var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select date range...", className }) => {
|
|
5538
|
+
const locale = (0, import_next_intl5.useLocale)();
|
|
5495
5539
|
const [isOpen, setIsOpen] = React22.useState(false);
|
|
5496
5540
|
const [dropdownPosition, setDropdownPosition] = React22.useState(null);
|
|
5497
5541
|
const triggerRef = React22.useRef(null);
|
|
@@ -5651,7 +5695,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5651
5695
|
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" })
|
|
5652
5696
|
}
|
|
5653
5697
|
),
|
|
5654
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
5698
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", { month: "long", year: "numeric" }) }),
|
|
5655
5699
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5656
5700
|
Button_default,
|
|
5657
5701
|
{
|
|
@@ -5663,7 +5707,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5663
5707
|
}
|
|
5664
5708
|
)
|
|
5665
5709
|
] }),
|
|
5666
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((d) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-xs text-muted-foreground text-center py-1 font-medium", children: d }, d)) }),
|
|
5710
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2", children: (locale === "vi" ? ["CN", "T2", "T3", "T4", "T5", "T6", "T7"] : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]).map((d) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-xs text-muted-foreground text-center py-1 font-medium", children: d }, d)) }),
|
|
5667
5711
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7", children: renderGrid() })
|
|
5668
5712
|
]
|
|
5669
5713
|
}
|
|
@@ -7268,7 +7312,7 @@ var Slider = React27.forwardRef(
|
|
|
7268
7312
|
size = "md",
|
|
7269
7313
|
disabled = false,
|
|
7270
7314
|
orientation = "horizontal",
|
|
7271
|
-
noFocus =
|
|
7315
|
+
noFocus = true,
|
|
7272
7316
|
...props
|
|
7273
7317
|
}, ref) => {
|
|
7274
7318
|
const [internalValue, setInternalValue] = React27.useState(defaultValue);
|
|
@@ -7293,13 +7337,7 @@ var Slider = React27.forwardRef(
|
|
|
7293
7337
|
showValue && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("text-xs font-mono text-muted-foreground min-w-8 text-right", valueClassName), children: displayValue })
|
|
7294
7338
|
] }),
|
|
7295
7339
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: cn("relative flex items-center", sizeStyles8.container), children: [
|
|
7296
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("w-full rounded-full bg-secondary relative overflow-hidden", sizeStyles8.track, trackClassName), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7297
|
-
"div",
|
|
7298
|
-
{
|
|
7299
|
-
className: "absolute left-0 top-0 h-full bg-primary rounded-full transition-all duration-150 ease-out",
|
|
7300
|
-
style: { width: `${percentage}%` }
|
|
7301
|
-
}
|
|
7302
|
-
) }),
|
|
7340
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("w-full rounded-full bg-secondary relative overflow-hidden", sizeStyles8.track, trackClassName), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "absolute left-0 top-0 h-full bg-primary rounded-full", style: { width: `${percentage}%` } }) }),
|
|
7303
7341
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7304
7342
|
"input",
|
|
7305
7343
|
{
|
|
@@ -11292,6 +11330,16 @@ function LanguageSwitcherHeadless({
|
|
|
11292
11330
|
] });
|
|
11293
11331
|
}
|
|
11294
11332
|
|
|
11333
|
+
// ../../lib/constants/constants-ui/alert.ts
|
|
11334
|
+
var VARIANT_STYLES_ALERT = {
|
|
11335
|
+
// Use system colors for background + border; leave text colors to content
|
|
11336
|
+
default: "border border-border bg-card/60 backdrop-blur-sm",
|
|
11337
|
+
info: "border border-info/30 bg-info/10 backdrop-blur-sm",
|
|
11338
|
+
success: "border border-success/30 bg-success/10 backdrop-blur-sm",
|
|
11339
|
+
warning: "border border-warning/30 bg-warning/10 backdrop-blur-sm",
|
|
11340
|
+
error: "border border-destructive/30 bg-destructive/10 backdrop-blur-sm"
|
|
11341
|
+
};
|
|
11342
|
+
|
|
11295
11343
|
// locales/en.json
|
|
11296
11344
|
var en_default = {
|
|
11297
11345
|
Common: {
|