@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
@@ -1,6 +1,7 @@
1
1
  import { UIOverrides } from "../../../../config/uiOverrides.context.js";
2
2
  import { Typography } from "../../../text/Typography/Typography.js";
3
3
  import { UIConfig } from "../../../../config/uiConfig.context.js";
4
+ import { FieldController } from "../../shared/form.binding.js";
4
5
  import { InputFrame } from "../../Skeleton/InputFrame.js";
5
6
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
6
7
  import { selectInputTagsContentWrapperDefinition } from "../shared/selectInput.cva.js";
@@ -12,7 +13,6 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
13
  import { clsx } from "clsx";
13
14
  import { useRef, useState } from "react";
14
15
  import { mergeRefs } from "@react-aria/utils";
15
- import { Controller } from "react-hook-form";
16
16
  //#region src/components/inputs/Selection/Select/Select.tsx
17
17
  function SelectInner(t0) {
18
18
  const $ = c(6);
@@ -163,35 +163,35 @@ function Select(t0) {
163
163
  props = $[1];
164
164
  renderStaticInput = $[2];
165
165
  }
166
- if ("formControl" in props && props.formControl) {
167
- let formControl;
166
+ if ("field" in props && props.field) {
167
+ let field;
168
168
  let innerProps;
169
169
  let ref;
170
170
  if ($[3] !== props) {
171
- ({formControl, ref, ...innerProps} = props);
171
+ ({field, ref, ...innerProps} = props);
172
172
  $[3] = props;
173
- $[4] = formControl;
173
+ $[4] = field;
174
174
  $[5] = innerProps;
175
175
  $[6] = ref;
176
176
  } else {
177
- formControl = $[4];
177
+ field = $[4];
178
178
  innerProps = $[5];
179
179
  ref = $[6];
180
180
  }
181
- const controlWithOptions = formControl.control;
181
+ const controlWithOptions = field.form;
182
182
  let t1;
183
183
  if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
184
184
  t1 = (t2) => {
185
- const { field, fieldState: t3 } = t2;
185
+ const { field: field_0, fieldState: t3 } = t2;
186
186
  const { error, isDirty } = t3;
187
187
  return /* @__PURE__ */ jsx(SelectInner, {
188
188
  ...innerProps,
189
- ref: mergeRefs(ref, field.ref),
190
- value: field.value,
191
- onChange: field.onChange,
192
- onBlur: field.onBlur,
189
+ ref: mergeRefs(ref, field_0.ref),
190
+ value: field_0.value,
191
+ onChange: field_0.onChange,
192
+ onBlur: field_0.onBlur,
193
193
  isDirty,
194
- isDisabled: field.disabled || props.isDisabled,
194
+ isDisabled: field_0.disabled || props.isDisabled,
195
195
  isFormControlDisabled: !!controlWithOptions._options?.disabled,
196
196
  error: props.error ?? error?.message,
197
197
  renderStaticInput
@@ -206,14 +206,14 @@ function Select(t0) {
206
206
  $[13] = t1;
207
207
  } else t1 = $[13];
208
208
  let t2;
209
- if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
210
- t2 = /* @__PURE__ */ jsx(Controller, {
211
- control: formControl.control,
212
- name: formControl.name,
209
+ if ($[14] !== field.form || $[15] !== field.name || $[16] !== t1) {
210
+ t2 = /* @__PURE__ */ jsx(FieldController, {
211
+ control: field.form,
212
+ name: field.name,
213
213
  render: t1
214
214
  });
215
- $[14] = formControl.control;
216
- $[15] = formControl.name;
215
+ $[14] = field.form;
216
+ $[15] = field.name;
217
217
  $[16] = t1;
218
218
  $[17] = t2;
219
219
  } else t2 = $[17];
@@ -25,7 +25,6 @@ export type SelectBaseProps<TKey extends Key = Key, TInitialSelectItem = Default
25
25
  customTrigger?: ReactElement;
26
26
  selectedTagsType?: "tags" | "list";
27
27
  collapseAfter?: number;
28
- fireBlurOnChange?: boolean;
29
28
  searchDebounceDelay?: number;
30
29
  multiSelectAutoConfirm?: boolean;
31
30
  onInputChange?: (value: string) => void;
@@ -7,7 +7,7 @@ import { c } from "react/compiler-runtime";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  //#region src/components/inputs/Selection/shared/SelectBase.tsx
9
9
  var SelectBase = (dProps) => {
10
- const $ = c(22);
10
+ const $ = c(21);
11
11
  const ui = UIConfig.useConfig();
12
12
  const t0 = dProps.selectionMode ?? ui.select.selectionMode;
13
13
  const t1 = dProps.variant ?? ui.input.variant;
@@ -20,12 +20,11 @@ var SelectBase = (dProps) => {
20
20
  const t8 = dProps.virtualizerOptions || (dProps.totalItems ?? 0) > 100 || dProps.hasLoadMore ? false : dProps.ignoreTriggerWidth ?? false;
21
21
  const t9 = dProps.collapseAfter ?? ui.select.collapseAfter;
22
22
  const t10 = dProps.hideSearchIcon ?? ui.select.hideSearchIcon;
23
- const t11 = dProps.fireBlurOnChange ?? ui.select.fireBlurOnChange;
24
- const t12 = dProps.multiSelectAutoConfirm ?? ui.select.multiSelectAutoConfirm;
25
- const t13 = dProps.ignoreInputValueFiltering ?? dProps.isClientSearchDisabled;
26
- let t14;
27
- if ($[0] !== dProps || $[1] !== t0 || $[2] !== t1 || $[3] !== t10 || $[4] !== t11 || $[5] !== t12 || $[6] !== t13 || $[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== t5 || $[11] !== t6 || $[12] !== t7 || $[13] !== t8 || $[14] !== t9) {
28
- t14 = {
23
+ const t11 = dProps.multiSelectAutoConfirm ?? ui.select.multiSelectAutoConfirm;
24
+ const t12 = dProps.ignoreInputValueFiltering ?? dProps.isClientSearchDisabled;
25
+ let t13;
26
+ if ($[0] !== dProps || $[1] !== t0 || $[2] !== t1 || $[3] !== t10 || $[4] !== t11 || $[5] !== t12 || $[6] !== t2 || $[7] !== t3 || $[8] !== t4 || $[9] !== t5 || $[10] !== t6 || $[11] !== t7 || $[12] !== t8 || $[13] !== t9) {
27
+ t13 = {
29
28
  ...dProps,
30
29
  selectionMode: t0,
31
30
  variant: t1,
@@ -38,9 +37,8 @@ var SelectBase = (dProps) => {
38
37
  ignoreTriggerWidth: t8,
39
38
  collapseAfter: t9,
40
39
  hideSearchIcon: t10,
41
- fireBlurOnChange: t11,
42
- multiSelectAutoConfirm: t12,
43
- isClientSearchDisabled: t13
40
+ multiSelectAutoConfirm: t11,
41
+ isClientSearchDisabled: t12
44
42
  };
45
43
  $[0] = dProps;
46
44
  $[1] = t0;
@@ -48,38 +46,37 @@ var SelectBase = (dProps) => {
48
46
  $[3] = t10;
49
47
  $[4] = t11;
50
48
  $[5] = t12;
51
- $[6] = t13;
52
- $[7] = t2;
53
- $[8] = t3;
54
- $[9] = t4;
55
- $[10] = t5;
56
- $[11] = t6;
57
- $[12] = t7;
58
- $[13] = t8;
59
- $[14] = t9;
60
- $[15] = t14;
61
- } else t14 = $[15];
62
- const props = t14;
49
+ $[6] = t2;
50
+ $[7] = t3;
51
+ $[8] = t4;
52
+ $[9] = t5;
53
+ $[10] = t6;
54
+ $[11] = t7;
55
+ $[12] = t8;
56
+ $[13] = t9;
57
+ $[14] = t13;
58
+ } else t13 = $[14];
59
+ const props = t13;
63
60
  const isDesktop = useBreakpoint("md");
64
- const t15 = props;
61
+ const t14 = props;
62
+ let t15;
63
+ if ($[15] !== isDesktop || $[16] !== props) {
64
+ t15 = isDesktop ? /* @__PURE__ */ jsx(SelectDesktop, { ...props }) : /* @__PURE__ */ jsx(SelectMobile, { ...props });
65
+ $[15] = isDesktop;
66
+ $[16] = props;
67
+ $[17] = t15;
68
+ } else t15 = $[17];
65
69
  let t16;
66
- if ($[16] !== isDesktop || $[17] !== props) {
67
- t16 = isDesktop ? /* @__PURE__ */ jsx(SelectDesktop, { ...props }) : /* @__PURE__ */ jsx(SelectMobile, { ...props });
68
- $[16] = isDesktop;
69
- $[17] = props;
70
- $[18] = t16;
71
- } else t16 = $[18];
72
- let t17;
73
- if ($[19] !== t15 || $[20] !== t16) {
74
- t17 = /* @__PURE__ */ jsx(SelectContext.Provider, {
75
- ...t15,
76
- children: t16
70
+ if ($[18] !== t14 || $[19] !== t15) {
71
+ t16 = /* @__PURE__ */ jsx(SelectContext.Provider, {
72
+ ...t14,
73
+ children: t15
77
74
  });
75
+ $[18] = t14;
78
76
  $[19] = t15;
79
77
  $[20] = t16;
80
- $[21] = t17;
81
- } else t17 = $[21];
82
- return t17;
78
+ } else t16 = $[20];
79
+ return t16;
83
80
  };
84
81
  //#endregion
85
82
  export { SelectBase };
@@ -25,8 +25,8 @@ export declare namespace SelectContext {
25
25
  isMultiple: boolean;
26
26
  multiSelectAutoConfirm: boolean;
27
27
  } & Pick<SelectBaseProps, "onInputChange" | "isLoading" | "hasLoadMore">;
28
- export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled" | "ignoreInputValueFiltering" | "fireBlurOnChange" | "searchDebounceDelay" | "multiSelectAutoConfirm" | "onBlur">;
29
- export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, searchDebounceDelay, multiSelectAutoConfirm, onBlur: fieldOnBlur, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
28
+ export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled" | "ignoreInputValueFiltering" | "searchDebounceDelay" | "multiSelectAutoConfirm" | "onBlur">;
29
+ export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, searchDebounceDelay, multiSelectAutoConfirm, onBlur: fieldOnBlur, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
30
30
  export const useSelect: () => Type;
31
31
  export {};
32
32
  }
@@ -1,5 +1,5 @@
1
- import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
2
1
  import { useSelectItems } from "./useSelectItems.js";
2
+ import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { createContext, use, useCallback, useEffect, useMemo, useRef, useState } from "react";
5
5
  //#region src/components/inputs/Selection/shared/select.context.tsx
@@ -10,7 +10,7 @@ var SelectContext;
10
10
  id: item.id,
11
11
  label: item.label ?? item.name ?? ""
12
12
  });
13
- _SelectContext.Provider = ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, searchDebounceDelay, multiSelectAutoConfirm = false, onBlur: fieldOnBlur, children, mapInitialToSelectItem = defaultMapInitialToSelectItem, ...props }) => {
13
+ _SelectContext.Provider = ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, searchDebounceDelay, multiSelectAutoConfirm = false, onBlur: fieldOnBlur, children, mapInitialToSelectItem = defaultMapInitialToSelectItem, ...props }) => {
14
14
  const isMultiple = props.selectionMode === "multiple";
15
15
  const initialSelectedItems = useMemo(() => {
16
16
  if (!props.initialSelection) return null;
@@ -75,9 +75,6 @@ var SelectContext;
75
75
  onSearchChangeDebounced,
76
76
  updateValue
77
77
  ]);
78
- const triggerBlurOnChange = useCallback(() => {
79
- if (fireBlurOnChange) fieldOnBlur?.({});
80
- }, [fireBlurOnChange, fieldOnBlur]);
81
78
  const syncFieldState = (value_1) => {
82
79
  const newFieldState = {
83
80
  value: value_1,
@@ -120,7 +117,7 @@ var SelectContext;
120
117
  searchValue: ""
121
118
  };
122
119
  setFieldState(newFieldState_1);
123
- if (emitStateChanges(newFieldState_1)) triggerBlurOnChange();
120
+ emitStateChanges(newFieldState_1);
124
121
  }
125
122
  if (!isMultiple) {
126
123
  setIsOpen(false);
@@ -131,8 +128,7 @@ var SelectContext;
131
128
  onNewItemOption,
132
129
  fieldState.inputValue,
133
130
  getItem_0,
134
- isMultiple,
135
- triggerBlurOnChange
131
+ isMultiple
136
132
  ]);
137
133
  const onClear = useCallback(() => {
138
134
  if (selectedIds.length === 0) {
@@ -1,6 +1,6 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
2
  import { Key } from 'react-aria-components';
3
- import { FieldValues } from 'react-hook-form';
3
+ import { FieldValues } from '../../shared/form.binding';
4
4
  import { ControlProps } from '../../shared/form.types';
5
5
  export interface SelectItem<TKey extends Key = Key> {
6
6
  id: TKey;
@@ -1,6 +1,6 @@
1
1
  import { FocusEvent, Ref } from 'react';
2
2
  import { SliderProps as AriaSliderProps } 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
  type SliderValue<IsRange extends boolean = false> = IsRange extends false ? number : number[];
@@ -1,13 +1,13 @@
1
1
  import { Typography } from "../../text/Typography/Typography.js";
2
2
  import { UIConfig } from "../../../config/uiConfig.context.js";
3
3
  import { uiOutlineClass } from "../../outline.clsx.js";
4
+ import { FieldController } from "../shared/form.binding.js";
4
5
  import { FormField } from "../FormField/FormField.js";
5
6
  import { c } from "react/compiler-runtime";
6
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
8
  import { clsx } from "clsx";
8
9
  import { Slider, SliderThumb, SliderTrack } from "react-aria-components";
9
10
  import { mergeRefs } from "@react-aria/utils";
10
- import { Controller } from "react-hook-form";
11
11
  //#region src/components/inputs/Slider/Slider.tsx
12
12
  var SliderBase = (props) => {
13
13
  const $ = c(61);
@@ -223,33 +223,33 @@ var SliderBase = (props) => {
223
223
  };
224
224
  var Slider$1 = (props) => {
225
225
  const $ = c(15);
226
- if ("formControl" in props && props.formControl) {
227
- let formControl;
226
+ if ("field" in props && props.field) {
227
+ let field;
228
228
  let innerProps;
229
229
  let ref;
230
230
  if ($[0] !== props) {
231
- ({formControl, ref, ...innerProps} = props);
231
+ ({field, ref, ...innerProps} = props);
232
232
  $[0] = props;
233
- $[1] = formControl;
233
+ $[1] = field;
234
234
  $[2] = innerProps;
235
235
  $[3] = ref;
236
236
  } else {
237
- formControl = $[1];
237
+ field = $[1];
238
238
  innerProps = $[2];
239
239
  ref = $[3];
240
240
  }
241
241
  let t0;
242
242
  if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
243
243
  t0 = (t1) => {
244
- const { field, fieldState: t2 } = t1;
244
+ const { field: field_0, fieldState: t2 } = t1;
245
245
  const { error } = t2;
246
246
  return /* @__PURE__ */ jsx(SliderBase, {
247
247
  ...innerProps,
248
- ref: mergeRefs(ref, field.ref),
249
- value: field.value,
250
- onBlur: field.onBlur,
251
- onChange: field.onChange,
252
- isDisabled: field.disabled || props.isDisabled,
248
+ ref: mergeRefs(ref, field_0.ref),
249
+ value: field_0.value,
250
+ onBlur: field_0.onBlur,
251
+ onChange: field_0.onChange,
252
+ isDisabled: field_0.disabled || props.isDisabled,
253
253
  error: props.error ?? error?.message
254
254
  });
255
255
  };
@@ -260,14 +260,14 @@ var Slider$1 = (props) => {
260
260
  $[8] = t0;
261
261
  } else t0 = $[8];
262
262
  let t1;
263
- if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
264
- t1 = /* @__PURE__ */ jsx(Controller, {
265
- control: formControl.control,
266
- name: formControl.name,
263
+ if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
264
+ t1 = /* @__PURE__ */ jsx(FieldController, {
265
+ control: field.form,
266
+ name: field.name,
267
267
  render: t0
268
268
  });
269
- $[9] = formControl.control;
270
- $[10] = formControl.name;
269
+ $[9] = field.form;
270
+ $[10] = field.name;
271
271
  $[11] = t0;
272
272
  $[12] = t1;
273
273
  } else t1 = $[12];
@@ -1,6 +1,6 @@
1
1
  import { JSONContent } from '@tiptap/react';
2
2
  import { Ref } from 'react';
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
  export interface TextEditorValue {
@@ -1,6 +1,7 @@
1
1
  import { UIOverrides } from "../../../config/uiOverrides.context.js";
2
2
  import { isEqual } from "../../../utils/isEqual.js";
3
3
  import { uiOutlineClass } from "../../outline.clsx.js";
4
+ import { FieldController } from "../shared/form.binding.js";
4
5
  import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
5
6
  import { FormField } from "../FormField/FormField.js";
6
7
  import { inputSideDefinition } from "../shared/input.cva.js";
@@ -11,7 +12,6 @@ import { clsx } from "clsx";
11
12
  import { useEffect, useRef, useState } from "react";
12
13
  import { useFocusVisible, useFocusWithin, useHover, useLabel } from "react-aria";
13
14
  import { mergeRefs } from "@react-aria/utils";
14
- import { Controller } from "react-hook-form";
15
15
  import { Color } from "@tiptap/extension-color";
16
16
  import { Highlight } from "@tiptap/extension-highlight";
17
17
  import { Link } from "@tiptap/extension-link";
@@ -136,34 +136,34 @@ var TextEditorBase = ({ ref, as = "default", placeholder, label, hideLabel, tool
136
136
  };
137
137
  var TextEditor = (props) => {
138
138
  const $ = c(15);
139
- if ("formControl" in props && props.formControl) {
140
- let formControl;
139
+ if ("field" in props && props.field) {
140
+ let field;
141
141
  let innerProps;
142
142
  let ref;
143
143
  if ($[0] !== props) {
144
- ({formControl, ref, ...innerProps} = props);
144
+ ({field, ref, ...innerProps} = props);
145
145
  $[0] = props;
146
- $[1] = formControl;
146
+ $[1] = field;
147
147
  $[2] = innerProps;
148
148
  $[3] = ref;
149
149
  } else {
150
- formControl = $[1];
150
+ field = $[1];
151
151
  innerProps = $[2];
152
152
  ref = $[3];
153
153
  }
154
154
  let t0;
155
155
  if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
156
156
  t0 = (t1) => {
157
- const { field, fieldState: t2 } = t1;
157
+ const { field: field_0, fieldState: t2 } = t1;
158
158
  const { error, isDirty } = t2;
159
159
  return /* @__PURE__ */ jsx(TextEditorBase, {
160
160
  ...innerProps,
161
- ref: mergeRefs(ref, field.ref),
162
- value: field.value,
163
- onChange: field.onChange,
164
- onBlur: field.onBlur,
161
+ ref: mergeRefs(ref, field_0.ref),
162
+ value: field_0.value,
163
+ onChange: field_0.onChange,
164
+ onBlur: field_0.onBlur,
165
165
  isDirty,
166
- isDisabled: field.disabled || props.isDisabled,
166
+ isDisabled: field_0.disabled || props.isDisabled,
167
167
  error: props.error ?? error?.message
168
168
  });
169
169
  };
@@ -174,14 +174,14 @@ var TextEditor = (props) => {
174
174
  $[8] = t0;
175
175
  } else t0 = $[8];
176
176
  let t1;
177
- if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
178
- t1 = /* @__PURE__ */ jsx(Controller, {
179
- control: formControl.control,
180
- name: formControl.name,
177
+ if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
178
+ t1 = /* @__PURE__ */ jsx(FieldController, {
179
+ control: field.form,
180
+ name: field.name,
181
181
  render: t0
182
182
  });
183
- $[9] = formControl.control;
184
- $[10] = formControl.name;
183
+ $[9] = field.form;
184
+ $[10] = field.name;
185
185
  $[11] = t0;
186
186
  $[12] = t1;
187
187
  } else t1 = $[12];
@@ -1,6 +1,6 @@
1
1
  import { Ref } from 'react';
2
2
  import { SwitchProps as AriaSwitchProps } from 'react-aria-components';
3
- import { FieldValues } from 'react-hook-form';
3
+ import { FieldValues } from '../shared/form.binding';
4
4
  import { FormFieldErrorProps } from '../FormField/FormFieldError';
5
5
  import { ControlProps } from '../shared/form.types';
6
6
  import { ToggleVariantProps } from './toggle.cva';
@@ -9,7 +9,6 @@ interface ToggleBaseProps extends FormFieldErrorProps, ToggleVariantProps, Omit<
9
9
  children?: string;
10
10
  isDirty?: boolean;
11
11
  isRequired?: boolean;
12
- fireBlurOnChange?: boolean;
13
12
  }
14
13
  export type ToggleProps = ToggleBaseProps;
15
14
  export type ControlledToggleProps<TFieldValues extends FieldValues> = ControlProps<ToggleProps, TFieldValues, "isSelected">;