@fuf-stack/uniform 0.9.5 → 0.9.7

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 (92) hide show
  1. package/dist/CheckboxGroup/index.cjs +3 -3
  2. package/dist/CheckboxGroup/index.d.cts +5 -2
  3. package/dist/CheckboxGroup/index.d.ts +5 -2
  4. package/dist/CheckboxGroup/index.js +2 -2
  5. package/dist/CheckboxGroup-o-qWkWe1.d.cts +130 -0
  6. package/dist/CheckboxGroup-o-qWkWe1.d.ts +130 -0
  7. package/dist/FieldArray/index.cjs +3 -3
  8. package/dist/FieldArray/index.js +2 -2
  9. package/dist/{FieldValidationError-BSXedjCA.d.cts → FieldValidationError-DAT12Ess.d.cts} +2 -1
  10. package/dist/{FieldValidationError-BSXedjCA.d.ts → FieldValidationError-DAT12Ess.d.ts} +2 -1
  11. package/dist/Input/index.cjs +3 -3
  12. package/dist/Input/index.js +2 -2
  13. package/dist/RadioGroup/index.cjs +3 -3
  14. package/dist/RadioGroup/index.d.cts +5 -2
  15. package/dist/RadioGroup/index.d.ts +5 -2
  16. package/dist/RadioGroup/index.js +2 -2
  17. package/dist/RadioGroup-D_kiBt0M.d.cts +162 -0
  18. package/dist/RadioGroup-D_kiBt0M.d.ts +162 -0
  19. package/dist/Select/index.cjs +3 -3
  20. package/dist/Select/index.d.cts +3 -3
  21. package/dist/Select/index.d.ts +3 -3
  22. package/dist/Select/index.js +2 -2
  23. package/dist/Select-BhS4z0Pj.d.cts +317 -0
  24. package/dist/Select-BhS4z0Pj.d.ts +317 -0
  25. package/dist/Switch/index.cjs +3 -3
  26. package/dist/Switch/index.d.cts +5 -2
  27. package/dist/Switch/index.d.ts +5 -2
  28. package/dist/Switch/index.js +2 -2
  29. package/dist/Switch-Fdldj8LV.d.cts +126 -0
  30. package/dist/Switch-Fdldj8LV.d.ts +126 -0
  31. package/dist/TextArea/index.cjs +3 -3
  32. package/dist/TextArea/index.js +2 -2
  33. package/dist/{chunk-OCR2UWG2.cjs → chunk-4RTJ5XR2.cjs} +3 -3
  34. package/dist/{chunk-OCR2UWG2.cjs.map → chunk-4RTJ5XR2.cjs.map} +1 -1
  35. package/dist/{chunk-FMQNL3RT.js → chunk-F7GG67YU.js} +2 -2
  36. package/dist/{chunk-W24WP5YE.cjs → chunk-HFMFDBEV.cjs} +46 -14
  37. package/dist/chunk-HFMFDBEV.cjs.map +1 -0
  38. package/dist/{chunk-NHPQEYYN.js → chunk-HOCRJOEU.js} +2 -2
  39. package/dist/{chunk-TNELIBCV.cjs → chunk-JDRMKZ35.cjs} +4 -4
  40. package/dist/{chunk-TNELIBCV.cjs.map → chunk-JDRMKZ35.cjs.map} +1 -1
  41. package/dist/{chunk-4AHVJWTB.js → chunk-JG5VQZ4V.js} +46 -14
  42. package/dist/chunk-JG5VQZ4V.js.map +1 -0
  43. package/dist/{chunk-5UHHZ7KY.cjs → chunk-JRFKYVXY.cjs} +3 -3
  44. package/dist/{chunk-5UHHZ7KY.cjs.map → chunk-JRFKYVXY.cjs.map} +1 -1
  45. package/dist/chunk-LDW7K7LW.js +231 -0
  46. package/dist/chunk-LDW7K7LW.js.map +1 -0
  47. package/dist/{chunk-INTLZONV.cjs → chunk-NQ4JZ7AK.cjs} +37 -15
  48. package/dist/chunk-NQ4JZ7AK.cjs.map +1 -0
  49. package/dist/{chunk-QVBZ5RLN.cjs → chunk-NXTXKBTP.cjs} +104 -113
  50. package/dist/chunk-NXTXKBTP.cjs.map +1 -0
  51. package/dist/{chunk-QTL5FREE.cjs → chunk-OHJYXA6R.cjs} +7 -5
  52. package/dist/chunk-OHJYXA6R.cjs.map +1 -0
  53. package/dist/{chunk-YUAJN6HW.cjs → chunk-PAX2HXPK.cjs} +54 -19
  54. package/dist/chunk-PAX2HXPK.cjs.map +1 -0
  55. package/dist/{chunk-AVKEYJH7.js → chunk-PFX4YRWI.js} +38 -16
  56. package/dist/chunk-PFX4YRWI.js.map +1 -0
  57. package/dist/{chunk-DTSX7YON.js → chunk-SCTH3FAO.js} +2 -2
  58. package/dist/{chunk-ARUVDZFG.js → chunk-VZFPQ6ZZ.js} +54 -19
  59. package/dist/chunk-VZFPQ6ZZ.js.map +1 -0
  60. package/dist/{chunk-DBLODROX.js → chunk-WKM2D7LF.js} +7 -5
  61. package/dist/chunk-WKM2D7LF.js.map +1 -0
  62. package/dist/index.cjs +9 -9
  63. package/dist/index.d.cts +8 -8
  64. package/dist/index.d.ts +8 -8
  65. package/dist/index.js +10 -10
  66. package/dist/partials/FieldValidationError/index.cjs +2 -2
  67. package/dist/partials/FieldValidationError/index.d.cts +2 -2
  68. package/dist/partials/FieldValidationError/index.d.ts +2 -2
  69. package/dist/partials/FieldValidationError/index.js +1 -1
  70. package/package.json +6 -6
  71. package/dist/CheckboxGroup-BYsQ0A0q.d.cts +0 -32
  72. package/dist/CheckboxGroup-BYsQ0A0q.d.ts +0 -32
  73. package/dist/RadioGroup-BU4K9cnS.d.cts +0 -40
  74. package/dist/RadioGroup-BU4K9cnS.d.ts +0 -40
  75. package/dist/Select-C08Oftdr.d.cts +0 -184
  76. package/dist/Select-C08Oftdr.d.ts +0 -184
  77. package/dist/Switch-OkO3GdPy.d.cts +0 -20
  78. package/dist/Switch-OkO3GdPy.d.ts +0 -20
  79. package/dist/chunk-4AHVJWTB.js.map +0 -1
  80. package/dist/chunk-ARUVDZFG.js.map +0 -1
  81. package/dist/chunk-AVKEYJH7.js.map +0 -1
  82. package/dist/chunk-DBLODROX.js.map +0 -1
  83. package/dist/chunk-I5M2A3MN.js +0 -240
  84. package/dist/chunk-I5M2A3MN.js.map +0 -1
  85. package/dist/chunk-INTLZONV.cjs.map +0 -1
  86. package/dist/chunk-QTL5FREE.cjs.map +0 -1
  87. package/dist/chunk-QVBZ5RLN.cjs.map +0 -1
  88. package/dist/chunk-W24WP5YE.cjs.map +0 -1
  89. package/dist/chunk-YUAJN6HW.cjs.map +0 -1
  90. /package/dist/{chunk-FMQNL3RT.js.map → chunk-F7GG67YU.js.map} +0 -0
  91. /package/dist/{chunk-NHPQEYYN.js.map → chunk-HOCRJOEU.js.map} +0 -0
  92. /package/dist/{chunk-DTSX7YON.js.map → chunk-SCTH3FAO.js.map} +0 -0
