@purpur/library 9.10.1 → 10.0.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.
- package/CHANGELOG.json +106 -0
- package/CHANGELOG.md +44 -1
- package/dist/LICENSE.txt +234 -179
- package/dist/{RichText-IejAKqm2.js → RichText-B865Qkzj.js} +2 -2
- package/dist/{RichText-IejAKqm2.js.map → RichText-B865Qkzj.js.map} +1 -1
- package/dist/{RichText-2_z57EYi.mjs → RichText-CPkBwXNI.mjs} +2 -2
- package/dist/{RichText-2_z57EYi.mjs.map → RichText-CPkBwXNI.mjs.map} +1 -1
- package/dist/accordion-aEZas0k1.mjs +122 -0
- package/dist/accordion-aEZas0k1.mjs.map +1 -0
- package/dist/accordion-zwsF1oUj.js +2 -0
- package/dist/accordion-zwsF1oUj.js.map +1 -0
- package/dist/accordion.cjs.js +1 -1
- package/dist/accordion.es.js +1 -1
- package/dist/button-C5CYysw5.js +2 -0
- package/dist/button-C5CYysw5.js.map +1 -0
- package/dist/button-mHw_J7JU.mjs +106 -0
- package/dist/button-mHw_J7JU.mjs.map +1 -0
- package/dist/button.cjs.js +1 -1
- package/dist/button.es.js +1 -1
- package/dist/{calendar-CTWhxuS4.mjs → calendar-DTL_g0ue.mjs} +4 -14
- package/dist/{calendar-CTWhxuS4.mjs.map → calendar-DTL_g0ue.mjs.map} +1 -1
- package/dist/{calendar-Cwzqytai.js → calendar-DVOrK53J.js} +2 -2
- package/dist/{calendar-Cwzqytai.js.map → calendar-DVOrK53J.js.map} +1 -1
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.es.js +1 -1
- package/dist/{card-t2ZkZ82G.mjs → card-C0yhMN5d.mjs} +3 -3
- package/dist/card-C0yhMN5d.mjs.map +1 -0
- package/dist/{card-pdsBEJif.js → card-CIlY38WI.js} +2 -2
- package/dist/card-CIlY38WI.js.map +1 -0
- package/dist/card.cjs.js +1 -1
- package/dist/card.es.js +1 -1
- package/dist/{carousel-DiKGSL-7.mjs → carousel-Dq9yzk_-.mjs} +2 -2
- package/dist/{carousel-DiKGSL-7.mjs.map → carousel-Dq9yzk_-.mjs.map} +1 -1
- package/dist/{carousel-Dz_bUGo4.js → carousel-j-s6M1hu.js} +2 -2
- package/dist/{carousel-Dz_bUGo4.js.map → carousel-j-s6M1hu.js.map} +1 -1
- package/dist/carousel.cjs.js +1 -1
- package/dist/carousel.es.js +1 -1
- package/dist/{chat-field-B2jmpVNr.js → chat-field-CLAjIHlM.js} +2 -2
- package/dist/{chat-field-B2jmpVNr.js.map → chat-field-CLAjIHlM.js.map} +1 -1
- package/dist/{chat-field-8cKqYcKi.mjs → chat-field-nxFRXoQx.mjs} +2 -2
- package/dist/{chat-field-8cKqYcKi.mjs.map → chat-field-nxFRXoQx.mjs.map} +1 -1
- package/dist/chat-field.cjs.js +1 -1
- package/dist/chat-field.es.js +1 -1
- package/dist/{chip-group-B775zvKD.js → chip-group-BLuG0MC6.js} +2 -2
- package/dist/{chip-group-B775zvKD.js.map → chip-group-BLuG0MC6.js.map} +1 -1
- package/dist/{chip-group-xuOe7nL3.mjs → chip-group-Bo4kJ8Vq.mjs} +2 -2
- package/dist/{chip-group-xuOe7nL3.mjs.map → chip-group-Bo4kJ8Vq.mjs.map} +1 -1
- package/dist/chip-group.cjs.js +1 -1
- package/dist/chip-group.es.js +1 -1
- package/dist/color-dot-BEE5rKco.js.map +1 -1
- package/dist/color-dot-Dz9yzVX3.mjs.map +1 -1
- package/dist/{comparison-table-N5G3k2kr.js → comparison-table-CRWRijfG.js} +2 -2
- package/dist/{comparison-table-N5G3k2kr.js.map → comparison-table-CRWRijfG.js.map} +1 -1
- package/dist/{comparison-table-CmtSOUfK.mjs → comparison-table-DYaRaP9Z.mjs} +3 -3
- package/dist/{comparison-table-CmtSOUfK.mjs.map → comparison-table-DYaRaP9Z.mjs.map} +1 -1
- package/dist/comparison-table.cjs.js +1 -1
- package/dist/comparison-table.es.js +1 -1
- package/dist/components/accordion/src/accordion-item.d.ts +5 -5
- package/dist/components/accordion/src/accordion-item.d.ts.map +1 -1
- package/dist/components/accordion/src/accordion.d.ts +2 -6
- package/dist/components/accordion/src/accordion.d.ts.map +1 -1
- package/dist/components/accordion/src/accordion.visual.fixtures.d.ts.map +1 -1
- package/dist/components/alert-badge/src/alert-badge.d.ts +1 -1
- package/dist/components/badge/src/badge.d.ts +1 -1
- package/dist/components/button/src/button.d.ts +3 -4
- package/dist/components/button/src/button.d.ts.map +1 -1
- package/dist/components/button/src/button.visual.fixtures.d.ts +1 -1
- package/dist/components/calendar/src/calendar.d.ts.map +1 -1
- package/dist/components/card/src/card-badge.d.ts +1 -1
- package/dist/components/card/src/card-content-container.d.ts +1 -1
- package/dist/components/card/src/card-content.d.ts +1 -1
- package/dist/components/card/src/card-heading.d.ts +5 -5
- package/dist/components/card/src/card-heading.d.ts.map +1 -1
- package/dist/components/card/src/card-root.d.ts +1 -1
- package/dist/components/color-dot/src/color-dot.d.ts +2 -1
- package/dist/components/color-dot/src/color-dot.d.ts.map +1 -1
- package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts +1 -1
- package/dist/components/content-block/src/content-block-group.d.ts +1 -1
- package/dist/components/content-block/src/content-block.d.ts +2 -2
- package/dist/components/content-block/src/content-block.d.ts.map +1 -1
- package/dist/components/counter-badge/src/counter-badge.d.ts +1 -1
- package/dist/components/country-flag-icon/src/all-country-flag-assets.d.ts +0 -1
- package/dist/components/country-flag-icon/src/all-country-flag-assets.d.ts.map +1 -1
- package/dist/components/country-flag-icon/src/country-flag-icon.d.ts +1 -1
- package/dist/components/cta-link/src/cta-link.d.ts +10 -10
- package/dist/components/date-field/src/date-field.d.ts +1 -1
- package/dist/components/date-picker/src/date-picker.d.ts +1 -1
- package/dist/components/date-range-field/src/date-range-field.d.ts +2 -2
- package/dist/components/date-range-field/src/date-range-field.d.ts.map +1 -1
- package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts +2 -2
- package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts.map +1 -1
- package/dist/components/drawer/src/drawer-container.d.ts +1 -1
- package/dist/components/drawer/src/drawer-container.d.ts.map +1 -1
- package/dist/components/drawer/src/drawer-frame.d.ts +2 -2
- package/dist/components/drawer/src/drawer-handle.d.ts +1 -1
- package/dist/components/drawer/src/drawer-header.d.ts +1 -1
- package/dist/components/drawer/src/drawer-scroll-area.d.ts +1 -1
- package/dist/components/drawer/src/drawer-trigger.d.ts +1 -1
- package/dist/components/drawer/src/drawer.context.d.ts +2 -0
- package/dist/components/drawer/src/drawer.context.d.ts.map +1 -1
- package/dist/components/drawer/src/drawer.d.ts +2 -0
- package/dist/components/drawer/src/drawer.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown-combobox.d.ts +2 -34
- package/dist/components/dropdown/src/dropdown-combobox.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown-select.d.ts +2 -34
- package/dist/components/dropdown/src/dropdown-select.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown-shared.d.ts +2 -1
- package/dist/components/dropdown/src/dropdown-shared.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown.types.d.ts +24 -13
- package/dist/components/dropdown/src/dropdown.types.d.ts.map +1 -1
- package/dist/components/dropdown/src/useDropdown.d.ts +1 -1
- package/dist/components/dropdown/src/useDropdown.d.ts.map +1 -1
- package/dist/components/dropdown/src/useDropdownFilter.d.ts.map +1 -1
- package/dist/components/dropdown/src/useDropdownInput.d.ts.map +1 -1
- package/dist/components/field-helper-text/src/field-helper-text.d.ts +1 -1
- package/dist/components/file-upload/src/file-upload-button.d.ts +22 -0
- package/dist/components/file-upload/src/file-upload-button.d.ts.map +1 -0
- package/dist/components/file-upload/src/file-upload-drag-and-drop.d.ts +10 -0
- package/dist/components/file-upload/src/file-upload-drag-and-drop.d.ts.map +1 -0
- package/dist/components/file-upload/src/file-upload-file-name-label.d.ts +8 -0
- package/dist/components/file-upload/src/file-upload-file-name-label.d.ts.map +1 -0
- package/dist/components/file-upload/src/file-upload-icon.d.ts +8 -0
- package/dist/components/file-upload/src/file-upload-icon.d.ts.map +1 -0
- package/dist/components/file-upload/src/file-upload-types.d.ts +82 -0
- package/dist/components/file-upload/src/file-upload-types.d.ts.map +1 -0
- package/dist/components/file-upload/src/file-upload-utils.d.ts +7 -0
- package/dist/components/file-upload/src/file-upload-utils.d.ts.map +1 -0
- package/dist/components/file-upload/src/file-upload.d.ts +6 -0
- package/dist/components/file-upload/src/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload/src/file-upload.visual.fixtures.d.ts +14 -0
- package/dist/components/file-upload/src/file-upload.visual.fixtures.d.ts.map +1 -0
- package/dist/components/footer/src/footer-social-link.d.ts +3 -3
- package/dist/components/heading/src/heading.d.ts +22 -4
- package/dist/components/heading/src/heading.d.ts.map +1 -1
- package/dist/components/hero-banner/src/hero-banner-types.d.ts +4 -4
- package/dist/components/hero-banner/src/hero-banner-types.d.ts.map +1 -1
- package/dist/components/hero-banner/src/hero-banner.d.ts +1 -1
- package/dist/components/hero-banner/src/hero-banner.d.ts.map +1 -1
- package/dist/components/icon/src/icon.d.ts +2 -2
- package/dist/components/illustrative-icon/src/static-illustrative-icon.d.ts +2 -2
- package/dist/components/label/src/label.d.ts +1 -1
- package/dist/components/listbox/src/listbox.d.ts +1 -1
- package/dist/components/loading/src/loading-illustrative.d.ts +1 -1
- package/dist/components/logo/src/logo.types.d.ts +1 -1
- package/dist/components/modal/src/modal-content.d.ts +1 -1
- package/dist/components/modal/src/modal-content.d.ts.map +1 -1
- package/dist/components/notification-banner/src/notification-banner.d.ts +3 -3
- package/dist/components/notification-banner/src/notification-banner.d.ts.map +1 -1
- package/dist/components/pagination/src/pagination-page-size-selector.d.ts +2 -2
- package/dist/components/pagination/src/pagination-page-trigger.d.ts +1 -1
- package/dist/components/pagination/src/pagination-pages.d.ts +2 -2
- package/dist/components/pagination/src/pagination-step-trigger.d.ts +2 -2
- package/dist/components/pagination/src/pagination-truncation-separator.d.ts +1 -1
- package/dist/components/pagination/src/types.d.ts +1 -1
- package/dist/components/pagination/src/use-page-options.hook.d.ts +1 -1
- package/dist/components/pagination/src/use-page-size-options.hook.d.ts +1 -1
- package/dist/components/paragraph/src/paragraph.d.ts +1 -1
- package/dist/components/password-field/src/password-strength-indicator.d.ts +1 -1
- package/dist/components/popover/src/popover-button.d.ts +2 -2
- package/dist/components/product-card/src/product-card.d.ts +1 -1
- package/dist/components/promotion-card/src/promotion-card.d.ts +10 -10
- package/dist/components/promotion-card/src/promotion-card.d.ts.map +1 -1
- package/dist/components/quantity-selector/src/quantity-selector-button.d.ts +2 -3
- package/dist/components/quantity-selector/src/quantity-selector-button.d.ts.map +1 -1
- package/dist/components/quantity-selector/src/quantity-selector.d.ts +3 -6
- package/dist/components/quantity-selector/src/quantity-selector.d.ts.map +1 -1
- package/dist/components/radio-button-group/src/radio-button-group-root.d.ts +1 -1
- package/dist/components/radio-card-group/src/radio-card-item.d.ts +1 -1
- package/dist/components/rich-text/src/types.d.ts +3 -3
- package/dist/components/search-field/src/search-field-autocomplete.d.ts +1 -1
- package/dist/components/search-field/src/search-field-base.d.ts +1 -1
- package/dist/components/select/src/select.d.ts +1 -1
- package/dist/components/skeleton/src/skeleton.d.ts +1 -1
- package/dist/components/spacer/src/spacer.d.ts +2 -2
- package/dist/components/spinner/src/spinner.d.ts +3 -3
- package/dist/components/stepper/src/stepper-container.d.ts +1 -1
- package/dist/components/stepper/src/{stepper-button.d.ts → stepper-link.d.ts} +5 -4
- package/dist/components/stepper/src/stepper-link.d.ts.map +1 -0
- package/dist/components/stepper/src/stepper-nav-items.d.ts +1 -0
- package/dist/components/stepper/src/stepper-nav-items.d.ts.map +1 -1
- package/dist/components/stepper/src/stepper.d.ts +2 -2
- package/dist/components/stepper/src/stepper.d.ts.map +1 -1
- package/dist/components/stepper/src/types.d.ts +2 -2
- package/dist/components/stepper/src/types.d.ts.map +1 -1
- package/dist/components/stepper/src/use-content-focus.hook.d.ts.map +1 -1
- package/dist/components/table/src/cell-types/button-group-cell.d.ts +2 -2
- package/dist/components/table/src/draggable-table.d.ts.map +1 -1
- package/dist/components/table/src/empty-table.d.ts +2 -2
- package/dist/components/table/src/table-column-header-cell.d.ts +1 -2
- package/dist/components/table/src/table-column-header-cell.d.ts.map +1 -1
- package/dist/components/table/src/table-content.d.ts +1 -1
- package/dist/components/table/src/table-headers.d.ts +2 -3
- package/dist/components/table/src/table-headers.d.ts.map +1 -1
- package/dist/components/table/src/table-settings-drawer.d.ts +11 -20
- package/dist/components/table/src/table-settings-drawer.d.ts.map +1 -1
- package/dist/components/table/src/table.d.ts +1 -8
- package/dist/components/table/src/table.d.ts.map +1 -1
- package/dist/components/table/src/test-utils/helpers.d.ts +10 -19
- package/dist/components/table/src/test-utils/helpers.d.ts.map +1 -1
- package/dist/components/tabs/src/tab-content.d.ts +4 -2
- package/dist/components/tabs/src/tab-content.d.ts.map +1 -1
- package/dist/components/text-field/src/text-field-ai.d.ts +4 -4
- package/dist/components/text-field/src/text-field-base.d.ts +4 -4
- package/dist/components/text-field/src/text-field.d.ts +5 -5
- package/dist/components/text-spacing/src/text-spacing.d.ts +1 -1
- package/dist/components/toggle/src/toggle.d.ts +1 -1
- package/dist/components/tooltip/src/tooltip.d.ts +4 -6
- package/dist/components/tooltip/src/tooltip.d.ts.map +1 -1
- package/dist/components-metadata.js +20 -10
- package/dist/{content-block-CDMrz41K.mjs → content-block-BCM0I3Y2.mjs} +2 -2
- package/dist/content-block-BCM0I3Y2.mjs.map +1 -0
- package/dist/{content-block-DyYAnL2e.js → content-block-DQppQumZ.js} +2 -2
- package/dist/content-block-DQppQumZ.js.map +1 -0
- package/dist/content-block.cjs.js +1 -1
- package/dist/content-block.es.js +1 -1
- package/dist/core.esm-BmIwrKkJ.js +6 -0
- package/dist/core.esm-BmIwrKkJ.js.map +1 -0
- package/dist/core.esm-CKGHpLM_.mjs +2892 -0
- package/dist/core.esm-CKGHpLM_.mjs.map +1 -0
- package/dist/country-flag-icon/LICENSE.txt +11 -0
- package/dist/country-flag-icon/all-country-flag-assets.cjs.js +1 -1
- package/dist/country-flag-icon/all-country-flag-assets.cjs.js.map +1 -1
- package/dist/country-flag-icon/all-country-flag-assets.d.ts +0 -1
- package/dist/country-flag-icon/all-country-flag-assets.d.ts.map +1 -1
- package/dist/country-flag-icon/all-country-flag-assets.es.js +0 -1
- package/dist/country-flag-icon/all-country-flag-assets.es.js.map +1 -1
- package/dist/country-flag-icon/dynamic-country-flag-icon.cjs.js +2 -0
- package/dist/country-flag-icon/dynamic-country-flag-icon.cjs.js.map +1 -0
- package/dist/country-flag-icon/dynamic-country-flag-icon.es.js +366 -0
- package/dist/country-flag-icon/dynamic-country-flag-icon.es.js.map +1 -0
- package/dist/{date-field-CwZ64buh.js → date-field-CtpWDaSh.js} +2 -2
- package/dist/{date-field-CwZ64buh.js.map → date-field-CtpWDaSh.js.map} +1 -1
- package/dist/{date-field-ChYx0N2j.mjs → date-field-_rCuf15v.mjs} +2 -2
- package/dist/{date-field-ChYx0N2j.mjs.map → date-field-_rCuf15v.mjs.map} +1 -1
- package/dist/date-field.cjs.js +1 -1
- package/dist/date-field.es.js +1 -1
- package/dist/{date-picker-BWMKTOq6.js → date-picker-BYlszX1W.js} +2 -2
- package/dist/{date-picker-BWMKTOq6.js.map → date-picker-BYlszX1W.js.map} +1 -1
- package/dist/{date-picker-CTyqgBRB.mjs → date-picker-sqcNAplg.mjs} +6 -6
- package/dist/{date-picker-CTyqgBRB.mjs.map → date-picker-sqcNAplg.mjs.map} +1 -1
- package/dist/date-picker.cjs.js +1 -1
- package/dist/date-picker.es.js +1 -1
- package/dist/date-range-field-B33XeBW8.js +2 -0
- package/dist/date-range-field-B33XeBW8.js.map +1 -0
- package/dist/{date-range-field-DDr-qEGX.mjs → date-range-field-BmjQeiOv.mjs} +23 -23
- package/dist/date-range-field-BmjQeiOv.mjs.map +1 -0
- package/dist/date-range-field.cjs.js +1 -1
- package/dist/date-range-field.es.js +1 -1
- package/dist/{dismissable-chip-group-2updhyuR.js → dismissable-chip-group-5ALErhD2.js} +2 -2
- package/dist/dismissable-chip-group-5ALErhD2.js.map +1 -0
- package/dist/{dismissable-chip-group-Cfs2s2BH.mjs → dismissable-chip-group-DMNU7g5e.mjs} +3 -3
- package/dist/dismissable-chip-group-DMNU7g5e.mjs.map +1 -0
- package/dist/dismissable-chip-group.cjs.js +1 -1
- package/dist/dismissable-chip-group.es.js +1 -1
- package/dist/{drawer-Cnk2OKgi.mjs → drawer-Chx3H8EU.mjs} +241 -233
- package/dist/drawer-Chx3H8EU.mjs.map +1 -0
- package/dist/drawer-oFJcxW58.js +2 -0
- package/dist/drawer-oFJcxW58.js.map +1 -0
- package/dist/drawer.cjs.js +1 -1
- package/dist/drawer.es.js +1 -1
- package/dist/dropdown-Bn7WvsL2.js +2 -0
- package/dist/dropdown-Bn7WvsL2.js.map +1 -0
- package/dist/dropdown-CrufJnb4.mjs +945 -0
- package/dist/dropdown-CrufJnb4.mjs.map +1 -0
- package/dist/dropdown.cjs.js +1 -1
- package/dist/dropdown.es.js +1 -1
- package/dist/file-upload-Ctw6LCTU.mjs +589 -0
- package/dist/file-upload-Ctw6LCTU.mjs.map +1 -0
- package/dist/file-upload-MvNuX4ks.js +2 -0
- package/dist/file-upload-MvNuX4ks.js.map +1 -0
- package/dist/file-upload.cjs.js +2 -0
- package/dist/file-upload.cjs.js.map +1 -0
- package/dist/file-upload.es.js +5 -0
- package/dist/file-upload.es.js.map +1 -0
- package/dist/{floating-ui.react-dom-EredA301.mjs → floating-ui.react-dom-1kwKo24Z.mjs} +15 -15
- package/dist/{floating-ui.react-dom-EredA301.mjs.map → floating-ui.react-dom-1kwKo24Z.mjs.map} +1 -1
- package/dist/footer-Bbemct3Z.js +2 -0
- package/dist/footer-Bbemct3Z.js.map +1 -0
- package/dist/{footer-D5YkHmCo.mjs → footer-DkVmTd-f.mjs} +24 -24
- package/dist/footer-DkVmTd-f.mjs.map +1 -0
- package/dist/footer.cjs.js +1 -1
- package/dist/footer.es.js +1 -1
- package/dist/{heading-xwBuT_-9.mjs → heading-BG7JTFO1.mjs} +25 -24
- package/dist/heading-BG7JTFO1.mjs.map +1 -0
- package/dist/{heading-drD5ugCC.js → heading-BPeRwNYu.js} +2 -2
- package/dist/heading-BPeRwNYu.js.map +1 -0
- package/dist/heading.cjs.js +1 -1
- package/dist/heading.es.js +6 -5
- package/dist/{hero-banner-BXRArPWP.mjs → hero-banner-ChDoFRhq.mjs} +4 -4
- package/dist/hero-banner-ChDoFRhq.mjs.map +1 -0
- package/dist/{hero-banner-CW7DIEZe.js → hero-banner-Mag1OwL4.js} +2 -2
- package/dist/hero-banner-Mag1OwL4.js.map +1 -0
- package/dist/hero-banner.cjs.js +1 -1
- package/dist/hero-banner.es.js +1 -1
- package/dist/index-BPY_9ddu.js +2 -0
- package/dist/index-BPY_9ddu.js.map +1 -0
- package/dist/index-Fewa56cA.mjs +440 -0
- package/dist/index-Fewa56cA.mjs.map +1 -0
- package/dist/libraries/library/src/calendar.d.ts +1 -1
- package/dist/libraries/library/src/card.d.ts +1 -1
- package/dist/libraries/library/src/container.d.ts +1 -1
- package/dist/libraries/library/src/content-block.d.ts +1 -1
- package/dist/libraries/library/src/dismissable-chip-group.d.ts +1 -1
- package/dist/libraries/library/src/drawer.d.ts +1 -1
- package/dist/libraries/library/src/file-upload.d.ts +6 -0
- package/dist/libraries/library/src/file-upload.d.ts.map +1 -0
- package/dist/libraries/library/src/library.d.ts +1 -1
- package/dist/libraries/library/src/library.d.ts.map +1 -1
- package/dist/libraries/library/src/notification-banner.d.ts +1 -1
- package/dist/libraries/library/src/notification.d.ts +1 -1
- package/dist/libraries/theme/src/ThemeProvider.d.ts +1 -1
- package/dist/library.cjs.js +1 -1
- package/dist/library.es.js +595 -596
- package/dist/{modal-CnC4Zyjk.js → modal-CXOYUsJm.js} +2 -2
- package/dist/modal-CXOYUsJm.js.map +1 -0
- package/dist/{modal-BuUQrUYJ.mjs → modal-Pwvhrzn-.mjs} +31 -31
- package/dist/modal-Pwvhrzn-.mjs.map +1 -0
- package/dist/modal.cjs.js +1 -1
- package/dist/modal.es.js +1 -1
- package/dist/{notification-CeoAXDXq.js → notification-BkM2vLzI.js} +2 -2
- package/dist/{notification-CeoAXDXq.js.map → notification-BkM2vLzI.js.map} +1 -1
- package/dist/{notification-C3f3N1K1.mjs → notification-Cbn0UN1p.mjs} +3 -3
- package/dist/{notification-C3f3N1K1.mjs.map → notification-Cbn0UN1p.mjs.map} +1 -1
- package/dist/notification-banner-B9RhXAZ8.js +2 -0
- package/dist/notification-banner-B9RhXAZ8.js.map +1 -0
- package/dist/{notification-banner-BvAy8dlg.mjs → notification-banner-C4NVekCZ.mjs} +5 -5
- package/dist/notification-banner-C4NVekCZ.mjs.map +1 -0
- package/dist/notification-banner.cjs.js +1 -1
- package/dist/notification-banner.es.js +1 -1
- package/dist/notification.cjs.js +1 -1
- package/dist/notification.es.js +1 -1
- package/dist/{password-field-C_E4563x.mjs → password-field-Cy_E-D_G.mjs} +29 -29
- package/dist/{password-field-C_E4563x.mjs.map → password-field-Cy_E-D_G.mjs.map} +1 -1
- package/dist/{password-field-BjKdBoIK.js → password-field-lKyWHjQS.js} +2 -2
- package/dist/{password-field-BjKdBoIK.js.map → password-field-lKyWHjQS.js.map} +1 -1
- package/dist/password-field.cjs.js +1 -1
- package/dist/password-field.es.js +1 -1
- package/dist/popover-B6ntmuEK.mjs +614 -0
- package/dist/popover-B6ntmuEK.mjs.map +1 -0
- package/dist/popover-DJHMEFXP.js +2 -0
- package/dist/popover-DJHMEFXP.js.map +1 -0
- package/dist/popover.cjs.js +1 -1
- package/dist/popover.es.js +1 -1
- package/dist/{product-card-CxfHfJVV.mjs → product-card-BMseoNrG.mjs} +3 -3
- package/dist/{product-card-CxfHfJVV.mjs.map → product-card-BMseoNrG.mjs.map} +1 -1
- package/dist/{product-card-XxBwuxM-.js → product-card-D0jX5-up.js} +2 -2
- package/dist/{product-card-XxBwuxM-.js.map → product-card-D0jX5-up.js.map} +1 -1
- package/dist/product-card.cjs.js +1 -1
- package/dist/product-card.es.js +1 -1
- package/dist/{promotion-card-C1UoxzcV.js → promotion-card-B3mz__m7.js} +2 -2
- package/dist/promotion-card-B3mz__m7.js.map +1 -0
- package/dist/{promotion-card-CooYPpFo.mjs → promotion-card-Co6qAkTZ.mjs} +5 -5
- package/dist/promotion-card-Co6qAkTZ.mjs.map +1 -0
- package/dist/promotion-card.cjs.js +1 -1
- package/dist/promotion-card.es.js +1 -1
- package/dist/purpur.css +1 -1
- package/dist/quantity-selector-Cy0aJGGX.js +2 -0
- package/dist/quantity-selector-Cy0aJGGX.js.map +1 -0
- package/dist/quantity-selector-k6ZaVrk1.mjs +162 -0
- package/dist/quantity-selector-k6ZaVrk1.mjs.map +1 -0
- package/dist/quantity-selector.cjs.js +1 -1
- package/dist/quantity-selector.es.js +2 -3
- package/dist/{radio-button-group-D_F6kWD6.mjs → radio-button-group-DjiTo3b1.mjs} +2 -2
- package/dist/{radio-button-group-D_F6kWD6.mjs.map → radio-button-group-DjiTo3b1.mjs.map} +1 -1
- package/dist/{radio-button-group-CdUrC7h9.js → radio-button-group-uCRGh1H5.js} +2 -2
- package/dist/{radio-button-group-CdUrC7h9.js.map → radio-button-group-uCRGh1H5.js.map} +1 -1
- package/dist/radio-button-group.cjs.js +1 -1
- package/dist/radio-button-group.es.js +1 -1
- package/dist/{radio-card-group-B9_jOJnM.mjs → radio-card-group-DoM7qYO1.mjs} +2 -2
- package/dist/{radio-card-group-B9_jOJnM.mjs.map → radio-card-group-DoM7qYO1.mjs.map} +1 -1
- package/dist/{radio-card-group-DcdGkfOp.js → radio-card-group-_9wJC-s3.js} +2 -2
- package/dist/{radio-card-group-DcdGkfOp.js.map → radio-card-group-_9wJC-s3.js.map} +1 -1
- package/dist/radio-card-group.cjs.js +1 -1
- package/dist/radio-card-group.es.js +1 -1
- package/dist/rich-text.cjs.js +1 -1
- package/dist/rich-text.es.js +1 -1
- package/dist/{search-field-BTqVE1-l.mjs → search-field-BTJtRyw5.mjs} +3 -3
- package/dist/{search-field-BTqVE1-l.mjs.map → search-field-BTJtRyw5.mjs.map} +1 -1
- package/dist/{search-field-DkJrwzJB.js → search-field-nzVXak1a.js} +2 -2
- package/dist/{search-field-DkJrwzJB.js.map → search-field-nzVXak1a.js.map} +1 -1
- package/dist/search-field.cjs.js +1 -1
- package/dist/search-field.es.js +1 -1
- package/dist/stepper-D59T-Y2_.mjs +469 -0
- package/dist/stepper-D59T-Y2_.mjs.map +1 -0
- package/dist/stepper-Dao4XaDV.js +2 -0
- package/dist/stepper-Dao4XaDV.js.map +1 -0
- package/dist/stepper.cjs.js +1 -1
- package/dist/stepper.es.js +1 -1
- package/dist/table-DRSgesQ4.mjs +4545 -0
- package/dist/table-DRSgesQ4.mjs.map +1 -0
- package/dist/table-zBs9JALh.js +5 -0
- package/dist/table-zBs9JALh.js.map +1 -0
- package/dist/table.cjs.js +1 -1
- package/dist/table.es.js +1 -1
- package/dist/tabs-D2__wbCs.js +2 -0
- package/dist/tabs-D2__wbCs.js.map +1 -0
- package/dist/tabs-DOG5g2wf.mjs +440 -0
- package/dist/tabs-DOG5g2wf.mjs.map +1 -0
- package/dist/tabs.cjs.js +1 -1
- package/dist/tabs.es.js +1 -1
- package/dist/{text-field-CS0PT5T6.js → text-field-BSgqJjpv.js} +2 -2
- package/dist/text-field-BSgqJjpv.js.map +1 -0
- package/dist/{text-field-C9LX7LBf.mjs → text-field-MQHeITxy.mjs} +3 -3
- package/dist/text-field-MQHeITxy.mjs.map +1 -0
- package/dist/text-field.cjs.js +1 -1
- package/dist/text-field.es.js +1 -1
- package/dist/tooltip-DeP1UsPW.js +2 -0
- package/dist/{tooltip-COFCRUKv.js.map → tooltip-DeP1UsPW.js.map} +1 -1
- package/dist/{tooltip-FH9R2MAA.mjs → tooltip-bqdd2lJL.mjs} +347 -309
- package/dist/{tooltip-FH9R2MAA.mjs.map → tooltip-bqdd2lJL.mjs.map} +1 -1
- package/dist/tooltip.cjs.js +1 -1
- package/dist/tooltip.es.js +1 -1
- package/package.json +25 -25
- package/src/aliases.ts +4 -4
- package/src/entries.js +1 -1
- package/src/{autocomplete.ts → file-upload.ts} +1 -1
- package/src/library.ts +1 -1
- package/src/purpur.css +4 -0
- package/dist/accordion-B6OoQ4uZ.mjs +0 -128
- package/dist/accordion-B6OoQ4uZ.mjs.map +0 -1
- package/dist/accordion-BfpN5h4C.js +0 -2
- package/dist/accordion-BfpN5h4C.js.map +0 -1
- package/dist/autocomplete-C6AqdYaZ.mjs +0 -228
- package/dist/autocomplete-C6AqdYaZ.mjs.map +0 -1
- package/dist/autocomplete-yrPbF5gq.js +0 -2
- package/dist/autocomplete-yrPbF5gq.js.map +0 -1
- package/dist/autocomplete.cjs.js +0 -2
- package/dist/autocomplete.cjs.js.map +0 -1
- package/dist/autocomplete.es.js +0 -6
- package/dist/autocomplete.es.js.map +0 -1
- package/dist/button-DZgtrGqN.js +0 -2
- package/dist/button-DZgtrGqN.js.map +0 -1
- package/dist/button-EVRfctR8.mjs +0 -109
- package/dist/button-EVRfctR8.mjs.map +0 -1
- package/dist/card-pdsBEJif.js.map +0 -1
- package/dist/card-t2ZkZ82G.mjs.map +0 -1
- package/dist/components/autocomplete/src/autocomplete.d.ts +0 -18
- package/dist/components/autocomplete/src/autocomplete.d.ts.map +0 -1
- package/dist/components/autocomplete/src/useAutocomplete.d.ts +0 -59
- package/dist/components/autocomplete/src/useAutocomplete.d.ts.map +0 -1
- package/dist/components/autocomplete/src/utils.d.ts +0 -7
- package/dist/components/autocomplete/src/utils.d.ts.map +0 -1
- package/dist/components/stepper/src/stepper-button.d.ts.map +0 -1
- package/dist/content-block-CDMrz41K.mjs.map +0 -1
- package/dist/content-block-DyYAnL2e.js.map +0 -1
- package/dist/date-range-field-CvzOl-eC.js +0 -2
- package/dist/date-range-field-CvzOl-eC.js.map +0 -1
- package/dist/date-range-field-DDr-qEGX.mjs.map +0 -1
- package/dist/dismissable-chip-group-2updhyuR.js.map +0 -1
- package/dist/dismissable-chip-group-Cfs2s2BH.mjs.map +0 -1
- package/dist/drawer-BnqxUIPM.js +0 -2
- package/dist/drawer-BnqxUIPM.js.map +0 -1
- package/dist/drawer-Cnk2OKgi.mjs.map +0 -1
- package/dist/dropdown-C8VsfTQw.mjs +0 -936
- package/dist/dropdown-C8VsfTQw.mjs.map +0 -1
- package/dist/dropdown-p4R2yCnJ.js +0 -2
- package/dist/dropdown-p4R2yCnJ.js.map +0 -1
- package/dist/footer-B8rzVSrZ.js +0 -2
- package/dist/footer-B8rzVSrZ.js.map +0 -1
- package/dist/footer-D5YkHmCo.mjs.map +0 -1
- package/dist/heading-drD5ugCC.js.map +0 -1
- package/dist/heading-xwBuT_-9.mjs.map +0 -1
- package/dist/hero-banner-BXRArPWP.mjs.map +0 -1
- package/dist/hero-banner-CW7DIEZe.js.map +0 -1
- package/dist/libraries/library/src/autocomplete.d.ts +0 -6
- package/dist/libraries/library/src/autocomplete.d.ts.map +0 -1
- package/dist/modal-BuUQrUYJ.mjs.map +0 -1
- package/dist/modal-CnC4Zyjk.js.map +0 -1
- package/dist/notification-banner-BvAy8dlg.mjs.map +0 -1
- package/dist/notification-banner-DUe4fT1r.js +0 -2
- package/dist/notification-banner-DUe4fT1r.js.map +0 -1
- package/dist/popover-4phnhJLj.js +0 -2
- package/dist/popover-4phnhJLj.js.map +0 -1
- package/dist/popover-DhObSx97.mjs +0 -1043
- package/dist/popover-DhObSx97.mjs.map +0 -1
- package/dist/promotion-card-C1UoxzcV.js.map +0 -1
- package/dist/promotion-card-CooYPpFo.mjs.map +0 -1
- package/dist/quantity-selector-Ds7d4MnV.js +0 -2
- package/dist/quantity-selector-Ds7d4MnV.js.map +0 -1
- package/dist/quantity-selector-DwkKKmFy.mjs +0 -172
- package/dist/quantity-selector-DwkKKmFy.mjs.map +0 -1
- package/dist/stepper-5rQ3cK18.js +0 -2
- package/dist/stepper-5rQ3cK18.js.map +0 -1
- package/dist/stepper-B3p9r3gv.mjs +0 -449
- package/dist/stepper-B3p9r3gv.mjs.map +0 -1
- package/dist/table-BIyaTsOh.js +0 -9
- package/dist/table-BIyaTsOh.js.map +0 -1
- package/dist/table-BtymEUG4.mjs +0 -7428
- package/dist/table-BtymEUG4.mjs.map +0 -1
- package/dist/tabs-Bye5lgZ1.mjs +0 -424
- package/dist/tabs-Bye5lgZ1.mjs.map +0 -1
- package/dist/tabs-D-nfZHIA.js +0 -2
- package/dist/tabs-D-nfZHIA.js.map +0 -1
- package/dist/text-field-C9LX7LBf.mjs.map +0 -1
- package/dist/text-field-CS0PT5T6.js.map +0 -1
- package/dist/tooltip-COFCRUKv.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),c=require("./index-2cFVyGXq.js"),s=require("react"),V=require("./button-
|
|
2
|
-
//# sourceMappingURL=modal-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),c=require("./index-2cFVyGXq.js"),s=require("react"),V=require("./button-C5CYysw5.js"),K=require("./heading-BPeRwNYu.js"),k=require("./close.es-VL3lKi1O.js"),G=require("./paragraph-B8HFdNne.js");require("./ThemeProvider-BJGm3zai.js");const J=require("./useThemePortalContainer-CUcqV327.js"),Q=require("./visually-hidden-C2CKovZx.js"),X=require("./bind-DeUYJ6m9.js"),Y="_fadeIn_1nrj3_1",Z="_fadeOut_1nrj3_1",ee="_slideUp_1nrj3_1",te="_slideDown_1nrj3_1",re={"purpur-modal-content":"_purpur-modal-content_1nrj3_1",fadeIn:Y,fadeOut:Z,slideUp:ee,slideDown:te,"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=X.c.bind(re),t="purpur-modal-content",ne=s.forwardRef(({["data-testid"]:n,actions:o,children:a,className:u,description:_,disableCloseOnClickOutside:y,hideDescription:b,image:p,stickyButtons:v=!0,title:D,notification:x=void 0,zIndex:$,container:C,onCloseAutoFocus:O,...g},P)=>{const{closeButtonAriaLabel:h,showCloseButton:E,...H}=g,[I,M]=s.useState(!1),[S,T]=s.useState(0),m=s.useRef(null),j=s.useRef(null),B=J.useThemePortalContainer(),W=C===void 0?B:C??void 0,z=r(t,{[`${t}--with-image`]:!!p},{[`${t}--overflow`]:I},{[`${t}--sticky-footer`]:v},u),d=l=>n?`${n} ${l}`:void 0,A=l=>{y&&l.preventDefault()},i=s.useCallback(()=>{if(!m.current||!j.current)return;const l=window.getComputedStyle(m.current,null),f=parseFloat(l.getPropertyValue("height")),U=j.current.offsetHeight;M(f<U),T((m.current.offsetWidth??0)-(m.current.clientWidth??0))},[]),F=()=>{const l=j.current;if(l){const f=l.querySelector("h2");f&&setTimeout(()=>{f.focus()})}},L=l=>{y&&!E&&l.preventDefault()};return s.useEffect(()=>(window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}),[i]),s.useEffect(()=>{i()},[x,a,i]),e.jsxs(c.Portal,{container:W,children:[e.jsx(c.Overlay,{className:r(`${t}__overlay`),style:{zIndex:$}}),e.jsxs(c.Content,{...H,className:z,"data-testid":n,ref:P,...!_&&{"aria-describedby":void 0},onPointerDownOutside:A,onOpenAutoFocus:()=>{i(),F()},onEscapeKeyDown:L,onCloseAutoFocus:O,style:{zIndex:`calc(${$} + 1)`},children:[e.jsxs("div",{ref:m,className:r(`${t}__wrapper`),children:[N(g)&&h&&p&&e.jsx(q,{"aria-label":h,hasImage:!0,scrollbarWidth:S,"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(q,{"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(K.Heading,{tag:"h2",variant:"display-10",tabIndex:-1,className:r(`${t}__heading`),children:D})})]}),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:[_&&b&&e.jsx(Q.VisuallyHidden,{asChild:!0,children:e.jsx(c.Description,{"data-testid":d("description"),children:_})}),_&&!b&&e.jsx(c.Description,{asChild:!0,className:r(`${t}__description`),"data-testid":d("description"),children:e.jsx(G.Paragraph,{variant:"paragraph-100",children:_})}),e.jsx("div",{children:a}),!v&&e.jsx(R,{actions:o,notification:x})]})})]})]}),v&&e.jsx(R,{actions:o,notification:x})]})]})}),q=({["aria-label"]:n,hasImage:o,scrollbarWidth:a,["data-testid"]:u})=>e.jsx(c.Close,{asChild:!0,children:e.jsx(V.Button,{variant:o?"primary":"text",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(k.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},oe=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=oe;w.Content=ne;w.displayName="Modal";exports.Modal=w;
|
|
2
|
+
//# sourceMappingURL=modal-CXOYUsJm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-CXOYUsJm.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 { useThemePortalContainer } from \"@purpur/theme\";\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 * Optional DOM element to portal the modal content into. When omitted,\n * the modal renders inside the nearest `ThemeProvider` so it inherits\n * the active color scheme. Pass `document.body` (or any other element) to\n * override. Pass `null` to fall back to Radix' default (`document.body`).\n * */\n container?: HTMLElement | null;\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 container,\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 const themePortalContainer = useThemePortalContainer();\n const portalContainer = container === undefined ? themePortalContainer : container ?? undefined;\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 container={portalContainer}>\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\" : \"text\"}\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","container","onCloseAutoFocus","ref","closeButtonAriaLabel","showCloseButton","rest","contentOverflow","setContentOverflow","useState","scrollbarWidth","setScrollbarWidth","wrapperRef","useRef","wrapperInnerRef","themePortalContainer","useThemePortalContainer","portalContainer","classes","getTestId","id","handlePointerDownOutside","event","handleContentOverflow","useCallback","computedStyle","wrapperHeight","innerHeight","handleInitialFocus","frame","heading","handleEscapeKeyDown","useEffect","jsxs","RadixPortal","jsx","RadixOverlay","RadixContent","CloseButton","RadixTitle","Heading","VisuallyHidden","RadixDescription","Paragraph","ModalActions","ariaLabel","hasImage","RadixClose","Button","IconClose","notificationRef","ModalTrigger","RadixTrigger","Modal","open","onOpenChange","RadixRoot"],"mappings":"ogEAgGMA,EACJC,GAC+BA,EAA2B,kBAAoB,GAE1EC,EAAKC,EAAAA,EAAE,KAAKC,EAAM,EAClBC,EAAgB,uBAETC,GAAeC,EAAAA,WAC1B,CACE,CACE,CAAC,eAAgBC,EACjB,QAAAC,EACA,S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pBiD,EAAAA,QAAA,CAAa,QAAO,GAAC,IAAAjD,EAAW,GAAGrB,EACjC,SAAAS,EACH,CAGN,ECGa8D,EAAQ,CAAC,CACpB,CAAC,eAAgBhE,EACjB,SAAAE,EACA,KAAA+D,EACA,aAAAC,CACF,UACGC,EAAAA,KAAA,CAAU,KAAAF,EAAY,aAAAC,EAA4B,cAAalE,EAC7D,SAAAE,CAAA,CACH,EAGF8D,EAAM,QAAUF,GAChBE,EAAM,QAAUlE,GAEhBkE,EAAM,YAAc"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { P as J, O as Q, C as X, T as Y, D as O, a as Z, b as tt, R as et } from "./index-3NV-ckDX.mjs";
|
|
3
|
-
import { forwardRef as I, useState as P, useRef as
|
|
4
|
-
import { b as nt } from "./button-
|
|
5
|
-
import { H as ot } from "./heading-
|
|
3
|
+
import { forwardRef as I, useState as P, useRef as g, useCallback as rt, useEffect as y } from "react";
|
|
4
|
+
import { b as nt } from "./button-mHw_J7JU.mjs";
|
|
5
|
+
import { H as ot } from "./heading-BG7JTFO1.mjs";
|
|
6
6
|
import { r as at } from "./close.es-BPmk2wkU.mjs";
|
|
7
7
|
import { P as st } from "./paragraph-CwAdFoIm.mjs";
|
|
8
8
|
import "./ThemeProvider-BJ25_asg.mjs";
|
|
9
9
|
import { u as lt } from "./useThemePortalContainer-D13Xx24N.mjs";
|
|
10
10
|
import { V as _t } from "./visually-hidden-BYFkJEp1.mjs";
|
|
11
11
|
import { c as dt } from "./bind-CU-R61T-.mjs";
|
|
12
|
-
const
|
|
12
|
+
const ct = "_fadeIn_1nrj3_1", it = "_fadeOut_1nrj3_1", ut = "_slideUp_1nrj3_1", pt = "_slideDown_1nrj3_1", mt = {
|
|
13
13
|
"purpur-modal-content": "_purpur-modal-content_1nrj3_1",
|
|
14
|
-
fadeIn:
|
|
15
|
-
fadeOut:
|
|
14
|
+
fadeIn: ct,
|
|
15
|
+
fadeOut: it,
|
|
16
16
|
slideUp: ut,
|
|
17
17
|
slideDown: pt,
|
|
18
18
|
"purpur-modal-content__overlay": "_purpur-modal-content__overlay_1nrj3_49",
|
|
@@ -33,13 +33,13 @@ const it = "_fadeIn_1nrj3_1", ct = "_fadeOut_1nrj3_1", ut = "_slideUp_1nrj3_1",
|
|
|
33
33
|
"purpur-modal-content__actions": "_purpur-modal-content__actions_1nrj3_154",
|
|
34
34
|
"purpur-modal-content__actions-separator": "_purpur-modal-content__actions-separator_1nrj3_206",
|
|
35
35
|
"purpur-modal-content--sticky-footer": "_purpur-modal-content--sticky-footer_1nrj3_216"
|
|
36
|
-
},
|
|
36
|
+
}, x = (n) => n.showCloseButton === !0, r = dt.bind(mt), e = "purpur-modal-content", ht = I(
|
|
37
37
|
({
|
|
38
38
|
["data-testid"]: n,
|
|
39
39
|
actions: o,
|
|
40
40
|
children: a,
|
|
41
|
-
className:
|
|
42
|
-
description:
|
|
41
|
+
className: c,
|
|
42
|
+
description: i,
|
|
43
43
|
disableCloseOnClickOutside: $,
|
|
44
44
|
hideDescription: C,
|
|
45
45
|
image: u,
|
|
@@ -49,14 +49,14 @@ const it = "_fadeIn_1nrj3_1", ct = "_fadeOut_1nrj3_1", ut = "_slideUp_1nrj3_1",
|
|
|
49
49
|
zIndex: N,
|
|
50
50
|
container: D,
|
|
51
51
|
onCloseAutoFocus: T,
|
|
52
|
-
...
|
|
52
|
+
...b
|
|
53
53
|
}, E) => {
|
|
54
|
-
const { closeButtonAriaLabel: m, showCloseButton: S, ...B } =
|
|
54
|
+
const { closeButtonAriaLabel: m, showCloseButton: S, ...B } = b, [V, W] = P(!1), [z, A] = P(0), p = g(null), h = g(null), F = lt(), L = D === void 0 ? F : D ?? void 0, U = r(
|
|
55
55
|
e,
|
|
56
56
|
{ [`${e}--with-image`]: !!u },
|
|
57
57
|
{ [`${e}--overflow`]: V },
|
|
58
58
|
{ [`${e}--sticky-footer`]: w },
|
|
59
|
-
|
|
59
|
+
c
|
|
60
60
|
), _ = (s) => n ? `${n} ${s}` : void 0, K = (s) => {
|
|
61
61
|
$ && s.preventDefault();
|
|
62
62
|
}, d = rt(() => {
|
|
@@ -77,9 +77,9 @@ const it = "_fadeIn_1nrj3_1", ct = "_fadeOut_1nrj3_1", ut = "_slideUp_1nrj3_1",
|
|
|
77
77
|
}, q = (s) => {
|
|
78
78
|
$ && !S && s.preventDefault();
|
|
79
79
|
};
|
|
80
|
-
return
|
|
80
|
+
return y(() => (window.addEventListener("resize", d), () => {
|
|
81
81
|
window.removeEventListener("resize", d);
|
|
82
|
-
}), [d]),
|
|
82
|
+
}), [d]), y(() => {
|
|
83
83
|
d();
|
|
84
84
|
}, [v, a, d]), /* @__PURE__ */ l(J, { container: L, children: [
|
|
85
85
|
/* @__PURE__ */ t(Q, { className: r(`${e}__overlay`), style: { zIndex: N } }),
|
|
@@ -90,7 +90,7 @@ const it = "_fadeIn_1nrj3_1", ct = "_fadeOut_1nrj3_1", ut = "_slideUp_1nrj3_1",
|
|
|
90
90
|
className: U,
|
|
91
91
|
"data-testid": n,
|
|
92
92
|
ref: E,
|
|
93
|
-
...!
|
|
93
|
+
...!i && { "aria-describedby": void 0 },
|
|
94
94
|
onPointerDownOutside: K,
|
|
95
95
|
onOpenAutoFocus: () => {
|
|
96
96
|
d(), k();
|
|
@@ -100,8 +100,8 @@ const it = "_fadeIn_1nrj3_1", ct = "_fadeOut_1nrj3_1", ut = "_slideUp_1nrj3_1",
|
|
|
100
100
|
style: { zIndex: `calc(${N} + 1)` },
|
|
101
101
|
children: [
|
|
102
102
|
/* @__PURE__ */ l("div", { ref: p, className: r(`${e}__wrapper`), children: [
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
x(b) && m && u && /* @__PURE__ */ t(
|
|
104
|
+
R,
|
|
105
105
|
{
|
|
106
106
|
"aria-label": m,
|
|
107
107
|
hasImage: !0,
|
|
@@ -111,8 +111,8 @@ const it = "_fadeIn_1nrj3_1", ct = "_fadeOut_1nrj3_1", ut = "_slideUp_1nrj3_1",
|
|
|
111
111
|
),
|
|
112
112
|
/* @__PURE__ */ l("div", { ref: h, className: r(`${e}__wrapper-inner`), children: [
|
|
113
113
|
/* @__PURE__ */ l("div", { className: r(`${e}__header`), children: [
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
x(b) && m && !u && /* @__PURE__ */ t(
|
|
115
|
+
R,
|
|
116
116
|
{
|
|
117
117
|
"aria-label": m,
|
|
118
118
|
"data-testid": _("close-button")
|
|
@@ -146,14 +146,14 @@ const it = "_fadeIn_1nrj3_1", ct = "_fadeOut_1nrj3_1", ut = "_slideUp_1nrj3_1",
|
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
148
|
/* @__PURE__ */ t("div", { className: r(`${e}__body`), children: /* @__PURE__ */ l("div", { className: r(`${e}__body-inner`), children: [
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
i && C && /* @__PURE__ */ t(_t, { asChild: !0, children: /* @__PURE__ */ t(O, { "data-testid": _("description"), children: i }) }),
|
|
150
|
+
i && !C && /* @__PURE__ */ t(
|
|
151
151
|
O,
|
|
152
152
|
{
|
|
153
153
|
asChild: !0,
|
|
154
154
|
className: r(`${e}__description`),
|
|
155
155
|
"data-testid": _("description"),
|
|
156
|
-
children: /* @__PURE__ */ t(st, { variant: "paragraph-100", children:
|
|
156
|
+
children: /* @__PURE__ */ t(st, { variant: "paragraph-100", children: i })
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
159
|
/* @__PURE__ */ t("div", { children: a }),
|
|
@@ -167,30 +167,30 @@ const it = "_fadeIn_1nrj3_1", ct = "_fadeOut_1nrj3_1", ut = "_slideUp_1nrj3_1",
|
|
|
167
167
|
)
|
|
168
168
|
] });
|
|
169
169
|
}
|
|
170
|
-
),
|
|
170
|
+
), R = ({
|
|
171
171
|
["aria-label"]: n,
|
|
172
172
|
hasImage: o,
|
|
173
173
|
scrollbarWidth: a,
|
|
174
|
-
["data-testid"]:
|
|
174
|
+
["data-testid"]: c
|
|
175
175
|
}) => /* @__PURE__ */ t(Z, { asChild: !0, children: /* @__PURE__ */ t(
|
|
176
176
|
nt,
|
|
177
177
|
{
|
|
178
|
-
variant: o ? "primary" : "
|
|
178
|
+
variant: o ? "primary" : "text",
|
|
179
179
|
negative: o,
|
|
180
180
|
size: "sm",
|
|
181
181
|
iconOnly: !0,
|
|
182
182
|
"aria-label": n,
|
|
183
183
|
className: r(`${e}__close-button`),
|
|
184
184
|
style: { right: `calc(var(--purpur-spacing-100) + ${a || 0}px)` },
|
|
185
|
-
"data-testid":
|
|
185
|
+
"data-testid": c,
|
|
186
186
|
children: /* @__PURE__ */ t(at, {})
|
|
187
187
|
}
|
|
188
188
|
) }), H = ({
|
|
189
189
|
actions: n,
|
|
190
190
|
notification: o
|
|
191
191
|
}) => {
|
|
192
|
-
const a =
|
|
193
|
-
return
|
|
192
|
+
const a = g(null);
|
|
193
|
+
return y(() => {
|
|
194
194
|
o && a?.current?.scrollIntoView?.(!1);
|
|
195
195
|
}, [o]), n ? /* @__PURE__ */ l("div", { className: r(`${e}__actions`), children: [
|
|
196
196
|
/* @__PURE__ */ t("div", { className: r(`${e}__actions-buttons`), "data-testid": "modal actions", children: n }),
|
|
@@ -203,12 +203,12 @@ const it = "_fadeIn_1nrj3_1", ct = "_fadeOut_1nrj3_1", ut = "_slideUp_1nrj3_1",
|
|
|
203
203
|
["data-testid"]: n,
|
|
204
204
|
children: o,
|
|
205
205
|
open: a,
|
|
206
|
-
onOpenChange:
|
|
207
|
-
}) => /* @__PURE__ */ t(et, { open: a, onOpenChange:
|
|
206
|
+
onOpenChange: c
|
|
207
|
+
}) => /* @__PURE__ */ t(et, { open: a, onOpenChange: c, "data-testid": n, children: o });
|
|
208
208
|
j.Trigger = ft;
|
|
209
209
|
j.Content = ht;
|
|
210
210
|
j.displayName = "Modal";
|
|
211
211
|
export {
|
|
212
212
|
j as M
|
|
213
213
|
};
|
|
214
|
-
//# sourceMappingURL=modal-
|
|
214
|
+
//# sourceMappingURL=modal-Pwvhrzn-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-Pwvhrzn-.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 { useThemePortalContainer } from \"@purpur/theme\";\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 * Optional DOM element to portal the modal content into. When omitted,\n * the modal renders inside the nearest `ThemeProvider` so it inherits\n * the active color scheme. Pass `document.body` (or any other element) to\n * override. Pass `null` to fall back to Radix' default (`document.body`).\n * */\n container?: HTMLElement | null;\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 container,\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 const themePortalContainer = useThemePortalContainer();\n const portalContainer = container === undefined ? themePortalContainer : container ?? undefined;\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 container={portalContainer}>\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\" : \"text\"}\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","container","onCloseAutoFocus","ref","closeButtonAriaLabel","showCloseButton","rest","contentOverflow","setContentOverflow","useState","scrollbarWidth","setScrollbarWidth","wrapperRef","useRef","wrapperInnerRef","themePortalContainer","useThemePortalContainer","portalContainer","classes","getTestId","id","handlePointerDownOutside","event","handleContentOverflow","useCallback","computedStyle","wrapperHeight","innerHeight","handleInitialFocus","frame","heading","handleEscapeKeyDown","useEffect","jsxs","RadixPortal","jsx","RadixOverlay","RadixContent","CloseButton","RadixTitle","Heading","VisuallyHidden","RadixDescription","Paragraph","ModalActions","ariaLabel","hasImage","RadixClose","Button","IconClose","notificationRef","ModalTrigger","RadixTrigger","Modal","open","onOpenChange","RadixRoot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGMA,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,WAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,GAAGpB;AAAA,EAAA,GAELqB,MACG;AACH,UAAM,EAAE,sBAAAC,GAAsB,iBAAAC,GAAiB,GAAGC,MAASxB,GACrD,CAACyB,GAAiBC,CAAkB,IAAIC,EAAS,EAAK,GACtD,CAACC,GAAgBC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,GAC5C,UAAA;AAAA,IAAA,gBAAAiD,EAAC,OAAA,EAAI,WAAWpD,EAAG,GAAGG,CAAa,mBAAmB,GAAG,eAAY,iBAClE,UAAAI,EAAA,CACH;AAAA,IACCS,KACC,gBAAAoC,EAAC,OAAA,EAAI,WAAWpD,EAAG,GAAGG,CAAa,gBAAgB,GAAG,KAAKgE,GACxD,UAAAnD,EAAA,CACH;AAAA,sBAED,QAAA,EAAK,WAAWhB,EAAG,GAAGG,CAAa,qBAAqB,EAAA,CAAG;AAAA,EAAA,EAAA,CAC9D,IACE;AACN,GC1UaiE,KAAe/D;AAAA,EAC1B,CAAC,EAAE,UAAAG,GAAU,GAAGT,EAAA,GAASqB,wBAEpBiD,IAAA,EAAa,SAAO,IAAC,KAAAjD,GAAW,GAAGrB,GACjC,UAAAS,GACH;AAGN,GCGa8D,IAAQ,CAAC;AAAA,EACpB,CAAC,gBAAgBhE;AAAA,EACjB,UAAAE;AAAA,EACA,MAAA+D;AAAA,EACA,cAAAC;AACF,wBACGC,IAAA,EAAU,MAAAF,GAAY,cAAAC,GAA4B,eAAalE,GAC7D,UAAAE,EAAA,CACH;AAGF8D,EAAM,UAAUF;AAChBE,EAAM,UAAUlE;AAEhBkE,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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./modal-CXOYUsJm.js");exports.Modal=e.Modal;
|
|
2
2
|
//# sourceMappingURL=modal.cjs.js.map
|
package/dist/modal.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),y=require("react"),O=require("./button-
|
|
2
|
-
//# sourceMappingURL=notification-
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),y=require("react"),O=require("./button-C5CYysw5.js"),A=require("./heading-BPeRwNYu.js"),d=require("./icon.es-j3eRib6d.js"),I=require("./error-filled.es-BbS_Oggw.js"),R=require("./paragraph-B8HFdNne.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-BkM2vLzI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-CeoAXDXq.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,U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CAAA,CAEJ,CAAA,CAAA,EAIR,CAEJ,CACF,EAEAJ,EAAa,YAAc"}
|
|
1
|
+
{"version":3,"file":"notification-BkM2vLzI.js","sources":["../../../components/icon/dist/assets/alert-filled.es.js","../../../components/icon/dist/assets/check-circle-filled.es.js","../../../components/icon/dist/assets/close.es.js","../../../components/icon/dist/assets/info-filled.es.js","../../../components/icon/dist/assets/sparkles.es.js","../../../components/notification/src/notification.tsx"],"sourcesContent":["const l = {\n name: \"alert-filled\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm1.038-14.81-.247 6.875h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.916c0 .649-.585 1.234-1.25 1.234-.649 0-1.25-.585-1.25-1.234 0-.633.601-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"alert-filled\"],\n category: \"status\"\n};\nexport {\n l as alertFilled\n};\n//# sourceMappingURL=alert-filled.es.js.map\n","const e = {\n name: \"check-circle-filled\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.712-12.491a.875.875 0 1 0-1.424-1.018l-4.4 6.16-2.27-2.27a.875.875 0 0 0-1.237 1.238l3 3a.875.875 0 0 0 1.331-.11l5-7Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"check-circle-filled\"],\n category: \"status\"\n};\nexport {\n e as checkCircleFilled\n};\n//# sourceMappingURL=check-circle-filled.es.js.map\n","const l = {\n name: \"close\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"close\"],\n category: \"utility\"\n};\nexport {\n l as close\n};\n//# sourceMappingURL=close.es.js.map\n","const e = {\n name: \"info-filled\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM10.9 7.786c0 .591.516 1.077 1.108 1.077.576 0 1.092-.486 1.092-1.077 0-.592-.516-1.078-1.092-1.078-.592 0-1.108.486-1.108 1.078Zm.167 9.74h1.866V9.94h-1.866v7.586Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"info-filled\"],\n category: \"status\"\n};\nexport {\n e as infoFilled\n};\n//# sourceMappingURL=info-filled.es.js.map\n","const a = {\n name: \"sparkles\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M17.154 22.054c.463-.002.855-.304.977-.755.411-1.533 1.256-2.463 2.656-2.926a1.02 1.02 0 0 0 .015-1.93c-1.437-.508-2.283-1.434-2.665-2.919a1.017 1.017 0 0 0-.974-.766c-.445.02-.864.305-.986.747-.422 1.518-1.267 2.447-2.66 2.923a1.02 1.02 0 0 0-.687.968c.001.437.279.825.686.962 1.4.479 2.243 1.414 2.657 2.946.121.442.523.75.978.75h.003Zm-1.788-4.66a5.334 5.334 0 0 0 1.779-1.867 5.32 5.32 0 0 0 1.792 1.87 5.256 5.256 0 0 0-1.787 1.88 5.326 5.326 0 0 0-1.784-1.883Zm.956-8.397c-2.97-1.047-4.797-3.046-5.583-6.115a1.232 1.232 0 0 0-1.19-.936 1.247 1.247 0 0 0-1.204.916c-.868 3.125-2.693 5.124-5.579 6.112-.502.171-.84.646-.84 1.182 0 .536.338 1.01.84 1.182 2.897.991 4.72 3.004 5.57 6.154.151.552.632.922 1.196.922h.004a1.228 1.228 0 0 0 1.191-.925c.849-3.162 2.674-5.166 5.578-6.126h.003a1.253 1.253 0 0 0 .015-2.366ZM9.53 15.415c-.996-2.405-2.64-4.167-4.906-5.259C6.878 9.071 8.52 7.324 9.526 4.941c.967 2.359 2.616 4.109 4.926 5.226-2.276 1.073-3.925 2.83-4.922 5.248Z\"/></svg>',\n keywords: [\"sparkles\"],\n category: \"ai\"\n};\nexport {\n a as sparkles\n};\n//# sourceMappingURL=sparkles.es.js.map\n","import React, { forwardRef } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { Icon } from \"@purpur/icon\";\nimport { alertFilled } from \"@purpur/icon/assets/alert-filled\";\nimport { checkCircleFilled } from \"@purpur/icon/assets/check-circle-filled\";\nimport { close } from \"@purpur/icon/assets/close\";\nimport { errorFilled } from \"@purpur/icon/assets/error-filled\";\nimport { infoFilled } from \"@purpur/icon/assets/info-filled\";\nimport { sparkles } from \"@purpur/icon/assets/sparkles\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./notification.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport const NOTIFICATION_STATUS = {\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n INFO: \"info\",\n AI: \"ai\",\n} as const;\n\nexport const notificationStatuses = Object.values(NOTIFICATION_STATUS);\nexport type NotificationStatus = (typeof NOTIFICATION_STATUS)[keyof typeof NOTIFICATION_STATUS];\n\nexport const NOTIFICATION_ARIA_LIVE = {\n POLITE: \"polite\",\n ASSERTIVE: \"assertive\",\n} as const;\n\nexport const notificationAriaLiveValues = Object.values(NOTIFICATION_ARIA_LIVE);\nexport type NotificationAriaLive =\n (typeof NOTIFICATION_ARIA_LIVE)[keyof typeof NOTIFICATION_ARIA_LIVE];\n\nexport const NOTIFICATION_ROLE = {\n ALERT: \"alert\",\n DIALOG: \"dialog\",\n ALERTDIALOG: \"alertdialog\",\n} as const;\n\nexport const notificationRoles = Object.values(NOTIFICATION_ROLE);\nexport type NotificationRole = (typeof NOTIFICATION_ROLE)[keyof typeof NOTIFICATION_ROLE];\n\nconst rootClassName = \"purpur-notification\";\n\nconst getStatusIcon = (status: NotificationStatus) => {\n switch (status) {\n case NOTIFICATION_STATUS.AI:\n return sparkles;\n case NOTIFICATION_STATUS.INFO:\n return infoFilled;\n case NOTIFICATION_STATUS.SUCCESS:\n return checkCircleFilled;\n case NOTIFICATION_STATUS.WARNING:\n return alertFilled;\n case NOTIFICATION_STATUS.ERROR:\n return errorFilled;\n }\n};\n\ntype DefaultProps = BaseProps & {\n [\"aria-live\"]?: NotificationAriaLive;\n headingTag?: HeadingTagType;\n status?: NotificationStatus;\n heading?: string;\n role?: NotificationRole;\n hidden?: boolean;\n /**\n * Use to explicitly not open the notification initially and open it programatically to trigger\n * that the aria-live message is read by the screen reader correctly.\n */\n open?: boolean;\n hideIcon?: boolean;\n};\n\ntype CloseButtonProps = {\n onClose: () => void;\n closeButtonAriaLabel: string;\n};\n\ntype NoCloseButtonProps = {\n onClose?: never;\n closeButtonAriaLabel?: never;\n};\n\nexport type NotificationProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n [\"aria-live\"]: ariaLive,\n children,\n className,\n closeButtonAriaLabel,\n headingTag = \"h4\",\n status = \"info\",\n heading,\n hidden,\n id,\n onClose,\n open = true,\n hideIcon,\n ...props\n },\n ref\n ) => {\n const showHeader = !!heading || !hideIcon;\n\n return (\n <div aria-live={ariaLive}>\n {open && (\n <div\n id={id}\n aria-labelledby={id ? `${id}-heading` : undefined}\n aria-describedby={id ? `${id}-body` : undefined}\n aria-hidden={!!hidden}\n className={cx(className, rootClassName, `${rootClassName}--${status}`, {\n [`${rootClassName}--hidden`]: hidden,\n [`${rootClassName}--has-close-button`]: !!onClose,\n })}\n data-testid={dataTestId}\n ref={ref}\n {...props}\n >\n {showHeader && (\n <div className={cx(`${rootClassName}__top`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {!hideIcon && (\n <Icon\n data-testid={dataTestId ? `${dataTestId}-icon` : undefined}\n className={cx(`${rootClassName}__icon`)}\n svg={getStatusIcon(status)}\n size=\"sm\"\n />\n )}\n {!!heading && (\n <Heading\n data-testid={dataTestId ? `${dataTestId}-heading` : undefined}\n variant=\"subsection-100\"\n tag={headingTag}\n className={cx(`${rootClassName}__heading`)}\n >\n <span id={id ? `${id}-heading` : undefined}> {heading}</span>\n </Heading>\n )}\n </div>\n </div>\n )}\n {onClose && (\n <Button\n data-testid={dataTestId ? `${dataTestId}-close-button` : undefined}\n variant=\"text\"\n size=\"sm\"\n iconOnly\n aria-label={closeButtonAriaLabel}\n onClick={onClose}\n className={cx(`${rootClassName}__close-button`)}\n >\n <Icon svg={close} size=\"md\" />\n </Button>\n )}\n {children && (\n <div\n data-testid={dataTestId ? `${dataTestId}-body` : undefined}\n className={cx(`${rootClassName}__body`, {\n [`${rootClassName}__body--extra-padding`]: !showHeader && !!onClose,\n })}\n id={id ? `${id}-body` : undefined}\n >\n {typeof children === \"string\" ? (\n <Paragraph\n data-testid={dataTestId ? `${dataTestId}-paragraph` : undefined}\n variant=\"paragraph-100\"\n >\n {children}\n </Paragraph>\n ) : (\n children\n )}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nNotification.displayName = \"Notification\";\n"],"names":["l","e","a","cx","c","styles","NOTIFICATION_STATUS","notificationStatuses","NOTIFICATION_ARIA_LIVE","notificationAriaLiveValues","NOTIFICATION_ROLE","notificationRoles","rootClassName","getStatusIcon","status","sparkles","infoFilled","checkCircleFilled","alertFilled","errorFilled","Notification","forwardRef","dataTestId","ariaLive","children","className","closeButtonAriaLabel","headingTag","heading","hidden","id","onClose","open","hideIcon","props","ref","showHeader","jsx","jsxs","Icon","Heading","Button","close","Paragraph"],"mappings":"6RAAMA,EAAI,CACR,KAAM,eACN,IAAK,kZACL,SAAU,CAAC,cAAc,EACzB,SAAU,QACZ,ECLMC,EAAI,CACR,KAAM,sBACN,IAAK,8UACL,SAAU,CAAC,qBAAqB,EAChC,SAAU,QACZ,ECLMD,EAAI,CACR,KAAM,QACN,IAAK,8VACL,SAAU,CAAC,OAAO,EAClB,SAAU,SACZ,ECLMC,EAAI,CACR,KAAM,cACN,IAAK,yXACL,SAAU,CAAC,aAAa,EACxB,SAAU,QACZ,ECLMC,EAAI,CACR,KAAM,WACN,IAAK,ijCACL,SAAU,CAAC,UAAU,EACrB,SAAU,IACZ,mjCCWMC,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAEXC,EAAsB,CACjC,QAAS,UACT,QAAS,UACT,MAAO,QACP,KAAM,OACN,GAAI,IACN,EAEaC,EAAuB,OAAO,OAAOD,CAAmB,EAGxDE,EAAyB,CACpC,OAAQ,SACR,UAAW,WACb,EAEaC,EAA6B,OAAO,OAAOD,CAAsB,EAIjEE,EAAoB,CAC/B,MAAO,QACP,OAAQ,SACR,YAAa,aACf,EAEaC,EAAoB,OAAO,OAAOD,CAAiB,EAG1DE,EAAgB,sBAEhBC,EAAiBC,GAA+B,CACpD,OAAQA,EAAA,CACN,KAAKR,EAAoB,GACvB,OAAOS,EACT,KAAKT,EAAoB,KACvB,OAAOU,EACT,KAAKV,EAAoB,QACvB,OAAOW,EACT,KAAKX,EAAoB,QACvB,OAAOY,EACT,KAAKZ,EAAoB,MACvB,OAAOa,EAAAA,CAAA,CAEb,EA6BaC,EAAeC,EAAAA,WAC1B,CACE,CACE,CAAC,eAAgBC,EACjB,CAAC,aAAc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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,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as N } from "react";
|
|
3
|
-
import { b as $ } from "./button-
|
|
4
|
-
import { H as j } from "./heading-
|
|
3
|
+
import { b as $ } from "./button-mHw_J7JU.mjs";
|
|
4
|
+
import { H as j } from "./heading-BG7JTFO1.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
7
|
import { P as O } from "./paragraph-CwAdFoIm.mjs";
|
|
@@ -176,4 +176,4 @@ export {
|
|
|
176
176
|
T as e,
|
|
177
177
|
W as n
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=notification-
|
|
179
|
+
//# sourceMappingURL=notification-Cbn0UN1p.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-C3f3N1K1.mjs","sources":["../../../components/icon/dist/assets/alert-filled.es.js","../../../components/icon/dist/assets/check-circle-filled.es.js","../../../components/icon/dist/assets/close.es.js","../../../components/icon/dist/assets/info-filled.es.js","../../../components/icon/dist/assets/sparkles.es.js","../../../components/notification/src/notification.tsx"],"sourcesContent":["const l = {\n name: \"alert-filled\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm1.038-14.81-.247 6.875h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.916c0 .649-.585 1.234-1.25 1.234-.649 0-1.25-.585-1.25-1.234 0-.633.601-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"alert-filled\"],\n category: \"status\"\n};\nexport {\n l as alertFilled\n};\n//# sourceMappingURL=alert-filled.es.js.map\n","const e = {\n name: \"check-circle-filled\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.712-12.491a.875.875 0 1 0-1.424-1.018l-4.4 6.16-2.27-2.27a.875.875 0 0 0-1.237 1.238l3 3a.875.875 0 0 0 1.331-.11l5-7Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"check-circle-filled\"],\n category: \"status\"\n};\nexport {\n e as checkCircleFilled\n};\n//# sourceMappingURL=check-circle-filled.es.js.map\n","const l = {\n name: \"close\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"close\"],\n category: \"utility\"\n};\nexport {\n l as close\n};\n//# sourceMappingURL=close.es.js.map\n","const e = {\n name: \"info-filled\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM10.9 7.786c0 .591.516 1.077 1.108 1.077.576 0 1.092-.486 1.092-1.077 0-.592-.516-1.078-1.092-1.078-.592 0-1.108.486-1.108 1.078Zm.167 9.74h1.866V9.94h-1.866v7.586Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"info-filled\"],\n category: \"status\"\n};\nexport {\n e as infoFilled\n};\n//# sourceMappingURL=info-filled.es.js.map\n","const a = {\n name: \"sparkles\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M17.154 22.054c.463-.002.855-.304.977-.755.411-1.533 1.256-2.463 2.656-2.926a1.02 1.02 0 0 0 .015-1.93c-1.437-.508-2.283-1.434-2.665-2.919a1.017 1.017 0 0 0-.974-.766c-.445.02-.864.305-.986.747-.422 1.518-1.267 2.447-2.66 2.923a1.02 1.02 0 0 0-.687.968c.001.437.279.825.686.962 1.4.479 2.243 1.414 2.657 2.946.121.442.523.75.978.75h.003Zm-1.788-4.66a5.334 5.334 0 0 0 1.779-1.867 5.32 5.32 0 0 0 1.792 1.87 5.256 5.256 0 0 0-1.787 1.88 5.326 5.326 0 0 0-1.784-1.883Zm.956-8.397c-2.97-1.047-4.797-3.046-5.583-6.115a1.232 1.232 0 0 0-1.19-.936 1.247 1.247 0 0 0-1.204.916c-.868 3.125-2.693 5.124-5.579 6.112-.502.171-.84.646-.84 1.182 0 .536.338 1.01.84 1.182 2.897.991 4.72 3.004 5.57 6.154.151.552.632.922 1.196.922h.004a1.228 1.228 0 0 0 1.191-.925c.849-3.162 2.674-5.166 5.578-6.126h.003a1.253 1.253 0 0 0 .015-2.366ZM9.53 15.415c-.996-2.405-2.64-4.167-4.906-5.259C6.878 9.071 8.52 7.324 9.526 4.941c.967 2.359 2.616 4.109 4.926 5.226-2.276 1.073-3.925 2.83-4.922 5.248Z\"/></svg>',\n keywords: [\"sparkles\"],\n category: \"ai\"\n};\nexport {\n a as sparkles\n};\n//# sourceMappingURL=sparkles.es.js.map\n","import React, { forwardRef } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { Icon } from \"@purpur/icon\";\nimport { alertFilled } from \"@purpur/icon/assets/alert-filled\";\nimport { checkCircleFilled } from \"@purpur/icon/assets/check-circle-filled\";\nimport { close } from \"@purpur/icon/assets/close\";\nimport { errorFilled } from \"@purpur/icon/assets/error-filled\";\nimport { infoFilled } from \"@purpur/icon/assets/info-filled\";\nimport { sparkles } from \"@purpur/icon/assets/sparkles\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./notification.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport const NOTIFICATION_STATUS = {\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n INFO: \"info\",\n AI: \"ai\",\n} as const;\n\nexport const notificationStatuses = Object.values(NOTIFICATION_STATUS);\nexport type NotificationStatus = (typeof NOTIFICATION_STATUS)[keyof typeof NOTIFICATION_STATUS];\n\nexport const NOTIFICATION_ARIA_LIVE = {\n POLITE: \"polite\",\n ASSERTIVE: \"assertive\",\n} as const;\n\nexport const notificationAriaLiveValues = Object.values(NOTIFICATION_ARIA_LIVE);\nexport type NotificationAriaLive =\n (typeof NOTIFICATION_ARIA_LIVE)[keyof typeof NOTIFICATION_ARIA_LIVE];\n\nexport const NOTIFICATION_ROLE = {\n ALERT: \"alert\",\n DIALOG: \"dialog\",\n ALERTDIALOG: \"alertdialog\",\n} as const;\n\nexport const notificationRoles = Object.values(NOTIFICATION_ROLE);\nexport type NotificationRole = (typeof NOTIFICATION_ROLE)[keyof typeof NOTIFICATION_ROLE];\n\nconst rootClassName = \"purpur-notification\";\n\nconst getStatusIcon = (status: NotificationStatus) => {\n switch (status) {\n case NOTIFICATION_STATUS.AI:\n return sparkles;\n case NOTIFICATION_STATUS.INFO:\n return infoFilled;\n case NOTIFICATION_STATUS.SUCCESS:\n return checkCircleFilled;\n case NOTIFICATION_STATUS.WARNING:\n return alertFilled;\n case NOTIFICATION_STATUS.ERROR:\n return errorFilled;\n }\n};\n\ntype DefaultProps = BaseProps & {\n [\"aria-live\"]?: NotificationAriaLive;\n headingTag?: HeadingTagType;\n status?: NotificationStatus;\n heading?: string;\n role?: NotificationRole;\n hidden?: boolean;\n /**\n * Use to explicitly not open the notification initially and open it programatically to trigger\n * that the aria-live message is read by the screen reader correctly.\n */\n open?: boolean;\n hideIcon?: boolean;\n};\n\ntype CloseButtonProps = {\n onClose: () => void;\n closeButtonAriaLabel: string;\n};\n\ntype NoCloseButtonProps = {\n onClose?: never;\n closeButtonAriaLabel?: never;\n};\n\nexport type NotificationProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n [\"aria-live\"]: ariaLive,\n children,\n className,\n closeButtonAriaLabel,\n headingTag = \"h4\",\n status = \"info\",\n heading,\n hidden,\n id,\n onClose,\n open = true,\n hideIcon,\n ...props\n },\n ref\n ) => {\n const showHeader = !!heading || !hideIcon;\n\n return (\n <div aria-live={ariaLive}>\n {open && (\n <div\n id={id}\n aria-labelledby={id ? `${id}-heading` : undefined}\n aria-describedby={id ? `${id}-body` : undefined}\n aria-hidden={!!hidden}\n className={cx(className, rootClassName, `${rootClassName}--${status}`, {\n [`${rootClassName}--hidden`]: hidden,\n [`${rootClassName}--has-close-button`]: !!onClose,\n })}\n data-testid={dataTestId}\n ref={ref}\n {...props}\n >\n {showHeader && (\n <div className={cx(`${rootClassName}__top`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {!hideIcon && (\n <Icon\n data-testid={dataTestId ? `${dataTestId}-icon` : undefined}\n className={cx(`${rootClassName}__icon`)}\n svg={getStatusIcon(status)}\n size=\"sm\"\n />\n )}\n {!!heading && (\n <Heading\n data-testid={dataTestId ? `${dataTestId}-heading` : undefined}\n variant=\"subsection-100\"\n tag={headingTag}\n className={cx(`${rootClassName}__heading`)}\n >\n <span id={id ? `${id}-heading` : undefined}> {heading}</span>\n </Heading>\n )}\n </div>\n </div>\n )}\n {onClose && (\n <Button\n data-testid={dataTestId ? `${dataTestId}-close-button` : undefined}\n variant=\"text\"\n size=\"sm\"\n iconOnly\n aria-label={closeButtonAriaLabel}\n onClick={onClose}\n className={cx(`${rootClassName}__close-button`)}\n >\n <Icon svg={close} size=\"md\" />\n </Button>\n )}\n {children && (\n <div\n data-testid={dataTestId ? `${dataTestId}-body` : undefined}\n className={cx(`${rootClassName}__body`, {\n [`${rootClassName}__body--extra-padding`]: !showHeader && !!onClose,\n })}\n id={id ? `${id}-body` : undefined}\n >\n {typeof children === \"string\" ? (\n <Paragraph\n data-testid={dataTestId ? `${dataTestId}-paragraph` : undefined}\n variant=\"paragraph-100\"\n >\n {children}\n </Paragraph>\n ) : (\n children\n )}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nNotification.displayName = \"Notification\";\n"],"names":["l","e","a","cx","c","styles","NOTIFICATION_STATUS","notificationStatuses","NOTIFICATION_ARIA_LIVE","notificationAriaLiveValues","NOTIFICATION_ROLE","notificationRoles","rootClassName","getStatusIcon","status","sparkles","infoFilled","checkCircleFilled","alertFilled","errorFilled","Notification","forwardRef","dataTestId","ariaLive","children","className","closeButtonAriaLabel","headingTag","heading","hidden","id","onClose","open","hideIcon","props","ref","showHeader","jsx","jsxs","Icon","Heading","Button","close","Paragraph"],"mappings":";;;;;;;;AAAA,MAAMA,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,cAAc;AAAA,EACzB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,qBAAqB;AAAA,EAChC,UAAU;AACZ,GCLMD,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,OAAO;AAAA,EAClB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,aAAa;AAAA,EACxB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,UAAU;AAAA,EACrB,UAAU;AACZ;;;;;;;;;;;;;;;;GCWMC,IAAKC,EAAE,KAAKC,CAAM,GAEXC,IAAsB;AAAA,EACjC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,IAAI;AACN,GAEaC,IAAuB,OAAO,OAAOD,CAAmB,GAGxDE,IAAyB;AAAA,EACpC,QAAQ;AAAA,EACR,WAAW;AACb,GAEaC,IAA6B,OAAO,OAAOD,CAAsB,GAIjEE,IAAoB;AAAA,EAC/B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,aAAa;AACf,GAEaC,IAAoB,OAAO,OAAOD,CAAiB,GAG1DE,IAAgB,uBAEhBC,IAAgB,CAACC,MAA+B;AACpD,UAAQA,GAAA;AAAA,IACN,KAAKR,EAAoB;AACvB,aAAOS;AAAAA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AAA,OAAON,KAAa,WACnB,gBAAAa;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,eAAarB,IAAa,GAAGA,CAAU,eAAe;AAAA,kBACtD,SAAQ;AAAA,kBAEP,UAAAE;AAAA,gBAAA;AAAA,cAAA,IAGHA;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA,GAIR;AAAA,EAEJ;AACF;AAEAJ,EAAa,cAAc;"}
|
|
1
|
+
{"version":3,"file":"notification-Cbn0UN1p.mjs","sources":["../../../components/icon/dist/assets/alert-filled.es.js","../../../components/icon/dist/assets/check-circle-filled.es.js","../../../components/icon/dist/assets/close.es.js","../../../components/icon/dist/assets/info-filled.es.js","../../../components/icon/dist/assets/sparkles.es.js","../../../components/notification/src/notification.tsx"],"sourcesContent":["const l = {\n name: \"alert-filled\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm1.038-14.81-.247 6.875h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.916c0 .649-.585 1.234-1.25 1.234-.649 0-1.25-.585-1.25-1.234 0-.633.601-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"alert-filled\"],\n category: \"status\"\n};\nexport {\n l as alertFilled\n};\n//# sourceMappingURL=alert-filled.es.js.map\n","const e = {\n name: \"check-circle-filled\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.712-12.491a.875.875 0 1 0-1.424-1.018l-4.4 6.16-2.27-2.27a.875.875 0 0 0-1.237 1.238l3 3a.875.875 0 0 0 1.331-.11l5-7Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"check-circle-filled\"],\n category: \"status\"\n};\nexport {\n e as checkCircleFilled\n};\n//# sourceMappingURL=check-circle-filled.es.js.map\n","const l = {\n name: \"close\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"close\"],\n category: \"utility\"\n};\nexport {\n l as close\n};\n//# sourceMappingURL=close.es.js.map\n","const e = {\n name: \"info-filled\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM10.9 7.786c0 .591.516 1.077 1.108 1.077.576 0 1.092-.486 1.092-1.077 0-.592-.516-1.078-1.092-1.078-.592 0-1.108.486-1.108 1.078Zm.167 9.74h1.866V9.94h-1.866v7.586Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"info-filled\"],\n category: \"status\"\n};\nexport {\n e as infoFilled\n};\n//# sourceMappingURL=info-filled.es.js.map\n","const a = {\n name: \"sparkles\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M17.154 22.054c.463-.002.855-.304.977-.755.411-1.533 1.256-2.463 2.656-2.926a1.02 1.02 0 0 0 .015-1.93c-1.437-.508-2.283-1.434-2.665-2.919a1.017 1.017 0 0 0-.974-.766c-.445.02-.864.305-.986.747-.422 1.518-1.267 2.447-2.66 2.923a1.02 1.02 0 0 0-.687.968c.001.437.279.825.686.962 1.4.479 2.243 1.414 2.657 2.946.121.442.523.75.978.75h.003Zm-1.788-4.66a5.334 5.334 0 0 0 1.779-1.867 5.32 5.32 0 0 0 1.792 1.87 5.256 5.256 0 0 0-1.787 1.88 5.326 5.326 0 0 0-1.784-1.883Zm.956-8.397c-2.97-1.047-4.797-3.046-5.583-6.115a1.232 1.232 0 0 0-1.19-.936 1.247 1.247 0 0 0-1.204.916c-.868 3.125-2.693 5.124-5.579 6.112-.502.171-.84.646-.84 1.182 0 .536.338 1.01.84 1.182 2.897.991 4.72 3.004 5.57 6.154.151.552.632.922 1.196.922h.004a1.228 1.228 0 0 0 1.191-.925c.849-3.162 2.674-5.166 5.578-6.126h.003a1.253 1.253 0 0 0 .015-2.366ZM9.53 15.415c-.996-2.405-2.64-4.167-4.906-5.259C6.878 9.071 8.52 7.324 9.526 4.941c.967 2.359 2.616 4.109 4.926 5.226-2.276 1.073-3.925 2.83-4.922 5.248Z\"/></svg>',\n keywords: [\"sparkles\"],\n category: \"ai\"\n};\nexport {\n a as sparkles\n};\n//# sourceMappingURL=sparkles.es.js.map\n","import React, { forwardRef } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { Icon } from \"@purpur/icon\";\nimport { alertFilled } from \"@purpur/icon/assets/alert-filled\";\nimport { checkCircleFilled } from \"@purpur/icon/assets/check-circle-filled\";\nimport { close } from \"@purpur/icon/assets/close\";\nimport { errorFilled } from \"@purpur/icon/assets/error-filled\";\nimport { infoFilled } from \"@purpur/icon/assets/info-filled\";\nimport { sparkles } from \"@purpur/icon/assets/sparkles\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./notification.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport const NOTIFICATION_STATUS = {\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n INFO: \"info\",\n AI: \"ai\",\n} as const;\n\nexport const notificationStatuses = Object.values(NOTIFICATION_STATUS);\nexport type NotificationStatus = (typeof NOTIFICATION_STATUS)[keyof typeof NOTIFICATION_STATUS];\n\nexport const NOTIFICATION_ARIA_LIVE = {\n POLITE: \"polite\",\n ASSERTIVE: \"assertive\",\n} as const;\n\nexport const notificationAriaLiveValues = Object.values(NOTIFICATION_ARIA_LIVE);\nexport type NotificationAriaLive =\n (typeof NOTIFICATION_ARIA_LIVE)[keyof typeof NOTIFICATION_ARIA_LIVE];\n\nexport const NOTIFICATION_ROLE = {\n ALERT: \"alert\",\n DIALOG: \"dialog\",\n ALERTDIALOG: \"alertdialog\",\n} as const;\n\nexport const notificationRoles = Object.values(NOTIFICATION_ROLE);\nexport type NotificationRole = (typeof NOTIFICATION_ROLE)[keyof typeof NOTIFICATION_ROLE];\n\nconst rootClassName = \"purpur-notification\";\n\nconst getStatusIcon = (status: NotificationStatus) => {\n switch (status) {\n case NOTIFICATION_STATUS.AI:\n return sparkles;\n case NOTIFICATION_STATUS.INFO:\n return infoFilled;\n case NOTIFICATION_STATUS.SUCCESS:\n return checkCircleFilled;\n case NOTIFICATION_STATUS.WARNING:\n return alertFilled;\n case NOTIFICATION_STATUS.ERROR:\n return errorFilled;\n }\n};\n\ntype DefaultProps = BaseProps & {\n [\"aria-live\"]?: NotificationAriaLive;\n headingTag?: HeadingTagType;\n status?: NotificationStatus;\n heading?: string;\n role?: NotificationRole;\n hidden?: boolean;\n /**\n * Use to explicitly not open the notification initially and open it programatically to trigger\n * that the aria-live message is read by the screen reader correctly.\n */\n open?: boolean;\n hideIcon?: boolean;\n};\n\ntype CloseButtonProps = {\n onClose: () => void;\n closeButtonAriaLabel: string;\n};\n\ntype NoCloseButtonProps = {\n onClose?: never;\n closeButtonAriaLabel?: never;\n};\n\nexport type NotificationProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n [\"aria-live\"]: ariaLive,\n children,\n className,\n closeButtonAriaLabel,\n headingTag = \"h4\",\n status = \"info\",\n heading,\n hidden,\n id,\n onClose,\n open = true,\n hideIcon,\n ...props\n },\n ref\n ) => {\n const showHeader = !!heading || !hideIcon;\n\n return (\n <div aria-live={ariaLive}>\n {open && (\n <div\n id={id}\n aria-labelledby={id ? `${id}-heading` : undefined}\n aria-describedby={id ? `${id}-body` : undefined}\n aria-hidden={!!hidden}\n className={cx(className, rootClassName, `${rootClassName}--${status}`, {\n [`${rootClassName}--hidden`]: hidden,\n [`${rootClassName}--has-close-button`]: !!onClose,\n })}\n data-testid={dataTestId}\n ref={ref}\n {...props}\n >\n {showHeader && (\n <div className={cx(`${rootClassName}__top`)}>\n <div className={cx(`${rootClassName}__header`)}>\n {!hideIcon && (\n <Icon\n data-testid={dataTestId ? `${dataTestId}-icon` : undefined}\n className={cx(`${rootClassName}__icon`)}\n svg={getStatusIcon(status)}\n size=\"sm\"\n />\n )}\n {!!heading && (\n <Heading\n data-testid={dataTestId ? `${dataTestId}-heading` : undefined}\n variant=\"subsection-100\"\n tag={headingTag}\n className={cx(`${rootClassName}__heading`)}\n >\n <span id={id ? `${id}-heading` : undefined}> {heading}</span>\n </Heading>\n )}\n </div>\n </div>\n )}\n {onClose && (\n <Button\n data-testid={dataTestId ? `${dataTestId}-close-button` : undefined}\n variant=\"text\"\n size=\"sm\"\n iconOnly\n aria-label={closeButtonAriaLabel}\n onClick={onClose}\n className={cx(`${rootClassName}__close-button`)}\n >\n <Icon svg={close} size=\"md\" />\n </Button>\n )}\n {children && (\n <div\n data-testid={dataTestId ? `${dataTestId}-body` : undefined}\n className={cx(`${rootClassName}__body`, {\n [`${rootClassName}__body--extra-padding`]: !showHeader && !!onClose,\n })}\n id={id ? `${id}-body` : undefined}\n >\n {typeof children === \"string\" ? (\n <Paragraph\n data-testid={dataTestId ? `${dataTestId}-paragraph` : undefined}\n variant=\"paragraph-100\"\n >\n {children}\n </Paragraph>\n ) : (\n children\n )}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nNotification.displayName = \"Notification\";\n"],"names":["l","e","a","cx","c","styles","NOTIFICATION_STATUS","notificationStatuses","NOTIFICATION_ARIA_LIVE","notificationAriaLiveValues","NOTIFICATION_ROLE","notificationRoles","rootClassName","getStatusIcon","status","sparkles","infoFilled","checkCircleFilled","alertFilled","errorFilled","Notification","forwardRef","dataTestId","ariaLive","children","className","closeButtonAriaLabel","headingTag","heading","hidden","id","onClose","open","hideIcon","props","ref","showHeader","jsx","jsxs","Icon","Heading","Button","close","Paragraph"],"mappings":";;;;;;;;AAAA,MAAMA,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,cAAc;AAAA,EACzB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,qBAAqB;AAAA,EAChC,UAAU;AACZ,GCLMD,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,OAAO;AAAA,EAClB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,aAAa;AAAA,EACxB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,UAAU;AAAA,EACrB,UAAU;AACZ;;;;;;;;;;;;;;;;GCWMC,IAAKC,EAAE,KAAKC,CAAM,GAEXC,IAAsB;AAAA,EACjC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,IAAI;AACN,GAEaC,IAAuB,OAAO,OAAOD,CAAmB,GAGxDE,IAAyB;AAAA,EACpC,QAAQ;AAAA,EACR,WAAW;AACb,GAEaC,IAA6B,OAAO,OAAOD,CAAsB,GAIjEE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AAGA,CAAU,UAAU;AAAA,cACjD,WAAWnB,EAAG,GAAGS,CAAa,UAAU;AAAA,gBACtC,CAAC,GAAGA,CAAa,uBAAuB,GAAG,CAACwB,KAAc,CAAC,CAACL;AAAA,cAAA,CAC7D;AAAA,cACD,IAAID,IAAK,GAAGA,CAAE,UAAU;AAAA,cAEvB,UAAA,OAAON,KAAa,WACnB,gBAAAa;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,eAAarB,IAAa,GAAGA,CAAU,eAAe;AAAA,kBACtD,SAAQ;AAAA,kBAEP,UAAAE;AAAA,gBAAA;AAAA,cAAA,IAGHA;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA,GAIR;AAAA,EAEJ;AACF;AAEAJ,EAAa,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),m=require("react"),x=require("./button-C5CYysw5.js"),N=require("./grid-uGMD2euo.js"),j=require("./heading-BPeRwNYu.js"),v=require("./close.es-VL3lKi1O.js"),q=require("./info.es-Br84jly5.js"),$=require("./bind-DeUYJ6m9.js"),B={"purpur-notification-banner":"_purpur-notification-banner_nh2gd_1","purpur-notification-banner__container":"_purpur-notification-banner__container_nh2gd_6","purpur-notification-banner__content":"_purpur-notification-banner__content_nh2gd_11","purpur-notification-banner__icon":"_purpur-notification-banner__icon_nh2gd_16","purpur-notification-banner__heading":"_purpur-notification-banner__heading_nh2gd_20","purpur-notification-banner__heading--no-overlap":"_purpur-notification-banner__heading--no-overlap_nh2gd_23","purpur-notification-banner__close-button":"_purpur-notification-banner__close-button_nh2gd_26"},r=$.c.bind(B),i="purpur-notification-banner",o=m.forwardRef(({["data-testid"]:e,children:c,className:s,closeButtonAriaLabel:_,description:u,hideIcon:d,icon:a,link:p,onClose:t,headingTag:l="h4",title:b,...h},f)=>{const g=r(s,i);return n.jsx("div",{...h,className:g,role:"alert",ref:f,"data-testid":e,children:n.jsx(N.Grid,{children:n.jsxs("div",{className:r(`${i}__container`),children:[d?null:a?n.jsx("span",{className:r(`${i}__icon`),children:a}):n.jsx(q.r,{className:r(`${i}__icon`),size:"sm"}),n.jsxs("div",{className:r(`${i}__content`),children:[n.jsx(j.Heading,{tag:l,variant:"subsection-100",className:r([`${i}__heading`,{[`${i}__heading--no-overlap`]:t}]),children:b}),n.jsxs("div",{children:[u," ",p]}),c]}),t&&n.jsx(x.Button,{"data-testid":e?`${e}-close-button`:void 0,variant:"text",size:"sm",iconOnly:!0,"aria-label":_,onClick:t,className:r(`${i}__close-button`),children:n.jsx(v.r,{size:"sm"})})]})})})});o.displayName="NotificationBanner";exports.NotificationBanner=o;
|
|
2
|
+
//# sourceMappingURL=notification-banner-B9RhXAZ8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-banner-B9RhXAZ8.js","sources":["../../../components/notification-banner/src/notification-banner.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode } from \"react\";\nimport { Button } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Grid } from \"@purpur/grid\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { IconInfo } from \"@purpur/icon/info\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./notification-banner.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type DefaultProps = BaseProps & {\n closeButtonAriaLabel?: string;\n description?: string;\n hideIcon?: boolean;\n icon?: ReactNode;\n link?: ReactNode;\n headingTag?: HeadingTagType;\n title?: string;\n};\n\ntype CloseButtonProps = {\n onClose: () => void;\n closeButtonAriaLabel: string;\n};\n\ntype NoCloseButtonProps = {\n onClose?: never;\n closeButtonAriaLabel?: never;\n};\n\nexport type NotificationBannerProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);\n\nconst rootClassName = \"purpur-notification-banner\";\n\nexport const NotificationBanner = forwardRef<HTMLDivElement, NotificationBannerProps>(\n (\n {\n [\"data-testid\"]: dataTestId,\n children,\n className,\n closeButtonAriaLabel,\n description,\n hideIcon,\n icon,\n link,\n onClose,\n headingTag = \"h4\",\n title,\n ...props\n },\n ref\n ) => {\n const classes = cx(className, rootClassName);\n\n return (\n <div {...props} className={classes} role=\"alert\" ref={ref} data-testid={dataTestId}>\n <Grid>\n <div className={cx(`${rootClassName}__container`)}>\n {!hideIcon ? (\n icon ? (\n <span className={cx(`${rootClassName}__icon`)}>{icon}</span>\n ) : (\n <IconInfo className={cx(`${rootClassName}__icon`)} size=\"sm\" />\n )\n ) : null}\n <div className={cx(`${rootClassName}__content`)}>\n <Heading\n tag={headingTag}\n variant=\"subsection-100\"\n className={cx([\n `${rootClassName}__heading`,\n { [`${rootClassName}__heading--no-overlap`]: onClose },\n ])}\n >\n {title}\n </Heading>\n <div>\n {description} {link}\n </div>\n {children}\n </div>\n {onClose && (\n <Button\n data-testid={dataTestId ? `${dataTestId}-close-button` : undefined}\n variant=\"text\"\n size=\"sm\"\n iconOnly\n aria-label={closeButtonAriaLabel}\n onClick={onClose}\n className={cx(`${rootClassName}__close-button`)}\n >\n <IconClose size=\"sm\" />\n </Button>\n )}\n </div>\n </Grid>\n </div>\n );\n }\n);\n\nNotificationBanner.displayName = \"NotificationBanner\";\n"],"names":["cx","c","styles","rootClassName","NotificationBanner","forwardRef","dataTestId","children","className","closeButtonAriaLabel","description","hideIcon","icon","link","onClose","headingTag","title","props","ref","classes","jsx","Grid","IconInfo","Heading","Button","IconClose"],"mappings":"23BAWMA,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAwBlBC,EAAgB,6BAETC,EAAqBC,EAAAA,WAChC,CACE,CACE,CAAC,eAAgBC,EACjB,SAAAC,EACA,UAAAC,EACA,qBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,KAAAC,EACA,KAAAC,EACA,QAAAC,EACA,WAAAC,EAAa,KACb,MAAAC,EACA,GAAGC,CAAA,EAELC,IACG,CACH,MAAMC,EAAUnB,EAAGQ,EAAWL,CAAa,EAE3C,OACEiB,MAAC,OAAK,GAAGH,EAAO,UAAWE,EAAS,KAAK,QAAQ,IAAAD,EAAU,cAAaZ,EACtE,SAAAc,MAACC,EAAAA,KAAA,CACC,gBAAC,MAAA,CAAI,UAAWrB,EAAG,GAAGG,CAAa,aAAa,EAC7C,SAAA,CAACQ,EAME,KALFC,EACEQ,EAAAA,IAAC,OAAA,CAAK,UAAWpB,EAAG,GAAGG,CAAa,QAAQ,EAAI,SAAAS,EAAK,EAErDQ,EAAAA,IAACE,EAAAA,EAAA,CAAS,UAAWtB,EAAG,GAAGG,CAAa,QAAQ,EAAG,KAAK,IAAA,CAAK,SAGhE,MAAA,CAAI,UAAWH,EAAG,GAAGG,CAAa,WAAW,EAC5C,SAAA,CAAAiB,EAAAA,IAACG,EAAAA,QAAA,CACC,IAAKR,EACL,QAAQ,iBACR,UAAWf,EAAG,CACZ,GAAGG,CAAa,YAChB,CAAE,CAAC,GAAGA,CAAa,uBAAuB,EAAGW,CAAA,CAAQ,CACtD,EAEA,SAAAE,CAAA,CAAA,SAEF,MAAA,CACE,SAAA,CAAAN,EAAY,IAAEG,CAAA,EACjB,EACCN,CAAA,EACH,EACCO,GACCM,EAAAA,IAACI,EAAAA,OAAA,CACC,cAAalB,EAAa,GAAGA,CAAU,gBAAkB,OACzD,QAAQ,OACR,KAAK,KACL,SAAQ,GACR,aAAYG,EACZ,QAASK,EACT,UAAWd,EAAG,GAAGG,CAAa,gBAAgB,EAE9C,SAAAiB,EAAAA,IAACK,EAAAA,EAAA,CAAU,KAAK,IAAA,CAAK,CAAA,CAAA,CACvB,CAAA,CAEJ,EACF,EACF,CAEJ,CACF,EAEArB,EAAmB,YAAc"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as i, jsxs as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as g } from "react";
|
|
3
|
-
import { b as N } from "./button-
|
|
3
|
+
import { b as N } from "./button-mHw_J7JU.mjs";
|
|
4
4
|
import { G as v } from "./grid-DGnCQgwf.mjs";
|
|
5
|
-
import { H as $ } from "./heading-
|
|
5
|
+
import { H as $ } from "./heading-BG7JTFO1.mjs";
|
|
6
6
|
import { r as x } from "./close.es-BPmk2wkU.mjs";
|
|
7
7
|
import { r as y } from "./info.es-u0pS2u7W.mjs";
|
|
8
8
|
import { c as z } from "./bind-CU-R61T-.mjs";
|
|
@@ -25,7 +25,7 @@ const B = {
|
|
|
25
25
|
icon: e,
|
|
26
26
|
link: d,
|
|
27
27
|
onClose: o,
|
|
28
|
-
|
|
28
|
+
headingTag: l = "h4",
|
|
29
29
|
title: m,
|
|
30
30
|
...f
|
|
31
31
|
}, b) => {
|
|
@@ -56,7 +56,7 @@ const B = {
|
|
|
56
56
|
N,
|
|
57
57
|
{
|
|
58
58
|
"data-testid": a ? `${a}-close-button` : void 0,
|
|
59
|
-
variant: "
|
|
59
|
+
variant: "text",
|
|
60
60
|
size: "sm",
|
|
61
61
|
iconOnly: !0,
|
|
62
62
|
"aria-label": s,
|
|
@@ -72,4 +72,4 @@ j.displayName = "NotificationBanner";
|
|
|
72
72
|
export {
|
|
73
73
|
j as N
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=notification-banner-
|
|
75
|
+
//# sourceMappingURL=notification-banner-C4NVekCZ.mjs.map
|