@axenstudio/axen-form 0.1.9 → 0.1.11

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 (101) hide show
  1. package/README.md +783 -270
  2. package/dist/core/dateUtils.cjs +7 -3
  3. package/dist/core/dateUtils.d.ts +1 -1
  4. package/dist/core/dateUtils.d.ts.map +1 -1
  5. package/dist/core/dateUtils.js +7 -3
  6. package/dist/core/validation.cjs +4 -1
  7. package/dist/core/validation.d.ts.map +1 -1
  8. package/dist/core/validation.js +4 -1
  9. package/dist/fields/AutocompleteField/AutocompleteField.cjs +32 -32
  10. package/dist/fields/AutocompleteField/AutocompleteField.js +32 -32
  11. package/dist/fields/AutocompleteField/AutocompleteField.module.css.cjs +34 -13
  12. package/dist/fields/AutocompleteField/AutocompleteField.module.css.js +34 -13
  13. package/dist/fields/AutocompleteMultiField/AutocompleteMultiField.cjs +90 -88
  14. package/dist/fields/AutocompleteMultiField/AutocompleteMultiField.d.ts.map +1 -1
  15. package/dist/fields/AutocompleteMultiField/AutocompleteMultiField.js +90 -88
  16. package/dist/fields/AutocompletePredictField/AutocompletePredictField.cjs +81 -64
  17. package/dist/fields/AutocompletePredictField/AutocompletePredictField.d.ts.map +1 -1
  18. package/dist/fields/AutocompletePredictField/AutocompletePredictField.js +81 -64
  19. package/dist/fields/CheckboxField/CheckboxField.module.css.cjs +12 -0
  20. package/dist/fields/CheckboxField/CheckboxField.module.css.js +12 -0
  21. package/dist/fields/ColorField/ColorField.module.css.cjs +12 -0
  22. package/dist/fields/ColorField/ColorField.module.css.js +12 -0
  23. package/dist/fields/DateField/DateField.cjs +56 -4
  24. package/dist/fields/DateField/DateField.d.ts +1 -1
  25. package/dist/fields/DateField/DateField.d.ts.map +1 -1
  26. package/dist/fields/DateField/DateField.js +56 -4
  27. package/dist/fields/DateField/DatePicker.cjs +194 -0
  28. package/dist/fields/DateField/DatePicker.d.ts +11 -0
  29. package/dist/fields/DateField/DatePicker.d.ts.map +1 -0
  30. package/dist/fields/DateField/DatePicker.js +194 -0
  31. package/dist/fields/DateField/DatePicker.module.css.cjs +62 -0
  32. package/dist/fields/DateField/DatePicker.module.css.js +62 -0
  33. package/dist/fields/DateTimeField/DateTimeField.cjs +126 -8
  34. package/dist/fields/DateTimeField/DateTimeField.d.ts +2 -1
  35. package/dist/fields/DateTimeField/DateTimeField.d.ts.map +1 -1
  36. package/dist/fields/DateTimeField/DateTimeField.js +126 -8
  37. package/dist/fields/PasswordField/PasswordField.module.css.cjs +12 -0
  38. package/dist/fields/PasswordField/PasswordField.module.css.js +12 -0
  39. package/dist/fields/RadioField/RadioField.module.css.cjs +12 -0
  40. package/dist/fields/RadioField/RadioField.module.css.js +12 -0
  41. package/dist/fields/SliderField/SliderField.module.css.cjs +15 -3
  42. package/dist/fields/SliderField/SliderField.module.css.js +15 -3
  43. package/dist/fields/SwitchField/SwitchField.module.css.cjs +12 -0
  44. package/dist/fields/SwitchField/SwitchField.module.css.js +12 -0
  45. package/dist/fields/TimeField/TimeField.cjs +60 -5
  46. package/dist/fields/TimeField/TimeField.d.ts +2 -1
  47. package/dist/fields/TimeField/TimeField.d.ts.map +1 -1
  48. package/dist/fields/TimeField/TimeField.js +60 -5
  49. package/dist/fields/TimeField/TimePicker.cjs +182 -0
  50. package/dist/fields/TimeField/TimePicker.d.ts +11 -0
  51. package/dist/fields/TimeField/TimePicker.d.ts.map +1 -0
  52. package/dist/fields/TimeField/TimePicker.js +182 -0
  53. package/dist/fields/TimeField/TimePicker.module.css.cjs +50 -0
  54. package/dist/fields/TimeField/TimePicker.module.css.js +50 -0
  55. package/dist/fields/defaultPlaceholders.cjs +1 -0
  56. package/dist/fields/defaultPlaceholders.d.ts.map +1 -1
  57. package/dist/fields/defaultPlaceholders.js +1 -0
  58. package/dist/fields/fieldBase.module.css.cjs +366 -18
  59. package/dist/fields/fieldBase.module.css.js +366 -18
  60. package/dist/fields/icons.cjs +2 -0
  61. package/dist/fields/icons.d.ts +4 -0
  62. package/dist/fields/icons.d.ts.map +1 -1
  63. package/dist/fields/icons.js +2 -0
  64. package/dist/index.cjs +230 -3
  65. package/dist/index.d.ts +2 -0
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +230 -3
  68. package/dist/layout/Box/Box.module.css.cjs +12 -0
  69. package/dist/layout/Box/Box.module.css.js +12 -0
  70. package/dist/layout/Divider/Divider.module.css.cjs +12 -0
  71. package/dist/layout/Divider/Divider.module.css.js +12 -0
  72. package/dist/layout/Grid/Grid.module.css.cjs +12 -0
  73. package/dist/layout/Grid/Grid.module.css.js +12 -0
  74. package/dist/layout/Stack/Stack.module.css.cjs +12 -0
  75. package/dist/layout/Stack/Stack.module.css.js +12 -0
  76. package/dist/react/AxenForm.cjs +228 -3
  77. package/dist/react/AxenForm.js +228 -3
  78. package/dist/react/fieldGroup.module.css.cjs +12 -0
  79. package/dist/react/fieldGroup.module.css.js +12 -0
  80. package/dist/react/gridCell.module.css.cjs +12 -0
  81. package/dist/react/gridCell.module.css.js +12 -0
  82. package/dist/types.d.ts +1 -0
  83. package/dist/types.d.ts.map +1 -1
  84. package/package.json +4 -9
  85. package/dist/fields/AutocompleteField/AutocompleteField.module.css +0 -168
  86. package/dist/fields/CheckboxField/CheckboxField.module.css +0 -29
  87. package/dist/fields/ColorField/ColorField.module.css +0 -33
  88. package/dist/fields/PasswordField/PasswordField.module.css +0 -41
  89. package/dist/fields/RadioField/RadioField.module.css +0 -34
  90. package/dist/fields/SliderField/SliderField.module.css +0 -76
  91. package/dist/fields/SwitchField/SwitchField.module.css +0 -79
  92. package/dist/fields/fieldBase.module.css +0 -244
  93. package/dist/layout/Box/Box.module.css +0 -3
  94. package/dist/layout/Divider/Divider.module.css +0 -25
  95. package/dist/layout/Grid/Grid.module.css +0 -43
  96. package/dist/layout/Stack/Stack.module.css +0 -3
  97. package/dist/react/fieldGroup.module.css +0 -22
  98. package/dist/react/gridCell.module.css +0 -38
  99. package/dist/tokens/reset.css +0 -68
  100. package/dist/tokens/themes.css +0 -31
  101. package/dist/tokens/tokens.css +0 -120
