@povio/ui 3.3.0 → 3.4.0-rc.1

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 (78) hide show
  1. package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -2
  2. package/dist/components/inputs/Checkbox/Checkbox.js +93 -100
  3. package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +1 -2
  4. package/dist/components/inputs/Checkbox/CheckboxGroup.js +109 -113
  5. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -2
  6. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +14 -21
  7. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -2
  8. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +14 -22
  9. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -2
  10. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +14 -21
  11. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -2
  12. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +275 -294
  13. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +1 -2
  14. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +1 -10
  15. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
  16. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +43 -46
  17. package/dist/components/inputs/File/FileUpload.d.ts +1 -1
  18. package/dist/components/inputs/File/FileUpload.js +17 -17
  19. package/dist/components/inputs/File/InputUpload.d.ts +1 -1
  20. package/dist/components/inputs/File/InputUpload.js +17 -17
  21. package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
  22. package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
  23. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
  24. package/dist/components/inputs/Input/NumberInput/NumberInput.js +19 -19
  25. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +1 -1
  26. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +18 -18
  27. package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
  28. package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -1
  29. package/dist/components/inputs/Input/TextArea/TextArea.js +18 -18
  30. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
  31. package/dist/components/inputs/Input/TextInput/TextInput.js +36 -38
  32. package/dist/components/inputs/Inputs/Form.d.ts +4 -4
  33. package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
  34. package/dist/components/inputs/Inputs/InputItem.js +35 -36
  35. package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
  36. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
  37. package/dist/components/inputs/RadioGroup/RadioGroup.js +107 -111
  38. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
  39. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +13 -13
  40. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
  41. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +19 -19
  42. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
  43. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
  44. package/dist/components/inputs/Selection/Select/QuerySelect.js +19 -19
  45. package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
  46. package/dist/components/inputs/Selection/Select/Select.js +19 -19
  47. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +0 -1
  48. package/dist/components/inputs/Selection/shared/SelectBase.js +34 -37
  49. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
  50. package/dist/components/inputs/Selection/shared/select.context.js +4 -8
  51. package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
  52. package/dist/components/inputs/Slider/Slider.d.ts +1 -1
  53. package/dist/components/inputs/Slider/Slider.js +18 -18
  54. package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
  55. package/dist/components/inputs/TextEditor/TextEditor.js +18 -18
  56. package/dist/components/inputs/Toggle/Toggle.d.ts +1 -2
  57. package/dist/components/inputs/Toggle/Toggle.js +59 -63
  58. package/dist/components/inputs/shared/form.binding.d.ts +27 -0
  59. package/dist/components/inputs/shared/form.binding.js +57 -0
  60. package/dist/components/inputs/shared/form.types.d.ts +9 -8
  61. package/dist/components/inputs/shared/form.types.js +8 -0
  62. package/dist/components/segment/Segment.d.ts +1 -1
  63. package/dist/components/segment/Segment.js +17 -17
  64. package/dist/components/segment/segment.types.d.ts +1 -1
  65. package/dist/config/uiConfig.context.d.ts +5 -5
  66. package/dist/config/uiConfig.context.js +3 -12
  67. package/dist/helpers/dynamicColumns.d.ts +1 -1
  68. package/dist/helpers/dynamicInputs.d.ts +7 -7
  69. package/dist/hooks/useAutosave.d.ts +4 -4
  70. package/dist/hooks/useAutosave.js +64 -49
  71. package/dist/hooks/useForm.d.ts +39 -15
  72. package/dist/hooks/useForm.js +96 -43
  73. package/dist/hooks/useFormAutosave.d.ts +8 -9
  74. package/dist/hooks/useFormAutosave.js +23 -9
  75. package/dist/index.d.ts +2 -2
  76. package/dist/index.js +3 -3
  77. package/package.json +2 -3
  78. package/dist/hooks/useAutosave.spec.d.ts +0 -1
@@ -39,8 +39,7 @@ interface DatePickerInputProps extends InputVariantProps {
39
39
  timeZone?: string;
40
40
  isTimeOptional?: boolean;
41
41
  format?: string;
42
- fireBlurOnChange?: boolean;
43
42
  onClear?: () => void;
44
43
  }
