@purpur/library 9.2.3 → 9.3.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 (280) hide show
  1. package/CHANGELOG.json +27 -0
  2. package/CHANGELOG.md +13 -1
  3. package/dist/LICENSE.txt +1 -1
  4. package/dist/{RichText-Bi51HE6X.mjs → RichText-jZ-sHV-u.mjs} +2 -2
  5. package/dist/{RichText-Bi51HE6X.mjs.map → RichText-jZ-sHV-u.mjs.map} +1 -1
  6. package/dist/{RichText-DNroJJXv.js → RichText-yobCUjTD.js} +2 -2
  7. package/dist/{RichText-DNroJJXv.js.map → RichText-yobCUjTD.js.map} +1 -1
  8. package/dist/{ThemeProvider-bkyFCeo6.mjs → ThemeProvider-CkX-BNWN.mjs} +2 -2
  9. package/dist/ThemeProvider-CkX-BNWN.mjs.map +1 -0
  10. package/dist/{ThemeProvider-5r7lDX-h.js → ThemeProvider-Dy771oix.js} +2 -2
  11. package/dist/ThemeProvider-Dy771oix.js.map +1 -0
  12. package/dist/{accordion-OtFSShSB.mjs → accordion-CIU4U8-4.mjs} +3 -3
  13. package/dist/accordion-CIU4U8-4.mjs.map +1 -0
  14. package/dist/{accordion-OsA0HvdA.js → accordion-DyhOG54L.js} +2 -2
  15. package/dist/accordion-DyhOG54L.js.map +1 -0
  16. package/dist/accordion.cjs.js +1 -1
  17. package/dist/accordion.es.js +3 -3
  18. package/dist/{autocomplete-D9uCJzjY.js → autocomplete-3kV1btuI.js} +2 -2
  19. package/dist/{autocomplete-D9uCJzjY.js.map → autocomplete-3kV1btuI.js.map} +1 -1
  20. package/dist/{autocomplete-BipmyKf0.mjs → autocomplete-BEGRn-Wh.mjs} +2 -2
  21. package/dist/{autocomplete-BipmyKf0.mjs.map → autocomplete-BEGRn-Wh.mjs.map} +1 -1
  22. package/dist/autocomplete.cjs.js +1 -1
  23. package/dist/autocomplete.es.js +1 -1
  24. package/dist/{card-DR2hvxjZ.mjs → card-C2mdp-ur.mjs} +2 -2
  25. package/dist/{card-DR2hvxjZ.mjs.map → card-C2mdp-ur.mjs.map} +1 -1
  26. package/dist/{card-CRHXm5NR.js → card-DFdUs5RG.js} +2 -2
  27. package/dist/{card-CRHXm5NR.js.map → card-DFdUs5RG.js.map} +1 -1
  28. package/dist/card.cjs.js +1 -1
  29. package/dist/card.es.js +1 -1
  30. package/dist/{carousel-BkxojLwn.mjs → carousel-DLkTL9sj.mjs} +29 -29
  31. package/dist/{carousel-BkxojLwn.mjs.map → carousel-DLkTL9sj.mjs.map} +1 -1
  32. package/dist/{carousel-BCw-5u92.js → carousel-DXrtxRz5.js} +2 -2
  33. package/dist/{carousel-BCw-5u92.js.map → carousel-DXrtxRz5.js.map} +1 -1
  34. package/dist/carousel.cjs.js +1 -1
  35. package/dist/carousel.es.js +1 -1
  36. package/dist/checkbox-BHTx89JQ.mjs +236 -0
  37. package/dist/checkbox-BHTx89JQ.mjs.map +1 -0
  38. package/dist/checkbox-CDNcNv6d.js +2 -0
  39. package/dist/checkbox-CDNcNv6d.js.map +1 -0
  40. package/dist/checkbox.cjs.js +1 -1
  41. package/dist/checkbox.es.js +1 -1
  42. package/dist/{comparison-table-B8w65g43.js → comparison-table-CitEzX7h.js} +2 -2
  43. package/dist/comparison-table-CitEzX7h.js.map +1 -0
  44. package/dist/{comparison-table-D1zJpdLL.mjs → comparison-table-Dmbjsqyg.mjs} +52 -52
  45. package/dist/comparison-table-Dmbjsqyg.mjs.map +1 -0
  46. package/dist/comparison-table.cjs.js +1 -1
  47. package/dist/comparison-table.es.js +1 -1
  48. package/dist/components/accordion/src/accordion.d.ts +1 -1
  49. package/dist/components/accordion/src/accordion.d.ts.map +1 -1
  50. package/dist/components/checkbox/src/checkbox.d.ts +4 -0
  51. package/dist/components/checkbox/src/checkbox.d.ts.map +1 -1
  52. package/dist/components/comparison-table/src/comparison-table.d.ts +1 -1
  53. package/dist/components/comparison-table/src/comparison-table.d.ts.map +1 -1
  54. package/dist/components/dismissable-chip-group/src/dismissable-chip-group-item.d.ts.map +1 -1
  55. package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts +4 -2
  56. package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts.map +1 -1
  57. package/dist/components/dropdown/src/dropdown-combobox.d.ts.map +1 -1
  58. package/dist/components/dropdown/src/dropdown-select.d.ts.map +1 -1
  59. package/dist/components/dropdown/src/dropdown-shared.d.ts +3 -2
  60. package/dist/components/dropdown/src/dropdown-shared.d.ts.map +1 -1
  61. package/dist/components/dropdown/src/useDropdown.d.ts +2 -1
  62. package/dist/components/dropdown/src/useDropdown.d.ts.map +1 -1
  63. package/dist/components/listbox/src/listbox-item.d.ts +2 -2
  64. package/dist/components/listbox/src/listbox-item.d.ts.map +1 -1
  65. package/dist/components/listbox/src/listbox.d.ts +4 -1
  66. package/dist/components/listbox/src/listbox.d.ts.map +1 -1
  67. package/dist/components/toggle/src/toggle.d.ts +1 -0
  68. package/dist/components/toggle/src/toggle.d.ts.map +1 -1
  69. package/dist/components-metadata.js +4 -2
  70. package/dist/{content-block-Dm3L4g8w.mjs → content-block-CakKeJtN.mjs} +2 -2
  71. package/dist/{content-block-Dm3L4g8w.mjs.map → content-block-CakKeJtN.mjs.map} +1 -1
  72. package/dist/{content-block-CDRUH0pg.js → content-block-CrekbIfe.js} +2 -2
  73. package/dist/{content-block-CDRUH0pg.js.map → content-block-CrekbIfe.js.map} +1 -1
  74. package/dist/content-block.cjs.js +1 -1
  75. package/dist/content-block.es.js +1 -1
  76. package/dist/{countdown-DZ4IwkNy.mjs → countdown-BsLsEZBv.mjs} +2 -2
  77. package/dist/{countdown-DZ4IwkNy.mjs.map → countdown-BsLsEZBv.mjs.map} +1 -1
  78. package/dist/{countdown-CqYsZigV.js → countdown-hYrFLmRg.js} +2 -2
  79. package/dist/{countdown-CqYsZigV.js.map → countdown-hYrFLmRg.js.map} +1 -1
  80. package/dist/countdown.cjs.js +1 -1
  81. package/dist/countdown.es.js +1 -1
  82. package/dist/dismissable-chip-group-2updhyuR.js +2 -0
  83. package/dist/dismissable-chip-group-2updhyuR.js.map +1 -0
  84. package/dist/dismissable-chip-group-Cfs2s2BH.mjs +94 -0
  85. package/dist/dismissable-chip-group-Cfs2s2BH.mjs.map +1 -0
  86. package/dist/dismissable-chip-group.cjs.js +1 -1
  87. package/dist/dismissable-chip-group.es.js +6 -5
  88. package/dist/dropdown-CMO_VD5e.mjs +916 -0
  89. package/dist/dropdown-CMO_VD5e.mjs.map +1 -0
  90. package/dist/dropdown-DJKNQnuo.js +2 -0
  91. package/dist/dropdown-DJKNQnuo.js.map +1 -0
  92. package/dist/dropdown.cjs.js +1 -1
  93. package/dist/dropdown.es.js +1 -1
  94. package/dist/{footer-BXs8uzTA.mjs → footer-BLPlXaZK.mjs} +4 -4
  95. package/dist/{footer-BXs8uzTA.mjs.map → footer-BLPlXaZK.mjs.map} +1 -1
  96. package/dist/{footer-DF9adlni.js → footer-D9AcPwlH.js} +2 -2
  97. package/dist/{footer-DF9adlni.js.map → footer-D9AcPwlH.js.map} +1 -1
  98. package/dist/footer.cjs.js +1 -1
  99. package/dist/footer.es.js +1 -1
  100. package/dist/{hero-banner-BfxclVFT.js → hero-banner-D1A-_qou.js} +2 -2
  101. package/dist/{hero-banner-BfxclVFT.js.map → hero-banner-D1A-_qou.js.map} +1 -1
  102. package/dist/{hero-banner-CxPvhXD2.mjs → hero-banner-DkC_BqM7.mjs} +3 -3
  103. package/dist/{hero-banner-CxPvhXD2.mjs.map → hero-banner-DkC_BqM7.mjs.map} +1 -1
  104. package/dist/hero-banner.cjs.js +1 -1
  105. package/dist/hero-banner.es.js +1 -1
  106. package/dist/libraries/theme/src/theme-props.d.ts +1 -0
  107. package/dist/libraries/theme/src/theme-props.d.ts.map +1 -1
  108. package/dist/libraries/tokens/dist/color/variables.d.ts +1 -0
  109. package/dist/libraries/tokens/dist/color/variables.dark.d.ts +1 -0
  110. package/dist/library.cjs.js +1 -1
  111. package/dist/library.es.js +592 -589
  112. package/dist/listbox-ATP4hOWF.js +2 -0
  113. package/dist/listbox-ATP4hOWF.js.map +1 -0
  114. package/dist/listbox-i6BQQ-NZ.mjs +73 -0
  115. package/dist/listbox-i6BQQ-NZ.mjs.map +1 -0
  116. package/dist/listbox.cjs.js +1 -1
  117. package/dist/listbox.es.js +3 -2
  118. package/dist/{modal-COF_UhvY.js → modal-Baisuc6m.js} +2 -2
  119. package/dist/{modal-COF_UhvY.js.map → modal-Baisuc6m.js.map} +1 -1
  120. package/dist/{modal-BMg43Fvd.mjs → modal-COZ1POGG.mjs} +2 -2
  121. package/dist/{modal-BMg43Fvd.mjs.map → modal-COZ1POGG.mjs.map} +1 -1
  122. package/dist/modal.cjs.js +1 -1
  123. package/dist/modal.es.js +1 -1
  124. package/dist/{notification-BqjaT4E7.js → notification-B5bNNq86.js} +2 -2
  125. package/dist/{notification-BqjaT4E7.js.map → notification-B5bNNq86.js.map} +1 -1
  126. package/dist/{notification-DdRS5BF2.mjs → notification-BbQCmsnY.mjs} +2 -2
  127. package/dist/{notification-DdRS5BF2.mjs.map → notification-BbQCmsnY.mjs.map} +1 -1
  128. package/dist/notification.cjs.js +1 -1
  129. package/dist/notification.es.js +1 -1
  130. package/dist/{pagination-CVYUacXN.mjs → pagination-Cc_4zCQA.mjs} +2 -2
  131. package/dist/{pagination-CVYUacXN.mjs.map → pagination-Cc_4zCQA.mjs.map} +1 -1
  132. package/dist/{pagination-Bwlkvqye.js → pagination-rFRdkHII.js} +2 -2
  133. package/dist/{pagination-Bwlkvqye.js.map → pagination-rFRdkHII.js.map} +1 -1
  134. package/dist/pagination.cjs.js +1 -1
  135. package/dist/pagination.es.js +1 -1
  136. package/dist/paragraph-By4jMjnH.js +2 -0
  137. package/dist/{paragraph-BsI53OR0.js.map → paragraph-By4jMjnH.js.map} +1 -1
  138. package/dist/{paragraph-Ci50OF1u.mjs → paragraph-DSxXmX_0.mjs} +23 -23
  139. package/dist/{paragraph-Ci50OF1u.mjs.map → paragraph-DSxXmX_0.mjs.map} +1 -1
  140. package/dist/paragraph.cjs.js +1 -1
  141. package/dist/paragraph.es.js +1 -1
  142. package/dist/{popover-XCUa2GfC.js → popover-B0XJZ5mj.js} +2 -2
  143. package/dist/{popover-XCUa2GfC.js.map → popover-B0XJZ5mj.js.map} +1 -1
  144. package/dist/{popover-Dwqs1wGH.mjs → popover-_xJATlhN.mjs} +2 -2
  145. package/dist/{popover-Dwqs1wGH.mjs.map → popover-_xJATlhN.mjs.map} +1 -1
  146. package/dist/popover.cjs.js +1 -1
  147. package/dist/popover.es.js +1 -1
  148. package/dist/{product-card-BfB82XpS.mjs → product-card-C3_N0t-R.mjs} +3 -3
  149. package/dist/{product-card-BfB82XpS.mjs.map → product-card-C3_N0t-R.mjs.map} +1 -1
  150. package/dist/{product-card-bVQ7JhHj.js → product-card-CoY1KggV.js} +2 -2
  151. package/dist/{product-card-bVQ7JhHj.js.map → product-card-CoY1KggV.js.map} +1 -1
  152. package/dist/product-card.cjs.js +1 -1
  153. package/dist/product-card.es.js +1 -1
  154. package/dist/{promotion-card-DqBBt2sz.js → promotion-card-Bag64gqP.js} +2 -2
  155. package/dist/{promotion-card-DqBBt2sz.js.map → promotion-card-Bag64gqP.js.map} +1 -1
  156. package/dist/{promotion-card-BhNw94sC.mjs → promotion-card-BiHnQvhn.mjs} +4 -4
  157. package/dist/{promotion-card-BhNw94sC.mjs.map → promotion-card-BiHnQvhn.mjs.map} +1 -1
  158. package/dist/promotion-card.cjs.js +1 -1
  159. package/dist/promotion-card.es.js +1 -1
  160. package/dist/purpur.css +1 -1
  161. package/dist/quantity-selector-CDSfcTb1.js +2 -0
  162. package/dist/{quantity-selector-8AkKNDik.js.map → quantity-selector-CDSfcTb1.js.map} +1 -1
  163. package/dist/{quantity-selector-C23kU1hF.mjs → quantity-selector-CvBvnMeB.mjs} +35 -35
  164. package/dist/{quantity-selector-C23kU1hF.mjs.map → quantity-selector-CvBvnMeB.mjs.map} +1 -1
  165. package/dist/quantity-selector.cjs.js +1 -1
  166. package/dist/quantity-selector.es.js +1 -1
  167. package/dist/{radio-card-group-BlRZBa-9.mjs → radio-card-group-CneOprGY.mjs} +2 -2
  168. package/dist/{radio-card-group-BlRZBa-9.mjs.map → radio-card-group-CneOprGY.mjs.map} +1 -1
  169. package/dist/{radio-card-group-sYcfDPJq.js → radio-card-group-Ctuvg61o.js} +2 -2
  170. package/dist/{radio-card-group-sYcfDPJq.js.map → radio-card-group-Ctuvg61o.js.map} +1 -1
  171. package/dist/radio-card-group.cjs.js +1 -1
  172. package/dist/radio-card-group.es.js +1 -1
  173. package/dist/rich-text.cjs.js +1 -1
  174. package/dist/rich-text.es.js +1 -1
  175. package/dist/{search-field-CZ9mIyZ-.mjs → search-field-CpkHGIYi.mjs} +3 -3
  176. package/dist/{search-field-CZ9mIyZ-.mjs.map → search-field-CpkHGIYi.mjs.map} +1 -1
  177. package/dist/{search-field-DD9UkOca.js → search-field-Z0PqDARl.js} +2 -2
  178. package/dist/{search-field-DD9UkOca.js.map → search-field-Z0PqDARl.js.map} +1 -1
  179. package/dist/search-field.cjs.js +1 -1
  180. package/dist/search-field.es.js +1 -1
  181. package/dist/{stepper-uBfDdIju.mjs → stepper-CNnx_NiR.mjs} +2 -2
  182. package/dist/{stepper-uBfDdIju.mjs.map → stepper-CNnx_NiR.mjs.map} +1 -1
  183. package/dist/{stepper-w-raIwqJ.js → stepper-Df4X7DDR.js} +2 -2
  184. package/dist/{stepper-w-raIwqJ.js.map → stepper-Df4X7DDR.js.map} +1 -1
  185. package/dist/stepper.cjs.js +1 -1
  186. package/dist/stepper.es.js +1 -1
  187. package/dist/{table-DsgqX7Vv.js → table-DRYW0yw4.js} +2 -2
  188. package/dist/{table-DsgqX7Vv.js.map → table-DRYW0yw4.js.map} +1 -1
  189. package/dist/{table-Dx_dhGT6.mjs → table-DUY8kQfE.mjs} +5 -5
  190. package/dist/{table-Dx_dhGT6.mjs.map → table-DUY8kQfE.mjs.map} +1 -1
  191. package/dist/table.cjs.js +1 -1
  192. package/dist/table.es.js +1 -1
  193. package/dist/{text-area-DDZ_GQPW.mjs → text-area-kJvg6cFp.mjs} +3 -3
  194. package/dist/{text-area-DDZ_GQPW.mjs.map → text-area-kJvg6cFp.mjs.map} +1 -1
  195. package/dist/{text-area-C6W0fDiQ.js → text-area-peNKG7g4.js} +2 -2
  196. package/dist/{text-area-C6W0fDiQ.js.map → text-area-peNKG7g4.js.map} +1 -1
  197. package/dist/text-area.cjs.js +1 -1
  198. package/dist/text-area.es.js +1 -1
  199. package/dist/theme.cjs.js +1 -1
  200. package/dist/theme.es.js +2 -2
  201. package/dist/toggle-B8ZLUVar.js +2 -0
  202. package/dist/{toggle-C8IwTbX8.js.map → toggle-B8ZLUVar.js.map} +1 -1
  203. package/dist/toggle-CY3J8BRX.mjs +302 -0
  204. package/dist/{toggle-D23x1wWk.mjs.map → toggle-CY3J8BRX.mjs.map} +1 -1
  205. package/dist/toggle.cjs.js +1 -1
  206. package/dist/toggle.es.js +1 -1
  207. package/dist/tokens/color/variables.css +1 -0
  208. package/dist/tokens/color/variables.d.ts +1 -0
  209. package/dist/tokens/color/variables.dark.css +1 -0
  210. package/dist/tokens/color/variables.dark.d.ts +1 -0
  211. package/dist/tokens/color/variables.dark.js +1 -0
  212. package/dist/tokens/color/variables.dark.json +2 -1
  213. package/dist/tokens/color/variables.dark.scss +1 -0
  214. package/dist/tokens/color/variables.js +1 -0
  215. package/dist/tokens/color/variables.json +2 -1
  216. package/dist/tokens/color/variables.scss +1 -0
  217. package/dist/tokens.cjs.js +1 -1
  218. package/dist/tokens.es.js +76 -75
  219. package/dist/{tooltip-0pLBlDG3.js → tooltip-C8Zxnqdb.js} +2 -2
  220. package/dist/{tooltip-0pLBlDG3.js.map → tooltip-C8Zxnqdb.js.map} +1 -1
  221. package/dist/{tooltip-Kom0VfOC.mjs → tooltip-VlURN8H3.mjs} +2 -2
  222. package/dist/{tooltip-Kom0VfOC.mjs.map → tooltip-VlURN8H3.mjs.map} +1 -1
  223. package/dist/tooltip.cjs.js +1 -1
  224. package/dist/tooltip.es.js +1 -1
  225. package/dist/use-autocomplete.es-BwAzMcau.js +2 -0
  226. package/dist/use-autocomplete.es-BwAzMcau.js.map +1 -0
  227. package/dist/{use-autocomplete.es-CVv3z8t6.mjs → use-autocomplete.es-CKb0RHKG.mjs} +37 -35
  228. package/dist/use-autocomplete.es-CKb0RHKG.mjs.map +1 -0
  229. package/dist/useColorScheme-DNyjsWX9.js +2 -0
  230. package/dist/{useColorScheme-0GMDl2GF.js.map → useColorScheme-DNyjsWX9.js.map} +1 -1
  231. package/dist/{useColorScheme-Di_Q0JR4.mjs → useColorScheme-tAkY9LHt.mjs} +2 -2
  232. package/dist/{useColorScheme-Di_Q0JR4.mjs.map → useColorScheme-tAkY9LHt.mjs.map} +1 -1
  233. package/dist/{variables-CKp4o9Tn.mjs → variables-B5hbV0Uy.mjs} +128 -127
  234. package/dist/variables-B5hbV0Uy.mjs.map +1 -0
  235. package/dist/variables-DoI78zZc.js +2 -0
  236. package/dist/variables-DoI78zZc.js.map +1 -0
  237. package/package.json +20 -20
  238. package/tokens/color/variables.css +1 -0
  239. package/tokens/color/variables.d.ts +1 -0
  240. package/tokens/color/variables.dark.css +1 -0
  241. package/tokens/color/variables.dark.d.ts +1 -0
  242. package/tokens/color/variables.dark.js +1 -0
  243. package/tokens/color/variables.dark.json +2 -1
  244. package/tokens/color/variables.dark.scss +1 -0
  245. package/tokens/color/variables.js +1 -0
  246. package/tokens/color/variables.json +2 -1
  247. package/tokens/color/variables.scss +1 -0
  248. package/dist/ThemeProvider-5r7lDX-h.js.map +0 -1
  249. package/dist/ThemeProvider-bkyFCeo6.mjs.map +0 -1
  250. package/dist/accordion-OsA0HvdA.js.map +0 -1
  251. package/dist/accordion-OtFSShSB.mjs.map +0 -1
  252. package/dist/checkbox-D6qWgpWR.mjs +0 -231
  253. package/dist/checkbox-D6qWgpWR.mjs.map +0 -1
  254. package/dist/checkbox-Dk3bZkZ3.js +0 -2
  255. package/dist/checkbox-Dk3bZkZ3.js.map +0 -1
  256. package/dist/comparison-table-B8w65g43.js.map +0 -1
  257. package/dist/comparison-table-D1zJpdLL.mjs.map +0 -1
  258. package/dist/dismissable-chip-group-Cd23yjBa.js +0 -2
  259. package/dist/dismissable-chip-group-Cd23yjBa.js.map +0 -1
  260. package/dist/dismissable-chip-group-D-gD93ON.mjs +0 -89
  261. package/dist/dismissable-chip-group-D-gD93ON.mjs.map +0 -1
  262. package/dist/dropdown-BsqVnd7z.js +0 -2
  263. package/dist/dropdown-BsqVnd7z.js.map +0 -1
  264. package/dist/dropdown-TO3Mh0bk.mjs +0 -910
  265. package/dist/dropdown-TO3Mh0bk.mjs.map +0 -1
  266. package/dist/listbox-COBHLRtB.js +0 -2
  267. package/dist/listbox-COBHLRtB.js.map +0 -1
  268. package/dist/listbox-DG4KmQP_.mjs +0 -66
  269. package/dist/listbox-DG4KmQP_.mjs.map +0 -1
  270. package/dist/paragraph-BsI53OR0.js +0 -2
  271. package/dist/quantity-selector-8AkKNDik.js +0 -2
  272. package/dist/toggle-C8IwTbX8.js +0 -2
  273. package/dist/toggle-D23x1wWk.mjs +0 -287
  274. package/dist/use-autocomplete.es-BHDgQLae.js +0 -2
  275. package/dist/use-autocomplete.es-BHDgQLae.js.map +0 -1
  276. package/dist/use-autocomplete.es-CVv3z8t6.mjs.map +0 -1
  277. package/dist/useColorScheme-0GMDl2GF.js +0 -2
  278. package/dist/variables-CKp4o9Tn.mjs.map +0 -1
  279. package/dist/variables-DH61hVNE.js +0 -2
  280. package/dist/variables-DH61hVNE.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";const t=require("react/jsx-runtime"),r=require("react"),m=require("./bind-DeUYJ6m9.js"),C=require("./checkmark.es-lYntWFA3.js"),q=require("./paragraph-By4jMjnH.js"),b={"purpur-listbox":"_purpur-listbox_xi2co_1","purpur-listbox--negative":"_purpur-listbox--negative_xi2co_15","purpur-listbox-item":"_purpur-listbox-item_xi2co_20","purpur-listbox-item--hovered":"_purpur-listbox-item--hovered_xi2co_34","purpur-listbox-item--highlighted":"_purpur-listbox-item--highlighted_xi2co_42","purpur-listbox-item--noninteractive":"_purpur-listbox-item--noninteractive_xi2co_46","purpur-listbox-item--disabled":"_purpur-listbox-item--disabled_xi2co_49","purpur-listbox-item--negative":"_purpur-listbox-item--negative_xi2co_53","purpur-listbox-item__icon":"_purpur-listbox-item__icon_xi2co_70"},p=m.c.bind(b),e="purpur-listbox",_=r.forwardRef((a,s)=>{const o=r.useContext(n),{disabled:i,highlighted:h,hovered:v,selected:c,children:l,className:g,noninteractive:N,negative:$,hideSelectedIcon:L,...f}=a,x=o??$,j=p(`${e}-item`,g,{[`${e}-item--highlighted`]:h,[`${e}-item--selected`]:c,[`${e}-item--hovered`]:v,[`${e}-item--disabled`]:i,[`${e}-item--noninteractive`]:N,[`${e}-item--negative`]:x});return t.jsxs("li",{...f,ref:s,className:j,"aria-selected":!!c,role:"option","aria-disabled":!!i,children:[typeof l=="string"?t.jsx(q.Paragraph,{disabled:i,negative:x,children:l}):l,c&&!L&&t.jsx(C.a,{size:"xs",className:p(`${e}-item__icon`)})]})});_.displayName="ListBoxItem";const y=m.c.bind(b),d="purpur-listbox",n=r.createContext(void 0),u=r.forwardRef(({children:a,negative:s=!1,...o},i)=>t.jsx("ul",{...o,ref:i,className:y(d,o.className,{[`${d}--negative`]:s}),role:"listbox",children:t.jsx(n.Provider,{value:s,children:a})}));u.Item=_;u.displayName="ListBox";exports.Listbox=u;exports.ListboxNegativeContext=n;
