@povio/ui 3.4.0-rc.1 → 3.4.0-rc.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 (78) hide show
  1. package/dist/components/inputs/Checkbox/Checkbox.d.ts +2 -1
  2. package/dist/components/inputs/Checkbox/Checkbox.js +100 -93
  3. package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +2 -1
  4. package/dist/components/inputs/Checkbox/CheckboxGroup.js +113 -109
  5. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +2 -1
  6. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +21 -14
  7. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +2 -1
  8. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +22 -14
  9. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +2 -1
  10. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +21 -14
  11. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +2 -1
  12. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +294 -275
  13. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
  14. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +10 -1
  15. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
  16. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +46 -43
  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 +38 -36
  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 +36 -35
  35. package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
  36. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +2 -1
  37. package/dist/components/inputs/RadioGroup/RadioGroup.js +111 -107
  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 +1 -0
  48. package/dist/components/inputs/Selection/shared/SelectBase.js +37 -34
  49. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
  50. package/dist/components/inputs/Selection/shared/select.context.js +8 -4
  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 +2 -1
  57. package/dist/components/inputs/Toggle/Toggle.js +63 -59
  58. package/dist/components/inputs/shared/form.types.d.ts +8 -9
  59. package/dist/components/segment/Segment.d.ts +1 -1
  60. package/dist/components/segment/Segment.js +17 -17
  61. package/dist/components/segment/segment.types.d.ts +1 -1
  62. package/dist/config/uiConfig.context.d.ts +5 -5
  63. package/dist/config/uiConfig.context.js +12 -3
  64. package/dist/helpers/dynamicColumns.d.ts +1 -1
  65. package/dist/helpers/dynamicInputs.d.ts +7 -7
  66. package/dist/hooks/useAutosave.d.ts +4 -4
  67. package/dist/hooks/useAutosave.js +49 -64
  68. package/dist/hooks/useAutosave.spec.d.ts +1 -0
  69. package/dist/hooks/useForm.d.ts +15 -39
  70. package/dist/hooks/useForm.js +43 -96
  71. package/dist/hooks/useFormAutosave.d.ts +9 -8
  72. package/dist/hooks/useFormAutosave.js +9 -23
  73. package/dist/index.d.ts +2 -2
  74. package/dist/index.js +3 -3
  75. package/package.json +3 -2
  76. package/dist/components/inputs/shared/form.binding.d.ts +0 -27
  77. package/dist/components/inputs/shared/form.binding.js +0 -57
  78. package/dist/components/inputs/shared/form.types.js +0 -8
@@ -39,7 +39,8 @@ interface DatePickerInputProps extends InputVariantProps {
39
39
  timeZone?: string;
40
40
  isTimeOptional?: boolean;
41
41
  format?: string;
42
+ fireBlurOnChange?: boolean;
42
43
  onClear?: () => void;
43
44
  }
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;
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;
45
46
  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, 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, fireBlurOnChange, onClear: onClearProp, ...props }) => {
21
21
  const uiConfig = UIConfig.useConfig();
22
22
  const timeZone = timeZoneProp ?? uiConfig.dateInput.timeZone;
23
23
  let effectiveTimeZone = getLocalTimeZone();
@@ -57,11 +57,16 @@ 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
+ }
60
64
  }
61
65
  setCanClear(false);
62
66
  }, [
63
67
  endFieldProps,
64
68
  fieldProps,
69
+ fireBlurOnChange,
65
70
  onClearProp
66
71
  ]);
67
72
  useImperativeHandle(ref, () => ({
@@ -83,6 +88,10 @@ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldVa
83
88
  fieldProps.onChange?.(today(effectiveTimeZone));
84
89
  if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
85
90
  }
91
+ if (fireBlurOnChange) {
92
+ fieldProps.onBlur?.(null);
93
+ endFieldProps?.onBlur?.(null);
94
+ }
86
95
  };
87
96
  const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
88
97
  const todayIconButton = renderDatePickerTodayIcon(todayIcon, {
@@ -19,6 +19,7 @@ interface DatePickerInputProps extends InputVariantProps {
19
19
  className?: string;
20
20
  onPress: () => void;
21
21
  onClear?: () => void;
22
+ fireBlurOnChange?: boolean;
22
23
  }
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;
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;
24
25
  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(67);
20
- const { ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear, ...props } = 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;
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,22 +147,25 @@ var TimePickerInput = (t0) => {
147
147
  $[32] = t22;
148
148
  } else t22 = $[32];
149
149
  let t23;
150
- if ($[33] !== canClear || $[34] !== isClearable || $[35] !== onClear || $[36] !== state) {
150
+ if ($[33] !== canClear || $[34] !== fieldProps || $[35] !== fireBlurOnChange || $[36] !== isClearable || $[37] !== onClear || $[38] !== 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);
155
156
  },
156
157
  show: canClear
157
158
  });
158
159
  $[33] = canClear;
159
- $[34] = isClearable;
160
- $[35] = onClear;
161
- $[36] = state;
162
- $[37] = t23;
163
- } else t23 = $[37];
160
+ $[34] = fieldProps;
161
+ $[35] = fireBlurOnChange;
162
+ $[36] = isClearable;
163
+ $[37] = onClear;
164
+ $[38] = state;
165
+ $[39] = t23;
166
+ } else t23 = $[39];
164
167
  let t24;
