jaci-ui 0.3.0 → 0.4.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +48 -0
  3. package/dist/components/calendar/calendar.cjs +377 -0
  4. package/dist/components/calendar/calendar.cjs.map +1 -0
  5. package/dist/components/calendar/calendar.d.cts +56 -0
  6. package/dist/components/calendar/calendar.d.ts +56 -0
  7. package/dist/components/calendar/calendar.js +368 -0
  8. package/dist/components/calendar/calendar.js.map +1 -0
  9. package/dist/components/calendar/index.d.cts +2 -0
  10. package/dist/components/calendar/index.d.ts +2 -0
  11. package/dist/components/combobox/combobox.cjs +13 -1
  12. package/dist/components/combobox/combobox.cjs.map +1 -1
  13. package/dist/components/combobox/combobox.d.cts +7 -2
  14. package/dist/components/combobox/combobox.d.ts +7 -2
  15. package/dist/components/combobox/combobox.js +13 -2
  16. package/dist/components/combobox/combobox.js.map +1 -1
  17. package/dist/components/combobox/index.d.cts +2 -2
  18. package/dist/components/combobox/index.d.ts +2 -2
  19. package/dist/components/controls/input.cjs +26 -5
  20. package/dist/components/controls/input.cjs.map +1 -1
  21. package/dist/components/controls/input.d.cts +5 -2
  22. package/dist/components/controls/input.d.ts +5 -2
  23. package/dist/components/controls/input.js +28 -7
  24. package/dist/components/controls/input.js.map +1 -1
  25. package/dist/components/controls/textarea.cjs +26 -5
  26. package/dist/components/controls/textarea.cjs.map +1 -1
  27. package/dist/components/controls/textarea.d.cts +5 -2
  28. package/dist/components/controls/textarea.d.ts +5 -2
  29. package/dist/components/controls/textarea.js +28 -7
  30. package/dist/components/controls/textarea.js.map +1 -1
  31. package/dist/components/date-picker/date-picker.cjs +9 -9
  32. package/dist/components/date-picker/date-picker.cjs.map +1 -1
  33. package/dist/components/date-picker/date-picker.d.cts +3 -1
  34. package/dist/components/date-picker/date-picker.d.ts +3 -1
  35. package/dist/components/date-picker/date-picker.js +9 -9
  36. package/dist/components/date-picker/date-picker.js.map +1 -1
  37. package/dist/components/date-range-picker/date-range-picker.cjs +589 -0
  38. package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -0
  39. package/dist/components/date-range-picker/date-range-picker.d.cts +134 -0
  40. package/dist/components/date-range-picker/date-range-picker.d.ts +134 -0
  41. package/dist/components/date-range-picker/date-range-picker.js +568 -0
  42. package/dist/components/date-range-picker/date-range-picker.js.map +1 -0
  43. package/dist/components/date-range-picker/index.d.cts +2 -0
  44. package/dist/components/date-range-picker/index.d.ts +2 -0
  45. package/dist/components/field/field.cjs +106 -11
  46. package/dist/components/field/field.cjs.map +1 -1
  47. package/dist/components/field/field.d.cts +22 -4
  48. package/dist/components/field/field.d.ts +22 -4
  49. package/dist/components/field/field.js +107 -13
  50. package/dist/components/field/field.js.map +1 -1
  51. package/dist/components/field/index.d.cts +2 -2
  52. package/dist/components/field/index.d.ts +2 -2
  53. package/dist/components/pin-input/index.d.cts +2 -0
  54. package/dist/components/pin-input/index.d.ts +2 -0
  55. package/dist/components/pin-input/pin-input.cjs +266 -0
  56. package/dist/components/pin-input/pin-input.cjs.map +1 -0
  57. package/dist/components/pin-input/pin-input.d.cts +46 -0
  58. package/dist/components/pin-input/pin-input.d.ts +46 -0
  59. package/dist/components/pin-input/pin-input.js +258 -0
  60. package/dist/components/pin-input/pin-input.js.map +1 -0
  61. package/dist/components/select/index.d.cts +2 -2
  62. package/dist/components/select/index.d.ts +2 -2
  63. package/dist/components/select/select.cjs +80 -3
  64. package/dist/components/select/select.cjs.map +1 -1
  65. package/dist/components/select/select.d.cts +18 -3
  66. package/dist/components/select/select.d.ts +18 -3
  67. package/dist/components/select/select.js +78 -5
  68. package/dist/components/select/select.js.map +1 -1
  69. package/dist/components/tags-input/tags-input.cjs +83 -5
  70. package/dist/components/tags-input/tags-input.cjs.map +1 -1
  71. package/dist/components/tags-input/tags-input.d.cts +3 -0
  72. package/dist/components/tags-input/tags-input.d.ts +3 -0
  73. package/dist/components/tags-input/tags-input.js +83 -5
  74. package/dist/components/tags-input/tags-input.js.map +1 -1
  75. package/dist/components/upload/index.d.cts +2 -2
  76. package/dist/components/upload/index.d.ts +2 -2
  77. package/dist/components/upload/upload.cjs +90 -10
  78. package/dist/components/upload/upload.cjs.map +1 -1
  79. package/dist/components/upload/upload.d.cts +25 -2
  80. package/dist/components/upload/upload.d.ts +25 -2
  81. package/dist/components/upload/upload.js +89 -11
  82. package/dist/components/upload/upload.js.map +1 -1
  83. package/dist/index.cjs +52 -1
  84. package/dist/index.d.cts +11 -5
  85. package/dist/index.d.ts +11 -5
  86. package/dist/index.js +9 -6
  87. package/dist/styled-system/recipes/calendar.cjs +43 -0
  88. package/dist/styled-system/recipes/calendar.cjs.map +1 -0
  89. package/dist/styled-system/recipes/calendar.js +43 -0
  90. package/dist/styled-system/recipes/calendar.js.map +1 -0
  91. package/dist/styled-system/recipes/combobox.cjs +1 -0
  92. package/dist/styled-system/recipes/combobox.cjs.map +1 -1
  93. package/dist/styled-system/recipes/combobox.js +1 -0
  94. package/dist/styled-system/recipes/combobox.js.map +1 -1
  95. package/dist/styled-system/recipes/date-range-picker.cjs +52 -0
  96. package/dist/styled-system/recipes/date-range-picker.cjs.map +1 -0
  97. package/dist/styled-system/recipes/date-range-picker.js +52 -0
  98. package/dist/styled-system/recipes/date-range-picker.js.map +1 -0
  99. package/dist/styled-system/recipes/pin-input.cjs +39 -0
  100. package/dist/styled-system/recipes/pin-input.cjs.map +1 -0
  101. package/dist/styled-system/recipes/pin-input.js +39 -0
  102. package/dist/styled-system/recipes/pin-input.js.map +1 -0
  103. package/dist/styled-system/recipes/select.cjs +5 -1
  104. package/dist/styled-system/recipes/select.cjs.map +1 -1
  105. package/dist/styled-system/recipes/select.js +5 -1
  106. package/dist/styled-system/recipes/select.js.map +1 -1
  107. package/dist/styled-system/recipes/upload.cjs +2 -0
  108. package/dist/styled-system/recipes/upload.cjs.map +1 -1
  109. package/dist/styled-system/recipes/upload.js +2 -0
  110. package/dist/styled-system/recipes/upload.js.map +1 -1
  111. package/dist/styles.css +745 -81
  112. package/package.json +3 -2