2
+ //# sourceMappingURL=listbox-ATP4hOWF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listbox-ATP4hOWF.js","sources":["../../../components/listbox/src/listbox-item.tsx","../../../components/listbox/src/listbox.tsx"],"sourcesContent":["import React, { forwardRef, useContext } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { IconCheckmark } from \"@purpur/icon/checkmark\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport { ListboxNegativeContext } from \"./listbox\";\nimport styles from \"./listbox.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-listbox\";\n\nexport type ListboxItemProps = Omit<BaseProps<\"li\">, \"role\"> & {\n highlighted?: boolean;\n hovered?: boolean;\n key?: string;\n selected?: boolean;\n disabled?: boolean;\n noninteractive?: boolean;\n negative?: boolean;\n /** When true, hides the built-in checkmark icon while preserving `aria-selected`. */\n hideSelectedIcon?: boolean;\n};\n\nexport const ListboxItem = forwardRef<HTMLLIElement, ListboxItemProps>((props, ref) => {\n const listboxNegative = useContext(ListboxNegativeContext);\n const {\n disabled,\n highlighted,\n hovered,\n selected,\n children,\n className,\n noninteractive,\n negative,\n hideSelectedIcon,\n ...liProps\n } = props;\n const resolvedNegative = listboxNegative ?? negative;\n\n const classes = cx(`${rootClassName}-item`, className, {\n [`${rootClassName}-item--highlighted`]: highlighted,\n [`${rootClassName}-item--selected`]: selected,\n [`${rootClassName}-item--hovered`]: hovered,\n [`${rootClassName}-item--disabled`]: disabled,\n [`${rootClassName}-item--noninteractive`]: noninteractive,\n [`${rootClassName}-item--negative`]: resolvedNegative,\n });\n\n return (\n <li\n {...liProps}\n ref={ref}\n className={classes}\n aria-selected={!!selected}\n role=\"option\"\n aria-disabled={!!disabled}\n >\n {typeof children === \"string\" ? (\n <Paragraph disabled={disabled} negative={resolvedNegative}>\n {children}\n </Paragraph>\n ) : (\n children\n )}\n {selected && !hideSelectedIcon && (\n <IconCheckmark size=\"xs\" className={cx(`${rootClassName}-item__icon`)} />\n )}\n </li>\n );\n});\n\nListboxItem.displayName = \"ListBoxItem\";\n","import React, {\n createContext,\n forwardRef,\n type ForwardRefExoticComponent,\n type PropsWithoutRef,\n} from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./listbox.module.scss\";\nimport { ListboxItem } from \"./listbox-item\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-listbox\";\n\nexport const ListboxNegativeContext = createContext<boolean | undefined>(undefined);\n\nexport type ListboxProps = Omit<BaseProps<\"ul\">, \"role\"> & {\n \"aria-label\": NonNullable<BaseProps<\"ul\">[\"aria-label\"]>;\n \"aria-expanded\": NonNullable<BaseProps<\"ul\">[\"aria-expanded\"]>;\n /** When true, renders the Listbox for use on dark or colored backgrounds. */\n negative?: boolean;\n};\n\ntype ListboxStatic = {\n Item: typeof ListboxItem;\n};\n\ntype ListboxComponent = ForwardRefExoticComponent<PropsWithoutRef<ListboxProps>> & ListboxStatic;\n\nexport const Listbox = forwardRef<HTMLUListElement, ListboxProps>(\n ({ children, negative = false, ...listboxProps }, ref) => (\n <ul\n {...listboxProps}\n ref={ref}\n className={cx(rootClassName, listboxProps.className, {\n [`${rootClassName}--negative`]: negative,\n })}\n role=\"listbox\"\n >\n <ListboxNegativeContext.Provider value={negative}>{children}</ListboxNegativeContext.Provider>\n </ul>\n )\n) as ListboxComponent;\n\nexport type { ListboxItemProps } from \"./listbox-item\";\nListbox.Item = ListboxItem;\nListbox.displayName = \"ListBox\";\n"],"names":["cx","c","styles","rootClassName","ListboxItem","forwardRef","props","ref","listboxNegative","useContext","ListboxNegativeContext","disabled","highlighted","hovered","selected","children","className","noninteractive","negative","hideSelectedIcon","liProps","resolvedNegative","classes","jsxs","jsx","Paragraph","IconCheckmark","createContext","Listbox","listboxProps"],"mappings":"2xBASMA,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAElBC,EAAgB,iBAcTC,EAAcC,EAAAA,WAA4C,CAACC,EAAOC,IAAQ,CACrF,MAAMC,EAAkBC,EAAAA,WAAWC,CAAsB,EACnD,CACJ,SAAAC,EACA,YAAAC,EACA,QAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EACA,eAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,GAAGC,CAAA,EACDd,EACEe,EAAmBb,GAAmBU,EAEtCI,EAAUtB,EAAG,GAAGG,CAAa,QAASa,EAAW,C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P } from "react";
3
+ import { c as u } from "./bind-CU-R61T-.mjs";
4
+ import { a as j } from "./checkmark.es-DdgIZN2R.mjs";
5
+ import { P as B } from "./paragraph-DSxXmX_0.mjs";
6
+ const x = {
7
+ "purpur-listbox": "_purpur-listbox_xi2co_1",
8
+ "purpur-listbox--negative": "_purpur-listbox--negative_xi2co_15",
9
+ "purpur-listbox-item": "_purpur-listbox-item_xi2co_20",
10
+ "purpur-listbox-item--hovered": "_purpur-listbox-item--hovered_xi2co_34",
11
+ "purpur-listbox-item--highlighted": "_purpur-listbox-item--highlighted_xi2co_42",
12
+ "purpur-listbox-item--noninteractive": "_purpur-listbox-item--noninteractive_xi2co_46",
13
+ "purpur-listbox-item--disabled": "_purpur-listbox-item--disabled_xi2co_49",
14
+ "purpur-listbox-item--negative": "_purpur-listbox-item--negative_xi2co_53",
15
+ "purpur-listbox-item__icon": "_purpur-listbox-item__icon_xi2co_70"
16
+ }, c = u.bind(x), e = "purpur-listbox", d = m((s, t) => {
17
+ const o = I(_), {
18
+ disabled: i,
19
+ highlighted: v,
20
+ hovered: h,
21
+ selected: l,
22
+ children: a,
23
+ className: g,
24
+ noninteractive: N,
25
+ negative: $,
26
+ hideSelectedIcon: f,
27
+ ...L
28
+ } = s, p = o ?? $, C = c(`${e}-item`, g, {
29
+ [`${e}-item--highlighted`]: v,
30
+ [`${e}-item--selected`]: l,
31
+ [`${e}-item--hovered`]: h,
32
+ [`${e}-item--disabled`]: i,
33
+ [`${e}-item--noninteractive`]: N,
34
+ [`${e}-item--negative`]: p
35
+ });
36
+ return /* @__PURE__ */ y(
37
+ "li",
38
+ {
39
+ ...L,
40
+ ref: t,
41
+ className: C,
42
+ "aria-selected": !!l,
43
+ role: "option",
44
+ "aria-disabled": !!i,
45
+ children: [
46
+ typeof a == "string" ? /* @__PURE__ */ r(B, { disabled: i, negative: p, children: a }) : a,
47
+ l && !f && /* @__PURE__ */ r(j, { size: "xs", className: c(`${e}-item__icon`) })
48
+ ]
49
+ }
50
+ );
51
+ });
52
+ d.displayName = "ListBoxItem";
53
+ const w = u.bind(x), n = "purpur-listbox", _ = P(void 0), b = m(
54
+ ({ children: s, negative: t = !1, ...o }, i) => /* @__PURE__ */ r(
55
+ "ul",
56
+ {
57
+ ...o,
58
+ ref: i,
59
+ className: w(n, o.className, {
60
+ [`${n}--negative`]: t
61
+ }),
62
+ role: "listbox",
63
+ children: /* @__PURE__ */ r(_.Provider, { value: t, children: s })
64
+ }
65
+ )
66
+ );
67
+ b.Item = d;
68
+ b.displayName = "ListBox";
69
+ export {
70
+ b as L,
71
+ _ as a
72
+ };
73
+ //# sourceMappingURL=listbox-i6BQQ-NZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listbox-i6BQQ-NZ.mjs","sources":["../../../components/listbox/src/listbox-item.tsx","../../../components/listbox/src/listbox.tsx"],"sourcesContent":["import React, { forwardRef, useContext } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { IconCheckmark } from \"@purpur/icon/checkmark\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport { ListboxNegativeContext } from \"./listbox\";\nimport styles from \"./listbox.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-listbox\";\n\nexport type ListboxItemProps = Omit<BaseProps<\"li\">, \"role\"> & {\n highlighted?: boolean;\n hovered?: boolean;\n key?: string;\n selected?: boolean;\n disabled?: boolean;\n noninteractive?: boolean;\n negative?: boolean;\n /** When true, hides the built-in checkmark icon while preserving `aria-selected`. */\n hideSelectedIcon?: boolean;\n};\n\nexport const ListboxItem = forwardRef<HTMLLIElement, ListboxItemProps>((props, ref) => {\n const listboxNegative = useContext(ListboxNegativeContext);\n const {\n disabled,\n highlighted,\n hovered,\n selected,\n children,\n className,\n noninteractive,\n negative,\n hideSelectedIcon,\n ...liProps\n } = props;\n const resolvedNegative = listboxNegative ?? negative;\n\n const classes = cx(`${rootClassName}-item`, className, {\n [`${rootClassName}-item--highlighted`]: highlighted,\n [`${rootClassName}-item--selected`]: selected,\n [`${rootClassName}-item--hovered`]: hovered,\n [`${rootClassName}-item--disabled`]: disabled,\n [`${rootClassName}-item--noninteractive`]: noninteractive,\n [`${rootClassName}-item--negative`]: resolvedNegative,\n });\n\n return (\n <li\n {...liProps}\n ref={ref}\n className={classes}\n aria-selected={!!selected}\n role=\"option\"\n aria-disabled={!!disabled}\n >\n {typeof children === \"string\" ? (\n <Paragraph disabled={disabled} negative={resolvedNegative}>\n {children}\n </Paragraph>\n ) : (\n children\n )}\n {selected && !hideSelectedIcon && (\n <IconCheckmark size=\"xs\" className={cx(`${rootClassName}-item__icon`)} />\n )}\n </li>\n );\n});\n\nListboxItem.displayName = \"ListBoxItem\";\n","import React, {\n createContext,\n forwardRef,\n type ForwardRefExoticComponent,\n type PropsWithoutRef,\n} from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./listbox.module.scss\";\nimport { ListboxItem } from \"./listbox-item\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-listbox\";\n\nexport const ListboxNegativeContext = createContext<boolean | undefined>(undefined);\n\nexport type ListboxProps = Omit<BaseProps<\"ul\">, \"role\"> & {\n \"aria-label\": NonNullable<BaseProps<\"ul\">[\"aria-label\"]>;\n \"aria-expanded\": NonNullable<BaseProps<\"ul\">[\"aria-expanded\"]>;\n /** When true, renders the Listbox for use on dark or colored backgrounds. */\n negative?: boolean;\n};\n\ntype ListboxStatic = {\n Item: typeof ListboxItem;\n};\n\ntype ListboxComponent = ForwardRefExoticComponent<PropsWithoutRef<ListboxProps>> & ListboxStatic;\n\nexport const Listbox = forwardRef<HTMLUListElement, ListboxProps>(\n ({ children, negative = false, ...listboxProps }, ref) => (\n <ul\n {...listboxProps}\n ref={ref}\n className={cx(rootClassName, listboxProps.className, {\n [`${rootClassName}--negative`]: negative,\n })}\n role=\"listbox\"\n >\n <ListboxNegativeContext.Provider value={negative}>{children}</ListboxNegativeContext.Provider>\n </ul>\n )\n) as ListboxComponent;\n\nexport type { ListboxItemProps } from \"./listbox-item\";\nListbox.Item = ListboxItem;\nListbox.displayName = \"ListBox\";\n"],"names":["cx","c","styles","rootClassName","ListboxItem","forwardRef","props","ref","listboxNegative","useContext","ListboxNegativeContext","disabled","highlighted","hovered","selected","children","className","noninteractive","negative","hideSelectedIcon","liProps","resolvedNegative","classes","jsxs","jsx","Paragraph","IconCheckmark","createContext","Listbox","listboxProps"],"mappings":";;;;;;;;;;;;;;;GASMA,IAAKC,EAAE,KAAKC,CAAM,GAElBC,IAAgB,kBAcTC,IAAcC,EAA4C,CAACC,GAAOC,MAAQ;AACrF,QAAMC,IAAkBC,EAAWC,CAAsB,GACnD;AAAA,IACJ,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDd,GACEe,IAAmBb,KAAmBU,GAEtCI,IAAUtB,EAAG,GAAGG,CAAa,SAASa,GAAW;AAAA,IACrD,CAAC,GAAGb,CAAa,oBAAoB,GAAGS;AAAA,IACxC,CAAC,GAAGT,CAAa,iBAAiB,GAAGW;AAAA,IACrC,CAAC,GAAGX,CAAa,gBAAgB,GAAGU;AAAA,IACpC,CAAC,GAAGV,CAAa,iBAAiB,GAAGQ;AAAA,IACrC,CAAC,GAAGR,CAAa,uBAAuB,GAAGc;AAAA,IAC3C,CAAC,GAAGd,CAAa,iBAAiB,GAAGkB;AAAA,EAAA,CACtC;AAED,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGH;AAAA,MACJ,KAAAb;AAAA,MACA,WAAWe;AAAA,MACX,iBAAe,CAAC,CAACR;AAAA,MACjB,MAAK;AAAA,MACL,iBAAe,CAAC,CAACH;AAAA,MAEhB,UAAA;AAAA,QAAA,OAAOI,KAAa,WACnB,gBAAAS,EAACC,GAAA,EAAU,UAAAd,GAAoB,UAAUU,GACtC,UAAAN,GACH,IAEAA;AAAA,QAEDD,KAAY,CAACK,KACZ,gBAAAK,EAACE,GAAA,EAAc,MAAK,MAAK,WAAW1B,EAAG,GAAGG,CAAa,aAAa,EAAA,CAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAI/E,CAAC;AAEDC,EAAY,cAAc;AC7D1B,MAAMJ,IAAKC,EAAE,KAAKC,CAAM,GAElBC,IAAgB,kBAETO,IAAyBiB,EAAmC,MAAS,GAerEC,IAAUvB;AAAA,EACrB,CAAC,EAAE,UAAAU,GAAU,UAAAG,IAAW,IAAO,GAAGW,EAAA,GAAgBtB,MAChD,gBAAAiB;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGK;AAAA,MACJ,KAAAtB;AAAA,MACA,WAAWP,EAAGG,GAAe0B,EAAa,WAAW;AAAA,QACnD,CAAC,GAAG1B,CAAa,YAAY,GAAGe;AAAA,MAAA,CACjC;AAAA,MACD,MAAK;AAAA,MAEL,4BAACR,EAAuB,UAAvB,EAAgC,OAAOQ,GAAW,UAAAH,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAGlE;AAGAa,EAAQ,OAAOxB;AACfwB,EAAQ,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./listbox-COBHLRtB.js");exports.Listbox=t.Listbox;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./listbox-ATP4hOWF.js");exports.Listbox=t.Listbox;exports.ListboxNegativeContext=t.ListboxNegativeContext;
2
2
  //# sourceMappingURL=listbox.cjs.js.map
