@purpur/library 9.1.3 → 9.2.1
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/.lintstagedrc.mts +10 -0
- package/CHANGELOG.json +59 -0
- package/CHANGELOG.md +29 -1
- package/dist/LICENSE.txt +66 -8
- package/dist/{ThemeProvider-ipAIFRUi.js → ThemeProvider-5r7lDX-h.js} +2 -2
- package/dist/{ThemeProvider-ipAIFRUi.js.map → ThemeProvider-5r7lDX-h.js.map} +1 -1
- package/dist/{ThemeProvider-BR1hJQOD.mjs → ThemeProvider-bkyFCeo6.mjs} +3 -3
- package/dist/{ThemeProvider-BR1hJQOD.mjs.map → ThemeProvider-bkyFCeo6.mjs.map} +1 -1
- package/dist/accordion-OsA0HvdA.js +2 -0
- package/dist/{accordion-DX8efWOt.js.map → accordion-OsA0HvdA.js.map} +1 -1
- package/dist/{accordion-BKTz9DM6.mjs → accordion-OtFSShSB.mjs} +37 -37
- package/dist/{accordion-BKTz9DM6.mjs.map → accordion-OtFSShSB.mjs.map} +1 -1
- package/dist/accordion.cjs.js +1 -1
- package/dist/accordion.es.js +1 -1
- package/dist/arrow-left.es-CCWJyrcQ.js +2 -0
- package/dist/arrow-left.es-CCWJyrcQ.js.map +1 -0
- package/dist/arrow-left.es-DU-PX-Il.mjs +13 -0
- package/dist/arrow-left.es-DU-PX-Il.mjs.map +1 -0
- package/dist/{autocomplete-B8L-dTmF.mjs → autocomplete-BipmyKf0.mjs} +2 -2
- package/dist/{autocomplete-B8L-dTmF.mjs.map → autocomplete-BipmyKf0.mjs.map} +1 -1
- package/dist/{autocomplete-B421J7CS.js → autocomplete-D9uCJzjY.js} +2 -2
- package/dist/{autocomplete-B421J7CS.js.map → autocomplete-D9uCJzjY.js.map} +1 -1
- package/dist/autocomplete.cjs.js +1 -1
- package/dist/autocomplete.es.js +1 -1
- package/dist/button-4-yWOgtD.mjs +109 -0
- package/dist/{button-Cv7NlYbv.mjs.map → button-4-yWOgtD.mjs.map} +1 -1
- package/dist/button-DmybVApa.js +2 -0
- package/dist/{button-Dqxdc3nC.js.map → button-DmybVApa.js.map} +1 -1
- package/dist/button.cjs.js +1 -1
- package/dist/button.es.js +1 -1
- package/dist/{calendar-CoP1dGpQ.js → calendar-CBBV8n3x.js} +2 -2
- package/dist/{calendar-CoP1dGpQ.js.map → calendar-CBBV8n3x.js.map} +1 -1
- package/dist/{calendar-D_sZrR92.mjs → calendar-DEXw83mu.mjs} +2 -2
- package/dist/{calendar-D_sZrR92.mjs.map → calendar-DEXw83mu.mjs.map} +1 -1
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.es.js +1 -1
- package/dist/card-CRHXm5NR.js +2 -0
- package/dist/{card-VMa3cGCP.js.map → card-CRHXm5NR.js.map} +1 -1
- package/dist/{card-CkZQZOz1.mjs → card-DR2hvxjZ.mjs} +75 -75
- package/dist/{card-CkZQZOz1.mjs.map → card-DR2hvxjZ.mjs.map} +1 -1
- package/dist/card.cjs.js +1 -1
- package/dist/card.es.js +1 -1
- package/dist/carousel-BCw-5u92.js +2 -0
- package/dist/carousel-BCw-5u92.js.map +1 -0
- package/dist/carousel-BkxojLwn.mjs +1633 -0
- package/dist/carousel-BkxojLwn.mjs.map +1 -0
- package/dist/carousel.cjs.js +2 -0
- package/dist/carousel.cjs.js.map +1 -0
- package/dist/carousel.es.js +5 -0
- package/dist/carousel.es.js.map +1 -0
- package/dist/{chat-field-yK-TwW0D.mjs → chat-field-CVF4DooY.mjs} +2 -2
- package/dist/{chat-field-yK-TwW0D.mjs.map → chat-field-CVF4DooY.mjs.map} +1 -1
- package/dist/{chat-field-CxOqk0-9.js → chat-field-Wjvh2J6C.js} +2 -2
- package/dist/{chat-field-CxOqk0-9.js.map → chat-field-Wjvh2J6C.js.map} +1 -1
- package/dist/chat-field.cjs.js +1 -1
- package/dist/chat-field.es.js +1 -1
- package/dist/comparison-table-B8w65g43.js +2 -0
- package/dist/comparison-table-B8w65g43.js.map +1 -0
- package/dist/comparison-table-D1zJpdLL.mjs +275 -0
- package/dist/comparison-table-D1zJpdLL.mjs.map +1 -0
- package/dist/comparison-table.cjs.js +2 -0
- package/dist/comparison-table.cjs.js.map +1 -0
- package/dist/comparison-table.es.js +5 -0
- package/dist/comparison-table.es.js.map +1 -0
- package/dist/components/carousel/src/carousel.d.ts +43 -0
- package/dist/components/carousel/src/carousel.d.ts.map +1 -0
- package/dist/components/carousel/src/components/PageIndicator.d.ts +12 -0
- package/dist/components/carousel/src/components/PageIndicator.d.ts.map +1 -0
- package/dist/components/carousel/src/hooks/useAutoplay.d.ts +8 -0
- package/dist/components/carousel/src/hooks/useAutoplay.d.ts.map +1 -0
- package/dist/components/carousel/src/hooks/usePageIndicators.d.ts +9 -0
- package/dist/components/carousel/src/hooks/usePageIndicators.d.ts.map +1 -0
- package/dist/components/carousel/src/hooks/usePrefersReducedMotion.d.ts +2 -0
- package/dist/components/carousel/src/hooks/usePrefersReducedMotion.d.ts.map +1 -0
- package/dist/components/carousel/src/hooks/usePrevNextButtons.d.ts +11 -0
- package/dist/components/carousel/src/hooks/usePrevNextButtons.d.ts.map +1 -0
- package/dist/components/comparison-table/src/comparison-table.d.ts +64 -0
- package/dist/components/comparison-table/src/comparison-table.d.ts.map +1 -0
- package/dist/components/comparison-table/src/components/Cell/cell.d.ts +7 -0
- package/dist/components/comparison-table/src/components/Cell/cell.d.ts.map +1 -0
- package/dist/components/comparison-table/src/components/LeadCell/lead-cell.d.ts +8 -0
- package/dist/components/comparison-table/src/components/LeadCell/lead-cell.d.ts.map +1 -0
- package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts +26 -0
- package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts.map +1 -0
- package/dist/components/comparison-table/src/components/ScrollProgress/scroll-progress.d.ts +11 -0
- package/dist/components/comparison-table/src/components/ScrollProgress/scroll-progress.d.ts.map +1 -0
- package/dist/components/content-block/src/content-block.d.ts +2 -2
- package/dist/components/content-block/src/content-block.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown-combobox.d.ts +2 -1
- package/dist/components/dropdown/src/dropdown-combobox.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown-select.d.ts +2 -1
- package/dist/components/dropdown/src/dropdown-select.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown-shared.d.ts +12 -1
- package/dist/components/dropdown/src/dropdown-shared.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown.d.ts +1 -1
- package/dist/components/dropdown/src/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/src/dropdown.types.d.ts +10 -5
- package/dist/components/dropdown/src/dropdown.types.d.ts.map +1 -1
- package/dist/components/dropdown/src/useDropdown.d.ts +1 -1
- package/dist/components/dropdown/src/useDropdown.d.ts.map +1 -1
- package/dist/components-metadata.js +18 -2
- package/dist/{content-block-Cd7xSE8t.js → content-block-CDRUH0pg.js} +2 -2
- package/dist/content-block-CDRUH0pg.js.map +1 -0
- package/dist/{content-block-BMOvlH7a.mjs → content-block-Dm3L4g8w.mjs} +2 -2
- package/dist/content-block-Dm3L4g8w.mjs.map +1 -0
- package/dist/content-block.cjs.js +1 -1
- package/dist/content-block.es.js +1 -1
- package/dist/{cta-link-BHU6irMG.js → cta-link-B1qMjH76.js} +2 -2
- package/dist/{cta-link-BHU6irMG.js.map → cta-link-B1qMjH76.js.map} +1 -1
- package/dist/{cta-link-B_FfwflB.mjs → cta-link-pwva2f2r.mjs} +43 -43
- package/dist/{cta-link-B_FfwflB.mjs.map → cta-link-pwva2f2r.mjs.map} +1 -1
- package/dist/cta-link.cjs.js +1 -1
- package/dist/cta-link.es.js +1 -1
- package/dist/{date-field-B7ipm5sH.js → date-field-BJaomFjs.js} +2 -2
- package/dist/{date-field-B7ipm5sH.js.map → date-field-BJaomFjs.js.map} +1 -1
- package/dist/{date-field-4tYMPw89.mjs → date-field-D3rTtf9Y.mjs} +2 -2
- package/dist/{date-field-4tYMPw89.mjs.map → date-field-D3rTtf9Y.mjs.map} +1 -1
- package/dist/date-field.cjs.js +1 -1
- package/dist/date-field.es.js +1 -1
- package/dist/{date-picker-D7EisjDG.mjs → date-picker-CpDZ0gK9.mjs} +4 -4
- package/dist/{date-picker-D7EisjDG.mjs.map → date-picker-CpDZ0gK9.mjs.map} +1 -1
- package/dist/{date-picker-BWW4xzyc.js → date-picker-D3uJGCjl.js} +2 -2
- package/dist/{date-picker-BWW4xzyc.js.map → date-picker-D3uJGCjl.js.map} +1 -1
- package/dist/date-picker.cjs.js +1 -1
- package/dist/date-picker.es.js +1 -1
- package/dist/{drawer-Vi9H2O3N.mjs → drawer-BJ8xwriz.mjs} +2 -2
- package/dist/{drawer-Vi9H2O3N.mjs.map → drawer-BJ8xwriz.mjs.map} +1 -1
- package/dist/{drawer-UdK-u7IX.js → drawer-CNs9K8Ca.js} +2 -2
- package/dist/{drawer-UdK-u7IX.js.map → drawer-CNs9K8Ca.js.map} +1 -1
- package/dist/drawer.cjs.js +1 -1
- package/dist/drawer.es.js +1 -1
- package/dist/dropdown-BsqVnd7z.js +2 -0
- package/dist/dropdown-BsqVnd7z.js.map +1 -0
- package/dist/dropdown-TO3Mh0bk.mjs +910 -0
- package/dist/dropdown-TO3Mh0bk.mjs.map +1 -0
- package/dist/dropdown.cjs.js +1 -1
- package/dist/dropdown.es.js +1 -1
- package/dist/{footer-cH07Xqil.mjs → footer-BXs8uzTA.mjs} +4 -4
- package/dist/{footer-cH07Xqil.mjs.map → footer-BXs8uzTA.mjs.map} +1 -1
- package/dist/{footer-BL0ewBZT.js → footer-DF9adlni.js} +2 -2
- package/dist/{footer-BL0ewBZT.js.map → footer-DF9adlni.js.map} +1 -1
- package/dist/footer.cjs.js +1 -1
- package/dist/footer.es.js +1 -1
- package/dist/{hero-banner-yGRM4OlS.js → hero-banner-BfxclVFT.js} +2 -2
- package/dist/{hero-banner-yGRM4OlS.js.map → hero-banner-BfxclVFT.js.map} +1 -1
- package/dist/{hero-banner-BjwICxaJ.mjs → hero-banner-CxPvhXD2.mjs} +3 -3
- package/dist/{hero-banner-BjwICxaJ.mjs.map → hero-banner-CxPvhXD2.mjs.map} +1 -1
- package/dist/hero-banner.cjs.js +1 -1
- package/dist/hero-banner.es.js +1 -1
- package/dist/libraries/library/src/carousel.d.ts +6 -0
- package/dist/libraries/library/src/carousel.d.ts.map +1 -0
- package/dist/libraries/library/src/comparison-table.d.ts +6 -0
- package/dist/libraries/library/src/comparison-table.d.ts.map +1 -0
- package/dist/libraries/library/src/library.d.ts +2 -0
- package/dist/libraries/library/src/library.d.ts.map +1 -1
- package/dist/library.cjs.js +1 -1
- package/dist/library.es.js +609 -605
- package/dist/library.es.js.map +1 -1
- package/dist/minus.es-BK9qA9iJ.mjs +13 -0
- package/dist/minus.es-BK9qA9iJ.mjs.map +1 -0
- package/dist/minus.es-DtXArdKK.js +2 -0
- package/dist/minus.es-DtXArdKK.js.map +1 -0
- package/dist/{modal-fTWvPEPW.mjs → modal-DCfN6q8I.mjs} +28 -28
- package/dist/modal-DCfN6q8I.mjs.map +1 -0
- package/dist/{modal-DMeRO1wE.js → modal-DZIdw9xy.js} +2 -2
- package/dist/modal-DZIdw9xy.js.map +1 -0
- package/dist/modal.cjs.js +1 -1
- package/dist/modal.es.js +1 -1
- package/dist/{notification-DE1pvk9W.js → notification-BqjaT4E7.js} +2 -2
- package/dist/{notification-DE1pvk9W.js.map → notification-BqjaT4E7.js.map} +1 -1
- package/dist/{notification-BvoL7BIW.mjs → notification-DdRS5BF2.mjs} +2 -2
- package/dist/{notification-BvoL7BIW.mjs.map → notification-DdRS5BF2.mjs.map} +1 -1
- package/dist/{notification-banner-C4gkkSlf.mjs → notification-banner-BOclxqFu.mjs} +2 -2
- package/dist/{notification-banner-C4gkkSlf.mjs.map → notification-banner-BOclxqFu.mjs.map} +1 -1
- package/dist/{notification-banner-COH7wJu2.js → notification-banner-jY8rQH2M.js} +2 -2
- package/dist/{notification-banner-COH7wJu2.js.map → notification-banner-jY8rQH2M.js.map} +1 -1
- package/dist/notification-banner.cjs.js +1 -1
- package/dist/notification-banner.es.js +1 -1
- package/dist/notification.cjs.js +1 -1
- package/dist/notification.es.js +1 -1
- package/dist/pagination-Bwlkvqye.js +2 -0
- package/dist/pagination-Bwlkvqye.js.map +1 -0
- package/dist/{pagination-BdCjh1Pi.mjs → pagination-CVYUacXN.mjs} +235 -242
- package/dist/pagination-CVYUacXN.mjs.map +1 -0
- package/dist/pagination.cjs.js +1 -1
- package/dist/pagination.es.js +1 -1
- package/dist/{popover-lxTyKALA.mjs → popover-Dwqs1wGH.mjs} +2 -2
- package/dist/{popover-lxTyKALA.mjs.map → popover-Dwqs1wGH.mjs.map} +1 -1
- package/dist/{popover-BnUVNqSi.js → popover-XCUa2GfC.js} +2 -2
- package/dist/{popover-BnUVNqSi.js.map → popover-XCUa2GfC.js.map} +1 -1
- package/dist/popover.cjs.js +1 -1
- package/dist/popover.es.js +1 -1
- package/dist/{product-card-BU1ThhCx.mjs → product-card-BfB82XpS.mjs} +2 -2
- package/dist/{product-card-BU1ThhCx.mjs.map → product-card-BfB82XpS.mjs.map} +1 -1
- package/dist/{product-card-CNBegEBW.js → product-card-bVQ7JhHj.js} +2 -2
- package/dist/{product-card-CNBegEBW.js.map → product-card-bVQ7JhHj.js.map} +1 -1
- package/dist/product-card.cjs.js +1 -1
- package/dist/product-card.es.js +1 -1
- package/dist/{promotion-card-_bPyVr9t.mjs → promotion-card-BhNw94sC.mjs} +4 -4
- package/dist/{promotion-card-_bPyVr9t.mjs.map → promotion-card-BhNw94sC.mjs.map} +1 -1
- package/dist/{promotion-card-CXNhskRl.js → promotion-card-DqBBt2sz.js} +2 -2
- package/dist/{promotion-card-CXNhskRl.js.map → promotion-card-DqBBt2sz.js.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-8AkKNDik.js +2 -0
- package/dist/quantity-selector-8AkKNDik.js.map +1 -0
- package/dist/{quantity-selector-CGhJ2DjO.mjs → quantity-selector-C23kU1hF.mjs} +73 -79
- package/dist/quantity-selector-C23kU1hF.mjs.map +1 -0
- package/dist/quantity-selector.cjs.js +1 -1
- package/dist/quantity-selector.es.js +1 -1
- package/dist/scss/action.scss +1 -0
- package/dist/{search-field-DTuEiK-M.mjs → search-field-CMBDkydb.mjs} +3 -3
- package/dist/{search-field-DTuEiK-M.mjs.map → search-field-CMBDkydb.mjs.map} +1 -1
- package/dist/{search-field-Bst9d-wX.js → search-field-CU_tsmHb.js} +2 -2
- package/dist/{search-field-Bst9d-wX.js.map → search-field-CU_tsmHb.js.map} +1 -1
- package/dist/search-field.cjs.js +1 -1
- package/dist/search-field.es.js +1 -1
- package/dist/{stepper-k0bX9m4t.mjs → stepper-uBfDdIju.mjs} +3 -3
- package/dist/{stepper-k0bX9m4t.mjs.map → stepper-uBfDdIju.mjs.map} +1 -1
- package/dist/{stepper-ClLQuoXr.js → stepper-w-raIwqJ.js} +2 -2
- package/dist/{stepper-ClLQuoXr.js.map → stepper-w-raIwqJ.js.map} +1 -1
- package/dist/stepper.cjs.js +1 -1
- package/dist/stepper.es.js +1 -1
- package/dist/{table-Ddv6BKo9.js → table-BVSBvTYG.js} +2 -2
- package/dist/{table-Ddv6BKo9.js.map → table-BVSBvTYG.js.map} +1 -1
- package/dist/{table-D_XW4smf.mjs → table-CuV3Gda_.mjs} +6 -6
- package/dist/{table-D_XW4smf.mjs.map → table-CuV3Gda_.mjs.map} +1 -1
- package/dist/table.cjs.js +1 -1
- package/dist/table.es.js +1 -1
- package/dist/{text-area-9ggiIWtJ.js → text-area-C6W0fDiQ.js} +2 -2
- package/dist/{text-area-9ggiIWtJ.js.map → text-area-C6W0fDiQ.js.map} +1 -1
- package/dist/{text-area-CpYWt99s.mjs → text-area-DDZ_GQPW.mjs} +3 -3
- package/dist/{text-area-CpYWt99s.mjs.map → text-area-DDZ_GQPW.mjs.map} +1 -1
- package/dist/text-area.cjs.js +1 -1
- package/dist/text-area.es.js +1 -1
- package/dist/{text-field-BQYzwIrG.mjs → text-field-BQfxJobW.mjs} +2 -2
- package/dist/{text-field-BQYzwIrG.mjs.map → text-field-BQfxJobW.mjs.map} +1 -1
- package/dist/{text-field-BwxGMWds.js → text-field-CYJzQG3h.js} +2 -2
- package/dist/{text-field-BwxGMWds.js.map → text-field-CYJzQG3h.js.map} +1 -1
- package/dist/text-field.cjs.js +1 -1
- package/dist/text-field.es.js +1 -1
- package/dist/theme.cjs.js +1 -1
- package/dist/theme.es.js +2 -2
- package/dist/tokens/color/variables.css +12 -12
- package/dist/tokens/color/variables.dark.css +13 -13
- package/dist/tokens/color/variables.dark.js +13 -13
- package/dist/tokens/color/variables.dark.json +13 -13
- package/dist/tokens/color/variables.dark.scss +13 -13
- package/dist/tokens/color/variables.js +12 -12
- package/dist/tokens/color/variables.json +12 -12
- package/dist/tokens/color/variables.scss +12 -12
- package/dist/tokens/gradient/variables.dark.js +4 -4
- package/dist/tokens/gradient/variables.dark.json +4 -4
- package/dist/tokens/gradient/variables.dark.scss +4 -4
- package/dist/tokens/gradient/variables.js +4 -4
- package/dist/tokens/gradient/variables.json +4 -4
- package/dist/tokens/gradient/variables.scss +4 -4
- package/dist/tokens.cjs.js +1 -1
- package/dist/tokens.cjs.js.map +1 -1
- package/dist/tokens.es.js +41 -41
- package/dist/tokens.es.js.map +1 -1
- package/dist/{tooltip-BatXMflw.js → tooltip-0pLBlDG3.js} +2 -2
- package/dist/{tooltip-BatXMflw.js.map → tooltip-0pLBlDG3.js.map} +1 -1
- package/dist/{tooltip-CZzwHkea.mjs → tooltip-Kom0VfOC.mjs} +2 -2
- package/dist/{tooltip-CZzwHkea.mjs.map → tooltip-Kom0VfOC.mjs.map} +1 -1
- package/dist/tooltip.cjs.js +1 -1
- package/dist/tooltip.es.js +1 -1
- package/dist/useColorScheme-0GMDl2GF.js +2 -0
- package/dist/{useColorScheme-DNNu9bz0.js.map → useColorScheme-0GMDl2GF.js.map} +1 -1
- package/dist/{useColorScheme-9rgSgG0N.mjs → useColorScheme-Di_Q0JR4.mjs} +2 -2
- package/dist/{useColorScheme-9rgSgG0N.mjs.map → useColorScheme-Di_Q0JR4.mjs.map} +1 -1
- package/dist/{variables-BVgnpUH9.mjs → variables-CKp4o9Tn.mjs} +2 -2
- package/dist/{variables-BVgnpUH9.mjs.map → variables-CKp4o9Tn.mjs.map} +1 -1
- package/dist/{variables-CMzMXeor.js → variables-DH61hVNE.js} +2 -2
- package/dist/{variables-CMzMXeor.js.map → variables-DH61hVNE.js.map} +1 -1
- package/package.json +42 -40
- package/src/aliases.ts +11 -0
- package/src/carousel.ts +6 -0
- package/src/comparison-table.ts +6 -0
- package/src/entries.js +2 -0
- package/src/library.ts +4 -0
- package/tokens/color/variables.css +12 -12
- package/tokens/color/variables.dark.css +13 -13
- package/tokens/color/variables.dark.js +13 -13
- package/tokens/color/variables.dark.json +13 -13
- package/tokens/color/variables.dark.scss +13 -13
- package/tokens/color/variables.js +12 -12
- package/tokens/color/variables.json +12 -12
- package/tokens/color/variables.scss +12 -12
- package/tokens/gradient/variables.dark.js +4 -4
- package/tokens/gradient/variables.dark.json +4 -4
- package/tokens/gradient/variables.dark.scss +4 -4
- package/tokens/gradient/variables.js +4 -4
- package/tokens/gradient/variables.json +4 -4
- package/tokens/gradient/variables.scss +4 -4
- package/dist/accordion-DX8efWOt.js +0 -2
- package/dist/button-Cv7NlYbv.mjs +0 -109
- package/dist/button-Dqxdc3nC.js +0 -2
- package/dist/card-VMa3cGCP.js +0 -2
- package/dist/content-block-BMOvlH7a.mjs.map +0 -1
- package/dist/content-block-Cd7xSE8t.js.map +0 -1
- package/dist/dropdown-BQOY21kI.js +0 -2
- package/dist/dropdown-BQOY21kI.js.map +0 -1
- package/dist/dropdown-CBYTBaMW.mjs +0 -779
- package/dist/dropdown-CBYTBaMW.mjs.map +0 -1
- package/dist/modal-DMeRO1wE.js.map +0 -1
- package/dist/modal-fTWvPEPW.mjs.map +0 -1
- package/dist/pagination-BdCjh1Pi.mjs.map +0 -1
- package/dist/pagination-C2A8NPol.js +0 -2
- package/dist/pagination-C2A8NPol.js.map +0 -1
- package/dist/quantity-selector-BV7QwVlT.js +0 -2
- package/dist/quantity-selector-BV7QwVlT.js.map +0 -1
- package/dist/quantity-selector-CGhJ2DjO.mjs.map +0 -1
- package/dist/useColorScheme-DNNu9bz0.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { b as
|
|
1
|
+
import { jsx as e, jsxs as h, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as x } from "react";
|
|
3
|
+
import { b as y } from "./icon.es-CZcKxTaM.mjs";
|
|
4
4
|
import { c as $ } from "./bind-CU-R61T-.mjs";
|
|
5
5
|
const C = {
|
|
6
6
|
name: "arrow-left",
|
|
@@ -23,69 +23,69 @@ const C = {
|
|
|
23
23
|
keywords: ["phone"],
|
|
24
24
|
category: "device"
|
|
25
25
|
}, Z = {
|
|
26
|
-
"purpur-cta-link": "_purpur-cta-
|
|
27
|
-
"purpur-cta-link--xs": "_purpur-cta-link--
|
|
28
|
-
"purpur-cta-link--icon-only": "_purpur-cta-link--icon-
|
|
29
|
-
"purpur-cta-link--sm": "_purpur-cta-link--
|
|
30
|
-
"purpur-cta-link--md": "_purpur-cta-link--
|
|
31
|
-
"purpur-cta-link--lg": "_purpur-cta-link--
|
|
32
|
-
"purpur-cta-link--full-width": "_purpur-cta-link--full-
|
|
33
|
-
"purpur-cta-link--primary": "_purpur-cta-link--
|
|
34
|
-
"purpur-cta-link--disabled": "_purpur-cta-link--
|
|
35
|
-
"purpur-cta-link--primary-negative": "_purpur-cta-link--primary-
|
|
36
|
-
"purpur-cta-link--secondary": "_purpur-cta-link--
|
|
37
|
-
"purpur-cta-link--secondary-negative": "_purpur-cta-link--secondary-
|
|
38
|
-
"purpur-cta-link--expressive": "_purpur-cta-link--
|
|
39
|
-
"purpur-cta-link--expressive-negative": "_purpur-cta-link--expressive-
|
|
40
|
-
"purpur-cta-link__icon": "_purpur-cta-
|
|
41
|
-
},
|
|
26
|
+
"purpur-cta-link": "_purpur-cta-link_1wk72_1",
|
|
27
|
+
"purpur-cta-link--xs": "_purpur-cta-link--xs_1wk72_23",
|
|
28
|
+
"purpur-cta-link--icon-only": "_purpur-cta-link--icon-only_1wk72_26",
|
|
29
|
+
"purpur-cta-link--sm": "_purpur-cta-link--sm_1wk72_29",
|
|
30
|
+
"purpur-cta-link--md": "_purpur-cta-link--md_1wk72_35",
|
|
31
|
+
"purpur-cta-link--lg": "_purpur-cta-link--lg_1wk72_41",
|
|
32
|
+
"purpur-cta-link--full-width": "_purpur-cta-link--full-width_1wk72_47",
|
|
33
|
+
"purpur-cta-link--primary": "_purpur-cta-link--primary_1wk72_65",
|
|
34
|
+
"purpur-cta-link--disabled": "_purpur-cta-link--disabled_1wk72_69",
|
|
35
|
+
"purpur-cta-link--primary-negative": "_purpur-cta-link--primary-negative_1wk72_75",
|
|
36
|
+
"purpur-cta-link--secondary": "_purpur-cta-link--secondary_1wk72_87",
|
|
37
|
+
"purpur-cta-link--secondary-negative": "_purpur-cta-link--secondary-negative_1wk72_98",
|
|
38
|
+
"purpur-cta-link--expressive": "_purpur-cta-link--expressive_1wk72_109",
|
|
39
|
+
"purpur-cta-link--expressive-negative": "_purpur-cta-link--expressive-negative_1wk72_119",
|
|
40
|
+
"purpur-cta-link__icon": "_purpur-cta-link__icon_1wk72_131"
|
|
41
|
+
}, k = $.bind(Z), r = "purpur-cta-link", F = ["forward", "external", "back", "phone"], B = {
|
|
42
42
|
forward: b,
|
|
43
43
|
external: L,
|
|
44
44
|
back: C,
|
|
45
45
|
phone: M
|
|
46
|
-
}, H =
|
|
46
|
+
}, H = x(
|
|
47
47
|
({
|
|
48
|
-
children:
|
|
49
|
-
className:
|
|
50
|
-
["data-testid"]:
|
|
51
|
-
fullWidth:
|
|
48
|
+
children: _,
|
|
49
|
+
className: w,
|
|
50
|
+
["data-testid"]: v,
|
|
51
|
+
fullWidth: g = !1,
|
|
52
52
|
iconOnly: l = !1,
|
|
53
53
|
showIcon: t = !0,
|
|
54
|
-
negative:
|
|
55
|
-
size:
|
|
56
|
-
variant:
|
|
54
|
+
negative: p = !1,
|
|
55
|
+
size: i = "md",
|
|
56
|
+
variant: c,
|
|
57
57
|
icon: a = "forward",
|
|
58
58
|
...n
|
|
59
|
-
},
|
|
60
|
-
const
|
|
59
|
+
}, s) => {
|
|
60
|
+
const m = k(
|
|
61
61
|
[
|
|
62
|
-
|
|
62
|
+
w,
|
|
63
63
|
r,
|
|
64
|
-
`${r}--${
|
|
65
|
-
`${r}--${
|
|
64
|
+
`${r}--${p ? `${c}-negative` : c}`,
|
|
65
|
+
`${r}--${i}`
|
|
66
66
|
],
|
|
67
67
|
{
|
|
68
68
|
[`${r}--icon-only`]: l,
|
|
69
|
-
[`${r}--negative`]:
|
|
70
|
-
[`${r}--full-width`]:
|
|
69
|
+
[`${r}--negative`]: p,
|
|
70
|
+
[`${r}--full-width`]: g
|
|
71
71
|
}
|
|
72
72
|
), u = () => /* @__PURE__ */ e(
|
|
73
|
-
|
|
73
|
+
y,
|
|
74
74
|
{
|
|
75
75
|
svg: B[a],
|
|
76
|
-
size:
|
|
77
|
-
className:
|
|
76
|
+
size: i === "lg" ? "sm" : "xs",
|
|
77
|
+
className: k(`${r}__icon`)
|
|
78
78
|
}
|
|
79
|
-
), o = /* @__PURE__ */
|
|
79
|
+
), o = /* @__PURE__ */ h(f, { children: [
|
|
80
80
|
t && (a === "back" || a === "phone") && /* @__PURE__ */ e(u, {}),
|
|
81
|
-
(!l || l && !t) &&
|
|
81
|
+
(!l || l && !t) && _,
|
|
82
82
|
t && (a === "forward" || a === "external") && /* @__PURE__ */ e(u, {})
|
|
83
83
|
] }), d = {
|
|
84
84
|
...n,
|
|
85
|
-
className:
|
|
86
|
-
"data-testid":
|
|
85
|
+
className: m,
|
|
86
|
+
"data-testid": v
|
|
87
87
|
};
|
|
88
|
-
return "href" in n && n.href ? /* @__PURE__ */ e("a", { ...d, ref:
|
|
88
|
+
return "href" in n && n.href ? /* @__PURE__ */ e("a", { ...d, ref: s, children: o }) : /* @__PURE__ */ e("span", { ...d, ref: s, children: o });
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
91
|
H.displayName = "CtaLink";
|
|
@@ -93,4 +93,4 @@ export {
|
|
|
93
93
|
H as C,
|
|
94
94
|
F as c
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=cta-link-
|
|
96
|
+
//# sourceMappingURL=cta-link-pwva2f2r.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cta-link-
|
|
1
|
+
{"version":3,"file":"cta-link-pwva2f2r.mjs","sources":["../../../components/icon/dist/assets/arrow-left.es.js","../../../components/icon/dist/assets/arrow-right.es.js","../../../components/icon/dist/assets/external.es.js","../../../components/icon/dist/assets/phone.es.js","../../../components/cta-link/src/cta-link.tsx"],"sourcesContent":["const e = {\n name: \"arrow-left\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M3.1 12a.9.9 0 0 1 .264-.636l5.5-5.5a.9.9 0 0 1 1.272 1.272L6.173 11.1H20a.9.9 0 0 1 0 1.8H6.173l3.963 3.964a.9.9 0 1 1-1.272 1.272l-5.5-5.5A.9.9 0 0 1 3.1 12Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"arrow-left\"],\n category: \"utility\"\n};\nexport {\n e as arrowLeft\n};\n//# sourceMappingURL=arrow-left.es.js.map\n","const r = {\n name: \"arrow-right\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M20.9 12a.9.9 0 0 1-.264.636l-5.5 5.5a.9.9 0 0 1-1.272-1.272l3.963-3.964H4a.9.9 0 0 1 0-1.8h13.827l-3.963-3.964a.9.9 0 1 1 1.272-1.272l5.5 5.5A.9.9 0 0 1 20.9 12Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"arrow-right\"],\n category: \"utility\"\n};\nexport {\n r as arrowRight\n};\n//# sourceMappingURL=arrow-right.es.js.map\n","const e = {\n name: \"external\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M15 3.4a.9.9 0 1 1 0-1.8h6.5a.9.9 0 0 1 .9.9V9a.9.9 0 1 1-1.8 0V4.673l-7.964 7.963a.9.9 0 1 1-1.272-1.272L19.327 3.4H15ZM1.6 5c0-1.05.85-1.9 1.9-1.9h6a.9.9 0 0 1 0 1.8h-6a.1.1 0 0 0-.1.1v15.5a.1.1 0 0 0 .1.1h16a.1.1 0 0 0 .1-.1V14a.9.9 0 1 1 1.8 0v6.5a1.9 1.9 0 0 1-1.9 1.9h-16a1.9 1.9 0 0 1-1.9-1.9V5Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"external\"],\n category: \"media\"\n};\nexport {\n e as external\n};\n//# sourceMappingURL=external.es.js.map\n","const e = {\n name: \"phone\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M5.341 2.228c.75-.622 1.73-.43 2.305.145l2.783 2.783a1.9 1.9 0 0 1 0 2.687L8.843 9.43a.1.1 0 0 0 0 .142l5.586 5.585a.1.1 0 0 0 .142 0l1.585-1.585a1.9 1.9 0 0 1 2.687 0l3.5 3.5c.343.342.698 1.023.31 1.742-.346.645-1.173 1.615-3.154 2.936-1.75 1.167-3.667 1.269-5.297.903-1.61-.361-3.015-1.192-3.839-2.016a.9.9 0 0 1 1.273-1.272c.573.572 1.669 1.242 2.96 1.532 1.27.285 2.656.188 3.905-.645 1.483-.989 2.137-1.68 2.418-2.06l-3.348-3.347a.1.1 0 0 0-.142 0l-1.586 1.585a1.9 1.9 0 0 1-2.687 0l-5.585-5.585a1.9 1.9 0 0 1 0-2.688l1.585-1.585a.1.1 0 0 0 0-.142L6.41 3.682c-.447.383-1.183 1.102-2.206 2.38-.878 1.097-1.14 2.08-1.127 2.951.013.898.323 1.758.732 2.59.24.488.733 1.079 1.551 1.88.561.549 1.227 1.152 2.002 1.854.344.312.71.644 1.098 1a.9.9 0 0 1-1.215 1.327c-.367-.336-.722-.658-1.061-.965a77.443 77.443 0 0 1-2.082-1.93c-.831-.813-1.523-1.586-1.909-2.372-.456-.93-.896-2.07-.916-3.356-.02-1.314.399-2.7 1.521-4.103 1.148-1.435 1.995-2.254 2.544-2.71Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"phone\"],\n category: \"device\"\n};\nexport {\n e as phone\n};\n//# sourceMappingURL=phone.es.js.map\n","import React, { type ForwardedRef, forwardRef } from \"react\";\nimport type { ActionProps } from \"@purpur/action\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Icon } from \"@purpur/icon\";\nimport { arrowLeft } from \"@purpur/icon/assets/arrow-left\";\nimport { arrowRight } from \"@purpur/icon/assets/arrow-right\";\nimport { external } from \"@purpur/icon/assets/external\";\nimport { phone } from \"@purpur/icon/assets/phone\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./cta-link.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-cta-link\";\n\nexport const ctaLinkIcons = [\"forward\", \"external\", \"back\", \"phone\"] as const;\nexport type CtaLinkIcon = (typeof ctaLinkIcons)[number];\n\nconst iconMapping = {\n forward: arrowRight,\n external: external,\n back: arrowLeft,\n phone: phone,\n};\n\ntype CtaLinkBaseProps = {\n icon?: CtaLinkIcon;\n showIcon?: boolean;\n};\n\nexport type CtaAnchorProps = ActionProps &\n Omit<BaseProps<\"a\">, \"href\"> & {\n href: string;\n };\n\ntype SpanProps = ActionProps & BaseProps<\"span\">;\n\nexport type CtaLinkProps = CtaLinkBaseProps & (CtaAnchorProps | SpanProps);\n\nexport const CtaLink = forwardRef<HTMLAnchorElement | HTMLSpanElement, CtaLinkProps>(\n (\n {\n children,\n className,\n [\"data-testid\"]: dataTestid,\n fullWidth = false,\n iconOnly = false,\n showIcon = true,\n negative = false,\n size = \"md\",\n variant,\n icon = \"forward\",\n ...props\n },\n ref\n ) => {\n const classes = cx(\n [\n className,\n rootClassName,\n `${rootClassName}--${negative ? `${variant}-negative` : variant}`,\n `${rootClassName}--${size}`,\n ],\n {\n [`${rootClassName}--icon-only`]: iconOnly,\n [`${rootClassName}--negative`]: negative,\n [`${rootClassName}--full-width`]: fullWidth,\n }\n );\n\n const MappedIcon = () => (\n <Icon\n svg={iconMapping[icon]}\n size={size === \"lg\" ? \"sm\" : \"xs\"}\n className={cx(`${rootClassName}__icon`)}\n />\n );\n\n const childrenWithIcons = (\n <>\n {showIcon && (icon === \"back\" || icon === \"phone\") && <MappedIcon />}\n {(!iconOnly || (iconOnly && !showIcon)) && children}\n {showIcon && (icon === \"forward\" || icon === \"external\") && <MappedIcon />}\n </>\n );\n\n const sharedProps = {\n ...props,\n className: classes,\n [\"data-testid\"]: dataTestid,\n };\n\n return \"href\" in props && props.href ? (\n <a {...sharedProps} ref={ref as ForwardedRef<HTMLAnchorElement>}>\n {childrenWithIcons}\n </a>\n ) : (\n <span {...sharedProps} ref={ref as ForwardedRef<HTMLSpanElement>}>\n {childrenWithIcons}\n </span>\n );\n }\n);\n\nCtaLink.displayName = \"CtaLink\";\n"],"names":["e","r","cx","c","styles","rootClassName","ctaLinkIcons","iconMapping","arrowRight","external","arrowLeft","phone","CtaLink","forwardRef","children","className","dataTestid","fullWidth","iconOnly","showIcon","negative","size","variant","icon","props","ref","classes","MappedIcon","jsx","Icon","childrenWithIcons","jsxs","Fragment","sharedProps"],"mappings":";;;;AAAA,MAAMA,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,YAAY;AAAA,EACvB,UAAU;AACZ,GCLMC,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,aAAa;AAAA,EACxB,UAAU;AACZ,GCLMD,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,UAAU;AAAA,EACrB,UAAU;AACZ,GCLMA,IAAI;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU,CAAC,OAAO;AAAA,EAClB,UAAU;AACZ;;;;;;;;;;;;;;;;GCOME,IAAKC,EAAE,KAAKC,CAAM,GAClBC,IAAgB,mBAETC,IAAe,CAAC,WAAW,YAAY,QAAQ,OAAO,GAG7DC,IAAc;AAAA,EAClB,SAASC;AAAAA,EAAA,UACTC;AAAAA,EACA,MAAMC;AAAAA,EAAA,OACNC;AACF,GAgBaC,IAAUC;AAAA,EACrB,CACE;AAAA,IACE,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,CAAC,gBAAgBC;AAAA,IACjB,WAAAC,IAAY;AAAA,IACZ,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,MAAAC,IAAO;AAAA,IACP,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAUxB;AAAA,MACd;AAAA,QACEa;AAAA,QACAV;AAAA,QACA,GAAGA,CAAa,KAAKe,IAAW,GAAGE,CAAO,cAAcA,CAAO;AAAA,QAC/D,GAAGjB,CAAa,KAAKgB,CAAI;AAAA,MAAA;AAAA,MAE3B;AAAA,QACE,CAAC,GAAGhB,CAAa,aAAa,GAAGa;AAAA,QACjC,CAAC,GAAGb,CAAa,YAAY,GAAGe;AAAA,QAChC,CAAC,GAAGf,CAAa,cAAc,GAAGY;AAAA,MAAA;AAAA,IACpC,GAGIU,IAAa,MACjB,gBAAAC;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,KAAKtB,EAAYgB,CAAI;AAAA,QACrB,MAAMF,MAAS,OAAO,OAAO;AAAA,QAC7B,WAAWnB,EAAG,GAAGG,CAAa,QAAQ;AAAA,MAAA;AAAA,IAAA,GAIpCyB,IACJ,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,MAAAb,MAAaI,MAAS,UAAUA,MAAS,8BAAaI,GAAA,EAAW;AAAA,OAChE,CAACT,KAAaA,KAAY,CAACC,MAAcL;AAAA,MAC1CK,MAAaI,MAAS,aAAaA,MAAS,iCAAgBI,GAAA,CAAA,CAAW;AAAA,IAAA,GAC1E,GAGIM,IAAc;AAAA,MAClB,GAAGT;AAAA,MACH,WAAWE;AAAA,MACV,eAAgBV;AAAA,IAAA;AAGnB,WAAO,UAAUQ,KAASA,EAAM,OAC9B,gBAAAI,EAAC,OAAG,GAAGK,GAAa,KAAAR,GACjB,UAAAK,EAAA,CACH,IAEA,gBAAAF,EAAC,QAAA,EAAM,GAAGK,GAAa,KAAAR,GACpB,UAAAK,GACH;AAAA,EAEJ;AACF;AAEAlB,EAAQ,cAAc;"}
|
package/dist/cta-link.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./cta-link-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./cta-link-B1qMjH76.js");exports.CtaLink=t.CtaLink;exports.ctaLinkIcons=t.ctaLinkIcons;
|
|
2
2
|
//# sourceMappingURL=cta-link.cjs.js.map
|
package/dist/cta-link.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const I=require("react/jsx-runtime"),P=require("react"),K=require("./text-field-BwxGMWds.js"),Z=require("./bind-DeUYJ6m9.js"),a=require("./format-CFKKBdIQ.js");function V(){return Object.assign({},a.getDefaultOptions())}function U(n,e){const r=a.toDate(n,e?.in).getDay();return r===0?7:r}function J(n,e){const r=S(e)?new e(0):a.constructFrom(e,0);return r.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),r.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),r}function S(n){return typeof n=="function"&&n.prototype?.constructor===n}const ee=10;class X{subPriority=0;validate(e,r){return!0}}class te extends X{constructor(e,r,t,s,o){super(),this.value=e,this.validateValue=r,this.setValue=t,this.priority=s,o&&(this.subPriority=o)}validate(e,r){return this.validateValue(e,this.value,r)}set(e,r,t){return this.setValue(e,r,this.value,t)}}class re extends X{priority=ee;subPriority=-1;constructor(e,r){super(),this.context=e||(t=>a.constructFrom(r,t))}set(e,r){return r.timestampIsSet?e:a.constructFrom(e,J(e,this.context))}}class c{run(e,r,t,s){const o=this.parse(e,r,t,s);return o?{setter:new te(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(e,r,t){return!0}}class ne extends c{priority=140;parse(e,r,t){switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"});case"GGGGG":return t.era(e,{width:"narrow"});default:return t.era(e,{width:"wide"})||t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"})}}set(e,r,t){return r.era=t,e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const h={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},T={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function p(n,e){return n&&{value:e(n.value),rest:n.rest}}function f(n,e){const r=e.match(n);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function D(n,e){const r=e.match(n);if(!r)return null;if(r[0]==="Z")return{value:0,rest:e.slice(1)};const t=r[1]==="+"?1:-1,s=r[2]?parseInt(r[2],10):0,o=r[3]?parseInt(r[3],10):0,u=r[5]?parseInt(r[5],10):0;return{value:t*(s*a.millisecondsInHour+o*a.millisecondsInMinute+u*a.millisecondsInSecond),rest:e.slice(r[0].length)}}function A(n){return f(h.anyDigitsSigned,n)}function w(n,e){switch(n){case 1:return f(h.singleDigit,e);case 2:return f(h.twoDigits,e);case 3:return f(h.threeDigits,e);case 4:return f(h.fourDigits,e);default:return f(new RegExp("^\\d{1,"+n+"}"),e)}}function R(n,e){switch(n){case 1:return f(h.singleDigitSigned,e);case 2:return f(h.twoDigitsSigned,e);case 3:return f(h.threeDigitsSigned,e);case 4:return f(h.fourDigitsSigned,e);default:return f(new RegExp("^-?\\d{1,"+n+"}"),e)}}function F(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function z(n,e){const r=e>0,t=r?e:1-e;let s;if(t<=50)s=n||100;else{const o=t+50,u=Math.trunc(o/100)*100,b=n>=o%100;s=n+u-(b?100:0)}return r?s:1-s}function $(n){return n%400===0||n%4===0&&n%100!==0}class se extends c{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,r,t){const s=o=>({year:o,isTwoDigitYear:r==="yy"});switch(r){case"y":return p(w(4,e),s);case"yo":return p(t.ordinalNumber(e,{unit:"year"}),s);default:return p(w(r.length,e),s)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,t){const s=e.getFullYear();if(t.isTwoDigitYear){const u=z(t.year,s);return e.setFullYear(u,0,1),e.setHours(0,0,0,0),e}const o=!("era"in r)||r.era===1?t.year:1-t.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class oe extends c{priority=130;parse(e,r,t){const s=o=>({year:o,isTwoDigitYear:r==="YY"});switch(r){case"Y":return p(w(4,e),s);case"Yo":return p(t.ordinalNumber(e,{unit:"year"}),s);default:return p(w(r.length,e),s)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,t,s){const o=a.getWeekYear(e,s);if(t.isTwoDigitYear){const b=z(t.year,o);return e.setFullYear(b,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),a.startOfWeek(e,s)}const u=!("era"in r)||r.era===1?t.year:1-t.year;return e.setFullYear(u,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),a.startOfWeek(e,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ae extends c{priority=130;parse(e,r){return R(r==="R"?4:r.length,e)}set(e,r,t){const s=a.constructFrom(e,0);return s.setFullYear(t,0,4),s.setHours(0,0,0,0),a.startOfISOWeek(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class ie extends c{priority=130;parse(e,r){return R(r==="u"?4:r.length,e)}set(e,r,t){return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class ce extends c{priority=120;parse(e,r,t){switch(r){case"Q":case"QQ":return w(r.length,e);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});default:return t.quarter(e,{width:"wide",context:"formatting"})||t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=1&&r<=4}set(e,r,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class ue extends c{priority=120;parse(e,r,t){switch(r){case"q":case"qq":return w(r.length,e);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});default:return t.quarter(e,{width:"wide",context:"standalone"})||t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=1&&r<=4}set(e,r,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class le extends c{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,r,t){const s=o=>o-1;switch(r){case"M":return p(f(h.month,e),s);case"MM":return p(w(2,e),s);case"Mo":return p(t.ordinalNumber(e,{unit:"month"}),s);case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});default:return t.month(e,{width:"wide",context:"formatting"})||t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}}class de extends c{priority=110;parse(e,r,t){const s=o=>o-1;switch(r){case"L":return p(f(h.month,e),s);case"LL":return p(w(2,e),s);case"Lo":return p(t.ordinalNumber(e,{unit:"month"}),s);case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});default:return t.month(e,{width:"wide",context:"standalone"})||t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function fe(n,e,r){const t=a.toDate(n,r?.in),s=a.getWeek(t,r)-e;return t.setDate(t.getDate()-s*7),a.toDate(t,r?.in)}class we extends c{priority=100;parse(e,r,t){switch(r){case"w":return f(h.week,e);case"wo":return t.ordinalNumber(e,{unit:"week"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,t,s){return a.startOfWeek(fe(e,t,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function he(n,e,r){const t=a.toDate(n,r?.in),s=a.getISOWeek(t,r)-e;return t.setDate(t.getDate()-s*7),t}class pe extends c{priority=100;parse(e,r,t){switch(r){case"I":return f(h.week,e);case"Io":return t.ordinalNumber(e,{unit:"week"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,t){return a.startOfISOWeek(he(e,t))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const ye=[31,28,31,30,31,30,31,31,30,31,30,31],xe=[31,29,31,30,31,30,31,31,30,31,30,31];class be extends c{priority=90;subPriority=1;parse(e,r,t){switch(r){case"d":return f(h.date,e);case"do":return t.ordinalNumber(e,{unit:"date"});default:return w(r.length,e)}}validate(e,r){const t=e.getFullYear(),s=$(t),o=e.getMonth();return s?r>=1&&r<=xe[o]:r>=1&&r<=ye[o]}set(e,r,t){return e.setDate(t),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class me extends c{priority=90;subpriority=1;parse(e,r,t){switch(r){case"D":case"DD":return f(h.dayOfYear,e);case"Do":return t.ordinalNumber(e,{unit:"date"});default:return w(r.length,e)}}validate(e,r){const t=e.getFullYear();return $(t)?r>=1&&r<=366:r>=1&&r<=365}set(e,r,t){return e.setMonth(0,t),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function W(n,e,r){const t=a.getDefaultOptions(),s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,o=a.toDate(n,r?.in),u=o.getDay(),y=(e%7+7)%7,_=7-s,Y=e<0||e>6?e-(u+_)%7:(y+_)%7-(u+_)%7;return a.addDays(o,Y,r)}class ge extends c{priority=90;parse(e,r,t){switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class Te extends c{priority=90;parse(e,r,t,s){const o=u=>{const b=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+b};switch(r){case"e":case"ee":return p(w(r.length,e),o);case"eo":return p(t.ordinalNumber(e,{unit:"day"}),o);case"eee":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"eeeee":return t.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class De extends c{priority=90;parse(e,r,t,s){const o=u=>{const b=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+b};switch(r){case"c":case"cc":return p(w(r.length,e),o);case"co":return p(t.ordinalNumber(e,{unit:"day"}),o);case"ccc":return t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});case"ccccc":return t.day(e,{width:"narrow",context:"standalone"});case"cccccc":return t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});default:return t.day(e,{width:"wide",context:"standalone"})||t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function _e(n,e,r){const t=a.toDate(n,r?.in),s=U(t,r),o=e-s;return a.addDays(t,o,r)}class ke extends c{priority=90;parse(e,r,t){const s=o=>o===0?7:o;switch(r){case"i":case"ii":return w(r.length,e);case"io":return t.ordinalNumber(e,{unit:"day"});case"iii":return p(t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s);case"iiiii":return p(t.day(e,{width:"narrow",context:"formatting"}),s);case"iiiiii":return p(t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s);default:return p(t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s)}}validate(e,r){return r>=1&&r<=7}set(e,r,t){return e=_e(e,t),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Pe extends c{priority=80;parse(e,r,t){switch(r){case"a":case"aa":case"aaa":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class Me extends c{priority=80;parse(e,r,t){switch(r){case"b":case"bb":case"bbb":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class Oe extends c{priority=80;parse(e,r,t){switch(r){case"B":case"BB":case"BBB":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class Ye extends c{priority=70;parse(e,r,t){switch(r){case"h":return f(h.hour12h,e);case"ho":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=12}set(e,r,t){const s=e.getHours()>=12;return s&&t<12?e.setHours(t+12,0,0,0):!s&&t===12?e.setHours(0,0,0,0):e.setHours(t,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class Ee extends c{priority=70;parse(e,r,t){switch(r){case"H":return f(h.hour23h,e);case"Ho":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=23}set(e,r,t){return e.setHours(t,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class He extends c{priority=70;parse(e,r,t){switch(r){case"K":return f(h.hour11h,e);case"Ko":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.getHours()>=12&&t<12?e.setHours(t+12,0,0,0):e.setHours(t,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class Ie extends c{priority=70;parse(e,r,t){switch(r){case"k":return f(h.hour24h,e);case"ko":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=24}set(e,r,t){const s=t<=24?t%24:t;return e.setHours(s,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class qe extends c{priority=60;parse(e,r,t){switch(r){case"m":return f(h.minute,e);case"mo":return t.ordinalNumber(e,{unit:"minute"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,t){return e.setMinutes(t,0,0),e}incompatibleTokens=["t","T"]}class Re extends c{priority=50;parse(e,r,t){switch(r){case"s":return f(h.second,e);case"so":return t.ordinalNumber(e,{unit:"second"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,t){return e.setSeconds(t,0),e}incompatibleTokens=["t","T"]}class Le extends c{priority=30;parse(e,r){const t=s=>Math.trunc(s*Math.pow(10,-r.length+3));return p(w(r.length,e),t)}set(e,r,t){return e.setMilliseconds(t),e}incompatibleTokens=["t","T"]}class ve extends c{priority=10;parse(e,r){switch(r){case"X":return D(T.basicOptionalMinutes,e);case"XX":return D(T.basic,e);case"XXXX":return D(T.basicOptionalSeconds,e);case"XXXXX":return D(T.extendedOptionalSeconds,e);default:return D(T.extended,e)}}set(e,r,t){return r.timestampIsSet?e:a.constructFrom(e,e.getTime()-a.getTimezoneOffsetInMilliseconds(e)-t)}incompatibleTokens=["t","T","x"]}class Ne extends c{priority=10;parse(e,r){switch(r){case"x":return D(T.basicOptionalMinutes,e);case"xx":return D(T.basic,e);case"xxxx":return D(T.basicOptionalSeconds,e);case"xxxxx":return D(T.extendedOptionalSeconds,e);default:return D(T.extended,e)}}set(e,r,t){return r.timestampIsSet?e:a.constructFrom(e,e.getTime()-a.getTimezoneOffsetInMilliseconds(e)-t)}incompatibleTokens=["t","T","X"]}class Qe extends c{priority=40;parse(e){return A(e)}set(e,r,t){return[a.constructFrom(e,t*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Ce extends c{priority=20;parse(e){return A(e)}set(e,r,t){return[a.constructFrom(e,t),{timestampIsSet:!0}]}incompatibleTokens="*"}const Fe={G:new ne,y:new se,Y:new oe,R:new ae,u:new ie,Q:new ce,q:new ue,M:new le,L:new de,w:new we,I:new pe,d:new be,D:new me,E:new ge,e:new Te,c:new De,i:new ke,a:new Pe,b:new Me,B:new Oe,h:new Ye,H:new Ee,K:new He,k:new Ie,m:new qe,s:new Re,S:new Le,X:new ve,x:new Ne,t:new Qe,T:new Ce},We=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Be=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ge=/^'([^]*?)'?$/,Xe=/''/g,Ae=/\S/,ze=/[a-zA-Z]/;function $e(n,e,r,t){const s=()=>a.constructFrom(r,NaN),o=V(),u=o.locale??a.enUS,b=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,y=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,_={firstWeekContainsDate:b,weekStartsOn:y,locale:u},Y=[new re(t?.in,r)],L=e.match(Be).map(i=>{const l=i[0];if(l in a.longFormatters){const d=a.longFormatters[l];return d(i,u.formatLong)}return i}).join("").match(We),k=[];for(let i of L){a.isProtectedWeekYearToken(i)&&a.warnOrThrowProtectedError(i,e,n),a.isProtectedDayOfYearToken(i)&&a.warnOrThrowProtectedError(i,e,n);const l=i[0],d=Fe[l];if(d){const{incompatibleTokens:x}=d;if(Array.isArray(x)){const O=k.find(m=>x.includes(m.token)||m.token===l);if(O)throw new RangeError(`The format string mustn't contain \`${O.fullToken}\` and \`${i}\` at the same time`)}else if(d.incompatibleTokens==="*"&&k.length>0)throw new RangeError(`The format string mustn't contain \`${i}\` and any other token at the same time`);k.push({token:l,fullToken:i});const g=d.run(n,i,u.match,_);if(!g)return s();Y.push(g.setter),n=g.rest}else{if(l.match(ze))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");if(i==="''"?i="'":l==="'"&&(i=je(i)),n.indexOf(i)===0)n=n.slice(i.length);else return s()}}if(n.length>0&&Ae.test(n))return s();const H=Y.map(i=>i.priority).sort((i,l)=>l-i).filter((i,l,d)=>d.indexOf(i)===l).map(i=>Y.filter(l=>l.priority===i).sort((l,d)=>d.subPriority-l.subPriority)).map(i=>i[0]);let M=a.toDate(r,t?.in);if(isNaN(+M))return s();const q={};for(const i of H){if(!i.validate(M,_))return s();const l=i.set(M,q,_);Array.isArray(l)?(M=l[0],Object.assign(q,l[1])):M=l}return M}function je(n){return n.match(Ge)[1].replace(Xe,"'")}const Ke={"purpur-date-field__container":"_purpur-date-field__container_ci2f4_1","purpur-date-field__overlay":"_purpur-date-field__overlay_ci2f4_5","purpur-date-field__start-adornment":"_purpur-date-field__start-adornment_ci2f4_16"},Ze=n=>$e(n,"yyyy-MM-dd",new Date),G=n=>n?a.format(n,"yyyy-MM-dd"):"",Ve=(...n)=>{const e=n.filter(Boolean);return e.length<=1?e[0]||null:r=>{for(const t of e)typeof t=="function"?t(r):t&&(t.current=r)}},N=Z.c.bind(Ke),Q="purpur-date-field",C="YYYY-MM-DD",Ue=(n,e)=>{let r=n;return e.length>4&&n>=4&&(r+=1),e.length>7&&n>=6&&(r+=1),Math.min(r,e.length)},j=P.forwardRef(({value:n,label:e,onChange:r,startAdornment:t,...s},o)=>{const[u,b]=P.useState(G(n));P.useEffect(()=>{b(n?G(n):"")},[n]);const y=P.useRef(null),_=Ve(o,y),[Y,L]=P.useState({}),k=P.useRef(null),H=P.useRef(null);P.useLayoutEffect(()=>{if(y.current){const d=window.document.querySelector(`label[for="${y.current.id}"]`),x=d?d.offsetHeight+4:0,g=window.getComputedStyle(y.current);L({position:"absolute",top:y.current.offsetTop+x,left:y.current.offsetLeft,padding:g.padding,width:y.current.offsetWidth,height:y.current.offsetHeight})}},[u,e,y]),P.useLayoutEffect(()=>{k.current!==null&&y.current&&(y.current.setSelectionRange(k.current,k.current),k.current=null)},[u]);const M=d=>{if(d.length===0&&r?.(void 0),d.length!==C.length)return;const x=Ze(d);a.isValid(x)&&r?.(x)},q=d=>{const x=d.currentTarget.selectionStart??0;H.current=u.slice(0,x).replace(/\D/g,"").length},i=d=>{const x=d.target.value,g=d.target.selectionStart??0,O=u.replace(/\D/g,""),m=x.replace(/\D/g,"");let E="";m.length>0&&(E+=m.slice(0,4)),m.length>4&&(E+="-"+m.slice(4,6)),m.length>6&&(E+="-"+m.slice(6,8));let v;const B=H.current;B!==null&&m.length>O.length?v=Math.min(B+(m.length-O.length),m.length):v=Math.min(x.slice(0,g).replace(/\D/g,"").length,m.length),H.current=null,k.current=Ue(v,E),b(E),M(E)},l=()=>C.split("").map((x,g)=>{const O=u[g];return I.jsx("span",{style:{color:O?"transparent":"var(--purpur-color-text-weak)"},children:O||x},g)});return I.jsxs("div",{className:N(`${Q}__container`),children:[I.jsx(K.TextField,{...s,startAdornment:t&&I.jsx("span",{className:N(`${Q}__start-adornment`),children:t}),ref:_,value:u,onChange:i,onKeyDown:q,type:"text",maxLength:C.length,inputMode:"numeric",label:e}),I.jsx("div",{role:"presentation",style:Y,className:N(`${Q}__overlay`),children:l()})]})});j.displayName="DateField";exports.DateField=j;
|
|
2
|
-
//# sourceMappingURL=date-field-
|
|
1
|
+
"use strict";const I=require("react/jsx-runtime"),P=require("react"),K=require("./text-field-CYJzQG3h.js"),Z=require("./bind-DeUYJ6m9.js"),a=require("./format-CFKKBdIQ.js");function V(){return Object.assign({},a.getDefaultOptions())}function U(n,e){const r=a.toDate(n,e?.in).getDay();return r===0?7:r}function J(n,e){const r=S(e)?new e(0):a.constructFrom(e,0);return r.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),r.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),r}function S(n){return typeof n=="function"&&n.prototype?.constructor===n}const ee=10;class X{subPriority=0;validate(e,r){return!0}}class te extends X{constructor(e,r,t,s,o){super(),this.value=e,this.validateValue=r,this.setValue=t,this.priority=s,o&&(this.subPriority=o)}validate(e,r){return this.validateValue(e,this.value,r)}set(e,r,t){return this.setValue(e,r,this.value,t)}}class re extends X{priority=ee;subPriority=-1;constructor(e,r){super(),this.context=e||(t=>a.constructFrom(r,t))}set(e,r){return r.timestampIsSet?e:a.constructFrom(e,J(e,this.context))}}class c{run(e,r,t,s){const o=this.parse(e,r,t,s);return o?{setter:new te(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(e,r,t){return!0}}class ne extends c{priority=140;parse(e,r,t){switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"});case"GGGGG":return t.era(e,{width:"narrow"});default:return t.era(e,{width:"wide"})||t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"})}}set(e,r,t){return r.era=t,e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const h={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},T={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function p(n,e){return n&&{value:e(n.value),rest:n.rest}}function f(n,e){const r=e.match(n);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function D(n,e){const r=e.match(n);if(!r)return null;if(r[0]==="Z")return{value:0,rest:e.slice(1)};const t=r[1]==="+"?1:-1,s=r[2]?parseInt(r[2],10):0,o=r[3]?parseInt(r[3],10):0,u=r[5]?parseInt(r[5],10):0;return{value:t*(s*a.millisecondsInHour+o*a.millisecondsInMinute+u*a.millisecondsInSecond),rest:e.slice(r[0].length)}}function A(n){return f(h.anyDigitsSigned,n)}function w(n,e){switch(n){case 1:return f(h.singleDigit,e);case 2:return f(h.twoDigits,e);case 3:return f(h.threeDigits,e);case 4:return f(h.fourDigits,e);default:return f(new RegExp("^\\d{1,"+n+"}"),e)}}function R(n,e){switch(n){case 1:return f(h.singleDigitSigned,e);case 2:return f(h.twoDigitsSigned,e);case 3:return f(h.threeDigitsSigned,e);case 4:return f(h.fourDigitsSigned,e);default:return f(new RegExp("^-?\\d{1,"+n+"}"),e)}}function F(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function z(n,e){const r=e>0,t=r?e:1-e;let s;if(t<=50)s=n||100;else{const o=t+50,u=Math.trunc(o/100)*100,b=n>=o%100;s=n+u-(b?100:0)}return r?s:1-s}function $(n){return n%400===0||n%4===0&&n%100!==0}class se extends c{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,r,t){const s=o=>({year:o,isTwoDigitYear:r==="yy"});switch(r){case"y":return p(w(4,e),s);case"yo":return p(t.ordinalNumber(e,{unit:"year"}),s);default:return p(w(r.length,e),s)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,t){const s=e.getFullYear();if(t.isTwoDigitYear){const u=z(t.year,s);return e.setFullYear(u,0,1),e.setHours(0,0,0,0),e}const o=!("era"in r)||r.era===1?t.year:1-t.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class oe extends c{priority=130;parse(e,r,t){const s=o=>({year:o,isTwoDigitYear:r==="YY"});switch(r){case"Y":return p(w(4,e),s);case"Yo":return p(t.ordinalNumber(e,{unit:"year"}),s);default:return p(w(r.length,e),s)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,t,s){const o=a.getWeekYear(e,s);if(t.isTwoDigitYear){const b=z(t.year,o);return e.setFullYear(b,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),a.startOfWeek(e,s)}const u=!("era"in r)||r.era===1?t.year:1-t.year;return e.setFullYear(u,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),a.startOfWeek(e,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ae extends c{priority=130;parse(e,r){return R(r==="R"?4:r.length,e)}set(e,r,t){const s=a.constructFrom(e,0);return s.setFullYear(t,0,4),s.setHours(0,0,0,0),a.startOfISOWeek(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class ie extends c{priority=130;parse(e,r){return R(r==="u"?4:r.length,e)}set(e,r,t){return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class ce extends c{priority=120;parse(e,r,t){switch(r){case"Q":case"QQ":return w(r.length,e);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});default:return t.quarter(e,{width:"wide",context:"formatting"})||t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=1&&r<=4}set(e,r,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class ue extends c{priority=120;parse(e,r,t){switch(r){case"q":case"qq":return w(r.length,e);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});default:return t.quarter(e,{width:"wide",context:"standalone"})||t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=1&&r<=4}set(e,r,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class le extends c{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,r,t){const s=o=>o-1;switch(r){case"M":return p(f(h.month,e),s);case"MM":return p(w(2,e),s);case"Mo":return p(t.ordinalNumber(e,{unit:"month"}),s);case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});default:return t.month(e,{width:"wide",context:"formatting"})||t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}}class de extends c{priority=110;parse(e,r,t){const s=o=>o-1;switch(r){case"L":return p(f(h.month,e),s);case"LL":return p(w(2,e),s);case"Lo":return p(t.ordinalNumber(e,{unit:"month"}),s);case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});default:return t.month(e,{width:"wide",context:"standalone"})||t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function fe(n,e,r){const t=a.toDate(n,r?.in),s=a.getWeek(t,r)-e;return t.setDate(t.getDate()-s*7),a.toDate(t,r?.in)}class we extends c{priority=100;parse(e,r,t){switch(r){case"w":return f(h.week,e);case"wo":return t.ordinalNumber(e,{unit:"week"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,t,s){return a.startOfWeek(fe(e,t,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function he(n,e,r){const t=a.toDate(n,r?.in),s=a.getISOWeek(t,r)-e;return t.setDate(t.getDate()-s*7),t}class pe extends c{priority=100;parse(e,r,t){switch(r){case"I":return f(h.week,e);case"Io":return t.ordinalNumber(e,{unit:"week"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,t){return a.startOfISOWeek(he(e,t))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const ye=[31,28,31,30,31,30,31,31,30,31,30,31],xe=[31,29,31,30,31,30,31,31,30,31,30,31];class be extends c{priority=90;subPriority=1;parse(e,r,t){switch(r){case"d":return f(h.date,e);case"do":return t.ordinalNumber(e,{unit:"date"});default:return w(r.length,e)}}validate(e,r){const t=e.getFullYear(),s=$(t),o=e.getMonth();return s?r>=1&&r<=xe[o]:r>=1&&r<=ye[o]}set(e,r,t){return e.setDate(t),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class me extends c{priority=90;subpriority=1;parse(e,r,t){switch(r){case"D":case"DD":return f(h.dayOfYear,e);case"Do":return t.ordinalNumber(e,{unit:"date"});default:return w(r.length,e)}}validate(e,r){const t=e.getFullYear();return $(t)?r>=1&&r<=366:r>=1&&r<=365}set(e,r,t){return e.setMonth(0,t),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function W(n,e,r){const t=a.getDefaultOptions(),s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,o=a.toDate(n,r?.in),u=o.getDay(),y=(e%7+7)%7,_=7-s,Y=e<0||e>6?e-(u+_)%7:(y+_)%7-(u+_)%7;return a.addDays(o,Y,r)}class ge extends c{priority=90;parse(e,r,t){switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class Te extends c{priority=90;parse(e,r,t,s){const o=u=>{const b=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+b};switch(r){case"e":case"ee":return p(w(r.length,e),o);case"eo":return p(t.ordinalNumber(e,{unit:"day"}),o);case"eee":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"eeeee":return t.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class De extends c{priority=90;parse(e,r,t,s){const o=u=>{const b=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+b};switch(r){case"c":case"cc":return p(w(r.length,e),o);case"co":return p(t.ordinalNumber(e,{unit:"day"}),o);case"ccc":return t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});case"ccccc":return t.day(e,{width:"narrow",context:"standalone"});case"cccccc":return t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});default:return t.day(e,{width:"wide",context:"standalone"})||t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function _e(n,e,r){const t=a.toDate(n,r?.in),s=U(t,r),o=e-s;return a.addDays(t,o,r)}class ke extends c{priority=90;parse(e,r,t){const s=o=>o===0?7:o;switch(r){case"i":case"ii":return w(r.length,e);case"io":return t.ordinalNumber(e,{unit:"day"});case"iii":return p(t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s);case"iiiii":return p(t.day(e,{width:"narrow",context:"formatting"}),s);case"iiiiii":return p(t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s);default:return p(t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s)}}validate(e,r){return r>=1&&r<=7}set(e,r,t){return e=_e(e,t),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Pe extends c{priority=80;parse(e,r,t){switch(r){case"a":case"aa":case"aaa":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class Me extends c{priority=80;parse(e,r,t){switch(r){case"b":case"bb":case"bbb":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class Oe extends c{priority=80;parse(e,r,t){switch(r){case"B":case"BB":case"BBB":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class Ye extends c{priority=70;parse(e,r,t){switch(r){case"h":return f(h.hour12h,e);case"ho":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=12}set(e,r,t){const s=e.getHours()>=12;return s&&t<12?e.setHours(t+12,0,0,0):!s&&t===12?e.setHours(0,0,0,0):e.setHours(t,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class Ee extends c{priority=70;parse(e,r,t){switch(r){case"H":return f(h.hour23h,e);case"Ho":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=23}set(e,r,t){return e.setHours(t,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class He extends c{priority=70;parse(e,r,t){switch(r){case"K":return f(h.hour11h,e);case"Ko":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.getHours()>=12&&t<12?e.setHours(t+12,0,0,0):e.setHours(t,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class Ie extends c{priority=70;parse(e,r,t){switch(r){case"k":return f(h.hour24h,e);case"ko":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=24}set(e,r,t){const s=t<=24?t%24:t;return e.setHours(s,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class qe extends c{priority=60;parse(e,r,t){switch(r){case"m":return f(h.minute,e);case"mo":return t.ordinalNumber(e,{unit:"minute"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,t){return e.setMinutes(t,0,0),e}incompatibleTokens=["t","T"]}class Re extends c{priority=50;parse(e,r,t){switch(r){case"s":return f(h.second,e);case"so":return t.ordinalNumber(e,{unit:"second"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,t){return e.setSeconds(t,0),e}incompatibleTokens=["t","T"]}class Le extends c{priority=30;parse(e,r){const t=s=>Math.trunc(s*Math.pow(10,-r.length+3));return p(w(r.length,e),t)}set(e,r,t){return e.setMilliseconds(t),e}incompatibleTokens=["t","T"]}class ve extends c{priority=10;parse(e,r){switch(r){case"X":return D(T.basicOptionalMinutes,e);case"XX":return D(T.basic,e);case"XXXX":return D(T.basicOptionalSeconds,e);case"XXXXX":return D(T.extendedOptionalSeconds,e);default:return D(T.extended,e)}}set(e,r,t){return r.timestampIsSet?e:a.constructFrom(e,e.getTime()-a.getTimezoneOffsetInMilliseconds(e)-t)}incompatibleTokens=["t","T","x"]}class Ne extends c{priority=10;parse(e,r){switch(r){case"x":return D(T.basicOptionalMinutes,e);case"xx":return D(T.basic,e);case"xxxx":return D(T.basicOptionalSeconds,e);case"xxxxx":return D(T.extendedOptionalSeconds,e);default:return D(T.extended,e)}}set(e,r,t){return r.timestampIsSet?e:a.constructFrom(e,e.getTime()-a.getTimezoneOffsetInMilliseconds(e)-t)}incompatibleTokens=["t","T","X"]}class Qe extends c{priority=40;parse(e){return A(e)}set(e,r,t){return[a.constructFrom(e,t*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Ce extends c{priority=20;parse(e){return A(e)}set(e,r,t){return[a.constructFrom(e,t),{timestampIsSet:!0}]}incompatibleTokens="*"}const Fe={G:new ne,y:new se,Y:new oe,R:new ae,u:new ie,Q:new ce,q:new ue,M:new le,L:new de,w:new we,I:new pe,d:new be,D:new me,E:new ge,e:new Te,c:new De,i:new ke,a:new Pe,b:new Me,B:new Oe,h:new Ye,H:new Ee,K:new He,k:new Ie,m:new qe,s:new Re,S:new Le,X:new ve,x:new Ne,t:new Qe,T:new Ce},We=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Be=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ge=/^'([^]*?)'?$/,Xe=/''/g,Ae=/\S/,ze=/[a-zA-Z]/;function $e(n,e,r,t){const s=()=>a.constructFrom(r,NaN),o=V(),u=o.locale??a.enUS,b=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,y=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,_={firstWeekContainsDate:b,weekStartsOn:y,locale:u},Y=[new re(t?.in,r)],L=e.match(Be).map(i=>{const l=i[0];if(l in a.longFormatters){const d=a.longFormatters[l];return d(i,u.formatLong)}return i}).join("").match(We),k=[];for(let i of L){a.isProtectedWeekYearToken(i)&&a.warnOrThrowProtectedError(i,e,n),a.isProtectedDayOfYearToken(i)&&a.warnOrThrowProtectedError(i,e,n);const l=i[0],d=Fe[l];if(d){const{incompatibleTokens:x}=d;if(Array.isArray(x)){const O=k.find(m=>x.includes(m.token)||m.token===l);if(O)throw new RangeError(`The format string mustn't contain \`${O.fullToken}\` and \`${i}\` at the same time`)}else if(d.incompatibleTokens==="*"&&k.length>0)throw new RangeError(`The format string mustn't contain \`${i}\` and any other token at the same time`);k.push({token:l,fullToken:i});const g=d.run(n,i,u.match,_);if(!g)return s();Y.push(g.setter),n=g.rest}else{if(l.match(ze))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");if(i==="''"?i="'":l==="'"&&(i=je(i)),n.indexOf(i)===0)n=n.slice(i.length);else return s()}}if(n.length>0&&Ae.test(n))return s();const H=Y.map(i=>i.priority).sort((i,l)=>l-i).filter((i,l,d)=>d.indexOf(i)===l).map(i=>Y.filter(l=>l.priority===i).sort((l,d)=>d.subPriority-l.subPriority)).map(i=>i[0]);let M=a.toDate(r,t?.in);if(isNaN(+M))return s();const q={};for(const i of H){if(!i.validate(M,_))return s();const l=i.set(M,q,_);Array.isArray(l)?(M=l[0],Object.assign(q,l[1])):M=l}return M}function je(n){return n.match(Ge)[1].replace(Xe,"'")}const Ke={"purpur-date-field__container":"_purpur-date-field__container_ci2f4_1","purpur-date-field__overlay":"_purpur-date-field__overlay_ci2f4_5","purpur-date-field__start-adornment":"_purpur-date-field__start-adornment_ci2f4_16"},Ze=n=>$e(n,"yyyy-MM-dd",new Date),G=n=>n?a.format(n,"yyyy-MM-dd"):"",Ve=(...n)=>{const e=n.filter(Boolean);return e.length<=1?e[0]||null:r=>{for(const t of e)typeof t=="function"?t(r):t&&(t.current=r)}},N=Z.c.bind(Ke),Q="purpur-date-field",C="YYYY-MM-DD",Ue=(n,e)=>{let r=n;return e.length>4&&n>=4&&(r+=1),e.length>7&&n>=6&&(r+=1),Math.min(r,e.length)},j=P.forwardRef(({value:n,label:e,onChange:r,startAdornment:t,...s},o)=>{const[u,b]=P.useState(G(n));P.useEffect(()=>{b(n?G(n):"")},[n]);const y=P.useRef(null),_=Ve(o,y),[Y,L]=P.useState({}),k=P.useRef(null),H=P.useRef(null);P.useLayoutEffect(()=>{if(y.current){const d=window.document.querySelector(`label[for="${y.current.id}"]`),x=d?d.offsetHeight+4:0,g=window.getComputedStyle(y.current);L({position:"absolute",top:y.current.offsetTop+x,left:y.current.offsetLeft,padding:g.padding,width:y.current.offsetWidth,height:y.current.offsetHeight})}},[u,e,y]),P.useLayoutEffect(()=>{k.current!==null&&y.current&&(y.current.setSelectionRange(k.current,k.current),k.current=null)},[u]);const M=d=>{if(d.length===0&&r?.(void 0),d.length!==C.length)return;const x=Ze(d);a.isValid(x)&&r?.(x)},q=d=>{const x=d.currentTarget.selectionStart??0;H.current=u.slice(0,x).replace(/\D/g,"").length},i=d=>{const x=d.target.value,g=d.target.selectionStart??0,O=u.replace(/\D/g,""),m=x.replace(/\D/g,"");let E="";m.length>0&&(E+=m.slice(0,4)),m.length>4&&(E+="-"+m.slice(4,6)),m.length>6&&(E+="-"+m.slice(6,8));let v;const B=H.current;B!==null&&m.length>O.length?v=Math.min(B+(m.length-O.length),m.length):v=Math.min(x.slice(0,g).replace(/\D/g,"").length,m.length),H.current=null,k.current=Ue(v,E),b(E),M(E)},l=()=>C.split("").map((x,g)=>{const O=u[g];return I.jsx("span",{style:{color:O?"transparent":"var(--purpur-color-text-weak)"},children:O||x},g)});return I.jsxs("div",{className:N(`${Q}__container`),children:[I.jsx(K.TextField,{...s,startAdornment:t&&I.jsx("span",{className:N(`${Q}__start-adornment`),children:t}),ref:_,value:u,onChange:i,onKeyDown:q,type:"text",maxLength:C.length,inputMode:"numeric",label:e}),I.jsx("div",{role:"presentation",style:Y,className:N(`${Q}__overlay`),children:l()})]})});j.displayName="DateField";exports.DateField=j;
|
|
2
|
+
//# sourceMappingURL=date-field-BJaomFjs.js.map
|