@purpur/library 9.1.2 → 9.2.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 (312) hide show
  1. package/CHANGELOG.json +56 -0
  2. package/CHANGELOG.md +28 -1
  3. package/dist/LICENSE.txt +66 -8
  4. package/dist/{ThemeProvider-ipAIFRUi.js → ThemeProvider-5r7lDX-h.js} +2 -2
  5. package/dist/{ThemeProvider-ipAIFRUi.js.map → ThemeProvider-5r7lDX-h.js.map} +1 -1
  6. package/dist/{ThemeProvider-BR1hJQOD.mjs → ThemeProvider-bkyFCeo6.mjs} +3 -3
  7. package/dist/{ThemeProvider-BR1hJQOD.mjs.map → ThemeProvider-bkyFCeo6.mjs.map} +1 -1
  8. package/dist/accordion-OsA0HvdA.js +2 -0
  9. package/dist/{accordion-DX8efWOt.js.map → accordion-OsA0HvdA.js.map} +1 -1
  10. package/dist/{accordion-BKTz9DM6.mjs → accordion-OtFSShSB.mjs} +37 -37
  11. package/dist/{accordion-BKTz9DM6.mjs.map → accordion-OtFSShSB.mjs.map} +1 -1
  12. package/dist/accordion.cjs.js +1 -1
  13. package/dist/accordion.es.js +1 -1
  14. package/dist/arrow-left.es-CCWJyrcQ.js +2 -0
  15. package/dist/arrow-left.es-CCWJyrcQ.js.map +1 -0
  16. package/dist/arrow-left.es-DU-PX-Il.mjs +13 -0
  17. package/dist/arrow-left.es-DU-PX-Il.mjs.map +1 -0
  18. package/dist/{autocomplete-B8L-dTmF.mjs → autocomplete-BipmyKf0.mjs} +2 -2
  19. package/dist/{autocomplete-B8L-dTmF.mjs.map → autocomplete-BipmyKf0.mjs.map} +1 -1
  20. package/dist/{autocomplete-B421J7CS.js → autocomplete-D9uCJzjY.js} +2 -2
  21. package/dist/{autocomplete-B421J7CS.js.map → autocomplete-D9uCJzjY.js.map} +1 -1
  22. package/dist/autocomplete.cjs.js +1 -1
  23. package/dist/autocomplete.es.js +1 -1
  24. package/dist/button-4-yWOgtD.mjs +109 -0
  25. package/dist/{button-Cv7NlYbv.mjs.map → button-4-yWOgtD.mjs.map} +1 -1
  26. package/dist/button-DmybVApa.js +2 -0
  27. package/dist/{button-Dqxdc3nC.js.map → button-DmybVApa.js.map} +1 -1
  28. package/dist/button.cjs.js +1 -1
  29. package/dist/button.es.js +1 -1
  30. package/dist/{calendar-CoP1dGpQ.js → calendar-CBBV8n3x.js} +2 -2
  31. package/dist/{calendar-CoP1dGpQ.js.map → calendar-CBBV8n3x.js.map} +1 -1
  32. package/dist/{calendar-D_sZrR92.mjs → calendar-DEXw83mu.mjs} +2 -2
  33. package/dist/{calendar-D_sZrR92.mjs.map → calendar-DEXw83mu.mjs.map} +1 -1
  34. package/dist/calendar.cjs.js +1 -1
  35. package/dist/calendar.es.js +1 -1
  36. package/dist/card-CRHXm5NR.js +2 -0
  37. package/dist/{card-VMa3cGCP.js.map → card-CRHXm5NR.js.map} +1 -1
  38. package/dist/{card-CkZQZOz1.mjs → card-DR2hvxjZ.mjs} +75 -75
  39. package/dist/{card-CkZQZOz1.mjs.map → card-DR2hvxjZ.mjs.map} +1 -1
  40. package/dist/card.cjs.js +1 -1
  41. package/dist/card.es.js +1 -1
  42. package/dist/carousel-BCw-5u92.js +2 -0
  43. package/dist/carousel-BCw-5u92.js.map +1 -0
  44. package/dist/carousel-BkxojLwn.mjs +1633 -0
  45. package/dist/carousel-BkxojLwn.mjs.map +1 -0
  46. package/dist/carousel.cjs.js +2 -0
  47. package/dist/carousel.cjs.js.map +1 -0
  48. package/dist/carousel.es.js +5 -0
  49. package/dist/carousel.es.js.map +1 -0
  50. package/dist/{chat-field-yK-TwW0D.mjs → chat-field-CVF4DooY.mjs} +2 -2
  51. package/dist/{chat-field-yK-TwW0D.mjs.map → chat-field-CVF4DooY.mjs.map} +1 -1
  52. package/dist/{chat-field-CxOqk0-9.js → chat-field-Wjvh2J6C.js} +2 -2
  53. package/dist/{chat-field-CxOqk0-9.js.map → chat-field-Wjvh2J6C.js.map} +1 -1
  54. package/dist/chat-field.cjs.js +1 -1
  55. package/dist/chat-field.es.js +1 -1
  56. package/dist/comparison-table-B8w65g43.js +2 -0
  57. package/dist/comparison-table-B8w65g43.js.map +1 -0
  58. package/dist/comparison-table-D1zJpdLL.mjs +275 -0
  59. package/dist/comparison-table-D1zJpdLL.mjs.map +1 -0
  60. package/dist/comparison-table.cjs.js +2 -0
  61. package/dist/comparison-table.cjs.js.map +1 -0
  62. package/dist/comparison-table.es.js +5 -0
  63. package/dist/comparison-table.es.js.map +1 -0
  64. package/dist/components/carousel/src/carousel.d.ts +43 -0
  65. package/dist/components/carousel/src/carousel.d.ts.map +1 -0
  66. package/dist/components/carousel/src/components/PageIndicator.d.ts +12 -0
  67. package/dist/components/carousel/src/components/PageIndicator.d.ts.map +1 -0
  68. package/dist/components/carousel/src/hooks/useAutoplay.d.ts +8 -0
  69. package/dist/components/carousel/src/hooks/useAutoplay.d.ts.map +1 -0
  70. package/dist/components/carousel/src/hooks/usePageIndicators.d.ts +9 -0
  71. package/dist/components/carousel/src/hooks/usePageIndicators.d.ts.map +1 -0
  72. package/dist/components/carousel/src/hooks/usePrefersReducedMotion.d.ts +2 -0
  73. package/dist/components/carousel/src/hooks/usePrefersReducedMotion.d.ts.map +1 -0
  74. package/dist/components/carousel/src/hooks/usePrevNextButtons.d.ts +11 -0
  75. package/dist/components/carousel/src/hooks/usePrevNextButtons.d.ts.map +1 -0
  76. package/dist/components/comparison-table/src/comparison-table.d.ts +64 -0
  77. package/dist/components/comparison-table/src/comparison-table.d.ts.map +1 -0
  78. package/dist/components/comparison-table/src/components/Cell/cell.d.ts +7 -0
  79. package/dist/components/comparison-table/src/components/Cell/cell.d.ts.map +1 -0
  80. package/dist/components/comparison-table/src/components/LeadCell/lead-cell.d.ts +8 -0
  81. package/dist/components/comparison-table/src/components/LeadCell/lead-cell.d.ts.map +1 -0
  82. package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts +26 -0
  83. package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts.map +1 -0
  84. package/dist/components/comparison-table/src/components/ScrollProgress/scroll-progress.d.ts +11 -0
  85. package/dist/components/comparison-table/src/components/ScrollProgress/scroll-progress.d.ts.map +1 -0
  86. package/dist/components/content-block/src/content-block.d.ts +2 -2
  87. package/dist/components/content-block/src/content-block.d.ts.map +1 -1
  88. package/dist/components/dropdown/src/dropdown-combobox.d.ts +2 -1
  89. package/dist/components/dropdown/src/dropdown-combobox.d.ts.map +1 -1
  90. package/dist/components/dropdown/src/dropdown-select.d.ts +2 -1
  91. package/dist/components/dropdown/src/dropdown-select.d.ts.map +1 -1
  92. package/dist/components/dropdown/src/dropdown-shared.d.ts +11 -1
  93. package/dist/components/dropdown/src/dropdown-shared.d.ts.map +1 -1
  94. package/dist/components/dropdown/src/dropdown.types.d.ts +7 -2
  95. package/dist/components/dropdown/src/dropdown.types.d.ts.map +1 -1
  96. package/dist/components/dropdown/src/useDropdown.d.ts +2 -1
  97. package/dist/components/dropdown/src/useDropdown.d.ts.map +1 -1
  98. package/dist/components-metadata.js +16 -0
  99. package/dist/{content-block-Cd7xSE8t.js → content-block-CDRUH0pg.js} +2 -2
  100. package/dist/content-block-CDRUH0pg.js.map +1 -0
  101. package/dist/{content-block-BMOvlH7a.mjs → content-block-Dm3L4g8w.mjs} +2 -2
  102. package/dist/content-block-Dm3L4g8w.mjs.map +1 -0
  103. package/dist/content-block.cjs.js +1 -1
  104. package/dist/content-block.es.js +1 -1
  105. package/dist/{cta-link-BHU6irMG.js → cta-link-B1qMjH76.js} +2 -2
  106. package/dist/{cta-link-BHU6irMG.js.map → cta-link-B1qMjH76.js.map} +1 -1
  107. package/dist/{cta-link-B_FfwflB.mjs → cta-link-pwva2f2r.mjs} +43 -43
  108. package/dist/{cta-link-B_FfwflB.mjs.map → cta-link-pwva2f2r.mjs.map} +1 -1
  109. package/dist/cta-link.cjs.js +1 -1
  110. package/dist/cta-link.es.js +1 -1
  111. package/dist/{date-field-B7ipm5sH.js → date-field-BJaomFjs.js} +2 -2
  112. package/dist/{date-field-B7ipm5sH.js.map → date-field-BJaomFjs.js.map} +1 -1
  113. package/dist/{date-field-4tYMPw89.mjs → date-field-D3rTtf9Y.mjs} +2 -2
  114. package/dist/{date-field-4tYMPw89.mjs.map → date-field-D3rTtf9Y.mjs.map} +1 -1
  115. package/dist/date-field.cjs.js +1 -1
  116. package/dist/date-field.es.js +1 -1
  117. package/dist/{date-picker-D7EisjDG.mjs → date-picker-CpDZ0gK9.mjs} +4 -4
  118. package/dist/{date-picker-D7EisjDG.mjs.map → date-picker-CpDZ0gK9.mjs.map} +1 -1
  119. package/dist/{date-picker-BWW4xzyc.js → date-picker-D3uJGCjl.js} +2 -2
  120. package/dist/{date-picker-BWW4xzyc.js.map → date-picker-D3uJGCjl.js.map} +1 -1
  121. package/dist/date-picker.cjs.js +1 -1
  122. package/dist/date-picker.es.js +1 -1
  123. package/dist/{drawer-Vi9H2O3N.mjs → drawer-BJ8xwriz.mjs} +2 -2
  124. package/dist/{drawer-Vi9H2O3N.mjs.map → drawer-BJ8xwriz.mjs.map} +1 -1
  125. package/dist/{drawer-UdK-u7IX.js → drawer-CNs9K8Ca.js} +2 -2
  126. package/dist/{drawer-UdK-u7IX.js.map → drawer-CNs9K8Ca.js.map} +1 -1
  127. package/dist/drawer.cjs.js +1 -1
  128. package/dist/drawer.es.js +1 -1
  129. package/dist/dropdown-BsqVnd7z.js +2 -0
  130. package/dist/dropdown-BsqVnd7z.js.map +1 -0
  131. package/dist/dropdown-TO3Mh0bk.mjs +910 -0
  132. package/dist/dropdown-TO3Mh0bk.mjs.map +1 -0
  133. package/dist/dropdown.cjs.js +1 -1
  134. package/dist/dropdown.es.js +1 -1
  135. package/dist/{footer-cH07Xqil.mjs → footer-BXs8uzTA.mjs} +4 -4
  136. package/dist/{footer-cH07Xqil.mjs.map → footer-BXs8uzTA.mjs.map} +1 -1
  137. package/dist/{footer-BL0ewBZT.js → footer-DF9adlni.js} +2 -2
  138. package/dist/{footer-BL0ewBZT.js.map → footer-DF9adlni.js.map} +1 -1
  139. package/dist/footer.cjs.js +1 -1
  140. package/dist/footer.es.js +1 -1
  141. package/dist/{hero-banner-yGRM4OlS.js → hero-banner-BfxclVFT.js} +2 -2
  142. package/dist/{hero-banner-yGRM4OlS.js.map → hero-banner-BfxclVFT.js.map} +1 -1
  143. package/dist/{hero-banner-BjwICxaJ.mjs → hero-banner-CxPvhXD2.mjs} +3 -3
  144. package/dist/{hero-banner-BjwICxaJ.mjs.map → hero-banner-CxPvhXD2.mjs.map} +1 -1
  145. package/dist/hero-banner.cjs.js +1 -1
  146. package/dist/hero-banner.es.js +1 -1
  147. package/dist/libraries/library/src/carousel.d.ts +6 -0
  148. package/dist/libraries/library/src/carousel.d.ts.map +1 -0
  149. package/dist/libraries/library/src/comparison-table.d.ts +6 -0
  150. package/dist/libraries/library/src/comparison-table.d.ts.map +1 -0
  151. package/dist/libraries/library/src/library.d.ts +2 -0
  152. package/dist/libraries/library/src/library.d.ts.map +1 -1
  153. package/dist/library.cjs.js +1 -1
  154. package/dist/library.es.js +609 -605
  155. package/dist/library.es.js.map +1 -1
  156. package/dist/minus.es-BK9qA9iJ.mjs +13 -0
  157. package/dist/minus.es-BK9qA9iJ.mjs.map +1 -0
  158. package/dist/minus.es-DtXArdKK.js +2 -0
  159. package/dist/minus.es-DtXArdKK.js.map +1 -0
  160. package/dist/{modal-fTWvPEPW.mjs → modal-DCfN6q8I.mjs} +28 -28
  161. package/dist/modal-DCfN6q8I.mjs.map +1 -0
  162. package/dist/{modal-DMeRO1wE.js → modal-DZIdw9xy.js} +2 -2
  163. package/dist/modal-DZIdw9xy.js.map +1 -0
  164. package/dist/modal.cjs.js +1 -1
  165. package/dist/modal.es.js +1 -1
  166. package/dist/{notification-DE1pvk9W.js → notification-BqjaT4E7.js} +2 -2
  167. package/dist/{notification-DE1pvk9W.js.map → notification-BqjaT4E7.js.map} +1 -1
  168. package/dist/{notification-BvoL7BIW.mjs → notification-DdRS5BF2.mjs} +2 -2
  169. package/dist/{notification-BvoL7BIW.mjs.map → notification-DdRS5BF2.mjs.map} +1 -1
  170. package/dist/{notification-banner-C4gkkSlf.mjs → notification-banner-BOclxqFu.mjs} +2 -2
  171. package/dist/{notification-banner-C4gkkSlf.mjs.map → notification-banner-BOclxqFu.mjs.map} +1 -1
  172. package/dist/{notification-banner-COH7wJu2.js → notification-banner-jY8rQH2M.js} +2 -2
  173. package/dist/{notification-banner-COH7wJu2.js.map → notification-banner-jY8rQH2M.js.map} +1 -1
  174. package/dist/notification-banner.cjs.js +1 -1
  175. package/dist/notification-banner.es.js +1 -1
  176. package/dist/notification.cjs.js +1 -1
  177. package/dist/notification.es.js +1 -1
  178. package/dist/pagination-Bwlkvqye.js +2 -0
  179. package/dist/pagination-Bwlkvqye.js.map +1 -0
  180. package/dist/{pagination-BdCjh1Pi.mjs → pagination-CVYUacXN.mjs} +235 -242
  181. package/dist/pagination-CVYUacXN.mjs.map +1 -0
  182. package/dist/pagination.cjs.js +1 -1
  183. package/dist/pagination.es.js +1 -1
  184. package/dist/{popover-lxTyKALA.mjs → popover-Dwqs1wGH.mjs} +2 -2
  185. package/dist/{popover-lxTyKALA.mjs.map → popover-Dwqs1wGH.mjs.map} +1 -1
  186. package/dist/{popover-BnUVNqSi.js → popover-XCUa2GfC.js} +2 -2
  187. package/dist/{popover-BnUVNqSi.js.map → popover-XCUa2GfC.js.map} +1 -1
  188. package/dist/popover.cjs.js +1 -1
  189. package/dist/popover.es.js +1 -1
  190. package/dist/{product-card-BU1ThhCx.mjs → product-card-BfB82XpS.mjs} +2 -2
  191. package/dist/{product-card-BU1ThhCx.mjs.map → product-card-BfB82XpS.mjs.map} +1 -1
  192. package/dist/{product-card-CNBegEBW.js → product-card-bVQ7JhHj.js} +2 -2
  193. package/dist/{product-card-CNBegEBW.js.map → product-card-bVQ7JhHj.js.map} +1 -1
  194. package/dist/product-card.cjs.js +1 -1
  195. package/dist/product-card.es.js +1 -1
  196. package/dist/{promotion-card-_bPyVr9t.mjs → promotion-card-BhNw94sC.mjs} +4 -4
  197. package/dist/{promotion-card-_bPyVr9t.mjs.map → promotion-card-BhNw94sC.mjs.map} +1 -1
  198. package/dist/{promotion-card-CXNhskRl.js → promotion-card-DqBBt2sz.js} +2 -2
  199. package/dist/{promotion-card-CXNhskRl.js.map → promotion-card-DqBBt2sz.js.map} +1 -1
  200. package/dist/promotion-card.cjs.js +1 -1
  201. package/dist/promotion-card.es.js +1 -1
  202. package/dist/purpur.css +1 -1
  203. package/dist/quantity-selector-8AkKNDik.js +2 -0
  204. package/dist/quantity-selector-8AkKNDik.js.map +1 -0
  205. package/dist/{quantity-selector-CGhJ2DjO.mjs → quantity-selector-C23kU1hF.mjs} +73 -79
  206. package/dist/quantity-selector-C23kU1hF.mjs.map +1 -0
  207. package/dist/quantity-selector.cjs.js +1 -1
  208. package/dist/quantity-selector.es.js +1 -1
  209. package/dist/scss/action.scss +1 -0
  210. package/dist/{search-field-DTuEiK-M.mjs → search-field-CMBDkydb.mjs} +3 -3
  211. package/dist/{search-field-DTuEiK-M.mjs.map → search-field-CMBDkydb.mjs.map} +1 -1
  212. package/dist/{search-field-Bst9d-wX.js → search-field-CU_tsmHb.js} +2 -2
  213. package/dist/{search-field-Bst9d-wX.js.map → search-field-CU_tsmHb.js.map} +1 -1
  214. package/dist/search-field.cjs.js +1 -1
  215. package/dist/search-field.es.js +1 -1
  216. package/dist/{stepper-k0bX9m4t.mjs → stepper-uBfDdIju.mjs} +3 -3
  217. package/dist/{stepper-k0bX9m4t.mjs.map → stepper-uBfDdIju.mjs.map} +1 -1
  218. package/dist/{stepper-ClLQuoXr.js → stepper-w-raIwqJ.js} +2 -2
  219. package/dist/{stepper-ClLQuoXr.js.map → stepper-w-raIwqJ.js.map} +1 -1
  220. package/dist/stepper.cjs.js +1 -1
  221. package/dist/stepper.es.js +1 -1
  222. package/dist/{table-Ddv6BKo9.js → table-BVSBvTYG.js} +2 -2
  223. package/dist/{table-Ddv6BKo9.js.map → table-BVSBvTYG.js.map} +1 -1
  224. package/dist/{table-D_XW4smf.mjs → table-CuV3Gda_.mjs} +6 -6
  225. package/dist/{table-D_XW4smf.mjs.map → table-CuV3Gda_.mjs.map} +1 -1
  226. package/dist/table.cjs.js +1 -1
  227. package/dist/table.es.js +1 -1
  228. package/dist/{text-area-9ggiIWtJ.js → text-area-C6W0fDiQ.js} +2 -2
  229. package/dist/{text-area-9ggiIWtJ.js.map → text-area-C6W0fDiQ.js.map} +1 -1
  230. package/dist/{text-area-CpYWt99s.mjs → text-area-DDZ_GQPW.mjs} +3 -3
  231. package/dist/{text-area-CpYWt99s.mjs.map → text-area-DDZ_GQPW.mjs.map} +1 -1
  232. package/dist/text-area.cjs.js +1 -1
  233. package/dist/text-area.es.js +1 -1
  234. package/dist/{text-field-BQYzwIrG.mjs → text-field-BQfxJobW.mjs} +2 -2
  235. package/dist/{text-field-BQYzwIrG.mjs.map → text-field-BQfxJobW.mjs.map} +1 -1
  236. package/dist/{text-field-BwxGMWds.js → text-field-CYJzQG3h.js} +2 -2
  237. package/dist/{text-field-BwxGMWds.js.map → text-field-CYJzQG3h.js.map} +1 -1
  238. package/dist/text-field.cjs.js +1 -1
  239. package/dist/text-field.es.js +1 -1
  240. package/dist/theme.cjs.js +1 -1
  241. package/dist/theme.es.js +2 -2
  242. package/dist/tokens/color/variables.css +12 -12
  243. package/dist/tokens/color/variables.dark.css +13 -13
  244. package/dist/tokens/color/variables.dark.js +13 -13
  245. package/dist/tokens/color/variables.dark.json +13 -13
  246. package/dist/tokens/color/variables.dark.scss +13 -13
  247. package/dist/tokens/color/variables.js +12 -12
  248. package/dist/tokens/color/variables.json +12 -12
  249. package/dist/tokens/color/variables.scss +12 -12
  250. package/dist/tokens/gradient/variables.dark.js +4 -4
  251. package/dist/tokens/gradient/variables.dark.json +4 -4
  252. package/dist/tokens/gradient/variables.dark.scss +4 -4
  253. package/dist/tokens/gradient/variables.js +4 -4
  254. package/dist/tokens/gradient/variables.json +4 -4
  255. package/dist/tokens/gradient/variables.scss +4 -4
  256. package/dist/tokens.cjs.js +1 -1
  257. package/dist/tokens.cjs.js.map +1 -1
  258. package/dist/tokens.es.js +41 -41
  259. package/dist/tokens.es.js.map +1 -1
  260. package/dist/{tooltip-BatXMflw.js → tooltip-0pLBlDG3.js} +2 -2
  261. package/dist/{tooltip-BatXMflw.js.map → tooltip-0pLBlDG3.js.map} +1 -1
  262. package/dist/{tooltip-CZzwHkea.mjs → tooltip-Kom0VfOC.mjs} +2 -2
  263. package/dist/{tooltip-CZzwHkea.mjs.map → tooltip-Kom0VfOC.mjs.map} +1 -1
  264. package/dist/tooltip.cjs.js +1 -1
  265. package/dist/tooltip.es.js +1 -1
  266. package/dist/useColorScheme-0GMDl2GF.js +2 -0
  267. package/dist/{useColorScheme-DNNu9bz0.js.map → useColorScheme-0GMDl2GF.js.map} +1 -1
  268. package/dist/{useColorScheme-9rgSgG0N.mjs → useColorScheme-Di_Q0JR4.mjs} +2 -2
  269. package/dist/{useColorScheme-9rgSgG0N.mjs.map → useColorScheme-Di_Q0JR4.mjs.map} +1 -1
  270. package/dist/{variables-BVgnpUH9.mjs → variables-CKp4o9Tn.mjs} +2 -2
  271. package/dist/{variables-BVgnpUH9.mjs.map → variables-CKp4o9Tn.mjs.map} +1 -1
  272. package/dist/{variables-CMzMXeor.js → variables-DH61hVNE.js} +2 -2
  273. package/dist/{variables-CMzMXeor.js.map → variables-DH61hVNE.js.map} +1 -1
  274. package/package.json +45 -43
  275. package/src/aliases.ts +11 -0
  276. package/src/carousel.ts +6 -0
  277. package/src/comparison-table.ts +6 -0
  278. package/src/entries.js +2 -0
  279. package/src/library.ts +4 -0
  280. package/tokens/color/variables.css +12 -12
  281. package/tokens/color/variables.dark.css +13 -13
  282. package/tokens/color/variables.dark.js +13 -13
  283. package/tokens/color/variables.dark.json +13 -13
  284. package/tokens/color/variables.dark.scss +13 -13
  285. package/tokens/color/variables.js +12 -12
  286. package/tokens/color/variables.json +12 -12
  287. package/tokens/color/variables.scss +12 -12
  288. package/tokens/gradient/variables.dark.js +4 -4
  289. package/tokens/gradient/variables.dark.json +4 -4
  290. package/tokens/gradient/variables.dark.scss +4 -4
  291. package/tokens/gradient/variables.js +4 -4
  292. package/tokens/gradient/variables.json +4 -4
  293. package/tokens/gradient/variables.scss +4 -4
  294. package/dist/accordion-DX8efWOt.js +0 -2
  295. package/dist/button-Cv7NlYbv.mjs +0 -109
  296. package/dist/button-Dqxdc3nC.js +0 -2
  297. package/dist/card-VMa3cGCP.js +0 -2
  298. package/dist/content-block-BMOvlH7a.mjs.map +0 -1
  299. package/dist/content-block-Cd7xSE8t.js.map +0 -1
  300. package/dist/dropdown-BC6evqyq.js +0 -2
  301. package/dist/dropdown-BC6evqyq.js.map +0 -1
  302. package/dist/dropdown-C-Ze4gvG.mjs +0 -771
  303. package/dist/dropdown-C-Ze4gvG.mjs.map +0 -1
  304. package/dist/modal-DMeRO1wE.js.map +0 -1
  305. package/dist/modal-fTWvPEPW.mjs.map +0 -1
  306. package/dist/pagination-BdCjh1Pi.mjs.map +0 -1
  307. package/dist/pagination-C2A8NPol.js +0 -2
  308. package/dist/pagination-C2A8NPol.js.map +0 -1
  309. package/dist/quantity-selector-BV7QwVlT.js +0 -2
  310. package/dist/quantity-selector-BV7QwVlT.js.map +0 -1
  311. package/dist/quantity-selector-CGhJ2DjO.mjs.map +0 -1
  312. package/dist/useColorScheme-DNNu9bz0.js +0 -2
