@purpur/library 9.6.0 → 9.7.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/CHANGELOG.json +57 -0
- package/CHANGELOG.md +26 -1
- package/dist/LICENSE.txt +7 -7
- package/dist/ThemeProvider-D7oXcAde.js +2 -0
- package/dist/{ThemeProvider-Dy771oix.js.map → ThemeProvider-D7oXcAde.js.map} +1 -1
- package/dist/ThemeProvider-DiDBfyFA.mjs +348 -0
- package/dist/{ThemeProvider-CkX-BNWN.mjs.map → ThemeProvider-DiDBfyFA.mjs.map} +1 -1
- package/dist/carousel-BIKcwvYz.mjs +1658 -0
- package/dist/carousel-BIKcwvYz.mjs.map +1 -0
- package/dist/carousel-DnSaLDZf.js +2 -0
- package/dist/carousel-DnSaLDZf.js.map +1 -0
- package/dist/carousel.cjs.js +1 -1
- package/dist/carousel.es.js +1 -1
- package/dist/{comparison-table-Nhp5W6Yc.js → comparison-table-0UDB2BTU.js} +2 -2
- package/dist/{comparison-table-Nhp5W6Yc.js.map → comparison-table-0UDB2BTU.js.map} +1 -1
- package/dist/{comparison-table-CZMKl1TX.mjs → comparison-table-CjTE-fHN.mjs} +48 -48
- package/dist/{comparison-table-CZMKl1TX.mjs.map → comparison-table-CjTE-fHN.mjs.map} +1 -1
- package/dist/comparison-table.cjs.js +1 -1
- package/dist/comparison-table.es.js +1 -1
- package/dist/components/button/src/button.d.ts +1 -1
- package/dist/components/button/src/button.visual.fixtures.d.ts +43 -0
- package/dist/components/button/src/button.visual.fixtures.d.ts.map +1 -0
- package/dist/components/carousel/src/carousel.d.ts.map +1 -1
- package/dist/components/date-picker/src/date-picker.d.ts +8 -0
- package/dist/components/date-picker/src/date-picker.d.ts.map +1 -1
- package/dist/components/drawer/src/drawer-content.d.ts +21 -0
- package/dist/components/drawer/src/drawer-content.d.ts.map +1 -1
- package/dist/components/hero-banner/src/hero-banner.visual.fixtures.d.ts +14 -0
- package/dist/components/hero-banner/src/hero-banner.visual.fixtures.d.ts.map +1 -0
- package/dist/components/modal/src/modal-content.d.ts +21 -0
- package/dist/components/modal/src/modal-content.d.ts.map +1 -1
- package/dist/components/modal/src/modal.d.ts +2 -0
- package/dist/components/modal/src/modal.d.ts.map +1 -1
- package/dist/components/popover/src/popover-content.d.ts +14 -0
- package/dist/components/popover/src/popover-content.d.ts.map +1 -1
- package/dist/components/radio-card-group/src/is-radio-card-item.d.ts +4 -0
- package/dist/components/radio-card-group/src/is-radio-card-item.d.ts.map +1 -0
- package/dist/components/radio-card-group/src/radio-card-group.constants.d.ts +5 -0
- package/dist/components/radio-card-group/src/radio-card-group.constants.d.ts.map +1 -0
- package/dist/components/radio-card-group/src/radio-card-group.d.ts +5 -6
- package/dist/components/radio-card-group/src/radio-card-group.d.ts.map +1 -1
- package/dist/components/radio-card-group/src/radio-card-item.d.ts +1 -2
- package/dist/components/radio-card-group/src/radio-card-item.d.ts.map +1 -1
- package/dist/components/search-field/src/search-field-autocomplete.d.ts +6 -3
- package/dist/components/search-field/src/search-field-autocomplete.d.ts.map +1 -1
- package/dist/components/search-field/src/search-field-base.d.ts +10 -3
- package/dist/components/search-field/src/search-field-base.d.ts.map +1 -1
- package/dist/components/search-field/src/search-field-button.d.ts +3 -1
- package/dist/components/search-field/src/search-field-button.d.ts.map +1 -1
- package/dist/components/search-field/src/search-field.d.ts +12 -6
- package/dist/components/search-field/src/search-field.d.ts.map +1 -1
- package/dist/components/table/src/drag-indicator-circle.d.ts +8 -1
- package/dist/components/table/src/drag-indicator-circle.d.ts.map +1 -1
- package/dist/components/table/src/table.d.ts.map +1 -1
- package/dist/components/tooltip/src/tooltip.d.ts +21 -0
- package/dist/components/tooltip/src/tooltip.d.ts.map +1 -1
- package/dist/components-metadata.js +0 -2
- package/dist/date-picker-CIizn3Pv.js +2 -0
- package/dist/{date-picker-uyPKJulK.js.map → date-picker-CIizn3Pv.js.map} +1 -1
- package/dist/date-picker-DixxW60s.mjs +1617 -0
- package/dist/{date-picker-CzxhZxsw.mjs.map → date-picker-DixxW60s.mjs.map} +1 -1
- package/dist/date-picker.cjs.js +1 -1
- package/dist/date-picker.es.js +1 -1
- package/dist/drawer-BzkRd9F0.mjs +577 -0
- package/dist/drawer-BzkRd9F0.mjs.map +1 -0
- package/dist/drawer-DyhsP34o.js +2 -0
- package/dist/drawer-DyhsP34o.js.map +1 -0
- package/dist/drawer.cjs.js +1 -1
- package/dist/drawer.es.js +1 -1
- package/dist/{footer-D9AcPwlH.js → footer-3Y-664-8.js} +2 -2
- package/dist/{footer-D9AcPwlH.js.map → footer-3Y-664-8.js.map} +1 -1
- package/dist/{footer-BLPlXaZK.mjs → footer-DenAcikt.mjs} +3 -3
- package/dist/{footer-BLPlXaZK.mjs.map → footer-DenAcikt.mjs.map} +1 -1
- package/dist/footer.cjs.js +1 -1
- package/dist/footer.es.js +1 -1
- package/dist/{hero-banner-DkC_BqM7.mjs → hero-banner-B7xrDfzN.mjs} +2 -2
- package/dist/{hero-banner-DkC_BqM7.mjs.map → hero-banner-B7xrDfzN.mjs.map} +1 -1
- package/dist/{hero-banner-D1A-_qou.js → hero-banner-DthITuQ7.js} +2 -2
- package/dist/{hero-banner-D1A-_qou.js.map → hero-banner-DthITuQ7.js.map} +1 -1
- package/dist/hero-banner.cjs.js +1 -1
- package/dist/hero-banner.es.js +1 -1
- package/dist/libraries/theme/src/ThemeProvider.d.ts.map +1 -1
- package/dist/libraries/theme/src/theme.d.ts +1 -0
- package/dist/libraries/theme/src/theme.d.ts.map +1 -1
- package/dist/libraries/theme/src/types.d.ts +7 -0
- package/dist/libraries/theme/src/types.d.ts.map +1 -1
- package/dist/libraries/theme/src/useThemePortalContainer.d.ts +12 -0
- package/dist/libraries/theme/src/useThemePortalContainer.d.ts.map +1 -0
- package/dist/library.cjs.js +1 -1
- package/dist/library.es.js +469 -469
- package/dist/library.es.js.map +1 -1
- package/dist/modal-DJn9idcw.js +2 -0
- package/dist/modal-DJn9idcw.js.map +1 -0
- package/dist/{modal-fp37VbrH.mjs → modal-EIP36327.mjs} +83 -80
- package/dist/modal-EIP36327.mjs.map +1 -0
- package/dist/modal.cjs.js +1 -1
- package/dist/modal.es.js +1 -1
- package/dist/{popover-I26xNbTz.mjs → popover-DERrvReO.mjs} +328 -325
- package/dist/popover-DERrvReO.mjs.map +1 -0
- package/dist/popover-DnGgzfQr.js +2 -0
- package/dist/popover-DnGgzfQr.js.map +1 -0
- package/dist/popover.cjs.js +1 -1
- package/dist/popover.es.js +1 -1
- package/dist/{promotion-card-BiHnQvhn.mjs → promotion-card-BnzIVNQ4.mjs} +2 -2
- package/dist/{promotion-card-BiHnQvhn.mjs.map → promotion-card-BnzIVNQ4.mjs.map} +1 -1
- package/dist/{promotion-card-Bag64gqP.js → promotion-card-DKc2Cx1h.js} +2 -2
- package/dist/{promotion-card-Bag64gqP.js.map → promotion-card-DKc2Cx1h.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/radio-card-group-ZBXjYcQs.mjs +166 -0
- package/dist/radio-card-group-ZBXjYcQs.mjs.map +1 -0
- package/dist/radio-card-group-nrDi5EPK.js +2 -0
- package/dist/radio-card-group-nrDi5EPK.js.map +1 -0
- package/dist/radio-card-group.cjs.js +1 -1
- package/dist/radio-card-group.es.js +3 -5
- package/dist/search-field-2vdDbiT0.js +2 -0
- package/dist/search-field-2vdDbiT0.js.map +1 -0
- package/dist/search-field-DKyNh7pE.mjs +167 -0
- package/dist/search-field-DKyNh7pE.mjs.map +1 -0
- package/dist/search-field.cjs.js +1 -1
- package/dist/search-field.es.js +1 -1
- package/dist/{stepper-CWR2vGPj.mjs → stepper-BDsSa6yr.mjs} +2 -2
- package/dist/{stepper-CWR2vGPj.mjs.map → stepper-BDsSa6yr.mjs.map} +1 -1
- package/dist/{stepper-Df4X7DDR.js → stepper-DpauItjx.js} +2 -2
- package/dist/{stepper-Df4X7DDR.js.map → stepper-DpauItjx.js.map} +1 -1
- package/dist/stepper.cjs.js +1 -1
- package/dist/stepper.es.js +1 -1
- package/dist/{table-gnGUejtb.js → table-BOCcBzSO.js} +4 -4
- package/dist/table-BOCcBzSO.js.map +1 -0
- package/dist/{table-g_n68i4s.mjs → table-i1Gs9e0e.mjs} +440 -440
- package/dist/table-i1Gs9e0e.mjs.map +1 -0
- package/dist/table.cjs.js +1 -1
- package/dist/table.es.js +1 -1
- package/dist/{text-area-peNKG7g4.js → text-area-D0truMT1.js} +2 -2
- package/dist/{text-area-peNKG7g4.js.map → text-area-D0truMT1.js.map} +1 -1
- package/dist/{text-area-kJvg6cFp.mjs → text-area-IVH-k4MM.mjs} +3 -3
- package/dist/{text-area-kJvg6cFp.mjs.map → text-area-IVH-k4MM.mjs.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 +8 -6
- package/dist/theme.es.js.map +1 -1
- package/dist/tooltip-CJGmJDFQ.js +2 -0
- package/dist/{tooltip-C8Zxnqdb.js.map → tooltip-CJGmJDFQ.js.map} +1 -1
- package/dist/{tooltip-LU2Cy-QC.mjs → tooltip-RA-03bKs.mjs} +277 -274
- package/dist/{tooltip-LU2Cy-QC.mjs.map → tooltip-RA-03bKs.mjs.map} +1 -1
- package/dist/tooltip.cjs.js +1 -1
- package/dist/tooltip.es.js +1 -1
- package/dist/{useColorScheme-tAkY9LHt.mjs → useColorScheme-B9DWd-LN.mjs} +2 -2
- package/dist/{useColorScheme-tAkY9LHt.mjs.map → useColorScheme-B9DWd-LN.mjs.map} +1 -1
- package/dist/useColorScheme-DbTQjxNB.js +2 -0
- package/dist/{useColorScheme-DNyjsWX9.js.map → useColorScheme-DbTQjxNB.js.map} +1 -1
- package/dist/useThemePortalContainer-D9BYjEvT.js +2 -0
- package/dist/useThemePortalContainer-D9BYjEvT.js.map +1 -0
- package/dist/useThemePortalContainer-tFLTaYKN.mjs +9 -0
- package/dist/useThemePortalContainer-tFLTaYKN.mjs.map +1 -0
- package/package.json +29 -29
- package/scripts/generate.mts +62 -3
- package/src/library.ts +2 -71
- package/dist/ThemeProvider-CkX-BNWN.mjs +0 -337
- package/dist/ThemeProvider-Dy771oix.js +0 -2
- package/dist/carousel-DLkTL9sj.mjs +0 -1633
- package/dist/carousel-DLkTL9sj.mjs.map +0 -1
- package/dist/carousel-DXrtxRz5.js +0 -2
- package/dist/carousel-DXrtxRz5.js.map +0 -1
- package/dist/date-picker-CzxhZxsw.mjs +0 -1611
- package/dist/date-picker-uyPKJulK.js +0 -2
- package/dist/drawer-8Acg4wkV.mjs +0 -574
- package/dist/drawer-8Acg4wkV.mjs.map +0 -1
- package/dist/drawer-BLHgcEqb.js +0 -2
- package/dist/drawer-BLHgcEqb.js.map +0 -1
- package/dist/modal-Baisuc6m.js +0 -2
- package/dist/modal-Baisuc6m.js.map +0 -1
- package/dist/modal-fp37VbrH.mjs.map +0 -1
- package/dist/popover-B0XJZ5mj.js +0 -2
- package/dist/popover-B0XJZ5mj.js.map +0 -1
- package/dist/popover-I26xNbTz.mjs.map +0 -1
- package/dist/radio-card-group-CneOprGY.mjs +0 -168
- package/dist/radio-card-group-CneOprGY.mjs.map +0 -1
- package/dist/radio-card-group-Ctuvg61o.js +0 -2
- package/dist/radio-card-group-Ctuvg61o.js.map +0 -1
- package/dist/search-field-CpkHGIYi.mjs +0 -151
- package/dist/search-field-CpkHGIYi.mjs.map +0 -1
- package/dist/search-field-Z0PqDARl.js +0 -2
- package/dist/search-field-Z0PqDARl.js.map +0 -1
- package/dist/table-g_n68i4s.mjs.map +0 -1
- package/dist/table-gnGUejtb.js.map +0 -1
- package/dist/tooltip-C8Zxnqdb.js +0 -2
- package/dist/useColorScheme-DNyjsWX9.js +0 -2
- package/tokens/_dark.scss +0 -9
- package/tokens/_index.scss +0 -9
- package/tokens/border/variables.css +0 -13
- package/tokens/border/variables.d.ts +0 -10
- package/tokens/border/variables.dark.css +0 -12
- package/tokens/border/variables.dark.d.ts +0 -10
- package/tokens/border/variables.dark.js +0 -10
- package/tokens/border/variables.dark.json +0 -18
- package/tokens/border/variables.dark.scss +0 -10
- package/tokens/border/variables.js +0 -10
- package/tokens/border/variables.json +0 -18
- package/tokens/border/variables.scss +0 -10
- package/tokens/breakpoint/variables.css +0 -11
- package/tokens/breakpoint/variables.d.ts +0 -8
- package/tokens/breakpoint/variables.dark.css +0 -10
- package/tokens/breakpoint/variables.dark.d.ts +0 -8
- package/tokens/breakpoint/variables.dark.js +0 -8
- package/tokens/breakpoint/variables.dark.json +0 -14
- package/tokens/breakpoint/variables.dark.scss +0 -8
- package/tokens/breakpoint/variables.js +0 -8
- package/tokens/breakpoint/variables.json +0 -14
- package/tokens/breakpoint/variables.scss +0 -8
- package/tokens/color/variables.css +0 -262
- package/tokens/color/variables.d.ts +0 -253
- package/tokens/color/variables.dark.css +0 -262
- package/tokens/color/variables.dark.d.ts +0 -252
- package/tokens/color/variables.dark.js +0 -252
- package/tokens/color/variables.dark.json +0 -306
- package/tokens/color/variables.dark.scss +0 -252
- package/tokens/color/variables.js +0 -253
- package/tokens/color/variables.json +0 -307
- package/tokens/color/variables.scss +0 -253
- package/tokens/dark.css +0 -9
- package/tokens/dark.d.ts +0 -9
- package/tokens/dark.js +0 -9
- package/tokens/filter/variables.css +0 -4
- package/tokens/filter/variables.d.ts +0 -1
- package/tokens/filter/variables.dark.css +0 -3
- package/tokens/filter/variables.dark.d.ts +0 -1
- package/tokens/filter/variables.dark.js +0 -1
- package/tokens/filter/variables.dark.json +0 -7
- package/tokens/filter/variables.dark.scss +0 -1
- package/tokens/filter/variables.js +0 -1
- package/tokens/filter/variables.json +0 -7
- package/tokens/filter/variables.scss +0 -1
- package/tokens/gradient/variables.css +0 -53
- package/tokens/gradient/variables.d.ts +0 -9
- package/tokens/gradient/variables.dark.css +0 -51
- package/tokens/gradient/variables.dark.d.ts +0 -9
- package/tokens/gradient/variables.dark.js +0 -18
- package/tokens/gradient/variables.dark.json +0 -27
- package/tokens/gradient/variables.dark.scss +0 -36
- package/tokens/gradient/variables.js +0 -18
- package/tokens/gradient/variables.json +0 -27
- package/tokens/gradient/variables.scss +0 -42
- package/tokens/index.css +0 -18
- package/tokens/index.d.ts +0 -9
- package/tokens/index.js +0 -9
- package/tokens/motion/variables.css +0 -14
- package/tokens/motion/variables.d.ts +0 -11
- package/tokens/motion/variables.dark.css +0 -13
- package/tokens/motion/variables.dark.d.ts +0 -11
- package/tokens/motion/variables.dark.js +0 -11
- package/tokens/motion/variables.dark.json +0 -19
- package/tokens/motion/variables.dark.scss +0 -11
- package/tokens/motion/variables.js +0 -11
- package/tokens/motion/variables.json +0 -19
- package/tokens/motion/variables.scss +0 -11
- package/tokens/shadow/variables.css +0 -11
- package/tokens/shadow/variables.d.ts +0 -4
- package/tokens/shadow/variables.dark.css +0 -10
- package/tokens/shadow/variables.dark.d.ts +0 -4
- package/tokens/shadow/variables.dark.js +0 -4
- package/tokens/shadow/variables.dark.json +0 -8
- package/tokens/shadow/variables.dark.scss +0 -4
- package/tokens/shadow/variables.js +0 -4
- package/tokens/shadow/variables.json +0 -8
- package/tokens/shadow/variables.scss +0 -4
- package/tokens/spacing/variables.css +0 -26
- package/tokens/spacing/variables.d.ts +0 -23
- package/tokens/spacing/variables.dark.css +0 -17
- package/tokens/spacing/variables.dark.d.ts +0 -15
- package/tokens/spacing/variables.dark.js +0 -15
- package/tokens/spacing/variables.dark.json +0 -19
- package/tokens/spacing/variables.dark.scss +0 -15
- package/tokens/spacing/variables.js +0 -23
- package/tokens/spacing/variables.json +0 -31
- package/tokens/spacing/variables.scss +0 -23
- package/tokens/typography/variables.css +0 -30
- package/tokens/typography/variables.d.ts +0 -26
- package/tokens/typography/variables.dark.css +0 -29
- package/tokens/typography/variables.dark.d.ts +0 -26
- package/tokens/typography/variables.dark.js +0 -28
- package/tokens/typography/variables.dark.json +0 -38
- package/tokens/typography/variables.dark.scss +0 -26
- package/tokens/typography/variables.js +0 -28
- package/tokens/typography/variables.json +0 -38
- package/tokens/typography/variables.scss +0 -26
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-BzkRd9F0.mjs","sources":["../../../components/drawer/src/drawer.context.ts","../../../components/drawer/src/drawer-container.tsx","../../../components/drawer/src/use-swipe-tracking.hook.ts","../../../components/drawer/src/drawer-handle.tsx","../../../components/drawer/src/drawer-header.tsx","../../../components/drawer/src/drawer-scroll-area.tsx","../../../components/drawer/src/drawer-frame.tsx","../../../components/drawer/src/use-swipe-to-dismiss.hook.ts","../../../components/drawer/src/drawer-content.tsx","../../../components/drawer/src/drawer-trigger.tsx","../../../components/drawer/src/drawer.tsx"],"sourcesContent":["import { createContext } from \"react\";\n\nimport { type DrawerVariant, type OpenHandlerFunction } from \"./types\";\n\nexport type DrawerContextValue = {\n isModal: boolean;\n onOpenChange: OpenHandlerFunction;\n variant: DrawerVariant;\n};\n\nexport const DrawerContext = createContext<DrawerContextValue | null>(null);\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./drawer-container.module.scss\";\nimport { type DrawerVariant } from \"./types\";\n\nconst cx = c.bind(styles);\n\nexport type DrawerContainerProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n drawerVariant?: DrawerVariant;\n stickyFooter: boolean;\n variant?: \"header\" | \"body\" | \"footer\";\n};\n\nconst rootClassName = \"purpur-drawer-container\";\n\nexport const DrawerContainer = forwardRef<HTMLDivElement, DrawerContainerProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-container\",\n children,\n className,\n drawerVariant = \"default\",\n variant = \"body\",\n stickyFooter,\n ...props\n },\n ref\n ) => {\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--${variant}`]: variant,\n [`${rootClassName}--sticky`]: stickyFooter,\n [`${rootClassName}--ai`]: drawerVariant === \"ai\",\n },\n className,\n ]);\n\n return (\n <div className={classes} data-testid={dataTestId} ref={ref} {...props}>\n {children}\n </div>\n );\n }\n);\n\nDrawerContainer.displayName = \"DrawerContainer\";\n","import type { PointerEvent, RefObject } from \"react\";\n\nimport { type SwipeEvent } from \"./types\";\n\ntype UseSwipeTracking = {\n onPointerDown(event: PointerEvent): void;\n onPointerMove(event: PointerEvent): void;\n onPointerUp(event: PointerEvent): void;\n};\n\nexport const useSwipeTracking = (\n pointerStartRef: RefObject<{ y: number } | null>,\n swipeDeltaRef: RefObject<{ y: number } | null>,\n onSwipeStart: () => void,\n onSwipeMove: (event: SwipeEvent) => void,\n onSwipeCancel: () => void,\n onSwipeEnd: (event: SwipeEvent) => void\n): UseSwipeTracking => {\n const onPointerDown = (event: PointerEvent) => {\n pointerStartRef.current = { y: event.clientY };\n };\n const onPointerMove = (event: PointerEvent) => {\n if (!pointerStartRef.current) {\n return;\n }\n const y = event.clientY - pointerStartRef.current.y;\n const hasSwipeMoveStarted = Boolean(swipeDeltaRef.current);\n const clampedY = Math.max(0, y);\n const moveStartBuffer = event.pointerType === \"touch\" ? 10 : 2;\n const delta = { y: clampedY };\n const eventDetail = { originalEvent: event, delta };\n if (hasSwipeMoveStarted) {\n swipeDeltaRef.current = delta;\n onSwipeMove(eventDetail);\n } else if (isDeltaInDirection(delta, 0)) {\n swipeDeltaRef.current = delta;\n onSwipeStart();\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n } else if (Math.abs(y) > moveStartBuffer) {\n // User is swiping in wrong direction so we disable swipe gesture\n // for the current pointer down interaction\n pointerStartRef.current = null;\n }\n };\n const onPointerUp = (event: PointerEvent) => {\n const delta = swipeDeltaRef.current;\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n swipeDeltaRef.current = null;\n pointerStartRef.current = null;\n if (delta) {\n const swipeHandle = event.currentTarget;\n const eventDetail = { originalEvent: event, delta };\n if (isDeltaInDirection(delta, 0) && delta.y > 200) {\n onSwipeEnd(eventDetail);\n } else {\n onSwipeCancel();\n }\n // Prevent click event from triggering on items within the drawer when\n // pointer up is part of a swipe gesture\n swipeHandle.addEventListener(\"click\", (event) => event.preventDefault(), {\n once: true,\n });\n }\n };\n return {\n onPointerDown,\n onPointerMove,\n onPointerUp,\n };\n};\n\nconst isDeltaInDirection = (delta: { y: number }, threshold = 0) => {\n const deltaY = Math.abs(delta.y);\n return deltaY > threshold;\n};\n","import React, { forwardRef } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./drawer-handle.module.scss\";\nimport { type DrawerVariant, type SwipeEvent } from \"./types\";\nimport { useSwipeTracking } from \"./use-swipe-tracking.hook\";\n\nconst cx = c.bind(styles);\n\nexport type DrawerHandleProps = Omit<BaseProps, \"children\"> & {\n onSwipeStart(): void;\n onSwipeMove(event: SwipeEvent): void;\n onSwipeCancel(): void;\n onSwipeEnd(event: SwipeEvent): void;\n variant?: DrawerVariant;\n};\n\nconst rootClassName = \"purpur-drawer-handle\";\n\nexport const DrawerHandle = forwardRef<HTMLDivElement, DrawerHandleProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-handle\",\n className,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n variant = \"default\",\n ...props\n },\n ref\n ) => {\n const classes = cx([rootClassName, { [`${rootClassName}--ai`]: variant === \"ai\" }, className]);\n const pointerStartRef = React.useRef<{ y: number } | null>(null);\n const swipeDeltaRef = React.useRef<{ y: number } | null>(null);\n const { onPointerDown, onPointerMove, onPointerUp } = useSwipeTracking(\n swipeDeltaRef,\n pointerStartRef,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd\n );\n\n return (\n <div\n className={classes}\n data-testid={dataTestId}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n ref={ref}\n {...props}\n />\n );\n }\n);\n\nDrawerHandle.displayName = \"DrawerHandle\";\n","import React, { forwardRef } from \"react\";\nimport { Button, BUTTON_VARIANT } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { DisplayVariant, Heading } from \"@purpur/heading\";\nimport { IconChevronLeft } from \"@purpur/icon/chevron-left\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./drawer-header.module.scss\";\nimport { type DrawerVariant } from \"./types\";\n\nconst cx = c.bind(styles);\n\nexport type DrawerHeaderProps = Omit<BaseProps, \"children\"> & {\n backButton: boolean;\n backButtonText?: string;\n backButtonOnlyIcon: boolean;\n closeButtonAriaLabel: string;\n headerContent?: React.ReactNode;\n onBackButtonClick?: () => void;\n onCloseClick?: () => void;\n title: string;\n variant?: DrawerVariant;\n};\n\nconst rootClassName = \"purpur-drawer-header\";\n\nexport const DrawerHeader = forwardRef<HTMLDivElement, DrawerHeaderProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-header\",\n backButton,\n backButtonText,\n backButtonOnlyIcon,\n className,\n closeButtonAriaLabel,\n headerContent,\n onBackButtonClick,\n onCloseClick,\n title,\n variant = \"default\",\n ...props\n },\n ref\n ) => {\n const classes = cx([rootClassName, { [`${rootClassName}--ai`]: variant === \"ai\" }, className]);\n const hasBackButton = !!(backButton && backButtonText && onBackButtonClick);\n const isAi = variant === \"ai\";\n\n const CloseButtonWrapper = onCloseClick ? React.Fragment : RadixDialog.Close;\n\n return (\n <div className={classes} data-testid={dataTestId} ref={ref} {...props}>\n <div\n className={cx([\n `${rootClassName}__row`,\n {\n [`${rootClassName}__row--with-back-button`]: hasBackButton,\n },\n ])}\n data-testid={`${dataTestId}-row`}\n >\n <div className={cx(`${rootClassName}__left`)}>\n {hasBackButton ? (\n <Button\n aria-label={backButtonOnlyIcon ? backButtonText : \"\"}\n className={cx([\n `${rootClassName}__back-button`,\n {\n [`${rootClassName}__back-button--only-icon`]: backButtonOnlyIcon,\n },\n ])}\n data-testid={`${dataTestId}-back-button`}\n iconOnly={backButtonOnlyIcon}\n negative={isAi}\n onClick={onBackButtonClick}\n size=\"sm\"\n variant={backButtonOnlyIcon ? BUTTON_VARIANT.TERTIARY_PURPLE : BUTTON_VARIANT.TEXT}\n >\n <IconChevronLeft size=\"sm\" />\n {!backButtonOnlyIcon && backButtonText}\n </Button>\n ) : headerContent ? (\n <>\n {headerContent}\n <VisuallyHidden asChild>\n <RadixDialog.Title>{title}</RadixDialog.Title>\n </VisuallyHidden>\n </>\n ) : (\n <RadixDialog.Title asChild>\n <Heading\n className={cx(`${rootClassName}__title`)}\n data-testid={`${dataTestId}-title`}\n negative={isAi}\n tag=\"h2\"\n variant={DisplayVariant.DISPLAY10}\n tabIndex={-1}\n >\n {title}\n </Heading>\n </RadixDialog.Title>\n )}\n </div>\n\n <div className={cx(`${rootClassName}__right`)}>\n <CloseButtonWrapper {...(onCloseClick ? {} : { asChild: true })}>\n <Button\n aria-label={closeButtonAriaLabel}\n className={cx(`${rootClassName}__close-button`)}\n iconOnly\n negative={isAi}\n onClick={onCloseClick}\n size=\"sm\"\n variant={BUTTON_VARIANT.TERTIARY_PURPLE}\n >\n <IconClose size=\"sm\" />\n </Button>\n </CloseButtonWrapper>\n </div>\n </div>\n {hasBackButton &&\n (headerContent ? (\n <>\n {headerContent}\n <VisuallyHidden asChild>\n <RadixDialog.Title>{title}</RadixDialog.Title>\n </VisuallyHidden>\n </>\n ) : (\n <RadixDialog.Title asChild>\n <Heading\n data-testid={`${dataTestId}-title-with-back-button`}\n className={cx(`${rootClassName}__title`)}\n negative={isAi}\n tag=\"h2\"\n tabIndex={-1}\n variant={DisplayVariant.DISPLAY10}\n >\n {title}\n </Heading>\n </RadixDialog.Title>\n ))}\n </div>\n );\n }\n);\n\nDrawerHeader.displayName = \"DrawerHeader\";\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport * as RadixScrollArea from \"@radix-ui/react-scroll-area\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./drawer-scroll-area.module.scss\";\nimport { type DrawerVariant } from \"./types\";\n\nconst cx = c.bind(styles);\n\nexport type DrawerScrollAreaProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n drawerVariant?: DrawerVariant;\n fitToContent?: boolean;\n};\n\nconst rootClassName = \"purpur-drawer-scroll-area\";\n\nexport const DrawerScrollArea = forwardRef<HTMLDivElement, DrawerScrollAreaProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-scroll-area\",\n children,\n className,\n drawerVariant = \"default\",\n fitToContent = false,\n ...props\n },\n ref\n ) => {\n const classes = cx([\n rootClassName,\n { [`${rootClassName}--ai`]: drawerVariant === \"ai\" },\n className,\n ]);\n return (\n <div className={classes} data-testid={dataTestId} ref={ref} {...props}>\n <RadixScrollArea.Root\n className={cx(`${rootClassName}__root`, {\n [`${rootClassName}__root--fit-to-content`]: fitToContent,\n })}\n >\n <RadixScrollArea.Viewport className={cx(`${rootClassName}__viewport`)}>\n {children}\n </RadixScrollArea.Viewport>\n <RadixScrollArea.Scrollbar\n className={cx(`${rootClassName}__scrollbar`)}\n orientation=\"vertical\"\n >\n <RadixScrollArea.Thumb className={cx(`${rootClassName}__thumb`)} />\n </RadixScrollArea.Scrollbar>\n </RadixScrollArea.Root>\n </div>\n );\n }\n);\n\nDrawerScrollArea.displayName = \"DrawerScrollArea\";\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport { DrawerContainer } from \"./drawer-container\";\nimport styles from \"./drawer-frame.module.scss\";\nimport { DrawerHandle } from \"./drawer-handle\";\nimport { DrawerHeader } from \"./drawer-header\";\nimport { DrawerScrollArea } from \"./drawer-scroll-area\";\nimport { type DrawerVariant, type Position, type SwipeEvent } from \"./types\";\n\nconst cx = c.bind(styles);\n\nexport type DrawerFrameProps = Omit<BaseProps, \"children\"> & {\n backButton: boolean;\n backButtonText?: string;\n backButtonOnlyIcon: boolean;\n children: ReactNode;\n closeButtonAriaLabel: string;\n fitToContent?: boolean;\n footerContent?: ReactNode;\n headerContent?: ReactNode;\n onBackButtonClick?: () => void;\n onCloseClick?: () => void;\n onSwipeStart(): void;\n onSwipeMove(event: SwipeEvent): void;\n onSwipeCancel(): void;\n onSwipeEnd(event: SwipeEvent): void;\n stickyFooter: boolean;\n title: string;\n position?: Position;\n variant?: DrawerVariant;\n};\n\nconst rootClassName = \"purpur-drawer-frame\";\n\nexport const DrawerFrame = forwardRef<HTMLDivElement, DrawerFrameProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-frame\",\n backButton,\n backButtonText,\n backButtonOnlyIcon,\n children,\n className,\n closeButtonAriaLabel,\n fitToContent = false,\n footerContent,\n headerContent,\n onBackButtonClick,\n onCloseClick,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n title,\n stickyFooter,\n position = \"right\",\n variant = \"default\",\n ...props\n },\n ref\n ) => {\n const hasBackButton = !!(backButton && backButtonText && onBackButtonClick);\n const isAi = variant === \"ai\";\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--fit-to-content`]: fitToContent,\n [`${rootClassName}--sticky-footer`]: stickyFooter,\n [`${rootClassName}--left`]: position === \"left\",\n [`${rootClassName}--right`]: position === \"right\",\n [`${rootClassName}--without-back-button`]: !hasBackButton,\n [`${rootClassName}--with-back-button`]: hasBackButton,\n [`${rootClassName}--ai`]: isAi,\n },\n className,\n ]);\n\n return (\n <div className={classes} data-testid={dataTestId} ref={ref} {...props}>\n <DrawerHandle\n onSwipeStart={onSwipeStart}\n onSwipeMove={onSwipeMove}\n onSwipeCancel={onSwipeCancel}\n onSwipeEnd={onSwipeEnd}\n variant={variant}\n />\n <DrawerContainer\n className={cx(`${rootClassName}__header`)}\n variant=\"header\"\n stickyFooter={stickyFooter}\n drawerVariant={variant}\n >\n <DrawerHeader\n title={title}\n headerContent={headerContent}\n backButtonOnlyIcon={backButtonOnlyIcon}\n backButton={backButton}\n backButtonText={backButtonText}\n closeButtonAriaLabel={closeButtonAriaLabel}\n onBackButtonClick={onBackButtonClick}\n onCloseClick={onCloseClick}\n variant={variant}\n />\n </DrawerContainer>\n {stickyFooter ? (\n <>\n <DrawerScrollArea\n className={cx(`${rootClassName}__body`)}\n data-testid={`${dataTestId}-sticky-footer-scroll-area`}\n fitToContent={fitToContent}\n drawerVariant={variant}\n >\n <DrawerContainer stickyFooter drawerVariant={variant}>\n {children}\n </DrawerContainer>\n </DrawerScrollArea>\n {footerContent && (\n <DrawerContainer\n className={cx(`${rootClassName}__footer`)}\n data-testid={`${dataTestId}-sticky-footer`}\n variant=\"footer\"\n stickyFooter={stickyFooter}\n drawerVariant={variant}\n >\n {footerContent}\n </DrawerContainer>\n )}\n </>\n ) : (\n <DrawerScrollArea\n className={cx(`${rootClassName}__body`)}\n data-testid={`${dataTestId}-scroll-area`}\n fitToContent={fitToContent}\n drawerVariant={variant}\n >\n <div\n className={cx([\n `${rootClassName}__content-container`,\n { [`${rootClassName}__content-container--no-footer`]: !footerContent },\n ])}\n >\n <DrawerContainer stickyFooter={stickyFooter} drawerVariant={variant}>\n {children}\n </DrawerContainer>\n {footerContent && (\n <DrawerContainer\n data-testid={`${dataTestId}-footer`}\n stickyFooter={stickyFooter}\n variant=\"footer\"\n drawerVariant={variant}\n >\n {footerContent}\n </DrawerContainer>\n )}\n </div>\n </DrawerScrollArea>\n )}\n </div>\n );\n }\n);\n\nDrawerFrame.displayName = \"DrawerFrame\";\n","import type { RefObject } from \"react\";\n\nimport { type SwipeEvent } from \"./types\";\n\ntype UseSwipeToDismiss = {\n onSwipeStart(): void;\n onSwipeMove(event: SwipeEvent): void;\n onSwipeCancel(): void;\n onSwipeEnd(event: SwipeEvent): void;\n};\n\nexport const useSwipeToDismiss = <T extends HTMLElement>(\n containerRef: RefObject<T | null>,\n handleOpenChange: ((open: boolean) => void) | null\n): UseSwipeToDismiss => {\n const onSwipeStart = () => {\n if (!containerRef.current) {\n return;\n }\n containerRef.current.setAttribute(\"data-swipe\", \"start\");\n };\n const onSwipeMove = (event: SwipeEvent) => {\n if (!containerRef.current) {\n return;\n }\n const { y } = event.delta;\n containerRef.current.setAttribute(\"data-swipe\", \"move\");\n containerRef.current.style.setProperty(\"--purpur-drawer-swipe-move-y\", `${y}px`);\n };\n const onSwipeCancel = () => {\n if (!containerRef.current) {\n return;\n }\n containerRef.current.setAttribute(\"data-swipe\", \"cancel\");\n containerRef.current.style.removeProperty(\"--purpur-drawer-swipe-move-y\");\n containerRef.current.style.removeProperty(\"--purpur-drawer-swipe-end-y\");\n };\n const onSwipeEnd = (event: SwipeEvent) => {\n if (!containerRef.current) {\n return;\n }\n const { y } = event.delta;\n containerRef.current.setAttribute(\"data-swipe\", \"end\");\n containerRef.current.style.removeProperty(\"--purpur-drawer-swipe-move-y\");\n containerRef.current.style.setProperty(\"--purpur-drawer-swipe-end-y\", `${y}px`);\n handleOpenChange?.(false);\n };\n\n return {\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n };\n};\n","import React, { forwardRef, type ReactNode, useContext, useRef } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { useThemePortalContainer } from \"@purpur/theme\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\nimport c from \"classnames/bind\";\n\nimport { DrawerContext } from \"./drawer.context\";\nimport styles from \"./drawer-content.module.scss\";\nimport { DrawerFrame } from \"./drawer-frame\";\nimport { type Position } from \"./types\";\nimport { useSwipeToDismiss } from \"./use-swipe-to-dismiss.hook\";\n\nconst cx = c.bind(styles);\n\nexport type WithBackButton = {\n backButton: boolean;\n backButtonText: string;\n backButtonOnlyIcon?: boolean;\n onBackButtonClick: () => void;\n};\n\nexport type WithoutBackButton = {\n backButton?: never;\n backButtonText?: never;\n backButtonOnlyIcon?: never;\n onBackButtonClick?: never;\n};\n\nexport type DrawerContentProps = Omit<BaseProps, \"children\"> & {\n bodyText?: string;\n children: ReactNode;\n closeButtonAriaLabel: string;\n /**\n * Optional DOM element to portal the drawer content into. When omitted,\n * the drawer renders inside the nearest `ThemeProvider` so it inherits\n * the active color scheme. Pass `document.body` (or any other element) to\n * override. Pass `null` to fall back to Radix' default (`document.body`).\n */\n container?: HTMLElement | null;\n disableCloseOnClickOutside?: boolean;\n /**\n * If true, the drawer height will fit to its content on small screens.\n */\n fitToContent?: boolean;\n footerContent?: ReactNode;\n headerContent?: ReactNode;\n onCloseClick?: () => void;\n stickyFooter?: boolean;\n title: string;\n zIndex?: number;\n position?: Position;\n} & (WithoutBackButton | WithBackButton);\n\nconst rootClassName = \"purpur-drawer-content\";\n\nexport const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-content\",\n backButton = false,\n backButtonText,\n backButtonOnlyIcon = false,\n bodyText,\n children,\n className,\n closeButtonAriaLabel,\n container,\n disableCloseOnClickOutside = false,\n fitToContent = false,\n footerContent,\n headerContent,\n onBackButtonClick,\n onCloseClick,\n stickyFooter = false,\n title,\n zIndex,\n position = \"right\",\n ...props\n },\n ref\n ) => {\n const drawerContext = useContext(DrawerContext);\n const variant = drawerContext?.variant ?? \"default\";\n const isModal = drawerContext?.isModal ?? true;\n const themePortalContainer = useThemePortalContainer();\n const portalContainer =\n container === undefined ? themePortalContainer : container ?? undefined;\n\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--fit-to-content`]: fitToContent,\n [`${rootClassName}--left`]: position === \"left\",\n [`${rootClassName}--right`]: position === \"right\",\n [`${rootClassName}--ai`]: variant === \"ai\",\n },\n className,\n ]);\n\n const drawerFrameRef = useRef<HTMLDivElement>(null);\n const internalDrawerContentRef = useRef<HTMLDivElement>(null);\n\n const setRef = (node: HTMLDivElement | null) => {\n internalDrawerContentRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n };\n\n const { onSwipeStart, onSwipeMove, onSwipeCancel, onSwipeEnd } = useSwipeToDismiss(\n internalDrawerContentRef,\n drawerContext?.onOpenChange ?? null\n );\n\n const handlePointerDownOutside = (event: CustomEvent<{ originalEvent: PointerEvent }>) => {\n if (disableCloseOnClickOutside) {\n event.preventDefault();\n return;\n }\n\n if (onCloseClick) {\n event.preventDefault();\n onCloseClick();\n }\n };\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (onCloseClick) {\n event.preventDefault();\n onCloseClick();\n }\n };\n\n const handleInitialFocus = () => {\n const frame = drawerFrameRef.current;\n if (frame) {\n const heading = frame.querySelector(\"h2\");\n\n heading &&\n setTimeout(() => {\n heading.focus();\n });\n }\n };\n\n const dialogContent = (\n <RadixDialog.Content\n onPointerDownOutside={handlePointerDownOutside}\n onEscapeKeyDown={handleEscapeKeyDown}\n onOpenAutoFocus={handleInitialFocus}\n className={classes}\n data-testid={dataTestId}\n ref={setRef}\n {...(!bodyText && { [\"aria-describedby\"]: undefined })}\n {...props}\n >\n <DrawerFrame\n backButton={backButton}\n backButtonText={backButtonText}\n backButtonOnlyIcon={backButtonOnlyIcon}\n closeButtonAriaLabel={closeButtonAriaLabel}\n className={cx(`${rootClassName}__drawer-frame`)}\n fitToContent={fitToContent}\n footerContent={footerContent}\n headerContent={headerContent}\n ref={drawerFrameRef}\n onBackButtonClick={onBackButtonClick}\n onCloseClick={onCloseClick}\n onSwipeStart={onSwipeStart}\n onSwipeMove={onSwipeMove}\n onSwipeCancel={onSwipeCancel}\n onSwipeEnd={onSwipeEnd}\n stickyFooter={stickyFooter}\n title={title}\n position={position}\n variant={variant}\n >\n {bodyText ? (\n <div className={cx(`${rootClassName}__content-container`)}>\n <RadixDialog.Description\n className={cx(`${rootClassName}__description`)}\n data-testid={`${dataTestId}-description`}\n >\n {bodyText}\n </RadixDialog.Description>\n <div>{children}</div>\n </div>\n ) : (\n children\n )}\n </DrawerFrame>\n </RadixDialog.Content>\n );\n\n if (!isModal) {\n return (\n <RadixDialog.Portal container={portalContainer}>\n <div\n className={cx(\"purpur-drawer-overlay\")}\n style={zIndex ? { zIndex } : undefined}\n data-testid={`${dataTestId}-overlay`}\n >\n {dialogContent}\n </div>\n </RadixDialog.Portal>\n );\n }\n\n return (\n <RadixDialog.Portal container={portalContainer}>\n <RadixDialog.Overlay\n className={cx(\"purpur-drawer-overlay\")}\n style={zIndex ? { zIndex } : undefined}\n data-testid={`${dataTestId}-overlay`}\n >\n {dialogContent}\n </RadixDialog.Overlay>\n </RadixDialog.Portal>\n );\n }\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\n\nexport type DrawerTriggerProps = Omit<BaseProps<\"button\">, \"children\"> & {\n children: ReactNode;\n};\n\nexport const DrawerTrigger = forwardRef<HTMLButtonElement, DrawerTriggerProps>(\n ({ [\"data-testid\"]: dataTestId = \"purpur-drawer-trigger\", children, ...props }, ref) => {\n return (\n <RadixDialog.Trigger asChild data-testid={dataTestId} ref={ref} {...props}>\n {children}\n </RadixDialog.Trigger>\n );\n }\n);\n\nDrawerTrigger.displayName = \"DrawerTrigger\";\n","import React, { type ReactNode, useEffect } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\n\nimport { DrawerContext } from \"./drawer.context\";\nimport { DrawerContent } from \"./drawer-content\";\nimport { DrawerTrigger } from \"./drawer-trigger\";\nimport { type DrawerVariant } from \"./types\";\n\nexport type { DrawerVariant };\n\nexport type DrawerProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n /**\n * Whether the drawer should be modal. When `true` (default), focus is trapped\n * and pointer events outside the drawer are disabled. Set to `false` when rendering\n * components that use portals (e.g. DatePicker) inside the drawer.\n */\n isModal?: boolean;\n onOpenChange?: (open: boolean) => void;\n open: boolean;\n variant?: DrawerVariant;\n};\n\nexport type DrawerComponent<P> = React.FunctionComponent<P> & {\n Trigger: typeof DrawerTrigger;\n Content: typeof DrawerContent;\n};\n\nexport const Drawer: DrawerComponent<DrawerProps> = ({\n [\"data-testid\"]: dataTestId = \"purpur-drawer\",\n children,\n className,\n isModal = true,\n onOpenChange,\n open = false,\n variant = \"default\",\n ...props\n}: DrawerProps) => {\n const [_open, _setOpen] = React.useState(open);\n\n const handleOpenChange = (newOpen: boolean) => {\n _setOpen(newOpen);\n onOpenChange?.(newOpen);\n };\n\n useEffect(() => {\n _setOpen(open);\n }, [open]);\n\n const contextValue = { isModal, onOpenChange: handleOpenChange, variant };\n\n return (\n <DrawerContext.Provider value={contextValue}>\n <div className={className} data-testid={dataTestId} {...props}>\n <RadixDialog.Root open={_open} onOpenChange={handleOpenChange} modal={isModal}>\n {children}\n </RadixDialog.Root>\n </div>\n </DrawerContext.Provider>\n );\n};\n\nDrawer.Trigger = DrawerTrigger;\nDrawer.Content = DrawerContent;\nDrawer.displayName = \"Drawer\";\n"],"names":["DrawerContext","createContext","cx","c","styles","rootClassName","DrawerContainer","forwardRef","dataTestId","children","className","drawerVariant","variant","stickyFooter","props","ref","classes","jsx","useSwipeTracking","pointerStartRef","swipeDeltaRef","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","event","y","hasSwipeMoveStarted","clampedY","moveStartBuffer","delta","eventDetail","isDeltaInDirection","target","swipeHandle","threshold","DrawerHandle","React","onPointerDown","onPointerMove","onPointerUp","DrawerHeader","backButton","backButtonText","backButtonOnlyIcon","closeButtonAriaLabel","headerContent","onBackButtonClick","onCloseClick","title","hasBackButton","isAi","CloseButtonWrapper","RadixDialog.Close","jsxs","Button","BUTTON_VARIANT","IconChevronLeft","Fragment","VisuallyHidden","RadixDialog.Title","Heading","DisplayVariant","IconClose","DrawerScrollArea","fitToContent","RadixScrollArea.Root","RadixScrollArea.Viewport","RadixScrollArea.Scrollbar","RadixScrollArea.Thumb","DrawerFrame","footerContent","position","useSwipeToDismiss","containerRef","handleOpenChange","DrawerContent","bodyText","container","disableCloseOnClickOutside","zIndex","drawerContext","useContext","isModal","themePortalContainer","useThemePortalContainer","portalContainer","drawerFrameRef","useRef","internalDrawerContentRef","setRef","node","dialogContent","RadixDialog.Content","frame","heading","RadixDialog.Description","RadixDialog.Portal","RadixDialog.Overlay","DrawerTrigger","RadixDialog.Trigger","Drawer","onOpenChange","open","_open","_setOpen","newOpen","useEffect","contextValue","RadixDialog.Root"],"mappings":";;;;;;;;;;;;AAUO,MAAMA,KAAgBC,GAAyC,IAAI;;;;;;;;;;;;;;;;;;;;;;;GCHpEC,KAAKC,EAAE,KAAKC,EAAM,GASlBC,IAAgB,2BAETC,IAAkBC;AAAA,EAC7B,CACE;AAAA,IACE,CAAC,gBAAgBC,IAAa;AAAA,IAC9B,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,SAAAC,IAAU;AAAA,IACV,cAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAUd,GAAG;AAAA,MACjBG;AAAAA,MACA;AAAA,QACE,CAAC,GAAGA,CAAa,KAAKO,CAAO,EAAE,GAAGA;AAAA,QAClC,CAAC,GAAGP,CAAa,UAAU,GAAGQ;AAAA,QAC9B,CAAC,GAAGR,CAAa,MAAM,GAAGM,MAAkB;AAAA,MAAA;AAAA,MAE9CD;AAAA,IAAA,CACD;AAED,WACE,gBAAAO,EAAC,SAAI,WAAWD,GAAS,eAAaR,GAAY,KAAAO,GAAW,GAAGD,GAC7D,UAAAL,EAAA,CACH;AAAA,EAEJ;AACF;AAEAH,EAAgB,cAAc;;;;;;;;;;;;;;;;;;GCvCjBY,KAAmB,CAC9BC,GACAC,GACAC,GACAC,GACAC,GACAC,OAmDO;AAAA,EACL,eAlDoB,CAACC,MAAwB;AAC7C,IAAAN,EAAgB,UAAU,EAAE,GAAGM,EAAM,QAAA;AAAA,EACvC;AAAA,EAiDE,eAhDoB,CA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AEA0F,GAAc,cAAc;ACWrB,MAAME,IAAuC,CAAC;AAAA,EACnD,CAAC,gBAAgB7F,IAAa;AAAA,EAC9B,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAyE,IAAU;AAAA,EACV,cAAAmB;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAA3F,IAAU;AAAA,EACV,GAAGE;AACL,MAAmB;AACjB,QAAM,CAAC0F,GAAOC,CAAQ,IAAIpE,EAAM,SAASkE,CAAI,GAEvC5B,IAAmB,CAAC+B,MAAqB;AAC7C,IAAAD,EAASC,CAAO,GAChBJ,IAAeI,CAAO;AAAA,EACxB;AAEA,EAAAC,GAAU,MAAM;AACd,IAAAF,EAASF,CAAI;AAAA,EACf,GAAG,CAACA,CAAI,CAAC;AAET,QAAMK,IAAe,EAAE,SAAAzB,GAAS,cAAcR,GAAkB,SAAA/D,EAAA;AAEhE,SACE,gBAAAK,EAACjB,GAAc,UAAd,EAAuB,OAAO4G,GAC7B,UAAA,gBAAA3F,EAAC,OAAA,EAAI,WAAAP,GAAsB,eAAaF,GAAa,GAAGM,GACtD,UAAA,gBAAAG,EAAC4F,IAAA,EAAiB,MAAML,GAAO,cAAc7B,GAAkB,OAAOQ,GACnE,UAAA1E,EAAA,CACH,EAAA,CACF,EAAA,CACF;AAEJ;AAEA4F,EAAO,UAAUF;AACjBE,EAAO,UAAUzB;AACjByB,EAAO,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),_=require("react"),j=require("./index-2cFVyGXq.js");require("./ThemeProvider-D7oXcAde.js");const wr=require("./useThemePortalContainer-D9BYjEvT.js"),O=require("./bind-DeUYJ6m9.js"),E=require("./button-DmybVApa.js"),L=require("./heading-drD5ugCC.js"),fr=require("./chevron-left.es-B0vPg5XM.js"),hr=require("./close.es-VL3lKi1O.js"),G=require("./visually-hidden-C2CKovZx.js"),T=require("./index-CoR7YA3H.js"),Z=_.createContext(null),mr="_slideUp_9zrj7_1",jr="_slideDown_9zrj7_1",$r="_slideInRight_9zrj7_1",vr="_slideInLeft_9zrj7_1",xr="_slideOutRight_9zrj7_1",yr="_slideOutLeft_9zrj7_1",gr="_fadeIn_9zrj7_1",br="_fadeOut_9zrj7_1",Nr={"purpur-drawer-content":"_purpur-drawer-content_9zrj7_1",slideUp:mr,slideDown:jr,"purpur-drawer-content--left":"_purpur-drawer-content--left_9zrj7_21","purpur-drawer-content--right":"_purpur-drawer-content--right_9zrj7_24","purpur-drawer-content--fit-to-content":"_purpur-drawer-content--fit-to-content_9zrj7_27",slideInRight:$r,slideInLeft:vr,slideOutRight:xr,slideOutLeft:yr,"purpur-drawer-content__content-container":"_purpur-drawer-content__content-container_9zrj7_63","purpur-drawer-content__description":"_purpur-drawer-content__description_9zrj7_68","purpur-drawer-content--ai":"_purpur-drawer-content--ai_9zrj7_78","purpur-drawer-overlay":"_purpur-drawer-overlay_9zrj7_82",fadeIn:gr,fadeOut:br},Dr={"purpur-drawer-container--header":"_purpur-drawer-container--header_1csed_1","purpur-drawer-container--ai":"_purpur-drawer-container--ai_1csed_4","purpur-drawer-container--body":"_purpur-drawer-container--body_1csed_7","purpur-drawer-container--sticky":"_purpur-drawer-container--sticky_1csed_15","purpur-drawer-container--footer":"_purpur-drawer-container--footer_1csed_23"},Pr=O.c.bind(Dr),M="purpur-drawer-container",C=_.forwardRef(({["data-testid"]:e="purpur-drawer-container",children:a,className:s,drawerVariant:n="default",variant:d="body",stickyFooter:l,...o},u)=>{const p=Pr([M,{[`${M}--${d}`]:d,[`${M}--sticky`]:l,[`${M}--ai`]:n==="ai"},s]);return r.jsx("div",{className:p,"data-testid":e,ref:u,...o,children:a})});C.displayName="DrawerContainer";const zr={"purpur-drawer-frame":"_purpur-drawer-frame_vjt35_1","purpur-drawer-frame--ai":"_purpur-drawer-frame--ai_vjt35_11","purpur-drawer-frame--without-back-button":"_purpur-drawer-frame--without-back-button_vjt35_14","purpur-drawer-frame__header":"_purpur-drawer-frame__header_vjt35_14","purpur-drawer-frame--with-back-button":"_purpur-drawer-frame--with-back-button_vjt35_17","purpur-drawer-frame--left":"_purpur-drawer-frame--left_vjt35_21","purpur-drawer-frame--right":"_purpur-drawer-frame--right_vjt35_25","purpur-drawer-frame--sticky-footer":"_purpur-drawer-frame--sticky-footer_vjt35_36","purpur-drawer-frame__body":"_purpur-drawer-frame__body_vjt35_42","purpur-drawer-frame--fit-to-content":"_purpur-drawer-frame--fit-to-content_vjt35_46","purpur-drawer-frame__footer":"_purpur-drawer-frame__footer_vjt35_55","purpur-drawer-frame__content-container":"_purpur-drawer-frame__content-container_vjt35_58","purpur-drawer-frame__content-container--no-footer":"_purpur-drawer-frame__content-container--no-footer_vjt35_63"},Sr={"purpur-drawer-handle":"_purpur-drawer-handle_lz3ca_1","purpur-drawer-handle--ai":"_purpur-drawer-handle--ai_lz3ca_22"},Ar=(e,a,s,n,d,l)=>({onPointerDown:t=>{e.current={y:t.clientY}},onPointerMove:t=>{if(!e.current)return;const i=t.clientY-e.current.y,w=!!a.current,f=Math.max(0,i),$=t.pointerType==="touch"?10:2,c={y:f},g={originalEvent:t,delta:c};w?(a.current=c,n(g)):J(c,0)?(a.current=c,s(),t.target.setPointerCapture(t.pointerId)):Math.abs(i)>$&&(e.current=null)},onPointerUp:t=>{const i=a.current,w=t.target;if(w.hasPointerCapture(t.pointerId)&&w.releasePointerCapture(t.pointerId),a.current=null,e.current=null,i){const f=t.currentTarget,$={originalEvent:t,delta:i};J(i,0)&&i.y>200?l($):d(),f.addEventListener("click",c=>c.preventDefault(),{once:!0})}}}),J=(e,a=0)=>Math.abs(e.y)>a,Cr=O.c.bind(Sr),Q="purpur-drawer-handle",rr=_.forwardRef(({["data-testid"]:e="purpur-drawer-handle",className:a,onSwipeStart:s,onSwipeMove:n,onSwipeCancel:d,onSwipeEnd:l,variant:o="default",...u},p)=>{const t=Cr([Q,{[`${Q}--ai`]:o==="ai"},a]),i=_.useRef(null),w=_.useRef(null),{onPointerDown:f,onPointerMove:$,onPointerUp:c}=Ar(w,i,s,n,d,l);return r.jsx("div",{className:t,"data-testid":e,onPointerDown:f,onPointerMove:$,onPointerUp:c,ref:p,...u})});rr.displayName="DrawerHandle";const Or={"purpur-drawer-header":"_purpur-drawer-header_1dlfk_1","purpur-drawer-header__row":"_purpur-drawer-header__row_1dlfk_4","purpur-drawer-header__row--with-back-button":"_purpur-drawer-header__row--with-back-button_1dlfk_7","purpur-drawer-header__left":"_purpur-drawer-header__left_1dlfk_10","purpur-drawer-header__right":"_purpur-drawer-header__right_1dlfk_13","purpur-drawer-header__close-button":"_purpur-drawer-header__close-button_1dlfk_16","purpur-drawer-header__back-button--only-icon":"_purpur-drawer-header__back-button--only-icon_1dlfk_27","purpur-drawer-header__title":"_purpur-drawer-header__title_1dlfk_30"},b=O.c.bind(Or),y="purpur-drawer-header",er=_.forwardRef(({["data-testid"]:e="purpur-drawer-header",backButton:a,backButtonText:s,backButtonOnlyIcon:n,className:d,closeButtonAriaLabel:l,headerContent:o,onBackButtonClick:u,onCloseClick:p,title:t,variant:i="default",...w},f)=>{const $=b([y,{[`${y}--ai`]:i==="ai"},d]),c=!!(a&&s&&u),g=i==="ai",V=p?_.Fragment:j.Close;return r.jsxs("div",{className:$,"data-testid":e,ref:f,...w,children:[r.jsxs("div",{className:b([`${y}__row`,{[`${y}__row--with-back-button`]:c}]),"data-testid":`${e}-row`,children:[r.jsx("div",{className:b(`${y}__left`),children:c?r.jsxs(E.Button,{"aria-label":n?s:"",className:b([`${y}__back-button`,{[`${y}__back-button--only-icon`]:n}]),"data-testid":`${e}-back-button`,iconOnly:n,negative:g,onClick:u,size:"sm",variant:n?E.BUTTON_VARIANT.TERTIARY_PURPLE:E.BUTTON_VARIANT.TEXT,children:[r.jsx(fr.l,{size:"sm"}),!n&&s]}):o?r.jsxs(r.Fragment,{children:[o,r.jsx(G.VisuallyHidden,{asChild:!0,children:r.jsx(j.Title,{children:t})})]}):r.jsx(j.Title,{asChild:!0,children:r.jsx(L.Heading,{className:b(`${y}__title`),"data-testid":`${e}-title`,negative:g,tag:"h2",variant:L.DisplayVariant.DISPLAY10,tabIndex:-1,children:t})})}),r.jsx("div",{className:b(`${y}__right`),children:r.jsx(V,{...p?{}:{asChild:!0},children:r.jsx(E.Button,{"aria-label":l,className:b(`${y}__close-button`),iconOnly:!0,negative:g,onClick:p,size:"sm",variant:E.BUTTON_VARIANT.TERTIARY_PURPLE,children:r.jsx(hr.r,{size:"sm"})})})})]}),c&&(o?r.jsxs(r.Fragment,{children:[o,r.jsx(G.VisuallyHidden,{asChild:!0,children:r.jsx(j.Title,{children:t})})]}):r.jsx(j.Title,{asChild:!0,children:r.jsx(L.Heading,{"data-testid":`${e}-title-with-back-button`,className:b(`${y}__title`),negative:g,tag:"h2",tabIndex:-1,variant:L.DisplayVariant.DISPLAY10,children:t})}))]})});er.displayName="DrawerHeader";const Vr={"purpur-drawer-scroll-area__root":"_purpur-drawer-scroll-area__root_vzgxi_1","purpur-drawer-scroll-area__root--fit-to-content":"_purpur-drawer-scroll-area__root--fit-to-content_vzgxi_4","purpur-drawer-scroll-area__viewport":"_purpur-drawer-scroll-area__viewport_vzgxi_10","purpur-drawer-scroll-area__scrollbar":"_purpur-drawer-scroll-area__scrollbar_vzgxi_14","purpur-drawer-scroll-area--ai":"_purpur-drawer-scroll-area--ai_vzgxi_25","purpur-drawer-scroll-area__thumb":"_purpur-drawer-scroll-area__thumb_vzgxi_29"},q=O.c.bind(Vr),D="purpur-drawer-scroll-area",F=_.forwardRef(({["data-testid"]:e="purpur-drawer-scroll-area",children:a,className:s,drawerVariant:n="default",fitToContent:d=!1,...l},o)=>{const u=q([D,{[`${D}--ai`]:n==="ai"},s]);return r.jsx("div",{className:u,"data-testid":e,ref:o,...l,children:r.jsxs(T.Root,{className:q(`${D}__root`,{[`${D}__root--fit-to-content`]:d}),children:[r.jsx(T.Viewport,{className:q(`${D}__viewport`),children:a}),r.jsx(T.Scrollbar,{className:q(`${D}__scrollbar`),orientation:"vertical",children:r.jsx(T.Thumb,{className:q(`${D}__thumb`)})})]})})});F.displayName="DrawerScrollArea";const S=O.c.bind(zr),h="purpur-drawer-frame",tr=_.forwardRef(({["data-testid"]:e="purpur-drawer-frame",backButton:a,backButtonText:s,backButtonOnlyIcon:n,children:d,className:l,closeButtonAriaLabel:o,fitToContent:u=!1,footerContent:p,headerContent:t,onBackButtonClick:i,onCloseClick:w,onSwipeStart:f,onSwipeMove:$,onSwipeCancel:c,onSwipeEnd:g,title:V,stickyFooter:v,position:P="right",variant:m="default",...z},k)=>{const R=!!(a&&s&&i),H=m==="ai",Y=S([h,{[`${h}--fit-to-content`]:u,[`${h}--sticky-footer`]:v,[`${h}--left`]:P==="left",[`${h}--right`]:P==="right",[`${h}--without-back-button`]:!R,[`${h}--with-back-button`]:R,[`${h}--ai`]:H},l]);return r.jsxs("div",{className:Y,"data-testid":e,ref:k,...z,children:[r.jsx(rr,{onSwipeStart:f,onSwipeMove:$,onSwipeCancel:c,onSwipeEnd:g,variant:m}),r.jsx(C,{className:S(`${h}__header`),variant:"header",stickyFooter:v,drawerVariant:m,children:r.jsx(er,{title:V,headerContent:t,backButtonOnlyIcon:n,backButton:a,backButtonText:s,closeButtonAriaLabel:o,onBackButtonClick:i,onCloseClick:w,variant:m})}),v?r.jsxs(r.Fragment,{children:[r.jsx(F,{className:S(`${h}__body`),"data-testid":`${e}-sticky-footer-scroll-area`,fitToContent:u,drawerVariant:m,children:r.jsx(C,{stickyFooter:!0,drawerVariant:m,children:d})}),p&&r.jsx(C,{className:S(`${h}__footer`),"data-testid":`${e}-sticky-footer`,variant:"footer",stickyFooter:v,drawerVariant:m,children:p})]}):r.jsx(F,{className:S(`${h}__body`),"data-testid":`${e}-scroll-area`,fitToContent:u,drawerVariant:m,children:r.jsxs("div",{className:S([`${h}__content-container`,{[`${h}__content-container--no-footer`]:!p}]),children:[r.jsx(C,{stickyFooter:v,drawerVariant:m,children:d}),p&&r.jsx(C,{"data-testid":`${e}-footer`,stickyFooter:v,variant:"footer",drawerVariant:m,children:p})]})})]})});tr.displayName="DrawerFrame";const kr=(e,a)=>({onSwipeStart:()=>{e.current&&e.current.setAttribute("data-swipe","start")},onSwipeMove:o=>{if(!e.current)return;const{y:u}=o.delta;e.current.setAttribute("data-swipe","move"),e.current.style.setProperty("--purpur-drawer-swipe-move-y",`${u}px`)},onSwipeCancel:()=>{e.current&&(e.current.setAttribute("data-swipe","cancel"),e.current.style.removeProperty("--purpur-drawer-swipe-move-y"),e.current.style.removeProperty("--purpur-drawer-swipe-end-y"))},onSwipeEnd:o=>{if(!e.current)return;const{y:u}=o.delta;e.current.setAttribute("data-swipe","end"),e.current.style.removeProperty("--purpur-drawer-swipe-move-y"),e.current.style.setProperty("--purpur-drawer-swipe-end-y",`${u}px`),a?.(!1)}}),A=O.c.bind(Nr),N="purpur-drawer-content",ar=_.forwardRef(({["data-testid"]:e="purpur-drawer-content",backButton:a=!1,backButtonText:s,backButtonOnlyIcon:n=!1,bodyText:d,children:l,className:o,closeButtonAriaLabel:u,container:p,disableCloseOnClickOutside:t=!1,fitToContent:i=!1,footerContent:w,headerContent:f,onBackButtonClick:$,onCloseClick:c,stickyFooter:g=!1,title:V,zIndex:v,position:P="right",...m},z)=>{const k=_.useContext(Z),R=k?.variant??"default",H=k?.isModal??!0,Y=wr.useThemePortalContainer(),I=p===void 0?Y:p??void 0,sr=A([N,{[`${N}--fit-to-content`]:i,[`${N}--left`]:P==="left",[`${N}--right`]:P==="right",[`${N}--ai`]:R==="ai"},o]),K=_.useRef(null),W=_.useRef(null),or=x=>{W.current=x,typeof z=="function"?z(x):z&&(z.current=x)},{onSwipeStart:ur,onSwipeMove:ir,onSwipeCancel:dr,onSwipeEnd:cr}=kr(W,k?.onOpenChange??null),lr=x=>{if(t){x.preventDefault();return}c&&(x.preventDefault(),c())},pr=x=>{c&&(x.preventDefault(),c())},_r=()=>{const x=K.current;if(x){const B=x.querySelector("h2");B&&setTimeout(()=>{B.focus()})}},X=r.jsx(j.Content,{onPointerDownOutside:lr,onEscapeKeyDown:pr,onOpenAutoFocus:_r,className:sr,"data-testid":e,ref:or,...!d&&{"aria-describedby":void 0},...m,children:r.jsx(tr,{backButton:a,backButtonText:s,backButtonOnlyIcon:n,closeButtonAriaLabel:u,className:A(`${N}__drawer-frame`),fitToContent:i,footerContent:w,headerContent:f,ref:K,onBackButtonClick:$,onCloseClick:c,onSwipeStart:ur,onSwipeMove:ir,onSwipeCancel:dr,onSwipeEnd:cr,stickyFooter:g,title:V,position:P,variant:R,children:d?r.jsxs("div",{className:A(`${N}__content-container`),children:[r.jsx(j.Description,{className:A(`${N}__description`),"data-testid":`${e}-description`,children:d}),r.jsx("div",{children:l})]}):l})});return H?r.jsx(j.Portal,{container:I,children:r.jsx(j.Overlay,{className:A("purpur-drawer-overlay"),style:v?{zIndex:v}:void 0,"data-testid":`${e}-overlay`,children:X})}):r.jsx(j.Portal,{container:I,children:r.jsx("div",{className:A("purpur-drawer-overlay"),style:v?{zIndex:v}:void 0,"data-testid":`${e}-overlay`,children:X})})});ar.displayName="DrawerContent";const nr=_.forwardRef(({["data-testid"]:e="purpur-drawer-trigger",children:a,...s},n)=>r.jsx(j.Trigger,{asChild:!0,"data-testid":e,ref:n,...s,children:a}));nr.displayName="DrawerTrigger";const U=({["data-testid"]:e="purpur-drawer",children:a,className:s,isModal:n=!0,onOpenChange:d,open:l=!1,variant:o="default",...u})=>{const[p,t]=_.useState(l),i=f=>{t(f),d?.(f)};_.useEffect(()=>{t(l)},[l]);const w={isModal:n,onOpenChange:i,variant:o};return r.jsx(Z.Provider,{value:w,children:r.jsx("div",{className:s,"data-testid":e,...u,children:r.jsx(j.Root,{open:p,onOpenChange:i,modal:n,children:a})})})};U.Trigger=nr;U.Content=ar;U.displayName="Drawer";exports.Drawer=U;
|
|
2
|
+
//# sourceMappingURL=drawer-DyhsP34o.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-DyhsP34o.js","sources":["../../../components/drawer/src/drawer.context.ts","../../../components/drawer/src/drawer-container.tsx","../../../components/drawer/src/use-swipe-tracking.hook.ts","../../../components/drawer/src/drawer-handle.tsx","../../../components/drawer/src/drawer-header.tsx","../../../components/drawer/src/drawer-scroll-area.tsx","../../../components/drawer/src/drawer-frame.tsx","../../../components/drawer/src/use-swipe-to-dismiss.hook.ts","../../../components/drawer/src/drawer-content.tsx","../../../components/drawer/src/drawer-trigger.tsx","../../../components/drawer/src/drawer.tsx"],"sourcesContent":["import { createContext } from \"react\";\n\nimport { type DrawerVariant, type OpenHandlerFunction } from \"./types\";\n\nexport type DrawerContextValue = {\n isModal: boolean;\n onOpenChange: OpenHandlerFunction;\n variant: DrawerVariant;\n};\n\nexport const DrawerContext = createContext<DrawerContextValue | null>(null);\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./drawer-container.module.scss\";\nimport { type DrawerVariant } from \"./types\";\n\nconst cx = c.bind(styles);\n\nexport type DrawerContainerProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n drawerVariant?: DrawerVariant;\n stickyFooter: boolean;\n variant?: \"header\" | \"body\" | \"footer\";\n};\n\nconst rootClassName = \"purpur-drawer-container\";\n\nexport const DrawerContainer = forwardRef<HTMLDivElement, DrawerContainerProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-container\",\n children,\n className,\n drawerVariant = \"default\",\n variant = \"body\",\n stickyFooter,\n ...props\n },\n ref\n ) => {\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--${variant}`]: variant,\n [`${rootClassName}--sticky`]: stickyFooter,\n [`${rootClassName}--ai`]: drawerVariant === \"ai\",\n },\n className,\n ]);\n\n return (\n <div className={classes} data-testid={dataTestId} ref={ref} {...props}>\n {children}\n </div>\n );\n }\n);\n\nDrawerContainer.displayName = \"DrawerContainer\";\n","import type { PointerEvent, RefObject } from \"react\";\n\nimport { type SwipeEvent } from \"./types\";\n\ntype UseSwipeTracking = {\n onPointerDown(event: PointerEvent): void;\n onPointerMove(event: PointerEvent): void;\n onPointerUp(event: PointerEvent): void;\n};\n\nexport const useSwipeTracking = (\n pointerStartRef: RefObject<{ y: number } | null>,\n swipeDeltaRef: RefObject<{ y: number } | null>,\n onSwipeStart: () => void,\n onSwipeMove: (event: SwipeEvent) => void,\n onSwipeCancel: () => void,\n onSwipeEnd: (event: SwipeEvent) => void\n): UseSwipeTracking => {\n const onPointerDown = (event: PointerEvent) => {\n pointerStartRef.current = { y: event.clientY };\n };\n const onPointerMove = (event: PointerEvent) => {\n if (!pointerStartRef.current) {\n return;\n }\n const y = event.clientY - pointerStartRef.current.y;\n const hasSwipeMoveStarted = Boolean(swipeDeltaRef.current);\n const clampedY = Math.max(0, y);\n const moveStartBuffer = event.pointerType === \"touch\" ? 10 : 2;\n const delta = { y: clampedY };\n const eventDetail = { originalEvent: event, delta };\n if (hasSwipeMoveStarted) {\n swipeDeltaRef.current = delta;\n onSwipeMove(eventDetail);\n } else if (isDeltaInDirection(delta, 0)) {\n swipeDeltaRef.current = delta;\n onSwipeStart();\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n } else if (Math.abs(y) > moveStartBuffer) {\n // User is swiping in wrong direction so we disable swipe gesture\n // for the current pointer down interaction\n pointerStartRef.current = null;\n }\n };\n const onPointerUp = (event: PointerEvent) => {\n const delta = swipeDeltaRef.current;\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n swipeDeltaRef.current = null;\n pointerStartRef.current = null;\n if (delta) {\n const swipeHandle = event.currentTarget;\n const eventDetail = { originalEvent: event, delta };\n if (isDeltaInDirection(delta, 0) && delta.y > 200) {\n onSwipeEnd(eventDetail);\n } else {\n onSwipeCancel();\n }\n // Prevent click event from triggering on items within the drawer when\n // pointer up is part of a swipe gesture\n swipeHandle.addEventListener(\"click\", (event) => event.preventDefault(), {\n once: true,\n });\n }\n };\n return {\n onPointerDown,\n onPointerMove,\n onPointerUp,\n };\n};\n\nconst isDeltaInDirection = (delta: { y: number }, threshold = 0) => {\n const deltaY = Math.abs(delta.y);\n return deltaY > threshold;\n};\n","import React, { forwardRef } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./drawer-handle.module.scss\";\nimport { type DrawerVariant, type SwipeEvent } from \"./types\";\nimport { useSwipeTracking } from \"./use-swipe-tracking.hook\";\n\nconst cx = c.bind(styles);\n\nexport type DrawerHandleProps = Omit<BaseProps, \"children\"> & {\n onSwipeStart(): void;\n onSwipeMove(event: SwipeEvent): void;\n onSwipeCancel(): void;\n onSwipeEnd(event: SwipeEvent): void;\n variant?: DrawerVariant;\n};\n\nconst rootClassName = \"purpur-drawer-handle\";\n\nexport const DrawerHandle = forwardRef<HTMLDivElement, DrawerHandleProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-handle\",\n className,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n variant = \"default\",\n ...props\n },\n ref\n ) => {\n const classes = cx([rootClassName, { [`${rootClassName}--ai`]: variant === \"ai\" }, className]);\n const pointerStartRef = React.useRef<{ y: number } | null>(null);\n const swipeDeltaRef = React.useRef<{ y: number } | null>(null);\n const { onPointerDown, onPointerMove, onPointerUp } = useSwipeTracking(\n swipeDeltaRef,\n pointerStartRef,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd\n );\n\n return (\n <div\n className={classes}\n data-testid={dataTestId}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n ref={ref}\n {...props}\n />\n );\n }\n);\n\nDrawerHandle.displayName = \"DrawerHandle\";\n","import React, { forwardRef } from \"react\";\nimport { Button, BUTTON_VARIANT } from \"@purpur/button\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { DisplayVariant, Heading } from \"@purpur/heading\";\nimport { IconChevronLeft } from \"@purpur/icon/chevron-left\";\nimport { IconClose } from \"@purpur/icon/close\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./drawer-header.module.scss\";\nimport { type DrawerVariant } from \"./types\";\n\nconst cx = c.bind(styles);\n\nexport type DrawerHeaderProps = Omit<BaseProps, \"children\"> & {\n backButton: boolean;\n backButtonText?: string;\n backButtonOnlyIcon: boolean;\n closeButtonAriaLabel: string;\n headerContent?: React.ReactNode;\n onBackButtonClick?: () => void;\n onCloseClick?: () => void;\n title: string;\n variant?: DrawerVariant;\n};\n\nconst rootClassName = \"purpur-drawer-header\";\n\nexport const DrawerHeader = forwardRef<HTMLDivElement, DrawerHeaderProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-header\",\n backButton,\n backButtonText,\n backButtonOnlyIcon,\n className,\n closeButtonAriaLabel,\n headerContent,\n onBackButtonClick,\n onCloseClick,\n title,\n variant = \"default\",\n ...props\n },\n ref\n ) => {\n const classes = cx([rootClassName, { [`${rootClassName}--ai`]: variant === \"ai\" }, className]);\n const hasBackButton = !!(backButton && backButtonText && onBackButtonClick);\n const isAi = variant === \"ai\";\n\n const CloseButtonWrapper = onCloseClick ? React.Fragment : RadixDialog.Close;\n\n return (\n <div className={classes} data-testid={dataTestId} ref={ref} {...props}>\n <div\n className={cx([\n `${rootClassName}__row`,\n {\n [`${rootClassName}__row--with-back-button`]: hasBackButton,\n },\n ])}\n data-testid={`${dataTestId}-row`}\n >\n <div className={cx(`${rootClassName}__left`)}>\n {hasBackButton ? (\n <Button\n aria-label={backButtonOnlyIcon ? backButtonText : \"\"}\n className={cx([\n `${rootClassName}__back-button`,\n {\n [`${rootClassName}__back-button--only-icon`]: backButtonOnlyIcon,\n },\n ])}\n data-testid={`${dataTestId}-back-button`}\n iconOnly={backButtonOnlyIcon}\n negative={isAi}\n onClick={onBackButtonClick}\n size=\"sm\"\n variant={backButtonOnlyIcon ? BUTTON_VARIANT.TERTIARY_PURPLE : BUTTON_VARIANT.TEXT}\n >\n <IconChevronLeft size=\"sm\" />\n {!backButtonOnlyIcon && backButtonText}\n </Button>\n ) : headerContent ? (\n <>\n {headerContent}\n <VisuallyHidden asChild>\n <RadixDialog.Title>{title}</RadixDialog.Title>\n </VisuallyHidden>\n </>\n ) : (\n <RadixDialog.Title asChild>\n <Heading\n className={cx(`${rootClassName}__title`)}\n data-testid={`${dataTestId}-title`}\n negative={isAi}\n tag=\"h2\"\n variant={DisplayVariant.DISPLAY10}\n tabIndex={-1}\n >\n {title}\n </Heading>\n </RadixDialog.Title>\n )}\n </div>\n\n <div className={cx(`${rootClassName}__right`)}>\n <CloseButtonWrapper {...(onCloseClick ? {} : { asChild: true })}>\n <Button\n aria-label={closeButtonAriaLabel}\n className={cx(`${rootClassName}__close-button`)}\n iconOnly\n negative={isAi}\n onClick={onCloseClick}\n size=\"sm\"\n variant={BUTTON_VARIANT.TERTIARY_PURPLE}\n >\n <IconClose size=\"sm\" />\n </Button>\n </CloseButtonWrapper>\n </div>\n </div>\n {hasBackButton &&\n (headerContent ? (\n <>\n {headerContent}\n <VisuallyHidden asChild>\n <RadixDialog.Title>{title}</RadixDialog.Title>\n </VisuallyHidden>\n </>\n ) : (\n <RadixDialog.Title asChild>\n <Heading\n data-testid={`${dataTestId}-title-with-back-button`}\n className={cx(`${rootClassName}__title`)}\n negative={isAi}\n tag=\"h2\"\n tabIndex={-1}\n variant={DisplayVariant.DISPLAY10}\n >\n {title}\n </Heading>\n </RadixDialog.Title>\n ))}\n </div>\n );\n }\n);\n\nDrawerHeader.displayName = \"DrawerHeader\";\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport * as RadixScrollArea from \"@radix-ui/react-scroll-area\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./drawer-scroll-area.module.scss\";\nimport { type DrawerVariant } from \"./types\";\n\nconst cx = c.bind(styles);\n\nexport type DrawerScrollAreaProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n drawerVariant?: DrawerVariant;\n fitToContent?: boolean;\n};\n\nconst rootClassName = \"purpur-drawer-scroll-area\";\n\nexport const DrawerScrollArea = forwardRef<HTMLDivElement, DrawerScrollAreaProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-scroll-area\",\n children,\n className,\n drawerVariant = \"default\",\n fitToContent = false,\n ...props\n },\n ref\n ) => {\n const classes = cx([\n rootClassName,\n { [`${rootClassName}--ai`]: drawerVariant === \"ai\" },\n className,\n ]);\n return (\n <div className={classes} data-testid={dataTestId} ref={ref} {...props}>\n <RadixScrollArea.Root\n className={cx(`${rootClassName}__root`, {\n [`${rootClassName}__root--fit-to-content`]: fitToContent,\n })}\n >\n <RadixScrollArea.Viewport className={cx(`${rootClassName}__viewport`)}>\n {children}\n </RadixScrollArea.Viewport>\n <RadixScrollArea.Scrollbar\n className={cx(`${rootClassName}__scrollbar`)}\n orientation=\"vertical\"\n >\n <RadixScrollArea.Thumb className={cx(`${rootClassName}__thumb`)} />\n </RadixScrollArea.Scrollbar>\n </RadixScrollArea.Root>\n </div>\n );\n }\n);\n\nDrawerScrollArea.displayName = \"DrawerScrollArea\";\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport { DrawerContainer } from \"./drawer-container\";\nimport styles from \"./drawer-frame.module.scss\";\nimport { DrawerHandle } from \"./drawer-handle\";\nimport { DrawerHeader } from \"./drawer-header\";\nimport { DrawerScrollArea } from \"./drawer-scroll-area\";\nimport { type DrawerVariant, type Position, type SwipeEvent } from \"./types\";\n\nconst cx = c.bind(styles);\n\nexport type DrawerFrameProps = Omit<BaseProps, \"children\"> & {\n backButton: boolean;\n backButtonText?: string;\n backButtonOnlyIcon: boolean;\n children: ReactNode;\n closeButtonAriaLabel: string;\n fitToContent?: boolean;\n footerContent?: ReactNode;\n headerContent?: ReactNode;\n onBackButtonClick?: () => void;\n onCloseClick?: () => void;\n onSwipeStart(): void;\n onSwipeMove(event: SwipeEvent): void;\n onSwipeCancel(): void;\n onSwipeEnd(event: SwipeEvent): void;\n stickyFooter: boolean;\n title: string;\n position?: Position;\n variant?: DrawerVariant;\n};\n\nconst rootClassName = \"purpur-drawer-frame\";\n\nexport const DrawerFrame = forwardRef<HTMLDivElement, DrawerFrameProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-frame\",\n backButton,\n backButtonText,\n backButtonOnlyIcon,\n children,\n className,\n closeButtonAriaLabel,\n fitToContent = false,\n footerContent,\n headerContent,\n onBackButtonClick,\n onCloseClick,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n title,\n stickyFooter,\n position = \"right\",\n variant = \"default\",\n ...props\n },\n ref\n ) => {\n const hasBackButton = !!(backButton && backButtonText && onBackButtonClick);\n const isAi = variant === \"ai\";\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--fit-to-content`]: fitToContent,\n [`${rootClassName}--sticky-footer`]: stickyFooter,\n [`${rootClassName}--left`]: position === \"left\",\n [`${rootClassName}--right`]: position === \"right\",\n [`${rootClassName}--without-back-button`]: !hasBackButton,\n [`${rootClassName}--with-back-button`]: hasBackButton,\n [`${rootClassName}--ai`]: isAi,\n },\n className,\n ]);\n\n return (\n <div className={classes} data-testid={dataTestId} ref={ref} {...props}>\n <DrawerHandle\n onSwipeStart={onSwipeStart}\n onSwipeMove={onSwipeMove}\n onSwipeCancel={onSwipeCancel}\n onSwipeEnd={onSwipeEnd}\n variant={variant}\n />\n <DrawerContainer\n className={cx(`${rootClassName}__header`)}\n variant=\"header\"\n stickyFooter={stickyFooter}\n drawerVariant={variant}\n >\n <DrawerHeader\n title={title}\n headerContent={headerContent}\n backButtonOnlyIcon={backButtonOnlyIcon}\n backButton={backButton}\n backButtonText={backButtonText}\n closeButtonAriaLabel={closeButtonAriaLabel}\n onBackButtonClick={onBackButtonClick}\n onCloseClick={onCloseClick}\n variant={variant}\n />\n </DrawerContainer>\n {stickyFooter ? (\n <>\n <DrawerScrollArea\n className={cx(`${rootClassName}__body`)}\n data-testid={`${dataTestId}-sticky-footer-scroll-area`}\n fitToContent={fitToContent}\n drawerVariant={variant}\n >\n <DrawerContainer stickyFooter drawerVariant={variant}>\n {children}\n </DrawerContainer>\n </DrawerScrollArea>\n {footerContent && (\n <DrawerContainer\n className={cx(`${rootClassName}__footer`)}\n data-testid={`${dataTestId}-sticky-footer`}\n variant=\"footer\"\n stickyFooter={stickyFooter}\n drawerVariant={variant}\n >\n {footerContent}\n </DrawerContainer>\n )}\n </>\n ) : (\n <DrawerScrollArea\n className={cx(`${rootClassName}__body`)}\n data-testid={`${dataTestId}-scroll-area`}\n fitToContent={fitToContent}\n drawerVariant={variant}\n >\n <div\n className={cx([\n `${rootClassName}__content-container`,\n { [`${rootClassName}__content-container--no-footer`]: !footerContent },\n ])}\n >\n <DrawerContainer stickyFooter={stickyFooter} drawerVariant={variant}>\n {children}\n </DrawerContainer>\n {footerContent && (\n <DrawerContainer\n data-testid={`${dataTestId}-footer`}\n stickyFooter={stickyFooter}\n variant=\"footer\"\n drawerVariant={variant}\n >\n {footerContent}\n </DrawerContainer>\n )}\n </div>\n </DrawerScrollArea>\n )}\n </div>\n );\n }\n);\n\nDrawerFrame.displayName = \"DrawerFrame\";\n","import type { RefObject } from \"react\";\n\nimport { type SwipeEvent } from \"./types\";\n\ntype UseSwipeToDismiss = {\n onSwipeStart(): void;\n onSwipeMove(event: SwipeEvent): void;\n onSwipeCancel(): void;\n onSwipeEnd(event: SwipeEvent): void;\n};\n\nexport const useSwipeToDismiss = <T extends HTMLElement>(\n containerRef: RefObject<T | null>,\n handleOpenChange: ((open: boolean) => void) | null\n): UseSwipeToDismiss => {\n const onSwipeStart = () => {\n if (!containerRef.current) {\n return;\n }\n containerRef.current.setAttribute(\"data-swipe\", \"start\");\n };\n const onSwipeMove = (event: SwipeEvent) => {\n if (!containerRef.current) {\n return;\n }\n const { y } = event.delta;\n containerRef.current.setAttribute(\"data-swipe\", \"move\");\n containerRef.current.style.setProperty(\"--purpur-drawer-swipe-move-y\", `${y}px`);\n };\n const onSwipeCancel = () => {\n if (!containerRef.current) {\n return;\n }\n containerRef.current.setAttribute(\"data-swipe\", \"cancel\");\n containerRef.current.style.removeProperty(\"--purpur-drawer-swipe-move-y\");\n containerRef.current.style.removeProperty(\"--purpur-drawer-swipe-end-y\");\n };\n const onSwipeEnd = (event: SwipeEvent) => {\n if (!containerRef.current) {\n return;\n }\n const { y } = event.delta;\n containerRef.current.setAttribute(\"data-swipe\", \"end\");\n containerRef.current.style.removeProperty(\"--purpur-drawer-swipe-move-y\");\n containerRef.current.style.setProperty(\"--purpur-drawer-swipe-end-y\", `${y}px`);\n handleOpenChange?.(false);\n };\n\n return {\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n };\n};\n","import React, { forwardRef, type ReactNode, useContext, useRef } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { useThemePortalContainer } from \"@purpur/theme\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\nimport c from \"classnames/bind\";\n\nimport { DrawerContext } from \"./drawer.context\";\nimport styles from \"./drawer-content.module.scss\";\nimport { DrawerFrame } from \"./drawer-frame\";\nimport { type Position } from \"./types\";\nimport { useSwipeToDismiss } from \"./use-swipe-to-dismiss.hook\";\n\nconst cx = c.bind(styles);\n\nexport type WithBackButton = {\n backButton: boolean;\n backButtonText: string;\n backButtonOnlyIcon?: boolean;\n onBackButtonClick: () => void;\n};\n\nexport type WithoutBackButton = {\n backButton?: never;\n backButtonText?: never;\n backButtonOnlyIcon?: never;\n onBackButtonClick?: never;\n};\n\nexport type DrawerContentProps = Omit<BaseProps, \"children\"> & {\n bodyText?: string;\n children: ReactNode;\n closeButtonAriaLabel: string;\n /**\n * Optional DOM element to portal the drawer content into. When omitted,\n * the drawer renders inside the nearest `ThemeProvider` so it inherits\n * the active color scheme. Pass `document.body` (or any other element) to\n * override. Pass `null` to fall back to Radix' default (`document.body`).\n */\n container?: HTMLElement | null;\n disableCloseOnClickOutside?: boolean;\n /**\n * If true, the drawer height will fit to its content on small screens.\n */\n fitToContent?: boolean;\n footerContent?: ReactNode;\n headerContent?: ReactNode;\n onCloseClick?: () => void;\n stickyFooter?: boolean;\n title: string;\n zIndex?: number;\n position?: Position;\n} & (WithoutBackButton | WithBackButton);\n\nconst rootClassName = \"purpur-drawer-content\";\n\nexport const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-drawer-content\",\n backButton = false,\n backButtonText,\n backButtonOnlyIcon = false,\n bodyText,\n children,\n className,\n closeButtonAriaLabel,\n container,\n disableCloseOnClickOutside = false,\n fitToContent = false,\n footerContent,\n headerContent,\n onBackButtonClick,\n onCloseClick,\n stickyFooter = false,\n title,\n zIndex,\n position = \"right\",\n ...props\n },\n ref\n ) => {\n const drawerContext = useContext(DrawerContext);\n const variant = drawerContext?.variant ?? \"default\";\n const isModal = drawerContext?.isModal ?? true;\n const themePortalContainer = useThemePortalContainer();\n const portalContainer =\n container === undefined ? themePortalContainer : container ?? undefined;\n\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--fit-to-content`]: fitToContent,\n [`${rootClassName}--left`]: position === \"left\",\n [`${rootClassName}--right`]: position === \"right\",\n [`${rootClassName}--ai`]: variant === \"ai\",\n },\n className,\n ]);\n\n const drawerFrameRef = useRef<HTMLDivElement>(null);\n const internalDrawerContentRef = useRef<HTMLDivElement>(null);\n\n const setRef = (node: HTMLDivElement | null) => {\n internalDrawerContentRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n };\n\n const { onSwipeStart, onSwipeMove, onSwipeCancel, onSwipeEnd } = useSwipeToDismiss(\n internalDrawerContentRef,\n drawerContext?.onOpenChange ?? null\n );\n\n const handlePointerDownOutside = (event: CustomEvent<{ originalEvent: PointerEvent }>) => {\n if (disableCloseOnClickOutside) {\n event.preventDefault();\n return;\n }\n\n if (onCloseClick) {\n event.preventDefault();\n onCloseClick();\n }\n };\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (onCloseClick) {\n event.preventDefault();\n onCloseClick();\n }\n };\n\n const handleInitialFocus = () => {\n const frame = drawerFrameRef.current;\n if (frame) {\n const heading = frame.querySelector(\"h2\");\n\n heading &&\n setTimeout(() => {\n heading.focus();\n });\n }\n };\n\n const dialogContent = (\n <RadixDialog.Content\n onPointerDownOutside={handlePointerDownOutside}\n onEscapeKeyDown={handleEscapeKeyDown}\n onOpenAutoFocus={handleInitialFocus}\n className={classes}\n data-testid={dataTestId}\n ref={setRef}\n {...(!bodyText && { [\"aria-describedby\"]: undefined })}\n {...props}\n >\n <DrawerFrame\n backButton={backButton}\n backButtonText={backButtonText}\n backButtonOnlyIcon={backButtonOnlyIcon}\n closeButtonAriaLabel={closeButtonAriaLabel}\n className={cx(`${rootClassName}__drawer-frame`)}\n fitToContent={fitToContent}\n footerContent={footerContent}\n headerContent={headerContent}\n ref={drawerFrameRef}\n onBackButtonClick={onBackButtonClick}\n onCloseClick={onCloseClick}\n onSwipeStart={onSwipeStart}\n onSwipeMove={onSwipeMove}\n onSwipeCancel={onSwipeCancel}\n onSwipeEnd={onSwipeEnd}\n stickyFooter={stickyFooter}\n title={title}\n position={position}\n variant={variant}\n >\n {bodyText ? (\n <div className={cx(`${rootClassName}__content-container`)}>\n <RadixDialog.Description\n className={cx(`${rootClassName}__description`)}\n data-testid={`${dataTestId}-description`}\n >\n {bodyText}\n </RadixDialog.Description>\n <div>{children}</div>\n </div>\n ) : (\n children\n )}\n </DrawerFrame>\n </RadixDialog.Content>\n );\n\n if (!isModal) {\n return (\n <RadixDialog.Portal container={portalContainer}>\n <div\n className={cx(\"purpur-drawer-overlay\")}\n style={zIndex ? { zIndex } : undefined}\n data-testid={`${dataTestId}-overlay`}\n >\n {dialogContent}\n </div>\n </RadixDialog.Portal>\n );\n }\n\n return (\n <RadixDialog.Portal container={portalContainer}>\n <RadixDialog.Overlay\n className={cx(\"purpur-drawer-overlay\")}\n style={zIndex ? { zIndex } : undefined}\n data-testid={`${dataTestId}-overlay`}\n >\n {dialogContent}\n </RadixDialog.Overlay>\n </RadixDialog.Portal>\n );\n }\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n","import React, { forwardRef, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\n\nexport type DrawerTriggerProps = Omit<BaseProps<\"button\">, \"children\"> & {\n children: ReactNode;\n};\n\nexport const DrawerTrigger = forwardRef<HTMLButtonElement, DrawerTriggerProps>(\n ({ [\"data-testid\"]: dataTestId = \"purpur-drawer-trigger\", children, ...props }, ref) => {\n return (\n <RadixDialog.Trigger asChild data-testid={dataTestId} ref={ref} {...props}>\n {children}\n </RadixDialog.Trigger>\n );\n }\n);\n\nDrawerTrigger.displayName = \"DrawerTrigger\";\n","import React, { type ReactNode, useEffect } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\n\nimport { DrawerContext } from \"./drawer.context\";\nimport { DrawerContent } from \"./drawer-content\";\nimport { DrawerTrigger } from \"./drawer-trigger\";\nimport { type DrawerVariant } from \"./types\";\n\nexport type { DrawerVariant };\n\nexport type DrawerProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n /**\n * Whether the drawer should be modal. When `true` (default), focus is trapped\n * and pointer events outside the drawer are disabled. Set to `false` when rendering\n * components that use portals (e.g. DatePicker) inside the drawer.\n */\n isModal?: boolean;\n onOpenChange?: (open: boolean) => void;\n open: boolean;\n variant?: DrawerVariant;\n};\n\nexport type DrawerComponent<P> = React.FunctionComponent<P> & {\n Trigger: typeof DrawerTrigger;\n Content: typeof DrawerContent;\n};\n\nexport const Drawer: DrawerComponent<DrawerProps> = ({\n [\"data-testid\"]: dataTestId = \"purpur-drawer\",\n children,\n className,\n isModal = true,\n onOpenChange,\n open = false,\n variant = \"default\",\n ...props\n}: DrawerProps) => {\n const [_open, _setOpen] = React.useState(open);\n\n const handleOpenChange = (newOpen: boolean) => {\n _setOpen(newOpen);\n onOpenChange?.(newOpen);\n };\n\n useEffect(() => {\n _setOpen(open);\n }, [open]);\n\n const contextValue = { isModal, onOpenChange: handleOpenChange, variant };\n\n return (\n <DrawerContext.Provider value={contextValue}>\n <div className={className} data-testid={dataTestId} {...props}>\n <RadixDialog.Root open={_open} onOpenChange={handleOpenChange} modal={isModal}>\n {children}\n </RadixDialog.Root>\n </div>\n </DrawerContext.Provider>\n );\n};\n\nDrawer.Trigger = DrawerTrigger;\nDrawer.Content = DrawerContent;\nDrawer.displayName = \"Drawer\";\n"],"names":["DrawerContext","createContext","cx","c","styles","rootClassName","DrawerContainer","forwardRef","dataTestId","children","className","drawerVariant","variant","stickyFooter","props","ref","classes","jsx","useSwipeTracking","pointerStartRef","swipeDeltaRef","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","event","y","hasSwipeMoveStarted","clampedY","moveStartBuffer","delta","eventDetail","isDeltaInDirection","target","swipeHandle","threshold","DrawerHandle","React","onPointerDown","onPointerMove","onPointerUp","DrawerHeader","backButton","backButtonText","backButtonOnlyIcon","closeButtonAriaLabel","headerContent","onBackButtonClick","onCloseClick","title","hasBackButton","isAi","CloseButtonWrapper","RadixDialog.Close","jsxs","Button","BUTTON_VARIANT","IconChevronLeft","Fragment","VisuallyHidden","RadixDialog.Title","Heading","DisplayVariant","IconClose","DrawerScrollArea","fitToContent","RadixScrollArea.Root","RadixScrollArea.Viewport","RadixScrollArea.Scrollbar","RadixScrollArea.Thumb","DrawerFrame","footerContent","position","useSwipeToDismiss","containerRef","handleOpenChange","DrawerContent","bodyText","container","disableCloseOnClickOutside","zIndex","drawerContext","useContext","isModal","themePortalContainer","useThemePortalContainer","portalContainer","drawerFrameRef","useRef","internalDrawerContentRef","setRef","node","handlePointerDownOutside","handleEscapeKeyDown","handleInitialFocus","frame","heading","dialogContent","RadixDialog.Content","RadixDialog.Description","RadixDialog.Portal","RadixDialog.Overlay","DrawerTrigger","RadixDialog.Trigger","Drawer","onOpenChange","open","_open","_setOpen","newOpen","useEffect","contextValue","RadixDialog.Root"],"mappings":"ycAUaA,EAAgBC,EAAAA,cAAyC,IAAI,swCCHpEC,GAAKC,EAAAA,EAAE,KAAKC,EAAM,EASlBC,EAAgB,0BAETC,EAAkBC,EAAAA,WAC7B,CACE,CACE,CAAC,eAAgBC,EAAa,0BAC9B,SAAAC,EACA,UAAAC,EACA,cAAAC,EAAgB,UAChB,QAAAC,EAAU,OACV,aAAAC,EACA,GAAGC,CAAA,EAELC,IACG,CACH,MAAMC,EAAUd,GAAG,CACjBG,EACA,CACE,CAAC,GAAGA,CAAa,KAAKO,CAAO,EAAE,EAAGA,EAClC,CAAC,GAAGP,CAAa,UAAU,EAAGQ,EAC9B,CAAC,GAAGR,CAAa,MAAM,EAAGM,IAAkB,IAAA,EAE9CD,CAAA,CACD,EAED,OACEO,MAAC,OAAI,UAAWD,EAAS,cAAaR,EAAY,IAAAO,EAAW,GAAGD,EAC7D,SAAAL,CAAA,CACH,CAEJ,CACF,EAEAH,EAAgB,YAAc,kpCCvCjBY,GAAmB,CAC9BC,EACAC,EACAC,EACAC,EACAC,EACAC,KAmDO,CACL,cAlDqBC,GAAwB,CAC7CN,EAAgB,QAAU,CAAE,EAAGM,EAAM,OAAA,CACvC,EAiDE,cAhDqBA,GAAwB,CAC7C,GAAI,CAACN,EAAgB,QACnB,OAEF,MAAMO,EAAID,EAAM,QAAUN,EAAgB,QAAQ,EAC5CQ,EAAsB,EAAQP,EAAc,QAC5CQ,EAAW,KAAK,IAAI,EAAGF,CAAC,EACxBG,EAAkBJ,EAAM,cAAgB,QAAU,GAAK,EACvDK,EAAQ,CAAE,EAAGF,CAAA,EACbG,EAAc,CAAE,cAAeN,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,SAAAC,EACA,UAAAC,EACA,QAAAyE,EAAU,GACV,aAAAsB,EACA,KAAAC,EAAO,GACP,QAAA9F,EAAU,UACV,GAAGE,CACL,IAAmB,CACjB,KAAM,CAAC6F,EAAOC,CAAQ,EAAIvE,EAAM,SAASqE,CAAI,EAEvC/B,EAAoBkC,GAAqB,CAC7CD,EAASC,CAAO,EAChBJ,IAAeI,CAAO,CACxB,EAEAC,EAAAA,UAAU,IAAM,CACdF,EAASF,CAAI,CACf,EAAG,CAACA,CAAI,CAAC,EAET,MAAMK,EAAe,CAAE,QAAA5B,EAAS,aAAcR,EAAkB,QAAA/D,CAAA,EAEhE,OACEK,EAAAA,IAACjB,EAAc,SAAd,CAAuB,MAAO+G,EAC7B,SAAA9F,EAAAA,IAAC,MAAA,CAAI,UAAAP,EAAsB,cAAaF,EAAa,GAAGM,EACtD,SAAAG,EAAAA,IAAC+F,EAAAA,KAAA,CAAiB,KAAML,EAAO,aAAchC,EAAkB,MAAOQ,EACnE,SAAA1E,CAAA,CACH,CAAA,CACF,CAAA,CACF,CAEJ,EAEA+F,EAAO,QAAUF,GACjBE,EAAO,QAAU5B,GACjB4B,EAAO,YAAc"}
|
package/dist/drawer.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./drawer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./drawer-DyhsP34o.js");exports.Drawer=e.Drawer;
|
|
2
2
|
//# sourceMappingURL=drawer.cjs.js.map
|
package/dist/drawer.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),m=require("react"),Z=require("./container-DRwKIAjh.js"),y=require("./link-DhWVrkTz.js"),H=require("./select-DOqTJgTj.js"),L=require("./ThemeProvider-
|
|
2
|
-
//# sourceMappingURL=footer-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),m=require("react"),Z=require("./container-DRwKIAjh.js"),y=require("./link-DhWVrkTz.js"),H=require("./select-DOqTJgTj.js"),L=require("./ThemeProvider-D7oXcAde.js"),w=require("./useColorScheme-DbTQjxNB.js"),g=require("./bind-DeUYJ6m9.js"),x=require("./accordion-DyhOG54L.js"),F=require("./icon.es-j3eRib6d.js"),r="purpur-footer",C={"purpur-footer":"_purpur-footer_yqb4h_1","purpur-footer__container":"_purpur-footer__container_yqb4h_8","purpur-footer__logo":"_purpur-footer__logo_yqb4h_30","purpur-footer__logo--telia":"_purpur-footer__logo--telia_yqb4h_34","purpur-footer__social":"_purpur-footer__social_yqb4h_54","purpur-footer__social--md":"_purpur-footer__social--md_yqb4h_70","purpur-footer__social--sm":"_purpur-footer__social--sm_yqb4h_78","purpur-footer__social-link":"_purpur-footer__social-link_yqb4h_87","purpur-footer__navigation":"_purpur-footer__navigation_yqb4h_107","purpur-footer__navigation-section":"_purpur-footer__navigation-section_yqb4h_116","purpur-footer__navigation-section-heading":"_purpur-footer__navigation-section-heading_yqb4h_119","purpur-footer__navigation--lg":"_purpur-footer__navigation--lg_yqb4h_142","purpur-footer__navigation--sm":"_purpur-footer__navigation--sm_yqb4h_156","purpur-footer__custom-link-navigation":"_purpur-footer__custom-link-navigation_yqb4h_180","purpur-footer__payments":"_purpur-footer__payments_yqb4h_202","purpur-footer__payments-image":"_purpur-footer__payments-image_yqb4h_219","purpur-footer__contacts":"_purpur-footer__contacts_yqb4h_223","purpur-footer__contacts-copyright":"_purpur-footer__contacts-copyright_yqb4h_238","purpur-footer__contacts-address":"_purpur-footer__contacts-address_yqb4h_243","purpur-footer__theme-select":"_purpur-footer__theme-select_yqb4h_247","purpur-footer__additional":"_purpur-footer__additional_yqb4h_263","purpur-footer__additional-links":"_purpur-footer__additional-links_yqb4h_280","purpur-footer__custom-content":"_purpur-footer__custom-content_yqb4h_292"},p=g.c.bind(C),j=({links:c,customLink:t})=>e.jsx("ul",{children:c.map(({href:s,text:o,..._},l)=>e.jsx("li",{children:t?e.jsx(t,{..._,href:s,className:p(`${r}__custom-link-navigation`),children:o}):e.jsx(y.Link,{..._,variant:"navigation",negative:!0,href:s,disableVisited:!0,children:o})},l))}),S=({navigationLinks:c,sectionProps:t,customLink:s})=>e.jsxs(e.Fragment,{children:[e.jsx("section",{...t,className:p(`${r}__navigation`,`${r}__navigation--lg`,t?.className),children:c.map((o,_)=>e.jsxs("div",{className:p(`${r}__navigation-section`),children:[e.jsx("h3",{className:p(`${r}__navigation-section-heading`),children:o.heading}),e.jsx(j,{links:o.links,customLink:s})]},_))}),e.jsx("section",{...t,className:p(`${r}__navigation`,`${r}__navigation--sm`,t?.className),children:e.jsx(x.Accordion,{negative:!0,children:c.map((o,_)=>e.jsx(x.Accordion.Item,{title:o.heading,titleTag:"h2",className:p(`${r}__navigation-section`),children:e.jsx(j,{links:o.links,customLink:s})},_))})})]}),T=g.c.bind(C),v=({icon:c,href:t,...s})=>e.jsx("a",{...s,href:t,className:T(`${r}__social-link`),rel:"noreferrer",target:"_blank",children:e.jsx(F.b,{svg:c})}),E=()=>e.jsxs("svg",{width:"81",height:"32",viewBox:"0 0 81 32",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[e.jsxs("g",{clipPath:"url(#clip0_5309_7721)",children:[e.jsx("path",{d:"M81.28 16.8043V25.2064H78.5458V23.8293C77.6183 25.04 76.1438 25.4912 74.9076 25.4912C72.3401 25.4912 70.8186 23.8773 70.8186 21.8592C70.8186 19.5573 73.4107 17.6821 76.5723 17.6821C77.1909 17.6821 77.8566 17.7301 78.4507 17.92V17.1371C78.4507 15.9499 77.7615 15.3333 76.3586 15.3333C75.0989 15.3333 73.9812 15.9744 73.2921 16.8053L71.2235 15.2864C72.3882 13.9339 74.3862 12.9845 76.4067 12.9845C79.5683 12.9824 81.28 14.3595 81.28 16.8043ZM78.4507 20.6251V20.1024C77.9752 19.936 77.4762 19.8891 76.8576 19.8891C74.7174 19.8891 73.6244 20.7435 73.6244 21.7877C73.6244 22.6421 74.3616 23.1883 75.4792 23.1883C76.9527 23.1883 78.4507 22.3104 78.4507 20.6251Z",fill:"currentColor"}),e.jsx("path",{d:"M65.8021 9.968C65.8021 9.04214 66.6109 8.28267 67.5373 8.28267C68.4412 8.28267 69.249 9.04214 69.249 9.968C69.249 10.8939 68.4401 11.6533 67.5373 11.6533C66.6109 11.6533 65.8021 10.8939 65.8021 9.968ZM66.0638 25.2064V13.3387H68.9883V25.2064H66.0638Z",fill:"currentColor"}),e.jsx("path",{d:"M64.2806 25.2533C63.8286 25.3483 63.3531 25.3717 62.9257 25.3717C60.8337 25.3717 59.9062 24.3744 59.9062 22.3573V8.59093H62.8306V21.9541C62.8306 22.9749 63.4493 23.1168 64.2806 23.0219V25.2533Z",fill:"currentColor"}),e.jsx("path",{d:"M58.0513 20.1035H49.2781C49.5869 21.8603 50.8477 23.0229 52.4643 23.0229C53.677 23.0229 54.6514 22.4768 55.2466 21.5755L57.5769 22.976C56.3877 24.5664 54.4388 25.5157 52.4653 25.5157C49.2086 25.5157 46.3793 22.9291 46.3793 19.2256C46.3793 15.5221 49.1851 12.96 52.3232 12.96C56.4347 12.9589 58.4552 16.2347 58.0513 20.1035ZM49.3732 17.8955H55.222C54.8651 16.3531 53.8672 15.3792 52.3211 15.3792C50.8712 15.3803 49.7771 16.3765 49.3732 17.8955Z",fill:"currentColor"}),e.jsx("path",{d:"M48.6359 11.2971H43.69V25.2064H40.5518V11.2971H35.5589V8.59093H48.6359V11.2971Z",fill:"currentColor"}),e.jsx("path",{d:"M16.9321 27.4656C11.5983 29.6245 8.54567 28.9365 6.85855 27.5904L6.83397 27.5712C9.44532 30.1717 12.4221 32.0011 15.0324 32.0011C19.6033 32.0011 25.8614 26.4651 28.8232 17.8805C27.1542 20.9792 23.5727 24.7861 16.9321 27.4656Z",fill:"currentColor"}),e.jsx("path",{d:"M20.9806 22.4843C25.137 20.0779 28.8809 15.9968 30.0616 13.0869C30.3971 10.6784 30.4654 10.3744 30.506 7.7248C30.5114 7.35787 30.4889 7.00587 30.4548 6.6688C30.2122 10.56 25.1743 15.4528 18.5092 18.6496C10.4689 22.5056 4.43738 23.5435 1.74589 20.6027C2.6808 22.4459 3.29411 23.3408 4.34549 24.7083C7.45048 27.4539 13.9853 26.5355 20.9806 22.4843Z",fill:"currentColor"}),e.jsx("path",{d:"M17.5721 15.8923C25.1562 12.24 30.4387 7.04427 29.5177 3.6C28.0058 0.993067 24.9457 0 21.6644 0C11.9381 0 0 6.4 0 14.5653C0 15.6149 0.231859 16.7883 0.647496 18.0181C2.86565 20.9568 9.64833 19.7077 17.5721 15.8923Z",fill:"currentColor"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_5309_7721",children:e.jsx("rect",{width:"81",height:"32",fill:"currentColor"})})})]}),i=g.c.bind(C),N=({className:c,navigation:t,social:s,contacts:o,additional:_,custom:l,payments:u,logo:f,themeSelect:h,forceColorScheme:b,...q})=>{const $=i(c,r),{options:k}=L.useTheme(),[P,V]=w.useColorScheme(),M=b??k?.footerColorScheme;return e.jsx("footer",{"data-color-scheme":M,className:$,...q,children:e.jsx(Z.Container,{children:e.jsxs("div",{className:i(`${r}__container`),children:[e.jsx("div",{className:i(`${r}__logo`,{[`${r}__logo--telia`]:!f}),children:f??e.jsx(E,{})}),s&&e.jsx("section",{...s.sectionProps,className:i(`${r}__social`,`${r}__social--md`,s.sectionProps?.className),children:s.links.map(({icon:n,href:a,...d})=>m.createElement(v,{...d,icon:n,href:a,key:a}))}),t&&e.jsx(S,{customLink:t.customLink,navigationLinks:t.links,sectionProps:t.sectionProps}),u&&e.jsxs("section",{...u.sectionProps,className:i(`${r}__payments`,u.sectionProps?.className),children:[u.content,u.images?.map(({alt:n,src:a})=>e.jsx("img",{className:i(`${r}__payments-image`),src:a,alt:n},a))]}),h&&e.jsx("section",{className:i(`${r}__theme-select`),children:e.jsx(H.Select,{value:P,label:h.label,options:h.options,negative:!0,onChange:n=>{V(n.target.value)}})}),o&&e.jsxs("section",{...o.sectionProps,className:i(`${r}__contacts`,o.sectionProps?.className),children:[o.copyright&&e.jsx("div",{className:i(`${r}__contacts-copyright`),children:o.copyright}),o.address&&e.jsx("address",{...o.address.addressProps,className:i(`${r}__contacts-address`,o.address.addressProps?.className),children:o.address.content})]}),(l||_)&&e.jsxs("div",{className:i(`${r}__additional`),children:[l&&e.jsx("section",{...l.sectionProps,className:i(`${r}__custom-content`,l.sectionProps?.className),children:l.content}),_&&e.jsx("section",{..._.sectionProps,className:i(`${r}__additional-links`,_.sectionProps?.className),children:_?.links?.map(({href:n,text:a,...d})=>m.createElement(y.Link,{...d,variant:"standalone",negative:!0,href:n,key:n,disableVisited:!0},a))})]}),s&&e.jsx("section",{...s.sectionProps,className:i(`${r}__social`,`${r}__social--sm`,s.sectionProps?.className),children:s.links.map(({icon:n,href:a,...d})=>m.createElement(v,{...d,icon:n,href:a,key:a}))})]})})})};N.displayName="Footer";exports.Footer=N;
|
|
2
|
+
//# sourceMappingURL=footer-3Y-664-8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer-D9AcPwlH.js","sources":["../../../components/footer/src/constants.ts","../../../components/footer/src/footer-navigation.tsx","../../../components/footer/src/footer-social-link.tsx","../../../components/footer/src/telia-logo.tsx","../../../components/footer/src/footer.tsx"],"sourcesContent":["export const rootClassName = \"purpur-footer\";\n","import React, { type AnchorHTMLAttributes, type ForwardRefExoticComponent } from \"react\";\nimport { Accordion } from \"@purpur/accordion\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Link } from \"@purpur/link\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type FooterNavigationItemLink = Omit<BaseProps<\"a\">, \"href\"> & {\n text: string;\n href: string;\n};\n\nexport type FooterNavigationItem = {\n heading: string;\n links: FooterNavigationItemLink[];\n};\n\nexport type CustomLinkType =\n | ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement>>\n | \"a\";\n\ntype NavigationLinksProps = {\n links: FooterNavigationItemLink[];\n customLink?: CustomLinkType;\n};\n\nconst NavigationLinks = ({ links, customLink: CustomLink }: NavigationLinksProps) => (\n <ul>\n {links.map(({ href, text, ...linkProps }, j) => (\n <li key={j}>\n {CustomLink ? (\n <CustomLink\n {...linkProps}\n href={href}\n className={cx(`${rootClassName}__custom-link-navigation`)}\n >\n {text}\n </CustomLink>\n ) : (\n <Link {...linkProps} variant=\"navigation\" negative href={href} disableVisited={true}>\n {text}\n </Link>\n )}\n </li>\n ))}\n </ul>\n);\n\ntype FooterNavigationProps = {\n customLink?: CustomLinkType;\n sectionProps?: Omit<BaseProps<\"section\">, \"children\">;\n navigationLinks: FooterNavigationItem[];\n};\n\nexport const FooterNavigation = ({\n navigationLinks,\n sectionProps,\n customLink,\n}: FooterNavigationProps) => (\n <>\n <section\n {...sectionProps}\n className={cx(\n `${rootClassName}__navigation`,\n `${rootClassName}__navigation--lg`,\n sectionProps?.className\n )}\n >\n {navigationLinks.map((section, i) => (\n <div key={i} className={cx(`${rootClassName}__navigation-section`)}>\n <h3 className={cx(`${rootClassName}__navigation-section-heading`)}>{section.heading}</h3>\n <NavigationLinks links={section.links} customLink={customLink} />\n </div>\n ))}\n </section>\n <section\n {...sectionProps}\n className={cx(\n `${rootClassName}__navigation`,\n `${rootClassName}__navigation--sm`,\n sectionProps?.className\n )}\n >\n <Accordion negative>\n {navigationLinks.map((section, i) => (\n <Accordion.Item\n key={i}\n title={section.heading}\n titleTag=\"h2\"\n className={cx(`${rootClassName}__navigation-section`)}\n >\n <NavigationLinks links={section.links} customLink={customLink} />\n </Accordion.Item>\n ))}\n </Accordion>\n </section>\n </>\n);\n","import React from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Icon, type IconProps } from \"@purpur/icon\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\n\nexport type FooterSocialLinkProps = Omit<BaseProps<\"a\">, \"aria-label\" | \"href\" | \"children\"> & {\n \"aria-label\": string;\n icon: IconProps[\"svg\"];\n href: string;\n};\n\nconst cx = c.bind(styles);\n\nexport const FooterSocialLink = ({ icon, href, ...props }: FooterSocialLinkProps) => (\n <a\n {...props}\n href={href}\n className={cx(`${rootClassName}__social-link`)}\n rel=\"noreferrer\"\n target=\"_blank\"\n >\n <Icon svg={icon} />\n </a>\n);\n","import React from \"react\";\n\nexport const TeliaLogo = () => (\n <svg\n width=\"81\"\n height=\"32\"\n viewBox=\"0 0 81 32\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n aria-hidden=\"true\"\n >\n <g clipPath=\"url(#clip0_5309_7721)\">\n <path\n d=\"M81.28 16.8043V25.2064H78.5458V23.8293C77.6183 25.04 76.1438 25.4912 74.9076 25.4912C72.3401 25.4912 70.8186 23.8773 70.8186 21.8592C70.8186 19.5573 73.4107 17.6821 76.5723 17.6821C77.1909 17.6821 77.8566 17.7301 78.4507 17.92V17.1371C78.4507 15.9499 77.7615 15.3333 76.3586 15.3333C75.0989 15.3333 73.9812 15.9744 73.2921 16.8053L71.2235 15.2864C72.3882 13.9339 74.3862 12.9845 76.4067 12.9845C79.5683 12.9824 81.28 14.3595 81.28 16.8043ZM78.4507 20.6251V20.1024C77.9752 19.936 77.4762 19.8891 76.8576 19.8891C74.7174 19.8891 73.6244 20.7435 73.6244 21.7877C73.6244 22.6421 74.3616 23.1883 75.4792 23.1883C76.9527 23.1883 78.4507 22.3104 78.4507 20.6251Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M65.8021 9.968C65.8021 9.04214 66.6109 8.28267 67.5373 8.28267C68.4412 8.28267 69.249 9.04214 69.249 9.968C69.249 10.8939 68.4401 11.6533 67.5373 11.6533C66.6109 11.6533 65.8021 10.8939 65.8021 9.968ZM66.0638 25.2064V13.3387H68.9883V25.2064H66.0638Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M64.2806 25.2533C63.8286 25.3483 63.3531 25.3717 62.9257 25.3717C60.8337 25.3717 59.9062 24.3744 59.9062 22.3573V8.59093H62.8306V21.9541C62.8306 22.9749 63.4493 23.1168 64.2806 23.0219V25.2533Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M58.0513 20.1035H49.2781C49.5869 21.8603 50.8477 23.0229 52.4643 23.0229C53.677 23.0229 54.6514 22.4768 55.2466 21.5755L57.5769 22.976C56.3877 24.5664 54.4388 25.5157 52.4653 25.5157C49.2086 25.5157 46.3793 22.9291 46.3793 19.2256C46.3793 15.5221 49.1851 12.96 52.3232 12.96C56.4347 12.9589 58.4552 16.2347 58.0513 20.1035ZM49.3732 17.8955H55.222C54.8651 16.3531 53.8672 15.3792 52.3211 15.3792C50.8712 15.3803 49.7771 16.3765 49.3732 17.8955Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M48.6359 11.2971H43.69V25.2064H40.5518V11.2971H35.5589V8.59093H48.6359V11.2971Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M16.9321 27.4656C11.5983 29.6245 8.54567 28.9365 6.85855 27.5904L6.83397 27.5712C9.44532 30.1717 12.4221 32.0011 15.0324 32.0011C19.6033 32.0011 25.8614 26.4651 28.8232 17.8805C27.1542 20.9792 23.5727 24.7861 16.9321 27.4656Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M20.9806 22.4843C25.137 20.0779 28.8809 15.9968 30.0616 13.0869C30.3971 10.6784 30.4654 10.3744 30.506 7.7248C30.5114 7.35787 30.4889 7.00587 30.4548 6.6688C30.2122 10.56 25.1743 15.4528 18.5092 18.6496C10.4689 22.5056 4.43738 23.5435 1.74589 20.6027C2.6808 22.4459 3.29411 23.3408 4.34549 24.7083C7.45048 27.4539 13.9853 26.5355 20.9806 22.4843Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M17.5721 15.8923C25.1562 12.24 30.4387 7.04427 29.5177 3.6C28.0058 0.993067 24.9457 0 21.6644 0C11.9381 0 0 6.4 0 14.5653C0 15.6149 0.231859 16.7883 0.647496 18.0181C2.86565 20.9568 9.64833 19.7077 17.5721 15.8923Z\"\n fill=\"currentColor\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_5309_7721\">\n <rect width=\"81\" height=\"32\" fill=\"currentColor\" />\n </clipPath>\n </defs>\n </svg>\n);\n","import React, { type ReactElement, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Container } from \"@purpur/container\";\nimport { Link, type LinkProps } from \"@purpur/link\";\nimport { Select } from \"@purpur/select\";\nimport { type ColorOptions, type ColorScheme, useColorScheme, useTheme } from \"@purpur/theme\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\nimport {\n type CustomLinkType,\n FooterNavigation,\n type FooterNavigationItem,\n type FooterNavigationItemLink,\n} from \"./footer-navigation\";\nimport { FooterSocialLink, type FooterSocialLinkProps } from \"./footer-social-link\";\nimport { TeliaLogo } from \"./telia-logo\";\n\nconst cx = c.bind(styles);\n\ntype AdditionalLink = FooterNavigationItemLink &\n Omit<LinkProps, \"href\" | \"variant\" | \"negative\" | \"children\" | \"disableVisited\">;\n\ntype SectionProps = Omit<BaseProps<\"section\">, \"children\">;\n\nexport type FooterProps = BaseProps<\"footer\"> & {\n /**\n * Navigation section of the footer.\n */\n navigation?: {\n customLink?: CustomLinkType;\n links: FooterNavigationItem[];\n sectionProps?: SectionProps;\n };\n /**\n * Social links section of the footer.\n */\n social?: {\n links: FooterSocialLinkProps[];\n sectionProps?: SectionProps;\n };\n /**\n * Contacts section of the footer.\n */\n contacts?: {\n copyright?: string;\n address?: {\n content: ReactElement;\n addressProps?: Omit<BaseProps<\"address\">, \"children\">;\n };\n sectionProps?: SectionProps;\n };\n /**\n * Additional links section of the footer.\n */\n additional?: {\n links: AdditionalLink[];\n sectionProps?: SectionProps;\n };\n /**\n * Custom content section of the footer.\n */\n custom?: {\n content: ReactElement;\n sectionProps?: SectionProps;\n };\n /**\n * Payment images section of the footer.\n */\n payments?: {\n /**\n * @deprecated use content instead\n */\n images?: { src: string; alt: string }[];\n content?: ReactElement | ReactElement[];\n sectionProps?: SectionProps;\n };\n /**\n * Custom logo that replaces the default Telia logo.\n */\n logo?: ReactNode;\n themeSelect?: {\n label: string;\n options: { value: ColorOptions; label: string }[];\n };\n forceColorScheme?: ColorScheme;\n};\n\nexport const Footer = ({\n className,\n navigation,\n social,\n contacts,\n additional,\n custom,\n payments,\n logo,\n themeSelect,\n forceColorScheme,\n ...props\n}: FooterProps) => {\n const classes = cx(className, rootClassName);\n\n const { options } = useTheme();\n const [colorScheme, setColorScheme] = useColorScheme();\n\n const resolvedColorScheme = forceColorScheme ?? options?.footerColorScheme;\n\n return (\n <footer data-color-scheme={resolvedColorScheme} className={classes} {...props}>\n <Container>\n <div className={cx(`${rootClassName}__container`)}>\n <div\n className={cx(`${rootClassName}__logo`, {\n [`${rootClassName}__logo--telia`]: !logo,\n })}\n >\n {logo ?? <TeliaLogo />}\n </div>\n {social && (\n <section\n {...social.sectionProps}\n className={cx(\n `${rootClassName}__social`,\n `${rootClassName}__social--md`,\n social.sectionProps?.className\n )}\n >\n {social.links.map(({ icon, href, ...socialLinkProps }) => (\n <FooterSocialLink {...socialLinkProps} icon={icon} href={href} key={href} />\n ))}\n </section>\n )}\n {navigation && (\n <FooterNavigation\n customLink={navigation.customLink}\n navigationLinks={navigation.links}\n sectionProps={navigation.sectionProps}\n />\n )}\n {payments && (\n <section\n {...payments.sectionProps}\n className={cx(`${rootClassName}__payments`, payments.sectionProps?.className)}\n >\n {payments.content}\n {payments.images?.map(({ alt, src }) => (\n <img\n className={cx(`${rootClassName}__payments-image`)}\n src={src}\n alt={alt}\n key={src}\n />\n ))}\n </section>\n )}\n {themeSelect && (\n <section className={cx(`${rootClassName}__theme-select`)}>\n <Select\n value={colorScheme}\n label={themeSelect.label}\n options={themeSelect.options}\n negative\n onChange={(event) => {\n setColorScheme(event.target.value as ColorOptions);\n }}\n />\n </section>\n )}\n {contacts && (\n <section\n {...contacts.sectionProps}\n className={cx(`${rootClassName}__contacts`, contacts.sectionProps?.className)}\n >\n {contacts.copyright && (\n <div className={cx(`${rootClassName}__contacts-copyright`)}>\n {contacts.copyright}\n </div>\n )}\n {contacts.address && (\n <address\n {...contacts.address.addressProps}\n className={cx(\n `${rootClassName}__contacts-address`,\n contacts.address.addressProps?.className\n )}\n >\n {contacts.address.content}\n </address>\n )}\n </section>\n )}\n {(custom || additional) && (\n <div className={cx(`${rootClassName}__additional`)}>\n {custom && (\n <section\n {...custom.sectionProps}\n className={cx(`${rootClassName}__custom-content`, custom.sectionProps?.className)}\n >\n {custom.content}\n </section>\n )}\n {additional && (\n <section\n {...additional.sectionProps}\n className={cx(\n `${rootClassName}__additional-links`,\n additional.sectionProps?.className\n )}\n >\n {additional?.links?.map(({ href, text, ...additionalLinkProps }) => (\n <Link\n {...additionalLinkProps}\n variant=\"standalone\"\n negative\n href={href}\n key={href}\n disableVisited={true}\n >\n {text}\n </Link>\n ))}\n </section>\n )}\n </div>\n )}\n {social && (\n <section\n {...social.sectionProps}\n className={cx(\n `${rootClassName}__social`,\n `${rootClassName}__social--sm`,\n social.sectionProps?.className\n )}\n >\n {social.links.map(({ icon, href, ...socialLinkProps }) => (\n <FooterSocialLink {...socialLinkProps} icon={icon} href={href} key={href} />\n ))}\n </section>\n )}\n </div>\n </Container>\n </footer>\n );\n};\n\nFooter.displayName = \"Footer\";\n"],"names":["rootClassName","cx","c","styles","NavigationLinks","links","CustomLink","href","text","linkProps","j","jsx","Link","FooterNavigation","navigationLinks","sectionProps","customLink","jsxs","Fragment","section","i","Accordion","FooterSocialLink","icon","props","Icon","TeliaLogo","Footer","className","navigation","social","contacts","additional","custom","payments","logo","themeSelect","forceColorScheme","classes","options","useTheme","colorScheme","setColorScheme","useColorScheme","resolvedColorScheme","Container","socialLinkProps","createElement","alt","src","Select","event","additionalLinkProps"],"mappings":"uWAAaA,EAAgB,inDCSvBC,EAAKC,EA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,EAAO,OAAA,CAAA,EAGXD,GACCrB,EAAAA,IAAC,UAAA,CACE,GAAGqB,EAAW,aACf,UAAW/B,EACT,GAAGD,CAAa,qBAChBgC,EAAW,cAAc,SAAA,EAG1B,SAAAA,GAAY,OAAO,IAAI,CAAC,CAAE,KAAAzB,EAAM,KAAAC,EAAM,GAAG4C,CAAA,IACxCL,EAAAA,cAACnC,EAAAA,KAAA,CACE,GAAGwC,EACJ,QAAQ,aACR,SAAQ,GACR,KAAA7C,EACA,IAAKA,EACL,eAAgB,EAAA,EAEfC,CAAA,CAEJ,CAAA,CAAA,CACH,EAEJ,EAEDsB,GACCnB,EAAAA,IAAC,UAAA,CACE,GAAGmB,EAAO,aACX,UAAW7B,EACT,GAAGD,CAAa,WAChB,GAAGA,CAAa,eAChB8B,EAAO,cAAc,SAAA,EAGtB,WAAO,MAAM,IAAI,CAAC,CAAE,KAAAP,EAAM,KAAAhB,EAAM,GAAGuC,CAAA,IAClCC,EAAAA,cAACzB,GAAkB,GAAGwB,EAAiB,KAAAvB,EAAY,KAAAhB,EAAY,IAAKA,EAAM,CAC3E,CAAA,CAAA,CACH,CAAA,CAEJ,EACF,EACF,CAEJ,EAEAoB,EAAO,YAAc"}
|
|
1
|
+
{"version":3,"file":"footer-3Y-664-8.js","sources":["../../../components/footer/src/constants.ts","../../../components/footer/src/footer-navigation.tsx","../../../components/footer/src/footer-social-link.tsx","../../../components/footer/src/telia-logo.tsx","../../../components/footer/src/footer.tsx"],"sourcesContent":["export const rootClassName = \"purpur-footer\";\n","import React, { type AnchorHTMLAttributes, type ForwardRefExoticComponent } from \"react\";\nimport { Accordion } from \"@purpur/accordion\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Link } from \"@purpur/link\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type FooterNavigationItemLink = Omit<BaseProps<\"a\">, \"href\"> & {\n text: string;\n href: string;\n};\n\nexport type FooterNavigationItem = {\n heading: string;\n links: FooterNavigationItemLink[];\n};\n\nexport type CustomLinkType =\n | ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement>>\n | \"a\";\n\ntype NavigationLinksProps = {\n links: FooterNavigationItemLink[];\n customLink?: CustomLinkType;\n};\n\nconst NavigationLinks = ({ links, customLink: CustomLink }: NavigationLinksProps) => (\n <ul>\n {links.map(({ href, text, ...linkProps }, j) => (\n <li key={j}>\n {CustomLink ? (\n <CustomLink\n {...linkProps}\n href={href}\n className={cx(`${rootClassName}__custom-link-navigation`)}\n >\n {text}\n </CustomLink>\n ) : (\n <Link {...linkProps} variant=\"navigation\" negative href={href} disableVisited={true}>\n {text}\n </Link>\n )}\n </li>\n ))}\n </ul>\n);\n\ntype FooterNavigationProps = {\n customLink?: CustomLinkType;\n sectionProps?: Omit<BaseProps<\"section\">, \"children\">;\n navigationLinks: FooterNavigationItem[];\n};\n\nexport const FooterNavigation = ({\n navigationLinks,\n sectionProps,\n customLink,\n}: FooterNavigationProps) => (\n <>\n <section\n {...sectionProps}\n className={cx(\n `${rootClassName}__navigation`,\n `${rootClassName}__navigation--lg`,\n sectionProps?.className\n )}\n >\n {navigationLinks.map((section, i) => (\n <div key={i} className={cx(`${rootClassName}__navigation-section`)}>\n <h3 className={cx(`${rootClassName}__navigation-section-heading`)}>{section.heading}</h3>\n <NavigationLinks links={section.links} customLink={customLink} />\n </div>\n ))}\n </section>\n <section\n {...sectionProps}\n className={cx(\n `${rootClassName}__navigation`,\n `${rootClassName}__navigation--sm`,\n sectionProps?.className\n )}\n >\n <Accordion negative>\n {navigationLinks.map((section, i) => (\n <Accordion.Item\n key={i}\n title={section.heading}\n titleTag=\"h2\"\n className={cx(`${rootClassName}__navigation-section`)}\n >\n <NavigationLinks links={section.links} customLink={customLink} />\n </Accordion.Item>\n ))}\n </Accordion>\n </section>\n </>\n);\n","import React from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Icon, type IconProps } from \"@purpur/icon\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\n\nexport type FooterSocialLinkProps = Omit<BaseProps<\"a\">, \"aria-label\" | \"href\" | \"children\"> & {\n \"aria-label\": string;\n icon: IconProps[\"svg\"];\n href: string;\n};\n\nconst cx = c.bind(styles);\n\nexport const FooterSocialLink = ({ icon, href, ...props }: FooterSocialLinkProps) => (\n <a\n {...props}\n href={href}\n className={cx(`${rootClassName}__social-link`)}\n rel=\"noreferrer\"\n target=\"_blank\"\n >\n <Icon svg={icon} />\n </a>\n);\n","import React from \"react\";\n\nexport const TeliaLogo = () => (\n <svg\n width=\"81\"\n height=\"32\"\n viewBox=\"0 0 81 32\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n aria-hidden=\"true\"\n >\n <g clipPath=\"url(#clip0_5309_7721)\">\n <path\n d=\"M81.28 16.8043V25.2064H78.5458V23.8293C77.6183 25.04 76.1438 25.4912 74.9076 25.4912C72.3401 25.4912 70.8186 23.8773 70.8186 21.8592C70.8186 19.5573 73.4107 17.6821 76.5723 17.6821C77.1909 17.6821 77.8566 17.7301 78.4507 17.92V17.1371C78.4507 15.9499 77.7615 15.3333 76.3586 15.3333C75.0989 15.3333 73.9812 15.9744 73.2921 16.8053L71.2235 15.2864C72.3882 13.9339 74.3862 12.9845 76.4067 12.9845C79.5683 12.9824 81.28 14.3595 81.28 16.8043ZM78.4507 20.6251V20.1024C77.9752 19.936 77.4762 19.8891 76.8576 19.8891C74.7174 19.8891 73.6244 20.7435 73.6244 21.7877C73.6244 22.6421 74.3616 23.1883 75.4792 23.1883C76.9527 23.1883 78.4507 22.3104 78.4507 20.6251Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M65.8021 9.968C65.8021 9.04214 66.6109 8.28267 67.5373 8.28267C68.4412 8.28267 69.249 9.04214 69.249 9.968C69.249 10.8939 68.4401 11.6533 67.5373 11.6533C66.6109 11.6533 65.8021 10.8939 65.8021 9.968ZM66.0638 25.2064V13.3387H68.9883V25.2064H66.0638Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M64.2806 25.2533C63.8286 25.3483 63.3531 25.3717 62.9257 25.3717C60.8337 25.3717 59.9062 24.3744 59.9062 22.3573V8.59093H62.8306V21.9541C62.8306 22.9749 63.4493 23.1168 64.2806 23.0219V25.2533Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M58.0513 20.1035H49.2781C49.5869 21.8603 50.8477 23.0229 52.4643 23.0229C53.677 23.0229 54.6514 22.4768 55.2466 21.5755L57.5769 22.976C56.3877 24.5664 54.4388 25.5157 52.4653 25.5157C49.2086 25.5157 46.3793 22.9291 46.3793 19.2256C46.3793 15.5221 49.1851 12.96 52.3232 12.96C56.4347 12.9589 58.4552 16.2347 58.0513 20.1035ZM49.3732 17.8955H55.222C54.8651 16.3531 53.8672 15.3792 52.3211 15.3792C50.8712 15.3803 49.7771 16.3765 49.3732 17.8955Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M48.6359 11.2971H43.69V25.2064H40.5518V11.2971H35.5589V8.59093H48.6359V11.2971Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M16.9321 27.4656C11.5983 29.6245 8.54567 28.9365 6.85855 27.5904L6.83397 27.5712C9.44532 30.1717 12.4221 32.0011 15.0324 32.0011C19.6033 32.0011 25.8614 26.4651 28.8232 17.8805C27.1542 20.9792 23.5727 24.7861 16.9321 27.4656Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M20.9806 22.4843C25.137 20.0779 28.8809 15.9968 30.0616 13.0869C30.3971 10.6784 30.4654 10.3744 30.506 7.7248C30.5114 7.35787 30.4889 7.00587 30.4548 6.6688C30.2122 10.56 25.1743 15.4528 18.5092 18.6496C10.4689 22.5056 4.43738 23.5435 1.74589 20.6027C2.6808 22.4459 3.29411 23.3408 4.34549 24.7083C7.45048 27.4539 13.9853 26.5355 20.9806 22.4843Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M17.5721 15.8923C25.1562 12.24 30.4387 7.04427 29.5177 3.6C28.0058 0.993067 24.9457 0 21.6644 0C11.9381 0 0 6.4 0 14.5653C0 15.6149 0.231859 16.7883 0.647496 18.0181C2.86565 20.9568 9.64833 19.7077 17.5721 15.8923Z\"\n fill=\"currentColor\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_5309_7721\">\n <rect width=\"81\" height=\"32\" fill=\"currentColor\" />\n </clipPath>\n </defs>\n </svg>\n);\n","import React, { type ReactElement, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Container } from \"@purpur/container\";\nimport { Link, type LinkProps } from \"@purpur/link\";\nimport { Select } from \"@purpur/select\";\nimport { type ColorOptions, type ColorScheme, useColorScheme, useTheme } from \"@purpur/theme\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\nimport {\n type CustomLinkType,\n FooterNavigation,\n type FooterNavigationItem,\n type FooterNavigationItemLink,\n} from \"./footer-navigation\";\nimport { FooterSocialLink, type FooterSocialLinkProps } from \"./footer-social-link\";\nimport { TeliaLogo } from \"./telia-logo\";\n\nconst cx = c.bind(styles);\n\ntype AdditionalLink = FooterNavigationItemLink &\n Omit<LinkProps, \"href\" | \"variant\" | \"negative\" | \"children\" | \"disableVisited\">;\n\ntype SectionProps = Omit<BaseProps<\"section\">, \"children\">;\n\nexport type FooterProps = BaseProps<\"footer\"> & {\n /**\n * Navigation section of the footer.\n */\n navigation?: {\n customLink?: CustomLinkType;\n links: FooterNavigationItem[];\n sectionProps?: SectionProps;\n };\n /**\n * Social links section of the footer.\n */\n social?: {\n links: FooterSocialLinkProps[];\n sectionProps?: SectionProps;\n };\n /**\n * Contacts section of the footer.\n */\n contacts?: {\n copyright?: string;\n address?: {\n content: ReactElement;\n addressProps?: Omit<BaseProps<\"address\">, \"children\">;\n };\n sectionProps?: SectionProps;\n };\n /**\n * Additional links section of the footer.\n */\n additional?: {\n links: AdditionalLink[];\n sectionProps?: SectionProps;\n };\n /**\n * Custom content section of the footer.\n */\n custom?: {\n content: ReactElement;\n sectionProps?: SectionProps;\n };\n /**\n * Payment images section of the footer.\n */\n payments?: {\n /**\n * @deprecated use content instead\n */\n images?: { src: string; alt: string }[];\n content?: ReactElement | ReactElement[];\n sectionProps?: SectionProps;\n };\n /**\n * Custom logo that replaces the default Telia logo.\n */\n logo?: ReactNode;\n themeSelect?: {\n label: string;\n options: { value: ColorOptions; label: string }[];\n };\n forceColorScheme?: ColorScheme;\n};\n\nexport const Footer = ({\n className,\n navigation,\n social,\n contacts,\n additional,\n custom,\n payments,\n logo,\n themeSelect,\n forceColorScheme,\n ...props\n}: FooterProps) => {\n const classes = cx(className, rootClassName);\n\n const { options } = useTheme();\n const [colorScheme, setColorScheme] = useColorScheme();\n\n const resolvedColorScheme = forceColorScheme ?? options?.footerColorScheme;\n\n return (\n <footer data-color-scheme={resolvedColorScheme} className={classes} {...props}>\n <Container>\n <div className={cx(`${rootClassName}__container`)}>\n <div\n className={cx(`${rootClassName}__logo`, {\n [`${rootClassName}__logo--telia`]: !logo,\n })}\n >\n {logo ?? <TeliaLogo />}\n </div>\n {social && (\n <section\n {...social.sectionProps}\n className={cx(\n `${rootClassName}__social`,\n `${rootClassName}__social--md`,\n social.sectionProps?.className\n )}\n >\n {social.links.map(({ icon, href, ...socialLinkProps }) => (\n <FooterSocialLink {...socialLinkProps} icon={icon} href={href} key={href} />\n ))}\n </section>\n )}\n {navigation && (\n <FooterNavigation\n customLink={navigation.customLink}\n navigationLinks={navigation.links}\n sectionProps={navigation.sectionProps}\n />\n )}\n {payments && (\n <section\n {...payments.sectionProps}\n className={cx(`${rootClassName}__payments`, payments.sectionProps?.className)}\n >\n {payments.content}\n {payments.images?.map(({ alt, src }) => (\n <img\n className={cx(`${rootClassName}__payments-image`)}\n src={src}\n alt={alt}\n key={src}\n />\n ))}\n </section>\n )}\n {themeSelect && (\n <section className={cx(`${rootClassName}__theme-select`)}>\n <Select\n value={colorScheme}\n label={themeSelect.label}\n options={themeSelect.options}\n negative\n onChange={(event) => {\n setColorScheme(event.target.value as ColorOptions);\n }}\n />\n </section>\n )}\n {contacts && (\n <section\n {...contacts.sectionProps}\n className={cx(`${rootClassName}__contacts`, contacts.sectionProps?.className)}\n >\n {contacts.copyright && (\n <div className={cx(`${rootClassName}__contacts-copyright`)}>\n {contacts.copyright}\n </div>\n )}\n {contacts.address && (\n <address\n {...contacts.address.addressProps}\n className={cx(\n `${rootClassName}__contacts-address`,\n contacts.address.addressProps?.className\n )}\n >\n {contacts.address.content}\n </address>\n )}\n </section>\n )}\n {(custom || additional) && (\n <div className={cx(`${rootClassName}__additional`)}>\n {custom && (\n <section\n {...custom.sectionProps}\n className={cx(`${rootClassName}__custom-content`, custom.sectionProps?.className)}\n >\n {custom.content}\n </section>\n )}\n {additional && (\n <section\n {...additional.sectionProps}\n className={cx(\n `${rootClassName}__additional-links`,\n additional.sectionProps?.className\n )}\n >\n {additional?.links?.map(({ href, text, ...additionalLinkProps }) => (\n <Link\n {...additionalLinkProps}\n variant=\"standalone\"\n negative\n href={href}\n key={href}\n disableVisited={true}\n >\n {text}\n </Link>\n ))}\n </section>\n )}\n </div>\n )}\n {social && (\n <section\n {...social.sectionProps}\n className={cx(\n `${rootClassName}__social`,\n `${rootClassName}__social--sm`,\n social.sectionProps?.className\n )}\n >\n {social.links.map(({ icon, href, ...socialLinkProps }) => (\n <FooterSocialLink {...socialLinkProps} icon={icon} href={href} key={href} />\n ))}\n </section>\n )}\n </div>\n </Container>\n </footer>\n );\n};\n\nFooter.displayName = \"Footer\";\n"],"names":["rootClassName","cx","c","styles","NavigationLinks","links","CustomLink","href","text","linkProps","j","jsx","Link","FooterNavigation","navigationLinks","sectionProps","customLink","jsxs","Fragment","section","i","Accordion","FooterSocialLink","icon","props","Icon","TeliaLogo","Footer","className","navigation","social","contacts","additional","custom","payments","logo","themeSelect","forceColorScheme","classes","options","useTheme","colorScheme","setColorScheme","useColorScheme","resolvedColorScheme","Container","socialLinkProps","createElement","alt","src","Select","event","additionalLinkProps"],"mappings":"uWAAaA,EAAgB,inDCSvBC,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAqBlBC,EAAkB,CAAC,CAAE,MAAAC,EAAO,WAAYC,WAC3C,KAAA,CACE,SAAAD,EAAM,IAAI,CAAC,CAAE,KAAAE,EAAM,KAAAC,EAAM,GAAGC,GAAaC,IACxCC,EAAAA,IAAC,KAAA,CACE,SAAAL,EACCK,EAAAA,IAACL,EAAA,CACE,GAAGG,EACJ,KAAAF,EACA,UAAWN,EAAG,GAAGD,CAAa,0BAA0B,EAEvD,SAAAQ,CAAA,CACH,EAEAG,EAAAA,IAACC,EAAAA,KAAA,CAAM,GAAGH,EAAW,QAAQ,aAAa,SAAQ,GAAC,KAAAF,EAAY,eAAgB,GAC5E,SAAAC,CAAA,CACH,GAZKE,CAcT,CACD,EACH,EASWG,EAAmB,CAAC,CAC/B,gBAAAC,EACA,aAAAC,EACA,WAAAC,CACF,IACEC,EAAAA,KAAAC,WAAA,CACE,SAAA,CAAAP,EAAAA,IAAC,UAAA,CACE,GAAGI,EACJ,UAAWd,EACT,GAAGD,CAAa,eAChB,GAAGA,CAAa,mBAChBe,GAAc,SAAA,EAGf,SAAAD,EAAgB,IAAI,CAACK,EAASC,IAC7BH,EAAAA,KAAC,MAAA,CAAY,UAAWhB,EAAG,GAAGD,CAAa,sBAAsB,EAC/D,SAAA,CAAAW,EAAAA,IAAC,KAAA,CAAG,UAAWV,EAAG,GAAGD,CAAa,8BAA8B,EAAI,WAAQ,OAAA,CAAQ,EACpFW,EAAAA,IAACP,EAAA,CAAgB,MAAOe,EAAQ,MAAO,WAAAH,CAAA,CAAwB,CAAA,CAAA,EAFvDI,CAGV,CACD,CAAA,CAAA,EAEHT,EAAAA,IAAC,UAAA,CACE,GAAGI,EACJ,UAAWd,EACT,GAAGD,CAAa,eAChB,GAAGA,CAAa,mBAChBe,GAAc,SAAA,EAGhB,SAAA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UAAA,CACE,GAAGsB,EAAO,aACX,UAAWhC,EAAG,GAAGD,CAAa,mBAAoBiC,EAAO,cAAc,SAAS,EAE/E,SAAAA,EAAO,OAAA,CAAA,EAGXD,GACCrB,EAAAA,IAAC,UAAA,CACE,GAAGqB,EAAW,aACf,UAAW/B,EACT,GAAGD,CAAa,qBAChBgC,EAAW,cAAc,SAAA,EAG1B,SAAAA,GAAY,OAAO,IAAI,CAAC,CAAE,KAAAzB,EAAM,KAAAC,EAAM,GAAG4C,CAAA,IACxCL,EAAAA,cAACnC,EAAAA,KAAA,CACE,GAAGwC,EACJ,QAAQ,aACR,SAAQ,GACR,KAAA7C,EACA,IAAKA,EACL,eAAgB,EAAA,EAEfC,CAAA,CAEJ,CAAA,CAAA,CACH,EAEJ,EAEDsB,GACCnB,EAAAA,IAAC,UAAA,CACE,GAAGmB,EAAO,aACX,UAAW7B,EACT,GAAGD,CAAa,WAChB,GAAGA,CAAa,eAChB8B,EAAO,cAAc,SAAA,EAGtB,WAAO,MAAM,IAAI,CAAC,CAAE,KAAAP,EAAM,KAAAhB,EAAM,GAAGuC,CAAA,IAClCC,EAAAA,cAACzB,GAAkB,GAAGwB,EAAiB,KAAAvB,EAAY,KAAAhB,EAAY,IAAKA,EAAM,CAC3E,CAAA,CAAA,CACH,CAAA,CAEJ,EACF,EACF,CAEJ,EAEAoB,EAAO,YAAc"}
|
|
@@ -3,8 +3,8 @@ import { createElement as f } from "react";
|
|
|
3
3
|
import { C as w } from "./container-DLjBTB_w.mjs";
|
|
4
4
|
import { a as $ } from "./link-DY5WLpyc.mjs";
|
|
5
5
|
import { S as x } from "./select-BEmu_fh9.mjs";
|
|
6
|
-
import { a as F } from "./ThemeProvider-
|
|
7
|
-
import { u as S } from "./useColorScheme-
|
|
6
|
+
import { a as F } from "./ThemeProvider-DiDBfyFA.mjs";
|
|
7
|
+
import { u as S } from "./useColorScheme-B9DWd-LN.mjs";
|
|
8
8
|
import { c as g } from "./bind-CU-R61T-.mjs";
|
|
9
9
|
import { A as y } from "./accordion-CIU4U8-4.mjs";
|
|
10
10
|
import { b as T } from "./icon.es-CZcKxTaM.mjs";
|
|
@@ -308,4 +308,4 @@ E.displayName = "Footer";
|
|
|
308
308
|
export {
|
|
309
309
|
E as F
|
|
310
310
|
};
|
|
311
|
-
//# sourceMappingURL=footer-
|
|
311
|
+
//# sourceMappingURL=footer-DenAcikt.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer-BLPlXaZK.mjs","sources":["../../../components/footer/src/constants.ts","../../../components/footer/src/footer-navigation.tsx","../../../components/footer/src/footer-social-link.tsx","../../../components/footer/src/telia-logo.tsx","../../../components/footer/src/footer.tsx"],"sourcesContent":["export const rootClassName = \"purpur-footer\";\n","import React, { type AnchorHTMLAttributes, type ForwardRefExoticComponent } from \"react\";\nimport { Accordion } from \"@purpur/accordion\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Link } from \"@purpur/link\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type FooterNavigationItemLink = Omit<BaseProps<\"a\">, \"href\"> & {\n text: string;\n href: string;\n};\n\nexport type FooterNavigationItem = {\n heading: string;\n links: FooterNavigationItemLink[];\n};\n\nexport type CustomLinkType =\n | ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement>>\n | \"a\";\n\ntype NavigationLinksProps = {\n links: FooterNavigationItemLink[];\n customLink?: CustomLinkType;\n};\n\nconst NavigationLinks = ({ links, customLink: CustomLink }: NavigationLinksProps) => (\n <ul>\n {links.map(({ href, text, ...linkProps }, j) => (\n <li key={j}>\n {CustomLink ? (\n <CustomLink\n {...linkProps}\n href={href}\n className={cx(`${rootClassName}__custom-link-navigation`)}\n >\n {text}\n </CustomLink>\n ) : (\n <Link {...linkProps} variant=\"navigation\" negative href={href} disableVisited={true}>\n {text}\n </Link>\n )}\n </li>\n ))}\n </ul>\n);\n\ntype FooterNavigationProps = {\n customLink?: CustomLinkType;\n sectionProps?: Omit<BaseProps<\"section\">, \"children\">;\n navigationLinks: FooterNavigationItem[];\n};\n\nexport const FooterNavigation = ({\n navigationLinks,\n sectionProps,\n customLink,\n}: FooterNavigationProps) => (\n <>\n <section\n {...sectionProps}\n className={cx(\n `${rootClassName}__navigation`,\n `${rootClassName}__navigation--lg`,\n sectionProps?.className\n )}\n >\n {navigationLinks.map((section, i) => (\n <div key={i} className={cx(`${rootClassName}__navigation-section`)}>\n <h3 className={cx(`${rootClassName}__navigation-section-heading`)}>{section.heading}</h3>\n <NavigationLinks links={section.links} customLink={customLink} />\n </div>\n ))}\n </section>\n <section\n {...sectionProps}\n className={cx(\n `${rootClassName}__navigation`,\n `${rootClassName}__navigation--sm`,\n sectionProps?.className\n )}\n >\n <Accordion negative>\n {navigationLinks.map((section, i) => (\n <Accordion.Item\n key={i}\n title={section.heading}\n titleTag=\"h2\"\n className={cx(`${rootClassName}__navigation-section`)}\n >\n <NavigationLinks links={section.links} customLink={customLink} />\n </Accordion.Item>\n ))}\n </Accordion>\n </section>\n </>\n);\n","import React from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Icon, type IconProps } from \"@purpur/icon\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\n\nexport type FooterSocialLinkProps = Omit<BaseProps<\"a\">, \"aria-label\" | \"href\" | \"children\"> & {\n \"aria-label\": string;\n icon: IconProps[\"svg\"];\n href: string;\n};\n\nconst cx = c.bind(styles);\n\nexport const FooterSocialLink = ({ icon, href, ...props }: FooterSocialLinkProps) => (\n <a\n {...props}\n href={href}\n className={cx(`${rootClassName}__social-link`)}\n rel=\"noreferrer\"\n target=\"_blank\"\n >\n <Icon svg={icon} />\n </a>\n);\n","import React from \"react\";\n\nexport const TeliaLogo = () => (\n <svg\n width=\"81\"\n height=\"32\"\n viewBox=\"0 0 81 32\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n aria-hidden=\"true\"\n >\n <g clipPath=\"url(#clip0_5309_7721)\">\n <path\n d=\"M81.28 16.8043V25.2064H78.5458V23.8293C77.6183 25.04 76.1438 25.4912 74.9076 25.4912C72.3401 25.4912 70.8186 23.8773 70.8186 21.8592C70.8186 19.5573 73.4107 17.6821 76.5723 17.6821C77.1909 17.6821 77.8566 17.7301 78.4507 17.92V17.1371C78.4507 15.9499 77.7615 15.3333 76.3586 15.3333C75.0989 15.3333 73.9812 15.9744 73.2921 16.8053L71.2235 15.2864C72.3882 13.9339 74.3862 12.9845 76.4067 12.9845C79.5683 12.9824 81.28 14.3595 81.28 16.8043ZM78.4507 20.6251V20.1024C77.9752 19.936 77.4762 19.8891 76.8576 19.8891C74.7174 19.8891 73.6244 20.7435 73.6244 21.7877C73.6244 22.6421 74.3616 23.1883 75.4792 23.1883C76.9527 23.1883 78.4507 22.3104 78.4507 20.6251Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M65.8021 9.968C65.8021 9.04214 66.6109 8.28267 67.5373 8.28267C68.4412 8.28267 69.249 9.04214 69.249 9.968C69.249 10.8939 68.4401 11.6533 67.5373 11.6533C66.6109 11.6533 65.8021 10.8939 65.8021 9.968ZM66.0638 25.2064V13.3387H68.9883V25.2064H66.0638Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M64.2806 25.2533C63.8286 25.3483 63.3531 25.3717 62.9257 25.3717C60.8337 25.3717 59.9062 24.3744 59.9062 22.3573V8.59093H62.8306V21.9541C62.8306 22.9749 63.4493 23.1168 64.2806 23.0219V25.2533Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M58.0513 20.1035H49.2781C49.5869 21.8603 50.8477 23.0229 52.4643 23.0229C53.677 23.0229 54.6514 22.4768 55.2466 21.5755L57.5769 22.976C56.3877 24.5664 54.4388 25.5157 52.4653 25.5157C49.2086 25.5157 46.3793 22.9291 46.3793 19.2256C46.3793 15.5221 49.1851 12.96 52.3232 12.96C56.4347 12.9589 58.4552 16.2347 58.0513 20.1035ZM49.3732 17.8955H55.222C54.8651 16.3531 53.8672 15.3792 52.3211 15.3792C50.8712 15.3803 49.7771 16.3765 49.3732 17.8955Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M48.6359 11.2971H43.69V25.2064H40.5518V11.2971H35.5589V8.59093H48.6359V11.2971Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M16.9321 27.4656C11.5983 29.6245 8.54567 28.9365 6.85855 27.5904L6.83397 27.5712C9.44532 30.1717 12.4221 32.0011 15.0324 32.0011C19.6033 32.0011 25.8614 26.4651 28.8232 17.8805C27.1542 20.9792 23.5727 24.7861 16.9321 27.4656Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M20.9806 22.4843C25.137 20.0779 28.8809 15.9968 30.0616 13.0869C30.3971 10.6784 30.4654 10.3744 30.506 7.7248C30.5114 7.35787 30.4889 7.00587 30.4548 6.6688C30.2122 10.56 25.1743 15.4528 18.5092 18.6496C10.4689 22.5056 4.43738 23.5435 1.74589 20.6027C2.6808 22.4459 3.29411 23.3408 4.34549 24.7083C7.45048 27.4539 13.9853 26.5355 20.9806 22.4843Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M17.5721 15.8923C25.1562 12.24 30.4387 7.04427 29.5177 3.6C28.0058 0.993067 24.9457 0 21.6644 0C11.9381 0 0 6.4 0 14.5653C0 15.6149 0.231859 16.7883 0.647496 18.0181C2.86565 20.9568 9.64833 19.7077 17.5721 15.8923Z\"\n fill=\"currentColor\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_5309_7721\">\n <rect width=\"81\" height=\"32\" fill=\"currentColor\" />\n </clipPath>\n </defs>\n </svg>\n);\n","import React, { type ReactElement, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Container } from \"@purpur/container\";\nimport { Link, type LinkProps } from \"@purpur/link\";\nimport { Select } from \"@purpur/select\";\nimport { type ColorOptions, type ColorScheme, useColorScheme, useTheme } from \"@purpur/theme\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\nimport {\n type CustomLinkType,\n FooterNavigation,\n type FooterNavigationItem,\n type FooterNavigationItemLink,\n} from \"./footer-navigation\";\nimport { FooterSocialLink, type FooterSocialLinkProps } from \"./footer-social-link\";\nimport { TeliaLogo } from \"./telia-logo\";\n\nconst cx = c.bind(styles);\n\ntype AdditionalLink = FooterNavigationItemLink &\n Omit<LinkProps, \"href\" | \"variant\" | \"negative\" | \"children\" | \"disableVisited\">;\n\ntype SectionProps = Omit<BaseProps<\"section\">, \"children\">;\n\nexport type FooterProps = BaseProps<\"footer\"> & {\n /**\n * Navigation section of the footer.\n */\n navigation?: {\n customLink?: CustomLinkType;\n links: FooterNavigationItem[];\n sectionProps?: SectionProps;\n };\n /**\n * Social links section of the footer.\n */\n social?: {\n links: FooterSocialLinkProps[];\n sectionProps?: SectionProps;\n };\n /**\n * Contacts section of the footer.\n */\n contacts?: {\n copyright?: string;\n address?: {\n content: ReactElement;\n addressProps?: Omit<BaseProps<\"address\">, \"children\">;\n };\n sectionProps?: SectionProps;\n };\n /**\n * Additional links section of the footer.\n */\n additional?: {\n links: AdditionalLink[];\n sectionProps?: SectionProps;\n };\n /**\n * Custom content section of the footer.\n */\n custom?: {\n content: ReactElement;\n sectionProps?: SectionProps;\n };\n /**\n * Payment images section of the footer.\n */\n payments?: {\n /**\n * @deprecated use content instead\n */\n images?: { src: string; alt: string }[];\n content?: ReactElement | ReactElement[];\n sectionProps?: SectionProps;\n };\n /**\n * Custom logo that replaces the default Telia logo.\n */\n logo?: ReactNode;\n themeSelect?: {\n label: string;\n options: { value: ColorOptions; label: string }[];\n };\n forceColorScheme?: ColorScheme;\n};\n\nexport const Footer = ({\n className,\n navigation,\n social,\n contacts,\n additional,\n custom,\n payments,\n logo,\n themeSelect,\n forceColorScheme,\n ...props\n}: FooterProps) => {\n const classes = cx(className, rootClassName);\n\n const { options } = useTheme();\n const [colorScheme, setColorScheme] = useColorScheme();\n\n const resolvedColorScheme = forceColorScheme ?? options?.footerColorScheme;\n\n return (\n <footer data-color-scheme={resolvedColorScheme} className={classes} {...props}>\n <Container>\n <div className={cx(`${rootClassName}__container`)}>\n <div\n className={cx(`${rootClassName}__logo`, {\n [`${rootClassName}__logo--telia`]: !logo,\n })}\n >\n {logo ?? <TeliaLogo />}\n </div>\n {social && (\n <section\n {...social.sectionProps}\n className={cx(\n `${rootClassName}__social`,\n `${rootClassName}__social--md`,\n social.sectionProps?.className\n )}\n >\n {social.links.map(({ icon, href, ...socialLinkProps }) => (\n <FooterSocialLink {...socialLinkProps} icon={icon} href={href} key={href} />\n ))}\n </section>\n )}\n {navigation && (\n <FooterNavigation\n customLink={navigation.customLink}\n navigationLinks={navigation.links}\n sectionProps={navigation.sectionProps}\n />\n )}\n {payments && (\n <section\n {...payments.sectionProps}\n className={cx(`${rootClassName}__payments`, payments.sectionProps?.className)}\n >\n {payments.content}\n {payments.images?.map(({ alt, src }) => (\n <img\n className={cx(`${rootClassName}__payments-image`)}\n src={src}\n alt={alt}\n key={src}\n />\n ))}\n </section>\n )}\n {themeSelect && (\n <section className={cx(`${rootClassName}__theme-select`)}>\n <Select\n value={colorScheme}\n label={themeSelect.label}\n options={themeSelect.options}\n negative\n onChange={(event) => {\n setColorScheme(event.target.value as ColorOptions);\n }}\n />\n </section>\n )}\n {contacts && (\n <section\n {...contacts.sectionProps}\n className={cx(`${rootClassName}__contacts`, contacts.sectionProps?.className)}\n >\n {contacts.copyright && (\n <div className={cx(`${rootClassName}__contacts-copyright`)}>\n {contacts.copyright}\n </div>\n )}\n {contacts.address && (\n <address\n {...contacts.address.addressProps}\n className={cx(\n `${rootClassName}__contacts-address`,\n contacts.address.addressProps?.className\n )}\n >\n {contacts.address.content}\n </address>\n )}\n </section>\n )}\n {(custom || additional) && (\n <div className={cx(`${rootClassName}__additional`)}>\n {custom && (\n <section\n {...custom.sectionProps}\n className={cx(`${rootClassName}__custom-content`, custom.sectionProps?.className)}\n >\n {custom.content}\n </section>\n )}\n {additional && (\n <section\n {...additional.sectionProps}\n className={cx(\n `${rootClassName}__additional-links`,\n additional.sectionProps?.className\n )}\n >\n {additional?.links?.map(({ href, text, ...additionalLinkProps }) => (\n <Link\n {...additionalLinkProps}\n variant=\"standalone\"\n negative\n href={href}\n key={href}\n disableVisited={true}\n >\n {text}\n </Link>\n ))}\n </section>\n )}\n </div>\n )}\n {social && (\n <section\n {...social.sectionProps}\n className={cx(\n `${rootClassName}__social`,\n `${rootClassName}__social--sm`,\n social.sectionProps?.className\n )}\n >\n {social.links.map(({ icon, href, ...socialLinkProps }) => (\n <FooterSocialLink {...socialLinkProps} icon={icon} href={href} key={href} />\n ))}\n </section>\n )}\n </div>\n </Container>\n </footer>\n );\n};\n\nFooter.displayName = \"Footer\";\n"],"names":["rootClassName","cx","c","styles","NavigationLinks","links","CustomLink","href","text","linkProps","j","jsx","Link","FooterNavigation","navigationLinks","sectionProps","customLink","jsxs","Fragment","section","i","Accordion","FooterSocialLink","icon","props","Icon","TeliaLogo","Footer","className","navigation","social","contacts","additional","custom","payments","logo","themeSelect","forceColorScheme","classes","options","useTheme","colorScheme","setColorScheme","useColorScheme","resolvedColorScheme","Container","socialLinkProps","createElement","alt","src","Select","event","additionalLinkProps"],"mappings":";;;;;;;;;;AAAO,MAAMA,IAAgB;;;;;;;;;;;;;;;;;;;;;;;;GCSvBC,IAAKC,EAAE,KAAKC,CAAM,GAqBlBC,IAAkB,CAAC,EAAE,OAAAC,GAAO,YAAYC,0BAC3C,MAAA,EACE,UAAAD,EAAM,IAAI,CAAC,EAAE,MAAAE,GAAM,MAAAC,GAAM,GAAGC,KAAaC,MACxC,gBAAAC,EAAC,MAAA,EACE,UAAAL,IACC,gBAAAK;AAAA,EAACL;AAAA,EAAA;AAAA,IACE,GAAGG;AAAA,IACJ,MAAAF;AAAA,IACA,WAAWN,EAAG,GAAGD,CAAa,0BAA0B;AAAA,IAEvD,UAAAQ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GAAG4C,EAAA,MACxC,gBAAAL;AAAA,YAACnC;AAAA,YAAA;AAAA,cACE,GAAGwC;AAAA,cACJ,SAAQ;AAAA,cACR,UAAQ;AAAA,cACR,MAAA7C;AAAA,cACA,KAAKA;AAAA,cACL,gBAAgB;AAAA,YAAA;AAAA,YAEfC;AAAA,UAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,GAEJ;AAAA,IAEDsB,KACC,gBAAAnB;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGmB,EAAO;AAAA,QACX,WAAW7B;AAAA,UACT,GAAGD,CAAa;AAAA,UAChB,GAAGA,CAAa;AAAA,UAChB8B,EAAO,cAAc;AAAA,QAAA;AAAA,QAGtB,YAAO,MAAM,IAAI,CAAC,EAAE,MAAAP,GAAM,MAAAhB,GAAM,GAAGuC,EAAA,MAClC,gBAAAC,EAACzB,KAAkB,GAAGwB,GAAiB,MAAAvB,GAAY,MAAAhB,GAAY,KAAKA,GAAM,CAC3E;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,EAAA,CAEJ,GACF,GACF;AAEJ;AAEAoB,EAAO,cAAc;"}
|
|
1
|
+
{"version":3,"file":"footer-DenAcikt.mjs","sources":["../../../components/footer/src/constants.ts","../../../components/footer/src/footer-navigation.tsx","../../../components/footer/src/footer-social-link.tsx","../../../components/footer/src/telia-logo.tsx","../../../components/footer/src/footer.tsx"],"sourcesContent":["export const rootClassName = \"purpur-footer\";\n","import React, { type AnchorHTMLAttributes, type ForwardRefExoticComponent } from \"react\";\nimport { Accordion } from \"@purpur/accordion\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Link } from \"@purpur/link\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type FooterNavigationItemLink = Omit<BaseProps<\"a\">, \"href\"> & {\n text: string;\n href: string;\n};\n\nexport type FooterNavigationItem = {\n heading: string;\n links: FooterNavigationItemLink[];\n};\n\nexport type CustomLinkType =\n | ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement>>\n | \"a\";\n\ntype NavigationLinksProps = {\n links: FooterNavigationItemLink[];\n customLink?: CustomLinkType;\n};\n\nconst NavigationLinks = ({ links, customLink: CustomLink }: NavigationLinksProps) => (\n <ul>\n {links.map(({ href, text, ...linkProps }, j) => (\n <li key={j}>\n {CustomLink ? (\n <CustomLink\n {...linkProps}\n href={href}\n className={cx(`${rootClassName}__custom-link-navigation`)}\n >\n {text}\n </CustomLink>\n ) : (\n <Link {...linkProps} variant=\"navigation\" negative href={href} disableVisited={true}>\n {text}\n </Link>\n )}\n </li>\n ))}\n </ul>\n);\n\ntype FooterNavigationProps = {\n customLink?: CustomLinkType;\n sectionProps?: Omit<BaseProps<\"section\">, \"children\">;\n navigationLinks: FooterNavigationItem[];\n};\n\nexport const FooterNavigation = ({\n navigationLinks,\n sectionProps,\n customLink,\n}: FooterNavigationProps) => (\n <>\n <section\n {...sectionProps}\n className={cx(\n `${rootClassName}__navigation`,\n `${rootClassName}__navigation--lg`,\n sectionProps?.className\n )}\n >\n {navigationLinks.map((section, i) => (\n <div key={i} className={cx(`${rootClassName}__navigation-section`)}>\n <h3 className={cx(`${rootClassName}__navigation-section-heading`)}>{section.heading}</h3>\n <NavigationLinks links={section.links} customLink={customLink} />\n </div>\n ))}\n </section>\n <section\n {...sectionProps}\n className={cx(\n `${rootClassName}__navigation`,\n `${rootClassName}__navigation--sm`,\n sectionProps?.className\n )}\n >\n <Accordion negative>\n {navigationLinks.map((section, i) => (\n <Accordion.Item\n key={i}\n title={section.heading}\n titleTag=\"h2\"\n className={cx(`${rootClassName}__navigation-section`)}\n >\n <NavigationLinks links={section.links} customLink={customLink} />\n </Accordion.Item>\n ))}\n </Accordion>\n </section>\n </>\n);\n","import React from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Icon, type IconProps } from \"@purpur/icon\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\n\nexport type FooterSocialLinkProps = Omit<BaseProps<\"a\">, \"aria-label\" | \"href\" | \"children\"> & {\n \"aria-label\": string;\n icon: IconProps[\"svg\"];\n href: string;\n};\n\nconst cx = c.bind(styles);\n\nexport const FooterSocialLink = ({ icon, href, ...props }: FooterSocialLinkProps) => (\n <a\n {...props}\n href={href}\n className={cx(`${rootClassName}__social-link`)}\n rel=\"noreferrer\"\n target=\"_blank\"\n >\n <Icon svg={icon} />\n </a>\n);\n","import React from \"react\";\n\nexport const TeliaLogo = () => (\n <svg\n width=\"81\"\n height=\"32\"\n viewBox=\"0 0 81 32\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n aria-hidden=\"true\"\n >\n <g clipPath=\"url(#clip0_5309_7721)\">\n <path\n d=\"M81.28 16.8043V25.2064H78.5458V23.8293C77.6183 25.04 76.1438 25.4912 74.9076 25.4912C72.3401 25.4912 70.8186 23.8773 70.8186 21.8592C70.8186 19.5573 73.4107 17.6821 76.5723 17.6821C77.1909 17.6821 77.8566 17.7301 78.4507 17.92V17.1371C78.4507 15.9499 77.7615 15.3333 76.3586 15.3333C75.0989 15.3333 73.9812 15.9744 73.2921 16.8053L71.2235 15.2864C72.3882 13.9339 74.3862 12.9845 76.4067 12.9845C79.5683 12.9824 81.28 14.3595 81.28 16.8043ZM78.4507 20.6251V20.1024C77.9752 19.936 77.4762 19.8891 76.8576 19.8891C74.7174 19.8891 73.6244 20.7435 73.6244 21.7877C73.6244 22.6421 74.3616 23.1883 75.4792 23.1883C76.9527 23.1883 78.4507 22.3104 78.4507 20.6251Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M65.8021 9.968C65.8021 9.04214 66.6109 8.28267 67.5373 8.28267C68.4412 8.28267 69.249 9.04214 69.249 9.968C69.249 10.8939 68.4401 11.6533 67.5373 11.6533C66.6109 11.6533 65.8021 10.8939 65.8021 9.968ZM66.0638 25.2064V13.3387H68.9883V25.2064H66.0638Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M64.2806 25.2533C63.8286 25.3483 63.3531 25.3717 62.9257 25.3717C60.8337 25.3717 59.9062 24.3744 59.9062 22.3573V8.59093H62.8306V21.9541C62.8306 22.9749 63.4493 23.1168 64.2806 23.0219V25.2533Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M58.0513 20.1035H49.2781C49.5869 21.8603 50.8477 23.0229 52.4643 23.0229C53.677 23.0229 54.6514 22.4768 55.2466 21.5755L57.5769 22.976C56.3877 24.5664 54.4388 25.5157 52.4653 25.5157C49.2086 25.5157 46.3793 22.9291 46.3793 19.2256C46.3793 15.5221 49.1851 12.96 52.3232 12.96C56.4347 12.9589 58.4552 16.2347 58.0513 20.1035ZM49.3732 17.8955H55.222C54.8651 16.3531 53.8672 15.3792 52.3211 15.3792C50.8712 15.3803 49.7771 16.3765 49.3732 17.8955Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M48.6359 11.2971H43.69V25.2064H40.5518V11.2971H35.5589V8.59093H48.6359V11.2971Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M16.9321 27.4656C11.5983 29.6245 8.54567 28.9365 6.85855 27.5904L6.83397 27.5712C9.44532 30.1717 12.4221 32.0011 15.0324 32.0011C19.6033 32.0011 25.8614 26.4651 28.8232 17.8805C27.1542 20.9792 23.5727 24.7861 16.9321 27.4656Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M20.9806 22.4843C25.137 20.0779 28.8809 15.9968 30.0616 13.0869C30.3971 10.6784 30.4654 10.3744 30.506 7.7248C30.5114 7.35787 30.4889 7.00587 30.4548 6.6688C30.2122 10.56 25.1743 15.4528 18.5092 18.6496C10.4689 22.5056 4.43738 23.5435 1.74589 20.6027C2.6808 22.4459 3.29411 23.3408 4.34549 24.7083C7.45048 27.4539 13.9853 26.5355 20.9806 22.4843Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M17.5721 15.8923C25.1562 12.24 30.4387 7.04427 29.5177 3.6C28.0058 0.993067 24.9457 0 21.6644 0C11.9381 0 0 6.4 0 14.5653C0 15.6149 0.231859 16.7883 0.647496 18.0181C2.86565 20.9568 9.64833 19.7077 17.5721 15.8923Z\"\n fill=\"currentColor\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_5309_7721\">\n <rect width=\"81\" height=\"32\" fill=\"currentColor\" />\n </clipPath>\n </defs>\n </svg>\n);\n","import React, { type ReactElement, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Container } from \"@purpur/container\";\nimport { Link, type LinkProps } from \"@purpur/link\";\nimport { Select } from \"@purpur/select\";\nimport { type ColorOptions, type ColorScheme, useColorScheme, useTheme } from \"@purpur/theme\";\nimport c from \"classnames/bind\";\n\nimport { rootClassName } from \"./constants\";\nimport styles from \"./footer.module.scss\";\nimport {\n type CustomLinkType,\n FooterNavigation,\n type FooterNavigationItem,\n type FooterNavigationItemLink,\n} from \"./footer-navigation\";\nimport { FooterSocialLink, type FooterSocialLinkProps } from \"./footer-social-link\";\nimport { TeliaLogo } from \"./telia-logo\";\n\nconst cx = c.bind(styles);\n\ntype AdditionalLink = FooterNavigationItemLink &\n Omit<LinkProps, \"href\" | \"variant\" | \"negative\" | \"children\" | \"disableVisited\">;\n\ntype SectionProps = Omit<BaseProps<\"section\">, \"children\">;\n\nexport type FooterProps = BaseProps<\"footer\"> & {\n /**\n * Navigation section of the footer.\n */\n navigation?: {\n customLink?: CustomLinkType;\n links: FooterNavigationItem[];\n sectionProps?: SectionProps;\n };\n /**\n * Social links section of the footer.\n */\n social?: {\n links: FooterSocialLinkProps[];\n sectionProps?: SectionProps;\n };\n /**\n * Contacts section of the footer.\n */\n contacts?: {\n copyright?: string;\n address?: {\n content: ReactElement;\n addressProps?: Omit<BaseProps<\"address\">, \"children\">;\n };\n sectionProps?: SectionProps;\n };\n /**\n * Additional links section of the footer.\n */\n additional?: {\n links: AdditionalLink[];\n sectionProps?: SectionProps;\n };\n /**\n * Custom content section of the footer.\n */\n custom?: {\n content: ReactElement;\n sectionProps?: SectionProps;\n };\n /**\n * Payment images section of the footer.\n */\n payments?: {\n /**\n * @deprecated use content instead\n */\n images?: { src: string; alt: string }[];\n content?: ReactElement | ReactElement[];\n sectionProps?: SectionProps;\n };\n /**\n * Custom logo that replaces the default Telia logo.\n */\n logo?: ReactNode;\n themeSelect?: {\n label: string;\n options: { value: ColorOptions; label: string }[];\n };\n forceColorScheme?: ColorScheme;\n};\n\nexport const Footer = ({\n className,\n navigation,\n social,\n contacts,\n additional,\n custom,\n payments,\n logo,\n themeSelect,\n forceColorScheme,\n ...props\n}: FooterProps) => {\n const classes = cx(className, rootClassName);\n\n const { options } = useTheme();\n const [colorScheme, setColorScheme] = useColorScheme();\n\n const resolvedColorScheme = forceColorScheme ?? options?.footerColorScheme;\n\n return (\n <footer data-color-scheme={resolvedColorScheme} className={classes} {...props}>\n <Container>\n <div className={cx(`${rootClassName}__container`)}>\n <div\n className={cx(`${rootClassName}__logo`, {\n [`${rootClassName}__logo--telia`]: !logo,\n })}\n >\n {logo ?? <TeliaLogo />}\n </div>\n {social && (\n <section\n {...social.sectionProps}\n className={cx(\n `${rootClassName}__social`,\n `${rootClassName}__social--md`,\n social.sectionProps?.className\n )}\n >\n {social.links.map(({ icon, href, ...socialLinkProps }) => (\n <FooterSocialLink {...socialLinkProps} icon={icon} href={href} key={href} />\n ))}\n </section>\n )}\n {navigation && (\n <FooterNavigation\n customLink={navigation.customLink}\n navigationLinks={navigation.links}\n sectionProps={navigation.sectionProps}\n />\n )}\n {payments && (\n <section\n {...payments.sectionProps}\n className={cx(`${rootClassName}__payments`, payments.sectionProps?.className)}\n >\n {payments.content}\n {payments.images?.map(({ alt, src }) => (\n <img\n className={cx(`${rootClassName}__payments-image`)}\n src={src}\n alt={alt}\n key={src}\n />\n ))}\n </section>\n )}\n {themeSelect && (\n <section className={cx(`${rootClassName}__theme-select`)}>\n <Select\n value={colorScheme}\n label={themeSelect.label}\n options={themeSelect.options}\n negative\n onChange={(event) => {\n setColorScheme(event.target.value as ColorOptions);\n }}\n />\n </section>\n )}\n {contacts && (\n <section\n {...contacts.sectionProps}\n className={cx(`${rootClassName}__contacts`, contacts.sectionProps?.className)}\n >\n {contacts.copyright && (\n <div className={cx(`${rootClassName}__contacts-copyright`)}>\n {contacts.copyright}\n </div>\n )}\n {contacts.address && (\n <address\n {...contacts.address.addressProps}\n className={cx(\n `${rootClassName}__contacts-address`,\n contacts.address.addressProps?.className\n )}\n >\n {contacts.address.content}\n </address>\n )}\n </section>\n )}\n {(custom || additional) && (\n <div className={cx(`${rootClassName}__additional`)}>\n {custom && (\n <section\n {...custom.sectionProps}\n className={cx(`${rootClassName}__custom-content`, custom.sectionProps?.className)}\n >\n {custom.content}\n </section>\n )}\n {additional && (\n <section\n {...additional.sectionProps}\n className={cx(\n `${rootClassName}__additional-links`,\n additional.sectionProps?.className\n )}\n >\n {additional?.links?.map(({ href, text, ...additionalLinkProps }) => (\n <Link\n {...additionalLinkProps}\n variant=\"standalone\"\n negative\n href={href}\n key={href}\n disableVisited={true}\n >\n {text}\n </Link>\n ))}\n </section>\n )}\n </div>\n )}\n {social && (\n <section\n {...social.sectionProps}\n className={cx(\n `${rootClassName}__social`,\n `${rootClassName}__social--sm`,\n social.sectionProps?.className\n )}\n >\n {social.links.map(({ icon, href, ...socialLinkProps }) => (\n <FooterSocialLink {...socialLinkProps} icon={icon} href={href} key={href} />\n ))}\n </section>\n )}\n </div>\n </Container>\n </footer>\n );\n};\n\nFooter.displayName = \"Footer\";\n"],"names":["rootClassName","cx","c","styles","NavigationLinks","links","CustomLink","href","text","linkProps","j","jsx","Link","FooterNavigation","navigationLinks","sectionProps","customLink","jsxs","Fragment","section","i","Accordion","FooterSocialLink","icon","props","Icon","TeliaLogo","Footer","className","navigation","social","contacts","additional","custom","payments","logo","themeSelect","forceColorScheme","classes","options","useTheme","colorScheme","setColorScheme","useColorScheme","resolvedColorScheme","Container","socialLinkProps","createElement","alt","src","Select","event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StringTag,{value:"Module"});const e=require("./footer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./footer-3Y-664-8.js");exports.Footer=e.Footer;
|
|
2
2
|
//# sourceMappingURL=footer.cjs.js.map
|
package/dist/footer.es.js
CHANGED