@strictly/react-form 0.0.6 → 0.0.8

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 (77) hide show
  1. package/.out/core/mobx/hooks.d.ts +5 -1
  2. package/.out/core/mobx/hooks.js +13 -3
  3. package/.out/core/mobx/specs/form_presenter.tests.js +3 -6
  4. package/.out/core/mobx/specs/{merge_field_adapters_with_two_way_converter.js → merge_field_adapters_with_two_way_converter.tests.js} +15 -16
  5. package/.out/core/mobx/specs/sub_form_field_adapters.tests.js +127 -12
  6. package/.out/core/mobx/sub_form_field_adapters.d.ts +6 -4
  7. package/.out/core/mobx/sub_form_field_adapters.js +28 -4
  8. package/.out/field_converters/nullable_to_boolean_converter.d.ts +2 -2
  9. package/.out/mantine/create_checkbox.js +1 -0
  10. package/.out/mantine/create_fields_view.d.ts +1 -1
  11. package/.out/mantine/create_fields_view.js +4 -4
  12. package/.out/mantine/create_form.d.ts +1 -1
  13. package/.out/mantine/create_list.d.ts +1 -1
  14. package/.out/mantine/create_pill.d.ts +1 -1
  15. package/.out/mantine/create_radio.d.ts +1 -1
  16. package/.out/mantine/create_radio_group.js +1 -0
  17. package/.out/mantine/create_text_input.js +7 -2
  18. package/.out/mantine/create_value_input.js +1 -0
  19. package/.out/mantine/error_renderer.d.ts +1 -1
  20. package/.out/mantine/error_renderer.js +1 -1
  21. package/.out/mantine/hooks.d.ts +9 -9
  22. package/.out/mantine/specs/checkbox_hooks.stories.d.ts +2 -6
  23. package/.out/mantine/specs/checkbox_hooks.stories.js +4 -16
  24. package/.out/mantine/specs/fields_view_hooks.stories.d.ts +1 -1
  25. package/.out/mantine/specs/fields_view_hooks.stories.js +6 -3
  26. package/.out/mantine/specs/form_hooks.stories.d.ts +2 -2
  27. package/.out/mantine/specs/form_hooks.stories.js +4 -1
  28. package/.out/mantine/specs/radio_group_hooks.stories.d.ts +2 -6
  29. package/.out/mantine/specs/radio_group_hooks.stories.js +5 -17
  30. package/.out/mantine/specs/select_hooks.stories.d.ts +2 -6
  31. package/.out/mantine/specs/select_hooks.stories.js +4 -16
  32. package/.out/mantine/specs/text_input_hooks.stories.d.ts +2 -5
  33. package/.out/mantine/specs/text_input_hooks.stories.js +5 -5
  34. package/.out/mantine/specs/value_input_hooks.stories.d.ts +2 -5
  35. package/.out/mantine/specs/value_input_hooks.stories.js +5 -5
  36. package/.out/mantine/types.d.ts +4 -2
  37. package/.out/tsconfig.tsbuildinfo +1 -1
  38. package/.turbo/turbo-build.log +8 -8
  39. package/.turbo/turbo-check-types.log +1 -1
  40. package/.turbo/turbo-release$colon$exports.log +1 -1
  41. package/core/mobx/hooks.ts +24 -6
  42. package/core/mobx/specs/form_presenter.tests.ts +6 -6
  43. package/core/mobx/specs/{merge_field_adapters_with_two_way_converter.ts → merge_field_adapters_with_two_way_converter.tests.ts} +16 -16
  44. package/core/mobx/specs/sub_form_field_adapters.tests.ts +193 -17
  45. package/core/mobx/sub_form_field_adapters.ts +74 -11
  46. package/dist/index.cjs +77 -32
  47. package/dist/index.d.cts +25 -18
  48. package/dist/index.d.ts +25 -18
  49. package/dist/index.js +68 -21
  50. package/field_converters/nullable_to_boolean_converter.ts +2 -3
  51. package/mantine/create_checkbox.tsx +2 -1
  52. package/mantine/create_fields_view.tsx +17 -14
  53. package/mantine/create_form.tsx +2 -2
  54. package/mantine/create_list.tsx +1 -1
  55. package/mantine/create_pill.tsx +1 -1
  56. package/mantine/create_radio.tsx +1 -1
  57. package/mantine/create_radio_group.tsx +6 -2
  58. package/mantine/create_text_input.tsx +9 -3
  59. package/mantine/create_value_input.tsx +2 -1
  60. package/mantine/error_renderer.ts +1 -1
  61. package/mantine/hooks.tsx +19 -14
  62. package/mantine/specs/__snapshots__/checkbox_hooks.tests.tsx.snap +1 -64
  63. package/mantine/specs/__snapshots__/fields_view_hooks.tests.tsx.snap +52 -52
  64. package/mantine/specs/__snapshots__/radio_group_hooks.tests.tsx.snap +1 -179
  65. package/mantine/specs/__snapshots__/select_hooks.tests.tsx.snap +1 -83
  66. package/mantine/specs/__snapshots__/text_input_hooks.tests.tsx.snap +27 -27
  67. package/mantine/specs/__snapshots__/value_input_hooks.tests.tsx.snap +31 -31
  68. package/mantine/specs/checkbox_hooks.stories.tsx +5 -21
  69. package/mantine/specs/fields_view_hooks.stories.tsx +16 -4
  70. package/mantine/specs/form_hooks.stories.tsx +10 -3
  71. package/mantine/specs/radio_group_hooks.stories.tsx +6 -20
  72. package/mantine/specs/select_hooks.stories.tsx +5 -21
  73. package/mantine/specs/text_input_hooks.stories.tsx +5 -8
  74. package/mantine/specs/value_input_hooks.stories.tsx +5 -8
  75. package/mantine/types.ts +7 -3
  76. package/package.json +2 -1
  77. /package/.out/core/mobx/specs/{merge_field_adapters_with_two_way_converter.d.ts → merge_field_adapters_with_two_way_converter.tests.d.ts} +0 -0