@@ -0,0 +1,258 @@
1
+ "use client";
2
+ import { cx } from "../../styled-system/css/cx.js";
3
+ import { pinInput } from "../../styled-system/recipes/pin-input.js";
4
+ import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/pin-input/pin-input.tsx
7
+ const PinInputContext = createContext(null);
8
+ function digitKey(index) {
9
+ return `digit-${index}`;
10
+ }
11
+ function usePinInputContext() {
12
+ const context = useContext(PinInputContext);
13
+ if (!context) throw new Error("PinInput parts must be rendered inside PinInput.Root.");
14
+ return context;
15
+ }
16
+ const PinInputRoot = forwardRef(function PinInputRoot({ autoFocus = false, children, className, defaultValue = "", disabled = false, id: providedId, invalid = false, length, name, onValueChange, onComplete, otp = false, type = "text", value: controlledValue, ...props }, ref) {
17
+ const generatedId = useId();
18
+ const id = providedId ?? generatedId;
19
+ const styles = pinInput();
20
+ const safeLength = Math.max(1, Math.floor(length));
21
+ const [uncontrolledValue, setUncontrolledValue] = useState(() => defaultValue.slice(0, safeLength));
22
+ const value = (controlledValue ?? uncontrolledValue).slice(0, safeLength);
23
+ const inputRefs = useRef([]);
24
+ const composingRef = useRef(false);
25
+ const updateValue = useCallback((next) => {
26
+ const normalized = next.slice(0, safeLength);
27
+ if (controlledValue === void 0) setUncontrolledValue(normalized);
28
+ onValueChange?.(normalized);
29
+ if (normalized.length === safeLength) onComplete?.(normalized);
30
+ }, [
31
+ controlledValue,
32
+ onComplete,
33
+ onValueChange,
34
+ safeLength
35
+ ]);
36
+ const normalize = useCallback((next) => {
37
+ const characters = Array.from(next);
38
+ return (otp ? characters.filter((character) => /[0-9]/u.test(character)) : characters).join("").slice(0, safeLength);
39
+ }, [otp, safeLength]);
40
+ const focusIndex = useCallback((index) => {
41
+ inputRefs.current[Math.max(0, Math.min(safeLength - 1, index))]?.focus();
42
+ }, [safeLength]);
43
+ const onInput = useCallback((index, nextCharacter) => {
44
+ if (composingRef.current) return;
45
+ const characters = Array.from(value);
46
+ const next = normalize(nextCharacter).slice(-1);
47
+ characters[index] = next;
48
+ const nextValue = characters.join("").slice(0, safeLength);
49
+ updateValue(nextValue);
50
+ if (next) focusIndex(index + 1);
51
+ }, [
52
+ focusIndex,
53
+ normalize,
54
+ safeLength,
55
+ updateValue,
56
+ value
57
+ ]);
58
+ const onCompositionStart = useCallback(() => {
59
+ composingRef.current = true;
60
+ }, []);
61
+ const onCompositionEnd = useCallback((index, event) => {
62
+ composingRef.current = false;
63
+ onInput(index, event.currentTarget.value);
64
+ }, [onInput]);
65
+ const onPaste = useCallback((index, event) => {
66
+ event.preventDefault();
67
+ const pasted = normalize(event.clipboardData.getData("text"));
68
+ if (!pasted) return;
69
+ const characters = Array.from(value);
70
+ Array.from(pasted).forEach((character, offset) => {
71
+ if (index + offset < safeLength) characters[index + offset] = character;
72
+ });
73
+ const nextValue = characters.join("").slice(0, safeLength);
74
+ updateValue(nextValue);
75
+ focusIndex(Math.min(safeLength - 1, index + pasted.length));
76
+ }, [
77
+ focusIndex,
78
+ normalize,
79
+ safeLength,
80
+ updateValue,
81
+ value
82
+ ]);
83
+ const context = {
84
+ disabled,
85
+ id,
86
+ invalid,
87
+ inputRefs,
88
+ length: safeLength,
89
+ onInput,
90
+ onCompositionEnd,
91
+ onCompositionStart,
92
+ onKeyDown: useCallback((index, event) => {
93
+ if (event.key === "Backspace" && !event.currentTarget.value && index > 0) {
94
+ event.preventDefault();
95
+ const characters = Array.from(value);
96
+ characters[index - 1] = "";
97
+ updateValue(characters.join(""));
98
+ focusIndex(index - 1);
99
+ } else if (event.key === "ArrowLeft") {
100
+ event.preventDefault();
101
+ focusIndex(index - 1);
102
+ } else if (event.key === "ArrowRight") {
103
+ event.preventDefault();
104
+ focusIndex(index + 1);
105
+ } else if (event.key === "Home") {
106
+ event.preventDefault();
107
+ focusIndex(0);
108
+ } else if (event.key === "End") {
109
+ event.preventDefault();
110
+ focusIndex(safeLength - 1);
111
+ }
112
+ }, [
113
+ focusIndex,
114
+ safeLength,
115
+ updateValue,
116
+ value
117
+ ]),
118
+ onPaste,
119
+ otp,
120
+ styles,
121
+ type,
122
+ value
123
+ };
124
+ useEffect(() => {
125
+ if (autoFocus) inputRefs.current[0]?.focus();
126
+ }, [autoFocus]);
127
+ return /* @__PURE__ */ jsxs("div", {
128
+ ...props,
129
+ className: cx(styles.root, className),
130
+ "data-disabled": disabled || void 0,
131
+ "data-invalid": invalid || void 0,
132
+ "data-jaci-component": "pin-input",
133
+ "data-slot": "pin-input",
134
+ id,
135
+ ref,
136
+ children: [/* @__PURE__ */ jsx(PinInputContext.Provider, {
137
+ value: context,
138
+ children
139
+ }), name ? /* @__PURE__ */ jsx("input", {
140
+ "aria-hidden": "true",
141
+ className: styles.hiddenInput,
142
+ disabled,
143
+ name,
144
+ tabIndex: -1,
145
+ value,
146
+ readOnly: true
147
+ }) : null]
148
+ });
149
+ });
150
+ const PinInputLabel = forwardRef(function PinInputLabel({ className, ...props }, ref) {
151
+ const { id, styles } = usePinInputContext();
152
+ return /* @__PURE__ */ jsx("label", {
153
+ ...props,
154
+ className: cx(styles.label, className),
155
+ "data-slot": "pin-input-label",
156
+ htmlFor: props.htmlFor ?? `${id}-0`,
157
+ ref
158
+ });
159
+ });
160
+ const PinInputControl = forwardRef(function PinInputControl({ className, ...props }, ref) {
161
+ const { styles } = usePinInputContext();
162
+ return /* @__PURE__ */ jsx("div", {
163
+ ...props,
164
+ className: cx(styles.control, className),
165
+ "data-slot": "pin-input-control",
166
+ ref
167
+ });
168
+ });
169
+ const PinInputInputs = forwardRef(function PinInputInputs({ className, ...props }, ref) {
170
+ const { length, styles } = usePinInputContext();
171
+ return /* @__PURE__ */ jsx("div", {
172
+ ...props,
173
+ className: cx(styles.inputs, className),
174
+ "data-slot": "pin-input-inputs",
175
+ ref,
176
+ children: Array.from({ length }, (_, index) => /* @__PURE__ */ jsx(PinInputInput, { index }, digitKey(index)))
177
+ });
178
+ });
179
+ const PinInputInput = forwardRef(function PinInputInput({ className, index, id, onCompositionEnd: onInputCompositionEnd, onCompositionStart: onInputCompositionStart, ...props }, ref) {
180
+ const { disabled, id: rootId, inputRefs, invalid, length, onInput, onCompositionEnd, onCompositionStart, onKeyDown, onPaste, otp, styles, type, value } = usePinInputContext();
181
+ return /* @__PURE__ */ jsx("input", {
182
+ ...props,
183
+ "aria-label": props["aria-label"] ?? `Digit ${index + 1} of ${length}`,
184
+ "aria-invalid": invalid || void 0,
185
+ autoComplete: otp ? "one-time-code" : props.autoComplete,
186
+ className: cx(styles.input, className),
187
+ "data-slot": "pin-input-input",
188
+ disabled: disabled || props.disabled,
189
+ id: id ?? `${rootId}-${index}`,
190
+ inputMode: otp ? "numeric" : props.inputMode,
191
+ maxLength: 1,
192
+ onChange: (event) => onInput(index, event.currentTarget.value),
193
+ onCompositionEnd: (event) => {
194
+ onCompositionEnd(index, event);
195
+ onInputCompositionEnd?.(event);
196
+ },
197
+ onCompositionStart: (event) => {
198
+ onCompositionStart();
199
+ onInputCompositionStart?.(event);
200
+ },
201
+ onKeyDown: (event) => onKeyDown(index, event),
202
+ onPaste: (event) => onPaste(index, event),
203
+ ref: (node) => {
204
+ inputRefs.current[index] = node;
205
+ if (typeof ref === "function") ref(node);
206
+ else if (ref) ref.current = node;
207
+ },
208
+ type,
209
+ value: Array.from(value)[index] ?? ""
210
+ });
211
+ });
212
+ const PinInputDescription = forwardRef(function PinInputDescription({ className, ...props }, ref) {
213
+ const { styles } = usePinInputContext();
214
+ return /* @__PURE__ */ jsx("p", {
215
+ ...props,
216
+ className: cx(styles.description, className),
217
+ "data-slot": "pin-input-description",
218
+ ref
219
+ });
220
+ });
221
+ const PinInputError = forwardRef(function PinInputError({ className, ...props }, ref) {
222
+ const { styles } = usePinInputContext();
223
+ return /* @__PURE__ */ jsx("p", {
224
+ ...props,
225
+ className: cx(styles.error, className),
226
+ "data-slot": "pin-input-error",
227
+ role: "alert",
228
+ ref
229
+ });
230
+ });
231
+ const PinInputHiddenInput = forwardRef(function PinInputHiddenInput(props, ref) {
232
+ const { disabled, styles, value } = usePinInputContext();
233
+ return /* @__PURE__ */ jsx("input", {
234
+ ...props,
235
+ "aria-hidden": "true",
236
+ className: styles.hiddenInput,
237
+ disabled: disabled || props.disabled,
238
+ readOnly: true,
239
+ ref,
240
+ tabIndex: -1,
241
+ type: "hidden",
242
+ value
243
+ });
244
+ });
245
+ const PinInput = {
246
+ Root: PinInputRoot,
247
+ Label: PinInputLabel,
248
+ Control: PinInputControl,
249
+ Inputs: PinInputInputs,
250
+ Input: PinInputInput,
251
+ Description: PinInputDescription,
252
+ Error: PinInputError,
253
+ HiddenInput: PinInputHiddenInput
254
+ };
255
+ //#endregion
256
+ export { PinInput, PinInputControl, PinInputDescription, PinInputError, PinInputHiddenInput, PinInputInput, PinInputInputs, PinInputLabel, PinInputRoot };
257
+
258
+ //# sourceMappingURL=pin-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pin-input.js","names":[],"sources":["../../../src/components/pin-input/pin-input.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport type {\n ClipboardEvent,\n CompositionEvent,\n ComponentPropsWithoutRef,\n KeyboardEvent,\n MutableRefObject,\n ReactNode,\n} from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { pinInput } from \"../../styled-system/recipes\";\n\ninterface PinInputContextValue {\n disabled: boolean;\n id: string;\n invalid: boolean;\n inputRefs: MutableRefObject<Array<HTMLInputElement | null>>;\n length: number;\n onInput: (index: number, value: string) => void;\n onCompositionEnd: (index: number, event: CompositionEvent<HTMLInputElement>) => void;\n onCompositionStart: () => void;\n onKeyDown: (index: number, event: KeyboardEvent<HTMLInputElement>) => void;\n onPaste: (index: number, event: ClipboardEvent<HTMLInputElement>) => void;\n otp: boolean;\n styles: ReturnType<typeof pinInput>;\n type: \"text\" | \"password\";\n value: string;\n}\n\nconst PinInputContext = createContext<PinInputContextValue | null>(null);\n\nfunction digitKey(index: number) {\n return `digit-${index}`;\n}\n\nfunction usePinInputContext() {\n const context = useContext(PinInputContext);\n if (!context) throw new Error(\"PinInput parts must be rendered inside PinInput.Root.\");\n return context;\n}\n\nexport interface PinInputRootProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"defaultValue\"> {\n length: number;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onComplete?: (value: string) => void;\n type?: \"text\" | \"password\";\n otp?: boolean;\n autoFocus?: boolean;\n disabled?: boolean;\n invalid?: boolean;\n name?: string;\n children?: ReactNode;\n}\n\nexport const PinInputRoot = forwardRef<HTMLDivElement, PinInputRootProps>(function PinInputRoot(\n {\n autoFocus = false,\n children,\n className,\n defaultValue = \"\",\n disabled = false,\n id: providedId,\n invalid = false,\n length,\n name,\n onValueChange,\n onComplete,\n otp = false,\n type = \"text\",\n value: controlledValue,\n ...props\n },\n ref,\n) {\n const generatedId = useId();\n const id = providedId ?? generatedId;\n const styles = pinInput();\n const safeLength = Math.max(1, Math.floor(length));\n const [uncontrolledValue, setUncontrolledValue] = useState(() =>\n defaultValue.slice(0, safeLength),\n );\n const value = (controlledValue ?? uncontrolledValue).slice(0, safeLength);\n const inputRefs = useRef<Array<HTMLInputElement | null>>([]);\n const composingRef = useRef(false);\n const updateValue = useCallback(\n (next: string) => {\n const normalized = next.slice(0, safeLength);\n if (controlledValue === undefined) setUncontrolledValue(normalized);\n onValueChange?.(normalized);\n if (normalized.length === safeLength) onComplete?.(normalized);\n },\n [controlledValue, onComplete, onValueChange, safeLength],\n );\n const normalize = useCallback(\n (next: string) => {\n const characters = Array.from(next);\n return (otp ? characters.filter((character) => /[0-9]/u.test(character)) : characters)\n .join(\"\")\n .slice(0, safeLength);\n },\n [otp, safeLength],\n );\n const focusIndex = useCallback(\n (index: number) => {\n inputRefs.current[Math.max(0, Math.min(safeLength - 1, index))]?.focus();\n },\n [safeLength],\n );\n const onInput = useCallback(\n (index: number, nextCharacter: string) => {\n if (composingRef.current) return;\n const characters = Array.from(value);\n const next = normalize(nextCharacter).slice(-1);\n characters[index] = next;\n const nextValue = characters.join(\"\").slice(0, safeLength);\n updateValue(nextValue);\n if (next) focusIndex(index + 1);\n },\n [focusIndex, normalize, safeLength, updateValue, value],\n );\n const onCompositionStart = useCallback(() => {\n composingRef.current = true;\n }, []);\n const onCompositionEnd = useCallback(\n (index: number, event: CompositionEvent<HTMLInputElement>) => {\n composingRef.current = false;\n onInput(index, event.currentTarget.value);\n },\n [onInput],\n );\n const onPaste = useCallback(\n (index: number, event: ClipboardEvent<HTMLInputElement>) => {\n event.preventDefault();\n const pasted = normalize(event.clipboardData.getData(\"text\"));\n if (!pasted) return;\n const characters = Array.from(value);\n Array.from(pasted).forEach((character, offset) => {\n if (index + offset < safeLength) characters[index + offset] = character;\n });\n const nextValue = characters.join(\"\").slice(0, safeLength);\n updateValue(nextValue);\n focusIndex(Math.min(safeLength - 1, index + pasted.length));\n },\n [focusIndex, normalize, safeLength, updateValue, value],\n );\n const onKeyDown = useCallback(\n (index: number, event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Backspace\" && !event.currentTarget.value && index > 0) {\n event.preventDefault();\n const characters = Array.from(value);\n characters[index - 1] = \"\";\n updateValue(characters.join(\"\"));\n focusIndex(index - 1);\n } else if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n focusIndex(index - 1);\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n focusIndex(index + 1);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n focusIndex(0);\n } else if (event.key === \"End\") {\n event.preventDefault();\n focusIndex(safeLength - 1);\n }\n },\n [focusIndex, safeLength, updateValue, value],\n );\n const context: PinInputContextValue = {\n disabled,\n id,\n invalid,\n inputRefs,\n length: safeLength,\n onInput,\n onCompositionEnd,\n onCompositionStart,\n onKeyDown,\n onPaste,\n otp,\n styles,\n type,\n value,\n };\n\n useEffect(() => {\n if (autoFocus) inputRefs.current[0]?.focus();\n }, [autoFocus]);\n\n return (\n <div\n {...props}\n className={cx(styles.root, className)}\n data-disabled={disabled || undefined}\n data-invalid={invalid || undefined}\n data-jaci-component=\"pin-input\"\n data-slot=\"pin-input\"\n id={id}\n ref={ref}\n >\n <PinInputContext.Provider value={context}>{children}</PinInputContext.Provider>\n {name ? (\n <input\n aria-hidden=\"true\"\n className={styles.hiddenInput}\n disabled={disabled}\n name={name}\n tabIndex={-1}\n value={value}\n readOnly\n />\n ) : null}\n </div>\n );\n});\n\nexport type PinInputLabelProps = ComponentPropsWithoutRef<\"label\">;\nexport const PinInputLabel = forwardRef<HTMLLabelElement, PinInputLabelProps>(\n function PinInputLabel({ className, ...props }, ref) {\n const { id, styles } = usePinInputContext();\n return (\n // biome-ignore lint/a11y/noLabelWithoutControl: the generated Inputs slot supplies the control.\n <label\n {...props}\n className={cx(styles.label, className)}\n data-slot=\"pin-input-label\"\n htmlFor={props.htmlFor ?? `${id}-0`}\n ref={ref}\n />\n );\n },\n);\n\nexport type PinInputControlProps = ComponentPropsWithoutRef<\"div\">;\nexport const PinInputControl = forwardRef<HTMLDivElement, PinInputControlProps>(\n function PinInputControl({ className, ...props }, ref) {\n const { styles } = usePinInputContext();\n return (\n <div\n {...props}\n className={cx(styles.control, className)}\n data-slot=\"pin-input-control\"\n ref={ref}\n />\n );\n },\n);\n\nexport type PinInputInputsProps = ComponentPropsWithoutRef<\"div\">;\nexport const PinInputInputs = forwardRef<HTMLDivElement, PinInputInputsProps>(\n function PinInputInputs({ className, ...props }, ref) {\n const { length, styles } = usePinInputContext();\n return (\n <div\n {...props}\n className={cx(styles.inputs, className)}\n data-slot=\"pin-input-inputs\"\n ref={ref}\n >\n {Array.from({ length }, (_, index) => (\n <PinInputInput index={index} key={digitKey(index)} />\n ))}\n </div>\n );\n },\n);\n\nexport interface PinInputInputProps\n extends Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"defaultValue\" | \"onChange\" | \"onKeyDown\" | \"onPaste\" | \"type\" | \"value\"\n > {\n index: number;\n}\nexport const PinInputInput = forwardRef<HTMLInputElement, PinInputInputProps>(\n function PinInputInput(\n {\n className,\n index,\n id,\n onCompositionEnd: onInputCompositionEnd,\n onCompositionStart: onInputCompositionStart,\n ...props\n },\n ref,\n ) {\n const {\n disabled,\n id: rootId,\n inputRefs,\n invalid,\n length,\n onInput,\n onCompositionEnd,\n onCompositionStart,\n onKeyDown,\n onPaste,\n otp,\n styles,\n type,\n value,\n } = usePinInputContext();\n return (\n <input\n {...props}\n aria-label={props[\"aria-label\"] ?? `Digit ${index + 1} of ${length}`}\n aria-invalid={invalid || undefined}\n autoComplete={otp ? \"one-time-code\" : props.autoComplete}\n className={cx(styles.input, className)}\n data-slot=\"pin-input-input\"\n disabled={disabled || props.disabled}\n id={id ?? `${rootId}-${index}`}\n inputMode={otp ? \"numeric\" : props.inputMode}\n maxLength={1}\n onChange={(event) => onInput(index, event.currentTarget.value)}\n onCompositionEnd={(event) => {\n onCompositionEnd(index, event);\n onInputCompositionEnd?.(event);\n }}\n onCompositionStart={(event) => {\n onCompositionStart();\n onInputCompositionStart?.(event);\n }}\n onKeyDown={(event) => onKeyDown(index, event)}\n onPaste={(event) => onPaste(index, event)}\n ref={(node) => {\n inputRefs.current[index] = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n type={type}\n value={Array.from(value)[index] ?? \"\"}\n />\n );\n },\n);\n\nexport type PinInputDescriptionProps = ComponentPropsWithoutRef<\"p\">;\nexport const PinInputDescription = forwardRef<HTMLParagraphElement, PinInputDescriptionProps>(\n function PinInputDescription({ className, ...props }, ref) {\n const { styles } = usePinInputContext();\n return (\n <p\n {...props}\n className={cx(styles.description, className)}\n data-slot=\"pin-input-description\"\n ref={ref}\n />\n );\n },\n);\nexport type PinInputErrorProps = ComponentPropsWithoutRef<\"p\">;\nexport const PinInputError = forwardRef<HTMLParagraphElement, PinInputErrorProps>(\n function PinInputError({ className, ...props }, ref) {\n const { styles } = usePinInputContext();\n return (\n <p\n {...props}\n className={cx(styles.error, className)}\n data-slot=\"pin-input-error\"\n role=\"alert\"\n ref={ref}\n />\n );\n },\n);\nexport type PinInputHiddenInputProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"name\" | \"type\" | \"value\"\n>;\nexport const PinInputHiddenInput = forwardRef<HTMLInputElement, PinInputHiddenInputProps>(\n function PinInputHiddenInput(props, ref) {\n const { disabled, styles, value } = usePinInputContext();\n return (\n <input\n {...props}\n aria-hidden=\"true\"\n className={styles.hiddenInput}\n disabled={disabled || props.disabled}\n readOnly\n ref={ref}\n tabIndex={-1}\n type=\"hidden\"\n value={value}\n />\n );\n },\n);\n\nexport const PinInput = {\n Root: PinInputRoot,\n Label: PinInputLabel,\n Control: PinInputControl,\n Inputs: PinInputInputs,\n Input: PinInputInput,\n Description: PinInputDescription,\n Error: PinInputError,\n HiddenInput: PinInputHiddenInput,\n};\n"],"mappings":";;;;;;AAyCA,MAAM,kBAAkB,cAA2C,IAAI;AAEvE,SAAS,SAAS,OAAe;CAC/B,OAAO,SAAS;AAClB;AAEA,SAAS,qBAAqB;CAC5B,MAAM,UAAU,WAAW,eAAe;CAC1C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,uDAAuD;CACrF,OAAO;AACT;AAkBA,MAAa,eAAe,WAA8C,SAAS,aACjF,EACE,YAAY,OACZ,UACA,WACA,eAAe,IACf,WAAW,OACX,IAAI,YACJ,UAAU,OACV,QACA,MACA,eACA,YACA,MAAM,OACN,OAAO,QACP,OAAO,iBACP,GAAG,SAEL,KACA;CACA,MAAM,cAAc,MAAM;CAC1B,MAAM,KAAK,cAAc;CACzB,MAAM,SAAS,SAAS;CACxB,MAAM,aAAa,KAAK,IAAI,GAAG,KAAK,MAAM,MAAM,CAAC;CACjD,MAAM,CAAC,mBAAmB,wBAAwB,eAChD,aAAa,MAAM,GAAG,UAAU,CAClC;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EAAE,WAAW,GAAG,SAAS,KAAK;CACnD,MAAM,EAAE,WAAW,mBAAmB;CACtC,OACE,oBAAC,KAAD;EACE,GAAI;EACJ,WAAW,GAAG,OAAO,OAAO,SAAS;EACrC,aAAU;EACV,MAAK;EACA;CACN,CAAA;AAEL,CACF;AAKA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,OAAO,KAAK;CACvC,MAAM,EAAE,UAAU,QAAQ,UAAU,mBAAmB;CACvD,OACE,oBAAC,SAAD;EACE,GAAI;EACJ,eAAY;EACZ,WAAW,OAAO;EAClB,UAAU,YAAY,MAAM;EAC5B,UAAA;EACK;EACL,UAAU;EACV,MAAK;EACE;CACR,CAAA;AAEL,CACF;AAEA,MAAa,WAAW;CACtB,MAAM;CACN,OAAO;CACP,SAAS;CACT,QAAQ;CACR,OAAO;CACP,aAAa;CACb,OAAO;CACP,aAAa;AACf"}
@@ -1,2 +1,2 @@
1
- import { Select, SelectGroup, SelectGroupLabel, SelectGroupLabelProps, SelectGroupProps, SelectIcon, SelectIconProps, SelectItem, SelectItemIndicator, SelectItemIndicatorProps, SelectItemProps, SelectItemText, SelectItemTextProps, SelectLabel, SelectLabelProps, SelectList, SelectListProps, SelectPopup, SelectPopupProps, SelectPortal, SelectPositioner, SelectPositionerProps, SelectRoot, SelectRootProps, SelectSeparator, SelectSeparatorProps, SelectSize, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps } from "./select.cjs";
2
- export { Select, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectLabel, type SelectLabelProps, SelectList, type SelectListProps, SelectPopup, type SelectPopupProps, SelectPortal, SelectPositioner, type SelectPositionerProps, SelectRoot, type SelectRootProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps };
1
+ import { Select, SelectClear, SelectClearProps, SelectEmpty, SelectEmptyProps, SelectGroup, SelectGroupLabel, SelectGroupLabelProps, SelectGroupProps, SelectIcon, SelectIconProps, SelectItem, SelectItemIndicator, SelectItemIndicatorProps, SelectItemProps, SelectItemText, SelectItemTextProps, SelectLabel, SelectLabelProps, SelectList, SelectListProps, SelectLoading, SelectLoadingProps, SelectPopup, SelectPopupProps, SelectPortal, SelectPositioner, SelectPositionerProps, SelectRoot, SelectRootProps, SelectSeparator, SelectSeparatorProps, SelectSize, SelectStatus, SelectStatusProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps } from "./select.cjs";
2
+ export { Select, SelectClear, type SelectClearProps, SelectEmpty, type SelectEmptyProps, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectLabel, type SelectLabelProps, SelectList, type SelectListProps, SelectLoading, type SelectLoadingProps, SelectPopup, type SelectPopupProps, SelectPortal, SelectPositioner, type SelectPositionerProps, SelectRoot, type SelectRootProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, SelectStatus, type SelectStatusProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps };
@@ -1,2 +1,2 @@
1
- import { Select, SelectGroup, SelectGroupLabel, SelectGroupLabelProps, SelectGroupProps, SelectIcon, SelectIconProps, SelectItem, SelectItemIndicator, SelectItemIndicatorProps, SelectItemProps, SelectItemText, SelectItemTextProps, SelectLabel, SelectLabelProps, SelectList, SelectListProps, SelectPopup, SelectPopupProps, SelectPortal, SelectPositioner, SelectPositionerProps, SelectRoot, SelectRootProps, SelectSeparator, SelectSeparatorProps, SelectSize, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps } from "./select.js";
2
- export { Select, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectLabel, type SelectLabelProps, SelectList, type SelectListProps, SelectPopup, type SelectPopupProps, SelectPortal, SelectPositioner, type SelectPositionerProps, SelectRoot, type SelectRootProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps };
1
+ import { Select, SelectClear, SelectClearProps, SelectEmpty, SelectEmptyProps, SelectGroup, SelectGroupLabel, SelectGroupLabelProps, SelectGroupProps, SelectIcon, SelectIconProps, SelectItem, SelectItemIndicator, SelectItemIndicatorProps, SelectItemProps, SelectItemText, SelectItemTextProps, SelectLabel, SelectLabelProps, SelectList, SelectListProps, SelectLoading, SelectLoadingProps, SelectPopup, SelectPopupProps, SelectPortal, SelectPositioner, SelectPositionerProps, SelectRoot, SelectRootProps, SelectSeparator, SelectSeparatorProps, SelectSize, SelectStatus, SelectStatusProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps } from "./select.js";
2
+ export { Select, SelectClear, type SelectClearProps, SelectEmpty, type SelectEmptyProps, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectLabel, type SelectLabelProps, SelectList, type SelectListProps, SelectLoading, type SelectLoadingProps, SelectPopup, type SelectPopupProps, SelectPortal, SelectPositioner, type SelectPositionerProps, SelectRoot, type SelectRootProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, SelectStatus, type SelectStatusProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps };
@@ -7,13 +7,37 @@ let react_jsx_runtime = require("react/jsx-runtime");
7
7
  let _base_ui_react_select = require("@base-ui/react/select");
