@ultraviolet/form 4.0.0-beta.9 → 4.0.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 (80) hide show
  1. package/README.md +191 -3
  2. package/dist/components/CheckboxField/index.cjs +13 -13
  3. package/dist/components/CheckboxField/index.js +13 -13
  4. package/dist/components/CheckboxGroupField/index.cjs +7 -7
  5. package/dist/components/CheckboxGroupField/index.d.ts +1 -3
  6. package/dist/components/CheckboxGroupField/index.js +7 -7
  7. package/dist/components/{DateField → DateInputField}/index.cjs +18 -18
  8. package/dist/components/DateInputField/index.d.ts +7 -0
  9. package/dist/components/{DateField → DateInputField}/index.js +18 -18
  10. package/dist/components/Form/defaultErrors.cjs +10 -10
  11. package/dist/components/Form/defaultErrors.js +10 -10
  12. package/dist/components/Form/index.cjs +5 -5
  13. package/dist/components/Form/index.js +5 -5
  14. package/dist/components/KeyValueField/index.cjs +11 -11
  15. package/dist/components/KeyValueField/index.d.ts +6 -6
  16. package/dist/components/KeyValueField/index.js +11 -11
  17. package/dist/components/NumberInputField/index.cjs +26 -26
  18. package/dist/components/NumberInputField/index.d.ts +3 -9
  19. package/dist/components/NumberInputField/index.js +26 -26
  20. package/dist/components/RadioField/index.cjs +8 -8
  21. package/dist/components/RadioField/index.d.ts +1 -4
  22. package/dist/components/RadioField/index.js +8 -8
  23. package/dist/components/RadioGroupField/index.cjs +7 -7
  24. package/dist/components/RadioGroupField/index.d.ts +17 -7
  25. package/dist/components/RadioGroupField/index.js +7 -7
  26. package/dist/components/SelectInputField/index.cjs +21 -73
  27. package/dist/components/SelectInputField/index.d.ts +3 -81
  28. package/dist/components/SelectInputField/index.js +22 -74
  29. package/dist/components/SelectableCardField/index.cjs +8 -8
  30. package/dist/components/SelectableCardField/index.js +8 -8
  31. package/dist/components/SelectableCardGroupField/index.cjs +7 -7
  32. package/dist/components/SelectableCardGroupField/index.js +7 -7
  33. package/dist/components/SelectableCardOptionGroupField/index.cjs +9 -9
  34. package/dist/components/SelectableCardOptionGroupField/index.d.ts +3 -3
  35. package/dist/components/SelectableCardOptionGroupField/index.js +9 -9
  36. package/dist/components/SliderField/index.cjs +9 -9
  37. package/dist/components/SliderField/index.d.ts +1 -1
  38. package/dist/components/SliderField/index.js +9 -9
  39. package/dist/components/Submit/index.cjs +1 -1
  40. package/dist/components/Submit/index.js +1 -1
  41. package/dist/components/SwitchButtonField/index.cjs +8 -9
  42. package/dist/components/SwitchButtonField/index.d.ts +11 -2
  43. package/dist/components/SwitchButtonField/index.js +8 -9
  44. package/dist/components/TagInputField/index.cjs +6 -6
  45. package/dist/components/TagInputField/index.js +6 -6
  46. package/dist/components/TextAreaField/index.cjs +8 -8
  47. package/dist/components/TextAreaField/index.js +8 -8
  48. package/dist/components/TextInputField/index.cjs +23 -77
  49. package/dist/components/TextInputField/index.d.ts +5 -11
  50. package/dist/components/TextInputField/index.js +23 -77
  51. package/dist/components/{TimeInputFieldV2 → TimeInputField}/index.cjs +6 -6
  52. package/dist/components/TimeInputField/index.d.ts +11 -0
  53. package/dist/components/{TimeInputFieldV2 → TimeInputField}/index.js +7 -7
  54. package/dist/components/ToggleField/index.cjs +7 -7
  55. package/dist/components/ToggleField/index.js +7 -7
  56. package/dist/components/UnitInputField/index.cjs +10 -10
  57. package/dist/components/UnitInputField/index.js +10 -10
  58. package/dist/components/VerificationCodeField/index.cjs +4 -4
  59. package/dist/components/VerificationCodeField/index.js +4 -4
  60. package/dist/components/index.d.ts +11 -15
  61. package/dist/index.cjs +45 -53
  62. package/dist/index.d.ts +5 -5
  63. package/dist/index.js +15 -23
  64. package/dist/providers/index.d.ts +1 -1
  65. package/dist/validators/index.d.ts +1 -1
  66. package/package.json +10 -10
  67. package/dist/components/DateField/index.d.ts +0 -7
  68. package/dist/components/NumberInputFieldV2/index.cjs +0 -59
  69. package/dist/components/NumberInputFieldV2/index.d.ts +0 -7
  70. package/dist/components/NumberInputFieldV2/index.js +0 -59
  71. package/dist/components/SelectInputFieldV2/index.cjs +0 -50
  72. package/dist/components/SelectInputFieldV2/index.d.ts +0 -7
  73. package/dist/components/SelectInputFieldV2/index.js +0 -50
  74. package/dist/components/TextInputFieldV2/index.cjs +0 -62
  75. package/dist/components/TextInputFieldV2/index.d.ts +0 -12
  76. package/dist/components/TextInputFieldV2/index.js +0 -62
  77. package/dist/components/TimeField/index.cjs +0 -68
  78. package/dist/components/TimeField/index.d.ts +0 -7
  79. package/dist/components/TimeField/index.js +0 -68
  80. package/dist/components/TimeInputFieldV2/index.d.ts +0 -11