@@ -1,183 +1,5 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`mantine radio group hooks > renders CustomError 1`] = `
4
- <div>
5
- <style
6
- data-mantine-styles="classes"
7
- >
8
- @media (max-width: 35.99375em) {.mantine-visible-from-xs {display: none !important;}}@media (min-width: 36em) {.mantine-hidden-from-xs {display: none !important;}}@media (max-width: 47.99375em) {.mantine-visible-from-sm {display: none !important;}}@media (min-width: 48em) {.mantine-hidden-from-sm {display: none !important;}}@media (max-width: 61.99375em) {.mantine-visible-from-md {display: none !important;}}@media (min-width: 62em) {.mantine-hidden-from-md {display: none !important;}}@media (max-width: 74.99375em) {.mantine-visible-from-lg {display: none !important;}}@media (min-width: 75em) {.mantine-hidden-from-lg {display: none !important;}}@media (max-width: 87.99375em) {.mantine-visible-from-xl {display: none !important;}}@media (min-width: 88em) {.mantine-hidden-from-xl {display: none !important;}}
9
- </style>
10
- <div
11
- class="m_46b77525 mantine-InputWrapper-root mantine-RadioGroup-root"
12
- data-error="true"
13
- >
14
- <div
15
- class="m_8fdc1311 mantine-InputWrapper-label mantine-RadioGroup-label"
16
- id="mantine-1fu8n1fu8-label"
17
- >
18
- Radio Group
19
- </div>
20
- <div
21
- aria-describedby="mantine-1fu8n1fu8-error"
22
- aria-labelledby="mantine-1fu8n1fu8-label"
23
- role="radiogroup"
24
- >
25
- <div
26
- class="m_6d731127 mantine-Stack-root"
27
- style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
28
- >
29
- <div
30
- class="m_f3f1af94 mantine-Radio-root m_5f75b09e mantine-Radio-root"
31
- data-label-position="right"
32
- style="--radio-color: var(--mantine-color-blue-filled);"
33
- >
34
- <div
35
- class="m_5f6e695e mantine-Radio-body"
36
- >
37
- <div
38
- class="m_89c4f5e4 mantine-Radio-inner"
39
- data-label-position="right"
40
- >
41
- <input
42
- class="mantine-focus-auto m_8a3dbb89 mantine-Radio-radio"
43
- id="mantine-0cyk5rcyk"
44
- name="$"
45
- type="radio"
46
- value="1"
47
- />
48
- <svg
49
- aria-hidden="true"
50
- class="m_f3ed6b2b mantine-Radio-icon"
51
- fill="none"
52
- viewBox="0 0 5 5"
53
- xmlns="http://www.w3.org/2000/svg"
54
- >
55
- <circle
56
- cx="2.5"
57
- cy="2.5"
58
- fill="currentColor"
59
- r="2.5"
60
- />
61
- </svg>
62
- </div>
63
- <div
64
- class="m_d3ea56bb mantine-Radio-labelWrapper"
65
- >
66
- <label
67
- class="m_8ee546b8 mantine-Radio-label"
68
- for="mantine-0cyk5rcyk"
69
- >
70
- One
71
- </label>
72
- </div>
73
- </div>
74
- </div>
75
- <div
76
- class="m_f3f1af94 mantine-Radio-root m_5f75b09e mantine-Radio-root"
77
- data-checked="true"
78
- data-label-position="right"
79
- style="--radio-color: var(--mantine-color-blue-filled);"
80
- >
81
- <div
82
- class="m_5f6e695e mantine-Radio-body"
83
- >
84
- <div
85
- class="m_89c4f5e4 mantine-Radio-inner"
86
- data-label-position="right"
87
- >
88
- <input
89
- checked=""
90
- class="mantine-focus-auto m_8a3dbb89 mantine-Radio-radio"
91
- id="mantine-0px4bipx4"
92
- name="$"
93
- type="radio"
94
- value="2"
95
- />
96
- <svg
97
- aria-hidden="true"
98
- class="m_f3ed6b2b mantine-Radio-icon"
99
- fill="none"
100
- viewBox="0 0 5 5"
101
- xmlns="http://www.w3.org/2000/svg"
102
- >
103
- <circle
104
- cx="2.5"
105
- cy="2.5"
106
- fill="currentColor"
107
- r="2.5"
108
- />
109
- </svg>
110
- </div>
111
- <div
112
- class="m_d3ea56bb mantine-Radio-labelWrapper"
113
- >
114
- <label
115
- class="m_8ee546b8 mantine-Radio-label"
116
- for="mantine-0px4bipx4"
117
- >
118
- Two
119
- </label>
120
- </div>
121
- </div>
122
- </div>
123
- <div
124
- class="m_f3f1af94 mantine-Radio-root m_5f75b09e mantine-Radio-root"
125
- data-label-position="right"
126
- style="--radio-color: var(--mantine-color-blue-filled);"
127
- >
128
- <div
129
- class="m_5f6e695e mantine-Radio-body"
130
- >
131
- <div
132
- class="m_89c4f5e4 mantine-Radio-inner"
133
- data-label-position="right"
134
- >
135
- <input
136
- class="mantine-focus-auto m_8a3dbb89 mantine-Radio-radio"
137
- id="mantine-12voha2vo"
138
- name="$"
139
- type="radio"
140
- value="3"
141
- />
142
- <svg
143
- aria-hidden="true"
144
- class="m_f3ed6b2b mantine-Radio-icon"
145
- fill="none"
146
- viewBox="0 0 5 5"
147
- xmlns="http://www.w3.org/2000/svg"
148
- >
149
- <circle
150
- cx="2.5"
151
- cy="2.5"
152
- fill="currentColor"
153
- r="2.5"
154
- />
155
- </svg>
156
- </div>
157
- <div
158
- class="m_d3ea56bb mantine-Radio-labelWrapper"
159
- >
160
- <label
161
- class="m_8ee546b8 mantine-Radio-label"
162
- for="mantine-12voha2vo"
163
- >
164
- Three
165
- </label>
166
- </div>
167
- </div>
168
- </div>
169
- </div>
170
- </div>
171
- <p
172
- class="m_8f816625 mantine-InputWrapper-error mantine-RadioGroup-error"
173
- id="mantine-1fu8n1fu8-error"
174
- >
175
- custom error
176
- </p>
177
- </div>
178
- </div>
179
- `;
180
-
181
3
  exports[`mantine radio group hooks > renders Disabled 1`] = `
182
4
  <div>
183
5
  <style
@@ -697,7 +519,7 @@ exports[`mantine radio group hooks > renders Error 1`] = `
697
519
  class="m_8f816625 mantine-InputWrapper-error mantine-RadioGroup-error"