45
- export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize, todayIconButtonComponent, todayIconPlacement, isDirty, isRequired, disableManualEntry, autoFixYear, placeholder, className, onOpenDropdown, dateGranularity, timeZone: timeZoneProp, isTimeOptional, format, fireBlurOnChange, onClear: onClearProp, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
44
+ export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize, todayIconButtonComponent, todayIconPlacement, isDirty, isRequired, disableManualEntry, autoFixYear, placeholder, className, onOpenDropdown, dateGranularity, timeZone: timeZoneProp, isTimeOptional, format, onClear: onClearProp, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
46
45
  export {};
@@ -17,7 +17,7 @@ import { Button } from "react-aria-components";
17
17
  import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
18
18
  import { getLocalTimeZone, today } from "@internationalized/date";
19
19
  //#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
20
- var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize = "none", todayIconButtonComponent, todayIconPlacement = "content", isDirty, isRequired, disableManualEntry, autoFixYear = false, placeholder, className, onOpenDropdown, dateGranularity = "day", timeZone: timeZoneProp, isTimeOptional = false, format, fireBlurOnChange, onClear: onClearProp, ...props }) => {
20
+ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize = "none", todayIconButtonComponent, todayIconPlacement = "content", isDirty, isRequired, disableManualEntry, autoFixYear = false, placeholder, className, onOpenDropdown, dateGranularity = "day", timeZone: timeZoneProp, isTimeOptional = false, format, onClear: onClearProp, ...props }) => {
21
21
  const uiConfig = UIConfig.useConfig();
22
22
  const timeZone = timeZoneProp ?? uiConfig.dateInput.timeZone;
23
23
  let effectiveTimeZone = getLocalTimeZone();
@@ -57,16 +57,11 @@ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldVa
57
57
  else {
58
58
  fieldProps.onChange?.(null);
59
59
  endFieldProps?.onChange?.(null);
60
- if (fireBlurOnChange) {
61
- fieldProps.onBlur?.(null);
62
- endFieldProps?.onBlur?.(null);
63
- }
64
60
  }
65
61
  setCanClear(false);
66
62
  }, [
67
63
  endFieldProps,
68
64
  fieldProps,
69
- fireBlurOnChange,
70
65
  onClearProp
71
66
  ]);
