@razorpay/blade 11.3.1 → 11.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +3 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheet.native.js +2 -1
- package/build/lib/native/components/BottomSheet/BottomSheet.native.js.map +1 -1
- package/build/lib/native/components/Breadcrumb/Breadcrumb.native.js +7 -0
- package/build/lib/native/components/Breadcrumb/Breadcrumb.native.js.map +1 -0
- package/build/lib/native/components/Breadcrumb/BreadcrumbItem.native.js +7 -0
- package/build/lib/native/components/Breadcrumb/BreadcrumbItem.native.js.map +1 -0
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/Drawer/Drawer.native.js +17 -0
- package/build/lib/native/components/Drawer/Drawer.native.js.map +1 -0
- package/build/lib/native/components/Drawer/DrawerSubcomponents.native.js +17 -0
- package/build/lib/native/components/Drawer/DrawerSubcomponents.native.js.map +1 -0
- package/build/lib/native/components/Link/BaseLink/BaseLink.js +1 -1
- package/build/lib/native/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/native/components/Popover/Popover.native.js +3 -2
- package/build/lib/native/components/Popover/Popover.native.js.map +1 -1
- package/build/lib/native/components/Popover/constants.js +2 -2
- package/build/lib/native/components/Popover/constants.js.map +1 -1
- package/build/lib/native/components/Tag/Tag.js +1 -1
- package/build/lib/native/components/Tag/Tag.js.map +1 -1
- package/build/lib/native/components/Tooltip/Tooltip.native.js +3 -2
- package/build/lib/native/components/Tooltip/Tooltip.native.js.map +1 -1
- package/build/lib/native/components/Tooltip/constants.js +2 -2
- package/build/lib/native/components/Tooltip/constants.js.map +1 -1
- package/build/lib/native/components/index.js +4 -0
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/utils/componentZIndices.js +4 -0
- package/build/lib/native/utils/componentZIndices.js.map +1 -0
- package/build/lib/native/utils/lodashButBetter/get.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +6 -2
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/development/components/BladeProvider/BladeProvider.web.js +5 -2
- package/build/lib/web/development/components/BladeProvider/BladeProvider.web.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +2 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
- package/build/lib/web/development/components/Breadcrumb/Breadcrumb.web.js +104 -0
- package/build/lib/web/development/components/Breadcrumb/Breadcrumb.web.js.map +1 -0
- package/build/lib/web/development/components/Breadcrumb/BreadcrumbContext.js +9 -0
- package/build/lib/web/development/components/Breadcrumb/BreadcrumbContext.js.map +1 -0
- package/build/lib/web/development/components/Breadcrumb/BreadcrumbItem.web.js +55 -0
- package/build/lib/web/development/components/Breadcrumb/BreadcrumbItem.web.js.map +1 -0
- package/build/lib/web/development/components/Breadcrumb/index.js +4 -0
- package/build/lib/web/development/components/Breadcrumb/index.js.map +1 -0
- package/build/lib/web/development/components/Breadcrumb/types.js +2 -0
- package/build/lib/web/development/components/Breadcrumb/types.js.map +1 -0
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +2 -2
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/Button/Button/index.js +1 -1
- package/build/lib/web/development/components/Drawer/Drawer.web.js +229 -0
- package/build/lib/web/development/components/Drawer/Drawer.web.js.map +1 -0
- package/build/lib/web/development/components/Drawer/DrawerContext.js +9 -0
- package/build/lib/web/development/components/Drawer/DrawerContext.js.map +1 -0
- package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js +65 -0
- package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js.map +1 -0
- package/build/lib/web/development/components/Drawer/StackProvider.js +57 -0
- package/build/lib/web/development/components/Drawer/StackProvider.js.map +1 -0
- package/build/lib/web/development/components/Drawer/drawerComponentIds.js +8 -0
- package/build/lib/web/development/components/Drawer/drawerComponentIds.js.map +1 -0
- package/build/lib/web/development/components/Drawer/index.js +4 -0
- package/build/lib/web/development/components/Drawer/index.js.map +1 -0
- package/build/lib/web/development/components/Drawer/types.js +2 -0
- package/build/lib/web/development/components/Drawer/types.js.map +1 -0
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +2 -2
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/development/components/Link/BaseLink/BaseLink.js +3 -1
- package/build/lib/web/development/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/web/development/components/Link/Link/index.js +1 -1
- package/build/lib/web/development/components/Modal/Modal.web.js +3 -2
- package/build/lib/web/development/components/Modal/Modal.web.js.map +1 -1
- package/build/lib/web/development/components/Modal/ModalHeader.web.js +2 -2
- package/build/lib/web/development/components/Modal/ModalHeader.web.js.map +1 -1
- package/build/lib/web/development/components/Modal/modalTokens.js +1 -2
- package/build/lib/web/development/components/Modal/modalTokens.js.map +1 -1
- package/build/lib/web/development/components/Popover/Popover.web.js +3 -2
- package/build/lib/web/development/components/Popover/Popover.web.js.map +1 -1
- package/build/lib/web/development/components/Popover/constants.js +1 -2
- package/build/lib/web/development/components/Popover/constants.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +2 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js +3 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/tourTokens.js +1 -3
- package/build/lib/web/development/components/SpotlightPopoverTour/tourTokens.js.map +1 -1
- package/build/lib/web/development/components/Tag/AnimatedTag.web.js +1 -1
- package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/development/components/Tag/Tag.js +1 -0
- package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js +3 -2
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
- package/build/lib/web/development/components/Tooltip/constants.js +1 -2
- package/build/lib/web/development/components/Tooltip/constants.js.map +1 -1
- package/build/lib/web/development/components/index.js +6 -0
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/utils/componentZIndices.js +13 -0
- package/build/lib/web/development/utils/componentZIndices.js.map +1 -0
- package/build/lib/web/development/utils/lodashButBetter/get.js +1 -1
- package/build/lib/web/development/utils/lodashButBetter/get.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +3 -0
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/utils/useVerifyAllowedChildren/index.js +2 -0
- package/build/lib/web/development/utils/useVerifyAllowedChildren/index.js.map +1 -0
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +6 -2
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/production/components/BladeProvider/BladeProvider.web.js +5 -2
- package/build/lib/web/production/components/BladeProvider/BladeProvider.web.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +2 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
- package/build/lib/web/production/components/Breadcrumb/Breadcrumb.web.js +104 -0
- package/build/lib/web/production/components/Breadcrumb/Breadcrumb.web.js.map +1 -0
- package/build/lib/web/production/components/Breadcrumb/BreadcrumbContext.js +9 -0
- package/build/lib/web/production/components/Breadcrumb/BreadcrumbContext.js.map +1 -0
- package/build/lib/web/production/components/Breadcrumb/BreadcrumbItem.web.js +55 -0
- package/build/lib/web/production/components/Breadcrumb/BreadcrumbItem.web.js.map +1 -0
- package/build/lib/web/production/components/Breadcrumb/index.js +4 -0
- package/build/lib/web/production/components/Breadcrumb/index.js.map +1 -0
- package/build/lib/web/production/components/Breadcrumb/types.js +2 -0
- package/build/lib/web/production/components/Breadcrumb/types.js.map +1 -0
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +2 -2
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Button/Button/index.js +1 -1
- package/build/lib/web/production/components/Drawer/Drawer.web.js +229 -0
- package/build/lib/web/production/components/Drawer/Drawer.web.js.map +1 -0
- package/build/lib/web/production/components/Drawer/DrawerContext.js +9 -0
- package/build/lib/web/production/components/Drawer/DrawerContext.js.map +1 -0
- package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js +65 -0
- package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js.map +1 -0
- package/build/lib/web/production/components/Drawer/StackProvider.js +57 -0
- package/build/lib/web/production/components/Drawer/StackProvider.js.map +1 -0
- package/build/lib/web/production/components/Drawer/drawerComponentIds.js +8 -0
- package/build/lib/web/production/components/Drawer/drawerComponentIds.js.map +1 -0
- package/build/lib/web/production/components/Drawer/index.js +4 -0
- package/build/lib/web/production/components/Drawer/index.js.map +1 -0
- package/build/lib/web/production/components/Drawer/types.js +2 -0
- package/build/lib/web/production/components/Drawer/types.js.map +1 -0
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +2 -2
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/production/components/Link/BaseLink/BaseLink.js +3 -1
- package/build/lib/web/production/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/web/production/components/Link/Link/index.js +1 -1
- package/build/lib/web/production/components/Modal/Modal.web.js +3 -2
- package/build/lib/web/production/components/Modal/Modal.web.js.map +1 -1
- package/build/lib/web/production/components/Modal/ModalHeader.web.js +2 -2
- package/build/lib/web/production/components/Modal/ModalHeader.web.js.map +1 -1
- package/build/lib/web/production/components/Modal/modalTokens.js +1 -2
- package/build/lib/web/production/components/Modal/modalTokens.js.map +1 -1
- package/build/lib/web/production/components/Popover/Popover.web.js +3 -2
- package/build/lib/web/production/components/Popover/Popover.web.js.map +1 -1
- package/build/lib/web/production/components/Popover/constants.js +1 -2
- package/build/lib/web/production/components/Popover/constants.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +2 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js +3 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/tourTokens.js +1 -3
- package/build/lib/web/production/components/SpotlightPopoverTour/tourTokens.js.map +1 -1
- package/build/lib/web/production/components/Tag/AnimatedTag.web.js +1 -1
- package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/production/components/Tag/Tag.js +1 -0
- package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js +3 -2
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
- package/build/lib/web/production/components/Tooltip/constants.js +1 -2
- package/build/lib/web/production/components/Tooltip/constants.js.map +1 -1
- package/build/lib/web/production/components/index.js +6 -0
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/utils/componentZIndices.js +13 -0
- package/build/lib/web/production/utils/componentZIndices.js.map +1 -0
- package/build/lib/web/production/utils/lodashButBetter/get.js +1 -1
- package/build/lib/web/production/utils/lodashButBetter/get.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +3 -0
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/utils/useVerifyAllowedChildren/index.js +2 -0
- package/build/lib/web/production/utils/useVerifyAllowedChildren/index.js.map +1 -0
- package/build/types/components/index.d.ts +332 -140
- package/build/types/components/index.native.d.ts +282 -141
- package/package.json +9 -57
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseHeader.js","sources":["../../../../../../src/components/BaseHeaderFooter/BaseHeader.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport type { ReactDOMAttributes } from '@use-gesture/react/dist/declarations/src/types';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { IconButton } from '~components/Button/IconButton';\nimport { ChevronLeftIcon, CloseIcon } from '~components/Icons';\nimport type { TestID } from '~utils/types';\nimport type { BoxProps } from '~components/Box';\nimport { Box } from '~components/Box';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { isReactNative } from '~utils';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport { logger, throwBladeError } from '~utils/logger';\n\ntype BaseHeaderProps = {\n title?: string;\n subtitle?: string;\n /**\n * Leading part of the header placed at the left most side of the header\n */\n leading?: React.ReactNode;\n /**\n * Trailing part of the header placed at the right most side of the header\n */\n trailing?: React.ReactNode;\n /**\n * Placed adjacent to the title text\n */\n titleSuffix?: React.ReactNode;\n /**\n * @default true\n */\n showDivider?: boolean;\n /**\n * @default false\n */\n showBackButton?: boolean;\n /**\n * @default true\n */\n showCloseButton?: boolean;\n onCloseButtonClick?: () => void;\n onBackButtonClick?: () => void;\n closeButtonRef?: React.MutableRefObject<any>;\n metaComponentName?: string;\n /**\n * inner child of BottomSheetHeader. Meant to be used for AutoComplete only\n */\n children?: React.ReactElement;\n} & Pick<\n ReactDOMAttributes,\n | 'onClickCapture'\n | 'onKeyDown'\n | 'onKeyUp'\n | 'onLostPointerCapture'\n | 'onPointerCancel'\n | 'onPointerDown'\n | 'onPointerMove'\n | 'onPointerUp'\n> &\n TestID;\n\ntype TrailingComponents = 'Button' | 'Badge' | 'Link' | 'Text' | 'Amount';\n\nconst centerBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n // We want to align title, icon, titleSuffix, trailing, closeButton to baseline\n // But we also want to keep them center aligned to each other\n // So we add a virtual Box around these slots with 28px and center align them to that box\n // We have done similar thing in figma as well (which is where this 28px comes from)\n height: '28px',\n};\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'medium',\n },\n Link: {\n size: 'medium',\n },\n Text: {\n size: 'medium',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'medium',\n },\n} as const;\n\nconst useTrailingRestriction = (trailing: React.ReactNode): React.ReactNode => {\n const [\n validatedTrailingComponent,\n setValidatedTrailingComponent,\n ] = React.useState<React.ReactElement | null>(null);\n\n // validate and restrict sub component props in trailing prop\n React.useEffect(() => {\n if (React.isValidElement(trailing)) {\n const trailingComponentType = getComponentId(trailing) as TrailingComponents;\n const restrictedProps = propRestrictionMap[trailingComponentType];\n const allowedComponents = Object.keys(propRestrictionMap);\n if (__DEV__) {\n if (!restrictedProps) {\n throwBladeError({\n message: `Only one of \\`${allowedComponents.join(\n ', ',\n )}\\` component is accepted as trailing`,\n moduleName: 'Header',\n });\n }\n }\n\n const restrictedPropKeys = Object.keys(propRestrictionMap[trailingComponentType]);\n for (const prop of restrictedPropKeys) {\n if (trailing?.props?.hasOwnProperty(prop)) {\n logger({\n message: `Do not pass \"${prop}\" to \"${trailingComponentType}\" while inside Header trailing, because we override it.`,\n moduleName: 'Header',\n type: 'warn',\n });\n }\n }\n setValidatedTrailingComponent(\n React.cloneElement(trailing as React.ReactElement, restrictedProps),\n );\n }\n }, [trailing]);\n\n return validatedTrailingComponent;\n};\n\nconst _BaseHeader = ({\n title,\n subtitle,\n leading,\n titleSuffix,\n trailing,\n showDivider = true,\n showBackButton = false,\n showCloseButton = true,\n onBackButtonClick,\n onCloseButtonClick,\n closeButtonRef,\n testID,\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n metaComponentName,\n children,\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction(trailing);\n const shouldWrapTitle = titleSuffix && trailing && showBackButton && showCloseButton;\n\n const webOnlyEventHandlers: Record<string, any> = isReactNative()\n ? {}\n : {\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n };\n\n return (\n <BaseBox {...metaAttribute({ name: metaComponentName, testID })}>\n <BaseBox\n marginY={{ base: 'spacing.5', m: 'spacing.6' }}\n paddingX={{ base: 'spacing.5', m: 'spacing.6' }}\n touchAction=\"none\"\n {...webOnlyEventHandlers}\n >\n <BaseBox display=\"flex\" flexDirection=\"row\" userSelect=\"none\">\n {showBackButton ? (\n <BaseBox overflow=\"visible\" marginRight=\"spacing.5\">\n <Box {...centerBoxProps}>\n <IconButton\n size=\"large\"\n icon={ChevronLeftIcon}\n onClick={() => onBackButtonClick?.()}\n accessibilityLabel=\"Back\"\n />\n </Box>\n </BaseBox>\n ) : null}\n <BaseBox\n paddingRight=\"spacing.5\"\n marginRight=\"auto\"\n flex=\"auto\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"flex-start\"\n >\n {leading ? (\n <BaseBox\n width=\"spacing.8\"\n height=\"spacing.8\"\n marginRight=\"spacing.3\"\n {...centerBoxProps}\n >\n {leading}\n </BaseBox>\n ) : null}\n <BaseBox flex=\"auto\">\n <BaseBox\n // Explicitly setting maxWidth in React Native because text is not being wrapped properly when multiple fix width components are rendered in header\n // In web, flex containers seem to work a expected\n // @todo: resolve this if we figure out some better solution later\n maxWidth={isReactNative() && shouldWrapTitle ? '100px' : undefined}\n flexShrink={0}\n display=\"flex\"\n flexDirection=\"row\"\n >\n {title ? (\n <Text size=\"large\" weight=\"semibold\" color=\"surface.text.gray.normal\">\n {title}\n </Text>\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text variant=\"body\" size=\"small\" weight=\"regular\" color=\"surface.text.gray.muted\">\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n {validatedTrailingComponent ? (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps}>{validatedTrailingComponent}</Box>\n </BaseBox>\n ) : null}\n {showCloseButton ? (\n <Box {...centerBoxProps}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n </BaseBox>\n {children}\n </BaseBox>\n {showDivider ? <Divider /> : null}\n </BaseBox>\n );\n};\n\nconst BaseHeader = assignWithoutSideEffects(_BaseHeader, {\n componentId: 'BaseHeader',\n});\n\nexport type { BaseHeaderProps };\nexport { BaseHeader };\n"],"names":["centerBoxProps","display","alignItems","justifyContent","height","propRestrictionMap","Button","size","variant","Badge","Link","Text","Amount","type","useTrailingRestriction","trailing","_React$useState","React","useState","_React$useState2","_slicedToArray","validatedTrailingComponent","setValidatedTrailingComponent","useEffect","isValidElement","trailingComponentType","getComponentId","restrictedProps","allowedComponents","Object","keys","throwBladeError","message","concat","join","moduleName","restrictedPropKeys","_i","_restrictedPropKeys","length","_trailing$props","prop","props","hasOwnProperty","logger","cloneElement","_BaseHeader","_ref","title","subtitle","leading","titleSuffix","_ref$showDivider","showDivider","_ref$showBackButton","showBackButton","_ref$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","children","shouldWrapTitle","webOnlyEventHandlers","isReactNative","_jsxs","BaseBox","_objectSpread","metaAttribute","name","marginY","base","m","paddingX","touchAction","flexDirection","userSelect","_jsx","overflow","marginRight","Box","IconButton","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","width","maxWidth","undefined","flexShrink","weight","color","marginLeft","ref","CloseIcon","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,IAAMA,cAAwB,GAAG;AAC/BC,EAAAA,OAAO,EAAE,MAAM;AACfC,EAAAA,UAAU,EAAE,QAAQ;AACpBC,EAAAA,cAAc,EAAE,QAAQ;AACxB;AACA;AACA;AACA;AACAC,EAAAA,MAAM,EAAE,MAAA;AACV,CAAC,CAAA;;AAED;AACA,IAAMC,kBAAkB,GAAG;AACzBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,IAAI,EAAE,QAAQ;AACdC,IAAAA,OAAO,EAAE,UAAA;GACV;AACDC,EAAAA,KAAK,EAAE;AACLF,IAAAA,IAAI,EAAE,QAAA;GACP;AACDG,EAAAA,IAAI,EAAE;AACJH,IAAAA,IAAI,EAAE,QAAA;GACP;AACDI,EAAAA,IAAI,EAAE;AACJJ,IAAAA,IAAI,EAAE,QAAQ;AACdC,IAAAA,OAAO,EAAE,MAAA;GACV;AACDI,EAAAA,MAAM,EAAE;AACNC,IAAAA,IAAI,EAAE,MAAM;AACZN,IAAAA,IAAI,EAAE,QAAA;AACR,GAAA;AACF,CAAU,CAAA;AAEV,IAAMO,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAIC,QAAyB,EAAsB;AAC7E,EAAA,IAAAC,eAAA,GAGIC,cAAK,CAACC,QAAQ,CAA4B,IAAI,CAAC;IAAAC,gBAAA,GAAAC,cAAA,CAAAJ,eAAA,EAAA,CAAA,CAAA;AAFjDK,IAAAA,0BAA0B,GAAAF,gBAAA,CAAA,CAAA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/D,WAAW,EAAE;AACvDgE,EAAAA,WAAW,EAAE,YAAA;AACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"BaseHeader.js","sources":["../../../../../../src/components/BaseHeaderFooter/BaseHeader.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport type { ReactDOMAttributes } from '@use-gesture/react/dist/declarations/src/types';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { IconButton } from '~components/Button/IconButton';\nimport { ChevronLeftIcon, CloseIcon } from '~components/Icons';\nimport type { TestID } from '~utils/types';\nimport type { BoxProps } from '~components/Box';\nimport { Box } from '~components/Box';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { isReactNative, makeSize } from '~utils';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport { logger, throwBladeError } from '~utils/logger';\nimport { size } from '~tokens/global';\n\ntype BaseHeaderProps = {\n title?: string;\n subtitle?: string;\n /**\n * Leading part of the header placed at the left most side of the header\n */\n leading?: React.ReactNode;\n /**\n * Trailing part of the header placed at the right most side of the header\n */\n trailing?: React.ReactNode;\n /**\n * Placed adjacent to the title text\n */\n titleSuffix?: React.ReactNode;\n /**\n * @default true\n */\n showDivider?: boolean;\n /**\n * @default false\n */\n showBackButton?: boolean;\n /**\n * @default true\n */\n showCloseButton?: boolean;\n onCloseButtonClick?: () => void;\n onBackButtonClick?: () => void;\n closeButtonRef?: React.MutableRefObject<any>;\n backButtonRef?: React.MutableRefObject<any>;\n metaComponentName?: string;\n /**\n * inner child of BottomSheetHeader. Meant to be used for AutoComplete only\n */\n children?: React.ReactElement;\n} & Pick<\n ReactDOMAttributes,\n | 'onClickCapture'\n | 'onKeyDown'\n | 'onKeyUp'\n | 'onLostPointerCapture'\n | 'onPointerCancel'\n | 'onPointerDown'\n | 'onPointerMove'\n | 'onPointerUp'\n> &\n TestID;\n\ntype TrailingComponents = 'Button' | 'Badge' | 'Link' | 'Text' | 'Amount';\n\nconst centerBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n // We want to align title, icon, titleSuffix, trailing, closeButton to baseline\n // But we also want to keep them center aligned to each other\n // So we add a virtual Box around these slots with 28px and center align them to that box\n // We have done similar thing in figma as well (which is where this 28px comes from)\n height: '28px',\n};\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'medium',\n },\n Link: {\n size: 'medium',\n },\n Text: {\n size: 'medium',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'medium',\n },\n} as const;\n\nconst useTrailingRestriction = (trailing: React.ReactNode): React.ReactNode => {\n const [\n validatedTrailingComponent,\n setValidatedTrailingComponent,\n ] = React.useState<React.ReactElement | null>(null);\n\n // validate and restrict sub component props in trailing prop\n React.useEffect(() => {\n if (React.isValidElement(trailing)) {\n const trailingComponentType = getComponentId(trailing) as TrailingComponents;\n const restrictedProps = propRestrictionMap[trailingComponentType];\n const allowedComponents = Object.keys(propRestrictionMap);\n if (__DEV__) {\n if (!restrictedProps) {\n throwBladeError({\n message: `Only one of \\`${allowedComponents.join(\n ', ',\n )}\\` component is accepted as trailing`,\n moduleName: 'Header',\n });\n }\n }\n\n const restrictedPropKeys = Object.keys(propRestrictionMap[trailingComponentType]);\n for (const prop of restrictedPropKeys) {\n if (trailing?.props?.hasOwnProperty(prop)) {\n logger({\n message: `Do not pass \"${prop}\" to \"${trailingComponentType}\" while inside Header trailing, because we override it.`,\n moduleName: 'Header',\n type: 'warn',\n });\n }\n }\n setValidatedTrailingComponent(\n React.cloneElement(trailing as React.ReactElement, restrictedProps),\n );\n }\n }, [trailing]);\n\n return validatedTrailingComponent;\n};\n\nconst _BaseHeader = ({\n title,\n subtitle,\n leading,\n titleSuffix,\n trailing,\n showDivider = true,\n showBackButton = false,\n showCloseButton = true,\n onBackButtonClick,\n onCloseButtonClick,\n closeButtonRef,\n backButtonRef,\n testID,\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n metaComponentName,\n children,\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction(trailing);\n const shouldWrapTitle = titleSuffix && trailing && showBackButton && showCloseButton;\n\n const webOnlyEventHandlers: Record<string, any> = isReactNative()\n ? {}\n : {\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n };\n\n return (\n <BaseBox {...metaAttribute({ name: metaComponentName, testID })}>\n <BaseBox\n marginY={{ base: 'spacing.5', m: 'spacing.6' }}\n paddingX={{ base: 'spacing.5', m: 'spacing.6' }}\n touchAction=\"none\"\n {...webOnlyEventHandlers}\n >\n <BaseBox display=\"flex\" flexDirection=\"row\" userSelect=\"none\">\n {showBackButton ? (\n <BaseBox overflow=\"visible\" marginRight=\"spacing.5\">\n <Box {...centerBoxProps}>\n <IconButton\n ref={backButtonRef}\n size=\"large\"\n icon={ChevronLeftIcon}\n onClick={() => onBackButtonClick?.()}\n accessibilityLabel=\"Back\"\n />\n </Box>\n </BaseBox>\n ) : null}\n <BaseBox\n paddingRight=\"spacing.5\"\n marginRight=\"auto\"\n flex=\"auto\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"flex-start\"\n >\n {leading ? (\n <BaseBox marginRight=\"spacing.3\" {...centerBoxProps}>\n {leading}\n </BaseBox>\n ) : null}\n <BaseBox flex=\"auto\">\n <BaseBox\n // Explicitly setting maxWidth in React Native because text is not being wrapped properly when multiple fix width components are rendered in header\n // In web, flex containers seem to work a expected\n // @todo: resolve this if we figure out some better solution later\n maxWidth={isReactNative() && shouldWrapTitle ? '100px' : undefined}\n flexShrink={0}\n display=\"flex\"\n flexDirection=\"row\"\n >\n {title ? (\n <Text\n size=\"large\"\n marginTop={makeSize(size['1'])}\n weight=\"semibold\"\n color=\"surface.text.gray.normal\"\n >\n {title}\n </Text>\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text variant=\"body\" size=\"small\" weight=\"regular\" color=\"surface.text.gray.muted\">\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n {validatedTrailingComponent ? (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps}>{validatedTrailingComponent}</Box>\n </BaseBox>\n ) : null}\n {showCloseButton ? (\n <Box {...centerBoxProps}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n </BaseBox>\n {children}\n </BaseBox>\n {showDivider ? <Divider /> : null}\n </BaseBox>\n );\n};\n\nconst BaseHeader = assignWithoutSideEffects(_BaseHeader, {\n componentId: 'BaseHeader',\n});\n\nexport type { BaseHeaderProps };\nexport { BaseHeader };\n"],"names":["centerBoxProps","display","alignItems","justifyContent","height","propRestrictionMap","Button","size","variant","Badge","Link","Text","Amount","type","useTrailingRestriction","trailing","_React$useState","React","useState","_React$useState2","_slicedToArray","validatedTrailingComponent","setValidatedTrailingComponent","useEffect","isValidElement","trailingComponentType","getComponentId","restrictedProps","allowedComponents","Object","keys","throwBladeError","message","concat","join","moduleName","restrictedPropKeys","_i","_restrictedPropKeys","length","_trailing$props","prop","props","hasOwnProperty","logger","cloneElement","_BaseHeader","_ref","title","subtitle","leading","titleSuffix","_ref$showDivider","showDivider","_ref$showBackButton","showBackButton","_ref$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","children","shouldWrapTitle","webOnlyEventHandlers","isReactNative","_jsxs","BaseBox","_objectSpread","metaAttribute","name","marginY","base","m","paddingX","touchAction","flexDirection","userSelect","_jsx","overflow","marginRight","Box","IconButton","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","undefined","flexShrink","marginTop","makeSize","weight","color","marginLeft","CloseIcon","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,IAAMA,cAAwB,GAAG;AAC/BC,EAAAA,OAAO,EAAE,MAAM;AACfC,EAAAA,UAAU,EAAE,QAAQ;AACpBC,EAAAA,cAAc,EAAE,QAAQ;AACxB;AACA;AACA;AACA;AACAC,EAAAA,MAAM,EAAE,MAAA;AACV,CAAC,CAAA;;AAED;AACA,IAAMC,kBAAkB,GAAG;AACzBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,IAAI,EAAE,QAAQ;AACdC,IAAAA,OAAO,EAAE,UAAA;GACV;AACDC,EAAAA,KAAK,EAAE;AACLF,IAAAA,IAAI,EAAE,QAAA;GACP;AACDG,EAAAA,IAAI,EAAE;AACJH,IAAAA,IAAI,EAAE,QAAA;GACP;AACDI,EAAAA,IAAI,EAAE;AACJJ,IAAAA,IAAI,EAAE,QAAQ;AACdC,IAAAA,OAAO,EAAE,MAAA;GACV;AACDI,EAAAA,MAAM,EAAE;AACNC,IAAAA,IAAI,EAAE,MAAM;AACZN,IAAAA,IAAI,EAAE,QAAA;AACR,GAAA;AACF,CAAU,CAAA;AAEV,IAAMO,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAIC,QAAyB,EAAsB;AAC7E,EAAA,IAAAC,eAAA,GAGIC,cAAK,CAACC,QAAQ,CAA4B,IAAI,CAAC;IAAAC,gBAAA,GAAAC,cAAA,CAAAJ,eAAA,EAAA,CAAA,CAAA;AAFjDK,IAAAA,0BAA0B,GAAAF,gBAAA,CAAA,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AAA,GAAA,CAC1B,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMC,UAAU,gBAAGC,wBAAwB,CAACjE,WAAW,EAAE;AACvDkE,EAAAA,WAAW,EAAE,YAAA;AACf,CAAC;;;;"}
|
|
@@ -4,6 +4,7 @@ import createStylisCSSHigherSpecificityPlugin from './stylisCSSHigherSpecificity
|
|
|
4
4
|
import { ThemeContext } from './useTheme.js';
|
|
5
5
|
import { useBladeProvider } from './useBladeProvider.js';
|
|
6
6
|
import { BottomSheetStackProvider } from '../BottomSheet/BottomSheetStack.js';
|
|
7
|
+
import { DrawerStackProvider } from '../Drawer/StackProvider.js';
|
|
7
8
|
import { jsx } from 'react/jsx-runtime';
|
|
8
9
|
|
|
9
10
|
var tooltipDelays = {
|
|
@@ -28,8 +29,10 @@ var BladeProvider = function BladeProvider(_ref) {
|
|
|
28
29
|
theme: theme,
|
|
29
30
|
children: /*#__PURE__*/jsx(StyleSheetManager, {
|
|
30
31
|
stylisPlugins: [createStylisCSSHigherSpecificityPlugin()],
|
|
31
|
-
children: /*#__PURE__*/jsx(
|
|
32
|
-
children:
|
|
32
|
+
children: /*#__PURE__*/jsx(DrawerStackProvider, {
|
|
33
|
+
children: /*#__PURE__*/jsx(BottomSheetStackProvider, {
|
|
34
|
+
children: children
|
|
35
|
+
})
|
|
33
36
|
})
|
|
34
37
|
})
|
|
35
38
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BladeProvider.web.js","sources":["../../../../../../src/components/BladeProvider/BladeProvider.web.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport {\n ThemeProvider as StyledComponentThemeProvider,\n StyleSheetManager,\n} from 'styled-components';\nimport { FloatingDelayGroup } from '@floating-ui/react';\nimport stylisCSSHigherSpecificity from './stylisCSSHigherSpecificity';\nimport { ThemeContext } from './useTheme';\nimport { useBladeProvider } from './useBladeProvider';\nimport type { BladeProviderProps } from './types';\nimport { BottomSheetStackProvider } from '~components/BottomSheet/BottomSheetStack';\n\nconst tooltipDelays = { open: 300, close: 300 };\n\nconst BladeProvider = ({\n themeTokens,\n colorScheme: initialColorScheme,\n children,\n}: BladeProviderProps): ReactElement => {\n const { theme, themeContextValue } = useBladeProvider({ initialColorScheme, themeTokens });\n\n return (\n <ThemeContext.Provider value={themeContextValue}>\n <FloatingDelayGroup delay={tooltipDelays}>\n <StyledComponentThemeProvider theme={theme}>\n <StyleSheetManager stylisPlugins={[stylisCSSHigherSpecificity()]}>\n <BottomSheetStackProvider>{children}</BottomSheetStackProvider>\n </StyleSheetManager>\n </StyledComponentThemeProvider>\n </FloatingDelayGroup>\n </ThemeContext.Provider>\n );\n};\n\nexport { BladeProvider };\n"],"names":["tooltipDelays","open","close","BladeProvider","_ref","themeTokens","initialColorScheme","colorScheme","children","_useBladeProvider","useBladeProvider","theme","themeContextValue","_jsx","ThemeContext","Provider","value","FloatingDelayGroup","delay","StyledComponentThemeProvider","StyleSheetManager","stylisPlugins","stylisCSSHigherSpecificity","BottomSheetStackProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"BladeProvider.web.js","sources":["../../../../../../src/components/BladeProvider/BladeProvider.web.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport {\n ThemeProvider as StyledComponentThemeProvider,\n StyleSheetManager,\n} from 'styled-components';\nimport { FloatingDelayGroup } from '@floating-ui/react';\nimport stylisCSSHigherSpecificity from './stylisCSSHigherSpecificity';\nimport { ThemeContext } from './useTheme';\nimport { useBladeProvider } from './useBladeProvider';\nimport type { BladeProviderProps } from './types';\nimport { BottomSheetStackProvider } from '~components/BottomSheet/BottomSheetStack';\nimport { DrawerStackProvider } from '~components/Drawer/StackProvider';\n\nconst tooltipDelays = { open: 300, close: 300 };\n\nconst BladeProvider = ({\n themeTokens,\n colorScheme: initialColorScheme,\n children,\n}: BladeProviderProps): ReactElement => {\n const { theme, themeContextValue } = useBladeProvider({ initialColorScheme, themeTokens });\n\n return (\n <ThemeContext.Provider value={themeContextValue}>\n <FloatingDelayGroup delay={tooltipDelays}>\n <StyledComponentThemeProvider theme={theme}>\n <StyleSheetManager stylisPlugins={[stylisCSSHigherSpecificity()]}>\n {/* \n If you want to add a new provider for keeping track of stack in component,\n You can move DrawerStackProvider to common utils and rename to GlobalStackProvider\n and reuse it for your component.\n */}\n <DrawerStackProvider>\n <BottomSheetStackProvider>{children}</BottomSheetStackProvider>\n </DrawerStackProvider>\n </StyleSheetManager>\n </StyledComponentThemeProvider>\n </FloatingDelayGroup>\n </ThemeContext.Provider>\n );\n};\n\nexport { BladeProvider };\n"],"names":["tooltipDelays","open","close","BladeProvider","_ref","themeTokens","initialColorScheme","colorScheme","children","_useBladeProvider","useBladeProvider","theme","themeContextValue","_jsx","ThemeContext","Provider","value","FloatingDelayGroup","delay","StyledComponentThemeProvider","StyleSheetManager","stylisPlugins","stylisCSSHigherSpecificity","DrawerStackProvider","BottomSheetStackProvider"],"mappings":";;;;;;;;;AAaA,IAAMA,aAAa,GAAG;AAAEC,EAAAA,IAAI,EAAE,GAAG;AAAEC,EAAAA,KAAK,EAAE,GAAA;AAAI,CAAC,CAAA;AAE/C,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAIqB;AAAA,EAAA,IAHtCC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IACEC,kBAAkB,GAAAF,IAAA,CAA/BG,WAAW;IACXC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ,CAAA;EAER,IAAAC,iBAAA,GAAqCC,gBAAgB,CAAC;AAAEJ,MAAAA,kBAAkB,EAAlBA,kBAAkB;AAAED,MAAAA,WAAW,EAAXA,WAAAA;AAAY,KAAC,CAAC;IAAlFM,KAAK,GAAAF,iBAAA,CAALE,KAAK;IAAEC,iBAAiB,GAAAH,iBAAA,CAAjBG,iBAAiB,CAAA;AAEhC,EAAA,oBACEC,GAAA,CAACC,YAAY,CAACC,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEJ,iBAAkB;IAAAJ,QAAA,eAC9CK,GAAA,CAACI,kBAAkB,EAAA;AAACC,MAAAA,KAAK,EAAElB,aAAc;MAAAQ,QAAA,eACvCK,GAAA,CAACM,aAA4B,EAAA;AAACR,QAAAA,KAAK,EAAEA,KAAM;QAAAH,QAAA,eACzCK,GAAA,CAACO,iBAAiB,EAAA;AAACC,UAAAA,aAAa,EAAE,CAACC,sCAA0B,EAAE,CAAE;UAAAd,QAAA,eAM/DK,GAAA,CAACU,mBAAmB,EAAA;YAAAf,QAAA,eAClBK,GAAA,CAACW,wBAAwB,EAAA;AAAAhB,cAAAA,QAAA,EAAEA,QAAAA;aAAmC,CAAA;WAC3C,CAAA;SACJ,CAAA;OACS,CAAA;KACZ,CAAA;AAAC,GACA,CAAC,CAAA;AAE5B;;;;"}
|
|
@@ -26,6 +26,7 @@ import '../../utils/makeSize/index.js';
|
|
|
26
26
|
import '../../utils/makeAccessible/index.js';
|
|
27
27
|
import '../../tokens/global/index.js';
|
|
28
28
|
import '../../utils/makeMotionTime/index.web.js';
|
|
29
|
+
import { componentZIndices } from '../../utils/componentZIndices.js';
|
|
29
30
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
30
31
|
import { makeSize } from '../../utils/makeSize/makeSize.js';
|
|
31
32
|
import { size } from '../../tokens/global/size.js';
|
|
@@ -81,7 +82,7 @@ var _BottomSheet = function _BottomSheet(_ref2) {
|
|
|
81
82
|
_ref2$snapPoints = _ref2.snapPoints,
|
|
82
83
|
snapPoints = _ref2$snapPoints === void 0 ? [0.35, 0.5, 0.85] : _ref2$snapPoints,
|
|
83
84
|
_ref2$zIndex = _ref2.zIndex,
|
|
84
|
-
zIndex = _ref2$zIndex === void 0 ?
|
|
85
|
+
zIndex = _ref2$zIndex === void 0 ? componentZIndices.bottomSheet : _ref2$zIndex;
|
|
85
86
|
var _useTheme = useTheme(),
|
|
86
87
|
theme = _useTheme.theme;
|
|
87
88
|
var dimensions = useWindowSize();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.web.js","sources":["../../../../../../src/components/BottomSheet/BottomSheet.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/jsx-no-useless-fragment */\n/* eslint-disable consistent-return */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport styled from 'styled-components';\nimport { rubberbandIfOutOfBounds, useDrag } from '@use-gesture/react';\nimport usePresence from 'use-presence';\nimport { clearAllBodyScrollLocks } from 'body-scroll-lock-upgrade';\nimport { BottomSheetHeader } from './BottomSheetHeader';\nimport { BottomSheetFooter } from './BottomSheetFooter';\nimport { BottomSheetBody } from './BottomSheetBody';\nimport type { SnapPoints } from './utils';\nimport { computeMaxContent, computeSnapPointBounds } from './utils';\nimport { BottomSheetBackdrop } from './BottomSheetBackdrop';\nimport type { BottomSheetContextProps } from './BottomSheetContext';\nimport { BottomSheetContext, useBottomSheetAndDropdownGlue } from './BottomSheetContext';\nimport { ComponentIds } from './componentIds';\nimport type { BottomSheetProps } from './types';\nimport { BottomSheetGrabHandle } from './BottomSheetGrabHandle';\nimport { useBottomSheetStack } from './BottomSheetStack';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useScrollLock } from '~utils/useScrollLock';\nimport { useWindowSize } from '~utils/useWindowSize';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { useTheme } from '~components/BladeProvider';\nimport { useId } from '~utils/useId';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { size } from '~tokens/global';\nimport { makeMotionTime } from '~utils/makeMotionTime';\n\nexport const BOTTOM_SHEET_EASING = 'cubic-bezier(.15,0,.24,.97)';\nconst AUTOCOMPLETE_DEFAULT_SNAPPOINT = 0.85;\n\nconst BottomSheetSurface = styled.div<{\n windowHeight: number;\n isDragging: boolean;\n}>(({ theme, windowHeight, isDragging }) => {\n return {\n background: theme.colors.popup.background.subtle,\n borderTopLeftRadius: makeSize(size[16]),\n borderTopRightRadius: makeSize(size[16]),\n borderColor: theme.colors.popup.border.subtle,\n // this is reverse top elevation of highRaised elevation token\n boxShadow: '0px -24px 48px -12px hsla(217, 56%, 17%, 0.18)',\n opacity: 0,\n pointerEvents: 'none',\n transitionDuration: isDragging\n ? undefined\n : `${makeMotionTime(theme.motion.duration.moderate)}`,\n transitionTimingFunction: BOTTOM_SHEET_EASING,\n willChange: 'transform, opacity, height',\n transitionProperty: 'transform, opacity, height',\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 0,\n top: windowHeight,\n backgroundColor: theme.colors.popup.background.subtle,\n justifyContent: 'center',\n alignItems: 'center',\n touchAction: 'none',\n overflow: 'hidden',\n };\n});\n\nconst _BottomSheet = ({\n isOpen,\n onDismiss,\n children,\n initialFocusRef,\n snapPoints = [0.35, 0.5, 0.85],\n zIndex = 100,\n}: BottomSheetProps): React.ReactElement => {\n const { theme } = useTheme();\n const dimensions = useWindowSize();\n const [contentHeight, setContentHeight] = React.useState(0);\n const [headerHeight, setHeaderHeight] = React.useState(0);\n const [footerHeight, setFooterHeight] = React.useState(0);\n const [grabHandleHeight, setGrabHandleHeight] = React.useState(0);\n const [hasBodyPadding, setHasBodyPadding] = React.useState(true);\n const [isHeaderEmpty, setIsHeaderEmpty] = React.useState(false);\n\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n const [positionY, _setPositionY] = React.useState(0);\n const _isOpen = isOpen ?? bottomSheetAndDropdownGlue?.isOpen;\n const [isDragging, setIsDragging] = React.useState(false);\n\n const preventScrollingRef = React.useRef(true);\n const scrollRef = React.useRef<HTMLDivElement>(null);\n const grabHandleRef = React.useRef<HTMLDivElement>(null);\n const defaultInitialFocusRef = React.useRef<any>(null);\n const originalFocusElement = React.useRef<HTMLElement | null>(null);\n const initialSnapPoint = React.useRef<number>(snapPoints[1]);\n const totalHeight = React.useMemo(() => {\n return grabHandleHeight + headerHeight + footerHeight + contentHeight;\n }, [contentHeight, footerHeight, grabHandleHeight, headerHeight]);\n\n const id = useId();\n const {\n stack,\n addBottomSheetToStack,\n removeBottomSheetFromStack,\n getTopOfTheStack,\n getCurrentStackIndexById,\n } = useBottomSheetStack();\n const currentStackIndex = getCurrentStackIndexById(id);\n const isOnTopOfStack = getTopOfTheStack() === id;\n const bottomSheetZIndex = zIndex - currentStackIndex;\n\n const setPositionY = React.useCallback(\n (value: number, limit = true) => {\n // In AutoComplete, we want BottomSheet to be docked to top snappoint so we remove the limits\n const shouldLimitPositionY =\n limit && !bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader;\n\n const maxValue = computeMaxContent({\n contentHeight,\n footerHeight,\n headerHeight: headerHeight + grabHandleHeight,\n maxHeight: value,\n });\n _setPositionY(shouldLimitPositionY ? maxValue : value);\n },\n [\n bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader,\n contentHeight,\n footerHeight,\n grabHandleHeight,\n headerHeight,\n ],\n );\n\n // locks the body scroll to prevent accidental scrolling of content when we drag the sheet\n // We are ready when we calculated the height of the content\n const isReady = contentHeight > 0;\n // only lock the body when we atleast have 1 bottomsheet open\n const shouldLock = isReady && stack.length > 0;\n const scrollLockRef = useScrollLock({\n enabled: shouldLock,\n targetRef: scrollRef,\n reserveScrollBarGap: true,\n });\n\n // clear all body locks to avoid memory leaks & accidental body locking\n React.useEffect(() => {\n const hasNoBottomSheets = stack.length < 1;\n if (hasNoBottomSheets) {\n clearAllBodyScrollLocks();\n }\n }, [stack]);\n\n // take the grabHandle's height into headerHeight too\n useIsomorphicLayoutEffect(() => {\n if (!grabHandleRef.current) return;\n setGrabHandleHeight(grabHandleRef.current.getBoundingClientRect().height);\n }, [grabHandleRef.current, _isOpen]);\n\n // if bottomSheet height is >35% & <50% then set initial snapPoint to 35%\n useIsomorphicLayoutEffect(() => {\n if (bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader) {\n initialSnapPoint.current = AUTOCOMPLETE_DEFAULT_SNAPPOINT;\n } else {\n const middleSnapPoint = snapPoints[1] * dimensions.height;\n const lowerSnapPoint = snapPoints[0] * dimensions.height;\n if (totalHeight > lowerSnapPoint && totalHeight < middleSnapPoint) {\n initialSnapPoint.current = snapPoints[0];\n }\n }\n }, [dimensions.height, snapPoints, totalHeight]);\n\n const returnFocus = React.useCallback(() => {\n if (!originalFocusElement.current) return;\n originalFocusElement.current.focus();\n // After returning focus we will clear the original focus\n // Because if sheet can be opened up via multiple triggers\n // We want to ensure the focus returns back to the most recent triggerer\n originalFocusElement.current = null;\n }, [originalFocusElement]);\n\n const focusOnInitialRef = React.useCallback(() => {\n if (!initialFocusRef) {\n // focus on close button\n defaultInitialFocusRef.current?.focus();\n } else {\n // focus on the initialRef passed by the user\n initialFocusRef.current?.focus();\n }\n }, [initialFocusRef]);\n\n const handleOnOpen = React.useCallback(() => {\n setPositionY(dimensions.height * initialSnapPoint.current);\n scrollLockRef.current.activate();\n // initialize the original focused element\n // On first render it will be the activeElement, eg: the button trigger or select input\n // On Subsequent open operations it won't further update the original focus\n originalFocusElement.current =\n originalFocusElement.current ?? (document.activeElement as HTMLElement);\n focusOnInitialRef();\n }, [dimensions.height, focusOnInitialRef, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n onDismiss?.();\n bottomSheetAndDropdownGlue?.onBottomSheetDismiss();\n returnFocus();\n }, [bottomSheetAndDropdownGlue, onDismiss, returnFocus]);\n\n // sync controlled state to our actions\n React.useEffect(() => {\n if (_isOpen) {\n // open on the next frame, otherwise the animations will not run on first render\n window.setTimeout(() => {\n handleOnOpen();\n });\n } else {\n handleOnClose();\n }\n }, [_isOpen, handleOnClose, handleOnOpen]);\n\n // let the Dropdown component know that it's rendering a bottomsheet\n React.useEffect(() => {\n if (!bottomSheetAndDropdownGlue) return;\n bottomSheetAndDropdownGlue.setDropdownHasBottomSheet(true);\n }, [bottomSheetAndDropdownGlue]);\n\n const bind = useDrag(\n ({\n active,\n last,\n cancel,\n tap,\n movement: [_movementX, movementY],\n velocity: [_velocityX, velocityY],\n lastOffset: [_, lastOffsetY],\n down,\n dragging,\n args: [{ isContentDragging = false } = {}] = [],\n }) => {\n setIsDragging(Boolean(dragging));\n // lastOffsetY is the previous position user stopped dragging the sheet\n // movementY is the drag amount from the bottom of the screen, so as you drag up the movementY goes into negatives\n // and rawY is the calculated offset from the last position of the bottomsheet to current drag amount.\n const rawY = lastOffsetY - movementY;\n\n const lowerSnapPoint = dimensions.height * snapPoints[0];\n const upperSnapPoint = dimensions.height * snapPoints[snapPoints.length - 1];\n\n // predictedY is used to create velocity driven swipe\n // the faster you swipe the more distance you cover\n // this enables users to reach upper & lower snappoint with a single swipe\n const predictedDistance = movementY * (velocityY / 2);\n const predictedY = Math.max(\n lowerSnapPoint,\n Math.min(upperSnapPoint, rawY - predictedDistance * 2),\n );\n\n let newY = rawY;\n\n if (down) {\n // Ensure that users aren't able to drag the sheet\n // more than the upperSnapPoint or maximum height of the sheet\n // this is basically a clamp() function but creates a nice rubberband effect\n const dampening = 0.55;\n if (totalHeight < upperSnapPoint) {\n newY = rubberbandIfOutOfBounds(rawY, 0, totalHeight, dampening);\n } else {\n newY = rubberbandIfOutOfBounds(rawY, 0, upperSnapPoint, dampening);\n }\n } else {\n newY = predictedY;\n }\n\n const isPosAtUpperSnapPoint = newY >= upperSnapPoint;\n\n if (isContentDragging) {\n if (isPosAtUpperSnapPoint) {\n newY = upperSnapPoint;\n }\n\n // keep the newY at upper snap point\n // until the scrollable content is not at top\n // and previously saved Y position is greater than or equal to upper snap point\n // Note: how using newY won't work here since we need the previous value of the newY\n // since we always keep updating the newY,\n // this is cruicial in making the scroll feel natural\n const isContentScrolledAtTop = scrollRef.current && scrollRef.current.scrollTop <= 0;\n if (lastOffsetY === upperSnapPoint && !isContentScrolledAtTop) {\n newY = upperSnapPoint;\n }\n preventScrollingRef.current = newY < upperSnapPoint;\n }\n\n if (last) {\n // calculate the nearest snapPoint\n const [nearest, lower] = computeSnapPointBounds(\n newY,\n snapPoints.map((point) => dimensions.height * point) as SnapPoints,\n );\n\n // This ensure that the lower snapPoint will always have atleast some buffer\n // When the bottomsheet total height is less than the lower snapPoint\n // Video walkthrough: https://www.loom.com/share/a9a8db7688d64194b13df8b3e25859ae\n const lowerPointBuffer = 60;\n const lowerestSnap = Math.min(lower, totalHeight) - lowerPointBuffer;\n\n const shouldClose = rawY < lowerestSnap;\n if (shouldClose) {\n setIsDragging(false);\n cancel();\n close();\n return;\n }\n\n // if we stop dragging assign snap to the nearest point\n if (!active && !tap) {\n newY = nearest;\n }\n }\n\n setPositionY(newY, !down);\n },\n {\n from: [0, positionY],\n filterTaps: true,\n enabled: isOnTopOfStack && _isOpen,\n },\n );\n\n // Here we are preventing the scrolling of the content, until the preventScrollingRef value is true\n useIsomorphicLayoutEffect(() => {\n const scrollElement = scrollRef.current;\n if (!scrollElement) return;\n\n const preventScrolling = (e: Event) => {\n if (preventScrollingRef?.current) {\n e.preventDefault();\n }\n };\n\n // https://www.bram.us/2016/05/02/prevent-overscroll-bounce-in-ios-mobilesafari-pure-css/\n const preventSafariOverscroll = (e: Event) => {\n if (scrollElement.scrollTop < 0) {\n // TODO: figure this out, it doesn't seem to work >iOS12\n // requestAnimationFrame(() => {\n // elem.style.overflow = 'hidden';\n // elem.scrollTop = 0;\n // elem.style.removeProperty('overflow');\n // });\n e.preventDefault();\n }\n };\n\n scrollElement.addEventListener('scroll', preventScrolling);\n scrollElement.addEventListener('touchmove', preventScrolling);\n scrollElement.addEventListener('touchstart', preventSafariOverscroll);\n return () => {\n scrollElement.removeEventListener('scroll', preventScrolling);\n scrollElement.removeEventListener('touchmove', preventScrolling);\n scrollElement.removeEventListener('touchstart', preventSafariOverscroll);\n };\n // Only run this hook when we know all the layout calculations are done,\n // Otherwise the scrollRef.current will be null.\n // isReady prop will ensure that we are done measuring the content height\n }, [isReady]);\n\n // usePresence hook waits for the animation to finish before unmounting the component\n // It's similar to framer-motions usePresence hook\n // https://www.framer.com/docs/animate-presence/#usepresence\n const { isMounted, isVisible } = usePresence(Boolean(_isOpen), {\n transitionDuration: theme.motion.duration.moderate,\n });\n\n const isHeaderFloating = !hasBodyPadding && isHeaderEmpty;\n const contextValue: BottomSheetContextProps = React.useMemo(\n () => ({\n isInBottomSheet: true,\n isOpen: Boolean(isVisible),\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n }),\n [\n isVisible,\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n ],\n );\n\n React.useEffect(() => {\n if (isMounted) {\n addBottomSheetToStack(id);\n } else {\n removeBottomSheetFromStack(id);\n }\n }, [addBottomSheetToStack, id, isMounted, removeBottomSheetFromStack]);\n\n // We will need to reset these values otherwise the next time the bottomsheet opens\n // this will be populated and the animations won't run\n // why?: because how the usePresence hook works, we actually just unmount the\n // html contents not the whole <BottomSheet /> react component\n React.useEffect(() => {\n if (!isMounted) {\n setHeaderHeight(0);\n setFooterHeight(0);\n setContentHeight(0);\n setGrabHandleHeight(0);\n _setPositionY(0);\n }\n }, [isMounted, scrollLockRef]);\n\n // We don't want to destroy the react tree when we are rendering inside Dropdown\n // Because if we bail out early then ActionList won't render,\n // and Dropdown manages it's state based on the rendered JSX of ActionList\n // If we don't render ActionList Dropdown state will reset each time we open/close BottomSheet\n const isInsideDropdown = Boolean(bottomSheetAndDropdownGlue);\n if (!isMounted && !isInsideDropdown) {\n return <></>;\n }\n\n return (\n <BottomSheetContext.Provider value={contextValue}>\n <BottomSheetBackdrop zIndex={bottomSheetZIndex} />\n <BottomSheetSurface\n {...metaAttribute({\n name: MetaConstants.BottomSheet,\n testID: 'bottomsheet-surface',\n })}\n {...makeAccessible({ modal: true, role: 'dialog' })}\n windowHeight={dimensions.height}\n isDragging={isDragging}\n style={{\n opacity: isVisible ? 1 : 0,\n pointerEvents: isVisible ? 'all' : 'none',\n height: positionY,\n bottom: 0,\n top: 'auto',\n zIndex: bottomSheetZIndex,\n }}\n >\n <BaseBox height=\"100%\" display=\"flex\" flexDirection=\"column\">\n <BottomSheetGrabHandle\n ref={grabHandleRef}\n isHeaderFloating={isHeaderFloating}\n {...metaAttribute({ name: ComponentIds.BottomSheetGrabHandle })}\n {...bind()}\n />\n {children}\n </BaseBox>\n </BottomSheetSurface>\n </BottomSheetContext.Provider>\n );\n};\n\nconst BottomSheet = assignWithoutSideEffects(_BottomSheet, {\n componentId: ComponentIds.BottomSheet,\n});\n\nexport { BottomSheet, BottomSheetBody, BottomSheetHeader, BottomSheetFooter };\nexport type { BottomSheetProps };\n"],"names":["BOTTOM_SHEET_EASING","AUTOCOMPLETE_DEFAULT_SNAPPOINT","BottomSheetSurface","styled","div","withConfig","displayName","componentId","_ref","theme","windowHeight","isDragging","background","colors","popup","subtle","borderTopLeftRadius","makeSize","size","borderTopRightRadius","borderColor","border","boxShadow","opacity","pointerEvents","transitionDuration","undefined","concat","makeMotionTime","motion","duration","moderate","transitionTimingFunction","willChange","transitionProperty","position","left","right","bottom","top","backgroundColor","justifyContent","alignItems","touchAction","overflow","_BottomSheet","_ref2","isOpen","onDismiss","children","initialFocusRef","_ref2$snapPoints","snapPoints","_ref2$zIndex","zIndex","_useTheme","useTheme","dimensions","useWindowSize","_React$useState","React","useState","_React$useState2","_slicedToArray","contentHeight","setContentHeight","_React$useState3","_React$useState4","headerHeight","setHeaderHeight","_React$useState5","_React$useState6","footerHeight","setFooterHeight","_React$useState7","_React$useState8","grabHandleHeight","setGrabHandleHeight","_React$useState9","_React$useState10","hasBodyPadding","setHasBodyPadding","_React$useState11","_React$useState12","isHeaderEmpty","setIsHeaderEmpty","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","_React$useState13","_React$useState14","positionY","_setPositionY","_isOpen","_React$useState15","_React$useState16","setIsDragging","preventScrollingRef","useRef","scrollRef","grabHandleRef","defaultInitialFocusRef","originalFocusElement","initialSnapPoint","totalHeight","useMemo","id","useId","_useBottomSheetStack","useBottomSheetStack","stack","addBottomSheetToStack","removeBottomSheetFromStack","getTopOfTheStack","getCurrentStackIndexById","currentStackIndex","isOnTopOfStack","bottomSheetZIndex","setPositionY","useCallback","value","limit","arguments","length","shouldLimitPositionY","hasAutoCompleteInBottomSheetHeader","maxValue","computeMaxContent","maxHeight","isReady","shouldLock","scrollLockRef","useScrollLock","enabled","targetRef","reserveScrollBarGap","useEffect","hasNoBottomSheets","clearAllBodyScrollLocks","useIsomorphicLayoutEffect","current","getBoundingClientRect","height","middleSnapPoint","lowerSnapPoint","returnFocus","focus","focusOnInitialRef","_defaultInitialFocusR","_initialFocusRef$curr","handleOnOpen","_originalFocusElement","activate","document","activeElement","handleOnClose","close","onBottomSheetDismiss","window","setTimeout","setDropdownHasBottomSheet","bind","useDrag","_ref3","active","last","cancel","tap","_ref3$movement","movement","_movementX","movementY","_ref3$velocity","velocity","_velocityX","velocityY","_ref3$lastOffset","lastOffset","_","lastOffsetY","down","dragging","_ref3$args","args","_ref3$args2","_ref3$args3","_ref3$args3$","_ref3$args3$2","_ref3$args3$2$isConte","isContentDragging","Boolean","rawY","upperSnapPoint","predictedDistance","predictedY","Math","max","min","newY","dampening","rubberbandIfOutOfBounds","isPosAtUpperSnapPoint","isContentScrolledAtTop","scrollTop","_computeSnapPointBoun","computeSnapPointBounds","map","point","_computeSnapPointBoun2","nearest","lower","lowerPointBuffer","lowerestSnap","shouldClose","from","filterTaps","scrollElement","preventScrolling","e","preventDefault","preventSafariOverscroll","addEventListener","removeEventListener","_usePresence","usePresence","isMounted","isVisible","isHeaderFloating","contextValue","isInBottomSheet","isInsideDropdown","_jsx","_Fragment","_jsxs","BottomSheetContext","Provider","BottomSheetBackdrop","_objectSpread","metaAttribute","name","MetaConstants","BottomSheet","testID","makeAccessible","modal","role","style","BaseBox","display","flexDirection","BottomSheetGrabHandle","ref","ComponentIds","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,IAAMA,mBAAmB,GAAG,8BAA6B;AAChE,IAAMC,8BAA8B,GAAG,IAAI,CAAA;AAE3C,IAAMC,kBAAkB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAGlC,CAAA,CAAA,UAAAC,IAAA,EAAyC;AAAA,EAAA,IAAtCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU,CAAA;EACnC,OAAO;IACLC,UAAU,EAAEH,KAAK,CAACI,MAAM,CAACC,KAAK,CAACF,UAAU,CAACG,MAAM;AAChDC,IAAAA,mBAAmB,EAAEC,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvCC,IAAAA,oBAAoB,EAAEF,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxCE,WAAW,EAAEX,KAAK,CAACI,MAAM,CAACC,KAAK,CAACO,MAAM,CAACN,MAAM;AAC7C;AACAO,IAAAA,SAAS,EAAE,gDAAgD;AAC3DC,IAAAA,OAAO,EAAE,CAAC;AACVC,IAAAA,aAAa,EAAE,MAAM;AACrBC,IAAAA,kBAAkB,EAAEd,UAAU,GAC1Be,SAAS,GAAA,EAAA,CAAAC,MAAA,CACNC,cAAc,CAACnB,KAAK,CAACoB,MAAM,CAACC,QAAQ,CAACC,QAAQ,CAAC,CAAE;AACvDC,IAAAA,wBAAwB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../../../src/components/BottomSheet/BottomSheet.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/jsx-no-useless-fragment */\n/* eslint-disable consistent-return */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport styled from 'styled-components';\nimport { rubberbandIfOutOfBounds, useDrag } from '@use-gesture/react';\nimport usePresence from 'use-presence';\nimport { clearAllBodyScrollLocks } from 'body-scroll-lock-upgrade';\nimport { BottomSheetHeader } from './BottomSheetHeader';\nimport { BottomSheetFooter } from './BottomSheetFooter';\nimport { BottomSheetBody } from './BottomSheetBody';\nimport type { SnapPoints } from './utils';\nimport { computeMaxContent, computeSnapPointBounds } from './utils';\nimport { BottomSheetBackdrop } from './BottomSheetBackdrop';\nimport type { BottomSheetContextProps } from './BottomSheetContext';\nimport { BottomSheetContext, useBottomSheetAndDropdownGlue } from './BottomSheetContext';\nimport { ComponentIds } from './componentIds';\nimport type { BottomSheetProps } from './types';\nimport { BottomSheetGrabHandle } from './BottomSheetGrabHandle';\nimport { useBottomSheetStack } from './BottomSheetStack';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useScrollLock } from '~utils/useScrollLock';\nimport { useWindowSize } from '~utils/useWindowSize';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { useTheme } from '~components/BladeProvider';\nimport { useId } from '~utils/useId';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { size } from '~tokens/global';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport { componentZIndices } from '~utils/componentZIndices';\n\nexport const BOTTOM_SHEET_EASING = 'cubic-bezier(.15,0,.24,.97)';\nconst AUTOCOMPLETE_DEFAULT_SNAPPOINT = 0.85;\n\nconst BottomSheetSurface = styled.div<{\n windowHeight: number;\n isDragging: boolean;\n}>(({ theme, windowHeight, isDragging }) => {\n return {\n background: theme.colors.popup.background.subtle,\n borderTopLeftRadius: makeSize(size[16]),\n borderTopRightRadius: makeSize(size[16]),\n borderColor: theme.colors.popup.border.subtle,\n // this is reverse top elevation of highRaised elevation token\n boxShadow: '0px -24px 48px -12px hsla(217, 56%, 17%, 0.18)',\n opacity: 0,\n pointerEvents: 'none',\n transitionDuration: isDragging\n ? undefined\n : `${makeMotionTime(theme.motion.duration.moderate)}`,\n transitionTimingFunction: BOTTOM_SHEET_EASING,\n willChange: 'transform, opacity, height',\n transitionProperty: 'transform, opacity, height',\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 0,\n top: windowHeight,\n backgroundColor: theme.colors.popup.background.subtle,\n justifyContent: 'center',\n alignItems: 'center',\n touchAction: 'none',\n overflow: 'hidden',\n };\n});\n\nconst _BottomSheet = ({\n isOpen,\n onDismiss,\n children,\n initialFocusRef,\n snapPoints = [0.35, 0.5, 0.85],\n zIndex = componentZIndices.bottomSheet,\n}: BottomSheetProps): React.ReactElement => {\n const { theme } = useTheme();\n const dimensions = useWindowSize();\n const [contentHeight, setContentHeight] = React.useState(0);\n const [headerHeight, setHeaderHeight] = React.useState(0);\n const [footerHeight, setFooterHeight] = React.useState(0);\n const [grabHandleHeight, setGrabHandleHeight] = React.useState(0);\n const [hasBodyPadding, setHasBodyPadding] = React.useState(true);\n const [isHeaderEmpty, setIsHeaderEmpty] = React.useState(false);\n\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n const [positionY, _setPositionY] = React.useState(0);\n const _isOpen = isOpen ?? bottomSheetAndDropdownGlue?.isOpen;\n const [isDragging, setIsDragging] = React.useState(false);\n\n const preventScrollingRef = React.useRef(true);\n const scrollRef = React.useRef<HTMLDivElement>(null);\n const grabHandleRef = React.useRef<HTMLDivElement>(null);\n const defaultInitialFocusRef = React.useRef<any>(null);\n const originalFocusElement = React.useRef<HTMLElement | null>(null);\n const initialSnapPoint = React.useRef<number>(snapPoints[1]);\n const totalHeight = React.useMemo(() => {\n return grabHandleHeight + headerHeight + footerHeight + contentHeight;\n }, [contentHeight, footerHeight, grabHandleHeight, headerHeight]);\n\n const id = useId();\n const {\n stack,\n addBottomSheetToStack,\n removeBottomSheetFromStack,\n getTopOfTheStack,\n getCurrentStackIndexById,\n } = useBottomSheetStack();\n const currentStackIndex = getCurrentStackIndexById(id);\n const isOnTopOfStack = getTopOfTheStack() === id;\n const bottomSheetZIndex = zIndex - currentStackIndex;\n\n const setPositionY = React.useCallback(\n (value: number, limit = true) => {\n // In AutoComplete, we want BottomSheet to be docked to top snappoint so we remove the limits\n const shouldLimitPositionY =\n limit && !bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader;\n\n const maxValue = computeMaxContent({\n contentHeight,\n footerHeight,\n headerHeight: headerHeight + grabHandleHeight,\n maxHeight: value,\n });\n _setPositionY(shouldLimitPositionY ? maxValue : value);\n },\n [\n bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader,\n contentHeight,\n footerHeight,\n grabHandleHeight,\n headerHeight,\n ],\n );\n\n // locks the body scroll to prevent accidental scrolling of content when we drag the sheet\n // We are ready when we calculated the height of the content\n const isReady = contentHeight > 0;\n // only lock the body when we atleast have 1 bottomsheet open\n const shouldLock = isReady && stack.length > 0;\n const scrollLockRef = useScrollLock({\n enabled: shouldLock,\n targetRef: scrollRef,\n reserveScrollBarGap: true,\n });\n\n // clear all body locks to avoid memory leaks & accidental body locking\n React.useEffect(() => {\n const hasNoBottomSheets = stack.length < 1;\n if (hasNoBottomSheets) {\n clearAllBodyScrollLocks();\n }\n }, [stack]);\n\n // take the grabHandle's height into headerHeight too\n useIsomorphicLayoutEffect(() => {\n if (!grabHandleRef.current) return;\n setGrabHandleHeight(grabHandleRef.current.getBoundingClientRect().height);\n }, [grabHandleRef.current, _isOpen]);\n\n // if bottomSheet height is >35% & <50% then set initial snapPoint to 35%\n useIsomorphicLayoutEffect(() => {\n if (bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader) {\n initialSnapPoint.current = AUTOCOMPLETE_DEFAULT_SNAPPOINT;\n } else {\n const middleSnapPoint = snapPoints[1] * dimensions.height;\n const lowerSnapPoint = snapPoints[0] * dimensions.height;\n if (totalHeight > lowerSnapPoint && totalHeight < middleSnapPoint) {\n initialSnapPoint.current = snapPoints[0];\n }\n }\n }, [dimensions.height, snapPoints, totalHeight]);\n\n const returnFocus = React.useCallback(() => {\n if (!originalFocusElement.current) return;\n originalFocusElement.current.focus();\n // After returning focus we will clear the original focus\n // Because if sheet can be opened up via multiple triggers\n // We want to ensure the focus returns back to the most recent triggerer\n originalFocusElement.current = null;\n }, [originalFocusElement]);\n\n const focusOnInitialRef = React.useCallback(() => {\n if (!initialFocusRef) {\n // focus on close button\n defaultInitialFocusRef.current?.focus();\n } else {\n // focus on the initialRef passed by the user\n initialFocusRef.current?.focus();\n }\n }, [initialFocusRef]);\n\n const handleOnOpen = React.useCallback(() => {\n setPositionY(dimensions.height * initialSnapPoint.current);\n scrollLockRef.current.activate();\n // initialize the original focused element\n // On first render it will be the activeElement, eg: the button trigger or select input\n // On Subsequent open operations it won't further update the original focus\n originalFocusElement.current =\n originalFocusElement.current ?? (document.activeElement as HTMLElement);\n focusOnInitialRef();\n }, [dimensions.height, focusOnInitialRef, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n onDismiss?.();\n bottomSheetAndDropdownGlue?.onBottomSheetDismiss();\n returnFocus();\n }, [bottomSheetAndDropdownGlue, onDismiss, returnFocus]);\n\n // sync controlled state to our actions\n React.useEffect(() => {\n if (_isOpen) {\n // open on the next frame, otherwise the animations will not run on first render\n window.setTimeout(() => {\n handleOnOpen();\n });\n } else {\n handleOnClose();\n }\n }, [_isOpen, handleOnClose, handleOnOpen]);\n\n // let the Dropdown component know that it's rendering a bottomsheet\n React.useEffect(() => {\n if (!bottomSheetAndDropdownGlue) return;\n bottomSheetAndDropdownGlue.setDropdownHasBottomSheet(true);\n }, [bottomSheetAndDropdownGlue]);\n\n const bind = useDrag(\n ({\n active,\n last,\n cancel,\n tap,\n movement: [_movementX, movementY],\n velocity: [_velocityX, velocityY],\n lastOffset: [_, lastOffsetY],\n down,\n dragging,\n args: [{ isContentDragging = false } = {}] = [],\n }) => {\n setIsDragging(Boolean(dragging));\n // lastOffsetY is the previous position user stopped dragging the sheet\n // movementY is the drag amount from the bottom of the screen, so as you drag up the movementY goes into negatives\n // and rawY is the calculated offset from the last position of the bottomsheet to current drag amount.\n const rawY = lastOffsetY - movementY;\n\n const lowerSnapPoint = dimensions.height * snapPoints[0];\n const upperSnapPoint = dimensions.height * snapPoints[snapPoints.length - 1];\n\n // predictedY is used to create velocity driven swipe\n // the faster you swipe the more distance you cover\n // this enables users to reach upper & lower snappoint with a single swipe\n const predictedDistance = movementY * (velocityY / 2);\n const predictedY = Math.max(\n lowerSnapPoint,\n Math.min(upperSnapPoint, rawY - predictedDistance * 2),\n );\n\n let newY = rawY;\n\n if (down) {\n // Ensure that users aren't able to drag the sheet\n // more than the upperSnapPoint or maximum height of the sheet\n // this is basically a clamp() function but creates a nice rubberband effect\n const dampening = 0.55;\n if (totalHeight < upperSnapPoint) {\n newY = rubberbandIfOutOfBounds(rawY, 0, totalHeight, dampening);\n } else {\n newY = rubberbandIfOutOfBounds(rawY, 0, upperSnapPoint, dampening);\n }\n } else {\n newY = predictedY;\n }\n\n const isPosAtUpperSnapPoint = newY >= upperSnapPoint;\n\n if (isContentDragging) {\n if (isPosAtUpperSnapPoint) {\n newY = upperSnapPoint;\n }\n\n // keep the newY at upper snap point\n // until the scrollable content is not at top\n // and previously saved Y position is greater than or equal to upper snap point\n // Note: how using newY won't work here since we need the previous value of the newY\n // since we always keep updating the newY,\n // this is cruicial in making the scroll feel natural\n const isContentScrolledAtTop = scrollRef.current && scrollRef.current.scrollTop <= 0;\n if (lastOffsetY === upperSnapPoint && !isContentScrolledAtTop) {\n newY = upperSnapPoint;\n }\n preventScrollingRef.current = newY < upperSnapPoint;\n }\n\n if (last) {\n // calculate the nearest snapPoint\n const [nearest, lower] = computeSnapPointBounds(\n newY,\n snapPoints.map((point) => dimensions.height * point) as SnapPoints,\n );\n\n // This ensure that the lower snapPoint will always have atleast some buffer\n // When the bottomsheet total height is less than the lower snapPoint\n // Video walkthrough: https://www.loom.com/share/a9a8db7688d64194b13df8b3e25859ae\n const lowerPointBuffer = 60;\n const lowerestSnap = Math.min(lower, totalHeight) - lowerPointBuffer;\n\n const shouldClose = rawY < lowerestSnap;\n if (shouldClose) {\n setIsDragging(false);\n cancel();\n close();\n return;\n }\n\n // if we stop dragging assign snap to the nearest point\n if (!active && !tap) {\n newY = nearest;\n }\n }\n\n setPositionY(newY, !down);\n },\n {\n from: [0, positionY],\n filterTaps: true,\n enabled: isOnTopOfStack && _isOpen,\n },\n );\n\n // Here we are preventing the scrolling of the content, until the preventScrollingRef value is true\n useIsomorphicLayoutEffect(() => {\n const scrollElement = scrollRef.current;\n if (!scrollElement) return;\n\n const preventScrolling = (e: Event) => {\n if (preventScrollingRef?.current) {\n e.preventDefault();\n }\n };\n\n // https://www.bram.us/2016/05/02/prevent-overscroll-bounce-in-ios-mobilesafari-pure-css/\n const preventSafariOverscroll = (e: Event) => {\n if (scrollElement.scrollTop < 0) {\n // TODO: figure this out, it doesn't seem to work >iOS12\n // requestAnimationFrame(() => {\n // elem.style.overflow = 'hidden';\n // elem.scrollTop = 0;\n // elem.style.removeProperty('overflow');\n // });\n e.preventDefault();\n }\n };\n\n scrollElement.addEventListener('scroll', preventScrolling);\n scrollElement.addEventListener('touchmove', preventScrolling);\n scrollElement.addEventListener('touchstart', preventSafariOverscroll);\n return () => {\n scrollElement.removeEventListener('scroll', preventScrolling);\n scrollElement.removeEventListener('touchmove', preventScrolling);\n scrollElement.removeEventListener('touchstart', preventSafariOverscroll);\n };\n // Only run this hook when we know all the layout calculations are done,\n // Otherwise the scrollRef.current will be null.\n // isReady prop will ensure that we are done measuring the content height\n }, [isReady]);\n\n // usePresence hook waits for the animation to finish before unmounting the component\n // It's similar to framer-motions usePresence hook\n // https://www.framer.com/docs/animate-presence/#usepresence\n const { isMounted, isVisible } = usePresence(Boolean(_isOpen), {\n transitionDuration: theme.motion.duration.moderate,\n });\n\n const isHeaderFloating = !hasBodyPadding && isHeaderEmpty;\n const contextValue: BottomSheetContextProps = React.useMemo(\n () => ({\n isInBottomSheet: true,\n isOpen: Boolean(isVisible),\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n }),\n [\n isVisible,\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n ],\n );\n\n React.useEffect(() => {\n if (isMounted) {\n addBottomSheetToStack(id);\n } else {\n removeBottomSheetFromStack(id);\n }\n }, [addBottomSheetToStack, id, isMounted, removeBottomSheetFromStack]);\n\n // We will need to reset these values otherwise the next time the bottomsheet opens\n // this will be populated and the animations won't run\n // why?: because how the usePresence hook works, we actually just unmount the\n // html contents not the whole <BottomSheet /> react component\n React.useEffect(() => {\n if (!isMounted) {\n setHeaderHeight(0);\n setFooterHeight(0);\n setContentHeight(0);\n setGrabHandleHeight(0);\n _setPositionY(0);\n }\n }, [isMounted, scrollLockRef]);\n\n // We don't want to destroy the react tree when we are rendering inside Dropdown\n // Because if we bail out early then ActionList won't render,\n // and Dropdown manages it's state based on the rendered JSX of ActionList\n // If we don't render ActionList Dropdown state will reset each time we open/close BottomSheet\n const isInsideDropdown = Boolean(bottomSheetAndDropdownGlue);\n if (!isMounted && !isInsideDropdown) {\n return <></>;\n }\n\n return (\n <BottomSheetContext.Provider value={contextValue}>\n <BottomSheetBackdrop zIndex={bottomSheetZIndex} />\n <BottomSheetSurface\n {...metaAttribute({\n name: MetaConstants.BottomSheet,\n testID: 'bottomsheet-surface',\n })}\n {...makeAccessible({ modal: true, role: 'dialog' })}\n windowHeight={dimensions.height}\n isDragging={isDragging}\n style={{\n opacity: isVisible ? 1 : 0,\n pointerEvents: isVisible ? 'all' : 'none',\n height: positionY,\n bottom: 0,\n top: 'auto',\n zIndex: bottomSheetZIndex,\n }}\n >\n <BaseBox height=\"100%\" display=\"flex\" flexDirection=\"column\">\n <BottomSheetGrabHandle\n ref={grabHandleRef}\n isHeaderFloating={isHeaderFloating}\n {...metaAttribute({ name: ComponentIds.BottomSheetGrabHandle })}\n {...bind()}\n />\n {children}\n </BaseBox>\n </BottomSheetSurface>\n </BottomSheetContext.Provider>\n );\n};\n\nconst BottomSheet = assignWithoutSideEffects(_BottomSheet, {\n componentId: ComponentIds.BottomSheet,\n});\n\nexport { BottomSheet, BottomSheetBody, BottomSheetHeader, BottomSheetFooter };\nexport type { BottomSheetProps };\n"],"names":["BOTTOM_SHEET_EASING","AUTOCOMPLETE_DEFAULT_SNAPPOINT","BottomSheetSurface","styled","div","withConfig","displayName","componentId","_ref","theme","windowHeight","isDragging","background","colors","popup","subtle","borderTopLeftRadius","makeSize","size","borderTopRightRadius","borderColor","border","boxShadow","opacity","pointerEvents","transitionDuration","undefined","concat","makeMotionTime","motion","duration","moderate","transitionTimingFunction","willChange","transitionProperty","position","left","right","bottom","top","backgroundColor","justifyContent","alignItems","touchAction","overflow","_BottomSheet","_ref2","isOpen","onDismiss","children","initialFocusRef","_ref2$snapPoints","snapPoints","_ref2$zIndex","zIndex","componentZIndices","bottomSheet","_useTheme","useTheme","dimensions","useWindowSize","_React$useState","React","useState","_React$useState2","_slicedToArray","contentHeight","setContentHeight","_React$useState3","_React$useState4","headerHeight","setHeaderHeight","_React$useState5","_React$useState6","footerHeight","setFooterHeight","_React$useState7","_React$useState8","grabHandleHeight","setGrabHandleHeight","_React$useState9","_React$useState10","hasBodyPadding","setHasBodyPadding","_React$useState11","_React$useState12","isHeaderEmpty","setIsHeaderEmpty","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","_React$useState13","_React$useState14","positionY","_setPositionY","_isOpen","_React$useState15","_React$useState16","setIsDragging","preventScrollingRef","useRef","scrollRef","grabHandleRef","defaultInitialFocusRef","originalFocusElement","initialSnapPoint","totalHeight","useMemo","id","useId","_useBottomSheetStack","useBottomSheetStack","stack","addBottomSheetToStack","removeBottomSheetFromStack","getTopOfTheStack","getCurrentStackIndexById","currentStackIndex","isOnTopOfStack","bottomSheetZIndex","setPositionY","useCallback","value","limit","arguments","length","shouldLimitPositionY","hasAutoCompleteInBottomSheetHeader","maxValue","computeMaxContent","maxHeight","isReady","shouldLock","scrollLockRef","useScrollLock","enabled","targetRef","reserveScrollBarGap","useEffect","hasNoBottomSheets","clearAllBodyScrollLocks","useIsomorphicLayoutEffect","current","getBoundingClientRect","height","middleSnapPoint","lowerSnapPoint","returnFocus","focus","focusOnInitialRef","_defaultInitialFocusR","_initialFocusRef$curr","handleOnOpen","_originalFocusElement","activate","document","activeElement","handleOnClose","close","onBottomSheetDismiss","window","setTimeout","setDropdownHasBottomSheet","bind","useDrag","_ref3","active","last","cancel","tap","_ref3$movement","movement","_movementX","movementY","_ref3$velocity","velocity","_velocityX","velocityY","_ref3$lastOffset","lastOffset","_","lastOffsetY","down","dragging","_ref3$args","args","_ref3$args2","_ref3$args3","_ref3$args3$","_ref3$args3$2","_ref3$args3$2$isConte","isContentDragging","Boolean","rawY","upperSnapPoint","predictedDistance","predictedY","Math","max","min","newY","dampening","rubberbandIfOutOfBounds","isPosAtUpperSnapPoint","isContentScrolledAtTop","scrollTop","_computeSnapPointBoun","computeSnapPointBounds","map","point","_computeSnapPointBoun2","nearest","lower","lowerPointBuffer","lowerestSnap","shouldClose","from","filterTaps","scrollElement","preventScrolling","e","preventDefault","preventSafariOverscroll","addEventListener","removeEventListener","_usePresence","usePresence","isMounted","isVisible","isHeaderFloating","contextValue","isInBottomSheet","isInsideDropdown","_jsx","_Fragment","_jsxs","BottomSheetContext","Provider","BottomSheetBackdrop","_objectSpread","metaAttribute","name","MetaConstants","BottomSheet","testID","makeAccessible","modal","role","style","BaseBox","display","flexDirection","BottomSheetGrabHandle","ref","ComponentIds","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,IAAMA,mBAAmB,GAAG,8BAA6B;AAChE,IAAMC,8BAA8B,GAAG,IAAI,CAAA;AAE3C,IAAMC,kBAAkB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAGlC,CAAA,CAAA,UAAAC,IAAA,EAAyC;AAAA,EAAA,IAAtCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU,CAAA;EACnC,OAAO;IACLC,UAAU,EAAEH,KAAK,CAACI,MAAM,CAACC,KAAK,CAACF,UAAU,CAACG,MAAM;AAChDC,IAAAA,mBAAmB,EAAEC,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvCC,IAAAA,oBAAoB,EAAEF,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxCE,WAAW,EAAEX,KAAK,CAACI,MAAM,CAACC,KAAK,CAACO,MAAM,CAACN,MAAM;AAC7C;AACAO,IAAAA,SAAS,EAAE,gDAAgD;AAC3DC,IAAAA,OAAO,EAAE,CAAC;AACVC,IAAAA,aAAa,EAAE,MAAM;AACrBC,IAAAA,kBAAkB,EAAEd,UAAU,GAC1Be,SAAS,GAAA,EAAA,CAAAC,MAAA,CACNC,cAAc,CAACnB,KAAK,CAACoB,MAAM,CAACC,QAAQ,CAACC,QAAQ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|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { BreadcrumbContext } from './BreadcrumbContext.js';
|
|
5
|
+
import '../Box/BaseBox/index.js';
|
|
6
|
+
import '../Typography/index.js';
|
|
7
|
+
import '../../utils/makeAccessible/index.js';
|
|
8
|
+
import '../Box/styledProps/index.js';
|
|
9
|
+
import '../../utils/metaAttribute/index.js';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
|
+
import { Text } from '../Typography/Text/Text.js';
|
|
12
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
13
|
+
import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
|
|
14
|
+
import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
|
|
15
|
+
import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
|
|
16
|
+
import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.web.js';
|
|
17
|
+
|
|
18
|
+
var _excluded = ["size", "color", "showLastSeparator", "accessibilityLabel", "children"];
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
+
var Separator = function Separator(_ref) {
|
|
22
|
+
var size = _ref.size,
|
|
23
|
+
color = _ref.color;
|
|
24
|
+
return /*#__PURE__*/jsx(Text, {
|
|
25
|
+
as: "span",
|
|
26
|
+
color: color === 'white' ? 'surface.text.staticWhite.muted' : 'surface.text.gray.muted',
|
|
27
|
+
size: size,
|
|
28
|
+
weight: "medium",
|
|
29
|
+
children: "/"
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var listStyleNone = {
|
|
33
|
+
listStyle: 'none'
|
|
34
|
+
};
|
|
35
|
+
var Breadcrumb = function Breadcrumb(_ref2) {
|
|
36
|
+
var _ref2$size = _ref2.size,
|
|
37
|
+
size = _ref2$size === void 0 ? 'medium' : _ref2$size,
|
|
38
|
+
_ref2$color = _ref2.color,
|
|
39
|
+
color = _ref2$color === void 0 ? 'primary' : _ref2$color,
|
|
40
|
+
_ref2$showLastSeparat = _ref2.showLastSeparator,
|
|
41
|
+
showLastSeparator = _ref2$showLastSeparat === void 0 ? false : _ref2$showLastSeparat,
|
|
42
|
+
_ref2$accessibilityLa = _ref2.accessibilityLabel,
|
|
43
|
+
accessibilityLabel = _ref2$accessibilityLa === void 0 ? 'Breadcrumb' : _ref2$accessibilityLa,
|
|
44
|
+
children = _ref2.children,
|
|
45
|
+
styledProps = _objectWithoutProperties(_ref2, _excluded);
|
|
46
|
+
var contextValue = React__default.useMemo(function () {
|
|
47
|
+
return {
|
|
48
|
+
size: size,
|
|
49
|
+
color: color
|
|
50
|
+
};
|
|
51
|
+
}, [size, color]);
|
|
52
|
+
return /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread(_objectSpread({
|
|
53
|
+
as: "nav"
|
|
54
|
+
}, getStyledProps(styledProps)), metaAttribute({
|
|
55
|
+
name: MetaConstants.Breadcrumb
|
|
56
|
+
})), {}, {
|
|
57
|
+
children: /*#__PURE__*/jsx(BreadcrumbContext.Provider, {
|
|
58
|
+
value: contextValue,
|
|
59
|
+
children: /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
|
|
60
|
+
as: "ol",
|
|
61
|
+
margin: "spacing.0",
|
|
62
|
+
padding: "spacing.0",
|
|
63
|
+
display: "flex",
|
|
64
|
+
flexWrap: "wrap",
|
|
65
|
+
gap: "spacing.2",
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
style: listStyleNone
|
|
68
|
+
}, makeAccessible({
|
|
69
|
+
label: accessibilityLabel
|
|
70
|
+
})), {}, {
|
|
71
|
+
children: React__default.Children.map(children, function (child, index) {
|
|
72
|
+
var _props;
|
|
73
|
+
var ariaCurrent = child !== null && child !== void 0 && (_props = child.props) !== null && _props !== void 0 && _props.isCurrentPage ? 'page' : undefined;
|
|
74
|
+
return /*#__PURE__*/jsxs(BaseBox, _objectSpread(_objectSpread(_objectSpread({
|
|
75
|
+
as: "li",
|
|
76
|
+
display: "flex",
|
|
77
|
+
alignItems: "center",
|
|
78
|
+
gap: "spacing.2"
|
|
79
|
+
}, makeAccessible({
|
|
80
|
+
current: ariaCurrent
|
|
81
|
+
})), metaAttribute({
|
|
82
|
+
name: MetaConstants.BreadcrumbItem
|
|
83
|
+
})), {}, {
|
|
84
|
+
children: [child, /*#__PURE__*/jsxs(BaseBox, _objectSpread(_objectSpread({
|
|
85
|
+
as: "span"
|
|
86
|
+
}, makeAccessible({
|
|
87
|
+
hidden: true
|
|
88
|
+
})), {}, {
|
|
89
|
+
children: [index !== React__default.Children.count(children) - 1 && /*#__PURE__*/jsx(Separator, {
|
|
90
|
+
size: size
|
|
91
|
+
}), index === React__default.Children.count(children) - 1 && showLastSeparator && /*#__PURE__*/jsx(Separator, {
|
|
92
|
+
size: size,
|
|
93
|
+
color: color
|
|
94
|
+
})]
|
|
95
|
+
}))]
|
|
96
|
+
}), index);
|
|
97
|
+
})
|
|
98
|
+
}))
|
|
99
|
+
})
|
|
100
|
+
}));
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export { Breadcrumb };
|
|
104
|
+
//# sourceMappingURL=Breadcrumb.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.web.js","sources":["../../../../../../src/components/Breadcrumb/Breadcrumb.web.tsx"],"sourcesContent":["/* eslint-disable react-native-a11y/has-valid-accessibility-role */\nimport React from 'react';\nimport type { BreadcrumbProps } from './types';\nimport { BreadcrumbContext } from './BreadcrumbContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\n\nconst Separator = ({\n size,\n color,\n}: Pick<BreadcrumbProps, 'size' | 'color'>): React.ReactElement => {\n return (\n <Text\n as=\"span\"\n color={color === 'white' ? 'surface.text.staticWhite.muted' : 'surface.text.gray.muted'}\n size={size}\n weight=\"medium\"\n >\n /\n </Text>\n );\n};\n\nconst listStyleNone = { listStyle: 'none' };\n\nconst Breadcrumb = ({\n size = 'medium',\n color = 'primary',\n showLastSeparator = false,\n accessibilityLabel = 'Breadcrumb',\n children,\n ...styledProps\n}: BreadcrumbProps): React.ReactElement => {\n const contextValue = React.useMemo(() => ({ size, color }), [size, color]);\n\n return (\n <BaseBox\n as=\"nav\"\n {...getStyledProps(styledProps)}\n {...metaAttribute({ name: MetaConstants.Breadcrumb })}\n >\n <BreadcrumbContext.Provider value={contextValue}>\n <BaseBox\n as=\"ol\"\n margin=\"spacing.0\"\n padding=\"spacing.0\"\n display=\"flex\"\n flexWrap=\"wrap\"\n gap=\"spacing.2\"\n alignItems=\"center\"\n style={listStyleNone}\n {...makeAccessible({ label: accessibilityLabel })}\n >\n {React.Children.map(children, (child, index) => {\n const ariaCurrent = (child as React.ReactElement)?.props?.isCurrentPage\n ? 'page'\n : undefined;\n\n return (\n <BaseBox\n key={index}\n as=\"li\"\n display=\"flex\"\n alignItems=\"center\"\n gap=\"spacing.2\"\n {...makeAccessible({ current: ariaCurrent })}\n {...metaAttribute({ name: MetaConstants.BreadcrumbItem })}\n >\n {child}\n <BaseBox as=\"span\" {...makeAccessible({ hidden: true })}>\n {index !== React.Children.count(children) - 1 && <Separator size={size} />}\n {index === React.Children.count(children) - 1 && showLastSeparator && (\n <Separator size={size} color={color} />\n )}\n </BaseBox>\n </BaseBox>\n );\n })}\n </BaseBox>\n </BreadcrumbContext.Provider>\n </BaseBox>\n );\n};\n\nexport { Breadcrumb };\n"],"names":["Separator","_ref","size","color","_jsx","Text","as","weight","children","listStyleNone","listStyle","Breadcrumb","_ref2","_ref2$size","_ref2$color","_ref2$showLastSeparat","showLastSeparator","_ref2$accessibilityLa","accessibilityLabel","styledProps","_objectWithoutProperties","_excluded","contextValue","React","useMemo","BaseBox","_objectSpread","getStyledProps","metaAttribute","name","MetaConstants","BreadcrumbContext","Provider","value","margin","padding","display","flexWrap","gap","alignItems","style","makeAccessible","label","Children","map","child","index","_props","ariaCurrent","props","isCurrentPage","undefined","_jsxs","current","BreadcrumbItem","hidden","count"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAGoD;AAAA,EAAA,IAFjEC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,KAAK,GAAAF,IAAA,CAALE,KAAK,CAAA;EAEL,oBACEC,GAAA,CAACC,IAAI,EAAA;AACHC,IAAAA,EAAE,EAAC,MAAM;AACTH,IAAAA,KAAK,EAAEA,KAAK,KAAK,OAAO,GAAG,gCAAgC,GAAG,yBAA0B;AACxFD,IAAAA,IAAI,EAAEA,IAAK;AACXK,IAAAA,MAAM,EAAC,QAAQ;AAAAC,IAAAA,QAAA,EAChB,GAAA;AAED,GAAM,CAAC,CAAA;AAEX,CAAC,CAAA;AAED,IAAMC,aAAa,GAAG;AAAEC,EAAAA,SAAS,EAAE,MAAA;AAAO,CAAC,CAAA;AAE3C,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAAC,KAAA,EAO2B;AAAA,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AAC,aAAA,CAAAA,aAAA,CAAA;AAACpB,cAAAA,EAAE,EAAC,MAAA;AAAM,aAAA,EAAKmC,cAAc,CAAC;AAAEc,cAAAA,MAAM,EAAE,IAAA;AAAK,aAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAA/C,cAAAA,QAAA,GACpDsC,KAAK,KAAKvB,cAAK,CAACoB,QAAQ,CAACa,KAAK,CAAChD,QAAQ,CAAC,GAAG,CAAC,iBAAIJ,GAAA,CAACJ,SAAS,EAAA;AAACE,gBAAAA,IAAI,EAAEA,IAAAA;AAAK,eAAE,CAAC,EACzE4C,KAAK,KAAKvB,cAAK,CAACoB,QAAQ,CAACa,KAAK,CAAChD,QAAQ,CAAC,GAAG,CAAC,IAAIQ,iBAAiB,iBAChEZ,GAAA,CAACJ,SAAS,EAAA;AAACE,gBAAAA,IAAI,EAAEA,IAAK;AAACC,gBAAAA,KAAK,EAAEA,KAAAA;AAAM,eAAE,CACvC,CAAA;AAAA,aAAA,CACM,CAAC,CAAA;AAAA,WAAA,CAAA,EAdL2C,KAeE,CAAC,CAAA;SAEb,CAAA;OACM,CAAA,CAAA;KACiB,CAAA;AAAC,GAAA,CACtB,CAAC,CAAA;AAEd;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreadcrumbContext.js","sources":["../../../../../../src/components/Breadcrumb/BreadcrumbContext.tsx"],"sourcesContent":["import React from 'react';\nimport type { BreadcrumbProps } from './types';\n\ntype BreadcrumbContextValue = Pick<BreadcrumbProps, 'color' | 'size'>;\nconst BreadcrumbContext = React.createContext<BreadcrumbContextValue>({\n size: 'medium',\n color: 'primary',\n});\n\nexport { BreadcrumbContext };\n"],"names":["BreadcrumbContext","React","createContext","size","color"],"mappings":";;AAIA,IAAMA,iBAAiB,gBAAGC,cAAK,CAACC,aAAa,CAAyB;AACpEC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,KAAK,EAAE,SAAA;AACT,CAAC;;;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { BreadcrumbContext } from './BreadcrumbContext.js';
|
|
3
|
+
import '../Link/BaseLink/index.js';
|
|
4
|
+
import '../Typography/index.js';
|
|
5
|
+
import '../Box/BaseBox/index.js';
|
|
6
|
+
import '../../tokens/global/index.js';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
9
|
+
import { Text } from '../Typography/Text/Text.js';
|
|
10
|
+
import BaseLink from '../Link/BaseLink/BaseLink.js';
|
|
11
|
+
import { opacity } from '../../tokens/global/opacity.js';
|
|
12
|
+
|
|
13
|
+
var BreadcrumbItem = function BreadcrumbItem(_ref) {
|
|
14
|
+
var children = _ref.children,
|
|
15
|
+
href = _ref.href,
|
|
16
|
+
Icon = _ref.icon,
|
|
17
|
+
isCurrentPage = _ref.isCurrentPage,
|
|
18
|
+
onClick = _ref.onClick,
|
|
19
|
+
accessibilityLabel = _ref.accessibilityLabel;
|
|
20
|
+
var _React$useContext = React__default.useContext(BreadcrumbContext),
|
|
21
|
+
color = _React$useContext.color,
|
|
22
|
+
size = _React$useContext.size;
|
|
23
|
+
if (isCurrentPage) {
|
|
24
|
+
var isWhite = color === 'white';
|
|
25
|
+
return /*#__PURE__*/jsxs(BaseBox, {
|
|
26
|
+
display: "flex",
|
|
27
|
+
gap: "spacing.2",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
children: [Icon && /*#__PURE__*/jsx(Icon, {
|
|
30
|
+
size: size,
|
|
31
|
+
color: isWhite ? 'surface.icon.staticWhite.normal' : 'surface.icon.gray.normal'
|
|
32
|
+
}), /*#__PURE__*/jsx(Text, {
|
|
33
|
+
weight: "medium",
|
|
34
|
+
size: size,
|
|
35
|
+
color: isWhite ? 'surface.text.staticWhite.normal' : 'surface.text.gray.normal',
|
|
36
|
+
children: children
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return /*#__PURE__*/jsx(BaseLink, {
|
|
41
|
+
size: size,
|
|
42
|
+
color: color,
|
|
43
|
+
opacity: color !== 'primary' ? opacity[7] : 1,
|
|
44
|
+
icon: Icon,
|
|
45
|
+
href: href,
|
|
46
|
+
onClick: onClick,
|
|
47
|
+
accessibilityProps: {
|
|
48
|
+
label: accessibilityLabel
|
|
49
|
+
},
|
|
50
|
+
children: children !== null && children !== void 0 ? children : ''
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { BreadcrumbItem };
|
|
55
|
+
//# sourceMappingURL=BreadcrumbItem.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreadcrumbItem.web.js","sources":["../../../../../../src/components/Breadcrumb/BreadcrumbItem.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { BreadcrumbItemProps } from './types';\nimport { BreadcrumbContext } from './BreadcrumbContext';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { opacity } from '~tokens/global';\n\nconst BreadcrumbItem = ({\n children,\n href,\n icon: Icon,\n isCurrentPage,\n onClick,\n accessibilityLabel,\n}: BreadcrumbItemProps): React.ReactElement => {\n const { color, size } = React.useContext(BreadcrumbContext);\n\n if (isCurrentPage) {\n const isWhite = color === 'white';\n return (\n <BaseBox display=\"flex\" gap=\"spacing.2\" alignItems=\"center\">\n {Icon && (\n <Icon\n size={size}\n color={isWhite ? 'surface.icon.staticWhite.normal' : 'surface.icon.gray.normal'}\n />\n )}\n <Text\n weight=\"medium\"\n size={size}\n color={isWhite ? 'surface.text.staticWhite.normal' : 'surface.text.gray.normal'}\n >\n {children}\n </Text>\n </BaseBox>\n );\n }\n\n return (\n <BaseLink\n size={size}\n color={color}\n opacity={color !== 'primary' ? opacity[7] : 1}\n icon={Icon}\n href={href}\n onClick={onClick}\n accessibilityProps={{ label: accessibilityLabel }}\n >\n {children ?? ''}\n </BaseLink>\n );\n};\n\nexport { BreadcrumbItem };\n"],"names":["BreadcrumbItem","_ref","children","href","Icon","icon","isCurrentPage","onClick","accessibilityLabel","_React$useContext","React","useContext","BreadcrumbContext","color","size","isWhite","_jsxs","BaseBox","display","gap","alignItems","_jsx","Text","weight","BaseLink","opacity","accessibilityProps","label"],"mappings":";;;;;;;;;;;;AAQA,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAO2B;AAAA,EAAA,IAN7CC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACEC,IAAI,GAAAH,IAAA,CAAVI,IAAI;IACJC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,OAAO,GAAAN,IAAA,CAAPM,OAAO;IACPC,kBAAkB,GAAAP,IAAA,CAAlBO,kBAAkB,CAAA;AAElB,EAAA,IAAAC,iBAAA,GAAwBC,cAAK,CAACC,UAAU,CAACC,iBAAiB,CAAC;IAAnDC,KAAK,GAAAJ,iBAAA,CAALI,KAAK;IAAEC,IAAI,GAAAL,iBAAA,CAAJK,IAAI,CAAA;AAEnB,EAAA,IAAIR,aAAa,EAAE;AACjB,IAAA,IAAMS,OAAO,GAAGF,KAAK,KAAK,OAAO,CAAA;IACjC,oBACEG,IAAA,CAACC,OAAO,EAAA;AAACC,MAAAA,OAAO,EAAC,MAAM;AAACC,MAAAA,GAAG,EAAC,WAAW;AAACC,MAAAA,UAAU,EAAC,QAAQ;AAAAlB,MAAAA,QAAA,EACxDE,CAAAA,IAAI,iBACHiB,GAAA,CAACjB,IAAI,EAAA;AACHU,QAAAA,IAAI,EAAEA,IAAK;AACXD,QAAAA,KAAK,EAAEE,OAAO,GAAG,iCAAiC,GAAG,0BAAA;AAA2B,OACjF,CACF,eACDM,GAAA,CAACC,IAAI,EAAA;AACHC,QAAAA,MAAM,EAAC,QAAQ;AACfT,QAAAA,IAAI,EAAEA,IAAK;AACXD,QAAAA,KAAK,EAAEE,OAAO,GAAG,iCAAiC,GAAG,0BAA2B;AAAAb,QAAAA,QAAA,EAE/EA,QAAAA;AAAQ,OACL,CAAC,CAAA;AAAA,KACA,CAAC,CAAA;AAEd,GAAA;EAEA,oBACEmB,GAAA,CAACG,QAAQ,EAAA;AACPV,IAAAA,IAAI,EAAEA,IAAK;AACXD,IAAAA,KAAK,EAAEA,KAAM;IACbY,OAAO,EAAEZ,KAAK,KAAK,SAAS,GAAGY,OAAO,CAAC,CAAC,CAAC,GAAG,CAAE;AAC9CpB,IAAAA,IAAI,EAAED,IAAK;AACXD,IAAAA,IAAI,EAAEA,IAAK;AACXI,IAAAA,OAAO,EAAEA,OAAQ;AACjBmB,IAAAA,kBAAkB,EAAE;AAAEC,MAAAA,KAAK,EAAEnB,kBAAAA;KAAqB;AAAAN,IAAAA,QAAA,EAEjDA,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAAA,KAAA,CAAA,GAARA,QAAQ,GAAI,EAAA;AAAE,GACP,CAAC,CAAA;AAEf;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -160,9 +160,9 @@ var buttonIconOnlyPadding = {
|
|
|
160
160
|
xsmall: {
|
|
161
161
|
top: 0,
|
|
162
162
|
bottom: 0,
|
|
163
|
-
left:
|
|
163
|
+
left: 3,
|
|
164
164
|
// should be `6px` as per design but we're making it `8px` since `6px` is not available as a spacing token
|
|
165
|
-
right:
|
|
165
|
+
right: 3 // should be `6px` as per design but we're making it `8px` since `6px` is not available as a spacing token
|
|
166
166
|
},
|
|
167
167
|
|
|
168
168
|
small: {
|