@underverse-ui/underverse 0.2.108 → 0.2.110
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 +186 -150
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +186 -150
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3970,7 +3970,7 @@ var Popover = ({
|
|
|
3970
3970
|
"div",
|
|
3971
3971
|
{
|
|
3972
3972
|
className: cn(
|
|
3973
|
-
"rounded-2xl border bg-popover text-popover-foreground shadow-md",
|
|
3973
|
+
"rounded-2xl md:rounded-3xl border bg-popover text-popover-foreground shadow-md",
|
|
3974
3974
|
"backdrop-blur-sm bg-popover/95 border-border/60 p-4",
|
|
3975
3975
|
contentClassName
|
|
3976
3976
|
),
|
|
@@ -5105,98 +5105,108 @@ var Combobox = ({
|
|
|
5105
5105
|
`${itemValue}-${index}`
|
|
5106
5106
|
);
|
|
5107
5107
|
};
|
|
5108
|
-
const dropdownBody = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
e
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5108
|
+
const dropdownBody = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
5109
|
+
"div",
|
|
5110
|
+
{
|
|
5111
|
+
"data-combobox-dropdown": true,
|
|
5112
|
+
"data-state": open ? "open" : "closed",
|
|
5113
|
+
role: "listbox",
|
|
5114
|
+
id: `${resolvedId}-listbox`,
|
|
5115
|
+
className: "w-full rounded-2xl md:rounded-3xl overflow-hidden",
|
|
5116
|
+
children: [
|
|
5117
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "relative p-2.5 border-b border-border/30", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", children: [
|
|
5118
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground/60 transition-colors peer-focus:text-primary" }),
|
|
5119
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5120
|
+
"input",
|
|
5121
|
+
{
|
|
5122
|
+
ref: inputRef,
|
|
5123
|
+
value: query,
|
|
5124
|
+
onChange: (e) => {
|
|
5125
|
+
setQuery(e.target.value);
|
|
5126
|
+
setActiveIndex(null);
|
|
5127
|
+
},
|
|
5128
|
+
onKeyDown: (e) => {
|
|
5129
|
+
if (e.key === "ArrowDown") {
|
|
5130
|
+
e.preventDefault();
|
|
5131
|
+
setActiveIndex((prev) => {
|
|
5132
|
+
const next = prev === null ? 0 : prev + 1;
|
|
5133
|
+
return next >= filteredOptions.length ? 0 : next;
|
|
5134
|
+
});
|
|
5135
|
+
} else if (e.key === "ArrowUp") {
|
|
5136
|
+
e.preventDefault();
|
|
5137
|
+
setActiveIndex((prev) => {
|
|
5138
|
+
const next = prev === null ? filteredOptions.length - 1 : prev - 1;
|
|
5139
|
+
return next < 0 ? filteredOptions.length - 1 : next;
|
|
5140
|
+
});
|
|
5141
|
+
} else if (e.key === "Enter") {
|
|
5142
|
+
e.preventDefault();
|
|
5143
|
+
if (activeIndex !== null && filteredOptions[activeIndex] && !getOptionDisabled(filteredOptions[activeIndex])) {
|
|
5144
|
+
handleSelect(filteredOptions[activeIndex]);
|
|
5145
|
+
}
|
|
5146
|
+
} else if (e.key === "Escape") {
|
|
5147
|
+
e.preventDefault();
|
|
5148
|
+
setOpen(false);
|
|
5149
|
+
}
|
|
5150
|
+
},
|
|
5151
|
+
placeholder: searchPlaceholder,
|
|
5152
|
+
className: cn(
|
|
5153
|
+
"peer w-full rounded-xl bg-muted/40 py-2.5 pl-9 pr-3 text-sm",
|
|
5154
|
+
"border border-transparent",
|
|
5155
|
+
"focus:outline-none focus:bg-background focus:border-primary/30 focus:ring-2 focus:ring-primary/10",
|
|
5156
|
+
"transition-all duration-200",
|
|
5157
|
+
"placeholder:text-muted-foreground/50"
|
|
5158
|
+
),
|
|
5159
|
+
"aria-autocomplete": "list",
|
|
5160
|
+
"aria-activedescendant": activeIndex != null ? `combobox-item-${activeIndex}` : void 0
|
|
5141
5161
|
}
|
|
5142
|
-
},
|
|
5143
|
-
placeholder: searchPlaceholder,
|
|
5144
|
-
className: cn(
|
|
5145
|
-
"peer w-full rounded-xl bg-muted/40 py-2.5 pl-9 pr-3 text-sm",
|
|
5146
|
-
"border border-transparent",
|
|
5147
|
-
"focus:outline-none focus:bg-background focus:border-primary/30 focus:ring-2 focus:ring-primary/10",
|
|
5148
|
-
"transition-all duration-200",
|
|
5149
|
-
"placeholder:text-muted-foreground/50"
|
|
5150
5162
|
),
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
] }) }) }) })
|
|
5199
|
-
] });
|
|
5163
|
+
query && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5164
|
+
"button",
|
|
5165
|
+
{
|
|
5166
|
+
type: "button",
|
|
5167
|
+
onClick: () => setQuery(""),
|
|
5168
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 p-0.5 rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",
|
|
5169
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.X, { className: "h-3.5 w-3.5" })
|
|
5170
|
+
}
|
|
5171
|
+
)
|
|
5172
|
+
] }) }),
|
|
5173
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "overflow-y-auto overscroll-contain", style: { maxHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "p-1.5", children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "px-3 py-10 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col items-center gap-3 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
5174
|
+
/* @__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" }) }),
|
|
5175
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-sm text-muted-foreground", children: loadingText })
|
|
5176
|
+
] }) }) : filteredOptions.length > 0 ? groupedOptions ? (
|
|
5177
|
+
// Render grouped options with global index tracking
|
|
5178
|
+
(() => {
|
|
5179
|
+
let globalIndex = 0;
|
|
5180
|
+
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: [
|
|
5181
|
+
/* @__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 }),
|
|
5182
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ul", { className: "space-y-0.5", children: items.map((item) => {
|
|
5183
|
+
const index = globalIndex++;
|
|
5184
|
+
return renderOptionItem(item, index);
|
|
5185
|
+
}) })
|
|
5186
|
+
] }, group));
|
|
5187
|
+
})()
|
|
5188
|
+
) : (
|
|
5189
|
+
// Render flat options
|
|
5190
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ul", { className: "space-y-0.5", children: filteredOptions.map((item, index) => renderOptionItem(item, index)) })
|
|
5191
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "px-3 py-10 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col items-center gap-3 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
5192
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "w-12 h-12 rounded-full bg-muted/50 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.SearchX, { className: "h-6 w-6 text-muted-foreground/60" }) }),
|
|
5193
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-1", children: [
|
|
5194
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "block text-sm font-medium text-foreground", children: emptyText }),
|
|
5195
|
+
query && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "block text-xs text-muted-foreground", children: "Try a different search term" })
|
|
5196
|
+
] }),
|
|
5197
|
+
query && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5198
|
+
"button",
|
|
5199
|
+
{
|
|
5200
|
+
type: "button",
|
|
5201
|
+
onClick: () => setQuery(""),
|
|
5202
|
+
className: "px-3 py-1.5 text-xs font-medium text-primary bg-primary/10 rounded-full hover:bg-primary/20 transition-colors",
|
|
5203
|
+
children: "Clear search"
|
|
5204
|
+
}
|
|
5205
|
+
)
|
|
5206
|
+
] }) }) }) })
|
|
5207
|
+
]
|
|
5208
|
+
}
|
|
5209
|
+
);
|
|
5200
5210
|
const sizeStyles8 = {
|
|
5201
5211
|
sm: "h-8 py-1.5 text-sm md:h-7 md:text-xs",
|
|
5202
5212
|
md: "h-10 py-2 text-sm",
|
|
@@ -5209,7 +5219,7 @@ var Combobox = ({
|
|
|
5209
5219
|
filled: "border-0 bg-muted/50 hover:bg-muted/80"
|
|
5210
5220
|
};
|
|
5211
5221
|
const labelSize = size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm";
|
|
5212
|
-
const radiusClass =
|
|
5222
|
+
const radiusClass = "rounded-full";
|
|
5213
5223
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
5214
5224
|
const triggerButtonBaseProps = {
|
|
5215
5225
|
ref: triggerRef,
|
|
@@ -5314,12 +5324,12 @@ var Combobox = ({
|
|
|
5314
5324
|
placement: "bottom-start",
|
|
5315
5325
|
matchTriggerWidth: true,
|
|
5316
5326
|
className: "z-9999",
|
|
5317
|
-
contentClassName: "p-0",
|
|
5327
|
+
contentClassName: "p-0 overflow-hidden rounded-2xl md:rounded-3xl",
|
|
5318
5328
|
children: dropdownBody
|
|
5319
5329
|
}
|
|
5320
5330
|
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", children: [
|
|
5321
5331
|
triggerButtonInline,
|
|
5322
|
-
open && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute left-0 top-full mt-1 z-50 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "rounded-2xl border text-popover-foreground shadow-md backdrop-blur-sm bg-popover/95 border-border/60", children: dropdownBody }) })
|
|
5332
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute left-0 top-full mt-1 z-50 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "rounded-2xl md:rounded-3xl overflow-hidden border text-popover-foreground shadow-md backdrop-blur-sm bg-popover/95 border-border/60", children: dropdownBody }) })
|
|
5323
5333
|
] }),
|
|
5324
5334
|
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: cn("text-xs transition-colors duration-200 flex items-center gap-1.5", error ? "text-destructive" : "text-muted-foreground"), children: [
|
|
5325
5335
|
error && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", className: "w-3.5 h-3.5 shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -6154,7 +6164,7 @@ var DatePicker = ({
|
|
|
6154
6164
|
contentClassName: cn(
|
|
6155
6165
|
"p-0",
|
|
6156
6166
|
"backdrop-blur-xl bg-popover/95 border-border/40 shadow-2xl",
|
|
6157
|
-
"rounded-2xl",
|
|
6167
|
+
"rounded-2xl md:rounded-3xl",
|
|
6158
6168
|
// Keep usable on small viewports (wheel scroll should stay within the popover if it overflows)
|
|
6159
6169
|
"max-w-[calc(100vw-1rem)] max-h-[calc(100vh-6rem)] overflow-auto overscroll-contain",
|
|
6160
6170
|
size === "sm" ? "p-4" : "p-5",
|
|
@@ -6186,8 +6196,8 @@ var DatePicker = ({
|
|
|
6186
6196
|
"div",
|
|
6187
6197
|
{
|
|
6188
6198
|
className: cn(
|
|
6189
|
-
"flex items-center justify-center
|
|
6190
|
-
isOpen ? "
|
|
6199
|
+
"flex items-center justify-center transition-colors duration-300",
|
|
6200
|
+
isOpen ? "text-primary" : "text-muted-foreground group-hover:text-primary"
|
|
6191
6201
|
),
|
|
6192
6202
|
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Calendar, { className: cn(size === "sm" ? "h-3.5 w-3.5" : "h-4 w-4", "transition-transform duration-300", isOpen && "scale-110") })
|
|
6193
6203
|
}
|
|
@@ -6457,7 +6467,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
6457
6467
|
contentClassName: cn(
|
|
6458
6468
|
"p-0",
|
|
6459
6469
|
"backdrop-blur-xl bg-popover/95 border-border/40 shadow-2xl",
|
|
6460
|
-
"rounded-2xl",
|
|
6470
|
+
"rounded-2xl md:rounded-3xl",
|
|
6461
6471
|
"max-w-[calc(100vw-1rem)] max-h-[calc(100vh-6rem)] overflow-auto overscroll-contain",
|
|
6462
6472
|
size === "sm" ? "p-3" : "p-5",
|
|
6463
6473
|
"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-300"
|
|
@@ -6482,9 +6492,8 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
6482
6492
|
"div",
|
|
6483
6493
|
{
|
|
6484
6494
|
className: cn(
|
|
6485
|
-
"flex items-center justify-center
|
|
6486
|
-
|
|
6487
|
-
isOpen ? "bg-primary/15 text-primary" : "bg-muted/50 text-muted-foreground group-hover:bg-primary/10 group-hover:text-primary"
|
|
6495
|
+
"flex items-center justify-center transition-colors duration-300",
|
|
6496
|
+
isOpen ? "text-primary" : "text-muted-foreground group-hover:text-primary"
|
|
6488
6497
|
),
|
|
6489
6498
|
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") })
|
|
6490
6499
|
}
|
|
@@ -7558,6 +7567,8 @@ function TimePicker({
|
|
|
7558
7567
|
showPresets = false,
|
|
7559
7568
|
allowManualInput = false,
|
|
7560
7569
|
customPresets = [],
|
|
7570
|
+
min,
|
|
7571
|
+
max,
|
|
7561
7572
|
minTime,
|
|
7562
7573
|
maxTime,
|
|
7563
7574
|
disabledTimes,
|
|
@@ -7594,37 +7605,65 @@ function TimePicker({
|
|
|
7594
7605
|
},
|
|
7595
7606
|
[disabledTimes]
|
|
7596
7607
|
);
|
|
7608
|
+
const resolvedMinTime = minTime ?? min;
|
|
7609
|
+
const resolvedMaxTime = maxTime ?? max;
|
|
7610
|
+
const toSeconds = React25.useCallback(
|
|
7611
|
+
(p) => {
|
|
7612
|
+
let h = p.h;
|
|
7613
|
+
if (format === "12") {
|
|
7614
|
+
const period = p.p ?? (h >= 12 ? "PM" : "AM");
|
|
7615
|
+
const base = h % 12;
|
|
7616
|
+
h = period === "PM" ? base + 12 : base;
|
|
7617
|
+
}
|
|
7618
|
+
return h * 3600 + p.m * 60 + (includeSeconds ? p.s : 0);
|
|
7619
|
+
},
|
|
7620
|
+
[format, includeSeconds]
|
|
7621
|
+
);
|
|
7597
7622
|
const isTimeInRange = React25.useCallback(
|
|
7598
7623
|
(timeStr) => {
|
|
7599
|
-
if (!
|
|
7624
|
+
if (!resolvedMinTime && !resolvedMaxTime) return true;
|
|
7600
7625
|
const parsed = parseTime(timeStr, format, includeSeconds);
|
|
7601
7626
|
if (!parsed) return true;
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
const minMinutes = min.h * 60 + min.m;
|
|
7607
|
-
if (currentMinutes < minMinutes) return false;
|
|
7608
|
-
}
|
|
7627
|
+
const current = toSeconds(parsed);
|
|
7628
|
+
if (resolvedMinTime) {
|
|
7629
|
+
const minParsed = parseTime(resolvedMinTime, format, includeSeconds);
|
|
7630
|
+
if (minParsed && current < toSeconds(minParsed)) return false;
|
|
7609
7631
|
}
|
|
7610
|
-
if (
|
|
7611
|
-
const
|
|
7612
|
-
if (
|
|
7613
|
-
const currentMinutes = parsed.h * 60 + parsed.m;
|
|
7614
|
-
const maxMinutes = max.h * 60 + max.m;
|
|
7615
|
-
if (currentMinutes > maxMinutes) return false;
|
|
7616
|
-
}
|
|
7632
|
+
if (resolvedMaxTime) {
|
|
7633
|
+
const maxParsed = parseTime(resolvedMaxTime, format, includeSeconds);
|
|
7634
|
+
if (maxParsed && current > toSeconds(maxParsed)) return false;
|
|
7617
7635
|
}
|
|
7618
7636
|
return true;
|
|
7619
7637
|
},
|
|
7620
|
-
[
|
|
7638
|
+
[format, includeSeconds, resolvedMaxTime, resolvedMinTime, toSeconds]
|
|
7639
|
+
);
|
|
7640
|
+
const canEmit = React25.useCallback(
|
|
7641
|
+
(next) => {
|
|
7642
|
+
const timeStr = next ? formatTime(next, format, includeSeconds) : void 0;
|
|
7643
|
+
if (!timeStr) return true;
|
|
7644
|
+
if (!isTimeInRange(timeStr)) return false;
|
|
7645
|
+
if (isTimeDisabled(timeStr)) return false;
|
|
7646
|
+
return true;
|
|
7647
|
+
},
|
|
7648
|
+
[format, includeSeconds, isTimeDisabled, isTimeInRange]
|
|
7649
|
+
);
|
|
7650
|
+
const emit = React25.useCallback(
|
|
7651
|
+
(next) => {
|
|
7652
|
+
const timeStr = next ? formatTime(next, format, includeSeconds) : void 0;
|
|
7653
|
+
if (!canEmit(next)) return;
|
|
7654
|
+
onChange?.(timeStr);
|
|
7655
|
+
},
|
|
7656
|
+
[canEmit, format, includeSeconds, onChange]
|
|
7657
|
+
);
|
|
7658
|
+
const tryUpdate = React25.useCallback(
|
|
7659
|
+
(next) => {
|
|
7660
|
+
if (!canEmit(next)) return false;
|
|
7661
|
+
setParts(next);
|
|
7662
|
+
emit(next);
|
|
7663
|
+
return true;
|
|
7664
|
+
},
|
|
7665
|
+
[canEmit, emit]
|
|
7621
7666
|
);
|
|
7622
|
-
const emit = (next) => {
|
|
7623
|
-
const timeStr = next ? formatTime(next, format, includeSeconds) : void 0;
|
|
7624
|
-
if (timeStr && !isTimeInRange(timeStr)) return;
|
|
7625
|
-
if (timeStr && isTimeDisabled(timeStr)) return;
|
|
7626
|
-
onChange?.(timeStr);
|
|
7627
|
-
};
|
|
7628
7667
|
const handleOpenChange = (newOpen) => {
|
|
7629
7668
|
setOpen(newOpen);
|
|
7630
7669
|
if (newOpen) {
|
|
@@ -7675,8 +7714,7 @@ function TimePicker({
|
|
|
7675
7714
|
if (e.key === "ArrowLeft") setFocusedColumn(includeSeconds ? "second" : "minute");
|
|
7676
7715
|
break;
|
|
7677
7716
|
}
|
|
7678
|
-
|
|
7679
|
-
emit(newParts);
|
|
7717
|
+
tryUpdate(newParts);
|
|
7680
7718
|
};
|
|
7681
7719
|
const setNow = () => {
|
|
7682
7720
|
const now2 = /* @__PURE__ */ new Date();
|
|
@@ -7689,8 +7727,7 @@ function TimePicker({
|
|
|
7689
7727
|
} else {
|
|
7690
7728
|
next = { h, m, s };
|
|
7691
7729
|
}
|
|
7692
|
-
|
|
7693
|
-
emit(next);
|
|
7730
|
+
tryUpdate(next);
|
|
7694
7731
|
};
|
|
7695
7732
|
const setPreset = (preset) => {
|
|
7696
7733
|
const { h, m, s } = PRESETS[preset];
|
|
@@ -7700,8 +7737,7 @@ function TimePicker({
|
|
|
7700
7737
|
} else {
|
|
7701
7738
|
next = { h, m, s };
|
|
7702
7739
|
}
|
|
7703
|
-
|
|
7704
|
-
emit(next);
|
|
7740
|
+
tryUpdate(next);
|
|
7705
7741
|
};
|
|
7706
7742
|
const handleManualInput = (input) => {
|
|
7707
7743
|
setManualInput(input);
|
|
@@ -7709,16 +7745,14 @@ function TimePicker({
|
|
|
7709
7745
|
if (parsed) {
|
|
7710
7746
|
const timeStr = formatTime(parsed, format, includeSeconds);
|
|
7711
7747
|
if (isTimeInRange(timeStr) && !isTimeDisabled(timeStr)) {
|
|
7712
|
-
|
|
7713
|
-
emit(parsed);
|
|
7748
|
+
tryUpdate(parsed);
|
|
7714
7749
|
}
|
|
7715
7750
|
}
|
|
7716
7751
|
};
|
|
7717
7752
|
const handleCustomPreset = (time) => {
|
|
7718
7753
|
const parsed = parseTime(time, format, includeSeconds);
|
|
7719
7754
|
if (parsed) {
|
|
7720
|
-
|
|
7721
|
-
emit(parsed);
|
|
7755
|
+
tryUpdate(parsed);
|
|
7722
7756
|
}
|
|
7723
7757
|
};
|
|
7724
7758
|
const hours = format === "24" ? Array.from({ length: 24 }, (_, i) => i) : Array.from({ length: 12 }, (_, i) => i + 1);
|
|
@@ -7839,8 +7873,7 @@ function TimePicker({
|
|
|
7839
7873
|
return period === "PM" ? base + 12 : base;
|
|
7840
7874
|
})();
|
|
7841
7875
|
const next = { ...parts, h: nextH, p: format === "12" ? period : parts.p };
|
|
7842
|
-
|
|
7843
|
-
emit(next);
|
|
7876
|
+
tryUpdate(next);
|
|
7844
7877
|
};
|
|
7845
7878
|
const timePickerContent = /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: panelSz.stackGap, children: [
|
|
7846
7879
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-center justify-center py-1", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn(panelSz.timeText, "font-bold tabular-nums tracking-wide text-foreground underline underline-offset-8 decoration-primary/60"), children: display }) }),
|
|
@@ -7946,8 +7979,7 @@ function TimePicker({
|
|
|
7946
7979
|
valueIndex: minuteIndex,
|
|
7947
7980
|
onSelect: (m) => {
|
|
7948
7981
|
const next = { ...parts, m };
|
|
7949
|
-
|
|
7950
|
-
emit(next);
|
|
7982
|
+
tryUpdate(next);
|
|
7951
7983
|
},
|
|
7952
7984
|
scrollRef: minuteScrollRef,
|
|
7953
7985
|
itemHeight,
|
|
@@ -7975,8 +8007,7 @@ function TimePicker({
|
|
|
7975
8007
|
valueIndex: secondIndex,
|
|
7976
8008
|
onSelect: (s) => {
|
|
7977
8009
|
const next = { ...parts, s };
|
|
7978
|
-
|
|
7979
|
-
emit(next);
|
|
8010
|
+
tryUpdate(next);
|
|
7980
8011
|
},
|
|
7981
8012
|
scrollRef: secondScrollRef,
|
|
7982
8013
|
itemHeight,
|
|
@@ -8029,8 +8060,7 @@ function TimePicker({
|
|
|
8029
8060
|
if (pVal === "AM" && hour >= 12) hour -= 12;
|
|
8030
8061
|
if (pVal === "PM" && hour < 12) hour += 12;
|
|
8031
8062
|
const next = { ...parts, p: pVal, h: hour };
|
|
8032
|
-
|
|
8033
|
-
emit(next);
|
|
8063
|
+
tryUpdate(next);
|
|
8034
8064
|
},
|
|
8035
8065
|
children: [
|
|
8036
8066
|
isSelected && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "absolute inset-0 bg-linear-to-tr from-white/20 to-transparent" }),
|
|
@@ -8104,7 +8134,13 @@ function TimePicker({
|
|
|
8104
8134
|
label,
|
|
8105
8135
|
required && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
8106
8136
|
] }) }),
|
|
8107
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8137
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8138
|
+
"div",
|
|
8139
|
+
{
|
|
8140
|
+
className: cn(panelSz.contentPadding, "rounded-2xl md:rounded-3xl border border-border/60 bg-card/95 backdrop-blur-sm shadow-xl", className),
|
|
8141
|
+
children: timePickerContent
|
|
8142
|
+
}
|
|
8143
|
+
)
|
|
8108
8144
|
] });
|
|
8109
8145
|
}
|
|
8110
8146
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "w-full", ...rest, children: [
|
|
@@ -8135,7 +8171,7 @@ function TimePicker({
|
|
|
8135
8171
|
contentWidth: matchTriggerWidth ? void 0 : contentWidth,
|
|
8136
8172
|
contentClassName: cn(
|
|
8137
8173
|
panelSz.contentPadding,
|
|
8138
|
-
"rounded-2xl border bg-popover/98 backdrop-blur-md shadow-2xl",
|
|
8174
|
+
"rounded-2xl md:rounded-3xl border bg-popover/98 backdrop-blur-md shadow-2xl",
|
|
8139
8175
|
error && "border-destructive/40",
|
|
8140
8176
|
success && "border-success/40",
|
|
8141
8177
|
!error && !success && "border-border/60",
|
|
@@ -8316,7 +8352,7 @@ var DateTimePicker = ({
|
|
|
8316
8352
|
}
|
|
8317
8353
|
),
|
|
8318
8354
|
contentClassName: cn(
|
|
8319
|
-
"w-auto p-0 rounded-2xl",
|
|
8355
|
+
"w-auto p-0 rounded-2xl md:rounded-3xl",
|
|
8320
8356
|
// Keep the popover usable on small viewports
|
|
8321
8357
|
"max-w-[calc(100vw-1rem)] max-h-[calc(100vh-6rem)] overflow-auto"
|
|
8322
8358
|
),
|
|
@@ -10926,7 +10962,7 @@ var MultiCombobox = ({
|
|
|
10926
10962
|
item.value
|
|
10927
10963
|
);
|
|
10928
10964
|
};
|
|
10929
|
-
const dropdownBody = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { "data-combobox-dropdown": true, "data-state": open ? "open" : "closed", className: "w-full", children: [
|
|
10965
|
+
const dropdownBody = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { "data-combobox-dropdown": true, "data-state": open ? "open" : "closed", className: "w-full rounded-2xl md:rounded-3xl overflow-hidden", children: [
|
|
10930
10966
|
value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "px-3 py-2 border-b border-border/40 flex items-center justify-between bg-muted/30", children: [
|
|
10931
10967
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "text-xs font-medium text-muted-foreground", children: [
|
|
10932
10968
|
value.length,
|
|
@@ -11030,7 +11066,7 @@ var MultiCombobox = ({
|
|
|
11030
11066
|
"aria-controls": listboxId,
|
|
11031
11067
|
"aria-invalid": !!error,
|
|
11032
11068
|
className: cn(
|
|
11033
|
-
"group flex w-full items-center gap-2 rounded-
|
|
11069
|
+
"group flex w-full items-center gap-2 rounded-full min-h-10 transition-all duration-200",
|
|
11034
11070
|
"px-3 py-2",
|
|
11035
11071
|
variantStyles6[variant],
|
|
11036
11072
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:border-primary",
|
|
@@ -11164,7 +11200,7 @@ var MultiCombobox = ({
|
|
|
11164
11200
|
placement: "bottom-start",
|
|
11165
11201
|
matchTriggerWidth: true,
|
|
11166
11202
|
className: "z-9999",
|
|
11167
|
-
contentClassName: "p-0",
|
|
11203
|
+
contentClassName: "p-0 overflow-hidden rounded-2xl md:rounded-3xl",
|
|
11168
11204
|
children: dropdownBody
|
|
11169
11205
|
}
|
|
11170
11206
|
),
|
|
@@ -12408,7 +12444,7 @@ function CategoryTreeSelect(props) {
|
|
|
12408
12444
|
// Modern trigger button styling
|
|
12409
12445
|
"group flex w-full items-center justify-between px-3 py-2.5",
|
|
12410
12446
|
"bg-background/80 backdrop-blur-sm border border-border/60",
|
|
12411
|
-
"rounded-
|
|
12447
|
+
"rounded-full h-11 text-sm",
|
|
12412
12448
|
"hover:bg-accent/10 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/5 hover:-translate-y-0.5",
|
|
12413
12449
|
"transition-all duration-300 ease-out",
|
|
12414
12450
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
@@ -12441,7 +12477,7 @@ function CategoryTreeSelect(props) {
|
|
|
12441
12477
|
{
|
|
12442
12478
|
className: cn(
|
|
12443
12479
|
"absolute z-20 mt-2 w-full max-h-80 overflow-auto",
|
|
12444
|
-
"rounded-2xl border border-border/40 bg-popover/95 text-popover-foreground",
|
|
12480
|
+
"rounded-2xl md:rounded-3xl overflow-hidden border border-border/40 bg-popover/95 text-popover-foreground",
|
|
12445
12481
|
"shadow-2xl backdrop-blur-xl",
|
|
12446
12482
|
"p-2",
|
|
12447
12483
|
"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-300"
|
|
@@ -14341,7 +14377,7 @@ function ColorPicker({
|
|
|
14341
14377
|
placement: "bottom-start",
|
|
14342
14378
|
matchTriggerWidth: variant === "minimal",
|
|
14343
14379
|
contentWidth: contentWidthByVariant[variant],
|
|
14344
|
-
contentClassName: cn("p-3 rounded-
|
|
14380
|
+
contentClassName: cn("p-3 rounded-2xl md:rounded-3xl border border-border bg-card shadow-lg", contentClassName),
|
|
14345
14381
|
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-3", children: [
|
|
14346
14382
|
variant !== "minimal" && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
14347
14383
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|