698
520
  id="mantine-1fu8n1fu8-error"
699
521
  >
700
- error
522
+ custom error error
701
523
  </p>
702
524
  </div>
703
525
  </div>
@@ -1,87 +1,5 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`mantine select hooks > renders CustomErrorSelect 1`] = `
4
- <div>
5
- <style
6
- data-mantine-styles="classes"
7
- >
8
- @media (max-width: 35.99375em) {.mantine-visible-from-xs {display: none !important;}}@media (min-width: 36em) {.mantine-hidden-from-xs {display: none !important;}}@media (max-width: 47.99375em) {.mantine-visible-from-sm {display: none !important;}}@media (min-width: 48em) {.mantine-hidden-from-sm {display: none !important;}}@media (max-width: 61.99375em) {.mantine-visible-from-md {display: none !important;}}@media (min-width: 62em) {.mantine-hidden-from-md {display: none !important;}}@media (max-width: 74.99375em) {.mantine-visible-from-lg {display: none !important;}}@media (min-width: 75em) {.mantine-hidden-from-lg {display: none !important;}}@media (max-width: 87.99375em) {.mantine-visible-from-xl {display: none !important;}}@media (min-width: 88em) {.mantine-hidden-from-xl {display: none !important;}}
9
- </style>
10
- <div
11
- class="m_46b77525 mantine-InputWrapper-root mantine-Select-root"
12
- data-error="true"
13
- >
14
- <label
15
- class="m_8fdc1311 mantine-InputWrapper-label mantine-Select-label"
16
- data-required="true"
17
- for="mantine-12voha2vo"
18
- id="mantine-12voha2vo-label"
19
- >
20
- Select
21
- <span
22
- aria-hidden="true"
23
- class="m_78a94662 mantine-InputWrapper-required mantine-Select-required"
24
- >
25
- *
26
- </span>
27
- </label>
28
- <div
29
- class="m_6c018570 mantine-Input-wrapper mantine-Select-wrapper"
30
- data-error="true"
31
- data-pointer="true"
32
- data-variant="default"
33
- data-with-right-section="true"
34
- style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2); --input-right-section-pointer-events: none;"
35
- >
36
- <input
37
- aria-describedby="mantine-12voha2vo-error"
38
- aria-haspopup="listbox"
39
- aria-invalid="true"
40
- autocomplete="off"
41
- class="m_8fb7ebe7 mantine-Input-input mantine-Select-input"
42
- data-error="true"
43
- data-variant="default"
44
- id="mantine-12voha2vo"
45
- readonly=""
46
- required=""
47
- value="c"
48
- />
49
- <div
50
- class="m_82577fc2 mantine-Input-section mantine-Select-section"
51
- data-position="right"
52
- >
53
- <svg
54
- class="m_2943220b mantine-ComboboxChevron-chevron"
55
- data-combobox-chevron="true"
56
- data-error="[object Object]"
57
- fill="none"
58
- viewBox="0 0 15 15"
59
- xmlns="http://www.w3.org/2000/svg"
60
- >
61
- <path
62
- clip-rule="evenodd"
63
- d="M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z"
64
- fill="currentColor"
65
- fill-rule="evenodd"
66
- />
67
- </svg>
68
- </div>
69
- </div>
70
- <p
71
- class="m_8f816625 mantine-InputWrapper-error mantine-Select-error"
72
- id="mantine-12voha2vo-error"
73
- >
74
- custom error
75
- </p>
76
- </div>
77
- <input
78
- name="$"
79
- type="hidden"
80
- value="c"
81
- />
82
- </div>
83
- `;
84
-
85
3
  exports[`mantine select hooks > renders DisabledSelect 1`] = `
86
4
  <div>
87
5
  <style
@@ -275,7 +193,7 @@ exports[`mantine select hooks > renders InvalidSelect 1`] = `
275
193
  class="m_8f816625 mantine-InputWrapper-error mantine-Select-error"
