@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,98 @@
1
+ var This_field_is_required = {
2
+ value: "This field is required"
3
+ };
4
+ var Enter_a_valid_value = {
5
+ value: "Enter a valid value"
6
+ };
7
+ var Enter_a_valid_email_address = {
8
+ value: "Enter a valid email address"
9
+ };
10
+ var Enter_a_valid_web_address = {
11
+ value: "Enter a valid web address"
12
+ };
13
+ var Enter_a_valid_phone_number = {
14
+ value: "Enter a valid phone number"
15
+ };
16
+ var Enter_a_valid_amount = {
17
+ value: "Enter a valid amount"
18
+ };
19
+ var Enter_a_number = {
20
+ value: "Enter a number"
21
+ };
22
+ var Enter_a_whole_number = {
23
+ value: "Enter a whole number"
24
+ };
25
+ var Enter_a_valid_colour = {
26
+ value: "Enter a valid colour"
27
+ };
28
+ var Choose_an_option = {
29
+ value: "Choose an option"
30
+ };
31
+ var Choose_at_least_one_option = {
32
+ value: "Choose at least one option"
33
+ };
34
+ var Enter_digits_only = {
35
+ value: "Enter digits only"
36
+ };
37
+ var Select_this_box_to_continue = {
38
+ value: "Select this box to continue"
39
+ };
40
+ var Enter_an_Eircode_such_as_D02_X285 = {
41
+ value: "Enter an Eircode, such as D02 X285"
42
+ };
43
+ var Enter_a_UK_postcode_such_as_SW1A_1AA = {
44
+ value: "Enter a UK postcode, such as SW1A 1AA"
45
+ };
46
+ var en = {
47
+ This_field_is_required: This_field_is_required,
48
+ "Enter_{min}_or_more_characters": {
49
+ value: "Enter {min} or more characters"
50
+ },
51
+ "Enter_{max}_characters_or_fewer": {
52
+ value: "Enter {max} characters or fewer"
53
+ },
54
+ Enter_a_valid_value: Enter_a_valid_value,
55
+ Enter_a_valid_email_address: Enter_a_valid_email_address,
56
+ Enter_a_valid_web_address: Enter_a_valid_web_address,
57
+ Enter_a_valid_phone_number: Enter_a_valid_phone_number,
58
+ Enter_a_valid_amount: Enter_a_valid_amount,
59
+ Enter_a_number: Enter_a_number,
60
+ Enter_a_whole_number: Enter_a_whole_number,
61
+ "Enter_{min}_or_more": {
62
+ value: "Enter {min} or more"
63
+ },
64
+ "Enter_{max}_or_less": {
65
+ value: "Enter {max} or less"
66
+ },
67
+ Enter_a_valid_colour: Enter_a_valid_colour,
68
+ "Choose_a_date_on_or_after_{min}": {
69
+ value: "Choose a date on or after {min}"
70
+ },
71
+ "Choose_a_date_on_or_before_{max}": {
72
+ value: "Choose a date on or before {max}"
73
+ },
74
+ Choose_an_option: Choose_an_option,
75
+ Choose_at_least_one_option: Choose_at_least_one_option,
76
+ Enter_digits_only: Enter_digits_only,
77
+ "Enter_{length}_digits": {
78
+ value: "Enter {length} digits"
79
+ },
80
+ Select_this_box_to_continue: Select_this_box_to_continue,
81
+ "Choose_{max}_or_fewer": {
82
+ value: "Choose {max} or fewer"
83
+ },
84
+ Enter_an_Eircode_such_as_D02_X285: Enter_an_Eircode_such_as_D02_X285,
85
+ Enter_a_UK_postcode_such_as_SW1A_1AA: Enter_a_UK_postcode_such_as_SW1A_1AA,
86
+ "Enter_a_postcode_such_as_{example}": {
87
+ value: "Enter a postcode, such as {example}"
88
+ },
89
+ "Enter_a_postal_code_such_as_{example}": {
90
+ value: "Enter a postal code, such as {example}"
91
+ },
92
+ "Enter_a_ZIP_code_such_as_{example}": {
93
+ value: "Enter a ZIP code, such as {example}"
94
+ }
95
+ };
96
+
97
+ export { Choose_an_option, Choose_at_least_one_option, Enter_a_UK_postcode_such_as_SW1A_1AA, Enter_a_number, Enter_a_valid_amount, Enter_a_valid_colour, Enter_a_valid_email_address, Enter_a_valid_phone_number, Enter_a_valid_value, Enter_a_valid_web_address, Enter_a_whole_number, Enter_an_Eircode_such_as_D02_X285, Enter_digits_only, Select_this_box_to_continue, This_field_is_required, en as default };
98
+ //# sourceMappingURL=en.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `Form` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/Form` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `Form` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormFooter` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/FormFooter` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormFooter` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormSaveErrorAlert` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/FormSaveErrorAlert` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormSaveErrorAlert` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormSection` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/FormSection` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormSection` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormUnsavedChangesModal` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/FormUnsavedChangesModal` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormUnsavedChangesModal` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormCheckbox` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormCheckbox` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormCheckbox` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormCheckboxGroup` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormCheckboxGroup` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormCheckboxGroup` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormColorPicker` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormColorPicker` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormColorPicker` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormDatePicker` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormDatePicker` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormDatePicker` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormInput` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormInput` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormInput` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormMultiSelect` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormMultiSelect` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormMultiSelect` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormRadioCardGroup` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormRadioCardGroup` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormRadioCardGroup` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormRadioGroup` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormRadioGroup` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormRadioGroup` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormSelect` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormSelect` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormSelect` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormSlider` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormSlider` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormSlider` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormTextArea` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormTextArea` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormTextArea` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `FormToggle` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/fields/FormToggle` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `FormToggle` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `validation` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/forms/validation` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `validation` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `colorUtils` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/utilities/colorUtils` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `colorUtils` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
@@ -5,7 +5,7 @@ var React = require('react');
5
5
  var reactRouter = require('react-router');
