@flipdish/ui-library 0.50.0 → 0.52.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 (409) hide show
  1. package/README.md +17 -16
  2. package/dist/components/atoms/Checkbox/index.cjs +11 -3
  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 +12 -4
  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/useSubmitInTurn/useSubmitInTurn.cjs +28 -0
  20. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.cjs.map +1 -0
  21. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.d.ts +10 -0
  22. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.d.ts.map +1 -0
  23. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.js +26 -0
  24. package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.js.map +1 -0
  25. package/dist/components/forms/Form/index.cjs +43 -0
  26. package/dist/components/forms/Form/index.cjs.map +1 -0
  27. package/dist/components/forms/Form/index.d.ts +30 -0
  28. package/dist/components/forms/Form/index.d.ts.map +1 -0
  29. package/dist/components/forms/Form/index.js +40 -0
  30. package/dist/components/forms/Form/index.js.map +1 -0
  31. package/dist/components/forms/Form/utilities/formSubmit.utils.cjs +23 -0
  32. package/dist/components/forms/Form/utilities/formSubmit.utils.cjs.map +1 -0
  33. package/dist/components/forms/Form/utilities/formSubmit.utils.d.ts +14 -0
  34. package/dist/components/forms/Form/utilities/formSubmit.utils.d.ts.map +1 -0
  35. package/dist/components/forms/Form/utilities/formSubmit.utils.js +21 -0
  36. package/dist/components/forms/Form/utilities/formSubmit.utils.js.map +1 -0
  37. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.cjs +39 -0
  38. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.cjs.map +1 -0
  39. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.d.ts +17 -0
  40. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.d.ts.map +1 -0
  41. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.js +37 -0
  42. package/dist/components/forms/FormFooter/hooks/useDestructiveConfirmation.js.map +1 -0
  43. package/dist/components/forms/FormFooter/hooks/useHasFieldError.cjs +26 -0
  44. package/dist/components/forms/FormFooter/hooks/useHasFieldError.cjs.map +1 -0
  45. package/dist/components/forms/FormFooter/hooks/useHasFieldError.d.ts +9 -0
  46. package/dist/components/forms/FormFooter/hooks/useHasFieldError.d.ts.map +1 -0
  47. package/dist/components/forms/FormFooter/hooks/useHasFieldError.js +24 -0
  48. package/dist/components/forms/FormFooter/hooks/useHasFieldError.js.map +1 -0
  49. package/dist/components/forms/FormFooter/index.cjs +41 -0
  50. package/dist/components/forms/FormFooter/index.cjs.map +1 -0
  51. package/dist/components/forms/FormFooter/index.d.ts +52 -0
  52. package/dist/components/forms/FormFooter/index.d.ts.map +1 -0
  53. package/dist/components/forms/FormFooter/index.js +39 -0
  54. package/dist/components/forms/FormFooter/index.js.map +1 -0
  55. package/dist/components/forms/FormFooter/utilities/formFooter.utils.cjs +21 -0
  56. package/dist/components/forms/FormFooter/utilities/formFooter.utils.cjs.map +1 -0
  57. package/dist/components/forms/FormFooter/utilities/formFooter.utils.d.ts +12 -0
  58. package/dist/components/forms/FormFooter/utilities/formFooter.utils.d.ts.map +1 -0
  59. package/dist/components/forms/FormFooter/utilities/formFooter.utils.js +19 -0
  60. package/dist/components/forms/FormFooter/utilities/formFooter.utils.js.map +1 -0
  61. package/dist/components/forms/FormSection/FormSection.styles.cjs +15 -0
  62. package/dist/components/forms/FormSection/FormSection.styles.cjs.map +1 -0
  63. package/dist/components/forms/FormSection/FormSection.styles.d.ts +9 -0
  64. package/dist/components/forms/FormSection/FormSection.styles.d.ts.map +1 -0
  65. package/dist/components/forms/FormSection/FormSection.styles.js +13 -0
  66. package/dist/components/forms/FormSection/FormSection.styles.js.map +1 -0
  67. package/dist/components/forms/FormSection/index.cjs +43 -0
  68. package/dist/components/forms/FormSection/index.cjs.map +1 -0
  69. package/dist/components/forms/FormSection/index.d.ts +41 -0
  70. package/dist/components/forms/FormSection/index.d.ts.map +1 -0
  71. package/dist/components/forms/FormSection/index.js +41 -0
  72. package/dist/components/forms/FormSection/index.js.map +1 -0
  73. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.cjs +28 -0
  74. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.cjs.map +1 -0
  75. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.d.ts +12 -0
  76. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.d.ts.map +1 -0
  77. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.js +26 -0
  78. package/dist/components/forms/__internal__/formField/hooks/useFocusTarget.js.map +1 -0
  79. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.cjs +68 -0
  80. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.cjs.map +1 -0
  81. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.d.ts +26 -0
  82. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.d.ts.map +1 -0
  83. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.js +66 -0
  84. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.js.map +1 -0
  85. package/dist/components/forms/__internal__/formField/hooks/useFormField.cjs +142 -0
  86. package/dist/components/forms/__internal__/formField/hooks/useFormField.cjs.map +1 -0
  87. package/dist/components/forms/__internal__/formField/hooks/useFormField.d.ts +35 -0
  88. package/dist/components/forms/__internal__/formField/hooks/useFormField.d.ts.map +1 -0
  89. package/dist/components/forms/__internal__/formField/hooks/useFormField.js +140 -0
  90. package/dist/components/forms/__internal__/formField/hooks/useFormField.js.map +1 -0
  91. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.cjs +12 -0
  92. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.cjs.map +1 -0
  93. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.d.ts +7 -0
  94. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.d.ts.map +1 -0
  95. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.js +10 -0
  96. package/dist/components/forms/__internal__/formField/providers/FieldElements.context.js.map +1 -0
  97. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.cjs +39 -0
  98. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.cjs.map +1 -0
  99. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.d.ts +21 -0
  100. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.d.ts.map +1 -0
  101. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.js +37 -0
  102. package/dist/components/forms/__internal__/formField/utilities/fieldElements.utils.js.map +1 -0
  103. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.cjs +40 -0
  104. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.cjs.map +1 -0
  105. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.d.ts +18 -0
  106. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.d.ts.map +1 -0
  107. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.js +37 -0
  108. package/dist/components/forms/__internal__/formField/utilities/fieldValue.utils.js.map +1 -0
  109. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.cjs +21 -0
  110. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.cjs.map +1 -0
  111. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.d.ts +11 -0
  112. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.d.ts.map +1 -0
  113. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.js +19 -0
  114. package/dist/components/forms/__internal__/formField/utilities/formFocus.utils.js.map +1 -0
  115. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.cjs +128 -0
  116. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.cjs.map +1 -0
  117. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.d.ts +72 -0
  118. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.d.ts.map +1 -0
  119. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.js +121 -0
  120. package/dist/components/forms/__internal__/formField/utilities/validationQueue.utils.js.map +1 -0
  121. package/dist/components/forms/fields/FormCheckbox/index.cjs +34 -0
  122. package/dist/components/forms/fields/FormCheckbox/index.cjs.map +1 -0
  123. package/dist/components/forms/fields/FormCheckbox/index.d.ts +16 -0
  124. package/dist/components/forms/fields/FormCheckbox/index.d.ts.map +1 -0
  125. package/dist/components/forms/fields/FormCheckbox/index.js +32 -0
  126. package/dist/components/forms/fields/FormCheckbox/index.js.map +1 -0
  127. package/dist/components/forms/fields/FormCheckboxGroup/index.cjs +33 -0
  128. package/dist/components/forms/fields/FormCheckboxGroup/index.cjs.map +1 -0
  129. package/dist/components/forms/fields/FormCheckboxGroup/index.d.ts +16 -0
  130. package/dist/components/forms/fields/FormCheckboxGroup/index.d.ts.map +1 -0
  131. package/dist/components/forms/fields/FormCheckboxGroup/index.js +31 -0
  132. package/dist/components/forms/fields/FormCheckboxGroup/index.js.map +1 -0
  133. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.cjs +26 -0
  134. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.cjs.map +1 -0
  135. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.d.ts +11 -0
  136. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.d.ts.map +1 -0
  137. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.js +24 -0
  138. package/dist/components/forms/fields/FormColorPicker/hooks/useEmptyFieldValue.js.map +1 -0
  139. package/dist/components/forms/fields/FormColorPicker/index.cjs +33 -0
  140. package/dist/components/forms/fields/FormColorPicker/index.cjs.map +1 -0
  141. package/dist/components/forms/fields/FormColorPicker/index.d.ts +21 -0
  142. package/dist/components/forms/fields/FormColorPicker/index.d.ts.map +1 -0
  143. package/dist/components/forms/fields/FormColorPicker/index.js +31 -0
  144. package/dist/components/forms/fields/FormColorPicker/index.js.map +1 -0
  145. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.cjs +20 -0
  146. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.cjs.map +1 -0
  147. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.d.ts +17 -0
  148. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.d.ts.map +1 -0
  149. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.js +18 -0
  150. package/dist/components/forms/fields/FormColorPicker/utilities/formColorPicker.utils.js.map +1 -0
  151. package/dist/components/forms/fields/FormDatePicker/index.cjs +35 -0
  152. package/dist/components/forms/fields/FormDatePicker/index.cjs.map +1 -0
  153. package/dist/components/forms/fields/FormDatePicker/index.d.ts +17 -0
  154. package/dist/components/forms/fields/FormDatePicker/index.d.ts.map +1 -0
  155. package/dist/components/forms/fields/FormDatePicker/index.js +33 -0
  156. package/dist/components/forms/fields/FormDatePicker/index.js.map +1 -0
  157. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.cjs +23 -0
  158. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.cjs.map +1 -0
  159. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.d.ts +9 -0
  160. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.d.ts.map +1 -0
  161. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.js +21 -0
  162. package/dist/components/forms/fields/FormDatePicker/utilities/formDatePicker.utils.js.map +1 -0
  163. package/dist/components/forms/fields/FormInput/index.cjs +27 -0
  164. package/dist/components/forms/fields/FormInput/index.cjs.map +1 -0
  165. package/dist/components/forms/fields/FormInput/index.d.ts +16 -0
  166. package/dist/components/forms/fields/FormInput/index.d.ts.map +1 -0
  167. package/dist/components/forms/fields/FormInput/index.js +25 -0
  168. package/dist/components/forms/fields/FormInput/index.js.map +1 -0
  169. package/dist/components/forms/fields/FormMultiSelect/index.cjs +44 -0
  170. package/dist/components/forms/fields/FormMultiSelect/index.cjs.map +1 -0
  171. package/dist/components/forms/fields/FormMultiSelect/index.d.ts +17 -0
  172. package/dist/components/forms/fields/FormMultiSelect/index.d.ts.map +1 -0
  173. package/dist/components/forms/fields/FormMultiSelect/index.js +42 -0
  174. package/dist/components/forms/fields/FormMultiSelect/index.js.map +1 -0
  175. package/dist/components/forms/fields/FormRadioCardGroup/index.cjs +36 -0
  176. package/dist/components/forms/fields/FormRadioCardGroup/index.cjs.map +1 -0
  177. package/dist/components/forms/fields/FormRadioCardGroup/index.d.ts +29 -0
  178. package/dist/components/forms/fields/FormRadioCardGroup/index.d.ts.map +1 -0
  179. package/dist/components/forms/fields/FormRadioCardGroup/index.js +34 -0
  180. package/dist/components/forms/fields/FormRadioCardGroup/index.js.map +1 -0
  181. package/dist/components/forms/fields/FormRadioGroup/index.cjs +31 -0
  182. package/dist/components/forms/fields/FormRadioGroup/index.cjs.map +1 -0
  183. package/dist/components/forms/fields/FormRadioGroup/index.d.ts +17 -0
  184. package/dist/components/forms/fields/FormRadioGroup/index.d.ts.map +1 -0
  185. package/dist/components/forms/fields/FormRadioGroup/index.js +29 -0
  186. package/dist/components/forms/fields/FormRadioGroup/index.js.map +1 -0
  187. package/dist/components/forms/fields/FormSelect/index.cjs +30 -0
  188. package/dist/components/forms/fields/FormSelect/index.cjs.map +1 -0
  189. package/dist/components/forms/fields/FormSelect/index.d.ts +16 -0
  190. package/dist/components/forms/fields/FormSelect/index.d.ts.map +1 -0
  191. package/dist/components/forms/fields/FormSelect/index.js +28 -0
  192. package/dist/components/forms/fields/FormSelect/index.js.map +1 -0
  193. package/dist/components/forms/fields/FormSlider/index.cjs +43 -0
  194. package/dist/components/forms/fields/FormSlider/index.cjs.map +1 -0
  195. package/dist/components/forms/fields/FormSlider/index.d.ts +17 -0
  196. package/dist/components/forms/fields/FormSlider/index.d.ts.map +1 -0
  197. package/dist/components/forms/fields/FormSlider/index.js +41 -0
  198. package/dist/components/forms/fields/FormSlider/index.js.map +1 -0
  199. package/dist/components/forms/fields/FormTextArea/index.cjs +27 -0
  200. package/dist/components/forms/fields/FormTextArea/index.cjs.map +1 -0
  201. package/dist/components/forms/fields/FormTextArea/index.d.ts +16 -0
  202. package/dist/components/forms/fields/FormTextArea/index.d.ts.map +1 -0
  203. package/dist/components/forms/fields/FormTextArea/index.js +25 -0
  204. package/dist/components/forms/fields/FormTextArea/index.js.map +1 -0
  205. package/dist/components/forms/fields/FormToggle/index.cjs +32 -0
  206. package/dist/components/forms/fields/FormToggle/index.cjs.map +1 -0
  207. package/dist/components/forms/fields/FormToggle/index.d.ts +16 -0
  208. package/dist/components/forms/fields/FormToggle/index.d.ts.map +1 -0
  209. package/dist/components/forms/fields/FormToggle/index.js +30 -0
  210. package/dist/components/forms/fields/FormToggle/index.js.map +1 -0
  211. package/dist/components/forms/validation/hooks/useSchemaResolver.cjs +39 -0
  212. package/dist/components/forms/validation/hooks/useSchemaResolver.cjs.map +1 -0
  213. package/dist/components/forms/validation/hooks/useSchemaResolver.d.ts +15 -0
  214. package/dist/components/forms/validation/hooks/useSchemaResolver.d.ts.map +1 -0
  215. package/dist/components/forms/validation/hooks/useSchemaResolver.js +37 -0
  216. package/dist/components/forms/validation/hooks/useSchemaResolver.js.map +1 -0
  217. package/dist/components/forms/validation/index.cjs +309 -0
  218. package/dist/components/forms/validation/index.cjs.map +1 -0
  219. package/dist/components/forms/validation/index.d.ts +214 -0
  220. package/dist/components/forms/validation/index.d.ts.map +1 -0
  221. package/dist/components/forms/validation/index.js +293 -0
  222. package/dist/components/forms/validation/index.js.map +1 -0
  223. package/dist/components/forms/validation/utilities/validation.utils.cjs +42 -0
  224. package/dist/components/forms/validation/utilities/validation.utils.cjs.map +1 -0
  225. package/dist/components/forms/validation/utilities/validation.utils.d.ts +20 -0
  226. package/dist/components/forms/validation/utilities/validation.utils.d.ts.map +1 -0
  227. package/dist/components/forms/validation/utilities/validation.utils.js +39 -0
  228. package/dist/components/forms/validation/utilities/validation.utils.js.map +1 -0
  229. package/dist/components/forms/validation/validation.types.d.ts +8 -0
  230. package/dist/components/forms/validation/validation.types.d.ts.map +1 -0
  231. package/dist/components/molecules/Alert/index.cjs +5 -25
  232. package/dist/components/molecules/Alert/index.cjs.map +1 -1
  233. package/dist/components/molecules/Alert/index.d.ts +9 -94
  234. package/dist/components/molecules/Alert/index.d.ts.map +1 -1
  235. package/dist/components/molecules/Alert/index.js +5 -25
  236. package/dist/components/molecules/Alert/index.js.map +1 -1
  237. package/dist/components/molecules/Alerts/components/Alert.cjs +39 -0
  238. package/dist/components/molecules/Alerts/components/Alert.cjs.map +1 -0
  239. package/dist/components/molecules/Alerts/components/Alert.d.ts +104 -0
  240. package/dist/components/molecules/Alerts/components/Alert.d.ts.map +1 -0
  241. package/dist/components/molecules/Alerts/components/Alert.js +36 -0
  242. package/dist/components/molecules/Alerts/components/Alert.js.map +1 -0
  243. package/dist/components/molecules/Alerts/components/SaveErrorAlert.cjs +26 -0
  244. package/dist/components/molecules/Alerts/components/SaveErrorAlert.cjs.map +1 -0
  245. package/dist/components/molecules/Alerts/components/SaveErrorAlert.d.ts +25 -0
  246. package/dist/components/molecules/Alerts/components/SaveErrorAlert.d.ts.map +1 -0
  247. package/dist/components/molecules/Alerts/components/SaveErrorAlert.js +24 -0
  248. package/dist/components/molecules/Alerts/components/SaveErrorAlert.js.map +1 -0
  249. package/dist/components/molecules/Alerts/hooks/useAlertActions.cjs +26 -0
  250. package/dist/components/molecules/Alerts/hooks/useAlertActions.cjs.map +1 -0
  251. package/dist/components/molecules/Alerts/hooks/useAlertActions.d.ts +13 -0
  252. package/dist/components/molecules/Alerts/hooks/useAlertActions.d.ts.map +1 -0
  253. package/dist/components/molecules/Alerts/hooks/useAlertActions.js +24 -0
  254. package/dist/components/molecules/Alerts/hooks/useAlertActions.js.map +1 -0
  255. package/dist/components/molecules/Alerts/index.cjs +11 -0
  256. package/dist/components/molecules/Alerts/index.cjs.map +1 -0
  257. package/dist/components/molecules/Alerts/index.d.ts +12 -0
  258. package/dist/components/molecules/Alerts/index.d.ts.map +1 -0
  259. package/dist/components/molecules/Alerts/index.js +3 -0
  260. package/dist/components/molecules/Alerts/index.js.map +1 -0
  261. package/dist/components/molecules/Modal/index.cjs +9 -39
  262. package/dist/components/molecules/Modal/index.cjs.map +1 -1
  263. package/dist/components/molecules/Modal/index.d.ts +13 -36
  264. package/dist/components/molecules/Modal/index.d.ts.map +1 -1
  265. package/dist/components/molecules/Modal/index.js +8 -38
  266. package/dist/components/molecules/Modal/index.js.map +1 -1
  267. package/dist/components/molecules/Modals/components/ConfirmationModal.cjs +32 -0
  268. package/dist/components/molecules/Modals/components/ConfirmationModal.cjs.map +1 -0
  269. package/dist/components/molecules/Modals/components/ConfirmationModal.d.ts +28 -0
  270. package/dist/components/molecules/Modals/components/ConfirmationModal.d.ts.map +1 -0
  271. package/dist/components/molecules/Modals/components/ConfirmationModal.js +30 -0
  272. package/dist/components/molecules/Modals/components/ConfirmationModal.js.map +1 -0
  273. package/dist/components/molecules/Modals/components/Modal.cjs +48 -0
  274. package/dist/components/molecules/Modals/components/Modal.cjs.map +1 -0
  275. package/dist/components/molecules/Modals/components/Modal.d.ts +37 -0
  276. package/dist/components/molecules/Modals/components/Modal.d.ts.map +1 -0
  277. package/dist/components/molecules/Modals/components/Modal.js +43 -0
  278. package/dist/components/molecules/Modals/components/Modal.js.map +1 -0
  279. package/dist/components/molecules/Modals/components/UnsavedChangesModal.cjs +30 -0
  280. package/dist/components/molecules/Modals/components/UnsavedChangesModal.cjs.map +1 -0
  281. package/dist/components/molecules/Modals/components/UnsavedChangesModal.d.ts +14 -0
  282. package/dist/components/molecules/Modals/components/UnsavedChangesModal.d.ts.map +1 -0
  283. package/dist/components/molecules/Modals/components/UnsavedChangesModal.js +28 -0
  284. package/dist/components/molecules/Modals/components/UnsavedChangesModal.js.map +1 -0
  285. package/dist/components/molecules/Modals/index.cjs +15 -0
  286. package/dist/components/molecules/Modals/index.cjs.map +1 -0
  287. package/dist/components/molecules/Modals/index.d.ts +14 -0
  288. package/dist/components/molecules/Modals/index.d.ts.map +1 -0
  289. package/dist/components/molecules/Modals/index.js +4 -0
  290. package/dist/components/molecules/Modals/index.js.map +1 -0
  291. package/dist/components/organisms/ColorPicker/components/ColorPickerField.cjs +13 -3
  292. package/dist/components/organisms/ColorPicker/components/ColorPickerField.cjs.map +1 -1
  293. package/dist/components/organisms/ColorPicker/components/ColorPickerField.d.ts +1 -1
  294. package/dist/components/organisms/ColorPicker/components/ColorPickerField.d.ts.map +1 -1
  295. package/dist/components/organisms/ColorPicker/components/ColorPickerField.js +13 -3
  296. package/dist/components/organisms/ColorPicker/components/ColorPickerField.js.map +1 -1
  297. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.cjs +2 -2
  298. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.cjs.map +1 -1
  299. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.d.ts +1 -0
  300. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.d.ts.map +1 -1
  301. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.js +2 -2
  302. package/dist/components/organisms/ColorPicker/hooks/useColorFieldEdit.js.map +1 -1
  303. package/dist/components/organisms/ColorPicker/hooks/useCssColorField.cjs +1 -1
  304. package/dist/components/organisms/ColorPicker/hooks/useCssColorField.js +1 -1
  305. package/dist/components/organisms/ColorPicker/index.cjs +1 -1
  306. package/dist/components/organisms/ColorPicker/index.d.ts.map +1 -1
  307. package/dist/components/organisms/ColorPicker/index.js +1 -1
  308. package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.d.ts +1 -1
  309. package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.d.ts.map +1 -1
  310. package/dist/components/organisms/ColorPicker/utilities/colorPicker.utils.cjs.map +1 -0
  311. package/dist/components/organisms/ColorPicker/utilities/colorPicker.utils.d.ts.map +1 -0
  312. package/dist/components/organisms/ColorPicker/utilities/colorPicker.utils.js.map +1 -0
  313. package/dist/components/organisms/DatePicker/components/CalendarOverlay.cjs +2 -2
  314. package/dist/components/organisms/DatePicker/components/CalendarOverlay.cjs.map +1 -1
  315. package/dist/components/organisms/DatePicker/components/CalendarOverlay.js +1 -1
  316. package/dist/components/organisms/DatePicker/components/DateRangePicker.cjs +4 -1
  317. package/dist/components/organisms/DatePicker/components/DateRangePicker.cjs.map +1 -1
  318. package/dist/components/organisms/DatePicker/components/DateRangePicker.d.ts.map +1 -1
  319. package/dist/components/organisms/DatePicker/components/DateRangePicker.js +5 -2
  320. package/dist/components/organisms/DatePicker/components/DateRangePicker.js.map +1 -1
  321. package/dist/components/organisms/GradientPicker/components/GradientStopRow.cjs +1 -1
  322. package/dist/components/organisms/GradientPicker/components/GradientStopRow.js +1 -1
  323. package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.cjs +48 -0
  324. package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.cjs.map +1 -0
  325. package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.d.ts +23 -0
  326. package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.d.ts.map +1 -0
  327. package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.js +45 -0
  328. package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.js.map +1 -0
  329. package/dist/hooks/useUnsavedChangesGuard/index.cjs +28 -0
  330. package/dist/hooks/useUnsavedChangesGuard/index.cjs.map +1 -0
  331. package/dist/hooks/useUnsavedChangesGuard/index.d.ts +18 -0
  332. package/dist/hooks/useUnsavedChangesGuard/index.d.ts.map +1 -0
  333. package/dist/hooks/useUnsavedChangesGuard/index.js +26 -0
  334. package/dist/hooks/useUnsavedChangesGuard/index.js.map +1 -0
  335. package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.cjs +8 -0
  336. package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.cjs.map +1 -0
  337. package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.d.ts +13 -0
  338. package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.d.ts.map +1 -0
  339. package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.js +6 -0
  340. package/dist/hooks/useUnsavedChangesGuard/providers/UnsavedChangesGuard.context.js.map +1 -0
  341. package/dist/localization/en.json.cjs +98 -0
  342. package/dist/localization/en.json.cjs.map +1 -0
  343. package/dist/localization/en.json.js +81 -0
  344. package/dist/localization/en.json.js.map +1 -0
  345. package/dist/native/components/forms/Form/index.d.ts +12 -0
  346. package/dist/native/components/forms/FormFooter/index.d.ts +12 -0
  347. package/dist/native/components/forms/FormSection/index.d.ts +12 -0
  348. package/dist/native/components/forms/fields/FormCheckbox/index.d.ts +12 -0
  349. package/dist/native/components/forms/fields/FormCheckboxGroup/index.d.ts +12 -0
  350. package/dist/native/components/forms/fields/FormColorPicker/index.d.ts +12 -0
  351. package/dist/native/components/forms/fields/FormDatePicker/index.d.ts +12 -0
  352. package/dist/native/components/forms/fields/FormInput/index.d.ts +12 -0
  353. package/dist/native/components/forms/fields/FormMultiSelect/index.d.ts +12 -0
  354. package/dist/native/components/forms/fields/FormRadioCardGroup/index.d.ts +12 -0
  355. package/dist/native/components/forms/fields/FormRadioGroup/index.d.ts +12 -0
  356. package/dist/native/components/forms/fields/FormSelect/index.d.ts +12 -0
  357. package/dist/native/components/forms/fields/FormSlider/index.d.ts +12 -0
  358. package/dist/native/components/forms/fields/FormTextArea/index.d.ts +12 -0
  359. package/dist/native/components/forms/fields/FormToggle/index.d.ts +12 -0
  360. package/dist/native/components/forms/validation/index.d.ts +12 -0
  361. package/dist/native/components/molecules/Alerts/index.d.ts +12 -0
  362. package/dist/native/components/molecules/Modals/index.d.ts +12 -0
  363. package/dist/native/hooks/useUnsavedChangesGuard/index.d.ts +12 -0
  364. package/dist/native/providers/UnsavedChangesGuardProvider/index.d.ts +12 -0
  365. package/dist/providers/UIProvider/hooks/useBrowserRouter.cjs +70 -0
  366. package/dist/providers/UIProvider/hooks/useBrowserRouter.cjs.map +1 -0
  367. package/dist/providers/UIProvider/hooks/useBrowserRouter.d.ts +12 -0
  368. package/dist/providers/UIProvider/hooks/useBrowserRouter.d.ts.map +1 -0
  369. package/dist/providers/UIProvider/hooks/useBrowserRouter.js +68 -0
  370. package/dist/providers/UIProvider/hooks/useBrowserRouter.js.map +1 -0
  371. package/dist/providers/UIProvider/index.cjs +19 -6
  372. package/dist/providers/UIProvider/index.cjs.map +1 -1
  373. package/dist/providers/UIProvider/index.d.ts +2 -2
  374. package/dist/providers/UIProvider/index.d.ts.map +1 -1
  375. package/dist/providers/UIProvider/index.js +20 -7
  376. package/dist/providers/UIProvider/index.js.map +1 -1
  377. package/dist/providers/UnsavedChangesGuardProvider/index.cjs +191 -0
  378. package/dist/providers/UnsavedChangesGuardProvider/index.cjs.map +1 -0
  379. package/dist/providers/UnsavedChangesGuardProvider/index.d.ts +10 -0
  380. package/dist/providers/UnsavedChangesGuardProvider/index.d.ts.map +1 -0
  381. package/dist/providers/UnsavedChangesGuardProvider/index.js +189 -0
  382. package/dist/providers/UnsavedChangesGuardProvider/index.js.map +1 -0
  383. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.cjs +7 -0
  384. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.cjs.map +1 -0
  385. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.d.ts +3 -0
  386. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.d.ts.map +1 -0
  387. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.js +5 -0
  388. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.constants.js.map +1 -0
  389. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.types.d.ts +21 -0
  390. package/dist/providers/UnsavedChangesGuardProvider/unsavedChangesGuard.types.d.ts.map +1 -0
  391. package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.cjs +97 -0
  392. package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.cjs.map +1 -0
  393. package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.d.ts +62 -0
  394. package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.d.ts.map +1 -0
  395. package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.js +88 -0
  396. package/dist/providers/UnsavedChangesGuardProvider/utilities/unsavedChangesGuard.utils.js.map +1 -0
  397. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.cjs +74 -0
  398. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.cjs.map +1 -0
  399. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.d.ts +51 -0
  400. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.d.ts.map +1 -0
  401. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.js +68 -0
  402. package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.js.map +1 -0
  403. package/package.json +41 -6
  404. package/dist/components/organisms/ColorPicker/colorPicker.utils.cjs.map +0 -1
  405. package/dist/components/organisms/ColorPicker/colorPicker.utils.d.ts.map +0 -1
  406. package/dist/components/organisms/ColorPicker/colorPicker.utils.js.map +0 -1
  407. /package/dist/components/organisms/ColorPicker/{colorPicker.utils.cjs → utilities/colorPicker.utils.cjs} +0 -0
  408. /package/dist/components/organisms/ColorPicker/{colorPicker.utils.d.ts → utilities/colorPicker.utils.d.ts} +0 -0
  409. /package/dist/components/organisms/ColorPicker/{colorPicker.utils.js → utilities/colorPicker.utils.js} +0 -0
