@underverse-ui/underverse 0.2.32 → 0.2.34

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 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 variantIcons = {
3580
- default: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.Info, { className: "h-4 w-4 text-muted-foreground" }),
3581
- info: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.Info, { className: "h-4 w-4 text-info" }),
3582
- success: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.CheckCircle, { className: "h-4 w-4 text-success" }),
3583
- warning: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.AlertTriangle, { className: "h-4 w-4 text-warning" }),
3584
- error: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.XCircle, { className: "h-4 w-4 text-destructive" })
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("w-full p-4 rounded-md flex items-start gap-3", VARIANT_STYLES_ALERT[variant], className),
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: "pt-1", children: icon ?? variantIcons[variant] }),
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 })),
@@ -4984,6 +5011,16 @@ var CompactPagination = ({
4984
5011
  // ../../components/ui/Section.tsx
4985
5012
  var import_react13 = __toESM(require("react"), 1);
4986
5013
  var import_jsx_runtime26 = require("react/jsx-runtime");
5014
+ var gradientDirectionMap = {
5015
+ "to-r": "bg-gradient-to-r",
5016
+ "to-l": "bg-gradient-to-l",
5017
+ "to-b": "bg-gradient-to-b",
5018
+ "to-t": "bg-gradient-to-t",
5019
+ "to-br": "bg-gradient-to-br",
5020
+ "to-bl": "bg-gradient-to-bl",
5021
+ "to-tr": "bg-gradient-to-tr",
5022
+ "to-tl": "bg-gradient-to-tl"
5023
+ };
4987
5024
  var Section = import_react13.default.forwardRef(
4988
5025
  ({
4989
5026
  children,
@@ -4992,13 +5029,17 @@ var Section = import_react13.default.forwardRef(
4992
5029
  spacing = "lg",
4993
5030
  fullWidth = false,
4994
5031
  outlined = false,
5032
+ gradientFrom = "from-primary/20",
5033
+ gradientTo = "to-accent/20",
5034
+ gradientDirection = "to-br",
4995
5035
  ...props
4996
5036
  }, ref) => {
4997
5037
  const variantClasses = {
4998
5038
  default: "bg-background",
4999
5039
  muted: "bg-muted/30",
5000
5040
  primary: "bg-primary/5",
5001
- accent: "bg-accent/10"
5041
+ accent: "bg-accent/10",
5042
+ gradient: ""
5002
5043
  };
5003
5044
  const spacingClasses = {
5004
5045
  sm: "py-6",
@@ -5006,12 +5047,16 @@ var Section = import_react13.default.forwardRef(
5006
5047
  lg: "py-12",
5007
5048
  xl: "py-16"
5008
5049
  };
5050
+ const getGradientClasses = () => {
5051
+ if (variant !== "gradient") return "";
5052
+ return cn(gradientDirectionMap[gradientDirection], gradientFrom, gradientTo);
5053
+ };
5009
5054
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5010
5055
  "section",
5011
5056
  {
5012
5057
  ref,
5013
5058
  className: cn(
5014
- variantClasses[variant],
5059
+ variant === "gradient" ? getGradientClasses() : variantClasses[variant],
5015
5060
  spacingClasses[spacing],
5016
5061
  outlined && "rounded-lg border border-border/60",
5017
5062
  !fullWidth && "container mx-auto px-4 md:px-6",
@@ -5312,7 +5357,11 @@ var DatePicker = ({
5312
5357
  setIsOpen(false);
5313
5358
  };
5314
5359
  const formatDateDisplay = (date) => {
5315
- return formatDate(date);
5360
+ return date.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", {
5361
+ day: "numeric",
5362
+ month: "long",
5363
+ year: "numeric"
5364
+ });
5316
5365
  };
5317
5366
  const getDaysInMonth = (date) => {
5318
5367
  return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
@@ -5394,10 +5443,12 @@ var DatePicker = ({
5394
5443
  children: [
5395
5444
  /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
5396
5445
  /* @__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" }) }),
5446
+ /* @__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
5447
  /* @__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
5448
  ] }),
5400
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("grid grid-cols-7 gap-1", size === "sm" ? "mb-1" : "mb-2"), children: (weekdayLabels || ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]).map((day) => /* @__PURE__ */ (0, import_jsx_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)) }),
5449
+ /* @__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(
5450
+ (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)
5451
+ ) }),
5401
5452
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7 gap-1", children: renderCalendar() }),
5402
5453
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-end mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5403
5454
  Button_default,
@@ -5502,6 +5553,7 @@ var DatePicker = ({
5502
5553
  ] });
5503
5554
  };
5504
5555
  var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select date range...", className }) => {
5556
+ const locale = (0, import_next_intl5.useLocale)();
5505
5557
  const [isOpen, setIsOpen] = React22.useState(false);
5506
5558
  const [dropdownPosition, setDropdownPosition] = React22.useState(null);
5507
5559
  const triggerRef = React22.useRef(null);
@@ -5661,7 +5713,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
5661
5713
  children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" })
5662
5714
  }
5663
5715
  ),
5664
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-sm font-semibold", children: viewDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
5716
+ /* @__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
5717
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
5666
5718
  Button_default,
5667
5719
  {
@@ -5673,7 +5725,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
5673
5725
  }
5674
5726
  )
5675
5727
  ] }),
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)) }),
5728
+ /* @__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
5729
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7", children: renderGrid() })
5678
5730
  ]
5679
5731
  }
@@ -7278,7 +7330,7 @@ var Slider = React27.forwardRef(
7278
7330
  size = "md",
7279
7331
  disabled = false,
7280
7332
  orientation = "horizontal",
7281
- noFocus = false,
7333
+ noFocus = true,
7282
7334
  ...props
7283
7335
  }, ref) => {
7284
7336
  const [internalValue, setInternalValue] = React27.useState(defaultValue);
@@ -7303,13 +7355,7 @@ var Slider = React27.forwardRef(
7303
7355
  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
7356
  ] }),
7305
7357
  /* @__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
- ) }),
7358
+ /* @__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
7359
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
7314
7360
  "input",
7315
7361
  {
@@ -11302,6 +11348,16 @@ function LanguageSwitcherHeadless({
11302
11348
  ] });
11303
11349
  }
11304
11350
 
11351
+ // ../../lib/constants/constants-ui/alert.ts
11352
+ var VARIANT_STYLES_ALERT = {
11353
+ // Use system colors for background + border; leave text colors to content
11354
+ default: "border border-border bg-card/60 backdrop-blur-sm",
11355
+ info: "border border-info/30 bg-info/10 backdrop-blur-sm",
11356
+ success: "border border-success/30 bg-success/10 backdrop-blur-sm",
11357
+ warning: "border border-warning/30 bg-warning/10 backdrop-blur-sm",
11358
+ error: "border border-destructive/30 bg-destructive/10 backdrop-blur-sm"
11359
+ };
11360
+
11305
11361
  // locales/en.json
11306
11362
  var en_default = {
11307
11363
  Common: {