@digigov/form 1.1.2 → 1.1.4-mobile

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 (727) hide show
  1. package/Field/FieldBase/index.js +103 -76
  2. package/Field/FieldBase.js.map +7 -0
  3. package/Field/FieldBaseContainer/index.js +29 -37
  4. package/Field/FieldBaseContainer.js.map +7 -0
  5. package/Field/FieldConditional/index.js +79 -53
  6. package/Field/FieldConditional.js.map +7 -0
  7. package/Field/index.js +89 -63
  8. package/Field/index.js.map +7 -0
  9. package/Field/types/index.js +1 -1
  10. package/Field/types.d.ts +4 -0
  11. package/Field/types.js.map +7 -0
  12. package/Field/utils/index.js +96 -85
  13. package/Field/utils.d.ts +1 -0
  14. package/Field/utils.js.map +7 -0
  15. package/FieldArray/FieldArray.stories/index.js +12 -6
  16. package/FieldArray/FieldArray.stories.d.ts +2 -2
  17. package/FieldArray/FieldArray.stories.js.map +7 -0
  18. package/FieldArray/__stories__/Default/index.js +87 -80
  19. package/FieldArray/__stories__/Default.d.ts +2 -2
  20. package/FieldArray/__stories__/Default.js.map +7 -0
  21. package/FieldArray/__stories__/WithExactLength/index.js +87 -80
  22. package/FieldArray/__stories__/WithExactLength.d.ts +2 -2
  23. package/FieldArray/__stories__/WithExactLength.js.map +7 -0
  24. package/FieldArray/index.d.ts +1 -0
  25. package/FieldArray/index.js +65 -59
  26. package/FieldArray/index.js.map +7 -0
  27. package/FieldArray/index.test.d.ts +1 -0
  28. package/FieldObject/index.d.ts +3 -0
  29. package/FieldObject/index.js +66 -52
  30. package/FieldObject/index.js.map +7 -0
  31. package/Fieldset/FieldsetWithContext/index.js +27 -31
  32. package/Fieldset/FieldsetWithContext.js.map +7 -0
  33. package/Fieldset/index.js +27 -29
  34. package/Fieldset/index.js.map +7 -0
  35. package/Fieldset/types/index.js +1 -1
  36. package/Fieldset/types.d.ts +2 -0
  37. package/Fieldset/types.js.map +7 -0
  38. package/Form.stories/index.js +7 -3
  39. package/Form.stories.js.map +7 -0
  40. package/FormBuilder/FormBuilder/index.js +123 -118
  41. package/FormBuilder/FormBuilder.d.ts +1 -0
  42. package/FormBuilder/FormBuilder.js.map +7 -0
  43. package/FormBuilder/FormBuilder.stories/index.js +10 -5
  44. package/FormBuilder/FormBuilder.stories.d.ts +1 -1
  45. package/FormBuilder/FormBuilder.stories.js.map +7 -0
  46. package/FormBuilder/__stories__/Default/index.js +27 -21
  47. package/FormBuilder/__stories__/Default.d.ts +2 -2
  48. package/FormBuilder/__stories__/Default.js.map +7 -0
  49. package/FormBuilder/index.js +6 -2
  50. package/FormBuilder/index.js.map +7 -0
  51. package/FormBuilder/index.test.d.ts +1 -0
  52. package/FormBuilder/scenarios.test.d.ts +88 -0
  53. package/FormContext/index.js +7 -3
  54. package/FormContext.js.map +7 -0
  55. package/MultiplicityField/MultiplicityField.stories/index.js +20 -10
  56. package/MultiplicityField/MultiplicityField.stories.d.ts +6 -6
  57. package/MultiplicityField/MultiplicityField.stories.js.map +7 -0
  58. package/MultiplicityField/__stories__/Default/index.js +90 -85
  59. package/MultiplicityField/__stories__/Default.d.ts +2 -2
  60. package/MultiplicityField/__stories__/Default.js.map +7 -0
  61. package/MultiplicityField/__stories__/PreviewDisplay/index.js +70 -72
  62. package/MultiplicityField/__stories__/PreviewDisplay.d.ts +2 -2
  63. package/MultiplicityField/__stories__/PreviewDisplay.js.map +7 -0
  64. package/MultiplicityField/__stories__/WithExactLength/index.js +87 -80
  65. package/MultiplicityField/__stories__/WithExactLength.d.ts +2 -2
  66. package/MultiplicityField/__stories__/WithExactLength.js.map +7 -0
  67. package/MultiplicityField/__stories__/WithMaxLength/index.js +90 -83
  68. package/MultiplicityField/__stories__/WithMaxLength.d.ts +2 -2
  69. package/MultiplicityField/__stories__/WithMaxLength.js.map +7 -0
  70. package/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +91 -84
  71. package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +2 -2
  72. package/MultiplicityField/__stories__/WithMinAndMaxLength.js.map +7 -0
  73. package/MultiplicityField/__stories__/WithMinLength/index.js +90 -83
  74. package/MultiplicityField/__stories__/WithMinLength.d.ts +2 -2
  75. package/MultiplicityField/__stories__/WithMinLength.js.map +7 -0
  76. package/MultiplicityField/add-objects/index.js +130 -132
  77. package/MultiplicityField/add-objects.d.ts +1 -0
  78. package/MultiplicityField/add-objects.js.map +7 -0
  79. package/MultiplicityField/index.d.ts +1 -1
  80. package/MultiplicityField/index.js +111 -101
  81. package/MultiplicityField/index.js.map +7 -0
  82. package/MultiplicityField/index.test.d.ts +1 -0
  83. package/Questions/Questions/index.js +44 -53
  84. package/Questions/Questions.js.map +7 -0
  85. package/Questions/Questions.stories/index.js +10 -5
  86. package/Questions/Questions.stories.d.ts +1 -1
  87. package/Questions/Questions.stories.js.map +7 -0
  88. package/Questions/QuestionsContext/index.js +9 -9
  89. package/Questions/QuestionsContext.js.map +7 -0
  90. package/Questions/Step/ReviewStep/index.js +35 -47
  91. package/Questions/Step/ReviewStep.js.map +7 -0
  92. package/Questions/Step/Step/index.js +39 -47
  93. package/Questions/Step/Step.js.map +7 -0
  94. package/Questions/Step/StepArrayReview/index.js +41 -45
  95. package/Questions/Step/StepArrayReview.js.map +7 -0
  96. package/Questions/Step/StepContext/index.js +15 -19
  97. package/Questions/Step/StepContext.js.map +7 -0
  98. package/Questions/Step/StepDescription/index.js +22 -22
  99. package/Questions/Step/StepDescription.js.map +7 -0
  100. package/Questions/Step/StepForm/index.js +33 -43
  101. package/Questions/Step/StepForm.js.map +7 -0
  102. package/Questions/Step/StepQuote/index.js +10 -9
  103. package/Questions/Step/StepQuote.js.map +7 -0
  104. package/Questions/Step/StepTitle/index.js +40 -38
  105. package/Questions/Step/StepTitle.d.ts +1 -0
  106. package/Questions/Step/StepTitle.js.map +7 -0
  107. package/Questions/Step/getAddMoreFields/index.js +28 -20
  108. package/Questions/Step/getAddMoreFields.js.map +7 -0
  109. package/Questions/Step/index.d.ts +0 -1
  110. package/Questions/Step/index.js +16 -13
  111. package/Questions/Step/index.js.map +7 -0
  112. package/Questions/Step/types/index.js +1 -1
  113. package/Questions/Step/types.d.ts +2 -0
  114. package/Questions/Step/types.js.map +7 -0
  115. package/Questions/__stories__/Default/index.js +106 -100
  116. package/Questions/__stories__/Default.d.ts +2 -2
  117. package/Questions/__stories__/Default.js.map +7 -0
  118. package/Questions/getNextStep/index.js +12 -10
  119. package/Questions/getNextStep.js.map +7 -0
  120. package/Questions/index.js +7 -3
  121. package/Questions/index.js.map +7 -0
  122. package/Questions/index.test.d.ts +1 -0
  123. package/Questions/types/index.js +1 -1
  124. package/Questions/types.d.ts +2 -0
  125. package/Questions/types.js.map +7 -0
  126. package/cjs/Field/FieldBase/index.js +135 -82
  127. package/cjs/Field/FieldBase.js.map +7 -0
  128. package/cjs/Field/FieldBaseContainer/index.js +61 -43
  129. package/cjs/Field/FieldBaseContainer.js.map +7 -0
  130. package/cjs/Field/FieldConditional/index.js +111 -59
  131. package/cjs/Field/FieldConditional.js.map +7 -0
  132. package/cjs/Field/index.js +121 -72
  133. package/cjs/Field/index.js.map +7 -0
  134. package/cjs/Field/types/index.js +16 -5
  135. package/cjs/Field/types.js.map +7 -0
  136. package/cjs/Field/utils/index.js +139 -106
  137. package/cjs/Field/utils.js.map +7 -0
  138. package/cjs/FieldArray/FieldArray.stories/index.js +46 -36
  139. package/cjs/FieldArray/FieldArray.stories.js.map +7 -0
  140. package/cjs/FieldArray/__stories__/Default/index.js +119 -89
  141. package/cjs/FieldArray/__stories__/Default.js.map +7 -0
  142. package/cjs/FieldArray/__stories__/WithExactLength/index.js +119 -89
  143. package/cjs/FieldArray/__stories__/WithExactLength.js.map +7 -0
  144. package/cjs/FieldArray/index.js +97 -65
  145. package/cjs/FieldArray/index.js.map +7 -0
  146. package/cjs/FieldObject/index.js +98 -61
  147. package/cjs/FieldObject/index.js.map +7 -0
  148. package/cjs/Fieldset/FieldsetWithContext/index.js +54 -40
  149. package/cjs/Fieldset/FieldsetWithContext.js.map +7 -0
  150. package/cjs/Fieldset/index.js +61 -39
  151. package/cjs/Fieldset/index.js.map +7 -0
  152. package/cjs/Fieldset/types/index.js +16 -5
  153. package/cjs/Fieldset/types.js.map +7 -0
  154. package/cjs/Form.stories/index.js +25 -8
  155. package/cjs/Form.stories.js.map +7 -0
  156. package/cjs/FormBuilder/FormBuilder/index.js +158 -128
  157. package/cjs/FormBuilder/FormBuilder.js.map +7 -0
  158. package/cjs/FormBuilder/FormBuilder.stories/index.js +43 -24
  159. package/cjs/FormBuilder/FormBuilder.stories.js.map +7 -0
  160. package/cjs/FormBuilder/__stories__/Default/index.js +60 -31
  161. package/cjs/FormBuilder/__stories__/Default.js.map +7 -0
  162. package/cjs/FormBuilder/index.js +24 -7
  163. package/cjs/FormBuilder/index.js.map +7 -0
  164. package/cjs/FormContext/index.js +29 -8
  165. package/cjs/FormContext.js.map +7 -0
  166. package/cjs/MultiplicityField/MultiplicityField.stories/index.js +58 -84
  167. package/cjs/MultiplicityField/MultiplicityField.stories.js.map +7 -0
  168. package/cjs/MultiplicityField/__stories__/Default/index.js +122 -94
  169. package/cjs/MultiplicityField/__stories__/Default.js.map +7 -0
  170. package/cjs/MultiplicityField/__stories__/PreviewDisplay/index.js +85 -81
  171. package/cjs/MultiplicityField/__stories__/PreviewDisplay.js.map +7 -0
  172. package/cjs/MultiplicityField/__stories__/WithExactLength/index.js +119 -89
  173. package/cjs/MultiplicityField/__stories__/WithExactLength.js.map +7 -0
  174. package/cjs/MultiplicityField/__stories__/WithMaxLength/index.js +122 -92
  175. package/cjs/MultiplicityField/__stories__/WithMaxLength.js.map +7 -0
  176. package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +123 -93
  177. package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength.js.map +7 -0
  178. package/cjs/MultiplicityField/__stories__/WithMinLength/index.js +122 -92
  179. package/cjs/MultiplicityField/__stories__/WithMinLength.js.map +7 -0
  180. package/cjs/MultiplicityField/add-objects/index.js +160 -138
  181. package/cjs/MultiplicityField/add-objects.js.map +7 -0
  182. package/cjs/MultiplicityField/index.js +144 -110
  183. package/cjs/MultiplicityField/index.js.map +7 -0
  184. package/cjs/Questions/Questions/index.js +76 -62
  185. package/cjs/Questions/Questions.js.map +7 -0
  186. package/cjs/Questions/Questions.stories/index.js +43 -24
  187. package/cjs/Questions/Questions.stories.js.map +7 -0
  188. package/cjs/Questions/QuestionsContext/index.js +31 -14
  189. package/cjs/Questions/QuestionsContext.js.map +7 -0
  190. package/cjs/Questions/Step/ReviewStep/index.js +61 -56
  191. package/cjs/Questions/Step/ReviewStep.js.map +7 -0
  192. package/cjs/Questions/Step/Step/index.js +71 -56
  193. package/cjs/Questions/Step/Step.js.map +7 -0
  194. package/cjs/Questions/Step/StepArrayReview/index.js +65 -54
  195. package/cjs/Questions/Step/StepArrayReview.js.map +7 -0
  196. package/cjs/Questions/Step/StepContext/index.js +37 -24
  197. package/cjs/Questions/Step/StepContext.js.map +7 -0
  198. package/cjs/Questions/Step/StepDescription/index.js +55 -31
  199. package/cjs/Questions/Step/StepDescription.js.map +7 -0
  200. package/cjs/Questions/Step/StepForm/index.js +65 -52
  201. package/cjs/Questions/Step/StepForm.js.map +7 -0
  202. package/cjs/Questions/Step/StepQuote/index.js +42 -15
  203. package/cjs/Questions/Step/StepQuote.js.map +7 -0
  204. package/cjs/Questions/Step/StepTitle/index.js +72 -47
  205. package/cjs/Questions/Step/StepTitle.js.map +7 -0
  206. package/cjs/Questions/Step/getAddMoreFields/index.js +50 -25
  207. package/cjs/Questions/Step/getAddMoreFields.js.map +7 -0
  208. package/cjs/Questions/Step/index.js +59 -143
  209. package/cjs/Questions/Step/index.js.map +7 -0
  210. package/cjs/Questions/Step/types/index.js +16 -5
  211. package/cjs/Questions/Step/types.js.map +7 -0
  212. package/cjs/Questions/__stories__/Default/index.js +132 -109
  213. package/cjs/Questions/__stories__/Default.js.map +7 -0
  214. package/cjs/Questions/getNextStep/index.js +33 -14
  215. package/cjs/Questions/getNextStep.js.map +7 -0
  216. package/cjs/Questions/index.js +29 -19
  217. package/cjs/Questions/index.js.map +7 -0
  218. package/cjs/Questions/types/index.js +16 -5
  219. package/cjs/Questions/types.js.map +7 -0
  220. package/cjs/index.js +47 -20
  221. package/cjs/index.js.map +7 -0
  222. package/cjs/inputs/AutoCompleteInput/AutoComplete.stories/index.js +46 -24
  223. package/cjs/inputs/AutoCompleteInput/AutoComplete.stories.js.map +7 -0
  224. package/cjs/inputs/AutoCompleteInput/__stories__/Default/index.js +78 -51
  225. package/cjs/inputs/AutoCompleteInput/__stories__/Default.js.map +7 -0
  226. package/cjs/inputs/AutoCompleteInput/__stories__/Multiple/index.js +84 -0
  227. package/cjs/inputs/AutoCompleteInput/__stories__/Multiple.js.map +7 -0
  228. package/cjs/inputs/AutoCompleteInput/index.js +90 -46
  229. package/cjs/inputs/AutoCompleteInput/index.js.map +7 -0
  230. package/cjs/inputs/Checkboxes/Checkboxes.stories/index.js +49 -48
  231. package/cjs/inputs/Checkboxes/Checkboxes.stories.js.map +7 -0
  232. package/cjs/inputs/Checkboxes/__stories__/Conditional/index.js +120 -89
  233. package/cjs/inputs/Checkboxes/__stories__/Conditional.js.map +7 -0
  234. package/cjs/inputs/Checkboxes/__stories__/Default/index.js +73 -46
  235. package/cjs/inputs/Checkboxes/__stories__/Default.js.map +7 -0
  236. package/cjs/inputs/Checkboxes/__stories__/WithDivider/index.js +74 -47
  237. package/cjs/inputs/Checkboxes/__stories__/WithDivider.js.map +7 -0
  238. package/cjs/inputs/Checkboxes/index.js +102 -96
  239. package/cjs/inputs/Checkboxes/index.js.map +7 -0
  240. package/cjs/inputs/DateInput/DateInput.stories/index.js +43 -24
  241. package/cjs/inputs/DateInput/DateInput.stories.js.map +7 -0
  242. package/cjs/inputs/DateInput/__stories__/Default/index.js +56 -28
  243. package/cjs/inputs/DateInput/__stories__/Default.js.map +7 -0
  244. package/cjs/inputs/DateInput/index.js +122 -109
  245. package/cjs/inputs/DateInput/index.js.map +7 -0
  246. package/cjs/inputs/FileInput/FileInput.stories/index.js +43 -24
  247. package/cjs/inputs/FileInput/FileInput.stories.js.map +7 -0
  248. package/cjs/inputs/FileInput/__stories__/Default/index.js +57 -26
  249. package/cjs/inputs/FileInput/__stories__/Default.js.map +7 -0
  250. package/cjs/inputs/FileInput/index.js +76 -63
  251. package/cjs/inputs/FileInput/index.js.map +7 -0
  252. package/cjs/inputs/ImageInput/ImageInput.stories/index.js +49 -48
  253. package/cjs/inputs/ImageInput/ImageInput.stories.js.map +7 -0
  254. package/cjs/inputs/ImageInput/__stories__/Default/index.js +58 -33
  255. package/cjs/inputs/ImageInput/__stories__/Default.js.map +7 -0
  256. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +65 -40
  257. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension.js.map +7 -0
  258. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +62 -37
  259. package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize.js.map +7 -0
  260. package/cjs/inputs/ImageInput/index.js +91 -83
  261. package/cjs/inputs/ImageInput/index.js.map +7 -0
  262. package/cjs/inputs/Input/Input.stories/index.js +70 -120
  263. package/cjs/inputs/Input/Input.stories.js.map +7 -0
  264. package/cjs/inputs/Input/__stories__/AFM/index.js +60 -29
  265. package/cjs/inputs/Input/__stories__/AFM.js.map +7 -0
  266. package/cjs/inputs/Input/__stories__/Boolean/index.js +61 -30
  267. package/cjs/inputs/Input/__stories__/Boolean.js.map +7 -0
  268. package/cjs/inputs/Input/__stories__/IBAN/index.js +61 -30
  269. package/cjs/inputs/Input/__stories__/IBAN.js.map +7 -0
  270. package/cjs/inputs/Input/__stories__/Integer/index.js +75 -38
  271. package/cjs/inputs/Input/__stories__/Integer.js.map +7 -0
  272. package/cjs/inputs/Input/__stories__/LandlineNumber/index.js +67 -0
  273. package/cjs/inputs/Input/__stories__/LandlineNumber.js.map +7 -0
  274. package/cjs/inputs/Input/__stories__/MobilePhone/index.js +64 -29
  275. package/cjs/inputs/Input/__stories__/MobilePhone.js.map +7 -0
  276. package/cjs/inputs/Input/__stories__/PhoneNumber/index.js +63 -29
  277. package/cjs/inputs/Input/__stories__/PhoneNumber.js.map +7 -0
  278. package/cjs/inputs/Input/__stories__/PostalCode/index.js +60 -31
  279. package/cjs/inputs/Input/__stories__/PostalCode.js.map +7 -0
  280. package/cjs/inputs/Input/__stories__/String/index.js +64 -0
  281. package/cjs/inputs/Input/__stories__/String.js.map +7 -0
  282. package/cjs/inputs/Input/__stories__/TextWithLimit/index.js +64 -0
  283. package/cjs/inputs/Input/__stories__/TextWithLimit.js.map +7 -0
  284. package/cjs/inputs/Input/index.js +87 -72
  285. package/cjs/inputs/Input/index.js.map +7 -0
  286. package/cjs/inputs/Input/inputsInputScenarios/index.js +439 -0
  287. package/cjs/inputs/Input/inputsInputScenarios.js.map +7 -0
  288. package/cjs/inputs/Label/Label.stories/index.js +43 -24
  289. package/cjs/inputs/Label/Label.stories.js.map +7 -0
  290. package/cjs/inputs/Label/__stories__/Default/index.js +66 -33
  291. package/cjs/inputs/Label/__stories__/Default.js.map +7 -0
  292. package/cjs/inputs/Label/index.js +45 -24
  293. package/cjs/inputs/Label/index.js.map +7 -0
  294. package/cjs/inputs/OtpInput/OtpInput.stories/index.js +43 -24
  295. package/cjs/inputs/OtpInput/OtpInput.stories.js.map +7 -0
  296. package/cjs/inputs/OtpInput/__stories__/Default/index.js +59 -34
  297. package/cjs/inputs/OtpInput/__stories__/Default.js.map +7 -0
  298. package/cjs/inputs/OtpInput/index.js +142 -112
  299. package/cjs/inputs/OtpInput/index.js.map +7 -0
  300. package/cjs/inputs/Radio/Radio.stories/index.js +49 -48
  301. package/cjs/inputs/Radio/Radio.stories.js.map +7 -0
  302. package/cjs/inputs/Radio/__stories__/Conditional/index.js +120 -89
  303. package/cjs/inputs/Radio/__stories__/Conditional.js.map +7 -0
  304. package/cjs/inputs/Radio/__stories__/Default/index.js +77 -51
  305. package/cjs/inputs/Radio/__stories__/Default.js.map +7 -0
  306. package/cjs/inputs/Radio/__stories__/WithDivider/index.js +78 -52
  307. package/cjs/inputs/Radio/__stories__/WithDivider.js.map +7 -0
  308. package/cjs/inputs/Radio/index.js +132 -61
  309. package/cjs/inputs/Radio/index.js.map +7 -0
  310. package/cjs/inputs/Select/Select.stories/index.js +43 -24
  311. package/cjs/inputs/Select/Select.stories.js.map +7 -0
  312. package/cjs/inputs/Select/__stories__/Default/index.js +82 -57
  313. package/cjs/inputs/Select/__stories__/Default.js.map +7 -0
  314. package/cjs/inputs/Select/index.js +55 -36
  315. package/cjs/inputs/Select/index.js.map +7 -0
  316. package/cjs/inputs/index.js +62 -69
  317. package/cjs/inputs/index.js.map +7 -0
  318. package/cjs/inputs/inputsScenarios/index.js +540 -0
  319. package/cjs/inputs/inputsScenarios.js.map +7 -0
  320. package/cjs/internal/index.js +116 -346
  321. package/cjs/internal.js.map +7 -0
  322. package/cjs/lazy/index.js +93 -0
  323. package/cjs/lazy.js.map +7 -0
  324. package/cjs/locales/el/index.js +35 -0
  325. package/cjs/locales/el.js.map +7 -0
  326. package/cjs/registry/index.js +174 -142
  327. package/cjs/registry.js.map +7 -0
  328. package/cjs/types/index.js +16 -5
  329. package/cjs/types.js.map +7 -0
  330. package/cjs/utils/index.js +78 -83
  331. package/cjs/utils.js.map +7 -0
  332. package/cjs/validators/index.js +130 -128
  333. package/cjs/validators/index.js.map +7 -0
  334. package/cjs/validators/types/index.js +16 -5
  335. package/cjs/validators/types.js.map +7 -0
  336. package/cjs/validators/utils/afm/index.js +38 -21
  337. package/cjs/validators/utils/afm.js.map +7 -0
  338. package/cjs/validators/utils/file/index.js +44 -47
  339. package/cjs/validators/utils/file.js.map +7 -0
  340. package/cjs/validators/utils/iban/index.js +36 -17
  341. package/cjs/validators/utils/iban.js.map +7 -0
  342. package/cjs/validators/utils/image/index.js +88 -112
  343. package/cjs/validators/utils/image.js.map +7 -0
  344. package/cjs/validators/utils/index.js +95 -159
  345. package/cjs/validators/utils/index.js.map +7 -0
  346. package/cjs/validators/utils/int/index.js +34 -12
  347. package/cjs/validators/utils/int.js.map +7 -0
  348. package/cjs/validators/utils/number/index.js +33 -11
  349. package/cjs/validators/utils/number.js.map +7 -0
  350. package/cjs/validators/utils/otp/index.js +35 -13
  351. package/cjs/validators/utils/otp.js.map +7 -0
  352. package/cjs/validators/utils/phone/index.js +171 -92
  353. package/cjs/validators/utils/phone.js.map +7 -0
  354. package/cjs/validators/utils/postal_code/index.js +36 -16
  355. package/cjs/validators/utils/postal_code.js.map +7 -0
  356. package/cjs/validators/utils/text_limit/index.js +40 -25
  357. package/cjs/validators/utils/text_limit.js.map +7 -0
  358. package/cjs/validators/utils/uuid4/index.js +34 -13
  359. package/cjs/validators/utils/uuid4.js.map +7 -0
  360. package/index.d.ts +4 -1
  361. package/index.js +13 -4
  362. package/index.js.map +7 -0
  363. package/inputs/AutoCompleteInput/AutoComplete.stories/index.js +12 -5
  364. package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +2 -1
  365. package/inputs/AutoCompleteInput/AutoComplete.stories.js.map +7 -0
  366. package/inputs/AutoCompleteInput/__stories__/Default/index.js +46 -42
  367. package/inputs/AutoCompleteInput/__stories__/Default.d.ts +3 -2
  368. package/inputs/AutoCompleteInput/__stories__/Default.js.map +7 -0
  369. package/inputs/AutoCompleteInput/__stories__/Multiple/index.js +51 -0
  370. package/inputs/AutoCompleteInput/__stories__/Multiple/package.json +6 -0
  371. package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +3 -0
  372. package/inputs/AutoCompleteInput/__stories__/Multiple.js.map +7 -0
  373. package/inputs/AutoCompleteInput/index.d.ts +1 -1
  374. package/inputs/AutoCompleteInput/index.js +58 -37
  375. package/inputs/AutoCompleteInput/index.js.map +7 -0
  376. package/inputs/AutoCompleteInput/index.test.d.ts +1 -0
  377. package/inputs/Checkboxes/Checkboxes.stories/index.js +14 -7
  378. package/inputs/Checkboxes/Checkboxes.stories.d.ts +3 -3
  379. package/inputs/Checkboxes/Checkboxes.stories.js.map +7 -0
  380. package/inputs/Checkboxes/__stories__/Conditional/index.js +88 -80
  381. package/inputs/Checkboxes/__stories__/Conditional.d.ts +3 -2
  382. package/inputs/Checkboxes/__stories__/Conditional.js.map +7 -0
  383. package/inputs/Checkboxes/__stories__/Default/index.js +40 -36
  384. package/inputs/Checkboxes/__stories__/Default.d.ts +2 -2
  385. package/inputs/Checkboxes/__stories__/Default.js.map +7 -0
  386. package/inputs/Checkboxes/__stories__/WithDivider/index.js +41 -37
  387. package/inputs/Checkboxes/__stories__/WithDivider.d.ts +2 -2
  388. package/inputs/Checkboxes/__stories__/WithDivider.js.map +7 -0
  389. package/inputs/Checkboxes/index.js +70 -87
  390. package/inputs/Checkboxes/index.js.map +7 -0
  391. package/inputs/Checkboxes/index.test.d.ts +1 -0
  392. package/inputs/DateInput/DateInput.stories/index.js +10 -5
  393. package/inputs/DateInput/DateInput.stories.d.ts +1 -1
  394. package/inputs/DateInput/DateInput.stories.js.map +7 -0
  395. package/inputs/DateInput/__stories__/Default/index.js +23 -18
  396. package/inputs/DateInput/__stories__/Default.d.ts +2 -2
  397. package/inputs/DateInput/__stories__/Default.js.map +7 -0
  398. package/inputs/DateInput/index.d.ts +2 -2
  399. package/inputs/DateInput/index.js +89 -99
  400. package/inputs/DateInput/index.js.map +7 -0
  401. package/inputs/DateInput/index.test.d.ts +1 -0
  402. package/inputs/FileInput/FileInput.stories/index.js +10 -5
  403. package/inputs/FileInput/FileInput.stories.d.ts +1 -1
  404. package/inputs/FileInput/FileInput.stories.js.map +7 -0
  405. package/inputs/FileInput/__stories__/Default/index.js +24 -16
  406. package/inputs/FileInput/__stories__/Default.d.ts +2 -2
  407. package/inputs/FileInput/__stories__/Default.js.map +7 -0
  408. package/inputs/FileInput/index.js +44 -54
  409. package/inputs/FileInput/index.js.map +7 -0
  410. package/inputs/FileInput/index.test.d.ts +1 -0
  411. package/inputs/ImageInput/ImageInput.stories/index.js +14 -7
  412. package/inputs/ImageInput/ImageInput.stories.d.ts +3 -3
  413. package/inputs/ImageInput/ImageInput.stories.js.map +7 -0
  414. package/inputs/ImageInput/__stories__/Default/index.js +25 -23
  415. package/inputs/ImageInput/__stories__/Default.d.ts +2 -2
  416. package/inputs/ImageInput/__stories__/Default.js.map +7 -0
  417. package/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +32 -30
  418. package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +2 -2
  419. package/inputs/ImageInput/__stories__/WithInvalidImageDimension.js.map +7 -0
  420. package/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +29 -27
  421. package/inputs/ImageInput/__stories__/WithInvalidImageSize.d.ts +2 -2
  422. package/inputs/ImageInput/__stories__/WithInvalidImageSize.js.map +7 -0
  423. package/inputs/ImageInput/index.js +59 -75
  424. package/inputs/ImageInput/index.js.map +7 -0
  425. package/inputs/ImageInput/index.test.d.ts +1 -0
  426. package/inputs/Input/Input.stories/index.js +28 -13
  427. package/inputs/Input/Input.stories.d.ts +10 -9
  428. package/inputs/Input/Input.stories.js.map +7 -0
  429. package/inputs/Input/__stories__/AFM/index.js +27 -19
  430. package/inputs/Input/__stories__/AFM.d.ts +2 -2
  431. package/inputs/Input/__stories__/AFM.js.map +7 -0
  432. package/inputs/Input/__stories__/Boolean/index.js +28 -20
  433. package/inputs/Input/__stories__/Boolean.d.ts +2 -2
  434. package/inputs/Input/__stories__/Boolean.js.map +7 -0
  435. package/inputs/Input/__stories__/IBAN/index.js +28 -20
  436. package/inputs/Input/__stories__/IBAN.d.ts +2 -2
  437. package/inputs/Input/__stories__/IBAN.js.map +7 -0
  438. package/inputs/Input/__stories__/Integer/index.js +43 -29
  439. package/inputs/Input/__stories__/Integer.d.ts +2 -2
  440. package/inputs/Input/__stories__/Integer.js.map +7 -0
  441. package/inputs/Input/__stories__/LandlineNumber/index.js +34 -0
  442. package/inputs/Input/__stories__/LandlineNumber/package.json +6 -0
  443. package/inputs/Input/__stories__/LandlineNumber.d.ts +3 -0
  444. package/inputs/Input/__stories__/LandlineNumber.js.map +7 -0
  445. package/inputs/Input/__stories__/MobilePhone/index.js +31 -19
  446. package/inputs/Input/__stories__/MobilePhone.d.ts +2 -2
  447. package/inputs/Input/__stories__/MobilePhone.js.map +7 -0
  448. package/inputs/Input/__stories__/PhoneNumber/index.js +30 -19
  449. package/inputs/Input/__stories__/PhoneNumber.d.ts +2 -2
  450. package/inputs/Input/__stories__/PhoneNumber.js.map +7 -0
  451. package/inputs/Input/__stories__/PostalCode/index.js +27 -21
  452. package/inputs/Input/__stories__/PostalCode.d.ts +2 -2
  453. package/inputs/Input/__stories__/PostalCode.js.map +7 -0
  454. package/inputs/Input/__stories__/String/index.js +31 -0
  455. package/inputs/Input/__stories__/{Default → String}/package.json +1 -1
  456. package/inputs/Input/__stories__/String.d.ts +3 -0
  457. package/inputs/Input/__stories__/String.js.map +7 -0
  458. package/inputs/Input/__stories__/TextWithLimit/index.js +31 -0
  459. package/inputs/Input/__stories__/TextWithLimit/package.json +6 -0
  460. package/inputs/Input/__stories__/TextWithLimit.d.ts +3 -0
  461. package/inputs/Input/__stories__/TextWithLimit.js.map +7 -0
  462. package/inputs/Input/index.js +56 -67
  463. package/inputs/Input/index.js.map +7 -0
  464. package/inputs/Input/index.test.d.ts +1 -0
  465. package/inputs/Input/inputsInputScenarios/index.js +406 -0
  466. package/inputs/Input/inputsInputScenarios/package.json +6 -0
  467. package/inputs/Input/inputsInputScenarios.d.ts +57 -0
  468. package/inputs/Input/inputsInputScenarios.js.map +7 -0
  469. package/inputs/Label/Label.stories/index.js +10 -5
  470. package/inputs/Label/Label.stories.d.ts +1 -1
  471. package/inputs/Label/Label.stories.js.map +7 -0
  472. package/inputs/Label/__stories__/Default/index.js +33 -23
  473. package/inputs/Label/__stories__/Default.d.ts +2 -2
  474. package/inputs/Label/__stories__/Default.js.map +7 -0
  475. package/inputs/Label/index.d.ts +1 -1
  476. package/inputs/Label/index.js +12 -17
  477. package/inputs/Label/index.js.map +7 -0
  478. package/inputs/Label/index.test.d.ts +1 -0
  479. package/inputs/OtpInput/OtpInput.stories/index.js +10 -5
  480. package/inputs/OtpInput/OtpInput.stories.d.ts +1 -1
  481. package/inputs/OtpInput/OtpInput.stories.js.map +7 -0
  482. package/inputs/OtpInput/__stories__/Default/index.js +26 -24
  483. package/inputs/OtpInput/__stories__/Default.d.ts +2 -2
  484. package/inputs/OtpInput/__stories__/Default.js.map +7 -0
  485. package/inputs/OtpInput/index.d.ts +9 -2
  486. package/inputs/OtpInput/index.js +109 -103
  487. package/inputs/OtpInput/index.js.map +7 -0
  488. package/inputs/OtpInput/index.test.d.ts +1 -0
  489. package/inputs/Radio/Radio.stories/index.js +14 -7
  490. package/inputs/Radio/Radio.stories.d.ts +3 -3
  491. package/inputs/Radio/Radio.stories.js.map +7 -0
  492. package/inputs/Radio/__stories__/Conditional/index.js +88 -80
  493. package/inputs/Radio/__stories__/Conditional.d.ts +3 -2
  494. package/inputs/Radio/__stories__/Conditional.js.map +7 -0
  495. package/inputs/Radio/__stories__/Default/index.js +44 -41
  496. package/inputs/Radio/__stories__/Default.d.ts +2 -2
  497. package/inputs/Radio/__stories__/Default.js.map +7 -0
  498. package/inputs/Radio/__stories__/WithDivider/index.js +45 -42
  499. package/inputs/Radio/__stories__/WithDivider.d.ts +2 -2
  500. package/inputs/Radio/__stories__/WithDivider.js.map +7 -0
  501. package/inputs/Radio/index.d.ts +4 -0
  502. package/inputs/Radio/index.js +99 -55
  503. package/inputs/Radio/index.js.map +7 -0
  504. package/inputs/Radio/index.test.d.ts +1 -0
  505. package/inputs/Select/Select.stories/index.js +10 -5
  506. package/inputs/Select/Select.stories.d.ts +1 -1
  507. package/inputs/Select/Select.stories.js.map +7 -0
  508. package/inputs/Select/__stories__/Default/index.js +49 -47
  509. package/inputs/Select/__stories__/Default.d.ts +2 -2
  510. package/inputs/Select/__stories__/Default.js.map +7 -0
  511. package/inputs/Select/index.js +24 -31
  512. package/inputs/Select/index.js.map +7 -0
  513. package/inputs/Select/index.test.d.ts +1 -0
  514. package/inputs/index.js +21 -9
  515. package/inputs/index.js.map +7 -0
  516. package/inputs/inputsScenarios/index.js +506 -0
  517. package/{validators/validators.spec → inputs/inputsScenarios}/package.json +1 -1
  518. package/inputs/inputsScenarios.d.ts +338 -0
  519. package/inputs/inputsScenarios.js.map +7 -0
  520. package/internal/index.js +51 -34
  521. package/internal.js.map +7 -0
  522. package/lazy/index.js +64 -0
  523. package/{Questions/index.spec → lazy}/package.json +1 -1
  524. package/lazy.d.ts +70 -0
  525. package/lazy.js.map +7 -0
  526. package/locales/el/index.js +6 -0
  527. package/locales/el/package.json +6 -0
  528. package/locales/el.d.ts +2 -0
  529. package/locales/el.js.map +7 -0
  530. package/package.json +5 -7
  531. package/registry/index.js +146 -134
  532. package/registry.d.ts +3 -0
  533. package/registry.js.map +7 -0
  534. package/src/Field/FieldBase.tsx +2 -0
  535. package/src/Field/FieldBaseContainer.tsx +1 -1
  536. package/src/Field/FieldConditional.tsx +4 -0
  537. package/src/Field/index.tsx +7 -1
  538. package/src/Field/types.tsx +7 -0
  539. package/src/Field/utils.ts +13 -6
  540. package/src/FieldArray/FieldArray.stories.js +2 -2
  541. package/src/FieldArray/index.test.tsx +24 -0
  542. package/src/FieldArray/index.tsx +12 -6
  543. package/src/FieldObject/index.tsx +10 -2
  544. package/src/Fieldset/types.tsx +3 -1
  545. package/src/FormBuilder/FormBuilder.stories.js +1 -1
  546. package/src/FormBuilder/FormBuilder.tsx +15 -3
  547. package/src/FormBuilder/index.test.tsx +20 -0
  548. package/src/FormBuilder/scenarios.test.tsx +1864 -0
  549. package/src/MultiplicityField/MultiplicityField.stories.js +6 -6
  550. package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +2 -2
  551. package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
  552. package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
  553. package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
  554. package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
  555. package/src/MultiplicityField/add-objects.tsx +26 -23
  556. package/src/MultiplicityField/index.test.tsx +40 -0
  557. package/src/MultiplicityField/index.tsx +9 -9
  558. package/src/Questions/Questions.stories.js +1 -1
  559. package/src/Questions/Step/StepTitle.tsx +1 -0
  560. package/src/Questions/Step/index.ts +0 -1
  561. package/src/Questions/Step/types.tsx +1 -0
  562. package/src/Questions/__snapshots__/index.spec.tsx.snap +67 -586
  563. package/src/Questions/index.mdx +4 -4
  564. package/src/Questions/index.spec.tsx +3 -3
  565. package/src/Questions/index.test.tsx +20 -0
  566. package/src/Questions/types.tsx +1 -0
  567. package/src/index.ts +4 -1
  568. package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +2 -1
  569. package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +27 -18
  570. package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +54 -0
  571. package/src/inputs/AutoCompleteInput/index.mdx +29 -0
  572. package/src/inputs/AutoCompleteInput/index.test.tsx +24 -0
  573. package/src/inputs/AutoCompleteInput/index.tsx +29 -17
  574. package/src/inputs/Checkboxes/Checkboxes.stories.js +3 -3
  575. package/src/inputs/Checkboxes/__stories__/Conditional.tsx +2 -3
  576. package/src/inputs/Checkboxes/index.mdx +33 -0
  577. package/src/inputs/Checkboxes/index.test.tsx +29 -0
  578. package/src/inputs/Checkboxes/index.tsx +28 -26
  579. package/src/inputs/DateInput/DateInput.stories.js +1 -1
  580. package/src/inputs/DateInput/__stories__/Default.tsx +21 -15
  581. package/src/inputs/DateInput/index.mdx +23 -0
  582. package/src/inputs/DateInput/index.test.tsx +20 -0
  583. package/src/inputs/DateInput/index.tsx +3 -3
  584. package/src/inputs/FileInput/FileInput.stories.js +1 -1
  585. package/src/inputs/FileInput/index.mdx +19 -0
  586. package/src/inputs/FileInput/index.test.tsx +20 -0
  587. package/src/inputs/ImageInput/ImageInput.stories.js +3 -3
  588. package/src/inputs/ImageInput/index.mdx +19 -0
  589. package/src/inputs/ImageInput/index.test.tsx +28 -0
  590. package/src/inputs/ImageInput/index.tsx +4 -4
  591. package/src/inputs/Input/Input.stories.js +10 -9
  592. package/src/inputs/Input/__stories__/LandlineNumber.tsx +27 -0
  593. package/src/inputs/Input/__stories__/MobilePhone.tsx +4 -0
  594. package/src/inputs/Input/__stories__/PhoneNumber.tsx +4 -1
  595. package/src/inputs/Input/__stories__/{Default.tsx → String.tsx} +2 -2
  596. package/src/inputs/Input/__stories__/{TextWithCharacterLimit.tsx → TextWithLimit.tsx} +2 -2
  597. package/src/inputs/Input/index.mdx +90 -3
  598. package/src/inputs/Input/index.test.tsx +56 -0
  599. package/src/inputs/Input/index.tsx +13 -13
  600. package/src/inputs/Input/inputsInputScenarios.ts +405 -0
  601. package/src/inputs/Label/Label.stories.js +1 -1
  602. package/src/inputs/Label/index.test.tsx +20 -0
  603. package/src/inputs/Label/index.tsx +1 -4
  604. package/src/inputs/OtpInput/OtpInput.stories.js +1 -1
  605. package/src/inputs/OtpInput/index.mdx +23 -0
  606. package/src/inputs/OtpInput/index.test.tsx +20 -0
  607. package/src/inputs/OtpInput/index.tsx +2 -2
  608. package/src/inputs/Radio/Radio.stories.js +3 -3
  609. package/src/inputs/Radio/__stories__/Conditional.tsx +4 -1
  610. package/src/inputs/Radio/index.mdx +33 -0
  611. package/src/inputs/Radio/index.test.tsx +28 -0
  612. package/src/inputs/Radio/index.tsx +65 -6
  613. package/src/inputs/Select/Select.stories.js +1 -1
  614. package/src/inputs/Select/index.mdx +17 -0
  615. package/src/inputs/Select/index.test.tsx +20 -0
  616. package/src/inputs/inputsScenarios.ts +503 -0
  617. package/src/lazy.js +61 -0
  618. package/src/locales/el.ts +3 -0
  619. package/src/registry.js +6 -0
  620. package/src/types.tsx +21 -19
  621. package/src/utils.ts +34 -33
  622. package/src/validators/index.ts +5 -0
  623. package/src/validators/utils/file.ts +9 -9
  624. package/src/validators/utils/phone.ts +143 -72
  625. package/src/validators/validators.spec.ts +3 -37
  626. package/types/index.js +1 -1
  627. package/types.d.ts +2 -0
  628. package/types.js.map +7 -0
  629. package/utils/index.js +56 -77
  630. package/utils.js.map +7 -0
  631. package/validators/index.js +101 -110
  632. package/validators/index.js.map +7 -0
  633. package/validators/types/index.js +1 -1
  634. package/validators/types.js.map +7 -0
  635. package/validators/utils/afm/index.js +16 -16
  636. package/validators/utils/afm.js.map +7 -0
  637. package/validators/utils/file/index.js +22 -42
  638. package/validators/utils/file.js.map +7 -0
  639. package/validators/utils/iban/index.js +14 -12
  640. package/validators/utils/iban.js.map +7 -0
  641. package/validators/utils/image/index.js +66 -106
  642. package/validators/utils/image.js.map +7 -0
  643. package/validators/utils/index.js +54 -48
  644. package/validators/utils/index.js.map +7 -0
  645. package/validators/utils/int/index.js +12 -7
  646. package/validators/utils/int.js.map +7 -0
  647. package/validators/utils/number/index.js +11 -6
  648. package/validators/utils/number.js.map +7 -0
  649. package/validators/utils/otp/index.js +13 -8
  650. package/validators/utils/otp.js.map +7 -0
  651. package/validators/utils/phone/index.js +146 -82
  652. package/validators/utils/phone.d.ts +2 -2
  653. package/validators/utils/phone.js.map +7 -0
  654. package/validators/utils/postal_code/index.js +14 -11
  655. package/validators/utils/postal_code.js.map +7 -0
  656. package/validators/utils/text_limit/index.js +18 -20
  657. package/validators/utils/text_limit.js.map +7 -0
  658. package/validators/utils/uuid4/index.js +12 -8
  659. package/validators/utils/uuid4.js.map +7 -0
  660. package/Field/index.mdx +0 -6
  661. package/FieldArray/FieldArray.stories.playwright.json +0 -353
  662. package/FormBuilder/FormBuilder.mdx +0 -256
  663. package/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  664. package/MultiplicityField/MultiplicityField.mdx +0 -590
  665. package/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  666. package/Questions/__snapshots__/index.spec.tsx.snap +0 -596
  667. package/Questions/index.mdx +0 -415
  668. package/Questions/index.spec/index.js +0 -59
  669. package/cjs/Field/index.mdx +0 -6
  670. package/cjs/FieldArray/FieldArray.stories.playwright.json +0 -353
  671. package/cjs/FormBuilder/FormBuilder.mdx +0 -256
  672. package/cjs/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  673. package/cjs/MultiplicityField/MultiplicityField.mdx +0 -590
  674. package/cjs/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  675. package/cjs/Questions/__snapshots__/index.spec.tsx.snap +0 -596
  676. package/cjs/Questions/index.mdx +0 -415
  677. package/cjs/Questions/index.spec/index.js +0 -63
  678. package/cjs/create-simple-form.mdx +0 -539
  679. package/cjs/index.mdx +0 -51
  680. package/cjs/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  681. package/cjs/inputs/Checkboxes/index.mdx +0 -0
  682. package/cjs/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  683. package/cjs/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  684. package/cjs/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  685. package/cjs/inputs/Input/Input.stories.playwright.json +0 -376
  686. package/cjs/inputs/Input/__stories__/Default/index.js +0 -33
  687. package/cjs/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -39
  688. package/cjs/inputs/Input/index.mdx +0 -8
  689. package/cjs/inputs/Label/Label.stories.playwright.json +0 -40
  690. package/cjs/inputs/Label/index.mdx +0 -0
  691. package/cjs/inputs/Radio/Radio.stories.playwright.json +0 -73
  692. package/cjs/inputs/Radio/index.mdx +0 -0
  693. package/cjs/inputs/Select/Select.stories.playwright.json +0 -22
  694. package/cjs/installation.mdx +0 -68
  695. package/cjs/validators/validators.spec/index.js +0 -87
  696. package/create-simple-form.mdx +0 -539
  697. package/index.mdx +0 -51
  698. package/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  699. package/inputs/Checkboxes/index.mdx +0 -0
  700. package/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  701. package/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  702. package/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  703. package/inputs/Input/Input.stories.playwright.json +0 -376
  704. package/inputs/Input/__stories__/Default/index.js +0 -23
  705. package/inputs/Input/__stories__/Default.d.ts +0 -3
  706. package/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -29
  707. package/inputs/Input/__stories__/TextWithCharacterLimit/package.json +0 -6
  708. package/inputs/Input/__stories__/TextWithCharacterLimit.d.ts +0 -3
  709. package/inputs/Input/index.mdx +0 -8
  710. package/inputs/Label/Label.stories.playwright.json +0 -40
  711. package/inputs/Label/index.mdx +0 -0
  712. package/inputs/Radio/Radio.stories.playwright.json +0 -73
  713. package/inputs/Radio/index.mdx +0 -0
  714. package/inputs/Select/Select.stories.playwright.json +0 -22
  715. package/installation.mdx +0 -68
  716. package/src/FieldArray/FieldArray.stories.playwright.json +0 -353
  717. package/src/FormBuilder/FormBuilder.stories.playwright.json +0 -52
  718. package/src/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
  719. package/src/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
  720. package/src/inputs/DateInput/DateInput.stories.playwright.json +0 -72
  721. package/src/inputs/FileInput/FileInput.stories.playwright.json +0 -75
  722. package/src/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
  723. package/src/inputs/Input/Input.stories.playwright.json +0 -376
  724. package/src/inputs/Label/Label.stories.playwright.json +0 -40
  725. package/src/inputs/Radio/Radio.stories.playwright.json +0 -73
  726. package/src/inputs/Select/Select.stories.playwright.json +0 -22
  727. package/validators/validators.spec/index.js +0 -85
