@page-speed/forms 0.1.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/LICENSE +28 -0
- package/README.md +469 -0
- package/dist/builder.cjs +4 -0
- package/dist/builder.cjs.map +1 -0
- package/dist/builder.d.cts +2 -0
- package/dist/builder.d.ts +2 -0
- package/dist/builder.js +3 -0
- package/dist/builder.js.map +1 -0
- package/dist/chunk-2FXAQT7S.cjs +236 -0
- package/dist/chunk-2FXAQT7S.cjs.map +1 -0
- package/dist/chunk-A3UV7BIN.js +357 -0
- package/dist/chunk-A3UV7BIN.js.map +1 -0
- package/dist/chunk-P37YLBFA.cjs +138 -0
- package/dist/chunk-P37YLBFA.cjs.map +1 -0
- package/dist/chunk-WHQMBQNI.js +127 -0
- package/dist/chunk-WHQMBQNI.js.map +1 -0
- package/dist/chunk-YTTOWHBZ.js +217 -0
- package/dist/chunk-YTTOWHBZ.js.map +1 -0
- package/dist/chunk-ZQCPEOB6.cjs +382 -0
- package/dist/chunk-ZQCPEOB6.cjs.map +1 -0
- package/dist/core.cjs +28 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +143 -0
- package/dist/core.d.ts +143 -0
- package/dist/core.js +3 -0
- package/dist/core.js.map +1 -0
- package/dist/index.cjs +28 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/inputs.cjs +555 -0
- package/dist/inputs.cjs.map +1 -0
- package/dist/inputs.d.cts +433 -0
- package/dist/inputs.d.ts +433 -0
- package/dist/inputs.js +529 -0
- package/dist/inputs.js.map +1 -0
- package/dist/integration.cjs +4 -0
- package/dist/integration.cjs.map +1 -0
- package/dist/integration.d.cts +2 -0
- package/dist/integration.d.ts +2 -0
- package/dist/integration.js +3 -0
- package/dist/integration.js.map +1 -0
- package/dist/types-Cw5CeZP-.d.cts +387 -0
- package/dist/types-Cw5CeZP-.d.ts +387 -0
- package/dist/upload.cjs +4 -0
- package/dist/upload.cjs.map +1 -0
- package/dist/upload.d.cts +2 -0
- package/dist/upload.d.ts +2 -0
- package/dist/upload.js +3 -0
- package/dist/upload.js.map +1 -0
- package/dist/validation-rules.cjs +80 -0
- package/dist/validation-rules.cjs.map +1 -0
- package/dist/validation-rules.d.cts +123 -0
- package/dist/validation-rules.d.ts +123 -0
- package/dist/validation-rules.js +3 -0
- package/dist/validation-rules.js.map +1 -0
- package/dist/validation-utils.cjs +48 -0
- package/dist/validation-utils.cjs.map +1 -0
- package/dist/validation-utils.d.cts +166 -0
- package/dist/validation-utils.d.ts +166 -0
- package/dist/validation-utils.js +3 -0
- package/dist/validation-utils.js.map +1 -0
- package/dist/validation-valibot.cjs +94 -0
- package/dist/validation-valibot.cjs.map +1 -0
- package/dist/validation-valibot.d.cts +92 -0
- package/dist/validation-valibot.d.ts +92 -0
- package/dist/validation-valibot.js +91 -0
- package/dist/validation-valibot.js.map +1 -0
- package/dist/validation.cjs +121 -0
- package/dist/validation.cjs.map +1 -0
- package/dist/validation.d.cts +4 -0
- package/dist/validation.d.ts +4 -0
- package/dist/validation.js +4 -0
- package/dist/validation.js.map +1 -0
- package/package.json +133 -0
package/dist/inputs.js
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
import * as React5 from 'react';
|
|
2
|
+
|
|
3
|
+
function TextInput({
|
|
4
|
+
name,
|
|
5
|
+
value,
|
|
6
|
+
onChange,
|
|
7
|
+
onBlur,
|
|
8
|
+
placeholder,
|
|
9
|
+
disabled = false,
|
|
10
|
+
required = false,
|
|
11
|
+
error = false,
|
|
12
|
+
className = "",
|
|
13
|
+
type = "text",
|
|
14
|
+
...props
|
|
15
|
+
}) {
|
|
16
|
+
const handleChange = (e) => {
|
|
17
|
+
onChange(e.target.value);
|
|
18
|
+
};
|
|
19
|
+
const handleBlur = () => {
|
|
20
|
+
onBlur?.();
|
|
21
|
+
};
|
|
22
|
+
const baseClassName = "text-input";
|
|
23
|
+
const errorClassName = error ? "text-input--error" : "";
|
|
24
|
+
const combinedClassName = `${baseClassName} ${errorClassName} ${className}`.trim();
|
|
25
|
+
return /* @__PURE__ */ React5.createElement(
|
|
26
|
+
"input",
|
|
27
|
+
{
|
|
28
|
+
type,
|
|
29
|
+
name,
|
|
30
|
+
value: value ?? "",
|
|
31
|
+
onChange: handleChange,
|
|
32
|
+
onBlur: handleBlur,
|
|
33
|
+
placeholder,
|
|
34
|
+
disabled,
|
|
35
|
+
required,
|
|
36
|
+
className: combinedClassName,
|
|
37
|
+
"aria-invalid": error || props["aria-invalid"],
|
|
38
|
+
"aria-describedby": props["aria-describedby"],
|
|
39
|
+
"aria-required": required || props["aria-required"],
|
|
40
|
+
...props
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
TextInput.displayName = "TextInput";
|
|
45
|
+
function TextArea({
|
|
46
|
+
name,
|
|
47
|
+
value,
|
|
48
|
+
onChange,
|
|
49
|
+
onBlur,
|
|
50
|
+
placeholder,
|
|
51
|
+
disabled = false,
|
|
52
|
+
required = false,
|
|
53
|
+
error = false,
|
|
54
|
+
className = "",
|
|
55
|
+
rows = 3,
|
|
56
|
+
cols,
|
|
57
|
+
maxLength,
|
|
58
|
+
minLength,
|
|
59
|
+
wrap = "soft",
|
|
60
|
+
...props
|
|
61
|
+
}) {
|
|
62
|
+
const handleChange = (e) => {
|
|
63
|
+
onChange(e.target.value);
|
|
64
|
+
};
|
|
65
|
+
const handleBlur = () => {
|
|
66
|
+
onBlur?.();
|
|
67
|
+
};
|
|
68
|
+
const baseClassName = "textarea";
|
|
69
|
+
const errorClassName = error ? "textarea--error" : "";
|
|
70
|
+
const combinedClassName = `${baseClassName} ${errorClassName} ${className}`.trim();
|
|
71
|
+
return /* @__PURE__ */ React5.createElement(
|
|
72
|
+
"textarea",
|
|
73
|
+
{
|
|
74
|
+
name,
|
|
75
|
+
value: value ?? "",
|
|
76
|
+
onChange: handleChange,
|
|
77
|
+
onBlur: handleBlur,
|
|
78
|
+
placeholder,
|
|
79
|
+
disabled,
|
|
80
|
+
required,
|
|
81
|
+
className: combinedClassName,
|
|
82
|
+
rows,
|
|
83
|
+
cols,
|
|
84
|
+
maxLength,
|
|
85
|
+
minLength,
|
|
86
|
+
wrap,
|
|
87
|
+
"aria-invalid": error || props["aria-invalid"],
|
|
88
|
+
"aria-describedby": props["aria-describedby"],
|
|
89
|
+
"aria-required": required || props["aria-required"],
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
TextArea.displayName = "TextArea";
|
|
95
|
+
function Checkbox({
|
|
96
|
+
name,
|
|
97
|
+
value,
|
|
98
|
+
onChange,
|
|
99
|
+
onBlur,
|
|
100
|
+
disabled = false,
|
|
101
|
+
required = false,
|
|
102
|
+
error = false,
|
|
103
|
+
className = "",
|
|
104
|
+
indeterminate = false,
|
|
105
|
+
label,
|
|
106
|
+
...props
|
|
107
|
+
}) {
|
|
108
|
+
const inputRef = React5.useRef(null);
|
|
109
|
+
React5.useEffect(() => {
|
|
110
|
+
if (inputRef.current) {
|
|
111
|
+
inputRef.current.indeterminate = indeterminate;
|
|
112
|
+
}
|
|
113
|
+
}, [indeterminate]);
|
|
114
|
+
const handleChange = (e) => {
|
|
115
|
+
onChange(e.target.checked);
|
|
116
|
+
};
|
|
117
|
+
const handleBlur = () => {
|
|
118
|
+
onBlur?.();
|
|
119
|
+
};
|
|
120
|
+
const baseClassName = "checkbox";
|
|
121
|
+
const errorClassName = error ? "checkbox--error" : "";
|
|
122
|
+
const combinedClassName = `${baseClassName} ${errorClassName} ${className}`.trim();
|
|
123
|
+
const checkbox = /* @__PURE__ */ React5.createElement(
|
|
124
|
+
"input",
|
|
125
|
+
{
|
|
126
|
+
ref: inputRef,
|
|
127
|
+
type: "checkbox",
|
|
128
|
+
name,
|
|
129
|
+
checked: value,
|
|
130
|
+
onChange: handleChange,
|
|
131
|
+
onBlur: handleBlur,
|
|
132
|
+
disabled,
|
|
133
|
+
required,
|
|
134
|
+
className: combinedClassName,
|
|
135
|
+
"aria-invalid": error || props["aria-invalid"],
|
|
136
|
+
"aria-describedby": props["aria-describedby"],
|
|
137
|
+
"aria-required": required || props["aria-required"],
|
|
138
|
+
...props
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
if (label) {
|
|
142
|
+
return /* @__PURE__ */ React5.createElement("label", { className: "checkbox-label" }, checkbox, /* @__PURE__ */ React5.createElement("span", { className: "checkbox-label-text" }, label));
|
|
143
|
+
}
|
|
144
|
+
return checkbox;
|
|
145
|
+
}
|
|
146
|
+
Checkbox.displayName = "Checkbox";
|
|
147
|
+
function Radio({
|
|
148
|
+
name,
|
|
149
|
+
value,
|
|
150
|
+
onChange,
|
|
151
|
+
onBlur,
|
|
152
|
+
disabled = false,
|
|
153
|
+
required = false,
|
|
154
|
+
error = false,
|
|
155
|
+
className = "",
|
|
156
|
+
layout = "stacked",
|
|
157
|
+
label,
|
|
158
|
+
options,
|
|
159
|
+
...props
|
|
160
|
+
}) {
|
|
161
|
+
const handleChange = (optionValue) => {
|
|
162
|
+
onChange(optionValue);
|
|
163
|
+
};
|
|
164
|
+
const handleKeyDown = (e, currentIndex) => {
|
|
165
|
+
if (e.key === "ArrowDown" || e.key === "ArrowRight") {
|
|
166
|
+
e.preventDefault();
|
|
167
|
+
let nextIndex = (currentIndex + 1) % options.length;
|
|
168
|
+
let attempts = 0;
|
|
169
|
+
while (options[nextIndex].disabled && attempts < options.length && !disabled) {
|
|
170
|
+
nextIndex = (nextIndex + 1) % options.length;
|
|
171
|
+
attempts++;
|
|
172
|
+
}
|
|
173
|
+
if (!options[nextIndex].disabled) {
|
|
174
|
+
handleChange(options[nextIndex].value);
|
|
175
|
+
}
|
|
176
|
+
} else if (e.key === "ArrowUp" || e.key === "ArrowLeft") {
|
|
177
|
+
e.preventDefault();
|
|
178
|
+
let prevIndex = (currentIndex - 1 + options.length) % options.length;
|
|
179
|
+
let attempts = 0;
|
|
180
|
+
while (options[prevIndex].disabled && attempts < options.length && !disabled) {
|
|
181
|
+
prevIndex = (prevIndex - 1 + options.length) % options.length;
|
|
182
|
+
attempts++;
|
|
183
|
+
}
|
|
184
|
+
if (!options[prevIndex].disabled) {
|
|
185
|
+
handleChange(options[prevIndex].value);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const handleBlur = () => {
|
|
190
|
+
onBlur?.();
|
|
191
|
+
};
|
|
192
|
+
const baseClassName = "radio-group";
|
|
193
|
+
const errorClassName = error ? "radio-group--error" : "";
|
|
194
|
+
const layoutClassName = `radio-group--${layout}`;
|
|
195
|
+
const combinedClassName = `${baseClassName} ${errorClassName} ${layoutClassName} ${className}`.trim();
|
|
196
|
+
return /* @__PURE__ */ React5.createElement(
|
|
197
|
+
"div",
|
|
198
|
+
{
|
|
199
|
+
className: combinedClassName,
|
|
200
|
+
role: "radiogroup",
|
|
201
|
+
"aria-invalid": error || props["aria-invalid"],
|
|
202
|
+
"aria-describedby": props["aria-describedby"],
|
|
203
|
+
"aria-required": required || props["aria-required"],
|
|
204
|
+
"aria-label": typeof label === "string" ? label : props["aria-label"]
|
|
205
|
+
},
|
|
206
|
+
label && /* @__PURE__ */ React5.createElement("div", { className: "radio-group-label" }, label),
|
|
207
|
+
/* @__PURE__ */ React5.createElement("div", { className: "radio-options" }, options.map((option, index) => {
|
|
208
|
+
const isChecked = value === option.value;
|
|
209
|
+
const isDisabled = disabled || option.disabled;
|
|
210
|
+
const radioId = `${name}-${option.value}`;
|
|
211
|
+
return /* @__PURE__ */ React5.createElement(
|
|
212
|
+
"label",
|
|
213
|
+
{
|
|
214
|
+
key: option.value,
|
|
215
|
+
className: `radio-option ${isDisabled ? "radio-option--disabled" : ""}`,
|
|
216
|
+
htmlFor: radioId
|
|
217
|
+
},
|
|
218
|
+
/* @__PURE__ */ React5.createElement(
|
|
219
|
+
"input",
|
|
220
|
+
{
|
|
221
|
+
type: "radio",
|
|
222
|
+
id: radioId,
|
|
223
|
+
name,
|
|
224
|
+
value: option.value,
|
|
225
|
+
checked: isChecked,
|
|
226
|
+
onChange: (e) => handleChange(e.target.value),
|
|
227
|
+
onBlur: handleBlur,
|
|
228
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
229
|
+
disabled: isDisabled,
|
|
230
|
+
required,
|
|
231
|
+
className: "radio-input",
|
|
232
|
+
"aria-describedby": option.description ? `${radioId}-description` : props["aria-describedby"]
|
|
233
|
+
}
|
|
234
|
+
),
|
|
235
|
+
/* @__PURE__ */ React5.createElement("div", { className: "radio-content" }, /* @__PURE__ */ React5.createElement("span", { className: "radio-label" }, option.label), option.description && /* @__PURE__ */ React5.createElement(
|
|
236
|
+
"span",
|
|
237
|
+
{
|
|
238
|
+
className: "radio-description",
|
|
239
|
+
id: `${radioId}-description`
|
|
240
|
+
},
|
|
241
|
+
option.description
|
|
242
|
+
))
|
|
243
|
+
);
|
|
244
|
+
}))
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
Radio.displayName = "Radio";
|
|
248
|
+
function Select({
|
|
249
|
+
name,
|
|
250
|
+
value,
|
|
251
|
+
onChange,
|
|
252
|
+
onBlur,
|
|
253
|
+
onFocus,
|
|
254
|
+
disabled = false,
|
|
255
|
+
required = false,
|
|
256
|
+
error = false,
|
|
257
|
+
className = "",
|
|
258
|
+
placeholder = "Select...",
|
|
259
|
+
searchable = true,
|
|
260
|
+
clearable = true,
|
|
261
|
+
loading = false,
|
|
262
|
+
options = [],
|
|
263
|
+
optionGroups = [],
|
|
264
|
+
renderOption,
|
|
265
|
+
...props
|
|
266
|
+
}) {
|
|
267
|
+
const [isOpen, setIsOpen] = React5.useState(false);
|
|
268
|
+
const [searchQuery, setSearchQuery] = React5.useState("");
|
|
269
|
+
const [focusedIndex, setFocusedIndex] = React5.useState(-1);
|
|
270
|
+
const selectRef = React5.useRef(null);
|
|
271
|
+
const searchInputRef = React5.useRef(null);
|
|
272
|
+
const dropdownId = `${name}-dropdown`;
|
|
273
|
+
const allOptions = React5.useMemo(() => {
|
|
274
|
+
if (optionGroups.length > 0) {
|
|
275
|
+
return optionGroups.flatMap((group) => group.options);
|
|
276
|
+
}
|
|
277
|
+
return options;
|
|
278
|
+
}, [options, optionGroups]);
|
|
279
|
+
const filteredOptions = React5.useMemo(() => {
|
|
280
|
+
if (!searchQuery.trim()) {
|
|
281
|
+
return allOptions;
|
|
282
|
+
}
|
|
283
|
+
const query = searchQuery.toLowerCase();
|
|
284
|
+
return allOptions.filter((option) => {
|
|
285
|
+
const label = typeof option.label === "string" ? option.label : String(option.label);
|
|
286
|
+
return label.toLowerCase().includes(query);
|
|
287
|
+
});
|
|
288
|
+
}, [allOptions, searchQuery]);
|
|
289
|
+
const selectedOption = React5.useMemo(() => {
|
|
290
|
+
return allOptions.find((opt) => opt.value === value);
|
|
291
|
+
}, [allOptions, value]);
|
|
292
|
+
const handleSelect = (optionValue) => {
|
|
293
|
+
onChange(optionValue);
|
|
294
|
+
setIsOpen(false);
|
|
295
|
+
setSearchQuery("");
|
|
296
|
+
setFocusedIndex(-1);
|
|
297
|
+
};
|
|
298
|
+
const handleClear = (e) => {
|
|
299
|
+
e.stopPropagation();
|
|
300
|
+
onChange("");
|
|
301
|
+
setSearchQuery("");
|
|
302
|
+
setFocusedIndex(-1);
|
|
303
|
+
};
|
|
304
|
+
const handleToggle = () => {
|
|
305
|
+
if (disabled) return;
|
|
306
|
+
const newIsOpen = !isOpen;
|
|
307
|
+
setIsOpen(newIsOpen);
|
|
308
|
+
if (newIsOpen && searchable && searchInputRef.current) {
|
|
309
|
+
setTimeout(() => searchInputRef.current?.focus(), 0);
|
|
310
|
+
}
|
|
311
|
+
if (newIsOpen) {
|
|
312
|
+
onFocus?.();
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
const handleSearchChange = (e) => {
|
|
316
|
+
setSearchQuery(e.target.value);
|
|
317
|
+
setFocusedIndex(0);
|
|
318
|
+
};
|
|
319
|
+
const handleKeyDown = (e) => {
|
|
320
|
+
if (disabled) return;
|
|
321
|
+
switch (e.key) {
|
|
322
|
+
case "ArrowDown":
|
|
323
|
+
e.preventDefault();
|
|
324
|
+
if (!isOpen) {
|
|
325
|
+
setIsOpen(true);
|
|
326
|
+
setFocusedIndex(0);
|
|
327
|
+
} else {
|
|
328
|
+
const enabledOptions = filteredOptions.filter((opt) => !opt.disabled);
|
|
329
|
+
if (enabledOptions.length > 0) {
|
|
330
|
+
const currentIndexInFiltered = focusedIndex;
|
|
331
|
+
const nextIndex = (currentIndexInFiltered + 1) % enabledOptions.length;
|
|
332
|
+
setFocusedIndex(
|
|
333
|
+
filteredOptions.indexOf(enabledOptions[nextIndex])
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
break;
|
|
338
|
+
case "ArrowUp":
|
|
339
|
+
e.preventDefault();
|
|
340
|
+
if (isOpen) {
|
|
341
|
+
const enabledOptions = filteredOptions.filter((opt) => !opt.disabled);
|
|
342
|
+
if (enabledOptions.length > 0) {
|
|
343
|
+
const currentIndexInFiltered = focusedIndex;
|
|
344
|
+
const prevIndex = (currentIndexInFiltered - 1 + enabledOptions.length) % enabledOptions.length;
|
|
345
|
+
setFocusedIndex(
|
|
346
|
+
filteredOptions.indexOf(enabledOptions[prevIndex])
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
break;
|
|
351
|
+
case "Enter":
|
|
352
|
+
e.preventDefault();
|
|
353
|
+
if (isOpen && focusedIndex >= 0 && focusedIndex < filteredOptions.length) {
|
|
354
|
+
const focusedOption = filteredOptions[focusedIndex];
|
|
355
|
+
if (!focusedOption.disabled) {
|
|
356
|
+
handleSelect(focusedOption.value);
|
|
357
|
+
}
|
|
358
|
+
} else if (!isOpen) {
|
|
359
|
+
setIsOpen(true);
|
|
360
|
+
}
|
|
361
|
+
break;
|
|
362
|
+
case "Escape":
|
|
363
|
+
e.preventDefault();
|
|
364
|
+
if (isOpen) {
|
|
365
|
+
setIsOpen(false);
|
|
366
|
+
setSearchQuery("");
|
|
367
|
+
setFocusedIndex(-1);
|
|
368
|
+
}
|
|
369
|
+
break;
|
|
370
|
+
case " ":
|
|
371
|
+
if (!isOpen && !searchable) {
|
|
372
|
+
e.preventDefault();
|
|
373
|
+
setIsOpen(true);
|
|
374
|
+
}
|
|
375
|
+
break;
|
|
376
|
+
default:
|
|
377
|
+
if (!searchable && e.key.length === 1 && !e.ctrlKey && !e.metaKey) {
|
|
378
|
+
const char = e.key.toLowerCase();
|
|
379
|
+
const matchingOption = filteredOptions.find((opt) => {
|
|
380
|
+
const label = typeof opt.label === "string" ? opt.label : String(opt.label);
|
|
381
|
+
return label.toLowerCase().startsWith(char) && !opt.disabled;
|
|
382
|
+
});
|
|
383
|
+
if (matchingOption) {
|
|
384
|
+
handleSelect(matchingOption.value);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
const handleBlur = () => {
|
|
391
|
+
onBlur?.();
|
|
392
|
+
};
|
|
393
|
+
React5.useEffect(() => {
|
|
394
|
+
const handleClickOutside = (event) => {
|
|
395
|
+
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
396
|
+
setIsOpen(false);
|
|
397
|
+
setSearchQuery("");
|
|
398
|
+
setFocusedIndex(-1);
|
|
399
|
+
handleBlur();
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
if (isOpen) {
|
|
403
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
404
|
+
return () => {
|
|
405
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
}, [isOpen]);
|
|
409
|
+
const baseClassName = "select";
|
|
410
|
+
const errorClassName = error ? "select--error" : "";
|
|
411
|
+
const disabledClassName = disabled ? "select--disabled" : "";
|
|
412
|
+
const openClassName = isOpen ? "select--open" : "";
|
|
413
|
+
const combinedClassName = `${baseClassName} ${errorClassName} ${disabledClassName} ${openClassName} ${className}`.trim();
|
|
414
|
+
return /* @__PURE__ */ React5.createElement(
|
|
415
|
+
"div",
|
|
416
|
+
{
|
|
417
|
+
ref: selectRef,
|
|
418
|
+
className: combinedClassName,
|
|
419
|
+
onKeyDown: handleKeyDown,
|
|
420
|
+
onBlur: handleBlur
|
|
421
|
+
},
|
|
422
|
+
/* @__PURE__ */ React5.createElement(
|
|
423
|
+
"select",
|
|
424
|
+
{
|
|
425
|
+
name,
|
|
426
|
+
value,
|
|
427
|
+
onChange: () => {
|
|
428
|
+
},
|
|
429
|
+
disabled,
|
|
430
|
+
required,
|
|
431
|
+
"aria-hidden": "true",
|
|
432
|
+
tabIndex: -1,
|
|
433
|
+
style: { display: "none" }
|
|
434
|
+
},
|
|
435
|
+
/* @__PURE__ */ React5.createElement("option", { value: "" }, "Select..."),
|
|
436
|
+
allOptions.map((option) => /* @__PURE__ */ React5.createElement("option", { key: option.value, value: option.value }, typeof option.label === "string" ? option.label : option.value))
|
|
437
|
+
),
|
|
438
|
+
/* @__PURE__ */ React5.createElement(
|
|
439
|
+
"div",
|
|
440
|
+
{
|
|
441
|
+
className: "select-trigger",
|
|
442
|
+
onClick: handleToggle,
|
|
443
|
+
role: "combobox",
|
|
444
|
+
"aria-expanded": isOpen,
|
|
445
|
+
"aria-controls": dropdownId,
|
|
446
|
+
"aria-invalid": error || props["aria-invalid"],
|
|
447
|
+
"aria-describedby": props["aria-describedby"],
|
|
448
|
+
"aria-required": required || props["aria-required"],
|
|
449
|
+
"aria-disabled": disabled,
|
|
450
|
+
tabIndex: disabled ? -1 : 0
|
|
451
|
+
},
|
|
452
|
+
/* @__PURE__ */ React5.createElement("span", { className: "select-value" }, selectedOption ? renderOption ? renderOption(selectedOption) : selectedOption.label : /* @__PURE__ */ React5.createElement("span", { className: "select-placeholder" }, placeholder)),
|
|
453
|
+
/* @__PURE__ */ React5.createElement("div", { className: "select-icons" }, loading && /* @__PURE__ */ React5.createElement("span", { className: "select-loading" }, "\u23F3"), clearable && value && !disabled && !loading && /* @__PURE__ */ React5.createElement(
|
|
454
|
+
"button",
|
|
455
|
+
{
|
|
456
|
+
type: "button",
|
|
457
|
+
className: "select-clear",
|
|
458
|
+
onClick: handleClear,
|
|
459
|
+
"aria-label": "Clear selection",
|
|
460
|
+
tabIndex: -1
|
|
461
|
+
},
|
|
462
|
+
"\u2715"
|
|
463
|
+
), /* @__PURE__ */ React5.createElement("span", { className: "select-arrow", "aria-hidden": "true" }, isOpen ? "\u25B2" : "\u25BC"))
|
|
464
|
+
),
|
|
465
|
+
isOpen && /* @__PURE__ */ React5.createElement("div", { id: dropdownId, className: "select-dropdown", role: "listbox" }, searchable && /* @__PURE__ */ React5.createElement("div", { className: "select-search" }, /* @__PURE__ */ React5.createElement(
|
|
466
|
+
"input",
|
|
467
|
+
{
|
|
468
|
+
ref: searchInputRef,
|
|
469
|
+
type: "text",
|
|
470
|
+
className: "select-search-input",
|
|
471
|
+
placeholder: "Search...",
|
|
472
|
+
value: searchQuery,
|
|
473
|
+
onChange: handleSearchChange,
|
|
474
|
+
onClick: (e) => e.stopPropagation(),
|
|
475
|
+
"aria-label": "Search options"
|
|
476
|
+
}
|
|
477
|
+
)), /* @__PURE__ */ React5.createElement("div", { className: "select-options" }, filteredOptions.length === 0 ? /* @__PURE__ */ React5.createElement("div", { className: "select-no-options" }, "No options found") : optionGroups.length > 0 ? (
|
|
478
|
+
// Render grouped options
|
|
479
|
+
optionGroups.map((group, groupIndex) => {
|
|
480
|
+
const groupOptions = group.options.filter(
|
|
481
|
+
(opt) => filteredOptions.includes(opt)
|
|
482
|
+
);
|
|
483
|
+
if (groupOptions.length === 0) return null;
|
|
484
|
+
return /* @__PURE__ */ React5.createElement("div", { key: groupIndex, className: "select-optgroup" }, /* @__PURE__ */ React5.createElement("div", { className: "select-optgroup-label" }, group.label), groupOptions.map((option) => {
|
|
485
|
+
const globalIndex = filteredOptions.indexOf(option);
|
|
486
|
+
const isSelected = value === option.value;
|
|
487
|
+
const isFocused = globalIndex === focusedIndex;
|
|
488
|
+
const isDisabled = option.disabled;
|
|
489
|
+
return /* @__PURE__ */ React5.createElement(
|
|
490
|
+
"div",
|
|
491
|
+
{
|
|
492
|
+
key: option.value,
|
|
493
|
+
className: `select-option ${isSelected ? "select-option--selected" : ""} ${isFocused ? "select-option--focused" : ""} ${isDisabled ? "select-option--disabled" : ""}`,
|
|
494
|
+
onClick: () => !isDisabled && handleSelect(option.value),
|
|
495
|
+
role: "option",
|
|
496
|
+
"aria-selected": isSelected,
|
|
497
|
+
"aria-disabled": isDisabled
|
|
498
|
+
},
|
|
499
|
+
renderOption ? renderOption(option) : option.label
|
|
500
|
+
);
|
|
501
|
+
}));
|
|
502
|
+
})
|
|
503
|
+
) : (
|
|
504
|
+
// Render flat options
|
|
505
|
+
filteredOptions.map((option, index) => {
|
|
506
|
+
const isSelected = value === option.value;
|
|
507
|
+
const isFocused = index === focusedIndex;
|
|
508
|
+
const isDisabled = option.disabled;
|
|
509
|
+
return /* @__PURE__ */ React5.createElement(
|
|
510
|
+
"div",
|
|
511
|
+
{
|
|
512
|
+
key: option.value,
|
|
513
|
+
className: `select-option ${isSelected ? "select-option--selected" : ""} ${isFocused ? "select-option--focused" : ""} ${isDisabled ? "select-option--disabled" : ""}`,
|
|
514
|
+
onClick: () => !isDisabled && handleSelect(option.value),
|
|
515
|
+
role: "option",
|
|
516
|
+
"aria-selected": isSelected,
|
|
517
|
+
"aria-disabled": isDisabled
|
|
518
|
+
},
|
|
519
|
+
renderOption ? renderOption(option) : option.label
|
|
520
|
+
);
|
|
521
|
+
})
|
|
522
|
+
)))
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
Select.displayName = "Select";
|
|
526
|
+
|
|
527
|
+
export { Checkbox, Radio, Select, TextArea, TextInput };
|
|
528
|
+
//# sourceMappingURL=inputs.js.map
|
|
529
|
+
//# sourceMappingURL=inputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/inputs/TextInput.tsx","../src/inputs/TextArea.tsx","../src/inputs/Checkbox.tsx","../src/inputs/Radio.tsx","../src/inputs/Select.tsx"],"names":["React","React2","React3","React4"],"mappings":";;AAiCO,SAAS,SAAA,CAAU;AAAA,EACxB,IAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA,GAAW,KAAA;AAAA,EACX,QAAA,GAAW,KAAA;AAAA,EACX,KAAA,GAAQ,KAAA;AAAA,EACR,SAAA,GAAY,EAAA;AAAA,EACZ,IAAA,GAAO,MAAA;AAAA,EACP,GAAG;AACL,CAAA,EAEG;AACD,EAAA,MAAM,YAAA,GAAe,CAAC,CAAA,KAA2C;AAC/D,IAAA,QAAA,CAAS,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,EACzB,CAAA;AAEA,EAAA,MAAM,aAAa,MAAM;AACvB,IAAA,MAAA,IAAS;AAAA,EACX,CAAA;AAEA,EAAA,MAAM,aAAA,GAAgB,YAAA;AACtB,EAAA,MAAM,cAAA,GAAiB,QAAQ,mBAAA,GAAsB,EAAA;AACrD,EAAA,MAAM,iBAAA,GAAoB,GAAG,aAAa,CAAA,CAAA,EAAI,cAAc,CAAA,CAAA,EAAI,SAAS,GAAG,IAAA,EAAK;AAEjF,EAAA,uBACEA,MAAA,CAAA,aAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,IAAA;AAAA,MACA,OAAO,KAAA,IAAS,EAAA;AAAA,MAChB,QAAA,EAAU,YAAA;AAAA,MACV,MAAA,EAAQ,UAAA;AAAA,MACR,WAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA,EAAW,iBAAA;AAAA,MACX,cAAA,EAAc,KAAA,IAAS,KAAA,CAAM,cAAc,CAAA;AAAA,MAC3C,kBAAA,EAAkB,MAAM,kBAAkB,CAAA;AAAA,M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;AAAA,YACnK,SAAS,MAAM,CAAC,UAAA,IAAc,YAAA,CAAa,OAAO,KAAK,CAAA;AAAA,YACvD,IAAA,EAAK,QAAA;AAAA,YACL,eAAA,EAAe,UAAA;AAAA,YACf,eAAA,EAAe;AAAA,WAAA;AAAA,UAEd,YAAA,GAAe,YAAA,CAAa,MAAM,CAAA,GAAI,MAAA,CAAO;AAAA,SAChD;AAAA,MAEJ,CAAC;AAAA,KAEL,CACF;AAAA,GAEJ;AAEJ;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA","file":"inputs.js","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type { InputProps } from \"../core/types\";\n\n/**\n * TextInput - High-performance text input component\n *\n * A lightweight, accessible text input with error state support.\n * Designed to work seamlessly with useForm and Field components.\n *\n * Features:\n * - Full accessibility support\n * - Error state styling\n * - Controlled input behavior\n * - All native input attributes supported\n *\n * @example\n * ```tsx\n * const form = useForm({ initialValues: { email: '' } });\n *\n * <TextInput\n * {...form.getFieldProps('email')}\n * type=\"email\"\n * placeholder=\"Enter your email\"\n * error={!!form.errors.email}\n * aria-invalid={!!form.errors.email}\n * aria-describedby={form.errors.email ? 'email-error' : undefined}\n * />\n * ```\n *\n * @see https://opensite.ai/developers/page-speed/forms/text-input\n */\nexport function TextInput({\n name,\n value,\n onChange,\n onBlur,\n placeholder,\n disabled = false,\n required = false,\n error = false,\n className = \"\",\n type = \"text\",\n ...props\n}: InputProps<string> & {\n type?: \"text\" | \"email\" | \"password\" | \"url\" | \"tel\" | \"search\";\n}) {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.value);\n };\n\n const handleBlur = () => {\n onBlur?.();\n };\n\n const baseClassName = \"text-input\";\n const errorClassName = error ? \"text-input--error\" : \"\";\n const combinedClassName = `${baseClassName} ${errorClassName} ${className}`.trim();\n\n return (\n <input\n type={type}\n name={name}\n value={value ?? \"\"}\n onChange={handleChange}\n onBlur={handleBlur}\n placeholder={placeholder}\n disabled={disabled}\n required={required}\n className={combinedClassName}\n aria-invalid={error || props[\"aria-invalid\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={required || props[\"aria-required\"]}\n {...props}\n />\n );\n}\n\nTextInput.displayName = \"TextInput\";\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { InputProps } from \"../core/types\";\n\n/**\n * Additional props specific to TextArea\n */\nexport interface TextAreaProps extends Omit<InputProps<string>, \"onChange\"> {\n /**\n * Number of visible text rows\n * @default 3\n */\n rows?: number;\n\n /**\n * Number of visible text columns (characters)\n */\n cols?: number;\n\n /**\n * Maximum character length\n */\n maxLength?: number;\n\n /**\n * Minimum character length\n */\n minLength?: number;\n\n /**\n * Text wrapping behavior\n * - soft: text wraps but newlines not submitted (default)\n * - hard: text wraps and newlines submitted (requires cols)\n * - off: no wrapping\n */\n wrap?: \"soft\" | \"hard\" | \"off\";\n\n /**\n * Change handler\n */\n onChange: (value: string) => void;\n\n /**\n * Additional native textarea attributes\n */\n [key: string]: any;\n}\n\n/**\n * TextArea - High-performance multi-line text input component\n *\n * A lightweight, accessible textarea with error state support.\n * Designed to work seamlessly with useForm and Field components.\n *\n * Features:\n * - Full accessibility support\n * - Error state styling\n * - Controlled input behavior\n * - Configurable rows and columns\n * - Text wrapping options\n * - Character length validation\n * - All native textarea attributes supported\n *\n * @example\n * ```tsx\n * const form = useForm({ initialValues: { bio: '' } });\n *\n * <TextArea\n * {...form.getFieldProps('bio')}\n * rows={5}\n * placeholder=\"Tell us about yourself\"\n * error={!!form.errors.bio}\n * aria-invalid={!!form.errors.bio}\n * aria-describedby={form.errors.bio ? 'bio-error' : undefined}\n * />\n * ```\n *\n * @see https://opensite.ai/developers/page-speed/forms/textarea\n */\nexport function TextArea({\n name,\n value,\n onChange,\n onBlur,\n placeholder,\n disabled = false,\n required = false,\n error = false,\n className = \"\",\n rows = 3,\n cols,\n maxLength,\n minLength,\n wrap = \"soft\",\n ...props\n}: TextAreaProps) {\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange(e.target.value);\n };\n\n const handleBlur = () => {\n onBlur?.();\n };\n\n const baseClassName = \"textarea\";\n const errorClassName = error ? \"textarea--error\" : \"\";\n const combinedClassName = `${baseClassName} ${errorClassName} ${className}`.trim();\n\n return (\n <textarea\n name={name}\n value={value ?? \"\"}\n onChange={handleChange}\n onBlur={handleBlur}\n placeholder={placeholder}\n disabled={disabled}\n required={required}\n className={combinedClassName}\n rows={rows}\n cols={cols}\n maxLength={maxLength}\n minLength={minLength}\n wrap={wrap}\n aria-invalid={error || props[\"aria-invalid\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={required || props[\"aria-required\"]}\n {...props}\n />\n );\n}\n\nTextArea.displayName = \"TextArea\";\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { InputProps } from \"../core/types\";\n\n/**\n * Additional props specific to Checkbox\n */\nexport interface CheckboxProps\n extends Omit<InputProps<boolean>, \"onChange\" | \"placeholder\"> {\n /**\n * Change handler - receives boolean checked state\n */\n onChange: (checked: boolean) => void;\n\n /**\n * Indeterminate state for partial selections\n * Useful for \"select all\" checkboxes with some items selected\n * @default false\n */\n indeterminate?: boolean;\n\n /**\n * Label text for the checkbox\n * Can also wrap checkbox in a label element\n */\n label?: React.ReactNode;\n\n /**\n * Additional native input attributes\n */\n [key: string]: any;\n}\n\n/**\n * Checkbox - High-performance boolean input component\n *\n * A lightweight, accessible checkbox with error state support.\n * Designed to work seamlessly with useForm and Field components.\n *\n * Features:\n * - Full accessibility support (ARIA attributes)\n * - Error state styling\n * - Controlled input behavior\n * - Indeterminate state support\n * - Optional label text\n * - All native checkbox attributes supported\n *\n * @example\n * ```tsx\n * const form = useForm({ initialValues: { terms: false } });\n *\n * <Checkbox\n * {...form.getFieldProps('terms')}\n * label=\"I agree to the terms and conditions\"\n * error={!!form.errors.terms}\n * aria-describedby={form.errors.terms ? 'terms-error' : undefined}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // With indeterminate state\n * <Checkbox\n * name=\"selectAll\"\n * value={allSelected}\n * onChange={handleSelectAll}\n * indeterminate={someSelected}\n * label=\"Select all items\"\n * />\n * ```\n *\n * @see https://opensite.ai/developers/page-speed/forms/checkbox\n */\nexport function Checkbox({\n name,\n value,\n onChange,\n onBlur,\n disabled = false,\n required = false,\n error = false,\n className = \"\",\n indeterminate = false,\n label,\n ...props\n}: CheckboxProps) {\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n // Set indeterminate state on the native input element\n React.useEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.checked);\n };\n\n const handleBlur = () => {\n onBlur?.();\n };\n\n const baseClassName = \"checkbox\";\n const errorClassName = error ? \"checkbox--error\" : \"\";\n const combinedClassName = `${baseClassName} ${errorClassName} ${className}`.trim();\n\n const checkbox = (\n <input\n ref={inputRef}\n type=\"checkbox\"\n name={name}\n checked={value}\n onChange={handleChange}\n onBlur={handleBlur}\n disabled={disabled}\n required={required}\n className={combinedClassName}\n aria-invalid={error || props[\"aria-invalid\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={required || props[\"aria-required\"]}\n {...props}\n />\n );\n\n // If label is provided, wrap checkbox in label element\n if (label) {\n return (\n <label className=\"checkbox-label\">\n {checkbox}\n <span className=\"checkbox-label-text\">{label}</span>\n </label>\n );\n }\n\n return checkbox;\n}\n\nCheckbox.displayName = \"Checkbox\";\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { InputProps } from \"../core/types\";\n\n/**\n * Radio option type\n */\nexport interface RadioOption {\n /**\n * The value for this radio option\n */\n value: string;\n\n /**\n * Display label for the option\n */\n label: React.ReactNode;\n\n /**\n * Optional description text below the label\n */\n description?: React.ReactNode;\n\n /**\n * Whether this option is disabled\n */\n disabled?: boolean;\n}\n\n/**\n * Additional props specific to Radio\n */\nexport interface RadioProps\n extends Omit<InputProps<string>, \"onChange\" | \"placeholder\"> {\n /**\n * Change handler - receives selected value\n */\n onChange: (value: string) => void;\n\n /**\n * Array of radio options\n */\n options: RadioOption[];\n\n /**\n * Layout direction\n * @default \"stacked\"\n */\n layout?: \"inline\" | \"stacked\";\n\n /**\n * Group-level label\n */\n label?: React.ReactNode;\n\n /**\n * Additional native input attributes\n */\n [key: string]: any;\n}\n\n/**\n * Radio - High-performance single selection component\n *\n * A lightweight, accessible radio group with error state support.\n * Designed to work seamlessly with useForm and Field components.\n *\n * Features:\n * - Full accessibility support (ARIA attributes, role=\"radiogroup\")\n * - Error state styling\n * - Controlled input behavior\n * - Keyboard navigation (arrow keys)\n * - Inline or stacked layout\n * - Optional descriptions for each option\n * - Individual option disabled state\n * - All native radio attributes supported\n *\n * @example\n * ```tsx\n * const form = useForm({ initialValues: { plan: 'basic' } });\n *\n * <Radio\n * {...form.getFieldProps('plan')}\n * label=\"Select your plan\"\n * options={[\n * { value: 'basic', label: 'Basic', description: '$9/month' },\n * { value: 'pro', label: 'Pro', description: '$29/month' },\n * { value: 'enterprise', label: 'Enterprise', description: '$99/month' }\n * ]}\n * error={!!form.errors.plan}\n * aria-describedby={form.errors.plan ? 'plan-error' : undefined}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Inline layout\n * <Radio\n * name=\"size\"\n * value={size}\n * onChange={handleSizeChange}\n * layout=\"inline\"\n * options={[\n * { value: 'sm', label: 'Small' },\n * { value: 'md', label: 'Medium' },\n * { value: 'lg', label: 'Large' }\n * ]}\n * />\n * ```\n *\n * @see https://opensite.ai/developers/page-speed/forms/radio\n */\nexport function Radio({\n name,\n value,\n onChange,\n onBlur,\n disabled = false,\n required = false,\n error = false,\n className = \"\",\n layout = \"stacked\",\n label,\n options,\n ...props\n}: RadioProps) {\n const handleChange = (optionValue: string) => {\n onChange(optionValue);\n };\n\n const handleKeyDown = (\n e: React.KeyboardEvent<HTMLDivElement>,\n currentIndex: number\n ) => {\n if (e.key === \"ArrowDown\" || e.key === \"ArrowRight\") {\n e.preventDefault();\n // Find next non-disabled option\n let nextIndex = (currentIndex + 1) % options.length;\n let attempts = 0;\n while (\n options[nextIndex].disabled &&\n attempts < options.length &&\n !disabled\n ) {\n nextIndex = (nextIndex + 1) % options.length;\n attempts++;\n }\n if (!options[nextIndex].disabled) {\n handleChange(options[nextIndex].value);\n }\n } else if (e.key === \"ArrowUp\" || e.key === \"ArrowLeft\") {\n e.preventDefault();\n // Find previous non-disabled option\n let prevIndex = (currentIndex - 1 + options.length) % options.length;\n let attempts = 0;\n while (\n options[prevIndex].disabled &&\n attempts < options.length &&\n !disabled\n ) {\n prevIndex = (prevIndex - 1 + options.length) % options.length;\n attempts++;\n }\n if (!options[prevIndex].disabled) {\n handleChange(options[prevIndex].value);\n }\n }\n };\n\n const handleBlur = () => {\n onBlur?.();\n };\n\n const baseClassName = \"radio-group\";\n const errorClassName = error ? \"radio-group--error\" : \"\";\n const layoutClassName = `radio-group--${layout}`;\n const combinedClassName =\n `${baseClassName} ${errorClassName} ${layoutClassName} ${className}`.trim();\n\n return (\n <div\n className={combinedClassName}\n role=\"radiogroup\"\n aria-invalid={error || props[\"aria-invalid\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={required || props[\"aria-required\"]}\n aria-label={typeof label === \"string\" ? label : props[\"aria-label\"]}\n >\n {label && <div className=\"radio-group-label\">{label}</div>}\n <div className=\"radio-options\">\n {options.map((option, index) => {\n const isChecked = value === option.value;\n const isDisabled = disabled || option.disabled;\n const radioId = `${name}-${option.value}`;\n\n return (\n <label\n key={option.value}\n className={`radio-option ${isDisabled ? \"radio-option--disabled\" : \"\"}`}\n htmlFor={radioId}\n >\n <input\n type=\"radio\"\n id={radioId}\n name={name}\n value={option.value}\n checked={isChecked}\n onChange={(e) => handleChange(e.target.value)}\n onBlur={handleBlur}\n onKeyDown={(e) => handleKeyDown(e, index)}\n disabled={isDisabled}\n required={required}\n className=\"radio-input\"\n aria-describedby={\n option.description\n ? `${radioId}-description`\n : props[\"aria-describedby\"]\n }\n />\n <div className=\"radio-content\">\n <span className=\"radio-label\">{option.label}</span>\n {option.description && (\n <span\n className=\"radio-description\"\n id={`${radioId}-description`}\n >\n {option.description}\n </span>\n )}\n </div>\n </label>\n );\n })}\n </div>\n </div>\n );\n}\n\nRadio.displayName = \"Radio\";\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { InputProps } from \"../core/types\";\n\n/**\n * Select option type\n */\nexport interface SelectOption {\n /**\n * The value for this option\n */\n value: string;\n\n /**\n * Display label for the option\n */\n label: React.ReactNode;\n\n /**\n * Whether this option is disabled\n */\n disabled?: boolean;\n}\n\n/**\n * Select option group type for organizing options\n */\nexport interface SelectOptionGroup {\n /**\n * Group label\n */\n label: string;\n\n /**\n * Options in this group\n */\n options: SelectOption[];\n}\n\n/**\n * Additional props specific to Select\n */\nexport interface SelectProps\n extends Omit<InputProps<string>, \"onChange\" | \"onFocus\"> {\n /**\n * Change handler - receives selected value\n */\n onChange: (value: string) => void;\n\n /**\n * Focus handler\n */\n onFocus?: () => void;\n\n /**\n * Array of select options (flat structure)\n */\n options?: SelectOption[];\n\n /**\n * Array of option groups (grouped structure)\n */\n optionGroups?: SelectOptionGroup[];\n\n /**\n * Placeholder text when no option is selected\n * @default \"Select...\"\n */\n placeholder?: string;\n\n /**\n * Enable search/filter functionality\n * @default true\n */\n searchable?: boolean;\n\n /**\n * Enable clearable button to reset selection\n * @default true\n */\n clearable?: boolean;\n\n /**\n * Loading state for async options\n * @default false\n */\n loading?: boolean;\n\n /**\n * Custom render function for options\n */\n renderOption?: (option: SelectOption) => React.ReactNode;\n\n /**\n * Additional native input attributes\n */\n [key: string]: any;\n}\n\n/**\n * Select - High-performance dropdown selection component\n *\n * A lightweight, accessible select/dropdown with search, keyboard navigation,\n * and error state support. Designed to work seamlessly with useForm and Field components.\n *\n * Features:\n * - Full accessibility support (ARIA attributes, role=\"combobox\")\n * - Error state styling\n * - Controlled input behavior\n * - Keyboard navigation (arrow keys, Enter, Escape, type-ahead)\n * - Searchable options with filtering\n * - Clearable selection\n * - Option groups support\n * - Loading state for async options\n * - Disabled options support\n * - Click outside to close\n *\n * @example\n * ```tsx\n * const form = useForm({ initialValues: { country: '' } });\n *\n * <Select\n * {...form.getFieldProps('country')}\n * placeholder=\"Select a country\"\n * options={[\n * { value: 'us', label: 'United States' },\n * { value: 'ca', label: 'Canada' },\n * { value: 'mx', label: 'Mexico' }\n * ]}\n * searchable\n * clearable\n * error={!!form.errors.country}\n * aria-describedby={form.errors.country ? 'country-error' : undefined}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // With option groups\n * <Select\n * name=\"timezone\"\n * value={timezone}\n * onChange={handleTimezoneChange}\n * optionGroups={[\n * {\n * label: 'North America',\n * options: [\n * { value: 'est', label: 'Eastern Time' },\n * { value: 'cst', label: 'Central Time' }\n * ]\n * },\n * {\n * label: 'Europe',\n * options: [\n * { value: 'gmt', label: 'GMT' },\n * { value: 'cet', label: 'Central European Time' }\n * ]\n * }\n * ]}\n * />\n * ```\n *\n * @see https://opensite.ai/developers/page-speed/forms/select\n */\nexport function Select({\n name,\n value,\n onChange,\n onBlur,\n onFocus,\n disabled = false,\n required = false,\n error = false,\n className = \"\",\n placeholder = \"Select...\",\n searchable = true,\n clearable = true,\n loading = false,\n options = [],\n optionGroups = [],\n renderOption,\n ...props\n}: SelectProps) {\n const [isOpen, setIsOpen] = React.useState(false);\n const [searchQuery, setSearchQuery] = React.useState(\"\");\n const [focusedIndex, setFocusedIndex] = React.useState(-1);\n const selectRef = React.useRef<HTMLDivElement>(null);\n const searchInputRef = React.useRef<HTMLInputElement>(null);\n const dropdownId = `${name}-dropdown`;\n\n // Flatten options from groups or use flat options\n const allOptions = React.useMemo(() => {\n if (optionGroups.length > 0) {\n return optionGroups.flatMap((group) => group.options);\n }\n return options;\n }, [options, optionGroups]);\n\n // Filter options based on search query\n const filteredOptions = React.useMemo(() => {\n if (!searchQuery.trim()) {\n return allOptions;\n }\n const query = searchQuery.toLowerCase();\n return allOptions.filter((option) => {\n const label =\n typeof option.label === \"string\" ? option.label : String(option.label);\n return label.toLowerCase().includes(query);\n });\n }, [allOptions, searchQuery]);\n\n // Get selected option\n const selectedOption = React.useMemo(() => {\n return allOptions.find((opt) => opt.value === value);\n }, [allOptions, value]);\n\n // Handle option selection\n const handleSelect = (optionValue: string) => {\n onChange(optionValue);\n setIsOpen(false);\n setSearchQuery(\"\");\n setFocusedIndex(-1);\n };\n\n // Handle clear selection\n const handleClear = (e: React.MouseEvent) => {\n e.stopPropagation();\n onChange(\"\");\n setSearchQuery(\"\");\n setFocusedIndex(-1);\n };\n\n // Toggle dropdown\n const handleToggle = () => {\n if (disabled) return;\n const newIsOpen = !isOpen;\n setIsOpen(newIsOpen);\n if (newIsOpen && searchable && searchInputRef.current) {\n // Focus search input when opening\n setTimeout(() => searchInputRef.current?.focus(), 0);\n }\n if (newIsOpen) {\n onFocus?.();\n }\n };\n\n // Handle search input change\n const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setSearchQuery(e.target.value);\n setFocusedIndex(0); // Reset focus to first filtered option\n };\n\n // Keyboard navigation\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (disabled) return;\n\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (!isOpen) {\n setIsOpen(true);\n setFocusedIndex(0);\n } else {\n const enabledOptions = filteredOptions.filter((opt) => !opt.disabled);\n if (enabledOptions.length > 0) {\n const currentIndexInFiltered = focusedIndex;\n const nextIndex = (currentIndexInFiltered + 1) % enabledOptions.length;\n setFocusedIndex(\n filteredOptions.indexOf(enabledOptions[nextIndex])\n );\n }\n }\n break;\n\n case \"ArrowUp\":\n e.preventDefault();\n if (isOpen) {\n const enabledOptions = filteredOptions.filter((opt) => !opt.disabled);\n if (enabledOptions.length > 0) {\n const currentIndexInFiltered = focusedIndex;\n const prevIndex =\n (currentIndexInFiltered - 1 + enabledOptions.length) %\n enabledOptions.length;\n setFocusedIndex(\n filteredOptions.indexOf(enabledOptions[prevIndex])\n );\n }\n }\n break;\n\n case \"Enter\":\n e.preventDefault();\n if (isOpen && focusedIndex >= 0 && focusedIndex < filteredOptions.length) {\n const focusedOption = filteredOptions[focusedIndex];\n if (!focusedOption.disabled) {\n handleSelect(focusedOption.value);\n }\n } else if (!isOpen) {\n setIsOpen(true);\n }\n break;\n\n case \"Escape\":\n e.preventDefault();\n if (isOpen) {\n setIsOpen(false);\n setSearchQuery(\"\");\n setFocusedIndex(-1);\n }\n break;\n\n case \" \":\n // Space key to open dropdown if not searching\n if (!isOpen && !searchable) {\n e.preventDefault();\n setIsOpen(true);\n }\n break;\n\n default:\n // Type-ahead search (only if not already searching)\n if (!searchable && e.key.length === 1 && !e.ctrlKey && !e.metaKey) {\n const char = e.key.toLowerCase();\n const matchingOption = filteredOptions.find((opt) => {\n const label =\n typeof opt.label === \"string\"\n ? opt.label\n : String(opt.label);\n return label.toLowerCase().startsWith(char) && !opt.disabled;\n });\n if (matchingOption) {\n handleSelect(matchingOption.value);\n }\n }\n break;\n }\n };\n\n // Handle blur\n const handleBlur = () => {\n onBlur?.();\n };\n\n // Close dropdown when clicking outside\n React.useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n selectRef.current &&\n !selectRef.current.contains(event.target as Node)\n ) {\n setIsOpen(false);\n setSearchQuery(\"\");\n setFocusedIndex(-1);\n handleBlur();\n }\n };\n\n if (isOpen) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }\n }, [isOpen]);\n\n const baseClassName = \"select\";\n const errorClassName = error ? \"select--error\" : \"\";\n const disabledClassName = disabled ? \"select--disabled\" : \"\";\n const openClassName = isOpen ? \"select--open\" : \"\";\n const combinedClassName =\n `${baseClassName} ${errorClassName} ${disabledClassName} ${openClassName} ${className}`.trim();\n\n return (\n <div\n ref={selectRef}\n className={combinedClassName}\n onKeyDown={handleKeyDown}\n onBlur={handleBlur}\n >\n {/* Hidden native select for form submission */}\n <select\n name={name}\n value={value}\n onChange={() => {}}\n disabled={disabled}\n required={required}\n aria-hidden=\"true\"\n tabIndex={-1}\n style={{ display: \"none\" }}\n >\n <option value=\"\">Select...</option>\n {allOptions.map((option) => (\n <option key={option.value} value={option.value}>\n {typeof option.label === \"string\" ? option.label : option.value}\n </option>\n ))}\n </select>\n\n {/* Custom select trigger */}\n <div\n className=\"select-trigger\"\n onClick={handleToggle}\n role=\"combobox\"\n aria-expanded={isOpen}\n aria-controls={dropdownId}\n aria-invalid={error || props[\"aria-invalid\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={required || props[\"aria-required\"]}\n aria-disabled={disabled}\n tabIndex={disabled ? -1 : 0}\n >\n <span className=\"select-value\">\n {selectedOption ? (\n renderOption ? (\n renderOption(selectedOption)\n ) : (\n selectedOption.label\n )\n ) : (\n <span className=\"select-placeholder\">{placeholder}</span>\n )}\n </span>\n <div className=\"select-icons\">\n {loading && <span className=\"select-loading\">⏳</span>}\n {clearable && value && !disabled && !loading && (\n <button\n type=\"button\"\n className=\"select-clear\"\n onClick={handleClear}\n aria-label=\"Clear selection\"\n tabIndex={-1}\n >\n ✕\n </button>\n )}\n <span className=\"select-arrow\" aria-hidden=\"true\">\n {isOpen ? \"▲\" : \"▼\"}\n </span>\n </div>\n </div>\n\n {/* Dropdown */}\n {isOpen && (\n <div id={dropdownId} className=\"select-dropdown\" role=\"listbox\">\n {searchable && (\n <div className=\"select-search\">\n <input\n ref={searchInputRef}\n type=\"text\"\n className=\"select-search-input\"\n placeholder=\"Search...\"\n value={searchQuery}\n onChange={handleSearchChange}\n onClick={(e) => e.stopPropagation()}\n aria-label=\"Search options\"\n />\n </div>\n )}\n\n <div className=\"select-options\">\n {filteredOptions.length === 0 ? (\n <div className=\"select-no-options\">No options found</div>\n ) : optionGroups.length > 0 ? (\n // Render grouped options\n optionGroups.map((group, groupIndex) => {\n const groupOptions = group.options.filter((opt) =>\n filteredOptions.includes(opt)\n );\n if (groupOptions.length === 0) return null;\n\n return (\n <div key={groupIndex} className=\"select-optgroup\">\n <div className=\"select-optgroup-label\">{group.label}</div>\n {groupOptions.map((option) => {\n const globalIndex = filteredOptions.indexOf(option);\n const isSelected = value === option.value;\n const isFocused = globalIndex === focusedIndex;\n const isDisabled = option.disabled;\n\n return (\n <div\n key={option.value}\n className={`select-option ${isSelected ? \"select-option--selected\" : \"\"} ${isFocused ? \"select-option--focused\" : \"\"} ${isDisabled ? \"select-option--disabled\" : \"\"}`}\n onClick={() =>\n !isDisabled && handleSelect(option.value)\n }\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={isDisabled}\n >\n {renderOption ? renderOption(option) : option.label}\n </div>\n );\n })}\n </div>\n );\n })\n ) : (\n // Render flat options\n filteredOptions.map((option, index) => {\n const isSelected = value === option.value;\n const isFocused = index === focusedIndex;\n const isDisabled = option.disabled;\n\n return (\n <div\n key={option.value}\n className={`select-option ${isSelected ? \"select-option--selected\" : \"\"} ${isFocused ? \"select-option--focused\" : \"\"} ${isDisabled ? \"select-option--disabled\" : \"\"}`}\n onClick={() => !isDisabled && handleSelect(option.value)}\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={isDisabled}\n >\n {renderOption ? renderOption(option) : option.label}\n </div>\n );\n })\n )}\n </div>\n </div>\n )}\n </div>\n );\n}\n\nSelect.displayName = \"Select\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"integration.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"integration.js"}
|