@purpur/library 9.2.3 → 9.4.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 +39 -0
- package/CHANGELOG.md +20 -1
- package/dist/LICENSE.txt +1 -1
- package/dist/{RichText-Bi51HE6X.mjs → RichText-jZ-sHV-u.mjs} +2 -2
- package/dist/{RichText-Bi51HE6X.mjs.map → RichText-jZ-sHV-u.mjs.map} +1 -1
- package/dist/{RichText-DNroJJXv.js → RichText-yobCUjTD.js} +2 -2
- package/dist/{RichText-DNroJJXv.js.map → RichText-yobCUjTD.js.map} +1 -1
- package/dist/{ThemeProvider-bkyFCeo6.mjs → ThemeProvider-CkX-BNWN.mjs} +2 -2
- package/dist/ThemeProvider-CkX-BNWN.mjs.map +1 -0
- package/dist/{ThemeProvider-5r7lDX-h.js → ThemeProvider-Dy771oix.js} +2 -2
- package/dist/ThemeProvider-Dy771oix.js.map +1 -0
- package/dist/{accordion-OtFSShSB.mjs → accordion-CIU4U8-4.mjs} +3 -3
- package/dist/accordion-CIU4U8-4.mjs.map +1 -0
- package/dist/{accordion-OsA0HvdA.js → accordion-DyhOG54L.js} +2 -2
- package/dist/accordion-DyhOG54L.js.map +1 -0
- package/dist/accordion.cjs.js +1 -1
- package/dist/accordion.es.js +3 -3
- package/dist/{autocomplete-D9uCJzjY.js → autocomplete-3kV1btuI.js} +2 -2
- package/dist/{autocomplete-D9uCJzjY.js.map → autocomplete-3kV1btuI.js.map} +1 -1
- package/dist/{autocomplete-BipmyKf0.mjs → autocomplete-BEGRn-Wh.mjs} +2 -2
- package/dist/{autocomplete-BipmyKf0.mjs.map → autocomplete-BEGRn-Wh.mjs.map} +1 -1
- package/dist/autocomplete.cjs.js +1 -1
- package/dist/autocomplete.es.js +1 -1
- package/dist/{card-DR2hvxjZ.mjs → card-C2mdp-ur.mjs} +2 -2
- package/dist/{card-DR2hvxjZ.mjs.map → card-C2mdp-ur.mjs.map} +1 -1
- package/dist/{card-CRHXm5NR.js → card-DFdUs5RG.js} +2 -2
- package/dist/{card-CRHXm5NR.js.map → card-DFdUs5RG.js.map} +1 -1
- package/dist/card.cjs.js +1 -1
- package/dist/card.es.js +1 -1
- package/dist/{carousel-BkxojLwn.mjs → carousel-DLkTL9sj.mjs} +29 -29
- package/dist/{carousel-BkxojLwn.mjs.map → carousel-DLkTL9sj.mjs.map} +1 -1
- package/dist/{carousel-BCw-5u92.js → carousel-DXrtxRz5.js} +2 -2
- package/dist/{carousel-BCw-5u92.js.map → carousel-DXrtxRz5.js.map} +1 -1
- package/dist/carousel.cjs.js +1 -1
- package/dist/carousel.es.js +1 -1
- package/dist/checkbox-BHTx89JQ.mjs +236 -0
- package/dist/checkbox-BHTx89JQ.mjs.map +1 -0
- package/dist/checkbox-CDNcNv6d.js +2 -0
- package/dist/checkbox-CDNcNv6d.js.map +1 -0
- package/dist/checkbox.cjs.js +1 -1
- package/dist/checkbox.es.js +1 -1
- package/dist/{comparison-table-D1zJpdLL.mjs → comparison-table-8bOJmz-L.mjs} +116 -116
- package/dist/comparison-table-8bOJmz-L.mjs.map +1 -0
- package/dist/comparison-table-mKL2IHXW.js +2 -0
- package/dist/comparison-table-mKL2IHXW.js.map +1 -0
- package/dist/comparison-table.cjs.js +1 -1
- package/dist/comparison-table.es.js +1 -1
- package/dist/components/accordion/src/accordion.d.ts +1 -1
- package/dist/components/accordion/src/accordion.d.ts.map +1 -1
- package/dist/components/checkbox/src/checkbox.d.ts +4 -0
- package/dist/components/checkbox/src/checkbox.d.ts.map +1 -1
- package/dist/components/comparison-table/src/comparison-table.d.ts +1 -1
- package/dist/components/comparison-table/src/comparison-table.d.ts.map +1 -1
- package/dist/components/dismissable-chip-group/src/dismissable-chip-group-item.d.ts.map +1 -1
- package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts +4 -2
- package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts.map +1 -1
- package/dist/components/drawer/src/drawer-content.d.ts.map +1 -1
- package/dist/components/drawer/src/drawer.context.d.ts +1 -0
- package/dist/components/drawer/src/drawer.context.d.ts.map +1 -1
- package/dist/components/drawer/src/drawer.d.ts +6 -0
- package/dist/components/drawer/src/drawer.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown-combobox.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown-select.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown-shared.d.ts +3 -2
- package/dist/components/dropdown/src/dropdown-shared.d.ts.map +1 -1
- package/dist/components/dropdown/src/useDropdown.d.ts +2 -1
- package/dist/components/dropdown/src/useDropdown.d.ts.map +1 -1
- package/dist/components/listbox/src/listbox-item.d.ts +2 -2
- package/dist/components/listbox/src/listbox-item.d.ts.map +1 -1
- package/dist/components/listbox/src/listbox.d.ts +4 -1
- package/dist/components/listbox/src/listbox.d.ts.map +1 -1
- package/dist/components/toggle/src/toggle.d.ts +1 -0
- package/dist/components/toggle/src/toggle.d.ts.map +1 -1
- package/dist/components-metadata.js +4 -2
- package/dist/{content-block-Dm3L4g8w.mjs → content-block-CakKeJtN.mjs} +2 -2
- package/dist/{content-block-Dm3L4g8w.mjs.map → content-block-CakKeJtN.mjs.map} +1 -1
- package/dist/{content-block-CDRUH0pg.js → content-block-CrekbIfe.js} +2 -2
- package/dist/{content-block-CDRUH0pg.js.map → content-block-CrekbIfe.js.map} +1 -1
- package/dist/content-block.cjs.js +1 -1
- package/dist/content-block.es.js +1 -1
- package/dist/{countdown-DZ4IwkNy.mjs → countdown-BsLsEZBv.mjs} +2 -2
- package/dist/{countdown-DZ4IwkNy.mjs.map → countdown-BsLsEZBv.mjs.map} +1 -1
- package/dist/{countdown-CqYsZigV.js → countdown-hYrFLmRg.js} +2 -2
- package/dist/{countdown-CqYsZigV.js.map → countdown-hYrFLmRg.js.map} +1 -1
- package/dist/countdown.cjs.js +1 -1
- package/dist/countdown.es.js +1 -1
- package/dist/{date-picker-DwFDRL5Z.mjs → date-picker-CbUNbOhn.mjs} +2 -2
- package/dist/{date-picker-DwFDRL5Z.mjs.map → date-picker-CbUNbOhn.mjs.map} +1 -1
- package/dist/{date-picker-DVrcu2QU.js → date-picker-DYXNB5aU.js} +2 -2
- package/dist/{date-picker-DVrcu2QU.js.map → date-picker-DYXNB5aU.js.map} +1 -1
- package/dist/date-picker.cjs.js +1 -1
- package/dist/date-picker.es.js +1 -1
- package/dist/dismissable-chip-group-2updhyuR.js +2 -0
- package/dist/dismissable-chip-group-2updhyuR.js.map +1 -0
- package/dist/dismissable-chip-group-Cfs2s2BH.mjs +94 -0
- package/dist/dismissable-chip-group-Cfs2s2BH.mjs.map +1 -0
- package/dist/dismissable-chip-group.cjs.js +1 -1
- package/dist/dismissable-chip-group.es.js +6 -5
- package/dist/drawer-8Acg4wkV.mjs +574 -0
- package/dist/drawer-8Acg4wkV.mjs.map +1 -0
- package/dist/drawer-BLHgcEqb.js +2 -0
- package/dist/drawer-BLHgcEqb.js.map +1 -0
- package/dist/drawer.cjs.js +1 -1
- package/dist/drawer.es.js +1 -1
- package/dist/dropdown-CMO_VD5e.mjs +916 -0
- package/dist/dropdown-CMO_VD5e.mjs.map +1 -0
- package/dist/dropdown-DJKNQnuo.js +2 -0
- package/dist/dropdown-DJKNQnuo.js.map +1 -0
- package/dist/dropdown.cjs.js +1 -1
- package/dist/dropdown.es.js +1 -1
- package/dist/{footer-BXs8uzTA.mjs → footer-BLPlXaZK.mjs} +4 -4
- package/dist/{footer-BXs8uzTA.mjs.map → footer-BLPlXaZK.mjs.map} +1 -1
- package/dist/{footer-DF9adlni.js → footer-D9AcPwlH.js} +2 -2
- package/dist/{footer-DF9adlni.js.map → footer-D9AcPwlH.js.map} +1 -1
- package/dist/footer.cjs.js +1 -1
- package/dist/footer.es.js +1 -1
- package/dist/{hero-banner-BfxclVFT.js → hero-banner-D1A-_qou.js} +2 -2
- package/dist/{hero-banner-BfxclVFT.js.map → hero-banner-D1A-_qou.js.map} +1 -1
- package/dist/{hero-banner-CxPvhXD2.mjs → hero-banner-DkC_BqM7.mjs} +3 -3
- package/dist/{hero-banner-CxPvhXD2.mjs.map → hero-banner-DkC_BqM7.mjs.map} +1 -1
- package/dist/hero-banner.cjs.js +1 -1
- package/dist/hero-banner.es.js +1 -1
- package/dist/{index-CKCTy3ZL.mjs → index-3NV-ckDX.mjs} +4 -4
- package/dist/{index-CKCTy3ZL.mjs.map → index-3NV-ckDX.mjs.map} +1 -1
- package/dist/libraries/theme/src/theme-props.d.ts +1 -0
- package/dist/libraries/theme/src/theme-props.d.ts.map +1 -1
- package/dist/libraries/tokens/dist/color/variables.d.ts +1 -0
- package/dist/libraries/tokens/dist/color/variables.dark.d.ts +1 -0
- package/dist/library.cjs.js +1 -1
- package/dist/library.es.js +593 -590
- package/dist/listbox-ATP4hOWF.js +2 -0
- package/dist/listbox-ATP4hOWF.js.map +1 -0
- package/dist/listbox-i6BQQ-NZ.mjs +73 -0
- package/dist/listbox-i6BQQ-NZ.mjs.map +1 -0
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.es.js +3 -2
- package/dist/{modal-COF_UhvY.js → modal-Baisuc6m.js} +2 -2
- package/dist/{modal-COF_UhvY.js.map → modal-Baisuc6m.js.map} +1 -1
- package/dist/{modal-BMg43Fvd.mjs → modal-fp37VbrH.mjs} +3 -3
- package/dist/{modal-BMg43Fvd.mjs.map → modal-fp37VbrH.mjs.map} +1 -1
- package/dist/modal.cjs.js +1 -1
- package/dist/modal.es.js +1 -1
- package/dist/{notification-BqjaT4E7.js → notification-B5bNNq86.js} +2 -2
- package/dist/{notification-BqjaT4E7.js.map → notification-B5bNNq86.js.map} +1 -1
- package/dist/{notification-DdRS5BF2.mjs → notification-BbQCmsnY.mjs} +2 -2
- package/dist/{notification-DdRS5BF2.mjs.map → notification-BbQCmsnY.mjs.map} +1 -1
- package/dist/notification.cjs.js +1 -1
- package/dist/notification.es.js +1 -1
- package/dist/{pagination-CVYUacXN.mjs → pagination-Cc_4zCQA.mjs} +2 -2
- package/dist/{pagination-CVYUacXN.mjs.map → pagination-Cc_4zCQA.mjs.map} +1 -1
- package/dist/{pagination-Bwlkvqye.js → pagination-rFRdkHII.js} +2 -2
- package/dist/{pagination-Bwlkvqye.js.map → pagination-rFRdkHII.js.map} +1 -1
- package/dist/pagination.cjs.js +1 -1
- package/dist/pagination.es.js +1 -1
- package/dist/paragraph-By4jMjnH.js +2 -0
- package/dist/{paragraph-BsI53OR0.js.map → paragraph-By4jMjnH.js.map} +1 -1
- package/dist/{paragraph-Ci50OF1u.mjs → paragraph-DSxXmX_0.mjs} +23 -23
- package/dist/{paragraph-Ci50OF1u.mjs.map → paragraph-DSxXmX_0.mjs.map} +1 -1
- package/dist/paragraph.cjs.js +1 -1
- package/dist/paragraph.es.js +1 -1
- package/dist/{popover-XCUa2GfC.js → popover-B0XJZ5mj.js} +2 -2
- package/dist/{popover-XCUa2GfC.js.map → popover-B0XJZ5mj.js.map} +1 -1
- package/dist/{popover-Dwqs1wGH.mjs → popover-_xJATlhN.mjs} +2 -2
- package/dist/{popover-Dwqs1wGH.mjs.map → popover-_xJATlhN.mjs.map} +1 -1
- package/dist/popover.cjs.js +1 -1
- package/dist/popover.es.js +1 -1
- package/dist/{product-card-BfB82XpS.mjs → product-card-C3_N0t-R.mjs} +3 -3
- package/dist/{product-card-BfB82XpS.mjs.map → product-card-C3_N0t-R.mjs.map} +1 -1
- package/dist/{product-card-bVQ7JhHj.js → product-card-CoY1KggV.js} +2 -2
- package/dist/{product-card-bVQ7JhHj.js.map → product-card-CoY1KggV.js.map} +1 -1
- package/dist/product-card.cjs.js +1 -1
- package/dist/product-card.es.js +1 -1
- package/dist/{promotion-card-DqBBt2sz.js → promotion-card-Bag64gqP.js} +2 -2
- package/dist/{promotion-card-DqBBt2sz.js.map → promotion-card-Bag64gqP.js.map} +1 -1
- package/dist/{promotion-card-BhNw94sC.mjs → promotion-card-BiHnQvhn.mjs} +4 -4
- package/dist/{promotion-card-BhNw94sC.mjs.map → promotion-card-BiHnQvhn.mjs.map} +1 -1
- 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-CDSfcTb1.js +2 -0
- package/dist/{quantity-selector-8AkKNDik.js.map → quantity-selector-CDSfcTb1.js.map} +1 -1
- package/dist/{quantity-selector-C23kU1hF.mjs → quantity-selector-CvBvnMeB.mjs} +35 -35
- package/dist/{quantity-selector-C23kU1hF.mjs.map → quantity-selector-CvBvnMeB.mjs.map} +1 -1
- package/dist/quantity-selector.cjs.js +1 -1
- package/dist/quantity-selector.es.js +1 -1
- package/dist/{radio-card-group-BlRZBa-9.mjs → radio-card-group-CneOprGY.mjs} +2 -2
- package/dist/{radio-card-group-BlRZBa-9.mjs.map → radio-card-group-CneOprGY.mjs.map} +1 -1
- package/dist/{radio-card-group-sYcfDPJq.js → radio-card-group-Ctuvg61o.js} +2 -2
- package/dist/{radio-card-group-sYcfDPJq.js.map → radio-card-group-Ctuvg61o.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-CZ9mIyZ-.mjs → search-field-CpkHGIYi.mjs} +3 -3
- package/dist/{search-field-CZ9mIyZ-.mjs.map → search-field-CpkHGIYi.mjs.map} +1 -1
- package/dist/{search-field-DD9UkOca.js → search-field-Z0PqDARl.js} +2 -2
- package/dist/{search-field-DD9UkOca.js.map → search-field-Z0PqDARl.js.map} +1 -1
- package/dist/search-field.cjs.js +1 -1
- package/dist/search-field.es.js +1 -1
- package/dist/{stepper-uBfDdIju.mjs → stepper-CNnx_NiR.mjs} +2 -2
- package/dist/{stepper-uBfDdIju.mjs.map → stepper-CNnx_NiR.mjs.map} +1 -1
- package/dist/{stepper-w-raIwqJ.js → stepper-Df4X7DDR.js} +2 -2
- package/dist/{stepper-w-raIwqJ.js.map → stepper-Df4X7DDR.js.map} +1 -1
- package/dist/stepper.cjs.js +1 -1
- package/dist/stepper.es.js +1 -1
- package/dist/{table-Dx_dhGT6.mjs → table-D_sdSJyr.mjs} +6 -6
- package/dist/{table-Dx_dhGT6.mjs.map → table-D_sdSJyr.mjs.map} +1 -1
- package/dist/{table-DsgqX7Vv.js → table-gnGUejtb.js} +2 -2
- package/dist/{table-DsgqX7Vv.js.map → table-gnGUejtb.js.map} +1 -1
- package/dist/table.cjs.js +1 -1
- package/dist/table.es.js +1 -1
- package/dist/{text-area-DDZ_GQPW.mjs → text-area-kJvg6cFp.mjs} +3 -3
- package/dist/{text-area-DDZ_GQPW.mjs.map → text-area-kJvg6cFp.mjs.map} +1 -1
- package/dist/{text-area-C6W0fDiQ.js → text-area-peNKG7g4.js} +2 -2
- package/dist/{text-area-C6W0fDiQ.js.map → text-area-peNKG7g4.js.map} +1 -1
- package/dist/text-area.cjs.js +1 -1
- package/dist/text-area.es.js +1 -1
- package/dist/theme.cjs.js +1 -1
- package/dist/theme.es.js +2 -2
- package/dist/toggle-B8ZLUVar.js +2 -0
- package/dist/{toggle-C8IwTbX8.js.map → toggle-B8ZLUVar.js.map} +1 -1
- package/dist/toggle-CY3J8BRX.mjs +302 -0
- package/dist/{toggle-D23x1wWk.mjs.map → toggle-CY3J8BRX.mjs.map} +1 -1
- package/dist/toggle.cjs.js +1 -1
- package/dist/toggle.es.js +1 -1
- package/dist/tokens/color/variables.css +1 -0
- package/dist/tokens/color/variables.d.ts +1 -0
- package/dist/tokens/color/variables.dark.css +1 -0
- package/dist/tokens/color/variables.dark.d.ts +1 -0
- package/dist/tokens/color/variables.dark.js +1 -0
- package/dist/tokens/color/variables.dark.json +2 -1
- package/dist/tokens/color/variables.dark.scss +1 -0
- package/dist/tokens/color/variables.js +1 -0
- package/dist/tokens/color/variables.json +2 -1
- package/dist/tokens/color/variables.scss +1 -0
- package/dist/tokens.cjs.js +1 -1
- package/dist/tokens.es.js +76 -75
- package/dist/{tooltip-0pLBlDG3.js → tooltip-C8Zxnqdb.js} +2 -2
- package/dist/{tooltip-0pLBlDG3.js.map → tooltip-C8Zxnqdb.js.map} +1 -1
- package/dist/{tooltip-Kom0VfOC.mjs → tooltip-VlURN8H3.mjs} +2 -2
- package/dist/{tooltip-Kom0VfOC.mjs.map → tooltip-VlURN8H3.mjs.map} +1 -1
- package/dist/tooltip.cjs.js +1 -1
- package/dist/tooltip.es.js +1 -1
- package/dist/use-autocomplete.es-BwAzMcau.js +2 -0
- package/dist/use-autocomplete.es-BwAzMcau.js.map +1 -0
- package/dist/{use-autocomplete.es-CVv3z8t6.mjs → use-autocomplete.es-CKb0RHKG.mjs} +37 -35
- package/dist/use-autocomplete.es-CKb0RHKG.mjs.map +1 -0
- package/dist/useColorScheme-DNyjsWX9.js +2 -0
- package/dist/{useColorScheme-0GMDl2GF.js.map → useColorScheme-DNyjsWX9.js.map} +1 -1
- package/dist/{useColorScheme-Di_Q0JR4.mjs → useColorScheme-tAkY9LHt.mjs} +2 -2
- package/dist/{useColorScheme-Di_Q0JR4.mjs.map → useColorScheme-tAkY9LHt.mjs.map} +1 -1
- package/dist/{variables-CKp4o9Tn.mjs → variables-B5hbV0Uy.mjs} +128 -127
- package/dist/variables-B5hbV0Uy.mjs.map +1 -0
- package/dist/variables-DoI78zZc.js +2 -0
- package/dist/variables-DoI78zZc.js.map +1 -0
- package/package.json +21 -21
- package/tokens/color/variables.css +1 -0
- package/tokens/color/variables.d.ts +1 -0
- package/tokens/color/variables.dark.css +1 -0
- package/tokens/color/variables.dark.d.ts +1 -0
- package/tokens/color/variables.dark.js +1 -0
- package/tokens/color/variables.dark.json +2 -1
- package/tokens/color/variables.dark.scss +1 -0
- package/tokens/color/variables.js +1 -0
- package/tokens/color/variables.json +2 -1
- package/tokens/color/variables.scss +1 -0
- package/dist/ThemeProvider-5r7lDX-h.js.map +0 -1
- package/dist/ThemeProvider-bkyFCeo6.mjs.map +0 -1
- package/dist/accordion-OsA0HvdA.js.map +0 -1
- package/dist/accordion-OtFSShSB.mjs.map +0 -1
- package/dist/checkbox-D6qWgpWR.mjs +0 -231
- package/dist/checkbox-D6qWgpWR.mjs.map +0 -1
- package/dist/checkbox-Dk3bZkZ3.js +0 -2
- package/dist/checkbox-Dk3bZkZ3.js.map +0 -1
- package/dist/comparison-table-B8w65g43.js +0 -2
- package/dist/comparison-table-B8w65g43.js.map +0 -1
- package/dist/comparison-table-D1zJpdLL.mjs.map +0 -1
- package/dist/dismissable-chip-group-Cd23yjBa.js +0 -2
- package/dist/dismissable-chip-group-Cd23yjBa.js.map +0 -1
- package/dist/dismissable-chip-group-D-gD93ON.mjs +0 -89
- package/dist/dismissable-chip-group-D-gD93ON.mjs.map +0 -1
- package/dist/drawer-Db2Mujc6.mjs +0 -565
- package/dist/drawer-Db2Mujc6.mjs.map +0 -1
- package/dist/drawer-DlwagnO4.js +0 -2
- package/dist/drawer-DlwagnO4.js.map +0 -1
- package/dist/dropdown-BsqVnd7z.js +0 -2
- package/dist/dropdown-BsqVnd7z.js.map +0 -1
- package/dist/dropdown-TO3Mh0bk.mjs +0 -910
- package/dist/dropdown-TO3Mh0bk.mjs.map +0 -1
- package/dist/listbox-COBHLRtB.js +0 -2
- package/dist/listbox-COBHLRtB.js.map +0 -1
- package/dist/listbox-DG4KmQP_.mjs +0 -66
- package/dist/listbox-DG4KmQP_.mjs.map +0 -1
- package/dist/paragraph-BsI53OR0.js +0 -2
- package/dist/quantity-selector-8AkKNDik.js +0 -2
- package/dist/toggle-C8IwTbX8.js +0 -2
- package/dist/toggle-D23x1wWk.mjs +0 -287
- package/dist/use-autocomplete.es-BHDgQLae.js +0 -2
- package/dist/use-autocomplete.es-BHDgQLae.js.map +0 -1
- package/dist/use-autocomplete.es-CVv3z8t6.mjs.map +0 -1
- package/dist/useColorScheme-0GMDl2GF.js +0 -2
- package/dist/variables-CKp4o9Tn.mjs.map +0 -1
- package/dist/variables-DH61hVNE.js +0 -2
- package/dist/variables-DH61hVNE.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const B=require("react/jsx-runtime"),a=require("react"),r=require("./variables-DH61hVNE.js"),k="#f4e0ff",x="#c461f7",f="#29003e",m="#ede1d8",N="#4f4741",y="#3b332d",P="#ffffff",E="#202022",O="rgba(255, 255, 255, 0.95)",b="rgba(255, 255, 255, 0.66)",A="rgba(255, 255, 255, 0.37)",H="rgba(0, 0, 0, 0.8)",M="rgba(0, 0, 0, 0.54)",W="rgba(0, 0, 0, 0.44)",D="#f4e0ff",h="#faf0ff",F="#ffffff",L="#4e0174",R="#ffffff",w="#6d02a3",Q="#4e0174",j="#29003e",q="#ffffff",$="#ffffff",z="#29003e",K="#ffffff",Z="#29003e",G="#ffffff",J="#ffffff",U="#d58df9",X="#d58df9",Y="#ffafc9",_="#980233",V="#fb4885",rr="#e4175c",er="#79d9a7",or="#02562b",tr="#1fa15e",ar="#f9bb5b",ur="#f39200",cr="#a86602",nr="#91cdf4",ir="#3694d3",lr="#ffffff",pr="#ffffff",vr="#4e0174",sr="#202022",gr="#29003e",dr="#f4e0ff",Br="#ffffff",Sr="#121212",Cr="#ffffff",Tr="#202022",Ir="#f5f5fa",kr="rgba(0, 0, 0, 0.71)",xr="rgba(255, 255, 255, 0.84)",fr="#03385b",mr="#f4e0ff",Nr="#e4b6fb",yr="#d58df9",Pr="#4e0174",Er="#6d02a3",Or="#8c07d0",br="#990ae3",Ar="#c461f7",Hr="#d58df9",Mr="#990ae3",Wr="#6d02a3",Dr="#4e0174",hr="rgba(255, 255, 255, 0.11)",Fr="rgba(0, 0, 0, 0.1)",Lr="#4e0174",Rr="#e4b6fb",wr="#6d02a3",Qr="#d58df9",jr="rgba(255, 255, 255, 0.16)",qr="rgba(0, 0, 0, 0.05)",$r="rgba(255, 255, 255, 0.07)",zr="rgba(0, 0, 0, 0.05)",Kr="#e4175c",Zr="#c00543",Gr="#980233",Jr="#03385b",Ur="#62b2e7",Xr="#003e1e",Yr="#3dbf7c",_r="#1fa15e",Vr="#700025",re="#ff80ab",ee="#fb4885",oe="#4c2f03",te="#f39200",ae="#f39200",ue="#353537",ce="#6d02a3",ne="#f4e0ff",ie="#ffffff",le="#f4e0ff",pe="#29003e",ve="#4f4741",se="#2d2824",ge="rgba(255, 255, 255, 0.29)",de="rgba(0, 0, 0, 0.33)",Be="rgba(255, 255, 255, 0.46)",Se="rgba(0, 0, 0, 0.54)",Ce="rgba(255, 255, 255, 0.16)",Te="rgba(0, 0, 0, 0.16)",Ie="#c461f7",ke="#f4e0ff",xe="#6d02a3",fe="#faf0ff",me="#ffffff",Ne="#4e0174",ye="#29003e",Pe="#990ae3",Ee="#d58df9",Oe="rgba(255, 255, 255, 0.37)",be="rgba(0, 0, 0, 0.44)",Ae="#e4b6fb",He="#6d02a3",Me="#fb4885",We="#e4175c",De="#f39200",he="#3694d3",Fe="#1fa15e",Le="#018842",Re={colorBrandDeepPurple:k,colorBrandCorePurple:x,colorBrandLightPurple:f,colorBrandDeepBeige:m,colorBrandBeige:N,colorBrandLightBeige:y,colorBrandOffBlack:P,colorBrandWhite:E,colorTextDefault:O,colorTextMedium:b,colorTextWeak:A,colorTextDefaultNegative:H,colorTextMediumNegative:M,colorTextWeakNegative:W,colorTextInteractivePrimary:D,colorTextInteractivePrimaryHover:h,colorTextInteractivePrimaryActive:F,colorTextInteractiveOnPrimary:L,colorTextInteractiveOnExpressive:q,colorTextInteractiveOnExpressiveHover:z,colorTextInteractiveOnExpressiveActive:Z,colorTextInteractiveOnDestructive:J,colorTextInteractiveSelected:U,colorTextInteractivePrimaryNegative:w,colorTextInteractivePrimaryHoverNegative:Q,colorTextInteractivePrimaryActiveNegative:j,colorTextInteractiveOnPrimaryNegative:R,colorTextInteractiveOnExpressiveNegative:$,colorTextInteractiveOnExpressiveHoverNegative:K,colorTextInteractiveOnExpressiveActiveNegative:G,colorTextStatusInfoMedium:ir,colorTextStatusInfoStrong:nr,colorTextStatusSuccessMedium:tr,colorTextStatusSuccessStrong:er,colorTextStatusWarningMedium:ur,colorTextStatusWarningStrong:ar,colorTextStatusErrorMedium:V,colorTextStatusErrorStrong:Y,colorTextStatusNeutral:lr,colorTextStatusSpecial:pr,colorTextStatusAttention:vr,colorTextStatusDiscount:X,colorTextStatusBlackFriday:sr,colorTextStatusSuccessStrongNegative:or,colorTextStatusErrorMediumNegative:rr,colorTextStatusErrorStrongNegative:_,colorTextStatusWarningMediumNegative:cr,colorTextToneOnTonePrimary:gr,colorTextToneOnToneSecondary:dr,colorTextToneOnToneTertiary:Br,colorBackgroundPrimary:Sr,colorBackgroundSecondary:Tr,colorBackgroundOnImage:kr,colorBackgroundPrimaryNegative:Cr,colorBackgroundSecondaryNegative:Ir,colorBackgroundOnImageNegative:xr,colorBackgroundInteractivePrimary:mr,colorBackgroundInteractivePrimaryHover:Nr,colorBackgroundInteractivePrimaryActive:yr,colorBackgroundInteractiveExpressive:br,colorBackgroundInteractiveExpressiveHover:Ar,colorBackgroundInteractiveExpressiveActive:Hr,colorBackgroundInteractiveTransparentHover:Lr,colorBackgroundInteractiveTransparentActive:wr,colorBackgroundInteractiveDisabled:hr,colorBackgroundInteractiveReadOnly:$r,colorBackgroundInteractiveInactive:jr,colorBackgroundInteractiveDestructive:Kr,colorBackgroundInteractiveDestructiveHover:Zr,colorBackgroundInteractiveDestructiveActive:Gr,colorBackgroundInteractiveAutoFill:fr,colorBackgroundInteractivePrimaryNegative:Pr,colorBackgroundInteractivePrimaryHoverNegative:Er,colorBackgroundInteractivePrimaryActiveNegative:Or,colorBackgroundInteractiveExpressiveNegative:Mr,colorBackgroundInteractiveExpressiveHoverNegative:Wr,colorBackgroundInteractiveExpressiveActiveNegative:Dr,colorBackgroundInteractiveTransparentHoverNegative:Rr,colorBackgroundInteractiveTransparentActiveNegative:Qr,colorBackgroundInteractiveDisabledNegative:Fr,colorBackgroundInteractiveInactiveNegative:qr,colorBackgroundInteractiveReadOnlyNegative:zr,colorBackgroundStatusInfoMedium:Jr,colorBackgroundStatusInfoStrong:Ur,colorBackgroundStatusSuccessMedium:Xr,colorBackgroundStatusSuccessStrong:Yr,colorBackgroundStatusWarningMedium:oe,colorBackgroundStatusWarningStrong:te,colorBackgroundStatusErrorMedium:Vr,colorBackgroundStatusErrorStrong:re,colorBackgroundStatusNeutral:ue,colorBackgroundStatusSpecial:ce,colorBackgroundStatusAttention:ne,colorBackgroundStatusBlackFriday:ie,colorBackgroundStatusSuccessStrongNegative:_r,colorBackgroundStatusWarningStrongNegative:ae,colorBackgroundStatusErrorStrongNegative:ee,colorBackgroundToneOnTonePrimary:le,colorBackgroundToneOnToneSecondary:pe,colorBackgroundToneOnToneTertiary:ve,colorBackgroundToneOnToneQuaternary:se,colorBorderWeak:Ce,colorBorderMedium:ge,colorBorderStrong:Be,colorBorderWeakNegative:Te,colorBorderMediumNegative:de,colorBorderStrongNegative:Se,colorBorderInteractivePrimary:ke,colorBorderInteractivePrimaryHover:fe,colorBorderInteractivePrimaryActive:me,colorBorderInteractiveFocus:Ie,colorBorderInteractiveExpressive:Pe,colorBorderInteractiveSubtle:Oe,colorBorderInteractiveSubtleHover:Ae,colorBorderInteractiveSelected:Ee,colorBorderInteractivePrimaryNegative:xe,colorBorderInteractivePrimaryHoverNegative:Ne,colorBorderInteractivePrimaryActiveNegative:ye,colorBorderInteractiveSubtleNegative:be,colorBorderInteractiveSubtleHoverNegative:He,colorBorderStatusError:Me,colorBorderStatusWarning:De,colorBorderStatusInfo:he,colorBorderStatusSuccess:Fe,colorBorderStatusErrorNegative:We,colorBorderStatusSuccessNegative:Le},we={colorBrandDeepPurple:r.purpurColorBrandDeepPurple,colorBrandCorePurple:r.purpurColorBrandCorePurple,colorBrandLightPurple:r.purpurColorBrandLightPurple,colorBrandDeepBeige:r.purpurColorBrandDeepBeige,colorBrandBeige:r.purpurColorBrandBeige,colorBrandLightBeige:r.purpurColorBrandLightBeige,colorBrandOffBlack:r.purpurColorBrandOffBlack,colorBrandWhite:r.purpurColorBrandWhite,colorTextDefault:r.purpurColorTextDefault,colorTextMedium:r.purpurColorTextMedium,colorTextWeak:r.purpurColorTextWeak,colorTextDefaultNegative:r.purpurColorTextDefaultNegative,colorTextMediumNegative:r.purpurColorTextMediumNegative,colorTextWeakNegative:r.purpurColorTextWeakNegative,colorTextInteractivePrimary:r.purpurColorTextInteractivePrimary,colorTextInteractivePrimaryHover:r.purpurColorTextInteractivePrimaryHover,colorTextInteractivePrimaryActive:r.purpurColorTextInteractivePrimaryActive,colorTextInteractiveOnPrimary:r.purpurColorTextInteractiveOnPrimary,colorTextInteractiveOnExpressive:r.purpurColorTextInteractiveOnExpressive,colorTextInteractiveOnExpressiveHover:r.purpurColorTextInteractiveOnExpressiveHover,colorTextInteractiveOnExpressiveActive:r.purpurColorTextInteractiveOnExpressiveActive,colorTextInteractiveOnDestructive:r.purpurColorTextInteractiveOnDestructive,colorTextInteractiveSelected:r.purpurColorTextInteractiveSelected,colorTextInteractivePrimaryNegative:r.purpurColorTextInteractivePrimaryNegative,colorTextInteractivePrimaryHoverNegative:r.purpurColorTextInteractivePrimaryHoverNegative,colorTextInteractivePrimaryActiveNegative:r.purpurColorTextInteractivePrimaryActiveNegative,colorTextInteractiveOnPrimaryNegative:r.purpurColorTextInteractiveOnPrimaryNegative,colorTextInteractiveOnExpressiveNegative:r.purpurColorTextInteractiveOnExpressiveNegative,colorTextInteractiveOnExpressiveHoverNegative:r.purpurColorTextInteractiveOnExpressiveHoverNegative,colorTextInteractiveOnExpressiveActiveNegative:r.purpurColorTextInteractiveOnExpressiveActiveNegative,colorTextStatusInfoMedium:r.purpurColorTextStatusInfoMedium,colorTextStatusInfoStrong:r.purpurColorTextStatusInfoStrong,colorTextStatusSuccessMedium:r.purpurColorTextStatusSuccessMedium,colorTextStatusSuccessStrong:r.purpurColorTextStatusSuccessStrong,colorTextStatusWarningMedium:r.purpurColorTextStatusWarningMedium,colorTextStatusWarningStrong:r.purpurColorTextStatusWarningStrong,colorTextStatusErrorMedium:r.purpurColorTextStatusErrorMedium,colorTextStatusErrorStrong:r.purpurColorTextStatusErrorStrong,colorTextStatusNeutral:r.purpurColorTextStatusNeutral,colorTextStatusSpecial:r.purpurColorTextStatusSpecial,colorTextStatusAttention:r.purpurColorTextStatusAttention,colorTextStatusDiscount:r.purpurColorTextStatusDiscount,colorTextStatusBlackFriday:r.purpurColorTextStatusBlackFriday,colorTextStatusSuccessStrongNegative:r.purpurColorTextStatusSuccessStrongNegative,colorTextStatusErrorMediumNegative:r.purpurColorTextStatusErrorMediumNegative,colorTextStatusErrorStrongNegative:r.purpurColorTextStatusErrorStrongNegative,colorTextStatusWarningMediumNegative:r.purpurColorTextStatusWarningMediumNegative,colorTextToneOnTonePrimary:r.purpurColorTextToneOnTonePrimary,colorTextToneOnToneSecondary:r.purpurColorTextToneOnToneSecondary,colorTextToneOnToneTertiary:r.purpurColorTextToneOnToneTertiary,colorBackgroundPrimary:r.purpurColorBackgroundPrimary,colorBackgroundSecondary:r.purpurColorBackgroundSecondary,colorBackgroundOnImage:r.purpurColorBackgroundOnImage,colorBackgroundPrimaryNegative:r.purpurColorBackgroundPrimaryNegative,colorBackgroundSecondaryNegative:r.purpurColorBackgroundSecondaryNegative,colorBackgroundOnImageNegative:r.purpurColorBackgroundOnImageNegative,colorBackgroundInteractivePrimary:r.purpurColorBackgroundInteractivePrimary,colorBackgroundInteractivePrimaryHover:r.purpurColorBackgroundInteractivePrimaryHover,colorBackgroundInteractivePrimaryActive:r.purpurColorBackgroundInteractivePrimaryActive,colorBackgroundInteractiveExpressive:r.purpurColorBackgroundInteractiveExpressive,colorBackgroundInteractiveExpressiveHover:r.purpurColorBackgroundInteractiveExpressiveHover,colorBackgroundInteractiveExpressiveActive:r.purpurColorBackgroundInteractiveExpressiveActive,colorBackgroundInteractiveTransparentHover:r.purpurColorBackgroundInteractiveTransparentHover,colorBackgroundInteractiveTransparentActive:r.purpurColorBackgroundInteractiveTransparentActive,colorBackgroundInteractiveDisabled:r.purpurColorBackgroundInteractiveDisabled,colorBackgroundInteractiveReadOnly:r.purpurColorBackgroundInteractiveReadOnly,colorBackgroundInteractiveInactive:r.purpurColorBackgroundInteractiveInactive,colorBackgroundInteractiveDestructive:r.purpurColorBackgroundInteractiveDestructive,colorBackgroundInteractiveDestructiveHover:r.purpurColorBackgroundInteractiveDestructiveHover,colorBackgroundInteractiveDestructiveActive:r.purpurColorBackgroundInteractiveDestructiveActive,colorBackgroundInteractiveAutoFill:r.purpurColorBackgroundInteractiveAutoFill,colorBackgroundInteractivePrimaryNegative:r.purpurColorBackgroundInteractivePrimaryNegative,colorBackgroundInteractivePrimaryHoverNegative:r.purpurColorBackgroundInteractivePrimaryHoverNegative,colorBackgroundInteractivePrimaryActiveNegative:r.purpurColorBackgroundInteractivePrimaryActiveNegative,colorBackgroundInteractiveExpressiveNegative:r.purpurColorBackgroundInteractiveExpressiveNegative,colorBackgroundInteractiveExpressiveHoverNegative:r.purpurColorBackgroundInteractiveExpressiveHoverNegative,colorBackgroundInteractiveExpressiveActiveNegative:r.purpurColorBackgroundInteractiveExpressiveActiveNegative,colorBackgroundInteractiveTransparentHoverNegative:r.purpurColorBackgroundInteractiveTransparentHoverNegative,colorBackgroundInteractiveTransparentActiveNegative:r.purpurColorBackgroundInteractiveTransparentActiveNegative,colorBackgroundInteractiveDisabledNegative:r.purpurColorBackgroundInteractiveDisabledNegative,colorBackgroundInteractiveInactiveNegative:r.purpurColorBackgroundInteractiveInactiveNegative,colorBackgroundInteractiveReadOnlyNegative:r.purpurColorBackgroundInteractiveReadOnlyNegative,colorBackgroundStatusInfoMedium:r.purpurColorBackgroundStatusInfoMedium,colorBackgroundStatusInfoStrong:r.purpurColorBackgroundStatusInfoStrong,colorBackgroundStatusSuccessMedium:r.purpurColorBackgroundStatusSuccessMedium,colorBackgroundStatusSuccessStrong:r.purpurColorBackgroundStatusSuccessStrong,colorBackgroundStatusWarningMedium:r.purpurColorBackgroundStatusWarningMedium,colorBackgroundStatusWarningStrong:r.purpurColorBackgroundStatusWarningStrong,colorBackgroundStatusErrorMedium:r.purpurColorBackgroundStatusErrorMedium,colorBackgroundStatusErrorStrong:r.purpurColorBackgroundStatusErrorStrong,colorBackgroundStatusNeutral:r.purpurColorBackgroundStatusNeutral,colorBackgroundStatusSpecial:r.purpurColorBackgroundStatusSpecial,colorBackgroundStatusAttention:r.purpurColorBackgroundStatusAttention,colorBackgroundStatusBlackFriday:r.purpurColorBackgroundStatusBlackFriday,colorBackgroundStatusSuccessStrongNegative:r.purpurColorBackgroundStatusSuccessStrongNegative,colorBackgroundStatusWarningStrongNegative:r.purpurColorBackgroundStatusWarningStrongNegative,colorBackgroundStatusErrorStrongNegative:r.purpurColorBackgroundStatusErrorStrongNegative,colorBackgroundToneOnTonePrimary:r.purpurColorBackgroundToneOnTonePrimary,colorBackgroundToneOnToneSecondary:r.purpurColorBackgroundToneOnToneSecondary,colorBackgroundToneOnToneTertiary:r.purpurColorBackgroundToneOnToneTertiary,colorBackgroundToneOnToneQuaternary:r.purpurColorBackgroundToneOnToneQuaternary,colorBorderWeak:r.purpurColorBorderWeak,colorBorderMedium:r.purpurColorBorderMedium,colorBorderStrong:r.purpurColorBorderStrong,colorBorderWeakNegative:r.purpurColorBorderWeakNegative,colorBorderMediumNegative:r.purpurColorBorderMediumNegative,colorBorderStrongNegative:r.purpurColorBorderStrongNegative,colorBorderInteractivePrimary:r.purpurColorBorderInteractivePrimary,colorBorderInteractivePrimaryHover:r.purpurColorBorderInteractivePrimaryHover,colorBorderInteractivePrimaryActive:r.purpurColorBorderInteractivePrimaryActive,colorBorderInteractiveFocus:r.purpurColorBorderInteractiveFocus,colorBorderInteractiveExpressive:r.purpurColorBorderInteractiveExpressive,colorBorderInteractiveSubtle:r.purpurColorBorderInteractiveSubtle,colorBorderInteractiveSubtleHover:r.purpurColorBorderInteractiveSubtleHover,colorBorderInteractiveSelected:r.purpurColorBorderInteractiveSelected,colorBorderInteractivePrimaryNegative:r.purpurColorBorderInteractivePrimaryNegative,colorBorderInteractivePrimaryHoverNegative:r.purpurColorBorderInteractivePrimaryHoverNegative,colorBorderInteractivePrimaryActiveNegative:r.purpurColorBorderInteractivePrimaryActiveNegative,colorBorderInteractiveSubtleNegative:r.purpurColorBorderInteractiveSubtleNegative,colorBorderInteractiveSubtleHoverNegative:r.purpurColorBorderInteractiveSubtleHoverNegative,colorBorderStatusError:r.purpurColorBorderStatusError,colorBorderStatusWarning:r.purpurColorBorderStatusWarning,colorBorderStatusInfo:r.purpurColorBorderStatusInfo,colorBorderStatusSuccess:r.purpurColorBorderStatusSuccess,colorBorderStatusErrorNegative:r.purpurColorBorderStatusErrorNegative,colorBorderStatusSuccessNegative:r.purpurColorBorderStatusSuccessNegative},s={light:we,dark:Re},Qe=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),S=({theme:o=s,cssVariablesSelector:e,currentColorScheme:u})=>{a.useEffect(()=>{u&&Object.entries(o?.[u]??s[u]).forEach(([i,l])=>{((e?document.querySelector(e):null)??document.documentElement).style.setProperty(`--purpur-${Qe(i)}`,l)})},[o,e,u])},C=a.createContext({colorScheme:"light",currentColorScheme:"light",setColorScheme:()=>{},options:{}}),je=({cssVariablesSelector:o,forceColorScheme:e,theme:u,children:i,options:l={},...g})=>{const[c,p]=a.useState(e??"auto"),[n,v]=a.useState(e??"light");a.useEffect(()=>{if(e)p(e);else{const t=localStorage.getItem("colorScheme");t&&p(t)}},[e]),a.useEffect(()=>{const t=window.matchMedia("(prefers-color-scheme: dark)");v(c==="auto"?t.matches?"dark":"light":c);const d=I=>{!e&&c==="auto"&&v(I.matches?"dark":"light")};return t.addEventListener("change",d),()=>{t.removeEventListener("change",d)}},[c,e]),S({theme:u,cssVariablesSelector:o,currentColorScheme:u!==void 0?n:void 0});const T=a.useMemo(()=>({colorScheme:c,currentColorScheme:n,setColorScheme:t=>{e||(p(t),localStorage.setItem("colorScheme",t))}}),[c,n,e]);return B.jsx(C.Provider,{value:{...T,options:l},children:B.jsx("div",{"data-color-scheme":n,className:n,...g,children:i})})},qe=()=>{const o=a.useContext(C);if(!o)throw new Error("useTheme must be used within a ThemeProvider");return o};exports.ThemeProvider=je;exports.teliaTheme=s;exports.useApplyTheme=S;exports.useTheme=qe;
|
|
2
|
-
//# sourceMappingURL=ThemeProvider-
|
|
1
|
+
"use strict";const B=require("react/jsx-runtime"),a=require("react"),r=require("./variables-DoI78zZc.js"),k="#f4e0ff",x="#c461f7",f="#29003e",m="#ede1d8",N="#4f4741",y="#3b332d",P="#ffffff",E="#202022",O="rgba(255, 255, 255, 0.95)",b="rgba(255, 255, 255, 0.66)",A="rgba(255, 255, 255, 0.37)",H="rgba(0, 0, 0, 0.8)",M="rgba(0, 0, 0, 0.54)",W="rgba(0, 0, 0, 0.44)",D="#f4e0ff",h="#faf0ff",F="#ffffff",L="#4e0174",R="#ffffff",w="#6d02a3",Q="#4e0174",j="#29003e",q="#ffffff",$="#ffffff",z="#29003e",K="#ffffff",Z="#29003e",G="#ffffff",J="#ffffff",U="#d58df9",X="#d58df9",Y="#ffafc9",_="#980233",V="#fb4885",rr="#e4175c",er="#79d9a7",or="#02562b",tr="#1fa15e",ar="#f9bb5b",ur="#f39200",cr="#a86602",nr="#91cdf4",ir="#3694d3",lr="#ffffff",pr="#ffffff",vr="#4e0174",sr="#202022",gr="#29003e",dr="#f4e0ff",Br="#ffffff",Sr="#121212",Cr="#ffffff",Tr="#202022",Ir="#f5f5fa",kr="rgba(0, 0, 0, 0.71)",xr="rgba(255, 255, 255, 0.84)",fr="#03385b",mr="#f4e0ff",Nr="#e4b6fb",yr="#d58df9",Pr="#4e0174",Er="#6d02a3",Or="#8c07d0",br="#990ae3",Ar="#c461f7",Hr="#d58df9",Mr="#990ae3",Wr="#6d02a3",Dr="#4e0174",hr="rgba(255, 255, 255, 0.11)",Fr="rgba(0, 0, 0, 0.1)",Lr="#4e0174",Rr="#e4b6fb",wr="#6d02a3",Qr="#d58df9",jr="rgba(255, 255, 255, 0.16)",qr="rgba(0, 0, 0, 0.05)",$r="rgba(255, 255, 255, 0.07)",zr="rgba(0, 0, 0, 0.05)",Kr="#e4175c",Zr="#c00543",Gr="#980233",Jr="#03385b",Ur="#62b2e7",Xr="#003e1e",Yr="#3dbf7c",_r="#1fa15e",Vr="#700025",re="#ff80ab",ee="#fb4885",oe="#4c2f03",te="#f39200",ae="#f39200",ue="#353537",ce="#6d02a3",ne="#f4e0ff",ie="#ffffff",le="#f4e0ff",pe="#29003e",ve="#4f4741",se="#2d2824",ge="rgba(255, 255, 255, 0.29)",de="rgba(0, 0, 0, 0.33)",Be="rgba(255, 255, 255, 0.46)",Se="rgba(0, 0, 0, 0.54)",Ce="rgba(255, 255, 255, 0.16)",Te="rgba(0, 0, 0, 0.16)",Ie="#c461f7",ke="#f4e0ff",xe="#6d02a3",fe="#faf0ff",me="#ffffff",Ne="#4e0174",ye="#29003e",Pe="#990ae3",Ee="#d58df9",Oe="rgba(255, 255, 255, 0.37)",be="rgba(0, 0, 0, 0.44)",Ae="#e4b6fb",He="#6d02a3",Me="#fb4885",We="#e4175c",De="#f39200",he="#3694d3",Fe="#1fa15e",Le="#018842",Re={colorBrandDeepPurple:k,colorBrandCorePurple:x,colorBrandLightPurple:f,colorBrandDeepBeige:m,colorBrandBeige:N,colorBrandLightBeige:y,colorBrandOffBlack:P,colorBrandWhite:E,colorTextDefault:O,colorTextMedium:b,colorTextWeak:A,colorTextDefaultNegative:H,colorTextMediumNegative:M,colorTextWeakNegative:W,colorTextInteractivePrimary:D,colorTextInteractivePrimaryHover:h,colorTextInteractivePrimaryActive:F,colorTextInteractiveOnPrimary:L,colorTextInteractiveOnExpressive:q,colorTextInteractiveOnExpressiveHover:z,colorTextInteractiveOnExpressiveActive:Z,colorTextInteractiveOnDestructive:J,colorTextInteractiveSelected:U,colorTextInteractivePrimaryNegative:w,colorTextInteractivePrimaryHoverNegative:Q,colorTextInteractivePrimaryActiveNegative:j,colorTextInteractiveOnPrimaryNegative:R,colorTextInteractiveOnExpressiveNegative:$,colorTextInteractiveOnExpressiveHoverNegative:K,colorTextInteractiveOnExpressiveActiveNegative:G,colorTextStatusInfoMedium:ir,colorTextStatusInfoStrong:nr,colorTextStatusSuccessMedium:tr,colorTextStatusSuccessStrong:er,colorTextStatusWarningMedium:ur,colorTextStatusWarningStrong:ar,colorTextStatusErrorMedium:V,colorTextStatusErrorStrong:Y,colorTextStatusNeutral:lr,colorTextStatusSpecial:pr,colorTextStatusAttention:vr,colorTextStatusDiscount:X,colorTextStatusBlackFriday:sr,colorTextStatusSuccessStrongNegative:or,colorTextStatusErrorMediumNegative:rr,colorTextStatusErrorStrongNegative:_,colorTextStatusWarningMediumNegative:cr,colorTextToneOnTonePrimary:gr,colorTextToneOnToneSecondary:dr,colorTextToneOnToneTertiary:Br,colorBackgroundPrimary:Sr,colorBackgroundSecondary:Tr,colorBackgroundOnImage:kr,colorBackgroundPrimaryNegative:Cr,colorBackgroundSecondaryNegative:Ir,colorBackgroundOnImageNegative:xr,colorBackgroundInteractivePrimary:mr,colorBackgroundInteractivePrimaryHover:Nr,colorBackgroundInteractivePrimaryActive:yr,colorBackgroundInteractiveExpressive:br,colorBackgroundInteractiveExpressiveHover:Ar,colorBackgroundInteractiveExpressiveActive:Hr,colorBackgroundInteractiveTransparentHover:Lr,colorBackgroundInteractiveTransparentActive:wr,colorBackgroundInteractiveDisabled:hr,colorBackgroundInteractiveReadOnly:$r,colorBackgroundInteractiveInactive:jr,colorBackgroundInteractiveDestructive:Kr,colorBackgroundInteractiveDestructiveHover:Zr,colorBackgroundInteractiveDestructiveActive:Gr,colorBackgroundInteractiveAutoFill:fr,colorBackgroundInteractivePrimaryNegative:Pr,colorBackgroundInteractivePrimaryHoverNegative:Er,colorBackgroundInteractivePrimaryActiveNegative:Or,colorBackgroundInteractiveExpressiveNegative:Mr,colorBackgroundInteractiveExpressiveHoverNegative:Wr,colorBackgroundInteractiveExpressiveActiveNegative:Dr,colorBackgroundInteractiveTransparentHoverNegative:Rr,colorBackgroundInteractiveTransparentActiveNegative:Qr,colorBackgroundInteractiveDisabledNegative:Fr,colorBackgroundInteractiveInactiveNegative:qr,colorBackgroundInteractiveReadOnlyNegative:zr,colorBackgroundStatusInfoMedium:Jr,colorBackgroundStatusInfoStrong:Ur,colorBackgroundStatusSuccessMedium:Xr,colorBackgroundStatusSuccessStrong:Yr,colorBackgroundStatusWarningMedium:oe,colorBackgroundStatusWarningStrong:te,colorBackgroundStatusErrorMedium:Vr,colorBackgroundStatusErrorStrong:re,colorBackgroundStatusNeutral:ue,colorBackgroundStatusSpecial:ce,colorBackgroundStatusAttention:ne,colorBackgroundStatusBlackFriday:ie,colorBackgroundStatusSuccessStrongNegative:_r,colorBackgroundStatusWarningStrongNegative:ae,colorBackgroundStatusErrorStrongNegative:ee,colorBackgroundToneOnTonePrimary:le,colorBackgroundToneOnToneSecondary:pe,colorBackgroundToneOnToneTertiary:ve,colorBackgroundToneOnToneQuaternary:se,colorBorderWeak:Ce,colorBorderMedium:ge,colorBorderStrong:Be,colorBorderWeakNegative:Te,colorBorderMediumNegative:de,colorBorderStrongNegative:Se,colorBorderInteractivePrimary:ke,colorBorderInteractivePrimaryHover:fe,colorBorderInteractivePrimaryActive:me,colorBorderInteractiveFocus:Ie,colorBorderInteractiveExpressive:Pe,colorBorderInteractiveSubtle:Oe,colorBorderInteractiveSubtleHover:Ae,colorBorderInteractiveSelected:Ee,colorBorderInteractivePrimaryNegative:xe,colorBorderInteractivePrimaryHoverNegative:Ne,colorBorderInteractivePrimaryActiveNegative:ye,colorBorderInteractiveSubtleNegative:be,colorBorderInteractiveSubtleHoverNegative:He,colorBorderStatusError:Me,colorBorderStatusWarning:De,colorBorderStatusInfo:he,colorBorderStatusSuccess:Fe,colorBorderStatusErrorNegative:We,colorBorderStatusSuccessNegative:Le},we={colorBrandDeepPurple:r.purpurColorBrandDeepPurple,colorBrandCorePurple:r.purpurColorBrandCorePurple,colorBrandLightPurple:r.purpurColorBrandLightPurple,colorBrandDeepBeige:r.purpurColorBrandDeepBeige,colorBrandBeige:r.purpurColorBrandBeige,colorBrandLightBeige:r.purpurColorBrandLightBeige,colorBrandOffBlack:r.purpurColorBrandOffBlack,colorBrandWhite:r.purpurColorBrandWhite,colorTextDefault:r.purpurColorTextDefault,colorTextMedium:r.purpurColorTextMedium,colorTextWeak:r.purpurColorTextWeak,colorTextDefaultNegative:r.purpurColorTextDefaultNegative,colorTextMediumNegative:r.purpurColorTextMediumNegative,colorTextWeakNegative:r.purpurColorTextWeakNegative,colorTextInteractivePrimary:r.purpurColorTextInteractivePrimary,colorTextInteractivePrimaryHover:r.purpurColorTextInteractivePrimaryHover,colorTextInteractivePrimaryActive:r.purpurColorTextInteractivePrimaryActive,colorTextInteractiveOnPrimary:r.purpurColorTextInteractiveOnPrimary,colorTextInteractiveOnExpressive:r.purpurColorTextInteractiveOnExpressive,colorTextInteractiveOnExpressiveHover:r.purpurColorTextInteractiveOnExpressiveHover,colorTextInteractiveOnExpressiveActive:r.purpurColorTextInteractiveOnExpressiveActive,colorTextInteractiveOnDestructive:r.purpurColorTextInteractiveOnDestructive,colorTextInteractiveSelected:r.purpurColorTextInteractiveSelected,colorTextInteractivePrimaryNegative:r.purpurColorTextInteractivePrimaryNegative,colorTextInteractivePrimaryHoverNegative:r.purpurColorTextInteractivePrimaryHoverNegative,colorTextInteractivePrimaryActiveNegative:r.purpurColorTextInteractivePrimaryActiveNegative,colorTextInteractiveOnPrimaryNegative:r.purpurColorTextInteractiveOnPrimaryNegative,colorTextInteractiveOnExpressiveNegative:r.purpurColorTextInteractiveOnExpressiveNegative,colorTextInteractiveOnExpressiveHoverNegative:r.purpurColorTextInteractiveOnExpressiveHoverNegative,colorTextInteractiveOnExpressiveActiveNegative:r.purpurColorTextInteractiveOnExpressiveActiveNegative,colorTextStatusInfoMedium:r.purpurColorTextStatusInfoMedium,colorTextStatusInfoStrong:r.purpurColorTextStatusInfoStrong,colorTextStatusSuccessMedium:r.purpurColorTextStatusSuccessMedium,colorTextStatusSuccessStrong:r.purpurColorTextStatusSuccessStrong,colorTextStatusWarningMedium:r.purpurColorTextStatusWarningMedium,colorTextStatusWarningStrong:r.purpurColorTextStatusWarningStrong,colorTextStatusErrorMedium:r.purpurColorTextStatusErrorMedium,colorTextStatusErrorStrong:r.purpurColorTextStatusErrorStrong,colorTextStatusNeutral:r.purpurColorTextStatusNeutral,colorTextStatusSpecial:r.purpurColorTextStatusSpecial,colorTextStatusAttention:r.purpurColorTextStatusAttention,colorTextStatusDiscount:r.purpurColorTextStatusDiscount,colorTextStatusBlackFriday:r.purpurColorTextStatusBlackFriday,colorTextStatusSuccessStrongNegative:r.purpurColorTextStatusSuccessStrongNegative,colorTextStatusErrorMediumNegative:r.purpurColorTextStatusErrorMediumNegative,colorTextStatusErrorStrongNegative:r.purpurColorTextStatusErrorStrongNegative,colorTextStatusWarningMediumNegative:r.purpurColorTextStatusWarningMediumNegative,colorTextToneOnTonePrimary:r.purpurColorTextToneOnTonePrimary,colorTextToneOnToneSecondary:r.purpurColorTextToneOnToneSecondary,colorTextToneOnToneTertiary:r.purpurColorTextToneOnToneTertiary,colorBackgroundPrimary:r.purpurColorBackgroundPrimary,colorBackgroundSecondary:r.purpurColorBackgroundSecondary,colorBackgroundOnImage:r.purpurColorBackgroundOnImage,colorBackgroundPrimaryNegative:r.purpurColorBackgroundPrimaryNegative,colorBackgroundSecondaryNegative:r.purpurColorBackgroundSecondaryNegative,colorBackgroundOnImageNegative:r.purpurColorBackgroundOnImageNegative,colorBackgroundInteractivePrimary:r.purpurColorBackgroundInteractivePrimary,colorBackgroundInteractivePrimaryHover:r.purpurColorBackgroundInteractivePrimaryHover,colorBackgroundInteractivePrimaryActive:r.purpurColorBackgroundInteractivePrimaryActive,colorBackgroundInteractiveExpressive:r.purpurColorBackgroundInteractiveExpressive,colorBackgroundInteractiveExpressiveHover:r.purpurColorBackgroundInteractiveExpressiveHover,colorBackgroundInteractiveExpressiveActive:r.purpurColorBackgroundInteractiveExpressiveActive,colorBackgroundInteractiveTransparentHover:r.purpurColorBackgroundInteractiveTransparentHover,colorBackgroundInteractiveTransparentActive:r.purpurColorBackgroundInteractiveTransparentActive,colorBackgroundInteractiveDisabled:r.purpurColorBackgroundInteractiveDisabled,colorBackgroundInteractiveReadOnly:r.purpurColorBackgroundInteractiveReadOnly,colorBackgroundInteractiveInactive:r.purpurColorBackgroundInteractiveInactive,colorBackgroundInteractiveDestructive:r.purpurColorBackgroundInteractiveDestructive,colorBackgroundInteractiveDestructiveHover:r.purpurColorBackgroundInteractiveDestructiveHover,colorBackgroundInteractiveDestructiveActive:r.purpurColorBackgroundInteractiveDestructiveActive,colorBackgroundInteractiveAutoFill:r.purpurColorBackgroundInteractiveAutoFill,colorBackgroundInteractivePrimaryNegative:r.purpurColorBackgroundInteractivePrimaryNegative,colorBackgroundInteractivePrimaryHoverNegative:r.purpurColorBackgroundInteractivePrimaryHoverNegative,colorBackgroundInteractivePrimaryActiveNegative:r.purpurColorBackgroundInteractivePrimaryActiveNegative,colorBackgroundInteractiveExpressiveNegative:r.purpurColorBackgroundInteractiveExpressiveNegative,colorBackgroundInteractiveExpressiveHoverNegative:r.purpurColorBackgroundInteractiveExpressiveHoverNegative,colorBackgroundInteractiveExpressiveActiveNegative:r.purpurColorBackgroundInteractiveExpressiveActiveNegative,colorBackgroundInteractiveTransparentHoverNegative:r.purpurColorBackgroundInteractiveTransparentHoverNegative,colorBackgroundInteractiveTransparentActiveNegative:r.purpurColorBackgroundInteractiveTransparentActiveNegative,colorBackgroundInteractiveDisabledNegative:r.purpurColorBackgroundInteractiveDisabledNegative,colorBackgroundInteractiveInactiveNegative:r.purpurColorBackgroundInteractiveInactiveNegative,colorBackgroundInteractiveReadOnlyNegative:r.purpurColorBackgroundInteractiveReadOnlyNegative,colorBackgroundStatusInfoMedium:r.purpurColorBackgroundStatusInfoMedium,colorBackgroundStatusInfoStrong:r.purpurColorBackgroundStatusInfoStrong,colorBackgroundStatusSuccessMedium:r.purpurColorBackgroundStatusSuccessMedium,colorBackgroundStatusSuccessStrong:r.purpurColorBackgroundStatusSuccessStrong,colorBackgroundStatusWarningMedium:r.purpurColorBackgroundStatusWarningMedium,colorBackgroundStatusWarningStrong:r.purpurColorBackgroundStatusWarningStrong,colorBackgroundStatusErrorMedium:r.purpurColorBackgroundStatusErrorMedium,colorBackgroundStatusErrorStrong:r.purpurColorBackgroundStatusErrorStrong,colorBackgroundStatusNeutral:r.purpurColorBackgroundStatusNeutral,colorBackgroundStatusSpecial:r.purpurColorBackgroundStatusSpecial,colorBackgroundStatusAttention:r.purpurColorBackgroundStatusAttention,colorBackgroundStatusBlackFriday:r.purpurColorBackgroundStatusBlackFriday,colorBackgroundStatusSuccessStrongNegative:r.purpurColorBackgroundStatusSuccessStrongNegative,colorBackgroundStatusWarningStrongNegative:r.purpurColorBackgroundStatusWarningStrongNegative,colorBackgroundStatusErrorStrongNegative:r.purpurColorBackgroundStatusErrorStrongNegative,colorBackgroundToneOnTonePrimary:r.purpurColorBackgroundToneOnTonePrimary,colorBackgroundToneOnToneSecondary:r.purpurColorBackgroundToneOnToneSecondary,colorBackgroundToneOnToneTertiary:r.purpurColorBackgroundToneOnToneTertiary,colorBackgroundToneOnToneQuaternary:r.purpurColorBackgroundToneOnToneQuaternary,colorBorderWeak:r.purpurColorBorderWeak,colorBorderMedium:r.purpurColorBorderMedium,colorBorderStrong:r.purpurColorBorderStrong,colorBorderWeakNegative:r.purpurColorBorderWeakNegative,colorBorderMediumNegative:r.purpurColorBorderMediumNegative,colorBorderStrongNegative:r.purpurColorBorderStrongNegative,colorBorderInteractivePrimary:r.purpurColorBorderInteractivePrimary,colorBorderInteractivePrimaryHover:r.purpurColorBorderInteractivePrimaryHover,colorBorderInteractivePrimaryActive:r.purpurColorBorderInteractivePrimaryActive,colorBorderInteractiveFocus:r.purpurColorBorderInteractiveFocus,colorBorderInteractiveExpressive:r.purpurColorBorderInteractiveExpressive,colorBorderInteractiveSubtle:r.purpurColorBorderInteractiveSubtle,colorBorderInteractiveSubtleHover:r.purpurColorBorderInteractiveSubtleHover,colorBorderInteractiveSelected:r.purpurColorBorderInteractiveSelected,colorBorderInteractivePrimaryNegative:r.purpurColorBorderInteractivePrimaryNegative,colorBorderInteractivePrimaryHoverNegative:r.purpurColorBorderInteractivePrimaryHoverNegative,colorBorderInteractivePrimaryActiveNegative:r.purpurColorBorderInteractivePrimaryActiveNegative,colorBorderInteractiveSubtleNegative:r.purpurColorBorderInteractiveSubtleNegative,colorBorderInteractiveSubtleHoverNegative:r.purpurColorBorderInteractiveSubtleHoverNegative,colorBorderStatusError:r.purpurColorBorderStatusError,colorBorderStatusWarning:r.purpurColorBorderStatusWarning,colorBorderStatusInfo:r.purpurColorBorderStatusInfo,colorBorderStatusSuccess:r.purpurColorBorderStatusSuccess,colorBorderStatusErrorNegative:r.purpurColorBorderStatusErrorNegative,colorBorderStatusSuccessNegative:r.purpurColorBorderStatusSuccessNegative},s={light:we,dark:Re},Qe=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),S=({theme:o=s,cssVariablesSelector:e,currentColorScheme:u})=>{a.useEffect(()=>{u&&Object.entries(o?.[u]??s[u]).forEach(([i,l])=>{((e?document.querySelector(e):null)??document.documentElement).style.setProperty(`--purpur-${Qe(i)}`,l)})},[o,e,u])},C=a.createContext({colorScheme:"light",currentColorScheme:"light",setColorScheme:()=>{},options:{}}),je=({cssVariablesSelector:o,forceColorScheme:e,theme:u,children:i,options:l={},...g})=>{const[c,p]=a.useState(e??"auto"),[n,v]=a.useState(e??"light");a.useEffect(()=>{if(e)p(e);else{const t=localStorage.getItem("colorScheme");t&&p(t)}},[e]),a.useEffect(()=>{const t=window.matchMedia("(prefers-color-scheme: dark)");v(c==="auto"?t.matches?"dark":"light":c);const d=I=>{!e&&c==="auto"&&v(I.matches?"dark":"light")};return t.addEventListener("change",d),()=>{t.removeEventListener("change",d)}},[c,e]),S({theme:u,cssVariablesSelector:o,currentColorScheme:u!==void 0?n:void 0});const T=a.useMemo(()=>({colorScheme:c,currentColorScheme:n,setColorScheme:t=>{e||(p(t),localStorage.setItem("colorScheme",t))}}),[c,n,e]);return B.jsx(C.Provider,{value:{...T,options:l},children:B.jsx("div",{"data-color-scheme":n,className:n,...g,children:i})})},qe=()=>{const o=a.useContext(C);if(!o)throw new Error("useTheme must be used within a ThemeProvider");return o};exports.ThemeProvider=je;exports.teliaTheme=s;exports.useApplyTheme=S;exports.useTheme=qe;
|
|
2
|
+
//# sourceMappingURL=ThemeProvider-Dy771oix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeProvider-Dy771oix.js","sources":["../../tokens/dist/color/variables.dark.js","../../theme/src/telia-dark.ts","../../theme/src/telia-light.ts","../../theme/src/telia-theme.ts","../../theme/src/useApplyTheme.ts","../../theme/src/ThemeProvider.tsx"],"sourcesContent":["export const purpurColorPurple50 = \"#faf0ff\";\nexport const purpurColorPurple100 = \"#f4e0ff\";\nexport const purpurColorPurple200 = \"#e4b6fb\";\nexport const purpurColorPurple300 = \"#d58df9\";\nexport const purpurColorPurple400 = \"#c461f7\";\nexport const purpurColorPurple500 = \"#b12df4\";\nexport const purpurColorPurple550 = \"#990ae3\";\nexport const purpurColorPurple600 = \"#8c07d0\";\nexport const purpurColorPurple700 = \"#6d02a3\";\nexport const purpurColorPurple800 = \"#4e0174\";\nexport const purpurColorPurple900 = \"#29003e\";\nexport const purpurColorPurple950 = \"#1f002e\";\nexport const purpurColorBeige50 = \"#f9f1ec\";\nexport const purpurColorBeige100 = \"#ede1d8\";\nexport const purpurColorBeige200 = \"#d7c3b5\";\nexport const purpurColorBeige300 = \"#bba494\";\nexport const purpurColorBeige400 = \"#a08877\";\nexport const purpurColorBeige500 = \"#807268\";\nexport const purpurColorBeige600 = \"#665e58\";\nexport const purpurColorBeige700 = \"#4f4741\";\nexport const purpurColorBeige800 = \"#3b332d\";\nexport const purpurColorBeige900 = \"#2d2824\";\nexport const purpurColorBeige950 = \"#170f09\";\nexport const purpurColorTeal50 = \"#edf5f5\";\nexport const purpurColorTeal100 = \"#d5eae9\";\nexport const purpurColorTeal200 = \"#a1cfcd\";\nexport const purpurColorTeal300 = \"#6eb5b2\";\nexport const purpurColorTeal400 = \"#3a9b96\";\nexport const purpurColorTeal500 = \"#00847e\";\nexport const purpurColorTeal600 = \"#006c67\";\nexport const purpurColorTeal700 = \"#02534f\";\nexport const purpurColorTeal800 = \"#063c39\";\nexport const purpurColorTeal900 = \"#032220\";\nexport const purpurColorTeal950 = \"#011413\";\nexport const purpurColorGray50 = \"#f5f5fa\";\nexport const purpurColorGray100 = \"#e5e5eb\";\nexport const purpurColorGray150 = \"#d6d6dd\";\nexport const purpurColorGray200 = \"#c6c6cd\";\nexport const purpurColorGray300 = \"#aaaab0\";\nexport const purpurColorGray400 = \"#8d8d94\";\nexport const purpurColorGray500 = \"#757579\";\nexport const purpurColorGray600 = \"#5f5f63\";\nexport const purpurColorGray700 = \"#4a4a4d\";\nexport const purpurColorGray800 = \"#353537\";\nexport const purpurColorGray850 = \"#2a2a2c\";\nexport const purpurColorGray900 = \"#202022\";\nexport const purpurColorGray950 = \"#121212\";\nexport const purpurColorGreen50 = \"#e1f9ec\";\nexport const purpurColorGreen100 = \"#c5efd9\";\nexport const purpurColorGreen200 = \"#79d9a7\";\nexport const purpurColorGreen300 = \"#3dbf7c\";\nexport const purpurColorGreen400 = \"#1fa15e\";\nexport const purpurColorGreen500 = \"#018842\";\nexport const purpurColorGreen600 = \"#017037\";\nexport const purpurColorGreen700 = \"#02562b\";\nexport const purpurColorGreen800 = \"#003e1e\";\nexport const purpurColorGreen900 = \"#002411\";\nexport const purpurColorGreen950 = \"#00150a\";\nexport const purpurColorRed50 = \"#fff0f5\";\nexport const purpurColorRed100 = \"#ffdde8\";\nexport const purpurColorRed200 = \"#ffafc9\";\nexport const purpurColorRed300 = \"#ff80ab\";\nexport const purpurColorRed400 = \"#fb4885\";\nexport const purpurColorRed500 = \"#e4175c\";\nexport const purpurColorRed600 = \"#c00543\";\nexport const purpurColorRed700 = \"#980233\";\nexport const purpurColorRed800 = \"#700025\";\nexport const purpurColorRed900 = \"#440016\";\nexport const purpurColorRed950 = \"#2c000e\";\nexport const purpurColorOrange50 = \"#fff2de\";\nexport const purpurColorOrange100 = \"#ffe1b3\";\nexport const purpurColorOrange200 = \"#f9bb5b\";\nexport const purpurColorOrange300 = \"#f39200\";\nexport const purpurColorOrange400 = \"#cc7a00\";\nexport const purpurColorOrange500 = \"#a86602\";\nexport const purpurColorOrange600 = \"#8b5301\";\nexport const purpurColorOrange700 = \"#6a4102\";\nexport const purpurColorOrange800 = \"#4c2f03\";\nexport const purpurColorOrange900 = \"#2b1b03\";\nexport const purpurColorOrange950 = \"#1a0f00\";\nexport const purpurColorBlue50 = \"#e8f6ff\";\nexport const purpurColorBlue100 = \"#caeaff\";\nexport const purpurColorBlue200 = \"#91cdf4\";\nexport const purpurColorBlue300 = \"#62b2e7\";\nexport const purpurColorBlue400 = \"#3694d3\";\nexport const purpurColorBlue500 = \"#0078cb\";\nexport const purpurColorBlue600 = \"#0063a6\";\nexport const purpurColorBlue700 = \"#014d80\";\nexport const purpurColorBlue800 = \"#03385b\";\nexport const purpurColorBlue900 = \"#002036\";\nexport const purpurColorBlue950 = \"#011320\";\nexport const purpurColorTransparentBlack50 = \"rgba(0, 0, 0, 0.05)\";\nexport const purpurColorTransparentBlack100 = \"rgba(0, 0, 0, 0.1)\";\nexport const purpurColorTransparentBlack150 = \"rgba(0, 0, 0, 0.16)\";\nexport const purpurColorTransparentBlack200 = \"rgba(0, 0, 0, 0.22)\";\nexport const purpurColorTransparentBlack300 = \"rgba(0, 0, 0, 0.33)\";\nexport const purpurColorTransparentBlack400 = \"rgba(0, 0, 0, 0.44)\";\nexport const purpurColorTransparentBlack500 = \"rgba(0, 0, 0, 0.54)\";\nexport const purpurColorTransparentBlack600 = \"rgba(0, 0, 0, 0.62)\";\nexport const purpurColorTransparentBlack700 = \"rgba(0, 0, 0, 0.71)\";\nexport const purpurColorTransparentBlack800 = \"rgba(0, 0, 0, 0.8)\";\nexport const purpurColorTransparentBlack850 = \"rgba(0, 0, 0, 0.84)\";\nexport const purpurColorTransparentBlack900 = \"rgba(0, 0, 0, 0.88)\";\nexport const purpurColorTransparentBlack950 = \"rgba(0, 0, 0, 0.93)\";\nexport const purpurColorTransparentWhite50 = \"rgba(255, 255, 255, 0.07)\";\nexport const purpurColorTransparentWhite100 = \"rgba(255, 255, 255, 0.11)\";\nexport const purpurColorTransparentWhite150 = \"rgba(255, 255, 255, 0.16)\";\nexport const purpurColorTransparentWhite200 = \"rgba(255, 255, 255, 0.21)\";\nexport const purpurColorTransparentWhite300 = \"rgba(255, 255, 255, 0.29)\";\nexport const purpurColorTransparentWhite400 = \"rgba(255, 255, 255, 0.37)\";\nexport const purpurColorTransparentWhite500 = \"rgba(255, 255, 255, 0.46)\";\nexport const purpurColorTransparentWhite600 = \"rgba(255, 255, 255, 0.55)\";\nexport const purpurColorTransparentWhite700 = \"rgba(255, 255, 255, 0.66)\";\nexport const purpurColorTransparentWhite800 = \"rgba(255, 255, 255, 0.79)\";\nexport const purpurColorTransparentWhite850 = \"rgba(255, 255, 255, 0.84)\";\nexport const purpurColorTransparentWhite900 = \"rgba(255, 255, 255, 0.89)\";\nexport const purpurColorTransparentWhite950 = \"rgba(255, 255, 255, 0.95)\";\nexport const purpurColorFunctionalBlack = \"#000000\";\nexport const purpurColorFunctionalWhite = \"#ffffff\";\nexport const purpurColorFunctionalTransparent = \"rgba(255, 255, 255, 0)\";\nexport const purpurColorBrandDeepPurple = \"#f4e0ff\";\nexport const purpurColorBrandCorePurple = \"#c461f7\";\nexport const purpurColorBrandLightPurple = \"#29003e\";\nexport const purpurColorBrandDeepBeige = \"#ede1d8\";\nexport const purpurColorBrandBeige = \"#4f4741\";\nexport const purpurColorBrandLightBeige = \"#3b332d\";\nexport const purpurColorBrandOffBlack = \"#ffffff\";\nexport const purpurColorBrandWhite = \"#202022\";\nexport const purpurColorTextDefault = \"rgba(255, 255, 255, 0.95)\";\nexport const purpurColorTextMedium = \"rgba(255, 255, 255, 0.66)\";\nexport const purpurColorTextWeak = \"rgba(255, 255, 255, 0.37)\";\nexport const purpurColorTextDefaultNegative = \"rgba(0, 0, 0, 0.8)\";\nexport const purpurColorTextMediumNegative = \"rgba(0, 0, 0, 0.54)\";\nexport const purpurColorTextWeakNegative = \"rgba(0, 0, 0, 0.44)\";\nexport const purpurColorTextInteractivePrimary = \"#f4e0ff\";\nexport const purpurColorTextInteractivePrimaryHover = \"#faf0ff\";\nexport const purpurColorTextInteractivePrimaryActive = \"#ffffff\";\nexport const purpurColorTextInteractiveOnPrimary = \"#4e0174\";\nexport const purpurColorTextInteractiveOnPrimaryNegative = \"#ffffff\";\nexport const purpurColorTextInteractivePrimaryNegative = \"#6d02a3\";\nexport const purpurColorTextInteractivePrimaryHoverNegative = \"#4e0174\";\nexport const purpurColorTextInteractivePrimaryActiveNegative = \"#29003e\";\nexport const purpurColorTextInteractiveOnExpressive = \"#ffffff\";\nexport const purpurColorTextInteractiveOnExpressiveNegative = \"#ffffff\";\nexport const purpurColorTextInteractiveOnExpressiveHover = \"#29003e\";\nexport const purpurColorTextInteractiveOnExpressiveHoverNegative = \"#ffffff\";\nexport const purpurColorTextInteractiveOnExpressiveActive = \"#29003e\";\nexport const purpurColorTextInteractiveOnExpressiveActiveNegative = \"#ffffff\";\nexport const purpurColorTextInteractiveOnDestructive = \"#ffffff\";\nexport const purpurColorTextInteractiveSelected = \"#d58df9\";\nexport const purpurColorTextInteractiveSelectedNegative = \"#990ae3\";\nexport const purpurColorTextStatusDiscount = \"#d58df9\";\nexport const purpurColorTextStatusErrorStrong = \"#ffafc9\";\nexport const purpurColorTextStatusErrorStrongNegative = \"#980233\";\nexport const purpurColorTextStatusErrorMedium = \"#fb4885\";\nexport const purpurColorTextStatusErrorMediumNegative = \"#e4175c\";\nexport const purpurColorTextStatusSuccessStrong = \"#79d9a7\";\nexport const purpurColorTextStatusSuccessStrongNegative = \"#02562b\";\nexport const purpurColorTextStatusSuccessMedium = \"#1fa15e\";\nexport const purpurColorTextStatusWarningStrong = \"#f9bb5b\";\nexport const purpurColorTextStatusWarningMedium = \"#f39200\";\nexport const purpurColorTextStatusWarningMediumNegative = \"#a86602\";\nexport const purpurColorTextStatusInfoStrong = \"#91cdf4\";\nexport const purpurColorTextStatusInfoMedium = \"#3694d3\";\nexport const purpurColorTextStatusNeutral = \"#ffffff\";\nexport const purpurColorTextStatusSpecial = \"#ffffff\";\nexport const purpurColorTextStatusAttention = \"#4e0174\";\nexport const purpurColorTextStatusBlackFriday = \"#202022\";\nexport const purpurColorTextToneOnTonePrimary = \"#29003e\";\nexport const purpurColorTextToneOnToneSecondary = \"#f4e0ff\";\nexport const purpurColorTextToneOnToneTertiary = \"#ffffff\";\nexport const purpurColorBackgroundPrimary = \"#121212\";\nexport const purpurColorBackgroundPrimaryNegative = \"#ffffff\";\nexport const purpurColorBackgroundSecondary = \"#202022\";\nexport const purpurColorBackgroundSecondaryNegative = \"#f5f5fa\";\nexport const purpurColorBackgroundOnImage = \"rgba(0, 0, 0, 0.71)\";\nexport const purpurColorBackgroundOnImageNegative = \"rgba(255, 255, 255, 0.84)\";\nexport const purpurColorBackgroundInteractiveAutoFill = \"#03385b\";\nexport const purpurColorBackgroundInteractivePrimary = \"#f4e0ff\";\nexport const purpurColorBackgroundInteractivePrimaryHover = \"#e4b6fb\";\nexport const purpurColorBackgroundInteractivePrimaryActive = \"#d58df9\";\nexport const purpurColorBackgroundInteractivePrimaryNegative = \"#4e0174\";\nexport const purpurColorBackgroundInteractivePrimaryHoverNegative = \"#6d02a3\";\nexport const purpurColorBackgroundInteractivePrimaryActiveNegative = \"#8c07d0\";\nexport const purpurColorBackgroundInteractiveExpressive = \"#990ae3\";\nexport const purpurColorBackgroundInteractiveExpressiveHover = \"#c461f7\";\nexport const purpurColorBackgroundInteractiveExpressiveActive = \"#d58df9\";\nexport const purpurColorBackgroundInteractiveExpressiveNegative = \"#990ae3\";\nexport const purpurColorBackgroundInteractiveExpressiveHoverNegative = \"#6d02a3\";\nexport const purpurColorBackgroundInteractiveExpressiveActiveNegative = \"#4e0174\";\nexport const purpurColorBackgroundInteractiveDisabled = \"rgba(255, 255, 255, 0.11)\";\nexport const purpurColorBackgroundInteractiveDisabledNegative = \"rgba(0, 0, 0, 0.1)\";\nexport const purpurColorBackgroundInteractiveTransparentHover = \"#4e0174\";\nexport const purpurColorBackgroundInteractiveTransparentHoverNegative = \"#e4b6fb\";\nexport const purpurColorBackgroundInteractiveTransparentActive = \"#6d02a3\";\nexport const purpurColorBackgroundInteractiveTransparentActiveNegative = \"#d58df9\";\nexport const purpurColorBackgroundInteractiveInactive = \"rgba(255, 255, 255, 0.16)\";\nexport const purpurColorBackgroundInteractiveInactiveNegative = \"rgba(0, 0, 0, 0.05)\";\nexport const purpurColorBackgroundInteractiveReadOnly = \"rgba(255, 255, 255, 0.07)\";\nexport const purpurColorBackgroundInteractiveReadOnlyNegative = \"rgba(0, 0, 0, 0.05)\";\nexport const purpurColorBackgroundInteractiveDestructive = \"#e4175c\";\nexport const purpurColorBackgroundInteractiveDestructiveHover = \"#c00543\";\nexport const purpurColorBackgroundInteractiveDestructiveActive = \"#980233\";\nexport const purpurColorBackgroundStatusInfoMedium = \"#03385b\";\nexport const purpurColorBackgroundStatusInfoStrong = \"#62b2e7\";\nexport const purpurColorBackgroundStatusSuccessMedium = \"#003e1e\";\nexport const purpurColorBackgroundStatusSuccessStrong = \"#3dbf7c\";\nexport const purpurColorBackgroundStatusSuccessStrongNegative = \"#1fa15e\";\nexport const purpurColorBackgroundStatusErrorMedium = \"#700025\";\nexport const purpurColorBackgroundStatusErrorStrong = \"#ff80ab\";\nexport const purpurColorBackgroundStatusErrorStrongNegative = \"#fb4885\";\nexport const purpurColorBackgroundStatusWarningMedium = \"#4c2f03\";\nexport const purpurColorBackgroundStatusWarningStrong = \"#f39200\";\nexport const purpurColorBackgroundStatusWarningStrongNegative = \"#f39200\";\nexport const purpurColorBackgroundStatusNeutral = \"#353537\";\nexport const purpurColorBackgroundStatusSpecial = \"#6d02a3\";\nexport const purpurColorBackgroundStatusAttention = \"#f4e0ff\";\nexport const purpurColorBackgroundStatusBlackFriday = \"#ffffff\";\nexport const purpurColorBackgroundToneOnTonePrimary = \"#f4e0ff\";\nexport const purpurColorBackgroundToneOnToneSecondary = \"#29003e\";\nexport const purpurColorBackgroundToneOnToneTertiary = \"#4f4741\";\nexport const purpurColorBackgroundToneOnToneQuaternary = \"#2d2824\";\nexport const purpurColorBorderMedium = \"rgba(255, 255, 255, 0.29)\";\nexport const purpurColorBorderMediumNegative = \"rgba(0, 0, 0, 0.33)\";\nexport const purpurColorBorderStrong = \"rgba(255, 255, 255, 0.46)\";\nexport const purpurColorBorderStrongNegative = \"rgba(0, 0, 0, 0.54)\";\nexport const purpurColorBorderWeak = \"rgba(255, 255, 255, 0.16)\";\nexport const purpurColorBorderWeakNegative = \"rgba(0, 0, 0, 0.16)\";\nexport const purpurColorBorderInteractiveFocus = \"#c461f7\";\nexport const purpurColorBorderInteractivePrimary = \"#f4e0ff\";\nexport const purpurColorBorderInteractivePrimaryNegative = \"#6d02a3\";\nexport const purpurColorBorderInteractivePrimaryHover = \"#faf0ff\";\nexport const purpurColorBorderInteractivePrimaryActive = \"#ffffff\";\nexport const purpurColorBorderInteractivePrimaryHoverNegative = \"#4e0174\";\nexport const purpurColorBorderInteractivePrimaryActiveNegative = \"#29003e\";\nexport const purpurColorBorderInteractiveExpressive = \"#990ae3\";\nexport const purpurColorBorderInteractiveSelected = \"#d58df9\";\nexport const purpurColorBorderInteractiveSubtle = \"rgba(255, 255, 255, 0.37)\";\nexport const purpurColorBorderInteractiveSubtleNegative = \"rgba(0, 0, 0, 0.44)\";\nexport const purpurColorBorderInteractiveSubtleHover = \"#e4b6fb\";\nexport const purpurColorBorderInteractiveSubtleHoverNegative = \"#6d02a3\";\nexport const purpurColorBorderStatusError = \"#fb4885\";\nexport const purpurColorBorderStatusErrorNegative = \"#e4175c\";\nexport const purpurColorBorderStatusWarning = \"#f39200\";\nexport const purpurColorBorderStatusInfo = \"#3694d3\";\nexport const purpurColorBorderStatusSuccess = \"#1fa15e\";\nexport const purpurColorBorderStatusSuccessNegative = \"#018842\";\nexport const purpurColorOverlayDefault = \"rgba(0, 0, 0, 0.71)\";\nexport const purpurColorGradientAiBottom = \"#62b2e7\";\nexport const purpurColorGradientAiBottomNegative = \"#3694d3\";\nexport const purpurColorGradientAiTop = \"#d58df9\";\nexport const purpurColorGradientAiTopNegative = \"#b12df4\";\n","import {\n purpurColorBackgroundInteractiveAutoFill,\n purpurColorBackgroundInteractiveDestructive,\n purpurColorBackgroundInteractiveDestructiveActive,\n purpurColorBackgroundInteractiveDestructiveHover,\n purpurColorBackgroundInteractiveDisabled,\n purpurColorBackgroundInteractiveDisabledNegative,\n purpurColorBackgroundInteractiveExpressive,\n purpurColorBackgroundInteractiveExpressiveActive,\n purpurColorBackgroundInteractiveExpressiveActiveNegative,\n purpurColorBackgroundInteractiveExpressiveHover,\n purpurColorBackgroundInteractiveExpressiveHoverNegative,\n purpurColorBackgroundInteractiveExpressiveNegative,\n purpurColorBackgroundInteractiveInactive,\n purpurColorBackgroundInteractiveInactiveNegative,\n purpurColorBackgroundInteractivePrimary,\n purpurColorBackgroundInteractivePrimaryActive,\n purpurColorBackgroundInteractivePrimaryActiveNegative,\n purpurColorBackgroundInteractivePrimaryHover,\n purpurColorBackgroundInteractivePrimaryHoverNegative,\n purpurColorBackgroundInteractivePrimaryNegative,\n purpurColorBackgroundInteractiveReadOnly,\n purpurColorBackgroundInteractiveReadOnlyNegative,\n purpurColorBackgroundInteractiveTransparentActive,\n purpurColorBackgroundInteractiveTransparentActiveNegative,\n purpurColorBackgroundInteractiveTransparentHover,\n purpurColorBackgroundInteractiveTransparentHoverNegative,\n purpurColorBackgroundOnImage,\n purpurColorBackgroundOnImageNegative,\n purpurColorBackgroundPrimary,\n purpurColorBackgroundPrimaryNegative,\n purpurColorBackgroundSecondary,\n purpurColorBackgroundSecondaryNegative,\n purpurColorBackgroundStatusAttention,\n purpurColorBackgroundStatusBlackFriday,\n purpurColorBackgroundStatusErrorMedium,\n purpurColorBackgroundStatusErrorStrong,\n purpurColorBackgroundStatusErrorStrongNegative,\n purpurColorBackgroundStatusInfoMedium,\n purpurColorBackgroundStatusInfoStrong,\n purpurColorBackgroundStatusNeutral,\n purpurColorBackgroundStatusSpecial,\n purpurColorBackgroundStatusSuccessMedium,\n purpurColorBackgroundStatusSuccessStrong,\n purpurColorBackgroundStatusSuccessStrongNegative,\n purpurColorBackgroundStatusWarningMedium,\n purpurColorBackgroundStatusWarningStrong,\n purpurColorBackgroundStatusWarningStrongNegative,\n purpurColorBackgroundToneOnTonePrimary,\n purpurColorBackgroundToneOnToneQuaternary,\n purpurColorBackgroundToneOnToneSecondary,\n purpurColorBackgroundToneOnToneTertiary,\n purpurColorBorderInteractiveExpressive,\n purpurColorBorderInteractiveFocus,\n purpurColorBorderInteractivePrimary,\n purpurColorBorderInteractivePrimaryActive,\n purpurColorBorderInteractivePrimaryActiveNegative,\n purpurColorBorderInteractivePrimaryHover,\n purpurColorBorderInteractivePrimaryHoverNegative,\n purpurColorBorderInteractivePrimaryNegative,\n purpurColorBorderInteractiveSelected,\n purpurColorBorderInteractiveSubtle,\n purpurColorBorderInteractiveSubtleHover,\n purpurColorBorderInteractiveSubtleHoverNegative,\n purpurColorBorderInteractiveSubtleNegative,\n purpurColorBorderMedium,\n purpurColorBorderMediumNegative,\n purpurColorBorderStatusError,\n purpurColorBorderStatusErrorNegative,\n purpurColorBorderStatusInfo,\n purpurColorBorderStatusSuccess,\n purpurColorBorderStatusSuccessNegative,\n purpurColorBorderStatusWarning,\n purpurColorBorderStrong,\n purpurColorBorderStrongNegative,\n purpurColorBorderWeak,\n purpurColorBorderWeakNegative,\n purpurColorBrandBeige,\n purpurColorBrandCorePurple,\n purpurColorBrandDeepBeige,\n purpurColorBrandDeepPurple,\n purpurColorBrandLightBeige,\n purpurColorBrandLightPurple,\n purpurColorBrandOffBlack,\n purpurColorBrandWhite,\n purpurColorTextDefault,\n purpurColorTextDefaultNegative,\n purpurColorTextInteractiveOnDestructive,\n purpurColorTextInteractiveOnExpressive,\n purpurColorTextInteractiveOnExpressiveActive,\n purpurColorTextInteractiveOnExpressiveActiveNegative,\n purpurColorTextInteractiveOnExpressiveHover,\n purpurColorTextInteractiveOnExpressiveHoverNegative,\n purpurColorTextInteractiveOnExpressiveNegative,\n purpurColorTextInteractiveOnPrimary,\n purpurColorTextInteractiveOnPrimaryNegative,\n purpurColorTextInteractivePrimary,\n purpurColorTextInteractivePrimaryActive,\n purpurColorTextInteractivePrimaryActiveNegative,\n purpurColorTextInteractivePrimaryHover,\n purpurColorTextInteractivePrimaryHoverNegative,\n purpurColorTextInteractivePrimaryNegative,\n purpurColorTextInteractiveSelected,\n purpurColorTextMedium,\n purpurColorTextMediumNegative,\n purpurColorTextStatusAttention,\n purpurColorTextStatusBlackFriday,\n purpurColorTextStatusDiscount,\n purpurColorTextStatusErrorMedium,\n purpurColorTextStatusErrorMediumNegative,\n purpurColorTextStatusErrorStrong,\n purpurColorTextStatusErrorStrongNegative,\n purpurColorTextStatusInfoMedium,\n purpurColorTextStatusInfoStrong,\n purpurColorTextStatusNeutral,\n purpurColorTextStatusSpecial,\n purpurColorTextStatusSuccessMedium,\n purpurColorTextStatusSuccessStrong,\n purpurColorTextStatusSuccessStrongNegative,\n purpurColorTextStatusWarningMedium,\n purpurColorTextStatusWarningMediumNegative,\n purpurColorTextStatusWarningStrong,\n purpurColorTextToneOnTonePrimary,\n purpurColorTextToneOnToneSecondary,\n purpurColorTextToneOnToneTertiary,\n purpurColorTextWeak,\n purpurColorTextWeakNegative,\n} from \"@purpur/tokens/dark\";\n\nimport type { ThemeProps } from \"./theme-props\";\n\nexport const dark = {\n colorBrandDeepPurple: purpurColorBrandDeepPurple,\n colorBrandCorePurple: purpurColorBrandCorePurple,\n colorBrandLightPurple: purpurColorBrandLightPurple,\n colorBrandDeepBeige: purpurColorBrandDeepBeige,\n colorBrandBeige: purpurColorBrandBeige,\n colorBrandLightBeige: purpurColorBrandLightBeige,\n colorBrandOffBlack: purpurColorBrandOffBlack,\n colorBrandWhite: purpurColorBrandWhite,\n\n colorTextDefault: purpurColorTextDefault,\n colorTextMedium: purpurColorTextMedium,\n colorTextWeak: purpurColorTextWeak,\n colorTextDefaultNegative: purpurColorTextDefaultNegative,\n colorTextMediumNegative: purpurColorTextMediumNegative,\n colorTextWeakNegative: purpurColorTextWeakNegative,\n\n colorTextInteractivePrimary: purpurColorTextInteractivePrimary,\n colorTextInteractivePrimaryHover: purpurColorTextInteractivePrimaryHover,\n colorTextInteractivePrimaryActive: purpurColorTextInteractivePrimaryActive,\n colorTextInteractiveOnPrimary: purpurColorTextInteractiveOnPrimary,\n colorTextInteractiveOnExpressive: purpurColorTextInteractiveOnExpressive,\n colorTextInteractiveOnExpressiveHover: purpurColorTextInteractiveOnExpressiveHover,\n colorTextInteractiveOnExpressiveActive: purpurColorTextInteractiveOnExpressiveActive,\n colorTextInteractiveOnDestructive: purpurColorTextInteractiveOnDestructive,\n colorTextInteractiveSelected: purpurColorTextInteractiveSelected,\n colorTextInteractivePrimaryNegative: purpurColorTextInteractivePrimaryNegative,\n colorTextInteractivePrimaryHoverNegative: purpurColorTextInteractivePrimaryHoverNegative,\n colorTextInteractivePrimaryActiveNegative: purpurColorTextInteractivePrimaryActiveNegative,\n colorTextInteractiveOnPrimaryNegative: purpurColorTextInteractiveOnPrimaryNegative,\n colorTextInteractiveOnExpressiveNegative: purpurColorTextInteractiveOnExpressiveNegative,\n colorTextInteractiveOnExpressiveHoverNegative:\n purpurColorTextInteractiveOnExpressiveHoverNegative,\n colorTextInteractiveOnExpressiveActiveNegative:\n purpurColorTextInteractiveOnExpressiveActiveNegative,\n\n colorTextStatusInfoMedium: purpurColorTextStatusInfoMedium,\n colorTextStatusInfoStrong: purpurColorTextStatusInfoStrong,\n colorTextStatusSuccessMedium: purpurColorTextStatusSuccessMedium,\n colorTextStatusSuccessStrong: purpurColorTextStatusSuccessStrong,\n colorTextStatusWarningMedium: purpurColorTextStatusWarningMedium,\n colorTextStatusWarningStrong: purpurColorTextStatusWarningStrong,\n colorTextStatusErrorMedium: purpurColorTextStatusErrorMedium,\n colorTextStatusErrorStrong: purpurColorTextStatusErrorStrong,\n colorTextStatusNeutral: purpurColorTextStatusNeutral,\n colorTextStatusSpecial: purpurColorTextStatusSpecial,\n colorTextStatusAttention: purpurColorTextStatusAttention,\n colorTextStatusDiscount: purpurColorTextStatusDiscount,\n colorTextStatusBlackFriday: purpurColorTextStatusBlackFriday,\n colorTextStatusSuccessStrongNegative: purpurColorTextStatusSuccessStrongNegative,\n colorTextStatusErrorMediumNegative: purpurColorTextStatusErrorMediumNegative,\n colorTextStatusErrorStrongNegative: purpurColorTextStatusErrorStrongNegative,\n colorTextStatusWarningMediumNegative: purpurColorTextStatusWarningMediumNegative,\n\n colorTextToneOnTonePrimary: purpurColorTextToneOnTonePrimary,\n colorTextToneOnToneSecondary: purpurColorTextToneOnToneSecondary,\n colorTextToneOnToneTertiary: purpurColorTextToneOnToneTertiary,\n\n colorBackgroundPrimary: purpurColorBackgroundPrimary,\n colorBackgroundSecondary: purpurColorBackgroundSecondary,\n colorBackgroundOnImage: purpurColorBackgroundOnImage,\n colorBackgroundPrimaryNegative: purpurColorBackgroundPrimaryNegative,\n colorBackgroundSecondaryNegative: purpurColorBackgroundSecondaryNegative,\n colorBackgroundOnImageNegative: purpurColorBackgroundOnImageNegative,\n\n colorBackgroundInteractivePrimary: purpurColorBackgroundInteractivePrimary,\n colorBackgroundInteractivePrimaryHover: purpurColorBackgroundInteractivePrimaryHover,\n colorBackgroundInteractivePrimaryActive: purpurColorBackgroundInteractivePrimaryActive,\n colorBackgroundInteractiveExpressive: purpurColorBackgroundInteractiveExpressive,\n colorBackgroundInteractiveExpressiveHover: purpurColorBackgroundInteractiveExpressiveHover,\n colorBackgroundInteractiveExpressiveActive: purpurColorBackgroundInteractiveExpressiveActive,\n colorBackgroundInteractiveTransparentHover: purpurColorBackgroundInteractiveTransparentHover,\n colorBackgroundInteractiveTransparentActive: purpurColorBackgroundInteractiveTransparentActive,\n colorBackgroundInteractiveDisabled: purpurColorBackgroundInteractiveDisabled,\n colorBackgroundInteractiveReadOnly: purpurColorBackgroundInteractiveReadOnly,\n colorBackgroundInteractiveInactive: purpurColorBackgroundInteractiveInactive,\n colorBackgroundInteractiveDestructive: purpurColorBackgroundInteractiveDestructive,\n colorBackgroundInteractiveDestructiveHover: purpurColorBackgroundInteractiveDestructiveHover,\n colorBackgroundInteractiveDestructiveActive: purpurColorBackgroundInteractiveDestructiveActive,\n colorBackgroundInteractiveAutoFill: purpurColorBackgroundInteractiveAutoFill,\n colorBackgroundInteractivePrimaryNegative: purpurColorBackgroundInteractivePrimaryNegative,\n colorBackgroundInteractivePrimaryHoverNegative:\n purpurColorBackgroundInteractivePrimaryHoverNegative,\n colorBackgroundInteractivePrimaryActiveNegative:\n purpurColorBackgroundInteractivePrimaryActiveNegative,\n colorBackgroundInteractiveExpressiveNegative: purpurColorBackgroundInteractiveExpressiveNegative,\n colorBackgroundInteractiveExpressiveHoverNegative:\n purpurColorBackgroundInteractiveExpressiveHoverNegative,\n colorBackgroundInteractiveExpressiveActiveNegative:\n purpurColorBackgroundInteractiveExpressiveActiveNegative,\n colorBackgroundInteractiveTransparentHoverNegative:\n purpurColorBackgroundInteractiveTransparentHoverNegative,\n colorBackgroundInteractiveTransparentActiveNegative:\n purpurColorBackgroundInteractiveTransparentActiveNegative,\n colorBackgroundInteractiveDisabledNegative: purpurColorBackgroundInteractiveDisabledNegative,\n colorBackgroundInteractiveInactiveNegative: purpurColorBackgroundInteractiveInactiveNegative,\n colorBackgroundInteractiveReadOnlyNegative: purpurColorBackgroundInteractiveReadOnlyNegative,\n\n colorBackgroundStatusInfoMedium: purpurColorBackgroundStatusInfoMedium,\n colorBackgroundStatusInfoStrong: purpurColorBackgroundStatusInfoStrong,\n colorBackgroundStatusSuccessMedium: purpurColorBackgroundStatusSuccessMedium,\n colorBackgroundStatusSuccessStrong: purpurColorBackgroundStatusSuccessStrong,\n colorBackgroundStatusWarningMedium: purpurColorBackgroundStatusWarningMedium,\n colorBackgroundStatusWarningStrong: purpurColorBackgroundStatusWarningStrong,\n colorBackgroundStatusErrorMedium: purpurColorBackgroundStatusErrorMedium,\n colorBackgroundStatusErrorStrong: purpurColorBackgroundStatusErrorStrong,\n colorBackgroundStatusNeutral: purpurColorBackgroundStatusNeutral,\n colorBackgroundStatusSpecial: purpurColorBackgroundStatusSpecial,\n colorBackgroundStatusAttention: purpurColorBackgroundStatusAttention,\n colorBackgroundStatusBlackFriday: purpurColorBackgroundStatusBlackFriday,\n colorBackgroundStatusSuccessStrongNegative: purpurColorBackgroundStatusSuccessStrongNegative,\n colorBackgroundStatusWarningStrongNegative: purpurColorBackgroundStatusWarningStrongNegative,\n colorBackgroundStatusErrorStrongNegative: purpurColorBackgroundStatusErrorStrongNegative,\n\n colorBackgroundToneOnTonePrimary: purpurColorBackgroundToneOnTonePrimary,\n colorBackgroundToneOnToneSecondary: purpurColorBackgroundToneOnToneSecondary,\n colorBackgroundToneOnToneTertiary: purpurColorBackgroundToneOnToneTertiary,\n colorBackgroundToneOnToneQuaternary: purpurColorBackgroundToneOnToneQuaternary,\n\n colorBorderWeak: purpurColorBorderWeak,\n colorBorderMedium: purpurColorBorderMedium,\n colorBorderStrong: purpurColorBorderStrong,\n colorBorderWeakNegative: purpurColorBorderWeakNegative,\n colorBorderMediumNegative: purpurColorBorderMediumNegative,\n colorBorderStrongNegative: purpurColorBorderStrongNegative,\n\n colorBorderInteractivePrimary: purpurColorBorderInteractivePrimary,\n colorBorderInteractivePrimaryHover: purpurColorBorderInteractivePrimaryHover,\n colorBorderInteractivePrimaryActive: purpurColorBorderInteractivePrimaryActive,\n colorBorderInteractiveFocus: purpurColorBorderInteractiveFocus,\n colorBorderInteractiveExpressive: purpurColorBorderInteractiveExpressive,\n colorBorderInteractiveSubtle: purpurColorBorderInteractiveSubtle,\n colorBorderInteractiveSubtleHover: purpurColorBorderInteractiveSubtleHover,\n colorBorderInteractiveSelected: purpurColorBorderInteractiveSelected,\n colorBorderInteractivePrimaryNegative: purpurColorBorderInteractivePrimaryNegative,\n colorBorderInteractivePrimaryHoverNegative: purpurColorBorderInteractivePrimaryHoverNegative,\n colorBorderInteractivePrimaryActiveNegative: purpurColorBorderInteractivePrimaryActiveNegative,\n colorBorderInteractiveSubtleNegative: purpurColorBorderInteractiveSubtleNegative,\n colorBorderInteractiveSubtleHoverNegative: purpurColorBorderInteractiveSubtleHoverNegative,\n\n colorBorderStatusError: purpurColorBorderStatusError,\n colorBorderStatusWarning: purpurColorBorderStatusWarning,\n colorBorderStatusInfo: purpurColorBorderStatusInfo,\n colorBorderStatusSuccess: purpurColorBorderStatusSuccess,\n colorBorderStatusErrorNegative: purpurColorBorderStatusErrorNegative,\n colorBorderStatusSuccessNegative: purpurColorBorderStatusSuccessNegative,\n} satisfies ThemeProps;\n","import {\n purpurColorBackgroundInteractiveAutoFill,\n purpurColorBackgroundInteractiveDestructive,\n purpurColorBackgroundInteractiveDestructiveActive,\n purpurColorBackgroundInteractiveDestructiveHover,\n purpurColorBackgroundInteractiveDisabled,\n purpurColorBackgroundInteractiveDisabledNegative,\n purpurColorBackgroundInteractiveExpressive,\n purpurColorBackgroundInteractiveExpressiveActive,\n purpurColorBackgroundInteractiveExpressiveActiveNegative,\n purpurColorBackgroundInteractiveExpressiveHover,\n purpurColorBackgroundInteractiveExpressiveHoverNegative,\n purpurColorBackgroundInteractiveExpressiveNegative,\n purpurColorBackgroundInteractiveInactive,\n purpurColorBackgroundInteractiveInactiveNegative,\n purpurColorBackgroundInteractivePrimary,\n purpurColorBackgroundInteractivePrimaryActive,\n purpurColorBackgroundInteractivePrimaryActiveNegative,\n purpurColorBackgroundInteractivePrimaryHover,\n purpurColorBackgroundInteractivePrimaryHoverNegative,\n purpurColorBackgroundInteractivePrimaryNegative,\n purpurColorBackgroundInteractiveReadOnly,\n purpurColorBackgroundInteractiveReadOnlyNegative,\n purpurColorBackgroundInteractiveTransparentActive,\n purpurColorBackgroundInteractiveTransparentActiveNegative,\n purpurColorBackgroundInteractiveTransparentHover,\n purpurColorBackgroundInteractiveTransparentHoverNegative,\n purpurColorBackgroundOnImage,\n purpurColorBackgroundOnImageNegative,\n purpurColorBackgroundPrimary,\n purpurColorBackgroundPrimaryNegative,\n purpurColorBackgroundSecondary,\n purpurColorBackgroundSecondaryNegative,\n purpurColorBackgroundStatusAttention,\n purpurColorBackgroundStatusBlackFriday,\n purpurColorBackgroundStatusErrorMedium,\n purpurColorBackgroundStatusErrorStrong,\n purpurColorBackgroundStatusErrorStrongNegative,\n purpurColorBackgroundStatusInfoMedium,\n purpurColorBackgroundStatusInfoStrong,\n purpurColorBackgroundStatusNeutral,\n purpurColorBackgroundStatusSpecial,\n purpurColorBackgroundStatusSuccessMedium,\n purpurColorBackgroundStatusSuccessStrong,\n purpurColorBackgroundStatusSuccessStrongNegative,\n purpurColorBackgroundStatusWarningMedium,\n purpurColorBackgroundStatusWarningStrong,\n purpurColorBackgroundStatusWarningStrongNegative,\n purpurColorBackgroundToneOnTonePrimary,\n purpurColorBackgroundToneOnToneQuaternary,\n purpurColorBackgroundToneOnToneSecondary,\n purpurColorBackgroundToneOnToneTertiary,\n purpurColorBorderInteractiveExpressive,\n purpurColorBorderInteractiveFocus,\n purpurColorBorderInteractivePrimary,\n purpurColorBorderInteractivePrimaryActive,\n purpurColorBorderInteractivePrimaryActiveNegative,\n purpurColorBorderInteractivePrimaryHover,\n purpurColorBorderInteractivePrimaryHoverNegative,\n purpurColorBorderInteractivePrimaryNegative,\n purpurColorBorderInteractiveSelected,\n purpurColorBorderInteractiveSubtle,\n purpurColorBorderInteractiveSubtleHover,\n purpurColorBorderInteractiveSubtleHoverNegative,\n purpurColorBorderInteractiveSubtleNegative,\n purpurColorBorderMedium,\n purpurColorBorderMediumNegative,\n purpurColorBorderStatusError,\n purpurColorBorderStatusErrorNegative,\n purpurColorBorderStatusInfo,\n purpurColorBorderStatusSuccess,\n purpurColorBorderStatusSuccessNegative,\n purpurColorBorderStatusWarning,\n purpurColorBorderStrong,\n purpurColorBorderStrongNegative,\n purpurColorBorderWeak,\n purpurColorBorderWeakNegative,\n purpurColorBrandBeige,\n purpurColorBrandCorePurple,\n purpurColorBrandDeepBeige,\n purpurColorBrandDeepPurple,\n purpurColorBrandLightBeige,\n purpurColorBrandLightPurple,\n purpurColorBrandOffBlack,\n purpurColorBrandWhite,\n purpurColorTextDefault,\n purpurColorTextDefaultNegative,\n purpurColorTextInteractiveOnDestructive,\n purpurColorTextInteractiveOnExpressive,\n purpurColorTextInteractiveOnExpressiveActive,\n purpurColorTextInteractiveOnExpressiveActiveNegative,\n purpurColorTextInteractiveOnExpressiveHover,\n purpurColorTextInteractiveOnExpressiveHoverNegative,\n purpurColorTextInteractiveOnExpressiveNegative,\n purpurColorTextInteractiveOnPrimary,\n purpurColorTextInteractiveOnPrimaryNegative,\n purpurColorTextInteractivePrimary,\n purpurColorTextInteractivePrimaryActive,\n purpurColorTextInteractivePrimaryActiveNegative,\n purpurColorTextInteractivePrimaryHover,\n purpurColorTextInteractivePrimaryHoverNegative,\n purpurColorTextInteractivePrimaryNegative,\n purpurColorTextInteractiveSelected,\n purpurColorTextMedium,\n purpurColorTextMediumNegative,\n purpurColorTextStatusAttention,\n purpurColorTextStatusBlackFriday,\n purpurColorTextStatusDiscount,\n purpurColorTextStatusErrorMedium,\n purpurColorTextStatusErrorMediumNegative,\n purpurColorTextStatusErrorStrong,\n purpurColorTextStatusErrorStrongNegative,\n purpurColorTextStatusInfoMedium,\n purpurColorTextStatusInfoStrong,\n purpurColorTextStatusNeutral,\n purpurColorTextStatusSpecial,\n purpurColorTextStatusSuccessMedium,\n purpurColorTextStatusSuccessStrong,\n purpurColorTextStatusSuccessStrongNegative,\n purpurColorTextStatusWarningMedium,\n purpurColorTextStatusWarningMediumNegative,\n purpurColorTextStatusWarningStrong,\n purpurColorTextToneOnTonePrimary,\n purpurColorTextToneOnToneSecondary,\n purpurColorTextToneOnToneTertiary,\n purpurColorTextWeak,\n purpurColorTextWeakNegative,\n} from \"@purpur/tokens\";\n\nimport type { ThemeProps } from \"./theme-props\";\n\nexport const light = {\n colorBrandDeepPurple: purpurColorBrandDeepPurple,\n colorBrandCorePurple: purpurColorBrandCorePurple,\n colorBrandLightPurple: purpurColorBrandLightPurple,\n colorBrandDeepBeige: purpurColorBrandDeepBeige,\n colorBrandBeige: purpurColorBrandBeige,\n colorBrandLightBeige: purpurColorBrandLightBeige,\n colorBrandOffBlack: purpurColorBrandOffBlack,\n colorBrandWhite: purpurColorBrandWhite,\n\n colorTextDefault: purpurColorTextDefault,\n colorTextMedium: purpurColorTextMedium,\n colorTextWeak: purpurColorTextWeak,\n colorTextDefaultNegative: purpurColorTextDefaultNegative,\n colorTextMediumNegative: purpurColorTextMediumNegative,\n colorTextWeakNegative: purpurColorTextWeakNegative,\n\n colorTextInteractivePrimary: purpurColorTextInteractivePrimary,\n colorTextInteractivePrimaryHover: purpurColorTextInteractivePrimaryHover,\n colorTextInteractivePrimaryActive: purpurColorTextInteractivePrimaryActive,\n colorTextInteractiveOnPrimary: purpurColorTextInteractiveOnPrimary,\n colorTextInteractiveOnExpressive: purpurColorTextInteractiveOnExpressive,\n colorTextInteractiveOnExpressiveHover: purpurColorTextInteractiveOnExpressiveHover,\n colorTextInteractiveOnExpressiveActive: purpurColorTextInteractiveOnExpressiveActive,\n colorTextInteractiveOnDestructive: purpurColorTextInteractiveOnDestructive,\n colorTextInteractiveSelected: purpurColorTextInteractiveSelected,\n colorTextInteractivePrimaryNegative: purpurColorTextInteractivePrimaryNegative,\n colorTextInteractivePrimaryHoverNegative: purpurColorTextInteractivePrimaryHoverNegative,\n colorTextInteractivePrimaryActiveNegative: purpurColorTextInteractivePrimaryActiveNegative,\n colorTextInteractiveOnPrimaryNegative: purpurColorTextInteractiveOnPrimaryNegative,\n colorTextInteractiveOnExpressiveNegative: purpurColorTextInteractiveOnExpressiveNegative,\n colorTextInteractiveOnExpressiveHoverNegative:\n purpurColorTextInteractiveOnExpressiveHoverNegative,\n colorTextInteractiveOnExpressiveActiveNegative:\n purpurColorTextInteractiveOnExpressiveActiveNegative,\n\n colorTextStatusInfoMedium: purpurColorTextStatusInfoMedium,\n colorTextStatusInfoStrong: purpurColorTextStatusInfoStrong,\n colorTextStatusSuccessMedium: purpurColorTextStatusSuccessMedium,\n colorTextStatusSuccessStrong: purpurColorTextStatusSuccessStrong,\n colorTextStatusWarningMedium: purpurColorTextStatusWarningMedium,\n colorTextStatusWarningStrong: purpurColorTextStatusWarningStrong,\n colorTextStatusErrorMedium: purpurColorTextStatusErrorMedium,\n colorTextStatusErrorStrong: purpurColorTextStatusErrorStrong,\n colorTextStatusNeutral: purpurColorTextStatusNeutral,\n colorTextStatusSpecial: purpurColorTextStatusSpecial,\n colorTextStatusAttention: purpurColorTextStatusAttention,\n colorTextStatusDiscount: purpurColorTextStatusDiscount,\n colorTextStatusBlackFriday: purpurColorTextStatusBlackFriday,\n colorTextStatusSuccessStrongNegative: purpurColorTextStatusSuccessStrongNegative,\n colorTextStatusErrorMediumNegative: purpurColorTextStatusErrorMediumNegative,\n colorTextStatusErrorStrongNegative: purpurColorTextStatusErrorStrongNegative,\n colorTextStatusWarningMediumNegative: purpurColorTextStatusWarningMediumNegative,\n\n colorTextToneOnTonePrimary: purpurColorTextToneOnTonePrimary,\n colorTextToneOnToneSecondary: purpurColorTextToneOnToneSecondary,\n colorTextToneOnToneTertiary: purpurColorTextToneOnToneTertiary,\n\n colorBackgroundPrimary: purpurColorBackgroundPrimary,\n colorBackgroundSecondary: purpurColorBackgroundSecondary,\n colorBackgroundOnImage: purpurColorBackgroundOnImage,\n colorBackgroundPrimaryNegative: purpurColorBackgroundPrimaryNegative,\n colorBackgroundSecondaryNegative: purpurColorBackgroundSecondaryNegative,\n colorBackgroundOnImageNegative: purpurColorBackgroundOnImageNegative,\n\n colorBackgroundInteractivePrimary: purpurColorBackgroundInteractivePrimary,\n colorBackgroundInteractivePrimaryHover: purpurColorBackgroundInteractivePrimaryHover,\n colorBackgroundInteractivePrimaryActive: purpurColorBackgroundInteractivePrimaryActive,\n colorBackgroundInteractiveExpressive: purpurColorBackgroundInteractiveExpressive,\n colorBackgroundInteractiveExpressiveHover: purpurColorBackgroundInteractiveExpressiveHover,\n colorBackgroundInteractiveExpressiveActive: purpurColorBackgroundInteractiveExpressiveActive,\n colorBackgroundInteractiveTransparentHover: purpurColorBackgroundInteractiveTransparentHover,\n colorBackgroundInteractiveTransparentActive: purpurColorBackgroundInteractiveTransparentActive,\n colorBackgroundInteractiveDisabled: purpurColorBackgroundInteractiveDisabled,\n colorBackgroundInteractiveReadOnly: purpurColorBackgroundInteractiveReadOnly,\n colorBackgroundInteractiveInactive: purpurColorBackgroundInteractiveInactive,\n colorBackgroundInteractiveDestructive: purpurColorBackgroundInteractiveDestructive,\n colorBackgroundInteractiveDestructiveHover: purpurColorBackgroundInteractiveDestructiveHover,\n colorBackgroundInteractiveDestructiveActive: purpurColorBackgroundInteractiveDestructiveActive,\n colorBackgroundInteractiveAutoFill: purpurColorBackgroundInteractiveAutoFill,\n colorBackgroundInteractivePrimaryNegative: purpurColorBackgroundInteractivePrimaryNegative,\n colorBackgroundInteractivePrimaryHoverNegative:\n purpurColorBackgroundInteractivePrimaryHoverNegative,\n colorBackgroundInteractivePrimaryActiveNegative:\n purpurColorBackgroundInteractivePrimaryActiveNegative,\n colorBackgroundInteractiveExpressiveNegative: purpurColorBackgroundInteractiveExpressiveNegative,\n colorBackgroundInteractiveExpressiveHoverNegative:\n purpurColorBackgroundInteractiveExpressiveHoverNegative,\n colorBackgroundInteractiveExpressiveActiveNegative:\n purpurColorBackgroundInteractiveExpressiveActiveNegative,\n colorBackgroundInteractiveTransparentHoverNegative:\n purpurColorBackgroundInteractiveTransparentHoverNegative,\n colorBackgroundInteractiveTransparentActiveNegative:\n purpurColorBackgroundInteractiveTransparentActiveNegative,\n colorBackgroundInteractiveDisabledNegative: purpurColorBackgroundInteractiveDisabledNegative,\n colorBackgroundInteractiveInactiveNegative: purpurColorBackgroundInteractiveInactiveNegative,\n colorBackgroundInteractiveReadOnlyNegative: purpurColorBackgroundInteractiveReadOnlyNegative,\n\n colorBackgroundStatusInfoMedium: purpurColorBackgroundStatusInfoMedium,\n colorBackgroundStatusInfoStrong: purpurColorBackgroundStatusInfoStrong,\n colorBackgroundStatusSuccessMedium: purpurColorBackgroundStatusSuccessMedium,\n colorBackgroundStatusSuccessStrong: purpurColorBackgroundStatusSuccessStrong,\n colorBackgroundStatusWarningMedium: purpurColorBackgroundStatusWarningMedium,\n colorBackgroundStatusWarningStrong: purpurColorBackgroundStatusWarningStrong,\n colorBackgroundStatusErrorMedium: purpurColorBackgroundStatusErrorMedium,\n colorBackgroundStatusErrorStrong: purpurColorBackgroundStatusErrorStrong,\n colorBackgroundStatusNeutral: purpurColorBackgroundStatusNeutral,\n colorBackgroundStatusSpecial: purpurColorBackgroundStatusSpecial,\n colorBackgroundStatusAttention: purpurColorBackgroundStatusAttention,\n colorBackgroundStatusBlackFriday: purpurColorBackgroundStatusBlackFriday,\n colorBackgroundStatusSuccessStrongNegative: purpurColorBackgroundStatusSuccessStrongNegative,\n colorBackgroundStatusWarningStrongNegative: purpurColorBackgroundStatusWarningStrongNegative,\n colorBackgroundStatusErrorStrongNegative: purpurColorBackgroundStatusErrorStrongNegative,\n\n colorBackgroundToneOnTonePrimary: purpurColorBackgroundToneOnTonePrimary,\n colorBackgroundToneOnToneSecondary: purpurColorBackgroundToneOnToneSecondary,\n colorBackgroundToneOnToneTertiary: purpurColorBackgroundToneOnToneTertiary,\n colorBackgroundToneOnToneQuaternary: purpurColorBackgroundToneOnToneQuaternary,\n\n colorBorderWeak: purpurColorBorderWeak,\n colorBorderMedium: purpurColorBorderMedium,\n colorBorderStrong: purpurColorBorderStrong,\n colorBorderWeakNegative: purpurColorBorderWeakNegative,\n colorBorderMediumNegative: purpurColorBorderMediumNegative,\n colorBorderStrongNegative: purpurColorBorderStrongNegative,\n\n colorBorderInteractivePrimary: purpurColorBorderInteractivePrimary,\n colorBorderInteractivePrimaryHover: purpurColorBorderInteractivePrimaryHover,\n colorBorderInteractivePrimaryActive: purpurColorBorderInteractivePrimaryActive,\n colorBorderInteractiveFocus: purpurColorBorderInteractiveFocus,\n colorBorderInteractiveExpressive: purpurColorBorderInteractiveExpressive,\n colorBorderInteractiveSubtle: purpurColorBorderInteractiveSubtle,\n colorBorderInteractiveSubtleHover: purpurColorBorderInteractiveSubtleHover,\n colorBorderInteractiveSelected: purpurColorBorderInteractiveSelected,\n colorBorderInteractivePrimaryNegative: purpurColorBorderInteractivePrimaryNegative,\n colorBorderInteractivePrimaryHoverNegative: purpurColorBorderInteractivePrimaryHoverNegative,\n colorBorderInteractivePrimaryActiveNegative: purpurColorBorderInteractivePrimaryActiveNegative,\n colorBorderInteractiveSubtleNegative: purpurColorBorderInteractiveSubtleNegative,\n colorBorderInteractiveSubtleHoverNegative: purpurColorBorderInteractiveSubtleHoverNegative,\n\n colorBorderStatusError: purpurColorBorderStatusError,\n colorBorderStatusWarning: purpurColorBorderStatusWarning,\n colorBorderStatusInfo: purpurColorBorderStatusInfo,\n colorBorderStatusSuccess: purpurColorBorderStatusSuccess,\n colorBorderStatusErrorNegative: purpurColorBorderStatusErrorNegative,\n colorBorderStatusSuccessNegative: purpurColorBorderStatusSuccessNegative,\n} satisfies ThemeProps;\n","import { dark } from \"./telia-dark\";\nimport { light } from \"./telia-light\";\nimport type { ThemeProps } from \"./theme-props\";\n\nexport const teliaTheme = {\n light,\n dark,\n} satisfies { light: ThemeProps; dark: ThemeProps };\n","import { useEffect } from \"react\";\n\nimport { teliaTheme } from \"./telia-theme\";\nimport type { ColorScheme, Theme } from \"./types\";\n\nconst toKebabCase = (str: string) => str.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\n\ntype Props = {\n theme?: Theme;\n cssVariablesSelector?: string;\n currentColorScheme?: ColorScheme;\n};\n\nexport const useApplyTheme = ({\n theme = teliaTheme,\n cssVariablesSelector,\n currentColorScheme,\n}: Props) => {\n useEffect(() => {\n if (currentColorScheme) {\n Object.entries(theme?.[currentColorScheme] ?? teliaTheme[currentColorScheme]).forEach(\n ([key, value]) => {\n const element = cssVariablesSelector\n ? (document.querySelector(cssVariablesSelector) as HTMLElement)\n : null;\n\n (element ?? document.documentElement).style.setProperty(\n `--purpur-${toKebabCase(key)}`,\n value\n );\n }\n );\n }\n }, [theme, cssVariablesSelector, currentColorScheme]);\n};\n","import React, {\n createContext,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\n\nimport type { ThemeProps } from \"./theme-props\";\nimport type { ColorOptions, ColorScheme, ThemeContextType } from \"./types\";\nimport { useApplyTheme } from \"./useApplyTheme\";\n\nconst ThemeContext = createContext<ThemeContextType>({\n colorScheme: \"light\",\n currentColorScheme: \"light\",\n setColorScheme: () => {},\n options: {},\n});\n\ntype PropsBase = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n cssVariablesSelector?: string;\n options?: ThemeContextType[\"options\"];\n};\n\nexport type Props =\n | PropsBase &\n (\n | {\n theme: { light: ThemeProps; dark?: never };\n forceColorScheme: \"light\";\n }\n | {\n theme?: { light: ThemeProps; dark: ThemeProps };\n forceColorScheme?: ColorScheme;\n }\n );\n\nexport const ThemeProvider = ({\n cssVariablesSelector,\n forceColorScheme,\n theme,\n children,\n options = {},\n ...props\n}: Props) => {\n const [colorScheme, setColorScheme] = useState<ColorOptions>(forceColorScheme ?? \"auto\");\n const [currentColorScheme, setCurrentColorScheme] = useState<ColorScheme>(\n forceColorScheme ?? \"light\"\n );\n\n useEffect(() => {\n if (!forceColorScheme) {\n const savedColorScheme = localStorage.getItem(\"colorScheme\") as ColorOptions | null;\n if (savedColorScheme) {\n setColorScheme(savedColorScheme);\n }\n } else {\n setColorScheme(forceColorScheme);\n }\n }, [forceColorScheme]);\n\n useEffect(() => {\n const mediaQuery = window.matchMedia(\"(prefers-color-scheme: dark)\");\n\n if (colorScheme === \"auto\") {\n setCurrentColorScheme(mediaQuery.matches ? \"dark\" : \"light\");\n } else {\n setCurrentColorScheme(colorScheme);\n }\n\n const handleChange = (e: MediaQueryListEvent) => {\n if (!forceColorScheme && colorScheme === \"auto\") {\n setCurrentColorScheme(e.matches ? \"dark\" : \"light\");\n }\n };\n\n mediaQuery.addEventListener(\"change\", handleChange);\n\n return () => {\n mediaQuery.removeEventListener(\"change\", handleChange);\n };\n }, [colorScheme, forceColorScheme]);\n\n const isCustomTheme = theme !== undefined;\n\n useApplyTheme({\n theme,\n cssVariablesSelector,\n currentColorScheme: isCustomTheme ? currentColorScheme : undefined,\n });\n\n const contextValue = useMemo(\n () => ({\n colorScheme,\n currentColorScheme,\n setColorScheme: (scheme: ColorOptions) => {\n if (!forceColorScheme) {\n setColorScheme(scheme);\n localStorage.setItem(\"colorScheme\", scheme);\n }\n },\n }),\n [colorScheme, currentColorScheme, forceColorScheme]\n );\n\n return (\n <ThemeContext.Provider value={{ ...contextValue, options }}>\n <div data-color-scheme={currentColorScheme} className={currentColorScheme} {...props}>\n {children}\n </div>\n </ThemeContext.Provider>\n );\n};\n\nexport const useTheme = (): ThemeContextType => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error(\"useTheme must be used within a ThemeProvider\");\n }\n return context;\n};\n"],"names":["purpurColorBrandDeepPurple","purpurColorBrandCorePurple","purpurColorBrandLightPurple","purpurColorBrandDeepBeige","purpurColorBrandBeige","purpurColorBrandLightBeige","purpurColorBrandOffBlack","purpurColorBrandWhite","purpurColorTextDefault","purpurColorTextMedium","purpurColorTextWeak","purpurColorTextDefaultNegative","purpurColorTextMediumNegative","purpurColorTextWeakNegative","purpurColorTextInteractivePrimary","purpurColorTextInteractivePrimaryHover","purpurColorTextInteractivePrimaryActive","purpurColorTextInteractiveOnPrimary","purpurColorTextInteractiveOnPrimaryNegative","purpurColorTextInteractivePrimaryNegative","purpurColorTextInteractivePrimaryHoverNegative","purpurColorTextInteractivePrimaryActiveNegative","purpurColorTextInteractiveOnExpressive","purpurColorTextInteractiveOnExpressiveNegative","purpurColorTextInteractiveOnExpressiveHover","purpurColorTextInteractiveOnExpressiveHoverNegative","purpurColorTextInteractiveOnExpressiveActive","purpurColorTextInteractiveOnExpressiveActiveNegative","purpurColorTextInteractiveOnDestructive","purpurColorTextInteractiveSelected","purpurColorTextStatusDiscount","purpurColorTextStatusErrorStrong","purpurColorTextStatusErrorStrongNegative","purpurColorTextStatusErrorMedium","purpurColorTextStatusErrorMediumNegative","purpurColorTextStatusSuccessStrong","purpurColorTextStatusSuccessStrongNegative","purpurColorTextStatusSuccessMedium","purpurColorTextStatusWarningStrong","purpurColorTextStatusWarningMedium","purpurColorTextStatusWarningMediumNegative","purpurColorTextStatusInfoStrong","purpurColorTextStatusInfoMedium","purpurColorTextStatusNeutral","purpurColorTextStatusSpecial","purpurColorTextStatusAttention","purpurColorTextStatusBlackFriday","purpurColorTextToneOnTonePrimary","purpurColorTextToneOnToneSecondary","purpurColorTextToneOnToneTertiary","purpurColorBackgroundPrimary","purpurColorBackgroundPrimaryNegative","purpurColorBackgroundSecondary","purpurColorBackgroundSecondaryNegative","purpurColorBackgroundOnImage","purpurColorBackgroundOnImageNegative","purpurColorBackgroundInteractiveAutoFill","purpurColorBackgroundInteractivePrimary","purpurColorBackgroundInteractivePrimaryHover","purpurColorBackgroundInteractivePrimaryActive","purpurColorBackgroundInteractivePrimaryNegative","purpurColorBackgroundInteractivePrimaryHoverNegative","purpurColorBackgroundInteractivePrimaryActiveNegative","purpurColorBackgroundInteractiveExpressive","purpurColorBackgroundInteractiveExpressiveHover","purpurColorBackgroundInteractiveExpressiveActive","purpurColorBackgroundInteractiveExpressiveNegative","purpurColorBackgroundInteractiveExpressiveHoverNegative","purpurColorBackgroundInteractiveExpressiveActiveNegative","purpurColorBackgroundInteractiveDisabled","purpurColorBackgroundInteractiveDisabledNegative","purpurColorBackgroundInteractiveTransparentHover","purpurColorBackgroundInteractiveTransparentHoverNegative","purpurColorBackgroundInteractiveTransparentActive","purpurColorBackgroundInteractiveTransparentActiveNegative","purpurColorBackgroundInteractiveInactive","purpurColorBackgroundInteractiveInactiveNegative","purpurColorBackgroundInteractiveReadOnly","purpurColorBackgroundInteractiveReadOnlyNegative","purpurColorBackgroundInteractiveDestructive","purpurColorBackgroundInteractiveDestructiveHover","purpurColorBackgroundInteractiveDestructiveActive","purpurColorBackgroundStatusInfoMedium","purpurColorBackgroundStatusInfoStrong","purpurColorBackgroundStatusSuccessMedium","purpurColorBackgroundStatusSuccessStrong","purpurColorBackgroundStatusSuccessStrongNegative","purpurColorBackgroundStatusErrorMedium","purpurColorBackgroundStatusErrorStrong","purpurColorBackgroundStatusErrorStrongNegative","purpurColorBackgroundStatusWarningMedium","purpurColorBackgroundStatusWarningStrong","purpurColorBackgroundStatusWarningStrongNegative","purpurColorBackgroundStatusNeutral","purpurColorBackgroundStatusSpecial","purpurColorBackgroundStatusAttention","purpurColorBackgroundStatusBlackFriday","purpurColorBackgroundToneOnTonePrimary","purpurColorBackgroundToneOnToneSecondary","purpurColorBackgroundToneOnToneTertiary","purpurColorBackgroundToneOnToneQuaternary","purpurColorBorderMedium","purpurColorBorderMediumNegative","purpurColorBorderStrong","purpurColorBorderStrongNegative","purpurColorBorderWeak","purpurColorBorderWeakNegative","purpurColorBorderInteractiveFocus","purpurColorBorderInteractivePrimary","purpurColorBorderInteractivePrimaryNegative","purpurColorBorderInteractivePrimaryHover","purpurColorBorderInteractivePrimaryActive","purpurColorBorderInteractivePrimaryHoverNegative","purpurColorBorderInteractivePrimaryActiveNegative","purpurColorBorderInteractiveExpressive","purpurColorBorderInteractiveSelected","purpurColorBorderInteractiveSubtle","purpurColorBorderInteractiveSubtleNegative","purpurColorBorderInteractiveSubtleHover","purpurColorBorderInteractiveSubtleHoverNegative","purpurColorBorderStatusError","purpurColorBorderStatusErrorNegative","purpurColorBorderStatusWarning","purpurColorBorderStatusInfo","purpurColorBorderStatusSuccess","purpurColorBorderStatusSuccessNegative","dark","light","teliaTheme","toKebabCase","str","useApplyTheme","theme","cssVariablesSelector","currentColorScheme","useEffect","key","value","ThemeContext","createContext","ThemeProvider","forceColorScheme","children","options","props","colorScheme","setColorScheme","useState","setCurrentColorScheme","savedColorScheme","mediaQuery","handleChange","e","contextValue","useMemo","scheme","jsx","useTheme","context","useContext"],"mappings":"0GAwHaA,EAA6B,UAC7BC,EAA6B,UAC7BC,EAA8B,UAC9BC,EAA4B,UAC5BC,EAAwB,UACxBC,EAA6B,UAC7BC,EAA2B,UAC3BC,EAAwB,UACxBC,EAAyB,4BACzBC,EAAwB,4BACxBC,EAAsB,4BACtBC,EAAiC,qBACjCC,EAAgC,sBAChCC,EAA8B,sBAC9BC,EAAoC,UACpCC,EAAyC,UACzCC,EAA0C,UAC1CC,EAAsC,UACtCC,EAA8C,UAC9CC,EAA4C,UAC5CC,EAAiD,UACjDC,EAAkD,UAClDC,EAAyC,UACzCC,EAAiD,UACjDC,EAA8C,UAC9CC,EAAsD,UACtDC,EAA+C,UAC/CC,EAAuD,UACvDC,EAA0C,UAC1CC,EAAqC,UAErCC,EAAgC,UAChCC,EAAmC,UACnCC,EAA2C,UAC3CC,EAAmC,UACnCC,GAA2C,UAC3CC,GAAqC,UACrCC,GAA6C,UAC7CC,GAAqC,UACrCC,GAAqC,UACrCC,GAAqC,UACrCC,GAA6C,UAC7CC,GAAkC,UAClCC,GAAkC,UAClCC,GAA+B,UAC/BC,GAA+B,UAC/BC,GAAiC,UACjCC,GAAmC,UACnCC,GAAmC,UACnCC,GAAqC,UACrCC,GAAoC,UACpCC,GAA+B,UAC/BC,GAAuC,UACvCC,GAAiC,UACjCC,GAAyC,UACzCC,GAA+B,sBAC/BC,GAAuC,4BACvCC,GAA2C,UAC3CC,GAA0C,UAC1CC,GAA+C,UAC/CC,GAAgD,UAChDC,GAAkD,UAClDC,GAAuD,UACvDC,GAAwD,UACxDC,GAA6C,UAC7CC,G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AM,CACXD,EAAW,oBAAoB,SAAUC,CAAY,CACvD,CACF,EAAG,CAACN,EAAaJ,CAAgB,CAAC,EAIlCV,EAAc,CACZ,MAAAC,EACA,qBAAAC,EACA,mBALoBD,IAAU,OAKME,EAAqB,MAAA,CAC1D,EAED,MAAMmB,EAAeC,EAAAA,QACnB,KAAO,CACL,YAAAT,EACA,mBAAAX,EACA,eAAiBqB,GAAyB,CACnCd,IACHK,EAAeS,CAAM,EACrB,aAAa,QAAQ,cAAeA,CAAM,EAE9C,CAAA,GAEF,CAACV,EAAaX,EAAoBO,CAAgB,CAAA,EAGpD,aACGH,EAAa,SAAb,CAAsB,MAAO,CAAE,GAAGe,EAAc,QAAAV,CAAA,EAC/C,SAAAa,EAAAA,IAAC,MAAA,CAAI,oBAAmBtB,EAAoB,UAAWA,EAAqB,GAAGU,EAC5E,SAAAF,EACH,EACF,CAEJ,EAEae,GAAW,IAAwB,CAC9C,MAAMC,EAAUC,EAAAA,WAAWrB,CAAY,EACvC,GAAI,CAACoB,EACH,MAAM,IAAI,MAAM,8CAA8C,EAEhE,OAAOA,CACT"}
|
|
@@ -3,7 +3,7 @@ import { useContext as A, useId as C, useState as H, createContext as I } from "
|
|
|
3
3
|
import { H as v } from "./heading-xwBuT_-9.mjs";
|
|
4
4
|
import { c as x } from "./bind-CU-R61T-.mjs";
|
|
5
5
|
import { l as j } from "./chevron-down.es-PCIIj6oG.mjs";
|
|
6
|
-
import { P } from "./paragraph-
|
|
6
|
+
import { P } from "./paragraph-DSxXmX_0.mjs";
|
|
7
7
|
const S = {
|
|
8
8
|
"purpur-accordion": "_purpur-accordion_mwmy0_1",
|
|
9
9
|
"purpur-accordion__title": "_purpur-accordion__title_mwmy0_4",
|
|
@@ -123,6 +123,6 @@ f.Item = L;
|
|
|
123
123
|
f.displayName = "Accordion";
|
|
124
124
|
export {
|
|
125
125
|
f as A,
|
|
126
|
-
$ as
|
|
126
|
+
$ as a
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=accordion-
|
|
128
|
+
//# sourceMappingURL=accordion-CIU4U8-4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion-CIU4U8-4.mjs","sources":["../../../components/accordion/src/accordion-item.tsx","../../../components/accordion/src/accordion.tsx"],"sourcesContent":["import React, { type ReactNode, useContext, useId, useState } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { IconChevronDown } from \"@purpur/icon/chevron-down\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport { AccordionNegativeContext } from \"./accordion\";\nimport styles from \"./accordion-item.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-accordion-item\";\n\nexport type AccordionItemOnClickEvent = React.MouseEvent<HTMLButtonElement, MouseEvent> & {\n currentTarget: { dataset: { state: \"open\" | \"closed\" } };\n};\n\nexport type AccordionItemProps = Omit<BaseProps, \"onClick\" | \"title\" | \"children\"> & {\n children: ReactNode;\n /**\n * If true, the children will take the full width without max-width constraint.\n * @default false\n */\n fullWidth?: boolean;\n /**\n * Content to be rendered inside a `button` element.\n * Only pass ReactNodes that are valid as children of a `button`, such as plain text,\n * inline elements like `span` or other non-interactive elements. Avoid block-level or interactive elements.\n */\n title: ReactNode;\n /**\n * This is the heading tag used for the accordion item title. Defaults to h3.\n * `type HeadingTagType = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\"`\n */\n titleTag?: HeadingTagType;\n /**\n * Makes it possible to set the initial state to opened\n * */\n initialOpen?: boolean;\n /**\n * onClick is called when accordion item is expanded or collapsed\n * event.currentTarget.dataset.state will be either \"open\" or \"closed\"\n */\n onClick?: (event: AccordionItemOnClickEvent) => void;\n onOpen?: () => void;\n onClose?: () => void;\n};\n\nexport const AccordionItem = ({\n children,\n className,\n fullWidth = false,\n title,\n titleTag = \"h3\",\n initialOpen = false,\n onClick,\n onOpen,\n onClose,\n ...props\n}: AccordionItemProps) => {\n const negative = useContext(AccordionNegativeContext);\n const uid = useId();\n const [hidden, setHidden] = useState(!initialOpen);\n\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: negative,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n <Heading\n tag={titleTag}\n variant=\"title-100\"\n className={cx([`${rootClassName}__header`, `${rootClassName}__title`])}\n >\n <button\n type=\"button\"\n data-state={hidden ? \"open\" : \"close\"} // The state is actually set in the onClick, so reversing the data- output state here\n onClick={(e: AccordionItemOnClickEvent) => {\n onClick && onClick(e);\n if (hidden) {\n onOpen && onOpen();\n } else {\n onClose && onClose();\n }\n setHidden(!hidden);\n }}\n className={cx(`${rootClassName}__trigger`, className, {\n [`${rootClassName}__rotate`]: !hidden,\n })}\n aria-expanded={!hidden}\n aria-controls={uid}\n id={uid + \"button\"}\n >\n {title}\n <IconChevronDown size=\"md\" className={cx(`${rootClassName}__icon`)} aria-hidden />\n </button>\n </Heading>\n <div\n className={cx(`${rootClassName}__content`, className)}\n aria-hidden={hidden}\n id={uid}\n aria-labelledby={uid + \"button\"}\n role=\"region\"\n >\n <div\n className={cx(`${rootClassName}__contentText`, {\n [`${rootClassName}__contentText--limit-width`]: !fullWidth,\n })}\n >\n {typeof children === \"string\" ? (\n <Paragraph variant=\"paragraph-200\">{children}</Paragraph>\n ) : (\n children\n )}\n </div>\n </div>\n </div>\n );\n};\n","import React, { createContext, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType, type HeadingVariant } from \"@purpur/heading\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./accordion.module.scss\";\nimport { AccordionItem } from \"./accordion-item\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-accordion\";\n\nexport type AccordionProps = Omit<BaseProps, \"title\" | \"children\"> & {\n children: ReactNode;\n negative?: boolean;\n title?: ReactNode;\n titleTag?: HeadingTagType;\n titleVariant?: HeadingVariant;\n /**\n * A schema enables external applications to parse the content in a structured manner.\n * See more at schema.org . We use a JSON-LD based script-tag to add the schema to the DOM.\n * Note that only one type of schema can be added per page\n */\n schema?: string;\n};\n\nexport const AccordionNegativeContext = createContext(false);\n\nexport const Accordion = ({\n children,\n className,\n negative = false,\n title,\n titleTag = \"h2\",\n titleVariant = \"display-15\",\n schema,\n ...props\n}: AccordionProps) => {\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: negative,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n {title && (\n <Heading tag={titleTag} variant={titleVariant} className={cx(`${rootClassName}__title`)}>\n {title}\n </Heading>\n )}\n <AccordionNegativeContext.Provider value={negative}>\n {children}\n </AccordionNegativeContext.Provider>\n {schema && (\n <script\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: schema,\n }}\n />\n )}\n </div>\n );\n};\n\nAccordion.Item = AccordionItem;\nAccordion.displayName = \"Accordion\";\n\nexport type { AccordionItemOnClickEvent, AccordionItemProps } from \"./accordion-item\";\n"],"names":["cx","c","styles","rootClassName","AccordionItem","children","className","fullWidth","title","titleTag","initialOpen","onClick","onOpen","onClose","props","negative","useContext","AccordionNegativeContext","uid","useId","hidden","setHidden","useState","classes","jsxs","jsx","Heading","e","IconChevronDown","Paragraph","createContext","Accordion","titleVariant","schema"],"mappings":";;;;;;;;;;;;;;;;;;;;;;GAUMA,IAAKC,EAAE,KAAKC,CAAM,GAElBC,IAAgB,yBAqCTC,IAAgB,CAAC;AAAA,EAC5B,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,aAAAC,IAAc;AAAA,EACd,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,MAA0B;AACxB,QAAMC,IAAWC,EAAWC,CAAwB,GAC9CC,IAAMC,EAAA,GACN,CAACC,GAAQC,CAA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|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),p=require("react"),$=require("./heading-drD5ugCC.js"),j=require("./bind-DeUYJ6m9.js"),f=require("./chevron-down.es-BMjgiS3F.js"),q=require("./paragraph-
|
|
2
|
-
//# sourceMappingURL=accordion-
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),p=require("react"),$=require("./heading-drD5ugCC.js"),j=require("./bind-DeUYJ6m9.js"),f=require("./chevron-down.es-BMjgiS3F.js"),q=require("./paragraph-By4jMjnH.js"),A={"purpur-accordion":"_purpur-accordion_mwmy0_1","purpur-accordion__title":"_purpur-accordion__title_mwmy0_4","purpur-accordion--negative":"_purpur-accordion--negative_mwmy0_13"},C={"purpur-accordion-item":"_purpur-accordion-item_mnhg5_1","purpur-accordion-item__trigger":"_purpur-accordion-item__trigger_mnhg5_4","purpur-accordion-item__header":"_purpur-accordion-item__header_mnhg5_10","purpur-accordion-item__trigger__icon":"_purpur-accordion-item__trigger__icon_mnhg5_43","purpur-accordion-item__title":"_purpur-accordion-item__title_mnhg5_49","purpur-accordion-item__icon":"_purpur-accordion-item__icon_mnhg5_50","purpur-accordion-item__rotate":"_purpur-accordion-item__rotate_mnhg5_64","purpur-accordion-item__content":"_purpur-accordion-item__content_mnhg5_67","purpur-accordion-item__contentText":"_purpur-accordion-item__contentText_mnhg5_82","purpur-accordion-item__contentText--limit-width":"_purpur-accordion-item__contentText--limit-width_mnhg5_85","purpur-accordion-item--negative":"_purpur-accordion-item--negative_mnhg5_107"},i=j.c.bind(C),t="purpur-accordion-item",H=({children:n,className:o,fullWidth:a=!1,title:_,titleTag:m="h3",initialOpen:l=!1,onClick:c,onOpen:s,onClose:u,...y})=>{const N=p.useContext(h),d=p.useId(),[e,b]=p.useState(!l),w=i([t,{[`${t}--negative`]:N},o]);return r.jsxs("div",{className:w,...y,children:[r.jsx($.Heading,{tag:m,variant:"title-100",className:i([`${t}__header`,`${t}__title`]),children:r.jsxs("button",{type:"button","data-state":e?"open":"close",onClick:T=>{c&&c(T),e?s&&s():u&&u(),b(!e)},className:i(`${t}__trigger`,o,{[`${t}__rotate`]:!e}),"aria-expanded":!e,"aria-controls":d,id:d+"button",children:[_,r.jsx(f.l,{size:"md",className:i(`${t}__icon`),"aria-hidden":!0})]})}),r.jsx("div",{className:i(`${t}__content`,o),"aria-hidden":e,id:d,"aria-labelledby":d+"button",role:"region",children:r.jsx("div",{className:i(`${t}__contentText`,{[`${t}__contentText--limit-width`]:!a}),children:typeof n=="string"?r.jsx(q.Paragraph,{variant:"paragraph-200",children:n}):n})})]})},v=j.c.bind(A),g="purpur-accordion",h=p.createContext(!1),x=({children:n,className:o,negative:a=!1,title:_,titleTag:m="h2",titleVariant:l="display-15",schema:c,...s})=>{const u=v([g,{[`${g}--negative`]:a},o]);return r.jsxs("div",{className:u,...s,children:[_&&r.jsx($.Heading,{tag:m,variant:l,className:v(`${g}__title`),children:_}),r.jsx(h.Provider,{value:a,children:n}),c&&r.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:c}})]})};x.Item=H;x.displayName="Accordion";exports.Accordion=x;exports.AccordionNegativeContext=h;
|
|
2
|
+
//# sourceMappingURL=accordion-DyhOG54L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion-DyhOG54L.js","sources":["../../../components/accordion/src/accordion-item.tsx","../../../components/accordion/src/accordion.tsx"],"sourcesContent":["import React, { type ReactNode, useContext, useId, useState } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType } from \"@purpur/heading\";\nimport { IconChevronDown } from \"@purpur/icon/chevron-down\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport { AccordionNegativeContext } from \"./accordion\";\nimport styles from \"./accordion-item.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-accordion-item\";\n\nexport type AccordionItemOnClickEvent = React.MouseEvent<HTMLButtonElement, MouseEvent> & {\n currentTarget: { dataset: { state: \"open\" | \"closed\" } };\n};\n\nexport type AccordionItemProps = Omit<BaseProps, \"onClick\" | \"title\" | \"children\"> & {\n children: ReactNode;\n /**\n * If true, the children will take the full width without max-width constraint.\n * @default false\n */\n fullWidth?: boolean;\n /**\n * Content to be rendered inside a `button` element.\n * Only pass ReactNodes that are valid as children of a `button`, such as plain text,\n * inline elements like `span` or other non-interactive elements. Avoid block-level or interactive elements.\n */\n title: ReactNode;\n /**\n * This is the heading tag used for the accordion item title. Defaults to h3.\n * `type HeadingTagType = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\"`\n */\n titleTag?: HeadingTagType;\n /**\n * Makes it possible to set the initial state to opened\n * */\n initialOpen?: boolean;\n /**\n * onClick is called when accordion item is expanded or collapsed\n * event.currentTarget.dataset.state will be either \"open\" or \"closed\"\n */\n onClick?: (event: AccordionItemOnClickEvent) => void;\n onOpen?: () => void;\n onClose?: () => void;\n};\n\nexport const AccordionItem = ({\n children,\n className,\n fullWidth = false,\n title,\n titleTag = \"h3\",\n initialOpen = false,\n onClick,\n onOpen,\n onClose,\n ...props\n}: AccordionItemProps) => {\n const negative = useContext(AccordionNegativeContext);\n const uid = useId();\n const [hidden, setHidden] = useState(!initialOpen);\n\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: negative,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n <Heading\n tag={titleTag}\n variant=\"title-100\"\n className={cx([`${rootClassName}__header`, `${rootClassName}__title`])}\n >\n <button\n type=\"button\"\n data-state={hidden ? \"open\" : \"close\"} // The state is actually set in the onClick, so reversing the data- output state here\n onClick={(e: AccordionItemOnClickEvent) => {\n onClick && onClick(e);\n if (hidden) {\n onOpen && onOpen();\n } else {\n onClose && onClose();\n }\n setHidden(!hidden);\n }}\n className={cx(`${rootClassName}__trigger`, className, {\n [`${rootClassName}__rotate`]: !hidden,\n })}\n aria-expanded={!hidden}\n aria-controls={uid}\n id={uid + \"button\"}\n >\n {title}\n <IconChevronDown size=\"md\" className={cx(`${rootClassName}__icon`)} aria-hidden />\n </button>\n </Heading>\n <div\n className={cx(`${rootClassName}__content`, className)}\n aria-hidden={hidden}\n id={uid}\n aria-labelledby={uid + \"button\"}\n role=\"region\"\n >\n <div\n className={cx(`${rootClassName}__contentText`, {\n [`${rootClassName}__contentText--limit-width`]: !fullWidth,\n })}\n >\n {typeof children === \"string\" ? (\n <Paragraph variant=\"paragraph-200\">{children}</Paragraph>\n ) : (\n children\n )}\n </div>\n </div>\n </div>\n );\n};\n","import React, { createContext, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType, type HeadingVariant } from \"@purpur/heading\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./accordion.module.scss\";\nimport { AccordionItem } from \"./accordion-item\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-accordion\";\n\nexport type AccordionProps = Omit<BaseProps, \"title\" | \"children\"> & {\n children: ReactNode;\n negative?: boolean;\n title?: ReactNode;\n titleTag?: HeadingTagType;\n titleVariant?: HeadingVariant;\n /**\n * A schema enables external applications to parse the content in a structured manner.\n * See more at schema.org . We use a JSON-LD based script-tag to add the schema to the DOM.\n * Note that only one type of schema can be added per page\n */\n schema?: string;\n};\n\nexport const AccordionNegativeContext = createContext(false);\n\nexport const Accordion = ({\n children,\n className,\n negative = false,\n title,\n titleTag = \"h2\",\n titleVariant = \"display-15\",\n schema,\n ...props\n}: AccordionProps) => {\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: negative,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n {title && (\n <Heading tag={titleTag} variant={titleVariant} className={cx(`${rootClassName}__title`)}>\n {title}\n </Heading>\n )}\n <AccordionNegativeContext.Provider value={negative}>\n {children}\n </AccordionNegativeContext.Provider>\n {schema && (\n <script\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: schema,\n }}\n />\n )}\n </div>\n );\n};\n\nAccordion.Item = AccordionItem;\nAccordion.displayName = \"Accordion\";\n\nexport type { AccordionItemOnClickEvent, AccordionItemProps } from \"./accordion-item\";\n"],"names":["cx","c","styles","rootClassName","AccordionItem","children","className","fullWidth","title","titleTag","initialOpen","onClick","onOpen","onClose","props","negative","useContext","AccordionNegativeContext","uid","useId","hidden","setHidden","useState","classes","jsxs","jsx","Heading","e","IconChevronDown","Paragraph","createContext","Accordion","titleVariant","schema"],"mappings":"2uCAUMA,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAElBC,EAAgB,wBAqCTC,EAAgB,CAAC,CAC5B,SAAAC,EACA,UAAAC,EACA,UAAAC,EAAY,GACZ,MAAAC,EACA,SAAAC,EAAW,KACX,YAAAC,EAAc,GACd,QAAAC,EACA,OAAAC,EACA,QAAAC,EACA,GAAGC,CACL,IAA0B,CACxB,MAAMC,EAAWC,EAAAA,WAAWC,CAAwB,EAC9CC,EAAMC,EAAAA,MAAA,EACN,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,CAACZ,CAAW,EAE3Ca,EAAUvB,EAAG,CACjBG,EACA,CACE,CAAC,GAAGA,CAAa,YAAY,EAAGY,CAAA,EAElCT,CAAA,CACD,EAED,OACEkB,EAAAA,KAAC,MAAA,CAAI,UAAWD,EAAU,GAAGT,EAC3B,SAAA,CAAAW,EAAAA,IAACC,EAAAA,QAAA,CACC,IAAKjB,EACL,QAAQ,YACR,UAAWT,EAAG,CAAC,GAAGG,CAAa,WAAY,GAAGA,CAAa,SAAS,CAAC,EAErE,SAAAqB,EAAAA,KAAC,SAAA,CACC,KAAK,SACL,aAAYJ,EAAS,OAAS,QAC9B,QAAUO,GAAiC,CACzChB,GAAWA,EAAQgB,CAAC,EAChBP,EACFR,GAAUA,EAAA,EAEVC,GAAWA,EAAA,EAEbQ,EAAU,CAACD,CAAM,CACnB,EACA,UAAWpB,EAAG,GAAGG,CAAa,YAAaG,EAAW,CACpD,CAAC,GAAGH,CAAa,UAAU,EAAG,C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GACCR,EAAAA,IAAC,SAAA,CACC,KAAK,sBACL,wBAAyB,CACvB,OAAQQ,CAAA,CACV,CAAA,CACF,EAEJ,CAEJ,EAEAF,EAAU,KAAO3B,EACjB2B,EAAU,YAAc"}
|
package/dist/accordion.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./accordion-DyhOG54L.js");exports.Accordion=o.Accordion;exports.AccordionNegativeContext=o.AccordionNegativeContext;
|
|
2
2
|
//# sourceMappingURL=accordion.cjs.js.map
|
package/dist/accordion.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as c, a as e } from "./accordion-CIU4U8-4.mjs";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
c as Accordion,
|
|
4
|
+
e as AccordionNegativeContext
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=accordion.es.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const p=require("react/jsx-runtime"),r=require("react"),de=require("./chevron-down.es-BMjgiS3F.js"),M=require("./listbox-
|
|
2
|
-
//# sourceMappingURL=autocomplete-
|
|
1
|
+
"use strict";const p=require("react/jsx-runtime"),r=require("react"),de=require("./chevron-down.es-BMjgiS3F.js"),M=require("./listbox-ATP4hOWF.js"),pe=require("./text-field-CYJzQG3h.js"),be=require("./bind-DeUYJ6m9.js"),me={"purpur-autocomplete":"_purpur-autocomplete_dgjyz_1","purpur-autocomplete__listbox":"_purpur-autocomplete__listbox_dgjyz_4","purpur-autocomplete__chevron-button":"_purpur-autocomplete__chevron-button_dgjyz_9","purpur-autocomplete__chevron-icon":"_purpur-autocomplete__chevron-icon_dgjyz_15","purpur-autocomplete__chevron-icon--up":"_purpur-autocomplete__chevron-icon--up_dgjyz_20"},fe=i=>r.useRef(i),xe=(i,x)=>{const n=r.useCallback(_=>{i&&!i.contains(_.target)&&x()},[x,i]);r.useEffect(()=>(document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}),[n])},Z=({combobox:i,comboboxButtonAriaLabel:x,highlightFirstOption:n,defaultInputValue:_,inputValue:u,filterOption:R,id:l,listboxLabel:S,listboxMaxHeight:b,onInputBlur:h,onInputChange:L,onInputFocus:D,onInputKeyDown:k,onInputMouseDown:$,openOnFocus:A,noOptionsText:E,onSelect:T,options:a,selectedOption:t,["data-testid"]:y})=>{const[C,K]=r.useState(((typeof u=="string"?u:_)||t?.label)??""),F=typeof u=="string"?u:C,[c,v]=r.useState(n?a[0]:void 0),B=r.useRef(null),U=fe(null),N=r.useRef(null),O=r.useRef({}),[V,Y]=r.useState(!1);function q(e){return y?`${y}-${e}`:void 0}const w=()=>{Y(!1),v(void 0)};xe(U.current,w);const g=({eventType:e})=>{Y(!0),t&&requestAnimationFrame(()=>{v({...t,isSetByClickEvent:e==="CLICK"}),z(O.current[t.id])})},ee=e=>{if(R)return a.filter(s=>R(e,s));if(!e)return a;const o=e.toUpperCase().split(" ")||[];return a.filter(s=>o.every(f=>(s.value||s.label).toUpperCase().includes(f)))},G=e=>t&&t?.label===e?a:ee(e),d=G(F),P=e=>{L?.(e),K(e)},z=e=>{if(e){const o=e.getBoundingClientRect(),s=N.current?.getBoundingClientRect()||{top:0,bottom:0};(o.top<s.top||o.bottom>s.bottom)&&e.scrollIntoView({block:"nearest"})}},J=e=>{e&&(B.current?.focus(),P(e.label),T?.(e)),w()},te=e=>{const o=n&&!c?0:d.findIndex(f=>f&&c?.id===f.id),s=d.length;return e==="ArrowDown"?d[(o??-1)+1]||d[0]:d[(o??s)-1]||d[s-1]},m=V&&(!!d.length||!!E),oe=e=>{!m&&g({eventType:"KEYBOARD"});const o=te(e);v(o),o&&z(O.current[o.id])},ne=e=>{switch(k?.(e),e.key){case"ArrowUp":case"ArrowDown":e.preventDefault(),oe(e.key);break;case"Enter":{const o=c||(n?a[0]:void 0);m&&J(o),!m&&g({eventType:"KEYBOARD"});break}case"Escape":case"Tab":w();break}},se=e=>{const o=G(e.target.value);P(e.target.value),v(void 0),!m&&g({eventType:"KEYBOARD"}),n&&o[0]&&z(O.current[o[0].id])},ce=e=>{$?.(e),m?w():g({eventType:"CLICK"})},re=e=>{D?.(e),!V&&A&&g({eventType:"KEYBOARD"}),B.current?.select()},ie=e=>{h?.(e),setTimeout(()=>{!B.current?.contains(document.activeElement)&&!N.current?.contains(document.activeElement)&&(w(),i&&P(t?t.label:""))})},ue={maxHeight:typeof b=="number"?`${b}px`:b},Q={"aria-label":S,"aria-expanded":m,"data-testid":q("listbox"),id:`${l}-listbox`,ref:N,onMouseLeave:()=>v(void 0),style:b?ue:void 0},W=e=>`${l}-listbox-item-${e.id}`,le=(e,o)=>{const s=()=>e.id!==c?.id&&v({...e,isSetByClickEvent:!0}),f=(e.id===c?.id||!!n&&!c&&o===0)&&!c?.isSetByClickEvent;return{"data-testid":q(`listbox-item-${e.id}`),id:W(e),key:e.id,onMouseMove:s,onMouseUp:()=>J(e),ref:X=>{X&&(O.current[e.id]=X)},tabIndex:-1,selected:e.id===t?.id,disabled:e.disabled,highlighted:f,hovered:e.id===c?.id&&!!c?.isSetByClickEvent}},ae={"aria-activedescendant":c?W(c):void 0,"aria-autocomplete":"list","aria-controls":Q.id,"data-testid":q("input"),autoComplete:"off",id:`${l}-input`,onChange:se,onMouseDown:ce,onFocus:re,onKeyDown:ne,onBlur:ie,ref:B,role:"combobox",value:F};return{id:l,inputProps:ae,internalRef:U,optionsToShow:d,showListbox:m,noOptionsText:E,combobox:i,comboboxButtonAriaLabel:x,getListBoxItemProps:le,listboxProps:Q}},j=be.c.bind(me),I="purpur-autocomplete",ve=({className:i,renderInput:x,renderOption:n,..._},u)=>{const{id:R,inputProps:l,internalRef:S,optionsToShow:b,showListbox:h,noOptionsText:L,combobox:D,comboboxButtonAriaLabel:k,getListBoxItemProps:$,listboxProps:A}=Z(_),E=(t,y)=>{const{key:C,...K}=$(t,y);return p.jsx(M.Listbox.Item,{...K,children:n?n?.(t):t.label},C)},T=t=>{S.current=t,typeof u=="function"?u(t):u&&(u.current=t)},a=()=>{const t=x(l);if(D&&k&&L&&t&&pe.isTextField(t)){const C=p.jsxs(p.Fragment,{children:[t.props.endAdornment,p.jsx("button",{"data-testid":"chevron button",type:"button",className:j(`${I}__chevron-button`),onClick:()=>{l.onFocus(void 0),l.onMouseDown(void 0)},"aria-label":k,"aria-expanded":h,"aria-controls":A.id,children:p.jsx(de.l,{size:"sm",className:j(`${I}__chevron-icon`,{[`${I}__chevron-icon--up`]:h})})})]});return r.cloneElement(t,{endAdornment:C})}return t};return p.jsxs("div",{id:R,ref:T,className:j([I,i]),children:[a(),h&&p.jsx(M.Listbox,{...A,className:j(`${I}__listbox`),children:b.length?b.filter(t=>!!t).map(E):p.jsx(M.Listbox.Item,{noninteractive:!0,children:L})})]})},H=r.forwardRef(ve);H.displayName="Autocomplete";exports.Autocomplete=H;exports.useAutocomplete=Z;
|
|
2
|
+
//# sourceMappingURL=autocomplete-3kV1btuI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-D9uCJzjY.js","sources":["../../../components/autocomplete/src/utils.ts","../../../components/autocomplete/src/useAutocomplete.ts","../../../components/autocomplete/src/autocomplete.tsx"],"sourcesContent":["import { type RefObject, useCallback, useEffect, useRef } from \"react\";\n\n// Used to \"merge\" \"intersection types\". Used to get comments on the props to the docs.\nexport type Prettify<T> = {\n [K in keyof T]: T[K];\n} & {};\n\nexport const useRefObject = <T>(value: T): RefObject<T> => {\n return useRef<T>(value) as RefObject<T>;\n};\n\nexport const useOnClickOutside = (element: HTMLElement | null, callback: () => void) => {\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (element && !element.contains(event.target as Node)) {\n callback();\n }\n },\n [callback, element]\n );\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [handleClickOutside]);\n};\n","import type { CSSProperties, ReactNode } from \"react\";\nimport { useRef, useState } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport type { ListboxItemProps, ListboxProps } from \"@purpur/listbox\";\n\nimport { useOnClickOutside, useRefObject } from \"./utils\";\n\nexport type AutocompleteOption = {\n label: string;\n id: string;\n value?: string;\n disabled?: boolean;\n};\n\nexport type InputProps = Omit<BaseProps<\"input\">, \"onFocus\" | \"onMouseDown\"> & {\n onFocus: (event: React.FocusEvent<HTMLInputElement> | undefined) => void;\n onMouseDown: (event: React.MouseEvent<HTMLInputElement> | undefined) => void;\n};\n\ntype ComboboxProps = {\n /*\n * Set to get combobox features. Use in combination with `noOptionsText`, `comboboxButtonAriaLabel` and Purpur TextField.\n */\n combobox: true;\n /**\n * An accessible label for the button that toggles the list of options for a combobox.\n * */\n comboboxButtonAriaLabel: string;\n /*\n * Shown when there are no options to show. Will be displayed inside a listbox item.\n */\n noOptionsText: ReactNode;\n};\n\ntype NoComboboxProps = {\n combobox?: never;\n comboboxButtonAriaLabel?: never;\n /*\n * Shown when there are no options to show. Will be displayed inside a listbox item.\n */\n noOptionsText?: ReactNode;\n};\n\nexport type UseAutocompleteResult<T extends AutocompleteOption> = {\n /*\n * Set to highlight the first option in the listbox when the input is focused.\n */\n highlightFirstOption?: boolean;\n /*\n * The default input value. Only to use when the input is uncontrolled.\n */\n defaultInputValue?: string;\n /*\n * The input value. Use this to control the input value.\n */\n inputValue?: string;\n /*\n * Invoked for each option. Use to control which options are shown.\n */\n filterOption?: (inputValue: string | undefined, option: T) => boolean;\n /*\n * Id will be used to prefix id:s of all elements.\n */\n id: string;\n /*\n * The label of the listbox (dropdown) displaying the options.\n */\n listboxLabel: string;\n /*\n * The height of the listbox. Number will be interpreted as px value. defaults to `calc(2 * var(--purpur-spacing-1200))`.\n */\n listboxMaxHeight?: string | number;\n /*\n * NOTE! Always use this instead of onBlur directly on the input element. Event handler invoked on input blur.\n */\n onInputBlur?: React.FocusEventHandler<HTMLInputElement>;\n /*\n * NOTE! Always use this instead of onChange directly on the input element. Event handler invoked when the input value changes.\n */\n onInputChange?: (value: string) => void;\n /*\n * NOTE! Always use this instead of onFocus directly on the input element. Event handler invoked on input focus.\n */\n onInputFocus?: (event: React.FocusEvent<HTMLInputElement> | undefined) => undefined;\n /*\n * NOTE! Always use this instead of onKeyDown directly on the input element. Event handler invoked on input key down.\n */\n onInputKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;\n /*\n * NOTE! Always use this instead of onMouseDown directly on the input element. Event handler invoked on input mouse down.\n */\n onInputMouseDown?: (event: React.MouseEvent<HTMLInputElement> | undefined) => undefined;\n /*\n * Set to open the listbox when input gets focus.\n */\n openOnFocus?: boolean;\n /*\n * Event handler invoked when an option is selected.\n */\n onSelect?: (option: T | undefined) => void;\n /*\n * The list of options. Could include custom props.\n */\n options: T[];\n /*\n * The selected option.\n */\n selectedOption?: T;\n [\"data-testid\"]?: string;\n} & (ComboboxProps | NoComboboxProps);\n\nexport const useAutocomplete = <T extends AutocompleteOption>({\n combobox,\n comboboxButtonAriaLabel,\n highlightFirstOption,\n defaultInputValue,\n inputValue,\n filterOption,\n id,\n listboxLabel,\n listboxMaxHeight,\n onInputBlur,\n onInputChange,\n onInputFocus,\n onInputKeyDown,\n onInputMouseDown,\n openOnFocus,\n noOptionsText,\n onSelect,\n options,\n selectedOption,\n [\"data-testid\"]: dataTestid,\n}: UseAutocompleteResult<T>) => {\n const [internalInputValue, setInternalInputValue] = useState(\n ((typeof inputValue === \"string\" ? inputValue : defaultInputValue) || selectedOption?.label) ??\n \"\"\n );\n const definiteInputValue = typeof inputValue === \"string\" ? inputValue : internalInputValue;\n const [highlightedOption, setHighlightedOption] = useState<\n (T & { isSetByClickEvent?: false }) | undefined\n >(highlightFirstOption ? options[0] : undefined);\n const inputRef = useRef<HTMLInputElement>(null);\n const internalRef = useRefObject<HTMLDivElement | null>(null);\n const listboxRef = useRef<HTMLUListElement>(null);\n const optionRefs = useRef<Record<string, HTMLLIElement>>({});\n const [listboxIsOpen, setListboxIsOpen] = useState(false);\n\n function getTestId(name: string) {\n return dataTestid ? `${dataTestid}-${name}` : undefined;\n }\n\n const closeListbox = () => {\n setListboxIsOpen(false);\n setHighlightedOption(undefined);\n };\n\n useOnClickOutside(internalRef.current, closeListbox);\n\n const openListbox = ({ eventType }: { eventType: \"CLICK\" | \"KEYBOARD\" }) => {\n setListboxIsOpen(true);\n if (selectedOption) {\n requestAnimationFrame(() => {\n const isSetByClickEvent = eventType === \"CLICK\";\n setHighlightedOption({ ...selectedOption, isSetByClickEvent });\n scrollOptionIntoView(optionRefs.current[selectedOption.id]);\n });\n }\n };\n\n const filterOptions = (searchTerm: string | undefined) => {\n if (filterOption) {\n return options.filter((option) => filterOption(searchTerm, option));\n }\n\n if (!searchTerm) {\n return options;\n }\n\n const searchTermChunks = searchTerm.toUpperCase().split(\" \") || [];\n return options.filter((option) =>\n searchTermChunks.every((chunk) =>\n (option.value || option.label).toUpperCase().includes(chunk)\n )\n );\n };\n\n const getOptionsToShow = (searchTerm: string | undefined): (T | undefined)[] => {\n return selectedOption && selectedOption?.label === searchTerm\n ? options\n : filterOptions(searchTerm);\n };\n\n const optionsToShow = getOptionsToShow(definiteInputValue);\n\n const populateInputField = (value: string) => {\n onInputChange?.(value);\n setInternalInputValue(value);\n };\n\n const scrollOptionIntoView = (option: HTMLLIElement | undefined) => {\n if (option) {\n const optionRect = option.getBoundingClientRect();\n const listboxRect = listboxRef.current?.getBoundingClientRect() || { top: 0, bottom: 0 };\n const isOptionOutsideView =\n optionRect.top < listboxRect.top || optionRect.bottom > listboxRect.bottom;\n if (isOptionOutsideView) {\n option.scrollIntoView({ block: \"nearest\" });\n }\n }\n };\n\n const selectOption = (option: T | undefined) => {\n if (option) {\n inputRef.current?.focus();\n populateInputField(option.label);\n onSelect?.(option);\n }\n closeListbox();\n };\n\n const findNextOption = (key: \"ArrowUp\" | \"ArrowDown\"): T | undefined => {\n const index =\n highlightFirstOption && !highlightedOption\n ? 0\n : optionsToShow.findIndex((option) => option && highlightedOption?.id === option.id);\n\n const optionsLength = optionsToShow.length;\n\n return key === \"ArrowDown\"\n ? optionsToShow[(index ?? -1) + 1] || optionsToShow[0]\n : optionsToShow[(index ?? optionsLength) - 1] || optionsToShow[optionsLength - 1];\n };\n\n const showListbox = listboxIsOpen && (!!optionsToShow.length || !!noOptionsText);\n\n const highlightNextOption = (key: \"ArrowUp\" | \"ArrowDown\") => {\n !showListbox && openListbox({ eventType: \"KEYBOARD\" });\n const nextOption = findNextOption(key);\n\n setHighlightedOption(nextOption);\n nextOption && scrollOptionIntoView(optionRefs.current[nextOption.id]);\n };\n\n const handleOnKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {\n onInputKeyDown?.(event);\n switch (event.key) {\n case \"ArrowUp\":\n case \"ArrowDown\":\n event.preventDefault(); // Preventing default to not move cursor in input\n highlightNextOption(event.key);\n break;\n case \"Enter\": {\n const optionToSelect = highlightedOption || (highlightFirstOption ? options[0] : undefined);\n showListbox && selectOption(optionToSelect);\n !showListbox && openListbox({ eventType: \"KEYBOARD\" });\n break;\n }\n case \"Escape\":\n case \"Tab\":\n closeListbox();\n break;\n }\n };\n\n const handleOnChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {\n const nextOptionsToShow = getOptionsToShow(e.target.value);\n populateInputField(e.target.value);\n setHighlightedOption(undefined);\n !showListbox && openListbox({ eventType: \"KEYBOARD\" });\n highlightFirstOption &&\n nextOptionsToShow[0] &&\n scrollOptionIntoView(optionRefs.current[nextOptionsToShow[0].id]);\n };\n\n const handleOnMouseDown = (event: React.MouseEvent<HTMLInputElement> | undefined) => {\n onInputMouseDown?.(event);\n showListbox ? closeListbox() : openListbox({ eventType: \"CLICK\" });\n };\n\n const handleOnFocus = (event: React.FocusEvent<HTMLInputElement> | undefined) => {\n onInputFocus?.(event);\n !listboxIsOpen && openOnFocus && openListbox({ eventType: \"KEYBOARD\" });\n inputRef.current?.select();\n };\n\n const handleOnBlur: React.FocusEventHandler<HTMLInputElement> = (event) => {\n onInputBlur?.(event);\n // Use a timeout to allow click events on the listbox to fire before this check\n setTimeout(() => {\n if (\n !inputRef.current?.contains(document.activeElement) &&\n !listboxRef.current?.contains(document.activeElement)\n ) {\n closeListbox();\n\n // If the blur happened due to a click inside the listbox for a combobox, don't reset the value\n if (combobox) {\n populateInputField(selectedOption ? selectedOption.label : \"\");\n }\n }\n });\n };\n\n const listboxStyle: CSSProperties = {\n maxHeight: typeof listboxMaxHeight === \"number\" ? `${listboxMaxHeight}px` : listboxMaxHeight,\n };\n\n const listboxProps: ListboxProps = {\n \"aria-label\": listboxLabel,\n \"aria-expanded\": showListbox,\n \"data-testid\": getTestId(\"listbox\"),\n id: `${id}-listbox`,\n ref: listboxRef,\n onMouseLeave: () => setHighlightedOption(undefined),\n style: listboxMaxHeight ? listboxStyle : undefined,\n };\n\n const createListboxItemId = (option: T) => `${id}-listbox-item-${option.id}`;\n\n const getListBoxItemProps = (option: T, index: number): ListboxItemProps => {\n const handleOnMouseMove = () =>\n option.id !== highlightedOption?.id &&\n setHighlightedOption({ ...option, isSetByClickEvent: true });\n\n const highlighted =\n (option.id === highlightedOption?.id ||\n (!!highlightFirstOption && !highlightedOption && index === 0)) &&\n !highlightedOption?.isSetByClickEvent;\n\n return {\n \"data-testid\": getTestId(`listbox-item-${option.id}`),\n id: createListboxItemId(option),\n key: option.id,\n onMouseMove: handleOnMouseMove,\n onMouseUp: () => selectOption(option),\n ref: (el) => {\n if (el) {\n optionRefs.current[option.id] = el;\n }\n },\n tabIndex: -1,\n selected: option.id === selectedOption?.id,\n disabled: option.disabled,\n highlighted,\n hovered: option.id === highlightedOption?.id && !!highlightedOption?.isSetByClickEvent,\n };\n };\n\n const inputProps: InputProps = {\n \"aria-activedescendant\": highlightedOption ? createListboxItemId(highlightedOption) : undefined,\n \"aria-autocomplete\": \"list\",\n \"aria-controls\": listboxProps.id,\n \"data-testid\": getTestId(\"input\"),\n autoComplete: \"off\",\n id: `${id}-input`,\n onChange: handleOnChange,\n onMouseDown: handleOnMouseDown,\n onFocus: handleOnFocus,\n onKeyDown: handleOnKeyDown,\n onBlur: handleOnBlur,\n ref: inputRef,\n role: \"combobox\",\n value: definiteInputValue,\n };\n\n return {\n id,\n inputProps,\n internalRef,\n optionsToShow,\n showListbox,\n noOptionsText,\n combobox,\n comboboxButtonAriaLabel,\n getListBoxItemProps,\n listboxProps,\n };\n};\n","import type { ComponentPropsWithRef, ForwardedRef, ReactNode } from \"react\";\nimport React, { cloneElement, forwardRef } from \"react\";\nimport { IconChevronDown } from \"@purpur/icon/chevron-down\";\nimport { Listbox } from \"@purpur/listbox\";\nimport { isTextField } from \"@purpur/text-field\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./autocomplete.module.scss\";\nimport type { AutocompleteOption, UseAutocompleteResult } from \"./useAutocomplete\";\nimport { useAutocomplete } from \"./useAutocomplete\";\nimport type { Prettify } from \"./utils\";\n\nconst cx = c.bind(styles);\n\ntype AutocompleteProps<T extends AutocompleteOption> = Prettify<\n UseAutocompleteResult<T> & {\n className?: string;\n /**\n * Render the input. `props` are native input props\n */\n renderInput: (props: ComponentPropsWithRef<\"input\">) => ReactNode;\n /**\n * Invoked for each given option. Use to customize the rendering of the options\n */\n renderOption?: (option: T) => ReactNode;\n }\n>;\n\nconst rootClassName = \"purpur-autocomplete\";\n\nconst AutocompleteComponent = <T extends AutocompleteOption>(\n { className, renderInput, renderOption, ...useAutocompleteProps }: AutocompleteProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n) => {\n const {\n id,\n inputProps,\n internalRef,\n optionsToShow,\n showListbox,\n noOptionsText,\n combobox,\n comboboxButtonAriaLabel,\n getListBoxItemProps,\n listboxProps,\n } = useAutocomplete(useAutocompleteProps);\n\n const renderListboxItem = (option: T, index: number) => {\n const { key, ...listboxItemProps } = getListBoxItemProps(option, index);\n\n return (\n <Listbox.Item key={key} {...listboxItemProps}>\n {renderOption ? renderOption?.(option) : option.label}\n </Listbox.Item>\n );\n };\n\n const setRootRef = (node: HTMLDivElement | null) => {\n internalRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n };\n\n const getInputComponent = () => {\n const input = renderInput(inputProps);\n const isCombobox =\n combobox && comboboxButtonAriaLabel && noOptionsText && input && isTextField(input);\n\n if (isCombobox) {\n const endAdornment = (\n <>\n {input.props.endAdornment}\n <button\n data-testid=\"chevron button\"\n type=\"button\"\n className={cx(`${rootClassName}__chevron-button`)}\n onClick={() => {\n inputProps.onFocus(undefined);\n inputProps.onMouseDown(undefined);\n }}\n aria-label={comboboxButtonAriaLabel}\n aria-expanded={showListbox}\n aria-controls={listboxProps.id}\n >\n <IconChevronDown\n size=\"sm\"\n className={cx(`${rootClassName}__chevron-icon`, {\n [`${rootClassName}__chevron-icon--up`]: showListbox,\n })}\n />\n </button>\n </>\n );\n\n return cloneElement(input, { endAdornment });\n }\n\n return input;\n };\n\n return (\n <div id={id} ref={setRootRef} className={cx([rootClassName, className])}>\n {getInputComponent()}\n {showListbox && (\n <Listbox {...listboxProps} className={cx(`${rootClassName}__listbox`)}>\n {!optionsToShow.length ? (\n <Listbox.Item noninteractive>{noOptionsText}</Listbox.Item>\n ) : (\n optionsToShow.filter((option): option is T => !!option).map(renderListboxItem)\n )}\n </Listbox>\n )}\n </div>\n );\n};\n\n/* @deprecated use `Dropdown` or `SearchField` instead, this is only exported for backwards compatibility and will be removed in a future release */\nexport const Autocomplete = forwardRef(AutocompleteComponent);\nAutocomplete.displayName = \"Autocomplete\";\n\nexport type {\n AutocompleteOption,\n UseAutocompleteResult as UseAutocompleteOptions,\n} from \"./useAutocomplete\";\nexport { useAutocomplete } from \"./useAutocomplete\";\n"],"names":["useRefObject","value","useRef","useOnClickOutside","element","callback","handleClickOutside","useCallback","event","useEffect","useAutocomplete","combobox","comboboxButtonAriaLabel","highlightFirstOption","defaultInputValue","inputValue","filterOption","id","listboxLabel","listboxMaxHeight","onInputBlur","onInputChange","onInputFocus","onInputKeyDown","onInputMouseDown","openOnFocus","noOptionsText","onSelect","options","selectedOption","dataTestid","internalInputValue","setInternalInputValue","useState","definiteInputValue","highlightedOption","setHighlightedOption","inputRef","internalRef","listboxRef","optionRefs","listboxIsOpen","setListboxIsOpen","getTestId","name","closeListbox","openListbox","eventType","scrollOptionIntoView","filterOptions","searchTerm","option","searchTermChunks","chunk","getOptionsToShow","optionsToShow","populateInputField","optionRect","listboxRect","selectOption","findNextOption","key","index","optionsLength","showListbox","highlightNextOption","nextOption","handleOnKeyDown","optionToSelect","handleOnChange","nextOptionsToShow","handleOnMouseDown","handleOnFocus","handleOnBlur","listboxStyle","listboxProps","createListboxItemId","getListBoxItemProps","handleOnMouseMove","highlighted","el","inputProps","cx","c","styles","rootClassName","AutocompleteComponent","className","renderInput","renderOption","useAutocompleteProps","ref","renderListboxItem","listboxItemProps","jsx","Listbox","setRootRef","node","getInputComponent","input","isTextField","endAdornment","jsxs","Fragment","IconChevronDown","cloneElement","Autocomplete","forwardRef"],"mappings":"8lBAOaA,GAAmBC,GACvBC,EAAAA,OAAUD,CAAK,EAGXE,GAAoB,CAACC,EAA6BC,IAAyB,CACtF,MAAMC,EAAqBC,EAAAA,YACxBC,GAAsB,CACjBJ,GAAW,CAACA,EAAQ,SAASI,EAAM,MAAc,GACnDH,EAAA,CAEJ,EACA,CAACA,EAAUD,CAAO,CAAA,EAGpBK,EAAAA,UAAU,KACR,SAAS,iBAAiB,YAAaH,CAAkB,EAClD,IAAM,CACX,SAAS,oBAAoB,YAAaA,CAAkB,CAC9D,GACC,CAACA,CAAkB,CAAC,CACzB,ECoFaI,EAAkB,CAA+B,CAC5D,SAAAC,EACA,wBAAAC,EACA,qBAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,aAAAC,EACA,GAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,cAAAC,EAC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AAGrB,CAAA,CACzC,CAAA,CAAA,CACH,CAAA,CACF,EACF,EAGF,OAAOyC,eAAaN,EAAO,CAAE,aAAAE,EAAc,CAC7C,CAEA,OAAOF,CACT,EAEA,OACEG,EAAAA,KAAC,MAAA,CAAI,GAAArF,EAAQ,IAAK+E,EAAY,UAAWd,EAAG,CAACG,EAAeE,CAAS,CAAC,EACnE,SAAA,CAAAW,EAAA,EACAlC,GACC8B,EAAAA,IAACC,EAAAA,QAAA,CAAS,GAAGpB,EAAc,UAAWO,EAAG,GAAGG,CAAa,WAAW,EACjE,SAAC9B,EAAc,OAGdA,EAAc,OAAQJ,GAAwB,CAAC,CAACA,CAAM,EAAE,IAAIyC,CAAiB,EAF7EE,EAAAA,IAACC,EAAAA,QAAQ,KAAR,CAAa,eAAc,GAAE,SAAArE,CAAA,CAAc,CAEiC,CAEjF,CAAA,EAEJ,CAEJ,EAGagF,EAAeC,EAAAA,WAAWrB,EAAqB,EAC5DoB,EAAa,YAAc"}
|
|
1
|
+
{"version":3,"file":"autocomplete-3kV1btuI.js","sources":["../../../components/autocomplete/src/utils.ts","../../../components/autocomplete/src/useAutocomplete.ts","../../../components/autocomplete/src/autocomplete.tsx"],"sourcesContent":["import { type RefObject, useCallback, useEffect, useRef } from \"react\";\n\n// Used to \"merge\" \"intersection types\". Used to get comments on the props to the docs.\nexport type Prettify<T> = {\n [K in keyof T]: T[K];\n} & {};\n\nexport const useRefObject = <T>(value: T): RefObject<T> => {\n return useRef<T>(value) as RefObject<T>;\n};\n\nexport const useOnClickOutside = (element: HTMLElement | null, callback: () => void) => {\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (element && !element.contains(event.target as Node)) {\n callback();\n }\n },\n [callback, element]\n );\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [handleClickOutside]);\n};\n","import type { CSSProperties, ReactNode } from \"react\";\nimport { useRef, useState } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport type { ListboxItemProps, ListboxProps } from \"@purpur/listbox\";\n\nimport { useOnClickOutside, useRefObject } from \"./utils\";\n\nexport type AutocompleteOption = {\n label: string;\n id: string;\n value?: string;\n disabled?: boolean;\n};\n\nexport type InputProps = Omit<BaseProps<\"input\">, \"onFocus\" | \"onMouseDown\"> & {\n onFocus: (event: React.FocusEvent<HTMLInputElement> | undefined) => void;\n onMouseDown: (event: React.MouseEvent<HTMLInputElement> | undefined) => void;\n};\n\ntype ComboboxProps = {\n /*\n * Set to get combobox features. Use in combination with `noOptionsText`, `comboboxButtonAriaLabel` and Purpur TextField.\n */\n combobox: true;\n /**\n * An accessible label for the button that toggles the list of options for a combobox.\n * */\n comboboxButtonAriaLabel: string;\n /*\n * Shown when there are no options to show. Will be displayed inside a listbox item.\n */\n noOptionsText: ReactNode;\n};\n\ntype NoComboboxProps = {\n combobox?: never;\n comboboxButtonAriaLabel?: never;\n /*\n * Shown when there are no options to show. Will be displayed inside a listbox item.\n */\n noOptionsText?: ReactNode;\n};\n\nexport type UseAutocompleteResult<T extends AutocompleteOption> = {\n /*\n * Set to highlight the first option in the listbox when the input is focused.\n */\n highlightFirstOption?: boolean;\n /*\n * The default input value. Only to use when the input is uncontrolled.\n */\n defaultInputValue?: string;\n /*\n * The input value. Use this to control the input value.\n */\n inputValue?: string;\n /*\n * Invoked for each option. Use to control which options are shown.\n */\n filterOption?: (inputValue: string | undefined, option: T) => boolean;\n /*\n * Id will be used to prefix id:s of all elements.\n */\n id: string;\n /*\n * The label of the listbox (dropdown) displaying the options.\n */\n listboxLabel: string;\n /*\n * The height of the listbox. Number will be interpreted as px value. defaults to `calc(2 * var(--purpur-spacing-1200))`.\n */\n listboxMaxHeight?: string | number;\n /*\n * NOTE! Always use this instead of onBlur directly on the input element. Event handler invoked on input blur.\n */\n onInputBlur?: React.FocusEventHandler<HTMLInputElement>;\n /*\n * NOTE! Always use this instead of onChange directly on the input element. Event handler invoked when the input value changes.\n */\n onInputChange?: (value: string) => void;\n /*\n * NOTE! Always use this instead of onFocus directly on the input element. Event handler invoked on input focus.\n */\n onInputFocus?: (event: React.FocusEvent<HTMLInputElement> | undefined) => undefined;\n /*\n * NOTE! Always use this instead of onKeyDown directly on the input element. Event handler invoked on input key down.\n */\n onInputKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;\n /*\n * NOTE! Always use this instead of onMouseDown directly on the input element. Event handler invoked on input mouse down.\n */\n onInputMouseDown?: (event: React.MouseEvent<HTMLInputElement> | undefined) => undefined;\n /*\n * Set to open the listbox when input gets focus.\n */\n openOnFocus?: boolean;\n /*\n * Event handler invoked when an option is selected.\n */\n onSelect?: (option: T | undefined) => void;\n /*\n * The list of options. Could include custom props.\n */\n options: T[];\n /*\n * The selected option.\n */\n selectedOption?: T;\n [\"data-testid\"]?: string;\n} & (ComboboxProps | NoComboboxProps);\n\nexport const useAutocomplete = <T extends AutocompleteOption>({\n combobox,\n comboboxButtonAriaLabel,\n highlightFirstOption,\n defaultInputValue,\n inputValue,\n filterOption,\n id,\n listboxLabel,\n listboxMaxHeight,\n onInputBlur,\n onInputChange,\n onInputFocus,\n onInputKeyDown,\n onInputMouseDown,\n openOnFocus,\n noOptionsText,\n onSelect,\n options,\n selectedOption,\n [\"data-testid\"]: dataTestid,\n}: UseAutocompleteResult<T>) => {\n const [internalInputValue, setInternalInputValue] = useState(\n ((typeof inputValue === \"string\" ? inputValue : defaultInputValue) || selectedOption?.label) ??\n \"\"\n );\n const definiteInputValue = typeof inputValue === \"string\" ? inputValue : internalInputValue;\n const [highlightedOption, setHighlightedOption] = useState<\n (T & { isSetByClickEvent?: false }) | undefined\n >(highlightFirstOption ? options[0] : undefined);\n const inputRef = useRef<HTMLInputElement>(null);\n const internalRef = useRefObject<HTMLDivElement | null>(null);\n const listboxRef = useRef<HTMLUListElement>(null);\n const optionRefs = useRef<Record<string, HTMLLIElement>>({});\n const [listboxIsOpen, setListboxIsOpen] = useState(false);\n\n function getTestId(name: string) {\n return dataTestid ? `${dataTestid}-${name}` : undefined;\n }\n\n const closeListbox = () => {\n setListboxIsOpen(false);\n setHighlightedOption(undefined);\n };\n\n useOnClickOutside(internalRef.current, closeListbox);\n\n const openListbox = ({ eventType }: { eventType: \"CLICK\" | \"KEYBOARD\" }) => {\n setListboxIsOpen(true);\n if (selectedOption) {\n requestAnimationFrame(() => {\n const isSetByClickEvent = eventType === \"CLICK\";\n setHighlightedOption({ ...selectedOption, isSetByClickEvent });\n scrollOptionIntoView(optionRefs.current[selectedOption.id]);\n });\n }\n };\n\n const filterOptions = (searchTerm: string | undefined) => {\n if (filterOption) {\n return options.filter((option) => filterOption(searchTerm, option));\n }\n\n if (!searchTerm) {\n return options;\n }\n\n const searchTermChunks = searchTerm.toUpperCase().split(\" \") || [];\n return options.filter((option) =>\n searchTermChunks.every((chunk) =>\n (option.value || option.label).toUpperCase().includes(chunk)\n )\n );\n };\n\n const getOptionsToShow = (searchTerm: string | undefined): (T | undefined)[] => {\n return selectedOption && selectedOption?.label === searchTerm\n ? options\n : filterOptions(searchTerm);\n };\n\n const optionsToShow = getOptionsToShow(definiteInputValue);\n\n const populateInputField = (value: string) => {\n onInputChange?.(value);\n setInternalInputValue(value);\n };\n\n const scrollOptionIntoView = (option: HTMLLIElement | undefined) => {\n if (option) {\n const optionRect = option.getBoundingClientRect();\n const listboxRect = listboxRef.current?.getBoundingClientRect() || { top: 0, bottom: 0 };\n const isOptionOutsideView =\n optionRect.top < listboxRect.top || optionRect.bottom > listboxRect.bottom;\n if (isOptionOutsideView) {\n option.scrollIntoView({ block: \"nearest\" });\n }\n }\n };\n\n const selectOption = (option: T | undefined) => {\n if (option) {\n inputRef.current?.focus();\n populateInputField(option.label);\n onSelect?.(option);\n }\n closeListbox();\n };\n\n const findNextOption = (key: \"ArrowUp\" | \"ArrowDown\"): T | undefined => {\n const index =\n highlightFirstOption && !highlightedOption\n ? 0\n : optionsToShow.findIndex((option) => option && highlightedOption?.id === option.id);\n\n const optionsLength = optionsToShow.length;\n\n return key === \"ArrowDown\"\n ? optionsToShow[(index ?? -1) + 1] || optionsToShow[0]\n : optionsToShow[(index ?? optionsLength) - 1] || optionsToShow[optionsLength - 1];\n };\n\n const showListbox = listboxIsOpen && (!!optionsToShow.length || !!noOptionsText);\n\n const highlightNextOption = (key: \"ArrowUp\" | \"ArrowDown\") => {\n !showListbox && openListbox({ eventType: \"KEYBOARD\" });\n const nextOption = findNextOption(key);\n\n setHighlightedOption(nextOption);\n nextOption && scrollOptionIntoView(optionRefs.current[nextOption.id]);\n };\n\n const handleOnKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {\n onInputKeyDown?.(event);\n switch (event.key) {\n case \"ArrowUp\":\n case \"ArrowDown\":\n event.preventDefault(); // Preventing default to not move cursor in input\n highlightNextOption(event.key);\n break;\n case \"Enter\": {\n const optionToSelect = highlightedOption || (highlightFirstOption ? options[0] : undefined);\n showListbox && selectOption(optionToSelect);\n !showListbox && openListbox({ eventType: \"KEYBOARD\" });\n break;\n }\n case \"Escape\":\n case \"Tab\":\n closeListbox();\n break;\n }\n };\n\n const handleOnChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {\n const nextOptionsToShow = getOptionsToShow(e.target.value);\n populateInputField(e.target.value);\n setHighlightedOption(undefined);\n !showListbox && openListbox({ eventType: \"KEYBOARD\" });\n highlightFirstOption &&\n nextOptionsToShow[0] &&\n scrollOptionIntoView(optionRefs.current[nextOptionsToShow[0].id]);\n };\n\n const handleOnMouseDown = (event: React.MouseEvent<HTMLInputElement> | undefined) => {\n onInputMouseDown?.(event);\n showListbox ? closeListbox() : openListbox({ eventType: \"CLICK\" });\n };\n\n const handleOnFocus = (event: React.FocusEvent<HTMLInputElement> | undefined) => {\n onInputFocus?.(event);\n !listboxIsOpen && openOnFocus && openListbox({ eventType: \"KEYBOARD\" });\n inputRef.current?.select();\n };\n\n const handleOnBlur: React.FocusEventHandler<HTMLInputElement> = (event) => {\n onInputBlur?.(event);\n // Use a timeout to allow click events on the listbox to fire before this check\n setTimeout(() => {\n if (\n !inputRef.current?.contains(document.activeElement) &&\n !listboxRef.current?.contains(document.activeElement)\n ) {\n closeListbox();\n\n // If the blur happened due to a click inside the listbox for a combobox, don't reset the value\n if (combobox) {\n populateInputField(selectedOption ? selectedOption.label : \"\");\n }\n }\n });\n };\n\n const listboxStyle: CSSProperties = {\n maxHeight: typeof listboxMaxHeight === \"number\" ? `${listboxMaxHeight}px` : listboxMaxHeight,\n };\n\n const listboxProps: ListboxProps = {\n \"aria-label\": listboxLabel,\n \"aria-expanded\": showListbox,\n \"data-testid\": getTestId(\"listbox\"),\n id: `${id}-listbox`,\n ref: listboxRef,\n onMouseLeave: () => setHighlightedOption(undefined),\n style: listboxMaxHeight ? listboxStyle : undefined,\n };\n\n const createListboxItemId = (option: T) => `${id}-listbox-item-${option.id}`;\n\n const getListBoxItemProps = (option: T, index: number): ListboxItemProps => {\n const handleOnMouseMove = () =>\n option.id !== highlightedOption?.id &&\n setHighlightedOption({ ...option, isSetByClickEvent: true });\n\n const highlighted =\n (option.id === highlightedOption?.id ||\n (!!highlightFirstOption && !highlightedOption && index === 0)) &&\n !highlightedOption?.isSetByClickEvent;\n\n return {\n \"data-testid\": getTestId(`listbox-item-${option.id}`),\n id: createListboxItemId(option),\n key: option.id,\n onMouseMove: handleOnMouseMove,\n onMouseUp: () => selectOption(option),\n ref: (el) => {\n if (el) {\n optionRefs.current[option.id] = el;\n }\n },\n tabIndex: -1,\n selected: option.id === selectedOption?.id,\n disabled: option.disabled,\n highlighted,\n hovered: option.id === highlightedOption?.id && !!highlightedOption?.isSetByClickEvent,\n };\n };\n\n const inputProps: InputProps = {\n \"aria-activedescendant\": highlightedOption ? createListboxItemId(highlightedOption) : undefined,\n \"aria-autocomplete\": \"list\",\n \"aria-controls\": listboxProps.id,\n \"data-testid\": getTestId(\"input\"),\n autoComplete: \"off\",\n id: `${id}-input`,\n onChange: handleOnChange,\n onMouseDown: handleOnMouseDown,\n onFocus: handleOnFocus,\n onKeyDown: handleOnKeyDown,\n onBlur: handleOnBlur,\n ref: inputRef,\n role: \"combobox\",\n value: definiteInputValue,\n };\n\n return {\n id,\n inputProps,\n internalRef,\n optionsToShow,\n showListbox,\n noOptionsText,\n combobox,\n comboboxButtonAriaLabel,\n getListBoxItemProps,\n listboxProps,\n };\n};\n","import type { ComponentPropsWithRef, ForwardedRef, ReactNode } from \"react\";\nimport React, { cloneElement, forwardRef } from \"react\";\nimport { IconChevronDown } from \"@purpur/icon/chevron-down\";\nimport { Listbox } from \"@purpur/listbox\";\nimport { isTextField } from \"@purpur/text-field\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./autocomplete.module.scss\";\nimport type { AutocompleteOption, UseAutocompleteResult } from \"./useAutocomplete\";\nimport { useAutocomplete } from \"./useAutocomplete\";\nimport type { Prettify } from \"./utils\";\n\nconst cx = c.bind(styles);\n\ntype AutocompleteProps<T extends AutocompleteOption> = Prettify<\n UseAutocompleteResult<T> & {\n className?: string;\n /**\n * Render the input. `props` are native input props\n */\n renderInput: (props: ComponentPropsWithRef<\"input\">) => ReactNode;\n /**\n * Invoked for each given option. Use to customize the rendering of the options\n */\n renderOption?: (option: T) => ReactNode;\n }\n>;\n\nconst rootClassName = \"purpur-autocomplete\";\n\nconst AutocompleteComponent = <T extends AutocompleteOption>(\n { className, renderInput, renderOption, ...useAutocompleteProps }: AutocompleteProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n) => {\n const {\n id,\n inputProps,\n internalRef,\n optionsToShow,\n showListbox,\n noOptionsText,\n combobox,\n comboboxButtonAriaLabel,\n getListBoxItemProps,\n listboxProps,\n } = useAutocomplete(useAutocompleteProps);\n\n const renderListboxItem = (option: T, index: number) => {\n const { key, ...listboxItemProps } = getListBoxItemProps(option, index);\n\n return (\n <Listbox.Item key={key} {...listboxItemProps}>\n {renderOption ? renderOption?.(option) : option.label}\n </Listbox.Item>\n );\n };\n\n const setRootRef = (node: HTMLDivElement | null) => {\n internalRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n };\n\n const getInputComponent = () => {\n const input = renderInput(inputProps);\n const isCombobox =\n combobox && comboboxButtonAriaLabel && noOptionsText && input && isTextField(input);\n\n if (isCombobox) {\n const endAdornment = (\n <>\n {input.props.endAdornment}\n <button\n data-testid=\"chevron button\"\n type=\"button\"\n className={cx(`${rootClassName}__chevron-button`)}\n onClick={() => {\n inputProps.onFocus(undefined);\n inputProps.onMouseDown(undefined);\n }}\n aria-label={comboboxButtonAriaLabel}\n aria-expanded={showListbox}\n aria-controls={listboxProps.id}\n >\n <IconChevronDown\n size=\"sm\"\n className={cx(`${rootClassName}__chevron-icon`, {\n [`${rootClassName}__chevron-icon--up`]: showListbox,\n })}\n />\n </button>\n </>\n );\n\n return cloneElement(input, { endAdornment });\n }\n\n return input;\n };\n\n return (\n <div id={id} ref={setRootRef} className={cx([rootClassName, className])}>\n {getInputComponent()}\n {showListbox && (\n <Listbox {...listboxProps} className={cx(`${rootClassName}__listbox`)}>\n {!optionsToShow.length ? (\n <Listbox.Item noninteractive>{noOptionsText}</Listbox.Item>\n ) : (\n optionsToShow.filter((option): option is T => !!option).map(renderListboxItem)\n )}\n </Listbox>\n )}\n </div>\n );\n};\n\n/* @deprecated use `Dropdown` or `SearchField` instead, this is only exported for backwards compatibility and will be removed in a future release */\nexport const Autocomplete = forwardRef(AutocompleteComponent);\nAutocomplete.displayName = \"Autocomplete\";\n\nexport type {\n AutocompleteOption,\n UseAutocompleteResult as UseAutocompleteOptions,\n} from \"./useAutocomplete\";\nexport { useAutocomplete } from \"./useAutocomplete\";\n"],"names":["useRefObject","value","useRef","useOnClickOutside","element","callback","handleClickOutside","useCallback","event","useEffect","useAutocomplete","combobox","comboboxButtonAriaLabel","highlightFirstOption","defaultInputValue","inputValue","filterOption","id","listboxLabel","listboxMaxHeight","onInputBlur","onInputChange","onInputFocus","onInputKeyDown","onInputMouseDown","openOnFocus","noOptionsText","onSelect","options","selectedOption","dataTestid","internalInputValue","setInternalInputValue","useState","definiteInputValue","highlightedOption","setHighlightedOption","inputRef","internalRef","listboxRef","optionRefs","listboxIsOpen","setListboxIsOpen","getTestId","name","closeListbox","openListbox","eventType","scrollOptionIntoView","filterOptions","searchTerm","option","searchTermChunks","chunk","getOptionsToShow","optionsToShow","populateInputField","optionRect","listboxRect","selectOption","findNextOption","key","index","optionsLength","showListbox","highlightNextOption","nextOption","handleOnKeyDown","optionToSelect","handleOnChange","nextOptionsToShow","handleOnMouseDown","handleOnFocus","handleOnBlur","listboxStyle","listboxProps","createListboxItemId","getListBoxItemProps","handleOnMouseMove","highlighted","el","inputProps","cx","c","styles","rootClassName","AutocompleteComponent","className","renderInput","renderOption","useAutocompleteProps","ref","renderListboxItem","listboxItemProps","jsx","Listbox","setRootRef","node","getInputComponent","input","isTextField","endAdornment","jsxs","Fragment","IconChevronDown","cloneElement","Autocomplete","forwardRef"],"mappings":"8lBAOaA,GAAmBC,GACvBC,EAAAA,OAAUD,CAAK,EAGXE,GAAoB,CAACC,EAA6BC,IAAyB,CACtF,MAAMC,EAAqBC,EAAAA,YACxBC,GAAsB,CACjBJ,GAAW,CAACA,EAAQ,SAASI,EAAM,MAAc,GACnDH,EAAA,CAEJ,EACA,CAACA,EAAUD,CAAO,CAAA,EAGpBK,EAAAA,UAAU,KACR,SAAS,iBAAiB,YAAaH,CAAkB,EAClD,IAAM,CACX,SAAS,oBAAoB,YAAaA,CAAkB,CAC9D,GACC,CAACA,CAAkB,CAAC,CACzB,ECoFaI,EAAkB,CAA+B,CAC5D,SAAAC,EACA,wBAAAC,EACA,qBAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,aAAAC,EACA,GAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,cAAAC,EACA,aAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,cAAAC,EACA,SAAAC,EACA,QAAAC,EACA,eAAAC,EACA,CAAC,eAAgBC,CACnB,IAA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EAEA,OACEG,EAAAA,KAAC,MAAA,CAAI,GAAArF,EAAQ,IAAK+E,EAAY,UAAWd,EAAG,CAACG,EAAeE,CAAS,CAAC,EACnE,SAAA,CAAAW,EAAA,EACAlC,GACC8B,EAAAA,IAACC,EAAAA,QAAA,CAAS,GAAGpB,EAAc,UAAWO,EAAG,GAAGG,CAAa,WAAW,EACjE,SAAC9B,EAAc,OAGdA,EAAc,OAAQJ,GAAwB,CAAC,CAACA,CAAM,EAAE,IAAIyC,CAAiB,EAF7EE,EAAAA,IAACC,EAAAA,QAAQ,KAAR,CAAa,eAAc,GAAE,SAAArE,CAAA,CAAc,CAEiC,CAEjF,CAAA,EAEJ,CAEJ,EAGagF,EAAeC,EAAAA,WAAWrB,EAAqB,EAC5DoB,EAAa,YAAc"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as H, jsx as g, Fragment as de } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as D, useCallback as pe, useEffect as me, useState as U, forwardRef as be, cloneElement as fe } from "react";
|
|
3
3
|
import { l as ve } from "./chevron-down.es-PCIIj6oG.mjs";
|
|
4
|
-
import { L as V } from "./listbox-
|
|
4
|
+
import { L as V } from "./listbox-i6BQQ-NZ.mjs";
|
|
5
5
|
import { i as _e } from "./text-field-BQfxJobW.mjs";
|
|
6
6
|
import { c as xe } from "./bind-CU-R61T-.mjs";
|
|
7
7
|
const he = {
|
|
@@ -225,4 +225,4 @@ export {
|
|
|
225
225
|
Ie as A,
|
|
226
226
|
ge as u
|
|
227
227
|
};
|
|
228
|
-
//# sourceMappingURL=autocomplete-
|
|
228
|
+
//# sourceMappingURL=autocomplete-BEGRn-Wh.mjs.map
|