@digigov/form 2.0.0-2a26e869 → 2.0.0-30d44ed9

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 (372) hide show
  1. package/Field/FieldBase/index.js +7 -3
  2. package/Field/FieldBase.js.map +2 -2
  3. package/Field/FieldBaseContainer/index.js +37 -18
  4. package/Field/FieldBaseContainer.d.ts +1 -1
  5. package/Field/FieldBaseContainer.js.map +2 -2
  6. package/Field/FieldConditional/index.js +4 -0
  7. package/Field/FieldConditional.js.map +2 -2
  8. package/Field/index.js +15 -4
  9. package/Field/index.js.map +2 -2
  10. package/Field/types.d.ts +13 -3
  11. package/Field/utils/index.js +9 -1
  12. package/Field/utils/index.js.map +2 -2
  13. package/Field/utils/useField/index.js +14 -1
  14. package/Field/utils/useField.js.map +2 -2
  15. package/FieldArray/FieldArray.stories.d.ts +1 -0
  16. package/FieldArray/FormDialog/index.js +397 -0
  17. package/{inputs/Input/inputsInputScenarios → FieldArray/FormDialog}/package.json +1 -1
  18. package/FieldArray/FormDialog.d.ts +66 -0
  19. package/FieldArray/FormDialog.js.map +7 -0
  20. package/FieldArray/__stories__/Default.d.ts +1 -1
  21. package/FieldArray/__stories__/WithExactLength.d.ts +1 -1
  22. package/FieldArray/__stories__/WithModal.d.ts +2 -0
  23. package/FieldArray/index.d.ts +6 -0
  24. package/FieldArray/index.js +82 -24
  25. package/FieldArray/index.js.map +2 -2
  26. package/FieldObject/index.d.ts +5 -0
  27. package/FieldObject/index.js +30 -15
  28. package/FieldObject/index.js.map +2 -2
  29. package/FormBuilder/FormBuilder.stories.d.ts +2 -0
  30. package/FormBuilder/__stories__/AutoErrorGrouping.d.ts +1 -1
  31. package/FormBuilder/__stories__/Default.d.ts +1 -1
  32. package/FormBuilder/__stories__/ErrorGrouping.d.ts +1 -1
  33. package/FormBuilder/index.d.ts +1 -1
  34. package/FormBuilder/index.js +11 -7
  35. package/FormBuilder/index.js.map +2 -2
  36. package/FormContext/index.js +6 -2
  37. package/FormContext.d.ts +1 -0
  38. package/FormContext.js.map +2 -2
  39. package/MultiplicityField/MultiplicityField.stories.d.ts +2 -0
  40. package/MultiplicityField/__stories__/Default.d.ts +1 -1
  41. package/MultiplicityField/__stories__/PreviewDisplay.d.ts +1 -1
  42. package/MultiplicityField/__stories__/WithExactLength.d.ts +1 -1
  43. package/MultiplicityField/__stories__/WithMaxLength.d.ts +1 -1
  44. package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +1 -1
  45. package/MultiplicityField/__stories__/WithMinLength.d.ts +1 -1
  46. package/MultiplicityField/add-objects/index.js +2 -0
  47. package/MultiplicityField/add-objects.js.map +2 -2
  48. package/MultiplicityField/index.js +4 -1
  49. package/MultiplicityField/index.js.map +2 -2
  50. package/MultiplicityField/types.d.ts +1 -0
  51. package/Questions/Questions.stories.d.ts +2 -0
  52. package/Questions/__stories__/Default.d.ts +1 -1
  53. package/cjs/Field/FieldBase/index.js +7 -3
  54. package/cjs/Field/FieldBase.js.map +2 -2
  55. package/cjs/Field/FieldBaseContainer/index.js +36 -17
  56. package/cjs/Field/FieldBaseContainer.js.map +3 -3
  57. package/cjs/Field/FieldConditional/index.js +4 -0
  58. package/cjs/Field/FieldConditional.js.map +2 -2
  59. package/cjs/Field/index.js +15 -4
  60. package/cjs/Field/index.js.map +2 -2
  61. package/cjs/Field/types.js.map +1 -1
  62. package/cjs/Field/utils/index.js +9 -1
  63. package/cjs/Field/utils/index.js.map +3 -3
  64. package/cjs/Field/utils/useField/index.js +14 -1
  65. package/cjs/Field/utils/useField.js.map +2 -2
  66. package/cjs/FieldArray/FormDialog/index.js +416 -0
  67. package/cjs/FieldArray/FormDialog.js.map +7 -0
  68. package/cjs/FieldArray/index.js +81 -23
  69. package/cjs/FieldArray/index.js.map +2 -2
  70. package/cjs/FieldObject/index.js +30 -15
  71. package/cjs/FieldObject/index.js.map +2 -2
  72. package/cjs/FormBuilder/index.js +11 -7
  73. package/cjs/FormBuilder/index.js.map +2 -2
  74. package/cjs/FormContext/index.js +7 -2
  75. package/cjs/FormContext.js.map +2 -2
  76. package/cjs/MultiplicityField/add-objects/index.js +2 -0
  77. package/cjs/MultiplicityField/add-objects.js.map +2 -2
  78. package/cjs/MultiplicityField/index.js +4 -1
  79. package/cjs/MultiplicityField/index.js.map +2 -2
  80. package/cjs/MultiplicityField/types.js.map +1 -1
  81. package/cjs/inputs/AutoCompleteInput/index.js +2 -1
  82. package/cjs/inputs/AutoCompleteInput/index.js.map +2 -2
  83. package/cjs/inputs/Checkboxes/index.js +3 -1
  84. package/cjs/inputs/Checkboxes/index.js.map +2 -2
  85. package/cjs/inputs/DateInput/index.js +44 -14
  86. package/cjs/inputs/DateInput/index.js.map +2 -2
  87. package/cjs/inputs/DateTimeInput/index.js +245 -0
  88. package/cjs/inputs/DateTimeInput/index.js.map +7 -0
  89. package/cjs/inputs/FileInput/index.js +68 -30
  90. package/cjs/inputs/FileInput/index.js.map +2 -2
  91. package/cjs/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
  92. package/cjs/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
  93. package/cjs/inputs/ImageInput/index.js +48 -11
  94. package/cjs/inputs/ImageInput/index.js.map +2 -2
  95. package/cjs/inputs/Input/index.js +8 -1
  96. package/cjs/inputs/Input/index.js.map +2 -2
  97. package/cjs/inputs/OtpInput/index.js +1 -0
  98. package/cjs/inputs/OtpInput/index.js.map +2 -2
  99. package/cjs/inputs/Radio/index.js +1 -0
  100. package/cjs/inputs/Radio/index.js.map +2 -2
  101. package/cjs/inputs/Select/index.js +9 -2
  102. package/cjs/inputs/Select/index.js.map +2 -2
  103. package/cjs/inputs/inputsScenarios/index.js +2 -2
  104. package/cjs/inputs/inputsScenarios.js.map +2 -2
  105. package/cjs/lazy/index.js +10 -1
  106. package/cjs/lazy.js.map +2 -2
  107. package/cjs/registry/index.js +12 -6
  108. package/cjs/registry.js.map +2 -2
  109. package/cjs/types.js.map +1 -1
  110. package/cjs/utils/index.js +20 -6
  111. package/cjs/utils.js.map +2 -2
  112. package/cjs/validators/index.js +21 -7
  113. package/cjs/validators/index.js.map +2 -2
  114. package/cjs/validators/utils/amka/index.js +60 -0
  115. package/cjs/validators/utils/amka.js.map +7 -0
  116. package/cjs/validators/utils/date/index.js +26 -3
  117. package/cjs/validators/utils/date.js.map +2 -2
  118. package/cjs/validators/utils/datetime/index.js +245 -0
  119. package/cjs/validators/utils/datetime.js.map +7 -0
  120. package/cjs/validators/utils/file/index.js +30 -17
  121. package/cjs/validators/utils/file.js.map +2 -2
  122. package/cjs/validators/utils/index.js +8 -2
  123. package/cjs/validators/utils/index.js.map +2 -2
  124. package/index.js +1 -1
  125. package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +2 -0
  126. package/inputs/AutoCompleteInput/__stories__/Default.d.ts +1 -1
  127. package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +1 -1
  128. package/inputs/AutoCompleteInput/index.js +2 -1
  129. package/inputs/AutoCompleteInput/index.js.map +2 -2
  130. package/inputs/Checkboxes/Checkboxes.stories.d.ts +2 -0
  131. package/inputs/Checkboxes/__stories__/Conditional.d.ts +1 -1
  132. package/inputs/Checkboxes/__stories__/Default.d.ts +1 -1
  133. package/inputs/Checkboxes/__stories__/WithDivider.d.ts +1 -1
  134. package/inputs/Checkboxes/index.js +3 -1
  135. package/inputs/Checkboxes/index.js.map +2 -2
  136. package/inputs/DateInput/DateInput.stories.d.ts +6 -0
  137. package/inputs/DateInput/__stories__/Default.d.ts +1 -1
  138. package/inputs/DateInput/__stories__/WithDefaultValue.d.ts +3 -0
  139. package/inputs/DateInput/__stories__/WithInitialValue.d.ts +3 -0
  140. package/inputs/DateInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
  141. package/inputs/DateInput/__stories__/WithWrongInitialValue.d.ts +3 -0
  142. package/inputs/DateInput/index.js +45 -15
  143. package/inputs/DateInput/index.js.map +2 -2
  144. package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +14 -0
  145. package/inputs/DateTimeInput/__stories__/Default.d.ts +3 -0
  146. package/inputs/DateTimeInput/__stories__/WithDefaultValue.d.ts +3 -0
  147. package/inputs/DateTimeInput/__stories__/WithInitialValue.d.ts +3 -0
  148. package/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
  149. package/inputs/DateTimeInput/__stories__/WithWrongInitialValue.d.ts +3 -0
  150. package/inputs/DateTimeInput/index.d.ts +13 -0
  151. package/inputs/DateTimeInput/index.js +215 -0
  152. package/inputs/DateTimeInput/index.js.map +7 -0
  153. package/inputs/DateTimeInput/index.test.d.ts +1 -0
  154. package/inputs/DateTimeInput/package.json +6 -0
  155. package/inputs/FileInput/FileInput.stories.d.ts +3 -0
  156. package/inputs/FileInput/__stories__/Default.d.ts +1 -1
  157. package/inputs/FileInput/__stories__/WithBorderAndLink.d.ts +3 -0
  158. package/inputs/FileInput/index.d.ts +17 -1
  159. package/inputs/FileInput/index.js +73 -32
  160. package/inputs/FileInput/index.js.map +2 -2
  161. package/inputs/ImageInput/ImageInput.stories.d.ts +4 -1
  162. package/inputs/ImageInput/__stories__/Default.d.ts +1 -1
  163. package/inputs/ImageInput/__stories__/MaxSize.d.ts +1 -1
  164. package/inputs/ImageInput/__stories__/WithInitialValues.d.ts +3 -0
  165. package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +1 -1
  166. package/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
  167. package/inputs/ImageInput/__stories__/logo.d/package.json +6 -0
  168. package/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
  169. package/inputs/ImageInput/index.d.ts +9 -1
  170. package/inputs/ImageInput/index.js +49 -12
  171. package/inputs/ImageInput/index.js.map +2 -2
  172. package/inputs/Input/Input.stories.d.ts +4 -0
  173. package/inputs/Input/__stories__/AFM.d.ts +1 -1
  174. package/inputs/Input/__stories__/AMKA.d.ts +3 -0
  175. package/inputs/Input/__stories__/Boolean.d.ts +1 -1
  176. package/inputs/Input/__stories__/Email.d.ts +3 -0
  177. package/inputs/Input/__stories__/IBAN.d.ts +1 -1
  178. package/inputs/Input/__stories__/Integer.d.ts +1 -1
  179. package/inputs/Input/__stories__/LandlineNumber.d.ts +1 -1
  180. package/inputs/Input/__stories__/MobilePhone.d.ts +1 -1
  181. package/inputs/Input/__stories__/PhoneNumber.d.ts +1 -1
  182. package/inputs/Input/__stories__/PostalCode.d.ts +1 -1
  183. package/inputs/Input/__stories__/String.d.ts +1 -1
  184. package/inputs/Input/__stories__/StringWithTrimValidation.d.ts +1 -1
  185. package/inputs/Input/__stories__/TextWithLimit.d.ts +1 -1
  186. package/inputs/Input/index.d.ts +2 -1
  187. package/inputs/Input/index.js +8 -1
  188. package/inputs/Input/index.js.map +2 -2
  189. package/inputs/Label/Label.stories.d.ts +2 -0
  190. package/inputs/Label/__stories__/Default.d.ts +1 -1
  191. package/inputs/OtpInput/OtpInput.stories.d.ts +2 -0
  192. package/inputs/OtpInput/__stories__/Default.d.ts +1 -1
  193. package/inputs/OtpInput/index.js +1 -0
  194. package/inputs/OtpInput/index.js.map +2 -2
  195. package/inputs/Radio/Radio.stories.d.ts +2 -0
  196. package/inputs/Radio/__stories__/Conditional.d.ts +1 -1
  197. package/inputs/Radio/__stories__/Default.d.ts +1 -1
  198. package/inputs/Radio/__stories__/WithDivider.d.ts +1 -1
  199. package/inputs/Radio/index.js +1 -0
  200. package/inputs/Radio/index.js.map +2 -2
  201. package/inputs/Select/Select.stories.d.ts +2 -0
  202. package/inputs/Select/__stories__/Default.d.ts +1 -1
  203. package/inputs/Select/index.d.ts +2 -1
  204. package/inputs/Select/index.js +9 -2
  205. package/inputs/Select/index.js.map +2 -2
  206. package/inputs/inputsScenarios/index.js +2 -2
  207. package/inputs/inputsScenarios.d.ts +1 -1
  208. package/inputs/inputsScenarios.js.map +2 -2
  209. package/lazy/index.js +10 -1
  210. package/package.json +8 -8
  211. package/registry/index.js +12 -6
  212. package/src/Field/FieldBase.tsx +6 -2
  213. package/src/Field/FieldBaseContainer.tsx +68 -46
  214. package/src/Field/FieldConditional.tsx +4 -0
  215. package/src/Field/doc.mdx +202 -1
  216. package/src/Field/index.tsx +20 -5
  217. package/src/Field/types.tsx +15 -3
  218. package/src/Field/utils/index.ts +8 -0
  219. package/src/Field/utils/useField.ts +14 -2
  220. package/src/FieldArray/FieldArray.stories.js +1 -0
  221. package/src/FieldArray/FormDialog.tsx +565 -0
  222. package/src/FieldArray/__stories__/Default.tsx +2 -1
  223. package/src/FieldArray/__stories__/WithExactLength.tsx +2 -1
  224. package/src/FieldArray/__stories__/WithModal.tsx +160 -0
  225. package/src/FieldArray/index.test.tsx +8 -0
  226. package/src/FieldArray/index.tsx +112 -48
  227. package/src/FieldObject/index.tsx +39 -18
  228. package/src/FormBuilder/FormBuilder.stories.js +3 -0
  229. package/src/FormBuilder/__stories__/AutoErrorGrouping.tsx +1 -1
  230. package/src/FormBuilder/__stories__/Default.tsx +1 -1
  231. package/src/FormBuilder/__stories__/ErrorGrouping.tsx +1 -1
  232. package/src/FormBuilder/doc.mdx +9 -4
  233. package/src/FormBuilder/index.test.tsx +20 -17
  234. package/src/FormBuilder/index.tsx +12 -7
  235. package/src/FormBuilder/interaction.test.tsx +8 -0
  236. package/src/FormBuilder/scenarios.test.tsx +771 -6
  237. package/src/FormContext.tsx +5 -1
  238. package/src/MultiplicityField/MultiplicityField.stories.js +3 -0
  239. package/src/MultiplicityField/__stories__/Default.tsx +1 -1
  240. package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +1 -1
  241. package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
  242. package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
  243. package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
  244. package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
  245. package/src/MultiplicityField/add-objects.tsx +2 -0
  246. package/src/MultiplicityField/doc.mdx +101 -83
  247. package/src/MultiplicityField/index.test.tsx +4 -0
  248. package/src/MultiplicityField/index.tsx +3 -0
  249. package/src/MultiplicityField/types.ts +1 -0
  250. package/src/Questions/Questions.stories.js +3 -0
  251. package/src/Questions/__snapshots__/index.spec.tsx.snap +2 -1
  252. package/src/Questions/__stories__/Default.tsx +1 -1
  253. package/src/Questions/doc.mdx +21 -41
  254. package/src/Questions/index.test.tsx +4 -0
  255. package/src/doc.mdx +26 -11
  256. package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +3 -0
  257. package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +1 -1
  258. package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +1 -1
  259. package/src/inputs/AutoCompleteInput/index.test.tsx +4 -0
  260. package/src/inputs/AutoCompleteInput/index.tsx +1 -0
  261. package/src/inputs/Checkboxes/Checkboxes.stories.js +3 -0
  262. package/src/inputs/Checkboxes/__stories__/Conditional.tsx +1 -1
  263. package/src/inputs/Checkboxes/__stories__/Default.tsx +1 -1
  264. package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +1 -1
  265. package/src/inputs/Checkboxes/index.test.tsx +4 -0
  266. package/src/inputs/Checkboxes/index.tsx +3 -5
  267. package/src/inputs/DateInput/DateInput.stories.js +7 -0
  268. package/src/inputs/DateInput/__stories__/Default.tsx +1 -1
  269. package/src/inputs/DateInput/__stories__/WithDefaultValue.tsx +26 -0
  270. package/src/inputs/DateInput/__stories__/WithInitialValue.tsx +28 -0
  271. package/src/inputs/DateInput/__stories__/WithWrongDefaultValue.tsx +26 -0
  272. package/src/inputs/DateInput/__stories__/WithWrongInitialValue.tsx +28 -0
  273. package/src/inputs/DateInput/index.test.tsx +20 -0
  274. package/src/inputs/DateInput/index.tsx +49 -14
  275. package/src/inputs/DateTimeInput/DateTimeInput.stories.js +14 -0
  276. package/src/inputs/DateTimeInput/__stories__/Default.tsx +25 -0
  277. package/src/inputs/DateTimeInput/__stories__/WithDefaultValue.tsx +26 -0
  278. package/src/inputs/DateTimeInput/__stories__/WithInitialValue.tsx +28 -0
  279. package/src/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.tsx +26 -0
  280. package/src/inputs/DateTimeInput/__stories__/WithWrongInitialValue.tsx +28 -0
  281. package/src/inputs/DateTimeInput/doc.mdx +16 -0
  282. package/src/inputs/DateTimeInput/index.test.tsx +40 -0
  283. package/src/inputs/DateTimeInput/index.tsx +233 -0
  284. package/src/inputs/FileInput/FileInput.stories.js +4 -0
  285. package/src/inputs/FileInput/__stories__/Default.tsx +1 -1
  286. package/src/inputs/FileInput/__stories__/WithBorderAndLink.tsx +34 -0
  287. package/src/inputs/FileInput/index.test.tsx +8 -0
  288. package/src/inputs/FileInput/index.tsx +104 -38
  289. package/src/inputs/ImageInput/ImageInput.stories.js +5 -1
  290. package/src/inputs/ImageInput/__stories__/Default.tsx +1 -1
  291. package/src/inputs/ImageInput/__stories__/MaxSize.tsx +3 -2
  292. package/src/inputs/ImageInput/__stories__/{WithInvalidImageSize.tsx → WithInitialValues.tsx} +12 -3
  293. package/src/inputs/ImageInput/__stories__/WithInvalidImageDimension.tsx +1 -1
  294. package/src/inputs/ImageInput/__stories__/logo.d.ts +4 -0
  295. package/src/inputs/ImageInput/__stories__/logo.png +0 -0
  296. package/src/inputs/ImageInput/index.test.tsx +8 -4
  297. package/src/inputs/ImageInput/index.tsx +100 -42
  298. package/src/inputs/Input/Input.stories.js +5 -0
  299. package/src/inputs/Input/__stories__/AFM.tsx +1 -1
  300. package/src/inputs/Input/__stories__/AMKA.tsx +23 -0
  301. package/src/inputs/Input/__stories__/Boolean.tsx +1 -1
  302. package/src/inputs/Input/__stories__/Email.tsx +23 -0
  303. package/src/inputs/Input/__stories__/IBAN.tsx +1 -1
  304. package/src/inputs/Input/__stories__/Integer.tsx +1 -1
  305. package/src/inputs/Input/__stories__/LandlineNumber.tsx +1 -1
  306. package/src/inputs/Input/__stories__/MobilePhone.tsx +1 -1
  307. package/src/inputs/Input/__stories__/PhoneNumber.tsx +1 -1
  308. package/src/inputs/Input/__stories__/PostalCode.tsx +1 -1
  309. package/src/inputs/Input/__stories__/String.tsx +1 -1
  310. package/src/inputs/Input/__stories__/StringWithTrimValidation.tsx +1 -1
  311. package/src/inputs/Input/__stories__/TextWithLimit.tsx +1 -1
  312. package/src/inputs/Input/index.test.tsx +12 -0
  313. package/src/inputs/Input/index.tsx +11 -2
  314. package/src/inputs/Label/Label.stories.js +3 -0
  315. package/src/inputs/Label/__stories__/Default.tsx +1 -1
  316. package/src/inputs/Label/index.test.tsx +4 -0
  317. package/src/inputs/OtpInput/OtpInput.stories.js +3 -0
  318. package/src/inputs/OtpInput/__stories__/Default.tsx +1 -1
  319. package/src/inputs/OtpInput/index.test.tsx +4 -0
  320. package/src/inputs/OtpInput/index.tsx +1 -0
  321. package/src/inputs/Radio/Radio.stories.js +3 -0
  322. package/src/inputs/Radio/__stories__/Conditional.tsx +1 -1
  323. package/src/inputs/Radio/__stories__/Default.tsx +1 -1
  324. package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
  325. package/src/inputs/Radio/index.test.tsx +4 -0
  326. package/src/inputs/Radio/index.tsx +1 -0
  327. package/src/inputs/Select/Select.stories.js +3 -0
  328. package/src/inputs/Select/__stories__/Default.tsx +1 -1
  329. package/src/inputs/Select/index.test.tsx +4 -0
  330. package/src/inputs/Select/index.tsx +13 -4
  331. package/src/inputs/inputsScenarios.ts +2 -2
  332. package/src/lazy.js +10 -1
  333. package/src/registry.js +12 -6
  334. package/src/types.tsx +2 -1
  335. package/src/utils.ts +27 -6
  336. package/src/validators/index.ts +30 -7
  337. package/src/validators/utils/amka.ts +39 -0
  338. package/src/validators/utils/date.ts +28 -4
  339. package/src/validators/utils/datetime.ts +222 -0
  340. package/src/validators/utils/file.ts +33 -19
  341. package/src/validators/utils/index.ts +5 -1
  342. package/types.d.ts +2 -1
  343. package/types.js.map +1 -1
  344. package/utils/index.js +20 -6
  345. package/utils.d.ts +2 -0
  346. package/utils.js.map +2 -2
  347. package/validators/index.d.ts +1 -1
  348. package/validators/index.js +26 -8
  349. package/validators/index.js.map +2 -2
  350. package/validators/utils/amka/index.js +36 -0
  351. package/validators/utils/amka/package.json +6 -0
  352. package/validators/utils/amka.d.ts +6 -0
  353. package/validators/utils/amka.js.map +7 -0
  354. package/validators/utils/date/index.js +26 -3
  355. package/validators/utils/date.d.ts +1 -1
  356. package/validators/utils/date.js.map +2 -2
  357. package/validators/utils/datetime/index.js +210 -0
  358. package/validators/utils/datetime/package.json +6 -0
  359. package/validators/utils/datetime.d.ts +9 -0
  360. package/validators/utils/datetime.js.map +7 -0
  361. package/validators/utils/file/index.js +30 -17
  362. package/validators/utils/file.js.map +2 -2
  363. package/validators/utils/index.d.ts +2 -0
  364. package/validators/utils/index.js +5 -1
  365. package/validators/utils/index.js.map +2 -2
  366. package/cjs/inputs/Input/inputsInputScenarios/index.js +0 -439
  367. package/cjs/inputs/Input/inputsInputScenarios.js.map +0 -7
  368. package/inputs/ImageInput/__stories__/WithInvalidImageSize.d.ts +0 -3
  369. package/inputs/Input/inputsInputScenarios/index.js +0 -406
  370. package/inputs/Input/inputsInputScenarios.d.ts +0 -57
  371. package/inputs/Input/inputsInputScenarios.js.map +0 -7
  372. package/src/inputs/Input/inputsInputScenarios.ts +0 -404