72
67
  useImperativeHandle(ref, () => ({
@@ -88,10 +83,6 @@ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldVa
88
83
  fieldProps.onChange?.(today(effectiveTimeZone));
89
84
  if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
90
85
  }
91
- if (fireBlurOnChange) {
92
- fieldProps.onBlur?.(null);
93
- endFieldProps?.onBlur?.(null);
94
- }
95
86
  };
96
87
  const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
97
88
  const todayIconButton = renderDatePickerTodayIcon(todayIcon, {
@@ -19,7 +19,6 @@ interface DatePickerInputProps extends InputVariantProps {
19
19
  className?: string;
20
20
  onPress: () => void;
21
21
  onClear?: () => void;
22
- fireBlurOnChange?: boolean;
23
22
  }
24
- export declare const TimePickerInput: ({ ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear, fireBlurOnChange, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const TimePickerInput: ({ ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
25
24
  export {};
@@ -16,8 +16,8 @@ import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
16
16
  import { mergeRefs } from "@react-aria/utils";
17
17
  //#region src/components/inputs/DateTime/shared/TimePickerInput.tsx
18
18
  var TimePickerInput = (t0) => {
19
- const $ = c(69);
20
- const { ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear, fireBlurOnChange, ...props } = t0;
19
+ const $ = c(67);
20
+ const { ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear, ...props } = t0;
21
21
  const uiConfig = UIConfig.useConfig();
22
22
  const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
23
23
  const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
@@ -147,25 +147,22 @@ var TimePickerInput = (t0) => {
147
147
  $[32] = t22;
148
148
  } else t22 = $[32];
149
149
  let t23;
150
- if ($[33] !== canClear || $[34] !== fieldProps || $[35] !== fireBlurOnChange || $[36] !== isClearable || $[37] !== onClear || $[38] !== state) {
150
+ if ($[33] !== canClear || $[34] !== isClearable || $[35] !== onClear || $[36] !== state) {
151
151
  t23 = isClearable && /* @__PURE__ */ jsx(InputClear, {
152
152
  onClear: () => {
153
153
  state.setValue(null);
154
154
  onClear?.();
155
- if (fireBlurOnChange) fieldProps.onBlur?.(null);
156
155
  },
157
156
  show: canClear
158
157
  });
159
158
  $[33] = canClear;
160
- $[34] = fieldProps;
161
- $[35] = fireBlurOnChange;
162
- $[36] = isClearable;
163
- $[37] = onClear;
164
- $[38] = state;
165
- $[39] = t23;
166
- } else t23 = $[39];
159
+ $[34] = isClearable;
160
+ $[35] = onClear;
161
+ $[36] = state;
162
+ $[37] = t23;
163
+ } else t23 = $[37];
167
164
  let t24;
168
- if ($[40] !== disableDropdown || $[41] !== disableManualEntry || $[42] !== isDisabled || $[43] !== onPress || $[44] !== uiConfig) {
165
+ if ($[38] !== disableDropdown || $[39] !== disableManualEntry || $[40] !== isDisabled || $[41] !== onPress || $[42] !== uiConfig) {
169
166
  t24 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
170
167
  label: "",
171
168
  color: "secondary",
@@ -175,26 +172,26 @@ var TimePickerInput = (t0) => {
175
172
  className: "border-0!",
176
173
  "data-static-press-action": ""
177
174
  });
178
- $[40] = disableDropdown;
179
- $[41] = disableManualEntry;
180
- $[42] = isDisabled;
181
- $[43] = onPress;
182
- $[44] = uiConfig;
183
- $[45] = t24;
184
- } else t24 = $[45];
175
+ $[38] = disableDropdown;
176
+ $[39] = disableManualEntry;
177
+ $[40] = isDisabled;
178
+ $[41] = onPress;
179
+ $[42] = uiConfig;
180
+ $[43] = t24;
181
+ } else t24 = $[43];
185
182
  let t25;
186
- if ($[46] !== t22 || $[47] !== t23 || $[48] !== t24) {
183
+ if ($[44] !== t22 || $[45] !== t23 || $[46] !== t24) {
187
184
  t25 = /* @__PURE__ */ jsxs("div", {
188
185
  className: t22,
189
186
  children: [t23, t24]
190
187
  });
191
- $[46] = t22;
192
- $[47] = t23;
193
- $[48] = t24;
194
- $[49] = t25;
195
- } else t25 = $[49];
188
+ $[44] = t22;
189
+ $[45] = t23;
190
+ $[46] = t24;
191
+ $[47] = t25;
192
+ } else t25 = $[47];
196
193
  let t26;
197
- if ($[50] !== fieldProps || $[51] !== focusWithinProps || $[52] !== hoverProps || $[53] !== t10 || $[54] !== t11 || $[55] !== t12 || $[56] !== t13 || $[57] !== t14 || $[58] !== t15 || $[59] !== t16 || $[60] !== t21 || $[61] !== t25 || $[62] !== t4 || $[63] !== t5 || $[64] !== t6 || $[65] !== t7 || $[66] !== t8 || $[67] !== t9) {
194
+ if ($[48] !== fieldProps || $[49] !== focusWithinProps || $[50] !== hoverProps || $[51] !== t10 || $[52] !== t11 || $[53] !== t12 || $[54] !== t13 || $[55] !== t14 || $[56] !== t15 || $[57] !== t16 || $[58] !== t21 || $[59] !== t25 || $[60] !== t4 || $[61] !== t5 || $[62] !== t6 || $[63] !== t7 || $[64] !== t8 || $[65] !== t9) {
198
195
  t26 = /* @__PURE__ */ jsxs("div", {
199
196
  ref: t4,
200
197
  className: t5,
@@ -216,26 +213,26 @@ var TimePickerInput = (t0) => {
216
213
  ...hoverProps,
217
214
  children: [t21, t25]
218
215
  });
219
- $[50] = fieldProps;
220
- $[51] = focusWithinProps;
221
- $[52] = hoverProps;
222
- $[53] = t10;
223
- $[54] = t11;
224
- $[55] = t12;
225
- $[56] = t13;
226
- $[57] = t14;
227
- $[58] = t15;
228
- $[59] = t16;
229
- $[60] = t21;
230
- $[61] = t25;
231
- $[62] = t4;
232
- $[63] = t5;
233
- $[64] = t6;
234
- $[65] = t7;
235
- $[66] = t8;
236
- $[67] = t9;
237
- $[68] = t26;
238
- } else t26 = $[68];
216
+ $[48] = fieldProps;
217
+ $[49] = focusWithinProps;
218
+ $[50] = hoverProps;
219
+ $[51] = t10;
220
+ $[52] = t11;
221
+ $[53] = t12;
222
+ $[54] = t13;
223
+ $[55] = t14;
224
+ $[56] = t15;
225
+ $[57] = t16;
226
+ $[58] = t21;
227
+ $[59] = t25;
228
+ $[60] = t4;
229
+ $[61] = t5;
230
+ $[62] = t6;
231
+ $[63] = t7;
232
+ $[64] = t8;
233
+ $[65] = t9;
234
+ $[66] = t26;
235
+ } else t26 = $[66];
239
236
  return t26;
240
237
  };
241
238
  function _temp(segment) {
@@ -1,4 +1,4 @@
1
- import { FieldValues } from 'react-hook-form';
1
+ import { FieldValues } from '../shared/form.binding';
2
2
  import { FileUploadProps } from './fileUpload.types';
3
3
  export type { DefaultFile, FileUploadBaseProps, FileUploadButtonProps, FileUploadError, FileUploadProps, FileUploadRequest, FileUploadResponse, FileUploadState, } from './fileUpload.types';
4
4
  export declare const FileUpload: <TFieldValues extends FieldValues = FieldValues>(props: FileUploadProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { UIOverrides } from "../../../config/uiOverrides.context.js";
2
2
  import { UIConfig } from "../../../config/uiConfig.context.js";
3
3
  import "../../../config/i18n.js";
4
+ import { FieldController } from "../shared/form.binding.js";
4
5
  import { FormField } from "../FormField/FormField.js";
5
6
  import { FileUtils } from "../../../utils/file.utils.js";
6
7
  import { FileCardList } from "./shared/FileCardList.js";
@@ -14,7 +15,6 @@ import { useCallback, useState } from "react";
14
15
  import { DropZone } from "react-aria-components";
15
16
  import { mergeRefs, useLabels } from "@react-aria/utils";
16
17
  import { useTranslation } from "react-i18next";
17
- import { Controller } from "react-hook-form";
18
18
  //#region src/components/inputs/File/FileUpload.tsx
19
19
  var FileUploadBase = (props) => {
20
20
  const { t } = useTranslation("ui");
@@ -192,32 +192,32 @@ var FileUploadBase = (props) => {
192
192
  };
193
193
  var FileUpload = (props) => {
194
194
  const $ = c(15);
195
- if ("formControl" in props && props.formControl) {
196
- let formControl;
195
+ if ("field" in props && props.field) {
196
+ let field;
197
197
  let innerProps;
198
198
  let ref;
199
199
  if ($[0] !== props) {
200
- ({formControl, ref, ...innerProps} = props);
200
+ ({field, ref, ...innerProps} = props);
201
201
  $[0] = props;
202
- $[1] = formControl;
202
+ $[1] = field;
203
203
  $[2] = innerProps;
204
204
  $[3] = ref;
205
205
  } else {
206
- formControl = $[1];
206
+ field = $[1];
207
207
  innerProps = $[2];
208
208
  ref = $[3];
209
209
  }
210
210
  let t0;
211
211
  if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
212
212
  t0 = (t1) => {
213
- const { field, fieldState: t2 } = t1;
213
+ const { field: field_0, fieldState: t2 } = t1;
214
214
  const { error } = t2;
215
215
  return /* @__PURE__ */ jsx(FileUploadBase, {
216
216
  ...innerProps,
217
- ref: mergeRefs(ref, field.ref),
218
- value: field.value,
219
- onChange: field.onChange,
220
- isDisabled: field.disabled || props.isDisabled,
217
+ ref: mergeRefs(ref, field_0.ref),
218
+ value: field_0.value,
219
+ onChange: field_0.onChange,
220
+ isDisabled: field_0.disabled || props.isDisabled,
221
221
  error: props.error ?? error?.message
222
222
  });
223
223
  };
@@ -228,14 +228,14 @@ var FileUpload = (props) => {
228
228
  $[8] = t0;
229
229
  } else t0 = $[8];
230
230
  let t1;
231
- if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
232
- t1 = /* @__PURE__ */ jsx(Controller, {
233
- control: formControl.control,
234
- name: formControl.name,
231
+ if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
232
+ t1 = /* @__PURE__ */ jsx(FieldController, {
233
+ control: field.form,
234
+ name: field.name,
235
235
  render: t0
236
236
  });
237
- $[9] = formControl.control;
238
- $[10] = formControl.name;
237
+ $[9] = field.form;
238
+ $[10] = field.name;
239
239
  $[11] = t0;
240
240
  $[12] = t1;
241
241
  } else t1 = $[12];
@@ -1,4 +1,4 @@
1
- import { FieldValues } from 'react-hook-form';
1
+ import { FieldValues } from '../shared/form.binding';
2
2
  import { InputUploadProps } from './inputUpload.types';
3
3
  export type { InputUploadBaseProps, InputUploadProps } from './inputUpload.types';
4
4
  export declare const InputUpload: <TFieldValues extends FieldValues = FieldValues>(props: InputUploadProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { UIConfig } from "../../../config/uiConfig.context.js";
2
+ import { FieldController } from "../shared/form.binding.js";
2
3
  import { FormField } from "../FormField/FormField.js";
3
4
  import { FileUtils } from "../../../utils/file.utils.js";
4
5
  import { InputUploadContent } from "./shared/InputUploadContent.js";
@@ -8,7 +9,6 @@ import { jsx } from "react/jsx-runtime";
8
9
  import { clsx } from "clsx";
9
10
  import { useState } from "react";
10
11
  import { mergeRefs, useLabels } from "@react-aria/utils";
11
- import { Controller } from "react-hook-form";
12
12
  //#region src/components/inputs/File/InputUpload.tsx
13
13
  var InputUploadBase = ({ ref: _ref, label, tooltipText, variant, helperText, isRequired, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, onChange, onInvalidFileType, value, defaultValue, allowsMultiple = false, hideLabel, acceptedFileTypes, size, ...rest }) => {
14
14
  const ui = UIConfig.useConfig();
@@ -96,32 +96,32 @@ var InputUploadBase = ({ ref: _ref, label, tooltipText, variant, helperText, isR
96
96
  };
97
97
  var InputUpload = (props) => {
98
98
  const $ = c(15);
99
- if ("formControl" in props && props.formControl) {
100
- let formControl;
99
+ if ("field" in props && props.field) {
100
+ let field;
101
101
  let innerProps;
102
102
  let ref;
103
103
  if ($[0] !== props) {
104
- ({formControl, ref, ...innerProps} = props);
104
+ ({field, ref, ...innerProps} = props);
105
105
  $[0] = props;
106
- $[1] = formControl;
106
+ $[1] = field;
107
107
  $[2] = innerProps;
108
108
  $[3] = ref;
109
109
  } else {
110
- formControl = $[1];
110
+ field = $[1];
111
111
  innerProps = $[2];
112
112
  ref = $[3];
113
113
  }
114
114
  let t0;
115
115
  if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
116
116
  t0 = (t1) => {
117
- const { field, fieldState: t2 } = t1;
117
+ const { field: field_0, fieldState: t2 } = t1;
118
118
  const { error } = t2;
119
119
  return /* @__PURE__ */ jsx(InputUploadBase, {
120
120
  ...innerProps,
121
- ref: mergeRefs(ref, field.ref),
122
- value: field.value,
123
- onChange: field.onChange,
124
- isDisabled: field.disabled || props.isDisabled,
121
+ ref: mergeRefs(ref, field_0.ref),
122
+ value: field_0.value,
123
+ onChange: field_0.onChange,
124
+ isDisabled: field_0.disabled || props.isDisabled,
125
125
  error: props.error ?? error?.message
126
126
  });
127
127
  };
@@ -132,14 +132,14 @@ var InputUpload = (props) => {
132
132
  $[8] = t0;
133
133
  } else t0 = $[8];
134
134
  let t1;
135
- if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
136
- t1 = /* @__PURE__ */ jsx(Controller, {
137
- control: formControl.control,
138
- name: formControl.name,
135
+ if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
136
+ t1 = /* @__PURE__ */ jsx(FieldController, {
137
+ control: field.form,
138
+ name: field.name,
139
139
  render: t0
140
140
  });
141
- $[9] = formControl.control;
142
- $[10] = formControl.name;
141
+ $[9] = field.form;
142
+ $[10] = field.name;
143
143
  $[11] = t0;
144
144
  $[12] = t1;
145
145
  } else t1 = $[12];
@@ -1,6 +1,6 @@
1
1
  import { ReactNode, Ref } from 'react';
2
2
  import { DropZoneProps, FileTriggerProps } from 'react-aria-components';
3
- import { FieldValues } from 'react-hook-form';
3
+ import { FieldValues } from '../shared/form.binding';
4
4
  import { ButtonProps } from '../../buttons/Button/Button';
5
5
  import { FormFieldProps } from '../FormField/FormField';
6
6
  import { ControlProps } from '../shared/form.types';
@@ -1,6 +1,6 @@
1
1
  import { Ref } from 'react';
2
2
  import { DropZoneProps, FileTriggerProps } from 'react-aria-components';
3
- import { FieldValues } from 'react-hook-form';
3
+ import { FieldValues } from '../shared/form.binding';
4
4
  import { FormFieldProps } from '../FormField/FormField';
5
5
  import { ControlProps } from '../shared/form.types';
6
6
  import { InputUploadButtonProps } from './shared/inputUploadButton.cva';
@@ -1,6 +1,6 @@
1
1
  import { FocusEvent, Ref } from 'react';
2
2
  import { NumberFieldProps as AriaNumberFieldProps } from 'react-aria-components';
3
- import { FieldValues } from 'react-hook-form';
3
+ import { FieldValues } from '../../shared/form.binding';
4
4
  import { FormFieldProps } from '../../FormField/FormField';
5
5
  import { InputContentProps } from '../shared/InputContent';
6
6
  import { ControlProps } from '../../shared/form.types';
@@ -1,5 +1,6 @@
1
1
  import { UIOverrides } from "../../../../config/uiOverrides.context.js";
2
2
  import { UIConfig } from "../../../../config/uiConfig.context.js";
3
+ import { FieldController } from "../../shared/form.binding.js";
3
4
  import { FormField } from "../../FormField/FormField.js";
4
5
  import { inputBaseDefinition } from "../../shared/input.cva.js";
5
6
  import { IntlUtils } from "../../../../utils/intl.utils.js";
@@ -15,7 +16,6 @@ import { useEffect, useRef, useState } from "react";
15
16
  import { Input, useLocale } from "react-aria-components";
16
17
  import { useFocusVisible, useNumberField } from "react-aria";
17
18
  import { mergeRefs } from "@react-aria/utils";
18
- import { Controller } from "react-hook-form";
19
19
  import { useNumberFieldState } from "react-stately";
20
20
  //#region src/components/inputs/Input/NumberInput/NumberInput.tsx
21
21
  var NumberInputBase = (props) => {
@@ -420,35 +420,35 @@ var NumberInput = (t0) => {
420
420
  props = $[1];
421
421
  renderStaticInput = $[2];
422
422
  }
423
- if ("formControl" in props && props.formControl) {
424
- let formControl;
423
+ if ("field" in props && props.field) {
424
+ let field;
425
425
  let innerProps;
426
426
  let ref;
427
427
  if ($[3] !== props) {
428
- ({formControl, ref, ...innerProps} = props);
428
+ ({field, ref, ...innerProps} = props);
429
429
  $[3] = props;
430
- $[4] = formControl;
430
+ $[4] = field;
431
431
  $[5] = innerProps;
432
432
  $[6] = ref;
433
433
  } else {
434
- formControl = $[4];
434
+ field = $[4];
435
435
  innerProps = $[5];
436
436
  ref = $[6];
437
437
  }
438
- const controlWithOptions = formControl.control;
438
+ const controlWithOptions = field.form;
439
439
  let t1;
440
440
  if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
441
441
  t1 = (t2) => {
442
- const { field, fieldState: t3 } = t2;
442
+ const { field: field_0, fieldState: t3 } = t2;
443
443
  const { error, isDirty } = t3;
444
444
  return /* @__PURE__ */ jsx(NumberInputInner, {
445
445
  ...innerProps,
446
- ref: mergeRefs(ref, field.ref),
447
- value: field.value,
448
- onChange: field.onChange,
449
- onBlur: field.onBlur,
446
+ ref: mergeRefs(ref, field_0.ref),
447
+ value: field_0.value,
448
+ onChange: field_0.onChange,
449
+ onBlur: field_0.onBlur,
450
450
  isDirty,
451
- isDisabled: field.disabled || props.isDisabled,
451
+ isDisabled: field_0.disabled || props.isDisabled,
452
452
  isFormControlDisabled: !!controlWithOptions._options?.disabled,
453
453
  error: props.error ?? error?.message,
454
454
  renderStaticInput
@@ -463,14 +463,14 @@ var NumberInput = (t0) => {
463
463
  $[13] = t1;
464
464
  } else t1 = $[13];
465
465
  let t2;
466
- if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
467
- t2 = /* @__PURE__ */ jsx(Controller, {
468
- control: formControl.control,
469
- name: formControl.name,
466
+ if ($[14] !== field.form || $[15] !== field.name || $[16] !== t1) {
467
+ t2 = /* @__PURE__ */ jsx(FieldController, {
468
+ control: field.form,
469
+ name: field.name,
470
470
  render: t1
471
471
  });
472
- $[14] = formControl.control;
473
- $[15] = formControl.name;
472
+ $[14] = field.form;
473
+ $[15] = field.name;
474
474
  $[16] = t1;
475
475
  $[17] = t2;
476
476
  } else t2 = $[17];
@@ -1,6 +1,6 @@
1
1
  import { FocusEvent, Ref } from 'react';
2
2
  import { NumberFieldProps as AriaNumberFieldProps } from 'react-aria-components';
3
- import { FieldValues } from 'react-hook-form';
3
+ import { FieldValues } from '../../shared/form.binding';
4
4
  import { FormFieldProps } from '../../FormField/FormField';
5
5
  import { NumberRangeValue } from './NumberRangeField';
6
6
  import { ControlProps } from '../../shared/form.types';
@@ -1,5 +1,6 @@
1
1
  import { UIOverrides } from "../../../../config/uiOverrides.context.js";
2
2
  import { UIConfig } from "../../../../config/uiConfig.context.js";
3
+ import { FieldController } from "../../shared/form.binding.js";
3
4
  import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
4
5
  import { inputBaseDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
5
6
  import { IntlUtils } from "../../../../utils/intl.utils.js";
@@ -14,7 +15,6 @@ import { clsx } from "clsx";
14
15
  import { useRef, useState } from "react";
15
16
  import { useLocale } from "react-aria-components";
16
17
  import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
17
- import { Controller } from "react-hook-form";
18
18
  //#region src/components/inputs/Input/NumberRangeInput/NumberRangeInput.tsx
19
19
  var EMPTY_RANGE = {
20
20
  min: null,
@@ -269,30 +269,30 @@ var NumberRangeInput = (t0) => {
269
269
  props = $[1];
270
270
  renderStaticInput = $[2];
271
271
  }
272
- if ("formControl" in props && props.formControl) {
273
- let formControl;
272
+ if ("field" in props && props.field) {
273
+ let field;
274
274
  let innerProps;
275
275
  if ($[3] !== props) {
276
- ({formControl, ...innerProps} = props);
276
+ ({field, ...innerProps} = props);
277
277
  $[3] = props;
278
- $[4] = formControl;
278
+ $[4] = field;
279
279
  $[5] = innerProps;
280
280
  } else {
281
- formControl = $[4];
281
+ field = $[4];
282
282
  innerProps = $[5];
283
283
  }
284
- const controlWithOptions = formControl.control;
284
+ const controlWithOptions = field.form;
285
285
  let t1;
286
286
  if ($[6] !== controlWithOptions._options?.disabled || $[7] !== innerProps || $[8] !== props.error || $[9] !== props.isDisabled || $[10] !== renderStaticInput) {
287
287
  t1 = (t2) => {
288
- const { field, fieldState: t3 } = t2;
288
+ const { field: field_0, fieldState: t3 } = t2;
289
289
  const { error } = t3;
290
290
  return /* @__PURE__ */ jsx(NumberRangeInputInner, {
291
291
  ...innerProps,
292
- value: field.value ?? EMPTY_RANGE,
293
- onChange: field.onChange,
294
- onBlur: field.onBlur,
295
- isDisabled: field.disabled || !!controlWithOptions._options?.disabled || props.isDisabled,
292
+ value: field_0.value ?? EMPTY_RANGE,
293
+ onChange: field_0.onChange,
294
+ onBlur: field_0.onBlur,
295
+ isDisabled: field_0.disabled || !!controlWithOptions._options?.disabled || props.isDisabled,
296
296
  isFormControlDisabled: !!controlWithOptions._options?.disabled,
297
297
  error: props.error ?? error?.message,
298
298
  renderStaticInput
@@ -306,14 +306,14 @@ var NumberRangeInput = (t0) => {
306
306
  $[11] = t1;
307
307
  } else t1 = $[11];
308
308
  let t2;
309
- if ($[12] !== formControl.control || $[13] !== formControl.name || $[14] !== t1) {
310
- t2 = /* @__PURE__ */ jsx(Controller, {
311
- control: formControl.control,
312
- name: formControl.name,
309
+ if ($[12] !== field.form || $[13] !== field.name || $[14] !== t1) {
310
+ t2 = /* @__PURE__ */ jsx(FieldController, {
311
+ control: field.form,
312
+ name: field.name,
313
313
  render: t1
314
314
  });
315
- $[12] = formControl.control;
316
- $[13] = formControl.name;
315
+ $[12] = field.form;
316
+ $[13] = field.name;
317
317
  $[14] = t1;
318
318
  $[15] = t2;
319
319
  } else t2 = $[15];
@@ -1,4 +1,4 @@
1
- import { FieldValues } from 'react-hook-form';
1
+ import { FieldValues } from '../../shared/form.binding';
2
2
  import { TextInputProps } from '../TextInput/TextInput';
3
3
  import { ControlProps } from '../../shared/form.types';
4
4
  export interface PasswordInputProps extends Omit<TextInputProps, "type" | "action" | "trailingIcon" | "unit"> {
@@ -1,7 +1,7 @@
1
1
  import { Ref } from 'react';
2
2
  import { AriaTextFieldProps } from 'react-aria';
3
3
  import { TextAreaProps as AriaTextAreaProps } from 'react-aria-components';
4
- import { FieldValues } from 'react-hook-form';
4
+ import { FieldValues } from '../../shared/form.binding';
5
5
  import { FormFieldProps } from '../../FormField/FormField';
6
6
  import { ControlProps } from '../../shared/form.types';
7
7
  import { InputVariantProps } from '../../shared/input.cva';