@underverse-ui/underverse 1.0.82 → 1.0.84
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/AGENTS.md +1 -1
- package/README.md +4 -1
- package/agent-recipes.json +1 -1
- package/api-reference.json +1 -1
- package/dist/index.cjs +320 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +320 -86
- package/dist/index.js.map +1 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -51,7 +51,7 @@ import { OverlayScrollbarProvider, ScrollArea, DataTable } from "@underverse-ui/
|
|
|
51
51
|
export function App() {
|
|
52
52
|
return (
|
|
53
53
|
<OverlayScrollbarProvider theme="os-theme-underverse" autoHide="leave">
|
|
54
|
-
<ScrollArea className="h-56" useOverlayScrollbar />
|
|
54
|
+
<ScrollArea className="h-56 rounded-xl border border-border" useOverlayScrollbar />
|
|
55
55
|
<DataTable columns={columns} data={rows} useOverlayScrollbar />
|
|
56
56
|
</OverlayScrollbarProvider>
|
|
57
57
|
);
|
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ import { OverlayScrollbarProvider, ScrollArea, DataTable } from "@underverse-ui/
|
|
|
147
147
|
function App() {
|
|
148
148
|
return (
|
|
149
149
|
<OverlayScrollbarProvider theme="os-theme-underverse" autoHide="leave">
|
|
150
|
-
<ScrollArea className="h-56" useOverlayScrollbar>
|
|
150
|
+
<ScrollArea className="h-56 rounded-xl border border-border" useOverlayScrollbar>
|
|
151
151
|
{/* long content */}
|
|
152
152
|
</ScrollArea>
|
|
153
153
|
|
|
@@ -183,6 +183,9 @@ Provider props:
|
|
|
183
183
|
Component-level enable flags:
|
|
184
184
|
|
|
185
185
|
- `ScrollArea`: `useOverlayScrollbar?: boolean` (default `false`)
|
|
186
|
+
- `className` styles the outer wrapper
|
|
187
|
+
- `contentClassName` styles the scroll viewport
|
|
188
|
+
- set border/radius explicitly; the primitive no longer hardcodes rounded corners
|
|
186
189
|
- `Table`: `useOverlayScrollbar?: boolean` (default `false`)
|
|
187
190
|
- `DataTable`: `useOverlayScrollbar?: boolean` (default `false`)
|
|
188
191
|
- `Combobox`: `useOverlayScrollbar?: boolean` (default `false`)
|
package/agent-recipes.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
{
|
|
27
27
|
"id": "overlay-scrollbar-provider",
|
|
28
28
|
"title": "Enable overlay scrollbars (opt-in)",
|
|
29
|
-
"code": "import \"overlayscrollbars/overlayscrollbars.css\";\nimport { OverlayScrollbarProvider, ScrollArea } from \"@underverse-ui/underverse\";\n\nexport function App(){\n return (\n <OverlayScrollbarProvider theme=\"os-theme-underverse\" autoHide=\"leave\">\n <ScrollArea className=\"h-56\" useOverlayScrollbar>{/* content */}</ScrollArea>\n </OverlayScrollbarProvider>\n );\n}\n"
|
|
29
|
+
"code": "import \"overlayscrollbars/overlayscrollbars.css\";\nimport { OverlayScrollbarProvider, ScrollArea } from \"@underverse-ui/underverse\";\n\nexport function App(){\n return (\n <OverlayScrollbarProvider theme=\"os-theme-underverse\" autoHide=\"leave\">\n <ScrollArea className=\"h-56 rounded-xl border border-border\" useOverlayScrollbar>{/* content */}</ScrollArea>\n </OverlayScrollbarProvider>\n );\n}\n"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"id": "overlay-scrollbar-custom-component",
|
package/api-reference.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -7934,19 +7934,23 @@ var variantClasses2 = {
|
|
|
7934
7934
|
accent: "bg-accent/10"
|
|
7935
7935
|
};
|
|
7936
7936
|
var ScrollArea = (0, import_react17.forwardRef)(
|
|
7937
|
-
({
|
|
7937
|
+
({
|
|
7938
|
+
className,
|
|
7939
|
+
contentClassName,
|
|
7940
|
+
children,
|
|
7941
|
+
variant = "default",
|
|
7942
|
+
outlined = false,
|
|
7943
|
+
overflowHidden = true,
|
|
7944
|
+
useOverlayScrollbar = false,
|
|
7945
|
+
...props
|
|
7946
|
+
}, ref) => {
|
|
7938
7947
|
const viewportRef = (0, import_react17.useRef)(null);
|
|
7939
7948
|
useOverlayScrollbarTarget(viewportRef, { enabled: useOverlayScrollbar });
|
|
7940
7949
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
7941
7950
|
"div",
|
|
7942
7951
|
{
|
|
7943
7952
|
ref,
|
|
7944
|
-
className: cn(
|
|
7945
|
-
"relative overflow-hidden rounded-2xl md:rounded-3xl",
|
|
7946
|
-
variantClasses2[variant],
|
|
7947
|
-
outlined && "border border-border/60",
|
|
7948
|
-
className
|
|
7949
|
-
),
|
|
7953
|
+
className: cn("relative", variantClasses2[variant], outlined && "border border-border/60", overflowHidden && "overflow-hidden", className),
|
|
7950
7954
|
...props,
|
|
7951
7955
|
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ref: viewportRef, className: cn("h-full w-full overflow-y-auto scroll-area-viewport", contentClassName), children })
|
|
7952
7956
|
}
|
|
@@ -7959,13 +7963,13 @@ ScrollArea.displayName = "ScrollArea";
|
|
|
7959
7963
|
var import_react18 = require("react");
|
|
7960
7964
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
7961
7965
|
var OverlayScrollArea = (0, import_react18.forwardRef)(
|
|
7962
|
-
({ className, viewportClassName, viewportProps, enabled = true, overlayScrollbarOptions, children, ...props }, ref) => {
|
|
7966
|
+
({ className, viewportClassName, viewportProps, enabled = true, overflowHidden = true, overlayScrollbarOptions, children, ...props }, ref) => {
|
|
7963
7967
|
const viewportRef = (0, import_react18.useRef)(null);
|
|
7964
7968
|
useOverlayScrollbarTarget(viewportRef, {
|
|
7965
7969
|
enabled,
|
|
7966
7970
|
...overlayScrollbarOptions
|
|
7967
7971
|
});
|
|
7968
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref, className: cn("relative overflow-hidden", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref, className: cn("relative", overflowHidden && "overflow-hidden", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7969
7973
|
"div",
|
|
7970
7974
|
{
|
|
7971
7975
|
ref: viewportRef,
|
|
@@ -8753,10 +8757,27 @@ var DatePicker = ({
|
|
|
8753
8757
|
effectiveError && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-xs text-destructive", children: effectiveError })
|
|
8754
8758
|
] });
|
|
8755
8759
|
};
|
|
8756
|
-
var DateRangePicker = ({
|
|
8760
|
+
var DateRangePicker = ({
|
|
8761
|
+
id,
|
|
8762
|
+
startDate,
|
|
8763
|
+
endDate,
|
|
8764
|
+
onChange,
|
|
8765
|
+
placeholder = "Select date range...",
|
|
8766
|
+
className,
|
|
8767
|
+
label,
|
|
8768
|
+
labelClassName,
|
|
8769
|
+
required = false,
|
|
8770
|
+
disablePastDates = false,
|
|
8771
|
+
minDate,
|
|
8772
|
+
maxDate,
|
|
8773
|
+
size = "md"
|
|
8774
|
+
}) => {
|
|
8757
8775
|
const locale = useSmartLocale();
|
|
8758
8776
|
const t = useSmartTranslations("DatePicker");
|
|
8777
|
+
const tv = useSmartTranslations("ValidationInput");
|
|
8759
8778
|
const [isOpen, setIsOpen] = React28.useState(false);
|
|
8779
|
+
const [viewMode, setViewMode] = React28.useState("calendar");
|
|
8780
|
+
const [localRequiredError, setLocalRequiredError] = React28.useState();
|
|
8760
8781
|
const wheelContainerRef = React28.useRef(null);
|
|
8761
8782
|
const wheelDeltaRef = React28.useRef(0);
|
|
8762
8783
|
const sizeStyles8 = {
|
|
@@ -8828,6 +8849,16 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
8828
8849
|
React28.useEffect(() => {
|
|
8829
8850
|
setTempEnd(normalizeToLocal(endDate));
|
|
8830
8851
|
}, [endDate]);
|
|
8852
|
+
React28.useEffect(() => {
|
|
8853
|
+
if (!isOpen) {
|
|
8854
|
+
setViewMode("calendar");
|
|
8855
|
+
}
|
|
8856
|
+
}, [isOpen]);
|
|
8857
|
+
React28.useEffect(() => {
|
|
8858
|
+
if (!required || startDate && endDate) {
|
|
8859
|
+
setLocalRequiredError(void 0);
|
|
8860
|
+
}
|
|
8861
|
+
}, [endDate, required, startDate]);
|
|
8831
8862
|
const isSameDay2 = (a, b) => {
|
|
8832
8863
|
if (!a || !b) return false;
|
|
8833
8864
|
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
@@ -8838,6 +8869,9 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
8838
8869
|
const navigateMonth = React28.useCallback((direction) => {
|
|
8839
8870
|
setViewDate((prev) => new Date(prev.getFullYear(), prev.getMonth() + (direction === "next" ? 1 : -1), 1));
|
|
8840
8871
|
}, []);
|
|
8872
|
+
const navigateYearRange = React28.useCallback((direction) => {
|
|
8873
|
+
setViewDate((prev) => new Date(prev.getFullYear() + (direction === "next" ? 12 : -12), prev.getMonth(), 1));
|
|
8874
|
+
}, []);
|
|
8841
8875
|
const isElementVerticallyScrollable = (el) => {
|
|
8842
8876
|
const style = window.getComputedStyle(el);
|
|
8843
8877
|
const overflowY = style.overflowY;
|
|
@@ -8882,11 +8916,33 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
8882
8916
|
setTempStart(localDate);
|
|
8883
8917
|
} else {
|
|
8884
8918
|
setTempEnd(localDate);
|
|
8919
|
+
setLocalRequiredError(void 0);
|
|
8885
8920
|
onChange(tempStart, localDate);
|
|
8886
8921
|
setIsOpen(false);
|
|
8887
8922
|
}
|
|
8888
8923
|
}
|
|
8889
8924
|
};
|
|
8925
|
+
const handleSelectToday = () => {
|
|
8926
|
+
const today = /* @__PURE__ */ new Date();
|
|
8927
|
+
today.setHours(0, 0, 0, 0);
|
|
8928
|
+
const localToday = new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
|
8929
|
+
const isPastDate = disablePastDates && localToday < today;
|
|
8930
|
+
const isOutOfRange = !!minDay && localToday < minDay || !!maxDay && localToday > maxDay;
|
|
8931
|
+
if (isPastDate || isOutOfRange) return;
|
|
8932
|
+
setTempStart(localToday);
|
|
8933
|
+
setTempEnd(localToday);
|
|
8934
|
+
setHoveredDate(null);
|
|
8935
|
+
setLocalRequiredError(void 0);
|
|
8936
|
+
onChange(localToday, localToday);
|
|
8937
|
+
setIsOpen(false);
|
|
8938
|
+
};
|
|
8939
|
+
const handleClear = () => {
|
|
8940
|
+
setTempStart(null);
|
|
8941
|
+
setTempEnd(null);
|
|
8942
|
+
setHoveredDate(null);
|
|
8943
|
+
onChange(void 0, void 0);
|
|
8944
|
+
setIsOpen(false);
|
|
8945
|
+
};
|
|
8890
8946
|
const renderGrid = () => {
|
|
8891
8947
|
const nodes = [];
|
|
8892
8948
|
const daysInMonth = getDaysInMonth(viewDate);
|
|
@@ -8955,13 +9011,63 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
8955
9011
|
}
|
|
8956
9012
|
return nodes;
|
|
8957
9013
|
};
|
|
9014
|
+
const renderMonthSelector = () => {
|
|
9015
|
+
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"];
|
|
9016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "grid grid-cols-3 gap-2 p-2", children: months.map((month, idx) => {
|
|
9017
|
+
const isSelected = viewDate.getMonth() === idx;
|
|
9018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9019
|
+
"button",
|
|
9020
|
+
{
|
|
9021
|
+
type: "button",
|
|
9022
|
+
onClick: () => {
|
|
9023
|
+
setViewDate(new Date(viewDate.getFullYear(), idx, 1));
|
|
9024
|
+
setViewMode("calendar");
|
|
9025
|
+
},
|
|
9026
|
+
className: cn(
|
|
9027
|
+
"py-2 px-3 rounded-lg text-sm font-medium transition-all duration-200",
|
|
9028
|
+
isSelected ? "bg-primary text-primary-foreground shadow-md" : "hover:bg-accent/80 text-foreground hover:scale-105"
|
|
9029
|
+
),
|
|
9030
|
+
children: month
|
|
9031
|
+
},
|
|
9032
|
+
month
|
|
9033
|
+
);
|
|
9034
|
+
}) });
|
|
9035
|
+
};
|
|
9036
|
+
const renderYearSelector = () => {
|
|
9037
|
+
const startYear = Math.floor(viewDate.getFullYear() / 12) * 12;
|
|
9038
|
+
const years = Array.from({ length: 12 }, (_, i) => startYear + i);
|
|
9039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "grid grid-cols-3 gap-2 p-2", children: years.map((year) => {
|
|
9040
|
+
const isSelected = viewDate.getFullYear() === year;
|
|
9041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9042
|
+
"button",
|
|
9043
|
+
{
|
|
9044
|
+
type: "button",
|
|
9045
|
+
onClick: () => {
|
|
9046
|
+
setViewDate(new Date(year, viewDate.getMonth(), 1));
|
|
9047
|
+
setViewMode("month");
|
|
9048
|
+
},
|
|
9049
|
+
className: cn(
|
|
9050
|
+
"py-2 px-3 rounded-lg text-sm font-medium transition-all duration-200",
|
|
9051
|
+
isSelected ? "bg-primary text-primary-foreground shadow-md" : "hover:bg-accent/80 text-foreground hover:scale-105"
|
|
9052
|
+
),
|
|
9053
|
+
children: year
|
|
9054
|
+
},
|
|
9055
|
+
year
|
|
9056
|
+
);
|
|
9057
|
+
}) });
|
|
9058
|
+
};
|
|
9059
|
+
const todayDate = React28.useMemo(() => {
|
|
9060
|
+
const today = /* @__PURE__ */ new Date();
|
|
9061
|
+
return new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
|
9062
|
+
}, []);
|
|
9063
|
+
const isTodayUnavailable = !!minDay && todayDate < minDay || !!maxDay && todayDate > maxDay;
|
|
8958
9064
|
const panel = /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { ref: wheelContainerRef, className: "w-full", children: [
|
|
8959
9065
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex items-center justify-between px-1", sizeStyles8[size].headerMargin), children: [
|
|
8960
9066
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
8961
9067
|
"button",
|
|
8962
9068
|
{
|
|
8963
9069
|
type: "button",
|
|
8964
|
-
onClick: () => navigateMonth("prev"),
|
|
9070
|
+
onClick: () => viewMode === "year" ? navigateYearRange("prev") : navigateMonth("prev"),
|
|
8965
9071
|
className: cn(
|
|
8966
9072
|
"rounded-xl transition-all duration-200",
|
|
8967
9073
|
sizeStyles8[size].navButton,
|
|
@@ -8972,15 +9078,39 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
8972
9078
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react15.ChevronLeft, { className: sizeStyles8[size].navIcon })
|
|
8973
9079
|
}
|
|
8974
9080
|
),
|
|
8975
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex
|
|
8976
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
8977
|
-
|
|
9081
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
9082
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9083
|
+
"button",
|
|
9084
|
+
{
|
|
9085
|
+
type: "button",
|
|
9086
|
+
onClick: () => setViewMode(viewMode === "month" ? "calendar" : "month"),
|
|
9087
|
+
className: cn(
|
|
9088
|
+
"rounded-lg px-2 py-0.5 font-bold transition-colors duration-200",
|
|
9089
|
+
size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm",
|
|
9090
|
+
viewMode === "month" ? "bg-primary/15 text-primary" : "text-foreground hover:bg-accent/50"
|
|
9091
|
+
),
|
|
9092
|
+
children: viewDate.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", { month: "long" })
|
|
9093
|
+
}
|
|
9094
|
+
),
|
|
9095
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9096
|
+
"button",
|
|
9097
|
+
{
|
|
9098
|
+
type: "button",
|
|
9099
|
+
onClick: () => setViewMode(viewMode === "year" ? "calendar" : "year"),
|
|
9100
|
+
className: cn(
|
|
9101
|
+
"rounded-lg px-2 py-0.5 font-medium transition-colors duration-200",
|
|
9102
|
+
size === "sm" ? "text-[10px]" : size === "lg" ? "text-sm" : "text-xs",
|
|
9103
|
+
viewMode === "year" ? "bg-primary/15 text-primary" : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
9104
|
+
),
|
|
9105
|
+
children: viewDate.getFullYear()
|
|
9106
|
+
}
|
|
9107
|
+
)
|
|
8978
9108
|
] }),
|
|
8979
9109
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
8980
9110
|
"button",
|
|
8981
9111
|
{
|
|
8982
9112
|
type: "button",
|
|
8983
|
-
onClick: () => navigateMonth("next"),
|
|
9113
|
+
onClick: () => viewMode === "year" ? navigateYearRange("next") : navigateMonth("next"),
|
|
8984
9114
|
className: cn(
|
|
8985
9115
|
"rounded-xl transition-all duration-200",
|
|
8986
9116
|
sizeStyles8[size].navButton,
|
|
@@ -8992,82 +9122,167 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
8992
9122
|
}
|
|
8993
9123
|
)
|
|
8994
9124
|
] }),
|
|
8995
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.
|
|
8996
|
-
"div",
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
open: isOpen,
|
|
9015
|
-
onOpenChange: setIsOpen,
|
|
9016
|
-
placement: "bottom-start",
|
|
9017
|
-
contentWidth: size === "sm" ? 240 : 280,
|
|
9018
|
-
contentClassName: cn(
|
|
9019
|
-
"p-0",
|
|
9020
|
-
"backdrop-blur-xl bg-popover/95 border-border/40 shadow-2xl",
|
|
9021
|
-
"rounded-2xl md:rounded-3xl",
|
|
9022
|
-
"max-w-[calc(100vw-1rem)] max-h-[calc(100vh-6rem)] overflow-auto overscroll-contain",
|
|
9023
|
-
size === "sm" ? "p-3" : "p-5",
|
|
9024
|
-
"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-300"
|
|
9025
|
-
),
|
|
9026
|
-
trigger: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
9125
|
+
viewMode === "calendar" && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
9126
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("grid grid-cols-7 gap-1 px-0.5", size === "sm" ? "mb-1" : size === "lg" ? "mb-3" : "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_runtime34.jsx)(
|
|
9127
|
+
"div",
|
|
9128
|
+
{
|
|
9129
|
+
className: cn(
|
|
9130
|
+
"text-center font-bold uppercase tracking-wide",
|
|
9131
|
+
sizeStyles8[size].weekdayLabel,
|
|
9132
|
+
idx === 0 || idx === 6 ? "text-primary/70" : "text-muted-foreground/60"
|
|
9133
|
+
),
|
|
9134
|
+
children: d
|
|
9135
|
+
},
|
|
9136
|
+
d
|
|
9137
|
+
)) }),
|
|
9138
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "grid grid-cols-7 gap-0.5 p-1 rounded-xl bg-muted/20", children: renderGrid() })
|
|
9139
|
+
] }),
|
|
9140
|
+
viewMode === "month" && renderMonthSelector(),
|
|
9141
|
+
viewMode === "year" && renderYearSelector(),
|
|
9142
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex items-center border-t border-border/50", sizeStyles8[size].footerMargin), children: [
|
|
9143
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
9027
9144
|
"button",
|
|
9028
9145
|
{
|
|
9029
9146
|
type: "button",
|
|
9147
|
+
onClick: handleSelectToday,
|
|
9148
|
+
disabled: isTodayUnavailable,
|
|
9030
9149
|
className: cn(
|
|
9031
|
-
"
|
|
9032
|
-
|
|
9033
|
-
"
|
|
9034
|
-
"
|
|
9035
|
-
"hover:
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
className
|
|
9150
|
+
"flex-1 font-semibold rounded-xl",
|
|
9151
|
+
"bg-linear-to-r from-primary/10 to-primary/5 border border-primary/30",
|
|
9152
|
+
"text-primary hover:from-primary/20 hover:to-primary/10 hover:border-primary/50",
|
|
9153
|
+
"transition-all duration-300 flex items-center justify-center",
|
|
9154
|
+
"hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-primary/10",
|
|
9155
|
+
sizeStyles8[size].actionButton,
|
|
9156
|
+
isTodayUnavailable && "opacity-50 cursor-not-allowed hover:scale-100 active:scale-100"
|
|
9039
9157
|
),
|
|
9040
9158
|
children: [
|
|
9041
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.
|
|
9042
|
-
|
|
9043
|
-
"div",
|
|
9044
|
-
{
|
|
9045
|
-
className: cn(
|
|
9046
|
-
"flex items-center justify-center transition-colors duration-300",
|
|
9047
|
-
isOpen ? "text-primary" : "text-muted-foreground group-hover:text-primary"
|
|
9048
|
-
),
|
|
9049
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react15.Calendar, { className: cn("transition-transform duration-300", size === "sm" ? "h-3 w-3" : "h-4 w-4", isOpen && "scale-110") })
|
|
9050
|
-
}
|
|
9051
|
-
),
|
|
9052
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9053
|
-
"span",
|
|
9054
|
-
{
|
|
9055
|
-
className: cn(
|
|
9056
|
-
"truncate font-medium transition-colors duration-200",
|
|
9057
|
-
!tempStart && !tempEnd && "text-muted-foreground",
|
|
9058
|
-
(tempStart || tempEnd) && "text-foreground"
|
|
9059
|
-
),
|
|
9060
|
-
children: label
|
|
9061
|
-
}
|
|
9062
|
-
)
|
|
9063
|
-
] }),
|
|
9064
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.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_runtime34.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_runtime34.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
|
|
9159
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react15.Sparkles, { className: sizeStyles8[size].actionIcon }),
|
|
9160
|
+
t("today")
|
|
9065
9161
|
]
|
|
9066
9162
|
}
|
|
9067
9163
|
),
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9164
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
9165
|
+
"button",
|
|
9166
|
+
{
|
|
9167
|
+
type: "button",
|
|
9168
|
+
onClick: handleClear,
|
|
9169
|
+
className: cn(
|
|
9170
|
+
"flex-1 font-semibold rounded-xl",
|
|
9171
|
+
"bg-linear-to-r from-destructive/10 to-destructive/5 border border-destructive/30",
|
|
9172
|
+
"text-destructive hover:from-destructive/20 hover:to-destructive/10 hover:border-destructive/50",
|
|
9173
|
+
"transition-all duration-300 flex items-center justify-center",
|
|
9174
|
+
"hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-destructive/10",
|
|
9175
|
+
sizeStyles8[size].actionButton
|
|
9176
|
+
),
|
|
9177
|
+
children: [
|
|
9178
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react15.X, { className: sizeStyles8[size].actionIcon }),
|
|
9179
|
+
t("clear")
|
|
9180
|
+
]
|
|
9181
|
+
}
|
|
9182
|
+
)
|
|
9183
|
+
] })
|
|
9184
|
+
] });
|
|
9185
|
+
const displayFormat = (date) => formatDateShort(date);
|
|
9186
|
+
const displayLabel = tempStart && tempEnd ? `${displayFormat(tempStart)} - ${displayFormat(tempEnd)}` : tempStart ? `${displayFormat(tempStart)} - ...` : placeholder;
|
|
9187
|
+
const effectiveError = localRequiredError;
|
|
9188
|
+
const autoId = (0, import_react19.useId)();
|
|
9189
|
+
const resolvedId = id ? String(id) : `daterangepicker-${autoId}`;
|
|
9190
|
+
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
9191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("space-y-1.5", className), children: [
|
|
9192
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
9193
|
+
"label",
|
|
9194
|
+
{
|
|
9195
|
+
id: labelId,
|
|
9196
|
+
htmlFor: resolvedId,
|
|
9197
|
+
className: cn(size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm", "font-medium text-foreground", effectiveError && "text-destructive", labelClassName),
|
|
9198
|
+
children: [
|
|
9199
|
+
label,
|
|
9200
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
9201
|
+
]
|
|
9202
|
+
}
|
|
9203
|
+
),
|
|
9204
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9205
|
+
"input",
|
|
9206
|
+
{
|
|
9207
|
+
tabIndex: -1,
|
|
9208
|
+
"aria-hidden": "true",
|
|
9209
|
+
value: startDate && endDate ? "selected" : "",
|
|
9210
|
+
onChange: () => {
|
|
9211
|
+
},
|
|
9212
|
+
required,
|
|
9213
|
+
onInvalid: (e) => {
|
|
9214
|
+
e.preventDefault();
|
|
9215
|
+
setLocalRequiredError(tv("required"));
|
|
9216
|
+
},
|
|
9217
|
+
className: "pointer-events-none absolute h-0 w-0 opacity-0"
|
|
9218
|
+
}
|
|
9219
|
+
),
|
|
9220
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9221
|
+
Popover,
|
|
9222
|
+
{
|
|
9223
|
+
open: isOpen,
|
|
9224
|
+
onOpenChange: setIsOpen,
|
|
9225
|
+
placement: "bottom-start",
|
|
9226
|
+
contentWidth: sizeStyles8[size].contentWidth,
|
|
9227
|
+
contentClassName: cn(
|
|
9228
|
+
"p-0",
|
|
9229
|
+
"backdrop-blur-xl bg-popover/95 border-border/40 shadow-2xl",
|
|
9230
|
+
"rounded-2xl md:rounded-3xl",
|
|
9231
|
+
"max-w-[calc(100vw-1rem)] max-h-[calc(100vh-6rem)] overflow-auto overscroll-contain",
|
|
9232
|
+
sizeStyles8[size].contentPadding,
|
|
9233
|
+
"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-300"
|
|
9234
|
+
),
|
|
9235
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
9236
|
+
"button",
|
|
9237
|
+
{
|
|
9238
|
+
id: resolvedId,
|
|
9239
|
+
type: "button",
|
|
9240
|
+
"aria-labelledby": labelId,
|
|
9241
|
+
"aria-required": required,
|
|
9242
|
+
"aria-invalid": !!effectiveError,
|
|
9243
|
+
className: cn(
|
|
9244
|
+
"group flex w-full items-center justify-between rounded-full border bg-background/80 backdrop-blur-sm",
|
|
9245
|
+
sizeStyles8[size].trigger,
|
|
9246
|
+
"border-border/60 hover:border-primary/40",
|
|
9247
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
9248
|
+
"hover:bg-accent/10 hover:shadow-lg hover:shadow-primary/5 hover:-translate-y-0.5",
|
|
9249
|
+
"transition-all duration-300 ease-out",
|
|
9250
|
+
isOpen && "ring-2 ring-primary/30 border-primary/50 shadow-lg shadow-primary/10",
|
|
9251
|
+
effectiveError && "border-destructive/60 focus-visible:ring-destructive/50 bg-destructive/5"
|
|
9252
|
+
),
|
|
9253
|
+
children: [
|
|
9254
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex items-center", size === "sm" ? "gap-1.5" : "gap-2.5"), children: [
|
|
9255
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9256
|
+
"div",
|
|
9257
|
+
{
|
|
9258
|
+
className: cn(
|
|
9259
|
+
"flex items-center justify-center transition-colors duration-300",
|
|
9260
|
+
effectiveError ? "text-destructive" : isOpen ? "text-primary" : "text-muted-foreground group-hover:text-primary"
|
|
9261
|
+
),
|
|
9262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react15.Calendar, { className: cn("transition-transform duration-300", sizeStyles8[size].calendarIcon, isOpen && "scale-110") })
|
|
9263
|
+
}
|
|
9264
|
+
),
|
|
9265
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9266
|
+
"span",
|
|
9267
|
+
{
|
|
9268
|
+
className: cn(
|
|
9269
|
+
"truncate font-medium transition-colors duration-200",
|
|
9270
|
+
!tempStart && !tempEnd && "text-muted-foreground",
|
|
9271
|
+
(tempStart || tempEnd) && "text-foreground"
|
|
9272
|
+
),
|
|
9273
|
+
children: displayLabel
|
|
9274
|
+
}
|
|
9275
|
+
)
|
|
9276
|
+
] }),
|
|
9277
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.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_runtime34.jsx)("svg", { className: cn(sizeStyles8[size].navIcon), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
|
|
9278
|
+
]
|
|
9279
|
+
}
|
|
9280
|
+
),
|
|
9281
|
+
children: panel
|
|
9282
|
+
}
|
|
9283
|
+
),
|
|
9284
|
+
effectiveError && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-xs text-destructive", children: effectiveError })
|
|
9285
|
+
] });
|
|
9071
9286
|
};
|
|
9072
9287
|
var CompactDatePicker = ({ value, onChange, className }) => {
|
|
9073
9288
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
@@ -18751,6 +18966,7 @@ var ListRoot = React46.forwardRef(
|
|
|
18751
18966
|
className,
|
|
18752
18967
|
itemClassName,
|
|
18753
18968
|
// New prop
|
|
18969
|
+
overflowHidden = true,
|
|
18754
18970
|
children,
|
|
18755
18971
|
...rest
|
|
18756
18972
|
}, ref) => {
|
|
@@ -18764,21 +18980,36 @@ var ListRoot = React46.forwardRef(
|
|
|
18764
18980
|
bordered: "border border-border/50 rounded-2xl md:rounded-3xl max-md:rounded-xl",
|
|
18765
18981
|
card: "rounded-2xl md:rounded-3xl bg-card shadow-md border border-border/50 max-md:rounded-xl max-md:shadow-sm",
|
|
18766
18982
|
flush: "",
|
|
18767
|
-
striped: "rounded-2xl md:rounded-3xl border border-border/50
|
|
18983
|
+
striped: "rounded-2xl md:rounded-3xl border border-border/50 max-md:rounded-xl"
|
|
18768
18984
|
};
|
|
18769
18985
|
if (loading2) {
|
|
18770
18986
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
18771
18987
|
Comp,
|
|
18772
18988
|
{
|
|
18773
18989
|
ref,
|
|
18774
|
-
className: cn(
|
|
18990
|
+
className: cn(
|
|
18991
|
+
"group/list",
|
|
18992
|
+
variantClasses3[variant],
|
|
18993
|
+
variant === "striped" && overflowHidden && "overflow-hidden",
|
|
18994
|
+
inset && "p-1.5 md:p-2 max-md:p-1",
|
|
18995
|
+
divided && "divide-y divide-border/60",
|
|
18996
|
+
className
|
|
18997
|
+
),
|
|
18775
18998
|
...rest,
|
|
18776
18999
|
children: Array.from({ length: loadingCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ListItemSkeleton, { size }, i))
|
|
18777
19000
|
}
|
|
18778
19001
|
);
|
|
18779
19002
|
}
|
|
18780
19003
|
if (!hasChildren && emptyText) {
|
|
18781
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
19004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
19005
|
+
Comp,
|
|
19006
|
+
{
|
|
19007
|
+
ref,
|
|
19008
|
+
className: cn("group/list", variantClasses3[variant], variant === "striped" && overflowHidden && "overflow-hidden", inset && "p-1.5 md:p-2 max-md:p-1", className),
|
|
19009
|
+
...rest,
|
|
19010
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "text-center py-8 text-muted-foreground text-sm", children: emptyText })
|
|
19011
|
+
}
|
|
19012
|
+
);
|
|
18782
19013
|
}
|
|
18783
19014
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
18784
19015
|
Comp,
|
|
@@ -18787,6 +19018,7 @@ var ListRoot = React46.forwardRef(
|
|
|
18787
19018
|
className: cn(
|
|
18788
19019
|
"group/list",
|
|
18789
19020
|
variantClasses3[variant],
|
|
19021
|
+
variant === "striped" && overflowHidden && "overflow-hidden",
|
|
18790
19022
|
inset && "p-1.5 md:p-2 max-md:p-1",
|
|
18791
19023
|
divided && "divide-y divide-border/60",
|
|
18792
19024
|
variant === "striped" && "[&>*:nth-child(even)]:bg-muted/30",
|
|
@@ -21881,6 +22113,7 @@ function DataTable({
|
|
|
21881
22113
|
storageKey,
|
|
21882
22114
|
stickyHeader = true,
|
|
21883
22115
|
maxHeight = 500,
|
|
22116
|
+
overflowHidden = true,
|
|
21884
22117
|
useOverlayScrollbar = false,
|
|
21885
22118
|
enableHeaderAutoFit = true,
|
|
21886
22119
|
labels
|
|
@@ -22014,7 +22247,8 @@ function DataTable({
|
|
|
22014
22247
|
"div",
|
|
22015
22248
|
{
|
|
22016
22249
|
className: cn(
|
|
22017
|
-
"relative rounded-2xl md:rounded-3xl border border-border/50 bg-card
|
|
22250
|
+
"relative rounded-2xl md:rounded-3xl border border-border/50 bg-card",
|
|
22251
|
+
overflowHidden && "overflow-hidden",
|
|
22018
22252
|
loading2 && "opacity-60 pointer-events-none"
|
|
22019
22253
|
),
|
|
22020
22254
|
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|