@@ -0,0 +1,160 @@
1
+ import React from 'react';
2
+ import FormBuilder, { Field, FieldSpec } from '@digigov/form';
3
+ import { Button } from '@digigov/ui/form/Button';
4
+
5
+ const fields = [
6
+ {
7
+ key: 'string',
8
+ type: 'string',
9
+ label: {
10
+ primary: 'Πεδίο κειμένου',
11
+ secondary:
12
+ 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας',
13
+ },
14
+ },
15
+ {
16
+ key: 'multiplicity',
17
+ editable: true,
18
+ required: true,
19
+ type: 'array',
20
+ label: {
21
+ primary: 'Συνυπογράφοντες',
22
+ secondary: 'Οι συνυπογράφοντες είναι άνθρωποι σαν και εμάς',
23
+ },
24
+ extra: {
25
+ noIndex: true,
26
+ border: false,
27
+ variant: 'dialog',
28
+ noHeader: false,
29
+ label: {
30
+ object: {
31
+ title: 'Συνυπογράφοντας',
32
+ title_added: 'Οι συνυπογράφοντες που έχετε προσθέσει',
33
+ add: 'Προσθήκη',
34
+ delete: 'Αφαίρεση συνυπογράφοντος',
35
+ append: {
36
+ label: 'Αποθήκευση',
37
+ props: {
38
+ color: 'primary',
39
+ },
40
+ },
41
+ edit: {
42
+ label: 'Αποθήκευση',
43
+ props: {
44
+ color: 'primary',
45
+ },
46
+ },
47
+ cancel: {
48
+ label: 'Ακύρωση',
49
+ props: {
50
+ variant: 'link',
51
+ },
52
+ },
53
+ },
54
+ question: {
55
+ title: 'Θέλετε να προσθέσετε επιπλέον συνυπογράφοντες;',
56
+ objectLabel: {
57
+ primary: 'Προσθήκη νέου συνυπογράφοντα',
58
+ secondary: 'Συμπληρώστε τα στοιχεία και μετά πατήστε «Προσθήκη»',
59
+ },
60
+ yes: 'Ναι',
61
+ no: 'Όχι',
62
+ },
63
+ },
64
+ min: 2,
65
+ // max: 4,
66
+ of: {
67
+ type: 'object',
68
+ extra: {
69
+ fields: [
70
+ {
71
+ key: 'firstName',
72
+ required: true,
73
+ type: 'string',
74
+ label: {
75
+ primary: 'Όνομα',
76
+ },
77
+ },
78
+ {
79
+ key: 'lastName',
80
+ required: true,
81
+ type: 'string',
82
+ label: {
83
+ primary: 'Επώνυμο',
84
+ },
85
+ },
86
+ ],
87
+ },
88
+ },
89
+ },
90
+ },
91
+ {
92
+ key: 'arrayofafm',
93
+ editable: true,
94
+ type: 'array',
95
+ label: {
96
+ primary: 'Συνυπογράφοντες',
97
+ secondary: 'Οι συνυπογράφοντες είναι άνθρωποι σαν και εμάς',
98
+ },
99
+ extra: {
100
+ variant: 'dialog',
101
+ noHeader: false,
102
+ label: {
103
+ object: {
104
+ title: 'Συνυπογράφοντας',
105
+ title_added: 'Οι συνυπογράφοντες που έχετε προσθέσει',
106
+ add: 'Προσθήκη',
107
+ delete: 'Αφαίρεση συνυπογράφοντος',
108
+ append: {
109
+ label: 'Αποθήκευση',
110
+ props: {
111
+ color: 'primary',
112
+ },
113
+ },
114
+ edit: {
115
+ label: 'Αποθήκευση',
116
+ props: {
117
+ color: 'primary',
118
+ },
119
+ },
120
+ cancel: {
121
+ label: 'Ακύρωση',
122
+ props: {
123
+ variant: 'link',
124
+ },
125
+ },
126
+ },
127
+ question: {
128
+ title: 'Θέλετε να προσθέσετε επιπλέον συνυπογράφοντες;',
129
+ objectLabel: {
130
+ primary: 'Προσθήκη νέου συνυπογράφοντα',
131
+ secondary: 'Συμπληρώστε τα στοιχεία και μετά πατήστε «Προσθήκη»',
132
+ },
133
+ yes: 'Ναι',
134
+ no: 'Όχι',
135
+ },
136
+ },
137
+ // min: 2,
138
+ // max: 4,
139
+ of: {
140
+ required: true,
141
+ type: 'afm',
142
+ label: {
143
+ primary: 'ΑΦΜ',
144
+ },
145
+ },
146
+ },
147
+ },
148
+ ] as FieldSpec[];
149
+
150
+ export const WithModal = (_: any) => (
151
+ <FormBuilder
152
+ onSubmit={(data) => {
153
+ console.log(data);
154
+ window.alert('Submit success');
155
+ }}
156
+ >
157
+ <Field name="multiplicity" {...fields[1]} />
158
+ <Button>Συνέχεια</Button>
159
+ </FormBuilder>
160
+ );
@@ -3,6 +3,7 @@ import { test, expect } from '@playwright/experimental-ct-react';
3
3
  import TestVariant from '@digigov/ui/utils/TestVariant'
