@flipdish/ui-library 0.51.0 → 0.53.0

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 (343) hide show
  1. package/README.md +17 -16
  2. package/dist/components/atoms/Checkbox/index.cjs +4 -2
  3. package/dist/components/atoms/Checkbox/index.cjs.map +1 -1
  4. package/dist/components/atoms/Checkbox/index.d.ts.map +1 -1
  5. package/dist/components/atoms/Checkbox/index.js +4 -2
  6. package/dist/components/atoms/Checkbox/index.js.map +1 -1
  7. package/dist/components/atoms/Slider/index.cjs +2 -2
  8. package/dist/components/atoms/Slider/index.cjs.map +1 -1
  9. package/dist/components/atoms/Slider/index.d.ts +3 -1
  10. package/dist/components/atoms/Slider/index.d.ts.map +1 -1
  11. package/dist/components/atoms/Slider/index.js +2 -2
  12. package/dist/components/atoms/Slider/index.js.map +1 -1
  13. package/dist/components/forms/Form/hooks/useForm.cjs +26 -0
  14. package/dist/components/forms/Form/hooks/useForm.cjs.map +1 -0
  15. package/dist/components/forms/Form/hooks/useForm.d.ts +13 -0
  16. package/dist/components/forms/Form/hooks/useForm.d.ts.map +1 -0
  17. package/dist/components/forms/Form/hooks/useForm.js +24 -0
  18. package/dist/components/forms/Form/hooks/useForm.js.map +1 -0
  19. package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.cjs +93 -0
  20. package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.cjs.map +1 -0
  21. package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.d.ts +54 -0
  22. package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.d.ts.map +1 -0
  23. package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.js +91 -0
  24. package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.js.map +1 -0
  25. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.cjs +28 -0
  26. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.cjs.map +1 -0
  27. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.d.ts +10 -0
  28. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.d.ts.map +1 -0
  29. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.js +26 -0
  30. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.js.map +1 -0
  31. package/dist/components/forms/Form/index.cjs +63 -0
  32. package/dist/components/forms/Form/index.cjs.map +1 -0
  33. package/dist/components/forms/Form/index.d.ts +37 -0
  34. package/dist/components/forms/Form/index.d.ts.map +1 -0
  35. package/dist/components/forms/Form/index.js +59 -0
  36. package/dist/components/forms/Form/index.js.map +1 -0
  37. package/dist/components/forms/Form/utilities/formSubmit.utils.cjs +23 -0
  38. package/dist/components/forms/Form/utilities/formSubmit.utils.cjs.map +1 -0
  39. package/dist/components/forms/Form/utilities/formSubmit.utils.d.ts +14 -0
  40. package/dist/components/forms/Form/utilities/formSubmit.utils.d.ts.map +1 -0
  41. package/dist/components/forms/Form/utilities/formSubmit.utils.js +21 -0
  42. package/dist/components/forms/Form/utilities/formSubmit.utils.js.map +1 -0
  43. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.cjs +39 -0
  44. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.cjs.map +1 -0
  45. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.d.ts +17 -0
  46. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.d.ts.map +1 -0
  47. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.js +37 -0
  48. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.js.map +1 -0
  49. package/dist/components/forms/FormFooter/hooks/useHasFieldError.cjs +26 -0
  50. package/dist/components/forms/FormFooter/hooks/useHasFieldError.cjs.map +1 -0
  51. package/dist/components/forms/FormFooter/hooks/useHasFieldError.d.ts +9 -0
  52. package/dist/components/forms/FormFooter/hooks/useHasFieldError.d.ts.map +1 -0
  53. package/dist/components/forms/FormFooter/hooks/useHasFieldError.js +24 -0
  54. package/dist/components/forms/FormFooter/hooks/useHasFieldError.js.map +1 -0
  55. package/dist/components/forms/FormFooter/index.cjs +41 -0
  56. package/dist/components/forms/FormFooter/index.cjs.map +1 -0
  57. package/dist/components/forms/FormFooter/index.d.ts +56 -0
  58. package/dist/components/forms/FormFooter/index.d.ts.map +1 -0
  59. package/dist/components/forms/FormFooter/index.js +39 -0
  60. package/dist/components/forms/FormFooter/index.js.map +1 -0
  61. package/dist/components/forms/FormFooter/utilities/formFooter.utils.cjs +21 -0
  62. package/dist/components/forms/FormFooter/utilities/formFooter.utils.cjs.map +1 -0
  63. package/dist/components/forms/FormFooter/utilities/formFooter.utils.d.ts +12 -0
  64. package/dist/components/forms/FormFooter/utilities/formFooter.utils.d.ts.map +1 -0
  65. package/dist/components/forms/FormFooter/utilities/formFooter.utils.js +19 -0
  66. package/dist/components/forms/FormFooter/utilities/formFooter.utils.js.map +1 -0
  67. package/dist/components/forms/FormSaveErrorAlert/index.cjs +28 -0
  68. package/dist/components/forms/FormSaveErrorAlert/index.cjs.map +1 -0
  69. package/dist/components/forms/FormSaveErrorAlert/index.d.ts +18 -0
  70. package/dist/components/forms/FormSaveErrorAlert/index.d.ts.map +1 -0
  71. package/dist/components/forms/FormSaveErrorAlert/index.js +26 -0
  72. package/dist/components/forms/FormSaveErrorAlert/index.js.map +1 -0
  73. package/dist/components/forms/FormSection/FormSection.styles.cjs +15 -0
  74. package/dist/components/forms/FormSection/FormSection.styles.cjs.map +1 -0
  75. package/dist/components/forms/FormSection/FormSection.styles.d.ts +9 -0
  76. package/dist/components/forms/FormSection/FormSection.styles.d.ts.map +1 -0
  77. package/dist/components/forms/FormSection/FormSection.styles.js +13 -0
  78. package/dist/components/forms/FormSection/FormSection.styles.js.map +1 -0
  79. package/dist/components/forms/FormSection/index.cjs +43 -0
  80. package/dist/components/forms/FormSection/index.cjs.map +1 -0
  81. package/dist/components/forms/FormSection/index.d.ts +41 -0
  82. package/dist/components/forms/FormSection/index.d.ts.map +1 -0
  83. package/dist/components/forms/FormSection/index.js +41 -0
  84. package/dist/components/forms/FormSection/index.js.map +1 -0
  85. package/dist/components/forms/FormUnsavedChangesModal/index.cjs +24 -0
  86. package/dist/components/forms/FormUnsavedChangesModal/index.cjs.map +1 -0
  87. package/dist/components/forms/FormUnsavedChangesModal/index.d.ts +14 -0
  88. package/dist/components/forms/FormUnsavedChangesModal/index.d.ts.map +1 -0
  89. package/dist/components/forms/FormUnsavedChangesModal/index.js +22 -0
  90. package/dist/components/forms/FormUnsavedChangesModal/index.js.map +1 -0
  91. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.cjs +28 -0
  92. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.cjs.map +1 -0
  93. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.d.ts +12 -0
  94. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.d.ts.map +1 -0
  95. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.js +26 -0
  96. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.js.map +1 -0
  97. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.cjs +68 -0
  98. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.cjs.map +1 -0
  99. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.d.ts +26 -0
  100. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.d.ts.map +1 -0
  101. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.js +66 -0
  102. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.js.map +1 -0
  103. package/dist/components/forms/__internal__/formField/hooks/useFormField.cjs +147 -0
  104. package/dist/components/forms/__internal__/formField/hooks/useFormField.cjs.map +1 -0
  105. package/dist/components/forms/__internal__/formField/hooks/useFormField.d.ts +35 -0
  106. package/dist/components/forms/__internal__/formField/hooks/useFormField.d.ts.map +1 -0
  107. package/dist/components/forms/__internal__/formField/hooks/useFormField.js +145 -0
  108. package/dist/components/forms/__internal__/formField/hooks/useFormField.js.map +1 -0
  109. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.cjs +12 -0
  110. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.cjs.map +1 -0
  111. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.d.ts +7 -0
  112. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.d.ts.map +1 -0
  113. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.js +10 -0
  114. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.js.map +1 -0
  115. package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.cjs +47 -0
  116. package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.cjs.map +1 -0
  117. package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.d.ts +26 -0
  118. package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.d.ts.map +1 -0
  119. package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.js +43 -0
  120. package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.js.map +1 -0
  121. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.cjs +39 -0
  122. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.cjs.map +1 -0
  123. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.d.ts +21 -0
  124. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.d.ts.map +1 -0
  125. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.js +37 -0
  126. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.js.map +1 -0
  127. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.cjs +40 -0
  128. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.cjs.map +1 -0
  129. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.d.ts +18 -0
  130. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.d.ts.map +1 -0
  131. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.js +37 -0
  132. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.js.map +1 -0
  133. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.cjs +21 -0
  134. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.cjs.map +1 -0
  135. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.d.ts +11 -0
  136. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.d.ts.map +1 -0
  137. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.js +19 -0
  138. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.js.map +1 -0
  139. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.cjs +128 -0
  140. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.cjs.map +1 -0
  141. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.d.ts +72 -0
  142. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.d.ts.map +1 -0
  143. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.js +121 -0
  144. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.js.map +1 -0
  145. package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.cjs +12 -0
  146. package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.cjs.map +1 -0
  147. package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.d.ts +6 -0
  148. package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.d.ts.map +1 -0
  149. package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.js +10 -0
  150. package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.js.map +1 -0
  151. package/dist/components/forms/fields/FormCheckbox/index.cjs +34 -0
  152. package/dist/components/forms/fields/FormCheckbox/index.cjs.map +1 -0
  153. package/dist/components/forms/fields/FormCheckbox/index.d.ts +19 -0
  154. package/dist/components/forms/fields/FormCheckbox/index.d.ts.map +1 -0
  155. package/dist/components/forms/fields/FormCheckbox/index.js +32 -0
  156. package/dist/components/forms/fields/FormCheckbox/index.js.map +1 -0
  157. package/dist/components/forms/fields/FormCheckboxGroup/index.cjs +33 -0
  158. package/dist/components/forms/fields/FormCheckboxGroup/index.cjs.map +1 -0
  159. package/dist/components/forms/fields/FormCheckboxGroup/index.d.ts +19 -0
  160. package/dist/components/forms/fields/FormCheckboxGroup/index.d.ts.map +1 -0
  161. package/dist/components/forms/fields/FormCheckboxGroup/index.js +31 -0
  162. package/dist/components/forms/fields/FormCheckboxGroup/index.js.map +1 -0
  163. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.cjs +26 -0
  164. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.cjs.map +1 -0
  165. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.d.ts +11 -0
  166. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.d.ts.map +1 -0
  167. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.js +24 -0
  168. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.js.map +1 -0
  169. package/dist/components/forms/fields/FormColorPicker/index.cjs +33 -0
  170. package/dist/components/forms/fields/FormColorPicker/index.cjs.map +1 -0
  171. package/dist/components/forms/fields/FormColorPicker/index.d.ts +24 -0
  172. package/dist/components/forms/fields/FormColorPicker/index.d.ts.map +1 -0
  173. package/dist/components/forms/fields/FormColorPicker/index.js +31 -0
  174. package/dist/components/forms/fields/FormColorPicker/index.js.map +1 -0
  175. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.cjs +20 -0
  176. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.cjs.map +1 -0
  177. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.d.ts +17 -0
  178. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.d.ts.map +1 -0
  179. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.js +18 -0
  180. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.js.map +1 -0
  181. package/dist/components/forms/fields/FormDatePicker/index.cjs +35 -0
  182. package/dist/components/forms/fields/FormDatePicker/index.cjs.map +1 -0
  183. package/dist/components/forms/fields/FormDatePicker/index.d.ts +20 -0
  184. package/dist/components/forms/fields/FormDatePicker/index.d.ts.map +1 -0
  185. package/dist/components/forms/fields/FormDatePicker/index.js +33 -0
  186. package/dist/components/forms/fields/FormDatePicker/index.js.map +1 -0
  187. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.cjs +23 -0
  188. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.cjs.map +1 -0
  189. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.d.ts +9 -0
  190. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.d.ts.map +1 -0
  191. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.js +21 -0
  192. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.js.map +1 -0
  193. package/dist/components/forms/fields/FormInput/index.cjs +27 -0
  194. package/dist/components/forms/fields/FormInput/index.cjs.map +1 -0
  195. package/dist/components/forms/fields/FormInput/index.d.ts +19 -0
  196. package/dist/components/forms/fields/FormInput/index.d.ts.map +1 -0
  197. package/dist/components/forms/fields/FormInput/index.js +25 -0
  198. package/dist/components/forms/fields/FormInput/index.js.map +1 -0
  199. package/dist/components/forms/fields/FormMultiSelect/index.cjs +44 -0
  200. package/dist/components/forms/fields/FormMultiSelect/index.cjs.map +1 -0
  201. package/dist/components/forms/fields/FormMultiSelect/index.d.ts +20 -0
  202. package/dist/components/forms/fields/FormMultiSelect/index.d.ts.map +1 -0
  203. package/dist/components/forms/fields/FormMultiSelect/index.js +42 -0
  204. package/dist/components/forms/fields/FormMultiSelect/index.js.map +1 -0
  205. package/dist/components/forms/fields/FormRadioCardGroup/index.cjs +36 -0
  206. package/dist/components/forms/fields/FormRadioCardGroup/index.cjs.map +1 -0
  207. package/dist/components/forms/fields/FormRadioCardGroup/index.d.ts +32 -0
  208. package/dist/components/forms/fields/FormRadioCardGroup/index.d.ts.map +1 -0
  209. package/dist/components/forms/fields/FormRadioCardGroup/index.js +34 -0
  210. package/dist/components/forms/fields/FormRadioCardGroup/index.js.map +1 -0
  211. package/dist/components/forms/fields/FormRadioGroup/index.cjs +31 -0
  212. package/dist/components/forms/fields/FormRadioGroup/index.cjs.map +1 -0
  213. package/dist/components/forms/fields/FormRadioGroup/index.d.ts +20 -0
  214. package/dist/components/forms/fields/FormRadioGroup/index.d.ts.map +1 -0
  215. package/dist/components/forms/fields/FormRadioGroup/index.js +29 -0
  216. package/dist/components/forms/fields/FormRadioGroup/index.js.map +1 -0
  217. package/dist/components/forms/fields/FormSelect/index.cjs +30 -0
  218. package/dist/components/forms/fields/FormSelect/index.cjs.map +1 -0
  219. package/dist/components/forms/fields/FormSelect/index.d.ts +19 -0
  220. package/dist/components/forms/fields/FormSelect/index.d.ts.map +1 -0
  221. package/dist/components/forms/fields/FormSelect/index.js +28 -0
  222. package/dist/components/forms/fields/FormSelect/index.js.map +1 -0
  223. package/dist/components/forms/fields/FormSlider/index.cjs +43 -0
  224. package/dist/components/forms/fields/FormSlider/index.cjs.map +1 -0
  225. package/dist/components/forms/fields/FormSlider/index.d.ts +20 -0
  226. package/dist/components/forms/fields/FormSlider/index.d.ts.map +1 -0
  227. package/dist/components/forms/fields/FormSlider/index.js +41 -0
  228. package/dist/components/forms/fields/FormSlider/index.js.map +1 -0
  229. package/dist/components/forms/fields/FormTextArea/index.cjs +27 -0
  230. package/dist/components/forms/fields/FormTextArea/index.cjs.map +1 -0
  231. package/dist/components/forms/fields/FormTextArea/index.d.ts +19 -0
  232. package/dist/components/forms/fields/FormTextArea/index.d.ts.map +1 -0
  233. package/dist/components/forms/fields/FormTextArea/index.js +25 -0
  234. package/dist/components/forms/fields/FormTextArea/index.js.map +1 -0
  235. package/dist/components/forms/fields/FormToggle/index.cjs +32 -0
  236. package/dist/components/forms/fields/FormToggle/index.cjs.map +1 -0
  237. package/dist/components/forms/fields/FormToggle/index.d.ts +19 -0
  238. package/dist/components/forms/fields/FormToggle/index.d.ts.map +1 -0
  239. package/dist/components/forms/fields/FormToggle/index.js +30 -0
  240. package/dist/components/forms/fields/FormToggle/index.js.map +1 -0
  241. package/dist/components/forms/validation/hooks/useSchemaResolver.cjs +44 -0
  242. package/dist/components/forms/validation/hooks/useSchemaResolver.cjs.map +1 -0
  243. package/dist/components/forms/validation/hooks/useSchemaResolver.d.ts +16 -0
  244. package/dist/components/forms/validation/hooks/useSchemaResolver.d.ts.map +1 -0
  245. package/dist/components/forms/validation/hooks/useSchemaResolver.js +42 -0
  246. package/dist/components/forms/validation/hooks/useSchemaResolver.js.map +1 -0
  247. package/dist/components/forms/validation/index.cjs +413 -0
  248. package/dist/components/forms/validation/index.cjs.map +1 -0
  249. package/dist/components/forms/validation/index.d.ts +278 -0
  250. package/dist/components/forms/validation/index.d.ts.map +1 -0
  251. package/dist/components/forms/validation/index.js +394 -0
  252. package/dist/components/forms/validation/index.js.map +1 -0
  253. package/dist/components/forms/validation/utilities/validation.utils.cjs +72 -0
  254. package/dist/components/forms/validation/utilities/validation.utils.cjs.map +1 -0
  255. package/dist/components/forms/validation/utilities/validation.utils.d.ts +38 -0
  256. package/dist/components/forms/validation/utilities/validation.utils.d.ts.map +1 -0
  257. package/dist/components/forms/validation/utilities/validation.utils.js +67 -0
  258. package/dist/components/forms/validation/utilities/validation.utils.js.map +1 -0
  259. package/dist/components/forms/validation/validation.types.d.ts +8 -0
  260. package/dist/components/forms/validation/validation.types.d.ts.map +1 -0
  261. package/dist/components/organisms/ColorPicker/components/ColorPickerField.cjs +13 -3
  262. package/dist/components/organisms/ColorPicker/components/ColorPickerField.cjs.map +1 -1
  263. package/dist/components/organisms/ColorPicker/components/ColorPickerField.d.ts +1 -1
  264. package/dist/components/organisms/ColorPicker/components/ColorPickerField.d.ts.map +1 -1
  265. package/dist/components/organisms/ColorPicker/components/ColorPickerField.js +13 -3
  266. package/dist/components/organisms/ColorPicker/components/ColorPickerField.js.map +1 -1
  267. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.cjs +2 -2
  268. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.cjs.map +1 -1
  269. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.d.ts +1 -0
  270. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.d.ts.map +1 -1
  271. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.js +2 -2
  272. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.js.map +1 -1
  273. package/dist/components/organisms/ColorPicker/hooks/useCssColorField.cjs +1 -1
  274. package/dist/components/organisms/ColorPicker/hooks/useCssColorField.js +1 -1
  275. package/dist/components/organisms/ColorPicker/index.cjs +1 -1
  276. package/dist/components/organisms/ColorPicker/index.d.ts.map +1 -1
  277. package/dist/components/organisms/ColorPicker/index.js +1 -1
  278. package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.d.ts +1 -1
  279. package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.d.ts.map +1 -1
  280. package/dist/components/organisms/ColorPicker/utilities/colorPicker.utils.cjs.map +1 -0
  281. package/dist/components/organisms/ColorPicker/utilities/colorPicker.utils.d.ts.map +1 -0
  282. package/dist/components/organisms/ColorPicker/utilities/colorPicker.utils.js.map +1 -0
  283. package/dist/components/organisms/GradientPicker/components/GradientStopRow.cjs +1 -1
  284. package/dist/components/organisms/GradientPicker/components/GradientStopRow.js +1 -1
  285. package/dist/hooks/useFocusAfterRetry/index.cjs +7 -3
  286. package/dist/hooks/useFocusAfterRetry/index.cjs.map +1 -1
  287. package/dist/hooks/useFocusAfterRetry/index.d.ts +8 -2
  288. package/dist/hooks/useFocusAfterRetry/index.d.ts.map +1 -1
  289. package/dist/hooks/useFocusAfterRetry/index.js +7 -3
  290. package/dist/hooks/useFocusAfterRetry/index.js.map +1 -1
  291. package/dist/localization/en.json.cjs +117 -0
  292. package/dist/localization/en.json.cjs.map +1 -0
  293. package/dist/localization/en.json.js +98 -0
  294. package/dist/localization/en.json.js.map +1 -0
  295. package/dist/native/components/forms/Form/index.d.ts +12 -0
  296. package/dist/native/components/forms/FormFooter/index.d.ts +12 -0
  297. package/dist/native/components/forms/FormSaveErrorAlert/index.d.ts +12 -0
  298. package/dist/native/components/forms/FormSection/index.d.ts +12 -0
  299. package/dist/native/components/forms/FormUnsavedChangesModal/index.d.ts +12 -0
  300. package/dist/native/components/forms/fields/FormCheckbox/index.d.ts +12 -0
  301. package/dist/native/components/forms/fields/FormCheckboxGroup/index.d.ts +12 -0
  302. package/dist/native/components/forms/fields/FormColorPicker/index.d.ts +12 -0
  303. package/dist/native/components/forms/fields/FormDatePicker/index.d.ts +12 -0
  304. package/dist/native/components/forms/fields/FormInput/index.d.ts +12 -0
  305. package/dist/native/components/forms/fields/FormMultiSelect/index.d.ts +12 -0
  306. package/dist/native/components/forms/fields/FormRadioCardGroup/index.d.ts +12 -0
  307. package/dist/native/components/forms/fields/FormRadioGroup/index.d.ts +12 -0
  308. package/dist/native/components/forms/fields/FormSelect/index.d.ts +12 -0
  309. package/dist/native/components/forms/fields/FormSlider/index.d.ts +12 -0
  310. package/dist/native/components/forms/fields/FormTextArea/index.d.ts +12 -0
  311. package/dist/native/components/forms/fields/FormToggle/index.d.ts +12 -0
  312. package/dist/native/components/forms/validation/index.d.ts +12 -0
  313. package/dist/native/utilities/colorUtils/index.d.ts +12 -0
  314. package/dist/providers/UnsavedChangesGuardProvider/index.cjs +1 -1
  315. package/dist/providers/UnsavedChangesGuardProvider/index.js +1 -1
  316. package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.cjs.map +1 -0
  317. package/dist/providers/UnsavedChangesGuardProvider/{unsavedChangesGuard.utils.d.ts → utilities/unsavedChangesGuard.utils.d.ts} +1 -1
  318. package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.d.ts.map +1 -0
  319. package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.js.map +1 -0
  320. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.cjs +74 -0
  321. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.cjs.map +1 -0
  322. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.d.ts +51 -0
  323. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.d.ts.map +1 -0
  324. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.js +68 -0
  325. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.js.map +1 -0
  326. package/dist/utilities/colorUtils/index.cjs +24 -0
  327. package/dist/utilities/colorUtils/index.cjs.map +1 -0
  328. package/dist/utilities/colorUtils/index.d.ts +8 -0
  329. package/dist/utilities/colorUtils/index.d.ts.map +1 -0
  330. package/dist/utilities/colorUtils/index.js +22 -0
  331. package/dist/utilities/colorUtils/index.js.map +1 -0
  332. package/package.json +41 -6
  333. package/dist/components/organisms/ColorPicker/colorPicker.utils.cjs.map +0 -1
  334. package/dist/components/organisms/ColorPicker/colorPicker.utils.d.ts.map +0 -1
  335. package/dist/components/organisms/ColorPicker/colorPicker.utils.js.map +0 -1
  336. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.utils.cjs.map +0 -1
  337. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.utils.d.ts.map +0 -1
  338. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.utils.js.map +0 -1
  339. /package/dist/components/organisms/ColorPicker/{colorPicker.utils.cjs → utilities/colorPicker.utils.cjs} +0 -0
  340. /package/dist/components/organisms/ColorPicker/{colorPicker.utils.d.ts → utilities/colorPicker.utils.d.ts} +0 -0
  341. /package/dist/components/organisms/ColorPicker/{colorPicker.utils.js → utilities/colorPicker.utils.js} +0 -0
  342. /package/dist/providers/UnsavedChangesGuardProvider/{unsavedChangesGuard.utils.cjs → utilities/unsavedChangesGuard.utils.cjs} +0 -0
  343. /package/dist/providers/UnsavedChangesGuardProvider/{unsavedChangesGuard.utils.js → utilities/unsavedChangesGuard.utils.js} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../../src/components/forms/validation/index.ts"],"sourcesContent":[null],"names":["builtInTextTemplate","z","valuesOf","noteCrossFieldRule"],"mappings":";;;;;;;AAqFA;AACA,MAAM,MAAM,GAAG,mBAAmB;AAClC,MAAM,MAAM,GAAG,iBAAiB;AAChC,MAAM,YAAY,GAAG,SAAS;AAC9B,MAAM,MAAM,GAAG,OAAO;AACtB,MAAM,UAAU,GAAG,iBAAiB;AACpC,MAAM,qBAAqB,GAAG,iCAAiC;AAE/D;;;;;AAKG;AACH,MAAM,gBAAgB,GAAG,CAAC,KAAa,KAAa;IAClD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AACvC,IAAA,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE;AACnF,CAAC;AAED;;;;;;AAMG;AACH,MAAM,OAAO,GAAG,CAAS,IAAuB,EAAE,SAAwB,KACxE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAI,IAAkC,GAAG,CAAC,IAAc,EAAEA,qCAAmB,CAAC,SAAS,CAAC,CAAC;AAE9G;;;;;;AAMG;AACH,MAAM,eAAe,GAAG,CAAC,QAAkC,EAAE,SAAA,GAA2B,wBAAwB,KAAI;IAClH,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,QAAQ,IAAI,SAAS;AAC9D,IAAA,OAAO,QAAQ,GAAGA,qCAAmB,CAAC,SAAS,CAAC,GAAG,SAAS;AAC9D,CAAC;AAiBD,MAAM,QAAQ,GAAG,oCAAoC;AACrD,M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AE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,KAAI;IAC3E,MAAM,SAAS,GAA2B,KAAK;IAC/C,MAAM,OAAO,GAAG,QAAQ,CAAC,WAAW,CAClC,CAAC,MAAM,EAAE,OAAO,KAAI;AAClB,QAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAA2B,CAAC;AACjD,QAAA,IAAI,CAAC,MAAM;YAAE;AACb,QAAA,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,MAAM,KAAK,QAAQ,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM;QACxG,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC,WAAW,GAAG,IAAI,EAAE,CAAC;IACpG,CAAC;;;;AAID,IAAA;QACE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,KACf,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,EAAE,WAAW,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAgB,CAAC,CAAC,CAAC;AAChI,KAAA,CACF;AACD,IAAAC,mCAAkB,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC;AAC7C,IAAA,OAAO,OAAO;AAChB,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,278 @@
