@firecms/ui 3.0.0-canary.241 → 3.0.0-canary.244
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/Autocomplete.d.ts +4 -2
- package/dist/components/Select.d.ts +1 -0
- package/dist/index.es.js +167 -148
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +167 -148
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Autocomplete.tsx +10 -5
- package/src/components/MultiSelect.tsx +2 -3
- package/src/components/Select.tsx +44 -39
package/dist/index.umd.js
CHANGED
@@ -462,11 +462,12 @@
|
|
462
462
|
};
|
463
463
|
};
|
464
464
|
function Autocomplete(t0) {
|
465
|
-
const $ = reactCompilerRuntime.c(
|
465
|
+
const $ = reactCompilerRuntime.c(14);
|
466
466
|
const {
|
467
467
|
children,
|
468
468
|
open,
|
469
|
-
setOpen
|
469
|
+
setOpen,
|
470
|
+
className
|
470
471
|
} = t0;
|
471
472
|
const autocompleteRef = React.useRef(null);
|
472
473
|
let t1;
|
@@ -489,50 +490,61 @@
|
|
489
490
|
}
|
490
491
|
const t4 = open ? paperMixin : "";
|
491
492
|
let t5;
|
492
|
-
if ($[4] !== t4) {
|
493
|
-
t5 = cls(t4, "bg-surface-50 dark:bg-surface-900
|
494
|
-
$[4] =
|
495
|
-
$[5] =
|
493
|
+
if ($[4] !== className || $[5] !== t4) {
|
494
|
+
t5 = cls(t4, "bg-surface-50 dark:bg-surface-900", className);
|
495
|
+
$[4] = className;
|
496
|
+
$[5] = t4;
|
497
|
+
$[6] = t5;
|
496
498
|
} else {
|
497
|
-
t5 = $[
|
499
|
+
t5 = $[6];
|
498
500
|
}
|
499
501
|
let t6;
|
500
|
-
if ($[
|
502
|
+
if ($[7] !== children || $[8] !== t5) {
|
501
503
|
t6 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: autocompleteRef, className: t5, children });
|
502
|
-
$[
|
503
|
-
$[
|
504
|
-
$[
|
504
|
+
$[7] = children;
|
505
|
+
$[8] = t5;
|
506
|
+
$[9] = t6;
|
505
507
|
} else {
|
506
|
-
t6 = $[
|
508
|
+
t6 = $[9];
|
507
509
|
}
|
508
510
|
let t7;
|
509
|
-
if ($[
|
510
|
-
t7 = /* @__PURE__ */ jsxRuntime.jsx(Collapse, { in: open, duration:
|
511
|
-
$[
|
512
|
-
$[
|
513
|
-
$[
|
514
|
-
$[
|
511
|
+
if ($[10] !== open || $[11] !== t3 || $[12] !== t6) {
|
512
|
+
t7 = /* @__PURE__ */ jsxRuntime.jsx(Collapse, { in: open, duration: 30, className: t3, children: t6 });
|
513
|
+
$[10] = open;
|
514
|
+
$[11] = t3;
|
515
|
+
$[12] = t6;
|
516
|
+
$[13] = t7;
|
515
517
|
} else {
|
516
|
-
t7 = $[
|
518
|
+
t7 = $[13];
|
517
519
|
}
|
518
520
|
return t7;
|
519
521
|
}
|
520
522
|
function AutocompleteItem(t0) {
|
521
|
-
const $ = reactCompilerRuntime.c(
|
523
|
+
const $ = reactCompilerRuntime.c(6);
|
522
524
|
const {
|
523
525
|
children,
|
524
|
-
onClick
|
526
|
+
onClick,
|
527
|
+
className
|
525
528
|
} = t0;
|
526
529
|
let t1;
|
527
|
-
if ($[0] !==
|
528
|
-
t1 =
|
529
|
-
$[0] =
|
530
|
-
$[1] =
|
531
|
-
$[2] = t1;
|
530
|
+
if ($[0] !== className) {
|
531
|
+
t1 = cls("flex w-full items-center h-[48px] cursor-pointer hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800", className);
|
532
|
+
$[0] = className;
|
533
|
+
$[1] = t1;
|
532
534
|
} else {
|
533
|
-
t1 = $[
|
535
|
+
t1 = $[1];
|
534
536
|
}
|
535
|
-
|
537
|
+
let t2;
|
538
|
+
if ($[2] !== children || $[3] !== onClick || $[4] !== t1) {
|
539
|
+
t2 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t1, onClick, children });
|
540
|
+
$[2] = children;
|
541
|
+
$[3] = onClick;
|
542
|
+
$[4] = t1;
|
543
|
+
$[5] = t2;
|
544
|
+
} else {
|
545
|
+
t2 = $[5];
|
546
|
+
}
|
547
|
+
return t2;
|
536
548
|
}
|
537
549
|
const getSizeClasses = (size) => {
|
538
550
|
switch (size) {
|
@@ -29665,7 +29677,7 @@
|
|
29665
29677
|
}
|
29666
29678
|
const MultiSelectContext = React__namespace.createContext({});
|
29667
29679
|
const MultiSelect = React__namespace.forwardRef((t0, ref) => {
|
29668
|
-
const $ = reactCompilerRuntime.c(
|
29680
|
+
const $ = reactCompilerRuntime.c(103);
|
29669
29681
|
const {
|
29670
29682
|
value,
|
29671
29683
|
size: t1,
|
@@ -29910,7 +29922,7 @@
|
|
29910
29922
|
t24 = $[48];
|
29911
29923
|
}
|
29912
29924
|
let t25;
|
29913
|
-
if ($[49] !== children || $[50] !== handleClear || $[51] !== includeClear || $[52] !== isPopoverOpen || $[53] !== placeholder || $[54] !== renderValues || $[55] !== selectedValues || $[56] !==
|
29925
|
+
if ($[49] !== children || $[50] !== handleClear || $[51] !== includeClear || $[52] !== isPopoverOpen || $[53] !== placeholder || $[54] !== renderValues || $[55] !== selectedValues || $[56] !== size || $[57] !== toggleOption || $[58] !== useChips) {
|
29914
29926
|
t25 = selectedValues.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center w-full", children: [
|
29915
29927
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1.5 text-start", children: [
|
29916
29928
|
renderValues && renderValues(selectedValues),
|
@@ -29934,11 +29946,11 @@
|
|
29934
29946
|
event_1.stopPropagation();
|
29935
29947
|
handleClear();
|
29936
29948
|
} }),
|
29937
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cls("px-2 h-full flex items-center"), children: /* @__PURE__ */ jsxRuntime.jsx(KeyboardArrowDownIcon, { size: "small", className: cls("transition", isPopoverOpen ? "rotate-180" : "") }) })
|
29949
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cls("px-2 h-full flex items-center"), children: /* @__PURE__ */ jsxRuntime.jsx(KeyboardArrowDownIcon, { size: size === "large" ? "medium" : "small", className: cls("transition", isPopoverOpen ? "rotate-180" : "") }) })
|
29938
29950
|
] })
|
29939
29951
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between w-full mx-auto", children: [
|
29940
29952
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: placeholder }),
|
29941
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cls("px-2 h-full flex items-center"), children: /* @__PURE__ */ jsxRuntime.jsx(KeyboardArrowDownIcon, { size: "small", className: cls("transition", isPopoverOpen ? "rotate-180" : "") }) })
|
29953
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cls("px-2 h-full flex items-center"), children: /* @__PURE__ */ jsxRuntime.jsx(KeyboardArrowDownIcon, { size: size === "large" ? "medium" : "small", className: cls("transition", isPopoverOpen ? "rotate-180" : "") }) })
|
29942
29954
|
] });
|
29943
29955
|
$[49] = children;
|
29944
29956
|
$[50] = handleClear;
|
@@ -29947,104 +29959,105 @@
|
|
29947
29959
|
$[53] = placeholder;
|
29948
29960
|
$[54] = renderValues;
|
29949
29961
|
$[55] = selectedValues;
|
29950
|
-
$[56] =
|
29951
|
-
$[57] =
|
29952
|
-
$[58] =
|
29962
|
+
$[56] = size;
|
29963
|
+
$[57] = toggleOption;
|
29964
|
+
$[58] = useChips;
|
29965
|
+
$[59] = t25;
|
29953
29966
|
} else {
|
29954
|
-
t25 = $[
|
29967
|
+
t25 = $[59];
|
29955
29968
|
}
|
29956
29969
|
let t26;
|
29957
|
-
if ($[
|
29970
|
+
if ($[60] !== handleTogglePopover || $[61] !== ref || $[62] !== t24 || $[63] !== t25) {
|
29958
29971
|
t26 = /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { ref, onClick: handleTogglePopover, className: t24, children: t25 }) });
|
29959
|
-
$[
|
29960
|
-
$[
|
29961
|
-
$[
|
29962
|
-
$[
|
29963
|
-
$[
|
29972
|
+
$[60] = handleTogglePopover;
|
29973
|
+
$[61] = ref;
|
29974
|
+
$[62] = t24;
|
29975
|
+
$[63] = t25;
|
29976
|
+
$[64] = t26;
|
29964
29977
|
} else {
|
29965
|
-
t26 = $[
|
29978
|
+
t26 = $[64];
|
29966
29979
|
}
|
29967
29980
|
let t27;
|
29968
|
-
if ($[
|
29981
|
+
if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
|
29969
29982
|
t27 = cls("z-50 relative overflow-hidden border bg-white dark:bg-surface-900 rounded-lg w-[400px]", defaultBorderMixin);
|
29970
|
-
$[
|
29983
|
+
$[65] = t27;
|
29971
29984
|
} else {
|
29972
|
-
t27 = $[
|
29985
|
+
t27 = $[65];
|
29973
29986
|
}
|
29974
29987
|
let t28;
|
29975
|
-
if ($[
|
29988
|
+
if ($[66] !== onPopoverOpenChange) {
|
29976
29989
|
t28 = () => onPopoverOpenChange(false);
|
29977
|
-
$[
|
29978
|
-
$[
|
29990
|
+
$[66] = onPopoverOpenChange;
|
29991
|
+
$[67] = t28;
|
29979
29992
|
} else {
|
29980
|
-
t28 = $[
|
29993
|
+
t28 = $[67];
|
29981
29994
|
}
|
29982
29995
|
let t29;
|
29983
|
-
if ($[
|
29996
|
+
if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
|
29984
29997
|
t29 = cls(focusedDisabled, "bg-transparent outline-none flex-1 h-full w-full m-4 flex-grow ");
|
29985
|
-
$[
|
29998
|
+
$[68] = t29;
|
29986
29999
|
} else {
|
29987
|
-
t29 = $[
|
30000
|
+
t29 = $[68];
|
29988
30001
|
}
|
29989
30002
|
let t30;
|
29990
|
-
if ($[
|
30003
|
+
if ($[69] !== handleInputKeyDown) {
|
29991
30004
|
t30 = /* @__PURE__ */ jsxRuntime.jsx(cmdk.Command.Input, { className: t29, placeholder: "Search...", onKeyDown: handleInputKeyDown });
|
29992
|
-
$[
|
29993
|
-
$[
|
30005
|
+
$[69] = handleInputKeyDown;
|
30006
|
+
$[70] = t30;
|
29994
30007
|
} else {
|
29995
|
-
t30 = $[
|
30008
|
+
t30 = $[70];
|
29996
30009
|
}
|
29997
30010
|
let t31;
|
29998
|
-
if ($[
|
30011
|
+
if ($[71] !== handleClear || $[72] !== selectedValues.length) {
|
29999
30012
|
t31 = selectedValues.length > 0 && /* @__PURE__ */ jsxRuntime.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" });
|
30000
|
-
$[
|
30001
|
-
$[
|
30002
|
-
$[
|
30013
|
+
$[71] = handleClear;
|
30014
|
+
$[72] = selectedValues.length;
|
30015
|
+
$[73] = t31;
|
30003
30016
|
} else {
|
30004
|
-
t31 = $[
|
30017
|
+
t31 = $[73];
|
30005
30018
|
}
|
30006
30019
|
let t32;
|
30007
|
-
if ($[
|
30020
|
+
if ($[74] !== t30 || $[75] !== t31) {
|
30008
30021
|
t32 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center", children: [
|
30009
30022
|
t30,
|
30010
30023
|
t31
|
30011
30024
|
] });
|
30012
|
-
$[
|
30013
|
-
$[
|
30014
|
-
$[
|
30025
|
+
$[74] = t30;
|
30026
|
+
$[75] = t31;
|
30027
|
+
$[76] = t32;
|
30015
30028
|
} else {
|
30016
|
-
t32 = $[
|
30029
|
+
t32 = $[76];
|
30017
30030
|
}
|
30018
30031
|
let t33;
|
30019
|
-
if ($[
|
30032
|
+
if ($[77] === Symbol.for("react.memo_cache_sentinel")) {
|
30020
30033
|
t33 = /* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "horizontal", className: "my-0" });
|
30021
|
-
$[
|
30034
|
+
$[77] = t33;
|
30022
30035
|
} else {
|
30023
|
-
t33 = $[
|
30036
|
+
t33 = $[77];
|
30024
30037
|
}
|
30025
30038
|
let t34;
|
30026
|
-
if ($[
|
30039
|
+
if ($[78] === Symbol.for("react.memo_cache_sentinel")) {
|
30027
30040
|
t34 = /* @__PURE__ */ jsxRuntime.jsx(cmdk.Command.Empty, { className: "px-4 py-2", children: "No results found." });
|
30028
|
-
$[
|
30041
|
+
$[78] = t34;
|
30029
30042
|
} else {
|
30030
|
-
t34 = $[
|
30043
|
+
t34 = $[78];
|
30031
30044
|
}
|
30032
30045
|
let t35;
|
30033
|
-
if ($[
|
30046
|
+
if ($[79] !== allValues.length || $[80] !== includeSelectAll || $[81] !== selectedValues.length || $[82] !== toggleAll) {
|
30034
30047
|
t35 = includeSelectAll && /* @__PURE__ */ jsxRuntime.jsxs(cmdk.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: [
|
30035
30048
|
/* @__PURE__ */ jsxRuntime.jsx(InnerCheckBox, { checked: selectedValues.length === allValues.length }),
|
30036
30049
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-text-secondary dark:text-text-secondary-dark", children: "(Select All)" })
|
30037
30050
|
] }, "all");
|
30038
|
-
$[
|
30039
|
-
$[
|
30040
|
-
$[
|
30041
|
-
$[
|
30042
|
-
$[
|
30051
|
+
$[79] = allValues.length;
|
30052
|
+
$[80] = includeSelectAll;
|
30053
|
+
$[81] = selectedValues.length;
|
30054
|
+
$[82] = toggleAll;
|
30055
|
+
$[83] = t35;
|
30043
30056
|
} else {
|
30044
|
-
t35 = $[
|
30057
|
+
t35 = $[83];
|
30045
30058
|
}
|
30046
30059
|
let t36;
|
30047
|
-
if ($[
|
30060
|
+
if ($[84] !== children || $[85] !== t35) {
|
30048
30061
|
t36 = /* @__PURE__ */ jsxRuntime.jsxs(cmdk.Command.List, { children: [
|
30049
30062
|
t34,
|
30050
30063
|
/* @__PURE__ */ jsxRuntime.jsxs(cmdk.Command.Group, { children: [
|
@@ -30052,61 +30065,61 @@
|
|
30052
30065
|
children
|
30053
30066
|
] })
|
30054
30067
|
] });
|
30055
|
-
$[
|
30056
|
-
$[
|
30057
|
-
$[
|
30068
|
+
$[84] = children;
|
30069
|
+
$[85] = t35;
|
30070
|
+
$[86] = t36;
|
30058
30071
|
} else {
|
30059
|
-
t36 = $[
|
30072
|
+
t36 = $[86];
|
30060
30073
|
}
|
30061
30074
|
let t37;
|
30062
|
-
if ($[
|
30075
|
+
if ($[87] !== t32 || $[88] !== t36) {
|
30063
30076
|
t37 = /* @__PURE__ */ jsxRuntime.jsxs(cmdk.Command, { children: [
|
30064
30077
|
t32,
|
30065
30078
|
t33,
|
30066
30079
|
t36
|
30067
30080
|
] });
|
30068
|
-
$[
|
30069
|
-
$[
|
30070
|
-
$[
|
30081
|
+
$[87] = t32;
|
30082
|
+
$[88] = t36;
|
30083
|
+
$[89] = t37;
|
30071
30084
|
} else {
|
30072
|
-
t37 = $[
|
30085
|
+
t37 = $[89];
|
30073
30086
|
}
|
30074
30087
|
let t38;
|
30075
|
-
if ($[
|
30088
|
+
if ($[90] !== t28 || $[91] !== t37) {
|
30076
30089
|
t38 = /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Content, { className: t27, align: "start", sideOffset: 8, onEscapeKeyDown: t28, children: t37 });
|
30077
|
-
$[
|
30078
|
-
$[
|
30079
|
-
$[
|
30090
|
+
$[90] = t28;
|
30091
|
+
$[91] = t37;
|
30092
|
+
$[92] = t38;
|
30080
30093
|
} else {
|
30081
|
-
t38 = $[
|
30094
|
+
t38 = $[92];
|
30082
30095
|
}
|
30083
30096
|
let t39;
|
30084
|
-
if ($[
|
30097
|
+
if ($[93] !== isPopoverOpen || $[94] !== modalPopover || $[95] !== onPopoverOpenChange || $[96] !== t26 || $[97] !== t38) {
|
30085
30098
|
t39 = /* @__PURE__ */ jsxRuntime.jsxs(PopoverPrimitive__namespace.Root, { open: isPopoverOpen, onOpenChange: onPopoverOpenChange, modal: modalPopover, children: [
|
30086
30099
|
t26,
|
30087
30100
|
t38
|
30088
30101
|
] });
|
30089
|
-
$[
|
30090
|
-
$[
|
30091
|
-
$[
|
30092
|
-
$[
|
30093
|
-
$[
|
30094
|
-
$[
|
30102
|
+
$[93] = isPopoverOpen;
|
30103
|
+
$[94] = modalPopover;
|
30104
|
+
$[95] = onPopoverOpenChange;
|
30105
|
+
$[96] = t26;
|
30106
|
+
$[97] = t38;
|
30107
|
+
$[98] = t39;
|
30095
30108
|
} else {
|
30096
|
-
t39 = $[
|
30109
|
+
t39 = $[98];
|
30097
30110
|
}
|
30098
30111
|
let t40;
|
30099
|
-
if ($[
|
30112
|
+
if ($[99] !== t18 || $[100] !== t19 || $[101] !== t39) {
|
30100
30113
|
t40 = /* @__PURE__ */ jsxRuntime.jsxs(MultiSelectContext.Provider, { value: t18, children: [
|
30101
30114
|
t19,
|
30102
30115
|
t39
|
30103
30116
|
] });
|
30104
|
-
$[
|
30105
|
-
$[
|
30106
|
-
$[
|
30107
|
-
$[
|
30117
|
+
$[99] = t18;
|
30118
|
+
$[100] = t19;
|
30119
|
+
$[101] = t39;
|
30120
|
+
$[102] = t40;
|
30108
30121
|
} else {
|
30109
|
-
t40 = $[
|
30122
|
+
t40 = $[102];
|
30110
30123
|
}
|
30111
30124
|
return t40;
|
30112
30125
|
});
|
@@ -30548,6 +30561,7 @@
|
|
30548
30561
|
endAdornment,
|
30549
30562
|
invisible,
|
30550
30563
|
children,
|
30564
|
+
dataType = "string",
|
30551
30565
|
...props
|
30552
30566
|
}, ref) => {
|
30553
30567
|
const [openInternal, setOpenInternal] = React.useState(open ?? false);
|
@@ -30556,9 +30570,12 @@
|
|
30556
30570
|
}, [open]);
|
30557
30571
|
const onValueChangeInternal = React.useCallback((newValue) => {
|
30558
30572
|
let typedValue = newValue;
|
30559
|
-
if (
|
30560
|
-
|
30561
|
-
|
30573
|
+
if (dataType === "boolean") {
|
30574
|
+
if (newValue === "true") typedValue = true;
|
30575
|
+
else if (newValue === "false") typedValue = false;
|
30576
|
+
} else if (dataType === "number") {
|
30577
|
+
if (!isNaN(Number(newValue)) && newValue.trim() !== "") typedValue = Number(newValue);
|
30578
|
+
}
|
30562
30579
|
onValueChange?.(typedValue);
|
30563
30580
|
if (onChange) {
|
30564
30581
|
const event = {
|
@@ -30577,54 +30594,56 @@
|
|
30577
30594
|
setOpenInternal(open_0);
|
30578
30595
|
}, ...props, children: [
|
30579
30596
|
typeof label === "string" ? /* @__PURE__ */ jsxRuntime.jsx(SelectInputLabel, { error, children: label }) : label,
|
30580
|
-
/* @__PURE__ */ jsxRuntime.
|
30597
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cls("select-none rounded-md text-sm", invisible ? fieldBackgroundInvisibleMixin : fieldBackgroundMixin, disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin, "relative flex items-center", className, {
|
30581
30598
|
"min-h-[28px]": size === "smallest",
|
30582
30599
|
"min-h-[32px]": size === "small",
|
30583
30600
|
"min-h-[42px]": size === "medium",
|
30584
30601
|
"min-h-[64px]": size === "large",
|
30585
30602
|
"w-fit": !fullWidth,
|
30586
30603
|
"w-full": fullWidth
|
30587
|
-
}), children:
|
30588
|
-
"
|
30589
|
-
|
30590
|
-
|
30591
|
-
|
30592
|
-
"
|
30593
|
-
"min-h-[32px]": size === "small",
|
30594
|
-
"min-h-[42px]": size === "medium",
|
30595
|
-
"min-h-[64px]": size === "large",
|
30596
|
-
"w-full": fullWidth,
|
30597
|
-
"w-fit": !fullWidth
|
30598
|
-
}, inputClassName), children: [
|
30599
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cls("flex-grow max-w-full flex flex-row gap-2 items-center", "overflow-visible", {
|
30604
|
+
}), children: [
|
30605
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Trigger, { ref: inputRef, id, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cls("h-full", padding ? {
|
30606
|
+
"px-4": size === "large",
|
30607
|
+
"px-3": size === "medium",
|
30608
|
+
"px-2": size === "small" || size === "smallest"
|
30609
|
+
} : "", "outline-none focus:outline-none", "select-none rounded-md text-sm", error ? "text-red-500 dark:text-red-600" : "focus:text-text-primary dark:focus:text-text-primary-dark", error ? "border border-red-500 dark:border-red-600" : "", disabled ? "text-surface-accent-600 dark:text-surface-accent-400" : "text-surface-accent-800 dark:text-white", "relative flex flex-row items-center", {
|
30600
30610
|
"min-h-[28px]": size === "smallest",
|
30601
30611
|
"min-h-[32px]": size === "small",
|
30602
30612
|
"min-h-[42px]": size === "medium",
|
30603
|
-
"min-h-[64px]": size === "large"
|
30604
|
-
|
30605
|
-
|
30606
|
-
|
30607
|
-
|
30608
|
-
|
30609
|
-
|
30610
|
-
|
30611
|
-
|
30612
|
-
|
30613
|
-
|
30614
|
-
|
30615
|
-
|
30616
|
-
|
30617
|
-
|
30613
|
+
"min-h-[64px]": size === "large",
|
30614
|
+
"w-full": fullWidth,
|
30615
|
+
"w-fit": !fullWidth
|
30616
|
+
}, inputClassName), children: [
|
30617
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cls("flex-grow max-w-full flex flex-row gap-2 items-center", "overflow-visible", {
|
30618
|
+
"min-h-[28px]": size === "smallest",
|
30619
|
+
"min-h-[32px]": size === "small",
|
30620
|
+
"min-h-[42px]": size === "medium",
|
30621
|
+
"min-h-[64px]": size === "large"
|
30622
|
+
}), children: /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Value, { onClick: (e) => {
|
30623
|
+
e.preventDefault();
|
30624
|
+
e.stopPropagation();
|
30625
|
+
}, placeholder, className: "w-full", children: [
|
30626
|
+
hasValue && value !== void 0 && renderValue ? renderValue(value) : placeholder,
|
30627
|
+
hasValue && !renderValue && (() => {
|
30628
|
+
const childrenProps = React.Children.map(children, (child) => {
|
30629
|
+
if (React.isValidElement(child)) {
|
30630
|
+
return child.props;
|
30631
|
+
}
|
30632
|
+
}).filter(Boolean);
|
30633
|
+
const option = childrenProps.find((o) => String(o.value) === String(value));
|
30634
|
+
return option?.children;
|
30635
|
+
})()
|
30636
|
+
] }) }),
|
30637
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(KeyboardArrowDownIcon, { size: size === "large" ? "medium" : "small", className: cls("transition", open ? "rotate-180" : "", {
|
30638
|
+
"px-2": size === "large",
|
30639
|
+
"px-1": size === "medium" || size === "small"
|
30640
|
+
}) }) })
|
30618
30641
|
] }) }),
|
30619
|
-
endAdornment && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls("h-full flex items-center"), onClick: (e_0) => {
|
30642
|
+
endAdornment && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls("h-full flex items-center absolute right-0 pr-12"), onClick: (e_0) => {
|
30620
30643
|
e_0.preventDefault();
|
30621
30644
|
e_0.stopPropagation();
|
30622
|
-
}, children: endAdornment })
|
30623
|
-
|
30624
|
-
"px-2": size === "large",
|
30625
|
-
"px-1": size === "medium" || size === "small"
|
30626
|
-
}) }) })
|
30627
|
-
] }) }) }),
|
30645
|
+
}, children: endAdornment })
|
30646
|
+
] }),
|
30628
30647
|
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Content, { position, className: cls(focusedDisabled, "z-50 relative overflow-hidden border bg-white dark:bg-surface-900 p-2 rounded-lg", defaultBorderMixin), children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Viewport, { className: "p-1", style: {
|
30629
30648
|
maxHeight: "var(--radix-select-content-available-height)"
|
30630
30649
|
}, children }) }) })
|