8
8
  //#region src/components/select/select.tsx
9
9
  const SelectSizeContext = (0, react.createContext)("md");
10
+ const SelectAuxContext = (0, react.createContext)(null);
10
11
  function useSelectStyles() {
11
12
  return require_select.select({ size: (0, react.useContext)(SelectSizeContext) });
12
13
  }
13
- function SelectRoot({ size = "md", ...props }) {
14
+ function SelectRoot({ defaultValue, disabled = false, loading: _loading, multiple, onValueChange, size = "md", value: controlledValue, ...props }) {
15
+ const [uncontrolledValue, setUncontrolledValue] = (0, react.useState)(defaultValue ?? (multiple ? [] : null));
16
+ const value = controlledValue === void 0 ? uncontrolledValue : controlledValue;
17
+ const clear = () => {
18
+ const nextValue = multiple ? [] : null;
19
+ if (controlledValue === void 0) setUncontrolledValue(nextValue);
20
+ onValueChange?.(nextValue, void 0);
21
+ };
14
22
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectSizeContext.Provider, {
15
23
  value: size,
16
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Root, { ...props })
24
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectAuxContext.Provider, {
25
+ value: {
26
+ clear,
27
+ disabled
28
+ },
29
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Root, {
30
+ ...props,
31
+ disabled,
32
+ defaultValue: void 0,
33
+ multiple,
34
+ onValueChange: (nextValue, details) => {
35
+ if (controlledValue === void 0) setUncontrolledValue(nextValue);
36
+ onValueChange?.(nextValue, details);
37
+ },
38
+ value
39
+ })
40
+ })
17
41
  });