4
4
  import { Default } from '@digigov/form/FieldArray/__stories__/Default';
5
5
  import { WithExactLength } from '@digigov/form/FieldArray/__stories__/WithExactLength';
6
+ import { WithModal } from '@digigov/form/FieldArray/__stories__/WithModal';
6
7
 
7
8
  test('renders the All FieldArray variants', async ({ mount, page }) => {
8
9
  await mount(
@@ -14,10 +15,17 @@ test('renders the All FieldArray variants', async ({ mount, page }) => {
14
15
  <TestVariant title="WithExactLength">
15
16
  <WithExactLength />
16
17
  </TestVariant>
18
+ <TestVariant title="WithModal">
19
+ <WithModal />
20
+ </TestVariant>
17
21
  </div>
18
22
  )
19
23
  await page.evaluate(() => document.fonts.ready);
20
24
 
25
+ // Move the mouse to the top-left corner to avoid random hover issues
26
+ await page.mouse.move(0, 0);
27
+
28
+
21
29
  const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
22
30
  expect(screenshot).toMatchSnapshot();
23
31
  });
@@ -1,93 +1,157 @@
1
- import React from 'react';
1
+ import React, { useEffect, useRef } from 'react';
2
2
  import { ErrorOption, useFieldArray, UseFormReturn } from 'react-hook-form';
3
3
  import { FieldBaseContainer } from '@digigov/form/Field/FieldBaseContainer';
4
4
  import { FieldProps } from '@digigov/form/Field/types';
5
+ import { FormDialog } from '@digigov/form/FieldArray/FormDialog';
5
6
  import { FieldObject } from '@digigov/form/FieldObject';
6
7
  import { FieldsetLabel, Fieldset } from '@digigov/form/Fieldset';
7
8
  import { Card } from '@digigov/ui/content/Card';
8
9
  import { Button } from '@digigov/ui/form/Button';
9
- import { Hint } from '@digigov/ui/typography/Hint';
10
10
 
11
11
  export interface FieldArrayProps extends FieldProps {
12
12
  control: UseFormReturn['control'];
13
+ trigger: UseFormReturn['trigger'];
13
14
  register: UseFormReturn['register'];
15
+ clearErrors: UseFormReturn['clearErrors'];
14
16
  formState: UseFormReturn['formState'];
15
17
  error?: ErrorOption;
18
+ getValues: UseFormReturn['getValues'];
19
+ setValue: UseFormReturn['setValue'];
20
+ reset: UseFormReturn['reset'];
21
+ resetField?: UseFormReturn['resetField'];
16
22
  Field: React.FC<FieldProps>;
17
23
  }
18
24
  export const FieldArray: React.FC<FieldArrayProps> = ({
19
25
  name,
26
+ trigger,
20
27
  register,
28
+ clearErrors,
21
29
  control,
22
30
  formState,
23
31
  error,
32
+ getValues,
33
+ setValue,
24
34
  layout,
35
+ reset,
36
+ resetField,
25
37
  label,
26
38
  Field,
27
39
  ...customField
28
40
  }) => {
29
- const { fields, append, remove } = useFieldArray({
41
+ const { append, remove } = useFieldArray({
30
42
  control,
31
43
  name,
32
44
  });
45
+ const fields = getValues(name) || [];
46
+
47
+ /** The ref of the FieldBaseContainer. */
48
+ const containerRef = useRef<HTMLFieldSetElement | null>(null);
49
+
50
+ const { errors } = formState;
51
+
52
+ // Focus the fieldset when there are errors related to this field array
53
+ useEffect(() => {
54
+ if (!containerRef.current) return;
55
+ const fieldErrors = Object.keys(errors);
56
+ // no errors
57
+ if (!fieldErrors.length) return;
58
+
59
+ if (
60
+ // Check if there are errors related to the current field array
61
+ fieldErrors.some((key) => {
62
+ const fieldArrayName = key.split('.')[0];
63
+ return fieldArrayName === name;
64
+ })
65
+ ) {
66
+ if (containerRef.current && errors[name]) {
67
+ containerRef.current.focus();
68
+ }
69
+ }
70
+ }, [errors, name]);
33
71
 
34
72
  return (
35
73
  <FieldBaseContainer
36
74
  label={label}
37
75
  layout={layout}
38
- error={
39
- formState.isSubmitted &&
40
- !formState.isSubmitting &&
41
- error?.message &&
42
- error
43
- ? error
44
- : undefined
45
- }
76
+ register={register}
77
+ ref={containerRef}
78
+ error={error?.message && error ? error : undefined}
46
79
  hasError={formState.isSubmitted && !formState.isSubmitting && !!error}
47
80
  wrapper="fieldset"
48
81
  name={name}
82
+ labelSize={customField.extra?.labelSize}
83
+ controlled={true}
49
84
  >
50
- {fields.length === 0 && (
51
- <Hint>{customField.extra?.label.object?.nothing_added}</Hint>
52
- )}
53
- {fields.map((field, index) => (
54
- <Card variant="border" key={field.id}>
55
- <Fieldset>
56
- <FieldsetLabel>
57
- {customField.extra?.label.object.title} {index + 1}
58
- </FieldsetLabel>
59
- <FieldObject
60
- name={`${name}.${index}`}
61
- error={Array.isArray(error) && error[index]}
62
- formState={formState}
63
- register={register}
64
- control={control}
65
- {...customField.extra?.of}
66
- Field={Field}
67
- />
85
+ {customField.extra?.variant === 'dialog' ? (
86
+ <FormDialog
87
+ name={name}
88
+ trigger={trigger}
89
+ register={register}
90
+ clearErrors={clearErrors}
91
+ control={control}
92
+ formState={formState}
93
+ error={error}
94
+ getValues={getValues}
95
+ setValue={setValue}
96
+ layout={layout}
97
+ label={label}
98
+ Field={Field}
99
+ reset={reset}
100
+ resetField={resetField}
101
+ sortable={customField.extra.sortable}
102
+ {...customField}
103
+ />
104
+ ) : (
105
+ <>
106
+ {fields.map((field, index) => (
107
+ <Card
108
+ variant={customField.extra?.border ? 'border' : 'divider'}
109
+ key={field.id || index}
110
+ >
111
+ <Fieldset>
112
+ <FieldsetLabel>
113
+ {customField.extra?.label.object.title}{' '}
114
+ {!customField.extra?.noIndex && index + 1}
115
+ </FieldsetLabel>
116
+ <FieldObject
117
+ name={`${name}.${index}`}
118
+ error={Array.isArray(error) && error[index]}
119
+ formState={formState}
120
+ register={register}
121
+ control={control}
122
+ {...customField.extra?.of}
123
+ Field={Field}
124
+ />
125
+ <Button
126
+ name={`${name}-object-remove`}
127
+ variant={customField.extra?.label.object?.deleteButtonVariant}
128
+ type="button"
129
+ color="warning"
130
+ onClick={() => remove(index)}
131
+ disabled={!customField?.editable}
132
+ >
133
+ {customField.extra?.label.object?.delete}
134
+ </Button>
135
+ </Fieldset>
136
+ </Card>
137
+ ))}
138
+ {customField.editable && (
68
139
  <Button
69
- name={`${name}-object-remove`}
70
140
  type="button"
71
- color="warning"
72
- onClick={() => remove(index)}
141
+ name={`${name}-add-object`}
142
+ color="secondary"
143
+ variant={customField.extra?.label.object?.addButtonVariant}
144
+ onClick={(ev) => {
145
+ ev.preventDefault();
146
+ append({});
147
+ }}
148
+ disabled={!customField?.editable}
73
149
  >
74
- {customField.extra?.label.object?.delete}
150
+ {customField.extra?.label.object?.add}
75
151
  </Button>
76
- </Fieldset>
77
- </Card>
78
- ))}
79
-
80
- <Button
81
- type="button"
82
- name={`${name}-add-object`}
83
- color="secondary"
84
- onClick={(ev) => {
85
- ev.preventDefault();
86
- append({});
87
- }}
88
- >
89
- {customField.extra?.label.object?.add}
90
- </Button>
152
+ )}
153
+ </>
154
+ )}
91
155
  </FieldBaseContainer>
92
156
  );
93
157
  };
@@ -1,7 +1,7 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import { ErrorOption, UseFormReturn } from 'react-hook-form';
3
3
  import { FieldBase } from '@digigov/form/Field/FieldBase';
4
- import { CalculatedField, FieldProps } from '@digigov/form/Field/types';
4
+ import { FieldProps, CalculatedField } from '@digigov/form/Field/types';
5
5
  import {
6
6
  FIELD_COMPONENTS,
7
7
  ALTERNATIVE_COMPONENTS,
@@ -16,8 +16,10 @@ export interface FieldObjectProps extends Omit<FieldProps, 'key'> {
16
16
  control: UseFormReturn['control'];
17
17
  register: UseFormReturn['register'];
18
18
  reset: UseFormReturn['reset'];
19
+ resetField: UseFormReturn['resetField'];
19
20
  formState: UseFormReturn['formState'];
20
21
  error?: ErrorOption;
22
+ defaultValue?: undefined;
21
23
  Field: React.FC<FieldProps>;
22
24
  }
23
25
 
@@ -28,8 +30,10 @@ export const FieldObject: React.FC<FieldObjectProps> = ({
28
30
  control,
29
31
  register,
30
32
  reset,
33
+ resetField,
31
34
  formState,
32
35
  error,
36
+ defaultValue,
33
37
  Field,
34
38
  }) => {
35
39
  const { t } = useTranslation();
@@ -37,21 +41,25 @@ export const FieldObject: React.FC<FieldObjectProps> = ({
37
41
  return (
38
42
  <Fieldset>
39
43
  {label?.primary && (
40
- <FieldsetLegend size="sm">{t(label.primary)}</FieldsetLegend>
44
+ <FieldsetLegend size="sm" marginBottom={3}>
45
+ {t(label.primary)}
46
+ </FieldsetLegend>
41
47
  )}
42
48
  {label?.secondary && (
43
- <FieldsetCaption>{t(label.secondary)}</FieldsetCaption>
49
+ <FieldsetCaption marginBottom={3}>{t(label.secondary)}</FieldsetCaption>
44
50
  )}
45
51
  {extra?.fields.map((field) => (
46
52
  <FieldObjectItem
47
- key={`${name}.${field.key}`}
48
- name={`${name}.${field.key}`}
53
+ key={`${name}${field.key ? `.${field.key}` : ''}`}
54
+ name={`${name}${field.key ? `.${field.key}` : ''}`}
49
55
  control={control}
50
56
  register={register}
51
57
  reset={reset}
58
+ resetField={resetField}
52
59
  field={field}
53
60
  error={error && error[field.key]}
54
61
  formState={formState}
62
+ defaultValue={defaultValue?.[field.key] || undefined}
55
63
  Field={Field}
56
64
  />
57
65
  ))}
@@ -60,14 +68,17 @@ export const FieldObject: React.FC<FieldObjectProps> = ({
60
68
  };
61
69
 
62
70
  export interface FieldObjectItemProps {
71
+ key: string;
63
72
  name: string;
64
73
  field: FieldSpec;
65
74
  control: UseFormReturn['control'];
66
75
  register: UseFormReturn['register'];
67
76
  reset: UseFormReturn['reset'];
77
+ resetField: UseFormReturn['resetField'];
68
78
  formState: UseFormReturn['formState'];
69
79
  error?: ErrorOption;
70
80
  children?: React.ReactNode;
81
+ defaultValue?: undefined;
71
82
  Field: React.FC<FieldProps>;
72
83
  }
73
84
 
@@ -79,7 +90,9 @@ const FieldObjectItem: React.FC<FieldObjectItemProps> = ({
79
90
  control,
80
91
  formState,
81
92
  reset,
93
+ resetField,
82
94
  register,
95
+ defaultValue,
83
96
  Field,
84
97
  }) => {
85
98
  const calculatedField: CalculatedField = useMemo(
@@ -87,19 +100,27 @@ const FieldObjectItem: React.FC<FieldObjectItemProps> = ({
87
100
  calculateField(children, field, FIELD_COMPONENTS, ALTERNATIVE_COMPONENTS),
88
101
  [field]
89
102
  );
90
-
91
- const customError = error ? error : formState?.errors[name];
92
- return (
93
- <FieldBase
94
- {...calculatedField}
95
- name={name}
96
- Field={Field}
97
- control={control}
98
- reset={reset}
99
- register={register}
100
- error={customError}
101
- />
102
- );
103
+ if (Field) {
104
+ if (!field.type) {
105
+ field.type = 'string';
106
+ }
107
+ return <Field {...field} name={name} />;
108
+ } else {
109
+ const customError = error ? error : formState?.errors[name];
110
+ return (
111
+ <FieldBase
112
+ {...calculatedField}
113
+ name={name}
114
+ Field={Field}
115
+ control={control}
116
+ reset={reset}
117
+ resetField={resetField}
118
+ register={register}
119
+ error={customError}
120
+ defaultValue={defaultValue}
121
+ />
122
+ );
123
+ }
103
124
  };
104
125
 
105
126
  export default FieldObject;
@@ -1,7 +1,10 @@
1
1
  import FormBuilder from '@digigov/form/FormBuilder';
2
+ import doc from './doc.mdx?raw';
2
3
  export default {
3
4
  title: 'Digigov Form/FormBuilder',
4
5
  component: FormBuilder,
6
+ tags: ['autodocs'],
7
+ markdown: doc,
5
8
  displayName: 'FormBuilder',
6
9
  };
7
10
  export { Default } from '@digigov/form/FormBuilder/__stories__/Default';
@@ -49,7 +49,7 @@ const FIELDS: FieldSpec[] = [
49
49
  },
50
50
  ];
51
51
 
52
- export const AutoErrorGrouping = () => (
52
+ export const AutoErrorGrouping = (_: any) => (
53
53
  <FormBuilder
54
54
  grid={true}
55
55
  auto={true}
@@ -6,7 +6,7 @@ const initialValues = {
6
6
  'business-title': null,
7
7
  };
8
8
 
9
- export const Default = () => (
9
+ export const Default = (_: any) => (
10
10
  <FormBuilder
11
11
  onSubmit={(data) => {
12
12
  console.log(data);
@@ -3,7 +3,7 @@ import FormBuilder, { Field } from '@digigov/form';
3
3
  import { ErrorGroup } from '@digigov/form/Field/ErrorGroup';
4
4
  import { Button } from '@digigov/ui/form/Button';
5
5
 
6
- export const ErrorGrouping = () => (
6
+ export const ErrorGrouping = (_: any) => (
7
7
  <FormBuilder
8
8
  grid={true}
9
9
  onSubmit={(data) => {
@@ -4,13 +4,14 @@ title: FormBuilder
4
4
  sidebar_label: FormBuilder
5
5
  ---
6
6
 
7
+ # FormBuilder
8
+
7
9
  `FormBuilder` is a React component that provides an easy way to efficiently create reusable form page. Forms are a flexible mechanism for collecting user input because there are suitable widgets for entering many different types of data, including text boxes, checkboxes, radio buttons, dropdowns and so on for submission to a server. Actually when we use `stepForm` for building step-forms all we do is to render `FormBuilder` component.
8
10
 
9
11
  `stepForm` component:
10
12
 
11
13
  <code src="@digigov/form/FormBuilder/__stories__/Default.tsx" />
12
14
 
13
-
14
15
  ### Importing and using FormBuilder Component
15
16
 
16
17
  To import `FormBuilder` component simply import it from `'@digigov/form`.
@@ -28,7 +29,7 @@ import BasicLayout, {
28
29
  Main,
29
30
  Bottom,
30
31
  } from '@digigov/ui/layouts/Basic';
31
- import {FormBuilder} from '@digigov/form';
32
+ import { FormBuilder } from '@digigov/form';
32
33
 
33
34
  export default function MyComponent({ props }) {
34
35
  return (
@@ -73,7 +74,7 @@ Below are demostrated some examples for each type of field
73
74
 
74
75
  ### FormBuilder implementation
75
76
 
76
- The examples above are implemented by using the code below
77
+ The example below are implemented by using the code above.
77
78
 
78
79
  ```jsx
79
80
  import React, { useState } from 'react';
@@ -83,7 +84,11 @@ import BasicLayout, {
83
84
  Main,
84
85
  Bottom,
85
86
  } from '@digigov/ui/layouts/Basic';
86
- import Header, { HeaderTitle, HeaderContent, HeaderSection } from '@digigov/ui/app/Header';
87
+ import Header, {
88
+ HeaderTitle,
89
+ HeaderContent,
90
+ HeaderSection,
91
+ } from '@digigov/ui/app/Header';
87
92
  import GovGRLogo from '@digigov/ui/govgr/GovGRLogo';
88
93
  import GovGRFooter from '@digigov/ui/govgr/Footer';
89
94
  import Button from '@digigov/ui/form/Button';
@@ -1,29 +1,32 @@
1
1
  import React from 'react';
2
2
  import { test, expect } from '@playwright/experimental-ct-react';
3
- import TestVariant from '@digigov/ui/utils/TestVariant';
3
+ import TestVariant from '@digigov/ui/utils/TestVariant'
4
4
  import { AutoErrorGrouping } from '@digigov/form/FormBuilder/__stories__/AutoErrorGrouping';
5
5
  import { Default } from '@digigov/form/FormBuilder/__stories__/Default';
6
6
  import { ErrorGrouping } from '@digigov/form/FormBuilder/__stories__/ErrorGrouping';
7
7
 
8
8
  test('renders the All FormBuilder variants', async ({ mount, page }) => {
9
9
  await mount(
10
- <div>
11
- <TestVariant title="AutoErrorGrouping">
12
- <AutoErrorGrouping />
13
- </TestVariant>
14
- <TestVariant title="Default">
15
- <Default />
16
- </TestVariant>
17
- <TestVariant title="ErrorGrouping">
18
- <ErrorGrouping />
19
- </TestVariant>
20
- </div>
21
- );
10
+
11
+ <div>
12
+ <TestVariant title="AutoErrorGrouping">
13
+ <AutoErrorGrouping />
14
+ </TestVariant>
15
+ <TestVariant title="Default">
16
+ <Default />
17
+ </TestVariant>
18
+ <TestVariant title="ErrorGrouping">
19
+ <ErrorGrouping />
20
+ </TestVariant>
21
+ </div>
22
+ )
22
23
  await page.evaluate(() => document.fonts.ready);
23
24
 
24
- const screenshot = await page.screenshot({
25
- fullPage: true,
26
- animations: 'disabled',
27
- });
25
+ // Move the mouse to the top-left corner to avoid random hover issues
26
+ await page.mouse.move(0, 0);
27
+
28
+
29
+ const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
28
30
  expect(screenshot).toMatchSnapshot();
29
31
  });
32
+