@@ -188,99 +188,101 @@ function AutocompleteMultiField({
188
188
  children: label
189
189
  }
190
190
  ),
191
- /* @__PURE__ */ jsx(
192
- "div",
193
- {
194
- className: cx(styles.input, error && styles.inputError),
195
- style: { height: "auto", padding: 0 },
196
- children: /* @__PURE__ */ jsxs("div", { className: localStyles.chipWrap, children: [
197
- resolvedIcon && /* @__PURE__ */ jsx(
198
- "span",
199
- {
200
- className: styles.fieldIcon,
201
- style: { position: "static", transform: "none", flexShrink: 0 },
202
- children: resolvedIcon
203
- }
204
- ),
205
- selectedValues.map((val) => /* @__PURE__ */ jsxs("span", { className: localStyles.chip, children: [
206
- resolveLabel(val),
207
- !disabled && !readOnly && /* @__PURE__ */ jsx(
208
- "button",
191
+ /* @__PURE__ */ jsxs("div", { className: localStyles.inputWrap, children: [
192
+ /* @__PURE__ */ jsx(
193
+ "div",
194
+ {
195
+ className: cx(styles.input, error && styles.inputError),
196
+ style: { height: "auto", padding: 0 },
197
+ children: /* @__PURE__ */ jsxs("div", { className: localStyles.chipWrap, children: [
198
+ resolvedIcon && /* @__PURE__ */ jsx(
199
+ "span",
209
200
  {
210
- type: "button",
211
- className: localStyles.chipRemove,
212
- onClick: () => removeValue(val),
213
- "aria-label": `Remove ${resolveLabel(val)}`,
214
- children: "×"
201
+ className: styles.fieldIcon,
202
+ style: { position: "static", transform: "none", flexShrink: 0 },
203
+ children: resolvedIcon
215
204
  }
216
- )
217
- ] }, val)),
218
- /* @__PURE__ */ jsx(
219
- "input",
220
- {
221
- ...aria,
222
- type: "text",
223
- value: inputText,
224
- onChange: handleInputChange,
225
- onKeyDown: handleKeyDown,
226
- onBlur: handleBlur,
227
- onFocus: () => {
228
- doSearch(inputText);
229
- setIsOpen(true);
230
- },
231
- placeholder: selectedValues.length === 0 ? placeholder : "",
232
- disabled,
233
- readOnly,
234
- role: "combobox",
235
- "aria-expanded": isOpen,
236
- "aria-controls": listboxId,
237
- "aria-activedescendant": activeIndex >= 0 ? `${name}-opt-${activeIndex}` : void 0,
238
- "aria-autocomplete": "list",
239
- autoComplete: "off",
240
- style: {
241
- border: "none",
242
- outline: "none",
243
- flex: 1,
244
- minWidth: "60px",
245
- padding: "var(--axen-space-xs)",
246
- background: "transparent"
205
+ ),
206
+ selectedValues.map((val) => /* @__PURE__ */ jsxs("span", { className: localStyles.chip, children: [
207
+ resolveLabel(val),
208
+ !disabled && !readOnly && /* @__PURE__ */ jsx(
209
+ "button",
210
+ {
211
+ type: "button",
212
+ className: localStyles.chipRemove,
213
+ onClick: () => removeValue(val),
214
+ "aria-label": `Remove ${resolveLabel(val)}`,
215
+ children: "×"
216
+ }
217
+ )
218
+ ] }, val)),
219
+ /* @__PURE__ */ jsx(
220
+ "input",
221
+ {
222
+ ...aria,
223
+ type: "text",
224
+ value: inputText,
225
+ onChange: handleInputChange,
226
+ onKeyDown: handleKeyDown,
227
+ onBlur: handleBlur,
228
+ onFocus: () => {
229
+ doSearch(inputText);
230
+ setIsOpen(true);
231
+ },
232
+ placeholder: selectedValues.length === 0 ? placeholder : "",
233
+ disabled,
234
+ readOnly,
235
+ role: "combobox",
236
+ "aria-expanded": isOpen,
237
+ "aria-controls": listboxId,
238
+ "aria-activedescendant": activeIndex >= 0 ? `${name}-opt-${activeIndex}` : void 0,
239
+ "aria-autocomplete": "list",
240
+ autoComplete: "off",
241
+ style: {
242
+ border: "none",
243
+ outline: "none",
244
+ flex: 1,
245
+ minWidth: "60px",
246
+ padding: "var(--axen-space-xs)",
247
+ background: "transparent"
248
+ }
247
249
  }
248
- }
249
- ),
250
- loading && /* @__PURE__ */ jsx("span", { className: localStyles.spinner, "aria-hidden": "true" })
251
- ] })
252
- }
253
- ),
254
- isOpen && filteredOptions.length > 0 && /* @__PURE__ */ jsx(
255
- "div",
256
- {
257
- id: listboxId,
258
- role: "listbox",
259
- className: localStyles.dropdown,
260
- "aria-multiselectable": "true",
261
- children: filteredOptions.map((opt, i) => /* @__PURE__ */ jsx(
262
- "div",
263
- {
264
- id: `${name}-opt-${i}`,
265
- role: "option",
266
- tabIndex: -1,
267
- "aria-selected": i === activeIndex,
268
- "aria-disabled": opt.disabled,
269
- className: cx(
270
- localStyles.option,
271
- i === activeIndex && localStyles.optionActive,
272
- opt.disabled && localStyles.optionDisabled
273
250
  ),
274
- onMouseDown: (e) => {
275
- e.preventDefault();
276
- if (!opt.disabled) selectOption(opt);
251
+ loading && /* @__PURE__ */ jsx("span", { className: localStyles.spinner, "aria-hidden": "true" })
252
+ ] })
253
+ }
254
+ ),
255
+ isOpen && filteredOptions.length > 0 && /* @__PURE__ */ jsx(
256
+ "div",
257
+ {
258
+ id: listboxId,
259
+ role: "listbox",
260
+ className: localStyles.dropdown,
261
+ "aria-multiselectable": "true",
262
+ children: filteredOptions.map((opt, i) => /* @__PURE__ */ jsx(
263
+ "div",
264
+ {
265
+ id: `${name}-opt-${i}`,
266
+ role: "option",
267
+ tabIndex: -1,
268
+ "aria-selected": i === activeIndex,
269
+ "aria-disabled": opt.disabled,
270
+ className: cx(
271
+ localStyles.option,
272
+ i === activeIndex && localStyles.optionActive,
273
+ opt.disabled && localStyles.optionDisabled
274
+ ),
275
+ onMouseDown: (e) => {
276
+ e.preventDefault();
277
+ if (!opt.disabled) selectOption(opt);
278
+ },
279
+ children: getOptionLabel(opt)
277
280
  },
278
- children: getOptionLabel(opt)
279
- },
280
- opt.value
281
- ))
282
- }
283
- ),
281
+ opt.value
282
+ ))
283
+ }
284
+ )
285
+ ] }),
284
286
  helperText && /* @__PURE__ */ jsx(
285
287
  "span",
286
288
  {
@@ -215,72 +215,89 @@ function AutocompletePredictField({
215
215
  children: label
216
216
  }
217
217
  ),
218
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: fieldUtils.cx(AutocompleteField_module.default.predictWrap, resolvedIcon && fieldBase_module.default.inputIconWrapper), children: [
219
- resolvedIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: fieldBase_module.default.fieldIcon, children: resolvedIcon }),
220
- ghostText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: AutocompleteField_module.default.ghostText, "aria-hidden": "true", children: ghostText }),
221
- /* @__PURE__ */ jsxRuntime.jsx("span", { ref: measureRef, className: AutocompleteField_module.default.ghostHidden, "aria-hidden": "true", children: inputText }),
222
- /* @__PURE__ */ jsxRuntime.jsx(
223
- "input",
224
- {
225
- ...aria,
226
- type: "text",
227
- name,
228
- value: inputText,
229
- onChange: handleInputChange,
230
- onKeyDown: handleKeyDown,
231
- onBlur: handleBlur,
232
- onFocus: () => {
233
- if (inputText) {
234
- doSearch(inputText);
235
- }
236
- setIsOpen(true);
237
- },
238
- placeholder,
239
- disabled,
240
- readOnly,
241
- role: "combobox",
242
- "aria-expanded": isOpen,
243
- "aria-controls": listboxId,
244
- "aria-activedescendant": activeIndex >= 0 ? `${name}-opt-${activeIndex}` : void 0,
245
- "aria-autocomplete": "both",
246
- autoComplete: "off",
247
- className: fieldUtils.cx(
248
- fieldBase_module.default.input,
249
- resolvedIcon && fieldBase_module.default.inputWithIcon,
250
- error && fieldBase_module.default.inputError
251
- ),
252
- style: { background: "transparent", position: "relative", zIndex: 1 }
253
- }
254
- ),
255
- loading && /* @__PURE__ */ jsxRuntime.jsx("span", { className: AutocompleteField_module.default.spinner, "aria-hidden": "true" })
256
- ] }),
257
- isOpen && filteredOptions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
218
+ /* @__PURE__ */ jsxRuntime.jsxs(
258
219
  "div",
259
220
  {
260
- id: listboxId,
261
- role: "listbox",
262
- className: AutocompleteField_module.default.dropdown,
263
- children: filteredOptions.map((opt, i) => /* @__PURE__ */ jsxRuntime.jsx(
264
- "div",
265
- {
266
- id: `${name}-opt-${i}`,
267
- role: "option",
268
- tabIndex: -1,
269
- "aria-selected": i === activeIndex,
270
- "aria-disabled": opt.disabled,
271
- className: fieldUtils.cx(
272
- AutocompleteField_module.default.option,
273
- i === activeIndex && AutocompleteField_module.default.optionActive,
274
- opt.disabled && AutocompleteField_module.default.optionDisabled
275
- ),
276
- onMouseDown: (e) => {
277
- e.preventDefault();
278
- if (!opt.disabled) selectOption(opt);
279
- },
280
- children: getOptionLabel(opt)
281
- },
282
- opt.value
283
- ))
221
+ className: fieldUtils.cx(
222
+ AutocompleteField_module.default.predictWrap,
223
+ resolvedIcon && fieldBase_module.default.inputIconWrapper,
224
+ error && AutocompleteField_module.default.predictWrapError
225
+ ),
226
+ children: [
227
+ resolvedIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: fieldBase_module.default.fieldIcon, children: resolvedIcon }),
228
+ ghostText && /* @__PURE__ */ jsxRuntime.jsx(
229
+ "span",
230
+ {
231
+ className: fieldUtils.cx(AutocompleteField_module.default.ghostText, resolvedIcon && AutocompleteField_module.default.ghostTextWithIcon),
232
+ "aria-hidden": "true",
233
+ children: ghostText
234
+ }
235
+ ),
236
+ /* @__PURE__ */ jsxRuntime.jsx("span", { ref: measureRef, className: AutocompleteField_module.default.ghostHidden, "aria-hidden": "true", children: inputText }),
237
+ /* @__PURE__ */ jsxRuntime.jsx(
238
+ "input",
239
+ {
240
+ ...aria,
241
+ type: "text",
242
+ name,
243
+ value: inputText,
244
+ onChange: handleInputChange,
245
+ onKeyDown: handleKeyDown,
246
+ onBlur: handleBlur,
247
+ onFocus: () => {
248
+ if (inputText) {
249
+ doSearch(inputText);
250
+ }
251
+ setIsOpen(true);
252
+ },
253
+ placeholder,
254
+ disabled,
255
+ readOnly,
256
+ role: "combobox",
257
+ "aria-expanded": isOpen,
258
+ "aria-controls": listboxId,
259
+ "aria-activedescendant": activeIndex >= 0 ? `${name}-opt-${activeIndex}` : void 0,
260
+ "aria-autocomplete": "both",
261
+ autoComplete: "off",
262
+ className: fieldUtils.cx(
263
+ fieldBase_module.default.input,
264
+ AutocompleteField_module.default.predictInput,
265
+ resolvedIcon && fieldBase_module.default.inputWithIcon
266
+ ),
267
+ style: { position: "relative", zIndex: 1 }
268
+ }
269
+ ),
270
+ loading && /* @__PURE__ */ jsxRuntime.jsx("span", { className: AutocompleteField_module.default.spinner, "aria-hidden": "true" }),
271
+ isOpen && filteredOptions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
272
+ "div",
273
+ {
274
+ id: listboxId,
275
+ role: "listbox",
276
+ className: AutocompleteField_module.default.dropdown,
277
+ children: filteredOptions.map((opt, i) => /* @__PURE__ */ jsxRuntime.jsx(
278
+ "div",
279
+ {
280
+ id: `${name}-opt-${i}`,
281
+ role: "option",
282
+ tabIndex: -1,
283
+ "aria-selected": i === activeIndex,
284
+ "aria-disabled": opt.disabled,
285
+ className: fieldUtils.cx(
286
+ AutocompleteField_module.default.option,
287
+ i === activeIndex && AutocompleteField_module.default.optionActive,
288
+ opt.disabled && AutocompleteField_module.default.optionDisabled
289
+ ),
290
+ onMouseDown: (e) => {
291
+ e.preventDefault();
292
+ if (!opt.disabled) selectOption(opt);
293
+ },
294
+ children: getOptionLabel(opt)
295
+ },
296
+ opt.value
297
+ ))
298
+ }
299
+ )
300
+ ]
284
301
  }
