@purpur/library 9.0.9 → 9.1.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 (306) hide show
  1. package/CHANGELOG.json +63 -0
  2. package/CHANGELOG.md +28 -1
  3. package/dist/LICENSE.txt +48 -27
  4. package/dist/{autocomplete-B_OBQM2h.js → autocomplete-B421J7CS.js} +2 -2
  5. package/dist/{autocomplete-B_OBQM2h.js.map → autocomplete-B421J7CS.js.map} +1 -1
  6. package/dist/{autocomplete-DJ3zbA0m.mjs → autocomplete-B8L-dTmF.mjs} +3 -3
  7. package/dist/{autocomplete-DJ3zbA0m.mjs.map → autocomplete-B8L-dTmF.mjs.map} +1 -1
  8. package/dist/autocomplete.cjs.js +1 -1
  9. package/dist/autocomplete.es.js +1 -1
  10. package/dist/button-Cv7NlYbv.mjs +109 -0
  11. package/dist/button-Cv7NlYbv.mjs.map +1 -0
  12. package/dist/button-Dqxdc3nC.js +2 -0
  13. package/dist/button-Dqxdc3nC.js.map +1 -0
  14. package/dist/button.cjs.js +1 -1
  15. package/dist/button.es.js +1 -1
  16. package/dist/{calendar-BSdvi_DA.js → calendar-C-F-pVCe.js} +2 -2
  17. package/dist/{calendar-BSdvi_DA.js.map → calendar-C-F-pVCe.js.map} +1 -1
  18. package/dist/{calendar-9p_aA7KY.mjs → calendar-DWpnuylk.mjs} +2 -2
  19. package/dist/{calendar-9p_aA7KY.mjs.map → calendar-DWpnuylk.mjs.map} +1 -1
  20. package/dist/calendar.cjs.js +1 -1
  21. package/dist/calendar.es.js +1 -1
  22. package/dist/chat-field-CxOqk0-9.js +2 -0
  23. package/dist/chat-field-CxOqk0-9.js.map +1 -0
  24. package/dist/chat-field-yK-TwW0D.mjs +149 -0
  25. package/dist/chat-field-yK-TwW0D.mjs.map +1 -0
  26. package/dist/chat-field.cjs.js +2 -0
  27. package/dist/chat-field.cjs.js.map +1 -0
  28. package/dist/chat-field.es.js +5 -0
  29. package/dist/chat-field.es.js.map +1 -0
  30. package/dist/components/autocomplete/src/autocomplete.d.ts.map +1 -1
  31. package/dist/components/button/src/button.d.ts +4 -0
  32. package/dist/components/button/src/button.d.ts.map +1 -1
  33. package/dist/components/chat-field/src/chat-field.d.ts +71 -0
  34. package/dist/components/chat-field/src/chat-field.d.ts.map +1 -0
  35. package/dist/components/dismissable-chip-group/src/dismissable-chip-group-item.d.ts.map +1 -1
  36. package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts +6 -1
  37. package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts.map +1 -1
  38. package/dist/components/drawer/src/drawer-container.d.ts +2 -0
  39. package/dist/components/drawer/src/drawer-container.d.ts.map +1 -1
  40. package/dist/components/drawer/src/drawer-content.d.ts.map +1 -1
  41. package/dist/components/drawer/src/drawer-frame.d.ts +2 -1
  42. package/dist/components/drawer/src/drawer-frame.d.ts.map +1 -1
  43. package/dist/components/drawer/src/drawer-handle.d.ts +2 -1
  44. package/dist/components/drawer/src/drawer-handle.d.ts.map +1 -1
  45. package/dist/components/drawer/src/drawer-header.d.ts +2 -0
  46. package/dist/components/drawer/src/drawer-header.d.ts.map +1 -1
  47. package/dist/components/drawer/src/drawer-scroll-area.d.ts +2 -0
  48. package/dist/components/drawer/src/drawer-scroll-area.d.ts.map +1 -1
  49. package/dist/components/drawer/src/drawer.context.d.ts +6 -2
  50. package/dist/components/drawer/src/drawer.context.d.ts.map +1 -1
  51. package/dist/components/drawer/src/drawer.d.ts +3 -0
  52. package/dist/components/drawer/src/drawer.d.ts.map +1 -1
  53. package/dist/components/drawer/src/types.d.ts +1 -0
  54. package/dist/components/drawer/src/types.d.ts.map +1 -1
  55. package/dist/components/dropdown/src/dropdown-combobox.d.ts +34 -0
  56. package/dist/components/dropdown/src/dropdown-combobox.d.ts.map +1 -0
  57. package/dist/components/dropdown/src/dropdown-select.d.ts +34 -0
  58. package/dist/components/dropdown/src/dropdown-select.d.ts.map +1 -0
  59. package/dist/components/dropdown/src/dropdown-shared.d.ts +51 -0
  60. package/dist/components/dropdown/src/dropdown-shared.d.ts.map +1 -0
  61. package/dist/components/dropdown/src/dropdown.d.ts +6 -0
  62. package/dist/components/dropdown/src/dropdown.d.ts.map +1 -0
  63. package/dist/components/dropdown/src/dropdown.types.d.ts +94 -0
  64. package/dist/components/dropdown/src/dropdown.types.d.ts.map +1 -0
  65. package/dist/components/dropdown/src/useDropdown.d.ts +38 -0
  66. package/dist/components/dropdown/src/useDropdown.d.ts.map +1 -0
  67. package/dist/components/dropdown/src/useDropdownFilter.d.ts +9 -0
  68. package/dist/components/dropdown/src/useDropdownFilter.d.ts.map +1 -0
  69. package/dist/components/dropdown/src/useDropdownHighlight.d.ts +19 -0
  70. package/dist/components/dropdown/src/useDropdownHighlight.d.ts.map +1 -0
  71. package/dist/components/dropdown/src/useDropdownInput.d.ts +12 -0
  72. package/dist/components/dropdown/src/useDropdownInput.d.ts.map +1 -0
  73. package/dist/components/dropdown/src/useOnClickOutside.d.ts +2 -0
  74. package/dist/components/dropdown/src/useOnClickOutside.d.ts.map +1 -0
  75. package/dist/components/listbox/src/listbox-item.d.ts +2 -0
  76. package/dist/components/listbox/src/listbox-item.d.ts.map +1 -1
  77. package/dist/components/notification/src/notification.d.ts +2 -1
  78. package/dist/components/notification/src/notification.d.ts.map +1 -1
  79. package/dist/components/search-field/src/search-field-autocomplete.d.ts +73 -0
  80. package/dist/components/search-field/src/search-field-autocomplete.d.ts.map +1 -0
  81. package/dist/components/search-field/src/search-field-base.d.ts +97 -0
  82. package/dist/components/search-field/src/search-field-base.d.ts.map +1 -0
  83. package/dist/components/search-field/src/search-field.d.ts +123 -41
  84. package/dist/components/search-field/src/search-field.d.ts.map +1 -1
  85. package/dist/components/text-field/src/text-field-ai.d.ts +669 -0
  86. package/dist/components/text-field/src/text-field-ai.d.ts.map +1 -0
  87. package/dist/components/text-field/src/text-field-base.d.ts +671 -0
  88. package/dist/components/text-field/src/text-field-base.d.ts.map +1 -0
  89. package/dist/components/text-field/src/text-field.d.ts +42 -4
  90. package/dist/components/text-field/src/text-field.d.ts.map +1 -1
  91. package/dist/components-metadata.js +30 -1
  92. package/dist/{date-field-Ch2lM7-P.mjs → date-field-4tYMPw89.mjs} +2 -2
  93. package/dist/{date-field-Ch2lM7-P.mjs.map → date-field-4tYMPw89.mjs.map} +1 -1
  94. package/dist/{date-field-DTI5mQkg.js → date-field-B7ipm5sH.js} +2 -2
  95. package/dist/{date-field-DTI5mQkg.js.map → date-field-B7ipm5sH.js.map} +1 -1
  96. package/dist/date-field.cjs.js +1 -1
  97. package/dist/date-field.es.js +1 -1
  98. package/dist/{date-picker-Dk39IXG5.js → date-picker-B8L1Hm8r.js} +2 -2
  99. package/dist/{date-picker-Dk39IXG5.js.map → date-picker-B8L1Hm8r.js.map} +1 -1
  100. package/dist/{date-picker-Bt3IaH23.mjs → date-picker-Bp_XpoOF.mjs} +4 -4
  101. package/dist/{date-picker-Bt3IaH23.mjs.map → date-picker-Bp_XpoOF.mjs.map} +1 -1
  102. package/dist/date-picker.cjs.js +1 -1
  103. package/dist/date-picker.es.js +1 -1
  104. package/dist/dismissable-chip-group-Cd23yjBa.js +2 -0
  105. package/dist/dismissable-chip-group-Cd23yjBa.js.map +1 -0
  106. package/dist/dismissable-chip-group-D-gD93ON.mjs +89 -0
  107. package/dist/dismissable-chip-group-D-gD93ON.mjs.map +1 -0
  108. package/dist/dismissable-chip-group.cjs.js +1 -1
  109. package/dist/dismissable-chip-group.es.js +5 -2
  110. package/dist/drawer-UdK-u7IX.js +2 -0
  111. package/dist/drawer-UdK-u7IX.js.map +1 -0
  112. package/dist/drawer-Vi9H2O3N.mjs +562 -0
  113. package/dist/drawer-Vi9H2O3N.mjs.map +1 -0
  114. package/dist/drawer.cjs.js +1 -1
  115. package/dist/drawer.es.js +1 -1
  116. package/dist/dropdown-BC6evqyq.js +2 -0
  117. package/dist/dropdown-BC6evqyq.js.map +1 -0
  118. package/dist/dropdown-C-Ze4gvG.mjs +771 -0
  119. package/dist/dropdown-C-Ze4gvG.mjs.map +1 -0
  120. package/dist/dropdown.cjs.js +2 -0
  121. package/dist/dropdown.cjs.js.map +1 -0
  122. package/dist/dropdown.es.js +6 -0
  123. package/dist/dropdown.es.js.map +1 -0
  124. package/dist/{hero-banner-B5HKmkXc.mjs → hero-banner-BjwICxaJ.mjs} +2 -2
  125. package/dist/{hero-banner-B5HKmkXc.mjs.map → hero-banner-BjwICxaJ.mjs.map} +1 -1
  126. package/dist/{hero-banner-OnNSuxNT.js → hero-banner-yGRM4OlS.js} +2 -2
  127. package/dist/{hero-banner-OnNSuxNT.js.map → hero-banner-yGRM4OlS.js.map} +1 -1
  128. package/dist/hero-banner.cjs.js +1 -1
  129. package/dist/hero-banner.es.js +1 -1
  130. package/dist/illustrative-icon/assets/json/cart-checkmark-duocolor-animated.json.d.ts +1 -1
  131. package/dist/illustrative-icon/assets/json/cart-checkmark-offblack-animated.json.d.ts +1 -1
  132. package/dist/illustrative-icon/assets/json/checkmark-duocolor-animated.json.d.ts +1 -1
  133. package/dist/illustrative-icon/assets/json/checkmark-offblack-animated.json.d.ts +1 -1
  134. package/dist/illustrative-icon/assets/json/document-checkmark-duocolor-animated.json.d.ts +1 -1
  135. package/dist/illustrative-icon/assets/json/document-checkmark-offblack-animated.json.d.ts +1 -1
  136. package/dist/illustrative-icon/assets/json/support-checkmark-duocolor-animated.json.d.ts +1 -1
  137. package/dist/illustrative-icon/assets/json/support-checkmark-offblack-animated.json.d.ts +1 -1
  138. package/dist/illustrative-icon/assets/json/user-checkmark-duocolor-animated.json.d.ts +1 -1
  139. package/dist/illustrative-icon/assets/json/user-checkmark-offblack-animated.json.d.ts +1 -1
  140. package/dist/illustrative-icon/components/cart-checkmark-duocolor-animated.cjs.js +1 -1
  141. package/dist/illustrative-icon/components/cart-checkmark-duocolor-animated.cjs.js.map +1 -1
  142. package/dist/illustrative-icon/components/cart-checkmark-duocolor-animated.es.js +1 -1
  143. package/dist/illustrative-icon/components/cart-checkmark-offblack-animated.cjs.js +1 -1
  144. package/dist/illustrative-icon/components/cart-checkmark-offblack-animated.cjs.js.map +1 -1
  145. package/dist/illustrative-icon/components/cart-checkmark-offblack-animated.es.js +1 -1
  146. package/dist/illustrative-icon/components/checkmark-duocolor-animated.cjs.js +1 -1
  147. package/dist/illustrative-icon/components/checkmark-duocolor-animated.cjs.js.map +1 -1
  148. package/dist/illustrative-icon/components/checkmark-duocolor-animated.es.js +1 -1
  149. package/dist/illustrative-icon/components/checkmark-offblack-animated.cjs.js +1 -1
  150. package/dist/illustrative-icon/components/checkmark-offblack-animated.cjs.js.map +1 -1
  151. package/dist/illustrative-icon/components/checkmark-offblack-animated.es.js +1 -1
  152. package/dist/illustrative-icon/components/document-checkmark-duocolor-animated.cjs.js +2 -2
  153. package/dist/illustrative-icon/components/document-checkmark-duocolor-animated.es.js +2 -2
  154. package/dist/illustrative-icon/components/document-checkmark-offblack-animated.cjs.js +2 -2
  155. package/dist/illustrative-icon/components/document-checkmark-offblack-animated.es.js +2 -2
  156. package/dist/illustrative-icon/components/support-checkmark-duocolor-animated.cjs.js +1 -1
  157. package/dist/illustrative-icon/components/support-checkmark-duocolor-animated.cjs.js.map +1 -1
  158. package/dist/illustrative-icon/components/support-checkmark-duocolor-animated.es.js +1 -1
  159. package/dist/illustrative-icon/components/support-checkmark-offblack-animated.cjs.js +1 -1
  160. package/dist/illustrative-icon/components/support-checkmark-offblack-animated.cjs.js.map +1 -1
  161. package/dist/illustrative-icon/components/support-checkmark-offblack-animated.es.js +1 -1
  162. package/dist/illustrative-icon/components/user-checkmark-duocolor-animated.cjs.js +1 -1
  163. package/dist/illustrative-icon/components/user-checkmark-duocolor-animated.es.js +1 -1
  164. package/dist/illustrative-icon/components/user-checkmark-offblack-animated.cjs.js +1 -1
  165. package/dist/illustrative-icon/components/user-checkmark-offblack-animated.es.js +1 -1
  166. package/dist/libraries/library/src/chat-field.d.ts +6 -0
  167. package/dist/libraries/library/src/chat-field.d.ts.map +1 -0
  168. package/dist/libraries/library/src/dropdown.d.ts +6 -0
  169. package/dist/libraries/library/src/dropdown.d.ts.map +1 -0
  170. package/dist/libraries/library/src/library.d.ts +2 -0
  171. package/dist/libraries/library/src/library.d.ts.map +1 -1
  172. package/dist/libraries/theme/src/theme-props.d.ts +1 -0
  173. package/dist/libraries/theme/src/theme-props.d.ts.map +1 -1
  174. package/dist/libraries/tokens/dist/border/variables.d.ts +1 -0
  175. package/dist/libraries/tokens/dist/border/variables.dark.d.ts +1 -0
  176. package/dist/library.cjs.js +1 -1
  177. package/dist/library.es.js +603 -592
  178. package/dist/library.es.js.map +1 -1
  179. package/dist/listbox-COBHLRtB.js +2 -0
  180. package/dist/listbox-COBHLRtB.js.map +1 -0
  181. package/dist/listbox-DG4KmQP_.mjs +66 -0
  182. package/dist/listbox-DG4KmQP_.mjs.map +1 -0
  183. package/dist/listbox.cjs.js +1 -1
  184. package/dist/listbox.es.js +1 -1
  185. package/dist/{modal-CQiJ98iI.js → modal-DMeRO1wE.js} +2 -2
  186. package/dist/{modal-CQiJ98iI.js.map → modal-DMeRO1wE.js.map} +1 -1
  187. package/dist/{modal-B1eJu9HN.mjs → modal-fTWvPEPW.mjs} +2 -2
  188. package/dist/{modal-B1eJu9HN.mjs.map → modal-fTWvPEPW.mjs.map} +1 -1
  189. package/dist/modal.cjs.js +1 -1
  190. package/dist/modal.es.js +1 -1
  191. package/dist/{notification-BtcM7Ndu.mjs → notification-BvoL7BIW.mjs} +60 -51
  192. package/dist/notification-BvoL7BIW.mjs.map +1 -0
  193. package/dist/notification-DE1pvk9W.js +2 -0
  194. package/dist/notification-DE1pvk9W.js.map +1 -0
  195. package/dist/{notification-banner-CbKcE7o4.mjs → notification-banner-C4gkkSlf.mjs} +2 -2
  196. package/dist/{notification-banner-CbKcE7o4.mjs.map → notification-banner-C4gkkSlf.mjs.map} +1 -1
  197. package/dist/{notification-banner-B0CUuKZn.js → notification-banner-COH7wJu2.js} +2 -2
  198. package/dist/{notification-banner-B0CUuKZn.js.map → notification-banner-COH7wJu2.js.map} +1 -1
  199. package/dist/notification-banner.cjs.js +1 -1
  200. package/dist/notification-banner.es.js +1 -1
  201. package/dist/notification.cjs.js +1 -1
  202. package/dist/notification.es.js +1 -1
  203. package/dist/{popover-D6k4-oO1.js → popover-BnUVNqSi.js} +2 -2
  204. package/dist/{popover-D6k4-oO1.js.map → popover-BnUVNqSi.js.map} +1 -1
  205. package/dist/{popover-D3b2gHm-.mjs → popover-lxTyKALA.mjs} +2 -2
  206. package/dist/{popover-D3b2gHm-.mjs.map → popover-lxTyKALA.mjs.map} +1 -1
  207. package/dist/popover.cjs.js +1 -1
  208. package/dist/popover.es.js +1 -1
  209. package/dist/purpur.css +1 -1
  210. package/dist/{quantity-selector-Djf8APeL.mjs → quantity-selector-CsR6KTG3.mjs} +3 -3
  211. package/dist/{quantity-selector-Djf8APeL.mjs.map → quantity-selector-CsR6KTG3.mjs.map} +1 -1
  212. package/dist/{quantity-selector-Bc-4Dnpc.js → quantity-selector-DWDg4aFO.js} +2 -2
  213. package/dist/{quantity-selector-Bc-4Dnpc.js.map → quantity-selector-DWDg4aFO.js.map} +1 -1
  214. package/dist/quantity-selector.cjs.js +1 -1
  215. package/dist/quantity-selector.es.js +1 -1
  216. package/dist/search-field-Caj2dKLn.mjs +151 -0
  217. package/dist/search-field-Caj2dKLn.mjs.map +1 -0
  218. package/dist/search-field-DAktzYb0.js +2 -0
  219. package/dist/search-field-DAktzYb0.js.map +1 -0
  220. package/dist/search-field.cjs.js +1 -1
  221. package/dist/search-field.es.js +3 -2
  222. package/dist/{stepper-CTdGj87I.mjs → stepper-B351hexi.mjs} +3 -3
  223. package/dist/{stepper-CTdGj87I.mjs.map → stepper-B351hexi.mjs.map} +1 -1
  224. package/dist/{stepper-BaoOY4Ea.js → stepper-Cb4_9D2h.js} +2 -2
  225. package/dist/{stepper-BaoOY4Ea.js.map → stepper-Cb4_9D2h.js.map} +1 -1
  226. package/dist/stepper.cjs.js +1 -1
  227. package/dist/stepper.es.js +1 -1
  228. package/dist/{table-D7qthqj_.mjs → table-DXYHrKI7.mjs} +5 -5
  229. package/dist/{table-D7qthqj_.mjs.map → table-DXYHrKI7.mjs.map} +1 -1
  230. package/dist/{table-TdOPMFoP.js → table-x3SDCR-z.js} +2 -2
  231. package/dist/{table-TdOPMFoP.js.map → table-x3SDCR-z.js.map} +1 -1
  232. package/dist/table.cjs.js +1 -1
  233. package/dist/table.es.js +1 -1
  234. package/dist/text-field-BQYzwIrG.mjs +322 -0
  235. package/dist/text-field-BQYzwIrG.mjs.map +1 -0
  236. package/dist/text-field-BwxGMWds.js +2 -0
  237. package/dist/text-field-BwxGMWds.js.map +1 -0
  238. package/dist/text-field.cjs.js +1 -1
  239. package/dist/text-field.es.js +4 -3
  240. package/dist/tokens/border/variables.css +1 -0
  241. package/dist/tokens/border/variables.d.ts +1 -0
  242. package/dist/tokens/border/variables.dark.css +1 -0
  243. package/dist/tokens/border/variables.dark.d.ts +1 -0
  244. package/dist/tokens/border/variables.dark.js +1 -0
  245. package/dist/tokens/border/variables.dark.json +1 -0
  246. package/dist/tokens/border/variables.dark.scss +1 -0
  247. package/dist/tokens/border/variables.js +1 -0
  248. package/dist/tokens/border/variables.json +1 -0
  249. package/dist/tokens/border/variables.scss +1 -0
  250. package/dist/tokens.cjs.js +1 -1
  251. package/dist/tokens.cjs.js.map +1 -1
  252. package/dist/tokens.es.js +337 -336
  253. package/dist/tokens.es.js.map +1 -1
  254. package/dist/{tooltip-BtGtu3ph.mjs → tooltip-BHsVKFJ3.mjs} +2 -2
  255. package/dist/{tooltip-BtGtu3ph.mjs.map → tooltip-BHsVKFJ3.mjs.map} +1 -1
  256. package/dist/{tooltip-eUP35j3v.js → tooltip-B_qTqtcF.js} +2 -2
  257. package/dist/{tooltip-eUP35j3v.js.map → tooltip-B_qTqtcF.js.map} +1 -1
  258. package/dist/tooltip.cjs.js +1 -1
  259. package/dist/tooltip.es.js +1 -1
  260. package/dist/use-autocomplete.es-BHDgQLae.js +2 -0
  261. package/dist/use-autocomplete.es-BHDgQLae.js.map +1 -0
  262. package/dist/use-autocomplete.es-CVv3z8t6.mjs +142 -0
  263. package/dist/use-autocomplete.es-CVv3z8t6.mjs.map +1 -0
  264. package/package.json +22 -20
  265. package/src/aliases.ts +8 -0
  266. package/src/chat-field.ts +6 -0
  267. package/src/dropdown.ts +6 -0
  268. package/src/entries.js +2 -0
  269. package/src/library.ts +4 -0
  270. package/tokens/border/variables.css +1 -0
  271. package/tokens/border/variables.d.ts +1 -0
  272. package/tokens/border/variables.dark.css +1 -0
  273. package/tokens/border/variables.dark.d.ts +1 -0
  274. package/tokens/border/variables.dark.js +1 -0
  275. package/tokens/border/variables.dark.json +1 -0
  276. package/tokens/border/variables.dark.scss +1 -0
  277. package/tokens/border/variables.js +1 -0
  278. package/tokens/border/variables.json +1 -0
  279. package/tokens/border/variables.scss +1 -0
  280. package/dist/button-BxdChrq-.js +0 -2
  281. package/dist/button-BxdChrq-.js.map +0 -1
  282. package/dist/button-D-BBdNhd.mjs +0 -105
  283. package/dist/button-D-BBdNhd.mjs.map +0 -1
  284. package/dist/dismissable-chip-group-CnziecOt.js +0 -2
  285. package/dist/dismissable-chip-group-CnziecOt.js.map +0 -1
  286. package/dist/dismissable-chip-group-ZCYOt1sB.mjs +0 -79
  287. package/dist/dismissable-chip-group-ZCYOt1sB.mjs.map +0 -1
  288. package/dist/drawer-B6j8nfAY.mjs +0 -530
  289. package/dist/drawer-B6j8nfAY.mjs.map +0 -1
  290. package/dist/drawer-CJsLdd2x.js +0 -2
  291. package/dist/drawer-CJsLdd2x.js.map +0 -1
  292. package/dist/listbox-BmjBtIv8.js +0 -2
  293. package/dist/listbox-BmjBtIv8.js.map +0 -1
  294. package/dist/listbox-oDeP8FvH.mjs +0 -65
  295. package/dist/listbox-oDeP8FvH.mjs.map +0 -1
  296. package/dist/notification-BtcM7Ndu.mjs.map +0 -1
  297. package/dist/notification-Dsg3Vzfi.js +0 -2
  298. package/dist/notification-Dsg3Vzfi.js.map +0 -1
  299. package/dist/search-field-0CBoxcNH.js +0 -2
  300. package/dist/search-field-0CBoxcNH.js.map +0 -1
  301. package/dist/search-field-aP_i6Nr0.mjs +0 -91
  302. package/dist/search-field-aP_i6Nr0.mjs.map +0 -1
  303. package/dist/text-field-9zPmL99g.mjs +0 -185
  304. package/dist/text-field-9zPmL99g.mjs.map +0 -1
  305. package/dist/text-field-CKCwxTJX.js +0 -2
  306. package/dist/text-field-CKCwxTJX.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"library.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"library.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const s=require("react/jsx-runtime"),o=require("react"),p=require("./bind-DeUYJ6m9.js"),N=require("./checkmark.es-lYntWFA3.js"),$=require("./paragraph-BsI53OR0.js"),m={"purpur-listbox":"_purpur-listbox_l0zrf_1","purpur-listbox-item":"_purpur-listbox-item_l0zrf_15","purpur-listbox-item--hovered":"_purpur-listbox-item--hovered_l0zrf_29","purpur-listbox-item--highlighted":"_purpur-listbox-item--highlighted_l0zrf_37","purpur-listbox-item--noninteractive":"_purpur-listbox-item--noninteractive_l0zrf_41","purpur-listbox-item--disabled":"_purpur-listbox-item--disabled_l0zrf_44","purpur-listbox-item__icon":"_purpur-listbox-item__icon_l0zrf_51"},u=p.c.bind(m),e="purpur-listbox",c=o.forwardRef((i,t)=>{const{disabled:r,highlighted:d,hovered:x,selected:l,children:a,className:b,noninteractive:_,hideSelectedIcon:h,...f}=i,g=u(`${e}-item`,b,{[`${e}-item--highlighted`]:d,[`${e}-item--selected`]:l,[`${e}-item--hovered`]:x,[`${e}-item--disabled`]:r,[`${e}-item--noninteractive`]:_});return s.jsxs("li",{...f,ref:t,className:g,"aria-selected":!!l,role:"option","aria-disabled":!!r,children:[typeof a=="string"?s.jsx($.Paragraph,{children:a}):a,l&&!h&&s.jsx(N.a,{size:"xs",className:u(`${e}-item__icon`)})]})}),v=i=>o.isValidElement(i)&&i?.type===c;c.displayName="ListBoxItem";const z=p.c.bind(m),y="purpur-listbox",n=o.forwardRef(({children:i,...t},r)=>s.jsx("ul",{...t,ref:r,className:z(y,t.className),role:"listbox",children:o.Children.toArray(i).filter(v)}));n.Item=c;n.displayName="ListBox";exports.Listbox=n;