165
- if ($[38] !== disableDropdown || $[39] !== disableManualEntry || $[40] !== isDisabled || $[41] !== onPress || $[42] !== uiConfig) {
168
+ if ($[40] !== disableDropdown || $[41] !== disableManualEntry || $[42] !== isDisabled || $[43] !== onPress || $[44] !== uiConfig) {
166
169
  t24 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
167
170
  label: "",
168
171
  color: "secondary",
@@ -172,26 +175,26 @@ var TimePickerInput = (t0) => {
172
175
  className: "border-0!",
173
176
  "data-static-press-action": ""
174
177
  });
175
- $[38] = disableDropdown;
176
- $[39] = disableManualEntry;
177
- $[40] = isDisabled;
178
- $[41] = onPress;
179
- $[42] = uiConfig;
180
- $[43] = t24;
181
- } else t24 = $[43];
178
+ $[40] = disableDropdown;
179
+ $[41] = disableManualEntry;
180
+ $[42] = isDisabled;
181
+ $[43] = onPress;
182
+ $[44] = uiConfig;
183
+ $[45] = t24;
184
+ } else t24 = $[45];
182
185
  let t25;
183
- if ($[44] !== t22 || $[45] !== t23 || $[46] !== t24) {
186
+ if ($[46] !== t22 || $[47] !== t23 || $[48] !== t24) {
184
187
  t25 = /* @__PURE__ */ jsxs("div", {
185
188
  className: t22,
186
189
  children: [t23, t24]
187
190
  });
188
- $[44] = t22;
189
- $[45] = t23;
190
- $[46] = t24;
191
- $[47] = t25;
192
- } else t25 = $[47];
191
+ $[46] = t22;
192
+ $[47] = t23;
193
+ $[48] = t24;
194
+ $[49] = t25;
195
+ } else t25 = $[49];
193
196
  let t26;
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) {
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) {
195
198
  t26 = /* @__PURE__ */ jsxs("div", {
196
199
  ref: t4,
197
200
  className: t5,
@@ -213,26 +216,26 @@ var TimePickerInput = (t0) => {
213
216
  ...hoverProps,
214
217
  children: [t21, t25]
215
218
  });
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];
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];
236
239
  return t26;
237
240
  };