285
302
  ),
286
303
  helperText && /* @__PURE__ */ jsxRuntime.jsx(
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompletePredictField.d.ts","sourceRoot":"","sources":["../../../src/fields/AutocompletePredictField/AutocompletePredictField.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAQ3E;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,IAAI,EACJ,KAAK,EACL,QAAQ,EAAE,SAAS,EACnB,MAAM,EACN,KAAK,EACL,UAAU,EACV,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EAAE,aAAa,EACtB,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,IAAI,GACL,EAAE,mBAAmB,GAAG;IACvB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,2CAuSA"}
1
+ {"version":3,"file":"AutocompletePredictField.d.ts","sourceRoot":"","sources":["../../../src/fields/AutocompletePredictField/AutocompletePredictField.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAQ3E;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,IAAI,EACJ,KAAK,EACL,QAAQ,EAAE,SAAS,EACnB,MAAM,EACN,KAAK,EACL,UAAU,EACV,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EAAE,aAAa,EACtB,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,IAAI,GACL,EAAE,mBAAmB,GAAG;IACvB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,2CAgTA"}
@@ -213,72 +213,89 @@ function AutocompletePredictField({
213
213
  children: label
214
214
  }
215
215
  ),
216
- /* @__PURE__ */ jsxs("div", { className: cx(localStyles.predictWrap, resolvedIcon && styles.inputIconWrapper), children: [
217
- resolvedIcon && /* @__PURE__ */ jsx("span", { className: styles.fieldIcon, children: resolvedIcon }),
218
- ghostText && /* @__PURE__ */ jsx("span", { className: localStyles.ghostText, "aria-hidden": "true", children: ghostText }),
219
- /* @__PURE__ */ jsx("span", { ref: measureRef, className: localStyles.ghostHidden, "aria-hidden": "true", children: inputText }),
220
- /* @__PURE__ */ jsx(
221
- "input",
222
- {
223
- ...aria,
224
- type: "text",
225
- name,
226
- value: inputText,
227
- onChange: handleInputChange,
228
- onKeyDown: handleKeyDown,
229
- onBlur: handleBlur,
230
- onFocus: () => {
231
- if (inputText) {
232
- doSearch(inputText);
233
- }
234
- setIsOpen(true);
235
- },
236
- placeholder,
237
- disabled,
238
- readOnly,
239
- role: "combobox",
240
- "aria-expanded": isOpen,
241
- "aria-controls": listboxId,
242
- "aria-activedescendant": activeIndex >= 0 ? `${name}-opt-${activeIndex}` : void 0,
243
- "aria-autocomplete": "both",
244
- autoComplete: "off",
245
- className: cx(
246
- styles.input,
247
- resolvedIcon && styles.inputWithIcon,
248
- error && styles.inputError
249
- ),
250
- style: { background: "transparent", position: "relative", zIndex: 1 }
251
- }
252
- ),
253
- loading && /* @__PURE__ */ jsx("span", { className: localStyles.spinner, "aria-hidden": "true" })
254
- ] }),
255
- isOpen && filteredOptions.length > 0 && /* @__PURE__ */ jsx(
216
+ /* @__PURE__ */ jsxs(
256
217
  "div",
257
218
  {
258
- id: listboxId,
259
- role: "listbox",
260
- className: localStyles.dropdown,
261
- children: filteredOptions.map((opt, i) => /* @__PURE__ */ jsx(
262
- "div",
263
- {
264
- id: `${name}-opt-${i}`,
265
- role: "option",
266
- tabIndex: -1,
267
- "aria-selected": i === activeIndex,
268
- "aria-disabled": opt.disabled,
269
- className: cx(
270
- localStyles.option,
271
- i === activeIndex && localStyles.optionActive,
272
- opt.disabled && localStyles.optionDisabled
273
- ),
274
- onMouseDown: (e) => {
275
- e.preventDefault();
276
- if (!opt.disabled) selectOption(opt);
277
- },
278
- children: getOptionLabel(opt)
279
- },
280
- opt.value
281
- ))
219
+ className: cx(
220
+ localStyles.predictWrap,
221
+ resolvedIcon && styles.inputIconWrapper,
222
+ error && localStyles.predictWrapError
223
+ ),
224
+ children: [
225
+ resolvedIcon && /* @__PURE__ */ jsx("span", { className: styles.fieldIcon, children: resolvedIcon }),
226
+ ghostText && /* @__PURE__ */ jsx(
227
+ "span",
228
+ {
229
+ className: cx(localStyles.ghostText, resolvedIcon && localStyles.ghostTextWithIcon),
230
+ "aria-hidden": "true",
231
+ children: ghostText
232
+ }
233
+ ),
234
+ /* @__PURE__ */ jsx("span", { ref: measureRef, className: localStyles.ghostHidden, "aria-hidden": "true", children: inputText }),
235
+ /* @__PURE__ */ jsx(
236
+ "input",
237
+ {
238
+ ...aria,
239
+ type: "text",
240
+ name,
241
+ value: inputText,
242
+ onChange: handleInputChange,
243
+ onKeyDown: handleKeyDown,
244
+ onBlur: handleBlur,
245
+ onFocus: () => {
246
+ if (inputText) {
247
+ doSearch(inputText);
248
+ }
249
+ setIsOpen(true);
250
+ },
251
+ placeholder,
252
+ disabled,
253
+ readOnly,
254
+ role: "combobox",
255
+ "aria-expanded": isOpen,
256
+ "aria-controls": listboxId,
257
+ "aria-activedescendant": activeIndex >= 0 ? `${name}-opt-${activeIndex}` : void 0,
258
+ "aria-autocomplete": "both",
259
+ autoComplete: "off",
260
+ className: cx(
261
+ styles.input,
262
+ localStyles.predictInput,
263
+ resolvedIcon && styles.inputWithIcon
264
+ ),
265
+ style: { position: "relative", zIndex: 1 }
266
+ }
267
+ ),
268
+ loading && /* @__PURE__ */ jsx("span", { className: localStyles.spinner, "aria-hidden": "true" }),
269
+ isOpen && filteredOptions.length > 0 && /* @__PURE__ */ jsx(
270
+ "div",
271
+ {
272
+ id: listboxId,
273
+ role: "listbox",
274
+ className: localStyles.dropdown,
275
+ children: filteredOptions.map((opt, i) => /* @__PURE__ */ jsx(
276
+ "div",
277
+ {
278
+ id: `${name}-opt-${i}`,
279
+ role: "option",
280
+ tabIndex: -1,
281
+ "aria-selected": i === activeIndex,
282
+ "aria-disabled": opt.disabled,
283
+ className: cx(
284
+ localStyles.option,
285
+ i === activeIndex && localStyles.optionActive,
286
+ opt.disabled && localStyles.optionDisabled
287
+ ),
288
+ onMouseDown: (e) => {
289
+ e.preventDefault();
290
+ if (!opt.disabled) selectOption(opt);
291
+ },
292
+ children: getOptionLabel(opt)
293
+ },
294
+ opt.value
295
+ ))
296
+ }
297
+ )
298
+ ]
282
299
  }
283
300
  ),
284
301
  helperText && /* @__PURE__ */ jsx(
@@ -1,3 +1,15 @@
1
+ (function() {
2
+ "use strict";
3
+ try {
4
+ if (typeof document != "undefined") {
5
+ var elementStyle = document.createElement("style");
6
+ elementStyle.appendChild(document.createTextNode("._checkboxLabel_1labl_1 {\n cursor: pointer;\n}\n\n._checkbox_1labl_1 {\n width: 20px;\n height: 20px;\n margin: 0;\n cursor: pointer;\n accent-color: var(--axen-color-primary);\n border-radius: var(--axen-border-radius-sm);\n}\n\n._checkbox_1labl_1:focus-visible {\n outline: var(--axen-focus-ring-width) solid var(--axen-focus-ring-color);\n outline-offset: var(--axen-focus-ring-offset);\n}\n\n._checkbox_1labl_1:disabled {\n cursor: not-allowed;\n}\n\n/* Mobile: larger touch target */\n@media (max-width: 599px) {\n ._checkbox_1labl_1 {\n width: 24px;\n height: 24px;\n }\n}"));
7
+ document.head.appendChild(elementStyle);
8
+ }
9
+ } catch (e) {
10
+ console.error("vite-plugin-css-injected-by-js", e);
11
+ }
12
+ })();
1
13
  "use strict";
2
14
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
15
  const checkboxLabel = "_checkboxLabel_1labl_1";
@@ -1,3 +1,15 @@
1
+ (function() {
2
+ "use strict";
3
+ try {
4
+ if (typeof document != "undefined") {
5
+ var elementStyle = document.createElement("style");
6
+ elementStyle.appendChild(document.createTextNode("._checkboxLabel_1labl_1 {\n cursor: pointer;\n}\n\n._checkbox_1labl_1 {\n width: 20px;\n height: 20px;\n margin: 0;\n cursor: pointer;\n accent-color: var(--axen-color-primary);\n border-radius: var(--axen-border-radius-sm);\n}\n\n._checkbox_1labl_1:focus-visible {\n outline: var(--axen-focus-ring-width) solid var(--axen-focus-ring-color);\n outline-offset: var(--axen-focus-ring-offset);\n}\n\n._checkbox_1labl_1:disabled {\n cursor: not-allowed;\n}\n\n/* Mobile: larger touch target */\n@media (max-width: 599px) {\n ._checkbox_1labl_1 {\n width: 24px;\n height: 24px;\n }\n}"));
7
+ document.head.appendChild(elementStyle);
8
+ }
9
+ } catch (e) {
10
+ console.error("vite-plugin-css-injected-by-js", e);
11
+ }
12
+ })();
1
13
  const checkboxLabel = "_checkboxLabel_1labl_1";
2
14
  const checkbox = "_checkbox_1labl_1";
3
15
  const localStyles = {
@@ -1,3 +1,15 @@
1
+ (function() {
2
+ "use strict";
3
+ try {
4
+ if (typeof document != "undefined") {
5
+ var elementStyle = document.createElement("style");
6
+ elementStyle.appendChild(document.createTextNode("._colorWrap_or7ln_1 {\n display: flex;\n align-items: center;\n gap: var(--axen-space-sm);\n min-height: var(--axen-field-min-height);\n}\n\n._colorInput_or7ln_8 {\n width: 44px;\n height: 44px;\n padding: 2px;\n border: var(--axen-border-width) solid var(--axen-color-border);\n border-radius: var(--axen-border-radius);\n cursor: pointer;\n background: none;\n}\n\n._colorInput_or7ln_8:focus-visible {\n outline: var(--axen-focus-ring-width) solid var(--axen-focus-ring-color);\n outline-offset: var(--axen-focus-ring-offset);\n}\n\n._colorInput_or7ln_8:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n._colorValue_or7ln_28 {\n font-size: var(--axen-font-size-sm);\n font-family: monospace;\n color: var(--axen-color-text-secondary);\n text-transform: uppercase;\n}"));
7
+ document.head.appendChild(elementStyle);
8
+ }
9
+ } catch (e) {
10
+ console.error("vite-plugin-css-injected-by-js", e);
11
+ }
12
+ })();
1
13
  "use strict";
2
14
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
15
  const colorWrap = "_colorWrap_or7ln_1";
@@ -1,3 +1,15 @@
1
+ (function() {
2
+ "use strict";
3
+ try {
4
+ if (typeof document != "undefined") {
5
+ var elementStyle = document.createElement("style");
6
+ elementStyle.appendChild(document.createTextNode("._colorWrap_or7ln_1 {\n display: flex;\n align-items: center;\n gap: var(--axen-space-sm);\n min-height: var(--axen-field-min-height);\n}\n\n._colorInput_or7ln_8 {\n width: 44px;\n height: 44px;\n padding: 2px;\n border: var(--axen-border-width) solid var(--axen-color-border);\n border-radius: var(--axen-border-radius);\n cursor: pointer;\n background: none;\n}\n\n._colorInput_or7ln_8:focus-visible {\n outline: var(--axen-focus-ring-width) solid var(--axen-focus-ring-color);\n outline-offset: var(--axen-focus-ring-offset);\n}\n\n._colorInput_or7ln_8:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n._colorValue_or7ln_28 {\n font-size: var(--axen-font-size-sm);\n font-family: monospace;\n color: var(--axen-color-text-secondary);\n text-transform: uppercase;\n}"));
7
+ document.head.appendChild(elementStyle);
8
+ }
9
+ } catch (e) {
10
+ console.error("vite-plugin-css-injected-by-js", e);
11
+ }
12
+ })();
1
13
  const colorWrap = "_colorWrap_or7ln_1";
2
14
  const colorInput = "_colorInput_or7ln_8";
3
15
  const colorValue = "_colorValue_or7ln_28";