@@ -1,590 +0,0 @@
1
- ---
2
- id: ask-users-recursive
3
- title: Ask users for recursive data
4
- ---
5
-
6
- import LeadText from '@site/src/components/LeadText';
7
-
8
- <LeadText>
9
- Multiplicity & FieldArray fields allow users to input data described by a
10
- particular schema for an arbitrary number of times until they are done. It can
11
- be used to input a fixed, a minimum, and a maximum length of instances.
12
- </LeadText>
13
-
14
- ## What we are trying to achieve
15
-
16
- First off, a bit of history. This field was developed to meet the needs of several
17
- GOV.GR services. They needed an easy way to add multiple objects in an array of
18
- data while they could still keep the usability of a web form, submitting data and
19
- validating the fields as well. As part of the prototype phase, an initial
20
- implementation was designed and used in Dilosi for several document templates.
21
- It used a single button to add new items in the array and opened a modal,
22
- blocking the rest of the user interface and prompting users to input data.
23
- During this process, the `FieldArray` component was conceived.
24
-
25
- Meanwhile, Digigov SDK got these requirements and started working on a more
26
- versatile version of this feature. The new field was developed from scratch as
27
- an accessible and guided way to fill arrays with objects. Also, we wanted to
28
- provide an easy-to-use component for developers. The input fields that will
29
- collect data for each item in the array are described by a JSON schema, then
30
- provided to `@digigov/form` to manage internally. These fields describe
31
- properties for a data entity like a citizen and their personal details, and it
32
- can be reused internally multiple times by `@digigov/form` to generate data
33
- objects based on this schema.
34
-
35
- ## Accessibility & usability
36
-
37
- We aim to have semantically correct and valid forms, and as a result we cannot
38
- mix form-related HTML elements, like `form`, `input`, `label` with generic ones,
39
- eg. `div`, cards or other custom components. For example, if we try to add a
40
- paragraph element inside a form, React will throw warnings in our console.
41
- Instead of creating complex interfaces that try to do too much too fast, Digigov
42
- Form recommends using forms in their original way, filling and validating
43
- inputs, then submitting the form as a whole.
44
-
45
- Adding another dimension to this problem, we should make sure our interfaces
46
- are entirely accessible to screen readers and other accessibility tools. This is
47
- the reason we decided to design the flow to be as guided and recoverable as
48
- possible. Forms and fields should read like well-written pieces of text and
49
- make sense to the users. While validation fails, the system provides users with
50
- meaningful error messages and instructs them on how to fix the validation errors to
51
- proceed. Once the validation is successful, the flow can proceed with
52
- submmitting data. In any case, it is imperative to provide meaningful
53
- information to the users at each step. Thus, we should avoid the use of 🌈
54
- “magic“ ✨ UX solutions that presume users have developed digital skills and
55
- most of the time are used for expert use cases.
56
-
57
- Initially, we used an add button that users clicked to explicitly create with
58
- their action a new item in the array, but in this way we cannot programmatically
59
- ensure that users still have stuff to enter to the system. What we decided to do
60
- is to turn this state check into a direct question that will be a part of the final
61
- form. We created a question that will make sure that users always provide the
62
- form with their intention.
63
-
64
- Both FieldArray and MultiplicityField will result in the same data output when
65
- users submit the form, which is an `array` that contains `objects` described by
66
- the `extra.fields` key. The component internally uses the
67
- [useFieldArray](https://www.react-hook-form.com/api/usefieldarray) hook from
68
- react-hook-form.
69
-
70
- :::caution
71
-
72
- We strongly recommend that services concerning citizens use `Multiplicity`, instead
73
- of `FieldArray`.
74
-
75
- Please be careful when and how you use a `FieldArray` component. Many users are not
76
- familiar with modern user interface design practices, and it is likely they will
77
- be confused. If you choose to use it, please provide meaningful hints in the
78
- `extra.label.object.nothing_added` and `extra.label.object.title_added` keys.
79
-
80
- :::
81
-
82
- Users should fill in data as this schema dictates, and every time
83
- they add something, we should ask them if they want to continue adding or escape
84
- the loop. We could also add some limits to the number of items users create,
85
- resulting in an array with specific cardinality. By doing so, we can validate the
86
- form state at any time, regardless of whether a user is in the process of data input
87
- or reviewing what they've added. In any case, the form should guide users
88
- through steps and validation errors, and avoid giving too much freedom of
89
- action that could lead to estranged users losing the intended path or their
90
- focus.
91
-
92
- Those are a lot of things to keep in mind, but luckily we've got you covered. How
93
- can we code this feature as part of a Digigov form, you ask?
94
-
95
- ## Introducing the Multiplicity field
96
-
97
- To deal with these features, we have decided to create a composite field that uses
98
- custom object schema for the input fields alongside some internal helpers to
99
- make sure that the flow is usable from beginning to end. In reality, this
100
- field is in fact considered as a normal single key-value pair by the
101
- `@digigov/form`, same as every other input type. The only difference is that the
102
- type of the value will be an `Array` instead of any other primitive used for a
103
- field type, like `string`, `number`, etc. Inside the array, each one of the
104
- indexes will be an object with nested field values.
105
-
106
- This field is the most complex component we currently offer, and it uses the
107
- [useFieldArray](https://www.react-hook-form.com/api/usefieldarray) hook from
108
- react-hook-form under the hood. First, let's take a look at what it looks like, and then we can
109
- break down its functionality and how you can use it.
110
-
111
- ```jsx live
112
- import React from 'react';
113
- import Form, { Field } from '@digigov/form';
114
- import Button from '@digigov/ui/form/Button';
115
-
116
- export default function SimpleForm() {
117
- return (
118
- <Form>
119
- <Field
120
- key="vehicles"
121
- name="vehicles"
122
- label={{ primary: 'Vehicles' }}
123
- type="array"
124
- extra={{
125
- border: true,
126
- label: {
127
- object: {
128
- title: 'Vehicle',
129
- title_added: 'The vehicles you have already added',
130
- add: 'Add',
131
- delete: 'Remove',
132
- },
133
- question: {
134
- title: 'Do you want to add more vehicles?',
135
- objectLabel: {
136
- primary: 'Add one more of your vehicles',
137
- secondary: 'Fill in the details below and then click “Add“.',
138
- },
139
- yes: 'Yes',
140
- no: 'No',
141
- },
142
- },
143
- of: {
144
- type: 'object',
145
- label: {
146
- primary: 'Vehicle details',
147
- secondary: 'See and change the details of a vehicle',
148
- },
149
- extra: {
150
- fields: [
151
- {
152
- key: 'registration_date',
153
- type: 'date',
154
- required: true,
155
- label: { primary: 'Registration date' },
156
- },
157
- {
158
- key: 'make',
159
- type: 'string',
160
- required: true,
161
- label: {
162
- primary: 'Make',
163
- },
164
- },
165
- {
166
- key: 'model',
167
- type: 'string',
168
- required: true,
169
- label: {
170
- primary: 'Model',
171
- },
172
- },
173
- ],
174
- },
175
- },
176
- }}
177
- required
178
- />
179
- <Button type="submit">Submit</Button>
180
- </Form>
181
- );
182
- }
183
- ```
184
-
185
- ### How to use it
186
-
187
- Before we begin, we should setup an empty form. We are going to need a main `Form`
188
- and a submit `Button` that will trigger the `onSubmit` events in our React form.
189
-
190
- ```jsx
191
- import React from 'react';
192
- import Form from '@digigov/form';
193
- import Button from '@digigov/ui/form/Button';
194
-
195
- export default function MultiplicityForm() {
196
- return (
197
- <Form>
198
- {/* this is where all fields will eventually be rendered */}
199
- <Button type="submit">Submit</Button>
200
- </Form>
201
- );
202
- }
203
- ```
204
-
205
- As you may have already assumed, this boilerplate code will not get us very far.
206
- We need an actual `Field` component that will be of `type: 'array'` since we
207
- need a value that contains multiple instances of a single schema. Given that we
208
- are asking users for information about their vehicles, we can also fill in the `key`,
209
- `label.primary`, as well as the `type` and `required`
210
- props.
211
-
212
- ```jsx
213
- <Field
214
- key="vehicles"
215
- name="vehicles"
216
- label={{ primary: 'Vehicles' }}
217
- type="array"
218
- required
219
- />
220
- ```
221
-
222
- Although this code may seem enough at first glance, it will soon become clear
223
- that Multiplicity packs a lot of functionality. It needs context in the form of
224
- natural language, Greek, English, or any other language dictated by the user needs
225
- in order to carry meaning to the end users.
226
-
227
- It also needs the schema of the form fields to be filled for each iteration. To
228
- do so, inside the `extra` key we can add an `of` key. This `of` key will contain
229
- a key named `label` and a key name `type`, signifying the label text and the type of the
230
- inner form, respectively.
231
-
232
- Inside the `of` key you can add an `extra` key that will then contain a `fields`
233
- key describing the field props for all inputs needed.
234
-
235
- ```js
236
- // this will be used as value for the `extra` prop
237
- {
238
- of: {
239
- type: 'object',
240
- label: {
241
- primary: 'Vehicle details',
242
- secondary: 'See and change the details of a vehicle',
243
- },
244
- extra: {
245
- fields: [
246
- {
247
- key: 'registration_date',
248
- type: 'date',
249
- required: true,
250
- label: { primary: 'Registration date' },
251
- },
252
- {
253
- key: 'make',
254
- type: 'string',
255
- required: true,
256
- label: {
257
- primary: 'Make',
258
- },
259
- },
260
- {
261
- key: 'model',
262
- type: 'string',
263
- required: true,
264
- label: {
265
- primary: 'Model',
266
- },
267
- },
268
- ],
269
- },
270
- },
271
- }
272
- ```
273
-
274
- ## Introducing the FieldArray field
275
-
276
- As a simpler alternative to Multiplicity, we also offer the original
277
- implementation called `FieldArray` which may be used in dashboards or other apps
278
- used by expert users or administrators of any kind. FieldArray skips all the
279
- extra safety features and protections of the Multiplicity and offers more
280
- flexibility for the end user.
281
-
282
- ### How to use it
283
-
284
- We tried to maintain the differences in the API between the two implementations
285
- as little as possible. The only thing that is required for you to do to use the
286
- FieldArray instead of the Multiplicity, is to explicitly disable the
287
- multiplicity functionality, by using the `multiplicity={false}` prop.
288
-
289
- As a result, if you learn how to use one, you can easily use the other, and
290
- naturally, you can also change their behaviour by changing a single prop in your
291
- React code.
292
-
293
- ```jsx
294
- <Field
295
- key="vehicles"
296
- name="vehicles"
297
- label={{ primary: 'Vehicles' }}
298
- type="array"
299
- // highlight-next-line
300
- multiplicity={false}
301
- required
302
- />
303
- ```
304
-
305
- The end result looks very different from Multiplicity at first glance, but you
306
- can achieve the same results with both of them.
307
-
308
- ```jsx live
309
- import React from 'react';
310
- import Form, { Field } from '@digigov/form';
311
- import Button from '@digigov/ui/form/Button';
312
-
313
- export default function SimpleForm() {
314
- return (
315
- <Form>
316
- <Field
317
- key="vehicles"
318
- name="vehicles"
319
- label={{ primary: 'Vehicles' }}
320
- type="array"
321
- multiplicity={false}
322
- extra={{
323
- border: true,
324
- label: {
325
- object: {
326
- title: 'Vehicle',
327
- title_added: 'The vehicles you have already added',
328
- nothing_added: 'You have not added any vehicles yet.',
329
- add: 'Add vehicle',
330
- delete: 'Remove',
331
- },
332
- question: {
333
- title: 'Do you want to add more vehicles?',
334
- objectLabel: {
335
- primary: 'Add one more of your vehicles',
336
- secondary: 'Fill in the details below and then click “Add“.',
337
- },
338
- yes: 'Yes',
339
- no: 'No',
340
- },
341
- },
342
- of: {
343
- type: 'object',
344
- label: {
345
- primary: 'Vehicle details',
346
- secondary: 'See and change the details of a vehicle',
347
- },
348
- extra: {
349
- fields: [
350
- {
351
- key: 'registration_date',
352
- type: 'date',
353
- required: true,
354
- label: { primary: 'Registration date' },
355
- },
356
- {
357
- key: 'make',
358
- type: 'string',
359
- required: true,
360
- label: {
361
- primary: 'Make',
362
- },
363
- },
364
- {
365
- key: 'model',
366
- type: 'string',
367
- required: true,
368
- label: {
369
- primary: 'Model',
370
- },
371
- },
372
- ],
373
- },
374
- },
375
- }}
376
- required
377
- />
378
- <Button type="submit">Submit</Button>
379
- </Form>
380
- );
381
- }
382
- ```
383
-
384
- ## Validating form data
385
-
386
- Luckily, if you want to validate the values of the nested fields, for instance,
387
- the first name of a vehicle, you don't have to perform any further actions. The fields'
388
- validation will work right out of the box, same as any other form.
389
-
390
- There is another use case that is available as part of the
391
- MultiplicityField. Given that the value of this field type is an array, we
392
- should expect to need some length validation sooner than later.
393
-
394
- ### Exact length
395
-
396
- You can easily validate the exact length of the items added to the multipliticy
397
- array, simply by using the `extra.length` prop.
398
-
399
- ```jsx
400
- <Field
401
- extra={{
402
- length: 2,
403
- of: { ... },
404
- label: { ... },
405
- }}
406
- />
407
- ```
408
-
409
- The example below will validate this and show all the error messages necessary
410
- to make sure that the users understand what is going wrong with the process.
411
-
412
- ```jsx live
413
- import React from 'react';
414
- import Form, { Field } from '@digigov/form';
415
- import Button from '@digigov/ui/form/Button';
416
-
417
- export default function SimpleForm() {
418
- return (
419
- <Form>
420
- <Field
421
- key="vehicles"
422
- name="vehicles"
423
- label={{ primary: 'Vehicles' }}
424
- type="array"
425
- multiplicity={true}
426
- extra={{
427
- border: true,
428
- length: 3,
429
- label: {
430
- object: {
431
- title: 'Vehicle',
432
- title_added: 'The vehicles you have already added',
433
- add: 'Add',
434
- delete: 'Remove',
435
- },
436
- question: {
437
- title: 'Do you want to add more vehicles?',
438
- objectLabel: {
439
- primary: 'Add one more of your vehicles',
440
- secondary: 'Fill in the details below and then click “Add“.',
441
- },
442
- yes: 'Yes',
443
- no: 'No',
444
- },
445
- },
446
- of: {
447
- type: 'object',
448
- label: {
449
- primary: 'Vehicle details',
450
- secondary: 'See and change the details of a vehicle',
451
- },
452
- extra: {
453
- fields: [
454
- {
455
- key: 'registration_date',
456
- type: 'date',
457
- required: true,
458
- label: { primary: 'Registration date' },
459
- },
460
- {
461
- key: 'make',
462
- type: 'string',
463
- required: true,
464
- label: {
465
- primary: 'Make',
466
- },
467
- },
468
- {
469
- key: 'model',
470
- type: 'string',
471
- required: true,
472
- label: {
473
- primary: 'Model',
474
- },
475
- },
476
- ],
477
- },
478
- },
479
- }}
480
- required
481
- />
482
- <Button type="submit">Submit</Button>
483
- </Form>
484
- );
485
- }
486
- ```
487
-
488
- ### Min or max length
489
-
490
- You can also use the min or max length validation to define the cardinality
491
- range for the array. You can use only the `min` key to add a minimum length of
492
- items or only the `max` key to limit them.
493
-
494
- :::caution
495
-
496
- Do not mix and match the exact `length` validation with the `min` or `max`.
497
-
498
- :::
499
-
500
- ```jsx
501
- <Field
502
- extra={{
503
- min: 2,
504
- max: 5,
505
- of: { ... },
506
- label: { ... },
507
- }}
508
- />
509
- ```
510
-
511
- The example below will validate this and show all the error messages necessary
512
- to make sure that the users understand what is going wrong with the process.
513
-
514
- ```jsx live
515
- import React from 'react';
516
- import Form, { Field } from '@digigov/form';
517
- import Button from '@digigov/ui/form/Button';
518
-
519
- export default function SimpleForm() {
520
- return (
521
- <Form>
522
- <Field
523
- key="vehicles"
524
- name="vehicles"
525
- label={{ primary: 'Vehicles' }}
526
- type="array"
527
- multiplicity={true}
528
- extra={{
529
- border: true,
530
- min: 2,
531
- max: 5,
532
- label: {
533
- object: {
534
- title: 'Vehicle',
535
- title_added: 'The vehicles you have already added',
536
- nothing_added: 'You have not added any vehicles yet.',
537
- add: 'Add',
538
- delete: 'Remove',
539
- },
540
- question: {
541
- title: 'Do you want to add more vehicles?',
542
- objectLabel: {
543
- primary: 'Add one more of your vehicles',
544
- secondary: 'Fill in the details below and then click “Add“.',
545
- },
546
- yes: 'Yes',
547
- no: 'No',
548
- },
549
- },
550
- of: {
551
- type: 'object',
552
- label: {
553
- primary: 'Vehicle details',
554
- secondary: 'See and change the details of a vehicle',
555
- },
556
- extra: {
557
- fields: [
558
- {
559
- key: 'registration_date',
560
- type: 'date',
561
- required: true,
562
- label: { primary: 'Registration date' },
563
- },
564
- {
565
- key: 'make',
566
- type: 'string',
567
- required: true,
568
- label: {
569
- primary: 'Make',
570
- },
571
- },
572
- {
573
- key: 'model',
574
- type: 'string',
575
- required: true,
576
- label: {
577
- primary: 'Model',
578
- },
579
- },
580
- ],
581
- },
582
- },
583
- }}
584
- required
585
- />
586
- <Button type="submit">Submit</Button>
587
- </Form>
588
- );
589
- }
590
- ```