2
+ //# sourceMappingURL=listbox-COBHLRtB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listbox-COBHLRtB.js","sources":["../../../components/listbox/src/listbox-item.tsx","../../../components/listbox/src/listbox.tsx"],"sourcesContent":["import React, { forwardRef, isValidElement, type ReactElement, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { IconCheckmark } from \"@purpur/icon/checkmark\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./listbox.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-listbox\";\n\nexport type ListboxItemProps = Omit<BaseProps<\"li\">, \"role\"> & {\n highlighted?: boolean;\n hovered?: boolean;\n key?: string;\n selected?: boolean;\n disabled?: boolean;\n noninteractive?: boolean;\n /** When true, hides the built-in checkmark icon while preserving `aria-selected`. */\n hideSelectedIcon?: boolean;\n};\n\nexport const ListboxItem = forwardRef<HTMLLIElement, ListboxItemProps>((props, ref) => {\n const {\n disabled,\n highlighted,\n hovered,\n selected,\n children,\n className,\n noninteractive,\n hideSelectedIcon,\n ...liProps\n } = props;\n\n const classes = cx(`${rootClassName}-item`, className, {\n [`${rootClassName}-item--highlighted`]: highlighted,\n [`${rootClassName}-item--selected`]: selected,\n [`${rootClassName}-item--hovered`]: hovered,\n [`${rootClassName}-item--disabled`]: disabled,\n [`${rootClassName}-item--noninteractive`]: noninteractive,\n });\n\n return (\n <li\n {...liProps}\n ref={ref}\n className={classes}\n aria-selected={!!selected}\n role=\"option\"\n aria-disabled={!!disabled}\n >\n {typeof children === \"string\" ? <Paragraph>{children}</Paragraph> : children}\n {selected && !hideSelectedIcon && (\n <IconCheckmark size=\"xs\" className={cx(`${rootClassName}-item__icon`)} />\n )}\n </li>\n );\n});\n\nexport const isListboxItem = (child?: ReactNode): child is ReactElement<ListboxItemProps> =>\n isValidElement<ListboxItemProps>(child) && child?.type === ListboxItem;\n\nListboxItem.displayName = \"ListBoxItem\";\n","import React, {\n Children,\n forwardRef,\n type ForwardRefExoticComponent,\n type PropsWithoutRef,\n} from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./listbox.module.scss\";\nimport { isListboxItem, ListboxItem } from \"./listbox-item\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-listbox\";\n\nexport type ListboxProps = Omit<BaseProps<\"ul\">, \"role\"> & {\n \"aria-label\": NonNullable<BaseProps<\"ul\">[\"aria-label\"]>;\n \"aria-expanded\": NonNullable<BaseProps<\"ul\">[\"aria-expanded\"]>;\n};\n\ntype ListboxStatic = {\n Item: typeof ListboxItem;\n};\n\ntype ListboxComponent = ForwardRefExoticComponent<PropsWithoutRef<ListboxProps>> & ListboxStatic;\n\nexport const Listbox = forwardRef<HTMLUListElement, ListboxProps>(\n ({ children, ...listboxProps }, ref) => (\n <ul\n {...listboxProps}\n ref={ref}\n className={cx(rootClassName, listboxProps.className)}\n role=\"listbox\"\n >\n {Children.toArray(children).filter(isListboxItem)}\n </ul>\n )\n) as ListboxComponent;\n\nexport type { ListboxItemProps } from \"./listbox-item\";\nListbox.Item = ListboxItem;\nListbox.displayName = \"ListBox\";\n"],"names":["cx","c","styles","rootClassName","ListboxItem","forwardRef","props","ref","disabled","highlighted","hovered","selected","children","className","noninteractive","hideSelectedIcon","liProps","classes","jsxs","jsx","Paragraph","IconCheckmark","isListboxItem","child","isValidElement","Listbox","listboxProps","Children"],"mappings":"ipBAQMA,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAElBC,EAAgB,iBAaTC,EAAcC,EAAAA,WAA4C,CAACC,EAAOC,IAAQ,CACrF,KAAM,CACJ,SAAAC,EACA,YAAAC,EACA,QAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,GAAGC,CAAA,EACDV,EAEEW,EAAUjB,EAAG,GAAGG,CAAa,QAASU,EAAW,CACrD,CAAC,GAAGV,CAAa,oBAAoB,EAAGM,EACxC,CAAC,GAAGN,CAAa,iBAAiB,EAAGQ,EACrC,CAAC,GAAGR,CAAa,gBAAgB,EAAGO,EACpC,CAAC,GAAGP,CAAa,iBAAiB,EAAGK,EACrC,CAAC,GAAGL,CAAa,uBAAuB,EAAGW,CAAA,CAC5C,EAED,OACEI,EAAAA,KAAC,KAAA,CACE,GAAGF,EACJ,IAAAT,EACA,UAAWU,EACX,gBAAe,CAAC,CAACN,EACjB,KAAK,SACL,gBAAe,CAAC,CAACH,EAEhB,SAAA,CAAA,OAAOI,GAAa,SAAWO,EAAAA,IAACC,EAAAA,UAAA,CAAW,SAAAR,EAAS,EAAeA,EACnED,GAAY,CAACI,GACZI,MAACE,EAAAA,EAAA,CAAc,KAAK,KAAK,UAAWrB,EAAG,GAAGG,CAAa,aAAa,CAAA,CAAG,CAAA,CAAA,CAAA,CAI/E,CAAC,EAEYmB,EAAiBC,GAC5BC,EAAAA,eAAiCD,CAAK,GAAKA,GAAO,OAASnB,EAE7DA,EAAY,YAAc,cCpD1B,MAAMJ,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAElBC,EAAgB,iBAaTsB,EAAUpB,EAAAA,WACrB,CAAC,CAAE,SAAAO,EAAU,GAAGc,CAAA,EAAgBnB,IAC9BY,EAAAA,IAAC,KAAA,CACE,GAAGO,EACJ,IAAAnB,EACA,UAAWP,EAAGG,EAAeuB,EAAa,SAAS,EACnD,KAAK,UAEJ,SAAAC,EAAAA,SAAS,QAAQf,CAAQ,EAAE,OAAOU,CAAa,CAAA,CAAA,CAGtD,EAGAG,EAAQ,KAAOrB,EACfqB,EAAQ,YAAc"}
@@ -0,0 +1,66 @@
1
+ import { jsxs as N, jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as a, isValidElement as $, Children as v } from "react";
3
+ import { c as n } from "./bind-CU-R61T-.mjs";
4
+ import { a as z } from "./checkmark.es-DdgIZN2R.mjs";
5
+ import { P as y } from "./paragraph-Ci50OF1u.mjs";
6
+ const u = {
7
+ "purpur-listbox": "_purpur-listbox_l0zrf_1",
8
+ "purpur-listbox-item": "_purpur-listbox-item_l0zrf_15",
9
+ "purpur-listbox-item--hovered": "_purpur-listbox-item--hovered_l0zrf_29",
10
+ "purpur-listbox-item--highlighted": "_purpur-listbox-item--highlighted_l0zrf_37",
11
+ "purpur-listbox-item--noninteractive": "_purpur-listbox-item--noninteractive_l0zrf_41",
12
+ "purpur-listbox-item--disabled": "_purpur-listbox-item--disabled_l0zrf_44",
13
+ "purpur-listbox-item__icon": "_purpur-listbox-item__icon_l0zrf_51"
14
+ }, m = n.bind(u), i = "purpur-listbox", p = a((e, t) => {
15
+ const {
16
+ disabled: r,
17
+ highlighted: d,
18
+ hovered: x,
19
+ selected: s,
20
+ children: o,
21
+ className: _,
22
+ noninteractive: b,
23
+ hideSelectedIcon: h,
24
+ ...f
25
+ } = e, g = m(`${i}-item`, _, {
26
+ [`${i}-item--highlighted`]: d,
27
+ [`${i}-item--selected`]: s,
28
+ [`${i}-item--hovered`]: x,
29
+ [`${i}-item--disabled`]: r,
30
+ [`${i}-item--noninteractive`]: b
31
+ });
32
+ return /* @__PURE__ */ N(
33
+ "li",
34
+ {
35
+ ...f,
36
+ ref: t,
37
+ className: g,
38
+ "aria-selected": !!s,
39
+ role: "option",
40
+ "aria-disabled": !!r,
41
+ children: [
42
+ typeof o == "string" ? /* @__PURE__ */ l(y, { children: o }) : o,
43
+ s && !h && /* @__PURE__ */ l(z, { size: "xs", className: m(`${i}-item__icon`) })
44
+ ]
45
+ }
46
+ );
47
+ }), L = (e) => $(e) && e?.type === p;
48
+ p.displayName = "ListBoxItem";
49
+ const I = n.bind(u), C = "purpur-listbox", c = a(
50
+ ({ children: e, ...t }, r) => /* @__PURE__ */ l(
51
+ "ul",
52
+ {
53
+ ...t,
54
+ ref: r,
55
+ className: I(C, t.className),
56
+ role: "listbox",
57
+ children: v.toArray(e).filter(L)
58
+ }
59
+ )
60
+ );
61
+ c.Item = p;
62
+ c.displayName = "ListBox";
63
+ export {
64
+ c as L
65
+ };
66
+ //# sourceMappingURL=listbox-DG4KmQP_.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listbox-DG4KmQP_.mjs","sources":["../../../components/listbox/src/listbox-item.tsx","../../../components/listbox/src/listbox.tsx"],"sourcesContent":["import React, { forwardRef, isValidElement, type ReactElement, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { IconCheckmark } from \"@purpur/icon/checkmark\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./listbox.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-listbox\";\n\nexport type ListboxItemProps = Omit<BaseProps<\"li\">, \"role\"> & {\n highlighted?: boolean;\n hovered?: boolean;\n key?: string;\n selected?: boolean;\n disabled?: boolean;\n noninteractive?: boolean;\n /** When true, hides the built-in checkmark icon while preserving `aria-selected`. */\n hideSelectedIcon?: boolean;\n};\n\nexport const ListboxItem = forwardRef<HTMLLIElement, ListboxItemProps>((props, ref) => {\n const {\n disabled,\n highlighted,\n hovered,\n selected,\n children,\n className,\n noninteractive,\n hideSelectedIcon,\n ...liProps\n } = props;\n\n const classes = cx(`${rootClassName}-item`, className, {\n [`${rootClassName}-item--highlighted`]: highlighted,\n [`${rootClassName}-item--selected`]: selected,\n [`${rootClassName}-item--hovered`]: hovered,\n [`${rootClassName}-item--disabled`]: disabled,\n [`${rootClassName}-item--noninteractive`]: noninteractive,\n });\n\n return (\n <li\n {...liProps}\n ref={ref}\n className={classes}\n aria-selected={!!selected}\n role=\"option\"\n aria-disabled={!!disabled}\n >\n {typeof children === \"string\" ? <Paragraph>{children}</Paragraph> : children}\n {selected && !hideSelectedIcon && (\n <IconCheckmark size=\"xs\" className={cx(`${rootClassName}-item__icon`)} />\n )}\n </li>\n );\n});\n\nexport const isListboxItem = (child?: ReactNode): child is ReactElement<ListboxItemProps> =>\n isValidElement<ListboxItemProps>(child) && child?.type === ListboxItem;\n\nListboxItem.displayName = \"ListBoxItem\";\n","import React, {\n Children,\n forwardRef,\n type ForwardRefExoticComponent,\n type PropsWithoutRef,\n} from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./listbox.module.scss\";\nimport { isListboxItem, ListboxItem } from \"./listbox-item\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-listbox\";\n\nexport type ListboxProps = Omit<BaseProps<\"ul\">, \"role\"> & {\n \"aria-label\": NonNullable<BaseProps<\"ul\">[\"aria-label\"]>;\n \"aria-expanded\": NonNullable<BaseProps<\"ul\">[\"aria-expanded\"]>;\n};\n\ntype ListboxStatic = {\n Item: typeof ListboxItem;\n};\n\ntype ListboxComponent = ForwardRefExoticComponent<PropsWithoutRef<ListboxProps>> & ListboxStatic;\n\nexport const Listbox = forwardRef<HTMLUListElement, ListboxProps>(\n ({ children, ...listboxProps }, ref) => (\n <ul\n {...listboxProps}\n ref={ref}\n className={cx(rootClassName, listboxProps.className)}\n role=\"listbox\"\n >\n {Children.toArray(children).filter(isListboxItem)}\n </ul>\n )\n) as ListboxComponent;\n\nexport type { ListboxItemProps } from \"./listbox-item\";\nListbox.Item = ListboxItem;\nListbox.displayName = \"ListBox\";\n"],"names":["cx","c","styles","rootClassName","ListboxItem","forwardRef","props","ref","disabled","highlighted","hovered","selected","children","className","noninteractive","hideSelectedIcon","liProps","classes","jsxs","jsx","Paragraph","IconCheckmark","isListboxItem","child","isValidElement","Listbox","listboxProps","Children"],"mappings":";;;;;;;;;;;;;GAQMA,IAAKC,EAAE,KAAKC,CAAM,GAElBC,IAAgB,kBAaTC,IAAcC,EAA4C,CAACC,GAAOC,MAAQ;AACrF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDV,GAEEW,IAAUjB,EAAG,GAAGG,CAAa,SAASU,GAAW;AAAA,IACrD,CAAC,GAAGV,CAAa,oBAAoB,GAAGM;AAAA,IACxC,CAAC,GAAGN,CAAa,iBAAiB,GAAGQ;AAAA,IACrC,CAAC,GAAGR,CAAa,gBAAgB,GAAGO;AAAA,IACpC,CAAC,GAAGP,CAAa,iBAAiB,GAAGK;AAAA,IACrC,CAAC,GAAGL,CAAa,uBAAuB,GAAGW;AAAA,EAAA,CAC5C;AAED,SACE,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,KAAAT;AAAA,MACA,WAAWU;AAAA,MACX,iBAAe,CAAC,CAACN;AAAA,MACjB,MAAK;AAAA,MACL,iBAAe,CAAC,CAACH;AAAA,MAEhB,UAAA;AAAA,QAAA,OAAOI,KAAa,WAAW,gBAAAO,EAACC,GAAA,EAAW,UAAAR,GAAS,IAAeA;AAAA,QACnED,KAAY,CAACI,KACZ,gBAAAI,EAACE,GAAA,EAAc,MAAK,MAAK,WAAWrB,EAAG,GAAGG,CAAa,aAAa,EAAA,CAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAI/E,CAAC,GAEYmB,IAAgB,CAACC,MAC5BC,EAAiCD,CAAK,KAAKA,GAAO,SAASnB;AAE7DA,EAAY,cAAc;ACpD1B,MAAMJ,IAAKC,EAAE,KAAKC,CAAM,GAElBC,IAAgB,kBAaTsB,IAAUpB;AAAA,EACrB,CAAC,EAAE,UAAAO,GAAU,GAAGc,EAAA,GAAgBnB,MAC9B,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGO;AAAA,MACJ,KAAAnB;AAAA,MACA,WAAWP,EAAGG,GAAeuB,EAAa,SAAS;AAAA,MACnD,MAAK;AAAA,MAEJ,UAAAC,EAAS,QAAQf,CAAQ,EAAE,OAAOU,CAAa;AAAA,IAAA;AAAA,EAAA;AAGtD;AAGAG,EAAQ,OAAOrB;AACfqB,EAAQ,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./listbox-BmjBtIv8.js");exports.Listbox=t.Listbox;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./listbox-COBHLRtB.js");exports.Listbox=t.Listbox;
2
2
  //# sourceMappingURL=listbox.cjs.js.map