1
+ import { z } from 'zod';
2
+ import type { MessageValues } from './validation.types';
3
+ export { useSchemaResolver } from './hooks/useSchemaResolver';
4
+ export type { MessageValues, Translate } from './validation.types';
5
+ /**
6
+ * A rule's limit: the limit alone, which shows the library's default message, or the limit with the message to show, a
7
+ * translation key or the text itself. A message may name the limit with a placeholder, `{min}` or `{max}`.
8
+ */
9
+ export type RuleLimit<TLimit> = TLimit | readonly [limit: TLimit, message: string];
10
+ /**
11
+ * Whether a field must be filled: `true` shows the library's default message for an empty one, and a string is the
12
+ * message to show, a translation key or the text itself. Without it the field is optional.
13
+ */
14
+ export type RequiredRule = boolean | string;
15
+ export interface TextRuleOptions {
16
+ /** Makes the field required. Without it the field is optional, and its other rules pass while it is empty. */
17
+ required?: RequiredRule;
18
+ /** The fewest characters a value may have. */
19
+ min?: RuleLimit<number>;
20
+ /** The most characters a value may have. */
21
+ max?: RuleLimit<number>;
22
+ /** The shape a value must have. */
23
+ pattern?: RuleLimit<RegExp>;
24
+ }
25
+ /** The messages of a rule that checks a value's format. */
26
+ export interface FormatRuleMessages {
27
+ /** Makes the field required. Without it the field is optional. */
28
+ required?: RequiredRule;
29
+ /** The message for a value in the wrong format; the library's default without it. */
30
+ invalid?: string;
31
+ }
32
+ export interface NumberRuleOptions extends FormatRuleMessages {
33
+ /** The smallest number allowed. */
34
+ min?: RuleLimit<number>;
35
+ /** The largest number allowed. */
36
+ max?: RuleLimit<number>;
37
+ /** Whether a decimal is refused, as for a quantity. */
38
+ isWhole?: boolean;
39
+ }
40
+ /** The rules of a money amount: those of a number, without the choice of whole numbers. */
41
+ export type AmountRuleOptions = Omit<NumberRuleOptions, 'isWhole'>;
42
+ export interface DigitsRuleOptions extends FormatRuleMessages {
43
+ /** The exact number of digits a value must have, as a PIN or a verification code does. */
44
+ length?: RuleLimit<number>;
45
+ /** The fewest digits a value may have. */
46
+ min?: RuleLimit<number>;
47
+ /** The most digits a value may have. */
48
+ max?: RuleLimit<number>;
49
+ }
50
+ export interface ListRuleOptions {
51
+ /** The message for an empty list; the library's default without it. */
52
+ required?: string;
53
+ /** The most entries the list may hold. */
54
+ max?: RuleLimit<number>;
55
+ }
56
+ export interface DateRuleOptions {
57
+ /** Makes the field required. Without it the field is optional. */
58
+ required?: RequiredRule;
59
+ /** The earliest date allowed, as an ISO date string or a function returning one; `{min}` in the message is that date. */
60
+ min?: RuleLimit<string | (() => string)>;
61
+ /** The latest date allowed, as an ISO date string or a function returning one; `{max}` in the message is that date. */
62
+ max?: RuleLimit<string | (() => string)>;
63
+ }
64
+ export interface HexColourRuleOptions {
65
+ /** Makes the field required. Without it the field is optional, for a colour the user may remove. */
66
+ required?: RequiredRule;
67
+ /** The message for a value that is not a hex colour; the library's default without it. */
68
+ invalid?: string;
69
+ /** Accepts the eight-digit form the picker writes for a see-through colour; by default only a solid, six-digit colour passes. */
70
+ isAlphaAllowed?: boolean;
71
+ }
72
+ /** A country whose postcode shape the library checks. */
73
+ export type PostcodeCountry = 'IE' | 'GB' | 'US' | 'CA' | 'FR' | 'DE' | 'ES' | 'IT' | 'PT' | 'PR';
74
+ export interface PostcodeRuleOptions extends FormatRuleMessages {
75
+ /** The country whose postcode shape a value must have. */
76
+ country: PostcodeCountry;
77
+ }
78
+ /**
79
+ * The rules for a text field, such as `FormInput` or `FormTextArea`. Spaces around the value are dropped before the
80
+ * rules run and from the validated value.
81
+ *
82
+ * @param options The rules to apply; a rule given without a message shows the library's default. None makes any text valid.
83
+ * @returns A zod string schema, which takes further zod rules.
84
+ */
85
+ export declare const text: ({ required, min, max, pattern }?: TextRuleOptions) => z.ZodString;
86
+ /**
87
+ * The rules for an email address.
88
+ *
89
+ * @param messages `invalid` for a value that is not an email address, and `required` to refuse an empty one; each has a default, and without `required` the field is optional.
90
+ * @returns A zod string schema whose validated value is the trimmed address.
91
+ */
92
+ export declare const email: ({ required, invalid }?: FormatRuleMessages) => z.ZodString;
93
+ /**
94
+ * The rules for a web address.
95
+ *
96
+ * @param messages `invalid` for a value that is not an `http` or `https` address, and `required` to refuse an empty one; each has a default, and without `required` the field is optional.
97
+ * @returns A zod string schema whose validated value is the trimmed address.
98
+ */
99
+ export declare const url: ({ required, invalid }?: FormatRuleMessages) => z.ZodString;
100
+ /**
101
+ * The rules for a phone number: 7 to 15 digits, with optional spaces, brackets, dashes and a leading `+`. It checks the
102
+ * number is plausible to dial, not that it exists.
103
+ *
104
+ * @param messages `invalid` for a value that is not such a number, and `required` to refuse an empty one; each has a default, and without `required` the field is optional.
105
+ * @returns A zod string schema whose validated value is the trimmed number, as typed.
106
+ */
107
+ export declare const phone: ({ required, invalid }?: FormatRuleMessages) => z.ZodString;
108
+ /**
109
+ * The rules for a postcode of one country, such as an Eircode in Ireland or a ZIP code in the United States. It checks
110
+ * the shape, not that the address exists. For a country the user picks in the same form, use `postcodeError` in a cross-field rule.
111
+ *
112
+ * @param options The `country` whose shape is required, `invalid` for a value that does not have it, which may show a fitting postcode as `{example}`, and `required` to refuse an empty one; each message has a default, and without `required` the field is optional.
113
+ * @returns A zod string schema whose validated value is the trimmed postcode.
114
+ */
115
+ export declare const postcode: ({ country, required, invalid }: PostcodeRuleOptions) => z.ZodString;
116
+ /**
117
+ * Checks a postcode against the shape its country uses, for a `crossFieldRules` `check` where the country is another
118
+ * field of the form.
119
+ *
120
+ * @param country The address's country, which decides the shape.
121
+ * @param value The postcode as typed; surrounding spaces and letter case do not matter.
122
+ * @returns The library's default message for the country with the example it shows, or `undefined` when the postcode
123
+ * fits it or is empty, which the field's own `required` rule reports.
124
+ */
125
+ export declare const postcodeError: (country: PostcodeCountry, value: string) => CrossFieldMessage | undefined;
126
+ /**
127
+ * The rules for a money amount typed into a text field: zero or more, with at most two decimal places.
128
+ *
129
+ * @param options `invalid` for a value that is not such an amount, the optional `min` and `max` it must sit between, and
130
+ * `required` to refuse an empty value; each message has a default, and without `required` the field is optional.
131
+ * @returns A zod string schema; the validated value stays the text typed, such as `'12.50'`.
132
+ */
133
+ export declare const amount: ({ invalid, ...options }?: AmountRuleOptions) => z.ZodString;
134
+ /**
135
+ * The rules for a number typed into a text field, such as a quantity or a percentage.
136
+ *
137
+ * @param options `invalid` for a value that is not a number, the optional `min` and `max` it must sit between, `isWhole` to
138
+ * refuse a decimal, and `required` to refuse an empty value; each message has a default, and without `required` the field is optional.
139
+ * @returns A zod string schema; the validated value stays the text typed, so convert it with `Number` when saving.
140
+ */
141
+ export declare const number: ({ invalid, isWhole, ...options }?: NumberRuleOptions) => z.ZodString;
142
+ /**
143
+ * The rules for a code made only of digits, such as a PIN, a verification code or an account number. Unlike `number`
144
+ * it keeps leading zeros, takes no sign or decimal point, and limits how many digits there are.
145
+ *
146
+ * @param options `invalid` for a value with anything but digits, the `length` it must have or the `min` and `max` digits it
147
+ * may have, and `required` to refuse an empty value; each message has a default, and without `required` the field is optional.
148
+ * @returns A zod string schema; the validated value is the digits as typed.
149
+ */
150
+ export declare const digits: ({ required, invalid, length, min, max }?: DigitsRuleOptions) => z.ZodString;
151
+ /**
152
+ * The rule for a box the user must tick or a switch they must turn on, such as accepting terms with `FormCheckbox`.
153
+ *
154
+ * @param required The message while it is off; the library's default without it.
155
+ * @returns A zod boolean schema, which only `true` passes.
156
+ */
157
+ export declare const checked: (required?: string) => z.ZodBoolean;
158
+ declare const requiredColour: (isColour: (value: string) => boolean, required: string, invalid: string) => z.ZodString;
159
+ declare const optionalColour: (isColour: (value: string) => boolean, invalid: string) => z.ZodOptional<z.ZodNullable<z.ZodString>>;
160
+ type KnownMessage<TMessage extends string> = string extends TMessage ? never : Exclude<TMessage, ''>;
161
+ /** `hexColour`'s two shapes: a colour the call itself makes required is a string, and any other may also be `null` or `undefined`. */
162
+ interface HexColourRule {
163
+ <TMessage extends string>(options: Omit<HexColourRuleOptions, 'required'> & {
164
+ required: true | (TMessage & KnownMessage<TMessage>);
165
+ }): ReturnType<typeof requiredColour>;
166
+ (options?: HexColourRuleOptions): ReturnType<typeof optionalColour>;
167
+ }
168
+ /**
169
+ * The rules for a colour held as a hex string, as `FormColorPicker` writes it. A field with no colour is one holding
170
+ * `null`, `undefined` or `''`: the picker writes back whichever of them the form itself uses for an empty field.
171
+ *
172
+ * @param options `required` to refuse a field with no colour, the message for a value that is not a hex colour, and whether a see-through colour passes.
173
+ * @returns A zod schema of a string, which also takes `null` and `undefined` unless the colour is required.
174
+ */
175
+ export declare const hexColour: HexColourRule;
176
+ /**
177
+ * Today's date in a time zone, as the ISO date string a `date` rule compares with. Use it for a limit that follows the
178
+ * calendar of the record being edited, such as a property's, and not the calendar of whoever is editing it.
179
+ *
180
+ * @param timeZone The IANA time zone, such as `Europe/Dublin`; without one, or with an empty one, the browser's. A name
181
+ * `Intl` does not know throws a `RangeError`, so validate a zone the user picks before it reaches here.
182
+ * @param now The moment to read the date at; the current time unless a test fixes it.
183
+ * @returns That date as `YYYY-MM-DD`.
184
+ */
185
+ export declare const todayIn: (timeZone?: string, now?: Date) => string;
186
+ /**
187
+ * The rules for a date held as an ISO date string (`YYYY-MM-DD`) or `null`, as `FormDatePicker` writes it.
188
+ *
189
+ * @param options `required` to refuse a field with no date, and the optional `min` and `max` it must sit between. A limit
190
+ * may be a function, read at each validation, for one that moves such as today: `min: () => todayIn()`. A default message
191
+ * shows the limit as a date, such as `13 Nov 2026`.
192
+ * @returns A zod schema of a string or `null`.
193
+ */
194
+ export declare const date: ({ required, min, max }?: DateRuleOptions) => z.ZodNullable<z.ZodString>;
195
+ /**
196
+ * The rules for a field that holds one of a fixed set of ids, such as `FormSelect` or `FormRadioGroup`.
197
+ *
198
+ * @param options Every id the field may hold.
199
+ * @param required The message for a field with no choice, or a value outside `options`; the library's default without it.
200
+ * @returns A zod enum schema, so the validated value is typed as one of `options`.
201
+ */
202
+ export declare const oneOf: <const TOptions extends readonly [string, ...string[]]>(options: TOptions, required?: string) => z.ZodEnum<{ [k_1 in TOptions[number]]: k_1; } extends infer T ? { [k in keyof T]: T[k]; } : never>;
203
+ /**
204
+ * The rules for a field that holds a list of any strings and needs at least one entry, such as a `FormMultiSelect`
205
+ * whose items are loaded.
206
+ *
207
+ * @param options `required` for an empty list and the optional `max` entries it may hold; each message has a default.
208
+ * @returns A zod array schema.
209
+ */
210
+ export declare const atLeastOne: (options?: ListRuleOptions) => z.ZodArray<z.ZodString>;
211
+ /**
212
+ * The rules for a field that holds a list from a fixed set of ids and needs at least one entry, such as
213
+ * `FormCheckboxGroup`.
214
+ *
215
+ * @param ids Every id the list may hold.
216
+ * @param options `required` for an empty list and the optional `max` entries it may hold; each message has a default.
217
+ * @returns A zod array schema, so the validated value is typed as a list of `ids`.
218
+ */
219
+ export declare const atLeastOneOf: <const TOptions extends readonly [string, ...string[]]>(ids: TOptions, options?: ListRuleOptions) => z.ZodArray<z.ZodEnum<{ [k_1 in TOptions[number]]: k_1; } extends infer T ? { [k in keyof T]: T[k]; } : never>>;
220
+ /** A cross-field rule's message with the values for its placeholders. */
221
+ export interface CrossFieldMessage {
222
+ /** The message: a translation key, or the text itself. */
223
+ key: string;
224
+ /** The value for each `{name}` placeholder in the message. */
225
+ values: MessageValues;
226
+ }
227
+ export interface CrossFieldRule<TSchema extends z.ZodObject> {
228
+ /** The fields the rule reads. It runs once these are valid, whatever else in the form is wrong. */
229
+ reads: readonly (keyof z.output<TSchema> & string)[];
230
+ /** The field the error is shown on: the one the user changes to fix it. */
231
+ reportsOn: keyof z.output<TSchema> & string;
232
+ /**
233
+ * Returns the message to show, or `undefined` when the fields agree; `{ key, values }` for a message with
234
+ * placeholders. Only the fields in `reads` are sure to be valid.
235
+ */
236
+ check: (values: z.output<TSchema>) => string | CrossFieldMessage | undefined;
237
+ /** Not for a rule with a `check`: test the condition inside `check`, or give `when` and `rules` in its place. */
238
+ when?: never;
239
+ /** Not for a rule with a `check`. */
240
+ rules?: never;
241
+ }
242
+ export interface ConditionalRule<TSchema extends z.ZodObject> {
243
+ /**
244
+ * When the rules apply: the name of a boolean field, for while it is on, or a function of the values. Name the
245
+ * fields a function reads in `reads`.
246
+ */
247
+ when: BooleanFieldName<TSchema> | ((values: z.output<TSchema>) => boolean);
248
+ /** The field the rules apply to, and the one the error is shown on. */
249
+ reportsOn: keyof z.output<TSchema> & string;
250
+ /** Any other fields `when` or `rules` read. The rule runs once these, `reportsOn` and a field `when` names are valid. */
251
+ reads?: readonly (keyof z.output<TSchema> & string)[];
252
+ /**
253
+ * The rules the field must also pass while `when` holds: a builder's schema, such as `date({ required: true })`, or a
254
+ * function of the values returning one, for a limit another field decides. They check the validated value of a
255
+ * field holding one value, not a nested group, and cannot be async.
256
+ */
257
+ rules: z.ZodType | ((values: z.output<TSchema>) => z.ZodType);
258
+ /** Not for a rule with `when` and `rules`: they replace the `check`. */
259
+ check?: never;
260
+ }
261
+ /** The fields of a schema that hold a boolean, such as a toggle. */
262
+ type BooleanFieldName<TSchema extends z.ZodObject> = {
263
+ [TName in keyof z.output<TSchema> & string]: z.output<TSchema>[TName] extends boolean ? TName : never;
264
+ }[keyof z.output<TSchema> & string];
265
+ /**
266
+ * Adds the rules that read more than one field, such as a postcode whose shape depends on the country, or a date that
267
+ * is needed only while a toggle is on. Each rule runs as soon as the fields it reads are valid: left to itself zod
268
+ * skips it while any field in the form fails, so its error would only show on a second save. In a form validated
269
+ * through `useSchemaResolver`, a `Form*` field a rule reads re-validates the field the rule reports on as it changes.
270
+ * That holds for a schema refined further, but not for one wrapped afterwards, as `.transform()` and `.optional()` do.
271
+ *
272
+ * @param schema The object schema holding each field's own rules.
273
+ * @param rules The rules to add, in the order they should run: a `check` of your own, or `when` and the `rules` a field
274
+ * must also pass while it holds.
275
+ * @returns The same schema with the rules applied; its `shape` and value type are unchanged.
276
+ */
277
+ export declare const crossFieldRules: <TSchema extends z.ZodObject>(schema: TSchema, ...rules: (CrossFieldRule<TSchema> | ConditionalRule<TSchema>)[]) => TSchema;
278
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,C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