@underverse-ui/underverse 0.2.60 → 0.2.62
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 +263 -131
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +300 -168
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -440,7 +440,7 @@ var Badge = ({
|
|
|
440
440
|
}
|
|
441
441
|
);
|
|
442
442
|
}
|
|
443
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: cn(baseClasses, "rounded-
|
|
443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: cn(baseClasses, "rounded-full gap-1", sizeStyles[size], className), onClick: handleClick, role: "status", children: [
|
|
444
444
|
Icon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
445
445
|
Icon,
|
|
446
446
|
{
|
|
@@ -2130,7 +2130,7 @@ function SmartImage({
|
|
|
2130
2130
|
alt,
|
|
2131
2131
|
className,
|
|
2132
2132
|
ratioClass,
|
|
2133
|
-
roundedClass = "rounded-
|
|
2133
|
+
roundedClass = "rounded-2xl md:rounded-3xl",
|
|
2134
2134
|
fill = true,
|
|
2135
2135
|
width,
|
|
2136
2136
|
height,
|
|
@@ -2320,10 +2320,10 @@ var Avatar_default = Avatar;
|
|
|
2320
2320
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2321
2321
|
var Skeleton = ({ className, width, height, variant = "rectangular", animation = "pulse", lines = 1 }) => {
|
|
2322
2322
|
const variantClasses2 = {
|
|
2323
|
-
rectangular: "rounded-md",
|
|
2323
|
+
rectangular: "rounded-2xl md:rounded-3xl",
|
|
2324
2324
|
circular: "rounded-full",
|
|
2325
|
-
rounded: "rounded-
|
|
2326
|
-
text: "rounded"
|
|
2325
|
+
rounded: "rounded-2xl md:rounded-3xl",
|
|
2326
|
+
text: "rounded-xl"
|
|
2327
2327
|
};
|
|
2328
2328
|
const animationClasses = {
|
|
2329
2329
|
pulse: "animate-pulse",
|
|
@@ -2372,9 +2372,9 @@ var SkeletonText = ({ lines = 3, className, width = "100%" }) => {
|
|
|
2372
2372
|
};
|
|
2373
2373
|
var SkeletonCard = ({ showAvatar = true, showImage = false, textLines = 3, className, children }) => {
|
|
2374
2374
|
if (children) {
|
|
2375
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("p-4 space-y-4 rounded-
|
|
2375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("p-4 space-y-4 rounded-2xl md:rounded-3xl bg-card outline-none focus:outline-none", className), children });
|
|
2376
2376
|
}
|
|
2377
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cn("p-4 space-y-4 rounded-2xl bg-card outline-none focus:outline-none", className), children: [
|
|
2377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cn("p-4 space-y-4 rounded-2xl md:rounded-3xl bg-card outline-none focus:outline-none", className), children: [
|
|
2378
2378
|
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
2379
2379
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonAvatar, {}),
|
|
2380
2380
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-2", children: [
|
|
@@ -2382,7 +2382,7 @@ var SkeletonCard = ({ showAvatar = true, showImage = false, textLines = 3, class
|
|
|
2382
2382
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Skeleton, { className: "h-3 w-16" })
|
|
2383
2383
|
] })
|
|
2384
2384
|
] }),
|
|
2385
|
-
showImage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Skeleton, { className: "h-48 w-full rounded-
|
|
2385
|
+
showImage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Skeleton, { className: "h-48 w-full rounded-2xl md:rounded-3xl" }),
|
|
2386
2386
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonText, { lines: textLines }),
|
|
2387
2387
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex space-x-2", children: [
|
|
2388
2388
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonButton, { size: "sm" }),
|
|
@@ -2391,7 +2391,7 @@ var SkeletonCard = ({ showAvatar = true, showImage = false, textLines = 3, class
|
|
|
2391
2391
|
] });
|
|
2392
2392
|
};
|
|
2393
2393
|
var SkeletonPost = ({ className }) => {
|
|
2394
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cn("p-6 space-y-4 rounded-3xl bg-card outline-none focus:outline-none", className), children: [
|
|
2394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cn("p-6 space-y-4 rounded-2xl md:rounded-3xl bg-card outline-none focus:outline-none", className), children: [
|
|
2395
2395
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
2396
2396
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonAvatar, { size: "lg" }),
|
|
2397
2397
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-2", children: [
|
|
@@ -2423,7 +2423,7 @@ var SkeletonMessage = ({ own = false, showAvatar = true, className }) => {
|
|
|
2423
2423
|
] });
|
|
2424
2424
|
};
|
|
2425
2425
|
var SkeletonList = ({ items = 5, itemHeight = 60, showAvatar = true, className }) => {
|
|
2426
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("space-y-3", className), children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center space-x-3 p-3 rounded-
|
|
2426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("space-y-3", className), children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center space-x-3 p-3 rounded-2xl md:rounded-3xl", children: [
|
|
2427
2427
|
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonAvatar, {}),
|
|
2428
2428
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
2429
2429
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Skeleton, { className: "h-4 w-3/4" }),
|
|
@@ -4511,7 +4511,7 @@ var sizeStyles6 = {
|
|
|
4511
4511
|
content: "mt-3 p-3"
|
|
4512
4512
|
},
|
|
4513
4513
|
md: {
|
|
4514
|
-
tab: "py-2 px-4 text-sm",
|
|
4514
|
+
tab: "py-2.5 px-4 text-sm",
|
|
4515
4515
|
content: "mt-4 p-4"
|
|
4516
4516
|
},
|
|
4517
4517
|
lg: {
|
|
@@ -4521,33 +4521,33 @@ var sizeStyles6 = {
|
|
|
4521
4521
|
};
|
|
4522
4522
|
var variantStyles5 = {
|
|
4523
4523
|
default: {
|
|
4524
|
-
container: "border-b border-border",
|
|
4525
|
-
tab: "border-b-2 border-transparent hover:
|
|
4526
|
-
activeTab: "border-primary text-primary",
|
|
4524
|
+
container: "border-b border-border/60 bg-muted/30 p-1 rounded-t-2xl",
|
|
4525
|
+
tab: "rounded-full border-b-2 border-transparent hover:bg-accent/40",
|
|
4526
|
+
activeTab: "border-primary bg-background text-primary shadow-sm",
|
|
4527
4527
|
inactiveTab: "text-muted-foreground hover:text-foreground"
|
|
4528
4528
|
},
|
|
4529
4529
|
pills: {
|
|
4530
|
-
container: "bg-muted p-1 rounded-
|
|
4531
|
-
tab: "rounded-
|
|
4532
|
-
activeTab: "bg-background text-foreground shadow-
|
|
4530
|
+
container: "bg-muted/50 backdrop-blur-sm p-1.5 rounded-2xl border border-border/40",
|
|
4531
|
+
tab: "rounded-full transition-all duration-200",
|
|
4532
|
+
activeTab: "bg-background text-foreground shadow-md border border-border/50",
|
|
4533
4533
|
inactiveTab: "text-muted-foreground hover:text-foreground hover:bg-background/50"
|
|
4534
4534
|
},
|
|
4535
4535
|
underline: {
|
|
4536
|
-
container: "relative border-b border-border",
|
|
4537
|
-
tab: "relative transition-colors duration-200 pb-3 border-b-2 border-transparent hover:border-
|
|
4538
|
-
activeTab: "text-primary border-primary font-
|
|
4536
|
+
container: "relative border-b border-border/60",
|
|
4537
|
+
tab: "relative transition-colors duration-200 pb-3 border-b-2 border-transparent hover:border-primary/30",
|
|
4538
|
+
activeTab: "text-primary border-primary font-semibold",
|
|
4539
4539
|
inactiveTab: "text-muted-foreground hover:text-foreground"
|
|
4540
4540
|
},
|
|
4541
4541
|
card: {
|
|
4542
|
-
container: "space-y-1",
|
|
4542
|
+
container: "space-y-1.5 bg-muted/20 p-2 rounded-2xl border border-border/30",
|
|
4543
4543
|
tab: "rounded-xl border border-transparent transition-all duration-200",
|
|
4544
|
-
activeTab: "bg-primary text-primary-foreground border-primary",
|
|
4545
|
-
inactiveTab: "text-muted-foreground hover:text-foreground hover:bg-accent/50 hover:border-border
|
|
4544
|
+
activeTab: "bg-primary text-primary-foreground border-primary shadow-md",
|
|
4545
|
+
inactiveTab: "text-muted-foreground hover:text-foreground hover:bg-accent/50 hover:border-border/50"
|
|
4546
4546
|
},
|
|
4547
4547
|
"underline-card": {
|
|
4548
|
-
container: "border-b border-border bg-card rounded-t-2xl",
|
|
4549
|
-
tab: "relative transition-all duration-200 pb-3 px-4 border-b-2 border-transparent hover:border-primary/
|
|
4550
|
-
activeTab: "text-primary border-primary font-
|
|
4548
|
+
container: "border-b border-border/60 bg-card/80 backdrop-blur-sm rounded-t-2xl p-1",
|
|
4549
|
+
tab: "relative transition-all duration-200 pb-3 px-4 rounded-t-xl border-b-2 border-transparent hover:border-primary/30 hover:bg-accent/30",
|
|
4550
|
+
activeTab: "text-primary border-primary font-semibold bg-accent/30",
|
|
4551
4551
|
inactiveTab: "text-muted-foreground hover:text-foreground"
|
|
4552
4552
|
}
|
|
4553
4553
|
};
|
|
@@ -4667,7 +4667,8 @@ var Tabs = ({
|
|
|
4667
4667
|
id: `${baseId}-panel-${tabs.findIndex((t) => t.value === active)}`,
|
|
4668
4668
|
"aria-labelledby": `${baseId}-tab-${tabs.findIndex((t) => t.value === active)}`,
|
|
4669
4669
|
className: cn(
|
|
4670
|
-
"bg-card rounded-
|
|
4670
|
+
"bg-card rounded-2xl md:rounded-3xl border border-border/60 shadow-sm text-card-foreground transition-all duration-200",
|
|
4671
|
+
"backdrop-blur-sm",
|
|
4671
4672
|
sizeStyles6[size].content,
|
|
4672
4673
|
orientation === "vertical" && "flex-1"
|
|
4673
4674
|
),
|
|
@@ -5008,6 +5009,7 @@ var Combobox = ({
|
|
|
5008
5009
|
const itemDescription = getOptionDescription(item);
|
|
5009
5010
|
const itemDisabled = getOptionDisabled(item);
|
|
5010
5011
|
const isSelected = itemValue === value;
|
|
5012
|
+
const isEven = index % 2 === 0;
|
|
5011
5013
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
5012
5014
|
"li",
|
|
5013
5015
|
{
|
|
@@ -5024,11 +5026,12 @@ var Combobox = ({
|
|
|
5024
5026
|
animationDelay: open ? `${Math.min(index * 15, 150)}ms` : "0ms"
|
|
5025
5027
|
},
|
|
5026
5028
|
className: cn(
|
|
5027
|
-
"dropdown-item group flex cursor-pointer items-center gap-3 rounded-
|
|
5029
|
+
"dropdown-item group flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm",
|
|
5028
5030
|
"outline-none focus:outline-none focus-visible:outline-none",
|
|
5029
5031
|
"transition-all duration-150",
|
|
5030
|
-
|
|
5031
|
-
!itemDisabled && "
|
|
5032
|
+
isEven && "bg-muted/40",
|
|
5033
|
+
!itemDisabled && "hover:bg-accent/70 hover:shadow-sm",
|
|
5034
|
+
!itemDisabled && "focus:bg-accent/80 focus:text-accent-foreground",
|
|
5032
5035
|
index === activeIndex && !itemDisabled && "bg-accent/60",
|
|
5033
5036
|
isSelected && "bg-primary/10 text-primary font-medium",
|
|
5034
5037
|
itemDisabled && "opacity-50 cursor-not-allowed"
|
|
@@ -5106,11 +5109,17 @@ var Combobox = ({
|
|
|
5106
5109
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "w-10 h-10 rounded-full border-2 border-primary/20 border-t-primary animate-spin" }) }),
|
|
5107
5110
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-sm text-muted-foreground", children: loadingText })
|
|
5108
5111
|
] }) }) : filteredOptions.length > 0 ? groupedOptions ? (
|
|
5109
|
-
// Render grouped options
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.
|
|
5113
|
-
|
|
5112
|
+
// Render grouped options with global index tracking
|
|
5113
|
+
(() => {
|
|
5114
|
+
let globalIndex = 0;
|
|
5115
|
+
return Object.entries(groupedOptions).map(([group, items]) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cn(globalIndex > 0 && "mt-2 pt-2 border-t border-border/30"), children: [
|
|
5116
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "px-3 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: group }),
|
|
5117
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ul", { className: "space-y-0.5", children: items.map((item) => {
|
|
5118
|
+
const index = globalIndex++;
|
|
5119
|
+
return renderOptionItem(item, index);
|
|
5120
|
+
}) })
|
|
5121
|
+
] }, group));
|
|
5122
|
+
})()
|
|
5114
5123
|
) : (
|
|
5115
5124
|
// Render flat options
|
|
5116
5125
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ul", { className: "space-y-0.5", children: filteredOptions.map((item, index) => renderOptionItem(item, index)) })
|
|
@@ -5437,17 +5446,23 @@ var Pagination = ({
|
|
|
5437
5446
|
}
|
|
5438
5447
|
)
|
|
5439
5448
|
] }),
|
|
5440
|
-
pageSizeOptions && onPageSizeChange ? /* @__PURE__ */ (0, import_jsx_runtime26.
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5449
|
+
pageSizeOptions && onPageSizeChange ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5450
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "text-xs text-muted-foreground/70 hidden sm:inline", children: [
|
|
5451
|
+
t("itemsPerPage"),
|
|
5452
|
+
":"
|
|
5453
|
+
] }),
|
|
5454
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5455
|
+
Combobox,
|
|
5456
|
+
{
|
|
5457
|
+
options: pageSizeOptionsStrings,
|
|
5458
|
+
value: pageSize?.toString() || "10",
|
|
5459
|
+
onChange: handlePageSizeChange,
|
|
5460
|
+
size: "sm",
|
|
5461
|
+
className: "w-20 sm:w-24",
|
|
5462
|
+
disabled
|
|
5463
|
+
}
|
|
5464
|
+
)
|
|
5465
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", {})
|
|
5451
5466
|
]
|
|
5452
5467
|
}
|
|
5453
5468
|
);
|
|
@@ -5673,7 +5688,12 @@ var ScrollArea = (0, import_react14.forwardRef)(
|
|
|
5673
5688
|
"div",
|
|
5674
5689
|
{
|
|
5675
5690
|
ref,
|
|
5676
|
-
className: cn(
|
|
5691
|
+
className: cn(
|
|
5692
|
+
"relative overflow-hidden rounded-2xl md:rounded-3xl",
|
|
5693
|
+
variantClasses[variant],
|
|
5694
|
+
outlined && "border border-border/60",
|
|
5695
|
+
className
|
|
5696
|
+
),
|
|
5677
5697
|
...props,
|
|
5678
5698
|
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("h-full w-full overflow-y-auto scroll-area-viewport", contentClassName), children })
|
|
5679
5699
|
}
|
|
@@ -5720,6 +5740,7 @@ var DatePicker = ({
|
|
|
5720
5740
|
const locale = useLocale();
|
|
5721
5741
|
const [isOpen, setIsOpen] = React23.useState(false);
|
|
5722
5742
|
const [viewDate, setViewDate] = React23.useState(value || /* @__PURE__ */ new Date());
|
|
5743
|
+
const [viewMode, setViewMode] = React23.useState("calendar");
|
|
5723
5744
|
const triggerRef = React23.useRef(null);
|
|
5724
5745
|
const wheelContainerRef = React23.useRef(null);
|
|
5725
5746
|
const wheelDeltaRef = React23.useRef(0);
|
|
@@ -5731,6 +5752,11 @@ var DatePicker = ({
|
|
|
5731
5752
|
setViewDate(/* @__PURE__ */ new Date());
|
|
5732
5753
|
}
|
|
5733
5754
|
}, [value]);
|
|
5755
|
+
React23.useEffect(() => {
|
|
5756
|
+
if (!isOpen) {
|
|
5757
|
+
setViewMode("calendar");
|
|
5758
|
+
}
|
|
5759
|
+
}, [isOpen]);
|
|
5734
5760
|
const handleDateSelect = (date) => {
|
|
5735
5761
|
let selectedDate;
|
|
5736
5762
|
if (value && (value.getHours() !== 0 || value.getMinutes() !== 0 || value.getSeconds() !== 0)) {
|
|
@@ -5839,13 +5865,64 @@ var DatePicker = ({
|
|
|
5839
5865
|
}
|
|
5840
5866
|
return days;
|
|
5841
5867
|
};
|
|
5868
|
+
const renderMonthSelector = () => {
|
|
5869
|
+
const months = locale === "vi" ? ["Th1", "Th2", "Th3", "Th4", "Th5", "Th6", "Th7", "Th8", "Th9", "Th10", "Th11", "Th12"] : ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
5870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-3 gap-2 p-2", children: months.map((month, idx) => {
|
|
5871
|
+
const isSelected = viewDate.getMonth() === idx;
|
|
5872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5873
|
+
"button",
|
|
5874
|
+
{
|
|
5875
|
+
type: "button",
|
|
5876
|
+
onClick: () => {
|
|
5877
|
+
setViewDate(new Date(viewDate.getFullYear(), idx, 1));
|
|
5878
|
+
setViewMode("calendar");
|
|
5879
|
+
},
|
|
5880
|
+
className: cn(
|
|
5881
|
+
"py-2 px-3 rounded-lg text-sm font-medium transition-all duration-200",
|
|
5882
|
+
isSelected ? "bg-primary text-primary-foreground shadow-md" : "hover:bg-accent/80 text-foreground hover:scale-105"
|
|
5883
|
+
),
|
|
5884
|
+
children: month
|
|
5885
|
+
},
|
|
5886
|
+
month
|
|
5887
|
+
);
|
|
5888
|
+
}) });
|
|
5889
|
+
};
|
|
5890
|
+
const renderYearSelector = () => {
|
|
5891
|
+
const currentYear = viewDate.getFullYear();
|
|
5892
|
+
const startYear = Math.floor(currentYear / 12) * 12;
|
|
5893
|
+
const years = Array.from({ length: 12 }, (_, i) => startYear + i);
|
|
5894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-3 gap-2 p-2", children: years.map((year) => {
|
|
5895
|
+
const isSelected = viewDate.getFullYear() === year;
|
|
5896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5897
|
+
"button",
|
|
5898
|
+
{
|
|
5899
|
+
type: "button",
|
|
5900
|
+
onClick: () => {
|
|
5901
|
+
setViewDate(new Date(year, viewDate.getMonth(), 1));
|
|
5902
|
+
setViewMode("month");
|
|
5903
|
+
},
|
|
5904
|
+
className: cn(
|
|
5905
|
+
"py-2 px-3 rounded-lg text-sm font-medium transition-all duration-200",
|
|
5906
|
+
isSelected ? "bg-primary text-primary-foreground shadow-md" : "hover:bg-accent/80 text-foreground hover:scale-105"
|
|
5907
|
+
),
|
|
5908
|
+
children: year
|
|
5909
|
+
},
|
|
5910
|
+
year
|
|
5911
|
+
);
|
|
5912
|
+
}) });
|
|
5913
|
+
};
|
|
5914
|
+
const navigateYearRange = (direction) => {
|
|
5915
|
+
const currentYear = viewDate.getFullYear();
|
|
5916
|
+
const offset = direction === "next" ? 12 : -12;
|
|
5917
|
+
setViewDate(new Date(currentYear + offset, viewDate.getMonth(), 1));
|
|
5918
|
+
};
|
|
5842
5919
|
const datePickerContent = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { ref: wheelContainerRef, "data-datepicker": true, className: "w-full", children: [
|
|
5843
5920
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-between mb-4 px-1", children: [
|
|
5844
5921
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5845
5922
|
"button",
|
|
5846
5923
|
{
|
|
5847
5924
|
type: "button",
|
|
5848
|
-
onClick: () => navigateMonth("prev"),
|
|
5925
|
+
onClick: () => viewMode === "year" ? navigateYearRange("prev") : navigateMonth("prev"),
|
|
5849
5926
|
className: cn(
|
|
5850
5927
|
"p-2 rounded-xl transition-all duration-200",
|
|
5851
5928
|
"bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground",
|
|
@@ -5855,15 +5932,37 @@ var DatePicker = ({
|
|
|
5855
5932
|
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" })
|
|
5856
5933
|
}
|
|
5857
5934
|
),
|
|
5858
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex
|
|
5859
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5860
|
-
|
|
5935
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
5936
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5937
|
+
"button",
|
|
5938
|
+
{
|
|
5939
|
+
type: "button",
|
|
5940
|
+
onClick: () => setViewMode(viewMode === "month" ? "calendar" : "month"),
|
|
5941
|
+
className: cn(
|
|
5942
|
+
"text-sm font-bold transition-all duration-200 px-2 py-1 rounded-lg",
|
|
5943
|
+
viewMode === "month" ? "bg-primary/15 text-primary" : "text-foreground hover:bg-accent/50"
|
|
5944
|
+
),
|
|
5945
|
+
children: viewDate.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", { month: "long" })
|
|
5946
|
+
}
|
|
5947
|
+
),
|
|
5948
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5949
|
+
"button",
|
|
5950
|
+
{
|
|
5951
|
+
type: "button",
|
|
5952
|
+
onClick: () => setViewMode(viewMode === "year" ? "calendar" : "year"),
|
|
5953
|
+
className: cn(
|
|
5954
|
+
"text-sm font-bold transition-all duration-200 px-2 py-1 rounded-lg",
|
|
5955
|
+
viewMode === "year" ? "bg-primary/15 text-primary" : "text-foreground hover:bg-accent/50"
|
|
5956
|
+
),
|
|
5957
|
+
children: viewDate.getFullYear()
|
|
5958
|
+
}
|
|
5959
|
+
)
|
|
5861
5960
|
] }),
|
|
5862
5961
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5863
5962
|
"button",
|
|
5864
5963
|
{
|
|
5865
5964
|
type: "button",
|
|
5866
|
-
onClick: () => navigateMonth("next"),
|
|
5965
|
+
onClick: () => viewMode === "year" ? navigateYearRange("next") : navigateMonth("next"),
|
|
5867
5966
|
className: cn(
|
|
5868
5967
|
"p-2 rounded-xl transition-all duration-200",
|
|
5869
5968
|
"bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground",
|
|
@@ -5874,22 +5973,26 @@ var DatePicker = ({
|
|
|
5874
5973
|
}
|
|
5875
5974
|
)
|
|
5876
5975
|
] }),
|
|
5877
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5976
|
+
viewMode === "calendar" && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
5977
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("grid grid-cols-7 gap-1 mb-2 px-0.5"), children: (weekdayLabels || (locale === "vi" ? ["CN", "T2", "T3", "T4", "T5", "T6", "T7"] : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"])).map(
|
|
5978
|
+
(day, idx) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5979
|
+
"div",
|
|
5980
|
+
{
|
|
5981
|
+
className: cn(
|
|
5982
|
+
"text-center font-bold uppercase tracking-wide",
|
|
5983
|
+
size === "sm" ? "text-[9px] py-1" : "text-[10px] py-1.5",
|
|
5984
|
+
idx === 0 || idx === 6 ? "text-primary/70" : "text-muted-foreground/60"
|
|
5985
|
+
),
|
|
5986
|
+
children: day
|
|
5987
|
+
},
|
|
5988
|
+
day
|
|
5989
|
+
)
|
|
5990
|
+
) }),
|
|
5991
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-7 gap-1 p-1 rounded-xl bg-muted/20", children: renderCalendar() })
|
|
5992
|
+
] }),
|
|
5993
|
+
viewMode === "month" && renderMonthSelector(),
|
|
5994
|
+
viewMode === "year" && renderYearSelector(),
|
|
5995
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex items-center gap-2 mt-4 pt-3 border-t border-border/50", size === "sm" && "mt-3 pt-2 gap-1.5"), children: [
|
|
5893
5996
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5894
5997
|
"button",
|
|
5895
5998
|
{
|
|
@@ -5899,14 +6002,15 @@ var DatePicker = ({
|
|
|
5899
6002
|
handleDateSelect(today);
|
|
5900
6003
|
},
|
|
5901
6004
|
className: cn(
|
|
5902
|
-
"flex-1
|
|
6005
|
+
"flex-1 font-semibold rounded-xl",
|
|
5903
6006
|
"bg-linear-to-r from-primary/10 to-primary/5 border border-primary/30",
|
|
5904
6007
|
"text-primary hover:from-primary/20 hover:to-primary/10 hover:border-primary/50",
|
|
5905
|
-
"transition-all duration-300 flex items-center justify-center
|
|
5906
|
-
"hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-primary/10"
|
|
6008
|
+
"transition-all duration-300 flex items-center justify-center",
|
|
6009
|
+
"hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-primary/10",
|
|
6010
|
+
size === "sm" ? "px-2 py-1 text-[10px] gap-1" : "px-3 py-2 text-xs gap-2"
|
|
5907
6011
|
),
|
|
5908
6012
|
children: [
|
|
5909
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Sparkles, { className: "w-3.5 h-3.5" }),
|
|
6013
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Sparkles, { className: size === "sm" ? "w-2.5 h-2.5" : "w-3.5 h-3.5" }),
|
|
5910
6014
|
todayLabel || t("today")
|
|
5911
6015
|
]
|
|
5912
6016
|
}
|
|
@@ -5921,14 +6025,15 @@ var DatePicker = ({
|
|
|
5921
6025
|
setViewDate(/* @__PURE__ */ new Date());
|
|
5922
6026
|
},
|
|
5923
6027
|
className: cn(
|
|
5924
|
-
"flex-1
|
|
6028
|
+
"flex-1 font-semibold rounded-xl",
|
|
5925
6029
|
"bg-linear-to-r from-destructive/10 to-destructive/5 border border-destructive/30",
|
|
5926
6030
|
"text-destructive hover:from-destructive/20 hover:to-destructive/10 hover:border-destructive/50",
|
|
5927
|
-
"transition-all duration-300 flex items-center justify-center
|
|
5928
|
-
"hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-destructive/10"
|
|
6031
|
+
"transition-all duration-300 flex items-center justify-center",
|
|
6032
|
+
"hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-destructive/10",
|
|
6033
|
+
size === "sm" ? "px-2 py-1 text-[10px] gap-1" : "px-3 py-2 text-xs gap-2"
|
|
5929
6034
|
),
|
|
5930
6035
|
children: [
|
|
5931
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.X, { className: "w-3.5 h-3.5" }),
|
|
6036
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.X, { className: size === "sm" ? "w-2.5 h-2.5" : "w-3.5 h-3.5" }),
|
|
5932
6037
|
clearLabel || t("clear")
|
|
5933
6038
|
]
|
|
5934
6039
|
}
|
|
@@ -6061,20 +6166,25 @@ var DatePicker = ({
|
|
|
6061
6166
|
)
|
|
6062
6167
|
] });
|
|
6063
6168
|
};
|
|
6064
|
-
var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select date range...", className, disablePastDates = false }) => {
|
|
6169
|
+
var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select date range...", className, disablePastDates = false, size = "md" }) => {
|
|
6065
6170
|
const locale = useLocale();
|
|
6171
|
+
const t = useTranslations("DatePicker");
|
|
6066
6172
|
const [isOpen, setIsOpen] = React23.useState(false);
|
|
6067
6173
|
const wheelContainerRef = React23.useRef(null);
|
|
6068
6174
|
const wheelDeltaRef = React23.useRef(0);
|
|
6175
|
+
const normalizeToLocal = (date) => {
|
|
6176
|
+
if (!date) return null;
|
|
6177
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
6178
|
+
};
|
|
6069
6179
|
const [viewDate, setViewDate] = React23.useState(startDate || /* @__PURE__ */ new Date());
|
|
6070
|
-
const [tempStart, setTempStart] = React23.useState(startDate
|
|
6071
|
-
const [tempEnd, setTempEnd] = React23.useState(endDate
|
|
6180
|
+
const [tempStart, setTempStart] = React23.useState(normalizeToLocal(startDate));
|
|
6181
|
+
const [tempEnd, setTempEnd] = React23.useState(normalizeToLocal(endDate));
|
|
6072
6182
|
const [hoveredDate, setHoveredDate] = React23.useState(null);
|
|
6073
6183
|
React23.useEffect(() => {
|
|
6074
|
-
setTempStart(startDate
|
|
6184
|
+
setTempStart(normalizeToLocal(startDate));
|
|
6075
6185
|
}, [startDate]);
|
|
6076
6186
|
React23.useEffect(() => {
|
|
6077
|
-
setTempEnd(endDate
|
|
6187
|
+
setTempEnd(normalizeToLocal(endDate));
|
|
6078
6188
|
}, [endDate]);
|
|
6079
6189
|
const isSameDay2 = (a, b) => {
|
|
6080
6190
|
if (!a || !b) return false;
|
|
@@ -6175,7 +6285,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
6175
6285
|
onMouseEnter: () => !isPastDate && tempStart && !tempEnd && setHoveredDate(date),
|
|
6176
6286
|
onMouseLeave: () => tempStart && !tempEnd && setHoveredDate(null),
|
|
6177
6287
|
className: cn(
|
|
6178
|
-
"
|
|
6288
|
+
"transition-all duration-200 focus:outline-none relative font-medium",
|
|
6289
|
+
size === "sm" ? "w-6 h-6 text-xs" : "w-8 h-8 text-sm",
|
|
6179
6290
|
// Disabled/past date state
|
|
6180
6291
|
isPastDate && "opacity-30 cursor-not-allowed text-muted-foreground",
|
|
6181
6292
|
// Default state
|
|
@@ -6201,24 +6312,25 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
6201
6312
|
return nodes;
|
|
6202
6313
|
};
|
|
6203
6314
|
const panel = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { ref: wheelContainerRef, className: "w-full", children: [
|
|
6204
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-between mb-
|
|
6315
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex items-center justify-between px-1", size === "sm" ? "mb-2" : "mb-4"), children: [
|
|
6205
6316
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6206
6317
|
"button",
|
|
6207
6318
|
{
|
|
6208
6319
|
type: "button",
|
|
6209
6320
|
onClick: () => navigateMonth("prev"),
|
|
6210
6321
|
className: cn(
|
|
6211
|
-
"
|
|
6322
|
+
"rounded-xl transition-all duration-200",
|
|
6323
|
+
size === "sm" ? "p-1.5" : "p-2",
|
|
6212
6324
|
"bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground",
|
|
6213
6325
|
"hover:scale-110 active:scale-95 hover:shadow-md",
|
|
6214
6326
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50"
|
|
6215
6327
|
),
|
|
6216
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.ChevronLeft, { className: "h-4 w-4" })
|
|
6328
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.ChevronLeft, { className: cn(size === "sm" ? "h-3 w-3" : "h-4 w-4") })
|
|
6217
6329
|
}
|
|
6218
6330
|
),
|
|
6219
6331
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
6220
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-sm
|
|
6221
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-
|
|
6332
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: cn("font-bold text-foreground", size === "sm" ? "text-xs" : "text-sm"), children: viewDate.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", { month: "long" }) }),
|
|
6333
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: cn("text-muted-foreground font-medium", size === "sm" ? "text-[10px]" : "text-xs"), children: viewDate.getFullYear() })
|
|
6222
6334
|
] }),
|
|
6223
6335
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6224
6336
|
"button",
|
|
@@ -6226,20 +6338,22 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
6226
6338
|
type: "button",
|
|
6227
6339
|
onClick: () => navigateMonth("next"),
|
|
6228
6340
|
className: cn(
|
|
6229
|
-
"
|
|
6341
|
+
"rounded-xl transition-all duration-200",
|
|
6342
|
+
size === "sm" ? "p-1.5" : "p-2",
|
|
6230
6343
|
"bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground",
|
|
6231
6344
|
"hover:scale-110 active:scale-95 hover:shadow-md",
|
|
6232
6345
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50"
|
|
6233
6346
|
),
|
|
6234
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.ChevronRight, { className: "h-4 w-4" })
|
|
6347
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.ChevronRight, { className: cn(size === "sm" ? "h-3 w-3" : "h-4 w-4") })
|
|
6235
6348
|
}
|
|
6236
6349
|
)
|
|
6237
6350
|
] }),
|
|
6238
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-7 gap-1
|
|
6351
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("grid grid-cols-7 gap-1 px-0.5", size === "sm" ? "mb-1" : "mb-2"), children: (locale === "vi" ? ["CN", "T2", "T3", "T4", "T5", "T6", "T7"] : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]).map((d, idx) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6239
6352
|
"div",
|
|
6240
6353
|
{
|
|
6241
6354
|
className: cn(
|
|
6242
|
-
"text-
|
|
6355
|
+
"text-center font-bold uppercase tracking-wide",
|
|
6356
|
+
size === "sm" ? "text-[8px] py-1" : "text-[10px] py-1.5",
|
|
6243
6357
|
idx === 0 || idx === 6 ? "text-primary/70" : "text-muted-foreground/60"
|
|
6244
6358
|
),
|
|
6245
6359
|
children: d
|
|
@@ -6256,13 +6370,13 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
6256
6370
|
open: isOpen,
|
|
6257
6371
|
onOpenChange: setIsOpen,
|
|
6258
6372
|
placement: "bottom-start",
|
|
6259
|
-
contentWidth: 280,
|
|
6373
|
+
contentWidth: size === "sm" ? 240 : 280,
|
|
6260
6374
|
contentClassName: cn(
|
|
6261
6375
|
"p-0",
|
|
6262
6376
|
"backdrop-blur-xl bg-popover/95 border-border/40 shadow-2xl",
|
|
6263
6377
|
"rounded-2xl",
|
|
6264
6378
|
"max-w-[calc(100vw-1rem)] max-h-[calc(100vh-6rem)] overflow-auto overscroll-contain",
|
|
6265
|
-
"p-5",
|
|
6379
|
+
size === "sm" ? "p-3" : "p-5",
|
|
6266
6380
|
"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-300"
|
|
6267
6381
|
),
|
|
6268
6382
|
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
@@ -6270,7 +6384,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
6270
6384
|
{
|
|
6271
6385
|
type: "button",
|
|
6272
6386
|
className: cn(
|
|
6273
|
-
"group flex w-full items-center justify-between rounded-full border bg-background/80 backdrop-blur-sm
|
|
6387
|
+
"group flex w-full items-center justify-between rounded-full border bg-background/80 backdrop-blur-sm",
|
|
6388
|
+
size === "sm" ? "px-2 py-1.5 text-xs" : "px-3 py-2.5 text-sm",
|
|
6274
6389
|
"border-border/60 hover:border-primary/40",
|
|
6275
6390
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
6276
6391
|
"hover:bg-accent/10 hover:shadow-lg hover:shadow-primary/5 hover:-translate-y-0.5",
|
|
@@ -6279,15 +6394,16 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
6279
6394
|
className
|
|
6280
6395
|
),
|
|
6281
6396
|
children: [
|
|
6282
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
6397
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex items-center", size === "sm" ? "gap-1.5" : "gap-2.5"), children: [
|
|
6283
6398
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6284
6399
|
"div",
|
|
6285
6400
|
{
|
|
6286
6401
|
className: cn(
|
|
6287
|
-
"flex items-center justify-center rounded-lg
|
|
6402
|
+
"flex items-center justify-center rounded-lg transition-all duration-300",
|
|
6403
|
+
size === "sm" ? "p-1" : "p-1.5",
|
|
6288
6404
|
isOpen ? "bg-primary/15 text-primary" : "bg-muted/50 text-muted-foreground group-hover:bg-primary/10 group-hover:text-primary"
|
|
6289
6405
|
),
|
|
6290
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Calendar, { className: cn("h-
|
|
6406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Calendar, { className: cn("transition-transform duration-300", size === "sm" ? "h-3 w-3" : "h-4 w-4", isOpen && "scale-110") })
|
|
6291
6407
|
}
|
|
6292
6408
|
),
|
|
6293
6409
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
@@ -6302,7 +6418,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
6302
6418
|
}
|
|
6303
6419
|
)
|
|
6304
6420
|
] }),
|
|
6305
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: cn("transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
|
|
6421
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: cn("transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { className: cn(size === "sm" ? "h-3 w-3" : "h-4 w-4"), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
|
|
6306
6422
|
]
|
|
6307
6423
|
}
|
|
6308
6424
|
),
|
|
@@ -7727,6 +7843,7 @@ var MultiCombobox = ({
|
|
|
7727
7843
|
const isDisabled = item.disabled || disabledOptions.includes(item.value);
|
|
7728
7844
|
const optionIcon = item.icon;
|
|
7729
7845
|
const optionDesc = item.description;
|
|
7846
|
+
const isEven = index % 2 === 0;
|
|
7730
7847
|
if (renderOption) {
|
|
7731
7848
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7732
7849
|
"li",
|
|
@@ -7741,7 +7858,7 @@ var MultiCombobox = ({
|
|
|
7741
7858
|
inputRef.current?.focus();
|
|
7742
7859
|
},
|
|
7743
7860
|
style: { animationDelay: open ? `${Math.min(index * 20, 200)}ms` : "0ms" },
|
|
7744
|
-
className: cn("dropdown-item", isDisabled && "opacity-50 cursor-not-allowed pointer-events-none"),
|
|
7861
|
+
className: cn("dropdown-item", isEven && "bg-muted/25", isDisabled && "opacity-50 cursor-not-allowed pointer-events-none"),
|
|
7745
7862
|
children: renderOption(item, isSelected)
|
|
7746
7863
|
},
|
|
7747
7864
|
item.value
|
|
@@ -7761,11 +7878,12 @@ var MultiCombobox = ({
|
|
|
7761
7878
|
},
|
|
7762
7879
|
style: { animationDelay: open ? `${Math.min(index * 20, 200)}ms` : "0ms" },
|
|
7763
7880
|
className: cn(
|
|
7764
|
-
"dropdown-item flex cursor-pointer items-center gap-3 rounded-
|
|
7881
|
+
"dropdown-item flex cursor-pointer items-center gap-3 rounded-lg transition-all duration-200",
|
|
7765
7882
|
sizeStyles8[size].item,
|
|
7766
|
-
"
|
|
7767
|
-
|
|
7768
|
-
|
|
7883
|
+
isEven && "bg-muted/25",
|
|
7884
|
+
"hover:bg-accent/70 hover:shadow-sm",
|
|
7885
|
+
index === activeIndex && "bg-accent/60",
|
|
7886
|
+
isSelected && "bg-primary/10 text-primary font-medium",
|
|
7769
7887
|
isDisabled && "opacity-40 cursor-not-allowed pointer-events-none"
|
|
7770
7888
|
),
|
|
7771
7889
|
children: [
|
|
@@ -8968,26 +9086,23 @@ function CategoryTreeSelect(props) {
|
|
|
8968
9086
|
const hasChildren = children.length > 0;
|
|
8969
9087
|
const isExpanded = expandedNodes.has(category.id);
|
|
8970
9088
|
const isSelected = valueArray.includes(category.id);
|
|
9089
|
+
const isParent = level === 0;
|
|
8971
9090
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "animate-in fade-in-50 duration-200", style: { animationDelay: `${level * 30}ms` }, children: [
|
|
8972
9091
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
8973
9092
|
"div",
|
|
8974
9093
|
{
|
|
8975
9094
|
className: cn(
|
|
8976
|
-
"relative flex items-center gap-2.5 px-3 py-2.5
|
|
9095
|
+
"relative flex items-center gap-2.5 px-3 py-2.5 transition-all duration-200",
|
|
9096
|
+
"border-l-4 border-l-transparent",
|
|
9097
|
+
// Parent level styling
|
|
9098
|
+
isParent && "bg-muted/25 font-medium",
|
|
8977
9099
|
!viewOnly && "cursor-pointer",
|
|
8978
9100
|
!viewOnly && !isSelected && "hover:bg-accent/60 hover:shadow-sm",
|
|
8979
9101
|
// Selected state
|
|
8980
|
-
!viewOnly && isSelected && "bg-
|
|
9102
|
+
!viewOnly && isSelected && "bg-accent/30 border-l-primary shadow-sm"
|
|
8981
9103
|
),
|
|
8982
9104
|
style: { paddingLeft: `${level * 1.25 + 0.75}rem` },
|
|
8983
9105
|
children: [
|
|
8984
|
-
!viewOnly && isSelected && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8985
|
-
"span",
|
|
8986
|
-
{
|
|
8987
|
-
"aria-hidden": true,
|
|
8988
|
-
className: "absolute left-0 top-2 bottom-2 w-1 rounded-full bg-linear-to-b from-primary to-primary/70 shadow-sm shadow-primary/30"
|
|
8989
|
-
}
|
|
8990
|
-
),
|
|
8991
9106
|
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8992
9107
|
"button",
|
|
8993
9108
|
{
|
|
@@ -9288,7 +9403,7 @@ function ImageUpload({
|
|
|
9288
9403
|
"div",
|
|
9289
9404
|
{
|
|
9290
9405
|
className: cn(
|
|
9291
|
-
"relative border-2 border-dashed rounded-
|
|
9406
|
+
"relative border-2 border-dashed rounded-2xl md:rounded-3xl p-8 text-center transition-all duration-200",
|
|
9292
9407
|
isDragging && !disabled ? "border-primary bg-primary/5 scale-[1.02]" : "border-border hover:border-primary/50",
|
|
9293
9408
|
disabled && "opacity-50 cursor-not-allowed",
|
|
9294
9409
|
uploading && "pointer-events-none"
|
|
@@ -9297,7 +9412,7 @@ function ImageUpload({
|
|
|
9297
9412
|
onDragLeave: handleDragLeave,
|
|
9298
9413
|
onDrop: handleDrop,
|
|
9299
9414
|
children: [
|
|
9300
|
-
uploading && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "absolute inset-0 bg-background/80 flex items-center justify-center rounded-
|
|
9415
|
+
uploading && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "absolute inset-0 bg-background/80 flex items-center justify-center rounded-2xl md:rounded-3xl", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
9301
9416
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Loader2, { className: "w-6 h-6 animate-spin text-primary" }),
|
|
9302
9417
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-sm font-medium", children: "Uploading..." })
|
|
9303
9418
|
] }) }),
|
|
@@ -9326,7 +9441,7 @@ function ImageUpload({
|
|
|
9326
9441
|
),
|
|
9327
9442
|
showPreview && uploadedImages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "space-y-3", children: [
|
|
9328
9443
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h4", { className: "text-sm font-medium", children: "Uploaded Images" }),
|
|
9329
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4", children: uploadedImages.map((image) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative group bg-card border border-border rounded-
|
|
9444
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4", children: uploadedImages.map((image) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative group bg-card border border-border rounded-2xl md:rounded-3xl p-3", children: [
|
|
9330
9445
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
9331
9446
|
Button_default,
|
|
9332
9447
|
{
|
|
@@ -9533,7 +9648,10 @@ function Carousel({
|
|
|
9533
9648
|
"div",
|
|
9534
9649
|
{
|
|
9535
9650
|
ref: carouselRef,
|
|
9536
|
-
className: cn(
|
|
9651
|
+
className: cn(
|
|
9652
|
+
"relative w-full overflow-hidden focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 rounded-2xl md:rounded-3xl",
|
|
9653
|
+
className
|
|
9654
|
+
),
|
|
9537
9655
|
onMouseEnter: () => setIsPaused(true),
|
|
9538
9656
|
onMouseLeave: () => setIsPaused(false),
|
|
9539
9657
|
role: "region",
|
|
@@ -9990,12 +10108,12 @@ var ListRoot = React34.forwardRef(
|
|
|
9990
10108
|
const hasChildren = childCount > 0;
|
|
9991
10109
|
const variantClasses2 = {
|
|
9992
10110
|
plain: "",
|
|
9993
|
-
outlined: "rounded-
|
|
9994
|
-
soft: "rounded-
|
|
9995
|
-
bordered: "border border-border rounded-
|
|
9996
|
-
card: "rounded-
|
|
10111
|
+
outlined: "rounded-2xl md:rounded-3xl bg-card text-card-foreground border border-border shadow-sm",
|
|
10112
|
+
soft: "rounded-2xl md:rounded-3xl bg-muted/40 border border-border/60",
|
|
10113
|
+
bordered: "border border-border rounded-2xl md:rounded-3xl",
|
|
10114
|
+
card: "rounded-2xl md:rounded-3xl bg-card shadow-md border border-border",
|
|
9997
10115
|
flush: "",
|
|
9998
|
-
striped: "rounded-
|
|
10116
|
+
striped: "rounded-2xl md:rounded-3xl border border-border overflow-hidden"
|
|
9999
10117
|
};
|
|
10000
10118
|
if (loading2) {
|
|
10001
10119
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
@@ -11258,14 +11376,14 @@ function joinAreas(areas) {
|
|
|
11258
11376
|
}
|
|
11259
11377
|
function getVariantClasses(variant = "default", outlined) {
|
|
11260
11378
|
if (outlined) {
|
|
11261
|
-
return "rounded-
|
|
11379
|
+
return "rounded-2xl md:rounded-3xl bg-card text-card-foreground border border-border shadow-sm";
|
|
11262
11380
|
}
|
|
11263
11381
|
const variants = {
|
|
11264
11382
|
default: "",
|
|
11265
|
-
bordered: "border border-border rounded-
|
|
11266
|
-
card: "rounded-
|
|
11267
|
-
flat: "bg-muted/30 rounded-
|
|
11268
|
-
glass: "bg-background/80 backdrop-blur-sm border border-border/50 rounded-
|
|
11383
|
+
bordered: "border border-border rounded-2xl md:rounded-3xl",
|
|
11384
|
+
card: "rounded-2xl md:rounded-3xl bg-card text-card-foreground border border-border shadow-sm",
|
|
11385
|
+
flat: "bg-muted/30 rounded-2xl md:rounded-3xl",
|
|
11386
|
+
glass: "bg-background/80 backdrop-blur-sm border border-border/50 rounded-2xl md:rounded-3xl shadow-lg"
|
|
11269
11387
|
};
|
|
11270
11388
|
return variants[variant] || "";
|
|
11271
11389
|
}
|
|
@@ -11400,7 +11518,11 @@ var GridItem = import_react21.default.forwardRef(
|
|
|
11400
11518
|
"div",
|
|
11401
11519
|
{
|
|
11402
11520
|
ref,
|
|
11403
|
-
className: cn(
|
|
11521
|
+
className: cn(
|
|
11522
|
+
"rounded-2xl md:rounded-3xl",
|
|
11523
|
+
hoverable && "transition-all duration-200 hover:scale-[1.02] hover:shadow-md cursor-pointer",
|
|
11524
|
+
className
|
|
11525
|
+
),
|
|
11404
11526
|
style: st,
|
|
11405
11527
|
...rest
|
|
11406
11528
|
}
|
|
@@ -13376,7 +13498,17 @@ function DataTable({
|
|
|
13376
13498
|
totalItems
|
|
13377
13499
|
] }),
|
|
13378
13500
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center gap-0.5", children: [
|
|
13379
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13501
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13502
|
+
Button_default,
|
|
13503
|
+
{
|
|
13504
|
+
variant: "ghost",
|
|
13505
|
+
size: "sm",
|
|
13506
|
+
className: "h-7 w-7 p-0 rounded-full",
|
|
13507
|
+
onClick: () => setCurPage(Math.max(1, curPage - 1)),
|
|
13508
|
+
disabled: curPage === 1,
|
|
13509
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
|
|
13510
|
+
}
|
|
13511
|
+
),
|
|
13380
13512
|
(() => {
|
|
13381
13513
|
const totalPages = Math.ceil(totalItems / curPageSize);
|
|
13382
13514
|
const pages = [];
|
|
@@ -13397,7 +13529,7 @@ function DataTable({
|
|
|
13397
13529
|
{
|
|
13398
13530
|
onClick: () => setCurPage(p),
|
|
13399
13531
|
className: cn(
|
|
13400
|
-
"h-7 min-w-7 px-
|
|
13532
|
+
"h-7 min-w-7 px-2 rounded-full text-xs font-medium transition-colors",
|
|
13401
13533
|
curPage === p ? "bg-primary text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground"
|
|
13402
13534
|
),
|
|
13403
13535
|
children: p
|
|
@@ -13411,7 +13543,7 @@ function DataTable({
|
|
|
13411
13543
|
{
|
|
13412
13544
|
variant: "ghost",
|
|
13413
13545
|
size: "sm",
|
|
13414
|
-
className: "h-7 w-7 p-0",
|
|
13546
|
+
className: "h-7 w-7 p-0 rounded-full",
|
|
13415
13547
|
onClick: () => setCurPage(Math.min(Math.ceil(totalItems / curPageSize), curPage + 1)),
|
|
13416
13548
|
disabled: curPage === Math.ceil(totalItems / curPageSize),
|
|
13417
13549
|
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })
|
|
@@ -13428,7 +13560,7 @@ function DataTable({
|
|
|
13428
13560
|
setCurPageSize(Number(v));
|
|
13429
13561
|
},
|
|
13430
13562
|
size: "sm",
|
|
13431
|
-
className: "w-
|
|
13563
|
+
className: "w-20"
|
|
13432
13564
|
}
|
|
13433
13565
|
)
|
|
13434
13566
|
] })
|