@firecms/ui 3.0.0-canary.211 → 3.0.0-canary.213
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/components/DateTimeField.d.ts +1 -1
- package/dist/components/MultiSelect.d.ts +1 -1
- package/dist/index.es.js +351 -316
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +351 -316
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/BooleanSwitch.tsx +6 -1
- package/src/components/BooleanSwitchWithLabel.tsx +5 -1
- package/src/components/DateTimeField.tsx +9 -5
- package/src/components/MultiSelect.tsx +15 -5
- package/src/components/TextField.tsx +5 -5
package/dist/index.es.js
CHANGED
@@ -720,7 +720,11 @@ const BooleanSwitch = React__default.forwardRef(function BooleanSwitch2({
|
|
720
720
|
} else {
|
721
721
|
onValueChange?.(!value);
|
722
722
|
}
|
723
|
-
}, className: cls(
|
723
|
+
}, className: cls({
|
724
|
+
"min-h-[32px]": size === "small",
|
725
|
+
"min-h-[48px]": size === "medium",
|
726
|
+
"min-h-[64px]": size === "large"
|
727
|
+
}, size === "small" ? "w-[38px] min-w-[38px]" : "w-[42px] min-w-[42px]", "outline-none rounded-full relative shadow-sm", value ? disabled ? "bg-white bg-opacity-54 dark:bg-surface-accent-950 border-surface-accent-100 dark:border-surface-accent-700 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700" : "ring-secondary ring-1 bg-secondary dark:bg-secondary" : "bg-white bg-opacity-54 dark:bg-surface-accent-900 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700", className), ...props, children: [
|
724
728
|
allowIndeterminate && (value === null || value === void 0) && /* @__PURE__ */ jsx("div", { className: cls("block rounded-full transition-transform duration-100 transform will-change-auto", disabled ? "bg-surface-accent-400 dark:bg-surface-accent-600" : "bg-surface-accent-400 dark:bg-surface-accent-600", {
|
725
729
|
"w-[21px] h-[10px]": size === "medium" || size === "large",
|
726
730
|
"w-[19px] h-[8px]": size === "small",
|
@@ -758,7 +762,11 @@ const BooleanSwitchWithLabel = function BooleanSwitchWithLabel2({
|
|
758
762
|
React__default.useEffect(() => {
|
759
763
|
}, []);
|
760
764
|
const focus = document.activeElement === refInput?.current || document.activeElement === ref?.current;
|
761
|
-
return /* @__PURE__ */ jsxs("div", { ref, onFocus, onBlur, tabIndex: -1, className: cls(!invisible && fieldBackgroundMixin, !invisible && (disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin), disabled ? "cursor-default" : "cursor-pointer", "rounded-md max-w-full justify-between box-border relative inline-flex items-center", !invisible && focus && !disabled ? focusedClasses : "", error ? "text-red-500 dark:text-red-600" : focus && !disabled ? "text-primary" : !disabled ? "text-text-primary dark:text-text-primary-dark" : "text-text-secondary dark:text-text-secondary-dark",
|
765
|
+
return /* @__PURE__ */ jsxs("div", { ref, onFocus, onBlur, tabIndex: -1, className: cls(!invisible && fieldBackgroundMixin, !invisible && (disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin), disabled ? "cursor-default" : "cursor-pointer", "rounded-md max-w-full justify-between box-border relative inline-flex items-center", !invisible && focus && !disabled ? focusedClasses : "", error ? "text-red-500 dark:text-red-600" : focus && !disabled ? "text-primary" : !disabled ? "text-text-primary dark:text-text-primary-dark" : "text-text-secondary dark:text-text-secondary-dark", {
|
766
|
+
"min-h-[28px]": size === "small",
|
767
|
+
"min-h-[42px]": size === "medium",
|
768
|
+
"min-h-[64px]": size === "large"
|
769
|
+
}, size === "small" ? "pl-2" : "pl-4", size === "small" ? "pr-4" : "pr-6", position === "end" ? "flex-row-reverse" : "flex-row", fullWidth ? "w-full" : "", className), onClick: disabled ? void 0 : (e) => {
|
762
770
|
if (props.allowIndeterminate) {
|
763
771
|
if (value === null || value === void 0) onValueChange?.(true);
|
764
772
|
else if (value) onValueChange?.(false);
|
@@ -27685,7 +27693,7 @@ function Typography(t0) {
|
|
27685
27693
|
return t15;
|
27686
27694
|
}
|
27687
27695
|
const DateTimeField = (t0) => {
|
27688
|
-
const $ = c(
|
27696
|
+
const $ = c(55);
|
27689
27697
|
const {
|
27690
27698
|
value,
|
27691
27699
|
label,
|
@@ -27759,161 +27767,170 @@ const DateTimeField = (t0) => {
|
|
27759
27767
|
}
|
27760
27768
|
const t6 = !invisible && fieldBackgroundMixin;
|
27761
27769
|
const t7 = disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin;
|
27762
|
-
const t8 = size === "
|
27763
|
-
const t9 = size === "
|
27764
|
-
|
27765
|
-
|
27766
|
-
|
27767
|
-
|
27768
|
-
"min-h-[
|
27770
|
+
const t8 = size === "small";
|
27771
|
+
const t9 = size === "medium";
|
27772
|
+
const t10 = size === "large";
|
27773
|
+
let t11;
|
27774
|
+
if ($[6] !== className || $[7] !== t10 || $[8] !== t6 || $[9] !== t7 || $[10] !== t8 || $[11] !== t9) {
|
27775
|
+
t11 = cls("rounded-md relative max-w-full", t6, t7, {
|
27776
|
+
"min-h-[28px]": t8,
|
27777
|
+
"min-h-[42px]": t9,
|
27778
|
+
"min-h-[64px]": t10
|
27769
27779
|
}, className);
|
27770
27780
|
$[6] = className;
|
27771
|
-
$[7] =
|
27772
|
-
$[8] =
|
27773
|
-
$[9] =
|
27774
|
-
$[10] =
|
27775
|
-
$[11] =
|
27781
|
+
$[7] = t10;
|
27782
|
+
$[8] = t6;
|
27783
|
+
$[9] = t7;
|
27784
|
+
$[10] = t8;
|
27785
|
+
$[11] = t9;
|
27786
|
+
$[12] = t11;
|
27776
27787
|
} else {
|
27777
|
-
|
27788
|
+
t11 = $[12];
|
27778
27789
|
}
|
27779
|
-
let
|
27780
|
-
if ($[
|
27781
|
-
|
27790
|
+
let t12;
|
27791
|
+
if ($[13] !== disabled) {
|
27792
|
+
t12 = () => {
|
27782
27793
|
if (!disabled) {
|
27783
27794
|
inputRef.current?.focus();
|
27784
27795
|
}
|
27785
27796
|
};
|
27786
|
-
$[
|
27787
|
-
$[
|
27797
|
+
$[13] = disabled;
|
27798
|
+
$[14] = t12;
|
27788
27799
|
} else {
|
27789
|
-
|
27800
|
+
t12 = $[14];
|
27790
27801
|
}
|
27791
|
-
let
|
27792
|
-
if ($[
|
27793
|
-
|
27794
|
-
$[
|
27795
|
-
$[
|
27796
|
-
$[
|
27797
|
-
$[
|
27798
|
-
$[
|
27799
|
-
} else {
|
27800
|
-
|
27801
|
-
}
|
27802
|
-
const
|
27803
|
-
const
|
27804
|
-
let t15;
|
27802
|
+
let t13;
|
27803
|
+
if ($[15] !== disabled || $[16] !== error || $[17] !== focused || $[18] !== label) {
|
27804
|
+
t13 = label && /* @__PURE__ */ jsx(InputLabel, { className: cls("absolute top-1 pointer-events-none", !error ? focused ? "text-primary" : "text-text-secondary dark:text-text-secondary-dark" : "text-red-500 dark:text-red-500", disabled ? "opacity-50" : ""), shrink: true, children: label });
|
27805
|
+
$[15] = disabled;
|
27806
|
+
$[16] = error;
|
27807
|
+
$[17] = focused;
|
27808
|
+
$[18] = label;
|
27809
|
+
$[19] = t13;
|
27810
|
+
} else {
|
27811
|
+
t13 = $[19];
|
27812
|
+
}
|
27813
|
+
const t14 = mode === "date_time" ? "datetime-local" : "date";
|
27814
|
+
const t15 = valueAsInputValue(value ?? null, mode);
|
27805
27815
|
let t16;
|
27806
|
-
|
27807
|
-
|
27808
|
-
t16 = () => setFocused(
|
27809
|
-
|
27816
|
+
let t17;
|
27817
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
27818
|
+
t16 = () => setFocused(true);
|
27819
|
+
t17 = () => setFocused(false);
|
27810
27820
|
$[20] = t16;
|
27821
|
+
$[21] = t17;
|
27811
27822
|
} else {
|
27812
|
-
t15 = $[19];
|
27813
27823
|
t16 = $[20];
|
27824
|
+
t17 = $[21];
|
27814
27825
|
}
|
27815
|
-
const
|
27816
|
-
const
|
27817
|
-
const
|
27818
|
-
const
|
27819
|
-
let t21;
|
27820
|
-
if ($[21] !== inputClassName || $[22] !== t17 || $[23] !== t18 || $[24] !== t19 || $[25] !== t20) {
|
27821
|
-
t21 = cls("w-full outline-none bg-transparent leading-normal text-base px-3", t17, "rounded-md", t18, t19, inputClassName, t20);
|
27822
|
-
$[21] = inputClassName;
|
27823
|
-
$[22] = t17;
|
27824
|
-
$[23] = t18;
|
27825
|
-
$[24] = t19;
|
27826
|
-
$[25] = t20;
|
27827
|
-
$[26] = t21;
|
27828
|
-
} else {
|
27829
|
-
t21 = $[26];
|
27830
|
-
}
|
27826
|
+
const t18 = clearable ? "pr-14" : "pr-12";
|
27827
|
+
const t19 = size === "small";
|
27828
|
+
const t20 = size === "medium";
|
27829
|
+
const t21 = size === "large";
|
27831
27830
|
let t22;
|
27832
|
-
if ($[
|
27833
|
-
t22 =
|
27834
|
-
|
27835
|
-
|
27836
|
-
|
27837
|
-
|
27838
|
-
$[
|
27839
|
-
$[
|
27831
|
+
if ($[22] !== disabled || $[23] !== inputClassName || $[24] !== label || $[25] !== t18 || $[26] !== t19 || $[27] !== t20 || $[28] !== t21) {
|
27832
|
+
t22 = cls("w-full outline-none bg-transparent leading-normal text-base px-3", t18, "rounded-md", {
|
27833
|
+
"min-h-[28px]": t19,
|
27834
|
+
"min-h-[42px]": t20,
|
27835
|
+
"min-h-[64px]": t21
|
27836
|
+
}, label ? "pt-8 pb-2" : "py-2", inputClassName, disabled && "border border-transparent outline-none opacity-50 dark:opacity-50 text-surface-accent-600 dark:text-surface-accent-500");
|
27837
|
+
$[22] = disabled;
|
27838
|
+
$[23] = inputClassName;
|
27839
|
+
$[24] = label;
|
27840
|
+
$[25] = t18;
|
27841
|
+
$[26] = t19;
|
27842
|
+
$[27] = t20;
|
27843
|
+
$[28] = t21;
|
27844
|
+
$[29] = t22;
|
27840
27845
|
} else {
|
27841
|
-
t22 = $[
|
27846
|
+
t22 = $[29];
|
27842
27847
|
}
|
27843
27848
|
let t23;
|
27844
|
-
if ($[33]
|
27845
|
-
t23 = (
|
27846
|
-
|
27847
|
-
|
27848
|
-
|
27849
|
-
$[33] =
|
27849
|
+
if ($[30] !== disabled || $[31] !== handleInputChange || $[32] !== t14 || $[33] !== t15 || $[34] !== t22) {
|
27850
|
+
t23 = /* @__PURE__ */ jsx("input", { ref: inputRef, type: t14, value: t15, onChange: handleInputChange, onFocus: t16, onBlur: t17, disabled, className: t22 });
|
27851
|
+
$[30] = disabled;
|
27852
|
+
$[31] = handleInputChange;
|
27853
|
+
$[32] = t14;
|
27854
|
+
$[33] = t15;
|
27855
|
+
$[34] = t22;
|
27856
|
+
$[35] = t23;
|
27850
27857
|
} else {
|
27851
|
-
t23 = $[
|
27858
|
+
t23 = $[35];
|
27852
27859
|
}
|
27853
27860
|
let t24;
|
27854
|
-
if ($[
|
27855
|
-
t24 =
|
27856
|
-
|
27861
|
+
if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
|
27862
|
+
t24 = (e_2) => {
|
27863
|
+
e_2.stopPropagation();
|
27864
|
+
inputRef.current?.showPicker();
|
27865
|
+
};
|
27866
|
+
$[36] = t24;
|
27857
27867
|
} else {
|
27858
|
-
t24 = $[
|
27868
|
+
t24 = $[36];
|
27859
27869
|
}
|
27860
27870
|
let t25;
|
27861
|
-
if ($[
|
27862
|
-
t25 =
|
27863
|
-
$[
|
27864
|
-
$[36] = handleClear;
|
27865
|
-
$[37] = value;
|
27866
|
-
$[38] = t25;
|
27871
|
+
if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
|
27872
|
+
t25 = /* @__PURE__ */ jsx(IconButton, { onClick: t24, className: "absolute right-3 top-1/2 transform -translate-y-1/2 !text-surface-accent-500", children: /* @__PURE__ */ jsx(CalendarMonthIcon, { color: "disabled" }) });
|
27873
|
+
$[37] = t25;
|
27867
27874
|
} else {
|
27868
|
-
t25 = $[
|
27875
|
+
t25 = $[37];
|
27869
27876
|
}
|
27870
27877
|
let t26;
|
27871
|
-
if ($[
|
27872
|
-
t26 = /* @__PURE__ */
|
27873
|
-
|
27874
|
-
|
27875
|
-
|
27876
|
-
|
27877
|
-
] });
|
27878
|
-
$[39] = style;
|
27879
|
-
$[40] = t10;
|
27880
|
-
$[41] = t11;
|
27881
|
-
$[42] = t12;
|
27882
|
-
$[43] = t22;
|
27883
|
-
$[44] = t25;
|
27884
|
-
$[45] = t26;
|
27878
|
+
if ($[38] !== clearable || $[39] !== handleClear || $[40] !== value) {
|
27879
|
+
t26 = clearable && value && /* @__PURE__ */ jsx(IconButton, { onClick: handleClear, className: "absolute right-14 top-1/2 transform -translate-y-1/2 text-surface-accent-400 ", children: /* @__PURE__ */ jsx(CloseIcon, {}) });
|
27880
|
+
$[38] = clearable;
|
27881
|
+
$[39] = handleClear;
|
27882
|
+
$[40] = value;
|
27883
|
+
$[41] = t26;
|
27885
27884
|
} else {
|
27886
|
-
t26 = $[
|
27885
|
+
t26 = $[41];
|
27887
27886
|
}
|
27888
27887
|
let t27;
|
27889
|
-
if ($[46] !==
|
27890
|
-
t27 =
|
27891
|
-
|
27892
|
-
|
27893
|
-
|
27894
|
-
|
27895
|
-
] })
|
27888
|
+
if ($[42] !== style || $[43] !== t11 || $[44] !== t12 || $[45] !== t13 || $[46] !== t23 || $[47] !== t26) {
|
27889
|
+
t27 = /* @__PURE__ */ jsxs("div", { className: t11, style, onClick: t12, children: [
|
27890
|
+
t13,
|
27891
|
+
t23,
|
27892
|
+
t25,
|
27893
|
+
t26
|
27896
27894
|
] });
|
27897
|
-
$[
|
27898
|
-
$[
|
27895
|
+
$[42] = style;
|
27896
|
+
$[43] = t11;
|
27897
|
+
$[44] = t12;
|
27898
|
+
$[45] = t13;
|
27899
|
+
$[46] = t23;
|
27900
|
+
$[47] = t26;
|
27899
27901
|
$[48] = t27;
|
27900
27902
|
} else {
|
27901
27903
|
t27 = $[48];
|
27902
27904
|
}
|
27903
27905
|
let t28;
|
27904
|
-
if ($[49] !==
|
27905
|
-
t28 = /* @__PURE__ */ jsxs(
|
27906
|
-
|
27907
|
-
|
27908
|
-
|
27906
|
+
if ($[49] !== invalidValue || $[50] !== value) {
|
27907
|
+
t28 = invalidValue && /* @__PURE__ */ jsxs("div", { className: "flex items-center m-2", children: [
|
27908
|
+
/* @__PURE__ */ jsx(ErrorIcon, { size: "small", color: "error" }),
|
27909
|
+
/* @__PURE__ */ jsxs("div", { className: "pl-2", children: [
|
27910
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", children: "Invalid date value for this field" }),
|
27911
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", children: `The provided value is: ${JSON.stringify(value)}` })
|
27912
|
+
] })
|
27909
27913
|
] });
|
27910
|
-
$[49] =
|
27911
|
-
$[50] =
|
27914
|
+
$[49] = invalidValue;
|
27915
|
+
$[50] = value;
|
27912
27916
|
$[51] = t28;
|
27913
27917
|
} else {
|
27914
27918
|
t28 = $[51];
|
27915
27919
|
}
|
27916
|
-
|
27920
|
+
let t29;
|
27921
|
+
if ($[52] !== t27 || $[53] !== t28) {
|
27922
|
+
t29 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
27923
|
+
t5,
|
27924
|
+
t27,
|
27925
|
+
t28
|
27926
|
+
] });
|
27927
|
+
$[52] = t27;
|
27928
|
+
$[53] = t28;
|
27929
|
+
$[54] = t29;
|
27930
|
+
} else {
|
27931
|
+
t29 = $[54];
|
27932
|
+
}
|
27933
|
+
return t29;
|
27917
27934
|
};
|
27918
27935
|
const inputStyles = `
|
27919
27936
|
/* Hide the default calendar icon in Chrome, Safari, Edge, Opera */
|
@@ -29623,91 +29640,92 @@ function SelectInputLabel(t0) {
|
|
29623
29640
|
}
|
29624
29641
|
const MultiSelectContext = React.createContext({});
|
29625
29642
|
const MultiSelect = React.forwardRef((t0, ref) => {
|
29626
|
-
const $ = c(
|
29643
|
+
const $ = c(101);
|
29627
29644
|
const {
|
29628
29645
|
value,
|
29629
|
-
size,
|
29646
|
+
size: t1,
|
29630
29647
|
label,
|
29631
29648
|
error,
|
29632
29649
|
onValueChange,
|
29633
29650
|
invisible,
|
29634
29651
|
disabled,
|
29635
29652
|
placeholder,
|
29636
|
-
modalPopover:
|
29637
|
-
includeClear:
|
29638
|
-
includeSelectAll:
|
29639
|
-
useChips:
|
29653
|
+
modalPopover: t2,
|
29654
|
+
includeClear: t3,
|
29655
|
+
includeSelectAll: t4,
|
29656
|
+
useChips: t5,
|
29640
29657
|
className,
|
29641
29658
|
children,
|
29642
29659
|
renderValues,
|
29643
29660
|
open,
|
29644
29661
|
onOpenChange
|
29645
29662
|
} = t0;
|
29646
|
-
const
|
29647
|
-
const
|
29648
|
-
const
|
29649
|
-
const
|
29663
|
+
const size = t1 === void 0 ? "large" : t1;
|
29664
|
+
const modalPopover = t2 === void 0 ? true : t2;
|
29665
|
+
const includeClear = t3 === void 0 ? true : t3;
|
29666
|
+
const includeSelectAll = t4 === void 0 ? true : t4;
|
29667
|
+
const useChips = t5 === void 0 ? true : t5;
|
29650
29668
|
const [isPopoverOpen, setIsPopoverOpen] = React.useState(open ?? false);
|
29651
|
-
let
|
29669
|
+
let t6;
|
29652
29670
|
if ($[0] !== value) {
|
29653
|
-
|
29671
|
+
t6 = value ?? [];
|
29654
29672
|
$[0] = value;
|
29655
|
-
$[1] =
|
29673
|
+
$[1] = t6;
|
29656
29674
|
} else {
|
29657
|
-
|
29675
|
+
t6 = $[1];
|
29658
29676
|
}
|
29659
|
-
const [selectedValues, setSelectedValues] = React.useState(
|
29660
|
-
let
|
29677
|
+
const [selectedValues, setSelectedValues] = React.useState(t6);
|
29678
|
+
let t7;
|
29661
29679
|
if ($[2] !== onOpenChange) {
|
29662
|
-
|
29680
|
+
t7 = (open_0) => {
|
29663
29681
|
setIsPopoverOpen(open_0);
|
29664
29682
|
onOpenChange?.(open_0);
|
29665
29683
|
};
|
29666
29684
|
$[2] = onOpenChange;
|
29667
|
-
$[3] =
|
29685
|
+
$[3] = t7;
|
29668
29686
|
} else {
|
29669
|
-
|
29687
|
+
t7 = $[3];
|
29670
29688
|
}
|
29671
|
-
const onPopoverOpenChange =
|
29672
|
-
let t7;
|
29689
|
+
const onPopoverOpenChange = t7;
|
29673
29690
|
let t8;
|
29691
|
+
let t9;
|
29674
29692
|
if ($[4] !== open) {
|
29675
|
-
|
29693
|
+
t8 = () => {
|
29676
29694
|
setIsPopoverOpen(open ?? false);
|
29677
29695
|
};
|
29678
|
-
|
29696
|
+
t9 = [open];
|
29679
29697
|
$[4] = open;
|
29680
|
-
$[5] =
|
29681
|
-
$[6] =
|
29698
|
+
$[5] = t8;
|
29699
|
+
$[6] = t9;
|
29682
29700
|
} else {
|
29683
|
-
|
29684
|
-
|
29701
|
+
t8 = $[5];
|
29702
|
+
t9 = $[6];
|
29685
29703
|
}
|
29686
|
-
useEffect(
|
29687
|
-
let
|
29704
|
+
useEffect(t8, t9);
|
29705
|
+
let t10;
|
29688
29706
|
if ($[7] !== children) {
|
29689
|
-
|
29707
|
+
t10 = children ? Children.map(children, _temp$1).filter(Boolean) : [];
|
29690
29708
|
$[7] = children;
|
29691
|
-
$[8] =
|
29709
|
+
$[8] = t10;
|
29692
29710
|
} else {
|
29693
|
-
|
29711
|
+
t10 = $[8];
|
29694
29712
|
}
|
29695
|
-
const allValues =
|
29696
|
-
let t10;
|
29713
|
+
const allValues = t10;
|
29697
29714
|
let t11;
|
29715
|
+
let t12;
|
29698
29716
|
if ($[9] !== value) {
|
29699
|
-
|
29717
|
+
t11 = () => {
|
29700
29718
|
setSelectedValues(value ?? []);
|
29701
29719
|
};
|
29702
|
-
|
29720
|
+
t12 = [value];
|
29703
29721
|
$[9] = value;
|
29704
|
-
$[10] =
|
29705
|
-
$[11] =
|
29722
|
+
$[10] = t11;
|
29723
|
+
$[11] = t12;
|
29706
29724
|
} else {
|
29707
|
-
|
29708
|
-
|
29725
|
+
t11 = $[10];
|
29726
|
+
t12 = $[11];
|
29709
29727
|
}
|
29710
|
-
React.useEffect(
|
29728
|
+
React.useEffect(t11, t12);
|
29711
29729
|
let onItemClick;
|
29712
29730
|
let updateValues;
|
29713
29731
|
if ($[12] !== onValueChange || $[13] !== selectedValues) {
|
@@ -29732,9 +29750,9 @@ const MultiSelect = React.forwardRef((t0, ref) => {
|
|
29732
29750
|
onItemClick = $[14];
|
29733
29751
|
updateValues = $[15];
|
29734
29752
|
}
|
29735
|
-
let
|
29753
|
+
let t13;
|
29736
29754
|
if ($[16] !== onPopoverOpenChange || $[17] !== selectedValues || $[18] !== updateValues) {
|
29737
|
-
|
29755
|
+
t13 = (event) => {
|
29738
29756
|
if (event.key === "Enter") {
|
29739
29757
|
onPopoverOpenChange(true);
|
29740
29758
|
} else {
|
@@ -29748,50 +29766,50 @@ const MultiSelect = React.forwardRef((t0, ref) => {
|
|
29748
29766
|
$[16] = onPopoverOpenChange;
|
29749
29767
|
$[17] = selectedValues;
|
29750
29768
|
$[18] = updateValues;
|
29751
|
-
$[19] =
|
29769
|
+
$[19] = t13;
|
29752
29770
|
} else {
|
29753
|
-
|
29771
|
+
t13 = $[19];
|
29754
29772
|
}
|
29755
|
-
const handleInputKeyDown =
|
29756
|
-
let
|
29773
|
+
const handleInputKeyDown = t13;
|
29774
|
+
let t14;
|
29757
29775
|
if ($[20] !== selectedValues || $[21] !== updateValues) {
|
29758
|
-
|
29776
|
+
t14 = (value_0) => {
|
29759
29777
|
const newSelectedValues_1 = selectedValues.some((v_2) => String(v_2) === String(value_0)) ? selectedValues.filter((v_1) => String(v_1) !== String(value_0)) : [...selectedValues, value_0];
|
29760
29778
|
updateValues(newSelectedValues_1);
|
29761
29779
|
};
|
29762
29780
|
$[20] = selectedValues;
|
29763
29781
|
$[21] = updateValues;
|
29764
|
-
$[22] =
|
29782
|
+
$[22] = t14;
|
29765
29783
|
} else {
|
29766
|
-
|
29784
|
+
t14 = $[22];
|
29767
29785
|
}
|
29768
|
-
const toggleOption =
|
29769
|
-
let
|
29786
|
+
const toggleOption = t14;
|
29787
|
+
let t15;
|
29770
29788
|
if ($[23] !== updateValues) {
|
29771
|
-
|
29789
|
+
t15 = () => {
|
29772
29790
|
updateValues([]);
|
29773
29791
|
};
|
29774
29792
|
$[23] = updateValues;
|
29775
|
-
$[24] =
|
29793
|
+
$[24] = t15;
|
29776
29794
|
} else {
|
29777
|
-
|
29795
|
+
t15 = $[24];
|
29778
29796
|
}
|
29779
|
-
const handleClear =
|
29780
|
-
let
|
29797
|
+
const handleClear = t15;
|
29798
|
+
let t16;
|
29781
29799
|
if ($[25] !== isPopoverOpen || $[26] !== onPopoverOpenChange) {
|
29782
|
-
|
29800
|
+
t16 = () => {
|
29783
29801
|
onPopoverOpenChange(!isPopoverOpen);
|
29784
29802
|
};
|
29785
29803
|
$[25] = isPopoverOpen;
|
29786
29804
|
$[26] = onPopoverOpenChange;
|
29787
|
-
$[27] =
|
29805
|
+
$[27] = t16;
|
29788
29806
|
} else {
|
29789
|
-
|
29807
|
+
t16 = $[27];
|
29790
29808
|
}
|
29791
|
-
const handleTogglePopover =
|
29792
|
-
let
|
29809
|
+
const handleTogglePopover = t16;
|
29810
|
+
let t17;
|
29793
29811
|
if ($[28] !== allValues || $[29] !== handleClear || $[30] !== onPopoverOpenChange || $[31] !== selectedValues.length || $[32] !== updateValues) {
|
29794
|
-
|
29812
|
+
t17 = () => {
|
29795
29813
|
if (selectedValues.length === allValues.length) {
|
29796
29814
|
handleClear();
|
29797
29815
|
} else {
|
@@ -29804,55 +29822,68 @@ const MultiSelect = React.forwardRef((t0, ref) => {
|
|
29804
29822
|
$[30] = onPopoverOpenChange;
|
29805
29823
|
$[31] = selectedValues.length;
|
29806
29824
|
$[32] = updateValues;
|
29807
|
-
$[33] =
|
29825
|
+
$[33] = t17;
|
29808
29826
|
} else {
|
29809
|
-
|
29827
|
+
t17 = $[33];
|
29810
29828
|
}
|
29811
|
-
const toggleAll =
|
29829
|
+
const toggleAll = t17;
|
29812
29830
|
useInjectStyles("MultiSelect", `
|
29813
29831
|
[cmdk-group] {
|
29814
29832
|
max-height: 45vh;
|
29815
29833
|
overflow-y: auto;
|
29816
29834
|
// width: 400px;
|
29817
29835
|
} `);
|
29818
|
-
let
|
29836
|
+
let t18;
|
29819
29837
|
if ($[34] !== onItemClick || $[35] !== selectedValues) {
|
29820
|
-
|
29838
|
+
t18 = {
|
29821
29839
|
fieldValue: selectedValues,
|
29822
29840
|
onItemClick
|
29823
29841
|
};
|
29824
29842
|
$[34] = onItemClick;
|
29825
29843
|
$[35] = selectedValues;
|
29826
|
-
$[36] =
|
29844
|
+
$[36] = t18;
|
29827
29845
|
} else {
|
29828
|
-
|
29846
|
+
t18 = $[36];
|
29829
29847
|
}
|
29830
|
-
let
|
29848
|
+
let t19;
|
29831
29849
|
if ($[37] !== error || $[38] !== label) {
|
29832
|
-
|
29850
|
+
t19 = typeof label === "string" ? /* @__PURE__ */ jsx(SelectInputLabel, { error, children: label }) : label;
|
29833
29851
|
$[37] = error;
|
29834
29852
|
$[38] = label;
|
29835
|
-
$[39] =
|
29853
|
+
$[39] = t19;
|
29836
29854
|
} else {
|
29837
|
-
|
29855
|
+
t19 = $[39];
|
29838
29856
|
}
|
29839
|
-
const
|
29840
|
-
const
|
29841
|
-
const
|
29842
|
-
let
|
29843
|
-
if ($[40] !== className || $[41] !==
|
29844
|
-
|
29857
|
+
const t20 = size === "small";
|
29858
|
+
const t21 = size === "medium";
|
29859
|
+
const t22 = size === "large";
|
29860
|
+
let t23;
|
29861
|
+
if ($[40] !== className || $[41] !== disabled || $[42] !== invisible || $[43] !== size || $[44] !== t20 || $[45] !== t21 || $[46] !== t22) {
|
29862
|
+
t23 = cls({
|
29863
|
+
"min-h-[28px]": t20,
|
29864
|
+
"min-h-[42px]": t21,
|
29865
|
+
"min-h-[64px]": t22
|
29866
|
+
}, {
|
29867
|
+
"py-1": size === "small",
|
29868
|
+
"py-2": size === "medium" || size === "large"
|
29869
|
+
}, {
|
29870
|
+
"px-2": size === "small",
|
29871
|
+
"px-4": size === "medium" || size === "large"
|
29872
|
+
}, "select-none rounded-md text-sm", invisible ? fieldBackgroundInvisibleMixin : fieldBackgroundMixin, disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin, "relative flex items-center", className);
|
29845
29873
|
$[40] = className;
|
29846
|
-
$[41] =
|
29847
|
-
$[42] =
|
29848
|
-
$[43] =
|
29849
|
-
$[44] =
|
29874
|
+
$[41] = disabled;
|
29875
|
+
$[42] = invisible;
|
29876
|
+
$[43] = size;
|
29877
|
+
$[44] = t20;
|
29878
|
+
$[45] = t21;
|
29879
|
+
$[46] = t22;
|
29880
|
+
$[47] = t23;
|
29850
29881
|
} else {
|
29851
|
-
|
29882
|
+
t23 = $[47];
|
29852
29883
|
}
|
29853
|
-
let
|
29854
|
-
if ($[
|
29855
|
-
|
29884
|
+
let t24;
|
29885
|
+
if ($[48] !== children || $[49] !== handleClear || $[50] !== includeClear || $[51] !== isPopoverOpen || $[52] !== placeholder || $[53] !== renderValues || $[54] !== selectedValues || $[55] !== toggleOption || $[56] !== useChips) {
|
29886
|
+
t24 = selectedValues.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center w-full", children: [
|
29856
29887
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5 text-start", children: [
|
29857
29888
|
renderValues && renderValues(selectedValues),
|
29858
29889
|
!renderValues && selectedValues.map((value_1) => {
|
@@ -29881,175 +29912,175 @@ const MultiSelect = React.forwardRef((t0, ref) => {
|
|
29881
29912
|
/* @__PURE__ */ jsx("span", { className: "text-sm", children: placeholder }),
|
29882
29913
|
/* @__PURE__ */ jsx("div", { className: cls("px-2 h-full flex items-center"), children: /* @__PURE__ */ jsx(KeyboardArrowDownIcon, { size: "small", className: cls("transition", isPopoverOpen ? "rotate-180" : "") }) })
|
29883
29914
|
] });
|
29884
|
-
$[
|
29885
|
-
$[
|
29886
|
-
$[
|
29887
|
-
$[
|
29888
|
-
$[
|
29889
|
-
$[
|
29890
|
-
$[
|
29891
|
-
$[
|
29892
|
-
$[
|
29893
|
-
$[
|
29894
|
-
} else {
|
29895
|
-
|
29896
|
-
}
|
29897
|
-
let t24;
|
29898
|
-
if ($[55] !== handleTogglePopover || $[56] !== ref || $[57] !== t22 || $[58] !== t23) {
|
29899
|
-
t24 = /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { ref, onClick: handleTogglePopover, className: t22, children: t23 }) });
|
29900
|
-
$[55] = handleTogglePopover;
|
29901
|
-
$[56] = ref;
|
29902
|
-
$[57] = t22;
|
29903
|
-
$[58] = t23;
|
29904
|
-
$[59] = t24;
|
29905
|
-
} else {
|
29906
|
-
t24 = $[59];
|
29915
|
+
$[48] = children;
|
29916
|
+
$[49] = handleClear;
|
29917
|
+
$[50] = includeClear;
|
29918
|
+
$[51] = isPopoverOpen;
|
29919
|
+
$[52] = placeholder;
|
29920
|
+
$[53] = renderValues;
|
29921
|
+
$[54] = selectedValues;
|
29922
|
+
$[55] = toggleOption;
|
29923
|
+
$[56] = useChips;
|
29924
|
+
$[57] = t24;
|
29925
|
+
} else {
|
29926
|
+
t24 = $[57];
|
29907
29927
|
}
|
29908
29928
|
let t25;
|
29909
|
-
if ($[60]
|
29910
|
-
t25 =
|
29911
|
-
$[
|
29929
|
+
if ($[58] !== handleTogglePopover || $[59] !== ref || $[60] !== t23 || $[61] !== t24) {
|
29930
|
+
t25 = /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { ref, onClick: handleTogglePopover, className: t23, children: t24 }) });
|
29931
|
+
$[58] = handleTogglePopover;
|
29932
|
+
$[59] = ref;
|
29933
|
+
$[60] = t23;
|
29934
|
+
$[61] = t24;
|
29935
|
+
$[62] = t25;
|
29912
29936
|
} else {
|
29913
|
-
t25 = $[
|
29937
|
+
t25 = $[62];
|
29914
29938
|
}
|
29915
29939
|
let t26;
|
29916
|
-
if ($[
|
29917
|
-
t26 = (
|
29918
|
-
$[
|
29919
|
-
$[62] = t26;
|
29940
|
+
if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
|
29941
|
+
t26 = cls("z-50 relative overflow-hidden border bg-white dark:bg-surface-900 rounded-lg w-[400px]", defaultBorderMixin);
|
29942
|
+
$[63] = t26;
|
29920
29943
|
} else {
|
29921
|
-
t26 = $[
|
29944
|
+
t26 = $[63];
|
29922
29945
|
}
|
29923
29946
|
let t27;
|
29924
|
-
if ($[
|
29925
|
-
t27 =
|
29926
|
-
$[
|
29947
|
+
if ($[64] !== onPopoverOpenChange) {
|
29948
|
+
t27 = () => onPopoverOpenChange(false);
|
29949
|
+
$[64] = onPopoverOpenChange;
|
29950
|
+
$[65] = t27;
|
29927
29951
|
} else {
|
29928
|
-
t27 = $[
|
29952
|
+
t27 = $[65];
|
29929
29953
|
}
|
29930
29954
|
let t28;
|
29931
|
-
if ($[
|
29932
|
-
t28 =
|
29933
|
-
$[
|
29934
|
-
$[65] = t28;
|
29955
|
+
if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
|
29956
|
+
t28 = cls(focusedDisabled, "bg-transparent outline-none flex-1 h-full w-full m-4 flex-grow ");
|
29957
|
+
$[66] = t28;
|
29935
29958
|
} else {
|
29936
|
-
t28 = $[
|
29959
|
+
t28 = $[66];
|
29937
29960
|
}
|
29938
29961
|
let t29;
|
29939
|
-
if ($[
|
29940
|
-
t29 =
|
29941
|
-
$[
|
29942
|
-
$[67] = selectedValues.length;
|
29962
|
+
if ($[67] !== handleInputKeyDown) {
|
29963
|
+
t29 = /* @__PURE__ */ jsx(Command.Input, { className: t28, placeholder: "Search...", onKeyDown: handleInputKeyDown });
|
29964
|
+
$[67] = handleInputKeyDown;
|
29943
29965
|
$[68] = t29;
|
29944
29966
|
} else {
|
29945
29967
|
t29 = $[68];
|
29946
29968
|
}
|
29947
29969
|
let t30;
|
29948
|
-
if ($[69] !==
|
29949
|
-
t30 = /* @__PURE__ */
|
29950
|
-
|
29951
|
-
|
29952
|
-
] });
|
29953
|
-
$[69] = t28;
|
29954
|
-
$[70] = t29;
|
29970
|
+
if ($[69] !== handleClear || $[70] !== selectedValues.length) {
|
29971
|
+
t30 = selectedValues.length > 0 && /* @__PURE__ */ jsx("div", { onClick: handleClear, className: "text-sm justify-center cursor-pointer py-3 px-4 text-text-secondary dark:text-text-secondary-dark", children: "Clear" });
|
29972
|
+
$[69] = handleClear;
|
29973
|
+
$[70] = selectedValues.length;
|
29955
29974
|
$[71] = t30;
|
29956
29975
|
} else {
|
29957
29976
|
t30 = $[71];
|
29958
29977
|
}
|
29959
29978
|
let t31;
|
29960
|
-
if ($[72]
|
29961
|
-
t31 = /* @__PURE__ */
|
29962
|
-
|
29979
|
+
if ($[72] !== t29 || $[73] !== t30) {
|
29980
|
+
t31 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center", children: [
|
29981
|
+
t29,
|
29982
|
+
t30
|
29983
|
+
] });
|
29984
|
+
$[72] = t29;
|
29985
|
+
$[73] = t30;
|
29986
|
+
$[74] = t31;
|
29963
29987
|
} else {
|
29964
|
-
t31 = $[
|
29988
|
+
t31 = $[74];
|
29965
29989
|
}
|
29966
29990
|
let t32;
|
29967
|
-
if ($[
|
29968
|
-
t32 = /* @__PURE__ */ jsx(
|
29969
|
-
$[
|
29991
|
+
if ($[75] === Symbol.for("react.memo_cache_sentinel")) {
|
29992
|
+
t32 = /* @__PURE__ */ jsx(Separator, { orientation: "horizontal", className: "my-0" });
|
29993
|
+
$[75] = t32;
|
29970
29994
|
} else {
|
29971
|
-
t32 = $[
|
29995
|
+
t32 = $[75];
|
29972
29996
|
}
|
29973
29997
|
let t33;
|
29974
|
-
if ($[
|
29975
|
-
t33 =
|
29976
|
-
|
29977
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm text-text-secondary dark:text-text-secondary-dark", children: "(Select All)" })
|
29978
|
-
] }, "all");
|
29979
|
-
$[74] = allValues.length;
|
29980
|
-
$[75] = includeSelectAll;
|
29981
|
-
$[76] = selectedValues.length;
|
29982
|
-
$[77] = toggleAll;
|
29983
|
-
$[78] = t33;
|
29998
|
+
if ($[76] === Symbol.for("react.memo_cache_sentinel")) {
|
29999
|
+
t33 = /* @__PURE__ */ jsx(Command.Empty, { className: "px-4 py-2", children: "No results found." });
|
30000
|
+
$[76] = t33;
|
29984
30001
|
} else {
|
29985
|
-
t33 = $[
|
30002
|
+
t33 = $[76];
|
29986
30003
|
}
|
29987
30004
|
let t34;
|
29988
|
-
if ($[79] !==
|
29989
|
-
t34 = /* @__PURE__ */ jsxs(Command.
|
29990
|
-
|
29991
|
-
/* @__PURE__ */
|
29992
|
-
|
29993
|
-
|
29994
|
-
|
29995
|
-
]
|
29996
|
-
$[
|
29997
|
-
$[80] = t33;
|
30005
|
+
if ($[77] !== allValues.length || $[78] !== includeSelectAll || $[79] !== selectedValues.length || $[80] !== toggleAll) {
|
30006
|
+
t34 = includeSelectAll && /* @__PURE__ */ jsxs(Command.Item, { onSelect: toggleAll, className: cls("flex flex-row items-center gap-1.5", "cursor-pointer", "m-1", "ring-offset-transparent", "p-1 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-offset-2", "aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900", "cursor-pointer p-2 rounded aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900"), children: [
|
30007
|
+
/* @__PURE__ */ jsx(InnerCheckBox, { checked: selectedValues.length === allValues.length }),
|
30008
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-text-secondary dark:text-text-secondary-dark", children: "(Select All)" })
|
30009
|
+
] }, "all");
|
30010
|
+
$[77] = allValues.length;
|
30011
|
+
$[78] = includeSelectAll;
|
30012
|
+
$[79] = selectedValues.length;
|
30013
|
+
$[80] = toggleAll;
|
29998
30014
|
$[81] = t34;
|
29999
30015
|
} else {
|
30000
30016
|
t34 = $[81];
|
30001
30017
|
}
|
30002
30018
|
let t35;
|
30003
|
-
if ($[82] !==
|
30004
|
-
t35 = /* @__PURE__ */ jsxs(Command, { children: [
|
30005
|
-
|
30006
|
-
|
30007
|
-
|
30019
|
+
if ($[82] !== children || $[83] !== t34) {
|
30020
|
+
t35 = /* @__PURE__ */ jsxs(Command.List, { children: [
|
30021
|
+
t33,
|
30022
|
+
/* @__PURE__ */ jsxs(Command.Group, { children: [
|
30023
|
+
t34,
|
30024
|
+
children
|
30025
|
+
] })
|
30008
30026
|
] });
|
30009
|
-
$[82] =
|
30027
|
+
$[82] = children;
|
30010
30028
|
$[83] = t34;
|
30011
30029
|
$[84] = t35;
|
30012
30030
|
} else {
|
30013
30031
|
t35 = $[84];
|
30014
30032
|
}
|
30015
30033
|
let t36;
|
30016
|
-
if ($[85] !==
|
30017
|
-
t36 = /* @__PURE__ */
|
30018
|
-
|
30034
|
+
if ($[85] !== t31 || $[86] !== t35) {
|
30035
|
+
t36 = /* @__PURE__ */ jsxs(Command, { children: [
|
30036
|
+
t31,
|
30037
|
+
t32,
|
30038
|
+
t35
|
30039
|
+
] });
|
30040
|
+
$[85] = t31;
|
30019
30041
|
$[86] = t35;
|
30020
30042
|
$[87] = t36;
|
30021
30043
|
} else {
|
30022
30044
|
t36 = $[87];
|
30023
30045
|
}
|
30024
30046
|
let t37;
|
30025
|
-
if ($[88] !==
|
30026
|
-
t37 = /* @__PURE__ */
|
30027
|
-
|
30028
|
-
|
30029
|
-
]
|
30030
|
-
$[88] = isPopoverOpen;
|
30031
|
-
$[89] = modalPopover;
|
30032
|
-
$[90] = onPopoverOpenChange;
|
30033
|
-
$[91] = t24;
|
30034
|
-
$[92] = t36;
|
30035
|
-
$[93] = t37;
|
30047
|
+
if ($[88] !== t27 || $[89] !== t36) {
|
30048
|
+
t37 = /* @__PURE__ */ jsx(PopoverPrimitive.Content, { className: t26, align: "start", sideOffset: 8, onEscapeKeyDown: t27, children: t36 });
|
30049
|
+
$[88] = t27;
|
30050
|
+
$[89] = t36;
|
30051
|
+
$[90] = t37;
|
30036
30052
|
} else {
|
30037
|
-
t37 = $[
|
30053
|
+
t37 = $[90];
|
30038
30054
|
}
|
30039
30055
|
let t38;
|
30040
|
-
if ($[
|
30041
|
-
t38 = /* @__PURE__ */ jsxs(
|
30042
|
-
|
30056
|
+
if ($[91] !== isPopoverOpen || $[92] !== modalPopover || $[93] !== onPopoverOpenChange || $[94] !== t25 || $[95] !== t37) {
|
30057
|
+
t38 = /* @__PURE__ */ jsxs(PopoverPrimitive.Root, { open: isPopoverOpen, onOpenChange: onPopoverOpenChange, modal: modalPopover, children: [
|
30058
|
+
t25,
|
30043
30059
|
t37
|
30044
30060
|
] });
|
30045
|
-
$[
|
30046
|
-
$[
|
30047
|
-
$[
|
30048
|
-
$[
|
30061
|
+
$[91] = isPopoverOpen;
|
30062
|
+
$[92] = modalPopover;
|
30063
|
+
$[93] = onPopoverOpenChange;
|
30064
|
+
$[94] = t25;
|
30065
|
+
$[95] = t37;
|
30066
|
+
$[96] = t38;
|
30067
|
+
} else {
|
30068
|
+
t38 = $[96];
|
30069
|
+
}
|
30070
|
+
let t39;
|
30071
|
+
if ($[97] !== t18 || $[98] !== t19 || $[99] !== t38) {
|
30072
|
+
t39 = /* @__PURE__ */ jsxs(MultiSelectContext.Provider, { value: t18, children: [
|
30073
|
+
t19,
|
30074
|
+
t38
|
30075
|
+
] });
|
30076
|
+
$[97] = t18;
|
30077
|
+
$[98] = t19;
|
30078
|
+
$[99] = t38;
|
30079
|
+
$[100] = t39;
|
30049
30080
|
} else {
|
30050
|
-
|
30081
|
+
t39 = $[100];
|
30051
30082
|
}
|
30052
|
-
return
|
30083
|
+
return t39;
|
30053
30084
|
});
|
30054
30085
|
MultiSelect.displayName = "MultiSelect";
|
30055
30086
|
function MultiSelectItem(t0) {
|
@@ -31317,7 +31348,11 @@ const TextField = forwardRef(({
|
|
31317
31348
|
element?.removeEventListener("wheel", handleWheel);
|
31318
31349
|
};
|
31319
31350
|
}, [inputRef, type]);
|
31320
|
-
const input = multiline ? /* @__PURE__ */ jsx(TextareaAutosize, { ...inputProps, ref: inputRef, placeholder: focused || hasValue || !label ? placeholder : void 0, autoFocus, minRows, maxRows, value: value ?? "", onChange, style: inputStyle, className: cls(invisible ? focusedInvisibleMixin : "", "rounded-md resize-none w-full outline-none p-[32px] text-base bg-transparent min-h-[64px] px-3 pt-8", disabled && "outline-none opacity-50 text-surface-accent-600 dark:text-surface-accent-500", inputClassName) }) : /* @__PURE__ */ jsx("input", { ...inputProps, ref: inputRef, disabled, style: inputStyle, className: cls("w-full outline-none bg-transparent leading-normal px-3", "rounded-md", "focused:text-text-primary focused:dark:text-text-primary-dark", invisible ? focusedInvisibleMixin : "", disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
31351
|
+
const input = multiline ? /* @__PURE__ */ jsx(TextareaAutosize, { ...inputProps, ref: inputRef, placeholder: focused || hasValue || !label ? placeholder : void 0, autoFocus, minRows, maxRows, value: value ?? "", onChange, style: inputStyle, className: cls(invisible ? focusedInvisibleMixin : "", "rounded-md resize-none w-full outline-none p-[32px] text-base bg-transparent min-h-[64px] px-3 pt-8", disabled && "outline-none opacity-50 text-surface-accent-600 dark:text-surface-accent-500", inputClassName) }) : /* @__PURE__ */ jsx("input", { ...inputProps, ref: inputRef, disabled, style: inputStyle, className: cls("w-full outline-none bg-transparent leading-normal px-3", "rounded-md", "focused:text-text-primary focused:dark:text-text-primary-dark", invisible ? focusedInvisibleMixin : "", disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin, {
|
31352
|
+
"min-h-[28px]": size === "small",
|
31353
|
+
"min-h-[42px]": size === "medium",
|
31354
|
+
"min-h-[64px]": size === "large"
|
31355
|
+
}, label ? size === "large" ? "pt-8 pb-2" : "pt-4 pb-2" : "py-2", endAdornment ? "pr-10" : "pr-3", disabled && "outline-none opacity-50 dark:opacity-50 text-surface-accent-800 dark:text-white", inputClassName), placeholder: focused || hasValue || !label ? placeholder : void 0, autoFocus, onFocus: () => setFocused(true), onBlur: () => setFocused(false), type, value: type === "number" && Number.isNaN(value) ? "" : value ?? "", onChange });
|
31321
31356
|
return /* @__PURE__ */ jsxs("div", { ref, className: cls("rounded-md relative max-w-full", invisible ? fieldBackgroundInvisibleMixin : fieldBackgroundMixin, disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin, error ? "border border-red-500 dark:border-red-600" : "", {
|
31322
31357
|
"min-h-[32px]": !invisible && size === "small",
|
31323
31358
|
"min-h-[48px]": !invisible && size === "medium",
|