18
42
  }
19
43
  /** An accessible label that Base UI associates with the trigger automatically. */
@@ -133,6 +157,51 @@ const SelectSeparator = (0, react.forwardRef)(function SelectSeparator({ classNa
133
157
  "data-slot": "select-separator"
134
158
  });
135
159
  });
160
+ const SelectClear = (0, react.forwardRef)(function SelectClear({ children = "×", className, ...props }, ref) {
161
+ const context = (0, react.useContext)(SelectAuxContext);
162
+ const styles = useSelectStyles();
163
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
164
+ ...props,
165
+ "aria-label": props["aria-label"] ?? "Clear selection",
166
+ className: require_cx.cx(styles.clear, className),
167
+ "data-slot": "select-clear",
168
+ disabled: props.disabled || context?.disabled,
169
+ onClick: (event) => {
170
+ context?.clear();
171
+ props.onClick?.(event);
172
+ },
173
+ ref,
174
+ type: "button",
175
+ children
176
+ });
177
+ });
178
+ const SelectEmpty = (0, react.forwardRef)(function SelectEmpty({ className, ...props }, ref) {
179
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
180
+ ...props,
181
+ className: require_cx.cx(useSelectStyles().empty, className),
182
+ "data-slot": "select-empty",
183
+ ref
184
+ });
185
+ });
186
+ const SelectLoading = (0, react.forwardRef)(function SelectLoading({ children = "Loading…", className, ...props }, ref) {
187
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
188
+ ...props,
189
+ "aria-live": "polite",
190
+ className: require_cx.cx(useSelectStyles().loading, className),
191
+ "data-slot": "select-loading",
192
+ ref,
193
+ children
194
+ });
195
+ });
196
+ const SelectStatus = (0, react.forwardRef)(function SelectStatus({ className, ...props }, ref) {
197
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
198
+ ...props,
199
+ "aria-live": "polite",
200
+ className: require_cx.cx(useSelectStyles().status, className),
201
+ "data-slot": "select-status",
202
+ ref
203
+ });
204
+ });
136
205
  const Select = {
137
206
  Root: SelectRoot,
138
207
  Label: SelectLabel,
@@ -148,10 +217,16 @@ const Select = {
148
217
  ItemIndicator: SelectItemIndicator,
149
218
  Group: SelectGroup,
150
219
  GroupLabel: SelectGroupLabel,
151
- Separator: SelectSeparator
220
+ Separator: SelectSeparator,
221
+ Clear: SelectClear,
222
+ Empty: SelectEmpty,
223
+ Loading: SelectLoading,
224
+ Status: SelectStatus
152
225
  };
153
226
  //#endregion
154
227
  exports.Select = Select;
228
+ exports.SelectClear = SelectClear;
229
+ exports.SelectEmpty = SelectEmpty;
155
230
  exports.SelectGroup = SelectGroup;
156
231
  exports.SelectGroupLabel = SelectGroupLabel;
157
232
  exports.SelectIcon = SelectIcon;
@@ -160,11 +235,13 @@ exports.SelectItemIndicator = SelectItemIndicator;
160
235
  exports.SelectItemText = SelectItemText;
161
236
  exports.SelectLabel = SelectLabel;
162
237
  exports.SelectList = SelectList;
238
+ exports.SelectLoading = SelectLoading;
163
239
  exports.SelectPopup = SelectPopup;
164
240
  exports.SelectPortal = SelectPortal;
165
241
  exports.SelectPositioner = SelectPositioner;
166
242
  exports.SelectRoot = SelectRoot;
167
243
  exports.SelectSeparator = SelectSeparator;
244
+ exports.SelectStatus = SelectStatus;
168
245
  exports.SelectTrigger = SelectTrigger;
169
246
  exports.SelectValue = SelectValue;
170
247
 
@@ -1 +1 @@
1
- {"version":3,"file":"select.cjs","names":["select","BaseSelect","withRecipeClassName","cx"],"sources":["../../../src/components/select/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { SelectRoot as BaseSelectRoot } from \"@base-ui/react/select\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { select } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type SelectSize = \"sm\" | \"md\" | \"lg\";\n\nconst SelectSizeContext = createContext<SelectSize>(\"md\");\n\nfunction useSelectStyles() {\n return select({ size: useContext(SelectSizeContext) });\n}\n\n/**\n * Groups an accessible listbox select. Use `value`/`onValueChange` for a\n * controlled selection, or `defaultValue` for an uncontrolled selection.\n *\n * `size` is shared by all visual parts so the trigger stays aligned with the\n * library's `Input` component.\n */\nexport interface SelectRootProps<Value, Multiple extends boolean | undefined = false>\n extends BaseSelectRoot.Props<Value, Multiple> {\n size?: SelectSize;\n}\n\nexport function SelectRoot<Value = unknown, Multiple extends boolean | undefined = false>({\n size = \"md\",\n ...props\n}: SelectRootProps<Value, Multiple>) {\n return (\n <SelectSizeContext.Provider value={size}>\n <BaseSelect.Root {...props} />\n </SelectSizeContext.Provider>\n );\n}\n\nexport type SelectLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.Label>;\n\n/** An accessible label that Base UI associates with the trigger automatically. */\nexport const SelectLabel = forwardRef<HTMLDivElement, SelectLabelProps>(function SelectLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().label, className)}\n data-slot=\"select-label\"\n />\n );\n});\n\nexport type SelectTriggerProps = ComponentPropsWithoutRef<typeof BaseSelect.Trigger>;\n\n/** The button-shaped control that opens the select popup. */\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n function SelectTrigger({ className, ...props }, ref) {\n return (\n <BaseSelect.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().trigger, className)}\n data-jaci-component=\"select\"\n data-slot=\"select-trigger\"\n />\n );\n },\n);\n\nexport type SelectValueProps = ComponentPropsWithoutRef<typeof BaseSelect.Value>;\n\n/** Renders the selected item's label, or its placeholder when empty. */\nexport const SelectValue = forwardRef<HTMLSpanElement, SelectValueProps>(function SelectValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().value, className)}\n data-slot=\"select-value\"\n />\n );\n});\n\nexport type SelectIconProps = ComponentPropsWithoutRef<typeof BaseSelect.Icon>;\n\n/** A small chevron that rotates while the popup is open. */\nexport const SelectIcon = forwardRef<HTMLSpanElement, SelectIconProps>(function SelectIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Icon\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().icon, className)}\n data-slot=\"select-icon\"\n >\n {children}\n </BaseSelect.Icon>\n );\n});\n\n/** Preserves Base UI's optional portal container and mount controls. */\nexport const SelectPortal = BaseSelect.Portal;\n\nexport type SelectPositionerProps = ComponentPropsWithoutRef<typeof BaseSelect.Positioner>;\n\nexport const SelectPositioner = forwardRef<HTMLDivElement, SelectPositionerProps>(\n function SelectPositioner({ className, ...props }, ref) {\n return (\n <BaseSelect.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().positioner, className)}\n data-slot=\"select-positioner\"\n />\n );\n },\n);\n\nexport type SelectPopupProps = ComponentPropsWithoutRef<typeof BaseSelect.Popup>;\n\nexport const SelectPopup = forwardRef<HTMLDivElement, SelectPopupProps>(function SelectPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().popup, className)}\n data-slot=\"select-popup\"\n />\n );\n});\n\nexport type SelectListProps = ComponentPropsWithoutRef<typeof BaseSelect.List>;\n\nexport const SelectList = forwardRef<HTMLDivElement, SelectListProps>(function SelectList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().list, className)}\n data-slot=\"select-list\"\n />\n );\n});\n\nexport type SelectItemProps = ComponentPropsWithoutRef<typeof BaseSelect.Item>;\n\nexport const SelectItem = forwardRef<HTMLElement, SelectItemProps>(function SelectItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().item, className)}\n data-slot=\"select-item\"\n />\n );\n});\n\nexport type SelectItemTextProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemText>;\n\nexport const SelectItemText = forwardRef<HTMLDivElement, SelectItemTextProps>(\n function SelectItemText({ className, ...props }, ref) {\n return (\n <BaseSelect.ItemText\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemText, className)}\n data-slot=\"select-item-text\"\n />\n );\n },\n);\n\nexport type SelectItemIndicatorProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemIndicator>;\n\nexport const SelectItemIndicator = forwardRef<HTMLSpanElement, SelectItemIndicatorProps>(\n function SelectItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemIndicator, className)}\n data-slot=\"select-item-indicator\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n },\n);\n\nexport type SelectGroupProps = ComponentPropsWithoutRef<typeof BaseSelect.Group>;\n\nexport const SelectGroup = forwardRef<HTMLDivElement, SelectGroupProps>(function SelectGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().group, className)}\n data-slot=\"select-group\"\n />\n );\n});\n\nexport type SelectGroupLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.GroupLabel>;\n\nexport const SelectGroupLabel = forwardRef<HTMLDivElement, SelectGroupLabelProps>(\n function SelectGroupLabel({ className, ...props }, ref) {\n return (\n <BaseSelect.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().groupLabel, className)}\n data-slot=\"select-group-label\"\n />\n );\n },\n);\n\n/**\n * A visual separator for groups in a listbox. It is intentionally hidden from\n * assistive technology because ARIA listboxes may only contain options or\n * option groups, not semantic separators.\n */\nexport interface SelectSeparatorProps extends ComponentPropsWithoutRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const SelectSeparator = forwardRef<HTMLDivElement, SelectSeparatorProps>(\n function SelectSeparator({ className, orientation = \"horizontal\", ...props }, ref) {\n return (\n <div\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useSelectStyles().separator, className)}\n data-orientation={orientation}\n data-slot=\"select-separator\"\n />\n );\n },\n);\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n Separator: Select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A,CACX,SAAS,gBAAgB,EAAE,WAAW,cAAc,cAAc,GAAG,SAAS,KAAK;CACjF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACJ,eAAY;EACP;EACL,WAAWC,WAAAA,GAAG,gBAAgB,CAAC,CAAC,WAAW,SAAS;EACpD,oBAAkB;EAClB,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,SAAS;CACpB,MAAM;CACN,OAAO;CACP,SAAS;CACT,OAAO;CACP,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,OAAO;CACP,YAAY;CACZ,WAAW;AACb"}
1
+ {"version":3,"file":"select.cjs","names":["select","BaseSelect","withRecipeClassName","cx"],"sources":["../../../src/components/select/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SelectRoot as BaseSelectRoot } from \"@base-ui/react/select\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { select } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type SelectSize = \"sm\" | \"md\" | \"lg\";\n\nconst SelectSizeContext = createContext<SelectSize>(\"md\");\nconst SelectAuxContext = createContext<{ clear: () => void; disabled: boolean } | null>(null);\n\nfunction useSelectStyles() {\n return select({ size: useContext(SelectSizeContext) });\n}\n\n/**\n * Groups an accessible listbox select. Use `value`/`onValueChange` for a\n * controlled selection, or `defaultValue` for an uncontrolled selection.\n *\n * `size` is shared by all visual parts so the trigger stays aligned with the\n * library's `Input` component.\n */\nexport interface SelectRootProps<Value, Multiple extends boolean | undefined = false>\n extends BaseSelectRoot.Props<Value, Multiple> {\n size?: SelectSize;\n loading?: boolean;\n}\n\nexport function SelectRoot<Value = unknown, Multiple extends boolean | undefined = false>({\n defaultValue,\n disabled = false,\n loading: _loading,\n multiple,\n onValueChange,\n size = \"md\",\n value: controlledValue,\n ...props\n}: SelectRootProps<Value, Multiple>) {\n const [uncontrolledValue, setUncontrolledValue] = useState<unknown>(\n defaultValue ?? (multiple ? [] : null),\n );\n const value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const clear = () => {\n const nextValue = multiple ? [] : null;\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue as never, undefined as never);\n };\n return (\n <SelectSizeContext.Provider value={size}>\n <SelectAuxContext.Provider value={{ clear, disabled }}>\n <BaseSelect.Root\n {...props}\n disabled={disabled}\n defaultValue={undefined}\n multiple={multiple}\n onValueChange={(nextValue, details) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue, details);\n }}\n value={value as SelectRootProps<Value, Multiple>[\"value\"]}\n />\n </SelectAuxContext.Provider>\n </SelectSizeContext.Provider>\n );\n}\n\nexport type SelectLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.Label>;\n\n/** An accessible label that Base UI associates with the trigger automatically. */\nexport const SelectLabel = forwardRef<HTMLDivElement, SelectLabelProps>(function SelectLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().label, className)}\n data-slot=\"select-label\"\n />\n );\n});\n\nexport type SelectTriggerProps = ComponentPropsWithoutRef<typeof BaseSelect.Trigger>;\n\n/** The button-shaped control that opens the select popup. */\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n function SelectTrigger({ className, ...props }, ref) {\n return (\n <BaseSelect.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().trigger, className)}\n data-jaci-component=\"select\"\n data-slot=\"select-trigger\"\n />\n );\n },\n);\n\nexport type SelectValueProps = ComponentPropsWithoutRef<typeof BaseSelect.Value>;\n\n/** Renders the selected item's label, or its placeholder when empty. */\nexport const SelectValue = forwardRef<HTMLSpanElement, SelectValueProps>(function SelectValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().value, className)}\n data-slot=\"select-value\"\n />\n );\n});\n\nexport type SelectIconProps = ComponentPropsWithoutRef<typeof BaseSelect.Icon>;\n\n/** A small chevron that rotates while the popup is open. */\nexport const SelectIcon = forwardRef<HTMLSpanElement, SelectIconProps>(function SelectIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Icon\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().icon, className)}\n data-slot=\"select-icon\"\n >\n {children}\n </BaseSelect.Icon>\n );\n});\n\n/** Preserves Base UI's optional portal container and mount controls. */\nexport const SelectPortal = BaseSelect.Portal;\n\nexport type SelectPositionerProps = ComponentPropsWithoutRef<typeof BaseSelect.Positioner>;\n\nexport const SelectPositioner = forwardRef<HTMLDivElement, SelectPositionerProps>(\n function SelectPositioner({ className, ...props }, ref) {\n return (\n <BaseSelect.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().positioner, className)}\n data-slot=\"select-positioner\"\n />\n );\n },\n);\n\nexport type SelectPopupProps = ComponentPropsWithoutRef<typeof BaseSelect.Popup>;\n\nexport const SelectPopup = forwardRef<HTMLDivElement, SelectPopupProps>(function SelectPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().popup, className)}\n data-slot=\"select-popup\"\n />\n );\n});\n\nexport type SelectListProps = ComponentPropsWithoutRef<typeof BaseSelect.List>;\n\nexport const SelectList = forwardRef<HTMLDivElement, SelectListProps>(function SelectList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().list, className)}\n data-slot=\"select-list\"\n />\n );\n});\n\nexport type SelectItemProps = ComponentPropsWithoutRef<typeof BaseSelect.Item>;\n\nexport const SelectItem = forwardRef<HTMLElement, SelectItemProps>(function SelectItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().item, className)}\n data-slot=\"select-item\"\n />\n );\n});\n\nexport type SelectItemTextProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemText>;\n\nexport const SelectItemText = forwardRef<HTMLDivElement, SelectItemTextProps>(\n function SelectItemText({ className, ...props }, ref) {\n return (\n <BaseSelect.ItemText\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemText, className)}\n data-slot=\"select-item-text\"\n />\n );\n },\n);\n\nexport type SelectItemIndicatorProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemIndicator>;\n\nexport const SelectItemIndicator = forwardRef<HTMLSpanElement, SelectItemIndicatorProps>(\n function SelectItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemIndicator, className)}\n data-slot=\"select-item-indicator\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n },\n);\n\nexport type SelectGroupProps = ComponentPropsWithoutRef<typeof BaseSelect.Group>;\n\nexport const SelectGroup = forwardRef<HTMLDivElement, SelectGroupProps>(function SelectGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().group, className)}\n data-slot=\"select-group\"\n />\n );\n});\n\nexport type SelectGroupLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.GroupLabel>;\n\nexport const SelectGroupLabel = forwardRef<HTMLDivElement, SelectGroupLabelProps>(\n function SelectGroupLabel({ className, ...props }, ref) {\n return (\n <BaseSelect.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().groupLabel, className)}\n data-slot=\"select-group-label\"\n />\n );\n },\n);\n\n/**\n * A visual separator for groups in a listbox. It is intentionally hidden from\n * assistive technology because ARIA listboxes may only contain options or\n * option groups, not semantic separators.\n */\nexport interface SelectSeparatorProps extends ComponentPropsWithoutRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const SelectSeparator = forwardRef<HTMLDivElement, SelectSeparatorProps>(\n function SelectSeparator({ className, orientation = \"horizontal\", ...props }, ref) {\n return (\n <div\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useSelectStyles().separator, className)}\n data-orientation={orientation}\n data-slot=\"select-separator\"\n />\n );\n },\n);\n\nexport interface SelectClearProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const SelectClear = forwardRef<HTMLButtonElement, SelectClearProps>(function SelectClear(\n { children = \"×\", className, ...props },\n ref,\n) {\n const context = useContext(SelectAuxContext);\n const styles = useSelectStyles();\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n className={cx(styles.clear, className)}\n data-slot=\"select-clear\"\n disabled={props.disabled || context?.disabled}\n onClick={(event) => {\n context?.clear();\n props.onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type SelectEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectEmpty = forwardRef<HTMLDivElement, SelectEmptyProps>(function SelectEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n className={cx(useSelectStyles().empty, className)}\n data-slot=\"select-empty\"\n ref={ref}\n />\n );\n});\nexport type SelectLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectLoading = forwardRef<HTMLDivElement, SelectLoadingProps>(function SelectLoading(\n { children = \"Loading…\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().loading, className)}\n data-slot=\"select-loading\"\n ref={ref}\n >\n {children}\n </div>\n );\n});\nexport type SelectStatusProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectStatus = forwardRef<HTMLDivElement, SelectStatusProps>(function SelectStatus(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().status, className)}\n data-slot=\"select-status\"\n ref={ref}\n />\n );\n});\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n Separator: SelectSeparator,\n Clear: SelectClear,\n Empty: SelectEmpty,\n Loading: SelectLoading,\n Status: SelectStatus,\n};\n"],"mappings":";;;;;;;;AAaA,MAAM,qBAAA,GAAA,MAAA,cAAA,CAA8C,IAAI;AACxD,MAAM,oBAAA,GAAA,MAAA,cAAA,CAAkF,IAAI;AAE5F,SAAS,kBAAkB;CACzB,OAAOA,eAAAA,OAAO,EAAE,OAAA,GAAA,MAAA,WAAA,CAAiB,iBAAiB,EAAE,CAAC;AACvD;AAeA,SAAgB,WAA0E,EACxF,cACA,WAAW,OACX,SAAS,UACT,UACA,eACA,OAAO,MACP,OAAO,iBACP,GAAG,SACgC;CACnC,MAAM,CAAC,mBAAmB,yBAAA,GAAA,MAAA,SAAA,CACxB,iBAAiB,WAAW,CAAC,IAAI,KACnC;CACA,MAAM,QAAQ,oBAAoB,KAAA,IAAY,oBAAoB;CAClE,MAAM,cAAc;EAClB,MAAM,YAAY,WAAW,CAAC,IAAI;EAClC,IAAI,oBAAoB,KAAA,GAAW,qBAAqB,SAAS;EACjE,gBAAgB,WAAoB,KAAA,CAAkB;CACxD;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAkB,UAAnB;EAA4B,OAAO;YACjC,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAiB,UAAlB;GAA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U;EACV,WAAWA,WAAAA,GAAG,gBAAgB,CAAC,CAAC,QAAQ,SAAS;EACjD,aAAU;EACL;CACN,CAAA;AAEL,CAAC;AAED,MAAa,SAAS;CACpB,MAAM;CACN,OAAO;CACP,SAAS;CACT,OAAO;CACP,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,OAAO;CACP,YAAY;CACZ,WAAW;CACX,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;AACV"}
@@ -1,4 +1,4 @@
1
- import { ComponentPropsWithoutRef } from "react";
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
2
  import { Select, SelectRoot } from "@base-ui/react/select";
3
3
  //#region src/components/select/select.d.ts
4
4
  type SelectSize = "sm" | "md" | "lg";
@@ -11,8 +11,9 @@ type SelectSize = "sm" | "md" | "lg";
11
11
  */
12
12
  interface SelectRootProps<Value, Multiple extends boolean | undefined = false> extends SelectRoot.Props<Value, Multiple> {
13
13
  size?: SelectSize;
14
+ loading?: boolean;
14
15
  }
15
- declare function SelectRoot$1<Value = unknown, Multiple extends boolean | undefined = false>({ size, ...props }: SelectRootProps<Value, Multiple>): import("react").JSX.Element;
16
+ declare function SelectRoot$1<Value = unknown, Multiple extends boolean | undefined = false>({ defaultValue, disabled, loading: _loading, multiple, onValueChange, size, value: controlledValue, ...props }: SelectRootProps<Value, Multiple>): import("react").JSX.Element;
16
17
  type SelectLabelProps = ComponentPropsWithoutRef<typeof Select.Label>;
17
18
  /** An accessible label that Base UI associates with the trigger automatically. */
18
19
  declare const SelectLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SelectLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -52,6 +53,16 @@ interface SelectSeparatorProps extends ComponentPropsWithoutRef<"div"> {
52
53
  orientation?: "horizontal" | "vertical";
53
54
  }
54
55
  declare const SelectSeparator: import("react").ForwardRefExoticComponent<SelectSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
56
+ interface SelectClearProps extends ComponentPropsWithoutRef<"button"> {
57
+ children?: ReactNode;
58
+ }
59
+ declare const SelectClear: import("react").ForwardRefExoticComponent<SelectClearProps & import("react").RefAttributes<HTMLButtonElement>>;
60
+ type SelectEmptyProps = ComponentPropsWithoutRef<"div">;
61
+ declare const SelectEmpty: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
62
+ type SelectLoadingProps = ComponentPropsWithoutRef<"div">;
63
+ declare const SelectLoading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
64
+ type SelectStatusProps = ComponentPropsWithoutRef<"div">;
65
+ declare const SelectStatus: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
55
66
  declare const Select$1: {
56
67
  Root: typeof SelectRoot$1;
57
68
  Label: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SelectLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -68,7 +79,11 @@ declare const Select$1: {
68
79
  Group: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SelectGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
69
80
  GroupLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SelectGroupLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
70
81
  Separator: import("react").ForwardRefExoticComponent<SelectSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
82
+ Clear: import("react").ForwardRefExoticComponent<SelectClearProps & import("react").RefAttributes<HTMLButtonElement>>;
83
+ Empty: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
84
+ Loading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
85
+ Status: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
71
86
  };
72
87
  //#endregion
73
- export { Select$1 as Select, SelectGroup, SelectGroupLabel, SelectGroupLabelProps, SelectGroupProps, SelectIcon, SelectIconProps, SelectItem, SelectItemIndicator, SelectItemIndicatorProps, SelectItemProps, SelectItemText, SelectItemTextProps, SelectLabel, SelectLabelProps, SelectList, SelectListProps, SelectPopup, SelectPopupProps, SelectPortal, SelectPositioner, SelectPositionerProps, SelectRoot$1 as SelectRoot, SelectRootProps, SelectSeparator, SelectSeparatorProps, SelectSize, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps };
88
+ export { Select$1 as Select, SelectClear, SelectClearProps, SelectEmpty, SelectEmptyProps, SelectGroup, SelectGroupLabel, SelectGroupLabelProps, SelectGroupProps, SelectIcon, SelectIconProps, SelectItem, SelectItemIndicator, SelectItemIndicatorProps, SelectItemProps, SelectItemText, SelectItemTextProps, SelectLabel, SelectLabelProps, SelectList, SelectListProps, SelectLoading, SelectLoadingProps, SelectPopup, SelectPopupProps, SelectPortal, SelectPositioner, SelectPositionerProps, SelectRoot$1 as SelectRoot, SelectRootProps, SelectSeparator, SelectSeparatorProps, SelectSize, SelectStatus, SelectStatusProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps };
74
89
  //# sourceMappingURL=select.d.cts.map
@@ -1,4 +1,4 @@
1
- import { ComponentPropsWithoutRef } from "react";
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
2
  import { Select, SelectRoot } from "@base-ui/react/select";
3
3
  //#region src/components/select/select.d.ts
4
4
  type SelectSize = "sm" | "md" | "lg";
@@ -11,8 +11,9 @@ type SelectSize = "sm" | "md" | "lg";
11
11
  */
12
12
  interface SelectRootProps<Value, Multiple extends boolean | undefined = false> extends SelectRoot.Props<Value, Multiple> {
13
13
  size?: SelectSize;
14
+ loading?: boolean;
14
15
  }
15
- declare function SelectRoot$1<Value = unknown, Multiple extends boolean | undefined = false>({ size, ...props }: SelectRootProps<Value, Multiple>): import("react").JSX.Element;
16
+ declare function SelectRoot$1<Value = unknown, Multiple extends boolean | undefined = false>({ defaultValue, disabled, loading: _loading, multiple, onValueChange, size, value: controlledValue, ...props }: SelectRootProps<Value, Multiple>): import("react").JSX.Element;
16
17
  type SelectLabelProps = ComponentPropsWithoutRef<typeof Select.Label>;
17
18
  /** An accessible label that Base UI associates with the trigger automatically. */
18
19
  declare const SelectLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SelectLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -52,6 +53,16 @@ interface SelectSeparatorProps extends ComponentPropsWithoutRef<"div"> {
52
53
  orientation?: "horizontal" | "vertical";
53
54
  }
54
55
  declare const SelectSeparator: import("react").ForwardRefExoticComponent<SelectSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
56
+ interface SelectClearProps extends ComponentPropsWithoutRef<"button"> {
57
+ children?: ReactNode;
58
+ }
59
+ declare const SelectClear: import("react").ForwardRefExoticComponent<SelectClearProps & import("react").RefAttributes<HTMLButtonElement>>;
60
+ type SelectEmptyProps = ComponentPropsWithoutRef<"div">;
61
+ declare const SelectEmpty: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
62
+ type SelectLoadingProps = ComponentPropsWithoutRef<"div">;
63
+ declare const SelectLoading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
64
+ type SelectStatusProps = ComponentPropsWithoutRef<"div">;
65
+ declare const SelectStatus: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
55
66
  declare const Select$1: {
56
67
  Root: typeof SelectRoot$1;
57
68
  Label: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SelectLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -68,7 +79,11 @@ declare const Select$1: {
68
79
  Group: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SelectGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
69
80
  GroupLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SelectGroupLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
70
81
  Separator: import("react").ForwardRefExoticComponent<SelectSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
82
+ Clear: import("react").ForwardRefExoticComponent<SelectClearProps & import("react").RefAttributes<HTMLButtonElement>>;
83
+ Empty: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
84
+ Loading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
85
+ Status: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
71
86
  };
72
87
  //#endregion
73
- export { Select$1 as Select, SelectGroup, SelectGroupLabel, SelectGroupLabelProps, SelectGroupProps, SelectIcon, SelectIconProps, SelectItem, SelectItemIndicator, SelectItemIndicatorProps, SelectItemProps, SelectItemText, SelectItemTextProps, SelectLabel, SelectLabelProps, SelectList, SelectListProps, SelectPopup, SelectPopupProps, SelectPortal, SelectPositioner, SelectPositionerProps, SelectRoot$1 as SelectRoot, SelectRootProps, SelectSeparator, SelectSeparatorProps, SelectSize, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps };
88
+ export { Select$1 as Select, SelectClear, SelectClearProps, SelectEmpty, SelectEmptyProps, SelectGroup, SelectGroupLabel, SelectGroupLabelProps, SelectGroupProps, SelectIcon, SelectIconProps, SelectItem, SelectItemIndicator, SelectItemIndicatorProps, SelectItemProps, SelectItemText, SelectItemTextProps, SelectLabel, SelectLabelProps, SelectList, SelectListProps, SelectLoading, SelectLoadingProps, SelectPopup, SelectPopupProps, SelectPortal, SelectPositioner, SelectPositionerProps, SelectRoot$1 as SelectRoot, SelectRootProps, SelectSeparator, SelectSeparatorProps, SelectSize, SelectStatus, SelectStatusProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps };
74
89
  //# sourceMappingURL=select.d.ts.map