@servicetitan/anvil2 1.29.0 → 1.31.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 (334) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/{Alert-CRv6t4jJ-g1uOIz5i.js → Alert-BW0jYz7s-C_bALro8.js} +6 -7
  3. package/dist/{Alert-CRv6t4jJ-g1uOIz5i.js.map → Alert-BW0jYz7s-C_bALro8.js.map} +1 -1
  4. package/dist/{Alert-DPNaYO2Q.js → Alert-KVBpZzAt.js} +2 -2
  5. package/dist/{Alert-DPNaYO2Q.js.map → Alert-KVBpZzAt.js.map} +1 -1
  6. package/dist/Alert.js +1 -1
  7. package/dist/{Announcement-CJmTMhbr.js → Announcement-DnaX0j_E.js} +5 -6
  8. package/dist/{Announcement-CJmTMhbr.js.map → Announcement-DnaX0j_E.js.map} +1 -1
  9. package/dist/Announcement.js +1 -1
  10. package/dist/{AnvilProvider-C7Li86-d.js → AnvilProvider-C3E7FZAC.js} +2 -2
  11. package/dist/{AnvilProvider-C7Li86-d.js.map → AnvilProvider-C3E7FZAC.js.map} +1 -1
  12. package/dist/AnvilProvider.js +1 -1
  13. package/dist/{Avatar-BbOnZyM_.js → Avatar-CylY-nHK.js} +5 -5
  14. package/dist/Avatar-CylY-nHK.js.map +1 -0
  15. package/dist/Avatar.js +1 -1
  16. package/dist/{Badge-CH8sBsJh.js → Badge-Lt1iCyYK.js} +2 -2
  17. package/dist/{Badge-CH8sBsJh.js.map → Badge-Lt1iCyYK.js.map} +1 -1
  18. package/dist/Badge.js +1 -1
  19. package/dist/{Breadcrumbs-ByNGkX5w.js → Breadcrumbs-DicsW4mk.js} +5 -5
  20. package/dist/{Breadcrumbs-ByNGkX5w.js.map → Breadcrumbs-DicsW4mk.js.map} +1 -1
  21. package/dist/Breadcrumbs.js +1 -1
  22. package/dist/{Button-3sLNiaQN.js → Button-CRGbkHTO.js} +2 -2
  23. package/dist/{Button-3sLNiaQN.js.map → Button-CRGbkHTO.js.map} +1 -1
  24. package/dist/{Button-Ce--YZ9L-Csh0Zzuf.js → Button-CpDA5JHI-DOaf7xjY.js} +7 -33
  25. package/dist/Button-CpDA5JHI-DOaf7xjY.js.map +1 -0
  26. package/dist/Button.js +1 -1
  27. package/dist/Button.module-BdSA8wlr-BdSA8wlr.js +25 -0
  28. package/dist/Button.module-BdSA8wlr-BdSA8wlr.js.map +1 -0
  29. package/dist/{ButtonCompound-CGci3MbQ.js → ButtonCompound-DbOF1Uyo-D4_cdbXr.js} +5 -23
  30. package/dist/ButtonCompound-DbOF1Uyo-D4_cdbXr.js.map +1 -0
  31. package/dist/ButtonCompound-Dq-3iCqQ.js +24 -0
  32. package/dist/ButtonCompound-Dq-3iCqQ.js.map +1 -0
  33. package/dist/ButtonCompound.js +1 -1
  34. package/dist/{ButtonLink-DcFTS_ob.js → ButtonLink-B1b4NVwl.js} +2 -2
  35. package/dist/{ButtonLink-DcFTS_ob.js.map → ButtonLink-B1b4NVwl.js.map} +1 -1
  36. package/dist/ButtonLink.js +1 -1
  37. package/dist/{ButtonToggle-CEHlQT_K.js → ButtonToggle-BdIwMXdH.js} +2 -2
  38. package/dist/{ButtonToggle-CEHlQT_K.js.map → ButtonToggle-BdIwMXdH.js.map} +1 -1
  39. package/dist/{ButtonToggle-BYwKq0iP-B4gHrxUt.js → ButtonToggle-D5b-K9BR-g1A3w7M3.js} +6 -5
  40. package/dist/ButtonToggle-D5b-K9BR-g1A3w7M3.js.map +1 -0
  41. package/dist/ButtonToggle.js +1 -1
  42. package/dist/{Calendar-CFsWEulW.js → Calendar-CqEPLYlk.js} +2 -2
  43. package/dist/{Calendar-CFsWEulW.js.map → Calendar-CqEPLYlk.js.map} +1 -1
  44. package/dist/{Calendar-9iYMS0Iw-D_XWYjOE.js → Calendar-DGlqu1W3-Bi5Q7PZR.js} +22 -26
  45. package/dist/{Calendar-9iYMS0Iw-D_XWYjOE.js.map → Calendar-DGlqu1W3-Bi5Q7PZR.js.map} +1 -1
  46. package/dist/Calendar.js +1 -1
  47. package/dist/{Card-CWGAMe-7.js → Card-D-ntWPsN.js} +2 -2
  48. package/dist/{Card-CWGAMe-7.js.map → Card-D-ntWPsN.js.map} +1 -1
  49. package/dist/{Card-js75vKLt-Bk6ujopM.js → Card-DukbBYaA-JN-eYW_v.js} +11 -11
  50. package/dist/{Card-js75vKLt-Bk6ujopM.js.map → Card-DukbBYaA-JN-eYW_v.js.map} +1 -1
  51. package/dist/{Card-js75vKLt.css → Card-DukbBYaA.css} +25 -10
  52. package/dist/Card.js +1 -1
  53. package/dist/{Checkbox-D6-kiZ0g-6jox0aDW.js → Checkbox-B1OkhWY6-DAwwh6to.js} +13 -10
  54. package/dist/Checkbox-B1OkhWY6-DAwwh6to.js.map +1 -0
  55. package/dist/{Checkbox-DJguu7Kw.js → Checkbox-K1ZrRTEZ.js} +2 -2
  56. package/dist/{Checkbox-DJguu7Kw.js.map → Checkbox-K1ZrRTEZ.js.map} +1 -1
  57. package/dist/Checkbox.js +1 -1
  58. package/dist/{Checkbox.module-DMrZNVpb-DL8zOKBQ.js → Checkbox.module-DMrZNVpb-DOdjd86H.js} +2 -2
  59. package/dist/{Checkbox.module-DMrZNVpb-DL8zOKBQ.js.map → Checkbox.module-DMrZNVpb-DOdjd86H.js.map} +1 -1
  60. package/dist/{Chip-CAxTyjIZ-DfkCTnYy.js → Chip-DX922SMw-13SW9xaV.js} +7 -9
  61. package/dist/Chip-DX922SMw-13SW9xaV.js.map +1 -0
  62. package/dist/{Chip-C5ElPVsb.js → Chip-i-OBdpYm.js} +2 -2
  63. package/dist/{Chip-C5ElPVsb.js.map → Chip-i-OBdpYm.js.map} +1 -1
  64. package/dist/Chip.js +1 -1
  65. package/dist/{Combobox-DCrEfyl2.js → Combobox-3SWKXAYu.js} +119 -135
  66. package/dist/Combobox-3SWKXAYu.js.map +1 -0
  67. package/dist/Combobox.js +1 -1
  68. package/dist/{DateField-4jR9NvbC.js → DateField-YjnaTpA4.js} +63 -41
  69. package/dist/DateField-YjnaTpA4.js.map +1 -0
  70. package/dist/DateField.js +1 -1
  71. package/dist/{Details-B1wMLkdg.js → Details-CtCidzce.js} +8 -8
  72. package/dist/Details-CtCidzce.js.map +1 -0
  73. package/dist/Details.js +1 -1
  74. package/dist/{Dialog-CL3bfZuB.js → Dialog-DDF9Xyrs.js} +2 -2
  75. package/dist/{Dialog-CL3bfZuB.js.map → Dialog-DDF9Xyrs.js.map} +1 -1
  76. package/dist/Dialog.js +1 -1
  77. package/dist/{Divider-CLnPwn7z.js → Divider-By5PjW0_.js} +2 -2
  78. package/dist/{Divider-CLnPwn7z.js.map → Divider-By5PjW0_.js.map} +1 -1
  79. package/dist/Divider.js +1 -1
  80. package/dist/DndSort.css +148 -0
  81. package/dist/DndSort.d.ts +2 -0
  82. package/dist/DndSort.js +5622 -0
  83. package/dist/DndSort.js.map +1 -0
  84. package/dist/{Drawer-8nHrKktU.js → Drawer-Bffoaren.js} +2 -2
  85. package/dist/{Drawer-8nHrKktU.js.map → Drawer-Bffoaren.js.map} +1 -1
  86. package/dist/Drawer.js +1 -1
  87. package/dist/{EditCard-Nwz2BjY0.js → EditCard-DripZNiC.js} +21 -23
  88. package/dist/EditCard-DripZNiC.js.map +1 -0
  89. package/dist/EditCard.css +15 -12
  90. package/dist/EditCard.js +1 -1
  91. package/dist/{Flex-D92F03lr.js → Flex-CbkDTKfn.js} +2 -2
  92. package/dist/{Flex-D92F03lr.js.map → Flex-CbkDTKfn.js.map} +1 -1
  93. package/dist/{Flex-pdHNcZrF-CdQdYhOU.js → Flex-DlNiHX1G-DiUzqGqj.js} +3 -3
  94. package/dist/{Flex-pdHNcZrF-CdQdYhOU.js.map → Flex-DlNiHX1G-DiUzqGqj.js.map} +1 -1
  95. package/dist/Flex.js +1 -1
  96. package/dist/{Grid-DaeLjn0g.js → Grid-LhlvpLTc.js} +2 -2
  97. package/dist/{Grid-DaeLjn0g.js.map → Grid-LhlvpLTc.js.map} +1 -1
  98. package/dist/Grid.js +1 -1
  99. package/dist/{HammerProvider-DuxhW0gv-C2voN5ro.js → HammerProvider-B4ULvVBh-DKGRrw3q.js} +4 -3
  100. package/dist/{HammerProvider-DuxhW0gv-C2voN5ro.js.map → HammerProvider-B4ULvVBh-DKGRrw3q.js.map} +1 -1
  101. package/dist/{Helper-Ba5DBS51-DBtASfJG.js → Helper-DBmwQvEP-Z2T8bXHx.js} +3 -3
  102. package/dist/{Helper-Ba5DBS51-DBtASfJG.js.map → Helper-DBmwQvEP-Z2T8bXHx.js.map} +1 -1
  103. package/dist/{Icon-DbHA5GV1-DwO2aGkj.js → Icon-DuwR7O2z-DwPHQiBF.js} +4 -4
  104. package/dist/Icon-DuwR7O2z-DwPHQiBF.js.map +1 -0
  105. package/dist/{Icon-CrE5UgZV.js → Icon-U0zxixxg.js} +2 -2
  106. package/dist/{Icon-CrE5UgZV.js.map → Icon-U0zxixxg.js.map} +1 -1
  107. package/dist/Icon.js +1 -1
  108. package/dist/{InputMask-jsL7rSOk.js → InputMask-DdF90b0D.js} +2 -2
  109. package/dist/{InputMask-jsL7rSOk.js.map → InputMask-DdF90b0D.js.map} +1 -1
  110. package/dist/{InputMask-B8N8PP1W-DlUKpMR4.js → InputMask-MW0aui2v-d0ziTRnR.js} +4 -4
  111. package/dist/InputMask-MW0aui2v-d0ziTRnR.js.map +1 -0
  112. package/dist/InputMask.js +1 -1
  113. package/dist/{Link-CBkwLJrX.js → Link-DDBu_8WX.js} +2 -2
  114. package/dist/{Link-CBkwLJrX.js.map → Link-DDBu_8WX.js.map} +1 -1
  115. package/dist/{Link-BZ7vy96e-DolN6mMF.js → Link-DIyZHRIV-DXK6prKs.js} +4 -4
  116. package/dist/{Link-BZ7vy96e-DolN6mMF.js.map → Link-DIyZHRIV-DXK6prKs.js.map} +1 -1
  117. package/dist/Link.js +1 -1
  118. package/dist/{ListView-DX7NxNSw.js → ListView-BU0TCQ4k.js} +5 -5
  119. package/dist/{ListView-DX7NxNSw.js.map → ListView-BU0TCQ4k.js.map} +1 -1
  120. package/dist/ListView.js +1 -1
  121. package/dist/{ListView.module-BqvHsIQ9-BqvHsIQ9.js → ListView.module-3I2M0Pia-3I2M0Pia.js} +2 -4
  122. package/dist/ListView.module-3I2M0Pia-3I2M0Pia.js.map +1 -0
  123. package/dist/{Listbox-DcMJEUMo.js → Listbox-BQP8FRTF.js} +2 -2
  124. package/dist/{Listbox-DcMJEUMo.js.map → Listbox-BQP8FRTF.js.map} +1 -1
  125. package/dist/{Listbox-CCUnPdBn-DwvTVF0i.js → Listbox-CthJSHQ3-Zsuei4zJ.js} +12 -12
  126. package/dist/Listbox-CthJSHQ3-Zsuei4zJ.js.map +1 -0
  127. package/dist/Listbox.js +1 -1
  128. package/dist/{LocalizationProvider-wckXpCYz-BnJmp0tU.js → LocalizationProvider-BrxC1a2D-B1iQENoJ.js} +2 -2
  129. package/dist/{LocalizationProvider-wckXpCYz-BnJmp0tU.js.map → LocalizationProvider-BrxC1a2D-B1iQENoJ.js.map} +1 -1
  130. package/dist/LocalizationProvider.js +1 -1
  131. package/dist/{Menu-CsfX8-_z.js → Menu-BtinbJQ_.js} +11 -20
  132. package/dist/Menu-BtinbJQ_.js.map +1 -0
  133. package/dist/Menu.js +1 -1
  134. package/dist/{Overflow-Codc9CEy.js → Overflow-CKVmrb1N.js} +2 -2
  135. package/dist/{Overflow-Codc9CEy.js.map → Overflow-CKVmrb1N.js.map} +1 -1
  136. package/dist/{Overflow-Cv9sOPm3-AYGUgSQn.js → Overflow-DXWJ1gWT-tN8GInwt.js} +7 -7
  137. package/dist/Overflow-DXWJ1gWT-tN8GInwt.js.map +1 -0
  138. package/dist/Overflow.js +1 -1
  139. package/dist/{Page-vKi5JkDS.js → Page-DnroZYyr.js} +20 -16
  140. package/dist/Page-DnroZYyr.js.map +1 -0
  141. package/dist/Page.js +1 -1
  142. package/dist/{Popover-OFlyW8gN.js → Popover-C7aIgvIl.js} +2 -2
  143. package/dist/{Popover-OFlyW8gN.js.map → Popover-C7aIgvIl.js.map} +1 -1
  144. package/dist/{Popover-tu_N1aS6-CSLR1Xzc.js → Popover-DDhjaX2z-waNj8Iba.js} +13 -16
  145. package/dist/Popover-DDhjaX2z-waNj8Iba.js.map +1 -0
  146. package/dist/Popover.js +1 -1
  147. package/dist/{ProgressBar-gVRLaKPz.js → ProgressBar-BfdgLTrw.js} +2 -2
  148. package/dist/{ProgressBar-gVRLaKPz.js.map → ProgressBar-BfdgLTrw.js.map} +1 -1
  149. package/dist/ProgressBar-YrCJtlvK-BlhqSUr-.js +2539 -0
  150. package/dist/ProgressBar-YrCJtlvK-BlhqSUr-.js.map +1 -0
  151. package/dist/ProgressBar-YrCJtlvK.css +736 -0
  152. package/dist/ProgressBar.js +1 -1
  153. package/dist/{Radio-BBwG1fqT-vopD4gzD.js → Radio-DE79qJFW-Dt9tFahU.js} +6 -6
  154. package/dist/{Radio-BBwG1fqT-vopD4gzD.js.map → Radio-DE79qJFW-Dt9tFahU.js.map} +1 -1
  155. package/dist/{Radio-CtFSLOYa.js → Radio-vM4P73jb.js} +2 -2
  156. package/dist/{Radio-CtFSLOYa.js.map → Radio-vM4P73jb.js.map} +1 -1
  157. package/dist/Radio.js +1 -1
  158. package/dist/{SearchField-C-4icPUa.js → SearchField-DMx9YWba.js} +6 -9
  159. package/dist/SearchField-DMx9YWba.js.map +1 -0
  160. package/dist/SearchField.js +1 -1
  161. package/dist/{SegmentedControl-DyeWOOF3.js → SegmentedControl-D-kdk7BJ.js} +5 -5
  162. package/dist/{SegmentedControl-DyeWOOF3.js.map → SegmentedControl-D-kdk7BJ.js.map} +1 -1
  163. package/dist/SegmentedControl.js +1 -1
  164. package/dist/SelectCard.js +1 -1
  165. package/dist/{SelectCardGroup-Ch56Mp-k.js → SelectCardGroup-u0bbiRwe.js} +13 -10
  166. package/dist/SelectCardGroup-u0bbiRwe.js.map +1 -0
  167. package/dist/{SideNav-Mdwo6zfi.js → SideNav-BIV-c-1o.js} +10 -31
  168. package/dist/SideNav-BIV-c-1o.js.map +1 -0
  169. package/dist/SideNav.js +1 -1
  170. package/dist/{Skeleton-DHDzs9qd.js → Skeleton-CO1kBH8A.js} +2 -2
  171. package/dist/{Skeleton-DHDzs9qd.js.map → Skeleton-CO1kBH8A.js.map} +1 -1
  172. package/dist/Skeleton.js +1 -1
  173. package/dist/{Spinner-DdirfhPp-c7cDfIit.js → Spinner-B55mSnmk-B3oOSVLo.js} +3 -6
  174. package/dist/Spinner-B55mSnmk-B3oOSVLo.js.map +1 -0
  175. package/dist/{Spinner-C0SZj1Xr.js → Spinner-DUXjTDlr.js} +2 -2
  176. package/dist/{Spinner-C0SZj1Xr.js.map → Spinner-DUXjTDlr.js.map} +1 -1
  177. package/dist/Spinner.js +1 -1
  178. package/dist/{Stepper-c7C22LVq.js → Stepper-tJSGpsW1.js} +14 -14
  179. package/dist/Stepper-tJSGpsW1.js.map +1 -0
  180. package/dist/Stepper.js +1 -1
  181. package/dist/{Switch-D2mURCX4.js → Switch-CksM88Ks.js} +3 -3
  182. package/dist/{Switch-D2mURCX4.js.map → Switch-CksM88Ks.js.map} +1 -1
  183. package/dist/Switch.js +1 -1
  184. package/dist/{Tab-x6_xtr13.js → Tab-qn_tnvF4.js} +11 -11
  185. package/dist/Tab-qn_tnvF4.js.map +1 -0
  186. package/dist/Tab.js +1 -1
  187. package/dist/{Text-C2n3GDdC-rz_AelM0.js → Text-BCRKWTMM-BvIdEgVR.js} +3 -3
  188. package/dist/{Text-C2n3GDdC-rz_AelM0.js.map → Text-BCRKWTMM-BvIdEgVR.js.map} +1 -1
  189. package/dist/{Text-BnRrIF-W.js → Text-CF2KcnWA.js} +2 -2
  190. package/dist/{Text-BnRrIF-W.js.map → Text-CF2KcnWA.js.map} +1 -1
  191. package/dist/Text.js +1 -1
  192. package/dist/{TextField-DgxJO1a7.js → TextField-B7Asq1aB.js} +2 -2
  193. package/dist/{TextField-DgxJO1a7.js.map → TextField-B7Asq1aB.js.map} +1 -1
  194. package/dist/{TextField-B8LHWOoC-DSV9zY-z.js → TextField-BTgxdt7I-Da1U7oOT.js} +8 -8
  195. package/dist/{TextField-B8LHWOoC-DSV9zY-z.js.map → TextField-BTgxdt7I-Da1U7oOT.js.map} +1 -1
  196. package/dist/TextField.js +1 -1
  197. package/dist/{TextField.module-B411p3ST-B411p3ST.js → TextField.module-ZWACK1yV-ZWACK1yV.js} +2 -4
  198. package/dist/TextField.module-ZWACK1yV-ZWACK1yV.js.map +1 -0
  199. package/dist/{Textarea-B-Dv2RXs.js → Textarea-CaMvxI9Y.js} +10 -12
  200. package/dist/Textarea-CaMvxI9Y.js.map +1 -0
  201. package/dist/Textarea.js +1 -1
  202. package/dist/{ThemeProvider-CioBp3gk-B6HyDICa.js → ThemeProvider-DKkyZPDr-BH0VGW7C.js} +6 -6
  203. package/dist/ThemeProvider-DKkyZPDr-BH0VGW7C.js.map +1 -0
  204. package/dist/{ThemeProvider-CioBp3gk.css → ThemeProvider-DKkyZPDr.css} +912 -120
  205. package/dist/{ThemeProvider-CRXKTOvG.js → ThemeProvider-Drjj0EtN.js} +2 -2
  206. package/dist/{ThemeProvider-CRXKTOvG.js.map → ThemeProvider-Drjj0EtN.js.map} +1 -1
  207. package/dist/ThemeProvider.js +1 -1
  208. package/dist/Toast.js +1 -1
  209. package/dist/{Toolbar-7BeCY61H.js → Toolbar-OYgCC3Up.js} +14 -14
  210. package/dist/Toolbar-OYgCC3Up.js.map +1 -0
  211. package/dist/Toolbar.js +1 -1
  212. package/dist/{Tooltip-BVBq-KxK.js → Tooltip-rDXwk4az.js} +2 -2
  213. package/dist/{Tooltip-BVBq-KxK.js.map → Tooltip-rDXwk4az.js.map} +1 -1
  214. package/dist/Tooltip.js +1 -1
  215. package/dist/assets/css-utils/border.css +4 -0
  216. package/dist/assets/css-utils/color.css +12 -0
  217. package/dist/assets/css-utils/utils.css +14 -0
  218. package/dist/{check_circle-C3DDoVXp.js → check_circle-BGfigqq-.js} +4 -2
  219. package/dist/check_circle-BGfigqq-.js.map +1 -0
  220. package/dist/components/DateField/DateField.d.ts +3 -1
  221. package/dist/components/DndSort/index.d.ts +2 -0
  222. package/dist/components/SelectCard/SelectCard.d.ts +4 -1
  223. package/dist/components/Toast/Toaster.d.ts +11 -5
  224. package/dist/components/Toast/toast.d.ts +1 -4
  225. package/dist/{floating-ui.react-4AwURJA3.js → floating-ui.react-Domgunz0.js} +667 -124
  226. package/dist/floating-ui.react-Domgunz0.js.map +1 -0
  227. package/dist/hooks/index.d.ts +1 -0
  228. package/dist/hooks/useBreakpoint/index.d.ts +1 -0
  229. package/dist/index.js +54 -53
  230. package/dist/index.js.map +1 -1
  231. package/dist/internal/components/Shadow.d.ts +3 -0
  232. package/dist/{proxy-Cy56d5Wf.js → proxy-CreWmH-e.js} +64 -53
  233. package/dist/proxy-CreWmH-e.js.map +1 -0
  234. package/dist/toast-KF3GWYbk.js +96 -0
  235. package/dist/toast-KF3GWYbk.js.map +1 -0
  236. package/dist/token/core/css-utils/border.css +4 -0
  237. package/dist/token/core/css-utils/color.css +12 -0
  238. package/dist/token/core/css-utils/utils.css +14 -0
  239. package/dist/token/core/raw.js +6 -0
  240. package/dist/token/core/semantic-variables.scss +6 -0
  241. package/dist/token/core/semantic.js +30 -0
  242. package/dist/token/core/semantic.scss +3 -0
  243. package/dist/token.js +33 -0
  244. package/dist/token.js.map +1 -1
  245. package/dist/{use-reduced-motion-BR76mHGj.js → use-reduced-motion-znCm41qB.js} +2 -2
  246. package/dist/{use-reduced-motion-BR76mHGj.js.map → use-reduced-motion-znCm41qB.js.map} +1 -1
  247. package/dist/{useAccessibleColor-CR4Gw85S-D9BFnrDq.js → useAccessibleColor-Dc6B_M-Z-BYKjkGRg.js} +4 -4
  248. package/dist/useAccessibleColor-Dc6B_M-Z-BYKjkGRg.js.map +1 -0
  249. package/dist/useAccessibleColor.js +1 -1
  250. package/dist/useBreakpoint-7QkBkSeP-Cv5fnZxs.js +50 -0
  251. package/dist/useBreakpoint-7QkBkSeP-Cv5fnZxs.js.map +1 -0
  252. package/dist/useBreakpoint.d.ts +6 -0
  253. package/dist/useBreakpoint.js +2 -0
  254. package/dist/useBreakpoint.js.map +1 -0
  255. package/dist/{useLayoutPropsUtil-C6qizVc6-BkgAan7h.js → useLayoutPropsUtil-3B2XYWSr-ChuzrydG.js} +9 -50
  256. package/dist/useLayoutPropsUtil-3B2XYWSr-ChuzrydG.js.map +1 -0
  257. package/dist/useLinkStyles.js +1 -1
  258. package/dist/useSize.js +4 -4
  259. package/dist/useSize.js.map +1 -1
  260. package/dist/useTrackingId.js +1 -1
  261. package/dist/useTrackingId.js.map +1 -1
  262. package/package.json +3 -6
  263. package/dist/Avatar-BbOnZyM_.js.map +0 -1
  264. package/dist/Button-Ce--YZ9L-Csh0Zzuf.js.map +0 -1
  265. package/dist/ButtonCompound-CGci3MbQ.js.map +0 -1
  266. package/dist/ButtonToggle-BYwKq0iP-B4gHrxUt.js.map +0 -1
  267. package/dist/Checkbox-D6-kiZ0g-6jox0aDW.js.map +0 -1
  268. package/dist/Chip-CAxTyjIZ-DfkCTnYy.js.map +0 -1
  269. package/dist/Combobox-DCrEfyl2.js.map +0 -1
  270. package/dist/DateField-4jR9NvbC.js.map +0 -1
  271. package/dist/Details-B1wMLkdg.js.map +0 -1
  272. package/dist/Dialog-CYBt_JdP-CmF0MUHL.js +0 -307
  273. package/dist/Dialog-CYBt_JdP-CmF0MUHL.js.map +0 -1
  274. package/dist/Dialog-CYBt_JdP.css +0 -140
  275. package/dist/Drawer-UQlX-LQG-BSCnMRad.js +0 -297
  276. package/dist/Drawer-UQlX-LQG-BSCnMRad.js.map +0 -1
  277. package/dist/Drawer-UQlX-LQG.css +0 -153
  278. package/dist/EditCard-Nwz2BjY0.js.map +0 -1
  279. package/dist/Icon-DbHA5GV1-DwO2aGkj.js.map +0 -1
  280. package/dist/InputMask-B8N8PP1W-DlUKpMR4.js.map +0 -1
  281. package/dist/Label-CUVr-jvI-BXhER5eQ.js +0 -51
  282. package/dist/Label-CUVr-jvI-BXhER5eQ.js.map +0 -1
  283. package/dist/Label-CUVr-jvI.css +0 -62
  284. package/dist/ListView.module-BqvHsIQ9-BqvHsIQ9.js.map +0 -1
  285. package/dist/Listbox-CCUnPdBn-DwvTVF0i.js.map +0 -1
  286. package/dist/Menu-CsfX8-_z.js.map +0 -1
  287. package/dist/Overflow-Cv9sOPm3-AYGUgSQn.js.map +0 -1
  288. package/dist/Page-vKi5JkDS.js.map +0 -1
  289. package/dist/Popover-tu_N1aS6-CSLR1Xzc.js.map +0 -1
  290. package/dist/ProgressBar-DQ1lsFk2-Ci4eqzM0.js +0 -130
  291. package/dist/ProgressBar-DQ1lsFk2-Ci4eqzM0.js.map +0 -1
  292. package/dist/ProgressBar-DQ1lsFk2.css +0 -91
  293. package/dist/SearchField-C-4icPUa.js.map +0 -1
  294. package/dist/SelectCardGroup-Ch56Mp-k.js.map +0 -1
  295. package/dist/SideNav-Mdwo6zfi.js.map +0 -1
  296. package/dist/Spinner-DdirfhPp-c7cDfIit.js.map +0 -1
  297. package/dist/Stepper-c7C22LVq.js.map +0 -1
  298. package/dist/Tab-x6_xtr13.js.map +0 -1
  299. package/dist/TextField.module-B411p3ST-B411p3ST.js.map +0 -1
  300. package/dist/Textarea-B-Dv2RXs.js.map +0 -1
  301. package/dist/ThemeProvider-CioBp3gk-B6HyDICa.js.map +0 -1
  302. package/dist/Toolbar-7BeCY61H.js.map +0 -1
  303. package/dist/Tooltip-C8sCGmKM-CLrDofvy.js +0 -631
  304. package/dist/Tooltip-C8sCGmKM-CLrDofvy.js.map +0 -1
  305. package/dist/Tooltip-C8sCGmKM.css +0 -102
  306. package/dist/check_circle-C3DDoVXp.js.map +0 -1
  307. package/dist/floating-ui.react-4AwURJA3.js.map +0 -1
  308. package/dist/index.esm-CunAFnrh.js +0 -546
  309. package/dist/index.esm-CunAFnrh.js.map +0 -1
  310. package/dist/info-CYpG6tcI.js +0 -6
  311. package/dist/info-CYpG6tcI.js.map +0 -1
  312. package/dist/proxy-Cy56d5Wf.js.map +0 -1
  313. package/dist/supportsPopover-8aJR37cf-8aJR37cf.js +0 -6
  314. package/dist/supportsPopover-8aJR37cf-8aJR37cf.js.map +0 -1
  315. package/dist/toast-CbokOkfo.js +0 -937
  316. package/dist/toast-CbokOkfo.js.map +0 -1
  317. package/dist/toast.css +0 -216
  318. package/dist/useAccessibleColor-CR4Gw85S-D9BFnrDq.js.map +0 -1
  319. package/dist/useKeyboardFocusables-CwVMAe5C-DtjYOAmt.js +0 -61
  320. package/dist/useKeyboardFocusables-CwVMAe5C-DtjYOAmt.js.map +0 -1
  321. package/dist/useLayoutPropsUtil-C6qizVc6-BkgAan7h.js.map +0 -1
  322. /package/dist/{Alert-CRv6t4jJ.css → Alert-BW0jYz7s.css} +0 -0
  323. /package/dist/{Button-Ce--YZ9L.css → Button.css} +0 -0
  324. /package/dist/{Calendar-9iYMS0Iw.css → Calendar-DGlqu1W3.css} +0 -0
  325. /package/dist/{Chip-CAxTyjIZ.css → Chip-DX922SMw.css} +0 -0
  326. /package/dist/{Flex-pdHNcZrF.css → Flex-DlNiHX1G.css} +0 -0
  327. /package/dist/{Helper-Ba5DBS51.css → Helper-DBmwQvEP.css} +0 -0
  328. /package/dist/{Icon-DbHA5GV1.css → Icon-DuwR7O2z.css} +0 -0
  329. /package/dist/{Link-BZ7vy96e.css → Link-DIyZHRIV.css} +0 -0
  330. /package/dist/{Overflow-Cv9sOPm3.css → Overflow-DXWJ1gWT.css} +0 -0
  331. /package/dist/{Popover-tu_N1aS6.css → Popover-DDhjaX2z.css} +0 -0
  332. /package/dist/{Radio-BBwG1fqT.css → Radio-DE79qJFW.css} +0 -0
  333. /package/dist/{Spinner-DdirfhPp.css → Spinner-B55mSnmk.css} +0 -0
  334. /package/dist/{Text-C2n3GDdC.css → Text-BCRKWTMM.css} +0 -0
