@strictly/react-form 0.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 (239) hide show
  1. package/.eslintrc.cjs +26 -0
  2. package/.out/.storybook/main.d.ts +3 -0
  3. package/.out/.storybook/main.js +32 -0
  4. package/.out/.storybook/preview.d.ts +4 -0
  5. package/.out/.storybook/preview.js +20 -0
  6. package/.out/.vitest/install_deterministic_random.d.ts +2 -0
  7. package/.out/.vitest/install_deterministic_random.js +15 -0
  8. package/.out/.vitest/install_storybook_preview.d.ts +1 -0
  9. package/.out/.vitest/install_storybook_preview.js +7 -0
  10. package/.out/.vitest/match_media.d.ts +1 -0
  11. package/.out/.vitest/match_media.js +5 -0
  12. package/.out/.vitest/resize_observer.d.ts +1 -0
  13. package/.out/.vitest/resize_observer.js +4 -0
  14. package/.out/core/mobx/field_adapter.d.ts +9 -0
  15. package/.out/core/mobx/field_adapter.js +1 -0
  16. package/.out/core/mobx/field_adapter_builder.d.ts +22 -0
  17. package/.out/core/mobx/field_adapter_builder.js +56 -0
  18. package/.out/core/mobx/flattened_adapters_of_fields.d.ts +9 -0
  19. package/.out/core/mobx/flattened_adapters_of_fields.js +1 -0
  20. package/.out/core/mobx/flattened_list_type_defs_of.d.ts +8 -0
  21. package/.out/core/mobx/flattened_list_type_defs_of.js +1 -0
  22. package/.out/core/mobx/form_presenter.d.ts +61 -0
  23. package/.out/core/mobx/form_presenter.js +425 -0
  24. package/.out/core/mobx/specs/flattened_adapters_of_fields.tests.d.ts +1 -0
  25. package/.out/core/mobx/specs/flattened_adapters_of_fields.tests.js +13 -0
  26. package/.out/core/mobx/specs/flattened_list_type_defs_of.tests.d.ts +1 -0
  27. package/.out/core/mobx/specs/flattened_list_type_defs_of.tests.js +16 -0
  28. package/.out/core/mobx/specs/form_presenter.tests.d.ts +1 -0
  29. package/.out/core/mobx/specs/form_presenter.tests.js +697 -0
  30. package/.out/core/mobx/types.d.ts +19 -0
  31. package/.out/core/mobx/types.js +1 -0
  32. package/.out/core/props.d.ts +12 -0
  33. package/.out/core/props.js +1 -0
  34. package/.out/field_converters/chain_field_converter.d.ts +3 -0
  35. package/.out/field_converters/chain_field_converter.js +46 -0
  36. package/.out/field_converters/identity_converter.d.ts +3 -0
  37. package/.out/field_converters/identity_converter.js +14 -0
  38. package/.out/field_converters/integer_to_string_converter.d.ts +7 -0
  39. package/.out/field_converters/integer_to_string_converter.js +26 -0
  40. package/.out/field_converters/list_converter.d.ts +2 -0
  41. package/.out/field_converters/list_converter.js +8 -0
  42. package/.out/field_converters/maybe_identity_converter.d.ts +8 -0
  43. package/.out/field_converters/maybe_identity_converter.js +15 -0
  44. package/.out/field_converters/nullable_to_boolean_converter.d.ts +11 -0
  45. package/.out/field_converters/nullable_to_boolean_converter.js +31 -0
  46. package/.out/field_converters/select_value_type_converter.d.ts +23 -0
  47. package/.out/field_converters/select_value_type_converter.js +60 -0
  48. package/.out/field_converters/trimming_string_converter.d.ts +6 -0
  49. package/.out/field_converters/trimming_string_converter.js +14 -0
  50. package/.out/field_converters/validating_converter.d.ts +3 -0
  51. package/.out/field_converters/validating_converter.js +21 -0
  52. package/.out/field_validators/minimum_string_length_field_validator.d.ts +2 -0
  53. package/.out/field_validators/minimum_string_length_field_validator.js +8 -0
  54. package/.out/field_value_factories/prototyping_field_value_factory.d.ts +2 -0
  55. package/.out/field_value_factories/prototyping_field_value_factory.js +5 -0
  56. package/.out/index.d.ts +16 -0
  57. package/.out/index.js +16 -0
  58. package/.out/mantine/create_checkbox.d.ts +9 -0
  59. package/.out/mantine/create_checkbox.js +37 -0
  60. package/.out/mantine/create_list.d.ts +15 -0
  61. package/.out/mantine/create_list.js +16 -0
  62. package/.out/mantine/create_pill.d.ts +7 -0
  63. package/.out/mantine/create_pill.js +15 -0
  64. package/.out/mantine/create_radio.d.ts +8 -0
  65. package/.out/mantine/create_radio.js +10 -0
  66. package/.out/mantine/create_radio_group.d.ts +9 -0
  67. package/.out/mantine/create_radio_group.js +34 -0
  68. package/.out/mantine/create_text_input.d.ts +19 -0
  69. package/.out/mantine/create_text_input.js +38 -0
  70. package/.out/mantine/create_value_input.d.ts +17 -0
  71. package/.out/mantine/create_value_input.js +38 -0
  72. package/.out/mantine/hooks.d.ts +56 -0
  73. package/.out/mantine/hooks.js +135 -0
  74. package/.out/mantine/specs/checkbox_constants.d.ts +1 -0
  75. package/.out/mantine/specs/checkbox_constants.js +1 -0
  76. package/.out/mantine/specs/checkbox_hooks.stories.d.ts +13 -0
  77. package/.out/mantine/specs/checkbox_hooks.stories.js +63 -0
  78. package/.out/mantine/specs/checkbox_hooks.tests.d.ts +1 -0
  79. package/.out/mantine/specs/checkbox_hooks.tests.js +74 -0
  80. package/.out/mantine/specs/list_hooks.stories.d.ts +11 -0
  81. package/.out/mantine/specs/list_hooks.stories.js +48 -0
  82. package/.out/mantine/specs/list_hooks.tests.d.ts +1 -0
  83. package/.out/mantine/specs/list_hooks.tests.js +12 -0
  84. package/.out/mantine/specs/radio_group_constants.d.ts +4 -0
  85. package/.out/mantine/specs/radio_group_constants.js +11 -0
  86. package/.out/mantine/specs/radio_group_hooks.stories.d.ts +14 -0
  87. package/.out/mantine/specs/radio_group_hooks.stories.js +68 -0
  88. package/.out/mantine/specs/radio_group_hooks.tests.d.ts +1 -0
  89. package/.out/mantine/specs/radio_group_hooks.tests.js +62 -0
  90. package/.out/mantine/specs/select_hooks.stories.d.ts +12 -0
  91. package/.out/mantine/specs/select_hooks.stories.js +57 -0
  92. package/.out/mantine/specs/select_hooks.tests.d.ts +1 -0
  93. package/.out/mantine/specs/select_hooks.tests.js +12 -0
  94. package/.out/mantine/specs/select_hooks_constant.d.ts +1 -0
  95. package/.out/mantine/specs/select_hooks_constant.js +1 -0
  96. package/.out/mantine/specs/text_input_constants.d.ts +1 -0
  97. package/.out/mantine/specs/text_input_constants.js +1 -0
  98. package/.out/mantine/specs/text_input_hooks.stories.d.ts +21 -0
  99. package/.out/mantine/specs/text_input_hooks.stories.js +88 -0
  100. package/.out/mantine/specs/text_input_hooks.tests.d.ts +1 -0
  101. package/.out/mantine/specs/text_input_hooks.tests.js +79 -0
  102. package/.out/mantine/specs/value_input_constants.d.ts +2 -0
  103. package/.out/mantine/specs/value_input_constants.js +2 -0
  104. package/.out/mantine/specs/value_input_hooks.stories.d.ts +23 -0
  105. package/.out/mantine/specs/value_input_hooks.stories.js +124 -0
  106. package/.out/mantine/specs/value_input_hooks.tests.d.ts +1 -0
  107. package/.out/mantine/specs/value_input_hooks.tests.js +12 -0
  108. package/.out/mantine/types.d.ts +11 -0
  109. package/.out/mantine/types.js +1 -0
  110. package/.out/tsconfig.json +27 -0
  111. package/.out/tsconfig.tsbuildinfo +1 -0
  112. package/.out/tsup.config.d.ts +3 -0
  113. package/.out/tsup.config.js +12 -0
  114. package/.out/types/all_fields_of_fields.d.ts +5 -0
  115. package/.out/types/all_fields_of_fields.js +1 -0
  116. package/.out/types/boolean_fields_of_fields.d.ts +5 -0
  117. package/.out/types/boolean_fields_of_fields.js +1 -0
  118. package/.out/types/error_type_of_field.d.ts +2 -0
  119. package/.out/types/error_type_of_field.js +1 -0
  120. package/.out/types/field.d.ts +7 -0
  121. package/.out/types/field.js +1 -0
  122. package/.out/types/field_converters.d.ts +29 -0
  123. package/.out/types/field_converters.js +5 -0
  124. package/.out/types/field_validator.d.ts +3 -0
  125. package/.out/types/field_validator.js +1 -0
  126. package/.out/types/flattened_form_fields_of.d.ts +9 -0
  127. package/.out/types/flattened_form_fields_of.js +1 -0
  128. package/.out/types/list_fields_of_fields.d.ts +5 -0
  129. package/.out/types/list_fields_of_fields.js +1 -0
  130. package/.out/types/specs/boolean_fields_of_fields.tests.d.ts +1 -0
  131. package/.out/types/specs/boolean_fields_of_fields.tests.js +11 -0
  132. package/.out/types/specs/error_type_of_field.tests.d.ts +1 -0
  133. package/.out/types/specs/error_type_of_field.tests.js +7 -0
  134. package/.out/types/specs/flattened_form_fields_of.tests.d.ts +1 -0
  135. package/.out/types/specs/flattened_form_fields_of.tests.js +13 -0
  136. package/.out/types/specs/string_fields_of_fields.tests.d.ts +1 -0
  137. package/.out/types/specs/string_fields_of_fields.tests.js +19 -0
  138. package/.out/types/specs/value_type_of_field.tests.d.ts +1 -0
  139. package/.out/types/specs/value_type_of_field.tests.js +7 -0
  140. package/.out/types/string_fields_of_fields.d.ts +5 -0
  141. package/.out/types/string_fields_of_fields.js +1 -0
  142. package/.out/types/value_type_of_field.d.ts +2 -0
  143. package/.out/types/value_type_of_field.js +1 -0
  144. package/.out/util/partial.d.ts +11 -0
  145. package/.out/util/partial.js +74 -0
  146. package/.out/vitest.workspace.d.ts +2 -0
  147. package/.out/vitest.workspace.js +22 -0
  148. package/.storybook/main.ts +40 -0
  149. package/.storybook/preview.tsx +28 -0
  150. package/.storybook/vite.config.mts +38 -0
  151. package/.turbo/turbo-build.log +18 -0
  152. package/.turbo/turbo-check-types.log +3 -0
  153. package/.turbo/turbo-release$colon$exports.log +3 -0
  154. package/.vitest/install_deterministic_random.ts +17 -0
  155. package/.vitest/install_storybook_preview.ts +9 -0
  156. package/.vitest/match_media.ts +7 -0
  157. package/.vitest/resize_observer.ts +5 -0
  158. package/README.md +2 -0
  159. package/core/mobx/field_adapter.ts +32 -0
  160. package/core/mobx/field_adapter_builder.ts +313 -0
  161. package/core/mobx/flattened_adapters_of_fields.ts +35 -0
  162. package/core/mobx/flattened_list_type_defs_of.ts +17 -0
  163. package/core/mobx/form_presenter.ts +705 -0
  164. package/core/mobx/specs/flattened_adapters_of_fields.tests.ts +72 -0
  165. package/core/mobx/specs/flattened_list_type_defs_of.tests.ts +35 -0
  166. package/core/mobx/specs/form_presenter.tests.ts +989 -0
  167. package/core/mobx/types.ts +54 -0
  168. package/core/props.ts +21 -0
  169. package/dist/index.cjs +11479 -0
  170. package/dist/index.d.cts +345 -0
  171. package/dist/index.d.ts +345 -0
  172. package/dist/index.js +11486 -0
  173. package/field_converters/chain_field_converter.ts +74 -0
  174. package/field_converters/identity_converter.ts +39 -0
  175. package/field_converters/integer_to_string_converter.ts +32 -0
  176. package/field_converters/list_converter.ts +15 -0
  177. package/field_converters/maybe_identity_converter.ts +23 -0
  178. package/field_converters/nullable_to_boolean_converter.ts +56 -0
  179. package/field_converters/select_value_type_converter.ts +141 -0
  180. package/field_converters/trimming_string_converter.ts +23 -0
  181. package/field_converters/validating_converter.ts +35 -0
  182. package/field_validators/minimum_string_length_field_validator.ts +13 -0
  183. package/field_value_factories/prototyping_field_value_factory.ts +11 -0
  184. package/index.ts +16 -0
  185. package/mantine/create_checkbox.tsx +79 -0
  186. package/mantine/create_list.tsx +58 -0
  187. package/mantine/create_pill.tsx +43 -0
  188. package/mantine/create_radio.tsx +36 -0
  189. package/mantine/create_radio_group.tsx +71 -0
  190. package/mantine/create_text_input.tsx +80 -0
  191. package/mantine/create_value_input.tsx +81 -0
  192. package/mantine/hooks.tsx +394 -0
  193. package/mantine/specs/__snapshots__/check_box_hooks.tests.tsx.snap +227 -0
  194. package/mantine/specs/__snapshots__/checkbox_hooks.tests.tsx.snap +227 -0
  195. package/mantine/specs/__snapshots__/list_hooks.tests.tsx.snap +68 -0
  196. package/mantine/specs/__snapshots__/radio_group_hooks.tests.tsx.snap +695 -0
  197. package/mantine/specs/__snapshots__/select_hooks.tests.tsx.snap +225 -0
  198. package/mantine/specs/__snapshots__/text_input_hooks.tests.tsx.snap +202 -0
  199. package/mantine/specs/__snapshots__/value_input_hooks.tests.tsx.snap +613 -0
  200. package/mantine/specs/checkbox_constants.ts +1 -0
  201. package/mantine/specs/checkbox_hooks.stories.tsx +79 -0
  202. package/mantine/specs/checkbox_hooks.tests.tsx +100 -0
  203. package/mantine/specs/list_hooks.stories.tsx +83 -0
  204. package/mantine/specs/list_hooks.tests.tsx +15 -0
  205. package/mantine/specs/radio_group_constants.ts +12 -0
  206. package/mantine/specs/radio_group_hooks.stories.tsx +103 -0
  207. package/mantine/specs/radio_group_hooks.tests.tsx +92 -0
  208. package/mantine/specs/select_hooks.stories.tsx +77 -0
  209. package/mantine/specs/select_hooks.tests.tsx +14 -0
  210. package/mantine/specs/select_hooks_constant.ts +1 -0
  211. package/mantine/specs/text_input_constants.ts +1 -0
  212. package/mantine/specs/text_input_hooks.stories.tsx +124 -0
  213. package/mantine/specs/text_input_hooks.tests.tsx +106 -0
  214. package/mantine/specs/value_input_constants.ts +2 -0
  215. package/mantine/specs/value_input_hooks.stories.tsx +182 -0
  216. package/mantine/specs/value_input_hooks.tests.tsx +14 -0
  217. package/mantine/types.ts +13 -0
  218. package/package.exports.json +18 -0
  219. package/package.json +74 -0
  220. package/tsconfig.build.json +13 -0
  221. package/tsconfig.json +27 -0
  222. package/tsup.config.ts +16 -0
  223. package/types/all_fields_of_fields.ts +9 -0
  224. package/types/boolean_fields_of_fields.ts +8 -0
  225. package/types/error_type_of_field.ts +3 -0
  226. package/types/field.ts +9 -0
  227. package/types/field_converters.ts +64 -0
  228. package/types/field_validator.ts +7 -0
  229. package/types/flattened_form_fields_of.ts +16 -0
  230. package/types/list_fields_of_fields.ts +7 -0
  231. package/types/specs/boolean_fields_of_fields.tests.ts +23 -0
  232. package/types/specs/error_type_of_field.tests.ts +10 -0
  233. package/types/specs/flattened_form_fields_of.tests.ts +43 -0
  234. package/types/specs/string_fields_of_fields.tests.ts +40 -0
  235. package/types/specs/value_type_of_field.tests.ts +10 -0
  236. package/types/string_fields_of_fields.ts +6 -0
  237. package/types/value_type_of_field.ts +3 -0
  238. package/util/partial.tsx +200 -0
  239. package/vitest.workspace.ts +26 -0