@@ -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,13 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { b as i } from "./icon-DNHpBTHs-JfI8WyiR.mjs";
3
+ const r = {
4
+ name: "minus",
5
+ svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.1 12a.9.9 0 0 1 .9-.9h14a.9.9 0 1 1 0 1.8H5a.9.9 0 0 1-.9-.9Z" clip-rule="evenodd"/></svg>',
6
+ keywords: ["minus"],
7
+ category: "utility"
8
+ }, s = (o) => /* @__PURE__ */ e(i, { ...o, svg: r });
9
+ s.displayName = "IconMinus";
10
+ export {
11
+ s as e
12
+ };
13
+ //# sourceMappingURL=minus.es-BK9qA9iJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minus.es-BK9qA9iJ.mjs","sources":["../../../components/icon/dist/components/minus.es.js"],"sourcesContent":["import { jsx as s } from \"react/jsx-runtime\";\nimport { I as n } from \"../icon-DNHpBTHs.mjs\";\nconst i = {\n name: \"minus\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M4.1 12a.9.9 0 0 1 .9-.9h14a.9.9 0 1 1 0 1.8H5a.9.9 0 0 1-.9-.9Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"minus\"],\n category: \"utility\"\n}, e = (o) => /* @__PURE__ */ s(n, { ...o, svg: i });\ne.displayName = \"IconMinus\";\nexport {\n e as IconMinus\n};\n//# sourceMappingURL=minus.es.js.map\n"],"names":["i","e","s","n"],"mappings":";;AAEK,MAACA,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,OAAO;AAAA,EAClB,UAAU;AACZ,GAAGC,IAAI,CAAC,MAAsBC,gBAAAA,EAAEC,GAAG,EAAE,GAAG,GAAG,KAAKH,EAAC,CAAE;AACnDC,EAAE,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const i=require("react/jsx-runtime"),n=require("./icon-DNHpBTHs-faYHqTXU.js"),o={name:"minus",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.1 12a.9.9 0 0 1 .9-.9h14a.9.9 0 1 1 0 1.8H5a.9.9 0 0 1-.9-.9Z" clip-rule="evenodd"/></svg>',keywords:["minus"],category:"utility"},e=s=>i.jsx(n.b,{...s,svg:o});e.displayName="IconMinus";exports.e=e;
2
+ //# sourceMappingURL=minus.es-DtXArdKK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minus.es-DtXArdKK.js","sources":["../../../components/icon/dist/components/minus.es.js"],"sourcesContent":["import { jsx as s } from \"react/jsx-runtime\";\nimport { I as n } from \"../icon-DNHpBTHs.mjs\";\nconst i = {\n name: \"minus\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M4.1 12a.9.9 0 0 1 .9-.9h14a.9.9 0 1 1 0 1.8H5a.9.9 0 0 1-.9-.9Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"minus\"],\n category: \"utility\"\n}, e = (o) => /* @__PURE__ */ s(n, { ...o, svg: i });\ne.displayName = \"IconMinus\";\nexport {\n e as IconMinus\n};\n//# sourceMappingURL=minus.es.js.map\n"],"names":["i","o","s","n"],"mappings":"2FAEMA,EAAI,CACR,KAAM,QACN,IAAK,6MACL,SAAU,CAAC,OAAO,EAClB,SAAU,SACZ,EAAG,EAAKC,GAAsBC,EAAAA,IAAEC,EAAAA,EAAG,CAAE,GAAGF,EAAG,IAAKD,CAAC,CAAE,EACnD,EAAE,YAAc"}
@@ -1,16 +1,16 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as l, 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
- 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-Cv7NlYbv.mjs";
3
+ import { forwardRef as I, useState as P, useRef as b, useCallback as Z, useEffect as g } from "react";
4
+ import { b as tt } from "./button-4-yWOgtD.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";
8
8
  import { V as nt } from "./visually-hidden-BYFkJEp1.mjs";