@@ -38,11 +38,11 @@ const VerificationCodeField = ({
38
38
  }
39
39
  }
40
40
  });
41
- return /* @__PURE__ */ jsxRuntime.jsx(ui.VerificationCode, { ...props, inputId, fields, onChange: (event) => {
41
+ return /* @__PURE__ */ jsxRuntime.jsx(ui.VerificationCode, { ...props, error: getError({
42
+ label: label || "verification-code-field"
43
+ }, error), fields, inputId, label, onChange: (event) => {
42
44
  onChange?.(event);
43
45
  field.onChange(event);
44
- }, required, error: getError({
45
- label: label || "verification-code-field"
46
- }, error), label });
46
+ }, required });
47
47
  };
48
48
  exports.VerificationCodeField = VerificationCodeField;
@@ -36,12 +36,12 @@ const VerificationCodeField = ({
36
36
  }
37
37
  }
38
38
  });
39
- return /* @__PURE__ */ jsx(VerificationCode, { ...props, inputId, fields, onChange: (event) => {
39
+ return /* @__PURE__ */ jsx(VerificationCode, { ...props, error: getError({
40
+ label: label || "verification-code-field"
41
+ }, error), fields, inputId, label, onChange: (event) => {
40
42
  onChange?.(event);
41
43
  field.onChange(event);
42
- }, required, error: getError({
43
- label: label || "verification-code-field"
44
- }, error), label });
44
+ }, required });
45
45
  };