@@ -1,937 +0,0 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { createContext, forwardRef, useRef, useState, useEffect, useCallback, useMemo, useContext } from 'react';
3
- import { c as cx } from './index-tZvMCc77.js';
4
- import { B as Button } from './Button-Ce--YZ9L-Csh0Zzuf.js';
5
- import { A as Alert } from './Alert-CRv6t4jJ-g1uOIz5i.js';
6
- import { P as ProgressBar } from './ProgressBar-DQ1lsFk2-Ci4eqzM0.js';
7
- import { u as useSwipe } from './useSwipe-DIUHs7T5-DIUHs7T5.js';
8
- import { S as SrOnly } from './SrOnly-BXm1DGl3-BJVodjQp.js';
9
- import { u as useMergeRefs } from './useMergeRefs-Bde85AWI-Bde85AWI.js';
10
-
11
- import './toast.css';/**
12
- * Convert array of 16 byte values to UUID string format of the form:
13
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
14
- */
15
- var byteToHex = [];
16
- for (var i = 0; i < 256; ++i) {
17
- byteToHex.push((i + 0x100).toString(16).slice(1));
18
- }
19
- function unsafeStringify(arr, offset = 0) {
20
- // Note: Be careful editing this code! It's been tuned for performance
21
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
22
- //
23
- // Note to future-self: No, you can't remove the `toLowerCase()` call.
24
- // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
25
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
26
- }
27
-
28
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
29
- // require the crypto API and do not support built-in fallback to lower quality random number
30
- // generators (like Math.random()).
31
-
32
- var getRandomValues;
33
- var rnds8 = new Uint8Array(16);
34
- function rng() {
35
- // lazy load so that environments that need to polyfill have a chance to do so
36
- if (!getRandomValues) {
37
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
38
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
39
- if (!getRandomValues) {
40
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
41
- }
42
- }
43
- return getRandomValues(rnds8);
44
- }
45
-
46
- var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
47
- const native = {
48
- randomUUID
49
- };
50
-
51
- function v4(options, buf, offset) {
52
- if (native.randomUUID && true && !options) {
53
- return native.randomUUID();
54
- }
55
- options = options || {};
56
- var rnds = options.random || (options.rng || rng)();
57
-
58
- // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
59
- rnds[6] = rnds[6] & 0x0f | 0x40;
60
- rnds[8] = rnds[8] & 0x3f | 0x80;
61
- return unsafeStringify(rnds);
62
- }
63
-
64
- const toaster = "_toaster_nxs96_3";
65
- const hidden = "_hidden_nxs96_65";
66
- const stacked = "_stacked_nxs96_72";
67
- const open = "_open_nxs96_164";
68
- const close = "_close_nxs96_165";
69
- const slideIn = "_slideIn_nxs96_1";
70
- const slideOut = "_slideOut_nxs96_1";
71
- const styles = {
72
- toaster: toaster,
73
- "toast-wrapper": "_toast-wrapper_nxs96_28",
74
- "toast-alert": "_toast-alert_nxs96_42",
75
- "alert-action": "_alert-action_nxs96_47",
76
- "message-container": "_message-container_nxs96_53",
77
- "show-extra-toast": "_show-extra-toast_nxs96_62",
78
- hidden: hidden,
79
- stacked: stacked,
80
- "stack-one": "_stack-one_nxs96_75",
81
- "stack-two": "_stack-two_nxs96_75",
82
- "stacked-show-extra": "_stacked-show-extra_nxs96_91",
83
- "stacked-extra": "_stacked-extra_nxs96_105",
84
- "show-more-button-container": "_show-more-button-container_nxs96_118",
85
- "show-collapse-button-container": "_show-collapse-button-container_nxs96_119",
86
- "show-collapse-button": "_show-collapse-button_nxs96_119",
87
- open: open,
88
- close: close,
89
- slideIn: slideIn,
90
- slideOut: slideOut
91
- };
92
-
93
- const ToastProviderContext = createContext({
94
- toasts: [],
95
- setToasts: () => [],
96
- toastHeights: [],
97
- setToastHeights: () => [],
98
- getToasterHeight: () => 0,
99
- toastsBeforeStack: 3,
100
- setToastsBeforeStack: () => [],
101
- extraToastsVisible: false,
102
- setExtraToastsVisible: () => []
103
- });
104
- const ToastProvider = (children) => {
105
- const [toasts, setToasts] = useState([]);
106
- const [toastHeights, setToastHeights] = useState([]);
107
- const [toastsBeforeStack, setToastsBeforeStack] = useState(3);
108
- const [extraToastsVisible, setExtraToastsVisible] = useState(false);
109
- const removeDuplicateToasts = (toasts2) => {
110
- const toastIds = /* @__PURE__ */ new Set();
111
- const uniqueToasts = toasts2.filter((toast) => {
112
- if (toastIds.has(toast.id)) {
113
- console.error(
114
- `Encountered toast with duplicate id ${toast.id}. Each toast id needs to be unique.`
115
- );
116
- return false;
117
- } else {
118
- toastIds.add(toast.id);
119
- return true;
120
- }
121
- });
122
- return uniqueToasts;
123
- };
124
- useEffect(() => {
125
- const uniqueToasts = removeDuplicateToasts(toasts);
126
- if (toasts.length !== uniqueToasts.length) {
127
- setToasts(uniqueToasts);
128
- }
129
- }, [toasts]);
130
- const getToasterHeight = useCallback(
131
- (index) => {
132
- const toastHeightsOnly = toastHeights.filter((t, i) => {
133
- return index !== undefined ? i > index : true;
134
- }).map((t) => t.height);
135
- if (toastHeightsOnly.length > 0) {
136
- if (extraToastsVisible) {
137
- return toastHeightsOnly.reduce((totalHeight, currentHeight) => {
138
- return totalHeight + currentHeight;
139
- });
140
- }
141
- return toastHeightsOnly.filter((t, i) => i >= toastHeightsOnly.length - toastsBeforeStack).reduce((totalHeight, currentHeight) => {
142
- return totalHeight + currentHeight;
143
- });
144
- }
145
- return 0;
146
- },
147
- [toastHeights, extraToastsVisible, toastsBeforeStack]
148
- );
149
- const value = useMemo(
150
- () => ({
151
- toasts,
152
- setToasts,
153
- toastHeights,
154
- setToastHeights,
155
- getToasterHeight,
156
- toastsBeforeStack,
157
- setToastsBeforeStack,
158
- extraToastsVisible,
159
- setExtraToastsVisible
160
- }),
161
- [
162
- extraToastsVisible,
163
- getToasterHeight,
164
- toastHeights,
165
- toasts,
166
- toastsBeforeStack
167
- ]
168
- );
169
- return /* @__PURE__ */ jsx(ToastProviderContext.Provider, { value, ...children });
170
- };
171
- const useToasts = () => {
172
- const context = useContext(ToastProviderContext);
173
- if (context == null) {
174
- throw new Error("useToasts must be wrapped in <ToastProvider />");
175
- }
176
- return context;
177
- };
178
-
179
- const toast$1 = () => {
180
- const toastMethods = [
181
- "info",
182
- "success",
183
- "warning",
184
- "danger",
185
- "promise",
186
- "update",
187
- "dismiss"
188
- ];
189
- console.error(
190
- "Please use one of the following toast methods:\n",
191
- ...toastMethods.map((m) => ` toast.${m}()
192
- `)
193
- );
194
- };
195
- const TOAST_EVENT_NAME = "hammer-toast";
196
- const TOAST_TYPES = ["info", "success", "warning", "danger"];
197
- const methods = {};
198
- TOAST_TYPES.forEach((type) => {
199
- methods[type] = (props) => {
200
- const uniqueId = v4();
201
- const ToastAddEvent = new CustomEvent(TOAST_EVENT_NAME, {
202
- composed: true,
203
- detail: {
204
- id: uniqueId,
205
- eventType: "add",
206
- status: type,
207
- createdAt: Date.now(),
208
- ...props
209
- }
210
- });
211
- dispatchEvent(ToastAddEvent);
212
- return uniqueId;
213
- };
214
- });
215
- const update = (id, props) => {
216
- const ToastEvent = new CustomEvent(
217
- TOAST_EVENT_NAME,
218
- {
219
- composed: true,
220
- detail: {
221
- eventType: "update",
222
- id,
223
- ...props
224
- }
225
- }
226
- );
227
- dispatchEvent(ToastEvent);
228
- };
229
- const dismiss = (id) => {
230
- const ToastEvent = new CustomEvent(
231
- TOAST_EVENT_NAME,
232
- {
233
- composed: true,
234
- detail: {
235
- eventType: "dismiss",
236
- id
237
- }
238
- }
239
- );
240
- dispatchEvent(ToastEvent);
241
- };
242
- const promise = async (promise2, toastConfig) => {
243
- const { onClose, ...loadingToastConfig } = toastConfig.loading;
244
- let closedWhileLoading = false;
245
- const onCloseWhileLoading = (e) => {
246
- toastConfig.loading.onClose?.(e);
247
- closedWhileLoading = true;
248
- };
249
- const id = toast$1.info({
250
- ...loadingToastConfig,
251
- onClose: onCloseWhileLoading,
252
- duration: false
253
- });
254
- await Promise.resolve(promise2).then((res) => {
255
- if (closedWhileLoading) {
256
- toast$1.success({
257
- ...toastConfig.success(res)
258
- });
259
- } else {
260
- toast$1.update(id, {
261
- ...toastConfig.success(res),
262
- status: "success"
263
- });
264
- }
265
- }).catch((err) => {
266
- if (closedWhileLoading) {
267
- toast$1.danger({
268
- ...toastConfig.error(err)
269
- });
270
- } else {
271
- toast$1.update(id, {
272
- ...toastConfig.error(err),
273
- status: "danger"
274
- });
275
- }
276
- });
277
- return id;
278
- };
279
- toast$1.info = methods.info;
280
- toast$1.success = methods.success;
281
- toast$1.warning = methods.warning;
282
- toast$1.danger = methods.danger;
283
- toast$1.update = update;
284
- toast$1.dismiss = dismiss;
285
- toast$1.promise = promise;
286
-
287
- const useShowMoreButtonPositionStyles = () => {
288
- const { toastHeights, toastsBeforeStack } = useToasts();
289
- const totalToasts = toastHeights.length;
290
- const extraSpace = totalToasts > toastsBeforeStack + 1 ? "2rem" : "1rem";
291
- const top = useMemo(() => {
292
- if (totalToasts > toastsBeforeStack) {
293
- return toastHeights.filter((t, i) => i >= totalToasts - toastsBeforeStack).map((t) => t.height).reduce((t, c) => t + c);
294
- }
295
- return "unset";
296
- }, [toastHeights, toastsBeforeStack]);
297
- return {
298
- // -0.75px fixes hover issue when 1rem != 16px due to pixel rounding
299
- top: `calc(${top}px + ${extraSpace} - 0.75px)`,
300
- position: "absolute",
301
- display: totalToasts > toastsBeforeStack ? undefined : "none"
302
- };
303
- };
304
- const STACKED_TOAST_HEIGHT = "5.3125rem";
305
- const STACKED_TOAST_PEEK_HEIGHT = "1rem";
306
- const TOAST_GAP = `${24 / 16}rem`;
307
- const useToastPositionStyles = (index) => {
308
- const {
309
- toasts,
310
- toastHeights,
311
- getToasterHeight,
312
- toastsBeforeStack,
313
- extraToastsVisible
314
- } = useToasts();
315
- const toastCount = toasts.length;
316
- const toasterHeight = getToasterHeight(index);
317
- return useMemo(() => {
318
- if (index === toastCount - 1) {
319
- return {
320
- top: TOAST_GAP,
321
- zIndex: 3
322
- };
323
- } else if (
324
- // all toasts when show more is clicked
325
- extraToastsVisible || // or visible toasts when stacked
326
- !extraToastsVisible && (toastCount <= toastsBeforeStack || toastCount > toastsBeforeStack && index >= toastCount - toastsBeforeStack)
327
- ) {
328
- return {
329
- top: `calc(${toasterHeight}px + ${TOAST_GAP})`
330
- };
331
- } else {
332
- if (toastCount > toastsBeforeStack) {
333
- if (index === toastCount - toastsBeforeStack - 1) {
334
- return {
335
- top: `calc(${toasterHeight || 0}px - ${STACKED_TOAST_HEIGHT} +
336
- ${STACKED_TOAST_PEEK_HEIGHT})`,
337
- zIndex: 1
338
- };
339
- } else if (index <= toastCount - toastsBeforeStack - 2) {
340
- return {
341
- top: `calc(${toasterHeight || 0}px -
342
- ${STACKED_TOAST_HEIGHT}
343
- + ${STACKED_TOAST_PEEK_HEIGHT} * 2)`,
344
- zIndex: 0
345
- };
346
- }
347
- }
348
- }
349
- return undefined;
350
- }, [toastHeights]);
351
- };
352
- const addOrUpdateToastHeight = (toastId, toastHeight, setToastHeights) => {
353
- setToastHeights((prev) => {
354
- if (prev.find((t) => t.id === toastId)) {
355
- return prev.map((t) => {
356
- if (t.id === toastId) {
357
- return { ...t, height: toastHeight };
358
- }
359
- return t;
360
- });
361
- }
362
- return [
363
- ...prev,
364
- {
365
- id: toastId,
366
- height: toastHeight
367
- }
368
- ];
369
- });
370
- };
371
- const setToastsAfterClose = (setToasts, setToastHeights, id) => {
372
- setToasts((prev) => id ? prev.filter((t) => t.id !== id) : []);
373
- setToastHeights((prev) => id ? prev.filter((t) => t.id !== id) : []);
374
- };
375
- const closeToast = (setToasts, setToastHeights, closingToastClassName, id) => {
376
- const prefersReducedMotion = globalThis.matchMedia(
377
- `(prefers-reduced-motion: reduce)`
378
- ).matches;
379
- if (prefersReducedMotion) {
380
- setToastsAfterClose(setToasts, setToastHeights, id);
381
- } else {
382
- setToasts(
383
- (prev) => prev.map((t) => {
384
- if (!id || t.id === id) {
385
- return {
386
- ...t,
387
- toastClassName: closingToastClassName
388
- };
389
- }
390
- return t;
391
- })
392
- );
393
- setTimeout(() => {
394
- setToastsAfterClose(setToasts, setToastHeights, id);
395
- }, 290);
396
- }
397
- };
398
- const useCloseToast = (closingToastClassName) => {
399
- const { setToasts, setToastHeights } = useToasts();
400
- return (id) => {
401
- closeToast(setToasts, setToastHeights, closingToastClassName, id);
402
- };
403
- };
404
-
405
- const Toast = forwardRef(
406
- ({
407
- actions,
408
- containerClassName,
409
- createdAt,
410
- duration,
411
- index = 0,
412
- isBelowStackIndex,
413
- isStacked,
414
- message,
415
- onClose,
416
- onDismiss,
417
- pausedStatus,
418
- progress,
419
- toastClassName,
420
- ...alertProps
421
- }, ref) => {
422
- const { setToastHeights, extraToastsVisible } = useToasts();
423
- const closeToast = useCloseToast(styles.close);
424
- const toastPositionStyles = useToastPositionStyles(index);
425
- const toastWrapperRef = useRef(null);
426
- const timerRef = useRef();
427
- const pausedAtRef = useRef(0);
428
- const createdAtRef = useRef(createdAt ?? 0);
429
- const hasBeenStackedRef = useRef(false);
430
- const [transitionClass, setTransitionClass] = useState(
431
- styles.hidden
432
- );
433
- const [toastOpened, setToastOpened] = useState(false);
434
- const alertClasses = cx(
435
- styles["toast-alert"],
436
- toastClassName,
437
- transitionClass
438
- );
439
- useEffect(() => {
440
- if (!toastOpened) {
441
- setTransitionClass(styles.open);
442
- setToastOpened(true);
443
- }
444
- return () => {
445
- onDismiss?.();
446
- };
447
- }, []);
448
- useEffect(() => {
449
- if (toastWrapperRef.current && toastOpened && !isStacked) {
450
- if (isBelowStackIndex && extraToastsVisible) {
451
- setTimeout(() => {
452
- const height = toastWrapperRef.current?.clientHeight;
453
- addOrUpdateToastHeight(alertProps.id, height ?? 0, setToastHeights);
454
- }, 300);
455
- } else {
456
- const height = toastWrapperRef.current.clientHeight;
457
- addOrUpdateToastHeight(alertProps.id, height, setToastHeights);
458
- }
459
- }
460
- }, [
461
- toastOpened,
462
- isStacked,
463
- extraToastsVisible,
464
- // toast updates
465
- actions,
466
- message,
467
- alertProps.title
468
- ]);
469
- useEffect(() => {
470
- if (duration && !isStacked) {
471
- if (!pausedStatus) {
472
- timerRef.current = setTimeout(
473
- () => closeToast(alertProps.id),
474
- duration
475
- );
476
- return () => clearTimeout(timerRef.current);
477
- } else if (typeof pausedStatus === "number") {
478
- clearTimeout(timerRef.current);
479
- pausedAtRef.current = pausedStatus;
480
- } else if (pausedStatus === "resumed") {
481
- const remainingDuration = (
482
- // rendering new toast after initial hover
483
- pausedAtRef.current === 0 ? duration : (
484
- // resume timer after valid hover
485
- duration + (createdAtRef.current || 0) - pausedAtRef.current
486
- )
487
- );
488
- timerRef.current = setTimeout(() => {
489
- closeToast(alertProps.id);
490
- pausedAtRef.current = 0;
491
- }, remainingDuration);
492
- return () => clearTimeout(timerRef.current);
493
- }
494
- }
495
- }, [createdAtRef.current, duration, pausedStatus]);
496
- useEffect(() => {
497
- if (duration) {
498
- if (isStacked) {
499
- clearTimeout(timerRef.current);
500
- hasBeenStackedRef.current = true;
501
- } else if (!isStacked && hasBeenStackedRef.current && !(typeof pausedStatus === "number")) {
502
- createdAtRef.current = Date.now();
503
- timerRef.current = setTimeout(() => {
504
- closeToast(alertProps.id);
505
- hasBeenStackedRef.current = false;
506
- }, duration);
507
- return () => clearTimeout(timerRef.current);
508
- }
509
- }
510
- }, [isStacked, duration]);
511
- const onSwipe = (dir) => {
512
- if (dir === "right") {
513
- toast$1.dismiss(alertProps.id);
514
- return;
515
- }
516
- };
517
- const { direction, ...touchProps } = useSwipe(onSwipe);
518
- const alertCloseProps = isStacked && !extraToastsVisible ? {} : {
519
- onClose
520
- };
521
- if (duration !== false && actions) {
522
- throw new Error(
523
- "If actions are provided to toast message, duration must be false."
524
- );
525
- }
526
- const hasMessage = message && message !== "";
527
- const hasProgress = progress != null;
528
- const hasActions = actions && duration === false;
529
- return /* @__PURE__ */ jsx(
530
- "div",
531
- {
532
- "data-anv": "toast",
533
- className: containerClassName,
534
- style: toastPositionStyles ?? { top: "1.5rem" },
535
- ref: toastWrapperRef,
536
- onAnimationStart: () => setToastOpened(true),
537
- role: isStacked ? "presentation" : undefined,
538
- ...touchProps,
539
- children: /* @__PURE__ */ jsx(
540
- Alert,
541
- {
542
- className: alertClasses,
543
- ...alertProps,
544
- ...alertCloseProps,
545
- ref,
546
- tabIndex: isStacked && !extraToastsVisible ? -1 : 0,
547
- children: hasMessage || hasProgress || hasActions ? /* @__PURE__ */ jsxs(Fragment, { children: [
548
- hasMessage ? /* @__PURE__ */ jsx(
549
- "div",
550
- {
551
- className: styles["message-container"],
552
- id: `toast-message-${alertProps.id}`,
553
- children: message
554
- }
555
- ) : null,
556
- hasProgress ? /* @__PURE__ */ jsx(Fragment, { children: progress === "indeterminate" ? /* @__PURE__ */ jsx(
557
- ProgressBar,
558
- {
559
- "aria-labelledby": `toast-message-${alertProps.id}`,
560
- indeterminate: true
561
- }
562
- ) : /* @__PURE__ */ jsx(
563
- ProgressBar,
564
- {
565
- "aria-labelledby": `toast-message-${alertProps.id}`,
566
- value: progress
567
- }
568
- ) }) : null,
569
- hasActions ? /* @__PURE__ */ jsxs("div", { className: styles["alert-action"], children: [
570
- /* @__PURE__ */ jsx(
571
- Button,
572
- {
573
- appearance: actions.primary.appearance,
574
- onClick: actions.primary.onClick,
575
- size: "small",
576
- children: actions.primary.label
577
- }
578
- ),
579
- actions.secondary && /* @__PURE__ */ jsx(
580
- Button,
581
- {
582
- appearance: actions.secondary.appearance,
583
- onClick: actions.secondary.onClick,
584
- size: "small",
585
- children: actions.secondary.label
586
- }
587
- )
588
- ] }) : null
589
- ] }) : null
590
- }
591
- )
592
- }
593
- );
594
- }
595
- );
596
- Toast.displayName = "Toast";
597
-
598
- function useHotkeyFocus({
599
- disabled,
600
- hotkey,
601
- onHotkeyIn,
602
- onHotkeyOut,
603
- refToFocus,
604
- rootRef
605
- }) {
606
- const [shouldEscapeRefocus, setShouldEscapeRefocus] = useState(false);
607
- const previousFocusElement = useRef(null);
608
- useEffect(() => {
609
- if (disabled || typeof document === "undefined") return;
610
- const rootElement = rootRef.current;
611
- const blurHandler = (e) => {
612
- if (e.relatedTarget && rootElement.contains(e.relatedTarget)) {
613
- return;
614
- }
615
- setShouldEscapeRefocus(false);
616
- };
617
- const keyDownHandler = async (e) => {
618
- const activeElement = document.activeElement?.shadowRoot?.activeElement || document.activeElement;
619
- if (activeElement?.tagName.toLowerCase() !== "input" && activeElement?.tagName.toLowerCase() !== "textarea" && activeElement?.tagName.toLowerCase() !== "pre" && e.key === hotkey) {
620
- e.preventDefault();
621
- previousFocusElement.current = activeElement;
622
- await onHotkeyIn?.();
623
- if (refToFocus.current) {
624
- refToFocus.current.focus();
625
- setShouldEscapeRefocus(true);
626
- if (refToFocus.current.scrollTo) {
627
- refToFocus.current.scrollTo();
628
- }
629
- }
630
- } else if (e.code === "Escape" && shouldEscapeRefocus) {
631
- onHotkeyOut?.();
632
- if (previousFocusElement.current && previousFocusElement.current.tagName.toLowerCase() !== "body") {
633
- previousFocusElement.current.focus();
634
- } else {
635
- activeElement.blur();
636
- }
637
- }
638
- };
639
- document.addEventListener("keydown", keyDownHandler);
640
- rootElement.addEventListener("focusout", blurHandler);
641
- return () => {
642
- document.removeEventListener("keydown", keyDownHandler);
643
- rootElement.removeEventListener("focusout", blurHandler);
644
- };
645
- }, [
646
- hotkey,
647
- disabled,
648
- rootRef,
649
- shouldEscapeRefocus,
650
- onHotkeyIn,
651
- refToFocus,
652
- onHotkeyOut
653
- ]);
654
- return { returnFocusRef: previousFocusElement };
655
- }
656
-
657
- const Toaster$1 = forwardRef(
658
- (props, ref) => {
659
- return /* @__PURE__ */ jsx(ToastProvider, { children: /* @__PURE__ */ jsx(ToasterContent, { ...props, ...ref }) });
660
- }
661
- );
662
- const ToasterContent = forwardRef(
663
- ({
664
- className,
665
- duration = false,
666
- focusKey = "t",
667
- forceRender = false,
668
- id,
669
- toastsBeforeStack = 3,
670
- ...props
671
- }, ref) => {
672
- const toasterRef = useRef(null);
673
- const firstToastRef = useRef(null);
674
- const mergedToasterRef = useMergeRefs([toasterRef, ref]);
675
- const {
676
- toasts,
677
- setToastsBeforeStack,
678
- extraToastsVisible,
679
- setExtraToastsVisible,
680
- setToasts,
681
- getToasterHeight
682
- } = useToasts();
683
- const toastCount = toasts.length;
684
- const lastToastCount = useRef(0);
685
- const a1ToastGroupObserver = useRef(null);
686
- const a1ToastGroupObserverConnected = useRef(false);
687
- const closeToast = useCloseToast(styles.close);
688
- const [toasterHeight, setToasterHeight] = useState(0);
689
- const [a1ToastGroups, setA1ToastGroups] = useState([]);
690
- const updateA1ToastGroups = () => {
691
- const mfeRoots = document.querySelectorAll(
692
- "[data-mfe-portal-name],[data-mfe-name]"
693
- );
694
- const a1ToastGroupsLocal = [
695
- ...document.getElementsByClassName("ToastGroup")
696
- ];
697
- if (mfeRoots.length > 0) {
698
- mfeRoots.forEach((el) => {
699
- setTimeout(() => {
700
- if (el.shadowRoot) {
701
- a1ToastGroupsLocal.push(
702
- ...el.shadowRoot.querySelectorAll(".ToastGroup")
703
- );
704
- }
705
- setA1ToastGroups(a1ToastGroupsLocal);
706
- });
707
- });
708
- } else {
709
- setA1ToastGroups(a1ToastGroupsLocal);
710
- }
711
- };
712
- const handleToasterBlur = useCallback(() => {
713
- setExtraToastsVisible(false);
714
- setToastPausedStatus("resumed");
715
- if (toasterRef.current?.scrollTo) {
716
- toasterRef.current?.scrollTo(0, 0);
717
- }
718
- }, [setExtraToastsVisible]);
719
- useEffect(() => {
720
- const toastEventListener = (e) => {
721
- const toasters = document.querySelectorAll("[data-anv='toaster']");
722
- const shadowToasters = toasterRef.current?.getRootNode()?.querySelectorAll("[data-anv='toaster']") || [];
723
- if (toasters.length && id !== toasters[0].getAttribute("data-toaster-id")) {
724
- return;
725
- } else if (
726
- // Toaster(s) exist in the shadow dom, bail out if this toaster is not the first one
727
- shadowToasters.length && id !== shadowToasters[0].getAttribute("data-toaster-id")
728
- ) {
729
- return;
730
- }
731
- const { eventType, ...toastProps } = e.detail;
732
- if (eventType === "add") {
733
- const toastAddProps = toastProps;
734
- if (!toastAddProps.toasterId || toastAddProps.toasterId === id) {
735
- setToasts((prev) => [...prev, toastProps]);
736
- }
737
- } else if (eventType === "update") {
738
- setToasts((prev) => {
739
- return prev.map((t) => {
740
- if (t.id === toastProps.id) {
741
- return {
742
- ...t,
743
- ...toastProps
744
- };
745
- } else {
746
- return t;
747
- }
748
- });
749
- });
750
- } else if (eventType === "dismiss") {
751
- if (toastProps.id) {
752
- closeToast(toastProps.id);
753
- } else {
754
- closeToast();
755
- }
756
- }
757
- };
758
- window.addEventListener("hammer-toast", toastEventListener);
759
- a1ToastGroupObserver.current = new MutationObserver(updateA1ToastGroups);
760
- return () => window.removeEventListener("hammer-toast", toastEventListener);
761
- }, []);
762
- useEffect(() => {
763
- if (a1ToastGroupObserver.current !== null) {
764
- if (toastCount > 0 && a1ToastGroupObserverConnected.current === false) {
765
- a1ToastGroupObserver.current.observe(document.body, {
766
- childList: true,
767
- subtree: true
768
- });
769
- a1ToastGroupObserverConnected.current = true;
770
- updateA1ToastGroups();
771
- } else if (toastCount === 0 && a1ToastGroupObserverConnected.current === true) {
772
- a1ToastGroupObserver.current.disconnect();
773
- a1ToastGroupObserverConnected.current = false;
774
- }
775
- }
776
- }, [toastCount]);
777
- useEffect(() => {
778
- if (a1ToastGroups && a1ToastGroups.length > 0) {
779
- a1ToastGroups.forEach((group) => {
780
- group.style.top = toastCount === 0 ? "16px" : `calc(${toasterHeight}px + 3.5rem)`;
781
- });
782
- }
783
- }, [toasterHeight, a1ToastGroups.length]);
784
- useEffect(() => {
785
- let timer;
786
- if (toastCount > lastToastCount.current) {
787
- setToasterHeight(getToasterHeight());
788
- } else {
789
- timer = setTimeout(() => setToasterHeight(getToasterHeight()), 290);
790
- }
791
- lastToastCount.current = toastCount;
792
- return () => {
793
- clearTimeout(timer);
794
- };
795
- }, [getToasterHeight]);
796
- useEffect(() => {
797
- setToastsBeforeStack(toastsBeforeStack);
798
- }, [setToastsBeforeStack, toastsBeforeStack]);
799
- const isToasterEmpty = toastCount === 0;
800
- const { returnFocusRef } = useHotkeyFocus({
801
- disabled: isToasterEmpty,
802
- hotkey: focusKey,
803
- onHotkeyIn: async () => {
804
- setExtraToastsVisible(true);
805
- return new Promise((resolve) => {
806
- setTimeout(() => {
807
- resolve();
808
- }, 100);
809
- });
810
- },
811
- onHotkeyOut: () => {
812
- setExtraToastsVisible(false);
813
- handleToasterBlur();
814
- },
815
- refToFocus: firstToastRef,
816
- rootRef: toasterRef
817
- });
818
- const showMoreButtonPositionStyles = useShowMoreButtonPositionStyles();
819
- const [toastPausedStatus, setToastPausedStatus] = useState(undefined);
820
- const showMoreButton = !extraToastsVisible && toastCount > toastsBeforeStack;
821
- const extraToastsLength = toastCount - toastsBeforeStack;
822
- const showMoreButtonText = `${extraToastsLength} more message${extraToastsLength > 1 ? "s" : ""}`;
823
- const toasterClasses = cx(styles.toaster, className, {
824
- [styles["show-more-button"]]: showMoreButton,
825
- [styles["show-extra-toast"]]: extraToastsVisible
826
- });
827
- const handleToasterFocusHover = () => {
828
- if (toastPausedStatus === "resumed" || toastPausedStatus === undefined) {
829
- setToastPausedStatus(Date.now());
830
- }
831
- };
832
- const handleToasterOnBlur = () => {
833
- if (!toasterRef.current?.matches(":focus-within")) {
834
- handleToasterBlur();
835
- }
836
- };
837
- return /* @__PURE__ */ jsxs(Fragment, { children: [
838
- /* @__PURE__ */ jsxs(
839
- "div",
840
- {
841
- "data-anv": "toaster",
842
- "data-toaster-id": id,
843
- className: toasterClasses,
844
- ref: mergedToasterRef,
845
- onMouseOver: handleToasterFocusHover,
846
- onMouseLeave: handleToasterBlur,
847
- onFocus: handleToasterFocusHover,
848
- onBlur: handleToasterOnBlur,
849
- style: {
850
- height: extraToastsVisible ? "100vh" : `calc(${toasterHeight}px + 2rem + var(--toaster-padding))`
851
- },
852
- ...props,
853
- children: [
854
- toasts.map(({ toastClassName, onClose, ...toastProps }, index) => {
855
- const isStacked = !extraToastsVisible && index < toastCount - toastsBeforeStack;
856
- const isLastToastDisplayed = index === toastCount - toastsBeforeStack;
857
- const isHidden = index < toastCount - toastsBeforeStack - 2;
858
- const toastClasses = cx(styles.toast, toastClassName);
859
- const toastContainerClasses = cx(styles["toast-wrapper"], {
860
- [styles.stacked]: isStacked || isLastToastDisplayed,
861
- [styles["stack-one"]]: isStacked && index === toastCount - toastsBeforeStack - 1,
862
- [styles["stack-two"]]: isStacked && index === toastCount - toastsBeforeStack - 2,
863
- [styles["stacked-extra"]]: isHidden,
864
- [styles["stacked-show-extra"]]: extraToastsVisible
865
- });
866
- const handleOnClose = (e) => {
867
- onClose?.(e);
868
- returnFocusRef.current?.focus();
869
- toast$1.dismiss(toastProps.id);
870
- };
871
- return /* @__PURE__ */ jsx(
872
- Toast,
873
- {
874
- containerClassName: toastContainerClasses,
875
- duration,
876
- index,
877
- isStacked,
878
- isBelowStackIndex: index < toastCount - toastsBeforeStack,
879
- onClose: handleOnClose,
880
- pausedStatus: toastPausedStatus,
881
- toastClassName: toastClasses,
882
- ref: index === 0 ? firstToastRef : undefined,
883
- ...toastProps
884
- },
885
- toastProps.id
886
- );
887
- }),
888
- showMoreButton && /* @__PURE__ */ jsx(
889
- "div",
890
- {
891
- className: styles["show-more-button-container"],
892
- style: showMoreButtonPositionStyles,
893
- children: /* @__PURE__ */ jsx(
894
- Button,
895
- {
896
- className: styles["show-collapse-button"],
897
- onClick: () => setExtraToastsVisible(true),
898
- appearance: "secondary",
899
- tabIndex: 0,
900
- children: showMoreButtonText
901
- }
902
- )
903
- }
904
- ),
905
- /* @__PURE__ */ jsxs(SrOnly, { "aria-live": "polite", children: [
906
- "New toast message appeared. Press the ",
907
- focusKey,
908
- " key to focus on the toast messages. Press escape to return focus to previous position."
909
- ] })
910
- ]
911
- }
912
- ),
913
- extraToastsVisible && /* @__PURE__ */ jsx("div", { className: styles["show-collapse-button-container"], children: /* @__PURE__ */ jsx(
914
- Button,
915
- {
916
- className: styles["show-collapse-button"],
917
- onClick: handleToasterBlur,
918
- appearance: "secondary",
919
- children: "Collapse Messages"
920
- }
921
- ) })
922
- ] });
923
- }
924
- );
925
- Toaster$1.displayName = "Toaster";
926
- ToasterContent.displayName = "ToasterContent";
927
-
928
- const Toaster = forwardRef(
929
- (props, ref) => {
930
- return /* @__PURE__ */ jsx(Toaster$1, { ref, ...props });
931
- }
932
- );
933
-
934
- const toast = toast$1;
935
-
936
- export { Toaster as T, toast as t };
937
- //# sourceMappingURL=toast-CbokOkfo.js.map