@razorpay/blade 11.30.0 → 11.30.2

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.
@@ -29,7 +29,7 @@ import { Box } from '../Box/Box.js';
29
29
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
30
30
  import { getComponentId } from '../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
31
31
 
32
- var commonCenterBoxProps={display:'flex',alignItems:'center',justifyContent:'center'};var centerBoxProps={large:Object.assign({},commonCenterBoxProps,{height:'28px'}),medium:Object.assign({},commonCenterBoxProps,{height:'20px'})};var sizeTokensMapping={large:{title:'large'},medium:{title:'medium'}};var propRestrictionMap={large:{Button:{size:'xsmall',variant:'tertiary'},Badge:{size:'medium'},Link:{size:'medium'},Text:{size:'medium',variant:'body'},Amount:{type:'body',size:'medium'}},medium:{Button:{size:'xsmall',variant:'tertiary'},Badge:{size:'small'},Link:{size:'small'},Text:{size:'small',variant:'body'},Amount:{type:'body',size:'small'}}};var useTrailingRestriction=function useTrailingRestriction(_ref){var trailing=_ref.trailing,size=_ref.size;var _React$useState=React__default.useState(null),_React$useState2=_slicedToArray(_React$useState,2),validatedTrailingComponent=_React$useState2[0],setValidatedTrailingComponent=_React$useState2[1];React__default.useEffect(function(){if(React__default.isValidElement(trailing)){var trailingComponentType=getComponentId(trailing);var restrictedProps=propRestrictionMap[size][trailingComponentType];var allowedComponents=Object.keys(propRestrictionMap[size]);if(__DEV__){if(!restrictedProps){throwBladeError({message:`Only one of \`${allowedComponents.join(', ')}\` component is accepted as trailing`,moduleName:'Header'});}}var restrictedPropKeys=Object.keys(propRestrictionMap[size][trailingComponentType]);for(var prop of restrictedPropKeys){var _trailing$props;if(trailing!=null&&(_trailing$props=trailing.props)!=null&&_trailing$props.hasOwnProperty(prop)){logger({message:`Do not pass "${prop}" to "${trailingComponentType}" while inside Header trailing, because we override it.`,moduleName:'Header',type:'warn'});}}setValidatedTrailingComponent(React__default.cloneElement(trailing,restrictedProps));}},[trailing,size]);return validatedTrailingComponent;};var _BaseHeader=function _BaseHeader(_ref2){var title=_ref2.title,subtitle=_ref2.subtitle,leading=_ref2.leading,titleSuffix=_ref2.titleSuffix,trailing=_ref2.trailing,_ref2$showDivider=_ref2.showDivider,showDivider=_ref2$showDivider===void 0?true:_ref2$showDivider,_ref2$showBackButton=_ref2.showBackButton,showBackButton=_ref2$showBackButton===void 0?false:_ref2$showBackButton,_ref2$showCloseButton=_ref2.showCloseButton,showCloseButton=_ref2$showCloseButton===void 0?true:_ref2$showCloseButton,onBackButtonClick=_ref2.onBackButtonClick,onCloseButtonClick=_ref2.onCloseButtonClick,closeButtonRef=_ref2.closeButtonRef,backButtonRef=_ref2.backButtonRef,testID=_ref2.testID,onClickCapture=_ref2.onClickCapture,onKeyDown=_ref2.onKeyDown,onKeyUp=_ref2.onKeyUp,onLostPointerCapture=_ref2.onLostPointerCapture,onPointerCancel=_ref2.onPointerCancel,onPointerDown=_ref2.onPointerDown,onPointerMove=_ref2.onPointerMove,onPointerUp=_ref2.onPointerUp,metaComponentName=_ref2.metaComponentName,paddingX=_ref2.paddingX,marginY=_ref2.marginY,marginBottom=_ref2.marginBottom,marginTop=_ref2.marginTop,_ref2$size=_ref2.size,size$1=_ref2$size===void 0?'large':_ref2$size,isDisabled=_ref2.isDisabled,children=_ref2.children,trailingInteractionElement=_ref2.trailingInteractionElement;var validatedTrailingComponent=useTrailingRestriction({trailing:trailing,size:size$1});var shouldWrapTitle=titleSuffix&&trailing&&showBackButton&&showCloseButton;var webOnlyEventHandlers=isReactNative()?{}:{onClickCapture:onClickCapture,onKeyDown:onKeyDown,onKeyUp:onKeyUp,onLostPointerCapture:onLostPointerCapture,onPointerCancel:onPointerCancel,onPointerDown:onPointerDown,onPointerMove:onPointerMove,onPointerUp:onPointerUp};return jsxs(BaseBox,Object.assign({},metaAttribute({name:metaComponentName,testID:testID}),{children:[jsxs(BaseBox,Object.assign({marginY:marginY!=null?marginY:{base:'spacing.5',m:'spacing.6'},paddingX:paddingX!=null?paddingX:{base:'spacing.5',m:'spacing.6'},marginTop:marginTop,marginBottom:marginBottom,touchAction:"none"},webOnlyEventHandlers,{children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",userSelect:"none",children:[showBackButton?jsx(BaseBox,{overflow:"visible",marginRight:"spacing.5",children:jsx(Box,Object.assign({},centerBoxProps[size$1],{children:jsx(IconButton,{ref:backButtonRef,size:"large",icon:ChevronLeftIcon,onClick:function onClick(){return onBackButtonClick==null?void 0:onBackButtonClick();},accessibilityLabel:"Back"})}))}):null,jsxs(BaseBox,{paddingRight:"spacing.5",marginRight:"auto",flex:"auto",display:"flex",flexDirection:"row",alignItems:"flex-start",children:[leading?jsx(BaseBox,Object.assign({marginRight:"spacing.3"},centerBoxProps[size$1],{children:leading})):null,jsxs(BaseBox,{flex:"auto",children:[jsxs(BaseBox,{maxWidth:isReactNative()&&shouldWrapTitle?'100px':undefined,flexShrink:0,display:"flex",flexDirection:"row",children:[title?jsx(Text,{size:sizeTokensMapping[size$1].title,marginTop:makeSize(size['1']),weight:"semibold",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.normal',children:title}):null,titleSuffix&&jsx(BaseBox,{marginLeft:"spacing.3",children:jsx(Box,Object.assign({},centerBoxProps[size$1],{children:titleSuffix}))})]}),subtitle?jsx(Text,{variant:"body",size:"small",weight:"regular",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.muted',children:subtitle}):null]})]}),validatedTrailingComponent?jsx(BaseBox,{marginRight:"spacing.5",children:jsx(Box,Object.assign({},centerBoxProps[size$1],{children:validatedTrailingComponent}))}):null,showCloseButton?jsx(Box,Object.assign({},centerBoxProps[size$1],{children:jsx(IconButton,{ref:closeButtonRef,size:"large",icon:CloseIcon,accessibilityLabel:"Close",onClick:function onClick(){return onCloseButtonClick==null?void 0:onCloseButtonClick();}})})):null,trailingInteractionElement&&!children?jsx(Box,Object.assign({},centerBoxProps[size$1],{children:trailingInteractionElement})):null]}),jsxs(BaseBox,{display:"flex",width:"100%",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[jsx(Box,{children:children}),trailingInteractionElement&&children?jsx(Box,Object.assign({alignSelf:"flex-start"},centerBoxProps[size$1],{children:trailingInteractionElement})):null]})]})),showDivider?jsx(Divider,{}):null]}));};var BaseHeader=assignWithoutSideEffects(_BaseHeader,{componentId:'BaseHeader'});
32
+ var commonCenterBoxProps={display:'flex',alignItems:'center',justifyContent:'center'};var centerBoxProps={large:Object.assign({},commonCenterBoxProps,{height:'28px'}),medium:Object.assign({},commonCenterBoxProps,{height:'20px'})};var sizeTokensMapping={large:{title:'large'},medium:{title:'medium'}};var propRestrictionMap={large:{Button:{size:'xsmall',variant:'tertiary'},Badge:{size:'medium'},Link:{size:'medium'},Text:{size:'medium',variant:'body'},Amount:{type:'body',size:'medium'}},medium:{Button:{size:'xsmall',variant:'tertiary'},Badge:{size:'small'},Link:{size:'small'},Text:{size:'small',variant:'body'},Amount:{type:'body',size:'small'}}};var useTrailingRestriction=function useTrailingRestriction(_ref){var trailing=_ref.trailing,size=_ref.size;var _React$useState=React__default.useState(null),_React$useState2=_slicedToArray(_React$useState,2),validatedTrailingComponent=_React$useState2[0],setValidatedTrailingComponent=_React$useState2[1];React__default.useEffect(function(){if(React__default.isValidElement(trailing)){var trailingComponentType=getComponentId(trailing);var restrictedProps=propRestrictionMap[size][trailingComponentType];var allowedComponents=Object.keys(propRestrictionMap[size]);if(__DEV__){if(!restrictedProps){throwBladeError({message:`Only one of \`${allowedComponents.join(', ')}\` component is accepted as trailing`,moduleName:'Header'});}}var restrictedPropKeys=Object.keys(propRestrictionMap[size][trailingComponentType]);for(var prop of restrictedPropKeys){var _trailing$props;if(trailing!=null&&(_trailing$props=trailing.props)!=null&&_trailing$props.hasOwnProperty(prop)){logger({message:`Do not pass "${prop}" to "${trailingComponentType}" while inside Header trailing, because we override it.`,moduleName:'Header',type:'warn'});}}setValidatedTrailingComponent(React__default.cloneElement(trailing,restrictedProps));}},[trailing,size]);return validatedTrailingComponent;};var _BaseHeader=function _BaseHeader(_ref2){var title=_ref2.title,subtitle=_ref2.subtitle,leading=_ref2.leading,titleSuffix=_ref2.titleSuffix,trailing=_ref2.trailing,_ref2$showDivider=_ref2.showDivider,showDivider=_ref2$showDivider===void 0?true:_ref2$showDivider,_ref2$showBackButton=_ref2.showBackButton,showBackButton=_ref2$showBackButton===void 0?false:_ref2$showBackButton,_ref2$showCloseButton=_ref2.showCloseButton,showCloseButton=_ref2$showCloseButton===void 0?true:_ref2$showCloseButton,onBackButtonClick=_ref2.onBackButtonClick,onCloseButtonClick=_ref2.onCloseButtonClick,closeButtonRef=_ref2.closeButtonRef,backButtonRef=_ref2.backButtonRef,testID=_ref2.testID,onClickCapture=_ref2.onClickCapture,onKeyDown=_ref2.onKeyDown,onKeyUp=_ref2.onKeyUp,onLostPointerCapture=_ref2.onLostPointerCapture,onPointerCancel=_ref2.onPointerCancel,onPointerDown=_ref2.onPointerDown,onPointerMove=_ref2.onPointerMove,onPointerUp=_ref2.onPointerUp,metaComponentName=_ref2.metaComponentName,paddingX=_ref2.paddingX,marginY=_ref2.marginY,marginBottom=_ref2.marginBottom,marginTop=_ref2.marginTop,_ref2$size=_ref2.size,size$1=_ref2$size===void 0?'large':_ref2$size,isDisabled=_ref2.isDisabled,children=_ref2.children,trailingInteractionElement=_ref2.trailingInteractionElement;var validatedTrailingComponent=useTrailingRestriction({trailing:trailing,size:size$1});var shouldWrapTitle=titleSuffix&&trailing&&showBackButton&&showCloseButton;var webOnlyEventHandlers=isReactNative()?{}:{onClickCapture:onClickCapture,onKeyDown:onKeyDown,onKeyUp:onKeyUp,onLostPointerCapture:onLostPointerCapture,onPointerCancel:onPointerCancel,onPointerDown:onPointerDown,onPointerMove:onPointerMove,onPointerUp:onPointerUp};return jsxs(BaseBox,Object.assign({},metaAttribute({name:metaComponentName,testID:testID}),{children:[jsxs(BaseBox,Object.assign({marginY:marginY!=null?marginY:{base:'spacing.5',m:'spacing.6'},paddingX:paddingX!=null?paddingX:{base:'spacing.5',m:'spacing.6'},marginTop:marginTop,marginBottom:marginBottom,touchAction:"none"},webOnlyEventHandlers,{children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",userSelect:"none",children:[showBackButton?jsx(BaseBox,{overflow:"visible",marginRight:"spacing.5",children:jsx(Box,Object.assign({},centerBoxProps[size$1],{children:jsx(IconButton,{ref:backButtonRef,size:"large",icon:ChevronLeftIcon,onClick:function onClick(){return onBackButtonClick==null?void 0:onBackButtonClick();},accessibilityLabel:"Back"})}))}):null,jsxs(BaseBox,{paddingRight:"spacing.5",marginRight:"auto",flex:"auto",display:"flex",flexDirection:"row",alignItems:"flex-start",children:[leading?jsx(BaseBox,Object.assign({marginRight:"spacing.3"},centerBoxProps[size$1],{children:leading})):null,jsxs(BaseBox,{flex:"auto",children:[jsxs(BaseBox,{maxWidth:isReactNative()&&shouldWrapTitle?'100px':undefined,flexShrink:0,display:"flex",flexDirection:"row",children:[title?jsx(Text,{size:sizeTokensMapping[size$1].title,marginTop:makeSize(size['1']),weight:"semibold",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.normal',wordBreak:"break-word",children:title}):null,titleSuffix&&jsx(BaseBox,{marginLeft:"spacing.3",children:jsx(Box,Object.assign({},centerBoxProps[size$1],{children:titleSuffix}))})]}),subtitle?jsx(Text,{variant:"body",size:"small",weight:"regular",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.muted',children:subtitle}):null]})]}),validatedTrailingComponent?jsx(BaseBox,{marginRight:"spacing.5",children:jsx(Box,Object.assign({},centerBoxProps[size$1],{children:validatedTrailingComponent}))}):null,showCloseButton?jsx(Box,Object.assign({},centerBoxProps[size$1],{children:jsx(IconButton,{ref:closeButtonRef,size:"large",icon:CloseIcon,accessibilityLabel:"Close",onClick:function onClick(){return onCloseButtonClick==null?void 0:onCloseButtonClick();}})})):null,trailingInteractionElement&&!children?jsx(Box,Object.assign({},centerBoxProps[size$1],{children:trailingInteractionElement})):null]}),jsxs(BaseBox,{display:"flex",width:"100%",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[jsx(Box,{width:"100%",children:children}),trailingInteractionElement&&children?jsx(Box,Object.assign({alignSelf:"flex-start"},centerBoxProps[size$1],{children:trailingInteractionElement})):null]})]})),showDivider?jsx(Divider,{}):null]}));};var BaseHeader=assignWithoutSideEffects(_BaseHeader,{componentId:'BaseHeader'});
33
33
 
34
34
  export { BaseHeader };
35
35
  //# sourceMappingURL=BaseHeader.js.map
@@ -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, makeSize } from '~utils';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport { logger, throwBladeError } from '~utils/logger';\nimport { size as sizeToken } 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 /**\n * Slot for rendering any trailing interaction element into BaseHeader.\n *\n * E.g. Used in accordion to render CollapsibleChevronIcon\n */\n trailingInteractionElement?: React.ReactNode;\n\n /**\n * Decides size of the Header\n */\n size?: 'large' | 'medium';\n /**\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Disabled state of BaseHeader\n *\n * @default false\n */\n isDisabled?: boolean;\n\n paddingX?: BoxProps['paddingX'];\n marginY?: BoxProps['marginY'];\n marginTop?: BoxProps['marginTop'];\n marginBottom?: BoxProps['marginBottom'];\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 | 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 commonCenterBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nconst centerBoxProps: { large: BoxProps; medium: BoxProps } = {\n large: {\n ...commonCenterBoxProps,\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 medium: {\n ...commonCenterBoxProps,\n height: '20px',\n },\n};\n\nconst sizeTokensMapping = {\n large: {\n title: 'large',\n },\n medium: {\n title: 'medium',\n },\n} as const;\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n large: {\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 },\n medium: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'small',\n },\n Link: {\n size: 'small',\n },\n Text: {\n size: 'small',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'small',\n },\n },\n} as const;\n\nconst useTrailingRestriction = ({\n trailing,\n size,\n}: {\n size: NonNullable<BaseHeaderProps['size']>;\n trailing: BaseHeaderProps['trailing'];\n}): 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[size][trailingComponentType];\n const allowedComponents = Object.keys(propRestrictionMap[size]);\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[size][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, size]);\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 paddingX,\n marginY,\n marginBottom,\n marginTop,\n size = 'large',\n isDisabled,\n children,\n trailingInteractionElement,\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction({ trailing, size });\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={marginY ?? { base: 'spacing.5', m: 'spacing.6' }}\n paddingX={paddingX ?? { base: 'spacing.5', m: 'spacing.6' }}\n marginTop={marginTop}\n marginBottom={marginBottom}\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[size]}>\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[size]}>\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={sizeTokensMapping[size].title}\n marginTop={makeSize(sizeToken['1'])}\n weight=\"semibold\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'}\n >\n {title}\n </Text>\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps[size]}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text\n variant=\"body\"\n size=\"small\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n >\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n {validatedTrailingComponent ? (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n ) : null}\n {showCloseButton ? (\n <Box {...centerBoxProps[size]}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n {trailingInteractionElement && !children ? (\n <Box {...centerBoxProps[size]}>{trailingInteractionElement}</Box>\n ) : null}\n </BaseBox>\n <BaseBox\n display=\"flex\"\n width=\"100%\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n >\n <Box>{children}</Box>\n {trailingInteractionElement && children ? (\n <Box alignSelf=\"flex-start\" {...centerBoxProps[size]}>\n {trailingInteractionElement}\n </Box>\n ) : null}\n </BaseBox>\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":["commonCenterBoxProps","display","alignItems","justifyContent","centerBoxProps","large","Object","assign","height","medium","sizeTokensMapping","title","propRestrictionMap","Button","size","variant","Badge","Link","Text","Amount","type","useTrailingRestriction","_ref","trailing","_React$useState","React","useState","_React$useState2","_slicedToArray","validatedTrailingComponent","setValidatedTrailingComponent","useEffect","isValidElement","trailingComponentType","getComponentId","restrictedProps","allowedComponents","keys","__DEV__","throwBladeError","message","join","moduleName","restrictedPropKeys","prop","_trailing$props","props","hasOwnProperty","logger","cloneElement","_BaseHeader","_ref2","subtitle","leading","titleSuffix","_ref2$showDivider","showDivider","_ref2$showBackButton","showBackButton","_ref2$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","paddingX","marginY","marginBottom","marginTop","_ref2$size","isDisabled","children","trailingInteractionElement","shouldWrapTitle","webOnlyEventHandlers","isReactNative","_jsxs","BaseBox","metaAttribute","name","base","m","touchAction","flexDirection","userSelect","_jsx","overflow","marginRight","Box","IconButton","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","undefined","flexShrink","makeSize","sizeToken","weight","color","marginLeft","CloseIcon","width","alignSelf","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,IAAMA,oBAA8B,CAAG,CACrCC,OAAO,CAAE,MAAM,CACfC,UAAU,CAAE,QAAQ,CACpBC,cAAc,CAAE,QAClB,CAAC,CAED,IAAMC,cAAqD,CAAG,CAC5DC,KAAK,CAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CACAP,oBAAoB,CAAA,CAKvBQ,MAAM,CAAE,MAAM,CACf,CAAA,CACDC,MAAM,CAAAH,MAAA,CAAAC,MAAA,CAAA,EAAA,CACDP,oBAAoB,CACvBQ,CAAAA,MAAM,CAAE,MAAM,EAElB,CAAC,CAED,IAAME,iBAAiB,CAAG,CACxBL,KAAK,CAAE,CACLM,KAAK,CAAE,OACT,CAAC,CACDF,MAAM,CAAE,CACNE,KAAK,CAAE,QACT,CACF,CAAU,CAGV,IAAMC,kBAAkB,CAAG,CACzBP,KAAK,CAAE,CACLQ,MAAM,CAAE,CACNC,IAAI,CAAE,QA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CAChBX,kBAAkB,CAAC,OAAO,CAC1BD,OAAO,CAAE,SAAAA,OAAAA,UAAMzC,kBAAkB,EAAlBA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,kBAAkB,EAAI,CAAA,CAAC,CACvC,CAAC,CAAA,CACC,CAAC,CACJ,IAAI,CACPoB,0BAA0B,EAAI,CAACD,QAAQ,CACtCc,GAAA,CAACG,GAAG,CAAA5F,MAAA,CAAAC,MAAA,CAAKH,EAAAA,CAAAA,cAAc,CAACU,MAAI,CAAC,EAAAmE,QAAA,CAAGC,0BAA0B,CAAA,CAAM,CAAC,CAC/D,IAAI,EACD,CAAC,CACVI,IAAA,CAACC,OAAO,CACNtF,CAAAA,OAAO,CAAC,MAAM,CACdmH,KAAK,CAAC,MAAM,CACZvB,aAAa,CAAC,KAAK,CACnB3F,UAAU,CAAC,QAAQ,CACnBC,cAAc,CAAC,eAAe,CAAA8E,QAAA,CAAA,CAE9Bc,GAAA,CAACG,GAAG,EAAAjB,QAAA,CAAEA,QAAQ,CAAM,CAAC,CACpBC,0BAA0B,EAAID,QAAQ,CACrCc,GAAA,CAACG,GAAG,CAAA5F,MAAA,CAAAC,MAAA,CAAA,CAAC8G,SAAS,CAAC,YAAY,EAAKjH,cAAc,CAACU,MAAI,CAAC,CAAA,CAAAmE,QAAA,CACjDC,0BAA0B,CACxB,CAAA,CAAC,CACJ,IAAI,CAAA,CACD,CAAC,CACH,CAAA,CAAA,CAAC,CACT1B,WAAW,CAAGuC,GAAA,CAACuB,OAAO,CAAE,EAAA,CAAC,CAAG,IAAI,CAAA,CAAA,CAC1B,CAAC,CAEd,CAAC,CAEK,IAAAC,UAAU,CAAGC,wBAAwB,CAACtE,WAAW,CAAE,CACvDuE,WAAW,CAAE,YACf,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 as sizeToken } 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 /**\n * Slot for rendering any trailing interaction element into BaseHeader.\n *\n * E.g. Used in accordion to render CollapsibleChevronIcon\n */\n trailingInteractionElement?: React.ReactNode;\n\n /**\n * Decides size of the Header\n */\n size?: 'large' | 'medium';\n /**\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Disabled state of BaseHeader\n *\n * @default false\n */\n isDisabled?: boolean;\n\n paddingX?: BoxProps['paddingX'];\n marginY?: BoxProps['marginY'];\n marginTop?: BoxProps['marginTop'];\n marginBottom?: BoxProps['marginBottom'];\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 | 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 commonCenterBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nconst centerBoxProps: { large: BoxProps; medium: BoxProps } = {\n large: {\n ...commonCenterBoxProps,\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 medium: {\n ...commonCenterBoxProps,\n height: '20px',\n },\n};\n\nconst sizeTokensMapping = {\n large: {\n title: 'large',\n },\n medium: {\n title: 'medium',\n },\n} as const;\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n large: {\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 },\n medium: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'small',\n },\n Link: {\n size: 'small',\n },\n Text: {\n size: 'small',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'small',\n },\n },\n} as const;\n\nconst useTrailingRestriction = ({\n trailing,\n size,\n}: {\n size: NonNullable<BaseHeaderProps['size']>;\n trailing: BaseHeaderProps['trailing'];\n}): 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[size][trailingComponentType];\n const allowedComponents = Object.keys(propRestrictionMap[size]);\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[size][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, size]);\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 paddingX,\n marginY,\n marginBottom,\n marginTop,\n size = 'large',\n isDisabled,\n children,\n trailingInteractionElement,\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction({ trailing, size });\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={marginY ?? { base: 'spacing.5', m: 'spacing.6' }}\n paddingX={paddingX ?? { base: 'spacing.5', m: 'spacing.6' }}\n marginTop={marginTop}\n marginBottom={marginBottom}\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[size]}>\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[size]}>\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={sizeTokensMapping[size].title}\n marginTop={makeSize(sizeToken['1'])}\n weight=\"semibold\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'}\n wordBreak=\"break-word\"\n >\n {title}\n </Text>\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps[size]}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text\n variant=\"body\"\n size=\"small\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n >\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n {validatedTrailingComponent ? (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n ) : null}\n {showCloseButton ? (\n <Box {...centerBoxProps[size]}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n {trailingInteractionElement && !children ? (\n <Box {...centerBoxProps[size]}>{trailingInteractionElement}</Box>\n ) : null}\n </BaseBox>\n <BaseBox\n display=\"flex\"\n width=\"100%\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n >\n <Box width=\"100%\">{children}</Box>\n {trailingInteractionElement && children ? (\n <Box alignSelf=\"flex-start\" {...centerBoxProps[size]}>\n {trailingInteractionElement}\n </Box>\n ) : null}\n </BaseBox>\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":["commonCenterBoxProps","display","alignItems","justifyContent","centerBoxProps","large","Object","assign","height","medium","sizeTokensMapping","title","propRestrictionMap","Button","size","variant","Badge","Link","Text","Amount","type","useTrailingRestriction","_ref","trailing","_React$useState","React","useState","_React$useState2","_slicedToArray","validatedTrailingComponent","setValidatedTrailingComponent","useEffect","isValidElement","trailingComponentType","getComponentId","restrictedProps","allowedComponents","keys","__DEV__","throwBladeError","message","join","moduleName","restrictedPropKeys","prop","_trailing$props","props","hasOwnProperty","logger","cloneElement","_BaseHeader","_ref2","subtitle","leading","titleSuffix","_ref2$showDivider","showDivider","_ref2$showBackButton","showBackButton","_ref2$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","paddingX","marginY","marginBottom","marginTop","_ref2$size","isDisabled","children","trailingInteractionElement","shouldWrapTitle","webOnlyEventHandlers","isReactNative","_jsxs","BaseBox","metaAttribute","name","base","m","touchAction","flexDirection","userSelect","_jsx","overflow","marginRight","Box","IconButton","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","undefined","flexShrink","makeSize","sizeToken","weight","color","wordBreak","marginLeft","CloseIcon","width","alignSelf","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,IAAMA,oBAA8B,CAAG,CACrCC,OAAO,CAAE,MAAM,CACfC,UAAU,CAAE,QAAQ,CACpBC,cAAc,CAAE,QAClB,CAAC,CAED,IAAMC,cAAqD,CAAG,CAC5DC,KAAK,CAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CACAP,oBAAoB,CAAA,CAKvBQ,MAAM,CAAE,MAAM,CACf,CAAA,CACDC,MAAM,CAAAH,MAAA,CAAAC,MAAA,CAAA,EAAA,CACDP,oBAAoB,CACvBQ,CAAAA,MAAM,CAAE,MAAM,EAElB,CAAC,CAED,IAAME,iBAAiB,CAAG,CACxBL,KAAK,CAAE,CACLM,KAAK,CAAE,OACT,CAAC,CACDF,MAAM,CAAE,CACNE,KAAK,CAAE,QACT,CACF,CAAU,CAGV,IAAMC,kBAAkB,CAAG,CACzBP,KAAK,CAAE,CACLQ,MAAM,CAAE,CACNC,IAAI,CAAE,QAAQ,CACdC,OAAO,CAAE,UACX,CAAC,CACDC,KAAK,CAAE,CACLF,IAAI,CAAE,QACR,CAAC,CACDG,IAAI,CAAE,CACJH,IAAI,CAAE,QACR,CAAC,CACDI,IAAI,CAAE,CACJJ,IAAI,CAAE,QAAQ,CACdC,OAAO,CAAE,MACX,CAAC,CACDI,MAAM,CAAE,CACNC,IAAI,CAAE,MAAM,CACZN,IAAI,CAAE,QACR,CACF,CAAC,CACDL,MAAM,CAAE,CACNI,MAAM,CAAE,CACNC,IAAI,CAAE,QAAQ,CACdC,OAAO,CAAE,UACX,CAAC,CACDC,KAAK,CAAE,CACLF,IAAI,CAAE,OACR,CAAC,CACDG,IAAI,CAAE,CACJH,IAAI,C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AAA,CAAAmE,QAAA,CAAGC,0BAA0B,EAAM,CAAC,CAC/D,IAAI,CAAA,CACD,CAAC,CACVI,IAAA,CAACC,OAAO,CAAA,CACNtF,OAAO,CAAC,MAAM,CACdoH,KAAK,CAAC,MAAM,CACZxB,aAAa,CAAC,KAAK,CACnB3F,UAAU,CAAC,QAAQ,CACnBC,cAAc,CAAC,eAAe,CAAA8E,QAAA,EAE9Bc,GAAA,CAACG,GAAG,CAAA,CAACmB,KAAK,CAAC,MAAM,CAAApC,QAAA,CAAEA,QAAQ,CAAM,CAAC,CACjCC,0BAA0B,EAAID,QAAQ,CACrCc,GAAA,CAACG,GAAG,CAAA5F,MAAA,CAAAC,MAAA,CAAA,CAAC+G,SAAS,CAAC,YAAY,EAAKlH,cAAc,CAACU,MAAI,CAAC,CAAA,CAAAmE,QAAA,CACjDC,0BAA0B,CACxB,CAAA,CAAC,CACJ,IAAI,CAAA,CACD,CAAC,CACH,CAAA,CAAA,CAAC,CACT1B,WAAW,CAAGuC,GAAA,CAACwB,OAAO,CAAE,EAAA,CAAC,CAAG,IAAI,CAAA,CAAA,CAC1B,CAAC,CAEd,CAAC,CAEK,IAAAC,UAAU,CAAGC,wBAAwB,CAACvE,WAAW,CAAE,CACvDwE,WAAW,CAAE,YACf,CAAC;;;;"}
@@ -251,6 +251,7 @@ var _BaseHeader = function _BaseHeader(_ref2) {
251
251
  marginTop: makeSize(size['1']),
252
252
  weight: "semibold",
253
253
  color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal',
254
+ wordBreak: "break-word",
254
255
  children: title
255
256
  }) : null, titleSuffix && /*#__PURE__*/jsx(BaseBox, {
256
257
  marginLeft: "spacing.3",
@@ -291,6 +292,7 @@ var _BaseHeader = function _BaseHeader(_ref2) {
291
292
  alignItems: "center",
292
293
  justifyContent: "space-between",
293
294
  children: [/*#__PURE__*/jsx(Box, {
295
+ width: "100%",
294
296
  children: children
295
297
  }), trailingInteractionElement && children ? /*#__PURE__*/jsx(Box, _objectSpread(_objectSpread({
296
298
  alignSelf: "flex-start"
@@ -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, makeSize } from '~utils';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport { logger, throwBladeError } from '~utils/logger';\nimport { size as sizeToken } 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 /**\n * Slot for rendering any trailing interaction element into BaseHeader.\n *\n * E.g. Used in accordion to render CollapsibleChevronIcon\n */\n trailingInteractionElement?: React.ReactNode;\n\n /**\n * Decides size of the Header\n */\n size?: 'large' | 'medium';\n /**\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Disabled state of BaseHeader\n *\n * @default false\n */\n isDisabled?: boolean;\n\n paddingX?: BoxProps['paddingX'];\n marginY?: BoxProps['marginY'];\n marginTop?: BoxProps['marginTop'];\n marginBottom?: BoxProps['marginBottom'];\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 | 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 commonCenterBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nconst centerBoxProps: { large: BoxProps; medium: BoxProps } = {\n large: {\n ...commonCenterBoxProps,\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 medium: {\n ...commonCenterBoxProps,\n height: '20px',\n },\n};\n\nconst sizeTokensMapping = {\n large: {\n title: 'large',\n },\n medium: {\n title: 'medium',\n },\n} as const;\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n large: {\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 },\n medium: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'small',\n },\n Link: {\n size: 'small',\n },\n Text: {\n size: 'small',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'small',\n },\n },\n} as const;\n\nconst useTrailingRestriction = ({\n trailing,\n size,\n}: {\n size: NonNullable<BaseHeaderProps['size']>;\n trailing: BaseHeaderProps['trailing'];\n}): 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[size][trailingComponentType];\n const allowedComponents = Object.keys(propRestrictionMap[size]);\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[size][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, size]);\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 paddingX,\n marginY,\n marginBottom,\n marginTop,\n size = 'large',\n isDisabled,\n children,\n trailingInteractionElement,\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction({ trailing, size });\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={marginY ?? { base: 'spacing.5', m: 'spacing.6' }}\n paddingX={paddingX ?? { base: 'spacing.5', m: 'spacing.6' }}\n marginTop={marginTop}\n marginBottom={marginBottom}\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[size]}>\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[size]}>\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={sizeTokensMapping[size].title}\n marginTop={makeSize(sizeToken['1'])}\n weight=\"semibold\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'}\n >\n {title}\n </Text>\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps[size]}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text\n variant=\"body\"\n size=\"small\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n >\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n {validatedTrailingComponent ? (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n ) : null}\n {showCloseButton ? (\n <Box {...centerBoxProps[size]}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n {trailingInteractionElement && !children ? (\n <Box {...centerBoxProps[size]}>{trailingInteractionElement}</Box>\n ) : null}\n </BaseBox>\n <BaseBox\n display=\"flex\"\n width=\"100%\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n >\n <Box>{children}</Box>\n {trailingInteractionElement && children ? (\n <Box alignSelf=\"flex-start\" {...centerBoxProps[size]}>\n {trailingInteractionElement}\n </Box>\n ) : null}\n </BaseBox>\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":["commonCenterBoxProps","display","alignItems","justifyContent","centerBoxProps","large","_objectSpread","height","medium","sizeTokensMapping","title","propRestrictionMap","Button","size","variant","Badge","Link","Text","Amount","type","useTrailingRestriction","_ref","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","_ref2","subtitle","leading","titleSuffix","_ref2$showDivider","showDivider","_ref2$showBackButton","showBackButton","_ref2$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","paddingX","marginY","marginBottom","marginTop","_ref2$size","isDisabled","children","trailingInteractionElement","shouldWrapTitle","webOnlyEventHandlers","isReactNative","_jsxs","BaseBox","metaAttribute","name","base","m","touchAction","flexDirection","userSelect","_jsx","overflow","marginRight","Box","IconButton","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","undefined","flexShrink","makeSize","sizeToken","weight","color","marginLeft","CloseIcon","width","alignSelf","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,IAAMA,oBAA8B,GAAG;AACrCC,EAAAA,OAAO,EAAE,MAAM;AACfC,EAAAA,UAAU,EAAE,QAAQ;AACpBC,EAAAA,cAAc,EAAE,QAAA;AAClB,CAAC,CAAA;AAED,IAAMC,cAAqD,GAAG;AAC5DC,EAAAA,KAAK,EAAAC,aAAA,CAAAA,aAAA,KACAN,oBAAoB,CAAA,EAAA,EAAA,EAAA;AACvB;AACA;AACA;AACA;AACAO,IAAAA,MAAM,EAAE,MAAA;GACT,CAAA;AACDC,EAAAA,MAAM,EAAAF,aAAA,CAAAA,aAAA,KACDN,oBAAoB,CAAA,EAAA,EAAA,EAAA;AACvBO,IAAAA,MAAM,EAAE,MAAA;AAAM,GAAA,CAAA;AAElB,CAAC,CAAA;AAED,IAAME,iBAAiB,GAAG;AACxBJ,EAAAA,KAAK,EAAE;AACLK,IAAAA,KAAK,EAAE,OAAA;GACR;AACDF,EAAAA,MAAM,EAAE;AACNE,IAAAA,KAAK,EAAE,QAAA;AACT,GAAA;AACF,CAAU,CAAA;;AAEV;AACA,IAAMC,kBAAkB,GAAG;AACzBN,EAAAA,KAAK,EAAE;AACLO,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAE,QAAQ;AACdC,MAAAA,OAAO,EAAE,UAAA;KACV;AACDC,IAAAA,KAAK,EAAE;AACLF,MAAAA,I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Cc,GAAA,CAACG,GAAG,EAAA/F,aAAA,CAAAA,aAAA,CAAA;AAACkH,UAAAA,SAAS,EAAC,YAAA;SAAiBpH,EAAAA,cAAc,CAACS,MAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAuE,UAAAA,QAAA,EACjDC,0BAAAA;SACE,CAAA,CAAC,GACJ,IAAI,CAAA;AAAA,OACD,CAAC,CAAA;KACH,CAAA,CAAC,EACT1B,WAAW,gBAAGuC,GAAA,CAACuB,OAAO,EAAA,EAAE,CAAC,GAAG,IAAI,CAAA;AAAA,GAAA,CAC1B,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMC,UAAU,gBAAGC,wBAAwB,CAACtE,WAAW,EAAE;AACvDuE,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 as sizeToken } 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 /**\n * Slot for rendering any trailing interaction element into BaseHeader.\n *\n * E.g. Used in accordion to render CollapsibleChevronIcon\n */\n trailingInteractionElement?: React.ReactNode;\n\n /**\n * Decides size of the Header\n */\n size?: 'large' | 'medium';\n /**\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Disabled state of BaseHeader\n *\n * @default false\n */\n isDisabled?: boolean;\n\n paddingX?: BoxProps['paddingX'];\n marginY?: BoxProps['marginY'];\n marginTop?: BoxProps['marginTop'];\n marginBottom?: BoxProps['marginBottom'];\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 | 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 commonCenterBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nconst centerBoxProps: { large: BoxProps; medium: BoxProps } = {\n large: {\n ...commonCenterBoxProps,\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 medium: {\n ...commonCenterBoxProps,\n height: '20px',\n },\n};\n\nconst sizeTokensMapping = {\n large: {\n title: 'large',\n },\n medium: {\n title: 'medium',\n },\n} as const;\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n large: {\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 },\n medium: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'small',\n },\n Link: {\n size: 'small',\n },\n Text: {\n size: 'small',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'small',\n },\n },\n} as const;\n\nconst useTrailingRestriction = ({\n trailing,\n size,\n}: {\n size: NonNullable<BaseHeaderProps['size']>;\n trailing: BaseHeaderProps['trailing'];\n}): 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[size][trailingComponentType];\n const allowedComponents = Object.keys(propRestrictionMap[size]);\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[size][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, size]);\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 paddingX,\n marginY,\n marginBottom,\n marginTop,\n size = 'large',\n isDisabled,\n children,\n trailingInteractionElement,\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction({ trailing, size });\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={marginY ?? { base: 'spacing.5', m: 'spacing.6' }}\n paddingX={paddingX ?? { base: 'spacing.5', m: 'spacing.6' }}\n marginTop={marginTop}\n marginBottom={marginBottom}\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[size]}>\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[size]}>\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={sizeTokensMapping[size].title}\n marginTop={makeSize(sizeToken['1'])}\n weight=\"semibold\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'}\n wordBreak=\"break-word\"\n >\n {title}\n </Text>\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps[size]}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text\n variant=\"body\"\n size=\"small\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n >\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n {validatedTrailingComponent ? (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n ) : null}\n {showCloseButton ? (\n <Box {...centerBoxProps[size]}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n {trailingInteractionElement && !children ? (\n <Box {...centerBoxProps[size]}>{trailingInteractionElement}</Box>\n ) : null}\n </BaseBox>\n <BaseBox\n display=\"flex\"\n width=\"100%\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n >\n <Box width=\"100%\">{children}</Box>\n {trailingInteractionElement && children ? (\n <Box alignSelf=\"flex-start\" {...centerBoxProps[size]}>\n {trailingInteractionElement}\n </Box>\n ) : null}\n </BaseBox>\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":["commonCenterBoxProps","display","alignItems","justifyContent","centerBoxProps","large","_objectSpread","height","medium","sizeTokensMapping","title","propRestrictionMap","Button","size","variant","Badge","Link","Text","Amount","type","useTrailingRestriction","_ref","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","_ref2","subtitle","leading","titleSuffix","_ref2$showDivider","showDivider","_ref2$showBackButton","showBackButton","_ref2$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","paddingX","marginY","marginBottom","marginTop","_ref2$size","isDisabled","children","trailingInteractionElement","shouldWrapTitle","webOnlyEventHandlers","isReactNative","_jsxs","BaseBox","metaAttribute","name","base","m","touchAction","flexDirection","userSelect","_jsx","overflow","marginRight","Box","IconButton","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","undefined","flexShrink","makeSize","sizeToken","weight","color","wordBreak","marginLeft","CloseIcon","width","alignSelf","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,IAAMA,oBAA8B,GAAG;AACrCC,EAAAA,OAAO,EAAE,MAAM;AACfC,EAAAA,UAAU,EAAE,QAAQ;AACpBC,EAAAA,cAAc,EAAE,QAAA;AAClB,CAAC,CAAA;AAED,IAAMC,cAAqD,GAAG;AAC5DC,EAAAA,KAAK,EAAAC,aAAA,CAAAA,aAAA,KACAN,oBAAoB,CAAA,EAAA,EAAA,EAAA;AACvB;AACA;AACA;AACA;AACAO,IAAAA,MAAM,EAAE,MAAA;GACT,CAAA;AACDC,EAAAA,MAAM,EAAAF,aAAA,CAAAA,aA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,EAAA/F,aAAA,CAAAA,aAAA,KAAKF,cAAc,CAACS,MAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAuE,UAAAA,QAAA,EAAGC,0BAAAA;SAAgC,CAAA,CAAC,GAC/D,IAAI,CAAA;AAAA,OACD,CAAC,eACVI,IAAA,CAACC,OAAO,EAAA;AACNzF,QAAAA,OAAO,EAAC,MAAM;AACduH,QAAAA,KAAK,EAAC,MAAM;AACZxB,QAAAA,aAAa,EAAC,KAAK;AACnB9F,QAAAA,UAAU,EAAC,QAAQ;AACnBC,QAAAA,cAAc,EAAC,eAAe;QAAAiF,QAAA,EAAA,cAE9Bc,GAAA,CAACG,GAAG,EAAA;AAACmB,UAAAA,KAAK,EAAC,MAAM;AAAApC,UAAAA,QAAA,EAAEA,QAAAA;AAAQ,SAAM,CAAC,EACjCC,0BAA0B,IAAID,QAAQ,gBACrCc,GAAA,CAACG,GAAG,EAAA/F,aAAA,CAAAA,aAAA,CAAA;AAACmH,UAAAA,SAAS,EAAC,YAAA;SAAiBrH,EAAAA,cAAc,CAACS,MAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAuE,UAAAA,QAAA,EACjDC,0BAAAA;SACE,CAAA,CAAC,GACJ,IAAI,CAAA;AAAA,OACD,CAAC,CAAA;KACH,CAAA,CAAC,EACT1B,WAAW,gBAAGuC,GAAA,CAACwB,OAAO,EAAA,EAAE,CAAC,GAAG,IAAI,CAAA;AAAA,GAAA,CAC1B,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMC,UAAU,gBAAGC,wBAAwB,CAACvE,WAAW,EAAE;AACvDwE,EAAAA,WAAW,EAAE,YAAA;AACf,CAAC;;;;"}
@@ -251,6 +251,7 @@ var _BaseHeader = function _BaseHeader(_ref2) {
251
251
  marginTop: makeSize(size['1']),
252
252
  weight: "semibold",
253
253
  color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal',
254
+ wordBreak: "break-word",
254
255
  children: title
255
256
  }) : null, titleSuffix && /*#__PURE__*/jsx(BaseBox, {
256
257
  marginLeft: "spacing.3",
@@ -291,6 +292,7 @@ var _BaseHeader = function _BaseHeader(_ref2) {
291
292
  alignItems: "center",
292
293
  justifyContent: "space-between",
293
294
  children: [/*#__PURE__*/jsx(Box, {
295
+ width: "100%",
294
296
  children: children
295
297
  }), trailingInteractionElement && children ? /*#__PURE__*/jsx(Box, _objectSpread(_objectSpread({
296
298
  alignSelf: "flex-start"
@@ -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, makeSize } from '~utils';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport { logger, throwBladeError } from '~utils/logger';\nimport { size as sizeToken } 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 /**\n * Slot for rendering any trailing interaction element into BaseHeader.\n *\n * E.g. Used in accordion to render CollapsibleChevronIcon\n */\n trailingInteractionElement?: React.ReactNode;\n\n /**\n * Decides size of the Header\n */\n size?: 'large' | 'medium';\n /**\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Disabled state of BaseHeader\n *\n * @default false\n */\n isDisabled?: boolean;\n\n paddingX?: BoxProps['paddingX'];\n marginY?: BoxProps['marginY'];\n marginTop?: BoxProps['marginTop'];\n marginBottom?: BoxProps['marginBottom'];\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 | 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 commonCenterBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nconst centerBoxProps: { large: BoxProps; medium: BoxProps } = {\n large: {\n ...commonCenterBoxProps,\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 medium: {\n ...commonCenterBoxProps,\n height: '20px',\n },\n};\n\nconst sizeTokensMapping = {\n large: {\n title: 'large',\n },\n medium: {\n title: 'medium',\n },\n} as const;\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n large: {\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 },\n medium: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'small',\n },\n Link: {\n size: 'small',\n },\n Text: {\n size: 'small',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'small',\n },\n },\n} as const;\n\nconst useTrailingRestriction = ({\n trailing,\n size,\n}: {\n size: NonNullable<BaseHeaderProps['size']>;\n trailing: BaseHeaderProps['trailing'];\n}): 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[size][trailingComponentType];\n const allowedComponents = Object.keys(propRestrictionMap[size]);\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[size][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, size]);\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 paddingX,\n marginY,\n marginBottom,\n marginTop,\n size = 'large',\n isDisabled,\n children,\n trailingInteractionElement,\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction({ trailing, size });\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={marginY ?? { base: 'spacing.5', m: 'spacing.6' }}\n paddingX={paddingX ?? { base: 'spacing.5', m: 'spacing.6' }}\n marginTop={marginTop}\n marginBottom={marginBottom}\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[size]}>\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[size]}>\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={sizeTokensMapping[size].title}\n marginTop={makeSize(sizeToken['1'])}\n weight=\"semibold\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'}\n >\n {title}\n </Text>\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps[size]}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text\n variant=\"body\"\n size=\"small\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n >\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n {validatedTrailingComponent ? (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n ) : null}\n {showCloseButton ? (\n <Box {...centerBoxProps[size]}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n {trailingInteractionElement && !children ? (\n <Box {...centerBoxProps[size]}>{trailingInteractionElement}</Box>\n ) : null}\n </BaseBox>\n <BaseBox\n display=\"flex\"\n width=\"100%\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n >\n <Box>{children}</Box>\n {trailingInteractionElement && children ? (\n <Box alignSelf=\"flex-start\" {...centerBoxProps[size]}>\n {trailingInteractionElement}\n </Box>\n ) : null}\n </BaseBox>\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":["commonCenterBoxProps","display","alignItems","justifyContent","centerBoxProps","large","_objectSpread","height","medium","sizeTokensMapping","title","propRestrictionMap","Button","size","variant","Badge","Link","Text","Amount","type","useTrailingRestriction","_ref","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","_ref2","subtitle","leading","titleSuffix","_ref2$showDivider","showDivider","_ref2$showBackButton","showBackButton","_ref2$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","paddingX","marginY","marginBottom","marginTop","_ref2$size","isDisabled","children","trailingInteractionElement","shouldWrapTitle","webOnlyEventHandlers","isReactNative","_jsxs","BaseBox","metaAttribute","name","base","m","touchAction","flexDirection","userSelect","_jsx","overflow","marginRight","Box","IconButton","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","undefined","flexShrink","makeSize","sizeToken","weight","color","marginLeft","CloseIcon","width","alignSelf","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,IAAMA,oBAA8B,GAAG;AACrCC,EAAAA,OAAO,EAAE,MAAM;AACfC,EAAAA,UAAU,EAAE,QAAQ;AACpBC,EAAAA,cAAc,EAAE,QAAA;AAClB,CAAC,CAAA;AAED,IAAMC,cAAqD,GAAG;AAC5DC,EAAAA,KAAK,EAAAC,aAAA,CAAAA,aAAA,KACAN,oBAAoB,CAAA,EAAA,EAAA,EAAA;AACvB;AACA;AACA;AACA;AACAO,IAAAA,MAAM,EAAE,MAAA;GACT,CAAA;AACDC,EAAAA,MAAM,EAAAF,aAAA,CAAAA,aAAA,KACDN,oBAAoB,CAAA,EAAA,EAAA,EAAA;AACvBO,IAAAA,MAAM,EAAE,MAAA;AAAM,GAAA,CAAA;AAElB,CAAC,CAAA;AAED,IAAME,iBAAiB,GAAG;AACxBJ,EAAAA,KAAK,EAAE;AACLK,IAAAA,KAAK,EAAE,OAAA;GACR;AACDF,EAAAA,MAAM,EAAE;AACNE,IAAAA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ZvB,QAAAA,aAAa,EAAC,KAAK;AACnB9F,QAAAA,UAAU,EAAC,QAAQ;AACnBC,QAAAA,cAAc,EAAC,eAAe;QAAAiF,QAAA,EAAA,cAE9Bc,GAAA,CAACG,GAAG,EAAA;AAAAjB,UAAAA,QAAA,EAAEA,QAAAA;AAAQ,SAAM,CAAC,EACpBC,0BAA0B,IAAID,QAAQ,gBACrCc,GAAA,CAACG,GAAG,EAAA/F,aAAA,CAAAA,aAAA,CAAA;AAACkH,UAAAA,SAAS,EAAC,YAAA;SAAiBpH,EAAAA,cAAc,CAACS,MAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAuE,UAAAA,QAAA,EACjDC,0BAAAA;SACE,CAAA,CAAC,GACJ,IAAI,CAAA;AAAA,OACD,CAAC,CAAA;KACH,CAAA,CAAC,EACT1B,WAAW,gBAAGuC,GAAA,CAACuB,OAAO,EAAA,EAAE,CAAC,GAAG,IAAI,CAAA;AAAA,GAAA,CAC1B,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMC,UAAU,gBAAGC,wBAAwB,CAACtE,WAAW,EAAE;AACvDuE,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 as sizeToken } 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 /**\n * Slot for rendering any trailing interaction element into BaseHeader.\n *\n * E.g. Used in accordion to render CollapsibleChevronIcon\n */\n trailingInteractionElement?: React.ReactNode;\n\n /**\n * Decides size of the Header\n */\n size?: 'large' | 'medium';\n /**\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Disabled state of BaseHeader\n *\n * @default false\n */\n isDisabled?: boolean;\n\n paddingX?: BoxProps['paddingX'];\n marginY?: BoxProps['marginY'];\n marginTop?: BoxProps['marginTop'];\n marginBottom?: BoxProps['marginBottom'];\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 | 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 commonCenterBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nconst centerBoxProps: { large: BoxProps; medium: BoxProps } = {\n large: {\n ...commonCenterBoxProps,\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 medium: {\n ...commonCenterBoxProps,\n height: '20px',\n },\n};\n\nconst sizeTokensMapping = {\n large: {\n title: 'large',\n },\n medium: {\n title: 'medium',\n },\n} as const;\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n large: {\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 },\n medium: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'small',\n },\n Link: {\n size: 'small',\n },\n Text: {\n size: 'small',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'small',\n },\n },\n} as const;\n\nconst useTrailingRestriction = ({\n trailing,\n size,\n}: {\n size: NonNullable<BaseHeaderProps['size']>;\n trailing: BaseHeaderProps['trailing'];\n}): 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[size][trailingComponentType];\n const allowedComponents = Object.keys(propRestrictionMap[size]);\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[size][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, size]);\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 paddingX,\n marginY,\n marginBottom,\n marginTop,\n size = 'large',\n isDisabled,\n children,\n trailingInteractionElement,\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction({ trailing, size });\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={marginY ?? { base: 'spacing.5', m: 'spacing.6' }}\n paddingX={paddingX ?? { base: 'spacing.5', m: 'spacing.6' }}\n marginTop={marginTop}\n marginBottom={marginBottom}\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[size]}>\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[size]}>\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={sizeTokensMapping[size].title}\n marginTop={makeSize(sizeToken['1'])}\n weight=\"semibold\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'}\n wordBreak=\"break-word\"\n >\n {title}\n </Text>\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps[size]}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text\n variant=\"body\"\n size=\"small\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n >\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n {validatedTrailingComponent ? (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n ) : null}\n {showCloseButton ? (\n <Box {...centerBoxProps[size]}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n {trailingInteractionElement && !children ? (\n <Box {...centerBoxProps[size]}>{trailingInteractionElement}</Box>\n ) : null}\n </BaseBox>\n <BaseBox\n display=\"flex\"\n width=\"100%\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n >\n <Box width=\"100%\">{children}</Box>\n {trailingInteractionElement && children ? (\n <Box alignSelf=\"flex-start\" {...centerBoxProps[size]}>\n {trailingInteractionElement}\n </Box>\n ) : null}\n </BaseBox>\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":["commonCenterBoxProps","display","alignItems","justifyContent","centerBoxProps","large","_objectSpread","height","medium","sizeTokensMapping","title","propRestrictionMap","Button","size","variant","Badge","Link","Text","Amount","type","useTrailingRestriction","_ref","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","_ref2","subtitle","leading","titleSuffix","_ref2$showDivider","showDivider","_ref2$showBackButton","showBackButton","_ref2$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","paddingX","marginY","marginBottom","marginTop","_ref2$size","isDisabled","children","trailingInteractionElement","shouldWrapTitle","webOnlyEventHandlers","isReactNative","_jsxs","BaseBox","metaAttribute","name","base","m","touchAction","flexDirection","userSelect","_jsx","overflow","marginRight","Box","IconButton","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","undefined","flexShrink","makeSize","sizeToken","weight","color","wordBreak","marginLeft","CloseIcon","width","alignSelf","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,IAAMA,oBAA8B,GAAG;AACrCC,EAAAA,OAAO,EAAE,MAAM;AACfC,EAAAA,UAAU,EAAE,QAAQ;AACpBC,EAAAA,cAAc,EAAE,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AACvDwE,EAAAA,WAAW,EAAE,YAAA;AACf,CAAC;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@razorpay/blade",
3
3
  "description": "The Design System that powers Razorpay",
4
- "version": "11.30.0",
4
+ "version": "11.30.2",
5
5
  "license": "MIT",
6
6
  "engines": {
7
7
  "node": ">=18.12.1"