@@ -1,32 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- type CheckboxGroupOption = {
4
- /** option label */
5
- label?: React.ReactNode;
6
- /** option value */
7
- value: string;
8
- /** disables the option */
9
- disabled?: boolean;
10
- /** HTML data-testid attribute of the option */
11
- testId?: string;
12
- };
13
- interface CheckboxGroupProps {
14
- /** CSS class name. ClassName: string | { buttons?: string | { base?: string; active?: string }; base?: string;} */
15
- className?: string;
16
- /** label displayed above the Checkboxes */
17
- label?: React.ReactNode;
18
- /** Name the Field is registered on the form. */
19
- name: string;
20
- /** Checkboxes that should be displayed. */
21
- options: CheckboxGroupOption[];
22
- /** sets all buttons disabled */
23
- disabled?: boolean;
24
- /** id for internal testing. */
25
- testId?: string;
26
- }
27
- /**
28
- * CheckboxGroup component based on [NextUI CheckboxGroup](https://nextui.org/docs/components/checkbox-group)
29
- */
30
- declare const CheckboxGroup: ({ className, label, options, disabled, name, testId: _testId, }: CheckboxGroupProps) => react_jsx_runtime.JSX.Element;
31
-
32
- export { CheckboxGroup as C, type CheckboxGroupProps as a, type CheckboxGroupOption as b };
@@ -1,32 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- type CheckboxGroupOption = {
4
- /** option label */
5
- label?: React.ReactNode;
6
- /** option value */
7
- value: string;
8
- /** disables the option */
9
- disabled?: boolean;
10
- /** HTML data-testid attribute of the option */
11
- testId?: string;
12
- };
13
- interface CheckboxGroupProps {
14
- /** CSS class name. ClassName: string | { buttons?: string | { base?: string; active?: string }; base?: string;} */
15
- className?: string;
16
- /** label displayed above the Checkboxes */
17
- label?: React.ReactNode;
18
- /** Name the Field is registered on the form. */
19
- name: string;
20
- /** Checkboxes that should be displayed. */
21
- options: CheckboxGroupOption[];
22
- /** sets all buttons disabled */
23
- disabled?: boolean;
24
- /** id for internal testing. */
25
- testId?: string;
26
- }
27
- /**
28
- * CheckboxGroup component based on [NextUI CheckboxGroup](https://nextui.org/docs/components/checkbox-group)
29
- */
30
- declare const CheckboxGroup: ({ className, label, options, disabled, name, testId: _testId, }: CheckboxGroupProps) => react_jsx_runtime.JSX.Element;
31
-
32
- export { CheckboxGroup as C, type CheckboxGroupProps as a, type CheckboxGroupOption as b };
@@ -1,40 +0,0 @@
1
- import { ReactNode, ReactElement } from 'react';
2
-
3
- interface RadioGroupOption {
4
- /** Description of the value. Works with variant radioBox. */
5
- description?: React.ReactNode;
6
- /** disables the option */
7
- disabled?: boolean;
8
- /** option label */
9
- label?: React.ReactNode;
10
- /** option icon */
11
- icon?: ReactNode;
12
- /** HTML data-testid attribute of the option */
13
- testId?: string;
14
- /** option value */
15
- value: string;
16
- }
17
- interface RadioGroupProps {
18
- /** CSS class name */
19
- className?: string;
20
- /** Determines if the Buttons are disabled or not. */
21
- disabled?: boolean;
22
- /** determines orientation of the Buttons. */
23
- inline?: boolean;
24
- /** Label displayed next to the RadioButton. */
25
- label?: ReactNode;
26
- /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */
27
- name: string;
28
- /** Radio button configuration. */
29
- options: RadioGroupOption[];
30
- /** Id to grab element in internal tests. */
31
- testId?: string;
32
- /** How the RadioGroup should look like. */
33
- variant?: 'default' | 'radioBox' | 'radioButton';
34
- }
35
- /**
36
- * RadioGroup component based on [NextUI RadioGroup](https://nextui.org/docs/components/radio-group)
37
- */
38
- declare const RadioGroup: ({ className, disabled, inline, label, name, options, testId: _testId, variant, }: RadioGroupProps) => ReactElement;
39
-
40
- export { RadioGroup as R, type RadioGroupProps as a };
@@ -1,40 +0,0 @@
1
- import { ReactNode, ReactElement } from 'react';
2
-
3
- interface RadioGroupOption {
4
- /** Description of the value. Works with variant radioBox. */
5
- description?: React.ReactNode;
6
- /** disables the option */
7
- disabled?: boolean;
8
- /** option label */
9
- label?: React.ReactNode;
10
- /** option icon */
11
- icon?: ReactNode;
12
- /** HTML data-testid attribute of the option */
13
- testId?: string;
14
- /** option value */
15
- value: string;
16
- }
17
- interface RadioGroupProps {
18
- /** CSS class name */
19
- className?: string;
20
- /** Determines if the Buttons are disabled or not. */
21
- disabled?: boolean;
22
- /** determines orientation of the Buttons. */
23
- inline?: boolean;
24
- /** Label displayed next to the RadioButton. */
25
- label?: ReactNode;
26
- /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */
27
- name: string;
28
- /** Radio button configuration. */
29
- options: RadioGroupOption[];
30
- /** Id to grab element in internal tests. */
31
- testId?: string;
32
- /** How the RadioGroup should look like. */
33
- variant?: 'default' | 'radioBox' | 'radioButton';
34
- }
35
- /**
36
- * RadioGroup component based on [NextUI RadioGroup](https://nextui.org/docs/components/radio-group)
37
- */
38
- declare const RadioGroup: ({ className, disabled, inline, label, name, options, testId: _testId, variant, }: RadioGroupProps) => ReactElement;
39
-
40
- export { RadioGroup as R, type RadioGroupProps as a };
@@ -1,184 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as tailwind_variants from 'tailwind-variants';
3
- import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
4
- import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
5
- import { Props } from 'react-select';
6
-
7
- declare const selectVariants: tailwind_variants.TVReturnType<{
8
- invalid: {
9
- true: {
10
- control: string;
11
- };
12
- };
13
- }, {
14
- base: string;
15
- clearIndicator: string;
16
- control: string;
17
- control_focused: string;
18
- crossIcon: string;
19
- downChevron: string;
20
- dropdownIndicator: string;
21
- group: string;
22
- groupHeading: string;
23
- indicatorsContainer: string;
24
- indicatorSeparator: string;
25
- input: string;
26
- label: string;
27
- loadingIndicator: string;
28
- loadingMessage: string;
29
- menu: string;
30
- menuList: string;
31
- menuPortal: string;
32
- multiValue: string;
33
- multiValueContainer: string;
34
- multiValueLabel: string;
35
- multiValueRemove: string;
36
- noOptionsMessage: string;
37
- option_focused: string;
38
- option_selected: string;
39
- option: string;
40
- placeholder: string;
41
- selectContainer: string;
42
- singleValue: string;
43
- valueContainer: string;
44
- }, undefined, tailwind_variants_dist_config_js.TVConfig<{
45
- invalid: {
46
- true: {
47
- control: string;
48
- };
49
- };
50
- }, {
51
- invalid: {
52
- true: {
53
- control: string;
54
- };
55
- };
56
- }>, {
57
- invalid: {
58
- true: {
59
- control: string;
60
- };
61
- };
62
- }, {
63
- base: string;
64
- clearIndicator: string;
65
- control: string;
66
- control_focused: string;
67
- crossIcon: string;
68
- downChevron: string;
69
- dropdownIndicator: string;
70
- group: string;
71
- groupHeading: string;
72
- indicatorsContainer: string;
73
- indicatorSeparator: string;
74
- input: string;
75
- label: string;
76
- loadingIndicator: string;
77
- loadingMessage: string;
78
- menu: string;
79
- menuList: string;
80
- menuPortal: string;
81
- multiValue: string;
82
- multiValueContainer: string;
83
- multiValueLabel: string;
84
- multiValueRemove: string;
85
- noOptionsMessage: string;
86
- option_focused: string;
87
- option_selected: string;
88
- option: string;
89
- placeholder: string;
90
- selectContainer: string;
91
- singleValue: string;
92
- valueContainer: string;
93
- }, tailwind_variants.TVReturnType<{
94
- invalid: {
95
- true: {
96
- control: string;
97
- };
98
- };
99
- }, {
100
- base: string;
101
- clearIndicator: string;
102
- control: string;
103
- control_focused: string;
104
- crossIcon: string;
105
- downChevron: string;
106
- dropdownIndicator: string;
107
- group: string;
108
- groupHeading: string;
109
- indicatorsContainer: string;
110
- indicatorSeparator: string;
111
- input: string;
112
- label: string;
113
- loadingIndicator: string;
114
- loadingMessage: string;
115
- menu: string;
116
- menuList: string;
117
- menuPortal: string;
118
- multiValue: string;
119
- multiValueContainer: string;
120
- multiValueLabel: string;
121
- multiValueRemove: string;
122
- noOptionsMessage: string;
123
- option_focused: string;
124
- option_selected: string;
125
- option: string;
126
- placeholder: string;
127
- selectContainer: string;
128
- singleValue: string;
129
- valueContainer: string;
130
- }, undefined, tailwind_variants_dist_config_js.TVConfig<{
131
- invalid: {
132
- true: {
133
- control: string;
134
- };
135
- };
136
- }, {
137
- invalid: {
138
- true: {
139
- control: string;
140
- };
141
- };
142
- }>, unknown, unknown, undefined>>;
143
- type SelectOption = {
144
- /** option label */
145
- label?: React.ReactNode;
146
- /** option value */
147
- value: string;
148
- };
149
- type VariantProps = TVProps<typeof selectVariants>;
150
- type ClassName = TVClassName<typeof selectVariants>;
151
- interface SelectProps extends VariantProps {
152
- /** CSS class name */
153
- className?: ClassName;
154
- /** Determine if the */
155
- clearable?: boolean;
156
- /** Set the select to disabled state. */
157
- disabled?: boolean;
158
- /** Filter Select Options */
159
- filterOption?: undefined | ((option?: SelectOption, inputValue?: string) => boolean);
160
- /** Format the label of the option */
161
- formatOptionLabel?: undefined | Props['formatOptionLabel'];
162
- /** The value of the search input */
163
- inputValue?: string;
164
- /** Label that should be associated with the select. */
165
- label?: React.ReactNode;
166
- /** Set the select to a loading state. */
167
- loading?: boolean;
168
- /** switch between single and multi select mode. */
169
- multiSelect?: boolean;
170
- /** The name for the Select component, used by react-hook-form */
171
- name: string;
172
- /** Placeholder that is displayed when nothing is selected */
173
- placeholder?: string;
174
- /** The options for the Select component */
175
- options: SelectOption[];
176
- /** Handle change events on the input */
177
- onInputChange?: Props['onInputChange'];
178
- /** HTML data-testid attribute used in e2e tests */
179
- testId?: string;
180
- }
181
- /** Select component based on [NextUI Select](https://nextui.org/docs/components/select) and [React-Select](https://react-select.com/home) */
182
- declare const Select: ({ className, clearable, disabled, filterOption, formatOptionLabel, inputValue, label: _label, loading, multiSelect, name, onInputChange, options, placeholder, testId: _testId, }: SelectProps) => react_jsx_runtime.JSX.Element;
183
-
184
- export { Select as S, type SelectProps as a };
@@ -1,184 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as tailwind_variants from 'tailwind-variants';
3
- import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
4
- import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
5
- import { Props } from 'react-select';
6
-
7
- declare const selectVariants: tailwind_variants.TVReturnType<{
8
- invalid: {
9
- true: {
10
- control: string;
11
- };
12
- };
13
- }, {
14
- base: string;
15
- clearIndicator: string;
16
- control: string;
17
- control_focused: string;
18
- crossIcon: string;
19
- downChevron: string;
20
- dropdownIndicator: string;
21
- group: string;
22
- groupHeading: string;
23
- indicatorsContainer: string;
24
- indicatorSeparator: string;
25
- input: string;
26
- label: string;
27
- loadingIndicator: string;
28
- loadingMessage: string;
29
- menu: string;
30
- menuList: string;
31
- menuPortal: string;
32
- multiValue: string;
33
- multiValueContainer: string;
34
- multiValueLabel: string;
35
- multiValueRemove: string;
36
- noOptionsMessage: string;
37
- option_focused: string;
38
- option_selected: string;
39
- option: string;
40
- placeholder: string;
41
- selectContainer: string;
42
- singleValue: string;
43
- valueContainer: string;
44
- }, undefined, tailwind_variants_dist_config_js.TVConfig<{
45
- invalid: {
46
- true: {
47
- control: string;
48
- };
49
- };
50
- }, {
51
- invalid: {
52
- true: {
53
- control: string;
54
- };
55
- };
56
- }>, {
57
- invalid: {
58
- true: {
59
- control: string;
60
- };
61
- };
62
- }, {
63
- base: string;
64
- clearIndicator: string;
65
- control: string;
66
- control_focused: string;
67
- crossIcon: string;
68
- downChevron: string;
69
- dropdownIndicator: string;
70
- group: string;
71
- groupHeading: string;
72
- indicatorsContainer: string;
73
- indicatorSeparator: string;
74
- input: string;
75
- label: string;
76
- loadingIndicator: string;
77
- loadingMessage: string;
78
- menu: string;
79
- menuList: string;
80
- menuPortal: string;
81
- multiValue: string;
82
- multiValueContainer: string;
83
- multiValueLabel: string;
84
- multiValueRemove: string;
85
- noOptionsMessage: string;
86
- option_focused: string;
87
- option_selected: string;
88
- option: string;
89
- placeholder: string;
90
- selectContainer: string;
91
- singleValue: string;
92
- valueContainer: string;
93
- }, tailwind_variants.TVReturnType<{
94
- invalid: {
95
- true: {
96
- control: string;
97
- };
98
- };
99
- }, {
100
- base: string;
101
- clearIndicator: string;
102
- control: string;
103
- control_focused: string;
104
- crossIcon: string;
105
- downChevron: string;
106
- dropdownIndicator: string;
107
- group: string;
108
- groupHeading: string;
109
- indicatorsContainer: string;
110
- indicatorSeparator: string;
111
- input: string;
112
- label: string;
113
- loadingIndicator: string;
114
- loadingMessage: string;
115
- menu: string;
116
- menuList: string;
117
- menuPortal: string;
118
- multiValue: string;
119
- multiValueContainer: string;
120
- multiValueLabel: string;
121
- multiValueRemove: string;
122
- noOptionsMessage: string;
123
- option_focused: string;
124
- option_selected: string;
125
- option: string;
126
- placeholder: string;
127
- selectContainer: string;
128
- singleValue: string;
129
- valueContainer: string;
130
- }, undefined, tailwind_variants_dist_config_js.TVConfig<{
131
- invalid: {
132
- true: {
133
- control: string;
134
- };
135
- };
136
- }, {
137
- invalid: {
138
- true: {
139
- control: string;
140
- };
141
- };
142
- }>, unknown, unknown, undefined>>;
143
- type SelectOption = {
144
- /** option label */
145
- label?: React.ReactNode;
146
- /** option value */
147
- value: string;
148
- };
149
- type VariantProps = TVProps<typeof selectVariants>;
150
- type ClassName = TVClassName<typeof selectVariants>;
151
- interface SelectProps extends VariantProps {
152
- /** CSS class name */
153
- className?: ClassName;
154
- /** Determine if the */
155
- clearable?: boolean;
156
- /** Set the select to disabled state. */
157
- disabled?: boolean;
158
- /** Filter Select Options */
159
- filterOption?: undefined | ((option?: SelectOption, inputValue?: string) => boolean);
160
- /** Format the label of the option */
161
- formatOptionLabel?: undefined | Props['formatOptionLabel'];
162
- /** The value of the search input */
163
- inputValue?: string;
164
- /** Label that should be associated with the select. */
165
- label?: React.ReactNode;
166
- /** Set the select to a loading state. */
167
- loading?: boolean;
168
- /** switch between single and multi select mode. */
169
- multiSelect?: boolean;
170
- /** The name for the Select component, used by react-hook-form */
171
- name: string;
172
- /** Placeholder that is displayed when nothing is selected */
173
- placeholder?: string;
174
- /** The options for the Select component */
175
- options: SelectOption[];
176
- /** Handle change events on the input */
177
- onInputChange?: Props['onInputChange'];
178
- /** HTML data-testid attribute used in e2e tests */
179
- testId?: string;
180
- }
181
- /** Select component based on [NextUI Select](https://nextui.org/docs/components/select) and [React-Select](https://react-select.com/home) */
182
- declare const Select: ({ className, clearable, disabled, filterOption, formatOptionLabel, inputValue, label: _label, loading, multiSelect, name, onInputChange, options, placeholder, testId: _testId, }: SelectProps) => react_jsx_runtime.JSX.Element;
183
-
184
- export { Select as S, type SelectProps as a };
@@ -1,20 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- interface SwitchProps {
4
- /** CSS class name */
5
- className?: string;
6
- /** whether the select should be disabled */
7
- disabled?: boolean;
8
- /** component displayed next to the switch. */
9
- label?: React.ReactNode;
10
- /** name the field is registered under */
11
- name: string;
12
- /** HTML data-testid attribute used in e2e tests */
13
- testId?: string;
14
- }
15
- /**
16
- * Switch component based on [NextUI Switch](https://nextui.org/docs/components/switch)
17
- */
18
- declare const Switch: ({ className, disabled, label: _label, name, testId: _testId, }: SwitchProps) => react_jsx_runtime.JSX.Element;
19
-
20
- export { Switch as S, type SwitchProps as a };
@@ -1,20 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- interface SwitchProps {
4
- /** CSS class name */
5
- className?: string;
6
- /** whether the select should be disabled */
7
- disabled?: boolean;
8
- /** component displayed next to the switch. */
9
- label?: React.ReactNode;
10
- /** name the field is registered under */
11
- name: string;
12
- /** HTML data-testid attribute used in e2e tests */
13
- testId?: string;
14
- }
15
- /**
16
- * Switch component based on [NextUI Switch](https://nextui.org/docs/components/switch)
17
- */
18
- declare const Switch: ({ className, disabled, label: _label, name, testId: _testId, }: SwitchProps) => react_jsx_runtime.JSX.Element;
19
-
20
- export { Switch as S, type SwitchProps as a };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/CheckboxGroup/CheckboxGroup.tsx","../src/CheckboxGroup/index.ts"],"sourcesContent":["import { Controller } from 'react-hook-form';\n\nimport {\n Checkbox,\n CheckboxGroup as NextCheckboxGroup,\n} from '@nextui-org/checkbox';\n\nimport { slugify } from '../helpers';\nimport { useFormContext } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport type CheckboxGroupOption = {\n /** option label */\n label?: React.ReactNode;\n /** option value */\n value: string;\n /** disables the option */\n disabled?: boolean;\n /** HTML data-testid attribute of the option */\n testId?: string;\n};\n\nexport interface CheckboxGroupProps {\n /** CSS class name. ClassName: string | { buttons?: string | { base?: string; active?: string }; base?: string;} */\n className?: string;\n /** label displayed above the Checkboxes */\n label?: React.ReactNode;\n /** Name the Field is registered on the form. */\n name: string;\n /** Checkboxes that should be displayed. */\n options: CheckboxGroupOption[];\n /** sets all buttons disabled */\n disabled?: boolean;\n /** id for internal testing. */\n testId?: string;\n}\n\n/**\n * CheckboxGroup component based on [NextUI CheckboxGroup](https://nextui.org/docs/components/checkbox-group)\n */\nconst CheckboxGroup = ({\n className = undefined,\n label = undefined,\n options,\n disabled = false,\n name,\n testId: _testId = undefined,\n}: CheckboxGroupProps) => {\n const { getFieldState, control } = useFormContext();\n const { error, invalid, required, testId } = getFieldState(name, _testId);\n\n return (\n <Controller\n control={control}\n name={name}\n disabled={disabled}\n render={({ field: { onChange, value, ref, onBlur } }) => {\n return (\n <NextCheckboxGroup\n className={className}\n data-testid={testId}\n errorMessage={error && <FieldValidationError error={error} />}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={\n label && (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label\n className={`text-bold text-ellipsis text-small ${invalid ? 'text-danger' : 'text-foreground-500'}`}\n >\n {label}\n <FieldCopyTestIdButton testId={testId} />\n </label>\n )\n }\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...(options.length === 1\n ? {\n value: [value].filter((v) => v !== undefined),\n onChange: (newValue) => onChange(newValue && newValue[0]),\n }\n : {\n onChange,\n value,\n })}\n onBlur={onBlur}\n ref={ref}\n >\n {options?.map((option) => {\n return (\n <Checkbox\n key={`index_${option.value}`}\n isDisabled={disabled || option.disabled}\n value={option?.value}\n data-testid={slugify(\n `${testId}_option_${option?.testId || option?.value}`,\n )}\n >\n {option?.label}\n </Checkbox>\n );\n })}\n </NextCheckboxGroup>\n );\n }}\n />\n );\n};\n\nexport default CheckboxGroup;\n","import CheckboxGroup from './CheckboxGroup';\n\nexport type { CheckboxGroupProps, CheckboxGroupOption } from './CheckboxGroup';\n\nexport { CheckboxGroup };\n\nexport default CheckboxGroup;\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAE3B;AAAA,EACE;AAAA,EACA,iBAAiB;AAAA,OACZ;AAyD4B,cAOnB,YAPmB;AArBnC,IAAM,gBAAgB,CAAC;AAAA,EACrB,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA,QAAQ,UAAU;AACpB,MAA0B;AACxB,QAAM,EAAE,eAAe,QAAQ,IAAI,eAAe;AAClD,QAAM,EAAE,OAAO,SAAS,UAAU,OAAO,IAAI,cAAc,MAAM,OAAO;AAExE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,OAAO,KAAK,OAAO,EAAE,MAAM;AACvD,eACE;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,eAAa;AAAA,YACb,cAAc,SAAS,oBAAC,gCAAqB,OAAc;AAAA,YAC3D,YAAY;AAAA,YACZ,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,OACE;AAAA,YAEE;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,sCAAsC,UAAU,gBAAgB,qBAAqB;AAAA,gBAE/F;AAAA;AAAA,kBACD,oBAAC,iCAAsB,QAAgB;AAAA;AAAA;AAAA,YACzC;AAAA,YAIH,GAAI,QAAQ,WAAW,IACpB;AAAA,cACE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,MAAM,MAAS;AAAA,cAC5C,UAAU,CAAC,aAAa,SAAS,YAAY,SAAS,CAAC,CAAC;AAAA,YAC1D,IACA;AAAA,cACE;AAAA,cACA;AAAA,YACF;AAAA,YACJ;AAAA,YACA;AAAA,YAEC,mBAAS,IAAI,CAAC,WAAW;AACxB,qBACE;AAAA,gBAAC;AAAA;AAAA,kBAEC,YAAY,YAAY,OAAO;AAAA,kBAC/B,OAAO,QAAQ;AAAA,kBACf,eAAa;AAAA,oBACX,GAAG,MAAM,WAAW,QAAQ,UAAU,QAAQ,KAAK;AAAA,kBACrD;AAAA,kBAEC,kBAAQ;AAAA;AAAA,gBAPJ,SAAS,OAAO,KAAK;AAAA,cAQ5B;AAAA,YAEJ,CAAC;AAAA;AAAA,QACH;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,wBAAQ;;;ACzGf,IAAOA,yBAAQ;","names":["CheckboxGroup_default"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/RadioGroup/RadioGroup.tsx","../src/RadioGroup/Variants/RadioBox.tsx","../src/RadioGroup/Variants/RadioButton.tsx","../src/RadioGroup/index.ts"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\n\nimport { Controller } from 'react-hook-form';\n\nimport { ButtonGroup as NextButtonGroup } from '@nextui-org/button';\nimport { RadioGroup as NextRadioGroup, Radio } from '@nextui-org/radio';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { slugify } from '../helpers';\nimport { useFormContext } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\nimport { RadioBox } from './Variants/RadioBox';\nimport { RadioButton } from './Variants/RadioButton';\n\nexport interface RadioGroupOption {\n /** Description of the value. Works with variant radioBox. */\n description?: React.ReactNode;\n /** disables the option */\n disabled?: boolean;\n /** option label */\n label?: React.ReactNode;\n /** option icon */\n icon?: ReactNode;\n /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: string;\n}\n\nexport interface RadioGroupProps {\n /** CSS class name */\n className?: string;\n /** Determines if the Buttons are disabled or not. */\n disabled?: boolean;\n /** determines orientation of the Buttons. */\n inline?: boolean;\n /** Label displayed next to the RadioButton. */\n label?: ReactNode;\n /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */\n name: string;\n /** Radio button configuration. */\n options: RadioGroupOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioGroup should look like. */\n variant?: 'default' | 'radioBox' | 'radioButton';\n}\n\n/**\n * RadioGroup component based on [NextUI RadioGroup](https://nextui.org/docs/components/radio-group)\n */\nconst RadioGroup = ({\n className = undefined,\n disabled = false,\n inline = false,\n label = undefined,\n name,\n options,\n testId: _testId = undefined,\n variant = 'default',\n}: RadioGroupProps): ReactElement => {\n const { control, getFieldState, getValues } = useFormContext();\n\n const { error, invalid, required, testId } = getFieldState(name, _testId);\n\n return (\n <Controller\n control={control}\n disabled={disabled}\n name={name}\n render={({ field: { onChange, disabled: isDisabled, onBlur, ref } }) => {\n let RadioComponents: ReactNode;\n switch (variant) {\n case 'radioBox':\n RadioComponents = options.map((option) => (\n <RadioBox\n key={option.value}\n data-testid={slugify(\n `${testId}_option_${option.testId || option.value}`,\n )}\n isDisabled={isDisabled || option.disabled}\n value={option.value}\n onChange={onChange}\n description={option.description}\n icon={option.icon}\n >\n {option.label ? option.label : option.value}\n </RadioBox>\n ));\n break;\n case 'radioButton':\n RadioComponents = options.map((option) => (\n <RadioButton\n key={option.value}\n data-testid={slugify(\n `${testId}_option_${option.testId || option.value}`,\n )}\n isDisabled={isDisabled || option.disabled}\n value={option.value}\n onChange={onChange}\n // TODO: how to do the classNames properly (make selected option darker with same color)\n className={cn(\n `${getValues()[name] !== option.value ? 'bg-opacity-50' : ''}`,\n )}\n >\n {option.label ? option.label : option.value}\n </RadioButton>\n ));\n break;\n default:\n RadioComponents = options.map((option) => (\n <Radio\n key={option.value}\n data-testid={slugify(\n `${testId}_option_${option.testId || option.value}`,\n )}\n isDisabled={isDisabled || option.disabled}\n value={option.value}\n onChange={onChange}\n >\n {option.label ? option.label : option.value}\n </Radio>\n ));\n }\n\n return (\n <NextRadioGroup\n className={className}\n data-testid={testId}\n errorMessage={error && <FieldValidationError error={error} />}\n isDisabled={isDisabled}\n isInvalid={invalid}\n isRequired={required}\n label={\n label && (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label className={`${invalid ? 'text-danger' : ''}`}>\n {label}\n <FieldCopyTestIdButton testId={testId} />\n </label>\n )\n }\n orientation={inline ? 'horizontal' : 'vertical'}\n onBlur={onBlur}\n onChange={onChange}\n name={name}\n ref={ref}\n >\n {variant === 'radioButton' ? (\n // TODO: NextButtonGroup uses ref to modify Button style, but we wrap it, so it does not work at the moment.\n <NextButtonGroup>{RadioComponents}</NextButtonGroup>\n ) : (\n RadioComponents\n )}\n </NextRadioGroup>\n );\n }}\n />\n );\n};\n\nexport default RadioGroup;\n","import type { RadioProps as NextRadioProps } from '@nextui-org/radio';\nimport type { ReactNode } from 'react';\n\nimport { useRadio } from '@nextui-org/radio';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\ninterface RadioProps extends NextRadioProps {\n /** icon for the option */\n icon?: ReactNode;\n}\n\nexport const RadioBox = ({ icon = undefined, ...props }: RadioProps) => {\n const {\n children,\n Component,\n description,\n getBaseProps,\n getControlProps,\n getInputProps,\n getLabelProps,\n getLabelWrapperProps,\n getWrapperProps,\n isDisabled,\n } = useRadio(props);\n\n return (\n <Component\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...getBaseProps()}\n className={cn(\n 'group inline-flex flex-auto cursor-pointer items-center justify-between gap-4 rounded-lg border-2 border-default p-4 hover:bg-content2 data-[selected=true]:border-primary',\n {\n // disabled styles\n 'pointer-events-none opacity-disabled': isDisabled,\n },\n )}\n >\n <VisuallyHidden>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <input {...getInputProps()} />\n </VisuallyHidden>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <span {...getWrapperProps()}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <span {...getControlProps()} />\n </span>\n {icon}\n <div\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...getLabelWrapperProps()}\n className={cn(getLabelWrapperProps().className, 'grow')}\n >\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n {children && <span {...getLabelProps()}>{children}</span>}\n {description && (\n <span className=\"text-small text-foreground opacity-70\">\n {description}\n </span>\n )}\n </div>\n </Component>\n );\n};\n\nexport default RadioBox;\n","import { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface RadioButtonProps {\n /** label of the value. */\n children: React.ReactNode;\n /** CSS class name */\n className?: string;\n /** disables the option */\n isDisabled?: boolean;\n /** Callback function. Executed if the option is clicked. */\n onChange: (...event: unknown[]) => void;\n /** value of the option. */\n value: string;\n}\n\nexport const RadioButton = ({\n className = undefined,\n value,\n isDisabled = false,\n onChange,\n children,\n}: RadioButtonProps) => {\n return (\n <Button\n key={`index_${value}`}\n className={cn(className)}\n disabled={isDisabled}\n onClick={() => {\n return onChange(value);\n }}\n >\n {children}\n </Button>\n );\n};\n\nexport default RadioButton;\n","import RadioGroup from './RadioGroup';\n\nexport type { RadioGroupProps } from './RadioGroup';\n\nexport { RadioGroup };\n\nexport default RadioGroup;\n"],"mappings":";;;;;;;;;;;;;;AAEA,SAAS,kBAAkB;AAE3B,SAAS,eAAe,uBAAuB;AAC/C,SAAS,cAAc,gBAAgB,aAAa;AAEpD,SAAS,MAAAA,WAAU;;;ACJnB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAE/B,SAAS,UAAU;AAmCX,cAQF,YARE;AA5BD,IAAM,WAAW,CAAC,EAAE,OAAO,QAAW,GAAG,MAAM,MAAkB;AACtE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,I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eAAa;AAAA,kBACX,GAAG,MAAM,WAAW,OAAO,UAAU,OAAO,KAAK;AAAA,gBACnD;AAAA,gBACA,YAAY,cAAc,OAAO;AAAA,gBACjC,OAAO,OAAO;AAAA,gBACd;AAAA,gBAEC,iBAAO,QAAQ,OAAO,QAAQ,OAAO;AAAA;AAAA,cARjC,OAAO;AAAA,YASd,CACD;AAAA,QACL;AAEA,eACE,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,eAAa;AAAA,YACb,cAAc,SAAS,gBAAAA,KAAC,gCAAqB,OAAc;AAAA,YAC3D;AAAA,YACA,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,OACE;AAAA,YAEE,gBAAAC,MAAC,WAAM,WAAW,GAAG,UAAU,gBAAgB,EAAE,IAC9C;AAAA;AAAA,cACD,gBAAAD,KAAC,iCAAsB,QAAgB;AAAA,eACzC;AAAA,YAGJ,aAAa,SAAS,eAAe;AAAA,YACrC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YAEC,sBAAY;AAAA;AAAA,cAEX,gBAAAA,KAAC,mBAAiB,2BAAgB;AAAA,gBAElC;AAAA;AAAA,QAEJ;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,qBAAQ;;;AG7Jf,IAAOG,sBAAQ;","names":["cn","cn","jsx","jsx","jsxs","cn","RadioGroup_default"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import { Controller } from 'react-hook-form';\n\nimport { useInput } from '@nextui-org/input';\nimport { Switch as NextSwitch } from '@nextui-org/switch';\n\nimport { useFormContext } from '../hooks';\nimport { FieldCopyTestIdButton } from '../partials/FieldCopyTestIdButton';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport interface SwitchProps {\n /** CSS class name */\n className?: string;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** component displayed next to the switch. */\n label?: React.ReactNode;\n /** name the field is registered under */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Switch component based on [NextUI Switch](https://nextui.org/docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n disabled = false,\n label: _label = undefined,\n name,\n testId: _testId = undefined,\n}: SwitchProps) => {\n const { control, getFieldState } = useFormContext();\n const { error, required, testId, invalid } = getFieldState(name, _testId);\n\n const { label, getInputProps, getHelperWrapperProps, getErrorMessageProps } =\n useInput({\n errorMessage: JSON.stringify(error),\n isInvalid: invalid,\n isRequired: required,\n label: _label,\n labelPlacement: 'outside',\n placeholder: ' ',\n });\n\n return (\n <Controller\n name={name}\n control={control}\n disabled={disabled}\n render={({\n field: { disabled: isDisabled, value, ref, onBlur, onChange },\n }) => (\n <>\n <NextSwitch\n aria-describedby={getInputProps()['aria-describedby']}\n required={required}\n isSelected={!!value}\n className={className}\n classNames={{\n label: `text-bold block text-ellipsis text-small ${invalid ? 'text-danger' : ''}`,\n }}\n data-testid={testId}\n isDisabled={isDisabled}\n value={value}\n onChange={onChange}\n onBlur={onBlur}\n name={name}\n ref={ref}\n >\n {label}\n {!!required && !!_label && (\n <span className=\"!text-danger\">{' \\u002A'}</span>\n )}\n <FieldCopyTestIdButton testId={testId} />\n </NextSwitch>\n {error && (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <div {...getHelperWrapperProps()}>\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n <div {...getErrorMessageProps()}>\n <FieldValidationError error={error} />\n </div>\n </div>\n )}\n </>\n )}\n />\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB;AACzB,SAAS,UAAU,kBAAkB;AAkD7B,mBAmBM,KAlBJ,YADF;AA5BR,IAAM,SAAS,CAAC;AAAA,EACd,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,OAAO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partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport { slugify } from '../../helpers';\n\nexport interface FieldValidationErrorProps {\n error: FieldError[] | Record<string, FieldError[]>;\n testId?: string;\n}\n\n/**\n * Renders a validation error of a field\n */\nconst FieldValidationError = ({\n error,\n testId = undefined,\n}: FieldValidationErrorProps) => {\n if (!error) {\n return null;\n }\n\n let tmp_errors: FieldError[] = [];\n\n if (typeof error === 'object' && !(error instanceof Array)) {\n const error_object = error as Record<string, FieldError[]>;\n Object.keys(error).forEach((key) => {\n tmp_errors = [...tmp_errors, ...error_object[key]];\n });\n }\n\n const errorArray: FieldError[] =\n JSON.stringify(tmp_errors) !== '[]' ? tmp_errors : (error as FieldError[]);\n const errorStrings: string[] = errorArray.map((e) => e.message) as string[];\n const ariaString = `Error: ${errorStrings.join('\\n')}`;\n\n return (\n <ul\n data-testid={slugify(testId || errorStrings.join())}\n aria-label={ariaString} // TODO: ist das richtig @Hannes?\n >\n {errorStrings.map((errorString: string, i: number) => (\n // eslint-disable-next-line react/no-array-index-key\n <li key={`error_${i}`}>\n <div>{errorString}</div>\n </li>\n ))}\n </ul>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport { FieldValidationError };\n\nexport default FieldValidationError;\n"],"mappings":";;;;;AA0CU;AA9BV,IAAM,uBAAuB,CAAC;AAAA,EAC5B;AAAA,EACA,SAAS;AACX,MAAiC;AAC/B,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AAEA,MAAI,aAA2B,CAAC;AAEhC,MAAI,OAAO,UAAU,YAAY,EAAE,iBAAiB,QAAQ;AAC1D,UAAM,eAAe;AACrB,WAAO,KAAK,KAAK,EAAE,QAAQ,CAAC,QAAQ;AAClC,mBAAa,CAAC,GAAG,YAAY,GAAG,aAAa,GAAG,CAAC;AAAA,IACnD,CAAC;AAAA,EACH;AAEA,QAAM,aACJ,KAAK,UAAU,UAAU,MAAM,OAAO,aAAc;AACtD,QAAM,eAAyB,WAAW,IAAI,CAAC,MAAM,EAAE,OAAO;AAC9D,QAAM,aAAa,UAAU,aAAa,KAAK,IAAI,CAAC;AAEpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,QAAQ,UAAU,aAAa,KAAK,CAAC;AAAA,MAClD,cAAY;AAAA,MAEX,uBAAa,IAAI,CAAC,aAAqB;AAAA;AAAA,QAEtC,oBAAC,QACC,8BAAC,SAAK,uBAAY,KADX,SAAS,CAAC,EAEnB;AAAA,OACD;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,+BAAQ;;;AC3Cf,IAAOA,gCAAQ;","names":["FieldValidationError_default"]}