276
194
  id="mantine-12voha2vo-error"
277
195
  >
278
- invalid option
196
+ Error invalid option
279
197
  </p>
280
198
  </div>
281
199
  <input
@@ -1,6 +1,6 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`mantine checkbox hooks > renders CustomError 1`] = `
3
+ exports[`mantine checkbox hooks > renders Disabled 1`] = `
4
4
  <div>
5
5
  <style
6
6
  data-mantine-styles="classes"
@@ -9,7 +9,6 @@ exports[`mantine checkbox hooks > renders CustomError 1`] = `
9
9
  </style>
10
10
  <div
11
11
  class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
12
- data-error="true"
13
12
  >
14
13
  <label
15
14
  class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
@@ -20,32 +19,25 @@ exports[`mantine checkbox hooks > renders CustomError 1`] = `
20
19
  </label>
21
20
  <div
22
21
  class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
23
- data-error="true"
22
+ data-disabled="true"
24
23
  data-variant="default"
25
- style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2);"
26
24
  >
27
25
  <input
28
- aria-describedby="mantine-0cyk5rcyk-error"
29
- aria-invalid="true"
26
+ aria-invalid="false"
30
27
  class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
31
- data-error="true"
28
+ data-disabled="true"
32
29
  data-variant="default"
30
+ disabled=""
33
31
  id="mantine-0cyk5rcyk"