9
9
  import { c as at } from "./bind-CU-R61T-.mjs";
10
- const lt = "_fadeIn_slvdi_1", st = "_fadeOut_slvdi_1", dt = "_slideUp_slvdi_1", it = "_slideDown_slvdi_1", _t = {
10
+ const st = "_fadeIn_slvdi_1", lt = "_fadeOut_slvdi_1", dt = "_slideUp_slvdi_1", it = "_slideDown_slvdi_1", _t = {
11
11
  "purpur-modal-content": "_purpur-modal-content_slvdi_1",
12
- fadeIn: lt,
13
- fadeOut: st,
12
+ fadeIn: st,
13
+ fadeOut: lt,
14
14
  slideUp: dt,
15
15
  slideDown: it,
16
16
  "purpur-modal-content__overlay": "_purpur-modal-content__overlay_slvdi_49",
@@ -45,41 +45,41 @@ const lt = "_fadeIn_slvdi_1", st = "_fadeOut_slvdi_1", dt = "_slideUp_slvdi_1",
45
45
  notification: w = void 0,
46
46
  zIndex: D,
47
47
  onCloseAutoFocus: E,
48
- ...b
48
+ ...y
49
49
  }, S) => {
50
- const { closeButtonAriaLabel: m, showCloseButton: T, ...B } = b, [V, W] = P(!1), [z, A] = P(0), p = y(null), v = y(null), F = r(
50
+ const { closeButtonAriaLabel: m, showCloseButton: T, ...B } = y, [V, W] = P(!1), [z, A] = P(0), p = b(null), v = b(null), F = r(
51
51
  e,
52
52
  { [`${e}--with-image`]: !!u },
53
53
  { [`${e}--overflow`]: V },
54
54
  { [`${e}--sticky-footer`]: f },
55
55
  _
56
- ), d = (l) => o ? `${o} ${l}` : void 0, L = (l) => {
57
- C && l.preventDefault();
56
+ ), d = (s) => o ? `${o} ${s}` : void 0, L = (s) => {
57
+ C && s.preventDefault();
58
58
  }, i = Z(() => {
59
59
  if (!p.current || !v.current)
60
60
  return;
61
- const l = window.getComputedStyle(p.current, null), h = parseFloat(l.getPropertyValue("height")), K = v.current.offsetHeight;
61
+ const s = window.getComputedStyle(p.current, null), h = parseFloat(s.getPropertyValue("height")), K = v.current.offsetHeight;
62
62
  W(h < K), A(
63
63
  (p.current.offsetWidth ?? 0) - (p.current.clientWidth ?? 0)
64
64
  );
65
65
  }, []), U = () => {
66
- const l = v.current;
67
- if (l) {
68
- const h = l.querySelector("h2");
66
+ const s = v.current;
67
+ if (s) {
68
+ const h = s.querySelector("h2");
69
69
  h && setTimeout(() => {
70
70
  h.focus();
71
71
  });
72
72
  }
73
- }, j = (l) => {
74
- C && !T && l.preventDefault();
73
+ }, j = (s) => {
74
+ C && !T && s.preventDefault();
75
75
  };
76
76
  return g(() => (window.addEventListener("resize", i), () => {
77
77
  window.removeEventListener("resize", i);
78
78
  }), [i]), g(() => {
79
79
  i();
80
- }, [w, a, i]), /* @__PURE__ */ s(k, { children: [
80
+ }, [w, a, i]), /* @__PURE__ */ l(k, { children: [
81
81
  /* @__PURE__ */ t(q, { className: r(`${e}__overlay`), style: { zIndex: D } }),
82
- /* @__PURE__ */ s(
82
+ /* @__PURE__ */ l(
83
83
  G,
84
84
  {
85
85
  ...B,
@@ -95,8 +95,8 @@ const lt = "_fadeIn_slvdi_1", st = "_fadeOut_slvdi_1", dt = "_slideUp_slvdi_1",
95
95
  onCloseAutoFocus: E,
96
96
  style: { zIndex: `calc(${D} + 1)` },
97
97
  children: [
98
- /* @__PURE__ */ s("div", { ref: p, className: r(`${e}__wrapper`), children: [
99
- R(b) && m && u && /* @__PURE__ */ t(
98
+ /* @__PURE__ */ l("div", { ref: p, className: r(`${e}__wrapper`), children: [
99
+ R(y) && m && u && /* @__PURE__ */ t(
100
100
  x,
101
101
  {
102
102
  "aria-label": m,
@@ -105,9 +105,9 @@ const lt = "_fadeIn_slvdi_1", st = "_fadeOut_slvdi_1", dt = "_slideUp_slvdi_1",
105
105
  "data-testid": d("close-button")
106
106
  }
107
107
  ),
108
- /* @__PURE__ */ s("div", { ref: v, className: r(`${e}__wrapper-inner`), children: [
109
- /* @__PURE__ */ s("div", { className: r(`${e}__header`), children: [
110
- R(b) && m && !u && /* @__PURE__ */ t(
108
+ /* @__PURE__ */ l("div", { ref: v, className: r(`${e}__wrapper-inner`), children: [
109
+ /* @__PURE__ */ l("div", { className: r(`${e}__header`), children: [
110
+ R(y) && m && !u && /* @__PURE__ */ t(
111
111
  x,
112
112
  {
113
113
  "aria-label": m,
@@ -120,7 +120,7 @@ const lt = "_fadeIn_slvdi_1", st = "_fadeOut_slvdi_1", dt = "_slideUp_slvdi_1",
120
120
  asChild: !0,
121
121
  className: r(`${e}__title`),
122
122
  "data-testid": d("title"),
123
- children: /* @__PURE__ */ t(et, { tag: "h2", variant: "title-200", tabIndex: -1, children: M })
123
+ children: /* @__PURE__ */ t(et, { tag: "h2", variant: "display-10", tabIndex: -1, children: M })
124
124
  }
125
125
  )
126
126
  ] }),
@@ -132,7 +132,7 @@ const lt = "_fadeIn_slvdi_1", st = "_fadeOut_slvdi_1", dt = "_slideUp_slvdi_1",
132
132
  children: u
133
133
  }
134
134
  ),
135
- /* @__PURE__ */ t("div", { className: r(`${e}__body`), children: /* @__PURE__ */ s("div", { className: r(`${e}__body-inner`), children: [
135
+ /* @__PURE__ */ t("div", { className: r(`${e}__body`), children: /* @__PURE__ */ l("div", { className: r(`${e}__body-inner`), children: [
136
136
  c && N && /* @__PURE__ */ t(nt, { asChild: !0, children: /* @__PURE__ */ t(O, { "data-testid": d("description"), children: c }) }),
137
137
  c && !N && /* @__PURE__ */ t(
138
138
  O,
@@ -176,10 +176,10 @@ const lt = "_fadeIn_slvdi_1", st = "_fadeOut_slvdi_1", dt = "_slideUp_slvdi_1",
176
176
  actions: o,
177
177
  notification: n
178
178
  }) => {
179
- const a = y(null);
179
+ const a = b(null);
180
180
  return g(() => {
181
181
  n && a?.current?.scrollIntoView?.(!1);
182
- }, [n]), o ? /* @__PURE__ */ s("div", { className: r(`${e}__actions`), children: [
182
+ }, [n]), o ? /* @__PURE__ */ l("div", { className: r(`${e}__actions`), children: [
183
183
  /* @__PURE__ */ t("div", { className: r(`${e}__actions-buttons`), "data-testid": "modal actions", children: o }),
184
184
  n && /* @__PURE__ */ t("div", { className: r(`${e}__notification`), ref: a, children: n }),
185
185
  /* @__PURE__ */ t("span", { className: r(`${e}__actions-separator`) })
@@ -198,4 +198,4 @@ $.displayName = "Modal";
198
198
  export {
199
199
  $ as M
200
200
  };
201
- //# sourceMappingURL=modal-fTWvPEPW.mjs.map
201
+ //# sourceMappingURL=modal-DCfN6q8I.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal-DCfN6q8I.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=\"display-10\" 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,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,4BAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,OAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,QAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,GAAGnB;AAAA,EAAA,GAELoB,MACG;AACH,UAAM,EAAE,sBAAAC,GAAsB,iBAAAC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I,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,2 +1,2 @@
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
+ "use strict";const e=require("react/jsx-runtime"),d=require("./index-2cFVyGXq.js"),a=require("react"),F=require("./button-DmybVApa.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:s,children:o,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,o,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:"display-10",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:o}),!x&&e.jsx(R,{actions:s,notification:j})]})})]})]}),x&&e.jsx(R,{actions:s,notification:j})]})]})}),C=({["aria-label"]:n,hasImage:s,scrollbarWidth:o,["data-testid"]:u})=>e.jsx(d.Close,{asChild:!0,children:e.jsx(F.Button,{variant:s?"primary":"tertiary-purple",negative:s,size:"sm",iconOnly:!0,"aria-label":n,className:r(`${t}__close-button`),style:{right:`calc(var(--purpur-spacing-100) + ${o||0}px)`},"data-testid":u,children:e.jsx(U.r,{})})}),R=({actions:n,notification:s})=>{const o=a.useRef(null);return a.useEffect(()=>{s&&o?.current?.scrollIntoView?.(!1)},[s]),n?e.jsxs("div",{className:r(`${t}__actions`),children:[e.jsx("div",{className:r(`${t}__actions-buttons`),"data-testid":"modal actions",children:n}),s&&e.jsx("div",{className:r(`${t}__notification`),ref:o,children:s}),e.jsx("span",{className:r(`${t}__actions-separator`)})]}):null},ee=a.forwardRef(({children:n,...s},o)=>e.jsx(d.Trigger,{asChild:!0,ref:o,...s,children:n})),w=({["data-testid"]:n,children:s,open:o,onOpenChange:u})=>e.jsx(d.Root,{open:o,onOpenChange:u,"data-testid":n,children:s});w.Trigger=ee;w.Content=Z;w.displayName="Modal";exports.Modal=w;
2
+ //# sourceMappingURL=modal-DZIdw9xy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal-DZIdw9xy.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=\"display-10\" 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,CAAE,CAAC,GAAGA,CAAa,cAAc,EAAG,CAAC,CAACU,CAAA,EACtC,CAAE,CAAC,GAAGV,CAAa,YAAY,EAAGoB,CAAA,EAClC,CAAE,CAAC,GAAGpB,CAA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,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"}
package/dist/modal.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./modal-DMeRO1wE.js");exports.Modal=e.Modal;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./modal-DZIdw9xy.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-fTWvPEPW.mjs";
1
+ import { M as r } from "./modal-DCfN6q8I.mjs";
2
2
  export {
3
3
  r as Modal
4
4
  };
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("react/jsx-runtime"),y=require("react"),O=require("./button-Dqxdc3nC.js"),A=require("./heading-drD5ugCC.js"),d=require("./icon.es-j3eRib6d.js"),I=require("./error-filled.es-BbS_Oggw.js"),R=require("./paragraph-BsI53OR0.js"),$=require("./bind-DeUYJ6m9.js"),S={name:"alert-filled",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>',keywords:["alert-filled"],category:"status"},C={name:"check-circle-filled",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>',keywords:["check-circle-filled"],category:"status"},L={name:"close",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>',keywords:["close"],category:"utility"},E={name:"info-filled",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>',keywords:["info-filled"],category:"status"},Z={name:"sparkles",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>',keywords:["sparkles"],category:"ai"},k={"purpur-notification":"_purpur-notification_1c3oj_1","purpur-notification__top":"_purpur-notification__top_1c3oj_14","purpur-notification__header":"_purpur-notification__header_1c3oj_20","purpur-notification__close-button":"_purpur-notification__close-button_1c3oj_25","purpur-notification__icon":"_purpur-notification__icon_1c3oj_31","purpur-notification__body":"_purpur-notification__body_1c3oj_35","purpur-notification__body--extra-padding":"_purpur-notification__body--extra-padding_1c3oj_38","purpur-notification--success":"_purpur-notification--success_1c3oj_41","purpur-notification__heading":"_purpur-notification__heading_1c3oj_44","purpur-notification--warning":"_purpur-notification--warning_1c3oj_50","purpur-notification--error":"_purpur-notification--error_1c3oj_59","purpur-notification--info":"_purpur-notification--info_1c3oj_68","purpur-notification--ai":"_purpur-notification--ai_1c3oj_77","purpur-notification--hidden":"_purpur-notification--hidden_1c3oj_92","purpur-notification--has-close-button":"_purpur-notification--has-close-button_1c3oj_96"},n=$.c.bind(k),e={SUCCESS:"success",WARNING:"warning",ERROR:"error",INFO:"info",AI:"ai"},T=Object.values(e),f={POLITE:"polite",ASSERTIVE:"assertive"},F=Object.values(f),v={ALERT:"alert",DIALOG:"dialog",ALERTDIALOG:"alertdialog"},q=Object.values(v),t="purpur-notification",M=i=>{switch(i){case e.AI:return Z;case e.INFO:return E;case e.SUCCESS:return C;case e.WARNING:return S;case e.ERROR:return I.e}},g=y.forwardRef(({["data-testid"]:i,["aria-live"]:h,children:a,className:w,closeButtonAriaLabel:b,headingTag:j="h4",status:u="info",heading:s,hidden:l,id:r,onClose:c,open:N=!0,hideIcon:_,...m},x)=>{const p=!!s||!_;return o.jsx("div",{"aria-live":h,children:N&&o.jsxs("div",{id:r,"aria-labelledby":r?`${r}-heading`:void 0,"aria-describedby":r?`${r}-body`:void 0,"aria-hidden":!!l,className:n(w,t,`${t}--${u}`,{[`${t}--hidden`]:l,[`${t}--has-close-button`]:!!c}),"data-testid":i,ref:x,...m,children:[p&&o.jsx("div",{className:n(`${t}__top`),children:o.jsxs("div",{className:n(`${t}__header`),children:[!_&&o.jsx(d.b,{"data-testid":i?`${i}-icon`:void 0,className:n(`${t}__icon`),svg:M(u),size:"sm"}),!!s&&o.jsx(A.Heading,{"data-testid":i?`${i}-heading`:void 0,variant:"subsection-100",tag:j,className:n(`${t}__heading`),children:o.jsxs("span",{id:r?`${r}-heading`:void 0,children:[" ",s]})})]})}),c&&o.jsx(O.Button,{"data-testid":i?`${i}-close-button`:void 0,variant:"text",size:"sm",iconOnly:!0,"aria-label":b,onClick:c,className:n(`${t}__close-button`),children:o.jsx(d.b,{svg:L,size:"md"})}),a&&o.jsx("div",{"data-testid":i?`${i}-body`:void 0,className:n(`${t}__body`,{[`${t}__body--extra-padding`]:!p&&!!c}),id:r?`${r}-body`:void 0,children:typeof a=="string"?o.jsx(R.Paragraph,{"data-testid":i?`${i}-paragraph`:void 0,variant:"paragraph-100",children:a}):a})]})})});g.displayName="Notification";exports.NOTIFICATION_ARIA_LIVE=f;exports.NOTIFICATION_ROLE=v;exports.NOTIFICATION_STATUS=e;exports.Notification=g;exports.notificationAriaLiveValues=F;exports.notificationRoles=q;exports.notificationStatuses=T;
2
- //# sourceMappingURL=notification-DE1pvk9W.js.map
1
+ "use strict";const o=require("react/jsx-runtime"),y=require("react"),O=require("./button-DmybVApa.js"),A=require("./heading-drD5ugCC.js"),d=require("./icon.es-j3eRib6d.js"),I=require("./error-filled.es-BbS_Oggw.js"),R=require("./paragraph-BsI53OR0.js"),$=require("./bind-DeUYJ6m9.js"),S={name:"alert-filled",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>',keywords:["alert-filled"],category:"status"},C={name:"check-circle-filled",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>',keywords:["check-circle-filled"],category:"status"},L={name:"close",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>',keywords:["close"],category:"utility"},E={name:"info-filled",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>',keywords:["info-filled"],category:"status"},Z={name:"sparkles",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>',keywords:["sparkles"],category:"ai"},k={"purpur-notification":"_purpur-notification_1c3oj_1","purpur-notification__top":"_purpur-notification__top_1c3oj_14","purpur-notification__header":"_purpur-notification__header_1c3oj_20","purpur-notification__close-button":"_purpur-notification__close-button_1c3oj_25","purpur-notification__icon":"_purpur-notification__icon_1c3oj_31","purpur-notification__body":"_purpur-notification__body_1c3oj_35","purpur-notification__body--extra-padding":"_purpur-notification__body--extra-padding_1c3oj_38","purpur-notification--success":"_purpur-notification--success_1c3oj_41","purpur-notification__heading":"_purpur-notification__heading_1c3oj_44","purpur-notification--warning":"_purpur-notification--warning_1c3oj_50","purpur-notification--error":"_purpur-notification--error_1c3oj_59","purpur-notification--info":"_purpur-notification--info_1c3oj_68","purpur-notification--ai":"_purpur-notification--ai_1c3oj_77","purpur-notification--hidden":"_purpur-notification--hidden_1c3oj_92","purpur-notification--has-close-button":"_purpur-notification--has-close-button_1c3oj_96"},n=$.c.bind(k),e={SUCCESS:"success",WARNING:"warning",ERROR:"error",INFO:"info",AI:"ai"},T=Object.values(e),f={POLITE:"polite",ASSERTIVE:"assertive"},F=Object.values(f),v={ALERT:"alert",DIALOG:"dialog",ALERTDIALOG:"alertdialog"},q=Object.values(v),t="purpur-notification",M=i=>{switch(i){case e.AI:return Z;case e.INFO:return E;case e.SUCCESS:return C;case e.WARNING:return S;case e.ERROR:return I.e}},g=y.forwardRef(({["data-testid"]:i,["aria-live"]:h,children:a,className:w,closeButtonAriaLabel:b,headingTag:j="h4",status:u="info",heading:s,hidden:l,id:r,onClose:c,open:N=!0,hideIcon:_,...m},x)=>{const p=!!s||!_;return o.jsx("div",{"aria-live":h,children:N&&o.jsxs("div",{id:r,"aria-labelledby":r?`${r}-heading`:void 0,"aria-describedby":r?`${r}-body`:void 0,"aria-hidden":!!l,className:n(w,t,`${t}--${u}`,{[`${t}--hidden`]:l,[`${t}--has-close-button`]:!!c}),"data-testid":i,ref:x,...m,children:[p&&o.jsx("div",{className:n(`${t}__top`),children:o.jsxs("div",{className:n(`${t}__header`),children:[!_&&o.jsx(d.b,{"data-testid":i?`${i}-icon`:void 0,className:n(`${t}__icon`),svg:M(u),size:"sm"}),!!s&&o.jsx(A.Heading,{"data-testid":i?`${i}-heading`:void 0,variant:"subsection-100",tag:j,className:n(`${t}__heading`),children:o.jsxs("span",{id:r?`${r}-heading`:void 0,children:[" ",s]})})]})}),c&&o.jsx(O.Button,{"data-testid":i?`${i}-close-button`:void 0,variant:"text",size:"sm",iconOnly:!0,"aria-label":b,onClick:c,className:n(`${t}__close-button`),children:o.jsx(d.b,{svg:L,size:"md"})}),a&&o.jsx("div",{"data-testid":i?`${i}-body`:void 0,className:n(`${t}__body`,{[`${t}__body--extra-padding`]:!p&&!!c}),id:r?`${r}-body`:void 0,children:typeof a=="string"?o.jsx(R.Paragraph,{"data-testid":i?`${i}-paragraph`:void 0,variant:"paragraph-100",children:a}):a})]})})});g.displayName="Notification";exports.NOTIFICATION_ARIA_LIVE=f;exports.NOTIFICATION_ROLE=v;exports.NOTIFICATION_STATUS=e;exports.Notification=g;exports.notificationAriaLiveValues=F;exports.notificationRoles=q;exports.notificationStatuses=T;
2
+ //# sourceMappingURL=notification-BqjaT4E7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification-DE1pvk9W.js","sources":["../../../components/icon/dist/assets/alert-filled.es.js","../../../components/icon/dist/assets/check-circle-filled.es.js","../../../components/icon/dist/assets/close.es.js","../../../components/icon/dist/assets/info-filled.es.js","../../../components/icon/dist/assets/sparkles.es.js","../../../components/notification/src/notification.tsx"],"sourcesContent":["const l = {\n name: \"alert-filled\",\n 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>',\n keywords: [\"alert-filled\"],\n category: \"status\"\n};\nexport {\n l as alertFilled\n};\n//# sourceMappingURL=alert-filled.es.js.map\n","const e = {\n name: \"check-circle-filled\",\n 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>',\n keywords: [\"check-circle-filled\"],\n category: \"status\"\n};\nexport {\n e as checkCircleFilled\n};\n//# sourceMappingURL=check-circle-filled.es.js.map\n","const l = {\n name: \"close\",\n 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>',\n keywords: [\"close\"],\n category: \"utility\"\n};\nexport {\n l as close\n};\n//# sourceMappingURL=close.es.js.map\n","const e = {\n name: \"info-filled\",\n 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>',\n keywords: [\"info-filled\"],\n category: \"status\"\n};\nexport {\n e as infoFilled\n};\n//# sourceMappingURL=info-filled.es.js.map\n","const a = {\n name: \"sparkles\",\n 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>',\n keywords: [\"sparkles\"],\n category: \"ai\"\n};\nexport {\n a as sparkles\n};\n//# sourceMappingURL=sparkles.es.js.map\n","import React, { forwardRef } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { Icon } from \"@purpur/icon\";\nimport { alertFilled } from \"@purpur/icon/assets/alert-filled\";\nimport { checkCircleFilled } from \"@purpur/icon/assets/check-circle-filled\";\nimport { close } from \"@purpur/icon/assets/close\";\nimport { errorFilled } from \"@purpur/icon/assets/error-filled\";\nimport { infoFilled } from \"@purpur/icon/assets/info-filled\";\nimport { sparkles } from \"@purpur/icon/assets/sparkles\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./notification.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport const NOTIFICATION_STATUS = {\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n INFO: \"info\",\n AI: \"ai\",\n} as const;\n\nexport const notificationStatuses = Object.values(NOTIFICATION_STATUS);\nexport type NotificationStatus = (typeof NOTIFICATION_STATUS)[keyof typeof NOTIFICATION_STATUS];\n\nexport const NOTIFICATION_ARIA_LIVE = {\n POLITE: \"polite\",\n ASSERTIVE: \"assertive\",\n} as const;\n\nexport const notificationAriaLiveValues = Object.values(NOTIFICATION_ARIA_LIVE);\nexport type NotificationAriaLive =\n (typeof NOTIFICATION_ARIA_LIVE)[keyof typeof NOTIFICATION_ARIA_LIVE];\n\nexport const NOTIFICATION_ROLE = {\n ALERT: \"alert\",\n DIALOG: \"dialog\",\n ALERTDIALOG: \"alertdialog\",\n} as const;\n\nexport const notificationRoles = Object.values(NOTIFICATION_ROLE);\nexport type NotificationRole = (typeof NOTIFICATION_ROLE)[keyof typeof NOTIFICATION_ROLE];\n\nconst rootClassName = \"purpur-notification\";\n\nconst getStatusIcon = (status: NotificationStatus) => {\n switch (status) {\n case NOTIFICATION_STATUS.AI:\n return sparkles;\n case NOTIFICATION_STATUS.INFO:\n return infoFilled;\n case NOTIFICATION_STATUS.SUCCESS:\n return checkCircleFilled;\n case NOTIFICATION_STATUS.WARNING:\n return alertFilled;\n case NOTIFICATION_STATUS.ERROR:\n return errorFilled;\n }\n};\n\ntype DefaultProps = BaseProps & {\n [\"aria-live\"]?: NotificationAriaLive;\n headingTag?: HeadingTagType;\n status?: NotificationStatus;\n heading?: string;\n role?: NotificationRole;\n hidden?: boolean;\n /**\n * Use to explicitly not open the notification initially and open it programatically to trigger\n * that the aria-live message is read by the screen reader correctly.\n */\n open?: boolean;\n hideIcon?: boolean;\n};\n\ntype CloseButtonProps = {\n onClose: () => void;\n closeButtonAriaLabel: string;\n};\n\ntype NoCloseButtonProps = {\n onClose?: never;\n closeButtonAriaLabel?: never;\n};\n\nexport type NotificationProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n [\"aria-live\"]: ariaLive,\n children,\n className,\n closeButtonAriaLabel,\n headingTag = \"h4\",\n status = \"info\",\n heading,\n hidden,\n id,\n onClose,\n open = true,\n hideIcon,\n ...props\n },\n ref\n ) => {\n const showHeader = !!heading || !hideIcon;\n\n return (\n <div aria-live={ariaLive}>\n {open && (\n <div\n id={id}\n aria-labelledby={id ? `${id}-heading` : undefined}\n aria-describedby={id ? `${id}-body` : undefined}\n aria-hidden={!!hidden}\n className={cx(className, rootClassName, `${rootClassName}--${status}`, {\n [`${rootClassName}--hidden`]: hidden,\n [`${rootClassName}--has-close-button`]: !!onClose,\n })}\n data-testid={dataTestId}\n ref={ref}\n {...props}\n >\n {showHeader && (\n <div className={cx(`${rootClassName}__top`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {!hideIcon && (\n <Icon\n data-testid={dataTestId ? `${dataTestId}-icon` : undefined}\n className={cx(`${rootClassName}__icon`)}\n svg={getStatusIcon(status)}\n size=\"sm\"\n />\n )}\n {!!heading && (\n <Heading\n data-testid={dataTestId ? `${dataTestId}-heading` : undefined}\n variant=\"subsection-100\"\n tag={headingTag}\n className={cx(`${rootClassName}__heading`)}\n >\n <span id={id ? `${id}-heading` : undefined}> {heading}</span>\n </Heading>\n )}\n </div>\n </div>\n )}\n {onClose && (\n <Button\n data-testid={dataTestId ? `${dataTestId}-close-button` : undefined}\n variant=\"text\"\n size=\"sm\"\n iconOnly\n aria-label={closeButtonAriaLabel}\n onClick={onClose}\n className={cx(`${rootClassName}__close-button`)}\n >\n <Icon svg={close} size=\"md\" />\n </Button>\n )}\n {children && (\n <div\n data-testid={dataTestId ? `${dataTestId}-body` : undefined}\n className={cx(`${rootClassName}__body`, {\n [`${rootClassName}__body--extra-padding`]: !showHeader && !!onClose,\n })}\n id={id ? `${id}-body` : undefined}\n >\n {typeof children === \"string\" ? (\n <Paragraph\n data-testid={dataTestId ? `${dataTestId}-paragraph` : undefined}\n variant=\"paragraph-100\"\n >\n {children}\n </Paragraph>\n ) : (\n children\n )}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nNotification.displayName = \"Notification\";\n"],"names":["l","e","a","cx","c","styles","NOTIFICATION_STATUS","notificationStatuses","NOTIFICATION_ARIA_LIVE","notificationAriaLiveValues","NOTIFICATION_ROLE","notificationRoles","rootClassName","getStatusIcon","status","sparkles","infoFilled","checkCircleFilled","alertFilled","errorFilled","Notification","forwardRef","dataTestId","ariaLive","children","className","closeButtonAriaLabel","headingTag","heading","hidden","id","onClose","open","hideIcon","props","ref","showHeader","jsx","jsxs","Icon","Heading","Button","close","Paragraph"],"mappings":"6RAAMA,EAAI,CACR,KAAM,eACN,IAAK,kZACL,SAAU,CAAC,cAAc,EACzB,SAAU,QACZ,ECLMC,EAAI,CACR,KAAM,sBACN,IAAK,8UACL,SAAU,CAAC,qBAAqB,EAChC,SAAU,QACZ,ECLMD,EAAI,CACR,KAAM,QACN,IAAK,8VACL,SAAU,CAAC,OAAO,EAClB,SAAU,SACZ,ECLMC,EAAI,CACR,KAAM,cACN,IAAK,yXACL,SAAU,CAAC,aAAa,EACxB,SAAU,QACZ,ECLMC,EAAI,CACR,KAAM,WACN,IAAK,ijCACL,SAAU,CAAC,UAAU,EACrB,SAAU,IACZ,mjCCWMC,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAEXC,EAAsB,CACjC,QAAS,UACT,QAAS,UACT,MAAO,QACP,KAAM,OACN,GAAI,IACN,EAEaC,EAAuB,OAAO,OAAOD,CAAmB,EAGxDE,EAAyB,CACpC,OAAQ,SACR,UAAW,WACb,EAEaC,EAA6B,OAAO,OAAOD,CAAsB,EAIjEE,EAAoB,CAC/B,MAAO,QACP,OAAQ,SACR,YAAa,aACf,EAEaC,EAAoB,OAAO,OAAOD,CAAiB,EAG1DE,EAAgB,sBAEhBC,EAAiBC,GAA+B,CACpD,OAAQA,EAAA,CACN,KAAKR,EAAoB,GACvB,OAAOS,EACT,KAAKT,EAAoB,KACvB,OAAOU,EACT,KAAKV,EAAoB,QACvB,OAAOW,EACT,KAAKX,EAAoB,QACvB,OAAOY,EACT,KAAKZ,EAAoB,MACvB,OAAOa,EAAAA,CAAA,CAEb,EA6BaC,EAAeC,EAAAA,WAC1B,CACE,CACE,CAAC,eAAgBC,EACjB,CAAC,aA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A,CAAA,CACxD,CAAA,CAEJ,CAAA,CACF,EAEDG,GACCM,EAAAA,IAACI,EAAAA,OAAA,CACC,cAAanB,EAAa,GAAGA,CAAU,gBAAkB,OACzD,QAAQ,OACR,KAAK,KACL,SAAQ,GACR,aAAYI,EACZ,QAASK,EACT,UAAW5B,EAAG,GAAGS,CAAa,gBAAgB,EAE9C,SAAAyB,EAAAA,IAACE,IAAA,CAAK,IAAKG,EAAO,KAAK,IAAA,CAAK,CAAA,CAAA,EAG/BlB,GACCa,EAAAA,IAAC,MAAA,CACC,cAAaf,EAAa,GAAGA,CAAU,QAAU,OACjD,UAAWnB,EAAG,GAAGS,CAAa,SAAU,CACtC,CAAC,GAAGA,CAAa,uBAAuB,EAAG,CAACwB,GAAc,CAAC,CAACL,CAAA,CAC7D,EACD,GAAID,EAAK,GAAGA,CAAE,QAAU,OAEvB,SAAA,OAAON,GAAa,SACnBa,EAAAA,IAACM,EAAAA,UAAA,CACC,cAAarB,EAAa,GAAGA,CAAU,aAAe,OACtD,QAAQ,gBAEP,SAAAE,CAAA,CAAA,EAGHA,CAAA,CAAA,CAEJ,CAAA,CAAA,EAIR,CAEJ,CACF,EAEAJ,EAAa,YAAc"}
1
+ {"version":3,"file":"notification-BqjaT4E7.js","sources":["../../../components/icon/dist/assets/alert-filled.es.js","../../../components/icon/dist/assets/check-circle-filled.es.js","../../../components/icon/dist/assets/close.es.js","../../../components/icon/dist/assets/info-filled.es.js","../../../components/icon/dist/assets/sparkles.es.js","../../../components/notification/src/notification.tsx"],"sourcesContent":["const l = {\n name: \"alert-filled\",\n 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>',\n keywords: [\"alert-filled\"],\n category: \"status\"\n};\nexport {\n l as alertFilled\n};\n//# sourceMappingURL=alert-filled.es.js.map\n","const e = {\n name: \"check-circle-filled\",\n 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>',\n keywords: [\"check-circle-filled\"],\n category: \"status\"\n};\nexport {\n e as checkCircleFilled\n};\n//# sourceMappingURL=check-circle-filled.es.js.map\n","const l = {\n name: \"close\",\n 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>',\n keywords: [\"close\"],\n category: \"utility\"\n};\nexport {\n l as close\n};\n//# sourceMappingURL=close.es.js.map\n","const e = {\n name: \"info-filled\",\n 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>',\n keywords: [\"info-filled\"],\n category: \"status\"\n};\nexport {\n e as infoFilled\n};\n//# sourceMappingURL=info-filled.es.js.map\n","const a = {\n name: \"sparkles\",\n 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>',\n keywords: [\"sparkles\"],\n category: \"ai\"\n};\nexport {\n a as sparkles\n};\n//# sourceMappingURL=sparkles.es.js.map\n","import React, { forwardRef } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { Icon } from \"@purpur/icon\";\nimport { alertFilled } from \"@purpur/icon/assets/alert-filled\";\nimport { checkCircleFilled } from \"@purpur/icon/assets/check-circle-filled\";\nimport { close } from \"@purpur/icon/assets/close\";\nimport { errorFilled } from \"@purpur/icon/assets/error-filled\";\nimport { infoFilled } from \"@purpur/icon/assets/info-filled\";\nimport { sparkles } from \"@purpur/icon/assets/sparkles\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./notification.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport const NOTIFICATION_STATUS = {\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n INFO: \"info\",\n AI: \"ai\",\n} as const;\n\nexport const notificationStatuses = Object.values(NOTIFICATION_STATUS);\nexport type NotificationStatus = (typeof NOTIFICATION_STATUS)[keyof typeof NOTIFICATION_STATUS];\n\nexport const NOTIFICATION_ARIA_LIVE = {\n POLITE: \"polite\",\n ASSERTIVE: \"assertive\",\n} as const;\n\nexport const notificationAriaLiveValues = Object.values(NOTIFICATION_ARIA_LIVE);\nexport type NotificationAriaLive =\n (typeof NOTIFICATION_ARIA_LIVE)[keyof typeof NOTIFICATION_ARIA_LIVE];\n\nexport const NOTIFICATION_ROLE = {\n ALERT: \"alert\",\n DIALOG: \"dialog\",\n ALERTDIALOG: \"alertdialog\",\n} as const;\n\nexport const notificationRoles = Object.values(NOTIFICATION_ROLE);\nexport type NotificationRole = (typeof NOTIFICATION_ROLE)[keyof typeof NOTIFICATION_ROLE];\n\nconst rootClassName = \"purpur-notification\";\n\nconst getStatusIcon = (status: NotificationStatus) => {\n switch (status) {\n case NOTIFICATION_STATUS.AI:\n return sparkles;\n case NOTIFICATION_STATUS.INFO:\n return infoFilled;\n case NOTIFICATION_STATUS.SUCCESS:\n return checkCircleFilled;\n case NOTIFICATION_STATUS.WARNING:\n return alertFilled;\n case NOTIFICATION_STATUS.ERROR:\n return errorFilled;\n }\n};\n\ntype DefaultProps = BaseProps & {\n [\"aria-live\"]?: NotificationAriaLive;\n headingTag?: HeadingTagType;\n status?: NotificationStatus;\n heading?: string;\n role?: NotificationRole;\n hidden?: boolean;\n /**\n * Use to explicitly not open the notification initially and open it programatically to trigger\n * that the aria-live message is read by the screen reader correctly.\n */\n open?: boolean;\n hideIcon?: boolean;\n};\n\ntype CloseButtonProps = {\n onClose: () => void;\n closeButtonAriaLabel: string;\n};\n\ntype NoCloseButtonProps = {\n onClose?: never;\n closeButtonAriaLabel?: never;\n};\n\nexport type NotificationProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n [\"aria-live\"]: ariaLive,\n children,\n className,\n closeButtonAriaLabel,\n headingTag = \"h4\",\n status = \"info\",\n heading,\n hidden,\n id,\n onClose,\n open = true,\n hideIcon,\n ...props\n },\n ref\n ) => {\n const showHeader = !!heading || !hideIcon;\n\n return (\n <div aria-live={ariaLive}>\n {open && (\n <div\n id={id}\n aria-labelledby={id ? `${id}-heading` : undefined}\n aria-describedby={id ? `${id}-body` : undefined}\n aria-hidden={!!hidden}\n className={cx(className, rootClassName, `${rootClassName}--${status}`, {\n [`${rootClassName}--hidden`]: hidden,\n [`${rootClassName}--has-close-button`]: !!onClose,\n })}\n data-testid={dataTestId}\n ref={ref}\n {...props}\n >\n {showHeader && (\n <div className={cx(`${rootClassName}__top`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {!hideIcon && (\n <Icon\n data-testid={dataTestId ? `${dataTestId}-icon` : undefined}\n className={cx(`${rootClassName}__icon`)}\n svg={getStatusIcon(status)}\n size=\"sm\"\n />\n )}\n {!!heading && (\n <Heading\n data-testid={dataTestId ? `${dataTestId}-heading` : undefined}\n variant=\"subsection-100\"\n tag={headingTag}\n className={cx(`${rootClassName}__heading`)}\n >\n <span id={id ? `${id}-heading` : undefined}> {heading}</span>\n </Heading>\n )}\n </div>\n </div>\n )}\n {onClose && (\n <Button\n data-testid={dataTestId ? `${dataTestId}-close-button` : undefined}\n variant=\"text\"\n size=\"sm\"\n iconOnly\n aria-label={closeButtonAriaLabel}\n onClick={onClose}\n className={cx(`${rootClassName}__close-button`)}\n >\n <Icon svg={close} size=\"md\" />\n </Button>\n )}\n {children && (\n <div\n data-testid={dataTestId ? `${dataTestId}-body` : undefined}\n className={cx(`${rootClassName}__body`, {\n [`${rootClassName}__body--extra-padding`]: !showHeader && !!onClose,\n })}\n id={id ? `${id}-body` : undefined}\n >\n {typeof children === \"string\" ? (\n <Paragraph\n data-testid={dataTestId ? `${dataTestId}-paragraph` : undefined}\n variant=\"paragraph-100\"\n >\n {children}\n </Paragraph>\n ) : (\n children\n )}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nNotification.displayName = \"Notification\";\n"],"names":["l","e","a","cx","c","styles","NOTIFICATION_STATUS","notificationStatuses","NOTIFICATION_ARIA_LIVE","notificationAriaLiveValues","NOTIFICATION_ROLE","notificationRoles","rootClassName","getStatusIcon","status","sparkles","infoFilled","checkCircleFilled","alertFilled","errorFilled","Notification","forwardRef","dataTestId","ariaLive","children","className","closeButtonAriaLabel","headingTag","heading","hidden","id","onClose","open","hideIcon","props","ref","showHeader","jsx","jsxs","Icon","Heading","Button","close","Paragraph"],"mappings":"6RAAMA,EAAI,CACR,KAAM,eACN,IAAK,kZACL,SAAU,CAAC,cAAc,EACzB,SAAU,QACZ,ECLMC,EAAI,CACR,KAAM,sBACN,IAAK,8UACL,SAAU,CAAC,qBAAqB,EAChC,SAAU,QACZ,ECLMD,EAAI,CACR,KAAM,QACN,IAAK,8VACL,SAAU,CAAC,OAAO,EAClB,SAAU,SACZ,ECLMC,EAAI,CACR,KAAM,cACN,IAAK,yXACL,SAAU,CAAC,aAAa,EACxB,SAAU,QACZ,ECLMC,EAAI,CACR,KAAM,WACN,IAAK,ijCACL,SA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AAAA,IAACM,EAAAA,UAAA,CACC,cAAarB,EAAa,GAAGA,CAAU,aAAe,OACtD,QAAQ,gBAEP,SAAAE,CAAA,CAAA,EAGHA,CAAA,CAAA,CAEJ,CAAA,CAAA,EAIR,CAEJ,CACF,EAEAJ,EAAa,YAAc"}
@@ -1,6 +1,6 @@
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-Cv7NlYbv.mjs";
3
+ import { b as $ } from "./button-4-yWOgtD.mjs";
4
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";
@@ -176,4 +176,4 @@ export {
176
176
  T as e,
177
177
  W as n
178
178
  };
179
- //# sourceMappingURL=notification-BvoL7BIW.mjs.map
179
+ //# sourceMappingURL=notification-DdRS5BF2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification-BvoL7BIW.mjs","sources":["../../../components/icon/dist/assets/alert-filled.es.js","../../../components/icon/dist/assets/check-circle-filled.es.js","../../../components/icon/dist/assets/close.es.js","../../../components/icon/dist/assets/info-filled.es.js","../../../components/icon/dist/assets/sparkles.es.js","../../../components/notification/src/notification.tsx"],"sourcesContent":["const l = {\n name: \"alert-filled\",\n 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>',\n keywords: [\"alert-filled\"],\n category: \"status\"\n};\nexport {\n l as alertFilled\n};\n//# sourceMappingURL=alert-filled.es.js.map\n","const e = {\n name: \"check-circle-filled\",\n 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>',\n keywords: [\"check-circle-filled\"],\n category: \"status\"\n};\nexport {\n e as checkCircleFilled\n};\n//# sourceMappingURL=check-circle-filled.es.js.map\n","const l = {\n name: \"close\",\n 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>',\n keywords: [\"close\"],\n category: \"utility\"\n};\nexport {\n l as close\n};\n//# sourceMappingURL=close.es.js.map\n","const e = {\n name: \"info-filled\",\n 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>',\n keywords: [\"info-filled\"],\n category: \"status\"\n};\nexport {\n e as infoFilled\n};\n//# sourceMappingURL=info-filled.es.js.map\n","const a = {\n name: \"sparkles\",\n 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>',\n keywords: [\"sparkles\"],\n category: \"ai\"\n};\nexport {\n a as sparkles\n};\n//# sourceMappingURL=sparkles.es.js.map\n","import React, { forwardRef } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { Icon } from \"@purpur/icon\";\nimport { alertFilled } from \"@purpur/icon/assets/alert-filled\";\nimport { checkCircleFilled } from \"@purpur/icon/assets/check-circle-filled\";\nimport { close } from \"@purpur/icon/assets/close\";\nimport { errorFilled } from \"@purpur/icon/assets/error-filled\";\nimport { infoFilled } from \"@purpur/icon/assets/info-filled\";\nimport { sparkles } from \"@purpur/icon/assets/sparkles\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./notification.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport const NOTIFICATION_STATUS = {\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n INFO: \"info\",\n AI: \"ai\",\n} as const;\n\nexport const notificationStatuses = Object.values(NOTIFICATION_STATUS);\nexport type NotificationStatus = (typeof NOTIFICATION_STATUS)[keyof typeof NOTIFICATION_STATUS];\n\nexport const NOTIFICATION_ARIA_LIVE = {\n POLITE: \"polite\",\n ASSERTIVE: \"assertive\",\n} as const;\n\nexport const notificationAriaLiveValues = Object.values(NOTIFICATION_ARIA_LIVE);\nexport type NotificationAriaLive =\n (typeof NOTIFICATION_ARIA_LIVE)[keyof typeof NOTIFICATION_ARIA_LIVE];\n\nexport const NOTIFICATION_ROLE = {\n ALERT: \"alert\",\n DIALOG: \"dialog\",\n ALERTDIALOG: \"alertdialog\",\n} as const;\n\nexport const notificationRoles = Object.values(NOTIFICATION_ROLE);\nexport type NotificationRole = (typeof NOTIFICATION_ROLE)[keyof typeof NOTIFICATION_ROLE];\n\nconst rootClassName = \"purpur-notification\";\n\nconst getStatusIcon = (status: NotificationStatus) => {\n switch (status) {\n case NOTIFICATION_STATUS.AI:\n return sparkles;\n case NOTIFICATION_STATUS.INFO:\n return infoFilled;\n case NOTIFICATION_STATUS.SUCCESS:\n return checkCircleFilled;\n case NOTIFICATION_STATUS.WARNING:\n return alertFilled;\n case NOTIFICATION_STATUS.ERROR:\n return errorFilled;\n }\n};\n\ntype DefaultProps = BaseProps & {\n [\"aria-live\"]?: NotificationAriaLive;\n headingTag?: HeadingTagType;\n status?: NotificationStatus;\n heading?: string;\n role?: NotificationRole;\n hidden?: boolean;\n /**\n * Use to explicitly not open the notification initially and open it programatically to trigger\n * that the aria-live message is read by the screen reader correctly.\n */\n open?: boolean;\n hideIcon?: boolean;\n};\n\ntype CloseButtonProps = {\n onClose: () => void;\n closeButtonAriaLabel: string;\n};\n\ntype NoCloseButtonProps = {\n onClose?: never;\n closeButtonAriaLabel?: never;\n};\n\nexport type NotificationProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n [\"aria-live\"]: ariaLive,\n children,\n className,\n closeButtonAriaLabel,\n headingTag = \"h4\",\n status = \"info\",\n heading,\n hidden,\n id,\n onClose,\n open = true,\n hideIcon,\n ...props\n },\n ref\n ) => {\n const showHeader = !!heading || !hideIcon;\n\n return (\n <div aria-live={ariaLive}>\n {open && (\n <div\n id={id}\n aria-labelledby={id ? `${id}-heading` : undefined}\n aria-describedby={id ? `${id}-body` : undefined}\n aria-hidden={!!hidden}\n className={cx(className, rootClassName, `${rootClassName}--${status}`, {\n [`${rootClassName}--hidden`]: hidden,\n [`${rootClassName}--has-close-button`]: !!onClose,\n })}\n data-testid={dataTestId}\n ref={ref}\n {...props}\n >\n {showHeader && (\n <div className={cx(`${rootClassName}__top`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {!hideIcon && (\n <Icon\n data-testid={dataTestId ? `${dataTestId}-icon` : undefined}\n className={cx(`${rootClassName}__icon`)}\n svg={getStatusIcon(status)}\n size=\"sm\"\n />\n )}\n {!!heading && (\n <Heading\n data-testid={dataTestId ? `${dataTestId}-heading` : undefined}\n variant=\"subsection-100\"\n tag={headingTag}\n className={cx(`${rootClassName}__heading`)}\n >\n <span id={id ? `${id}-heading` : undefined}> {heading}</span>\n </Heading>\n )}\n </div>\n </div>\n )}\n {onClose && (\n <Button\n data-testid={dataTestId ? `${dataTestId}-close-button` : undefined}\n variant=\"text\"\n size=\"sm\"\n iconOnly\n aria-label={closeButtonAriaLabel}\n onClick={onClose}\n className={cx(`${rootClassName}__close-button`)}\n >\n <Icon svg={close} size=\"md\" />\n </Button>\n )}\n {children && (\n <div\n data-testid={dataTestId ? `${dataTestId}-body` : undefined}\n className={cx(`${rootClassName}__body`, {\n [`${rootClassName}__body--extra-padding`]: !showHeader && !!onClose,\n })}\n id={id ? `${id}-body` : undefined}\n >\n {typeof children === \"string\" ? (\n <Paragraph\n data-testid={dataTestId ? `${dataTestId}-paragraph` : undefined}\n variant=\"paragraph-100\"\n >\n {children}\n </Paragraph>\n ) : (\n children\n )}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nNotification.displayName = \"Notification\";\n"],"names":["l","e","a","cx","c","styles","NOTIFICATION_STATUS","notificationStatuses","NOTIFICATION_ARIA_LIVE","notificationAriaLiveValues","NOTIFICATION_ROLE","notificationRoles","rootClassName","getStatusIcon","status","sparkles","infoFilled","checkCircleFilled","alertFilled","errorFilled","Notification","forwardRef","dataTestId","ariaLive","children","className","closeButtonAriaLabel","headingTag","heading","hidden","id","onClose","open","hideIcon","props","ref","showHeader","jsx","jsxs","Icon","Heading","Button","close","Paragraph"],"mappings":";;;;;;;;AAAA,MAAMA,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,cAAc;AAAA,EACzB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,qBAAqB;AAAA,EAChC,UAAU;AACZ,GCLMD,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,OAAO;AAAA,EAClB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,aAAa;AAAA,EACxB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,UAAU;AAAA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zD,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,UAAQ;AAAA,cACR,cAAYI;AAAA,cACZ,SAASK;AAAA,cACT,WAAW5B,EAAG,GAAGS,CAAa,gBAAgB;AAAA,cAE9C,UAAA,gBAAAyB,EAACE,GAAA,EAAK,KAAKG,GAAO,MAAK,KAAA,CAAK;AAAA,YAAA;AAAA,UAAA;AAAA,UAG/BlB,KACC,gBAAAa;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,eAAaf,IAAa,GAAGA,CAAU,UAAU;AAAA,cACjD,WAAWnB,EAAG,GAAGS,CAAa,UAAU;AAAA,gBACtC,CAAC,GAAGA,CAAa,uBAAuB,GAAG,CAACwB,KAAc,CAAC,CAACL;AAAA,cAAA,CAC7D;AAAA,cACD,IAAID,IAAK,GAAGA,CAAE,UAAU;AAAA,cAEvB,UAAA,OAAON,KAAa,WACnB,gBAAAa;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,eAAarB,IAAa,GAAGA,CAAU,eAAe;AAAA,kBACtD,SAAQ;AAAA,kBAEP,UAAAE;AAAA,gBAAA;AAAA,cAAA,IAGHA;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA,GAIR;AAAA,EAEJ;AACF;AAEAJ,EAAa,cAAc;"}
1
+ {"version":3,"file":"notification-DdRS5BF2.mjs","sources":["../../../components/icon/dist/assets/alert-filled.es.js","../../../components/icon/dist/assets/check-circle-filled.es.js","../../../components/icon/dist/assets/close.es.js","../../../components/icon/dist/assets/info-filled.es.js","../../../components/icon/dist/assets/sparkles.es.js","../../../components/notification/src/notification.tsx"],"sourcesContent":["const l = {\n name: \"alert-filled\",\n 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>',\n keywords: [\"alert-filled\"],\n category: \"status\"\n};\nexport {\n l as alertFilled\n};\n//# sourceMappingURL=alert-filled.es.js.map\n","const e = {\n name: \"check-circle-filled\",\n 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>',\n keywords: [\"check-circle-filled\"],\n category: \"status\"\n};\nexport {\n e as checkCircleFilled\n};\n//# sourceMappingURL=check-circle-filled.es.js.map\n","const l = {\n name: \"close\",\n 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>',\n keywords: [\"close\"],\n category: \"utility\"\n};\nexport {\n l as close\n};\n//# sourceMappingURL=close.es.js.map\n","const e = {\n name: \"info-filled\",\n 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>',\n keywords: [\"info-filled\"],\n category: \"status\"\n};\nexport {\n e as infoFilled\n};\n//# sourceMappingURL=info-filled.es.js.map\n","const a = {\n name: \"sparkles\",\n 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>',\n keywords: [\"sparkles\"],\n category: \"ai\"\n};\nexport {\n a as sparkles\n};\n//# sourceMappingURL=sparkles.es.js.map\n","import React, { forwardRef } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { Icon } from \"@purpur/icon\";\nimport { alertFilled } from \"@purpur/icon/assets/alert-filled\";\nimport { checkCircleFilled } from \"@purpur/icon/assets/check-circle-filled\";\nimport { close } from \"@purpur/icon/assets/close\";\nimport { errorFilled } from \"@purpur/icon/assets/error-filled\";\nimport { infoFilled } from \"@purpur/icon/assets/info-filled\";\nimport { sparkles } from \"@purpur/icon/assets/sparkles\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./notification.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport const NOTIFICATION_STATUS = {\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n INFO: \"info\",\n AI: \"ai\",\n} as const;\n\nexport const notificationStatuses = Object.values(NOTIFICATION_STATUS);\nexport type NotificationStatus = (typeof NOTIFICATION_STATUS)[keyof typeof NOTIFICATION_STATUS];\n\nexport const NOTIFICATION_ARIA_LIVE = {\n POLITE: \"polite\",\n ASSERTIVE: \"assertive\",\n} as const;\n\nexport const notificationAriaLiveValues = Object.values(NOTIFICATION_ARIA_LIVE);\nexport type NotificationAriaLive =\n (typeof NOTIFICATION_ARIA_LIVE)[keyof typeof NOTIFICATION_ARIA_LIVE];\n\nexport const NOTIFICATION_ROLE = {\n ALERT: \"alert\",\n DIALOG: \"dialog\",\n ALERTDIALOG: \"alertdialog\",\n} as const;\n\nexport const notificationRoles = Object.values(NOTIFICATION_ROLE);\nexport type NotificationRole = (typeof NOTIFICATION_ROLE)[keyof typeof NOTIFICATION_ROLE];\n\nconst rootClassName = \"purpur-notification\";\n\nconst getStatusIcon = (status: NotificationStatus) => {\n switch (status) {\n case NOTIFICATION_STATUS.AI:\n return sparkles;\n case NOTIFICATION_STATUS.INFO:\n return infoFilled;\n case NOTIFICATION_STATUS.SUCCESS:\n return checkCircleFilled;\n case NOTIFICATION_STATUS.WARNING:\n return alertFilled;\n case NOTIFICATION_STATUS.ERROR:\n return errorFilled;\n }\n};\n\ntype DefaultProps = BaseProps & {\n [\"aria-live\"]?: NotificationAriaLive;\n headingTag?: HeadingTagType;\n status?: NotificationStatus;\n heading?: string;\n role?: NotificationRole;\n hidden?: boolean;\n /**\n * Use to explicitly not open the notification initially and open it programatically to trigger\n * that the aria-live message is read by the screen reader correctly.\n */\n open?: boolean;\n hideIcon?: boolean;\n};\n\ntype CloseButtonProps = {\n onClose: () => void;\n closeButtonAriaLabel: string;\n};\n\ntype NoCloseButtonProps = {\n onClose?: never;\n closeButtonAriaLabel?: never;\n};\n\nexport type NotificationProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n [\"aria-live\"]: ariaLive,\n children,\n className,\n closeButtonAriaLabel,\n headingTag = \"h4\",\n status = \"info\",\n heading,\n hidden,\n id,\n onClose,\n open = true,\n hideIcon,\n ...props\n },\n ref\n ) => {\n const showHeader = !!heading || !hideIcon;\n\n return (\n <div aria-live={ariaLive}>\n {open && (\n <div\n id={id}\n aria-labelledby={id ? `${id}-heading` : undefined}\n aria-describedby={id ? `${id}-body` : undefined}\n aria-hidden={!!hidden}\n className={cx(className, rootClassName, `${rootClassName}--${status}`, {\n [`${rootClassName}--hidden`]: hidden,\n [`${rootClassName}--has-close-button`]: !!onClose,\n })}\n data-testid={dataTestId}\n ref={ref}\n {...props}\n >\n {showHeader && (\n <div className={cx(`${rootClassName}__top`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {!hideIcon && (\n <Icon\n data-testid={dataTestId ? `${dataTestId}-icon` : undefined}\n className={cx(`${rootClassName}__icon`)}\n svg={getStatusIcon(status)}\n size=\"sm\"\n />\n )}\n {!!heading && (\n <Heading\n data-testid={dataTestId ? `${dataTestId}-heading` : undefined}\n variant=\"subsection-100\"\n tag={headingTag}\n className={cx(`${rootClassName}__heading`)}\n >\n <span id={id ? `${id}-heading` : undefined}> {heading}</span>\n </Heading>\n )}\n </div>\n </div>\n )}\n {onClose && (\n <Button\n data-testid={dataTestId ? `${dataTestId}-close-button` : undefined}\n variant=\"text\"\n size=\"sm\"\n iconOnly\n aria-label={closeButtonAriaLabel}\n onClick={onClose}\n className={cx(`${rootClassName}__close-button`)}\n >\n <Icon svg={close} size=\"md\" />\n </Button>\n )}\n {children && (\n <div\n data-testid={dataTestId ? `${dataTestId}-body` : undefined}\n className={cx(`${rootClassName}__body`, {\n [`${rootClassName}__body--extra-padding`]: !showHeader && !!onClose,\n })}\n id={id ? `${id}-body` : undefined}\n >\n {typeof children === \"string\" ? (\n <Paragraph\n data-testid={dataTestId ? `${dataTestId}-paragraph` : undefined}\n variant=\"paragraph-100\"\n >\n {children}\n </Paragraph>\n ) : (\n children\n )}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nNotification.displayName = \"Notification\";\n"],"names":["l","e","a","cx","c","styles","NOTIFICATION_STATUS","notificationStatuses","NOTIFICATION_ARIA_LIVE","notificationAriaLiveValues","NOTIFICATION_ROLE","notificationRoles","rootClassName","getStatusIcon","status","sparkles","infoFilled","checkCircleFilled","alertFilled","errorFilled","Notification","forwardRef","dataTestId","ariaLive","children","className","closeButtonAriaLabel","headingTag","heading","hidden","id","onClose","open","hideIcon","props","ref","showHeader","jsx","jsxs","Icon","Heading","Button","close","Paragraph"],"mappings":";;;;;;;;AAAA,MAAMA,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,cAAc;AAAA,EACzB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,qBAAqB;AAAA,EAChC,UAAU;AACZ,GCLMD,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,OAAO;A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AA,kBAAEF;AAAA,gBAAA,EAAA,CAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UACxD,EAAA,CAEJ,EAAA,CACF;AAAA,UAEDG,KACC,gBAAAM;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,eAAanB,IAAa,GAAGA,CAAU,kBAAkB;AAAA,cACzD,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,UAAQ;AAAA,cACR,cAAYI;AAAA,cACZ,SAASK;AAAA,cACT,WAAW5B,EAAG,GAAGS,CAAa,gBAAgB;AAAA,cAE9C,UAAA,gBAAAyB,EAACE,GAAA,EAAK,KAAKG,GAAO,MAAK,KAAA,CAAK;AAAA,YAAA;AAAA,UAAA;AAAA,UAG/BlB,KACC,gBAAAa;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,eAAaf,IAAa,GAAGA,CAAU,UAAU;AAAA,cACjD,WAAWnB,EAAG,GAAGS,CAAa,UAAU;AAAA,gBACtC,CAAC,GAAGA,CAAa,uBAAuB,GAAG,CAACwB,KAAc,CAAC,CAACL;AAAA,cAAA,CAC7D;AAAA,cACD,IAAID,IAAK,GAAGA,CAAE,UAAU;AAAA,cAEvB,UAAA,OAAON,KAAa,WACnB,gBAAAa;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,eAAarB,IAAa,GAAGA,CAAU,eAAe;AAAA,kBACtD,SAAQ;AAAA,kBAEP,UAAAE;AAAA,gBAAA;AAAA,cAAA,IAGHA;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA,GAIR;AAAA,EAEJ;AACF;AAEAJ,EAAa,cAAc;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as i, jsxs as t } from "react/jsx-runtime";
2
2
  import { forwardRef as N } from "react";
3
- import { b as v } from "./button-Cv7NlYbv.mjs";
3
+ import { b as v } from "./button-4-yWOgtD.mjs";
4
4
  import { G as $ } from "./grid-DGnCQgwf.mjs";
5
5
  import { H as g } from "./heading-xwBuT_-9.mjs";
6
6
  import { r as x } from "./close.es-BPmk2wkU.mjs";
@@ -72,4 +72,4 @@ j.displayName = "NotificationBanner";
72
72
  export {
73
73
  j as N
74
74
  };
75
- //# sourceMappingURL=notification-banner-C4gkkSlf.mjs.map
75
+ //# sourceMappingURL=notification-banner-BOclxqFu.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification-banner-C4gkkSlf.mjs","sources":["../../../components/notification-banner/src/notification-banner.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Grid } from \"@purpur/grid\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { IconInfo } from \"@purpur/icon/info\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./notification-banner.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type DefaultProps = BaseProps & {\n closeButtonAriaLabel?: string;\n description?: string;\n hideIcon?: boolean;\n icon?: ReactNode;\n link?: ReactNode;\n titleTag?: HeadingTagType;\n title?: string;\n};\n\ntype CloseButtonProps = {\n onClose: () => void;\n closeButtonAriaLabel: string;\n};\n\ntype NoCloseButtonProps = {\n onClose?: never;\n closeButtonAriaLabel?: never;\n};\n\nexport type NotificationBannerProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nconst rootClassName = \"purpur-notification-banner\";\n\nexport const NotificationBanner = forwardRef<HTMLDivElement, NotificationBannerProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n children,\n className,\n closeButtonAriaLabel,\n description,\n hideIcon,\n icon,\n link,\n onClose,\n titleTag = \"h4\",\n title,\n ...props\n },\n ref\n ) => {\n const classes = cx(className, rootClassName);\n\n return (\n <div {...props} className={classes} role=\"alert\" ref={ref} data-testid={dataTestId}>\n <Grid>\n <div className={cx(`${rootClassName}__container`)}>\n {!hideIcon ? (\n icon ? (\n <span className={cx(`${rootClassName}__icon`)}>{icon}</span>\n ) : (\n <IconInfo className={cx(`${rootClassName}__icon`)} size=\"sm\" />\n )\n ) : null}\n <div className={cx(`${rootClassName}__content`)}>\n <Heading\n tag={titleTag}\n variant=\"subsection-100\"\n className={cx([\n `${rootClassName}__heading`,\n { [`${rootClassName}__heading--no-overlap`]: onClose },\n ])}\n >\n {title}\n </Heading>\n <div>\n {description} {link}\n </div>\n {children}\n </div>\n {onClose && (\n <Button\n data-testid={dataTestId ? `${dataTestId}-close-button` : undefined}\n variant=\"tertiary-purple\"\n size=\"sm\"\n iconOnly\n aria-label={closeButtonAriaLabel}\n onClick={onClose}\n className={cx(`${rootClassName}__close-button`)}\n >\n <IconClose size=\"sm\" />\n </Button>\n )}\n </div>\n </Grid>\n </div>\n );\n }\n);\n\nNotificationBanner.displayName = \"NotificationBanner\";\n"],"names":["cx","c","styles","rootClassName","NotificationBanner","forwardRef","dataTestId","children","className","closeButtonAriaLabel","description","hideIcon","icon","link","onClose","titleTag","title","props","ref","classes","jsx","Grid","IconInfo","Heading","Button","IconClose"],"mappings":";;;;;;;;;;;;;;;;GAWMA,IAAKC,EAAE,KAAKC,CAAM,GAwBlBC,IAAgB,8BAETC,IAAqBC;AAAA,EAChC,CACE;AAAA,IACE,CAAC,gBAAgBC;AAAA,IACjB,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAUnB,EAAGQ,GAAWL,CAAa;AAE3C,WACE,gBAAAiB,EAAC,SAAK,GAAGH,GAAO,WAAWE,GAAS,MAAK,SAAQ,KAAAD,GAAU,eAAaZ,GACtE,UAAA,gBAAAc,EAACC,GAAA,EACC,4BAAC,OAAA,EAAI,WAAWrB,EAAG,GAAGG,CAAa,aAAa,GAC7C,UAAA;AAAA,MAACQ,IAME,OALFC,IACE,gBAAAQ,EAAC,QAAA,EAAK,WAAWpB,EAAG,GAAGG,CAAa,QAAQ,GAAI,UAAAS,GAAK,IAErD,gBAAAQ,EAACE,GAAA,EAAS,WAAWtB,EAAG,GAAGG,CAAa,QAAQ,GAAG,MAAK,KAAA,CAAK;AAAA,wBAGhE,OAAA,EAAI,WAAWH,EAAG,GAAGG,CAAa,WAAW,GAC5C,UAAA;AAAA,QAAA,gBAAAiB;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,KAAKR;AAAA,YACL,SAAQ;AAAA,YACR,WAAWf,EAAG;AAAA,cACZ,GAAGG,CAAa;AAAA,cAChB,EAAE,CAAC,GAAGA,CAAa,uBAAuB,GAAGW,EAAA;AAAA,YAAQ,CACtD;AAAA,YAEA,UAAAE;AAAA,UAAA;AAAA,QAAA;AAAA,0BAEF,OAAA,EACE,UAAA;AAAA,UAAAN;AAAA,UAAY;AAAA,UAAEG;AAAA,QAAA,GACjB;AAAA,QACCN;AAAA,MAAA,GACH;AAAA,MACCO,KACC,gBAAAM;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,eAAalB,IAAa,GAAGA,CAAU,kBAAkB;AAAA,UACzD,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,UAAQ;AAAA,UACR,cAAYG;AAAA,UACZ,SAASK;AAAA,UACT,WAAWd,EAAG,GAAGG,CAAa,gBAAgB;AAAA,UAE9C,UAAA,gBAAAiB,EAACK,GAAA,EAAU,MAAK,KAAA,CAAK;AAAA,QAAA;AAAA,MAAA;AAAA,IACvB,EAAA,CAEJ,GACF,GACF;AAAA,EAEJ;AACF;AAEArB,EAAmB,cAAc;"}
1
+ {"version":3,"file":"notification-banner-BOclxqFu.mjs","sources":["../../../components/notification-banner/src/notification-banner.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Grid } from \"@purpur/grid\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { IconInfo } from \"@purpur/icon/info\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./notification-banner.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type DefaultProps = BaseProps & {\n closeButtonAriaLabel?: string;\n description?: string;\n hideIcon?: boolean;\n icon?: ReactNode;\n link?: ReactNode;\n titleTag?: HeadingTagType;\n title?: string;\n};\n\ntype CloseButtonProps = {\n onClose: () => void;\n closeButtonAriaLabel: string;\n};\n\ntype NoCloseButtonProps = {\n onClose?: never;\n closeButtonAriaLabel?: never;\n};\n\nexport type NotificationBannerProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nconst rootClassName = \"purpur-notification-banner\";\n\nexport const NotificationBanner = forwardRef<HTMLDivElement, NotificationBannerProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n children,\n className,\n closeButtonAriaLabel,\n description,\n hideIcon,\n icon,\n link,\n onClose,\n titleTag = \"h4\",\n title,\n ...props\n },\n ref\n ) => {\n const classes = cx(className, rootClassName);\n\n return (\n <div {...props} className={classes} role=\"alert\" ref={ref} data-testid={dataTestId}>\n <Grid>\n <div className={cx(`${rootClassName}__container`)}>\n {!hideIcon ? (\n icon ? (\n <span className={cx(`${rootClassName}__icon`)}>{icon}</span>\n ) : (\n <IconInfo className={cx(`${rootClassName}__icon`)} size=\"sm\" />\n )\n ) : null}\n <div className={cx(`${rootClassName}__content`)}>\n <Heading\n tag={titleTag}\n variant=\"subsection-100\"\n className={cx([\n `${rootClassName}__heading`,\n { [`${rootClassName}__heading--no-overlap`]: onClose },\n ])}\n >\n {title}\n </Heading>\n <div>\n {description} {link}\n </div>\n {children}\n </div>\n {onClose && (\n <Button\n data-testid={dataTestId ? `${dataTestId}-close-button` : undefined}\n variant=\"tertiary-purple\"\n size=\"sm\"\n iconOnly\n aria-label={closeButtonAriaLabel}\n onClick={onClose}\n className={cx(`${rootClassName}__close-button`)}\n >\n <IconClose size=\"sm\" />\n </Button>\n )}\n </div>\n </Grid>\n </div>\n );\n }\n);\n\nNotificationBanner.displayName = \"NotificationBanner\";\n"],"names":["cx","c","styles","rootClassName","NotificationBanner","forwardRef","dataTestId","children","className","closeButtonAriaLabel","description","hideIcon","icon","link","onClose","titleTag","title","props","ref","classes","jsx","Grid","IconInfo","Heading","Button","IconClose"],"mappings":";;;;;;;;;;;;;;;;GAWMA,IAAKC,EAAE,KAAKC,CAAM,GAwBlBC,IAAgB,8BAETC,IAAqBC;AAAA,EAChC,CACE;AAAA,IACE,CAAC,gBAAgBC;AAAA,IACjB,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAUnB,EAAGQ,GAAWL,CAAa;AAE3C,WACE,gBAAAiB,EAAC,SAAK,GAAGH,GAAO,WAAWE,GAAS,MAAK,SAAQ,KAAAD,GAAU,eAAaZ,GACtE,UAAA,gBAAAc,EAACC,GAAA,EACC,4BAAC,OAAA,EAAI,WAAWrB,EAAG,GAAGG,CAAa,aAAa,GAC7C,UAAA;AAAA,MAACQ,IAME,OALFC,IACE,gBAAAQ,EAAC,QAAA,EAAK,WAAWpB,EAAG,GAAGG,CAAa,QAAQ,GAAI,UAAAS,GAAK,IAErD,gBAAAQ,EAACE,GAAA,EAAS,WAAWtB,EAAG,GAAGG,CAAa,QAAQ,GAAG,MAAK,KAAA,CAAK;AAAA,wBAGhE,OAAA,EAAI,WAAWH,EAAG,GAAGG,CAAa,WAAW,GAC5C,UAAA;AAAA,QAAA,gBAAAiB;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,KAAKR;AAAA,YACL,SAAQ;AAAA,YACR,WAAWf,EAAG;AAAA,cACZ,GAAGG,CAAa;AAAA,cAChB,EAAE,CAAC,GAAGA,CAAa,uBAAuB,GAAGW,EAAA;AAAA,YAAQ,CACtD;AAAA,YAEA,UAAAE;AAAA,UAAA;AAAA,QAAA;AAAA,0BAEF,OAAA,EACE,UAAA;AAAA,UAAAN;AAAA,UAAY;AAAA,UAAEG;AAAA,QAAA,GACjB;AAAA,QACCN;AAAA,MAAA,GACH;AAAA,MACCO,KACC,gBAAAM;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,eAAalB,IAAa,GAAGA,CAAU,kBAAkB;AAAA,UACzD,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,UAAQ;AAAA,UACR,cAAYG;AAAA,UACZ,SAASK;AAAA,UACT,WAAWd,EAAG,GAAGG,CAAa,gBAAgB;AAAA,UAE9C,UAAA,gBAAAiB,EAACK,GAAA,EAAU,MAAK,KAAA,CAAK;AAAA,QAAA;AAAA,MAAA;AAAA,IACvB,EAAA,CAEJ,GACF,GACF;AAAA,EAEJ;AACF;AAEArB,EAAmB,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";const n=require("react/jsx-runtime"),x=require("react"),N=require("./button-Dqxdc3nC.js"),j=require("./grid-uGMD2euo.js"),g=require("./heading-drD5ugCC.js"),v=require("./close.es-VL3lKi1O.js"),q=require("./info.es-Br84jly5.js"),$=require("./bind-DeUYJ6m9.js"),y={"purpur-notification-banner":"_purpur-notification-banner_llblm_1","purpur-notification-banner__container":"_purpur-notification-banner__container_llblm_6","purpur-notification-banner__content":"_purpur-notification-banner__content_llblm_11","purpur-notification-banner__icon":"_purpur-notification-banner__icon_llblm_16","purpur-notification-banner__heading":"_purpur-notification-banner__heading_llblm_19","purpur-notification-banner__heading--no-overlap":"_purpur-notification-banner__heading--no-overlap_llblm_22","purpur-notification-banner__close-button":"_purpur-notification-banner__close-button_llblm_25"},r=$.c.bind(y),i="purpur-notification-banner",o=x.forwardRef(({["data-testid"]:e,children:c,className:s,closeButtonAriaLabel:_,description:l,hideIcon:u,icon:a,link:p,onClose:t,titleTag:b="h4",title:d,...f},m)=>{const h=r(s,i);return n.jsx("div",{...f,className:h,role:"alert",ref:m,"data-testid":e,children:n.jsx(j.Grid,{children:n.jsxs("div",{className:r(`${i}__container`),children:[u?null:a?n.jsx("span",{className:r(`${i}__icon`),children:a}):n.jsx(q.r,{className:r(`${i}__icon`),size:"sm"}),n.jsxs("div",{className:r(`${i}__content`),children:[n.jsx(g.Heading,{tag:b,variant:"subsection-100",className:r([`${i}__heading`,{[`${i}__heading--no-overlap`]:t}]),children:d}),n.jsxs("div",{children:[l," ",p]}),c]}),t&&n.jsx(N.Button,{"data-testid":e?`${e}-close-button`:void 0,variant:"tertiary-purple",size:"sm",iconOnly:!0,"aria-label":_,onClick:t,className:r(`${i}__close-button`),children:n.jsx(v.r,{size:"sm"})})]})})})});o.displayName="NotificationBanner";exports.NotificationBanner=o;
2
- //# sourceMappingURL=notification-banner-COH7wJu2.js.map
1
+ "use strict";const n=require("react/jsx-runtime"),x=require("react"),N=require("./button-DmybVApa.js"),j=require("./grid-uGMD2euo.js"),g=require("./heading-drD5ugCC.js"),v=require("./close.es-VL3lKi1O.js"),q=require("./info.es-Br84jly5.js"),$=require("./bind-DeUYJ6m9.js"),y={"purpur-notification-banner":"_purpur-notification-banner_llblm_1","purpur-notification-banner__container":"_purpur-notification-banner__container_llblm_6","purpur-notification-banner__content":"_purpur-notification-banner__content_llblm_11","purpur-notification-banner__icon":"_purpur-notification-banner__icon_llblm_16","purpur-notification-banner__heading":"_purpur-notification-banner__heading_llblm_19","purpur-notification-banner__heading--no-overlap":"_purpur-notification-banner__heading--no-overlap_llblm_22","purpur-notification-banner__close-button":"_purpur-notification-banner__close-button_llblm_25"},r=$.c.bind(y),i="purpur-notification-banner",o=x.forwardRef(({["data-testid"]:e,children:c,className:s,closeButtonAriaLabel:_,description:l,hideIcon:u,icon:a,link:p,onClose:t,titleTag:b="h4",title:d,...f},m)=>{const h=r(s,i);return n.jsx("div",{...f,className:h,role:"alert",ref:m,"data-testid":e,children:n.jsx(j.Grid,{children:n.jsxs("div",{className:r(`${i}__container`),children:[u?null:a?n.jsx("span",{className:r(`${i}__icon`),children:a}):n.jsx(q.r,{className:r(`${i}__icon`),size:"sm"}),n.jsxs("div",{className:r(`${i}__content`),children:[n.jsx(g.Heading,{tag:b,variant:"subsection-100",className:r([`${i}__heading`,{[`${i}__heading--no-overlap`]:t}]),children:d}),n.jsxs("div",{children:[l," ",p]}),c]}),t&&n.jsx(N.Button,{"data-testid":e?`${e}-close-button`:void 0,variant:"tertiary-purple",size:"sm",iconOnly:!0,"aria-label":_,onClick:t,className:r(`${i}__close-button`),children:n.jsx(v.r,{size:"sm"})})]})})})});o.displayName="NotificationBanner";exports.NotificationBanner=o;
2
+ //# sourceMappingURL=notification-banner-jY8rQH2M.js.map