@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,539 +0,0 @@
1
- ---
2
- id: create-simple-form
3
- title: Create a simple Digigov Form
4
- sidebar_label: Creating simple forms
5
- ---
6
-
7
- import LeadText from '@site/src/components/LeadText';
8
-
9
- <LeadText>
10
- This guide walks through building a simple form page, complete with validation
11
- and data serialisation.
12
- </LeadText>
13
-
14
- ## What we are building
15
-
16
- Before we start diving into more advanced usecases, let's first create a form
17
- asking users for their personal information.
18
-
19
- - First name
20
- - Last name
21
- - AFM (Greek tax number)
22
- - Telephone number
23
- - Marital status
24
-
25
- As you can see, this form is pretty basic. But even for a basic form like this
26
- we want to implement features that will help our users submit their data. We
27
- should add basic input validations and get any data from those inputs, assuming
28
- that these validation checks passed. These features are not rocket science, but
29
- even though they are used all the time, there is a lot of boilerplate code that
30
- can be abstracted away.
31
-
32
- Let's see how Digigov Form helps us build forms in no time.
33
-
34
- ## Create your first form component
35
-
36
- Let's start by creating a form in plain HTML. In this example, the first element
37
- we use is a `<form>` followed by `<label>` and `<input>` elements. These are
38
- primitive elements.
39
-
40
- ```jsx
41
- import React from 'react';
42
-
43
- export default function SimpleForm() {
44
- return (
45
- <form>
46
- <label>
47
- Name:
48
- <input type="text" name="name" />
49
- </label>
50
- <input type="submit" value="Submit" />
51
- </form>
52
- );
53
- }
54
- ```
55
-
56
- In Digigov Form, we use the same primitive elements under the hood but we add a
57
- lot of built-in functionality. Let's take a quick look on how we can transform
58
- the same form using Digigov Form.
59
-
60
- The default export of `@digigov/form` package is a React component that can be
61
- used for wrapping Field components. The component is the same as
62
- `@digigov/form/FormBuilder` and it can be used in two distinct ways. We will
63
- talk about that in a more advanced guide.
64
-
65
- ```jsx
66
- import React from 'react';
67
- // highlight-next-line
68
- import Form from '@digigov/form';
69
-
70
- export default function SimpleForm() {
71
- // highlight-start
72
- return <Form>{/* this is where the fields are going to be placed */}</Form>;
73
- // highlight-end
74
- }
75
- ```
76
-
77
- ## Adding the first field
78
-
79
- In this state, the form is just an empty shell waiting for us to define its
80
- fields. According to our initial requirements set in the beginning of this
81
- guide, we should create a new field with label ‘First name‘.
82
-
83
- Let's go ahead and import the `Field` component and use it to render an input
84
- field and a label. This component creates and manages any necessary React
85
- components transparently. All you need to do is describe a few React props.
86
-
87
- - `key`
88
- - `name`
89
- - `type`
90
- - `label`
91
- - `required`
92
-
93
- These props can be then passed down the `Field` component which will be rendered
94
- by `FormBuilder`.
95
-
96
- Take a look at this live example. You can also use the live editor to play
97
- around with the example code.
98
-
99
- ```jsx
100
- import React from 'react';
101
- // highlight-next-line
102
- import Form, { Field } from '@digigov/form';
103
-
104
- export default function SimpleForm() {
105
- return (
106
- <Form>
107
- // highlight-start
108
- <Field
109
- key="firstName"
110
- name="firstName"
111
- label={{ primary: 'First name' }}
112
- type="string"
113
- required
114
- />
115
- // highlight-end
116
- </Form>
117
- );
118
- }
119
- ```
120
-
121
- Hooray! 🎉
122
-
123
- It looks like the first two fields of our awesome form are working as
124
- expected. They are pretty basic, string inputs, accepting data input but they
125
- don't seem to submit data or do any validation in their current state.
126
-
127
- ```jsx live
128
- import React from 'react';
129
- import Form, { Field } from '@digigov/form';
130
-
131
- export default function SimpleForm() {
132
- return (
133
- <Form>
134
- <Field
135
- key="firstName"
136
- name="firstName"
137
- label={{ primary: 'First name' }}
138
- type="string"
139
- required
140
- />
141
- <Field
142
- key="lastName"
143
- name="lastName"
144
- label={{ primary: 'Last name' }}
145
- type="string"
146
- required
147
- />
148
- </Form>
149
- );
150
- }
151
- ```
152
-
153
- ## Adding a submit button
154
-
155
- Before we proceed with adding the rest of the fields, we should first make sure
156
- that the form is working, validating and submitting data.
157
-
158
- Let's modify the previous example and use a `@digigov/ui/form/Button` to submit
159
- data. First we should import the button component and use it right at the
160
- bottom of our form.
161
-
162
- It is important to note that you should make sure the Button has a
163
- `type="submit"` prop. In any other case, the button will not exhibit the correct
164
- behaviour when users try to submit data using their keyboard (eg. hitting the
165
- enter key) or using any other tools eg. screen readers.
166
-
167
- ```jsx
168
- import React from 'react';
169
- import Form, { Field } from '@digigov/form';
170
- // highlight-next-line
171
- import Button from '@digigov/ui/form/Button';
172
-
173
- export default function SimpleForm() {
174
- return (
175
- <Form>
176
- {/* this is where the fields are going to be placed */}
177
- <Field
178
- key="firstName"
179
- name="firstName"
180
- label={{ primary: 'First name' }}
181
- type="string"
182
- required
183
- />
184
- <Field
185
- key="lastName"
186
- name="lastName"
187
- label={{ primary: 'Last name' }}
188
- type="string"
189
- required
190
- />
191
- // highlight-next-line
192
- <Button type="submit">Continue</Button>
193
- </Form>
194
- );
195
- }
196
- ```
197
-
198
- The code now looks fine. You can go ahead and test that the fields are
199
- validating as we have instructed them. The form should display red errors when
200
- you try to submit it with empty values.
201
-
202
- Go ahead and try it in the live example below. You can also remove the
203
- `required` prop from one of the fields in the live editor, and see how that
204
- affects the submit behaviour.
205
-
206
- ```jsx live
207
- import React from 'react';
208
- import Form, { Field } from '@digigov/form';
209
- import Button from '@digigov/ui/form/Button';
210
-
211
- export default function SimpleForm() {
212
- return (
213
- <Form>
214
- {/* this is where the fields are going to be placed */}
215
- <Field
216
- key="firstName"
217
- name="firstName"
218
- label={{ primary: 'First name' }}
219
- type="string"
220
- required
221
- />
222
- <Field
223
- key="lastName"
224
- name="lastName"
225
- label={{ primary: 'Last name' }}
226
- type="string"
227
- required
228
- />
229
- <Button type="submit">Continue</Button>
230
- </Form>
231
- );
232
- }
233
- ```
234
-
235
- Straightaway, the form is actually doing something and it is validating our
236
- inputs with almost zero coding needed.
237
-
238
- That's good. But we have yet to gather data in our code when users submit the form.
239
-
240
- Note. We should note that behind the scenes the Digigov Form inherits a prop (from [React Hook Form](https://react-hook-form.com/api/useform/)) called `shouldFocusError`
241
- which sets focus on the first field that has an error. You can check it out by pessing the submit button.
242
-
243
- ## Handling onSubmit events
244
-
245
- Naturally, when we get data from HTML forms, we make use of the `submit` events
246
- that are bubbling up. In React, we follow the convention of naming event
247
- handlers like `onChange` and `onSubmit`.
248
-
249
- We use the same familiar pattern as many other libraries. We get data inside an
250
- event handler function and we can render this information in our application or
251
- choose to send it to a remote server via an API.
252
-
253
- In our case, we need a quick and dirty way to display the actual values we have
254
- just entered to a form right back to us and render them for debugging purposes.
255
-
256
- We will use the `useState` hook inside our functional component. This will let
257
- us react to a `submit` event and locally save the form data as key-value pairs
258
- in our state. Then we can call `JSON.stringify` and render the raw JSON
259
- information.
260
-
261
- ```jsx
262
- // highlight-next-line
263
- import React, { useState } from 'react';
264
- import Form, { Field } from '@digigov/form';
265
- import Button from '@digigov/ui/form/Button';
266
-
267
- export default function SimpleForm() {
268
- // highlight-start
269
- const [submittedData, setSubmittedData] = useState({});
270
- const handleSubmit = (data) => {
271
- setSubmittedData(data);
272
- };
273
- return (
274
- <>
275
- <Form onSubmit={handleSubmit}>
276
- // highlight-end
277
- {/* this is where the fields are going to be placed */}
278
- <Field
279
- key="firstName"
280
- name="firstName"
281
- label={{ primary: 'First name' }}
282
- type="string"
283
- required
284
- />
285
- <Field
286
- key="lastName"
287
- name="lastName"
288
- label={{ primary: 'Last name' }}
289
- type="string"
290
- required
291
- />
292
- <Button type="submit">Continue</Button>
293
- </Form>
294
- // highlight-start
295
- {
296
- <>
297
- You submitted the following values
298
- <pre>
299
- <code>{JSON.stringify(submittedData)}</code>
300
- </pre>
301
- </>
302
- }
303
- // highlight-end
304
- </>
305
- );
306
- }
307
- ```
308
-
309
- As you can see in the live example when the form first loads, the submitted data
310
- is an empty object, which is actually the default value we have given the
311
- `useState` hook when we declare it.
312
-
313
- Go ahead and fill the inputs with your first and last name. Then click the
314
- button or press enter and see what happens.
315
-
316
- ```jsx live
317
- import React, { useState } from 'react';
318
- import Form, { Field } from '@digigov/form';
319
- import Button from '@digigov/ui/form/Button';
320
- import Paragraph from '@digigov/ui/typography/Paragraph';
321
-
322
- export default function SimpleForm() {
323
- const [submittedData, setSubmittedData] = useState({});
324
- const handleSubmit = (data) => {
325
- setSubmittedData(data);
326
- };
327
- return (
328
- <>
329
- <Form onSubmit={handleSubmit}>
330
- {/* this is where the fields are going to be placed */}
331
- <Field
332
- key="firstName"
333
- name="firstName"
334
- label={{ primary: 'First name' }}
335
- type="string"
336
- required
337
- />
338
- <Field
339
- key="lastName"
340
- name="lastName"
341
- label={{ primary: 'Last name' }}
342
- type="string"
343
- required
344
- />
345
- <Button type="submit">Continue</Button>
346
- </Form>
347
- {
348
- <Paragraph>
349
- You have submitted the following values
350
- <pre>
351
- <code>{JSON.stringify(submittedData)}</code>
352
- </pre>
353
- </Paragraph>
354
- }
355
- </>
356
- );
357
- }
358
- ```
359
-
360
- That's great, now we have a form that's actually interactive in some way. The
361
- inputs are validating data entered and it kindly provides us the submitted data.
362
-
363
- We're so close to achieve our original goal of a simple working form.
364
-
365
- ## Adding miscellaneous fields
366
-
367
- It is time to expand our little form and make it render a few more advanced
368
- fields. We want to get the AFM number, which is used by Greek tax authorities
369
- and a telephone number. Both of these need custom validations that ensure the
370
- correct format for user input. Also, we want to get the marital status of our
371
- users.
372
-
373
- ### AFM & Phone number with validation
374
-
375
- For these two fields, we can follow exactly the same pattern we have used for
376
- `firstName` and `lastName` before.
377
-
378
- In the case of the AFM, the `type` prop will have a value of `afm`. This prop
379
- will apply the appropriate validation in the Field.
380
-
381
- Also, please note the use of the `secondary` value in the `label` prop. It is
382
- used to provide explanation for each field. We can use it to inform users about
383
- the format of this tax number
384
-
385
- ```jsx
386
- <Field
387
- key="taxNumber"
388
- name="taxNumber"
389
- type="afm"
390
- label={{
391
- primary: 'Tax number',
392
- secondary: 'Tax number is your AFM number, given to you by AADE',
393
- }}
394
- required
395
- />
396
- ```
397
-
398
- A similar field can be used for the phone number. You can use the
399
- `type="phone_number"` to validate this field.
400
-
401
- ```jsx
402
- <Field
403
- key="phoneNumber"
404
- name="phoneNumber"
405
- type="phone_number"
406
- label={{
407
- primary: 'Phone number',
408
- secondary: 'You can enter any landline phone number.',
409
- }}
410
- required
411
- />
412
- ```
413
-
414
- ### Marital status as a radio group
415
-
416
- Last but not least, we should create a single choice field, which will be
417
- rendered as a radio group of answers.
418
-
419
- ```jsx
420
- <Field
421
- key="maritalStatus"
422
- name="maritalStatus"
423
- type="choice:single"
424
- label={{ primary: 'Marital status' }}
425
- required
426
- extra={{
427
- options: [
428
- {
429
- label: { primary: 'Married' },
430
- value: 'married',
431
- },
432
- {
433
- label: { primary: 'Cohabitation agreement' },
434
- value: 'cohabitation',
435
- },
436
- {
437
- label: { primary: 'Prefer not to answer' },
438
- value: 'wontanswer',
439
- },
440
- ],
441
- }}
442
- />
443
- ```
444
-
445
- ## Final form
446
-
447
- Finally, we have the code almost ready. Let's put it all together by adding the
448
- few last fields right above the submit button.
449
-
450
- Feel free to fill the form in the example and submit it.
451
-
452
- ```jsx live
453
- import React, { useState } from 'react';
454
- import Form, { Field } from '@digigov/form';
455
- import Button from '@digigov/ui/form/Button';
456
- import Paragraph from '@digigov/ui/typography/Paragraph';
457
-
458
- export default function SimpleForm() {
459
- const [submittedData, setSubmittedData] = useState({});
460
- const handleSubmit = (data) => {
461
- setSubmittedData(data);
462
- };
463
- return (
464
- <>
465
- <Form onSubmit={handleSubmit}>
466
- {/* this is where the fields are going to be placed */}
467
- <Field
468
- key="firstName"
469
- name="firstName"
470
- label={{ primary: 'First name' }}
471
- type="string"
472
- required
473
- />
474
- <Field
475
- key="lastName"
476
- name="lastName"
477
- label={{ primary: 'Last name' }}
478
- type="string"
479
- required
480
- />
481
- <Field
482
- key="taxNumber"
483
- name="taxNumber"
484
- type="afm"
485
- label={{
486
- primary: 'Tax number',
487
- secondary: 'Tax number is your AFM number, given to you by AADE',
488
- }}
489
- required
490
- />
491
- <Field
492
- key="phoneNumber"
493
- name="phoneNumber"
494
- type="phone_number"
495
- label={{
496
- primary: 'Phone number',
497
- secondary: 'You can enter any landline phone number.',
498
- }}
499
- required
500
- />
501
- <Field
502
- key="maritalStatus"
503
- name="maritalStatus"
504
- type="choice:single"
505
- label={{ primary: 'Marital status' }}
506
- required
507
- extra={{
508
- options: [
509
- {
510
- label: { primary: 'Married' },
511
- value: 'married',
512
- },
513
- {
514
- label: { primary: 'Cohabitation agreement' },
515
- value: 'cohabitation',
516
- },
517
- {
518
- label: { primary: 'Prefer not to answer' },
519
- value: 'wontanswer',
520
- },
521
- ],
522
- }}
523
- />
524
- <Button type="submit">Continue</Button>
525
- </Form>
526
- {
527
- <Paragraph>
528
- You have submitted the following values
529
- <pre>
530
- <code>{JSON.stringify(submittedData)}</code>
531
- </pre>
532
- </Paragraph>
533
- }
534
- </>
535
- );
536
- }
537
- ```
538
-
539
- Perfect! We now have a finished form, complete with field validation.
package/index.mdx DELETED
@@ -1,51 +0,0 @@
1
- ---
2
- id: Introduction
3
- title: Digigov Form
4
- sidebar_label: Introduction to Digigov Form
5
- ---
6
-
7
- import LeadText from '@site/src/components/LeadText';
8
-
9
- <LeadText>
10
- Digigov Form is an off-the-shelf solution for managing web forms using
11
- Reactjs. It supports flexible and multi-step forms and easy-to-use validation.
12
- This page will guide you through everything you need to create accessible and
13
- dynamic forms that can handle all sorts of user inputs.
14
- </LeadText>
15
-
16
- <img
17
- src="/img/form.svg"
18
- style={{ margin: '3rem 0', maxWidth: '450px', width: '60%' }}
19
- />
20
-
21
- ## Before we start
22
-
23
- Forms are essential for any modern application. We have done the heavy lifting of
24
- creating a library that will help you increase the productivity and the quality
25
- of your forms. You can choose from a variety of input types and validations and
26
- describe how form fields behave and restrict data input.
27
-
28
- Finally, we also offer an easy way to spread your forms across multiple pages or
29
- steps and still be able to gather data in a single serialized object that you
30
- will be able to save via an JSON API.
31
-
32
- ## Overview
33
-
34
- The `@digigov/form` NPM package contains React components and validators. The
35
- library uses basic, semantically correct HTML5 input fields.
36
-
37
- It adds dynamic control, interactivity and validations to the core input
38
- components implemented in `@digigov/react-core`. Styling is provided by
39
- `@digigov/css` library following the [GOV.GR design
40
- system](https://guide.services.gov.gr).
41
-
42
- Digigov Form uses two main libraries internally. The first is [React Hook
43
- Form](https://www.react-hook-form.com/) which helps us manage the form state and
44
- perform actions and mutations on it. The second is
45
- [Yup](https://github.com/jquense/yup) and it is used to validate form data. It
46
- interfaces with React Hook Form right out of the box, but also enables us to
47
- define custom validation types such as AMKA, AFM etc.
48
-
49
- Some basic functionalites of `@digigov/form` will be presented in the following
50
- sections and also we are going to guide you through some more advanced topics
51
- such as internationalisation, custom data validation etc.
@@ -1,85 +0,0 @@
1
- {
2
- "version": "4",
3
- "stories": {
4
- "digigov-form-inputs-checkboxes--default": {
5
- "actionSets": [
6
- {
7
- "actions": [
8
- {
9
- "name": "click",
10
- "args": {
11
- "selector": "html>body>div:nth-child(5)>form>button"
12
- }
13
- }
14
- ],
15
- "id": "6mm9fbbYacA3",
16
- "title": "show validation error"
17
- },
18
- {
19
- "actions": [
20
- {
21
- "name": "keyboard.press",
22
- "args": {
23
- "key": "Tab"
24
- }
25
- },
26
- {
27
- "name": "keyboard.press",
28
- "args": {
29
- "key": "Tab"
30
- }
31
- },
32
- {
33
- "name": "keyboard.press",
34
- "args": {
35
- "key": "Space"
36
- }
37
- },
38
- {
39
- "name": "keyboard.press",
40
- "args": {
41
- "key": "Tab"
42
- }
43
- },
44
- {
45
- "name": "keyboard.press",
46
- "args": {
47
- "key": "Space"
48
- }
49
- },
50
- {
51
- "name": "click",
52
- "args": {
53
- "selector": "html>body>div:nth-child(5)>form>div>fieldset>div>div:nth-child(1)>label>input"
54
- }
55
- },
56
- {
57
- "name": "click",
58
- "args": {
59
- "selector": "html>body>div:nth-child(5)>form>button"
60
- }
61
- }
62
- ],
63
- "id": "hBiOJ8xaQSWv",
64
- "title": "Focus and check using keyboard, click box and submit"
65
- }
66
- ]
67
- },
68
- "digigov-form-inputs-checkboxes--conditional": {
69
- "actionSets": [
70
- {
71
- "actions": [
72
- {
73
- "name": "click",
74
- "args": {
75
- "selector": "html>body>div:nth-child(5)>form>div>fieldset>div>div:nth-child(1)>label>input"
76
- }
77
- }
78
- ],
79
- "id": "zpUjNzrqwtmW",
80
- "title": "Checkboxes conditional action"
81
- }
82
- ]
83
- }
84
- }
85
- }
File without changes