34
32
  name="$"
35
33
  value="xxx"
36
34
  />
37
35
  </div>
38
- <p
39
- class="m_8f816625 mantine-InputWrapper-error mantine-TextInput-error"
40
- id="mantine-0cyk5rcyk-error"
41
- >
42
- custom error
43
- </p>
44
36
  </div>
45
37
  </div>
46
38
  `;
47
39
 
48
- exports[`mantine checkbox hooks > renders Disabled 1`] = `
40
+ exports[`mantine checkbox hooks > renders Empty 1`] = `
49
41
  <div>
50
42
  <style
51
43
  data-mantine-styles="classes"
@@ -57,32 +49,29 @@ exports[`mantine checkbox hooks > renders Disabled 1`] = `
57
49
  >
58
50
  <label
59
51
  class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
60
- for="mantine-0cyk5rcyk"
61
- id="mantine-0cyk5rcyk-label"
52
+ for="mantine-0px4bipx4"
53
+ id="mantine-0px4bipx4-label"
62
54
  >
63
55
  Text Input
64
56
  </label>
65
57
  <div
66
58
  class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
67
- data-disabled="true"
68
59
  data-variant="default"
69
60
  >
70
61
  <input
71
62
  aria-invalid="false"
72
63
  class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
73
- data-disabled="true"
74
64
  data-variant="default"
75
- disabled=""
76
- id="mantine-0cyk5rcyk"
65
+ id="mantine-0px4bipx4"
77
66
  name="$"
78
- value="xxx"
67
+ value=""
79
68
  />
80
69
  </div>
81
70
  </div>
82
71
  </div>