@@ -1,29 +1,9 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { Button } from '@flipdish/ui-library/components/atoms/Button';
3
- import { CloseButton } from '@flipdish/ui-library/components/atoms/CloseButton';
4
- import { FeaturedIcon } from '@flipdish/ui-library/components/atoms/FeaturedIcon';
5
- import { cx } from '@flipdish/ui-library/utilities/cx';
6
- import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
7
- import { getStatusFeaturedIconProps } from '../../__internal__/statusIcon/statusIcon.utils.js';
1
+ import { AlertFloating as AlertFloating$1, AlertFullWidth as AlertFullWidth$1 } from '@flipdish/ui-library/components/molecules/Alerts';
8
2
 
9
- /**
10
- * Floating card alert for in-page contextual notices with optional confirm and dismiss actions.
11
- *
12
- * @summary in-page alert card with confirm and dismiss actions
13
- */
14
- const AlertFloating = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', dismissLabel = 'Dismiss', 'data-testid': dataTestId, }) => {
15
- const alertTestId = useResolvedTestId({ testId: dataTestId, segment: 'alert-floating', rootName: 'alert-floating' });
16
- return (jsxs("div", { "data-testid": alertTestId, className: "relative flex flex-col gap-4 rounded-xl border border-primary bg-primary_alt p-4 shadow-xs md:flex-row", children: [jsx(FeaturedIcon, { ...getStatusFeaturedIconProps(color), size: "md" }), jsxs("div", { className: "flex flex-1 flex-col gap-3 md:w-0", children: [jsxs("div", { className: "flex flex-col gap-1 overflow-auto", children: [jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] }), (onConfirm || onClose) && (jsxs("div", { className: "flex gap-3", children: [onClose && (jsx(Button, { onClick: onClose, size: "sm", color: "link-gray", "data-testid": joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsx(Button, { onClick: onConfirm, size: "sm", color: "link-color", "data-testid": joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }))] }), onClose && (jsx(CloseButton, { onClick: onClose, size: "sm", label: dismissLabel, className: "absolute top-2 right-2", "data-testid": joinTestId(alertTestId, 'close') }))] }));
17
- };
18
- /**
19
- * Full-width banner alert for site-wide or layout-level notices with optional confirm and dismiss actions.
20
- *
21
- * @summary full-width banner alert for site-wide notices
22
- */
23
- const AlertFullWidth = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', actionType = 'button', dismissLabel = 'Dismiss', 'data-testid': dataTestId, }) => {
24
- const alertTestId = useResolvedTestId({ testId: dataTestId, segment: 'alert-full-width', rootName: 'alert-full-width' });
25
- return (jsx("div", { "data-testid": alertTestId, className: "relative border-t border-primary bg-secondary md:border-t-0 md:border-b", children: jsxs("div", { className: "mx-auto flex max-w-container flex-col gap-4 p-4 md:flex-row md:items-center md:gap-3 md:px-8 md:py-3", children: [jsxs("div", { className: "flex flex-1 flex-col gap-4 md:w-0 md:flex-row md:items-center", children: [jsx(FeaturedIcon, { className: "hidden md:flex", ...getStatusFeaturedIconProps(color), size: "md" }), jsxs("div", { className: "flex flex-col gap-0.5 overflow-hidden lg:flex-row lg:gap-1.5", children: [jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] })] }), (onConfirm || onClose) && (jsxs("div", { className: "flex gap-2", children: [jsxs("div", { className: cx('flex w-full gap-3', actionType === 'button' ? 'flex-col-reverse md:flex-row' : 'flex-row'), children: [onClose && (jsx(Button, { onClick: onClose, color: actionType === 'button' ? 'secondary' : 'link-gray', size: "sm", "data-testid": joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsx(Button, { onClick: onConfirm, color: actionType === 'button' ? 'primary' : 'link-color', size: "sm", "data-testid": joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }), onClose && (jsx(CloseButton, { onClick: onClose, size: "sm", label: dismissLabel, className: "absolute top-2 right-2 shrink-0 md:static", "data-testid": joinTestId(alertTestId, 'close') }))] }))] }) }));
26
- };
3
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Alerts`. Removed in the next major. */
4
+ const AlertFloating = AlertFloating$1;
5
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Alerts`. Removed in the next major. */
6
+ const AlertFullWidth = AlertFullWidth$1;
27
7
 
28
8
  export { AlertFloating, AlertFullWidth };
29
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/molecules/Alert/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AAiDA;;;;AAIG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,YAAY,EACZ,OAAO,EACP,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,YAAY,GAAG,SAAS,EACxB,aAAa,EAAE,UAAU,GACN,KAAI;AACvB,IAAA,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;AAEpH,IAAA,QACEA,IAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAkB,WAAW,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KAAK,EAAE,UAAU,KAAK,QAAQ,GAAG,WAAW,GAAG,WAAW,EAC1D,IAAI,EAAC,IAAI,EAAA,aAAA,EACI,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,QAAA,EAE9C,YAAY,EAAA,CACN,CACV,EACA,SAAS,KACRA,GAAA,CAAC,MAAM,IACL,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,UAAU,KAAK,QAAQ,GAAG,SAAS,GAAG,YAAY,EACzD,IAAI,EAAC,IAAI,EAAA,aAAA,EACI,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,QAAA,EAE9C,YAAY,EAAA,CACN,CACV,IACG,EAEL,OAAO,KACNA,GAAA,CAAC,WAAW,EAAA,EACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,2CAA2C,EAAA,aAAA,EACxC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,EAAA,CAC7C,CACH,IACG,CACP,CAAA,EAAA,CACG,EAAA,CACF;AAEV;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/molecules/Alert/index.tsx"],"sourcesContent":[null],"names":["AlertFloatingNext","AlertFullWidthNext"],"mappings":";;AAWA;AACO,MAAM,aAAa,GAAGA;AAC7B;AACO,MAAM,cAAc,GAAGC;;"}
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var Button = require('@flipdish/ui-library/components/atoms/Button');
5
+ var CloseButton = require('@flipdish/ui-library/components/atoms/CloseButton');
6
+ var FeaturedIcon = require('@flipdish/ui-library/components/atoms/FeaturedIcon');
7
+ var cx = require('@flipdish/ui-library/utilities/cx');
8
+ var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
9
+ var statusIcon_utils = require('../../../__internal__/statusIcon/statusIcon.utils.cjs');
10
+ var useAlertActions = require('../hooks/useAlertActions.cjs');
11
+
12
+ /**
13
+ * Floating card alert for in-page contextual notices with optional confirm and dismiss actions.
14
+ *
15
+ * @summary in-page alert card with confirm and dismiss actions
16
+ */
17
+ const AlertFloating = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', dismissLabel = 'Dismiss', returnFocusTo, 'data-testid': dataTestId, }) => {
18
+ const alertTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'alert-floating', rootName: 'alert-floating' });
19
+ const { originRef, leaveThen } = useAlertActions.useAlertActions(returnFocusTo);
20
+ const close = leaveThen(onClose);
21
+ const confirm = leaveThen(onConfirm);
22
+ return (jsxRuntime.jsxs("div", { ref: originRef, "data-testid": alertTestId, className: "relative flex flex-col gap-4 rounded-xl border border-primary bg-primary_alt p-4 shadow-xs md:flex-row", children: [jsxRuntime.jsx(FeaturedIcon.FeaturedIcon, { ...statusIcon_utils.getStatusFeaturedIconProps(color), size: "md" }), jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-3 md:w-0", children: [jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 overflow-auto", children: [jsxRuntime.jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsxRuntime.jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] }), (onConfirm || onClose) && (jsxRuntime.jsxs("div", { className: "flex gap-3", children: [onClose && (jsxRuntime.jsx(Button.Button, { onClick: close, size: "sm", color: "link-gray", "data-testid": testIdUtils.joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsxRuntime.jsx(Button.Button, { onClick: confirm, size: "sm", color: "link-color", "data-testid": testIdUtils.joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }))] }), onClose && (jsxRuntime.jsx(CloseButton.CloseButton, { onClick: close, size: "sm", label: dismissLabel, className: "absolute top-2 right-2", "data-testid": testIdUtils.joinTestId(alertTestId, 'close') }))] }));
23
+ };
24
+ /**
25
+ * Full-width banner alert for site-wide or layout-level notices with optional confirm and dismiss actions.
26
+ *
27
+ * @summary full-width banner alert for site-wide notices
28
+ */
29
+ const AlertFullWidth = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', actionType = 'button', dismissLabel = 'Dismiss', returnFocusTo, 'data-testid': dataTestId, }) => {
30
+ const alertTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'alert-full-width', rootName: 'alert-full-width' });
31
+ const { originRef, leaveThen } = useAlertActions.useAlertActions(returnFocusTo);
32
+ const close = leaveThen(onClose);
33
+ const confirm = leaveThen(onConfirm);
34
+ return (jsxRuntime.jsx("div", { ref: originRef, "data-testid": alertTestId, className: "relative border-t border-primary bg-secondary md:border-t-0 md:border-b", children: jsxRuntime.jsxs("div", { className: "mx-auto flex max-w-container flex-col gap-4 p-4 md:flex-row md:items-center md:gap-3 md:px-8 md:py-3", children: [jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-4 md:w-0 md:flex-row md:items-center", children: [jsxRuntime.jsx(FeaturedIcon.FeaturedIcon, { className: "hidden md:flex", ...statusIcon_utils.getStatusFeaturedIconProps(color), size: "md" }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 overflow-hidden lg:flex-row lg:gap-1.5", children: [jsxRuntime.jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsxRuntime.jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] })] }), (onConfirm || onClose) && (jsxRuntime.jsxs("div", { className: "flex gap-2", children: [jsxRuntime.jsxs("div", { className: cx.cx('flex w-full gap-3', actionType === 'button' ? 'flex-col-reverse md:flex-row' : 'flex-row'), children: [onClose && (jsxRuntime.jsx(Button.Button, { onClick: close, color: actionType === 'button' ? 'secondary' : 'link-gray', size: "sm", "data-testid": testIdUtils.joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsxRuntime.jsx(Button.Button, { onClick: confirm, color: actionType === 'button' ? 'primary' : 'link-color', size: "sm", "data-testid": testIdUtils.joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }), onClose && (jsxRuntime.jsx(CloseButton.CloseButton, { onClick: close, size: "sm", label: dismissLabel, className: "absolute top-2 right-2 shrink-0 md:static", "data-testid": testIdUtils.joinTestId(alertTestId, 'close') }))] }))] }) }));
35
+ };
36
+
37
+ exports.AlertFloating = AlertFloating;
38
+ exports.AlertFullWidth = AlertFullWidth;
39
+ //# sourceMappingURL=Alert.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Alert.cjs","sources":["../../../../../src/components/molecules/Alerts/components/Alert.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useAlertActions","_jsxs","_jsx","FeaturedIcon","getStatusFeaturedIconProps","Button","joinTestId","CloseButton","cx"],"mappings":";;;;;;;;;;;AAuDA;;;;AAIG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,YAAY,EACZ,OAAO,EACP,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,YAAY,GAAG,SAAS,EACxB,aAAa,EACb,aAAa,EAAE,UAAU,GACN,KAAI;AACvB,IAAA,MAAM,WAAW,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IACpH,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAGC,+BAAe,CAAC,aAAa,CAAC;AAC/D,IAAA,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC;AAChC,IAAA,MAAM,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC;AAEpC,IAAA,QACEC,eAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,SAAS,iBACD,WAAW,EACxB,SAAS,EAAC,wGAAwG,EAAA,QAAA,EAAA,CAElHC,cAAA,CAACC,yBAAY,EAAA,EAAA,GAAKC,2CAA0B,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,IAAI,EAAA,CAAG,EAEjEH,yBAAK,SAAS,EAAC,mCAAm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,EACL,OAAO,EAAE,KAAK,EACd,KAAK,EAAE,UAAU,KAAK,QAAQ,GAAG,WAAW,GAAG,WAAW,EAC1D,IAAI,EAAC,IAAI,EAAA,aAAA,EACIC,sBAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,QAAA,EAE9C,YAAY,GACN,CACV,EACA,SAAS,KACRJ,eAACG,aAAM,EAAA,EACL,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,UAAU,KAAK,QAAQ,GAAG,SAAS,GAAG,YAAY,EACzD,IAAI,EAAC,IAAI,iBACIC,sBAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,QAAA,EAE9C,YAAY,EAAA,CACN,CACV,CAAA,EAAA,CACG,EAEL,OAAO,KACNJ,eAACK,uBAAW,EAAA,EACV,OAAO,EAAE,KAAK,EACd,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,2CAA2C,EAAA,aAAA,EACxCD,sBAAU,CAAC,WAAW,EAAE,OAAO,CAAC,EAAA,CAC7C,CACH,IACG,CACP,CAAA,EAAA,CACG,EAAA,CACF;AAEV;;;"}
@@ -0,0 +1,104 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { StatusColor } from '../../../__internal__/statusIcon/statusIcon.types';
3
+ export interface AlertFloatingProps {
4
+ /**
5
+ * The title of the alert.
6
+ */
7
+ title: string;
8
+ /**
9
+ * The description of the alert.
10
+ */
11
+ description: ReactNode;
12
+ /**
13
+ * The label for the confirm button.
14
+ */
15
+ confirmLabel: string;
16
+ /**
17
+ * The label for the dismiss button.
18
+ * @default "Dismiss"
19
+ */
20
+ dismissLabel?: string;
21
+ /**
22
+ * The color of the alert.
23
+ * @default "default"
24
+ */
25
+ color?: StatusColor;
26
+ /**
27
+ * The function to call when the dismiss button is clicked.
28
+ */
29
+ onClose?: () => void;
30
+ /**
31
+ * The function to call when the confirm button is clicked.
32
+ */
33
+ onConfirm?: () => void;
34
+ /**
35
+ * A CSS selector for the control that takes focus when a button on the alert is pressed. Set it when pressing one
36
+ * removes the alert, or focus is lost to the top of the page.
37
+ */
38
+ returnFocusTo?: string;
39
+ /**
40
+ * Overrides the `data-testid` (defaults to `fd-alert-floating`). The confirm,
41
+ * dismiss, and close controls derive their ids from this prefix.
42
+ */
43
+ 'data-testid'?: string;
44
+ }
45
+ /**
46
+ * Floating card alert for in-page contextual notices with optional confirm and dismiss actions.
47
+ *
48
+ * @summary in-page alert card with confirm and dismiss actions
49
+ */
50
+ export declare const AlertFloating: ({ title, description, confirmLabel, onClose, onConfirm, color, dismissLabel, returnFocusTo, "data-testid": dataTestId, }: AlertFloatingProps) => import("react").JSX.Element;
51
+ export interface AlertFullWidthProps {
52
+ /**
53
+ * The title of the alert.
54
+ */
55
+ title: string;
56
+ /**
57
+ * The description of the alert.
58
+ */
59
+ description: ReactNode;
60
+ /**
61
+ * The label for the confirm button.
62
+ */
63
+ confirmLabel: string;
64
+ /**
65
+ * The label for the dismiss button.
66
+ * @default "Dismiss"
67
+ */
68
+ dismissLabel?: string;
69
+ /**
70
+ * The type of the action buttons.
71
+ * @default "button"
72
+ */
73
+ actionType?: 'button' | 'link';
74
+ /**
75
+ * The color of the alert.
76
+ * @default "default"
77
+ */
78
+ color?: StatusColor;
79
+ /**
80
+ * The function to call when the dismiss button is clicked.
81
+ */
82
+ onClose?: () => void;
83
+ /**
84
+ * The function to call when the confirm button is clicked.
85
+ */
86
+ onConfirm?: () => void;
87
+ /**
88
+ * A CSS selector for the control that takes focus when a button on the alert is pressed. Set it when pressing one
89
+ * removes the alert, or focus is lost to the top of the page.
90
+ */
91
+ returnFocusTo?: string;
92
+ /**
93
+ * Overrides the `data-testid` (defaults to `fd-alert-full-width`). The confirm,
94
+ * dismiss, and close controls derive their ids from this prefix.
95
+ */
96
+ 'data-testid'?: string;
97
+ }
98
+ /**
99
+ * Full-width banner alert for site-wide or layout-level notices with optional confirm and dismiss actions.
100
+ *
101
+ * @summary full-width banner alert for site-wide notices
102
+ */
103
+ export declare const AlertFullWidth: ({ title, description, confirmLabel, onClose, onConfirm, color, actionType, dismissLabel, returnFocusTo, "data-testid": dataTestId, }: AlertFullWidthProps) => import("react").JSX.Element;
104
+ //# sourceMappingURL=Alert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Alerts/components/Alert.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AAGrF,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,0HAU3B,kBAAkB,gCA+CpB,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,sIAW5B,mBAAmB,gCAyDrB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Button } from '@flipdish/ui-library/components/atoms/Button';
3
+ import { CloseButton } from '@flipdish/ui-library/components/atoms/CloseButton';
4
+ import { FeaturedIcon } from '@flipdish/ui-library/components/atoms/FeaturedIcon';
5
+ import { cx } from '@flipdish/ui-library/utilities/cx';
6
+ import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
7
+ import { getStatusFeaturedIconProps } from '../../../__internal__/statusIcon/statusIcon.utils.js';
8
+ import { useAlertActions } from '../hooks/useAlertActions.js';
9
+
10
+ /**
11
+ * Floating card alert for in-page contextual notices with optional confirm and dismiss actions.
12
+ *
13
+ * @summary in-page alert card with confirm and dismiss actions
14
+ */
15
+ const AlertFloating = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', dismissLabel = 'Dismiss', returnFocusTo, 'data-testid': dataTestId, }) => {
16
+ const alertTestId = useResolvedTestId({ testId: dataTestId, segment: 'alert-floating', rootName: 'alert-floating' });
17
+ const { originRef, leaveThen } = useAlertActions(returnFocusTo);
18
+ const close = leaveThen(onClose);
19
+ const confirm = leaveThen(onConfirm);
20
+ return (jsxs("div", { ref: originRef, "data-testid": alertTestId, className: "relative flex flex-col gap-4 rounded-xl border border-primary bg-primary_alt p-4 shadow-xs md:flex-row", children: [jsx(FeaturedIcon, { ...getStatusFeaturedIconProps(color), size: "md" }), jsxs("div", { className: "flex flex-1 flex-col gap-3 md:w-0", children: [jsxs("div", { className: "flex flex-col gap-1 overflow-auto", children: [jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] }), (onConfirm || onClose) && (jsxs("div", { className: "flex gap-3", children: [onClose && (jsx(Button, { onClick: close, size: "sm", color: "link-gray", "data-testid": joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsx(Button, { onClick: confirm, size: "sm", color: "link-color", "data-testid": joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }))] }), onClose && (jsx(CloseButton, { onClick: close, size: "sm", label: dismissLabel, className: "absolute top-2 right-2", "data-testid": joinTestId(alertTestId, 'close') }))] }));
21
+ };
22
+ /**
23
+ * Full-width banner alert for site-wide or layout-level notices with optional confirm and dismiss actions.
24
+ *
25
+ * @summary full-width banner alert for site-wide notices
26
+ */
27
+ const AlertFullWidth = ({ title, description, confirmLabel, onClose, onConfirm, color = 'default', actionType = 'button', dismissLabel = 'Dismiss', returnFocusTo, 'data-testid': dataTestId, }) => {
28
+ const alertTestId = useResolvedTestId({ testId: dataTestId, segment: 'alert-full-width', rootName: 'alert-full-width' });
29
+ const { originRef, leaveThen } = useAlertActions(returnFocusTo);
30
+ const close = leaveThen(onClose);
31
+ const confirm = leaveThen(onConfirm);
32
+ return (jsx("div", { ref: originRef, "data-testid": alertTestId, className: "relative border-t border-primary bg-secondary md:border-t-0 md:border-b", children: jsxs("div", { className: "mx-auto flex max-w-container flex-col gap-4 p-4 md:flex-row md:items-center md:gap-3 md:px-8 md:py-3", children: [jsxs("div", { className: "flex flex-1 flex-col gap-4 md:w-0 md:flex-row md:items-center", children: [jsx(FeaturedIcon, { className: "hidden md:flex", ...getStatusFeaturedIconProps(color), size: "md" }), jsxs("div", { className: "flex flex-col gap-0.5 overflow-hidden lg:flex-row lg:gap-1.5", children: [jsx("p", { className: "pr-8 text-sm font-semibold text-secondary md:truncate md:pr-0", children: title }), jsx("p", { className: "text-sm text-tertiary md:truncate", children: description })] })] }), (onConfirm || onClose) && (jsxs("div", { className: "flex gap-2", children: [jsxs("div", { className: cx('flex w-full gap-3', actionType === 'button' ? 'flex-col-reverse md:flex-row' : 'flex-row'), children: [onClose && (jsx(Button, { onClick: close, color: actionType === 'button' ? 'secondary' : 'link-gray', size: "sm", "data-testid": joinTestId(alertTestId, 'dismiss'), children: dismissLabel })), onConfirm && (jsx(Button, { onClick: confirm, color: actionType === 'button' ? 'primary' : 'link-color', size: "sm", "data-testid": joinTestId(alertTestId, 'confirm'), children: confirmLabel }))] }), onClose && (jsx(CloseButton, { onClick: close, size: "sm", label: dismissLabel, className: "absolute top-2 right-2 shrink-0 md:static", "data-testid": joinTestId(alertTestId, 'close') }))] }))] }) }));
33
+ };
34
+
35
+ export { AlertFloating, AlertFullWidth };
36
+ //# sourceMappingURL=Alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Alert.js","sources":["../../../../../src/components/molecules/Alerts/components/Alert.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;AAuDA;;;;AAIG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,YAAY,EACZ,OAAO,EACP,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,YAAY,GAAG,SAAS,EACxB,aAAa,EACb,aAAa,EAAE,UAAU,GACN,KAAI;AACvB,IAAA,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IACpH,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC,aAAa,CAAC;AAC/D,IAAA,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC;AAChC,IAAA,MAAM,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC;AAEpC,IAAA,QACEA,IAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,SAAS,iBACD,WAA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AA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,UAAU,KAAK,QAAQ,GAAG,8BAA8B,GAAG,UAAU,CAAC,EAAA,QAAA,EAAA,CAC3G,OAAO,KACNC,IAAC,MAAM,EAAA,EACL,OAAO,EAAE,KAAK,EACd,KAAK,EAAE,UAAU,KAAK,QAAQ,GAAG,WAAW,GAAG,WAAW,EAC1D,IAAI,EAAC,IAAI,EAAA,aAAA,EACI,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,QAAA,EAE9C,YAAY,GACN,CACV,EACA,SAAS,KACRA,IAAC,MAAM,EAAA,EACL,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,UAAU,KAAK,QAAQ,GAAG,SAAS,GAAG,YAAY,EACzD,IAAI,EAAC,IAAI,iBACI,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,QAAA,EAE9C,YAAY,EAAA,CACN,CACV,CAAA,EAAA,CACG,EAEL,OAAO,KACNA,IAAC,WAAW,EAAA,EACV,OAAO,EAAE,KAAK,EACd,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,2CAA2C,EAAA,aAAA,EACxC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,EAAA,CAC7C,CACH,IACG,CACP,CAAA,EAAA,CACG,EAAA,CACF;AAEV;;"}
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
5
+ var useAlertActions = require('../hooks/useAlertActions.cjs');
6
+ var Alert = require('./Alert.cjs');
7
+
8
+ /**
9
+ * Reports a save that failed outright: announced as an alert with "Try again", while the user's edits stay in place.
10
+ * Render it inside the form or section whose save failed, beside the control that started it.
11
+ *
12
+ * @summary inline alert for a failed save, with a retry
13
+ */
14
+ const SaveErrorAlert = ({ title, description, onRetry, onDismiss, returnFocusTo = 'button[type="submit"]', 'data-testid': dataTestId, }) => {
15
+ const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'save-error-alert', rootName: 'save-error-alert' });
16
+ // Its own form or section only: the default names any submit button, and one elsewhere on the page is not this save's.
17
+ const { originRef, leaveThen } = useAlertActions.useAlertActions(returnFocusTo, 'form, section');
18
+ return (
19
+ // Focus stays where the user was: a field keeps it through the save, so the alert only has to be announced.
20
+ jsxRuntime.jsx("div", { role: "alert", ref: originRef, children: jsxRuntime.jsx(Alert.AlertFloating, { color: "error", title: title, description: description, confirmLabel: "Try again",
21
+ // Both buttons remove the alert, so each hands focus on first.
22
+ onConfirm: leaveThen(onRetry), onClose: leaveThen(onDismiss), "data-testid": rootTestId }) }));
23
+ };
24
+
25
+ exports.SaveErrorAlert = SaveErrorAlert;
26
+ //# sourceMappingURL=SaveErrorAlert.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveErrorAlert.cjs","sources":["../../../../../src/components/molecules/Alerts/components/SaveErrorAlert.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useAlertActions","_jsx","AlertFloating"],"mappings":";;;;;;;AAwBA;;;;;AAKG;MACU,cAAc,GAAG,CAAC,EAC7B,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,GAAG,uBAAuB,EACvC,aAAa,EAAE,UAAU,GACL,KAAI;AACxB,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;;AAEvH,IAAA,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAGC,+BAAe,CAAC,aAAa,EAAE,eAAe,CAAC;IAEhF;;IAEEC,cAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,SAAS,EAAA,QAAA,EAC9BA,cAAA,CAACC,mBAAa,EAAA,EACZ,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,YAAY,EAAC,WAAW;;AAExB,YAAA,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,EAC7B,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,EAAA,aAAA,EAChB,UAAU,EAAA,CACvB,EAAA,CACE;AAEV;;"}
@@ -0,0 +1,25 @@
1
+ export interface SaveErrorAlertProps {
2
+ /** What failed, such as "Your changes could not be saved". */
3
+ title: string;
4
+ /** What happened to the user's edits and what to do next. */
5
+ description: string;
6
+ /** Sends the same save again. */
7
+ onRetry: () => void;
8
+ /** Hides the alert; the caller stops rendering it. */
9
+ onDismiss: () => void;
10
+ /**
11
+ * A CSS selector for the control that takes focus when the alert leaves, found in the nearest form or section around
12
+ * it. Defaults to that form's submit button; name the control instead when a single control failed to save.
13
+ */
14
+ returnFocusTo?: string;
15
+ /** Overrides the root `data-testid` (defaults to `fd-save-error-alert`); the retry, dismiss and close buttons derive theirs from it. */
16
+ 'data-testid'?: string;
17
+ }
18
+ /**
19
+ * Reports a save that failed outright: announced as an alert with "Try again", while the user's edits stay in place.
20
+ * Render it inside the form or section whose save failed, beside the control that started it.
21
+ *
22
+ * @summary inline alert for a failed save, with a retry
23
+ */
24
+ export declare const SaveErrorAlert: ({ title, description, onRetry, onDismiss, returnFocusTo, "data-testid": dataTestId, }: SaveErrorAlertProps) => import("react").JSX.Element;
25
+ //# sourceMappingURL=SaveErrorAlert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveErrorAlert.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Alerts/components/SaveErrorAlert.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sDAAsD;IACtD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wIAAwI;IACxI,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,uFAO5B,mBAAmB,gCAoBrB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useResolvedTestId } from '@flipdish/ui-library/utilities/testIdUtils';
3
+ import { useAlertActions } from '../hooks/useAlertActions.js';
4
+ import { AlertFloating } from './Alert.js';
5
+
6
+ /**
7
+ * Reports a save that failed outright: announced as an alert with "Try again", while the user's edits stay in place.
8
+ * Render it inside the form or section whose save failed, beside the control that started it.
9
+ *
10
+ * @summary inline alert for a failed save, with a retry
11
+ */
12
+ const SaveErrorAlert = ({ title, description, onRetry, onDismiss, returnFocusTo = 'button[type="submit"]', 'data-testid': dataTestId, }) => {
13
+ const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'save-error-alert', rootName: 'save-error-alert' });
14
+ // Its own form or section only: the default names any submit button, and one elsewhere on the page is not this save's.
15
+ const { originRef, leaveThen } = useAlertActions(returnFocusTo, 'form, section');
16
+ return (
17
+ // Focus stays where the user was: a field keeps it through the save, so the alert only has to be announced.
18
+ jsx("div", { role: "alert", ref: originRef, children: jsx(AlertFloating, { color: "error", title: title, description: description, confirmLabel: "Try again",
19
+ // Both buttons remove the alert, so each hands focus on first.
20
+ onConfirm: leaveThen(onRetry), onClose: leaveThen(onDismiss), "data-testid": rootTestId }) }));
21
+ };
22
+
23
+ export { SaveErrorAlert };
24
+ //# sourceMappingURL=SaveErrorAlert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveErrorAlert.js","sources":["../../../../../src/components/molecules/Alerts/components/SaveErrorAlert.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;AAwBA;;;;;AAKG;MACU,cAAc,GAAG,CAAC,EAC7B,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,GAAG,uBAAuB,EACvC,aAAa,EAAE,UAAU,GACL,KAAI;AACxB,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;;AAEvH,IAAA,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC,aAAa,EAAE,eAAe,CAAC;IAEhF;;IAEEA,GAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,SAAS,EAAA,QAAA,EAC9BA,GAAA,CAAC,aAAa,EAAA,EACZ,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,YAAY,EAAC,WAAW;;AAExB,YAAA,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,EAC7B,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,EAAA,aAAA,EAChB,UAAU,EAAA,CACvB,EAAA,CACE;AAEV;;"}
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var useReturnFocus = require('../../../../hooks/__internal__/useReturnFocus/useReturnFocus.cjs');
4
+
5
+ // Nearest first, out to the page: the control named by `returnFocusTo` may sit beside the alert or anywhere around it.
6
+ const PAGE_CONTAINERS = 'form, section, main, body';
7
+ /**
8
+ * Wraps an alert's actions so focus leaves for the `returnFocusTo` control before the action runs: an action that
9
+ * removes the alert would otherwise drop focus to the top of the page.
10
+ *
11
+ * @param returnFocusTo The selector the consumer gave, or `undefined` to leave focus alone.
12
+ * @param containerSelector The containers the control is looked for in, nearest first; the whole page unless narrowed.
13
+ * @returns `originRef` for the alert's root, and `leaveThen`, which wraps a handler and keeps an absent one absent.
14
+ */
15
+ const useAlertActions = (returnFocusTo, containerSelector = PAGE_CONTAINERS) => {
16
+ const { originRef, returnFocus } = useReturnFocus.useReturnFocus(returnFocusTo, containerSelector);
17
+ const leaveThen = (action) => action &&
18
+ (() => {
19
+ returnFocus();
20
+ action();
21
+ });
22
+ return { originRef, leaveThen };
23
+ };
24
+
25
+ exports.useAlertActions = useAlertActions;
26
+ //# sourceMappingURL=useAlertActions.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAlertActions.cjs","sources":["../../../../../src/components/molecules/Alerts/hooks/useAlertActions.ts"],"sourcesContent":[null],"names":["useReturnFocus"],"mappings":";;;;AAEA;AACA,MAAM,eAAe,GAAG,2BAA2B;AAEnD;;;;;;;AAOG;AACI,MAAM,eAAe,GAAG,CAAC,aAAiC,EAAE,iBAAiB,GAAG,eAAe,KAAI;AACxG,IAAA,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAGA,6BAAc,CAAiB,aAAa,EAAE,iBAAiB,CAAC;AACnG,IAAA,MAAM,SAAS,GAAG,CAAC,MAAgC,KACjD,MAAM;AACN,SAAC,MAAK;AACJ,YAAA,WAAW,EAAE;AACb,YAAA,MAAM,EAAE;AACV,QAAA,CAAC,CAAC;AAEJ,IAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE;AACjC;;"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Wraps an alert's actions so focus leaves for the `returnFocusTo` control before the action runs: an action that
3
+ * removes the alert would otherwise drop focus to the top of the page.
4
+ *
5
+ * @param returnFocusTo The selector the consumer gave, or `undefined` to leave focus alone.
6
+ * @param containerSelector The containers the control is looked for in, nearest first; the whole page unless narrowed.
7
+ * @returns `originRef` for the alert's root, and `leaveThen`, which wraps a handler and keeps an absent one absent.
8
+ */
9
+ export declare const useAlertActions: (returnFocusTo: string | undefined, containerSelector?: string) => {
10
+ originRef: import("react").RefObject<HTMLDivElement | null>;
11
+ leaveThen: (action: (() => void) | undefined) => (() => void) | undefined;
12
+ };
13
+ //# sourceMappingURL=useAlertActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAlertActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Alerts/hooks/useAlertActions.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,eAAe,MAAM,GAAG,SAAS,EAAE,0BAAmC;;wBAEzE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS;CAQpD,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { useReturnFocus } from '../../../../hooks/__internal__/useReturnFocus/useReturnFocus.js';
2
+
3
+ // Nearest first, out to the page: the control named by `returnFocusTo` may sit beside the alert or anywhere around it.
4
+ const PAGE_CONTAINERS = 'form, section, main, body';
5
+ /**
6
+ * Wraps an alert's actions so focus leaves for the `returnFocusTo` control before the action runs: an action that
7
+ * removes the alert would otherwise drop focus to the top of the page.
8
+ *
9
+ * @param returnFocusTo The selector the consumer gave, or `undefined` to leave focus alone.
10
+ * @param containerSelector The containers the control is looked for in, nearest first; the whole page unless narrowed.
11
+ * @returns `originRef` for the alert's root, and `leaveThen`, which wraps a handler and keeps an absent one absent.
12
+ */
13
+ const useAlertActions = (returnFocusTo, containerSelector = PAGE_CONTAINERS) => {
14
+ const { originRef, returnFocus } = useReturnFocus(returnFocusTo, containerSelector);
15
+ const leaveThen = (action) => action &&
16
+ (() => {
17
+ returnFocus();
18
+ action();
19
+ });
20
+ return { originRef, leaveThen };
21
+ };
22
+
23
+ export { useAlertActions };
24
+ //# sourceMappingURL=useAlertActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAlertActions.js","sources":["../../../../../src/components/molecules/Alerts/hooks/useAlertActions.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;AACA,MAAM,eAAe,GAAG,2BAA2B;AAEnD;;;;;;;AAOG;AACI,MAAM,eAAe,GAAG,CAAC,aAAiC,EAAE,iBAAiB,GAAG,eAAe,KAAI;AACxG,IAAA,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,cAAc,CAAiB,aAAa,EAAE,iBAAiB,CAAC;AACnG,IAAA,MAAM,SAAS,GAAG,CAAC,MAAgC,KACjD,MAAM;AACN,SAAC,MAAK;AACJ,YAAA,WAAW,EAAE;AACb,YAAA,MAAM,EAAE;AACV,QAAA,CAAC,CAAC;AAEJ,IAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE;AACjC;;"}
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var Alert = require('./components/Alert.cjs');
4
+ var SaveErrorAlert = require('./components/SaveErrorAlert.cjs');
5
+
6
+
7
+
8
+ exports.AlertFloating = Alert.AlertFloating;
9
+ exports.AlertFullWidth = Alert.AlertFullWidth;
10
+ exports.SaveErrorAlert = SaveErrorAlert.SaveErrorAlert;
11
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Inline alerts and their ready-made forms: `AlertFloating` and `AlertFullWidth` for a message you word yourself, and
3
+ * the alerts built on them for one job each, such as reporting a save that failed.
4
+ *
5
+ * Explicit named re-exports on purpose: `export *` would publish every symbol of every private sub-component file
6
+ * (import paths are the public API here), so this list is the single source of truth for what Alerts exposes.
7
+ */
8
+ export type { AlertFloatingProps, AlertFullWidthProps } from './components/Alert';
9
+ export { AlertFloating, AlertFullWidth } from './components/Alert';
10
+ export type { SaveErrorAlertProps } from './components/SaveErrorAlert';
11
+ export { SaveErrorAlert } from './components/SaveErrorAlert';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Alerts/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { AlertFloating, AlertFullWidth } from './components/Alert.js';
2
+ export { SaveErrorAlert } from './components/SaveErrorAlert.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,45 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var cx = require('@flipdish/ui-library/utilities/cx');
5
- var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
6
- var reactAriaComponents = require('react-aria-components');
3
+ var Modals = require('@flipdish/ui-library/components/molecules/Modals');
7
4
 
8
- /** Opens the modal when its child button is pressed; a plain alias of react-aria-components' `DialogTrigger`. */
9
- const DialogTrigger = reactAriaComponents.DialogTrigger;
10
- /**
11
- * Backdrop and positioning layer for a `Modal` dialog that interrupts the page for input or
12
- * confirmation. Wrap `Modal` and `Dialog` in it; focus trapping, scroll lock and Escape are
13
- * handled.
14
- *
15
- * @summary overlay dialog for focused input or confirmation
16
- */
17
- const ModalOverlay = ({ 'data-testid': dataTestId, ...props }) => {
18
- const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'modal', rootName: 'modal' });
19
- return (jsxRuntime.jsx(testIdUtils.TestIdProvider, { value: rootTestId, children: jsxRuntime.jsx(reactAriaComponents.ModalOverlay, { ...props, "data-testid": rootTestId, className: (state) => cx.cx('fixed inset-0 z-50 flex min-h-dvh w-full items-end justify-center bg-overlay/70 px-4 outline-hidden backdrop-blur-[6px] sm:items-center sm:justify-center sm:px-8',
20
- // Vertical padding
21
- 'pt-(--modal-pt) pb-(--modal-pb) [--modal-pb:clamp(16px,8vh,64px)] [--modal-pt:16px] sm:[--modal-pb:32px] sm:[--modal-pt:32px]',
22
- // Animations
23
- state.isEntering && 'duration-300 ease-out animate-in fade-in', state.isExiting && 'duration-200 ease-in animate-out fade-out', typeof props.className === 'function' ? props.className(state) : props.className) }) }));
24
- };
25
- /**
26
- * Accessible overlay dialog built on react-aria primitives. Compose with `ModalOverlay`,
27
- * `Dialog`, and optionally `DialogTrigger` to display focused content or actions in an overlay
28
- * that blocks the rest of the page.
29
- *
30
- * @summary accessible overlay dialog for focused content or actions
31
- */
32
- const Modal = (props) => (jsxRuntime.jsx(reactAriaComponents.Modal, { ...props, className: (state) => cx.cx('rounded-xl bg-primary align-middle shadow-xl outline-hidden max-sm:overflow-y-auto sm:rounded-2xl',
33
- // Max height based on parent's vertical padding
34
- 'max-h-[calc(var(--visual-viewport-height)-var(--modal-pt)-var(--modal-pb))]',
35
- // Animations
36
- state.isEntering && 'duration-300 ease-out animate-in zoom-in-95', state.isExiting && 'duration-200 ease-in animate-out zoom-out-95', typeof props.className === 'function' ? props.className(state) : props.className) }));
37
- /** Scrollable, focus-managed content container that sits inside `Modal` and holds the dialog's content. */
38
- const Dialog = ({ 'data-testid': dataTestId, ...props }) => {
39
- const prefix = testIdUtils.useTestIdPrefix();
40
- const dialogTestId = dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, 'dialog') : undefined);
41
- return (jsxRuntime.jsx(reactAriaComponents.Dialog, { ...props, "data-testid": dialogTestId, className: cx.cx('relative max-h-[inherit] w-full overflow-y-auto outline-hidden', props.className) }));
42
- };
5
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
6
+ const DialogTrigger = Modals.DialogTrigger;
7
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
8
+ const ModalOverlay = Modals.ModalOverlay;
9
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
10
+ const Modal = Modals.Modal;
11
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
12
+ const Dialog = Modals.Dialog;
43
13
 
44
14
  exports.Dialog = Dialog;
45
15
  exports.DialogTrigger = DialogTrigger;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../src/components/molecules/Modal/index.tsx"],"sourcesContent":[null],"names":["AriaDialogTrigger","useResolvedTestId","_jsx","TestIdProvider","AriaModalOverlay","cx","AriaModal","useTestIdPrefix","joinTestId","AriaDialog"],"mappings":";;;;;;;AAYA;AACO,MAAM,aAAa,GAAGA;AAU7B;;;;;;AAMG;AACI,MAAM,YAAY,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAqB,KAAI;AACzF,IAAA,MAAM,UAAU,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;IAEjG,QACEC,cAAA,CAACC,0BAAc,EAAA,EAAC,KAAK,EAAE,UAAU,EAAA,QAAA,EAC/BD,cAAA,CAACE,gCAAgB,EAAA,EAAA,GACX,KAAK,iBACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KACfC,KAAE,CACA,mKAAmK;;YAEnK,+HAA+H;;AAE/H,YAAA,KAAK,CAAC,UAAU,IAAI,0CAA0C,EAC9D,KAAK,CAAC,SAAS,IAAI,2CAA2C,EAC9D,OAAO,KAAK,CAAC,SAAS,KAAK,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,SAAS,CACjF,EAAA,CAEH,EAAA,CACa;AAErB;AAEA;;;;;;AAMG;AACI,MAAM,KAAK,GAAG,CAAC,KAA4B,MAChDH,cAAA,CAACI,yBAAS,OACJ,KAAK,EACT,SAAS,EAAE,CAAC,KAAK,KACfD,KAAE,CACA,mGAAmG;;IAEnG,6EAA6E;;AAE7E,IAAA,KAAK,CAAC,UAAU,IAAI,6CAA6C,EACjE,KAAK,CAAC,SAAS,IAAI,8CAA8C,EACjE,OAAO,KAAK,CAAC,SAAS,KAAK,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,SAAS,CACjF,EAAA,CAEH;AAWJ;AACO,MAAM,MAAM,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAe,KAAI;AAC7E,IAAA,MAAM,MAAM,GAAGE,2BAAe,EAAE;IAChC,MAAM,YAAY,GAAG,UAAU,KAAK,MAAM,GAAGC,sBAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC;IAEtF,QACEN,eAACO,0BAAU,EAAA,EAAA,GACL,KAAK,EAAA,aAAA,EACI,YAAY,EACzB,SAAS,EAAEJ,KAAE,CAAC,gEAAgE,EAAE,KAAK,CAAC,SAAS,CAAC,EAAA,CAChG;AAEN;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../src/components/molecules/Modal/index.tsx"],"sourcesContent":[null],"names":["DialogTriggerNext","ModalOverlayNext","ModalNext","DialogNext"],"mappings":";;;;AAaA;AACO,MAAM,aAAa,GAAGA;AAC7B;AACO,MAAM,YAAY,GAAGC;AAC5B;AACO,MAAM,KAAK,GAAGC;AACrB;AACO,MAAM,MAAM,GAAGC;;;;;"}
@@ -1,37 +1,14 @@
1
- import type { DialogProps as AriaDialogProps, ModalOverlayProps as AriaModalOverlayProps } from 'react-aria-components';
2
- import { DialogTrigger as AriaDialogTrigger } from 'react-aria-components';
3
- /** Opens the modal when its child button is pressed; a plain alias of react-aria-components' `DialogTrigger`. */
4
- export declare const DialogTrigger: typeof AriaDialogTrigger;
5
- export interface ModalOverlayProps extends AriaModalOverlayProps {
6
- /**
7
- * Overrides the derived root `data-testid` (defaults to `fd-modal`). `Dialog`
8
- * derives its id from this prefix (`<root>--dialog`).
9
- */
10
- 'data-testid'?: string;
11
- }
12
- /**
13
- * Backdrop and positioning layer for a `Modal` dialog that interrupts the page for input or
14
- * confirmation. Wrap `Modal` and `Dialog` in it; focus trapping, scroll lock and Escape are
15
- * handled.
16
- *
17
- * @summary overlay dialog for focused input or confirmation
18
- */
19
- export declare const ModalOverlay: ({ "data-testid": dataTestId, ...props }: ModalOverlayProps) => import("react").JSX.Element;
20
- /**
21
- * Accessible overlay dialog built on react-aria primitives. Compose with `ModalOverlay`,
22
- * `Dialog`, and optionally `DialogTrigger` to display focused content or actions in an overlay
23
- * that blocks the rest of the page.
24
- *
25
- * @summary accessible overlay dialog for focused content or actions
26
- */
27
- export declare const Modal: (props: AriaModalOverlayProps) => import("react").JSX.Element;
28
- export interface DialogProps extends AriaDialogProps {
29
- /**
30
- * Overrides the derived `data-testid` for the dialog (defaults to `<root>--dialog`,
31
- * e.g. `fd-modal--dialog`, when nested under `ModalOverlay`).
32
- */
33
- 'data-testid'?: string;
34
- }
35
- /** Scrollable, focus-managed content container that sits inside `Modal` and holds the dialog's content. */
36
- export declare const Dialog: ({ "data-testid": dataTestId, ...props }: DialogProps) => import("react").JSX.Element;
1
+ import { type DialogProps as DialogPropsNext, type ModalOverlayProps as ModalOverlayPropsNext } from '@flipdish/ui-library/components/molecules/Modals';
2
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
3
+ export declare const DialogTrigger: typeof import("react-aria-components").DialogTrigger;
4
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
5
+ export declare const ModalOverlay: ({ "data-testid": dataTestId, ...props }: ModalOverlayPropsNext) => import("react").JSX.Element;
6
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
7
+ export declare const Modal: (props: import("react-aria-components").ModalOverlayProps) => import("react").JSX.Element;
8
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
9
+ export declare const Dialog: ({ "data-testid": dataTestId, ...props }: DialogPropsNext) => import("react").JSX.Element;
10
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
11
+ export type ModalOverlayProps = ModalOverlayPropsNext;
12
+ /** @deprecated Import from `@flipdish/ui-library/components/molecules/Modals`. Removed in the next major. */
13
+ export type DialogProps = DialogPropsNext;
37
14
  //# sourceMappingURL=index.d.ts.map