@@ -0,0 +1,613 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`mantine value input hooks > renders AnJsonInput 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-JsonInput-root"
12
+ >
13
+ <div
14
+ class="m_6c018570 mantine-Input-wrapper mantine-JsonInput-wrapper"
15
+ data-multiline="true"
16
+ data-variant="default"
17
+ >
18
+ <textarea
19
+ aria-invalid="false"
20
+ autocomplete="off"
21
+ class="m_8fb7ebe7 mantine-Input-input mantine-JsonInput-input"
22
+ data-monospace="true"
23
+ data-variant="default"
24
+ id="mantine-0cyk5rcyk"
25
+ name="$"
26
+ rows="8"
27
+ >
28
+ {}
29
+ </textarea>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ `;
34
+
35
+ exports[`mantine value input hooks > renders AnRating 1`] = `
36
+ <div>
37
+ <style
38
+ data-mantine-styles="classes"
39
+ >
40
+ @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;}}
41
+ </style>
42
+ <div
43
+ class="m_f8d312f2 mantine-Rating-root"
44
+ data-size="sm"
45
+ id="mantine-0px4bipx4"
46
+ style="--rating-size: var(--rating-size-sm); --rating-color: var(--mantine-color-yellow-filled);"
47
+ >
48
+ <div
49
+ class="m_61734bb7 mantine-Rating-symbolGroup"
50
+ >
51
+ <input
52
+ aria-label="0"
53
+ class="m_211007ba mantine-Rating-input"
54
+ id="mantine-0px4bipx4-0-0"
55
+ name="$"
56
+ type="radio"
57
+ value="0"
58
+ />
59
+ <label
60
+ class="m_21342ee4 mantine-Rating-label"
61
+ for="mantine-0px4bipx4-0-0"
62
+ style="--rating-item-z-index: 0;"
63
+ >
64
+ <div
65
+ class="m_fae05d6a mantine-Rating-symbolBody"
66
+ style="--rating-symbol-clip-path: inset(0 100% 0 0);"
67
+ >
68
+ <svg
69
+ class="m_5662a89a mantine-Rating-starSymbol"
70
+ data-filled="true"
71
+ fill="none"
72
+ stroke-linecap="round"
73
+ stroke-linejoin="round"
74
+ viewBox="0 0 24 24"
75
+ xmlns="http://www.w3.org/2000/svg"
76
+ >
77
+ <path
78
+ d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
79
+ />
80
+ </svg>
81
+ </div>
82
+ </label>
83
+ <input
84
+ aria-label="1"
85
+ class="m_211007ba mantine-Rating-input"
86
+ id="mantine-0px4bipx4-0-1"
87
+ name="$"
88
+ type="radio"
89
+ value="1"
90
+ />
91
+ <label
92
+ class="m_21342ee4 mantine-Rating-label"
93
+ for="mantine-0px4bipx4-0-1"
94
+ >
95
+ <div
96
+ class="m_fae05d6a mantine-Rating-symbolBody"
97
+ >
98
+ <svg
99
+ class="m_5662a89a mantine-Rating-starSymbol"
100
+ data-filled="true"
101
+ fill="none"
102
+ stroke-linecap="round"
103
+ stroke-linejoin="round"
104
+ viewBox="0 0 24 24"
105
+ xmlns="http://www.w3.org/2000/svg"
106
+ >
107
+ <path
108
+ d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
109
+ />
110
+ </svg>
111
+ </div>
112
+ </label>
113
+ </div>
114
+ <div
115
+ class="m_61734bb7 mantine-Rating-symbolGroup"
116
+ >
117
+ <input
118
+ aria-label="2"
119
+ checked=""
120
+ class="m_211007ba mantine-Rating-input"
121
+ data-active="true"
122
+ id="mantine-0px4bipx4-1-0"
123
+ name="$"
124
+ type="radio"
125
+ value="2"
126
+ />
127
+ <label
128
+ class="m_21342ee4 mantine-Rating-label"
129
+ for="mantine-0px4bipx4-1-0"
130
+ >
131
+ <div
132
+ class="m_fae05d6a mantine-Rating-symbolBody"
133
+ >
134
+ <svg
135
+ class="m_5662a89a mantine-Rating-starSymbol"
136
+ data-filled="true"
137
+ fill="none"
138
+ stroke-linecap="round"
139
+ stroke-linejoin="round"
140
+ viewBox="0 0 24 24"
141
+ xmlns="http://www.w3.org/2000/svg"
142
+ >
143
+ <path
144
+ d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
145
+ />
146
+ </svg>
147
+ </div>
148
+ </label>
149
+ </div>
150
+ <div
151
+ class="m_61734bb7 mantine-Rating-symbolGroup"
152
+ >
153
+ <input
154
+ aria-label="3"
155
+ class="m_211007ba mantine-Rating-input"
156
+ id="mantine-0px4bipx4-2-0"
157
+ name="$"
158
+ type="radio"
159
+ value="3"
160
+ />
161
+ <label
162
+ class="m_21342ee4 mantine-Rating-label"
163
+ for="mantine-0px4bipx4-2-0"
164
+ >
165
+ <div
166
+ class="m_fae05d6a mantine-Rating-symbolBody"
167
+ >
168
+ <svg
169
+ class="m_5662a89a mantine-Rating-starSymbol"
170
+ fill="none"
171
+ stroke-linecap="round"
172
+ stroke-linejoin="round"
173
+ viewBox="0 0 24 24"
174
+ xmlns="http://www.w3.org/2000/svg"
175
+ >
176
+ <path
177
+ d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
178
+ />
179
+ </svg>
180
+ </div>
181
+ </label>
182
+ </div>
183
+ <div
184
+ class="m_61734bb7 mantine-Rating-symbolGroup"
185
+ >
186
+ <input
187
+ aria-label="4"
188
+ class="m_211007ba mantine-Rating-input"
189
+ id="mantine-0px4bipx4-3-0"
190
+ name="$"
191
+ type="radio"
192
+ value="4"
193
+ />
194
+ <label
195
+ class="m_21342ee4 mantine-Rating-label"
196
+ for="mantine-0px4bipx4-3-0"
197
+ >
198
+ <div
199
+ class="m_fae05d6a mantine-Rating-symbolBody"
200
+ >
201
+ <svg
202
+ class="m_5662a89a mantine-Rating-starSymbol"
203
+ fill="none"
204
+ stroke-linecap="round"
205
+ stroke-linejoin="round"
206
+ viewBox="0 0 24 24"
207
+ xmlns="http://www.w3.org/2000/svg"
208
+ >
209
+ <path
210
+ d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
211
+ />
212
+ </svg>
213
+ </div>
214
+ </label>
215
+ </div>
216
+ <div
217
+ class="m_61734bb7 mantine-Rating-symbolGroup"
218
+ >
219
+ <input
220
+ aria-label="5"
221
+ class="m_211007ba mantine-Rating-input"
222
+ id="mantine-0px4bipx4-4-0"
223
+ name="$"
224
+ type="radio"
225
+ value="5"
226
+ />
227
+ <label
228
+ class="m_21342ee4 mantine-Rating-label"
229
+ for="mantine-0px4bipx4-4-0"
230
+ >
231
+ <div
232
+ class="m_fae05d6a mantine-Rating-symbolBody"
233
+ >
234
+ <svg
235
+ class="m_5662a89a mantine-Rating-starSymbol"
236
+ fill="none"
237
+ stroke-linecap="round"
238
+ stroke-linejoin="round"
239
+ viewBox="0 0 24 24"
240
+ xmlns="http://www.w3.org/2000/svg"
241
+ >
242
+ <path
243
+ d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"
244
+ />
245
+ </svg>
246
+ </div>
247
+ </label>
248
+ </div>
249
+ </div>
250
+ </div>
251
+ `;
252
+
253
+ exports[`mantine value input hooks > renders AnSlider 1`] = `
254
+ <div>
255
+ <style
256
+ data-mantine-styles="classes"
257
+ >
258
+ @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;}}
259
+ </style>
260
+ <div
261
+ class="m_dd36362e mantine-Slider-root"
262
+ style="--slider-radius: var(--mantine-radius-xl); --slider-thumb-size: calc(var(--slider-size) * 2);"
263
+ tabindex="-1"
264
+ >
265
+ <div
266
+ class="m_a8645c2 mantine-Slider-trackContainer"
267
+ >
268
+ <div
269
+ class="m_c9ade57f mantine-Slider-track"
270
+ >
271
+ <div
272
+ class="m_38aeed47 mantine-Slider-bar"
273
+ style="--slider-bar-width: calc(22.22222222222222% + var(--slider-size)); --slider-bar-offset: calc(0% - var(--slider-size));"
274
+ />
275
+ <div
276
+ aria-label=""
277
+ aria-valuemax="10"
278
+ aria-valuemin="1"
279
+ aria-valuenow="3"
280
+ class="mantine-focus-auto m_c9a9a60a mantine-Slider-thumb"
281
+ role="slider"
282
+ style="--slider-thumb-offset: 22.22222222222222%;"
283
+ tabindex="0"
284
+ />
285
+ <div>
286
+ <div
287
+ class="m_b7b0423a mantine-Slider-markWrapper"
288
+ style="--mark-offset: 0%;"
289
+ >
290
+ <div
291
+ class="m_dd33bc19 mantine-Slider-mark"
292
+ data-filled="true"
293
+ />
294
+ <div
295
+ class="m_68c77a5b mantine-Slider-markLabel"
296
+ >
297
+ min
298
+ </div>
299
+ </div>
300
+ <div
301
+ class="m_b7b0423a mantine-Slider-markWrapper"
302
+ style="--mark-offset: 44.44444444444444%;"
303
+ >
304
+ <div
305
+ class="m_dd33bc19 mantine-Slider-mark"
306
+ />
307
+ <div
308
+ class="m_68c77a5b mantine-Slider-markLabel"
309
+ >
310
+ mid
311
+ </div>
312
+ </div>
313
+ <div
314
+ class="m_b7b0423a mantine-Slider-markWrapper"
315
+ style="--mark-offset: 100%;"
316
+ >
317
+ <div
318
+ class="m_dd33bc19 mantine-Slider-mark"
319
+ />
320
+ <div
321
+ class="m_68c77a5b mantine-Slider-markLabel"
322
+ >
323
+ max
324
+ </div>
325
+ </div>
326
+ </div>
327
+ </div>
328
+ </div>
329
+ <input
330
+ name="$"
331
+ type="hidden"
332
+ value="3"
333
+ />
334
+ </div>
335
+ </div>
336
+ `;
337
+
338
+ exports[`mantine value input hooks > renders DisabledNumberInput 1`] = `
339
+ <div>
340
+ <style
341
+ data-mantine-styles="classes"
342
+ >
343
+ @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;}}
344
+ </style>
345
+ <div
346
+ class="m_e2f5cd4e m_46b77525 mantine-InputWrapper-root mantine-NumberInput-root"
347
+ >
348
+ <label
349
+ class="m_8fdc1311 mantine-InputWrapper-label mantine-NumberInput-label"
350
+ for="mantine-0cyk5rcyk"
351
+ id="mantine-0cyk5rcyk-label"
352
+ >
353
+ Number Input
354
+ </label>
355
+ <div
356
+ class="m_6c018570 mantine-Input-wrapper mantine-NumberInput-wrapper"
357
+ data-disabled="true"
358
+ data-variant="default"
359
+ data-with-right-section="true"
360
+ style="--input-right-section-width: var(--ni-right-section-width-sm); --input-right-section-pointer-events: none;"
361
+ >
362
+ <input
363
+ aria-invalid="false"
364
+ class="m_8fb7ebe7 mantine-Input-input mantine-NumberInput-input"
365
+ data-disabled="true"
366
+ data-variant="default"
367
+ disabled=""
368
+ id="mantine-0cyk5rcyk"
369
+ inputmode="numeric"
370
+ name="$"
371
+ type="text"
372
+ value="3"
373
+ />
374
+ <div
375
+ class="m_82577fc2 mantine-Input-section mantine-NumberInput-section"
376
+ data-position="right"
377
+ >
378
+ <div
379
+ class="m_95e17d22 mantine-NumberInput-controls"
380
+ >
381
+ <button
382
+ aria-hidden="true"
383
+ class="mantine-focus-auto m_80b4b171 mantine-NumberInput-control m_87cf2631 mantine-UnstyledButton-root"
384
+ data-direction="up"
385
+ disabled=""
386
+ tabindex="-1"
387
+ type="button"
388
+ >
389
+ <svg
390
+ fill="none"
391
+ style="transform: rotate(180deg);"
392
+ viewBox="0 0 15 15"
393
+ xmlns="http://www.w3.org/2000/svg"
394
+ >
395
+ <path
396
+ clip-rule="evenodd"
397
+ d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z"
398
+ fill="currentColor"
399
+ fill-rule="evenodd"
400
+ />
401
+ </svg>
402
+ </button>
403
+ <button
404
+ aria-hidden="true"
405
+ class="mantine-focus-auto m_80b4b171 mantine-NumberInput-control m_87cf2631 mantine-UnstyledButton-root"
406
+ data-direction="down"
407
+ disabled=""
408
+ tabindex="-1"
409
+ type="button"
410
+ >
411
+ <svg
412
+ fill="none"
413
+ viewBox="0 0 15 15"
414
+ xmlns="http://www.w3.org/2000/svg"
415
+ >
416
+ <path
417
+ clip-rule="evenodd"
418
+ d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z"
419
+ fill="currentColor"
420
+ fill-rule="evenodd"
421
+ />
422
+ </svg>
423
+ </button>
424
+ </div>
425
+ </div>
426
+ </div>
427
+ </div>
428
+ </div>
429
+ `;
430
+
431
+ exports[`mantine value input hooks > renders EmptyNumberInput 1`] = `
432
+ <div>
433
+ <style
434
+ data-mantine-styles="classes"
435
+ >
436
+ @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;}}
437
+ </style>
438
+ <div
439
+ class="m_e2f5cd4e m_46b77525 mantine-InputWrapper-root mantine-NumberInput-root"
440
+ >
441
+ <label
442
+ class="m_8fdc1311 mantine-InputWrapper-label mantine-NumberInput-label"
443
+ data-required="true"
444
+ for="mantine-0px4bipx4"
445
+ id="mantine-0px4bipx4-label"
446
+ >
447
+ Number Input
448
+ <span
449
+ aria-hidden="true"
450
+ class="m_78a94662 mantine-InputWrapper-required mantine-NumberInput-required"
451
+ >
452
+ *
453
+ </span>
454
+ </label>
455
+ <div
456
+ class="m_6c018570 mantine-Input-wrapper mantine-NumberInput-wrapper"
457
+ data-variant="default"
458
+ data-with-right-section="true"
459
+ style="--input-right-section-width: var(--ni-right-section-width-sm);"
460
+ >
461
+ <input
462
+ aria-invalid="false"
463
+ class="m_8fb7ebe7 mantine-Input-input mantine-NumberInput-input"
464
+ data-variant="default"
465
+ id="mantine-0px4bipx4"
466
+ inputmode="numeric"
467
+ name="$"
468
+ required=""
469
+ type="text"
470
+ value=""
471
+ />
472
+ <div
473
+ class="m_82577fc2 mantine-Input-section mantine-NumberInput-section"
474
+ data-position="right"
475
+ >
476
+ <div
477
+ class="m_95e17d22 mantine-NumberInput-controls"
478
+ >
479
+ <button
480
+ aria-hidden="true"
481
+ class="mantine-focus-auto m_80b4b171 mantine-NumberInput-control m_87cf2631 mantine-UnstyledButton-root"
482
+ data-direction="up"
483
+ tabindex="-1"
484
+ type="button"
485
+ >
486
+ <svg
487
+ fill="none"
488
+ style="transform: rotate(180deg);"
489
+ viewBox="0 0 15 15"
490
+ xmlns="http://www.w3.org/2000/svg"
491
+ >
492
+ <path
493
+ clip-rule="evenodd"
494
+ d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z"
495
+ fill="currentColor"
496
+ fill-rule="evenodd"
497
+ />
498
+ </svg>
499
+ </button>
500
+ <button
501
+ aria-hidden="true"
502
+ class="mantine-focus-auto m_80b4b171 mantine-NumberInput-control m_87cf2631 mantine-UnstyledButton-root"
503
+ data-direction="down"
504
+ tabindex="-1"
505
+ type="button"
506
+ >
507
+ <svg
508
+ fill="none"
509
+ viewBox="0 0 15 15"
510
+ xmlns="http://www.w3.org/2000/svg"
511
+ >
512
+ <path
513
+ clip-rule="evenodd"
514
+ d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z"
515
+ fill="currentColor"
516
+ fill-rule="evenodd"
517
+ />
518
+ </svg>
519
+ </button>
520
+ </div>
521
+ </div>
522
+ </div>
523
+ </div>
524
+ </div>
525
+ `;
526
+
527
+ exports[`mantine value input hooks > renders PopulatedNumberInput 1`] = `
528
+ <div>
529
+ <style
530
+ data-mantine-styles="classes"
531
+ >
532
+ @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;}}
533
+ </style>
534
+ <div
535
+ class="m_e2f5cd4e m_46b77525 mantine-InputWrapper-root mantine-NumberInput-root"
536
+ >
537
+ <label
538
+ class="m_8fdc1311 mantine-InputWrapper-label mantine-NumberInput-label"
539
+ for="mantine-0cyk5rcyk"
540
+ id="mantine-0cyk5rcyk-label"
541
+ >
542
+ Number Input
543
+ </label>
544
+ <div
545
+ class="m_6c018570 mantine-Input-wrapper mantine-NumberInput-wrapper"
546
+ data-variant="default"
547
+ data-with-right-section="true"
548
+ style="--input-right-section-width: var(--ni-right-section-width-sm);"
549
+ >
550
+ <input
551
+ aria-invalid="false"
552
+ class="m_8fb7ebe7 mantine-Input-input mantine-NumberInput-input"
553
+ data-variant="default"
554
+ id="mantine-0cyk5rcyk"
555
+ inputmode="numeric"
556
+ name="$"
557
+ type="text"
558
+ value="3"
559
+ />
560
+ <div
561
+ class="m_82577fc2 mantine-Input-section mantine-NumberInput-section"
562
+ data-position="right"
563
+ >
564
+ <div
565
+ class="m_95e17d22 mantine-NumberInput-controls"
566
+ >
567
+ <button
568
+ aria-hidden="true"
569
+ class="mantine-focus-auto m_80b4b171 mantine-NumberInput-control m_87cf2631 mantine-UnstyledButton-root"
570
+ data-direction="up"
571
+ tabindex="-1"
572
+ type="button"
573
+ >
574
+ <svg
575
+ fill="none"
576
+ style="transform: rotate(180deg);"
577
+ viewBox="0 0 15 15"
578
+ xmlns="http://www.w3.org/2000/svg"
579
+ >
580
+ <path
581
+ clip-rule="evenodd"
582
+ d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z"
583
+ fill="currentColor"
584
+ fill-rule="evenodd"
585
+ />
586
+ </svg>
587
+ </button>
588
+ <button
589
+ aria-hidden="true"
590
+ class="mantine-focus-auto m_80b4b171 mantine-NumberInput-control m_87cf2631 mantine-UnstyledButton-root"
591
+ data-direction="down"
592
+ tabindex="-1"
593
+ type="button"
594
+ >
595
+ <svg
596
+ fill="none"
597
+ viewBox="0 0 15 15"
598
+ xmlns="http://www.w3.org/2000/svg"
599
+ >
600
+ <path
601
+ clip-rule="evenodd"
602
+ d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z"
603
+ fill="currentColor"
604
+ fill-rule="evenodd"
605
+ />
606
+ </svg>
607
+ </button>
608
+ </div>
609
+ </div>
610
+ </div>
611
+ </div>
612
+ </div>
613
+ `;
@@ -0,0 +1 @@
1
+ export const CHECKBOX_LABEL = 'Checkbox'
@@ -0,0 +1,79 @@
1
+ import { action } from '@storybook/addon-actions'
2
+ import {
3
+ type Meta,
4
+ type StoryObj,
5
+ } from '@storybook/react'
6
+ import { type FormProps } from 'core/props'
7
+ import { useMantineForm } from 'mantine/hooks'
8
+ import { type Field } from 'types/field'
9
+ import { CHECKBOX_LABEL } from './checkbox_constants'
10
+
11
+ function Component(props: FormProps<{
12
+ $: Field<boolean, string>,
13
+ }>) {
14
+ const inputProps = useMantineForm(props)
15
+ const CheckboxComponent = inputProps.checkbox('$')
16
+ return <CheckboxComponent label={CHECKBOX_LABEL} />
17
+ }
18
+
19
+ const meta: Meta<typeof Component> = {
20
+ component: Component,
21
+ args: {
22
+ onFieldBlur: action('onFieldBlur'),
23
+ onFieldFocus: action('onFieldFocus'),
24
+ onFieldSubmit: action('onFieldSubmit'),
25
+ onFieldValueChange: action('onFieldValueChange'),
26
+ },
27
+ }
28
+
29
+ export default meta
30
+
31
+ type Story = StoryObj<typeof Component>
32
+
33
+ export const Off: Story = {
34
+ args: {
35
+ fields: {
36
+ $: {
37
+ disabled: false,
38
+ required: false,
39
+ value: false,
40
+ },
41
+ },
42
+ },
43
+ }
44
+
45
+ export const On: Story = {
46
+ args: {
47
+ fields: {
48
+ $: {
49
+ disabled: false,
50
+ required: false,
51
+ value: true,
52
+ },
53
+ },
54
+ },
55
+ }
56
+
57
+ export const Required: Story = {
58
+ args: {
59
+ fields: {
60
+ $: {
61
+ disabled: false,
62
+ required: true,
63
+ value: false,
64
+ },
65
+ },
66
+ },
67
+ }
68
+
69
+ export const Disabled: Story = {
70
+ args: {
71
+ fields: {
72
+ $: {
73
+ disabled: true,
74
+ required: false,
75
+ value: false,
76
+ },
77
+ },
78
+ },
79
+ }