83
72
  `;
84
73
 
85
- exports[`mantine checkbox hooks > renders Empty 1`] = `
74
+ exports[`mantine checkbox hooks > renders Error 1`] = `
86
75
  <div>
87
76
  <style
88
77
  data-mantine-styles="classes"
@@ -91,27 +80,38 @@ exports[`mantine checkbox hooks > renders Empty 1`] = `
91
80
  </style>
92
81
  <div
93
82
  class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
83
+ data-error="true"
94
84
  >
95
85
  <label
96
86
  class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
97
- for="mantine-0px4bipx4"
98
- id="mantine-0px4bipx4-label"
87
+ for="mantine-0cyk5rcyk"
88
+ id="mantine-0cyk5rcyk-label"
99
89
  >
100
90
  Text Input
101
91
  </label>
102
92
  <div
103
93
  class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
94
+ data-error="true"
104
95
  data-variant="default"
96
+ style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2);"
105
97
  >
106
98
  <input
107
- aria-invalid="false"
99
+ aria-describedby="mantine-0cyk5rcyk-error"
100
+ aria-invalid="true"
108
101
  class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
102
+ data-error="true"
109
103
  data-variant="default"
110
- id="mantine-0px4bipx4"
104
+ id="mantine-0cyk5rcyk"
111
105
  name="$"
112
- value=""
106
+ value="xxx"
113
107
  />
114
108
  </div>
109
+ <p
110
+ class="m_8f816625 mantine-InputWrapper-error mantine-TextInput-error"
111
+ id="mantine-0cyk5rcyk-error"
112
+ >
113
+ error error
114
+ </p>
115
115
  </div>
116
116
  </div>
117
117
  `;
@@ -335,7 +335,7 @@ exports[`mantine value input hooks > renders AnSlider 1`] = `
335
335
  </div>
336
336
  `;
337
337
 
338
- exports[`mantine value input hooks > renders CustomErrorNumberInput 1`] = `
338
+ exports[`mantine value input hooks > renders DisabledNumberInput 1`] = `
339
339
  <div>
340
340
  <style
341
341
  data-mantine-styles="classes"
@@ -344,7 +344,6 @@ exports[`mantine value input hooks > renders CustomErrorNumberInput 1`] = `
344
344
  </style>
345
345
  <div
346
346
  class="m_e2f5cd4e m_46b77525 mantine-InputWrapper-root mantine-NumberInput-root"
347
- data-error="true"
348
347
  >
349
348
  <label
350
349
  class="m_8fdc1311 mantine-InputWrapper-label mantine-NumberInput-label"
@@ -355,17 +354,17 @@ exports[`mantine value input hooks > renders CustomErrorNumberInput 1`] = `
355
354
  </label>
356
355
  <div
357
356
  class="m_6c018570 mantine-Input-wrapper mantine-NumberInput-wrapper"
358
- data-error="true"
357
+ data-disabled="true"
359
358
  data-variant="default"
360
359
  data-with-right-section="true"
361
- style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2); --input-right-section-width: var(--ni-right-section-width-sm);"
360
+ style="--input-right-section-width: var(--ni-right-section-width-sm); --input-right-section-pointer-events: none;"
362
361
  >
363
362
  <input
364
- aria-describedby="mantine-0cyk5rcyk-error"
365
- aria-invalid="true"
363
+ aria-invalid="false"
366
364
  class="m_8fb7ebe7 mantine-Input-input mantine-NumberInput-input"
367
- data-error="true"
365
+ data-disabled="true"
368
366
  data-variant="default"
367
+ disabled=""
369
368
  id="mantine-0cyk5rcyk"
370
369
  inputmode="numeric"
371
370
  name="$"
@@ -383,6 +382,7 @@ exports[`mantine value input hooks > renders CustomErrorNumberInput 1`] = `
383
382
  aria-hidden="true"
384
383
  class="mantine-focus-auto m_80b4b171 mantine-NumberInput-control m_87cf2631 mantine-UnstyledButton-root"
385
384
  data-direction="up"