@@ -1,5 +1,6 @@
1
- import { L as s } from "./listbox-DG4KmQP_.mjs";
1
+ import { L as a, a as e } from "./listbox-i6BQQ-NZ.mjs";
2
2
  export {
3
- s as Listbox
3
+ a as Listbox,
4
+ e as ListboxNegativeContext
4
5
  };
5
6
  //# sourceMappingURL=listbox.es.js.map
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),c=require("./index-2cFVyGXq.js"),s=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_1nrj3_1",J="_fadeOut_1nrj3_1",Q="_slideUp_1nrj3_1",X="_slideDown_1nrj3_1",Y={"purpur-modal-content":"_purpur-modal-content_1nrj3_1",fadeIn:G,fadeOut:J,slideUp:Q,slideDown:X,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_1nrj3_49","purpur-modal-content__close-button":"_purpur-modal-content__close-button_1nrj3_65","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_1nrj3_75","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_1nrj3_85","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_1nrj3_89","purpur-modal-content__header":"_purpur-modal-content__header_1nrj3_112","purpur-modal-content__title":"_purpur-modal-content__title_1nrj3_125","purpur-modal-content__heading":"_purpur-modal-content__heading_1nrj3_128","purpur-modal-content__description":"_purpur-modal-content__description_1nrj3_131","purpur-modal-content__body":"_purpur-modal-content__body_1nrj3_134","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_1nrj3_142","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_1nrj3_154","purpur-modal-content__notification":"_purpur-modal-content__notification_1nrj3_172","purpur-modal-content--with-image":"_purpur-modal-content--with-image_1nrj3_175","purpur-modal-content--overflow":"_purpur-modal-content--overflow_1nrj3_175","purpur-modal-content__actions":"_purpur-modal-content__actions_1nrj3_154","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_1nrj3_206","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_1nrj3_216"},N=n=>n.showCloseButton===!0,r=k.c.bind(Y),t="purpur-modal-content",Z=s.forwardRef(({["data-testid"]:n,actions:o,children:a,className:u,description:i,disableCloseOnClickOutside:y,hideDescription:b,image:p,stickyButtons:v=!0,title:q,notification:x=void 0,zIndex:$,onCloseAutoFocus:D,...g},O)=>{const{closeButtonAriaLabel:h,showCloseButton:E,...H}=g,[I,M]=s.useState(!1),[P,S]=s.useState(0),m=s.useRef(null),j=s.useRef(null),B=r(t,{[`${t}--with-image`]:!!p},{[`${t}--overflow`]:I},{[`${t}--sticky-footer`]:v},u),d=l=>n?`${n} ${l}`:void 0,T=l=>{y&&l.preventDefault()},_=s.useCallback(()=>{if(!m.current||!j.current)return;const l=window.getComputedStyle(m.current,null),f=parseFloat(l.getPropertyValue("height")),A=j.current.offsetHeight;M(f<A),S((m.current.offsetWidth??0)-(m.current.clientWidth??0))},[]),W=()=>{const l=j.current;if(l){const f=l.querySelector("h2");f&&setTimeout(()=>{f.focus()})}},z=l=>{y&&!E&&l.preventDefault()};return s.useEffect(()=>(window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}),[_]),s.useEffect(()=>{_()},[x,a,_]),e.jsxs(c.Portal,{children:[e.jsx(c.Overlay,{className:r(`${t}__overlay`),style:{zIndex:$}}),e.jsxs(c.Content,{...H,className:B,"data-testid":n,ref:O,...!i&&{"aria-describedby":void 0},onPointerDownOutside:T,onOpenAutoFocus:()=>{_(),W()},onEscapeKeyDown:z,onCloseAutoFocus:D,style:{zIndex:`calc(${$} + 1)`},children:[e.jsxs("div",{ref:m,className:r(`${t}__wrapper`),children:[N(g)&&h&&p&&e.jsx(C,{"aria-label":h,hasImage:!0,scrollbarWidth:P,"data-testid":d("close-button")}),e.jsxs("div",{ref:j,className:r(`${t}__wrapper-inner`),children:[e.jsxs("div",{className:r(`${t}__header`),children:[N(g)&&h&&!p&&e.jsx(C,{"aria-label":h,"data-testid":d("close-button")}),e.jsx(c.Title,{asChild:!0,className:r(`${t}__title`),"data-testid":d("title"),children:e.jsx(L.Heading,{tag:"h2",variant:"display-10",tabIndex:-1,className:r(`${t}__heading`),children:q})})]}),p&&e.jsx("div",{className:r(`${t}__image-wrapper`),"data-testid":d("image"),children:p}),e.jsx("div",{className:r(`${t}__body`),children:e.jsxs("div",{className:r(`${t}__body-inner`),children:[i&&b&&e.jsx(K.VisuallyHidden,{asChild:!0,children:e.jsx(c.Description,{"data-testid":d("description"),children:i})}),i&&!b&&e.jsx(c.Description,{asChild:!0,className:r(`${t}__description`),"data-testid":d("description"),children:e.jsx(V.Paragraph,{variant:"paragraph-100",children:i})}),e.jsx("div",{children:a}),!v&&e.jsx(R,{actions:o,notification:x})]})})]})]}),v&&e.jsx(R,{actions:o,notification:x})]})]})}),C=({["aria-label"]:n,hasImage:o,scrollbarWidth:a,["data-testid"]:u})=>e.jsx(c.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) + ${a||0}px)`},"data-testid":u,children:e.jsx(U.r,{})})}),R=({actions:n,notification:o})=>{const a=s.useRef(null);return s.useEffect(()=>{o&&a?.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:a,children:o}),e.jsx("span",{className:r(`${t}__actions-separator`)})]}):null},ee=s.forwardRef(({children:n,...o},a)=>e.jsx(c.Trigger,{asChild:!0,ref:a,...o,children:n})),w=({["data-testid"]:n,children:o,open:a,onOpenChange:u})=>e.jsx(c.Root,{open:a,onOpenChange:u,"data-testid":n,children:o});w.Trigger=ee;w.Content=Z;w.displayName="Modal";exports.Modal=w;
2
- //# sourceMappingURL=modal-COF_UhvY.js.map
1
+ "use strict";const e=require("react/jsx-runtime"),c=require("./index-2cFVyGXq.js"),s=require("react"),F=require("./button-DmybVApa.js"),L=require("./heading-drD5ugCC.js"),U=require("./close.es-VL3lKi1O.js"),V=require("./paragraph-By4jMjnH.js"),K=require("./visually-hidden-C2CKovZx.js"),k=require("./bind-DeUYJ6m9.js"),G="_fadeIn_1nrj3_1",J="_fadeOut_1nrj3_1",Q="_slideUp_1nrj3_1",X="_slideDown_1nrj3_1",Y={"purpur-modal-content":"_purpur-modal-content_1nrj3_1",fadeIn:G,fadeOut:J,slideUp:Q,slideDown:X,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_1nrj3_49","purpur-modal-content__close-button":"_purpur-modal-content__close-button_1nrj3_65","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_1nrj3_75","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_1nrj3_85","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_1nrj3_89","purpur-modal-content__header":"_purpur-modal-content__header_1nrj3_112","purpur-modal-content__title":"_purpur-modal-content__title_1nrj3_125","purpur-modal-content__heading":"_purpur-modal-content__heading_1nrj3_128","purpur-modal-content__description":"_purpur-modal-content__description_1nrj3_131","purpur-modal-content__body":"_purpur-modal-content__body_1nrj3_134","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_1nrj3_142","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_1nrj3_154","purpur-modal-content__notification":"_purpur-modal-content__notification_1nrj3_172","purpur-modal-content--with-image":"_purpur-modal-content--with-image_1nrj3_175","purpur-modal-content--overflow":"_purpur-modal-content--overflow_1nrj3_175","purpur-modal-content__actions":"_purpur-modal-content__actions_1nrj3_154","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_1nrj3_206","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_1nrj3_216"},N=n=>n.showCloseButton===!0,r=k.c.bind(Y),t="purpur-modal-content",Z=s.forwardRef(({["data-testid"]:n,actions:o,children:a,className:u,description:i,disableCloseOnClickOutside:y,hideDescription:b,image:p,stickyButtons:v=!0,title:q,notification:x=void 0,zIndex:$,onCloseAutoFocus:D,...g},O)=>{const{closeButtonAriaLabel:h,showCloseButton:E,...H}=g,[I,M]=s.useState(!1),[P,S]=s.useState(0),m=s.useRef(null),j=s.useRef(null),B=r(t,{[`${t}--with-image`]:!!p},{[`${t}--overflow`]:I},{[`${t}--sticky-footer`]:v},u),d=l=>n?`${n} ${l}`:void 0,T=l=>{y&&l.preventDefault()},_=s.useCallback(()=>{if(!m.current||!j.current)return;const l=window.getComputedStyle(m.current,null),f=parseFloat(l.getPropertyValue("height")),A=j.current.offsetHeight;M(f<A),S((m.current.offsetWidth??0)-(m.current.clientWidth??0))},[]),W=()=>{const l=j.current;if(l){const f=l.querySelector("h2");f&&setTimeout(()=>{f.focus()})}},z=l=>{y&&!E&&l.preventDefault()};return s.useEffect(()=>(window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}),[_]),s.useEffect(()=>{_()},[x,a,_]),e.jsxs(c.Portal,{children:[e.jsx(c.Overlay,{className:r(`${t}__overlay`),style:{zIndex:$}}),e.jsxs(c.Content,{...H,className:B,"data-testid":n,ref:O,...!i&&{"aria-describedby":void 0},onPointerDownOutside:T,onOpenAutoFocus:()=>{_(),W()},onEscapeKeyDown:z,onCloseAutoFocus:D,style:{zIndex:`calc(${$} + 1)`},children:[e.jsxs("div",{ref:m,className:r(`${t}__wrapper`),children:[N(g)&&h&&p&&e.jsx(C,{"aria-label":h,hasImage:!0,scrollbarWidth:P,"data-testid":d("close-button")}),e.jsxs("div",{ref:j,className:r(`${t}__wrapper-inner`),children:[e.jsxs("div",{className:r(`${t}__header`),children:[N(g)&&h&&!p&&e.jsx(C,{"aria-label":h,"data-testid":d("close-button")}),e.jsx(c.Title,{asChild:!0,className:r(`${t}__title`),"data-testid":d("title"),children:e.jsx(L.Heading,{tag:"h2",variant:"display-10",tabIndex:-1,className:r(`${t}__heading`),children:q})})]}),p&&e.jsx("div",{className:r(`${t}__image-wrapper`),"data-testid":d("image"),children:p}),e.jsx("div",{className:r(`${t}__body`),children:e.jsxs("div",{className:r(`${t}__body-inner`),children:[i&&b&&e.jsx(K.VisuallyHidden,{asChild:!0,children:e.jsx(c.Description,{"data-testid":d("description"),children:i})}),i&&!b&&e.jsx(c.Description,{asChild:!0,className:r(`${t}__description`),"data-testid":d("description"),children:e.jsx(V.Paragraph,{variant:"paragraph-100",children:i})}),e.jsx("div",{children:a}),!v&&e.jsx(R,{actions:o,notification:x})]})})]})]}),v&&e.jsx(R,{actions:o,notification:x})]})]})}),C=({["aria-label"]:n,hasImage:o,scrollbarWidth:a,["data-testid"]:u})=>e.jsx(c.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) + ${a||0}px)`},"data-testid":u,children:e.jsx(U.r,{})})}),R=({actions:n,notification:o})=>{const a=s.useRef(null);return s.useEffect(()=>{o&&a?.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:a,children:o}),e.jsx("span",{className:r(`${t}__actions-separator`)})]}):null},ee=s.forwardRef(({children:n,...o},a)=>e.jsx(c.Trigger,{asChild:!0,ref:a,...o,children:n})),w=({["data-testid"]:n,children:o,open:a,onOpenChange:u})=>e.jsx(c.Root,{open:a,onOpenChange:u,"data-testid":n,children:o});w.Trigger=ee;w.Content=Z;w.displayName="Modal";exports.Modal=w;
2
+ //# sourceMappingURL=modal-Baisuc6m.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal-COF_UhvY.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\n tag=\"h2\"\n variant=\"display-10\"\n tabIndex={-1}\n className={cx(`${rootClassName}__heading`)}\n >\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":"+5DAwFMA,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,CAAa,iBAAiB,EAAGW,CAAA,EACvCL,CAAA,EAGIuB,EAAaC,GAAgB3B,EAAa,GAAGA,CAAU,IAAI2B,CAAE,GAAK,OAElEC,EAA4BC,GAAwD,CACpFxB,GACFwB,EAAM,eAAA,CAEV,EAEMC,EAAwBC,EAAAA,YAAY,IAAM,CAC9C,GAAI,CAACT,EAAW,SAAW,CAACE,EAAgB,QAC1C,OAGF,MAAMQ,EAAgB,OAAO,iBAAiBV,EAAW,QAAS,IAAI,EAChEW,EAAgB,WAAWD,EAAc,iBAAiB,QAAQ,CAAC,EACnEE,EAAcV,EAAgB,QAAQ,aAE5CN,EAAmBe,EAAgBC,CAAW,E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AAA,CAAA,CAC9D,EACE,IACN,EC/Ta6D,GAAe3D,EAAAA,WAC1B,CAAC,CAAE,SAAAG,EAAU,GAAGT,CAAA,EAASoB,UAEpB8C,EAAAA,QAAA,CAAa,QAAO,GAAC,IAAA9C,EAAW,GAAGpB,EACjC,SAAAS,EACH,CAGN,ECGa0D,EAAQ,CAAC,CACpB,CAAC,eAAgB5D,EACjB,SAAAE,EACA,KAAA2D,EACA,aAAAC,CACF,UACGC,EAAAA,KAAA,CAAU,KAAAF,EAAY,aAAAC,EAA4B,cAAa9D,EAC7D,SAAAE,CAAA,CACH,EAGF0D,EAAM,QAAUF,GAChBE,EAAM,QAAU9D,EAEhB8D,EAAM,YAAc"}
1
+ {"version":3,"file":"modal-Baisuc6m.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\n tag=\"h2\"\n variant=\"display-10\"\n tabIndex={-1}\n className={cx(`${rootClassName}__heading`)}\n >\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":"+5DAwFMA,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,IAA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EAAAA,EAAA,CAAA,CAAU,CAAA,CACb,EACF,EAKWL,EAAe,CAAC,CAC3B,QAAAlD,EACA,aAAAS,CACF,IAA2D,CACzD,MAAM+C,EAAkBlC,EAAAA,OAAuB,IAAI,EAEnDgB,OAAAA,EAAAA,UAAU,IAAM,CACV7B,GACF+C,GAAiB,SAAS,iBAAiB,EAAK,CAEpD,EAAG,CAAC/C,CAAY,CAAC,EAEVT,SACJ,MAAA,CAAI,UAAWP,EAAG,GAAGG,CAAa,WAAW,EAC5C,SAAA,CAAA4C,EAAAA,IAAC,MAAA,CAAI,UAAW/C,EAAG,GAAGG,CAAa,mBAAmB,EAAG,cAAY,gBAClE,SAAAI,CAAA,CACH,EACCS,GACC+B,EAAAA,IAAC,MAAA,CAAI,UAAW/C,EAAG,GAAGG,CAAa,gBAAgB,EAAG,IAAK4D,EACxD,SAAA/C,CAAA,CACH,QAED,OAAA,CAAK,UAAWhB,EAAG,GAAGG,CAAa,qBAAqB,CAAA,CAAG,CAAA,CAAA,CAC9D,EACE,IACN,EC/Ta6D,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"}
@@ -4,7 +4,7 @@ import { forwardRef as H, useState as O, useRef as b, useCallback as Z, useEffec
4
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
- import { P as nt } from "./paragraph-Ci50OF1u.mjs";
7
+ import { P as nt } from "./paragraph-DSxXmX_0.mjs";
8
8
  import { V as ot } from "./visually-hidden-BYFkJEp1.mjs";
9
9
  import { c as at } from "./bind-CU-R61T-.mjs";
10
10
  const lt = "_fadeIn_1nrj3_1", st = "_fadeOut_1nrj3_1", _t = "_slideUp_1nrj3_1", dt = "_slideDown_1nrj3_1", ct = {
@@ -208,4 +208,4 @@ j.displayName = "Modal";
208
208
  export {
209
209
  j as M
210
210
  };
211
- //# sourceMappingURL=modal-BMg43Fvd.mjs.map
211
+ //# sourceMappingURL=modal-COZ1POGG.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal-BMg43Fvd.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\n tag=\"h2\"\n variant=\"display-10\"\n tabIndex={-1}\n className={cx(`${rootClassName}__heading`)}\n >\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,GAAiB,GAAGC,MAASvB,GACrD,CAACwB,GAAiBC,CAAkB,IAAIC,EAAS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,CAAa,mBAAmB,GAAG,eAAY,iBAClE,UAAAI,EAAA,CACH;AAAA,IACCS,KACC,gBAAA+B,EAAC,OAAA,EAAI,WAAW/C,EAAG,GAAGG,CAAa,gBAAgB,GAAG,KAAK4D,GACxD,UAAA/C,EAAA,CACH;AAAA,sBAED,QAAA,EAAK,WAAWhB,EAAG,GAAGG,CAAa,qBAAqB,EAAA,CAAG;AAAA,EAAA,EAAA,CAC9D,IACE;AACN,GC/Ta6D,KAAe3D;AAAA,EAC1B,CAAC,EAAE,UAAAG,GAAU,GAAGT,EAAA,GAASoB,wBAEpB8C,GAAA,EAAa,SAAO,IAAC,KAAA9C,GAAW,GAAGpB,GACjC,UAAAS,GACH;AAGN,GCGa0D,IAAQ,CAAC;AAAA,EACpB,CAAC,gBAAgB5D;AAAA,EACjB,UAAAE;AAAA,EACA,MAAA2D;AAAA,EACA,cAAAC;AACF,wBACGC,GAAA,EAAU,MAAAF,GAAY,cAAAC,GAA4B,eAAa9D,GAC7D,UAAAE,EAAA,CACH;AAGF0D,EAAM,UAAUF;AAChBE,EAAM,UAAU9D;AAEhB8D,EAAM,cAAc;"}
1
+ {"version":3,"file":"modal-COZ1POGG.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\n tag=\"h2\"\n variant=\"display-10\"\n tabIndex={-1}\n className={cx(`${rootClassName}__heading`)}\n >\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,4B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ACF,MAA2D;AACzD,QAAM+C,IAAkBlC,EAAuB,IAAI;AAEnD,SAAAgB,EAAU,MAAM;AACd,IAAI7B,KACF+C,GAAiB,SAAS,iBAAiB,EAAK;AAAA,EAEpD,GAAG,CAAC/C,CAAY,CAAC,GAEVT,sBACJ,OAAA,EAAI,WAAWP,EAAG,GAAGG,CAAa,WAAW,GAC5C,UAAA;AAAA,IAAA,gBAAA4C,EAAC,OAAA,EAAI,WAAW/C,EAAG,GAAGG,CAAa,mBAAmB,GAAG,eAAY,iBAClE,UAAAI,EAAA,CACH;AAAA,IACCS,KACC,gBAAA+B,EAAC,OAAA,EAAI,WAAW/C,EAAG,GAAGG,CAAa,gBAAgB,GAAG,KAAK4D,GACxD,UAAA/C,EAAA,CACH;AAAA,sBAED,QAAA,EAAK,WAAWhB,EAAG,GAAGG,CAAa,qBAAqB,EAAA,CAAG;AAAA,EAAA,EAAA,CAC9D,IACE;AACN,GC/Ta6D,KAAe3D;AAAA,EAC1B,CAAC,EAAE,UAAAG,GAAU,GAAGT,EAAA,GAASoB,wBAEpB8C,GAAA,EAAa,SAAO,IAAC,KAAA9C,GAAW,GAAGpB,GACjC,UAAAS,GACH;AAGN,GCGa0D,IAAQ,CAAC;AAAA,EACpB,CAAC,gBAAgB5D;AAAA,EACjB,UAAAE;AAAA,EACA,MAAA2D;AAAA,EACA,cAAAC;AACF,wBACGC,GAAA,EAAU,MAAAF,GAAY,cAAAC,GAA4B,eAAa9D,GAC7D,UAAAE,EAAA,CACH;AAGF0D,EAAM,UAAUF;AAChBE,EAAM,UAAU9D;AAEhB8D,EAAM,cAAc;"}
package/dist/modal.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./modal-COF_UhvY.js");exports.Modal=e.Modal;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./modal-Baisuc6m.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-BMg43Fvd.mjs";
1
+ import { M as r } from "./modal-COZ1POGG.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-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
+ "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-By4jMjnH.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-B5bNNq86.js.map
@@ -1 +1 @@
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,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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A,CAAU,WAAa,OACpD,QAAQ,iBACR,IAAKK,EACL,UAAWxB,EAAG,GAAGS,CAAa,WAAW,EAEzC,gBAAC,OAAA,CAAK,GAAIkB,EAAK,GAAGA,CAAE,WAAa,OAAW,SAAA,CAAA,IAAEF,CAAA,CAAA,CAAQ,CAAA,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-B5bNNq86.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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ACjD,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"}
@@ -4,7 +4,7 @@ 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";
7
- import { P as O } from "./paragraph-Ci50OF1u.mjs";
7
+ import { P as O } from "./paragraph-DSxXmX_0.mjs";
8
8
  import { c as A } from "./bind-CU-R61T-.mjs";
9
9
  const R = {
10
10
  name: "alert-filled",
@@ -176,4 +176,4 @@ export {
176
176
  T as e,
177
177
  W as n
178
178
  };
179
- //# sourceMappingURL=notification-DdRS5BF2.mjs.map
179
+ //# sourceMappingURL=notification-BbQCmsnY.mjs.map