@fuf-stack/uniform 1.29.0 → 1.30.0
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/README.md +6 -0
- package/dist/Checkboxes/index.d.mts +61 -14
- package/dist/Checkboxes/index.d.mts.map +1 -1
- package/dist/Checkboxes/index.mjs +8 -3
- package/dist/Checkboxes/index.mjs.map +1 -1
- package/dist/DatePicker/index.d.mts +129 -1120
- package/dist/DatePicker/index.d.mts.map +1 -1
- package/dist/DatePicker/index.mjs +38 -32
- package/dist/DatePicker/index.mjs.map +1 -1
- package/dist/FieldReset/index.d.mts +1 -1
- package/dist/Form/index.d.mts +12 -12
- package/dist/{FormContext-BnNJYZOo.d.mts → FormContext-Dvt3MiKq.d.mts} +3 -3
- package/dist/{FormContext-BnNJYZOo.d.mts.map → FormContext-Dvt3MiKq.d.mts.map} +1 -1
- package/dist/Input/index.d.mts +63 -452
- package/dist/Input/index.d.mts.map +1 -1
- package/dist/Input/index.mjs +19 -14
- package/dist/Input/index.mjs.map +1 -1
- package/dist/RadioBoxes/index.d.mts +157 -888
- package/dist/RadioBoxes/index.d.mts.map +1 -1
- package/dist/RadioBoxes/index.mjs +27 -20
- package/dist/RadioBoxes/index.mjs.map +1 -1
- package/dist/RadioTabs/index.d.mts +93 -43
- package/dist/RadioTabs/index.d.mts.map +1 -1
- package/dist/RadioTabs/index.mjs +8 -5
- package/dist/RadioTabs/index.mjs.map +1 -1
- package/dist/Radios/index.d.mts +128 -1033
- package/dist/Radios/index.d.mts.map +1 -1
- package/dist/Radios/index.mjs +22 -18
- package/dist/Radios/index.mjs.map +1 -1
- package/dist/Select/index.d.mts +447 -3035
- package/dist/Select/index.d.mts.map +1 -1
- package/dist/Select/index.mjs +79 -45
- package/dist/Select/index.mjs.map +1 -1
- package/dist/Slider/index.d.mts +174 -1337
- package/dist/Slider/index.d.mts.map +1 -1
- package/dist/Slider/index.mjs +41 -28
- package/dist/Slider/index.mjs.map +1 -1
- package/dist/Switch/index.d.mts +125 -944
- package/dist/Switch/index.d.mts.map +1 -1
- package/dist/Switch/index.mjs +18 -14
- package/dist/Switch/index.mjs.map +1 -1
- package/dist/SwitchBox/index.d.mts +140 -99
- package/dist/SwitchBox/index.d.mts.map +1 -1
- package/dist/SwitchBox/index.mjs +9 -6
- package/dist/SwitchBox/index.mjs.map +1 -1
- package/dist/TextArea/index.d.mts +63 -452
- package/dist/TextArea/index.d.mts.map +1 -1
- package/dist/TextArea/index.mjs +16 -12
- package/dist/TextArea/index.mjs.map +1 -1
- package/dist/Time/index.d.mts +82 -729
- package/dist/Time/index.d.mts.map +1 -1
- package/dist/Time/index.mjs +22 -18
- package/dist/Time/index.mjs.map +1 -1
- package/dist/hooks/useFormContext/index.d.mts +1 -1
- package/dist/hooks/useUniformField/index.d.mts +1 -1
- package/dist/hooks/useUniformField/index.mjs +5 -1
- package/dist/hooks/useUniformField/index.mjs.map +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.mts +1 -1
- package/dist/{index-DaiTW5Bl.d.mts → index-DsB0_365.d.mts} +9 -2
- package/dist/index-DsB0_365.d.mts.map +1 -0
- package/dist/{useFormContext-BhPzFXwF.d.mts → useFormContext-BSSUZ0Md.d.mts} +2 -2
- package/dist/{useFormContext-BhPzFXwF.d.mts.map → useFormContext-BSSUZ0Md.d.mts.map} +1 -1
- package/package.json +2 -2
- package/dist/index-DaiTW5Bl.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/Select/Select.tsx"],"mappings":";;;;qBAsBa,kBAAc
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/Select/Select.tsx"],"mappings":";;;;qBAsBa,kBAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8EV;;EAEf;;;;;EAKA;;EAEA,QAAQ;;EAER;;KAGG,eAAe,eAAe;KAC9B,YAAY,mBAAmB;UAEnB,oBAAoB;;EAEnC;;EAEA,YAAY;;EAEZ;;EAEA;;EAEA;;EAEA,6BAEM,SAAS,cAAc;;EAE7B;;EAEA,QAAQ;;EAER;;EAEA;;EAEA;;EAEA,gBAAgB;;EAEhB,SAAS;;EAET;;EAEA;;EAEA,qBAAqB;;EAErB,gCAAgC;;;;;;;;EAQhC,yBAAyB,eAAe;;EAExC;;EAEA,YAAY;;;cASR,WAAU,WAAA,WAAA,eAAA,cAAA,YAAA,SAAA,aAAA,MAAA,eAAA,SAAA,aAAA,oBAAA,mBAAA,2BAAA,qBAgBb,gCAAW,IAAA"}
|
package/dist/Select/index.mjs
CHANGED
|
@@ -7,10 +7,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import ReactSelect, { components } from "react-select";
|
|
8
8
|
import { useSelect } from "@heroui/select";
|
|
9
9
|
// src/Select/SelectComponents.tsx
|
|
10
|
-
/** Mirrors the select test id onto the underlying react-select input element. */
|
|
10
|
+
/** Mirrors the select test id and read-only state onto the underlying react-select input element. */
|
|
11
11
|
const InputComponent = (props) => {
|
|
12
12
|
const testId = `${props.selectProps["data-testid"]}`;
|
|
13
|
+
const ariaReadOnly = props.selectProps["aria-readonly"];
|
|
13
14
|
return /* @__PURE__ */ jsx(components.Input, {
|
|
15
|
+
"aria-readonly": ariaReadOnly,
|
|
14
16
|
"data-testid": testId,
|
|
15
17
|
...props
|
|
16
18
|
});
|
|
@@ -42,47 +44,67 @@ const DropdownIndicatorComponent = (props) => {
|
|
|
42
44
|
});
|
|
43
45
|
};
|
|
44
46
|
// src/Select/Select.tsx
|
|
45
|
-
const selectVariants = tv({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
47
|
+
const selectVariants = tv({
|
|
48
|
+
slots: {
|
|
49
|
+
base: [
|
|
50
|
+
"group",
|
|
51
|
+
"flex w-full flex-col",
|
|
52
|
+
"gap-y-1.5",
|
|
53
|
+
"leading-normal"
|
|
54
|
+
],
|
|
55
|
+
clearIndicator: "rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800",
|
|
56
|
+
control: "duration-150! min-h-10 rounded-lg border-2 border-default-200 bg-content1 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none",
|
|
57
|
+
control_focused: "border-focus",
|
|
58
|
+
crossIcon: "",
|
|
59
|
+
downChevron: "",
|
|
60
|
+
dropdownIndicator: "rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black",
|
|
61
|
+
group: "",
|
|
62
|
+
groupHeading: "mb-1 ml-3 mt-2 text-sm text-foreground-500",
|
|
63
|
+
indicatorsContainer: "gap-1 p-1",
|
|
64
|
+
indicatorSeparator: "bg-default-300",
|
|
65
|
+
input: "py-0.5 pl-1",
|
|
66
|
+
label: "pointer-events-auto inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger",
|
|
67
|
+
loadingIndicator: "",
|
|
68
|
+
loadingMessage: "rounded-sm p-2 text-foreground-500",
|
|
69
|
+
menu: "mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg",
|
|
70
|
+
menuList: "",
|
|
71
|
+
menuPortal: "z-50!",
|
|
72
|
+
multiValue: "h-6 items-center gap-1.5 rounded bg-default-100 pl-2 pr-1",
|
|
73
|
+
multiValueContainer: "",
|
|
74
|
+
multiValueLabel: "py-0 leading-5",
|
|
75
|
+
multiValueRemove: "flex h-5 w-5 items-center justify-center rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800",
|
|
76
|
+
noOptionsMessage: "rounded-sm p-2 text-foreground-500",
|
|
77
|
+
option: "rounded px-3 py-2 hover:cursor-pointer",
|
|
78
|
+
option_disabled: "cursor-not-allowed! hover:cursor-not-allowed! opacity-disabled",
|
|
79
|
+
option_focused: "bg-default-100 active:bg-default-200",
|
|
80
|
+
option_selected: "bg-default-300",
|
|
81
|
+
placeholder: "ml-1 py-0.5 pl-1 text-sm text-foreground-500",
|
|
82
|
+
selectContainer: "",
|
|
83
|
+
singleValue: "ml-1! leading-7!",
|
|
84
|
+
valueContainer: "gap-1 p-1"
|
|
85
|
+
},
|
|
86
|
+
variants: {
|
|
87
|
+
disabled: { true: {
|
|
88
|
+
base: "**:cursor-not-allowed cursor-not-allowed opacity-disabled",
|
|
89
|
+
clearIndicator: "hover:cursor-not-allowed hover:bg-transparent hover:text-foreground-500",
|
|
90
|
+
control: "hover:border-default-200",
|
|
91
|
+
dropdownIndicator: "hover:cursor-not-allowed hover:bg-transparent hover:text-foreground-500"
|
|
92
|
+
} },
|
|
93
|
+
readOnly: { true: {
|
|
94
|
+
base: "**:cursor-not-allowed cursor-not-allowed opacity-disabled",
|
|
95
|
+
clearIndicator: "hover:cursor-not-allowed hover:bg-transparent hover:text-foreground-500",
|
|
96
|
+
control: "hover:border-default-200",
|
|
97
|
+
dropdownIndicator: "hover:cursor-not-allowed hover:bg-transparent hover:text-foreground-500"
|
|
98
|
+
} }
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
/** Hides react-select sub-components, e.g. multi-value remove buttons. */
|
|
102
|
+
const hiddenComponent = () => {
|
|
103
|
+
return null;
|
|
104
|
+
};
|
|
83
105
|
/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */
|
|
84
106
|
const Select = ({ className = void 0, clearable = true, debugMenuOpen = false, filterOption = void 0, inputValue = void 0, loading = false, multiSelect = false, name, onInputChange = void 0, options, placeholder = void 0, renderEmptyOptions = void 0, renderOptionLabel = void 0, selectedOptionFallback = void 0, ...uniformFieldProps }) => {
|
|
85
|
-
const { ariaLabel, disabled, errorMessage, field: { onBlur, onChange, ref, value }, getErrorMessageProps, getHelperWrapperProps, getLabelProps, invalid, label, required, testId } = useUniformField({
|
|
107
|
+
const { ariaLabel, disabled, errorMessage, field: { onBlur, onChange, ref, value }, getErrorMessageProps, getHelperWrapperProps, getLabelProps, invalid, label, readOnly, required, testId } = useUniformField({
|
|
86
108
|
isArrayValue: multiSelect,
|
|
87
109
|
name,
|
|
88
110
|
...uniformFieldProps
|
|
@@ -90,7 +112,10 @@ const Select = ({ className = void 0, clearable = true, debugMenuOpen = false, f
|
|
|
90
112
|
const { getFieldState } = useFormContext();
|
|
91
113
|
const [isFocused, setIsFocused] = useState(false);
|
|
92
114
|
const { convertToOriginalType } = createOptionValueConverter(options);
|
|
93
|
-
const variants = selectVariants(
|
|
115
|
+
const variants = selectVariants({
|
|
116
|
+
disabled,
|
|
117
|
+
readOnly
|
|
118
|
+
});
|
|
94
119
|
const classNames = variantsToClassNames(variants, className, "base");
|
|
95
120
|
const reactSelectClassNames = {
|
|
96
121
|
clearIndicator: () => {
|
|
@@ -205,6 +230,7 @@ const Select = ({ className = void 0, clearable = true, debugMenuOpen = false, f
|
|
|
205
230
|
return findOption(value);
|
|
206
231
|
})();
|
|
207
232
|
const handleChange = (option) => {
|
|
233
|
+
if (readOnly) return;
|
|
208
234
|
if (multiSelect) onChange(option?.map((_option) => {
|
|
209
235
|
return convertToOriginalType(_option.value);
|
|
210
236
|
}));
|
|
@@ -217,6 +243,10 @@ const Select = ({ className = void 0, clearable = true, debugMenuOpen = false, f
|
|
|
217
243
|
onBlur();
|
|
218
244
|
});
|
|
219
245
|
};
|
|
246
|
+
const isClearable = clearable && !readOnly;
|
|
247
|
+
let menuIsOpen;
|
|
248
|
+
if (readOnly) menuIsOpen = false;
|
|
249
|
+
else if (debugMenuOpen) menuIsOpen = true;
|
|
220
250
|
const handleBlur = () => {
|
|
221
251
|
setIsFocused(false);
|
|
222
252
|
onBlur();
|
|
@@ -226,7 +256,7 @@ const Select = ({ className = void 0, clearable = true, debugMenuOpen = false, f
|
|
|
226
256
|
};
|
|
227
257
|
return /* @__PURE__ */ jsxs("div", {
|
|
228
258
|
...getBaseProps(),
|
|
229
|
-
className:
|
|
259
|
+
className: classNames.base,
|
|
230
260
|
"data-required": required,
|
|
231
261
|
"data-testid": `${testId}_wrapper`,
|
|
232
262
|
children: [
|
|
@@ -247,23 +277,27 @@ const Select = ({ className = void 0, clearable = true, debugMenuOpen = false, f
|
|
|
247
277
|
"aria-invalid": invalid,
|
|
248
278
|
"aria-label": ariaLabel,
|
|
249
279
|
"aria-labelledby": label ? getTriggerProps()["aria-labelledby"]?.split(" ")[1] : void 0,
|
|
280
|
+
"aria-readonly": readOnly || void 0,
|
|
281
|
+
backspaceRemovesValue: !readOnly,
|
|
250
282
|
classNames: reactSelectClassNames,
|
|
251
283
|
components: {
|
|
252
284
|
Control: ControlComponent,
|
|
253
285
|
DropdownIndicator: DropdownIndicatorComponent,
|
|
254
286
|
Input: InputComponent,
|
|
287
|
+
...readOnly ? { MultiValueRemove: hiddenComponent } : {},
|
|
255
288
|
Option: OptionComponent
|
|
256
289
|
},
|
|
257
290
|
"data-testid": testId,
|
|
258
291
|
filterOption,
|
|
259
292
|
formatOptionLabel: renderOptionLabel,
|
|
260
|
-
inputValue,
|
|
293
|
+
inputValue: readOnly ? "" : inputValue,
|
|
261
294
|
instanceId: name,
|
|
262
|
-
isClearable
|
|
295
|
+
isClearable,
|
|
263
296
|
isDisabled: disabled,
|
|
264
297
|
isLoading: loading,
|
|
265
298
|
isMulti: multiSelect,
|
|
266
|
-
|
|
299
|
+
isSearchable: !readOnly,
|
|
300
|
+
menuIsOpen,
|
|
267
301
|
menuPosition: "fixed",
|
|
268
302
|
menuShouldBlockScroll: true,
|
|
269
303
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/Select/SelectComponents.tsx","../../src/Select/Select.tsx","../../src/Select/index.ts"],"sourcesContent":["import { components } from 'react-select';\n\nimport { slugify } from '@fuf-stack/pixel-utils';\n\n/** Mirrors the select test id onto the underlying react-select input element. */\nexport const InputComponent: typeof components.Input = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}`;\n return <components.Input data-testid={testId} {...props} />;\n};\n\n/** Wraps the control root to expose a stable `*_select` test id hook. */\nexport const ControlComponent: typeof components.Control = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select`;\n return (\n <div data-testid={testId}>\n <components.Control {...props} />\n </div>\n );\n};\n\n/** Adds deterministic option test ids and forwards disabled state semantics. */\nexport const OptionComponent: typeof components.Option = (props) => {\n const { isDisabled } = props;\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select_option_${slugify(String(props?.data?.testId ?? props?.data?.value), { replaceDots: true })}`;\n return (\n <div aria-disabled={isDisabled ? true : undefined} data-testid={testId}>\n <components.Option {...props} />\n </div>\n );\n};\n\n/** Wraps the dropdown indicator with a predictable test id for automation. */\nexport const DropdownIndicatorComponent: typeof components.DropdownIndicator = (\n props,\n) => {\n // @ts-expect-error data-testid is not a default prop\n const testId = props?.selectProps['data-testid'] as string;\n return (\n <div data-testid={`${testId}_select_dropdown`}>\n <components.DropdownIndicator {...props} />\n </div>\n );\n};\n","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\nimport type { MultiValue, Props, SingleValue } from 'react-select';\nimport type { InputValueTransform } from '../hooks/useInputValueTransform';\n\nimport { useState } from 'react';\nimport ReactSelect from 'react-select';\n\nimport { useSelect } from '@heroui/select';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter, isValueEmpty } from '../helpers';\nimport { useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\nimport {\n ControlComponent,\n DropdownIndicatorComponent,\n InputComponent,\n OptionComponent,\n} from './SelectComponents';\n\nexport const selectVariants = tv({\n slots: {\n base: [\n // Enables group-data selectors used by child slots.\n 'group',\n // Make field wrappers align with other form controls.\n 'flex w-full flex-col',\n // Keep label/control vertical rhythm consistent.\n 'gap-y-1.5',\n // Preserve existing text flow for select content.\n 'leading-normal',\n ],\n clearIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800',\n control:\n 'duration-150! min-h-10 rounded-lg border-2 border-default-200 bg-content1 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none',\n control_focused: 'border-focus',\n crossIcon: '',\n downChevron: '',\n dropdownIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black',\n group: '',\n groupHeading: 'mb-1 ml-3 mt-2 text-sm text-foreground-500',\n indicatorsContainer: 'gap-1 p-1',\n indicatorSeparator: 'bg-default-300',\n input: 'py-0.5 pl-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'pointer-events-auto inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger',\n loadingIndicator: '',\n loadingMessage: 'rounded-sm p-2 text-foreground-500',\n menu: 'mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg',\n menuList: '',\n // ensure menu has same z-index as modal so it is visible when rendered in modal\n // see: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/modal.ts (see z-50)\n menuPortal: 'z-50!',\n multiValue: 'h-6 items-center gap-1.5 rounded bg-default-100 pl-2 pr-1',\n multiValueContainer: '',\n multiValueLabel: 'py-0 leading-5',\n multiValueRemove:\n 'flex h-5 w-5 items-center justify-center rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800',\n noOptionsMessage: 'rounded-sm p-2 text-foreground-500',\n option: 'rounded px-3 py-2 hover:cursor-pointer',\n option_disabled:\n 'cursor-not-allowed! hover:cursor-not-allowed! opacity-disabled',\n option_focused: 'bg-default-100 active:bg-default-200',\n option_selected: 'bg-default-300',\n placeholder: 'ml-1 py-0.5 pl-1 text-sm text-foreground-500',\n selectContainer: '',\n singleValue: 'ml-1! leading-7!',\n valueContainer: 'gap-1 p-1',\n },\n});\n\nexport interface SelectOption {\n /** set option to disabled state */\n disabled?: boolean;\n /**\n * True when option was auto-generated because the value wasn't found in options.\n * Use in renderOptionLabel to render a component that fetches the real label.\n */\n isFallback?: boolean;\n /** option label */\n label?: ReactNode;\n /** option value */\n value: string | number;\n}\n\ntype VariantProps = TVProps<typeof selectVariants>;\ntype ClassName = TVClassName<typeof selectVariants>;\n\nexport interface SelectProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName; // string;\n /** Determine if the */\n clearable?: boolean;\n /** Force menu open for debugging or visual testing. */\n debugMenuOpen?: boolean;\n /** Set the select to disabled state. */\n disabled?: boolean;\n /** Filter Select Options */\n filterOption?:\n | undefined\n | ((option?: SelectOption, inputValue?: string) => boolean);\n /** The value of the search input */\n inputValue?: string;\n /** Label that should be associated with the select. */\n label?: ReactNode;\n /** Set the select to a loading state. */\n loading?: boolean;\n /** switch between single and multi select mode. */\n multiSelect?: boolean;\n /** The name for the Select component, used by react-hook-form */\n name: string;\n /** Handle change events on the input */\n onInputChange?: Props['onInputChange'];\n /** The options for the Select component */\n options: SelectOption[];\n /** Placeholder that is displayed when nothing is selected */\n placeholder?: string;\n /** Render custom content when no options match the current search input. */\n renderEmptyOptions?: Props['noOptionsMessage'];\n /** Format the label of the option */\n renderOptionLabel?: undefined | Props['formatOptionLabel'];\n /**\n * Fallback option(s) for async selects when value isn't in current options.\n * Use when the selected value may not be in the options list (e.g., after\n * search results change). Used only if value not found in options.\n * For single select: pass the option object or undefined\n * For multi-select: pass an array of option objects\n */\n selectedOptionFallback?: SelectOption | SelectOption[];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Allows disentangled display and form values for a field. */\n transform?: InputValueTransform;\n}\n\n/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */\nconst Select = ({\n className = undefined,\n clearable = true,\n debugMenuOpen = false,\n filterOption = undefined,\n inputValue = undefined,\n loading = false,\n multiSelect = false,\n name,\n onInputChange = undefined,\n options,\n placeholder = undefined,\n renderEmptyOptions = undefined,\n renderOptionLabel = undefined,\n selectedOptionFallback = undefined,\n ...uniformFieldProps\n}: SelectProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n // Multi-select values are arrays and can produce nested RHF error shapes.\n isArrayValue: multiSelect,\n name,\n ...uniformFieldProps,\n });\n\n // Get getFieldState to check isTouched in onChange callback\n const { getFieldState } = useFormContext();\n\n // Track if the select is focused\n const [isFocused, setIsFocused] = useState(false);\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n // classNames from slots\n const variants = selectVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // React-select classNames configuration\n const reactSelectClassNames = {\n clearIndicator: () => {\n return classNames.clearIndicator;\n },\n control: () => {\n return cn(classNames.control, {\n [classNames.control_focused]: isFocused && !invalid,\n });\n },\n dropdownIndicator: () => {\n return classNames.dropdownIndicator;\n },\n groupHeading: () => {\n return classNames.groupHeading;\n },\n indicatorSeparator: () => {\n return classNames.indicatorSeparator;\n },\n indicatorsContainer: () => {\n return classNames.indicatorsContainer;\n },\n input: () => {\n return classNames.input;\n },\n loadingIndicator: () => {\n return classNames.loadingIndicator;\n },\n loadingMessage: () => {\n return classNames.loadingMessage;\n },\n menu: () => {\n return classNames.menu;\n },\n menuList: () => {\n return classNames.menuList;\n },\n menuPortal: () => {\n return classNames.menuPortal;\n },\n multiValue: () => {\n return classNames.multiValue;\n },\n multiValueLabel: () => {\n return cn(`${getValueProps().className}`, classNames.multiValueLabel);\n },\n multiValueRemove: () => {\n return classNames.multiValueRemove;\n },\n noOptionsMessage: () => {\n return classNames.noOptionsMessage;\n },\n option: ({\n isDisabled: optionIsDisabled,\n isFocused: optionIsFocused,\n isSelected: optionIsSelected,\n }: {\n isDisabled: boolean;\n isFocused: boolean;\n isSelected: boolean;\n }) => {\n return cn(classNames.option, {\n [classNames.option_disabled]: optionIsDisabled,\n [classNames.option_focused]: optionIsFocused,\n [classNames.option_selected]: optionIsSelected,\n });\n },\n placeholder: () => {\n return classNames.placeholder;\n },\n singleValue: () => {\n return cn(classNames.singleValue, `${getValueProps().className}`);\n },\n valueContainer: () => {\n return classNames.valueContainer;\n },\n };\n\n const { getBaseProps, getTriggerProps, getValueProps } = useSelect({\n children: [],\n classNames,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isLoading: loading,\n isRequired: required,\n label,\n labelPlacement: 'outside',\n });\n\n // react-select expects `isDisabled`, while our option contract uses `disabled`.\n const reactSelectOptions = options.map((option) => {\n return {\n ...option,\n isDisabled: option.disabled,\n };\n });\n\n // Compute selected option(s) for react-select\n //\n // Priority for finding options:\n // 1. Look in current options list\n // 2. Use selectedOptionFallback prop (for async selects with pre-fetched data)\n // 3. Create fallback with value as label\n //\n // Handles edge cases:\n // - Compares as strings to support both string and number values\n // - Returns null for empty single-select (required by react-select to clear)\n // - Creates fallback options when value exists but isn't in options list\n // (common with async selects where options change after selection)\n const reactSelectValue = (() => {\n // Helper to find option by value\n const findOption = (v: string | number): SelectOption => {\n // First, look in options list\n const inOptions = options.find((option) => {\n return String(option.value) === String(v);\n });\n if (inOptions) {\n return inOptions;\n }\n\n // Second, look in selectedOptionFallback prop (for async selects)\n if (selectedOptionFallback) {\n if (Array.isArray(selectedOptionFallback)) {\n const inSelected = selectedOptionFallback.find((option) => {\n return String(option.value) === String(v);\n });\n if (inSelected) {\n return inSelected;\n }\n } else if (String(selectedOptionFallback.value) === String(v)) {\n return selectedOptionFallback;\n }\n }\n\n // Fallback: create option with value as label, marked as fallback\n return { isFallback: true, label: String(v), value: v };\n };\n\n if (multiSelect) {\n if (!Array.isArray(value) || isValueEmpty(value)) {\n return [];\n }\n return value.map((v) => {\n return findOption(v);\n });\n }\n\n // Single select - use isValueEmpty to handle marker strings (__NULL__, etc.)\n if (isValueEmpty(value)) {\n return null;\n }\n return findOption(value);\n })();\n\n // Handle selection change\n const handleChange = (\n option: MultiValue<SelectOption> | SingleValue<SelectOption>,\n ) => {\n if (multiSelect) {\n onChange(\n (option as SelectOption[])?.map((_option) => {\n return convertToOriginalType(_option.value);\n }),\n );\n } else {\n const newValue = (option as SelectOption)?.value;\n // Pass null explicitly when clearing (not undefined)\n onChange(newValue != null ? convertToOriginalType(newValue) : null);\n }\n\n // Mark field as touched immediately when a selection is made if not already touched\n // This ensures validation errors show right away (isTouched becomes true)\n // For Select components, selecting an option is a complete user action\n // (unlike text inputs where typing is ongoing), so we mark as touched immediately\n const { isTouched: currentIsTouched } = getFieldState(name, testId);\n if (!currentIsTouched) {\n // Defer blur/touched notification until after the onChange value commit.\n // This prevents \"one render cycle behind\" validation states where blur\n // validation runs against the previous value.\n queueMicrotask(() => {\n onBlur();\n });\n }\n };\n\n // Handle blur event\n const handleBlur = () => {\n setIsFocused(false);\n onBlur();\n };\n\n // Handle focus event\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n return (\n <div\n {...getBaseProps()}\n className={cn(classNames.base)}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-required={required}\n data-testid={`${testId}_wrapper`}\n >\n {label ? (\n <label\n className={classNames.label}\n data-slot=\"label\"\n htmlFor={`react-select-${name}-input`}\n id={getLabelProps().id}\n >\n {label}\n {required ? (\n <span aria-hidden className=\"ml-0.5 text-danger\">\n *\n </span>\n ) : null}\n </label>\n ) : null}\n <ReactSelect\n ref={ref}\n aria-errormessage=\"\"\n aria-invalid={invalid}\n aria-label={ariaLabel}\n // set aria-labelledby to the label id so that the select is accessible\n aria-labelledby={\n label\n ? getTriggerProps()['aria-labelledby']?.split(' ')[1]\n : undefined\n }\n classNames={reactSelectClassNames}\n components={{\n Control: ControlComponent,\n DropdownIndicator: DropdownIndicatorComponent,\n Input: InputComponent,\n Option: OptionComponent,\n }}\n // Does not affect the testId of the select, but is needed to pass it to sub-components\n data-testid={testId}\n filterOption={filterOption}\n formatOptionLabel={renderOptionLabel}\n inputValue={inputValue}\n instanceId={name}\n isClearable={clearable}\n isDisabled={disabled}\n isLoading={loading}\n isMulti={multiSelect}\n menuIsOpen={debugMenuOpen ? true : undefined}\n // set menuPosition to fixed so that menu can be rendered\n // inside Card / Modal components, menuShouldBlockScroll\n // prevents container scroll when menu is open\n menuPosition=\"fixed\"\n menuShouldBlockScroll\n name={name}\n noOptionsMessage={renderEmptyOptions}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n onInputChange={onInputChange}\n options={reactSelectOptions}\n placeholder={placeholder}\n unstyled\n value={reactSelectValue}\n />\n {invalid ? (\n <div {...getHelperWrapperProps()}>\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Select;\n","import Select from './Select';\n\nexport type { SelectProps, SelectOption } from './Select';\n\nexport { selectVariants } from './Select';\n\nexport default Select;\n"],"mappings":";;;;;;;;;;AAKA,MAAa,kBAA2C,UAAU;CAGhE,MAAM,SAAS,GAAG,MAAM,YAAY;CACpC,OAAO,oBAAC,WAAW,OAAZ;EAAkB,eAAa;EAAQ,GAAI;CAAQ,CAAA;AAC5D;;AAGA,MAAa,oBAA+C,UAAU;CAGpE,MAAM,SAAS,GAAG,MAAM,YAAY,eAAe;CACnD,OACE,oBAAC,OAAD;EAAK,eAAa;EAChB,UAAA,oBAAC,WAAW,SAAZ,EAAoB,GAAI,MAAQ,CAAA;CAC7B,CAAA;AAET;;AAGA,MAAa,mBAA6C,UAAU;CAClE,MAAM,EAAE,eAAe;CAGvB,MAAM,SAAS,GAAG,MAAM,YAAY,eAAe,iBAAiB,QAAQ,OAAO,OAAO,MAAM,UAAU,OAAO,MAAM,KAAK,GAAG,EAAE,aAAa,KAAK,CAAC;CACpJ,OACE,oBAAC,OAAD;EAAK,iBAAe,aAAa,OAAO,KAAA;EAAW,eAAa;EAC9D,UAAA,oBAAC,WAAW,QAAZ,EAAmB,GAAI,MAAQ,CAAA;CAC5B,CAAA;AAET;;AAGA,MAAa,8BACX,UACG;CAEH,MAAM,SAAS,OAAO,YAAY;CAClC,OACE,oBAAC,OAAD;EAAK,eAAa,GAAG,OAAO;EAC1B,UAAA,oBAAC,WAAW,mBAAZ,EAA8B,GAAI,MAAQ,CAAA;CACvC,CAAA;AAET;;AC1BA,MAAa,iBAAiB,GAAG,EAC/B,OAAO;CACL,MAAM;EAEJ;EAEA;EAEA;EAEA;CACF;CACA,gBACE;CACF,SACE;CACF,iBAAiB;CACjB,WAAW;CACX,aAAa;CACb,mBACE;CACF,OAAO;CACP,cAAc;CACd,qBAAqB;CACrB,oBAAoB;CACpB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cAAY;IAEZ,mBACE,QACI,gBAAgB,CAAC,CAAC,kBAAkB,EAAE,MAAM,GAAG,CAAC,CAAC,KACjD,KAAA;IAEN,YAAY;IACZ,YAAY;KACV,SAAS;KACT,mBAAmB;KACnB,OAAO;KACP,QAAQ;IACV;IAEA,eAAa;IACC;IACd,mBAAmB;IACP;IACZ,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,WAAW;IACX,SAAS;IACT,YAAY,gBAAgB,OAAO,KAAA;IAInC,cAAa;IACb,uBAAA;IACM;IACN,kBAAkB;IAClB,QAAQ;IACR,UAAU;IACV,SAAS;IACM;IACf,SAAS;IACI;IACb,UAAA;IACA,OAAO;GACR,CAAA;GACA,UACC,oBAAC,OAAD;IAAK,GAAI,sBAAsB;IAC7B,UAAA,oBAAC,OAAD;KAAK,GAAI,qBAAqB;KAAI,UAAA;IAAkB,CAAA;GACjD,CAAA,IACH;EACD;;AAET;;AC5cA,IAAA,iBAAe"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/Select/SelectComponents.tsx","../../src/Select/Select.tsx","../../src/Select/index.ts"],"sourcesContent":["import { components } from 'react-select';\n\nimport { slugify } from '@fuf-stack/pixel-utils';\n\n/** Mirrors the select test id and read-only state onto the underlying react-select input element. */\nexport const InputComponent: typeof components.Input = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}`;\n // @ts-expect-error aria-readonly is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const ariaReadOnly = props.selectProps['aria-readonly'] as true | undefined;\n return (\n <components.Input\n aria-readonly={ariaReadOnly}\n data-testid={testId}\n {...props}\n />\n );\n};\n\n/** Wraps the control root to expose a stable `*_select` test id hook. */\nexport const ControlComponent: typeof components.Control = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select`;\n return (\n <div data-testid={testId}>\n <components.Control {...props} />\n </div>\n );\n};\n\n/** Adds deterministic option test ids and forwards disabled state semantics. */\nexport const OptionComponent: typeof components.Option = (props) => {\n const { isDisabled } = props;\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select_option_${slugify(String(props?.data?.testId ?? props?.data?.value), { replaceDots: true })}`;\n return (\n <div aria-disabled={isDisabled ? true : undefined} data-testid={testId}>\n <components.Option {...props} />\n </div>\n );\n};\n\n/** Wraps the dropdown indicator with a predictable test id for automation. */\nexport const DropdownIndicatorComponent: typeof components.DropdownIndicator = (\n props,\n) => {\n // @ts-expect-error data-testid is not a default prop\n const testId = props?.selectProps['data-testid'] as string;\n return (\n <div data-testid={`${testId}_select_dropdown`}>\n <components.DropdownIndicator {...props} />\n </div>\n );\n};\n","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\nimport type { MultiValue, Props, SingleValue } from 'react-select';\nimport type { InputValueTransform } from '../hooks/useInputValueTransform';\n\nimport { useState } from 'react';\nimport ReactSelect from 'react-select';\n\nimport { useSelect } from '@heroui/select';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter, isValueEmpty } from '../helpers';\nimport { useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\nimport {\n ControlComponent,\n DropdownIndicatorComponent,\n InputComponent,\n OptionComponent,\n} from './SelectComponents';\n\nexport const selectVariants = tv({\n slots: {\n base: [\n // Enables group-data selectors used by child slots.\n 'group',\n // Make field wrappers align with other form controls.\n 'flex w-full flex-col',\n // Keep label/control vertical rhythm consistent.\n 'gap-y-1.5',\n // Preserve existing text flow for select content.\n 'leading-normal',\n ],\n clearIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800',\n control:\n 'duration-150! min-h-10 rounded-lg border-2 border-default-200 bg-content1 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none',\n control_focused: 'border-focus',\n crossIcon: '',\n downChevron: '',\n dropdownIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black',\n group: '',\n groupHeading: 'mb-1 ml-3 mt-2 text-sm text-foreground-500',\n indicatorsContainer: 'gap-1 p-1',\n indicatorSeparator: 'bg-default-300',\n input: 'py-0.5 pl-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'pointer-events-auto inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger',\n loadingIndicator: '',\n loadingMessage: 'rounded-sm p-2 text-foreground-500',\n menu: 'mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg',\n menuList: '',\n // ensure menu has same z-index as modal so it is visible when rendered in modal\n // see: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/modal.ts (see z-50)\n menuPortal: 'z-50!',\n multiValue: 'h-6 items-center gap-1.5 rounded bg-default-100 pl-2 pr-1',\n multiValueContainer: '',\n multiValueLabel: 'py-0 leading-5',\n multiValueRemove:\n 'flex h-5 w-5 items-center justify-center rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800',\n noOptionsMessage: 'rounded-sm p-2 text-foreground-500',\n option: 'rounded px-3 py-2 hover:cursor-pointer',\n option_disabled:\n 'cursor-not-allowed! hover:cursor-not-allowed! opacity-disabled',\n option_focused: 'bg-default-100 active:bg-default-200',\n option_selected: 'bg-default-300',\n placeholder: 'ml-1 py-0.5 pl-1 text-sm text-foreground-500',\n selectContainer: '',\n singleValue: 'ml-1! leading-7!',\n valueContainer: 'gap-1 p-1',\n },\n variants: {\n disabled: {\n true: {\n base: '**:cursor-not-allowed cursor-not-allowed opacity-disabled',\n clearIndicator:\n 'hover:cursor-not-allowed hover:bg-transparent hover:text-foreground-500',\n control: 'hover:border-default-200',\n dropdownIndicator:\n 'hover:cursor-not-allowed hover:bg-transparent hover:text-foreground-500',\n },\n },\n readOnly: {\n true: {\n // Inner controls set their own cursors, so override every descendant.\n base: '**:cursor-not-allowed cursor-not-allowed opacity-disabled',\n clearIndicator:\n 'hover:cursor-not-allowed hover:bg-transparent hover:text-foreground-500',\n control: 'hover:border-default-200',\n dropdownIndicator:\n 'hover:cursor-not-allowed hover:bg-transparent hover:text-foreground-500',\n },\n },\n },\n});\n\nexport interface SelectOption {\n /** set option to disabled state */\n disabled?: boolean;\n /**\n * True when option was auto-generated because the value wasn't found in options.\n * Use in renderOptionLabel to render a component that fetches the real label.\n */\n isFallback?: boolean;\n /** option label */\n label?: ReactNode;\n /** option value */\n value: string | number;\n}\n\ntype VariantProps = TVProps<typeof selectVariants>;\ntype ClassName = TVClassName<typeof selectVariants>;\n\nexport interface SelectProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName; // string;\n /** Determine if the */\n clearable?: boolean;\n /** Force menu open for debugging or visual testing. */\n debugMenuOpen?: boolean;\n /** Set the select to disabled state. */\n disabled?: boolean;\n /** Filter Select Options */\n filterOption?:\n | undefined\n | ((option?: SelectOption, inputValue?: string) => boolean);\n /** The value of the search input */\n inputValue?: string;\n /** Label that should be associated with the select. */\n label?: ReactNode;\n /** Set the select to a loading state. */\n loading?: boolean;\n /** switch between single and multi select mode. */\n multiSelect?: boolean;\n /** The name for the Select component, used by react-hook-form */\n name: string;\n /** Handle change events on the input */\n onInputChange?: Props['onInputChange'];\n /** The options for the Select component */\n options: SelectOption[];\n /** Placeholder that is displayed when nothing is selected */\n placeholder?: string;\n /** Prevents changes while keeping the select focusable and its value in validation and submission */\n readOnly?: boolean;\n /** Render custom content when no options match the current search input. */\n renderEmptyOptions?: Props['noOptionsMessage'];\n /** Format the label of the option */\n renderOptionLabel?: undefined | Props['formatOptionLabel'];\n /**\n * Fallback option(s) for async selects when value isn't in current options.\n * Use when the selected value may not be in the options list (e.g., after\n * search results change). Used only if value not found in options.\n * For single select: pass the option object or undefined\n * For multi-select: pass an array of option objects\n */\n selectedOptionFallback?: SelectOption | SelectOption[];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Allows disentangled display and form values for a field. */\n transform?: InputValueTransform;\n}\n\n/** Hides react-select sub-components, e.g. multi-value remove buttons. */\nconst hiddenComponent = () => {\n return null;\n};\n\n/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */\nconst Select = ({\n className = undefined,\n clearable = true,\n debugMenuOpen = false,\n filterOption = undefined,\n inputValue = undefined,\n loading = false,\n multiSelect = false,\n name,\n onInputChange = undefined,\n options,\n placeholder = undefined,\n renderEmptyOptions = undefined,\n renderOptionLabel = undefined,\n selectedOptionFallback = undefined,\n ...uniformFieldProps\n}: SelectProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n invalid,\n label,\n readOnly,\n required,\n testId,\n } = useUniformField({\n // Multi-select values are arrays and can produce nested RHF error shapes.\n isArrayValue: multiSelect,\n name,\n ...uniformFieldProps,\n });\n\n // Get getFieldState to check isTouched in onChange callback\n const { getFieldState } = useFormContext();\n\n // Track if the select is focused\n const [isFocused, setIsFocused] = useState(false);\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n // classNames from slots\n const variants = selectVariants({ disabled, readOnly });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // React-select classNames configuration\n const reactSelectClassNames = {\n clearIndicator: () => {\n return classNames.clearIndicator;\n },\n control: () => {\n return cn(classNames.control, {\n [classNames.control_focused]: isFocused && !invalid,\n });\n },\n dropdownIndicator: () => {\n return classNames.dropdownIndicator;\n },\n groupHeading: () => {\n return classNames.groupHeading;\n },\n indicatorSeparator: () => {\n return classNames.indicatorSeparator;\n },\n indicatorsContainer: () => {\n return classNames.indicatorsContainer;\n },\n input: () => {\n return classNames.input;\n },\n loadingIndicator: () => {\n return classNames.loadingIndicator;\n },\n loadingMessage: () => {\n return classNames.loadingMessage;\n },\n menu: () => {\n return classNames.menu;\n },\n menuList: () => {\n return classNames.menuList;\n },\n menuPortal: () => {\n return classNames.menuPortal;\n },\n multiValue: () => {\n return classNames.multiValue;\n },\n multiValueLabel: () => {\n return cn(`${getValueProps().className}`, classNames.multiValueLabel);\n },\n multiValueRemove: () => {\n return classNames.multiValueRemove;\n },\n noOptionsMessage: () => {\n return classNames.noOptionsMessage;\n },\n option: ({\n isDisabled: optionIsDisabled,\n isFocused: optionIsFocused,\n isSelected: optionIsSelected,\n }: {\n isDisabled: boolean;\n isFocused: boolean;\n isSelected: boolean;\n }) => {\n return cn(classNames.option, {\n [classNames.option_disabled]: optionIsDisabled,\n [classNames.option_focused]: optionIsFocused,\n [classNames.option_selected]: optionIsSelected,\n });\n },\n placeholder: () => {\n return classNames.placeholder;\n },\n singleValue: () => {\n return cn(classNames.singleValue, `${getValueProps().className}`);\n },\n valueContainer: () => {\n return classNames.valueContainer;\n },\n };\n\n const { getBaseProps, getTriggerProps, getValueProps } = useSelect({\n children: [],\n classNames,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isLoading: loading,\n isRequired: required,\n label,\n labelPlacement: 'outside',\n });\n\n // react-select expects `isDisabled`, while our option contract uses `disabled`.\n const reactSelectOptions = options.map((option) => {\n return {\n ...option,\n isDisabled: option.disabled,\n };\n });\n\n // Compute selected option(s) for react-select\n //\n // Priority for finding options:\n // 1. Look in current options list\n // 2. Use selectedOptionFallback prop (for async selects with pre-fetched data)\n // 3. Create fallback with value as label\n //\n // Handles edge cases:\n // - Compares as strings to support both string and number values\n // - Returns null for empty single-select (required by react-select to clear)\n // - Creates fallback options when value exists but isn't in options list\n // (common with async selects where options change after selection)\n const reactSelectValue = (() => {\n // Helper to find option by value\n const findOption = (v: string | number): SelectOption => {\n // First, look in options list\n const inOptions = options.find((option) => {\n return String(option.value) === String(v);\n });\n if (inOptions) {\n return inOptions;\n }\n\n // Second, look in selectedOptionFallback prop (for async selects)\n if (selectedOptionFallback) {\n if (Array.isArray(selectedOptionFallback)) {\n const inSelected = selectedOptionFallback.find((option) => {\n return String(option.value) === String(v);\n });\n if (inSelected) {\n return inSelected;\n }\n } else if (String(selectedOptionFallback.value) === String(v)) {\n return selectedOptionFallback;\n }\n }\n\n // Fallback: create option with value as label, marked as fallback\n return { isFallback: true, label: String(v), value: v };\n };\n\n if (multiSelect) {\n if (!Array.isArray(value) || isValueEmpty(value)) {\n return [];\n }\n return value.map((v) => {\n return findOption(v);\n });\n }\n\n // Single select - use isValueEmpty to handle marker strings (__NULL__, etc.)\n if (isValueEmpty(value)) {\n return null;\n }\n return findOption(value);\n })();\n\n // Handle selection change\n const handleChange = (\n option: MultiValue<SelectOption> | SingleValue<SelectOption>,\n ) => {\n if (readOnly) {\n return;\n }\n if (multiSelect) {\n onChange(\n (option as SelectOption[])?.map((_option) => {\n return convertToOriginalType(_option.value);\n }),\n );\n } else {\n const newValue = (option as SelectOption)?.value;\n // Pass null explicitly when clearing (not undefined)\n onChange(newValue != null ? convertToOriginalType(newValue) : null);\n }\n\n // Mark field as touched immediately when a selection is made if not already touched\n // This ensures validation errors show right away (isTouched becomes true)\n // For Select components, selecting an option is a complete user action\n // (unlike text inputs where typing is ongoing), so we mark as touched immediately\n const { isTouched: currentIsTouched } = getFieldState(name, testId);\n if (!currentIsTouched) {\n // Defer blur/touched notification until after the onChange value commit.\n // This prevents \"one render cycle behind\" validation states where blur\n // validation runs against the previous value.\n queueMicrotask(() => {\n onBlur();\n });\n }\n };\n\n // Read-only selects keep their value, so they never clear or open the menu.\n const isClearable = clearable && !readOnly;\n let menuIsOpen: boolean | undefined;\n if (readOnly) {\n menuIsOpen = false;\n } else if (debugMenuOpen) {\n menuIsOpen = true;\n }\n\n // Handle blur event\n const handleBlur = () => {\n setIsFocused(false);\n onBlur();\n };\n\n // Handle focus event\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n return (\n <div\n {...getBaseProps()}\n className={classNames.base}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-required={required}\n data-testid={`${testId}_wrapper`}\n >\n {label ? (\n <label\n className={classNames.label}\n data-slot=\"label\"\n htmlFor={`react-select-${name}-input`}\n id={getLabelProps().id}\n >\n {label}\n {required ? (\n <span aria-hidden className=\"ml-0.5 text-danger\">\n *\n </span>\n ) : null}\n </label>\n ) : null}\n <ReactSelect\n ref={ref}\n aria-errormessage=\"\"\n aria-invalid={invalid}\n aria-label={ariaLabel}\n // set aria-labelledby to the label id so that the select is accessible\n aria-labelledby={\n label\n ? getTriggerProps()['aria-labelledby']?.split(' ')[1]\n : undefined\n }\n // forwarded to the input by InputComponent\n aria-readonly={readOnly || undefined}\n // react-select has no read-only mode: the control stays focusable,\n // while value removal, clearing, search, and the menu are blocked\n backspaceRemovesValue={!readOnly}\n classNames={reactSelectClassNames}\n components={{\n Control: ControlComponent,\n DropdownIndicator: DropdownIndicatorComponent,\n Input: InputComponent,\n ...(readOnly ? { MultiValueRemove: hiddenComponent } : {}),\n Option: OptionComponent,\n }}\n // Does not affect the testId of the select, but is needed to pass it to sub-components\n data-testid={testId}\n filterOption={filterOption}\n formatOptionLabel={renderOptionLabel}\n // a pending search hides the selected value, read-only selects show it\n inputValue={readOnly ? '' : inputValue}\n instanceId={name}\n isClearable={isClearable}\n isDisabled={disabled}\n isLoading={loading}\n isMulti={multiSelect}\n isSearchable={!readOnly}\n menuIsOpen={menuIsOpen}\n // set menuPosition to fixed so that menu can be rendered\n // inside Card / Modal components, menuShouldBlockScroll\n // prevents container scroll when menu is open\n menuPosition=\"fixed\"\n menuShouldBlockScroll\n name={name}\n noOptionsMessage={renderEmptyOptions}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n onInputChange={onInputChange}\n options={reactSelectOptions}\n placeholder={placeholder}\n unstyled\n value={reactSelectValue}\n />\n {invalid ? (\n <div {...getHelperWrapperProps()}>\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Select;\n","import Select from './Select';\n\nexport type { SelectProps, SelectOption } from './Select';\n\nexport { selectVariants } from './Select';\n\nexport default Select;\n"],"mappings":";;;;;;;;;;AAKA,MAAa,kBAA2C,UAAU;CAGhE,MAAM,SAAS,GAAG,MAAM,YAAY;CAGpC,MAAM,eAAe,MAAM,YAAY;CACvC,OACE,oBAAC,WAAW,OAAZ;EACE,iBAAe;EACf,eAAa;EACb,GAAI;CACL,CAAA;AAEL;;AAGA,MAAa,oBAA+C,UAAU;CAGpE,MAAM,SAAS,GAAG,MAAM,YAAY,eAAe;CACnD,OACE,oBAAC,OAAD;EAAK,eAAa;EAChB,UAAA,oBAAC,WAAW,SAAZ,EAAoB,GAAI,MAAQ,CAAA;CAC7B,CAAA;AAET;;AAGA,MAAa,mBAA6C,UAAU;CAClE,MAAM,EAAE,eAAe;CAGvB,MAAM,SAAS,GAAG,MAAM,YAAY,eAAe,iBAAiB,QAAQ,OAAO,OAAO,MAAM,UAAU,OAAO,MAAM,KAAK,GAAG,EAAE,aAAa,KAAK,CAAC;CACpJ,OACE,oBAAC,OAAD;EAAK,iBAAe,aAAa,OAAO,KAAA;EAAW,eAAa;EAC9D,UAAA,oBAAC,WAAW,QAAZ,EAAmB,GAAI,MAAQ,CAAA;CAC5B,CAAA;AAET;;AAGA,MAAa,8BACX,UACG;CAEH,MAAM,SAAS,OAAO,YAAY;CAClC,OACE,oBAAC,OAAD;EAAK,eAAa,GAAG,OAAO;EAC1B,UAAA,oBAAC,WAAW,mBAAZ,EAA8B,GAAI,MAAQ,CAAA;CACvC,CAAA;AAET;;ACnCA,MAAa,iBAAiB,GAAG;CAC/B,OAAO;EACL,MAAM;GAEJ;GAEA;GAEA;GAE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