385
+ disabled=""
386
386
  tabindex="-1"
387
387
  type="button"
388
388
  >
@@ -404,6 +404,7 @@ exports[`mantine value input hooks > renders CustomErrorNumberInput 1`] = `
404
404
  aria-hidden="true"
405
405
  class="mantine-focus-auto m_80b4b171 mantine-NumberInput-control m_87cf2631 mantine-UnstyledButton-root"
406
406
  data-direction="down"
407
+ disabled=""
407
408
  tabindex="-1"
408
409
  type="button"
409
410
  >
@@ -423,17 +424,11 @@ exports[`mantine value input hooks > renders CustomErrorNumberInput 1`] = `
423
424
  </div>
424
425
  </div>
425
426
  </div>
426
- <p
427
- class="m_8f816625 mantine-InputWrapper-error mantine-NumberInput-error"
428
- id="mantine-0cyk5rcyk-error"
429
- >
430
- a custom error
431
- </p>
432
427
  </div>
433
428
  </div>
434
429
  `;
435
430
 
436
- exports[`mantine value input hooks > renders DisabledNumberInput 1`] = `
431
+ exports[`mantine value input hooks > renders EmptyNumberInput 1`] = `
437
432
  <div>
438
433
  <style
439
434
  data-mantine-styles="classes"
@@ -445,29 +440,26 @@ exports[`mantine value input hooks > renders DisabledNumberInput 1`] = `
445
440
  >
446
441
  <label
447
442
  class="m_8fdc1311 mantine-InputWrapper-label mantine-NumberInput-label"
448
- for="mantine-0cyk5rcyk"
449
- id="mantine-0cyk5rcyk-label"
443
+ for="mantine-0px4bipx4"
444
+ id="mantine-0px4bipx4-label"
450
445
  >
451
446
  Number Input
452
447
  </label>
453
448
  <div
454
449
  class="m_6c018570 mantine-Input-wrapper mantine-NumberInput-wrapper"
455
- data-disabled="true"
456
450
  data-variant="default"
457
451
  data-with-right-section="true"
458
- style="--input-right-section-width: var(--ni-right-section-width-sm); --input-right-section-pointer-events: none;"
452
+ style="--input-right-section-width: var(--ni-right-section-width-sm);"
459
453
  >
460
454
  <input
461
455
  aria-invalid="false"
462
456
  class="m_8fb7ebe7 mantine-Input-input mantine-NumberInput-input"
463
- data-disabled="true"
464
457
  data-variant="default"
465
- disabled=""
466
- id="mantine-0cyk5rcyk"
458
+ id="mantine-0px4bipx4"
467
459
  inputmode="numeric"
468
460
  name="$"
469
461
  type="text"
470
- value="3"
462
+ value=""
471
463
  />
472
464
  <div
473
465
  class="m_82577fc2 mantine-Input-section mantine-NumberInput-section"
@@ -480,7 +472,6 @@ exports[`mantine value input hooks > renders DisabledNumberInput 1`] = `
480
472
  aria-hidden="true"
481
473
  class="mantine-focus-auto m_80b4b171 mantine-NumberInput-control m_87cf2631 mantine-UnstyledButton-root"
482
474
  data-direction="up"
483
- disabled=""
484
475
  tabindex="-1"
485
476
  type="button"
486
477
  >
@@ -502,7 +493,6 @@ exports[`mantine value input hooks > renders DisabledNumberInput 1`] = `
502
493
  aria-hidden="true"
503
494
  class="mantine-focus-auto m_80b4b171 mantine-NumberInput-control m_87cf2631 mantine-UnstyledButton-root"
504
495
  data-direction="down"
505
- disabled=""
506
496
  tabindex="-1"
507
497
  type="button"
508
498
  >
@@ -526,7 +516,7 @@ exports[`mantine value input hooks > renders DisabledNumberInput 1`] = `
526
516
  </div>
527
517
  `;
528
518
 