238
241
  function _temp(segment) {
@@ -1,4 +1,4 @@
1
- import { FieldValues } from '../shared/form.binding';
1
+ import { FieldValues } from 'react-hook-form';
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,7 +1,6 @@
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";
5
4
  import { FormField } from "../FormField/FormField.js";
6
5
  import { FileUtils } from "../../../utils/file.utils.js";
7
6
  import { FileCardList } from "./shared/FileCardList.js";
@@ -15,6 +14,7 @@ import { useCallback, useState } from "react";
15
14
  import { DropZone } from "react-aria-components";
16
15
  import { mergeRefs, useLabels } from "@react-aria/utils";
17
16
  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 ("field" in props && props.field) {
196
- let field;
195
+ if ("formControl" in props && props.formControl) {
196
+ let formControl;
197
197
  let innerProps;
198
198
  let ref;
199
199
  if ($[0] !== props) {
200
- ({field, ref, ...innerProps} = props);
200
+ ({formControl, ref, ...innerProps} = props);
201
201
  $[0] = props;
202
- $[1] = field;
202
+ $[1] = formControl;
203
203
  $[2] = innerProps;
204
204
  $[3] = ref;
205
205
  } else {
206
- field = $[1];
206
+ formControl = $[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: field_0, fieldState: t2 } = t1;
213
+ const { field, fieldState: t2 } = t1;
214
214
  const { error } = t2;
215
215
  return /* @__PURE__ */ jsx(FileUploadBase, {
216
216
  ...innerProps,
217
- ref: mergeRefs(ref, field_0.ref),
218
- value: field_0.value,
219
- onChange: field_0.onChange,
220
- isDisabled: field_0.disabled || props.isDisabled,
217
+ ref: mergeRefs(ref, field.ref),
218
+ value: field.value,
219
+ onChange: field.onChange,
220
+ isDisabled: field.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] !== field.form || $[10] !== field.name || $[11] !== t0) {
232
- t1 = /* @__PURE__ */ jsx(FieldController, {
233
- control: field.form,
234
- name: field.name,
231
+ if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
232
+ t1 = /* @__PURE__ */ jsx(Controller, {
233
+ control: formControl.control,
234
+ name: formControl.name,
235
235
  render: t0
236
236
  });
237
- $[9] = field.form;
238
- $[10] = field.name;
237
+ $[9] = formControl.control;
238
+ $[10] = formControl.name;
239
239
  $[11] = t0;
240
240
  $[12] = t1;
241
241
  } else t1 = $[12];
@@ -1,4 +1,4 @@
1
- import { FieldValues } from '../shared/form.binding';
1
+ import { FieldValues } from 'react-hook-form';
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,5 +1,4 @@
1
1
  import { UIConfig } from "../../../config/uiConfig.context.js";
2
- import { FieldController } from "../shared/form.binding.js";
3
2
  import { FormField } from "../FormField/FormField.js";
4
3
  import { FileUtils } from "../../../utils/file.utils.js";
5
4
  import { InputUploadContent } from "./shared/InputUploadContent.js";
@@ -9,6 +8,7 @@ import { jsx } from "react/jsx-runtime";
9
8
  import { clsx } from "clsx";
10
9
  import { useState } from "react";
11
10
  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 ("field" in props && props.field) {
100
- let field;
99
+ if ("formControl" in props && props.formControl) {
100
+ let formControl;
101
101
  let innerProps;
102
102
  let ref;
103
103
  if ($[0] !== props) {
104
- ({field, ref, ...innerProps} = props);
104
+ ({formControl, ref, ...innerProps} = props);
105
105
  $[0] = props;
106
- $[1] = field;
106
+ $[1] = formControl;
107
107
  $[2] = innerProps;
108
108
  $[3] = ref;
109
109
  } else {
110
- field = $[1];
110
+ formControl = $[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: field_0, fieldState: t2 } = t1;
117
+ const { field, fieldState: t2 } = t1;
118
118
  const { error } = t2;
119
119
  return /* @__PURE__ */ jsx(InputUploadBase, {
120
120
  ...innerProps,
121
- ref: mergeRefs(ref, field_0.ref),
122
- value: field_0.value,
123
- onChange: field_0.onChange,
124
- isDisabled: field_0.disabled || props.isDisabled,
121
+ ref: mergeRefs(ref, field.ref),
122
+ value: field.value,
123
+ onChange: field.onChange,
124
+ isDisabled: field.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] !== field.form || $[10] !== field.name || $[11] !== t0) {
136
- t1 = /* @__PURE__ */ jsx(FieldController, {
137
- control: field.form,
138
- name: field.name,
135
+ if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
136
+ t1 = /* @__PURE__ */ jsx(Controller, {
137
+ control: formControl.control,
138
+ name: formControl.name,
139
139
  render: t0
140
140
  });
141
- $[9] = field.form;
142
- $[10] = field.name;
141
+ $[9] = formControl.control;
142
+ $[10] = formControl.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 '../shared/form.binding';
3
+ import { FieldValues } from 'react-hook-form';
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 '../shared/form.binding';
3
+ import { FieldValues } from 'react-hook-form';
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 '../../shared/form.binding';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  import { FormFieldProps } from '../../FormField/FormField';
5
5
  import { InputContentProps } from '../shared/InputContent';
6
6
  import { ControlProps } from '../../shared/form.types';
@@ -1,6 +1,5 @@
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";
4
3
  import { FormField } from "../../FormField/FormField.js";
5
4
  import { inputBaseDefinition } from "../../shared/input.cva.js";
6
5
  import { IntlUtils } from "../../../../utils/intl.utils.js";
@@ -16,6 +15,7 @@ import { useEffect, useRef, useState } from "react";
16
15
  import { Input, useLocale } from "react-aria-components";
17
16
  import { useFocusVisible, useNumberField } from "react-aria";
18
17
  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 ("field" in props && props.field) {
424
- let field;
423
+ if ("formControl" in props && props.formControl) {
424
+ let formControl;
425
425
  let innerProps;
426
426
  let ref;
427
427
  if ($[3] !== props) {
428
- ({field, ref, ...innerProps} = props);
428
+ ({formControl, ref, ...innerProps} = props);
429
429
  $[3] = props;
430
- $[4] = field;
430
+ $[4] = formControl;
431
431
  $[5] = innerProps;
432
432
  $[6] = ref;
433
433
  } else {
434
- field = $[4];
434
+ formControl = $[4];
435
435
  innerProps = $[5];
436
436
  ref = $[6];
437
437
  }
438
- const controlWithOptions = field.form;
438
+ const controlWithOptions = formControl.control;
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: field_0, fieldState: t3 } = t2;
442
+ const { field, fieldState: t3 } = t2;
443
443
  const { error, isDirty } = t3;
444
444
  return /* @__PURE__ */ jsx(NumberInputInner, {
445
445
  ...innerProps,
446
- ref: mergeRefs(ref, field_0.ref),
447
- value: field_0.value,
448
- onChange: field_0.onChange,
449
- onBlur: field_0.onBlur,
446
+ ref: mergeRefs(ref, field.ref),
447
+ value: field.value,
448
+ onChange: field.onChange,
449
+ onBlur: field.onBlur,
450
450
  isDirty,
451
- isDisabled: field_0.disabled || props.isDisabled,
451
+ isDisabled: field.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] !== field.form || $[15] !== field.name || $[16] !== t1) {
467
- t2 = /* @__PURE__ */ jsx(FieldController, {
468
- control: field.form,
469
- name: field.name,
466
+ if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
467
+ t2 = /* @__PURE__ */ jsx(Controller, {
468
+ control: formControl.control,
469
+ name: formControl.name,
470
470
  render: t1
471
471
  });
472
- $[14] = field.form;
473
- $[15] = field.name;
472
+ $[14] = formControl.control;
473
+ $[15] = formControl.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 '../../shared/form.binding';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  import { FormFieldProps } from '../../FormField/FormField';
5
5
  import { NumberRangeValue } from './NumberRangeField';
6
6
  import { ControlProps } from '../../shared/form.types';
@@ -1,6 +1,5 @@
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";
4
3
  import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
5
4
  import { inputBaseDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
6
5
  import { IntlUtils } from "../../../../utils/intl.utils.js";
@@ -15,6 +14,7 @@ import { clsx } from "clsx";
15
14
  import { useRef, useState } from "react";
16
15
  import { useLocale } from "react-aria-components";
17
16
  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 ("field" in props && props.field) {
273
- let field;
272
+ if ("formControl" in props && props.formControl) {
273
+ let formControl;
274
274
  let innerProps;
275
275
  if ($[3] !== props) {
276
- ({field, ...innerProps} = props);
276
+ ({formControl, ...innerProps} = props);
277
277
  $[3] = props;
278
- $[4] = field;
278
+ $[4] = formControl;
279
279
  $[5] = innerProps;
280
280
  } else {
281
- field = $[4];
281
+ formControl = $[4];
282
282
  innerProps = $[5];
283
283
  }
284
- const controlWithOptions = field.form;
284
+ const controlWithOptions = formControl.control;
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: field_0, fieldState: t3 } = t2;
288
+ const { field, fieldState: t3 } = t2;
289
289
  const { error } = t3;
290
290
  return /* @__PURE__ */ jsx(NumberRangeInputInner, {
291
291
  ...innerProps,
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,
292
+ value: field.value ?? EMPTY_RANGE,
293
+ onChange: field.onChange,
294
+ onBlur: field.onBlur,
295
+ isDisabled: field.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] !== field.form || $[13] !== field.name || $[14] !== t1) {
310
- t2 = /* @__PURE__ */ jsx(FieldController, {
311
- control: field.form,
312
- name: field.name,
309
+ if ($[12] !== formControl.control || $[13] !== formControl.name || $[14] !== t1) {
310
+ t2 = /* @__PURE__ */ jsx(Controller, {
311
+ control: formControl.control,
312
+ name: formControl.name,
313
313
  render: t1
314
314
  });
315
- $[12] = field.form;
316
- $[13] = field.name;
315
+ $[12] = formControl.control;
316
+ $[13] = formControl.name;
317
317
  $[14] = t1;
318
318
  $[15] = t2;
319
319
  } else t2 = $[15];
@@ -1,4 +1,4 @@
1
- import { FieldValues } from '../../shared/form.binding';
1
+ import { FieldValues } from 'react-hook-form';
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 '../../shared/form.binding';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  import { FormFieldProps } from '../../FormField/FormField';
6
6
  import { ControlProps } from '../../shared/form.types';
7
7
  import { InputVariantProps } from '../../shared/input.cva';