6
6
  var UnsavedChangesGuard_context = require('../../hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.cjs');
7
7
  var unsavedChangesGuard_constants = require('./unsavedChangesGuard.constants.cjs');
8
- var unsavedChangesGuard_utils = require('./unsavedChangesGuard.utils.cjs');
8
+ var unsavedChangesGuard_utils = require('./utilities/unsavedChangesGuard.utils.cjs');
9
9
 
10
10
  /** Registers the router's blocker. Rendered only while it is needed: react-router warns on every host navigation while one exists. */
11
11
  const NavigationHold = ({ shouldBlock, onChange }) => {
@@ -3,7 +3,7 @@ import { useContext, useState, useRef, useCallback, useEffect, useMemo } from 'r
3
3
  import { UNSAFE_DataRouterContext, useHref, useLocation, useBlocker } from 'react-router';
4
4
  import { UnsavedChangesGuardContext } from '../../hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.js';
5
5
  import { HOST_APPROVAL_MS } from './unsavedChangesGuard.constants.js';
6
- import { browserEntry, isInside, hasLeftFrom, canRewind, historyPosition, historyIndex, watchLeftPosition, hostGuard } from './unsavedChangesGuard.utils.js';
6
+ import { browserEntry, isInside, hasLeftFrom, canRewind, historyPosition, historyIndex, watchLeftPosition, hostGuard } from './utilities/unsavedChangesGuard.utils.js';
7
7
 
8
8
  /** Registers the router's blocker. Rendered only while it is needed: react-router warns on every host navigation while one exists. */
9
9
  const NavigationHold = ({ shouldBlock, onChange }) => {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsavedChangesGuard.utils.cjs","sources":["../../../../src/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;AAIG;AACI,MAAM,SAAS,GAAG,MAAsC,MAA6D,CAAC;AAE7H;;;;AAIG;AACI,MAAM,YAAY,GAAG,MAAgB,MAAM,CAAC,OAAO,CAAC,KAAkC,EAAE;AAE/F;;;;AAIG;AACI,MAAM,eAAe,GAAG,MAA2B,MAAkD,CAAC,UAAU,EAAE,YAAY,EAAE;AASvI;;;;;AAKG;AACI,MAAM,iBAAiB,GAAG,CAAC,OAA+C,KAAkB;AACjG,IAAA,MAAM,EAAE,UAAU,EAAE,GAAG,MAAiD;AACxE,IAAA,IAAI,CAAC,UAAU;AAAE,QAAA,OAAO,MAAK,EAAE,CAAC;;AAEhC,IAAA,MAAM,IAAI,GAAG,CAAC,KAA2C,KAAK,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;AAC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AG,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,SAAS;AACzD;AAEA;;;;;;AAMG;MACU,QAAQ,GAAG,CAAC,QAAgB,EAAE,QAAgB,KAAI;AAC7D,IAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;AACvD,IAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE;AACnC,IAAA,OAAO,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,CAAA,EAAG,IAAI,CAAA,CAAA,CAAG,CAAC;AACrD;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import type { FdNavigationGuard, HistoryPlace } from './unsavedChangesGuard.types';
1
+ import type { FdNavigationGuard, HistoryPlace } from '../unsavedChangesGuard.types';
2
2
  /**
3
3
  * Reads the bridge a host such as Portal puts on the window for the apps it mounts.
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsavedChangesGuard.utils.d.ts","sourceRoot":"","sources":["../../../../src/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEpF;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAO,iBAAiB,GAAG,SAA6F,CAAC;AAE/I;;;;GAIG;AACH,eAAO,MAAM,YAAY,QAAO,OAAkE,CAAC;AAEnG;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAO,MAAM,GAAG,SAAgG,CAAC;AAS7I;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAO9F,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,YAAY,EAAE,cAAc,MAAM,GAAG,SAAS,YACc,CAAC;AAEhG;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,YAAY,EAAE,IAAI,YAAY,YAM7D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,KAAG;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,GAAG,SAMjE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,UAAU,MAAM,EAAE,UAAU,MAAM,YAI1D,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsavedChangesGuard.utils.js","sources":["../../../../src/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;AAIG;AACI,MAAM,SAAS,GAAG,MAAsC,MAA6D,CAAC;AAE7H;;;;AAIG;AACI,MAAM,YAAY,GAAG,MAAgB,MAAM,CAAC,OAAO,CAAC,KAAkC,EAAE;AAE/F;;;;AAIG;AACI,MAAM,eAAe,GAAG,MAA2B,MAAkD,CAAC,UAAU,EAAE,YAAY,EAAE;AASvI;;;;;AAKG;AACI,MAAM,iBAAiB,GAAG,CAAC,OAA+C,KAAkB;AACjG,IAAA,MAAM,EAAE,UAAU,EAAE,GAAG,MAAiD;AACxE,IAAA,IAAI,CAAC,UAAU;AAAE,QAAA,OAAO,MAAK,EAAE,CAAC;;AAEhC,IAAA,MAAM,IAAI,GAAG,CAAC,KAA2C,KAAK,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;AACzF,IAAA,UAAU,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,IAAI,CAAC;IACvD,OAAO,MAAM,UAAU,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,IAAI,CAAC;AACzE;AAEA;;;;;;;AAOG;AACI,MAAM,WAAW,GAAG,CAAC,KAAmB,EAAE,YAAgC,KAC/E,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,IA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;AACnC,IAAA,OAAO,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,CAAA,EAAG,IAAI,CAAA,CAAA,CAAG,CAAC;AACrD;;"}
@@ -0,0 +1,74 @@
1
+ 'use strict';
2
+
3
+ var en = require('../../../localization/en.json.cjs');
4
+
5
+ /**
6
+ * The library's own text, read from the language files `scripts/sync-localization.mjs` copies in from the repo's
7
+ * `localization/` folder. INTERNAL: import as `#internal/utilities/builtInTextUtils/builtInText.utils`.
8
+ */
9
+ const FALLBACK_LANGUAGE = 'en';
10
+ // `en` alone formats a date the American way; Portal's `en` is British and Irish English, and `en-US` is its own file.
11
+ const DATE_LOCALES = { en: 'en-GB' };
12
+ const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
13
+ /**
14
+ * Fills a message's `{name}` placeholders.
15
+ *
16
+ * @param message The message, with a `{name}` placeholder wherever a value belongs.
17
+ * @param values The value for each placeholder; one with no value is left as written.
18
+ * @returns The message with its placeholders filled.
19
+ */
20
+ const fillPlaceholders = (message, values = {}) => message.replace(/\{(\w+)\}/g, (placeholder, name) => (name in values ? String(values[name]) : placeholder));
21
+ /**
22
+ * Writes an ISO date the way the language's readers do, such as `13 Nov 2026`, and passes any other value through.
23
+ *
24
+ * @param value A placeholder's value.
25
+ * @param language The language the message is shown in.
26
+ * @returns The date as text, or the value unchanged when it is not an ISO date.
27
+ */
28
+ const readable = (value, language) => {
29
+ if (typeof value !== 'string' || !ISO_DATE.test(value))
30
+ return value;
31
+ try {
32
+ return new Intl.DateTimeFormat(DATE_LOCALES[language] ?? language, { dateStyle: 'medium', timeZone: 'UTC' }).format(new Date(`${value}T00:00:00Z`));
33
+ }
34
+ catch {
35
+ // A language tag or option this runtime's `Intl` does not know: the ISO date still reads.
36
+ return value;
37
+ }
38
+ };
39
+ /**
40
+ * Builds the lookup for one package's messages.
41
+ *
42
+ * @param languages The package's language files, keyed by language.
43
+ * @returns A function from a message id, its placeholder values and a language to the text to show. A message or a
44
+ * language the files do not hold is shown in English, and a date among the values is written for the language.
45
+ */
46
+ const createBuiltInText = (languages) => (id, values = {}, language = FALLBACK_LANGUAGE) => {
47
+ const message = languages[language]?.[id]?.value ?? languages.en[id].value;
48
+ const readableValues = Object.fromEntries(Object.entries(values).map(([name, value]) => [name, readable(value, language)]));
49
+ return fillPlaceholders(message, readableValues);
50
+ };
51
+ /** The text of one of the library's own messages. English until the `TranslationProvider` supplies the language. */
52
+ const builtInText = createBuiltInText({ en: en.default });
53
+ /**
54
+ * The English wording of one of the library's messages, with its placeholders unfilled.
55
+ *
56
+ * @param id The message's id.
57
+ * @returns The message as `localization/en.json` holds it.
58
+ */
59
+ const builtInTextTemplate = (id) => en.default[id].value;
60
+ const ID_BY_TEMPLATE = new Map(Object.entries(en.default).map(([id, { value }]) => [value, id]));
61
+ /**
62
+ * Finds the id behind a message that is one of the library's own, so it can be shown in the reader's language.
63
+ *
64
+ * @param template A message as written, with its placeholders unfilled.
65
+ * @returns The message's id, or `undefined` for text the library does not ship.
66
+ */
67
+ const builtInTextIdOf = (template) => ID_BY_TEMPLATE.get(template);
68
+
69
+ exports.builtInText = builtInText;
70
+ exports.builtInTextIdOf = builtInTextIdOf;
71
+ exports.builtInTextTemplate = builtInTextTemplate;
72
+ exports.createBuiltInText = createBuiltInText;
73
+ exports.fillPlaceholders = fillPlaceholders;
74
+ //# sourceMappingURL=builtInText.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtInText.utils.cjs","sources":["../../../../src/utilities/__internal__/builtInTextUtils/builtInText.utils.ts"],"sourcesContent":[null],"names":["en"],"mappings":";;;;AAAA;;;AAGG;AAiBH,MAAM,iBAAiB,GAAG,IAAI;AAC9B;AACA,MAAM,YAAY,GAA2B,EAAE,EAAE,EAAE,OAAO,EAAE;AAC5D,MAAM,QAAQ,GAAG,qBAAqB;AAEtC;;;;;;AAMG;MACU,gBAAgB,GAAG,CAAC,OAAe,EAAE,SAAqB,EAAE,KACvE,OAAO,CAAC,OAA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,iBAAiB,CAAgB,MAAEA,UAAE,EAAE;AAElE;;;;;AAKG;AACI,MAAM,mBAAmB,GAAG,CAAC,EAAiB,KAAaA,UAAE,CAAC,EAAE,CAAC,CAAC;AAEzE,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAACA,UAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,EAAmB,CAAC,CAAC,CAAC;AAEzG;;;;;AAKG;AACI,MAAM,eAAe,GAAG,CAAC,QAAgB,KAAgC,cAAc,CAAC,GAAG,CAAC,QAAQ;;;;;;"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The library's own text, read from the language files `scripts/sync-localization.mjs` copies in from the repo's
3
+ * `localization/` folder. INTERNAL: import as `#internal/utilities/builtInTextUtils/builtInText.utils`.
4
+ */
5
+ import en from '../../../localization/en.json';
6
+ /** One message as a language file holds it. */
7
+ interface Message {
8
+ value: string;
9
+ }
10
+ /** The value for each `{name}` placeholder in a message. */
11
+ type TextValues = Record<string, string | number>;
12
+ /** A set of language files: English, which holds every message, and any other language, which may hold fewer. */
13
+ type Languages<TId extends string> = {
14
+ en: Record<TId, Message>;
15
+ } & Record<string, Partial<Record<TId, Message>>>;
16
+ /** The id of a message the library ships: a key of `localization/en.json`. */
17
+ export type BuiltInTextId = keyof typeof en;
18
+ /**
19
+ * Fills a message's `{name}` placeholders.
20
+ *
21
+ * @param message The message, with a `{name}` placeholder wherever a value belongs.
22
+ * @param values The value for each placeholder; one with no value is left as written.
23
+ * @returns The message with its placeholders filled.
24
+ */
25
+ export declare const fillPlaceholders: (message: string, values?: TextValues) => string;
26
+ /**
27
+ * Builds the lookup for one package's messages.
28
+ *
29
+ * @param languages The package's language files, keyed by language.
30
+ * @returns A function from a message id, its placeholder values and a language to the text to show. A message or a
31
+ * language the files do not hold is shown in English, and a date among the values is written for the language.
32
+ */
33
+ export declare const createBuiltInText: <TId extends string>(languages: Languages<TId>) => (id: TId, values?: TextValues, language?: string) => string;
34
+ /** The text of one of the library's own messages. English until the `TranslationProvider` supplies the language. */
35
+ export declare const builtInText: (id: "This_field_is_required" | "Enter_{min}_or_more_characters" | "Enter_{max}_characters_or_fewer" | "Enter_a_valid_value" | "Enter_a_valid_email_address" | "Enter_a_valid_web_address" | "Enter_a_valid_phone_number" | "Enter_a_valid_amount" | "Enter_a_number" | "Enter_a_whole_number" | "Enter_{min}_or_more" | "Enter_{max}_or_less" | "Enter_a_valid_colour" | "Choose_a_date_on_or_after_{min}" | "Choose_a_date_on_or_before_{max}" | "Choose_an_option" | "Choose_at_least_one_option" | "Enter_digits_only" | "Enter_{length}_digits" | "Select_this_box_to_continue" | "Choose_{max}_or_fewer" | "Enter_an_Eircode_such_as_D02_X285" | "Enter_a_UK_postcode_such_as_SW1A_1AA" | "Enter_a_postcode_such_as_{example}" | "Enter_a_postal_code_such_as_{example}" | "Enter_a_ZIP_code_such_as_{example}", values?: TextValues, language?: string) => string;
36
+ /**
37
+ * The English wording of one of the library's messages, with its placeholders unfilled.
38
+ *
39
+ * @param id The message's id.
40
+ * @returns The message as `localization/en.json` holds it.
41
+ */
42
+ export declare const builtInTextTemplate: (id: BuiltInTextId) => string;
43
+ /**
44
+ * Finds the id behind a message that is one of the library's own, so it can be shown in the reader's language.
45
+ *
46
+ * @param template A message as written, with its placeholders unfilled.
47
+ * @returns The message's id, or `undefined` for text the library does not ship.
48
+ */
49
+ export declare const builtInTextIdOf: (template: string) => BuiltInTextId | undefined;
50
+ export {};
51
+ //# sourceMappingURL=builtInText.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtInText.utils.d.ts","sourceRoot":"","sources":["../../../../src/utilities/__internal__/builtInTextUtils/builtInText.utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/C,+CAA+C;AAC/C,UAAU,OAAO;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,4DAA4D;AAC5D,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAElD,iHAAiH;AACjH,KAAK,SAAS,CAAC,GAAG,SAAS,MAAM,IAAI;IAAE,EAAE,EAAE,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAElH,8EAA8E;AAC9E,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,EAAE,CAAC;AAO5C;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,EAAE,SAAQ,UAAe,KAAG,MACyC,CAAC;AAqBtH;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC3B,GAAG,SAAS,MAAM,EAAE,WAAW,SAAS,CAAC,GAAG,CAAC,MAC7C,IAAI,GAAG,EAAE,SAAQ,UAAe,EAAE,WAAU,MAA0B,KAAG,MAIzE,CAAC;AAEJ,oHAAoH;AACpH,eAAO,MAAM,WAAW,kyBAPJ,UAAU,aAAiB,MAAM,KAAuB,MAOT,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,IAAI,aAAa,KAAG,MAAsB,CAAC;AAI/E;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,KAAG,aAAa,GAAG,SAAyC,CAAC"}
@@ -0,0 +1,68 @@
1
+ import en from '../../../localization/en.json.js';
2
+
3
+ /**
4
+ * The library's own text, read from the language files `scripts/sync-localization.mjs` copies in from the repo's
5
+ * `localization/` folder. INTERNAL: import as `#internal/utilities/builtInTextUtils/builtInText.utils`.
6
+ */
7
+ const FALLBACK_LANGUAGE = 'en';
8
+ // `en` alone formats a date the American way; Portal's `en` is British and Irish English, and `en-US` is its own file.
9
+ const DATE_LOCALES = { en: 'en-GB' };
10
+ const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
11
+ /**
12
+ * Fills a message's `{name}` placeholders.
13
+ *
14
+ * @param message The message, with a `{name}` placeholder wherever a value belongs.
15
+ * @param values The value for each placeholder; one with no value is left as written.
16
+ * @returns The message with its placeholders filled.
17
+ */
18
+ const fillPlaceholders = (message, values = {}) => message.replace(/\{(\w+)\}/g, (placeholder, name) => (name in values ? String(values[name]) : placeholder));
19
+ /**
20
+ * Writes an ISO date the way the language's readers do, such as `13 Nov 2026`, and passes any other value through.
21
+ *
22
+ * @param value A placeholder's value.
23
+ * @param language The language the message is shown in.
24
+ * @returns The date as text, or the value unchanged when it is not an ISO date.
25
+ */
26
+ const readable = (value, language) => {
27
+ if (typeof value !== 'string' || !ISO_DATE.test(value))
28
+ return value;
29
+ try {
30
+ return new Intl.DateTimeFormat(DATE_LOCALES[language] ?? language, { dateStyle: 'medium', timeZone: 'UTC' }).format(new Date(`${value}T00:00:00Z`));
31
+ }
32
+ catch {
33
+ // A language tag or option this runtime's `Intl` does not know: the ISO date still reads.
34
+ return value;
35
+ }
36
+ };
37
+ /**
38
+ * Builds the lookup for one package's messages.
39
+ *
40
+ * @param languages The package's language files, keyed by language.
41
+ * @returns A function from a message id, its placeholder values and a language to the text to show. A message or a
42
+ * language the files do not hold is shown in English, and a date among the values is written for the language.
43
+ */
44
+ const createBuiltInText = (languages) => (id, values = {}, language = FALLBACK_LANGUAGE) => {
45
+ const message = languages[language]?.[id]?.value ?? languages.en[id].value;
46
+ const readableValues = Object.fromEntries(Object.entries(values).map(([name, value]) => [name, readable(value, language)]));
47
+ return fillPlaceholders(message, readableValues);
48
+ };
49
+ /** The text of one of the library's own messages. English until the `TranslationProvider` supplies the language. */
50
+ const builtInText = createBuiltInText({ en });
51
+ /**
52
+ * The English wording of one of the library's messages, with its placeholders unfilled.
53
+ *
54
+ * @param id The message's id.
55
+ * @returns The message as `localization/en.json` holds it.
56
+ */
57
+ const builtInTextTemplate = (id) => en[id].value;
58
+ const ID_BY_TEMPLATE = new Map(Object.entries(en).map(([id, { value }]) => [value, id]));
59
+ /**
60
+ * Finds the id behind a message that is one of the library's own, so it can be shown in the reader's language.
61
+ *
62
+ * @param template A message as written, with its placeholders unfilled.
63
+ * @returns The message's id, or `undefined` for text the library does not ship.
64
+ */
65
+ const builtInTextIdOf = (template) => ID_BY_TEMPLATE.get(template);
66
+
67
+ export { builtInText, builtInTextIdOf, builtInTextTemplate, createBuiltInText, fillPlaceholders };
68
+ //# sourceMappingURL=builtInText.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtInText.utils.js","sources":["../../../../src/utilities/__internal__/builtInTextUtils/builtInText.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAiBH,MAAM,iBAAiB,GAAG,IAAI;AAC9B;AACA,MAAM,YAAY,GAA2B,EAAE,EAAE,EAAE,OAAO,EAAE;AAC5D,MAAM,QAAQ,GAAG,qBAAqB;AAEtC;;;;;;AAMG;MACU,gBAAgB,GAAG,CAAC,OAAe,EAAE,SAAqB,EAAE,KACvE,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,WAAW,EAAE,IAAY,MAAM,IAAI,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC;AAEpH;;;;;;AAMG;AACH,MAAM,QAAQ,GAAG,CAAC,KAAsB,EAAE,QAAgB,KAAqB;IAC7E,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,KAAK;AACpE,IAAA,IAAI;AACF,QAAA,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,QAAQ,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CACjH,IAAI,IAAI,C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