46
46
  export {
47
47
  VerificationCodeField
@@ -1,27 +1,23 @@
1
1
  export { CheckboxField } from './CheckboxField';
2
2
  export { CheckboxGroupField } from './CheckboxGroupField';
3
- export { DateField } from './DateField';
3
+ export { DateInputField } from './DateInputField';
4
4
  export { Form } from './Form';
5
+ export { KeyValueField } from './KeyValueField';
6
+ export { NumberInputField } from './NumberInputField';
5
7
  export { RadioField } from './RadioField';
6
- export { SelectInputField } from './SelectInputField';
8
+ export { RadioGroupField } from './RadioGroupField';
7
9
  export { SelectableCardField } from './SelectableCardField';
8
- export { NumberInputField } from './NumberInputField';
9
- export { NumberInputFieldV2 } from './NumberInputFieldV2';
10
+ export { SelectableCardGroupField } from './SelectableCardGroupField';
11
+ export { SelectableCardOptionGroupField } from './SelectableCardOptionGroupField';
12
+ export { SelectInputField } from './SelectInputField';
13
+ export { SliderField } from './SliderField';
14
+ export { Submit } from './Submit';
10
15
  export { SubmitErrorAlert } from './SubmitErrorAlert';
16
+ export { SwitchButtonField } from './SwitchButtonField';
11
17
  export { TagInputField } from './TagInputField';
12
18
  export { TextAreaField } from './TextAreaField';
13
19
  export { TextInputField } from './TextInputField';
14
- export { TextInputField as TextInputFieldV2 } from './TextInputFieldV2';
15
- export { TimeField } from './TimeField';
16
- export { TimeInputFieldV2 } from './TimeInputFieldV2';
20
+ export { TimeInputField } from './TimeInputField';
17
21
  export { ToggleField } from './ToggleField';
18
- export { Submit } from './Submit';
19
- export { RadioGroupField } from './RadioGroupField';
20
- export { KeyValueField } from './KeyValueField';
21
- export { SelectableCardGroupField } from './SelectableCardGroupField';
22
- export { SelectInputFieldV2 } from './SelectInputFieldV2';
23
22
  export { UnitInputField } from './UnitInputField';
24
- export { SliderField } from './SliderField';
25
- export { SwitchButtonField } from './SwitchButtonField';
26
23
  export { VerificationCodeField } from './VerificationCodeField';
27
- export { SelectableCardOptionGroupField } from './SelectableCardOptionGroupField';
package/dist/index.cjs CHANGED
@@ -1,37 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./providers/ErrorContext/index.cjs");
4
3
  const reactHookForm = require("react-hook-form");
4
+ const index$1 = require("./providers/ErrorContext/index.cjs");
5
+ const index = require("./components/Form/index.cjs");
5
6
  const useOnFieldChange = require("./hooks/useOnFieldChange.cjs");
6
- const index$1 = require("./components/Form/index.cjs");
7
7
  const index$2 = require("./components/CheckboxField/index.cjs");
8
8
  const index$3 = require("./components/CheckboxGroupField/index.cjs");
9
- const index$4 = require("./components/DateField/index.cjs");
10
- const index$5 = require("./components/RadioField/index.cjs");
11
- const index$6 = require("./components/SelectInputField/index.cjs");
12
- const index$7 = require("./components/SelectableCardField/index.cjs");
13
- const index$8 = require("./components/NumberInputField/index.cjs");
14
- const index$9 = require("./components/NumberInputFieldV2/index.cjs");
15
- const index$a = require("./components/SubmitErrorAlert/index.cjs");
16
- const index$b = require("./components/TagInputField/index.cjs");
17
- const index$c = require("./components/TextAreaField/index.cjs");
18
- const index$d = require("./components/TextInputField/index.cjs");
19
- const index$e = require("./components/TextInputFieldV2/index.cjs");
20
- const index$f = require("./components/TimeField/index.cjs");
21
- const index$g = require("./components/TimeInputFieldV2/index.cjs");
22
- const index$h = require("./components/ToggleField/index.cjs");
23
- const index$i = require("./components/Submit/index.cjs");
24
- const index$j = require("./components/RadioGroupField/index.cjs");
25
- const index$k = require("./components/KeyValueField/index.cjs");
26
- const index$l = require("./components/SelectableCardGroupField/index.cjs");
27
- const index$m = require("./components/SelectInputFieldV2/index.cjs");
28
- const index$n = require("./components/UnitInputField/index.cjs");
29
- const index$o = require("./components/SliderField/index.cjs");
30
- const index$p = require("./components/SwitchButtonField/index.cjs");
31
- const index$q = require("./components/VerificationCodeField/index.cjs");
32
- const index$r = require("./components/SelectableCardOptionGroupField/index.cjs");
33
- exports.ErrorProvider = index.ErrorProvider;
34
- exports.useErrors = index.useErrors;
9
+ const index$4 = require("./components/DateInputField/index.cjs");
10
+ const index$5 = require("./components/KeyValueField/index.cjs");
11
+ const index$6 = require("./components/NumberInputField/index.cjs");
12
+ const index$7 = require("./components/RadioField/index.cjs");
13
+ const index$8 = require("./components/RadioGroupField/index.cjs");
14
+ const index$9 = require("./components/SelectableCardField/index.cjs");
15
+ const index$a = require("./components/SelectableCardGroupField/index.cjs");
16
+ const index$b = require("./components/SelectableCardOptionGroupField/index.cjs");
17
+ const index$c = require("./components/SelectInputField/index.cjs");
18
+ const index$d = require("./components/SliderField/index.cjs");
19
+ const index$e = require("./components/Submit/index.cjs");
20
+ const index$f = require("./components/SubmitErrorAlert/index.cjs");
21
+ const index$g = require("./components/SwitchButtonField/index.cjs");
22
+ const index$h = require("./components/TagInputField/index.cjs");
23
+ const index$i = require("./components/TextAreaField/index.cjs");
24
+ const index$j = require("./components/TextInputField/index.cjs");
25
+ const index$k = require("./components/TimeInputField/index.cjs");
26
+ const index$l = require("./components/ToggleField/index.cjs");
27
+ const index$m = require("./components/UnitInputField/index.cjs");
28
+ const index$n = require("./components/VerificationCodeField/index.cjs");
35
29
  Object.defineProperty(exports, "useController", {
36
30
  enumerable: true,
37
31
  get: () => reactHookForm.useController
@@ -56,31 +50,29 @@ Object.defineProperty(exports, "useWatch", {
56
50
  enumerable: true,
57
51
  get: () => reactHookForm.useWatch
58
52
  });
53
+ exports.ErrorProvider = index$1.ErrorProvider;
54
+ exports.useErrors = index$1.useErrors;
55
+ exports.Form = index.Form;
59
56
  exports.useOnFieldChange = useOnFieldChange.useOnFieldChange;
60
- exports.Form = index$1.Form;
61
57
  exports.CheckboxField = index$2.CheckboxField;
62
58
  exports.CheckboxGroupField = index$3.CheckboxGroupField;
63
- exports.DateField = index$4.DateField;
64
- exports.RadioField = index$5.RadioField;
65
- exports.SelectInputField = index$6.SelectInputField;
66
- exports.SelectableCardField = index$7.SelectableCardField;
67
- exports.NumberInputField = index$8.NumberInputField;
68
- exports.NumberInputFieldV2 = index$9.NumberInputFieldV2;
69
- exports.SubmitErrorAlert = index$a.SubmitErrorAlert;
70
- exports.TagInputField = index$b.TagInputField;
71
- exports.TextAreaField = index$c.TextAreaField;
72
- exports.TextInputField = index$d.TextInputField;
73
- exports.TextInputFieldV2 = index$e.TextInputField;
74
- exports.TimeField = index$f.TimeField;
75
- exports.TimeInputFieldV2 = index$g.TimeInputFieldV2;
76
- exports.ToggleField = index$h.ToggleField;
77
- exports.Submit = index$i.Submit;
78
- exports.RadioGroupField = index$j.RadioGroupField;
79
- exports.KeyValueField = index$k.KeyValueField;
80
- exports.SelectableCardGroupField = index$l.SelectableCardGroupField;
81
- exports.SelectInputFieldV2 = index$m.SelectInputFieldV2;
82
- exports.UnitInputField = index$n.UnitInputField;
83
- exports.SliderField = index$o.SliderField;
84
- exports.SwitchButtonField = index$p.SwitchButtonField;
85
- exports.VerificationCodeField = index$q.VerificationCodeField;
86
- exports.SelectableCardOptionGroupField = index$r.SelectableCardOptionGroupField;
59
+ exports.DateInputField = index$4.DateInputField;
60
+ exports.KeyValueField = index$5.KeyValueField;
61
+ exports.NumberInputField = index$6.NumberInputField;
62
+ exports.RadioField = index$7.RadioField;
63
+ exports.RadioGroupField = index$8.RadioGroupField;
64
+ exports.SelectableCardField = index$9.SelectableCardField;
65
+ exports.SelectableCardGroupField = index$a.SelectableCardGroupField;
66
+ exports.SelectableCardOptionGroupField = index$b.SelectableCardOptionGroupField;
67
+ exports.SelectInputField = index$c.SelectInputField;
68
+ exports.SliderField = index$d.SliderField;
69
+ exports.Submit = index$e.Submit;
70
+ exports.SubmitErrorAlert = index$f.SubmitErrorAlert;
71
+ exports.SwitchButtonField = index$g.SwitchButtonField;
72
+ exports.TagInputField = index$h.TagInputField;
73
+ exports.TextAreaField = index$i.TextAreaField;
74
+ exports.TextInputField = index$j.TextInputField;
75
+ exports.TimeInputField = index$k.TimeInputField;
76
+ exports.ToggleField = index$l.ToggleField;
77
+ exports.UnitInputField = index$m.UnitInputField;
78
+ exports.VerificationCodeField = index$n.VerificationCodeField;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from './components';
2
- export type { BaseFieldProps, FormErrors } from './types';
3
- export { useErrors, ErrorProvider } from './providers/ErrorContext';
4
- export { useOnFieldChange } from './hooks';
5
- export { useForm, useFieldArray, useWatch, useController, useFormState, useFormContext, } from 'react-hook-form';
6
1
  export type * from 'react-hook-form';
2
+ export { useController, useFieldArray, useForm, useFormContext, useFormState, useWatch, } from 'react-hook-form';
3
+ export * from './components';
7
4
  export { Form } from './components';
5
+ export { useOnFieldChange } from './hooks';
6
+ export { ErrorProvider, useErrors } from './providers/ErrorContext';
7
+ export type { BaseFieldProps, FormErrors } from './types';
package/dist/index.js CHANGED
@@ -1,46 +1,40 @@
1
- import { ErrorProvider, useErrors } from "./providers/ErrorContext/index.js";
2
1
  import { useController, useFieldArray, useForm, useFormContext, useFormState, useWatch } from "react-hook-form";
3
- import { useOnFieldChange } from "./hooks/useOnFieldChange.js";
2
+ import { ErrorProvider, useErrors } from "./providers/ErrorContext/index.js";
4
3
  import { Form } from "./components/Form/index.js";
4
+ import { useOnFieldChange } from "./hooks/useOnFieldChange.js";
5
5
  import { CheckboxField } from "./components/CheckboxField/index.js";
6
6
  import { CheckboxGroupField } from "./components/CheckboxGroupField/index.js";
7
- import { DateField } from "./components/DateField/index.js";
7
+ import { DateInputField } from "./components/DateInputField/index.js";
8
+ import { KeyValueField } from "./components/KeyValueField/index.js";
9
+ import { NumberInputField } from "./components/NumberInputField/index.js";
8
10
  import { RadioField } from "./components/RadioField/index.js";
9
- import { SelectInputField } from "./components/SelectInputField/index.js";
11
+ import { RadioGroupField } from "./components/RadioGroupField/index.js";
10
12
  import { SelectableCardField } from "./components/SelectableCardField/index.js";
11
- import { NumberInputField } from "./components/NumberInputField/index.js";
12
- import { NumberInputFieldV2 } from "./components/NumberInputFieldV2/index.js";
13
+ import { SelectableCardGroupField } from "./components/SelectableCardGroupField/index.js";
14
+ import { SelectableCardOptionGroupField } from "./components/SelectableCardOptionGroupField/index.js";
15
+ import { SelectInputField } from "./components/SelectInputField/index.js";
16
+ import { SliderField } from "./components/SliderField/index.js";
17
+ import { Submit } from "./components/Submit/index.js";
13
18
  import { SubmitErrorAlert } from "./components/SubmitErrorAlert/index.js";
19
+ import { SwitchButtonField } from "./components/SwitchButtonField/index.js";
14
20
  import { TagInputField } from "./components/TagInputField/index.js";
15
21
  import { TextAreaField } from "./components/TextAreaField/index.js";
16
22
  import { TextInputField } from "./components/TextInputField/index.js";
17
- import { TextInputField as TextInputField2 } from "./components/TextInputFieldV2/index.js";
18
- import { TimeField } from "./components/TimeField/index.js";
19
- import { TimeInputFieldV2 } from "./components/TimeInputFieldV2/index.js";
23
+ import { TimeInputField } from "./components/TimeInputField/index.js";
20
24
  import { ToggleField } from "./components/ToggleField/index.js";
21
- import { Submit } from "./components/Submit/index.js";
22
- import { RadioGroupField } from "./components/RadioGroupField/index.js";
23
- import { KeyValueField } from "./components/KeyValueField/index.js";
24
- import { SelectableCardGroupField } from "./components/SelectableCardGroupField/index.js";
25
- import { SelectInputFieldV2 } from "./components/SelectInputFieldV2/index.js";
26
25
  import { UnitInputField } from "./components/UnitInputField/index.js";
27
- import { SliderField } from "./components/SliderField/index.js";
28
- import { SwitchButtonField } from "./components/SwitchButtonField/index.js";
29
26
  import { VerificationCodeField } from "./components/VerificationCodeField/index.js";
30
- import { SelectableCardOptionGroupField } from "./components/SelectableCardOptionGroupField/index.js";
31
27
  export {
32
28
  CheckboxField,
33
29
  CheckboxGroupField,
34
- DateField,
30
+ DateInputField,
35
31
  ErrorProvider,
36
32
  Form,
37
33
  KeyValueField,
38
34
  NumberInputField,
39
- NumberInputFieldV2,
40
35
  RadioField,
41
36
  RadioGroupField,
42
37
  SelectInputField,
43
- SelectInputFieldV2,
44
38
  SelectableCardField,
45
39
  SelectableCardGroupField,
46
40
  SelectableCardOptionGroupField,
@@ -51,9 +45,7 @@ export {
51
45
  TagInputField,
52
46
  TextAreaField,
53
47
  TextInputField,
54
- TextInputField2 as TextInputFieldV2,
55
- TimeField,
56
- TimeInputFieldV2,
48
+ TimeInputField,
57
49
  ToggleField,
58
50
  UnitInputField,
59
51
  VerificationCodeField,
@@ -1 +1 @@
1
- export { useErrors, ErrorProvider } from './ErrorContext';
1
+ export { ErrorProvider, useErrors } from './ErrorContext';
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- minDate: (maxDate?: Date) => (value: Date | [Date, Date]) => boolean;
3
2
  maxDate: (maxDate?: Date) => (value: Date | [Date, Date]) => boolean;
3
+ minDate: (maxDate?: Date) => (value: Date | [Date, Date]) => boolean;
4
4
  };
5
5
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/form",
3
- "version": "4.0.0-beta.9",
3
+ "version": "4.0.1",
4
4
  "description": "Ultraviolet Form",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -52,29 +52,29 @@
52
52
  ],
53
53
  "peerDependencies": {
54
54
  "@emotion/react": "11.14.0",
55
- "@emotion/styled": "11.14.0",
55
+ "@emotion/styled": "11.14.1",
56
56
  "react": "18.x || 19.x",
57
57
  "react-dom": "18.x || 19.x",
58
- "@ultraviolet/ui": "2.0.0-beta.8"
58
+ "@ultraviolet/ui": "2.0.1"
59
59
  },
60
60
  "devDependencies": {
61
- "@babel/core": "7.27.1",
61
+ "@babel/core": "7.28.0",
62
62
  "@emotion/react": "11.14.0",
63
- "@emotion/styled": "11.14.0",
63
+ "@emotion/styled": "11.14.1",
64
64
  "@types/final-form-focus": "1.1.7",
65
- "@types/react": "19.1.6",
65
+ "@types/react": "19.1.8",
66
66
  "@types/react-dom": "19.1.6",
67
67
  "react": "19.1.0",
68
68
  "react-dom": "19.1.0",
69
- "@ultraviolet/ui": "2.0.0-beta.8",
69
+ "@ultraviolet/ui": "2.0.1",
70
70
  "@utils/test": "0.0.1"
71
71
  },
72
72
  "dependencies": {
73
- "@babel/runtime": "7.27.1",
73
+ "@babel/runtime": "7.27.6",
74
74
  "react-hook-form": "7.55.0",
75
75
  "react-select": "5.10.0",
76
- "@ultraviolet/icons": "4.0.0-beta.5",
77
- "@ultraviolet/themes": "2.0.0-beta.2"
76
+ "@ultraviolet/icons": "4.0.1",
77
+ "@ultraviolet/themes": "2.0.0"
78
78
  },
79
79
  "scripts": {
80
80
  "build:profile": "npx vite-bundle-visualizer -c vite.config.ts",
@@ -1,7 +0,0 @@
1
- import { DateInput } from '@ultraviolet/ui';
2
- import type { ComponentProps } from 'react';
3
- import type { FieldPath, FieldValues } from 'react-hook-form';
4
- import type { BaseFieldProps } from '../../types';
5
- type DateFieldProps<TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TFieldName> & Omit<ComponentProps<typeof DateInput>, 'required' | 'name' | 'onChange' | 'value'>;
6
- export declare const DateField: <TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ required, name, control, label, format, minDate, maxDate, onChange, onBlur, validate, selectsRange, showMonthYearPicker, shouldUnregister, ...props }: DateFieldProps<TFieldValues, TFieldName>) => import("@emotion/react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,59 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const jsxRuntime = require("@emotion/react/jsx-runtime");
5
- const ui = require("@ultraviolet/ui");
6
- const reactHookForm = require("react-hook-form");
7
- const isInteger = require("../../validators/isInteger.cjs");
8
- const index = require("../../providers/ErrorContext/index.cjs");
9
- const NumberInputFieldV2 = ({
10
- control,
11
- max = Number.MAX_SAFE_INTEGER,
12
- min = 0,
13
- name,
14
- onChange,
15
- onBlur,
16
- step,
17
- label,
18
- "aria-label": ariaLabel,
19
- required,
20
- shouldUnregister = false,
21
- validate,
22
- ...props
23
- }) => {
24
- const {
25
- getError
26
- } = index.useErrors();
27
- const {
28
- field,
29
- fieldState: {
30
- error
31
- }
32
- } = reactHookForm.useController({
33
- name,
34
- control,
35
- shouldUnregister,
36
- rules: {
37
- max,
38
- min,
39
- required,
40
- validate: {
41
- ...validate,
42
- isInteger: isInteger.isInteger(step)
43
- }
44
- }
45
- });
46
- return /* @__PURE__ */ jsxRuntime.jsx(ui.NumberInputV2, { ...props, name: field.name, value: field.value, onBlur: (event) => {
47
- field.onBlur();
48
- onBlur?.(event);
49
- }, onChange: (newValue) => {
50
- field.onChange(newValue);
51
- onChange?.(newValue);
52
- }, max, min, step, label, error: getError({
53
- label: label ?? ariaLabel ?? name,
54
- max,
55
- min,
56
- isInteger: step
57
- }, error), "aria-label": ariaLabel, required });
58
- };
59
- exports.NumberInputFieldV2 = NumberInputFieldV2;
@@ -1,7 +0,0 @@
1
- import { NumberInputV2 } from '@ultraviolet/ui';
2
- import type { ComponentProps } from 'react';
3
- import type { FieldPath, FieldValues } from 'react-hook-form';
4
- import type { BaseFieldProps } from '../../types';
5
- type NumberInputV2Props<TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TFieldName> & Omit<ComponentProps<typeof NumberInputV2>, 'onChange' | 'value'>;
6
- export declare const NumberInputFieldV2: <TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, max, min, name, onChange, onBlur, step, label, "aria-label": ariaLabel, required, shouldUnregister, validate, ...props }: NumberInputV2Props<TFieldValues, TFieldName>) => import("@emotion/react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,59 +0,0 @@
1
- "use client";
2
- import { jsx } from "@emotion/react/jsx-runtime";
3
- import { NumberInputV2 } from "@ultraviolet/ui";
4
- import { useController } from "react-hook-form";
5
- import { isInteger } from "../../validators/isInteger.js";
6
- import { useErrors } from "../../providers/ErrorContext/index.js";
7
- const NumberInputFieldV2 = ({
8
- control,
9
- max = Number.MAX_SAFE_INTEGER,
10
- min = 0,
11
- name,
12
- onChange,
13
- onBlur,
14
- step,
15
- label,
16
- "aria-label": ariaLabel,
17
- required,
18
- shouldUnregister = false,
19
- validate,
20
- ...props
21
- }) => {
22
- const {
23
- getError
24
- } = useErrors();
25
- const {
26
- field,
27
- fieldState: {
28
- error
29
- }
30
- } = useController({
31
- name,
32
- control,
33
- shouldUnregister,
34
- rules: {
35
- max,
36
- min,
37
- required,
38
- validate: {
39
- ...validate,
40
- isInteger: isInteger(step)
41
- }
42
- }
43
- });
44
- return /* @__PURE__ */ jsx(NumberInputV2, { ...props, name: field.name, value: field.value, onBlur: (event) => {
45
- field.onBlur();
46
- onBlur?.(event);
47
- }, onChange: (newValue) => {
48
- field.onChange(newValue);
49
- onChange?.(newValue);
50
- }, max, min, step, label, error: getError({
51
- label: label ?? ariaLabel ?? name,
52
- max,
53
- min,
54
- isInteger: step
55
- }, error), "aria-label": ariaLabel, required });
56
- };
57
- export {
58
- NumberInputFieldV2
59
- };
@@ -1,50 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const jsxRuntime = require("@emotion/react/jsx-runtime");
5
- const ui = require("@ultraviolet/ui");
6
- const react = require("react");
7
- const reactHookForm = require("react-hook-form");
8
- const index = require("../../providers/ErrorContext/index.cjs");
9
- const SelectInputFieldV2 = ({
10
- label = "",
11
- onBlur,
12
- required,
13
- name,
14
- "aria-label": ariaLabel,
15
- shouldUnregister = false,
16
- control,
17
- validate,
18
- onChange,
19
- multiselect,
20
- ...props
21
- }) => {
22
- const {
23
- field,
24
- fieldState: {
25
- error
26
- }
27
- } = reactHookForm.useController({
28
- name,
29
- control,
30
- shouldUnregister,
31
- rules: {
32
- required,
33
- validate
34
- }
35
- });
36
- const {
37
- getError
38
- } = index.useErrors();
39
- const handleChange = react.useCallback((value) => {
40
- onChange?.(value);
41
- field.onChange(value);
42
- }, [onChange, field]);
43
- return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectInputV2, { name: field.name, multiselect, required, onBlur: (event) => {
44
- field.onBlur();
45
- onBlur?.(event);
46
- }, value: field.value, error: getError({
47
- label: label ?? ariaLabel ?? name
48
- }, error), label, "aria-label": ariaLabel, onChange: handleChange, ...props });
49
- };
50
- exports.SelectInputFieldV2 = SelectInputFieldV2;
@@ -1,7 +0,0 @@
1
- import { SelectInputV2 } from '@ultraviolet/ui';
2
- import { type ComponentProps } from 'react';
3
- import type { FieldPath, FieldValues } from 'react-hook-form';
4
- import type { BaseFieldProps } from '../../types';
5
- type SelectInputFieldV2Props<TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TFieldName> & Omit<ComponentProps<typeof SelectInputV2>, 'value' | 'onChange'>;
6
- export declare const SelectInputFieldV2: <TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, onBlur, required, name, "aria-label": ariaLabel, shouldUnregister, control, validate, onChange, multiselect, ...props }: SelectInputFieldV2Props<TFieldValues, TFieldName>) => import("@emotion/react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,50 +0,0 @@
1
- "use client";
2
- import { jsx } from "@emotion/react/jsx-runtime";
3
- import { SelectInputV2 } from "@ultraviolet/ui";
4
- import { useCallback } from "react";
5
- import { useController } from "react-hook-form";
6
- import { useErrors } from "../../providers/ErrorContext/index.js";
7
- const SelectInputFieldV2 = ({
8
- label = "",
9
- onBlur,
10
- required,
11
- name,
12
- "aria-label": ariaLabel,
13
- shouldUnregister = false,
14
- control,
15
- validate,
16
- onChange,
17
- multiselect,
18
- ...props
19
- }) => {
20
- const {
21
- field,
22
- fieldState: {
23
- error
24
- }
25
- } = useController({
26
- name,
27
- control,
28
- shouldUnregister,
29
- rules: {
30
- required,
31
- validate
32
- }
33
- });
34
- const {
35
- getError
36
- } = useErrors();
37
- const handleChange = useCallback((value) => {
38
- onChange?.(value);
39
- field.onChange(value);
40
- }, [onChange, field]);
41
- return /* @__PURE__ */ jsx(SelectInputV2, { name: field.name, multiselect, required, onBlur: (event) => {
42
- field.onBlur();
43
- onBlur?.(event);
44
- }, value: field.value, error: getError({
45
- label: label ?? ariaLabel ?? name
46
- }, error), label, "aria-label": ariaLabel, onChange: handleChange, ...props });
47
- };
48
- export {
49
- SelectInputFieldV2
50
- };
@@ -1,62 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const jsxRuntime = require("@emotion/react/jsx-runtime");
5
- const ui = require("@ultraviolet/ui");
6
- const reactHookForm = require("react-hook-form");
7
- const validateRegex = require("../../utils/validateRegex.cjs");
8
- const index = require("../../providers/ErrorContext/index.cjs");
9
- const TextInputField = ({
10
- regex: regexes,
11
- onChange,
12
- label,
13
- required = false,
14
- name,
15
- onBlur,
16
- minLength,
17
- maxLength,
18
- "aria-label": ariaLabel,
19
- shouldUnregister,
20
- validate,
21
- control,
22
- ...props
23
- }) => {
24
- const {
25
- getError
26
- } = index.useErrors();
27
- const {
28
- field,
29
- fieldState: {
30
- error
31
- }
32
- } = reactHookForm.useController({
33
- name,
34
- shouldUnregister,
35
- control,
36
- rules: {
37
- required,
38
- validate: {
39
- ...regexes ? {
40
- pattern: (value) => validateRegex.validateRegex(value, regexes)
41
- } : {},
42
- ...validate
43
- },
44
- minLength,
45
- maxLength
46
- }
47
- });
48
- return /* @__PURE__ */ jsxRuntime.jsx(ui.TextInputV2, { ...props, error: getError({
49
- regex: regexes,
50
- minLength,
51
- maxLength,
52
- label: label ?? ariaLabel ?? name,
53
- value: field.value
54
- }, error), label, minLength, maxLength, name, onBlur: (event) => {
55
- onBlur?.(event);
56
- field.onBlur();
57
- }, onChange: (event) => {
58
- field.onChange(event);
59
- onChange?.(event.target.value);
60
- }, required, value: field.value === void 0 ? "" : field.value, "aria-label": ariaLabel });
61
- };
62
- exports.TextInputField = TextInputField;