@underverse-ui/underverse 2.0.6 → 2.0.8
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/api-reference.json +1 -1
- package/dist/{chunk-OZH3EDGZ.js → chunk-JINSMREP.js} +2 -2
- package/dist/{chunk-JXE7JBQV.js → chunk-TETMVVUP.js} +3 -1
- package/dist/chunk-TETMVVUP.js.map +1 -0
- package/dist/{chunk-2UQ7H5GR.js → chunk-XE3RJHVX.js} +3 -3
- package/dist/index.cjs +229 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +254 -121
- package/dist/index.js.map +1 -1
- package/dist/{menu-bar-6HZDCX44.js → menu-bar-NFEW4FOJ.js} +3 -3
- package/dist/ueditor.js +2 -2
- package/package.json +3 -1
- package/dist/chunk-JXE7JBQV.js.map +0 -1
- /package/dist/{chunk-OZH3EDGZ.js.map → chunk-JINSMREP.js.map} +0 -0
- /package/dist/{chunk-2UQ7H5GR.js.map → chunk-XE3RJHVX.js.map} +0 -0
- /package/dist/{menu-bar-6HZDCX44.js.map → menu-bar-NFEW4FOJ.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -31,7 +31,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
33
|
// src/constants/form-control-size.ts
|
|
34
|
-
var formControlSizeStyles, formControlFixedClass, formControlValueClass;
|
|
34
|
+
var formControlSizeStyles, formControlLabelClass, formControlFixedClass, formControlValueClass;
|
|
35
35
|
var init_form_control_size = __esm({
|
|
36
36
|
"src/constants/form-control-size.ts"() {
|
|
37
37
|
"use strict";
|
|
@@ -82,6 +82,7 @@ var init_form_control_size = __esm({
|
|
|
82
82
|
tag: "h-8 max-w-36 px-3 text-sm leading-none"
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
+
formControlLabelClass = "font-medium";
|
|
85
86
|
formControlFixedClass = "min-h-0 overflow-hidden";
|
|
86
87
|
formControlValueClass = "max-h-full min-w-0 flex-1 truncate whitespace-nowrap";
|
|
87
88
|
}
|
|
@@ -10039,6 +10040,7 @@ var Card_default = Card;
|
|
|
10039
10040
|
var React5 = __toESM(require("react"), 1);
|
|
10040
10041
|
init_cn();
|
|
10041
10042
|
var import_lucide_react2 = require("lucide-react");
|
|
10043
|
+
init_form_control_size();
|
|
10042
10044
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
10043
10045
|
var Checkbox = React5.forwardRef(
|
|
10044
10046
|
({ className, label, labelClassName, containerClassName, checked, defaultChecked, onChange, ...props }, ref) => {
|
|
@@ -10064,7 +10066,7 @@ var Checkbox = React5.forwardRef(
|
|
|
10064
10066
|
children: isChecked && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Check, { className: "w-4 h-4" })
|
|
10065
10067
|
}
|
|
10066
10068
|
),
|
|
10067
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: cn("text-sm text-foreground", labelClassName), children: label })
|
|
10069
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: cn("text-sm text-foreground", formControlLabelClass, labelClassName), children: label })
|
|
10068
10070
|
] });
|
|
10069
10071
|
}
|
|
10070
10072
|
);
|
|
@@ -10355,6 +10357,7 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
10355
10357
|
value,
|
|
10356
10358
|
maxLength,
|
|
10357
10359
|
rightAddon,
|
|
10360
|
+
rightSection,
|
|
10358
10361
|
borderMode,
|
|
10359
10362
|
...rest
|
|
10360
10363
|
}, ref) => {
|
|
@@ -10454,7 +10457,8 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
10454
10457
|
className: cn(
|
|
10455
10458
|
// Label size follows input size
|
|
10456
10459
|
sizeStyles8[size].label,
|
|
10457
|
-
|
|
10460
|
+
formControlLabelClass,
|
|
10461
|
+
"transition-colors duration-200",
|
|
10458
10462
|
// default color and highlight while any descendant focused
|
|
10459
10463
|
disabled ? "text-muted-foreground" : cn("text-foreground group-focus-within:text-primary", success && "text-primary"),
|
|
10460
10464
|
errMsg && "text-destructive",
|
|
@@ -10525,7 +10529,7 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
10525
10529
|
radiusClass,
|
|
10526
10530
|
// Icon padding adjustments
|
|
10527
10531
|
LeftIcon && "pl-10",
|
|
10528
|
-
(RightIcon || showPasswordToggle || clearable || loading2 || success || errMsg) && "pr-10",
|
|
10532
|
+
(RightIcon || showPasswordToggle || clearable || loading2 || success || errMsg || rightSection) && "pr-10",
|
|
10529
10533
|
// Variant styles
|
|
10530
10534
|
variantStyles6[variant].container,
|
|
10531
10535
|
errMsg ? variantStyles6[variant].error : variantStyles6[variant].focus,
|
|
@@ -10538,45 +10542,57 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
10538
10542
|
...restInput
|
|
10539
10543
|
}
|
|
10540
10544
|
),
|
|
10541
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
|
|
10545
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
10546
|
+
"div",
|
|
10547
|
+
{
|
|
10548
|
+
className: cn(
|
|
10549
|
+
"absolute z-10 flex items-center gap-1",
|
|
10550
|
+
rightSection ? "inset-y-0 right-0" : "right-3 top-1/2 -translate-y-1/2"
|
|
10551
|
+
),
|
|
10552
|
+
children: [
|
|
10553
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn("flex items-center gap-1", rightSection && "px-1"), children: [
|
|
10554
|
+
getStatusIcon(),
|
|
10555
|
+
RightIcon && !loading2 && !success && !errMsg && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RightIcon, { className: cn("text-muted-foreground", sizeStyles8[size].icon) }),
|
|
10556
|
+
clearable && hasValue && !loading2 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
10557
|
+
"button",
|
|
10558
|
+
{
|
|
10559
|
+
type: "button",
|
|
10560
|
+
onClick: () => {
|
|
10561
|
+
if (onClear) return onClear();
|
|
10562
|
+
rest.onChange?.({ target: { value: "" } });
|
|
10563
|
+
},
|
|
10564
|
+
className: cn(
|
|
10565
|
+
"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors rounded-md",
|
|
10566
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
|
|
10567
|
+
"active:bg-accent active:text-accent-foreground",
|
|
10568
|
+
sizeStyles8[size].iconButton
|
|
10569
|
+
),
|
|
10570
|
+
tabIndex: 0,
|
|
10571
|
+
"aria-label": gi18n.clearInput ?? "Clear input",
|
|
10572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.X, { className: sizeStyles8[size].icon })
|
|
10573
|
+
}
|
|
10574
|
+
),
|
|
10575
|
+
showPasswordToggle && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
10576
|
+
"button",
|
|
10577
|
+
{
|
|
10578
|
+
type: "button",
|
|
10579
|
+
onClick: () => setShowPassword(!showPassword),
|
|
10580
|
+
className: cn(
|
|
10581
|
+
"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors rounded-full",
|
|
10582
|
+
"focus:outline-none focus-visible:ring-1 focus-visible:ring-ring/40",
|
|
10583
|
+
"active:bg-accent/50 active:text-accent-foreground",
|
|
10584
|
+
sizeStyles8[size].iconButton
|
|
10585
|
+
),
|
|
10586
|
+
tabIndex: 0,
|
|
10587
|
+
"aria-label": showPassword ? gi18n.hidePassword ?? "Hide password" : gi18n.showPassword ?? "Show password",
|
|
10588
|
+
children: showPassword ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.EyeOff, { className: sizeStyles8[size].icon }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.Eye, { className: sizeStyles8[size].icon })
|
|
10589
|
+
}
|
|
10590
|
+
)
|
|
10591
|
+
] }),
|
|
10592
|
+
rightSection
|
|
10593
|
+
]
|
|
10594
|
+
}
|
|
10595
|
+
),
|
|
10580
10596
|
rightAddon,
|
|
10581
10597
|
variant === "minimal" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
10582
10598
|
"div",
|
|
@@ -10611,27 +10627,128 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
10611
10627
|
}
|
|
10612
10628
|
);
|
|
10613
10629
|
Input.displayName = "Input";
|
|
10630
|
+
var searchButtonWidthStyles = {
|
|
10631
|
+
xs: "w-6",
|
|
10632
|
+
sm: "w-8",
|
|
10633
|
+
md: "w-10",
|
|
10634
|
+
lg: "w-12",
|
|
10635
|
+
xl: "w-14"
|
|
10636
|
+
};
|
|
10637
|
+
var searchButtonPaddingStyles = {
|
|
10638
|
+
xs: "pr-14",
|
|
10639
|
+
sm: "pr-18",
|
|
10640
|
+
md: "pr-20",
|
|
10641
|
+
lg: "pr-24",
|
|
10642
|
+
xl: "pr-28"
|
|
10643
|
+
};
|
|
10644
|
+
var searchButtonRadiusStyles = {
|
|
10645
|
+
none: "rounded-r-none",
|
|
10646
|
+
sm: "rounded-r-sm",
|
|
10647
|
+
md: "rounded-r-md",
|
|
10648
|
+
lg: "rounded-r-lg",
|
|
10649
|
+
xl: "rounded-r-xl",
|
|
10650
|
+
"2xl": "rounded-r-2xl",
|
|
10651
|
+
"3xl": "rounded-r-3xl",
|
|
10652
|
+
full: "rounded-r-full",
|
|
10653
|
+
daewoo: "rounded-r",
|
|
10654
|
+
infiniq: "rounded-r-full"
|
|
10655
|
+
};
|
|
10614
10656
|
var SearchInput = (0, import_react4.forwardRef)(
|
|
10615
|
-
({
|
|
10616
|
-
|
|
10657
|
+
({
|
|
10658
|
+
mode = "default",
|
|
10659
|
+
onSearch,
|
|
10660
|
+
searchDelay = 300,
|
|
10661
|
+
searchButtonLabel = "Search",
|
|
10662
|
+
placeholder = "Search\u2026",
|
|
10663
|
+
value,
|
|
10664
|
+
defaultValue,
|
|
10665
|
+
onChange,
|
|
10666
|
+
onClear,
|
|
10667
|
+
onKeyDown,
|
|
10668
|
+
clearable = true,
|
|
10669
|
+
size = "md",
|
|
10670
|
+
className,
|
|
10671
|
+
disabled,
|
|
10672
|
+
loading: loading2 = false,
|
|
10673
|
+
rightSection,
|
|
10674
|
+
borderMode,
|
|
10675
|
+
...props
|
|
10676
|
+
}, ref) => {
|
|
10677
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react4.useState)(defaultValue ?? "");
|
|
10678
|
+
const isControlled = value !== void 0;
|
|
10679
|
+
const searchValue = isControlled ? value : uncontrolledValue;
|
|
10680
|
+
const searchText = String(searchValue ?? "");
|
|
10681
|
+
const globalConfig = useUnderverseUIConfig();
|
|
10682
|
+
const resolvedBorderMode = borderMode ?? globalConfig.input?.borderMode ?? globalConfig.borderMode ?? "full";
|
|
10683
|
+
const searchButtonRadiusClass = searchButtonRadiusStyles[resolvedBorderMode] ?? getBorderRadiusClass(resolvedBorderMode);
|
|
10684
|
+
const triggerSearch = (0, import_react4.useCallback)(() => {
|
|
10685
|
+
onSearch?.(searchText);
|
|
10686
|
+
}, [onSearch, searchText]);
|
|
10617
10687
|
import_react4.default.useEffect(() => {
|
|
10618
|
-
if (!onSearch) return;
|
|
10688
|
+
if (!onSearch || mode !== "default") return;
|
|
10619
10689
|
const timer = setTimeout(() => {
|
|
10620
|
-
onSearch(
|
|
10690
|
+
onSearch(searchText);
|
|
10621
10691
|
}, searchDelay);
|
|
10622
10692
|
return () => clearTimeout(timer);
|
|
10623
|
-
}, [
|
|
10693
|
+
}, [mode, onSearch, searchDelay, searchText]);
|
|
10694
|
+
const searchButton = mode === "button" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
10695
|
+
"button",
|
|
10696
|
+
{
|
|
10697
|
+
type: "button",
|
|
10698
|
+
onClick: triggerSearch,
|
|
10699
|
+
disabled: disabled || loading2,
|
|
10700
|
+
className: cn(
|
|
10701
|
+
"flex h-full shrink-0 cursor-pointer items-center justify-center border-l border-border bg-transparent text-foreground",
|
|
10702
|
+
"transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
10703
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
10704
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",
|
|
10705
|
+
searchButtonWidthStyles[size],
|
|
10706
|
+
searchButtonRadiusClass
|
|
10707
|
+
),
|
|
10708
|
+
"aria-label": searchButtonLabel,
|
|
10709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.Search, { className: formControlSizeStyles[size].icon, "aria-hidden": "true" })
|
|
10710
|
+
}
|
|
10711
|
+
) : null;
|
|
10624
10712
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
10625
10713
|
Input,
|
|
10626
10714
|
{
|
|
10627
10715
|
ref,
|
|
10628
10716
|
type: "search",
|
|
10629
|
-
leftIcon: import_lucide_react3.Search,
|
|
10717
|
+
leftIcon: mode === "default" ? import_lucide_react3.Search : void 0,
|
|
10630
10718
|
placeholder,
|
|
10631
|
-
clearable
|
|
10719
|
+
clearable,
|
|
10632
10720
|
value: searchValue,
|
|
10633
|
-
onChange: (
|
|
10634
|
-
|
|
10721
|
+
onChange: (event) => {
|
|
10722
|
+
if (!isControlled) setUncontrolledValue(event.target.value);
|
|
10723
|
+
onChange?.(event);
|
|
10724
|
+
},
|
|
10725
|
+
onClear: () => {
|
|
10726
|
+
if (!isControlled) {
|
|
10727
|
+
setUncontrolledValue("");
|
|
10728
|
+
} else if (!onClear && onChange) {
|
|
10729
|
+
onChange({ target: { value: "" }, currentTarget: { value: "" } });
|
|
10730
|
+
}
|
|
10731
|
+
onClear?.();
|
|
10732
|
+
},
|
|
10733
|
+
onKeyDown: (event) => {
|
|
10734
|
+
onKeyDown?.(event);
|
|
10735
|
+
if (mode === "button" && event.key === "Enter" && !event.defaultPrevented && !event.nativeEvent.isComposing) {
|
|
10736
|
+
triggerSearch();
|
|
10737
|
+
}
|
|
10738
|
+
},
|
|
10739
|
+
size,
|
|
10740
|
+
className: cn(
|
|
10741
|
+
"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none",
|
|
10742
|
+
mode === "button" && searchButtonPaddingStyles[size],
|
|
10743
|
+
className
|
|
10744
|
+
),
|
|
10745
|
+
disabled,
|
|
10746
|
+
loading: loading2,
|
|
10747
|
+
rightSection: mode === "button" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
10748
|
+
rightSection,
|
|
10749
|
+
searchButton
|
|
10750
|
+
] }) : rightSection,
|
|
10751
|
+
borderMode,
|
|
10635
10752
|
...props
|
|
10636
10753
|
}
|
|
10637
10754
|
);
|
|
@@ -10872,7 +10989,8 @@ var Textarea = (0, import_react4.forwardRef)(
|
|
|
10872
10989
|
"label",
|
|
10873
10990
|
{
|
|
10874
10991
|
className: cn(
|
|
10875
|
-
"text-sm
|
|
10992
|
+
"text-sm transition-colors duration-200",
|
|
10993
|
+
formControlLabelClass,
|
|
10876
10994
|
isFocused ? "text-primary" : "text-foreground",
|
|
10877
10995
|
error && "text-destructive",
|
|
10878
10996
|
labelClassName
|
|
@@ -11837,7 +11955,8 @@ var TagInput = (0, import_react10.forwardRef)(
|
|
|
11837
11955
|
{
|
|
11838
11956
|
htmlFor: inputId,
|
|
11839
11957
|
className: cn(
|
|
11840
|
-
"block
|
|
11958
|
+
"block transition-colors duration-200",
|
|
11959
|
+
formControlLabelClass,
|
|
11841
11960
|
formControlSizeStyles[size].label,
|
|
11842
11961
|
disabled ? "text-muted-foreground" : isFocused ? "text-primary" : "text-foreground",
|
|
11843
11962
|
labelClassName
|
|
@@ -12012,6 +12131,7 @@ var TagInput_default = TagInput;
|
|
|
12012
12131
|
// src/components/Switch.tsx
|
|
12013
12132
|
var React17 = __toESM(require("react"), 1);
|
|
12014
12133
|
init_cn();
|
|
12134
|
+
init_form_control_size();
|
|
12015
12135
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
12016
12136
|
var Switch = ({
|
|
12017
12137
|
checked,
|
|
@@ -12112,7 +12232,7 @@ var Switch = ({
|
|
|
12112
12232
|
]
|
|
12113
12233
|
}
|
|
12114
12234
|
),
|
|
12115
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: cn("text-sm
|
|
12235
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: cn("text-sm text-foreground transition-colors", formControlLabelClass, disabled && "text-muted-foreground", labelClassName), children: label })
|
|
12116
12236
|
] });
|
|
12117
12237
|
};
|
|
12118
12238
|
Switch.displayName = "Switch";
|
|
@@ -12122,9 +12242,10 @@ var Switch_default = Switch;
|
|
|
12122
12242
|
var React18 = __toESM(require("react"), 1);
|
|
12123
12243
|
var import_class_variance_authority = require("class-variance-authority");
|
|
12124
12244
|
init_cn();
|
|
12245
|
+
init_form_control_size();
|
|
12125
12246
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
12126
12247
|
var labelVariants = (0, import_class_variance_authority.cva)(
|
|
12127
|
-
|
|
12248
|
+
`text-sm ${formControlLabelClass} leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`
|
|
12128
12249
|
);
|
|
12129
12250
|
var Label = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
12130
12251
|
"label",
|
|
@@ -14554,7 +14675,8 @@ var Combobox = ({
|
|
|
14554
14675
|
onClick: () => triggerRef.current?.focus(),
|
|
14555
14676
|
className: cn(
|
|
14556
14677
|
labelSize,
|
|
14557
|
-
|
|
14678
|
+
formControlLabelClass,
|
|
14679
|
+
"transition-colors duration-200",
|
|
14558
14680
|
disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary",
|
|
14559
14681
|
effectiveError && "text-destructive",
|
|
14560
14682
|
labelClassName
|
|
@@ -15835,7 +15957,8 @@ var DatePicker = ({
|
|
|
15835
15957
|
onClick: () => inputRef.current?.focus(),
|
|
15836
15958
|
className: cn(
|
|
15837
15959
|
labelSize,
|
|
15838
|
-
|
|
15960
|
+
formControlLabelClass,
|
|
15961
|
+
"transition-colors duration-300 cursor-pointer",
|
|
15839
15962
|
disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary hover:text-primary",
|
|
15840
15963
|
effectiveError && "text-destructive",
|
|
15841
15964
|
labelClassName
|
|
@@ -16594,7 +16717,8 @@ var DateRangePicker = ({
|
|
|
16594
16717
|
onClick: () => inputRef.current?.focus(),
|
|
16595
16718
|
className: cn(
|
|
16596
16719
|
size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm",
|
|
16597
|
-
|
|
16720
|
+
formControlLabelClass,
|
|
16721
|
+
"transition-colors duration-300",
|
|
16598
16722
|
disabled ? "text-muted-foreground cursor-not-allowed" : "text-foreground group-focus-within:text-primary hover:text-primary cursor-pointer",
|
|
16599
16723
|
effectiveError && "text-destructive",
|
|
16600
16724
|
labelClassName
|
|
@@ -17539,7 +17663,8 @@ var LunarDatePicker = ({
|
|
|
17539
17663
|
onClick: () => inputRef.current?.focus(),
|
|
17540
17664
|
className: cn(
|
|
17541
17665
|
labelSize,
|
|
17542
|
-
|
|
17666
|
+
formControlLabelClass,
|
|
17667
|
+
"transition-colors duration-300 cursor-pointer",
|
|
17543
17668
|
disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary hover:text-primary",
|
|
17544
17669
|
effectiveError && "text-destructive",
|
|
17545
17670
|
labelClassName
|
|
@@ -18168,7 +18293,8 @@ var LunarDateRangePicker = ({
|
|
|
18168
18293
|
onClick: () => setIsOpen(true),
|
|
18169
18294
|
className: cn(
|
|
18170
18295
|
size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm",
|
|
18171
|
-
|
|
18296
|
+
formControlLabelClass,
|
|
18297
|
+
"transition-colors duration-300",
|
|
18172
18298
|
disabled ? "text-muted-foreground cursor-not-allowed" : "text-foreground group-focus-within:text-primary hover:text-primary cursor-pointer",
|
|
18173
18299
|
effectiveError && "text-destructive",
|
|
18174
18300
|
labelClassName
|
|
@@ -19086,7 +19212,7 @@ function MonthYearPicker({
|
|
|
19086
19212
|
] });
|
|
19087
19213
|
if (variant === "inline") {
|
|
19088
19214
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("w-full", className), ...rest, children: [
|
|
19089
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("label", { className: cn(sz.label, "block mb-1.5
|
|
19215
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("label", { className: cn(sz.label, "block mb-1.5 text-foreground/80", formControlLabelClass, effectiveError && "text-destructive", labelClassName), children: [
|
|
19090
19216
|
label,
|
|
19091
19217
|
required && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-destructive ml-0.5", children: "*" })
|
|
19092
19218
|
] }),
|
|
@@ -19123,7 +19249,7 @@ function MonthYearPicker({
|
|
|
19123
19249
|
] });
|
|
19124
19250
|
}
|
|
19125
19251
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("w-full", className), ...rest, children: [
|
|
19126
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("label", { className: cn(sz.label, "block mb-1.5
|
|
19252
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("label", { className: cn(sz.label, "block mb-1.5 text-foreground/80", formControlLabelClass, effectiveError && "text-destructive", labelClassName), children: [
|
|
19127
19253
|
label,
|
|
19128
19254
|
required && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-destructive ml-0.5", children: "*" })
|
|
19129
19255
|
] }),
|
|
@@ -21005,7 +21131,7 @@ function TimePicker({
|
|
|
21005
21131
|
"label",
|
|
21006
21132
|
{
|
|
21007
21133
|
id: labelId,
|
|
21008
|
-
className: cn(sz.label,
|
|
21134
|
+
className: cn(sz.label, formControlLabelClass, disabled ? "text-muted-foreground" : "text-foreground", effectiveError && "text-destructive"),
|
|
21009
21135
|
children: [
|
|
21010
21136
|
label,
|
|
21011
21137
|
required && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
@@ -21053,7 +21179,7 @@ function TimePicker({
|
|
|
21053
21179
|
htmlFor: triggerId,
|
|
21054
21180
|
className: cn(
|
|
21055
21181
|
sz.label,
|
|
21056
|
-
|
|
21182
|
+
formControlLabelClass,
|
|
21057
21183
|
disabled ? "text-muted-foreground" : "text-foreground",
|
|
21058
21184
|
effectiveError && "text-destructive",
|
|
21059
21185
|
"cursor-pointer transition-colors hover:text-primary"
|
|
@@ -21298,7 +21424,13 @@ var DateTimePicker = ({
|
|
|
21298
21424
|
{
|
|
21299
21425
|
id: labelId,
|
|
21300
21426
|
htmlFor: triggerId,
|
|
21301
|
-
className: cn(
|
|
21427
|
+
className: cn(
|
|
21428
|
+
sizeStyles8[size].label,
|
|
21429
|
+
formControlLabelClass,
|
|
21430
|
+
"text-foreground flex items-center gap-1",
|
|
21431
|
+
effectiveError && "text-destructive",
|
|
21432
|
+
labelClassName
|
|
21433
|
+
),
|
|
21302
21434
|
children: [
|
|
21303
21435
|
label,
|
|
21304
21436
|
" ",
|
|
@@ -24931,7 +25063,8 @@ var MultiCombobox = ({
|
|
|
24931
25063
|
{
|
|
24932
25064
|
className: cn(
|
|
24933
25065
|
size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm",
|
|
24934
|
-
|
|
25066
|
+
formControlLabelClass,
|
|
25067
|
+
"transition-colors duration-200",
|
|
24935
25068
|
disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary",
|
|
24936
25069
|
effectiveError && "text-destructive",
|
|
24937
25070
|
labelClassName
|
|
@@ -24949,7 +25082,8 @@ var MultiCombobox = ({
|
|
|
24949
25082
|
onClick: () => triggerRef.current?.focus(),
|
|
24950
25083
|
className: cn(
|
|
24951
25084
|
labelSize,
|
|
24952
|
-
|
|
25085
|
+
formControlLabelClass,
|
|
25086
|
+
"transition-colors duration-200",
|
|
24953
25087
|
disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary",
|
|
24954
25088
|
effectiveError && "text-destructive",
|
|
24955
25089
|
labelClassName
|
|
@@ -25019,6 +25153,7 @@ var React47 = __toESM(require("react"), 1);
|
|
|
25019
25153
|
init_cn();
|
|
25020
25154
|
init_radius();
|
|
25021
25155
|
init_UnderverseConfigContext();
|
|
25156
|
+
init_form_control_size();
|
|
25022
25157
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
25023
25158
|
var RadioGroupContext = React47.createContext(void 0);
|
|
25024
25159
|
var useRadioGroup = () => {
|
|
@@ -25170,7 +25305,7 @@ var RadioGroupItem = React47.forwardRef(
|
|
|
25170
25305
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
25171
25306
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
25172
25307
|
Icon && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Icon, { className: "h-4 w-4 text-foreground" }),
|
|
25173
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { htmlFor: radioId, className: cn("
|
|
25308
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { htmlFor: radioId, className: cn(formControlLabelClass, "text-foreground cursor-pointer", sizeStyles7[size].text, labelClassName), children: label || children })
|
|
25174
25309
|
] }),
|
|
25175
25310
|
description && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-muted-foreground mt-1 text-xs", children: description })
|
|
25176
25311
|
] })
|
|
@@ -25205,7 +25340,8 @@ var RadioGroupItem = React47.forwardRef(
|
|
|
25205
25340
|
id: radioId,
|
|
25206
25341
|
disabled: isDisabled,
|
|
25207
25342
|
className: cn(
|
|
25208
|
-
"inline-flex items-center justify-center gap-2 border
|
|
25343
|
+
"inline-flex items-center justify-center gap-2 border transition-all duration-200",
|
|
25344
|
+
formControlLabelClass,
|
|
25209
25345
|
getBorderRadiusClass(borderMode ?? "lg"),
|
|
25210
25346
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
25211
25347
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
@@ -25263,7 +25399,8 @@ var RadioGroupItem = React47.forwardRef(
|
|
|
25263
25399
|
{
|
|
25264
25400
|
htmlFor: radioId,
|
|
25265
25401
|
className: cn(
|
|
25266
|
-
|
|
25402
|
+
formControlLabelClass,
|
|
25403
|
+
"text-foreground cursor-pointer flex-1",
|
|
25267
25404
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
25268
25405
|
sizeStyles7[size].text,
|
|
25269
25406
|
isDisabled && "cursor-not-allowed opacity-50",
|
|
@@ -25452,6 +25589,7 @@ var ToggleGroup = (props) => {
|
|
|
25452
25589
|
var React48 = __toESM(require("react"), 1);
|
|
25453
25590
|
init_cn();
|
|
25454
25591
|
init_GlobalI18nContext();
|
|
25592
|
+
init_form_control_size();
|
|
25455
25593
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
25456
25594
|
var SIZE_STYLES = {
|
|
25457
25595
|
sm: {
|
|
@@ -25670,7 +25808,7 @@ var Slider = React48.forwardRef(
|
|
|
25670
25808
|
}
|
|
25671
25809
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: cn("w-full space-y-2", containerClassName), children: [
|
|
25672
25810
|
(label || showValue) && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
25673
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("label", { className: cn("text-sm
|
|
25811
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("label", { className: cn("text-sm text-foreground", formControlLabelClass, labelClassName), children: label }),
|
|
25674
25812
|
showValue && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: cn("text-xs font-mono text-muted-foreground min-w-8 text-right", valueClassName), children: displayValue })
|
|
25675
25813
|
] }),
|
|
25676
25814
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
@@ -40563,7 +40701,7 @@ function surrogateLow(ch) {
|
|
|
40563
40701
|
function surrogateHigh(ch) {
|
|
40564
40702
|
return ch >= 55296 && ch < 56320;
|
|
40565
40703
|
}
|
|
40566
|
-
var
|
|
40704
|
+
var Fragment31 = class _Fragment {
|
|
40567
40705
|
/**
|
|
40568
40706
|
@internal
|
|
40569
40707
|
*/
|
|
@@ -40855,7 +40993,7 @@ var Fragment30 = class _Fragment {
|
|
|
40855
40993
|
throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
40856
40994
|
}
|
|
40857
40995
|
};
|
|
40858
|
-
|
|
40996
|
+
Fragment31.empty = new Fragment31([], 0);
|
|
40859
40997
|
var found = { index: 0, offset: 0 };
|
|
40860
40998
|
function retIndex(index, offset) {
|
|
40861
40999
|
found.index = index;
|
|
@@ -41080,7 +41218,7 @@ var Slice = class _Slice {
|
|
|
41080
41218
|
let openStart = json.openStart || 0, openEnd = json.openEnd || 0;
|
|
41081
41219
|
if (typeof openStart != "number" || typeof openEnd != "number")
|
|
41082
41220
|
throw new RangeError("Invalid input for Slice.fromJSON");
|
|
41083
|
-
return new _Slice(
|
|
41221
|
+
return new _Slice(Fragment31.fromJSON(schema, json.content), openStart, openEnd);
|
|
41084
41222
|
}
|
|
41085
41223
|
/**
|
|
41086
41224
|
Create a slice from a fragment by taking the maximum possible
|
|
@@ -41095,7 +41233,7 @@ var Slice = class _Slice {
|
|
|
41095
41233
|
return new _Slice(fragment, openStart, openEnd);
|
|
41096
41234
|
}
|
|
41097
41235
|
};
|
|
41098
|
-
Slice.empty = new Slice(
|
|
41236
|
+
Slice.empty = new Slice(Fragment31.empty, 0, 0);
|
|
41099
41237
|
function removeRange(content, from, to) {
|
|
41100
41238
|
let { index, offset } = content.findIndex(from), child = content.maybeChild(index);
|
|
41101
41239
|
let { index: indexTo, offset: offsetTo } = content.findIndex(to);
|
|
@@ -41194,7 +41332,7 @@ function replaceThreeWay($from, $start, $end, $to, depth) {
|
|
|
41194
41332
|
addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);
|
|
41195
41333
|
}
|
|
41196
41334
|
addRange($to, null, depth, content);
|
|
41197
|
-
return new
|
|
41335
|
+
return new Fragment31(content);
|
|
41198
41336
|
}
|
|
41199
41337
|
function replaceTwoWay($from, $to, depth) {
|
|
41200
41338
|
let content = [];
|
|
@@ -41204,13 +41342,13 @@ function replaceTwoWay($from, $to, depth) {
|
|
|
41204
41342
|
addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);
|
|
41205
41343
|
}
|
|
41206
41344
|
addRange($to, null, depth, content);
|
|
41207
|
-
return new
|
|
41345
|
+
return new Fragment31(content);
|
|
41208
41346
|
}
|
|
41209
41347
|
function prepareSliceForReplace(slice, $along) {
|
|
41210
41348
|
let extra = $along.depth - slice.openStart, parent = $along.node(extra);
|
|
41211
41349
|
let node = parent.copy(slice.content);
|
|
41212
41350
|
for (let i = extra - 1; i >= 0; i--)
|
|
41213
|
-
node = $along.node(i).copy(
|
|
41351
|
+
node = $along.node(i).copy(Fragment31.from(node));
|
|
41214
41352
|
return {
|
|
41215
41353
|
start: node.resolveNoCache(slice.openStart + extra),
|
|
41216
41354
|
end: node.resolveNoCache(node.content.size - slice.openEnd - extra)
|
|
@@ -41549,7 +41687,7 @@ var Node7 = class _Node {
|
|
|
41549
41687
|
this.type = type;
|
|
41550
41688
|
this.attrs = attrs;
|
|
41551
41689
|
this.marks = marks;
|
|
41552
|
-
this.content = content ||
|
|
41690
|
+
this.content = content || Fragment31.empty;
|
|
41553
41691
|
}
|
|
41554
41692
|
/**
|
|
41555
41693
|
The array of this node's child nodes.
|
|
@@ -41855,7 +41993,7 @@ var Node7 = class _Node {
|
|
|
41855
41993
|
can optionally pass `start` and `end` indices into the
|
|
41856
41994
|
replacement fragment.
|
|
41857
41995
|
*/
|
|
41858
|
-
canReplace(from, to, replacement =
|
|
41996
|
+
canReplace(from, to, replacement = Fragment31.empty, start = 0, end = replacement.childCount) {
|
|
41859
41997
|
let one = this.contentMatchAt(from).matchFragment(replacement, start, end);
|
|
41860
41998
|
let two = one && one.matchFragment(this.content, to);
|
|
41861
41999
|
if (!two || !two.validEnd)
|
|
@@ -41937,7 +42075,7 @@ var Node7 = class _Node {
|
|
|
41937
42075
|
throw new RangeError("Invalid text node in JSON");
|
|
41938
42076
|
return schema.text(json.text, marks);
|
|
41939
42077
|
}
|
|
41940
|
-
let content =
|
|
42078
|
+
let content = Fragment31.fromJSON(schema, json.content);
|
|
41941
42079
|
let node = schema.nodeType(json.type).create(json.attrs, content, marks);
|
|
41942
42080
|
node.type.checkAttrs(node.attrs);
|
|
41943
42081
|
return node;
|
|
@@ -42033,7 +42171,7 @@ var ContentMatch = class _ContentMatch {
|
|
|
42033
42171
|
function search(match, types) {
|
|
42034
42172
|
let finished = match.matchFragment(after, startIndex);
|
|
42035
42173
|
if (finished && (!toEnd || finished.validEnd))
|
|
42036
|
-
return
|
|
42174
|
+
return Fragment31.from(types.map((tp) => tp.createAndFill()));
|
|
42037
42175
|
for (let i = 0; i < match.next.length; i++) {
|
|
42038
42176
|
let { type, next } = match.next[i];
|
|
42039
42177
|
if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {
|
|
@@ -42601,7 +42739,7 @@ function mapFragment(fragment, f, parent) {
|
|
|
42601
42739
|
child = f(child, parent, i);
|
|
42602
42740
|
mapped.push(child);
|
|
42603
42741
|
}
|
|
42604
|
-
return
|
|
42742
|
+
return Fragment31.fromArray(mapped);
|
|
42605
42743
|
}
|
|
42606
42744
|
var AddMarkStep = class _AddMarkStep extends Step {
|
|
42607
42745
|
/**
|
|
@@ -42718,7 +42856,7 @@ var AddNodeMarkStep = class _AddNodeMarkStep extends Step {
|
|
|
42718
42856
|
if (!node)
|
|
42719
42857
|
return StepResult.fail("No node at mark step's position");
|
|
42720
42858
|
let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));
|
|
42721
|
-
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(
|
|
42859
|
+
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment31.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
42722
42860
|
}
|
|
42723
42861
|
invert(doc) {
|
|
42724
42862
|
let node = doc.nodeAt(this.pos);
|
|
@@ -42764,7 +42902,7 @@ var RemoveNodeMarkStep = class _RemoveNodeMarkStep extends Step {
|
|
|
42764
42902
|
if (!node)
|
|
42765
42903
|
return StepResult.fail("No node at mark step's position");
|
|
42766
42904
|
let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));
|
|
42767
|
-
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(
|
|
42905
|
+
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment31.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
42768
42906
|
}
|
|
42769
42907
|
invert(doc) {
|
|
42770
42908
|
let node = doc.nodeAt(this.pos);
|
|
@@ -42967,7 +43105,7 @@ var AttrStep = class _AttrStep extends Step {
|
|
|
42967
43105
|
attrs[name] = node.attrs[name];
|
|
42968
43106
|
attrs[this.attr] = this.value;
|
|
42969
43107
|
let updated = node.type.create(attrs, null, node.marks);
|
|
42970
|
-
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(
|
|
43108
|
+
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment31.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
42971
43109
|
}
|
|
42972
43110
|
getMap() {
|
|
42973
43111
|
return StepMap.empty;
|
|
@@ -43351,7 +43489,7 @@ var NodeSelection2 = class _NodeSelection extends Selection {
|
|
|
43351
43489
|
return new _NodeSelection($pos);
|
|
43352
43490
|
}
|
|
43353
43491
|
content() {
|
|
43354
|
-
return new Slice(
|
|
43492
|
+
return new Slice(Fragment31.from(this.node), 0, 0);
|
|
43355
43493
|
}
|
|
43356
43494
|
eq(other) {
|
|
43357
43495
|
return other instanceof _NodeSelection && other.anchor == this.anchor;
|
|
@@ -44079,10 +44217,10 @@ var CellSelection2 = class CellSelection3 extends Selection {
|
|
|
44079
44217
|
}
|
|
44080
44218
|
rowContent.push(cell);
|
|
44081
44219
|
}
|
|
44082
|
-
rows.push(table.child(row).copy(
|
|
44220
|
+
rows.push(table.child(row).copy(Fragment31.from(rowContent)));
|
|
44083
44221
|
}
|
|
44084
44222
|
const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
|
|
44085
|
-
return new Slice(
|
|
44223
|
+
return new Slice(Fragment31.from(fragment), 1, 1);
|
|
44086
44224
|
}
|
|
44087
44225
|
replace(tr, content = Slice.empty) {
|
|
44088
44226
|
const mapFrom = tr.steps.length, ranges = this.ranges;
|
|
@@ -44094,7 +44232,7 @@ var CellSelection2 = class CellSelection3 extends Selection {
|
|
|
44094
44232
|
if (sel) tr.setSelection(sel);
|
|
44095
44233
|
}
|
|
44096
44234
|
replaceWith(tr, node) {
|
|
44097
|
-
this.replace(tr, new Slice(
|
|
44235
|
+
this.replace(tr, new Slice(Fragment31.from(node), 0, 0));
|
|
44098
44236
|
}
|
|
44099
44237
|
forEachCell(f) {
|
|
44100
44238
|
const table = this.$anchorCell.node(-1);
|