@@ -1,4 +1,4 @@
1
- import { L as s } from "./listbox-oDeP8FvH.mjs";
1
+ import { L as s } from "./listbox-DG4KmQP_.mjs";
2
2
  export {
3
3
  s as Listbox
4
4
  };
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),d=require("./index-2cFVyGXq.js"),a=require("react"),F=require("./button-BxdChrq-.js"),L=require("./heading-drD5ugCC.js"),U=require("./close.es-VL3lKi1O.js"),V=require("./paragraph-BsI53OR0.js"),K=require("./visually-hidden-C2CKovZx.js"),k=require("./bind-DeUYJ6m9.js"),G="_fadeIn_slvdi_1",J="_fadeOut_slvdi_1",Q="_slideUp_slvdi_1",X="_slideDown_slvdi_1",Y={"purpur-modal-content":"_purpur-modal-content_slvdi_1",fadeIn:G,fadeOut:J,slideUp:Q,slideDown:X,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_slvdi_49","purpur-modal-content__close-button":"_purpur-modal-content__close-button_slvdi_65","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_slvdi_75","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_slvdi_85","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_slvdi_89","purpur-modal-content__header":"_purpur-modal-content__header_slvdi_112","purpur-modal-content__title":"_purpur-modal-content__title_slvdi_125","purpur-modal-content__description":"_purpur-modal-content__description_slvdi_128","purpur-modal-content__body":"_purpur-modal-content__body_slvdi_131","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_slvdi_139","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_slvdi_151","purpur-modal-content__notification":"_purpur-modal-content__notification_slvdi_169","purpur-modal-content--with-image":"_purpur-modal-content--with-image_slvdi_172","purpur-modal-content--overflow":"_purpur-modal-content--overflow_slvdi_172","purpur-modal-content__actions":"_purpur-modal-content__actions_slvdi_151","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_slvdi_203","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_slvdi_213"},N=n=>n.showCloseButton===!0,r=k.c.bind(Y),t="purpur-modal-content",Z=a.forwardRef(({["data-testid"]:n,actions:o,children:s,className:u,description:_,disableCloseOnClickOutside:b,hideDescription:g,image:p,stickyButtons:x=!0,title:q,notification:j=void 0,zIndex:$,onCloseAutoFocus:D,...y},O)=>{const{closeButtonAriaLabel:v,showCloseButton:E,...H}=y,[I,M]=a.useState(!1),[P,S]=a.useState(0),m=a.useRef(null),h=a.useRef(null),B=r(t,{[`${t}--with-image`]:!!p},{[`${t}--overflow`]:I},{[`${t}--sticky-footer`]:x},u),i=l=>n?`${n} ${l}`:void 0,T=l=>{b&&l.preventDefault()},c=a.useCallback(()=>{if(!m.current||!h.current)return;const l=window.getComputedStyle(m.current,null),f=parseFloat(l.getPropertyValue("height")),A=h.current.offsetHeight;M(f<A),S((m.current.offsetWidth??0)-(m.current.clientWidth??0))},[]),W=()=>{const l=h.current;if(l){const f=l.querySelector("h2");f&&setTimeout(()=>{f.focus()})}},z=l=>{b&&!E&&l.preventDefault()};return a.useEffect(()=>(window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[c]),a.useEffect(()=>{c()},[j,s,c]),e.jsxs(d.Portal,{children:[e.jsx(d.Overlay,{className:r(`${t}__overlay`),style:{zIndex:$}}),e.jsxs(d.Content,{...H,className:B,"data-testid":n,ref:O,...!_&&{"aria-describedby":void 0},onPointerDownOutside:T,onOpenAutoFocus:()=>{c(),W()},onEscapeKeyDown:z,onCloseAutoFocus:D,style:{zIndex:`calc(${$} + 1)`},children:[e.jsxs("div",{ref:m,className:r(`${t}__wrapper`),children:[N(y)&&v&&p&&e.jsx(C,{"aria-label":v,hasImage:!0,scrollbarWidth:P,"data-testid":i("close-button")}),e.jsxs("div",{ref:h,className:r(`${t}__wrapper-inner`),children:[e.jsxs("div",{className:r(`${t}__header`),children:[N(y)&&v&&!p&&e.jsx(C,{"aria-label":v,"data-testid":i("close-button")}),e.jsx(d.Title,{asChild:!0,className:r(`${t}__title`),"data-testid":i("title"),children:e.jsx(L.Heading,{tag:"h2",variant:"title-200",tabIndex:-1,children:q})})]}),p&&e.jsx("div",{className:r(`${t}__image-wrapper`),"data-testid":i("image"),children:p}),e.jsx("div",{className:r(`${t}__body`),children:e.jsxs("div",{className:r(`${t}__body-inner`),children:[_&&g&&e.jsx(K.VisuallyHidden,{asChild:!0,children:e.jsx(d.Description,{"data-testid":i("description"),children:_})}),_&&!g&&e.jsx(d.Description,{asChild:!0,className:r(`${t}__description`),"data-testid":i("description"),children:e.jsx(V.Paragraph,{variant:"paragraph-100",children:_})}),e.jsx("div",{children:s}),!x&&e.jsx(R,{actions:o,notification:j})]})})]})]}),x&&e.jsx(R,{actions:o,notification:j})]})]})}),C=({["aria-label"]:n,hasImage:o,scrollbarWidth:s,["data-testid"]:u})=>e.jsx(d.Close,{asChild:!0,children:e.jsx(F.Button,{variant:o?"primary":"tertiary-purple",negative:o,size:"sm",iconOnly:!0,"aria-label":n,className:r(`${t}__close-button`),style:{right:`calc(var(--purpur-spacing-100) + ${s||0}px)`},"data-testid":u,children:e.jsx(U.r,{})})}),R=({actions:n,notification:o})=>{const s=a.useRef(null);return a.useEffect(()=>{o&&s?.current?.scrollIntoView?.(!1)},[o]),n?e.jsxs("div",{className:r(`${t}__actions`),children:[e.jsx("div",{className:r(`${t}__actions-buttons`),"data-testid":"modal actions",children:n}),o&&e.jsx("div",{className:r(`${t}__notification`),ref:s,children:o}),e.jsx("span",{className:r(`${t}__actions-separator`)})]}):null},ee=a.forwardRef(({children:n,...o},s)=>e.jsx(d.Trigger,{asChild:!0,ref:s,...o,children:n})),w=({["data-testid"]:n,children:o,open:s,onOpenChange:u})=>e.jsx(d.Root,{open:s,onOpenChange:u,"data-testid":n,children:o});w.Trigger=ee;w.Content=Z;w.displayName="Modal";exports.Modal=w;
2
- //# sourceMappingURL=modal-CQiJ98iI.js.map
1
+ "use strict";const e=require("react/jsx-runtime"),d=require("./index-2cFVyGXq.js"),a=require("react"),F=require("./button-Dqxdc3nC.js"),L=require("./heading-drD5ugCC.js"),U=require("./close.es-VL3lKi1O.js"),V=require("./paragraph-BsI53OR0.js"),K=require("./visually-hidden-C2CKovZx.js"),k=require("./bind-DeUYJ6m9.js"),G="_fadeIn_slvdi_1",J="_fadeOut_slvdi_1",Q="_slideUp_slvdi_1",X="_slideDown_slvdi_1",Y={"purpur-modal-content":"_purpur-modal-content_slvdi_1",fadeIn:G,fadeOut:J,slideUp:Q,slideDown:X,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_slvdi_49","purpur-modal-content__close-button":"_purpur-modal-content__close-button_slvdi_65","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_slvdi_75","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_slvdi_85","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_slvdi_89","purpur-modal-content__header":"_purpur-modal-content__header_slvdi_112","purpur-modal-content__title":"_purpur-modal-content__title_slvdi_125","purpur-modal-content__description":"_purpur-modal-content__description_slvdi_128","purpur-modal-content__body":"_purpur-modal-content__body_slvdi_131","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_slvdi_139","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_slvdi_151","purpur-modal-content__notification":"_purpur-modal-content__notification_slvdi_169","purpur-modal-content--with-image":"_purpur-modal-content--with-image_slvdi_172","purpur-modal-content--overflow":"_purpur-modal-content--overflow_slvdi_172","purpur-modal-content__actions":"_purpur-modal-content__actions_slvdi_151","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_slvdi_203","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_slvdi_213"},N=n=>n.showCloseButton===!0,r=k.c.bind(Y),t="purpur-modal-content",Z=a.forwardRef(({["data-testid"]:n,actions:o,children:s,className:u,description:_,disableCloseOnClickOutside:b,hideDescription:g,image:p,stickyButtons:x=!0,title:q,notification:j=void 0,zIndex:$,onCloseAutoFocus:D,...y},O)=>{const{closeButtonAriaLabel:v,showCloseButton:E,...H}=y,[I,M]=a.useState(!1),[P,S]=a.useState(0),m=a.useRef(null),h=a.useRef(null),B=r(t,{[`${t}--with-image`]:!!p},{[`${t}--overflow`]:I},{[`${t}--sticky-footer`]:x},u),i=l=>n?`${n} ${l}`:void 0,T=l=>{b&&l.preventDefault()},c=a.useCallback(()=>{if(!m.current||!h.current)return;const l=window.getComputedStyle(m.current,null),f=parseFloat(l.getPropertyValue("height")),A=h.current.offsetHeight;M(f<A),S((m.current.offsetWidth??0)-(m.current.clientWidth??0))},[]),W=()=>{const l=h.current;if(l){const f=l.querySelector("h2");f&&setTimeout(()=>{f.focus()})}},z=l=>{b&&!E&&l.preventDefault()};return a.useEffect(()=>(window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[c]),a.useEffect(()=>{c()},[j,s,c]),e.jsxs(d.Portal,{children:[e.jsx(d.Overlay,{className:r(`${t}__overlay`),style:{zIndex:$}}),e.jsxs(d.Content,{...H,className:B,"data-testid":n,ref:O,...!_&&{"aria-describedby":void 0},onPointerDownOutside:T,onOpenAutoFocus:()=>{c(),W()},onEscapeKeyDown:z,onCloseAutoFocus:D,style:{zIndex:`calc(${$} + 1)`},children:[e.jsxs("div",{ref:m,className:r(`${t}__wrapper`),children:[N(y)&&v&&p&&e.jsx(C,{"aria-label":v,hasImage:!0,scrollbarWidth:P,"data-testid":i("close-button")}),e.jsxs("div",{ref:h,className:r(`${t}__wrapper-inner`),children:[e.jsxs("div",{className:r(`${t}__header`),children:[N(y)&&v&&!p&&e.jsx(C,{"aria-label":v,"data-testid":i("close-button")}),e.jsx(d.Title,{asChild:!0,className:r(`${t}__title`),"data-testid":i("title"),children:e.jsx(L.Heading,{tag:"h2",variant:"title-200",tabIndex:-1,children:q})})]}),p&&e.jsx("div",{className:r(`${t}__image-wrapper`),"data-testid":i("image"),children:p}),e.jsx("div",{className:r(`${t}__body`),children:e.jsxs("div",{className:r(`${t}__body-inner`),children:[_&&g&&e.jsx(K.VisuallyHidden,{asChild:!0,children:e.jsx(d.Description,{"data-testid":i("description"),children:_})}),_&&!g&&e.jsx(d.Description,{asChild:!0,className:r(`${t}__description`),"data-testid":i("description"),children:e.jsx(V.Paragraph,{variant:"paragraph-100",children:_})}),e.jsx("div",{children:s}),!x&&e.jsx(R,{actions:o,notification:j})]})})]})]}),x&&e.jsx(R,{actions:o,notification:j})]})]})}),C=({["aria-label"]:n,hasImage:o,scrollbarWidth:s,["data-testid"]:u})=>e.jsx(d.Close,{asChild:!0,children:e.jsx(F.Button,{variant:o?"primary":"tertiary-purple",negative:o,size:"sm",iconOnly:!0,"aria-label":n,className:r(`${t}__close-button`),style:{right:`calc(var(--purpur-spacing-100) + ${s||0}px)`},"data-testid":u,children:e.jsx(U.r,{})})}),R=({actions:n,notification:o})=>{const s=a.useRef(null);return a.useEffect(()=>{o&&s?.current?.scrollIntoView?.(!1)},[o]),n?e.jsxs("div",{className:r(`${t}__actions`),children:[e.jsx("div",{className:r(`${t}__actions-buttons`),"data-testid":"modal actions",children:n}),o&&e.jsx("div",{className:r(`${t}__notification`),ref:s,children:o}),e.jsx("span",{className:r(`${t}__actions-separator`)})]}):null},ee=a.forwardRef(({children:n,...o},s)=>e.jsx(d.Trigger,{asChild:!0,ref:s,...o,children:n})),w=({["data-testid"]:n,children:o,open:s,onOpenChange:u})=>e.jsx(d.Root,{open:s,onOpenChange:u,"data-testid":n,children:o});w.Trigger=ee;w.Content=Z;w.displayName="Modal";exports.Modal=w;
2
+ //# sourceMappingURL=modal-DMeRO1wE.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal-CQiJ98iI.js","sources":["../../../components/modal/src/modal-content.tsx","../../../components/modal/src/modal-trigger.tsx","../../../components/modal/src/modal.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading } from \"@purpur/heading\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport {\n Close as RadixClose,\n Content as RadixContent,\n Description as RadixDescription,\n Overlay as RadixOverlay,\n Portal as RadixPortal,\n Title as RadixTitle,\n} from \"@radix-ui/react-dialog\";\nimport c from \"classnames/bind\";\n\nimport \"@purpur/notification/styles\";\nimport styles from \"./modal-content.module.scss\";\n\nexport type DefaultProps = Omit<BaseProps, \"children\"> & {\n /**\n * One or several CTA links or buttons\n * */\n actions?: ReactNode;\n children: ReactNode;\n /**\n * An optional accessible description to be announced when the dialog is opened.\n * */\n description?: string;\n /**\n * Prevents the modal from closing on click outside if set to `true`.\n * */\n disableCloseOnClickOutside?: boolean;\n /**\n * Visually hides the description if set to `true`.\n * */\n hideDescription?: boolean;\n /**\n * An optional image to be displayed at the top of the modal.\n * */\n image?: ReactNode;\n /**\n * Provide a Purpur Notification which will render beneath the modal buttons, otherwise leave it undefined.\n * */\n notification?: ReactNode;\n /**\n * Determines whether the button group should be fixed at the bottom or scroll with the content.\n * */\n stickyButtons?: boolean;\n /**\n * An accessible title to be announced when the dialog is opened.\n * */\n title: string;\n /**\n * z-index of the modal\n * */\n zIndex?: number;\n /**\n * Event handler called when focus moves to the trigger after closing.\n * */\n onCloseAutoFocus?: (e: Event) => void;\n};\n\ntype NoCloseButtonProps = {\n /**\n * An accessible label for the close button.\n * */\n closeButtonAriaLabel?: never;\n /**\n * Shows the close button if set to `true`. Must be used in conjunction with `closeButtonAriaLabel`.\n * */\n showCloseButton?: false;\n};\n\ntype CloseButtonProps = {\n /**\n * An accessible label for the close button.\n * */\n closeButtonAriaLabel: string;\n /**\n * Shows the close button if set to `true`. Must be used in conjunction with `closeButtonAriaLabel`.\n * */\n showCloseButton: true;\n};\n\nexport type ModalContentProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nconst hasCloseButtonProps = (\n props: CloseButtonProps | NoCloseButtonProps\n): props is CloseButtonProps => (props as CloseButtonProps).showCloseButton === true;\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-modal-content\";\n\nexport const ModalContent = forwardRef<HTMLDivElement, ModalContentProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n actions,\n children,\n className,\n description,\n disableCloseOnClickOutside,\n hideDescription,\n image,\n stickyButtons = true,\n title,\n notification = undefined,\n zIndex,\n onCloseAutoFocus,\n ...props\n },\n ref\n ) => {\n const { closeButtonAriaLabel, showCloseButton, ...rest } = props;\n const [contentOverflow, setContentOverflow] = useState(false);\n const [scrollbarWidth, setScrollbarWidth] = useState(0);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const wrapperInnerRef = useRef<HTMLDivElement>(null);\n\n const classes = cx(\n rootClassName,\n { [`${rootClassName}--with-image`]: !!image },\n { [`${rootClassName}--overflow`]: contentOverflow },\n { [`${rootClassName}--sticky-footer`]: stickyButtons },\n className\n );\n\n const getTestId = (id: string) => (dataTestId ? `${dataTestId} ${id}` : undefined);\n\n const handlePointerDownOutside = (event: CustomEvent<{ originalEvent: PointerEvent }>) => {\n if (disableCloseOnClickOutside) {\n event.preventDefault();\n }\n };\n\n const handleContentOverflow = useCallback(() => {\n if (!wrapperRef.current || !wrapperInnerRef.current) {\n return;\n }\n\n const computedStyle = window.getComputedStyle(wrapperRef.current, null);\n const wrapperHeight = parseFloat(computedStyle.getPropertyValue(\"height\"));\n const innerHeight = wrapperInnerRef.current.offsetHeight;\n\n setContentOverflow(wrapperHeight < innerHeight);\n\n setScrollbarWidth(\n (wrapperRef.current.offsetWidth ?? 0) - (wrapperRef.current.clientWidth ?? 0)\n );\n }, []);\n\n const handleInitialFocus = () => {\n const frame = wrapperInnerRef.current;\n if (frame) {\n const heading = frame.querySelector(\"h2\");\n\n heading &&\n setTimeout(() => {\n heading.focus();\n });\n }\n };\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (disableCloseOnClickOutside && !showCloseButton) {\n event.preventDefault();\n }\n };\n\n useEffect(() => {\n window.addEventListener(\"resize\", handleContentOverflow);\n\n return () => {\n window.removeEventListener(\"resize\", handleContentOverflow);\n };\n }, [handleContentOverflow]);\n\n useEffect(() => {\n handleContentOverflow();\n }, [notification, children, handleContentOverflow]);\n\n return (\n <RadixPortal>\n <RadixOverlay className={cx(`${rootClassName}__overlay`)} style={{ zIndex }} />\n <RadixContent\n {...rest}\n className={classes}\n data-testid={dataTestId}\n ref={ref}\n {...(!description && { [\"aria-describedby\"]: undefined })}\n onPointerDownOutside={handlePointerDownOutside}\n onOpenAutoFocus={() => {\n handleContentOverflow();\n handleInitialFocus();\n }}\n onEscapeKeyDown={handleEscapeKeyDown}\n onCloseAutoFocus={onCloseAutoFocus}\n style={{ zIndex: `calc(${zIndex} + 1)` }}\n >\n <div ref={wrapperRef} className={cx(`${rootClassName}__wrapper`)}>\n {hasCloseButtonProps(props) && closeButtonAriaLabel && image && (\n <CloseButton\n aria-label={closeButtonAriaLabel}\n hasImage\n scrollbarWidth={scrollbarWidth}\n data-testid={getTestId(\"close-button\")}\n />\n )}\n <div ref={wrapperInnerRef} className={cx(`${rootClassName}__wrapper-inner`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {hasCloseButtonProps(props) && closeButtonAriaLabel && !image && (\n <CloseButton\n aria-label={closeButtonAriaLabel}\n data-testid={getTestId(\"close-button\")}\n />\n )}\n <RadixTitle\n asChild\n className={cx(`${rootClassName}__title`)}\n data-testid={getTestId(\"title\")}\n >\n <Heading tag=\"h2\" variant=\"title-200\" tabIndex={-1}>\n {title}\n </Heading>\n </RadixTitle>\n </div>\n {image && (\n <div\n className={cx(`${rootClassName}__image-wrapper`)}\n data-testid={getTestId(\"image\")}\n >\n {image}\n </div>\n )}\n <div className={cx(`${rootClassName}__body`)}>\n <div className={cx(`${rootClassName}__body-inner`)}>\n {description && hideDescription && (\n <VisuallyHidden asChild>\n <RadixDescription data-testid={getTestId(\"description\")}>\n {description}\n </RadixDescription>\n </VisuallyHidden>\n )}\n {description && !hideDescription && (\n <RadixDescription\n asChild\n className={cx(`${rootClassName}__description`)}\n data-testid={getTestId(\"description\")}\n >\n <Paragraph variant=\"paragraph-100\">{description}</Paragraph>\n </RadixDescription>\n )}\n <div>{children}</div>\n {!stickyButtons && <ModalActions actions={actions} notification={notification} />}\n </div>\n </div>\n </div>\n </div>\n\n {stickyButtons && <ModalActions actions={actions} notification={notification} />}\n </RadixContent>\n </RadixPortal>\n );\n }\n);\n\nconst CloseButton = ({\n [\"aria-label\"]: ariaLabel,\n hasImage,\n scrollbarWidth,\n [\"data-testid\"]: dataTestId,\n}: {\n [\"aria-label\"]: string;\n hasImage?: boolean;\n scrollbarWidth?: number;\n [\"data-testid\"]?: string;\n}) => (\n <RadixClose asChild>\n <Button\n variant={hasImage ? \"primary\" : \"tertiary-purple\"}\n negative={hasImage}\n size=\"sm\"\n iconOnly\n aria-label={ariaLabel}\n className={cx(`${rootClassName}__close-button`)}\n style={{ right: `calc(var(--purpur-spacing-100) + ${scrollbarWidth || 0}px)` }}\n data-testid={dataTestId}\n >\n <IconClose />\n </Button>\n </RadixClose>\n);\n\nexport const MAX_NUMBER_OF_ACTIONS = 3;\n\nexport const ModalActions = ({\n actions,\n notification,\n}: Pick<ModalContentProps, \"actions\" | \"notification\">) => {\n const notificationRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (notification) {\n notificationRef?.current?.scrollIntoView?.(false);\n }\n }, [notification]);\n\n return actions ? (\n <div className={cx(`${rootClassName}__actions`)}>\n <div className={cx(`${rootClassName}__actions-buttons`)} data-testid=\"modal actions\">\n {actions}\n </div>\n {notification && (\n <div className={cx(`${rootClassName}__notification`)} ref={notificationRef}>\n {notification}\n </div>\n )}\n <span className={cx(`${rootClassName}__actions-separator`)} />\n </div>\n ) : null;\n};\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Trigger as RadixTrigger } from \"@radix-ui/react-dialog\";\n\nexport type ModalTriggerProps = Omit<BaseProps<\"button\">, \"children\"> & {\n children: ReactNode;\n};\n\nexport const ModalTrigger = forwardRef<HTMLButtonElement, ModalTriggerProps>(\n ({ children, ...props }, ref) => {\n return (\n <RadixTrigger asChild ref={ref} {...props}>\n {children}\n </RadixTrigger>\n );\n }\n);\n","import React, { type ReactNode } from \"react\";\nimport { Root as RadixRoot } from \"@radix-ui/react-dialog\";\n\nimport { ModalContent } from \"./modal-content\";\nimport { ModalTrigger } from \"./modal-trigger\";\n\nexport type ModalProps = {\n [\"data-testid\"]?: string;\n children: ReactNode;\n /**\n * Event handler called when the open state of the dialog changes.\n * */\n onOpenChange?: (value: boolean) => void;\n /**\n * The controlled open state of the dialog. Must be used in conjunction with `onOpenChange`.\n * */\n open?: boolean;\n};\n\nexport const Modal = ({\n [\"data-testid\"]: dataTestId,\n children,\n open,\n onOpenChange,\n}: ModalProps) => (\n <RadixRoot open={open} onOpenChange={onOpenChange} data-testid={dataTestId}>\n {children}\n </RadixRoot>\n);\n\nModal.Trigger = ModalTrigger;\nModal.Content = ModalContent;\n\nModal.displayName = \"Modal\";\n"],"names":["hasCloseButtonProps","props","cx","c","styles","rootClassName","ModalContent","forwardRef","dataTestId","actions","children","className","description","disableCloseOnClickOutside","hideDescription","image","stickyButtons","title","notification","zIndex","onCloseAutoFocus","ref","closeButtonAriaLabel","showCloseButton","rest","contentOverflow","setContentOverflow","useState","scrollbarWidth","setScrollbarWidth","wrapperRef","useRef","wrapperInnerRef","classes","getTestId","id","handlePointerDownOutside","event","handleContentOverflow","useCallback","computedStyle","wrapperHeight","innerHeight","handleInitialFocus","frame","heading","handleEscapeKeyDown","useEffect","RadixPortal","jsx","RadixOverlay","jsxs","RadixContent","CloseButton","RadixTitle","Heading","VisuallyHidden","RadixDescription","Paragraph","ModalActions","ariaLabel","hasImage","RadixClose","Button","IconClose","notificationRef","ModalTrigger","RadixTrigger","Modal","open","onOpenChange","RadixRoot"],"mappings":"o1DAwFMA,EACJC,GAC+BA,EAA2B,kBAAoB,GAE1EC,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAClBC,EAAgB,uBAETC,EAAeC,EAAAA,WAC1B,CACE,CACE,CAAC,eAAgBC,EACjB,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,YAAAC,EACA,2BAAAC,EACA,gBAAAC,EACA,MAAAC,EACA,cAAAC,EAAgB,GAChB,MAAAC,EACA,aAAAC,EAAe,OACf,OAAAC,EACA,iBAAAC,EACA,GAAGnB,CAAA,EAELoB,IACG,CACH,KAAM,CAAE,qBAAAC,EAAsB,gBAAAC,EAAiB,GAAGC,GAASvB,EACrD,CAACwB,EAAiBC,CAAkB,EAAIC,EAAAA,SAAS,EAAK,EACtD,CAACC,EAAgBC,CAAiB,EAAIF,EAAAA,SAAS,CAAC,EAChDG,EAAaC,EAAAA,OAAuB,IAAI,EACxCC,EAAkBD,EAAAA,OAAuB,IAAI,EAE7CE,EAAU/B,EACdG,EACA,C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,EAAkBlC,EAAAA,OAAuB,IAAI,EAEnDgB,OAAAA,EAAAA,UAAU,IAAM,CACV7B,GACF+C,GAAiB,SAAS,iBAAiB,EAAK,CAEpD,EAAG,CAAC/C,CAAY,CAAC,EAEVT,SACJ,MAAA,CAAI,UAAWP,EAAG,GAAGG,CAAa,WAAW,EAC5C,SAAA,CAAA4C,EAAAA,IAAC,MAAA,CAAI,UAAW/C,EAAG,GAAGG,CAAa,mBAAmB,EAAG,cAAY,gBAClE,SAAAI,CAAA,CACH,EACCS,GACC+B,EAAAA,IAAC,MAAA,CAAI,UAAW/C,EAAG,GAAGG,CAAa,gBAAgB,EAAG,IAAK4D,EACxD,SAAA/C,CAAA,CACH,QAED,OAAA,CAAK,UAAWhB,EAAG,GAAGG,CAAa,qBAAqB,CAAA,CAAG,CAAA,CAAA,CAC9D,EACE,IACN,EC1Ta6D,GAAe3D,EAAAA,WAC1B,CAAC,CAAE,SAAAG,EAAU,GAAGT,CAAA,EAASoB,UAEpB8C,EAAAA,QAAA,CAAa,QAAO,GAAC,IAAA9C,EAAW,GAAGpB,EACjC,SAAAS,EACH,CAGN,ECGa0D,EAAQ,CAAC,CACpB,CAAC,eAAgB5D,EACjB,SAAAE,EACA,KAAA2D,EACA,aAAAC,CACF,UACGC,EAAAA,KAAA,CAAU,KAAAF,EAAY,aAAAC,EAA4B,cAAa9D,EAC7D,SAAAE,CAAA,CACH,EAGF0D,EAAM,QAAUF,GAChBE,EAAM,QAAU9D,EAEhB8D,EAAM,YAAc"}
1
+ {"version":3,"file":"modal-DMeRO1wE.js","sources":["../../../components/modal/src/modal-content.tsx","../../../components/modal/src/modal-trigger.tsx","../../../components/modal/src/modal.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading } from \"@purpur/heading\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport {\n Close as RadixClose,\n Content as RadixContent,\n Description as RadixDescription,\n Overlay as RadixOverlay,\n Portal as RadixPortal,\n Title as RadixTitle,\n} from \"@radix-ui/react-dialog\";\nimport c from \"classnames/bind\";\n\nimport \"@purpur/notification/styles\";\nimport styles from \"./modal-content.module.scss\";\n\nexport type DefaultProps = Omit<BaseProps, \"children\"> & {\n /**\n * One or several CTA links or buttons\n * */\n actions?: ReactNode;\n children: ReactNode;\n /**\n * An optional accessible description to be announced when the dialog is opened.\n * */\n description?: string;\n /**\n * Prevents the modal from closing on click outside if set to `true`.\n * */\n disableCloseOnClickOutside?: boolean;\n /**\n * Visually hides the description if set to `true`.\n * */\n hideDescription?: boolean;\n /**\n * An optional image to be displayed at the top of the modal.\n * */\n image?: ReactNode;\n /**\n * Provide a Purpur Notification which will render beneath the modal buttons, otherwise leave it undefined.\n * */\n notification?: ReactNode;\n /**\n * Determines whether the button group should be fixed at the bottom or scroll with the content.\n * */\n stickyButtons?: boolean;\n /**\n * An accessible title to be announced when the dialog is opened.\n * */\n title: string;\n /**\n * z-index of the modal\n * */\n zIndex?: number;\n /**\n * Event handler called when focus moves to the trigger after closing.\n * */\n onCloseAutoFocus?: (e: Event) => void;\n};\n\ntype NoCloseButtonProps = {\n /**\n * An accessible label for the close button.\n * */\n closeButtonAriaLabel?: never;\n /**\n * Shows the close button if set to `true`. Must be used in conjunction with `closeButtonAriaLabel`.\n * */\n showCloseButton?: false;\n};\n\ntype CloseButtonProps = {\n /**\n * An accessible label for the close button.\n * */\n closeButtonAriaLabel: string;\n /**\n * Shows the close button if set to `true`. Must be used in conjunction with `closeButtonAriaLabel`.\n * */\n showCloseButton: true;\n};\n\nexport type ModalContentProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nconst hasCloseButtonProps = (\n props: CloseButtonProps | NoCloseButtonProps\n): props is CloseButtonProps => (props as CloseButtonProps).showCloseButton === true;\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-modal-content\";\n\nexport const ModalContent = forwardRef<HTMLDivElement, ModalContentProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n actions,\n children,\n className,\n description,\n disableCloseOnClickOutside,\n hideDescription,\n image,\n stickyButtons = true,\n title,\n notification = undefined,\n zIndex,\n onCloseAutoFocus,\n ...props\n },\n ref\n ) => {\n const { closeButtonAriaLabel, showCloseButton, ...rest } = props;\n const [contentOverflow, setContentOverflow] = useState(false);\n const [scrollbarWidth, setScrollbarWidth] = useState(0);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const wrapperInnerRef = useRef<HTMLDivElement>(null);\n\n const classes = cx(\n rootClassName,\n { [`${rootClassName}--with-image`]: !!image },\n { [`${rootClassName}--overflow`]: contentOverflow },\n { [`${rootClassName}--sticky-footer`]: stickyButtons },\n className\n );\n\n const getTestId = (id: string) => (dataTestId ? `${dataTestId} ${id}` : undefined);\n\n const handlePointerDownOutside = (event: CustomEvent<{ originalEvent: PointerEvent }>) => {\n if (disableCloseOnClickOutside) {\n event.preventDefault();\n }\n };\n\n const handleContentOverflow = useCallback(() => {\n if (!wrapperRef.current || !wrapperInnerRef.current) {\n return;\n }\n\n const computedStyle = window.getComputedStyle(wrapperRef.current, null);\n const wrapperHeight = parseFloat(computedStyle.getPropertyValue(\"height\"));\n const innerHeight = wrapperInnerRef.current.offsetHeight;\n\n setContentOverflow(wrapperHeight < innerHeight);\n\n setScrollbarWidth(\n (wrapperRef.current.offsetWidth ?? 0) - (wrapperRef.current.clientWidth ?? 0)\n );\n }, []);\n\n const handleInitialFocus = () => {\n const frame = wrapperInnerRef.current;\n if (frame) {\n const heading = frame.querySelector(\"h2\");\n\n heading &&\n setTimeout(() => {\n heading.focus();\n });\n }\n };\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (disableCloseOnClickOutside && !showCloseButton) {\n event.preventDefault();\n }\n };\n\n useEffect(() => {\n window.addEventListener(\"resize\", handleContentOverflow);\n\n return () => {\n window.removeEventListener(\"resize\", handleContentOverflow);\n };\n }, [handleContentOverflow]);\n\n useEffect(() => {\n handleContentOverflow();\n }, [notification, children, handleContentOverflow]);\n\n return (\n <RadixPortal>\n <RadixOverlay className={cx(`${rootClassName}__overlay`)} style={{ zIndex }} />\n <RadixContent\n {...rest}\n className={classes}\n data-testid={dataTestId}\n ref={ref}\n {...(!description && { [\"aria-describedby\"]: undefined })}\n onPointerDownOutside={handlePointerDownOutside}\n onOpenAutoFocus={() => {\n handleContentOverflow();\n handleInitialFocus();\n }}\n onEscapeKeyDown={handleEscapeKeyDown}\n onCloseAutoFocus={onCloseAutoFocus}\n style={{ zIndex: `calc(${zIndex} + 1)` }}\n >\n <div ref={wrapperRef} className={cx(`${rootClassName}__wrapper`)}>\n {hasCloseButtonProps(props) && closeButtonAriaLabel && image && (\n <CloseButton\n aria-label={closeButtonAriaLabel}\n hasImage\n scrollbarWidth={scrollbarWidth}\n data-testid={getTestId(\"close-button\")}\n />\n )}\n <div ref={wrapperInnerRef} className={cx(`${rootClassName}__wrapper-inner`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {hasCloseButtonProps(props) && closeButtonAriaLabel && !image && (\n <CloseButton\n aria-label={closeButtonAriaLabel}\n data-testid={getTestId(\"close-button\")}\n />\n )}\n <RadixTitle\n asChild\n className={cx(`${rootClassName}__title`)}\n data-testid={getTestId(\"title\")}\n >\n <Heading tag=\"h2\" variant=\"title-200\" tabIndex={-1}>\n {title}\n </Heading>\n </RadixTitle>\n </div>\n {image && (\n <div\n className={cx(`${rootClassName}__image-wrapper`)}\n data-testid={getTestId(\"image\")}\n >\n {image}\n </div>\n )}\n <div className={cx(`${rootClassName}__body`)}>\n <div className={cx(`${rootClassName}__body-inner`)}>\n {description && hideDescription && (\n <VisuallyHidden asChild>\n <RadixDescription data-testid={getTestId(\"description\")}>\n {description}\n </RadixDescription>\n </VisuallyHidden>\n )}\n {description && !hideDescription && (\n <RadixDescription\n asChild\n className={cx(`${rootClassName}__description`)}\n data-testid={getTestId(\"description\")}\n >\n <Paragraph variant=\"paragraph-100\">{description}</Paragraph>\n </RadixDescription>\n )}\n <div>{children}</div>\n {!stickyButtons && <ModalActions actions={actions} notification={notification} />}\n </div>\n </div>\n </div>\n </div>\n\n {stickyButtons && <ModalActions actions={actions} notification={notification} />}\n </RadixContent>\n </RadixPortal>\n );\n }\n);\n\nconst CloseButton = ({\n [\"aria-label\"]: ariaLabel,\n hasImage,\n scrollbarWidth,\n [\"data-testid\"]: dataTestId,\n}: {\n [\"aria-label\"]: string;\n hasImage?: boolean;\n scrollbarWidth?: number;\n [\"data-testid\"]?: string;\n}) => (\n <RadixClose asChild>\n <Button\n variant={hasImage ? \"primary\" : \"tertiary-purple\"}\n negative={hasImage}\n size=\"sm\"\n iconOnly\n aria-label={ariaLabel}\n className={cx(`${rootClassName}__close-button`)}\n style={{ right: `calc(var(--purpur-spacing-100) + ${scrollbarWidth || 0}px)` }}\n data-testid={dataTestId}\n >\n <IconClose />\n </Button>\n </RadixClose>\n);\n\nexport const MAX_NUMBER_OF_ACTIONS = 3;\n\nexport const ModalActions = ({\n actions,\n notification,\n}: Pick<ModalContentProps, \"actions\" | \"notification\">) => {\n const notificationRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (notification) {\n notificationRef?.current?.scrollIntoView?.(false);\n }\n }, [notification]);\n\n return actions ? (\n <div className={cx(`${rootClassName}__actions`)}>\n <div className={cx(`${rootClassName}__actions-buttons`)} data-testid=\"modal actions\">\n {actions}\n </div>\n {notification && (\n <div className={cx(`${rootClassName}__notification`)} ref={notificationRef}>\n {notification}\n </div>\n )}\n <span className={cx(`${rootClassName}__actions-separator`)} />\n </div>\n ) : null;\n};\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Trigger as RadixTrigger } from \"@radix-ui/react-dialog\";\n\nexport type ModalTriggerProps = Omit<BaseProps<\"button\">, \"children\"> & {\n children: ReactNode;\n};\n\nexport const ModalTrigger = forwardRef<HTMLButtonElement, ModalTriggerProps>(\n ({ children, ...props }, ref) => {\n return (\n <RadixTrigger asChild ref={ref} {...props}>\n {children}\n </RadixTrigger>\n );\n }\n);\n","import React, { type ReactNode } from \"react\";\nimport { Root as RadixRoot } from \"@radix-ui/react-dialog\";\n\nimport { ModalContent } from \"./modal-content\";\nimport { ModalTrigger } from \"./modal-trigger\";\n\nexport type ModalProps = {\n [\"data-testid\"]?: string;\n children: ReactNode;\n /**\n * Event handler called when the open state of the dialog changes.\n * */\n onOpenChange?: (value: boolean) => void;\n /**\n * The controlled open state of the dialog. Must be used in conjunction with `onOpenChange`.\n * */\n open?: boolean;\n};\n\nexport const Modal = ({\n [\"data-testid\"]: dataTestId,\n children,\n open,\n onOpenChange,\n}: ModalProps) => (\n <RadixRoot open={open} onOpenChange={onOpenChange} data-testid={dataTestId}>\n {children}\n </RadixRoot>\n);\n\nModal.Trigger = ModalTrigger;\nModal.Content = ModalContent;\n\nModal.displayName = \"Modal\";\n"],"names":["hasCloseButtonProps","props","cx","c","styles","rootClassName","ModalContent","forwardRef","dataTestId","actions","children","className","description","disableCloseOnClickOutside","hideDescription","image","stickyButtons","title","notification","zIndex","onCloseAutoFocus","ref","closeButtonAriaLabel","showCloseButton","rest","contentOverflow","setContentOverflow","useState","scrollbarWidth","setScrollbarWidth","wrapperRef","useRef","wrapperInnerRef","classes","getTestId","id","handlePointerDownOutside","event","handleContentOverflow","useCallback","computedStyle","wrapperHeight","innerHeight","handleInitialFocus","frame","heading","handleEscapeKeyDown","useEffect","RadixPortal","jsx","RadixOverlay","jsxs","RadixContent","CloseButton","RadixTitle","Heading","VisuallyHidden","RadixDescription","Paragraph","ModalActions","ariaLabel","hasImage","RadixClose","Button","IconClose","notificationRef","ModalTrigger","RadixTrigger","Modal","open","onOpenChange","RadixRoot"],"mappings":"o1DAwFMA,EACJC,GAC+BA,EAA2B,kBAAoB,GAE1EC,EAAKC,EAAAA,EAAE,KAAKC,CAAM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ECGa0D,EAAQ,CAAC,CACpB,CAAC,eAAgB5D,EACjB,SAAAE,EACA,KAAA2D,EACA,aAAAC,CACF,UACGC,EAAAA,KAAA,CAAU,KAAAF,EAAY,aAAAC,EAA4B,cAAa9D,EAC7D,SAAAE,CAAA,CACH,EAGF0D,EAAM,QAAUF,GAChBE,EAAM,QAAU9D,EAEhB8D,EAAM,YAAc"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
2
  import { P as k, O as q, C as G, T as J, D as O, a as Q, b as X, R as Y } from "./index-CKCTy3ZL.mjs";
3
3
  import { forwardRef as I, useState as P, useRef as y, useCallback as Z, useEffect as g } from "react";
4
- import { b as tt } from "./button-D-BBdNhd.mjs";
4
+ import { b as tt } from "./button-Cv7NlYbv.mjs";
5
5
  import { H as et } from "./heading-xwBuT_-9.mjs";
6
6
  import { r as rt } from "./close.es-BPmk2wkU.mjs";
7
7
  import { P as ot } from "./paragraph-Ci50OF1u.mjs";
@@ -198,4 +198,4 @@ $.displayName = "Modal";
198
198
  export {
199
199
  $ as M
200
200
  };
201
- //# sourceMappingURL=modal-B1eJu9HN.mjs.map
201
+ //# sourceMappingURL=modal-fTWvPEPW.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal-B1eJu9HN.mjs","sources":["../../../components/modal/src/modal-content.tsx","../../../components/modal/src/modal-trigger.tsx","../../../components/modal/src/modal.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading } from \"@purpur/heading\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport {\n Close as RadixClose,\n Content as RadixContent,\n Description as RadixDescription,\n Overlay as RadixOverlay,\n Portal as RadixPortal,\n Title as RadixTitle,\n} from \"@radix-ui/react-dialog\";\nimport c from \"classnames/bind\";\n\nimport \"@purpur/notification/styles\";\nimport styles from \"./modal-content.module.scss\";\n\nexport type DefaultProps = Omit<BaseProps, \"children\"> & {\n /**\n * One or several CTA links or buttons\n * */\n actions?: ReactNode;\n children: ReactNode;\n /**\n * An optional accessible description to be announced when the dialog is opened.\n * */\n description?: string;\n /**\n * Prevents the modal from closing on click outside if set to `true`.\n * */\n disableCloseOnClickOutside?: boolean;\n /**\n * Visually hides the description if set to `true`.\n * */\n hideDescription?: boolean;\n /**\n * An optional image to be displayed at the top of the modal.\n * */\n image?: ReactNode;\n /**\n * Provide a Purpur Notification which will render beneath the modal buttons, otherwise leave it undefined.\n * */\n notification?: ReactNode;\n /**\n * Determines whether the button group should be fixed at the bottom or scroll with the content.\n * */\n stickyButtons?: boolean;\n /**\n * An accessible title to be announced when the dialog is opened.\n * */\n title: string;\n /**\n * z-index of the modal\n * */\n zIndex?: number;\n /**\n * Event handler called when focus moves to the trigger after closing.\n * */\n onCloseAutoFocus?: (e: Event) => void;\n};\n\ntype NoCloseButtonProps = {\n /**\n * An accessible label for the close button.\n * */\n closeButtonAriaLabel?: never;\n /**\n * Shows the close button if set to `true`. Must be used in conjunction with `closeButtonAriaLabel`.\n * */\n showCloseButton?: false;\n};\n\ntype CloseButtonProps = {\n /**\n * An accessible label for the close button.\n * */\n closeButtonAriaLabel: string;\n /**\n * Shows the close button if set to `true`. Must be used in conjunction with `closeButtonAriaLabel`.\n * */\n showCloseButton: true;\n};\n\nexport type ModalContentProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nconst hasCloseButtonProps = (\n props: CloseButtonProps | NoCloseButtonProps\n): props is CloseButtonProps => (props as CloseButtonProps).showCloseButton === true;\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-modal-content\";\n\nexport const ModalContent = forwardRef<HTMLDivElement, ModalContentProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n actions,\n children,\n className,\n description,\n disableCloseOnClickOutside,\n hideDescription,\n image,\n stickyButtons = true,\n title,\n notification = undefined,\n zIndex,\n onCloseAutoFocus,\n ...props\n },\n ref\n ) => {\n const { closeButtonAriaLabel, showCloseButton, ...rest } = props;\n const [contentOverflow, setContentOverflow] = useState(false);\n const [scrollbarWidth, setScrollbarWidth] = useState(0);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const wrapperInnerRef = useRef<HTMLDivElement>(null);\n\n const classes = cx(\n rootClassName,\n { [`${rootClassName}--with-image`]: !!image },\n { [`${rootClassName}--overflow`]: contentOverflow },\n { [`${rootClassName}--sticky-footer`]: stickyButtons },\n className\n );\n\n const getTestId = (id: string) => (dataTestId ? `${dataTestId} ${id}` : undefined);\n\n const handlePointerDownOutside = (event: CustomEvent<{ originalEvent: PointerEvent }>) => {\n if (disableCloseOnClickOutside) {\n event.preventDefault();\n }\n };\n\n const handleContentOverflow = useCallback(() => {\n if (!wrapperRef.current || !wrapperInnerRef.current) {\n return;\n }\n\n const computedStyle = window.getComputedStyle(wrapperRef.current, null);\n const wrapperHeight = parseFloat(computedStyle.getPropertyValue(\"height\"));\n const innerHeight = wrapperInnerRef.current.offsetHeight;\n\n setContentOverflow(wrapperHeight < innerHeight);\n\n setScrollbarWidth(\n (wrapperRef.current.offsetWidth ?? 0) - (wrapperRef.current.clientWidth ?? 0)\n );\n }, []);\n\n const handleInitialFocus = () => {\n const frame = wrapperInnerRef.current;\n if (frame) {\n const heading = frame.querySelector(\"h2\");\n\n heading &&\n setTimeout(() => {\n heading.focus();\n });\n }\n };\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (disableCloseOnClickOutside && !showCloseButton) {\n event.preventDefault();\n }\n };\n\n useEffect(() => {\n window.addEventListener(\"resize\", handleContentOverflow);\n\n return () => {\n window.removeEventListener(\"resize\", handleContentOverflow);\n };\n }, [handleContentOverflow]);\n\n useEffect(() => {\n handleContentOverflow();\n }, [notification, children, handleContentOverflow]);\n\n return (\n <RadixPortal>\n <RadixOverlay className={cx(`${rootClassName}__overlay`)} style={{ zIndex }} />\n <RadixContent\n {...rest}\n className={classes}\n data-testid={dataTestId}\n ref={ref}\n {...(!description && { [\"aria-describedby\"]: undefined })}\n onPointerDownOutside={handlePointerDownOutside}\n onOpenAutoFocus={() => {\n handleContentOverflow();\n handleInitialFocus();\n }}\n onEscapeKeyDown={handleEscapeKeyDown}\n onCloseAutoFocus={onCloseAutoFocus}\n style={{ zIndex: `calc(${zIndex} + 1)` }}\n >\n <div ref={wrapperRef} className={cx(`${rootClassName}__wrapper`)}>\n {hasCloseButtonProps(props) && closeButtonAriaLabel && image && (\n <CloseButton\n aria-label={closeButtonAriaLabel}\n hasImage\n scrollbarWidth={scrollbarWidth}\n data-testid={getTestId(\"close-button\")}\n />\n )}\n <div ref={wrapperInnerRef} className={cx(`${rootClassName}__wrapper-inner`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {hasCloseButtonProps(props) && closeButtonAriaLabel && !image && (\n <CloseButton\n aria-label={closeButtonAriaLabel}\n data-testid={getTestId(\"close-button\")}\n />\n )}\n <RadixTitle\n asChild\n className={cx(`${rootClassName}__title`)}\n data-testid={getTestId(\"title\")}\n >\n <Heading tag=\"h2\" variant=\"title-200\" tabIndex={-1}>\n {title}\n </Heading>\n </RadixTitle>\n </div>\n {image && (\n <div\n className={cx(`${rootClassName}__image-wrapper`)}\n data-testid={getTestId(\"image\")}\n >\n {image}\n </div>\n )}\n <div className={cx(`${rootClassName}__body`)}>\n <div className={cx(`${rootClassName}__body-inner`)}>\n {description && hideDescription && (\n <VisuallyHidden asChild>\n <RadixDescription data-testid={getTestId(\"description\")}>\n {description}\n </RadixDescription>\n </VisuallyHidden>\n )}\n {description && !hideDescription && (\n <RadixDescription\n asChild\n className={cx(`${rootClassName}__description`)}\n data-testid={getTestId(\"description\")}\n >\n <Paragraph variant=\"paragraph-100\">{description}</Paragraph>\n </RadixDescription>\n )}\n <div>{children}</div>\n {!stickyButtons && <ModalActions actions={actions} notification={notification} />}\n </div>\n </div>\n </div>\n </div>\n\n {stickyButtons && <ModalActions actions={actions} notification={notification} />}\n </RadixContent>\n </RadixPortal>\n );\n }\n);\n\nconst CloseButton = ({\n [\"aria-label\"]: ariaLabel,\n hasImage,\n scrollbarWidth,\n [\"data-testid\"]: dataTestId,\n}: {\n [\"aria-label\"]: string;\n hasImage?: boolean;\n scrollbarWidth?: number;\n [\"data-testid\"]?: string;\n}) => (\n <RadixClose asChild>\n <Button\n variant={hasImage ? \"primary\" : \"tertiary-purple\"}\n negative={hasImage}\n size=\"sm\"\n iconOnly\n aria-label={ariaLabel}\n className={cx(`${rootClassName}__close-button`)}\n style={{ right: `calc(var(--purpur-spacing-100) + ${scrollbarWidth || 0}px)` }}\n data-testid={dataTestId}\n >\n <IconClose />\n </Button>\n </RadixClose>\n);\n\nexport const MAX_NUMBER_OF_ACTIONS = 3;\n\nexport const ModalActions = ({\n actions,\n notification,\n}: Pick<ModalContentProps, \"actions\" | \"notification\">) => {\n const notificationRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (notification) {\n notificationRef?.current?.scrollIntoView?.(false);\n }\n }, [notification]);\n\n return actions ? (\n <div className={cx(`${rootClassName}__actions`)}>\n <div className={cx(`${rootClassName}__actions-buttons`)} data-testid=\"modal actions\">\n {actions}\n </div>\n {notification && (\n <div className={cx(`${rootClassName}__notification`)} ref={notificationRef}>\n {notification}\n </div>\n )}\n <span className={cx(`${rootClassName}__actions-separator`)} />\n </div>\n ) : null;\n};\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Trigger as RadixTrigger } from \"@radix-ui/react-dialog\";\n\nexport type ModalTriggerProps = Omit<BaseProps<\"button\">, \"children\"> & {\n children: ReactNode;\n};\n\nexport const ModalTrigger = forwardRef<HTMLButtonElement, ModalTriggerProps>(\n ({ children, ...props }, ref) => {\n return (\n <RadixTrigger asChild ref={ref} {...props}>\n {children}\n </RadixTrigger>\n );\n }\n);\n","import React, { type ReactNode } from \"react\";\nimport { Root as RadixRoot } from \"@radix-ui/react-dialog\";\n\nimport { ModalContent } from \"./modal-content\";\nimport { ModalTrigger } from \"./modal-trigger\";\n\nexport type ModalProps = {\n [\"data-testid\"]?: string;\n children: ReactNode;\n /**\n * Event handler called when the open state of the dialog changes.\n * */\n onOpenChange?: (value: boolean) => void;\n /**\n * The controlled open state of the dialog. Must be used in conjunction with `onOpenChange`.\n * */\n open?: boolean;\n};\n\nexport const Modal = ({\n [\"data-testid\"]: dataTestId,\n children,\n open,\n onOpenChange,\n}: ModalProps) => (\n <RadixRoot open={open} onOpenChange={onOpenChange} data-testid={dataTestId}>\n {children}\n </RadixRoot>\n);\n\nModal.Trigger = ModalTrigger;\nModal.Content = ModalContent;\n\nModal.displayName = \"Modal\";\n"],"names":["hasCloseButtonProps","props","cx","c","styles","rootClassName","ModalContent","forwardRef","dataTestId","actions","children","className","description","disableCloseOnClickOutside","hideDescription","image","stickyButtons","title","notification","zIndex","onCloseAutoFocus","ref","closeButtonAriaLabel","showCloseButton","rest","contentOverflow","setContentOverflow","useState","scrollbarWidth","setScrollbarWidth","wrapperRef","useRef","wrapperInnerRef","classes","getTestId","id","handlePointerDownOutside","event","handleContentOverflow","useCallback","computedStyle","wrapperHeight","innerHeight","handleInitialFocus","frame","heading","handleEscapeKeyDown","useEffect","RadixPortal","jsx","RadixOverlay","jsxs","RadixContent","CloseButton","RadixTitle","Heading","VisuallyHidden","RadixDescription","Paragraph","ModalActions","ariaLabel","hasImage","RadixClose","Button","IconClose","notificationRef","ModalTrigger","RadixTrigger","Modal","open","onOpenChange","RadixRoot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFMA,IAAsB,CAC1BC,MAC+BA,EAA2B,oBAAoB,IAE1EC,IAAKC,GAAE,KAAKC,EAAM,GAClBC,IAAgB,wBAETC,KAAeC;AAAA,EAC1B,CACE;AAAA,IACE,CAAC,gBAAgBC;AAAA,IACjB,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,W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AU,MAAM;AACd,IAAI7B,KACF+C,GAAiB,SAAS,iBAAiB,EAAK;AAAA,EAEpD,GAAG,CAAC/C,CAAY,CAAC,GAEVT,sBACJ,OAAA,EAAI,WAAWP,EAAG,GAAGG,CAAa,WAAW,GAC5C,UAAA;AAAA,IAAA,gBAAA4C,EAAC,OAAA,EAAI,WAAW/C,EAAG,GAAGG,CAAa,mBAAmB,GAAG,eAAY,iBAClE,UAAAI,EAAA,CACH;AAAA,IACCS,KACC,gBAAA+B,EAAC,OAAA,EAAI,WAAW/C,EAAG,GAAGG,CAAa,gBAAgB,GAAG,KAAK4D,GACxD,UAAA/C,EAAA,CACH;AAAA,sBAED,QAAA,EAAK,WAAWhB,EAAG,GAAGG,CAAa,qBAAqB,EAAA,CAAG;AAAA,EAAA,EAAA,CAC9D,IACE;AACN,GC1Ta6D,KAAe3D;AAAA,EAC1B,CAAC,EAAE,UAAAG,GAAU,GAAGT,EAAA,GAASoB,wBAEpB8C,GAAA,EAAa,SAAO,IAAC,KAAA9C,GAAW,GAAGpB,GACjC,UAAAS,GACH;AAGN,GCGa0D,IAAQ,CAAC;AAAA,EACpB,CAAC,gBAAgB5D;AAAA,EACjB,UAAAE;AAAA,EACA,MAAA2D;AAAA,EACA,cAAAC;AACF,wBACGC,GAAA,EAAU,MAAAF,GAAY,cAAAC,GAA4B,eAAa9D,GAC7D,UAAAE,EAAA,CACH;AAGF0D,EAAM,UAAUF;AAChBE,EAAM,UAAU9D;AAEhB8D,EAAM,cAAc;"}
1
+ {"version":3,"file":"modal-fTWvPEPW.mjs","sources":["../../../components/modal/src/modal-content.tsx","../../../components/modal/src/modal-trigger.tsx","../../../components/modal/src/modal.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading } from \"@purpur/heading\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport {\n Close as RadixClose,\n Content as RadixContent,\n Description as RadixDescription,\n Overlay as RadixOverlay,\n Portal as RadixPortal,\n Title as RadixTitle,\n} from \"@radix-ui/react-dialog\";\nimport c from \"classnames/bind\";\n\nimport \"@purpur/notification/styles\";\nimport styles from \"./modal-content.module.scss\";\n\nexport type DefaultProps = Omit<BaseProps, \"children\"> & {\n /**\n * One or several CTA links or buttons\n * */\n actions?: ReactNode;\n children: ReactNode;\n /**\n * An optional accessible description to be announced when the dialog is opened.\n * */\n description?: string;\n /**\n * Prevents the modal from closing on click outside if set to `true`.\n * */\n disableCloseOnClickOutside?: boolean;\n /**\n * Visually hides the description if set to `true`.\n * */\n hideDescription?: boolean;\n /**\n * An optional image to be displayed at the top of the modal.\n * */\n image?: ReactNode;\n /**\n * Provide a Purpur Notification which will render beneath the modal buttons, otherwise leave it undefined.\n * */\n notification?: ReactNode;\n /**\n * Determines whether the button group should be fixed at the bottom or scroll with the content.\n * */\n stickyButtons?: boolean;\n /**\n * An accessible title to be announced when the dialog is opened.\n * */\n title: string;\n /**\n * z-index of the modal\n * */\n zIndex?: number;\n /**\n * Event handler called when focus moves to the trigger after closing.\n * */\n onCloseAutoFocus?: (e: Event) => void;\n};\n\ntype NoCloseButtonProps = {\n /**\n * An accessible label for the close button.\n * */\n closeButtonAriaLabel?: never;\n /**\n * Shows the close button if set to `true`. Must be used in conjunction with `closeButtonAriaLabel`.\n * */\n showCloseButton?: false;\n};\n\ntype CloseButtonProps = {\n /**\n * An accessible label for the close button.\n * */\n closeButtonAriaLabel: string;\n /**\n * Shows the close button if set to `true`. Must be used in conjunction with `closeButtonAriaLabel`.\n * */\n showCloseButton: true;\n};\n\nexport type ModalContentProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nconst hasCloseButtonProps = (\n props: CloseButtonProps | NoCloseButtonProps\n): props is CloseButtonProps => (props as CloseButtonProps).showCloseButton === true;\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-modal-content\";\n\nexport const ModalContent = forwardRef<HTMLDivElement, ModalContentProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n actions,\n children,\n className,\n description,\n disableCloseOnClickOutside,\n hideDescription,\n image,\n stickyButtons = true,\n title,\n notification = undefined,\n zIndex,\n onCloseAutoFocus,\n ...props\n },\n ref\n ) => {\n const { closeButtonAriaLabel, showCloseButton, ...rest } = props;\n const [contentOverflow, setContentOverflow] = useState(false);\n const [scrollbarWidth, setScrollbarWidth] = useState(0);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const wrapperInnerRef = useRef<HTMLDivElement>(null);\n\n const classes = cx(\n rootClassName,\n { [`${rootClassName}--with-image`]: !!image },\n { [`${rootClassName}--overflow`]: contentOverflow },\n { [`${rootClassName}--sticky-footer`]: stickyButtons },\n className\n );\n\n const getTestId = (id: string) => (dataTestId ? `${dataTestId} ${id}` : undefined);\n\n const handlePointerDownOutside = (event: CustomEvent<{ originalEvent: PointerEvent }>) => {\n if (disableCloseOnClickOutside) {\n event.preventDefault();\n }\n };\n\n const handleContentOverflow = useCallback(() => {\n if (!wrapperRef.current || !wrapperInnerRef.current) {\n return;\n }\n\n const computedStyle = window.getComputedStyle(wrapperRef.current, null);\n const wrapperHeight = parseFloat(computedStyle.getPropertyValue(\"height\"));\n const innerHeight = wrapperInnerRef.current.offsetHeight;\n\n setContentOverflow(wrapperHeight < innerHeight);\n\n setScrollbarWidth(\n (wrapperRef.current.offsetWidth ?? 0) - (wrapperRef.current.clientWidth ?? 0)\n );\n }, []);\n\n const handleInitialFocus = () => {\n const frame = wrapperInnerRef.current;\n if (frame) {\n const heading = frame.querySelector(\"h2\");\n\n heading &&\n setTimeout(() => {\n heading.focus();\n });\n }\n };\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (disableCloseOnClickOutside && !showCloseButton) {\n event.preventDefault();\n }\n };\n\n useEffect(() => {\n window.addEventListener(\"resize\", handleContentOverflow);\n\n return () => {\n window.removeEventListener(\"resize\", handleContentOverflow);\n };\n }, [handleContentOverflow]);\n\n useEffect(() => {\n handleContentOverflow();\n }, [notification, children, handleContentOverflow]);\n\n return (\n <RadixPortal>\n <RadixOverlay className={cx(`${rootClassName}__overlay`)} style={{ zIndex }} />\n <RadixContent\n {...rest}\n className={classes}\n data-testid={dataTestId}\n ref={ref}\n {...(!description && { [\"aria-describedby\"]: undefined })}\n onPointerDownOutside={handlePointerDownOutside}\n onOpenAutoFocus={() => {\n handleContentOverflow();\n handleInitialFocus();\n }}\n onEscapeKeyDown={handleEscapeKeyDown}\n onCloseAutoFocus={onCloseAutoFocus}\n style={{ zIndex: `calc(${zIndex} + 1)` }}\n >\n <div ref={wrapperRef} className={cx(`${rootClassName}__wrapper`)}>\n {hasCloseButtonProps(props) && closeButtonAriaLabel && image && (\n <CloseButton\n aria-label={closeButtonAriaLabel}\n hasImage\n scrollbarWidth={scrollbarWidth}\n data-testid={getTestId(\"close-button\")}\n />\n )}\n <div ref={wrapperInnerRef} className={cx(`${rootClassName}__wrapper-inner`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {hasCloseButtonProps(props) && closeButtonAriaLabel && !image && (\n <CloseButton\n aria-label={closeButtonAriaLabel}\n data-testid={getTestId(\"close-button\")}\n />\n )}\n <RadixTitle\n asChild\n className={cx(`${rootClassName}__title`)}\n data-testid={getTestId(\"title\")}\n >\n <Heading tag=\"h2\" variant=\"title-200\" tabIndex={-1}>\n {title}\n </Heading>\n </RadixTitle>\n </div>\n {image && (\n <div\n className={cx(`${rootClassName}__image-wrapper`)}\n data-testid={getTestId(\"image\")}\n >\n {image}\n </div>\n )}\n <div className={cx(`${rootClassName}__body`)}>\n <div className={cx(`${rootClassName}__body-inner`)}>\n {description && hideDescription && (\n <VisuallyHidden asChild>\n <RadixDescription data-testid={getTestId(\"description\")}>\n {description}\n </RadixDescription>\n </VisuallyHidden>\n )}\n {description && !hideDescription && (\n <RadixDescription\n asChild\n className={cx(`${rootClassName}__description`)}\n data-testid={getTestId(\"description\")}\n >\n <Paragraph variant=\"paragraph-100\">{description}</Paragraph>\n </RadixDescription>\n )}\n <div>{children}</div>\n {!stickyButtons && <ModalActions actions={actions} notification={notification} />}\n </div>\n </div>\n </div>\n </div>\n\n {stickyButtons && <ModalActions actions={actions} notification={notification} />}\n </RadixContent>\n </RadixPortal>\n );\n }\n);\n\nconst CloseButton = ({\n [\"aria-label\"]: ariaLabel,\n hasImage,\n scrollbarWidth,\n [\"data-testid\"]: dataTestId,\n}: {\n [\"aria-label\"]: string;\n hasImage?: boolean;\n scrollbarWidth?: number;\n [\"data-testid\"]?: string;\n}) => (\n <RadixClose asChild>\n <Button\n variant={hasImage ? \"primary\" : \"tertiary-purple\"}\n negative={hasImage}\n size=\"sm\"\n iconOnly\n aria-label={ariaLabel}\n className={cx(`${rootClassName}__close-button`)}\n style={{ right: `calc(var(--purpur-spacing-100) + ${scrollbarWidth || 0}px)` }}\n data-testid={dataTestId}\n >\n <IconClose />\n </Button>\n </RadixClose>\n);\n\nexport const MAX_NUMBER_OF_ACTIONS = 3;\n\nexport const ModalActions = ({\n actions,\n notification,\n}: Pick<ModalContentProps, \"actions\" | \"notification\">) => {\n const notificationRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (notification) {\n notificationRef?.current?.scrollIntoView?.(false);\n }\n }, [notification]);\n\n return actions ? (\n <div className={cx(`${rootClassName}__actions`)}>\n <div className={cx(`${rootClassName}__actions-buttons`)} data-testid=\"modal actions\">\n {actions}\n </div>\n {notification && (\n <div className={cx(`${rootClassName}__notification`)} ref={notificationRef}>\n {notification}\n </div>\n )}\n <span className={cx(`${rootClassName}__actions-separator`)} />\n </div>\n ) : null;\n};\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Trigger as RadixTrigger } from \"@radix-ui/react-dialog\";\n\nexport type ModalTriggerProps = Omit<BaseProps<\"button\">, \"children\"> & {\n children: ReactNode;\n};\n\nexport const ModalTrigger = forwardRef<HTMLButtonElement, ModalTriggerProps>(\n ({ children, ...props }, ref) => {\n return (\n <RadixTrigger asChild ref={ref} {...props}>\n {children}\n </RadixTrigger>\n );\n }\n);\n","import React, { type ReactNode } from \"react\";\nimport { Root as RadixRoot } from \"@radix-ui/react-dialog\";\n\nimport { ModalContent } from \"./modal-content\";\nimport { ModalTrigger } from \"./modal-trigger\";\n\nexport type ModalProps = {\n [\"data-testid\"]?: string;\n children: ReactNode;\n /**\n * Event handler called when the open state of the dialog changes.\n * */\n onOpenChange?: (value: boolean) => void;\n /**\n * The controlled open state of the dialog. Must be used in conjunction with `onOpenChange`.\n * */\n open?: boolean;\n};\n\nexport const Modal = ({\n [\"data-testid\"]: dataTestId,\n children,\n open,\n onOpenChange,\n}: ModalProps) => (\n <RadixRoot open={open} onOpenChange={onOpenChange} data-testid={dataTestId}>\n {children}\n </RadixRoot>\n);\n\nModal.Trigger = ModalTrigger;\nModal.Content = ModalContent;\n\nModal.displayName = \"Modal\";\n"],"names":["hasCloseButtonProps","props","cx","c","styles","rootClassName","ModalContent","forwardRef","dataTestId","actions","children","className","description","disableCloseOnClickOutside","hideDescription","image","stickyButtons","title","notification","zIndex","onCloseAutoFocus","ref","closeButtonAriaLabel","showCloseButton","rest","contentOverflow","setContentOverflow","useState","scrollbarWidth","setScrollbarWidth","wrapperRef","useRef","wrapperInnerRef","classes","getTestId","id","handlePointerDownOutside","event","handleContentOverflow","useCallback","computedStyle","wrapperHeight","innerHeight","handleInitialFocus","frame","heading","handleEscapeKeyDown","useEffect","RadixPortal","jsx","RadixOverlay","jsxs","RadixContent","CloseButton","RadixTitle","Heading","VisuallyHidden","RadixDescription","Paragraph","ModalActions","ariaLabel","hasImage","RadixClose","Button","IconClose","notificationRef","ModalTrigger","RadixTrigger","Modal","open","onOpenChange","RadixRoot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFMA,IAAsB,CAC1BC,MAC+BA,EAA2B,oBAAoB,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AA,CAAU;AAAA,EAAA;AACb,GACF,GAKWL,IAAe,CAAC;AAAA,EAC3B,SAAAlD;AAAA,EACA,cAAAS;AACF,MAA2D;AACzD,QAAM+C,IAAkBlC,EAAuB,IAAI;AAEnD,SAAAgB,EAAU,MAAM;AACd,IAAI7B,KACF+C,GAAiB,SAAS,iBAAiB,EAAK;AAAA,EAEpD,GAAG,CAAC/C,CAAY,CAAC,GAEVT,sBACJ,OAAA,EAAI,WAAWP,EAAG,GAAGG,CAAa,WAAW,GAC5C,UAAA;AAAA,IAAA,gBAAA4C,EAAC,OAAA,EAAI,WAAW/C,EAAG,GAAGG,CAAa,mBAAmB,GAAG,eAAY,iBAClE,UAAAI,EAAA,CACH;AAAA,IACCS,KACC,gBAAA+B,EAAC,OAAA,EAAI,WAAW/C,EAAG,GAAGG,CAAa,gBAAgB,GAAG,KAAK4D,GACxD,UAAA/C,EAAA,CACH;AAAA,sBAED,QAAA,EAAK,WAAWhB,EAAG,GAAGG,CAAa,qBAAqB,EAAA,CAAG;AAAA,EAAA,EAAA,CAC9D,IACE;AACN,GC1Ta6D,KAAe3D;AAAA,EAC1B,CAAC,EAAE,UAAAG,GAAU,GAAGT,EAAA,GAASoB,wBAEpB8C,GAAA,EAAa,SAAO,IAAC,KAAA9C,GAAW,GAAGpB,GACjC,UAAAS,GACH;AAGN,GCGa0D,IAAQ,CAAC;AAAA,EACpB,CAAC,gBAAgB5D;AAAA,EACjB,UAAAE;AAAA,EACA,MAAA2D;AAAA,EACA,cAAAC;AACF,wBACGC,GAAA,EAAU,MAAAF,GAAY,cAAAC,GAA4B,eAAa9D,GAC7D,UAAAE,EAAA,CACH;AAGF0D,EAAM,UAAUF;AAChBE,EAAM,UAAU9D;AAEhB8D,EAAM,cAAc;"}
package/dist/modal.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./modal-CQiJ98iI.js");exports.Modal=e.Modal;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./modal-DMeRO1wE.js");exports.Modal=e.Modal;
2
2
  //# sourceMappingURL=modal.cjs.js.map
package/dist/modal.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { M as r } from "./modal-B1eJu9HN.mjs";
1
+ import { M as r } from "./modal-fTWvPEPW.mjs";
2
2
  export {
3
3
  r as Modal
4
4
  };
@@ -1,22 +1,22 @@
1
1
  import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
2
  import { forwardRef as N } from "react";
3
- import { b as $ } from "./button-D-BBdNhd.mjs";
4
- import { H as O } from "./heading-xwBuT_-9.mjs";
3
+ import { b as $ } from "./button-Cv7NlYbv.mjs";
4
+ import { H as j } from "./heading-xwBuT_-9.mjs";
5
5
  import { b as f } from "./icon.es-CZcKxTaM.mjs";
6
6
  import { e as x } from "./error-filled.es-C0Amnd7Y.mjs";
7
- import { P as R } from "./paragraph-Ci50OF1u.mjs";
8
- import { c as S } from "./bind-CU-R61T-.mjs";
9
- const A = {
7
+ import { P as O } from "./paragraph-Ci50OF1u.mjs";
8
+ import { c as A } from "./bind-CU-R61T-.mjs";
9
+ const R = {
10
10
  name: "alert-filled",
11
11
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm1.038-14.81-.247 6.875h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.916c0 .649-.585 1.234-1.25 1.234-.649 0-1.25-.585-1.25-1.234 0-.633.601-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',
12
12
  keywords: ["alert-filled"],
13
13
  category: "status"
14
- }, L = {
14
+ }, S = {
15
15
  name: "check-circle-filled",
16
16
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.712-12.491a.875.875 0 1 0-1.424-1.018l-4.4 6.16-2.27-2.27a.875.875 0 0 0-1.237 1.238l3 3a.875.875 0 0 0 1.331-.11l5-7Z" clip-rule="evenodd"/></svg>',
17
17
  keywords: ["check-circle-filled"],
18
18
  category: "status"
19
- }, E = {
19
+ }, Z = {
20
20
  name: "close",
21
21
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',
22
22
  keywords: ["close"],
@@ -26,42 +26,51 @@ const A = {
26
26
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM10.9 7.786c0 .591.516 1.077 1.108 1.077.576 0 1.092-.486 1.092-1.077 0-.592-.516-1.078-1.092-1.078-.592 0-1.108.486-1.108 1.078Zm.167 9.74h1.866V9.94h-1.866v7.586Z" clip-rule="evenodd"/></svg>',
27
27
  keywords: ["info-filled"],
28
28
  category: "status"
29
- }, I = {
30
- "purpur-notification": "_purpur-notification_53c05_1",
31
- "purpur-notification__top": "_purpur-notification__top_53c05_14",
32
- "purpur-notification__header": "_purpur-notification__header_53c05_20",
33
- "purpur-notification__close-button": "_purpur-notification__close-button_53c05_25",
34
- "purpur-notification__icon": "_purpur-notification__icon_53c05_30",
35
- "purpur-notification__body": "_purpur-notification__body_53c05_33",
36
- "purpur-notification__body--extra-padding": "_purpur-notification__body--extra-padding_53c05_36",
37
- "purpur-notification--success": "_purpur-notification--success_53c05_39",
38
- "purpur-notification__heading": "_purpur-notification__heading_53c05_42",
39
- "purpur-notification--warning": "_purpur-notification--warning_53c05_48",
40
- "purpur-notification--error": "_purpur-notification--error_53c05_57",
41
- "purpur-notification--info": "_purpur-notification--info_53c05_66",
42
- "purpur-notification--hidden": "_purpur-notification--hidden_53c05_75",
43
- "purpur-notification--has-close-button": "_purpur-notification--has-close-button_53c05_79"
44
- }, n = S.bind(I), a = {
29
+ }, L = {
30
+ name: "sparkles",
31
+ svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17.154 22.054c.463-.002.855-.304.977-.755.411-1.533 1.256-2.463 2.656-2.926a1.02 1.02 0 0 0 .015-1.93c-1.437-.508-2.283-1.434-2.665-2.919a1.017 1.017 0 0 0-.974-.766c-.445.02-.864.305-.986.747-.422 1.518-1.267 2.447-2.66 2.923a1.02 1.02 0 0 0-.687.968c.001.437.279.825.686.962 1.4.479 2.243 1.414 2.657 2.946.121.442.523.75.978.75h.003Zm-1.788-4.66a5.334 5.334 0 0 0 1.779-1.867 5.32 5.32 0 0 0 1.792 1.87 5.256 5.256 0 0 0-1.787 1.88 5.326 5.326 0 0 0-1.784-1.883Zm.956-8.397c-2.97-1.047-4.797-3.046-5.583-6.115a1.232 1.232 0 0 0-1.19-.936 1.247 1.247 0 0 0-1.204.916c-.868 3.125-2.693 5.124-5.579 6.112-.502.171-.84.646-.84 1.182 0 .536.338 1.01.84 1.182 2.897.991 4.72 3.004 5.57 6.154.151.552.632.922 1.196.922h.004a1.228 1.228 0 0 0 1.191-.925c.849-3.162 2.674-5.166 5.578-6.126h.003a1.253 1.253 0 0 0 .015-2.366ZM9.53 15.415c-.996-2.405-2.64-4.167-4.906-5.259C6.878 9.071 8.52 7.324 9.526 4.941c.967 2.359 2.616 4.109 4.926 5.226-2.276 1.073-3.925 2.83-4.922 5.248Z"/></svg>',
32
+ keywords: ["sparkles"],
33
+ category: "ai"
34
+ }, E = {
35
+ "purpur-notification": "_purpur-notification_1c3oj_1",
36
+ "purpur-notification__top": "_purpur-notification__top_1c3oj_14",
37
+ "purpur-notification__header": "_purpur-notification__header_1c3oj_20",
38
+ "purpur-notification__close-button": "_purpur-notification__close-button_1c3oj_25",
39
+ "purpur-notification__icon": "_purpur-notification__icon_1c3oj_31",
40
+ "purpur-notification__body": "_purpur-notification__body_1c3oj_35",
41
+ "purpur-notification__body--extra-padding": "_purpur-notification__body--extra-padding_1c3oj_38",
42
+ "purpur-notification--success": "_purpur-notification--success_1c3oj_41",
43
+ "purpur-notification__heading": "_purpur-notification__heading_1c3oj_44",
44
+ "purpur-notification--warning": "_purpur-notification--warning_1c3oj_50",
45
+ "purpur-notification--error": "_purpur-notification--error_1c3oj_59",
46
+ "purpur-notification--info": "_purpur-notification--info_1c3oj_68",
47
+ "purpur-notification--ai": "_purpur-notification--ai_1c3oj_77",
48
+ "purpur-notification--hidden": "_purpur-notification--hidden_1c3oj_92",
49
+ "purpur-notification--has-close-button": "_purpur-notification--has-close-button_1c3oj_96"
50
+ }, a = A.bind(E), n = {
45
51
  SUCCESS: "success",
46
52
  WARNING: "warning",
47
53
  ERROR: "error",
48
- INFO: "info"
49
- }, D = Object.values(a), Z = {
54
+ INFO: "info",
55
+ AI: "ai"
56
+ }, T = Object.values(n), I = {
50
57
  POLITE: "polite",
51
58
  ASSERTIVE: "assertive"
52
- }, T = Object.values(Z), k = {
59
+ }, W = Object.values(I), k = {
53
60
  ALERT: "alert",
54
61
  DIALOG: "dialog",
55
62
  ALERTDIALOG: "alertdialog"
56
- }, W = Object.values(k), o = "purpur-notification", j = (i) => {
63
+ }, q = Object.values(k), o = "purpur-notification", M = (i) => {
57
64
  switch (i) {
58
- case a.INFO:
59
- return C;
60
- case a.SUCCESS:
65
+ case n.AI:
61
66
  return L;
62
- case a.WARNING:
63
- return A;
64
- case a.ERROR:
67
+ case n.INFO:
68
+ return C;
69
+ case n.SUCCESS:
70
+ return S;
71
+ case n.WARNING:
72
+ return R;
73
+ case n.ERROR:
65
74
  return x;
66
75
  }
67
76
  }, B = N(
@@ -89,7 +98,7 @@ const A = {
89
98
  "aria-labelledby": t ? `${t}-heading` : void 0,
90
99
  "aria-describedby": t ? `${t}-body` : void 0,
91
100
  "aria-hidden": !!p,
92
- className: n(g, o, `${o}--${u}`, {
101
+ className: a(g, o, `${o}--${u}`, {
93
102
  [`${o}--hidden`]: p,
94
103
  [`${o}--has-close-button`]: !!c
95
104
  }),
@@ -97,23 +106,23 @@ const A = {
97
106
  ref: y,
98
107
  ...b,
99
108
  children: [
100
- d && /* @__PURE__ */ r("div", { className: n(`${o}__top`), children: /* @__PURE__ */ l("div", { className: n(`${o}__header`), children: [
109
+ d && /* @__PURE__ */ r("div", { className: a(`${o}__top`), children: /* @__PURE__ */ l("div", { className: a(`${o}__header`), children: [
101
110
  !_ && /* @__PURE__ */ r(
102
111
  f,
103
112
  {
104
113
  "data-testid": i ? `${i}-icon` : void 0,
105
- className: n(`${o}__icon`),
106
- svg: j(u),
107
- size: "md"
114
+ className: a(`${o}__icon`),
115
+ svg: M(u),
116
+ size: "sm"
108
117
  }
109
118
  ),
110
119
  !!s && /* @__PURE__ */ r(
111
- O,
120
+ j,
112
121
  {
113
122
  "data-testid": i ? `${i}-heading` : void 0,
114
123
  variant: "subsection-100",
115
124
  tag: h,
116
- className: n(`${o}__heading`),
125
+ className: a(`${o}__heading`),
117
126
  children: /* @__PURE__ */ l("span", { id: t ? `${t}-heading` : void 0, children: [
118
127
  " ",
119
128
  s
@@ -125,25 +134,25 @@ const A = {
125
134
  $,
126
135
  {
127
136
  "data-testid": i ? `${i}-close-button` : void 0,
128
- variant: "tertiary-purple",
137
+ variant: "text",
129
138
  size: "sm",
130
139
  iconOnly: !0,
131
140
  "aria-label": m,
132
141
  onClick: c,
133
- className: n(`${o}__close-button`),
134
- children: /* @__PURE__ */ r(f, { svg: E, size: "sm" })
142
+ className: a(`${o}__close-button`),
143
+ children: /* @__PURE__ */ r(f, { svg: Z, size: "md" })
135
144
  }
136
145
  ),
137
146
  e && /* @__PURE__ */ r(
138
147
  "div",
139
148
  {
140
149
  "data-testid": i ? `${i}-body` : void 0,
141
- className: n(`${o}__body`, {
150
+ className: a(`${o}__body`, {
142
151
  [`${o}__body--extra-padding`]: !d && !!c
143
152
  }),
144
153
  id: t ? `${t}-body` : void 0,
145
154
  children: typeof e == "string" ? /* @__PURE__ */ r(
146
- R,
155
+ O,
147
156
  {
148
157
  "data-testid": i ? `${i}-paragraph` : void 0,
149
158
  variant: "paragraph-100",
@@ -159,12 +168,12 @@ const A = {
159
168
  );
160
169
  B.displayName = "Notification";
161
170
  export {
162
- Z as N,
171
+ I as N,
163
172
  k as a,
164
- a as b,
173
+ n as b,
165
174
  B as c,
166
- W as d,
167
- D as e,
168
- T as n
175
+ q as d,
176
+ T as e,
177
+ W as n
169
178
  };
170
- //# sourceMappingURL=notification-BtcM7Ndu.mjs.map
179
+ //# sourceMappingURL=notification-BvoL7BIW.mjs.map