@underverse-ui/underverse 0.2.32 → 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 +71 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +71 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3563,25 +3563,43 @@ var SidebarSheet = ({ navigation, children, ...props }) => {
|
|
|
3563
3563
|
var import_react9 = require("react");
|
|
3564
3564
|
var import_lucide_react9 = require("lucide-react");
|
|
3565
3565
|
var import_next_intl2 = require("next-intl");
|
|
3566
|
-
|
|
3567
|
-
// ../../lib/constants/constants-ui/alert.ts
|
|
3568
|
-
var VARIANT_STYLES_ALERT = {
|
|
3569
|
-
// Use system colors for background + border; leave text colors to content
|
|
3570
|
-
default: "border border-border bg-card/60 backdrop-blur-sm",
|
|
3571
|
-
info: "border border-info/30 bg-info/10 backdrop-blur-sm",
|
|
3572
|
-
success: "border border-success/30 bg-success/10 backdrop-blur-sm",
|
|
3573
|
-
warning: "border border-warning/30 bg-warning/10 backdrop-blur-sm",
|
|
3574
|
-
error: "border border-destructive/30 bg-destructive/10 backdrop-blur-sm"
|
|
3575
|
-
};
|
|
3576
|
-
|
|
3577
|
-
// ../../components/ui/Alert.tsx
|
|
3578
3566
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3579
|
-
var
|
|
3580
|
-
default:
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
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
|
+
}
|
|
3585
3603
|
};
|
|
3586
3604
|
var Alert = ({ title, description, variant = "default", className, icon, dismissible = false, onClose, actions, closeAriaLabel }) => {
|
|
3587
3605
|
const [open, setOpen] = (0, import_react9.useState)(true);
|
|
@@ -3591,14 +3609,23 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
3591
3609
|
setOpen(false);
|
|
3592
3610
|
onClose?.();
|
|
3593
3611
|
};
|
|
3612
|
+
const config = variantConfig[variant];
|
|
3613
|
+
const Icon = config.icon;
|
|
3594
3614
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3595
3615
|
"div",
|
|
3596
3616
|
{
|
|
3597
|
-
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
|
+
),
|
|
3598
3624
|
role: "alert",
|
|
3599
3625
|
"aria-live": variant === "error" ? "assertive" : "polite",
|
|
3600
3626
|
children: [
|
|
3601
|
-
/* @__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) }) }),
|
|
3602
3629
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3603
3630
|
title && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "font-semibold text-sm leading-none mb-1 text-foreground", children: title }),
|
|
3604
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 })),
|
|
@@ -5312,7 +5339,11 @@ var DatePicker = ({
|
|
|
5312
5339
|
setIsOpen(false);
|
|
5313
5340
|
};
|
|
5314
5341
|
const formatDateDisplay = (date) => {
|
|
5315
|
-
return
|
|
5342
|
+
return date.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", {
|
|
5343
|
+
day: "numeric",
|
|
5344
|
+
month: "long",
|
|
5345
|
+
year: "numeric"
|
|
5346
|
+
});
|
|
5316
5347
|
};
|
|
5317
5348
|
const getDaysInMonth = (date) => {
|
|
5318
5349
|
return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
|
|
@@ -5394,10 +5425,12 @@ var DatePicker = ({
|
|
|
5394
5425
|
children: [
|
|
5395
5426
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
|
|
5396
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" }) }),
|
|
5397
|
-
/* @__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" }) }),
|
|
5398
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" }) })
|
|
5399
5430
|
] }),
|
|
5400
|
-
/* @__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
|
+
) }),
|
|
5401
5434
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7 gap-1", children: renderCalendar() }),
|
|
5402
5435
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-end mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5403
5436
|
Button_default,
|
|
@@ -5502,6 +5535,7 @@ var DatePicker = ({
|
|
|
5502
5535
|
] });
|
|
5503
5536
|
};
|
|
5504
5537
|
var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select date range...", className }) => {
|
|
5538
|
+
const locale = (0, import_next_intl5.useLocale)();
|
|
5505
5539
|
const [isOpen, setIsOpen] = React22.useState(false);
|
|
5506
5540
|
const [dropdownPosition, setDropdownPosition] = React22.useState(null);
|
|
5507
5541
|
const triggerRef = React22.useRef(null);
|
|
@@ -5661,7 +5695,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5661
5695
|
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" })
|
|
5662
5696
|
}
|
|
5663
5697
|
),
|
|
5664
|
-
/* @__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" }) }),
|
|
5665
5699
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5666
5700
|
Button_default,
|
|
5667
5701
|
{
|
|
@@ -5673,7 +5707,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5673
5707
|
}
|
|
5674
5708
|
)
|
|
5675
5709
|
] }),
|
|
5676
|
-
/* @__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)) }),
|
|
5677
5711
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7", children: renderGrid() })
|
|
5678
5712
|
]
|
|
5679
5713
|
}
|
|
@@ -7278,7 +7312,7 @@ var Slider = React27.forwardRef(
|
|
|
7278
7312
|
size = "md",
|
|
7279
7313
|
disabled = false,
|
|
7280
7314
|
orientation = "horizontal",
|
|
7281
|
-
noFocus =
|
|
7315
|
+
noFocus = true,
|
|
7282
7316
|
...props
|
|
7283
7317
|
}, ref) => {
|
|
7284
7318
|
const [internalValue, setInternalValue] = React27.useState(defaultValue);
|
|
@@ -7303,13 +7337,7 @@ var Slider = React27.forwardRef(
|
|
|
7303
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 })
|
|
7304
7338
|
] }),
|
|
7305
7339
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: cn("relative flex items-center", sizeStyles8.container), children: [
|
|
7306
|
-
/* @__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)(
|
|
7307
|
-
"div",
|
|
7308
|
-
{
|
|
7309
|
-
className: "absolute left-0 top-0 h-full bg-primary rounded-full transition-all duration-150 ease-out",
|
|
7310
|
-
style: { width: `${percentage}%` }
|
|
7311
|
-
}
|
|
7312
|
-
) }),
|
|
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}%` } }) }),
|
|
7313
7341
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7314
7342
|
"input",
|
|
7315
7343
|
{
|
|
@@ -11302,6 +11330,16 @@ function LanguageSwitcherHeadless({
|
|
|
11302
11330
|
] });
|
|
11303
11331
|
}
|
|
11304
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
|
+
|
|
11305
11343
|
// locales/en.json
|
|
11306
11344
|
var en_default = {
|
|
11307
11345
|
Common: {
|