529
- exports[`mantine value input hooks > renders EmptyNumberInput 1`] = `
519
+ exports[`mantine value input hooks > renders ErrorNumberInput 1`] = `
530
520
  <div>
531
521
  <style
532
522
  data-mantine-styles="classes"
@@ -535,29 +525,33 @@ exports[`mantine value input hooks > renders EmptyNumberInput 1`] = `
535
525
  </style>
536
526
  <div
537
527
  class="m_e2f5cd4e m_46b77525 mantine-InputWrapper-root mantine-NumberInput-root"
528
+ data-error="true"
538
529
  >
539
530
  <label
540
531
  class="m_8fdc1311 mantine-InputWrapper-label mantine-NumberInput-label"
541
- for="mantine-0px4bipx4"
542
- id="mantine-0px4bipx4-label"
532
+ for="mantine-0cyk5rcyk"
533
+ id="mantine-0cyk5rcyk-label"
543
534
  >
544
535
  Number Input
545
536
  </label>
546
537
  <div
547
538
  class="m_6c018570 mantine-Input-wrapper mantine-NumberInput-wrapper"
539
+ data-error="true"
548
540
  data-variant="default"
549
541
  data-with-right-section="true"
550
- style="--input-right-section-width: var(--ni-right-section-width-sm);"
542
+ style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2); --input-right-section-width: var(--ni-right-section-width-sm);"
551
543
  >
552
544
  <input
553
- aria-invalid="false"
545
+ aria-describedby="mantine-0cyk5rcyk-error"
546
+ aria-invalid="true"
554
547
  class="m_8fb7ebe7 mantine-Input-input mantine-NumberInput-input"
548
+ data-error="true"
555
549
  data-variant="default"
556
- id="mantine-0px4bipx4"
550
+ id="mantine-0cyk5rcyk"
557
551
  inputmode="numeric"
558
552
  name="$"
559
553
  type="text"
560
- value=""
554
+ value="3"
561
555
  />
562
556
  <div
563
557
  class="m_82577fc2 mantine-Input-section mantine-NumberInput-section"
@@ -610,6 +604,12 @@ exports[`mantine value input hooks > renders EmptyNumberInput 1`] = `
610
604
  </div>
611
605
  </div>
612
606
  </div>
607
+ <p
608
+ class="m_8f816625 mantine-InputWrapper-error mantine-NumberInput-error"
609
+ id="mantine-0cyk5rcyk-error"
610
+ >
611
+ error an error
612
+ </p>
613
613
  </div>
614
614
  </div>
615
615
  `;
@@ -4,19 +4,19 @@ import {
4
4
  type StoryObj,
5
5
  } from '@storybook/react'
6
6
  import { type FieldsViewProps } from 'core/props'
7
- import { type ErrorRenderer } from 'mantine/error_renderer'
8
7
  import { useMantineFormFields } from 'mantine/hooks'
9
8
  import { type Field } from 'types/field'
10
9
  import { CHECKBOX_LABEL } from './checkbox_constants'
11
10
 
11
+ function ErrorRenderer({ error }: { error: string }) {
12
+ return `Error ${error}`
13
+ }
14
+
12
15
  function Component({
13
- ErrorRenderer,
14
16
  ...props
15
17
  }: FieldsViewProps<{
16
18
  $: Field<boolean, string>,
17
- }> & {
18
- ErrorRenderer?: ErrorRenderer,
19
- }) {
19
+ }>) {
20
20
  const inputProps = useMantineFormFields(props)
21
21
  const CheckboxComponent = inputProps.checkbox('$')
22
22
  return (
@@ -101,19 +101,3 @@ export const Error: Story = {
101
101
  },
102
102
  },
103
103
  }
104
-
105
- export const CustomError: Story = {
106
- args: {
107
- fields: {
108
- $: {
109
- readonly: false,
110
- required: false,
111
- value: true,
112
- error: 'error',
113
- },
114
- },
115
- ErrorRenderer: function () {
116
- return 'custom error'
117
- },
118
- },
119
- }