@razorpay/blade 11.24.2 → 11.24.3

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.
Files changed (23) hide show
  1. package/build/lib/native/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +5 -4
  2. package/build/lib/native/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -1
  3. package/build/lib/native/components/Typography/BaseText/BaseText.native.js +2 -1
  4. package/build/lib/native/components/Typography/BaseText/BaseText.native.js.map +1 -1
  5. package/build/lib/native/utils/useTruncationTitle/useTruncationTitle.native.js +4 -0
  6. package/build/lib/native/utils/useTruncationTitle/useTruncationTitle.native.js.map +1 -0
  7. package/build/lib/web/development/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +49 -34
  8. package/build/lib/web/development/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -1
  9. package/build/lib/web/development/components/Typography/BaseText/BaseText.web.js +6 -3
  10. package/build/lib/web/development/components/Typography/BaseText/BaseText.web.js.map +1 -1
  11. package/build/lib/web/development/utils/useTruncationTitle/index.js +2 -0
  12. package/build/lib/web/development/utils/useTruncationTitle/index.js.map +1 -0
  13. package/build/lib/web/development/utils/useTruncationTitle/useTruncationTitle.web.js +37 -0
  14. package/build/lib/web/development/utils/useTruncationTitle/useTruncationTitle.web.js.map +1 -0
  15. package/build/lib/web/production/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +49 -34
  16. package/build/lib/web/production/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -1
  17. package/build/lib/web/production/components/Typography/BaseText/BaseText.web.js +6 -3
  18. package/build/lib/web/production/components/Typography/BaseText/BaseText.web.js.map +1 -1
  19. package/build/lib/web/production/utils/useTruncationTitle/index.js +2 -0
  20. package/build/lib/web/production/utils/useTruncationTitle/index.js.map +1 -0
  21. package/build/lib/web/production/utils/useTruncationTitle/useTruncationTitle.web.js +37 -0
  22. package/build/lib/web/production/utils/useTruncationTitle/useTruncationTitle.web.js.map +1 -0
  23. package/package.json +1 -1
@@ -3,7 +3,7 @@ import React__default from 'react';
3
3
  import { BaseMenuItemContext } from '../BaseMenuContext.js';
4
4
  import { StyledMenuItemContainer } from './StyledMenuItemContainer.native.js';
5
5
  import { Box } from '../../Box/Box.js';
6
- import '../../Typography/BaseText/BaseText.native.js';
6
+ import { BaseText } from '../../Typography/BaseText/BaseText.native.js';
7
7
  import '@babel/runtime/helpers/slicedToArray';
8
8
  import 'react-native';
9
9
  import '../../../tokens/global/typography.js';
@@ -11,12 +11,13 @@ import '../../../tokens/global/motion.js';
11
11
  import { size } from '../../../tokens/global/size.js';
12
12
  import { makeSize } from '../../../utils/makeSize/makeSize.js';
13
13
  import '../../BladeProvider/useTheme.js';
14
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
15
- import { Text } from '../../Typography/Text/Text.js';
14
+ import { jsx, jsxs } from 'react/jsx-runtime';
15
+ import { getTextProps, Text } from '../../Typography/Text/Text.js';
16
16
  import '../../Typography/Code/Code.js';
17
17
  import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.native.js';
18
+ import { useTruncationTitle } from '../../../utils/useTruncationTitle/useTruncationTitle.native.js';
18
19
 
19
- var _excluded=["title","description","as","leading","trailing","titleSuffix","isDisabled","selectionType","isSelected","isVisible","color","role","children"];var menuItemTitleColor={negative:{default:'feedback.text.negative.intense',disabled:'interactive.text.gray.disabled'},normal:{default:'interactive.text.gray.normal',disabled:'interactive.text.gray.disabled'}};var menuItemDescriptionColor={default:'interactive.text.gray.muted',disabled:'interactive.text.gray.disabled'};var itemFirstRowHeight=makeSize(size[20]);var _BaseMenuItem=function _BaseMenuItem(_ref,ref){var title=_ref.title,description=_ref.description,as=_ref.as,leading=_ref.leading,trailing=_ref.trailing,titleSuffix=_ref.titleSuffix,isDisabled=_ref.isDisabled,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,isSelected=_ref.isSelected,_ref$isVisible=_ref.isVisible,isVisible=_ref$isVisible===void 0?true:_ref$isVisible,color=_ref.color,_ref$role=_ref.role,role=_ref$role===void 0?'menuitem':_ref$role,children=_ref.children,props=_objectWithoutProperties(_ref,_excluded);return jsx(BaseMenuItemContext.Provider,{value:{color:color,isDisabled:isDisabled},children:jsx(StyledMenuItemContainer,Object.assign({ref:ref,as:as,type:"button",disabled:isDisabled},makeAccessible({role:role,current:role==='menuitem'||role==='menuitemcheckbox'?isSelected:undefined,disabled:isDisabled,selected:isSelected}),{color:color,isVisible:isVisible,isSelected:isSelected,isDisabled:isDisabled,selectionType:selectionType},props,{children:children?children:jsx(Fragment,{children:jsxs(Box,{display:"flex",alignItems:"flex-start",width:"100%",justifyContent:"center",children:[jsx(Box,{display:"flex",justifyContent:"center",alignItems:"center",height:itemFirstRowHeight,children:leading}),jsxs(Box,{paddingLeft:leading?'spacing.3':'spacing.0',paddingRight:"spacing.3",display:"flex",flexDirection:"column",children:[jsxs(Box,{display:"flex",alignItems:"center",flexDirection:"row",height:itemFirstRowHeight,children:[jsx(Text,{truncateAfterLines:1,color:menuItemTitleColor[color==='negative'?'negative':'normal'][isDisabled?'disabled':'default'],children:title}),titleSuffix]}),jsx(Box,{children:description?jsx(Text,{color:menuItemDescriptionColor[isDisabled?'disabled':'default'],size:"small",children:description}):null})]}),jsx(Box,{marginLeft:"auto",children:trailing})]})})}))});};var BaseMenuItem=React__default.forwardRef(_BaseMenuItem);
20
+ var _excluded=["title","description","as","leading","trailing","titleSuffix","isDisabled","selectionType","isSelected","isVisible","color","role","children"];var menuItemTitleColor={negative:{default:'feedback.text.negative.intense',disabled:'interactive.text.gray.disabled'},normal:{default:'interactive.text.gray.normal',disabled:'interactive.text.gray.disabled'}};var menuItemDescriptionColor={default:'interactive.text.gray.muted',disabled:'interactive.text.gray.disabled'};var itemFirstRowHeight=makeSize(size[20]);var _BaseMenuItem=function _BaseMenuItem(_ref,ref){var title=_ref.title,description=_ref.description,as=_ref.as,leading=_ref.leading,trailing=_ref.trailing,titleSuffix=_ref.titleSuffix,isDisabled=_ref.isDisabled,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,isSelected=_ref.isSelected,_ref$isVisible=_ref.isVisible,isVisible=_ref$isVisible===void 0?true:_ref$isVisible,color=_ref.color,_ref$role=_ref.role,role=_ref$role===void 0?'menuitem':_ref$role,children=_ref.children,props=_objectWithoutProperties(_ref,_excluded);var _useTruncationTitle=useTruncationTitle({content:title}),containerRef=_useTruncationTitle.containerRef,textRef=_useTruncationTitle.textRef;return jsx(BaseMenuItemContext.Provider,{value:{color:color,isDisabled:isDisabled},children:jsx(StyledMenuItemContainer,Object.assign({ref:ref,as:as,type:"button",disabled:isDisabled},makeAccessible({role:role,current:role==='menuitem'||role==='menuitemcheckbox'?isSelected:undefined,disabled:isDisabled,selected:isSelected}),{color:color,isVisible:isVisible,isSelected:isSelected,isDisabled:isDisabled,selectionType:selectionType},props,{children:children?children:jsxs(Box,{display:"flex",alignItems:"flex-start",width:"100%",justifyContent:"center",children:[jsx(Box,{display:"flex",justifyContent:"center",alignItems:"center",height:itemFirstRowHeight,children:leading}),jsxs(Box,{paddingLeft:leading?'spacing.3':'spacing.0',paddingRight:"spacing.3",display:"flex",flexDirection:"column",children:[jsxs(Box,{display:"flex",alignItems:"center",flexDirection:"row",height:itemFirstRowHeight,ref:containerRef,children:[jsx(BaseText,Object.assign({as:"p",ref:textRef,truncateAfterLines:1,wordBreak:"break-all"},getTextProps({size:'medium',color:menuItemTitleColor[color==='negative'?'negative':'normal'][isDisabled?'disabled':'default'],weight:'regular'}),{children:title})),titleSuffix]}),jsx(Box,{children:description?jsx(Text,{color:menuItemDescriptionColor[isDisabled?'disabled':'default'],size:"small",children:description}):null})]}),jsx(Box,{marginLeft:"auto",children:trailing})]})}))});};var BaseMenuItem=React__default.forwardRef(_BaseMenuItem);
20
21
 
21
22
  export { BaseMenuItem };
22
23
  //# sourceMappingURL=BaseMenuItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseMenuItem.js","sources":["../../../../../../src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseMenuItemProps } from '../types';\nimport { BaseMenuItemContext } from '../BaseMenuContext';\nimport { StyledMenuItemContainer } from './StyledMenuItemContainer';\nimport { Box } from '~components/Box';\nimport { Text } from '~components/Typography';\nimport { size } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeElementRef } from '~utils/types';\n\nconst menuItemTitleColor = {\n negative: {\n default: 'feedback.text.negative.intense',\n disabled: 'interactive.text.gray.disabled',\n },\n normal: { default: 'interactive.text.gray.normal', disabled: 'interactive.text.gray.disabled' },\n} as const;\n\nconst menuItemDescriptionColor = {\n default: 'interactive.text.gray.muted',\n disabled: 'interactive.text.gray.disabled',\n} as const;\n\n// This is the height of item excluding the description to make sure description comes at the bottom and other first row items are center aligned\nconst itemFirstRowHeight = makeSize(size[20]);\n\nconst _BaseMenuItem: React.ForwardRefRenderFunction<BladeElementRef, BaseMenuItemProps> = (\n {\n title,\n description,\n as,\n leading,\n trailing,\n titleSuffix,\n isDisabled,\n selectionType = 'single',\n isSelected,\n isVisible = true,\n color,\n role = 'menuitem',\n children,\n ...props\n },\n ref,\n): React.ReactElement => {\n return (\n <BaseMenuItemContext.Provider value={{ color, isDisabled }}>\n <StyledMenuItemContainer\n ref={ref as never}\n as={as}\n type=\"button\"\n disabled={isDisabled}\n {...makeAccessible({\n role,\n current: role === 'menuitem' || role === 'menuitemcheckbox' ? isSelected : undefined,\n disabled: isDisabled,\n selected: isSelected,\n })}\n color={color}\n isVisible={isVisible}\n isSelected={isSelected}\n isDisabled={isDisabled}\n selectionType={selectionType}\n {...props}\n >\n {children ? (\n children\n ) : (\n <>\n <Box display=\"flex\" alignItems=\"flex-start\" width=\"100%\" justifyContent=\"center\">\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n height={itemFirstRowHeight}\n >\n {leading}\n </Box>\n <Box\n paddingLeft={leading ? 'spacing.3' : 'spacing.0'}\n paddingRight=\"spacing.3\"\n display=\"flex\"\n flexDirection=\"column\"\n >\n <Box\n display=\"flex\"\n alignItems=\"center\"\n flexDirection=\"row\"\n height={itemFirstRowHeight}\n >\n <Text\n truncateAfterLines={1}\n color={\n menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][\n isDisabled ? 'disabled' : 'default'\n ]\n }\n >\n {title}\n </Text>\n {titleSuffix}\n </Box>\n <Box>\n {description ? (\n <Text\n color={menuItemDescriptionColor[isDisabled ? 'disabled' : 'default']}\n size=\"small\"\n >\n {description}\n </Text>\n ) : null}\n </Box>\n </Box>\n <Box marginLeft=\"auto\">{trailing}</Box>\n </Box>\n </>\n )}\n </StyledMenuItemContainer>\n </BaseMenuItemContext.Provider>\n );\n};\n\nconst BaseMenuItem = React.forwardRef(_BaseMenuItem);\n\nexport { BaseMenuItem };\n"],"names":["menuItemTitleColor","negative","default","disabled","normal","menuItemDescriptionColor","itemFirstRowHeight","makeSize","size","_BaseMenuItem","_ref","ref","title","description","as","leading","trailing","titleSuffix","isDisabled","_ref$selectionType","selectionType","isSelected","_ref$isVisible","isVisible","color","_ref$role","role","children","props","_objectWithoutProperties","_excluded","_jsx","BaseMenuItemContext","Provider","value","StyledMenuItemContainer","Object","assign","type","makeAccessible","current","undefined","selected","_Fragment","_jsxs","Box","display","alignItems","width","justifyContent","height","paddingLeft","paddingRight","flexDirection","Text","truncateAfterLines","marginLeft","BaseMenuItem","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,aAAA,CAAA,IAAA,CAAA,SAAA,CAAA,UAAA,CAAA,aAAA,CAAA,YAAA,CAAA,eAAA,CAAA,YAAA,CAAA,WAAA,CAAA,OAAA,CAAA,MAAA,CAAA,UAAA,CAAA,CAWA,IAAMA,kBAAkB,CAAG,CACzBC,QAAQ,CAAE,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,IAAA,CAACC,GAAG,CACFC,CAAAA,OAAO,CAAC,MAAM,CACdC,UAAU,CAAC,QAAQ,CACnBM,aAAa,CAAC,KAAK,CACnBH,MAAM,CAAE5C,kBAAmB,CAAAqB,QAAA,CAAA,CAE3BI,GAAA,CAACuB,IAAI,CAAA,CACHC,kBAAkB,CAAE,CAAE,CACtB/B,KAAK,CACHxB,kBAAkB,CAACwB,KAAK,GAAK,UAAU,CAAG,UAAU,CAAG,QAAQ,CAAC,CAC9DN,UAAU,CAAG,UAAU,CAAG,SAAS,CAEtC,CAAAS,QAAA,CAEAf,KAAK,CACF,CAAC,CACNK,WAAW,CAAA,CACT,CAAC,CACNc,GAAA,CAACc,GAAG,CAAA,CAAAlB,QAAA,CACDd,WAAW,CACVkB,GAAA,CAACuB,IAAI,CACH9B,CAAAA,KAAK,CAAEnB,wBAAwB,CAACa,UAAU,CAAG,UAAU,CAAG,SAAS,CAAE,CACrEV,IAAI,CAAC,OAAO,CAAAmB,QAAA,CAEXd,WAAW,CACR,CAAC,CACL,IAAI,CACL,CAAC,CACH,CAAA,CAAC,CACNkB,GAAA,CAACc,GAAG,CAAA,CAACW,UAAU,CAAC,MAAM,CAAA7B,QAAA,CAAEX,QAAQ,CAAM,CAAC,CAAA,CACpC,CAAC,CACN,CACH,CAAA,CACsB,CAAC,CACE,CAAC,CAEnC,CAAC,CAEK,IAAAyC,YAAY,CAAGC,cAAK,CAACC,UAAU,CAAClD,aAAa;;;;"}
1
+ {"version":3,"file":"BaseMenuItem.js","sources":["../../../../../../src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseMenuItemProps } from '../types';\nimport { BaseMenuItemContext } from '../BaseMenuContext';\nimport { StyledMenuItemContainer } from './StyledMenuItemContainer';\nimport { Box } from '~components/Box';\nimport { getTextProps, Text } from '~components/Typography';\nimport { size } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeElementRef } from '~utils/types';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { useTruncationTitle } from '~utils/useTruncationTitle';\n\nconst menuItemTitleColor = {\n negative: {\n default: 'feedback.text.negative.intense',\n disabled: 'interactive.text.gray.disabled',\n },\n normal: { default: 'interactive.text.gray.normal', disabled: 'interactive.text.gray.disabled' },\n} as const;\n\nconst menuItemDescriptionColor = {\n default: 'interactive.text.gray.muted',\n disabled: 'interactive.text.gray.disabled',\n} as const;\n\n// This is the height of item excluding the description to make sure description comes at the bottom and other first row items are center aligned\nconst itemFirstRowHeight = makeSize(size[20]);\n\nconst _BaseMenuItem: React.ForwardRefRenderFunction<BladeElementRef, BaseMenuItemProps> = (\n {\n title,\n description,\n as,\n leading,\n trailing,\n titleSuffix,\n isDisabled,\n selectionType = 'single',\n isSelected,\n isVisible = true,\n color,\n role = 'menuitem',\n children,\n ...props\n },\n ref,\n): React.ReactElement => {\n const { containerRef, textRef } = useTruncationTitle({ content: title });\n return (\n <BaseMenuItemContext.Provider value={{ color, isDisabled }}>\n <StyledMenuItemContainer\n ref={ref as never}\n as={as}\n type=\"button\"\n disabled={isDisabled}\n {...makeAccessible({\n role,\n current: role === 'menuitem' || role === 'menuitemcheckbox' ? isSelected : undefined,\n disabled: isDisabled,\n selected: isSelected,\n })}\n color={color}\n isVisible={isVisible}\n isSelected={isSelected}\n isDisabled={isDisabled}\n selectionType={selectionType}\n {...props}\n >\n {children ? (\n children\n ) : (\n <Box display=\"flex\" alignItems=\"flex-start\" width=\"100%\" justifyContent=\"center\">\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n height={itemFirstRowHeight}\n >\n {leading}\n </Box>\n <Box\n paddingLeft={leading ? 'spacing.3' : 'spacing.0'}\n paddingRight=\"spacing.3\"\n display=\"flex\"\n flexDirection=\"column\"\n >\n <Box\n display=\"flex\"\n alignItems=\"center\"\n flexDirection=\"row\"\n height={itemFirstRowHeight}\n ref={containerRef as never}\n >\n <BaseText\n as=\"p\"\n ref={textRef as never}\n truncateAfterLines={1}\n wordBreak=\"break-all\"\n {...getTextProps({\n size: 'medium',\n color:\n menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][\n isDisabled ? 'disabled' : 'default'\n ],\n weight: 'regular',\n })}\n >\n {title}\n </BaseText>\n {titleSuffix}\n </Box>\n <Box>\n {description ? (\n <Text\n color={menuItemDescriptionColor[isDisabled ? 'disabled' : 'default']}\n size=\"small\"\n >\n {description}\n </Text>\n ) : null}\n </Box>\n </Box>\n <Box marginLeft=\"auto\">{trailing}</Box>\n </Box>\n )}\n </StyledMenuItemContainer>\n </BaseMenuItemContext.Provider>\n );\n};\n\nconst BaseMenuItem = React.forwardRef(_BaseMenuItem);\n\nexport { BaseMenuItem };\n"],"names":["menuItemTitleColor","negative","default","disabled","normal","menuItemDescriptionColor","itemFirstRowHeight","makeSize","size","_BaseMenuItem","_ref","ref","title","description","as","leading","trailing","titleSuffix","isDisabled","_ref$selectionType","selectionType","isSelected","_ref$isVisible","isVisible","color","_ref$role","role","children","props","_objectWithoutProperties","_excluded","_useTruncationTitle","useTruncationTitle","content","containerRef","textRef","_jsx","BaseMenuItemContext","Provider","value","StyledMenuItemContainer","Object","assign","type","makeAccessible","current","undefined","selected","_jsxs","Box","display","alignItems","width","justifyContent","height","paddingLeft","paddingRight","flexDirection","BaseText","truncateAfterLines","wordBreak","getTextProps","weight","Text","marginLeft","BaseMenuItem","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,aAAA,CAAA,IAAA,CAAA,SAAA,CAAA,UAAA,CAAA,aAAA,CAAA,YAAA,CAAA,eAAA,CAAA,YAAA,CAAA,WAAA,CAAA,OAAA,CAAA,MAAA,CAAA,UAAA,CAAA,CAaA,IAAMA,kBAAkB,CAAG,CACzBC,QAAQ,CAAE,CACRC,OAAO,CAAE,gCAAgC,CACzCC,QAAQ,CAAE,gCACZ,CAAC,CACDC,MAAM,CA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time/helpers/objectWithoutProperties';
2
+ import React__default from 'react';
2
3
  import styled from 'styled-components/native';
3
4
  import getBaseTextStyles from './getBaseTextStyles.js';
4
5
  import { metaAttribute } from '../../../utils/metaAttribute/metaAttribute.native.js';
@@ -8,7 +9,7 @@ import { useStyledProps } from '../../Box/styledProps/useStyledProps.js';
8
9
  import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.native.js';
9
10
  import { jsx } from 'react/jsx-runtime';
10
11
 
11
- var _excluded=["color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","letterSpacing","textAlign","as","opacity"],_excluded2=["id","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","lineHeight","textAlign","children","truncateAfterLines","opacity","className","style","accessibilityProps","componentName","testID"];var StyledBaseText=styled.Text(function(_ref){var color=_ref.color,fontFamily=_ref.fontFamily,fontSize=_ref.fontSize,fontWeight=_ref.fontWeight,fontStyle=_ref.fontStyle,textDecorationLine=_ref.textDecorationLine,numberOfLines=_ref.numberOfLines,lineHeight=_ref.lineHeight,letterSpacing=_ref.letterSpacing,textAlign=_ref.textAlign;_ref.as;var opacity=_ref.opacity,props=_objectWithoutProperties(_ref,_excluded);var styledPropsCSSObject=useStyledProps(props);return Object.assign({},getBaseTextStyles({color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,numberOfLines:numberOfLines,lineHeight:lineHeight,letterSpacing:letterSpacing,textAlign:textAlign,opacity:opacity,theme:props.theme}),styledPropsCSSObject);});var BaseText=function BaseText(_ref2){var id=_ref2.id,color=_ref2.color,fontFamily=_ref2.fontFamily,fontSize=_ref2.fontSize,fontWeight=_ref2.fontWeight,fontStyle=_ref2.fontStyle,textDecorationLine=_ref2.textDecorationLine,lineHeight=_ref2.lineHeight,textAlign=_ref2.textAlign,children=_ref2.children,truncateAfterLines=_ref2.truncateAfterLines,opacity=_ref2.opacity,className=_ref2.className,style=_ref2.style,_ref2$accessibilityPr=_ref2.accessibilityProps,accessibilityProps=_ref2$accessibilityPr===void 0?{}:_ref2$accessibilityPr,_ref2$componentName=_ref2.componentName,componentName=_ref2$componentName===void 0?MetaConstants.BaseText:_ref2$componentName,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded2);return jsx(StyledBaseText,Object.assign({},getStyledProps(styledProps),{color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:lineHeight,as:undefined,textAlign:textAlign,numberOfLines:truncateAfterLines,opacity:opacity,className:className,style:style,id:id},makeAccessible(accessibilityProps),metaAttribute({name:componentName,testID:testID}),{children:children}));};
12
+ var _excluded=["color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","letterSpacing","textAlign","as","opacity"],_excluded2=["id","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","lineHeight","textAlign","children","truncateAfterLines","opacity","className","style","accessibilityProps","componentName","testID"];var StyledBaseText=styled.Text(function(_ref){var color=_ref.color,fontFamily=_ref.fontFamily,fontSize=_ref.fontSize,fontWeight=_ref.fontWeight,fontStyle=_ref.fontStyle,textDecorationLine=_ref.textDecorationLine,numberOfLines=_ref.numberOfLines,lineHeight=_ref.lineHeight,letterSpacing=_ref.letterSpacing,textAlign=_ref.textAlign;_ref.as;var opacity=_ref.opacity,props=_objectWithoutProperties(_ref,_excluded);var styledPropsCSSObject=useStyledProps(props);return Object.assign({},getBaseTextStyles({color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,numberOfLines:numberOfLines,lineHeight:lineHeight,letterSpacing:letterSpacing,textAlign:textAlign,opacity:opacity,theme:props.theme}),styledPropsCSSObject);});var _BaseText=function _BaseText(_ref2,ref){var id=_ref2.id,color=_ref2.color,fontFamily=_ref2.fontFamily,fontSize=_ref2.fontSize,fontWeight=_ref2.fontWeight,fontStyle=_ref2.fontStyle,textDecorationLine=_ref2.textDecorationLine,lineHeight=_ref2.lineHeight,textAlign=_ref2.textAlign,children=_ref2.children,truncateAfterLines=_ref2.truncateAfterLines,opacity=_ref2.opacity,className=_ref2.className,style=_ref2.style,_ref2$accessibilityPr=_ref2.accessibilityProps,accessibilityProps=_ref2$accessibilityPr===void 0?{}:_ref2$accessibilityPr,_ref2$componentName=_ref2.componentName,componentName=_ref2$componentName===void 0?MetaConstants.BaseText:_ref2$componentName,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded2);return jsx(StyledBaseText,Object.assign({ref:ref},getStyledProps(styledProps),{color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:lineHeight,as:undefined,textAlign:textAlign,numberOfLines:truncateAfterLines,opacity:opacity,className:className,style:style,id:id},makeAccessible(accessibilityProps),metaAttribute({name:componentName,testID:testID}),{children:children}));};var BaseText=React__default.forwardRef(_BaseText);
12
13
 
13
14
  export { BaseText };
14
15
  //# sourceMappingURL=BaseText.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseText.native.js","sources":["../../../../../../src/components/Typography/BaseText/BaseText.native.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport styled from 'styled-components/native';\nimport getBaseTextStyles from './getBaseTextStyles';\nimport type { BaseTextProps, StyledBaseTextProps } from './types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps, useStyledProps } from '~components/Box/styledProps';\nimport { makeAccessible } from '~utils/makeAccessible';\n\nconst StyledBaseText = styled.Text<StyledBaseTextProps>(\n ({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n as,\n opacity,\n ...props\n }) => {\n const styledPropsCSSObject = useStyledProps(props);\n\n return {\n ...getBaseTextStyles({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n opacity,\n theme: props.theme,\n }),\n ...styledPropsCSSObject,\n };\n },\n);\n\nexport const BaseText = ({\n id,\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n lineHeight,\n textAlign,\n children,\n truncateAfterLines,\n opacity,\n className,\n style,\n accessibilityProps = {},\n componentName = MetaConstants.BaseText,\n testID,\n ...styledProps\n}: BaseTextProps): ReactElement => {\n return (\n <StyledBaseText\n {...getStyledProps(styledProps)}\n color={color}\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={fontWeight}\n fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n lineHeight={lineHeight}\n as={undefined}\n textAlign={textAlign}\n numberOfLines={truncateAfterLines}\n opacity={opacity}\n className={className}\n style={style}\n id={id}\n {...makeAccessible(accessibilityProps)}\n {...metaAttribute({ name: componentName, testID })}\n >\n {children}\n </StyledBaseText>\n );\n};\n"],"names":["StyledBaseText","styled","Text","_ref","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","letterSpacing","textAlign","as","opacity","props","_objectWithoutProperties","_excluded","styledPropsCSSObject","useStyledProps","Object","assign","getBaseTextStyles","theme","BaseText","_ref2","id","children","truncateAfterLines","className","style","_ref2$accessibilityPr","accessibilityProps","_ref2$componentName","componentName","MetaConstants","testID","styledProps","_excluded2","_jsx","getStyledProps","undefined","makeAccessible","metaAttribute","name"],"mappings":";;;;;;;;;;2YAQA,IAAMA,cAAc,CAAGC,MAAM,CAACC,IAAI,CAChC,SAAAC,IAAA,CAcM,CAbJ,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,UAAU,CAAAF,IAAA,CAAVE,UAAU,CACVC,QAAQ,CAAAH,IAAA,CAARG,QAAQ,CACRC,UAAU,CAAAJ,IAAA,CAAVI,UAAU,CACVC,SAAS,CAAAL,IAAA,CAATK,SA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"}
1
+ {"version":3,"file":"BaseText.native.js","sources":["../../../../../../src/components/Typography/BaseText/BaseText.native.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport styled from 'styled-components/native';\nimport getBaseTextStyles from './getBaseTextStyles';\nimport type { BaseTextProps, StyledBaseTextProps } from './types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps, useStyledProps } from '~components/Box/styledProps';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeElementRef } from '~utils/types';\n\nconst StyledBaseText = styled.Text<StyledBaseTextProps>(\n ({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n as,\n opacity,\n ...props\n }) => {\n const styledPropsCSSObject = useStyledProps(props);\n\n return {\n ...getBaseTextStyles({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n opacity,\n theme: props.theme,\n }),\n ...styledPropsCSSObject,\n };\n },\n);\n\nconst _BaseText: React.ForwardRefRenderFunction<BladeElementRef, BaseTextProps> = (\n {\n id,\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n lineHeight,\n textAlign,\n children,\n truncateAfterLines,\n opacity,\n className,\n style,\n accessibilityProps = {},\n componentName = MetaConstants.BaseText,\n testID,\n ...styledProps\n },\n ref,\n): ReactElement => {\n return (\n <StyledBaseText\n ref={ref}\n {...getStyledProps(styledProps)}\n color={color}\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={fontWeight}\n fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n lineHeight={lineHeight}\n as={undefined}\n textAlign={textAlign}\n numberOfLines={truncateAfterLines}\n opacity={opacity}\n className={className}\n style={style}\n id={id}\n {...makeAccessible(accessibilityProps)}\n {...metaAttribute({ name: componentName, testID })}\n >\n {children}\n </StyledBaseText>\n );\n};\n\nconst BaseText = React.forwardRef(_BaseText);\n\nexport { BaseText };\n"],"names":["StyledBaseText","styled","Text","_ref","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","letterSpacing","textAlign","as","opacity","props","_objectWithoutProperties","_excluded","styledPropsCSSObject","useStyledProps","Object","assign","getBaseTextStyles","theme","_BaseText","_ref2","ref","id","children","truncateAfterLines","className","style","_ref2$accessibilityPr","accessibilityProps","_ref2$componentName","componentName","MetaConstants","BaseText","testID","styledProps","_excluded2","_jsx","getStyledProps","undefined","makeAccessible","metaAttribute","name","React","forwardRef"],"mappings":";;;;;;;;;;;2YAUA,IAAMA,cAAc,CAAGC,MAAM,CAACC,IAAI,CAChC,SAAAC,IAAA,CAcM,CAbJ,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,UAAU,CAAAF,IAAA,CAAVE,UAAU,CACVC,QAAQ,CAAAH,IAAA,CAARG,QAAQ,CACRC,UAAU,CAAAJ,IAAA,CAAVI,UAAU,CACVC,SAAS,CAAAL,IAAA,CAATK,SAAS,CACTC,kBAAkB,CAAAN,IAAA,CAAlBM,kBAAkB,CAClBC,aAAa,CAAAP,IAAA,CAAbO,aAAa,CACbC,UAAU,CAAAR,IAAA,CAAVQ,UAAU,CACVC,aAAa,CAAAT,IAAA,CAAbS,aAAa,CACbC,SAAS,CAAAV,IAAA,CAATU,SAAS,CACPV,IAAA,CAAFW,EAAE,KACFC,OAAO,CAAAZ,IAAA,CAAPY,OAAO,CACJC,KAAK,CAAAC,wBAAA,CAAAd,IAAA,CAAAe,SAAA,EAER,IAAMC,oBAAoB,CAAGC,cAAc,CAACJ,KAAK,CAAC,CAElD,OAAAK,MAAA,CAAAC,MAAA,CACKC,EAAAA,CAAAA,iBAAiB,CAAC,CACnBnB,KAAK,CAALA,KAAK,CACLC,UAAU,CAAVA,UAAU,CACVC,QAAQ,CAARA,QAAQ,CACRC,UAAU,CAAVA,UAAU,C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AA,CAAAS,KAAA,CAAAe,UAAA,CAAA,CAIhB,OACEC,GAAA,CAAC1C,cAAc,CAAAqB,MAAA,CAAAC,MAAA,CAAA,CACbK,GAAG,CAAEA,GAAI,CAAA,CACLgB,cAAc,CAACH,WAAW,CAAC,CAAA,CAC/BpC,KAAK,CAAEA,KAAM,CACbC,UAAU,CAAEA,UAAW,CACvBC,QAAQ,CAAEA,QAAS,CACnBC,UAAU,CAAEA,UAAW,CACvBC,SAAS,CAAEA,SAAU,CACrBC,kBAAkB,CAAEA,kBAAmB,CACvCE,UAAU,CAAEA,UAAW,CACvBG,EAAE,CAAE8B,SAAU,CACd/B,SAAS,CAAEA,SAAU,CACrBH,aAAa,CAAEoB,kBAAmB,CAClCf,OAAO,CAAEA,OAAQ,CACjBgB,SAAS,CAAEA,SAAU,CACrBC,KAAK,CAAEA,KAAM,CACbJ,EAAE,CAAEA,EAAG,CACHiB,CAAAA,cAAc,CAACX,kBAAkB,CAAC,CAClCY,aAAa,CAAC,CAAEC,IAAI,CAAEX,aAAa,CAAEG,MAAM,CAANA,MAAO,CAAC,CAAC,CAAA,CAAAV,QAAA,CAEjDA,QAAQ,CACK,CAAA,CAAC,CAErB,CAAC,CAEK,IAAAS,QAAQ,CAAGU,cAAK,CAACC,UAAU,CAACxB,SAAS;;;;"}
@@ -0,0 +1,4 @@
1
+ var useTruncationTitle=function useTruncationTitle(_ref){_ref.content;return {containerRef:{current:null},textRef:{current:null}};};
2
+
3
+ export { useTruncationTitle };
4
+ //# sourceMappingURL=useTruncationTitle.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTruncationTitle.native.js","sources":["../../../../../src/utils/useTruncationTitle/useTruncationTitle.native.tsx"],"sourcesContent":["const useTruncationTitle = ({\n content: _,\n}: {\n content?: string;\n}): {\n containerRef: { current: null };\n textRef: { current: null };\n} => {\n return {\n containerRef: { current: null },\n textRef: { current: null },\n };\n};\n\nexport { useTruncationTitle };\n"],"names":["useTruncationTitle","_ref","content","containerRef","current","textRef"],"mappings":"AAAM,IAAAA,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAAC,IAAA,CAOnB,CANOA,IAAA,CAAVC,QAOA,OAAO,CACLC,YAAY,CAAE,CAAEC,OAAO,CAAE,IAAK,CAAC,CAC/BC,OAAO,CAAE,CAAED,OAAO,CAAE,IAAK,CAC3B,CAAC,CACH;;;;"}
@@ -8,12 +8,16 @@ import '../../Typography/index.js';
8
8
  import '../../../tokens/global/index.js';
9
9
  import '../../../utils/index.js';
10
10
  import '../../../utils/makeAccessible/index.js';
11
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
11
+ import '../../Typography/BaseText/index.js';
12
+ import '../../../utils/useTruncationTitle/index.js';
13
+ import { jsx, jsxs } from 'react/jsx-runtime';
12
14
  import { makeSize } from '../../../utils/makeSize/makeSize.js';
13
15
  import { size } from '../../../tokens/global/size.js';
16
+ import { useTruncationTitle } from '../../../utils/useTruncationTitle/useTruncationTitle.web.js';
14
17
  import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.web.js';
15
18
  import { Box } from '../../Box/Box.js';
16
- import { Text } from '../../Typography/Text/Text.js';
19
+ import { BaseText } from '../../Typography/BaseText/BaseText.web.js';
20
+ import { getTextProps, Text } from '../../Typography/Text/Text.js';
17
21
 
18
22
  var _excluded = ["title", "description", "as", "leading", "trailing", "titleSuffix", "isDisabled", "selectionType", "isSelected", "isVisible", "color", "role", "children"];
19
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -53,6 +57,11 @@ var _BaseMenuItem = function _BaseMenuItem(_ref, ref) {
53
57
  role = _ref$role === void 0 ? 'menuitem' : _ref$role,
54
58
  children = _ref.children,
55
59
  props = _objectWithoutProperties(_ref, _excluded);
60
+ var _useTruncationTitle = useTruncationTitle({
61
+ content: title
62
+ }),
63
+ containerRef = _useTruncationTitle.containerRef,
64
+ textRef = _useTruncationTitle.textRef;
56
65
  return /*#__PURE__*/jsx(BaseMenuItemContext.Provider, {
57
66
  value: {
58
67
  color: color,
@@ -75,45 +84,51 @@ var _BaseMenuItem = function _BaseMenuItem(_ref, ref) {
75
84
  isDisabled: isDisabled,
76
85
  selectionType: selectionType
77
86
  }, props), {}, {
78
- children: children ? children : /*#__PURE__*/jsx(Fragment, {
79
- children: /*#__PURE__*/jsxs(Box, {
87
+ children: children ? children : /*#__PURE__*/jsxs(Box, {
88
+ display: "flex",
89
+ alignItems: "flex-start",
90
+ width: "100%",
91
+ justifyContent: "center",
92
+ children: [/*#__PURE__*/jsx(Box, {
80
93
  display: "flex",
81
- alignItems: "flex-start",
82
- width: "100%",
83
94
  justifyContent: "center",
84
- children: [/*#__PURE__*/jsx(Box, {
95
+ alignItems: "center",
96
+ height: itemFirstRowHeight,
97
+ children: leading
98
+ }), /*#__PURE__*/jsxs(Box, {
99
+ paddingLeft: leading ? 'spacing.3' : 'spacing.0',
100
+ paddingRight: "spacing.3",
101
+ display: "flex",
102
+ flexDirection: "column",
103
+ children: [/*#__PURE__*/jsxs(Box, {
85
104
  display: "flex",
86
- justifyContent: "center",
87
105
  alignItems: "center",
106
+ flexDirection: "row",
88
107
  height: itemFirstRowHeight,
89
- children: leading
90
- }), /*#__PURE__*/jsxs(Box, {
91
- paddingLeft: leading ? 'spacing.3' : 'spacing.0',
92
- paddingRight: "spacing.3",
93
- display: "flex",
94
- flexDirection: "column",
95
- children: [/*#__PURE__*/jsxs(Box, {
96
- display: "flex",
97
- alignItems: "center",
98
- flexDirection: "row",
99
- height: itemFirstRowHeight,
100
- children: [/*#__PURE__*/jsx(Text, {
101
- truncateAfterLines: 1,
102
- color: menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][isDisabled ? 'disabled' : 'default'],
103
- children: title
104
- }), titleSuffix]
105
- }), /*#__PURE__*/jsx(Box, {
106
- children: description ? /*#__PURE__*/jsx(Text, {
107
- color: menuItemDescriptionColor[isDisabled ? 'disabled' : 'default'],
108
- size: "small",
109
- children: description
110
- }) : null
111
- })]
108
+ ref: containerRef,
109
+ children: [/*#__PURE__*/jsx(BaseText, _objectSpread(_objectSpread({
110
+ as: "p",
111
+ ref: textRef,
112
+ truncateAfterLines: 1,
113
+ wordBreak: "break-all"
114
+ }, getTextProps({
115
+ size: 'medium',
116
+ color: menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][isDisabled ? 'disabled' : 'default'],
117
+ weight: 'regular'
118
+ })), {}, {
119
+ children: title
120
+ })), titleSuffix]
112
121
  }), /*#__PURE__*/jsx(Box, {
113
- marginLeft: "auto",
114
- children: trailing
122
+ children: description ? /*#__PURE__*/jsx(Text, {
123
+ color: menuItemDescriptionColor[isDisabled ? 'disabled' : 'default'],
124
+ size: "small",
125
+ children: description
126
+ }) : null
115
127
  })]
116
- })
128
+ }), /*#__PURE__*/jsx(Box, {
129
+ marginLeft: "auto",
130
+ children: trailing
131
+ })]
117
132
  })
118
133
  }))
119
134
  });
@@ -1 +1 @@
1
- {"version":3,"file":"BaseMenuItem.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseMenuItemProps } from '../types';\nimport { BaseMenuItemContext } from '../BaseMenuContext';\nimport { StyledMenuItemContainer } from './StyledMenuItemContainer';\nimport { Box } from '~components/Box';\nimport { Text } from '~components/Typography';\nimport { size } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeElementRef } from '~utils/types';\n\nconst menuItemTitleColor = {\n negative: {\n default: 'feedback.text.negative.intense',\n disabled: 'interactive.text.gray.disabled',\n },\n normal: { default: 'interactive.text.gray.normal', disabled: 'interactive.text.gray.disabled' },\n} as const;\n\nconst menuItemDescriptionColor = {\n default: 'interactive.text.gray.muted',\n disabled: 'interactive.text.gray.disabled',\n} as const;\n\n// This is the height of item excluding the description to make sure description comes at the bottom and other first row items are center aligned\nconst itemFirstRowHeight = makeSize(size[20]);\n\nconst _BaseMenuItem: React.ForwardRefRenderFunction<BladeElementRef, BaseMenuItemProps> = (\n {\n title,\n description,\n as,\n leading,\n trailing,\n titleSuffix,\n isDisabled,\n selectionType = 'single',\n isSelected,\n isVisible = true,\n color,\n role = 'menuitem',\n children,\n ...props\n },\n ref,\n): React.ReactElement => {\n return (\n <BaseMenuItemContext.Provider value={{ color, isDisabled }}>\n <StyledMenuItemContainer\n ref={ref as never}\n as={as}\n type=\"button\"\n disabled={isDisabled}\n {...makeAccessible({\n role,\n current: role === 'menuitem' || role === 'menuitemcheckbox' ? isSelected : undefined,\n disabled: isDisabled,\n selected: isSelected,\n })}\n color={color}\n isVisible={isVisible}\n isSelected={isSelected}\n isDisabled={isDisabled}\n selectionType={selectionType}\n {...props}\n >\n {children ? (\n children\n ) : (\n <>\n <Box display=\"flex\" alignItems=\"flex-start\" width=\"100%\" justifyContent=\"center\">\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n height={itemFirstRowHeight}\n >\n {leading}\n </Box>\n <Box\n paddingLeft={leading ? 'spacing.3' : 'spacing.0'}\n paddingRight=\"spacing.3\"\n display=\"flex\"\n flexDirection=\"column\"\n >\n <Box\n display=\"flex\"\n alignItems=\"center\"\n flexDirection=\"row\"\n height={itemFirstRowHeight}\n >\n <Text\n truncateAfterLines={1}\n color={\n menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][\n isDisabled ? 'disabled' : 'default'\n ]\n }\n >\n {title}\n </Text>\n {titleSuffix}\n </Box>\n <Box>\n {description ? (\n <Text\n color={menuItemDescriptionColor[isDisabled ? 'disabled' : 'default']}\n size=\"small\"\n >\n {description}\n </Text>\n ) : null}\n </Box>\n </Box>\n <Box marginLeft=\"auto\">{trailing}</Box>\n </Box>\n </>\n )}\n </StyledMenuItemContainer>\n </BaseMenuItemContext.Provider>\n );\n};\n\nconst BaseMenuItem = React.forwardRef(_BaseMenuItem);\n\nexport { BaseMenuItem };\n"],"names":["menuItemTitleColor","negative","disabled","normal","menuItemDescriptionColor","itemFirstRowHeight","makeSize","size","_BaseMenuItem","_ref","ref","title","description","as","leading","trailing","titleSuffix","isDisabled","_ref$selectionType","selectionType","isSelected","_ref$isVisible","isVisible","color","_ref$role","role","children","props","_objectWithoutProperties","_excluded","_jsx","BaseMenuItemContext","Provider","value","StyledMenuItemContainer","_objectSpread","type","makeAccessible","current","undefined","selected","_Fragment","_jsxs","Box","display","alignItems","width","justifyContent","height","paddingLeft","paddingRight","flexDirection","Text","truncateAfterLines","marginLeft","BaseMenuItem","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,kBAAkB,GAAG;AACzBC,EAAAA,QAAQ,EAAE;AACR,IAAA,SAAA,EAAS,gCAAgC;AACzCC,IAAAA,QAAQ,EAAE,gCAAA;GACX;AACDC,EAAAA,MAAM,EAAE;AAAE,IAAA,SAAA,EAAS,8BAA8B;AAAED,IAAAA,QAAQ,EAAE,gCAAA;AAAiC,GAAA;AAChG,CAAU,CAAA;AAEV,IAAME,wBAAwB,GAAG;AAC/B,EAAA,SAAA,EAAS,6BAA6B;AACtCF,EAAAA,QAAQ,EAAE,gCAAA;AACZ,CAAU,CAAA;;AAEV;AACA,IAAMG,kBAAkB,GAAGC,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;AAE7C,IAAMC,aAAiF,GAAG,SAApFA,aAAiFA,CAAAC,IAAA,EAiBrFC,GAAG,EACoB;AAAA,EAAA,IAhBrBC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,EAAE,GAAAJ,IAAA,CAAFI,EAAE;IACFC,OAAO,GAAAL,IAAA,CAAPK,OAAO;IACPC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;IACRC,WAAW,GAAAP,IAAA,CAAXO,WAAW;IACXC,UAAU,GA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UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC,CAC9DN,UAAU,GAAG,UAAU,GAAG,SAAS,CAEtC;AAAAS,gBAAAA,QAAA,EAEAf,KAAAA;eACG,CAAC,EACNK,WAAW,CAAA;AAAA,aACT,CAAC,eACNc,GAAA,CAACa,GAAG,EAAA;AAAAjB,cAAAA,QAAA,EACDd,WAAW,gBACVkB,GAAA,CAACsB,IAAI,EAAA;gBACH7B,KAAK,EAAEnB,wBAAwB,CAACa,UAAU,GAAG,UAAU,GAAG,SAAS,CAAE;AACrEV,gBAAAA,IAAI,EAAC,OAAO;AAAAmB,gBAAAA,QAAA,EAEXd,WAAAA;AAAW,eACR,CAAC,GACL,IAAA;AAAI,aACL,CAAC,CAAA;AAAA,WACH,CAAC,eACNkB,GAAA,CAACa,GAAG,EAAA;AAACW,YAAAA,UAAU,EAAC,MAAM;AAAA5B,YAAAA,QAAA,EAAEX,QAAAA;AAAQ,WAAM,CAAC,CAAA;SACpC,CAAA;OACL,CAAA;KAEmB,CAAA,CAAA;AAAC,GACE,CAAC,CAAA;AAEnC,CAAC,CAAA;AAED,IAAMwC,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAACjD,aAAa;;;;"}
1
+ {"version":3,"file":"BaseMenuItem.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseMenuItemProps } from '../types';\nimport { BaseMenuItemContext } from '../BaseMenuContext';\nimport { StyledMenuItemContainer } from './StyledMenuItemContainer';\nimport { Box } from '~components/Box';\nimport { getTextProps, Text } from '~components/Typography';\nimport { size } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeElementRef } from '~utils/types';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { useTruncationTitle } from '~utils/useTruncationTitle';\n\nconst menuItemTitleColor = {\n negative: {\n default: 'feedback.text.negative.intense',\n disabled: 'interactive.text.gray.disabled',\n },\n normal: { default: 'interactive.text.gray.normal', disabled: 'interactive.text.gray.disabled' },\n} as const;\n\nconst menuItemDescriptionColor = {\n default: 'interactive.text.gray.muted',\n disabled: 'interactive.text.gray.disabled',\n} as const;\n\n// This is the height of item excluding the description to make sure description comes at the bottom and other first row items are center aligned\nconst itemFirstRowHeight = makeSize(size[20]);\n\nconst _BaseMenuItem: React.ForwardRefRenderFunction<BladeElementRef, BaseMenuItemProps> = (\n {\n title,\n description,\n as,\n leading,\n trailing,\n titleSuffix,\n isDisabled,\n selectionType = 'single',\n isSelected,\n isVisible = true,\n color,\n role = 'menuitem',\n children,\n ...props\n },\n ref,\n): React.ReactElement => {\n const { containerRef, textRef } = useTruncationTitle({ content: title });\n return (\n <BaseMenuItemContext.Provider value={{ color, isDisabled }}>\n <StyledMenuItemContainer\n ref={ref as never}\n as={as}\n type=\"button\"\n disabled={isDisabled}\n {...makeAccessible({\n role,\n current: role === 'menuitem' || role === 'menuitemcheckbox' ? isSelected : undefined,\n disabled: isDisabled,\n selected: isSelected,\n })}\n color={color}\n isVisible={isVisible}\n isSelected={isSelected}\n isDisabled={isDisabled}\n selectionType={selectionType}\n {...props}\n >\n {children ? (\n children\n ) : (\n <Box display=\"flex\" alignItems=\"flex-start\" width=\"100%\" justifyContent=\"center\">\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n height={itemFirstRowHeight}\n >\n {leading}\n </Box>\n <Box\n paddingLeft={leading ? 'spacing.3' : 'spacing.0'}\n paddingRight=\"spacing.3\"\n display=\"flex\"\n flexDirection=\"column\"\n >\n <Box\n display=\"flex\"\n alignItems=\"center\"\n flexDirection=\"row\"\n height={itemFirstRowHeight}\n ref={containerRef as never}\n >\n <BaseText\n as=\"p\"\n ref={textRef as never}\n truncateAfterLines={1}\n wordBreak=\"break-all\"\n {...getTextProps({\n size: 'medium',\n color:\n menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][\n isDisabled ? 'disabled' : 'default'\n ],\n weight: 'regular',\n })}\n >\n {title}\n </BaseText>\n {titleSuffix}\n </Box>\n <Box>\n {description ? (\n <Text\n color={menuItemDescriptionColor[isDisabled ? 'disabled' : 'default']}\n size=\"small\"\n >\n {description}\n </Text>\n ) : null}\n </Box>\n </Box>\n <Box marginLeft=\"auto\">{trailing}</Box>\n </Box>\n )}\n </StyledMenuItemContainer>\n </BaseMenuItemContext.Provider>\n );\n};\n\nconst BaseMenuItem = React.forwardRef(_BaseMenuItem);\n\nexport { BaseMenuItem };\n"],"names":["menuItemTitleColor","negative","disabled","normal","menuItemDescriptionColor","itemFirstRowHeight","makeSize","size","_BaseMenuItem","_ref","ref","title","description","as","leading","trailing","titleSuffix","isDisabled","_ref$selectionType","selectionType","isSelected","_ref$isVisible","isVisible","color","_ref$role","role","children","props","_objectWithoutProperties","_excluded","_useTruncationTitle","useTruncationTitle","content","containerRef","textRef","_jsx","BaseMenuItemContext","Provider","value","StyledMenuItemContainer","_objectSpread","type","makeAccessible","current","undefined","selected","_jsxs","Box","display","alignItems","width","justifyContent","height","paddingLeft","paddingRight","flexDirection","BaseText","truncateAfterLines","wordBreak","getTextProps","weight","Text","marginLeft","BaseMenuItem","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,kBAAkB,GAAG;AACzBC,EAAAA,QAAQ,EAAE;AACR,IAAA,SAAA,EAAS,gCAAgC;AACzCC,IAAAA,QAAQ,EAAE,gCAAA;GACX;AACDC,EAAAA,MAAM,EAAE;AAAE,IAAA,SAAA,EAAS,8BAA8B;AAAED,IAAAA,QAAQ,EAAE,gCAAA;AAAiC,GAAA;AAChG,CAAU,CAAA;AAEV,IAAME,wBAAwB,GAAG;AAC/B,EAAA,SAAA,EAAS,6BAA6B;AACtCF,EAAAA,QAAQ,EAAE,gCAAA;AACZ,CAAU,CAAA;;AAEV;AACA,IAAMG,kBAAkB,GAAGC,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;AAE7C,IAAMC,a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AA;AAAA,SACH,CAAC,eACNuB,GAAA,CAACY,GAAG,EAAA;AAACe,UAAAA,UAAU,EAAC,MAAM;AAAApC,UAAAA,QAAA,EAAEX,QAAAA;AAAQ,SAAM,CAAC,CAAA;OACpC,CAAA;KAEgB,CAAA,CAAA;AAAC,GACE,CAAC,CAAA;AAEnC,CAAC,CAAA;AAED,IAAMgD,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAACzD,aAAa;;;;"}
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
- import 'react';
3
+ import React__default from 'react';
4
4
  import styled from 'styled-components';
5
5
  import getBaseTextStyles from './getBaseTextStyles.js';
6
6
  import '../../../utils/metaAttribute/index.js';
@@ -52,7 +52,7 @@ var StyledBaseText = /*#__PURE__*/styled.div.withConfig({
52
52
  theme: props.theme
53
53
  })), styledPropsCSSObject);
54
54
  });
55
- var BaseText = function BaseText(_ref2) {
55
+ var _BaseText = function _BaseText(_ref2, ref) {
56
56
  var id = _ref2.id,
57
57
  color = _ref2.color,
58
58
  fontFamily = _ref2.fontFamily,
@@ -76,7 +76,9 @@ var BaseText = function BaseText(_ref2) {
76
76
  componentName = _ref2$componentName === void 0 ? MetaConstants.BaseText : _ref2$componentName,
77
77
  testID = _ref2.testID,
78
78
  styledProps = _objectWithoutProperties(_ref2, _excluded2);
79
- return /*#__PURE__*/jsx(StyledBaseText, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getStyledProps(styledProps)), {}, {
79
+ return /*#__PURE__*/jsx(StyledBaseText, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
80
+ ref: ref
81
+ }, getStyledProps(styledProps)), {}, {
80
82
  color: color,
81
83
  fontFamily: fontFamily,
82
84
  fontSize: fontSize,
@@ -100,6 +102,7 @@ var BaseText = function BaseText(_ref2) {
100
102
  children: children
101
103
  }));
102
104
  };
105
+ var BaseText = /*#__PURE__*/React__default.forwardRef(_BaseText);
103
106
 
104
107
  export { BaseText };
105
108
  //# sourceMappingURL=BaseText.web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseText.web.js","sources":["../../../../../../../src/components/Typography/BaseText/BaseText.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport styled from 'styled-components';\nimport getBaseTextStyles from './getBaseTextStyles';\nimport type { BaseTextProps, StyledBaseTextProps } from './types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps, useStyledProps } from '~components/Box/styledProps';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { omitPropsFromHTML } from '~utils/omitPropsFromHTML';\n\nconst StyledBaseText = styled.div.withConfig({\n shouldForwardProp: omitPropsFromHTML,\n displayName: 'StyledBaseText',\n})<StyledBaseTextProps>(\n ({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n wordBreak,\n opacity,\n ...props\n }) => {\n const styledPropsCSSObject = useStyledProps(props);\n return {\n ...getBaseTextStyles({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n wordBreak,\n opacity,\n theme: props.theme,\n }),\n ...styledPropsCSSObject,\n };\n },\n);\n\nexport const BaseText = ({\n id,\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n lineHeight,\n letterSpacing,\n as,\n textAlign,\n children,\n truncateAfterLines,\n wordBreak,\n opacity,\n className,\n style,\n accessibilityProps = {},\n componentName = MetaConstants.BaseText,\n testID,\n ...styledProps\n}: BaseTextProps): ReactElement => {\n return (\n <StyledBaseText\n {...getStyledProps(styledProps)}\n color={color}\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={fontWeight}\n fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n lineHeight={lineHeight}\n letterSpacing={letterSpacing}\n as={as}\n textAlign={textAlign}\n numberOfLines={truncateAfterLines}\n wordBreak={wordBreak}\n opacity={opacity}\n className={className}\n style={style}\n id={id}\n {...makeAccessible(accessibilityProps)}\n {...metaAttribute({ name: componentName, testID })}\n >\n {children}\n </StyledBaseText>\n );\n};\n"],"names":["StyledBaseText","styled","div","withConfig","shouldForwardProp","omitPropsFromHTML","displayName","_ref","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","letterSpacing","textAlign","wordBreak","opacity","props","_objectWithoutProperties","_excluded","styledPropsCSSObject","useStyledProps","_objectSpread","getBaseTextStyles","theme","BaseText","_ref2","id","as","children","truncateAfterLines","className","style","_ref2$accessibilityPr","accessibilityProps","_ref2$componentName","componentName","MetaConstants","testID","styledProps","_excluded2","_jsx","getStyledProps","makeAccessible","metaAttribute","name"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,cAAc,gBAAGC,MAAM,CAACC,GAAG,CAACC,UAAU,CAAC;AAC3CC,EAAAA,iBAAiB,EAAEC,iBAAiB;AACpCC,EAAAA,WAAW,EAAE,gBAAA;AACf,CAAC,CAAC,CACA,UAAAC,IAAA,EAcM;AAAA,EAAA,IAbJC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IACVC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,kBAAkB,GAAAN,IAAA,CAAlBM,kBAAkB;IAClBC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,aAAa,GAAAT,IAAA,CAAbS,aAAa;IACbC,SAAS,GAAAV,IAAA,CAATU,SAAS;IACTC,SAAS,GAAAX,IAAA,CAATW,SAAS;IACTC,OAAO,GAAAZ,IAAA,CAAPY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,SAAS,EAAEA,SAAU;AACrBC,IAAAA,KAAK,EAAEA,KAAM;AACbL,IAAAA,EAAE,EAAEA,EAAAA;AAAG,GAAA,EACHgB,cAAc,CAACT,kBAAkB,CAAC,CAAA,EAClCU,aAAa,CAAC;AAAEC,IAAAA,IAAI,EAAET,aAAa;AAAEE,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAT,IAAAA,QAAA,EAEjDA,QAAAA;AAAQ,GAAA,CACK,CAAC,CAAA;AAErB;;;;"}
1
+ {"version":3,"file":"BaseText.web.js","sources":["../../../../../../../src/components/Typography/BaseText/BaseText.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport styled from 'styled-components';\nimport getBaseTextStyles from './getBaseTextStyles';\nimport type { BaseTextProps, StyledBaseTextProps } from './types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps, useStyledProps } from '~components/Box/styledProps';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { omitPropsFromHTML } from '~utils/omitPropsFromHTML';\nimport type { BladeElementRef } from '~utils/types';\n\nconst StyledBaseText = styled.div.withConfig({\n shouldForwardProp: omitPropsFromHTML,\n displayName: 'StyledBaseText',\n})<StyledBaseTextProps>(\n ({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n wordBreak,\n opacity,\n ...props\n }) => {\n const styledPropsCSSObject = useStyledProps(props);\n return {\n ...getBaseTextStyles({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n wordBreak,\n opacity,\n theme: props.theme,\n }),\n ...styledPropsCSSObject,\n };\n },\n);\n\nconst _BaseText: React.ForwardRefRenderFunction<BladeElementRef, BaseTextProps> = (\n {\n id,\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n lineHeight,\n letterSpacing,\n as,\n textAlign,\n children,\n truncateAfterLines,\n wordBreak,\n opacity,\n className,\n style,\n accessibilityProps = {},\n componentName = MetaConstants.BaseText,\n testID,\n ...styledProps\n },\n ref,\n): ReactElement => {\n return (\n <StyledBaseText\n ref={ref as never}\n {...getStyledProps(styledProps)}\n color={color}\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={fontWeight}\n fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n lineHeight={lineHeight}\n letterSpacing={letterSpacing}\n as={as}\n textAlign={textAlign}\n numberOfLines={truncateAfterLines}\n wordBreak={wordBreak}\n opacity={opacity}\n className={className}\n style={style}\n id={id}\n {...makeAccessible(accessibilityProps)}\n {...metaAttribute({ name: componentName, testID })}\n >\n {children}\n </StyledBaseText>\n );\n};\n\nconst BaseText = React.forwardRef(_BaseText);\nexport { BaseText };\n"],"names":["StyledBaseText","styled","div","withConfig","shouldForwardProp","omitPropsFromHTML","displayName","_ref","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","letterSpacing","textAlign","wordBreak","opacity","props","_objectWithoutProperties","_excluded","styledPropsCSSObject","useStyledProps","_objectSpread","getBaseTextStyles","theme","_BaseText","_ref2","ref","id","as","children","truncateAfterLines","className","style","_ref2$accessibilityPr","accessibilityProps","_ref2$componentName","componentName","MetaConstants","BaseText","testID","styledProps","_excluded2","_jsx","getStyledProps","makeAccessible","metaAttribute","name","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,cAAc,gBAAGC,MAAM,CAACC,GAAG,CAACC,UAAU,CAAC;AAC3CC,EAAAA,iBAAiB,EAAEC,iBAAiB;AACpCC,EAAAA,WAAW,EAAE,gBAAA;AACf,CAAC,CAAC,CACA,UAAAC,IAAA,EAcM;AAAA,EAAA,IAbJC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,UAAU,GAAAF,IAAA,CAAV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AA,KAAK,EAAEA,KAAM;AACbC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCE,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,aAAa,EAAEA,aAAc;AAC7BgB,IAAAA,EAAE,EAAEA,EAAG;AACPf,IAAAA,SAAS,EAAEA,SAAU;AACrBH,IAAAA,aAAa,EAAEoB,kBAAmB;AAClChB,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBgB,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,KAAK,EAAEA,KAAM;AACbL,IAAAA,EAAE,EAAEA,EAAAA;AAAG,GAAA,EACHiB,cAAc,CAACV,kBAAkB,CAAC,CAAA,EAClCW,aAAa,CAAC;AAAEC,IAAAA,IAAI,EAAEV,aAAa;AAAEG,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAV,IAAAA,QAAA,EAEjDA,QAAAA;AAAQ,GAAA,CACK,CAAC,CAAA;AAErB,CAAC,CAAA;AAED,IAAMS,QAAQ,gBAAGS,cAAK,CAACC,UAAU,CAACxB,SAAS;;;;"}
@@ -0,0 +1,2 @@
1
+ export { useTruncationTitle } from './useTruncationTitle.web.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import React__default from 'react';
2
+
3
+ /**
4
+ * Utility function that takes checks if text is truncated and adds `htmlTitle` with full text
5
+ *
6
+ * ## Usage
7
+ *
8
+ * ```tsx
9
+ * const { containerRef, textRef } = useTruncationTitle({ content: 'saurabhdaware99@gmail.com' });
10
+ *
11
+ * <Box ref={containerRef}>
12
+ * <BaseText ref={textRef} truncateAfterLines={1}>
13
+ * saurabhdaware99@gmail.com
14
+ * </BaseText>
15
+ * </Box>
16
+ * ```
17
+ */
18
+ var useTruncationTitle = function useTruncationTitle(_ref) {
19
+ var content = _ref.content;
20
+ var containerRef = React__default.useRef(null);
21
+ var textRef = React__default.useRef(null);
22
+ React__default.useEffect(function () {
23
+ if (!textRef.current || !containerRef.current) {
24
+ return;
25
+ }
26
+ if (textRef.current.scrollHeight > containerRef.current.clientHeight && content) {
27
+ textRef.current.setAttribute('title', content);
28
+ }
29
+ }, [content]);
30
+ return {
31
+ containerRef: containerRef,
32
+ textRef: textRef
33
+ };
34
+ };
35
+
36
+ export { useTruncationTitle };
37
+ //# sourceMappingURL=useTruncationTitle.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTruncationTitle.web.js","sources":["../../../../../../src/utils/useTruncationTitle/useTruncationTitle.web.tsx"],"sourcesContent":["import React from 'react';\n\n/**\n * Utility function that takes checks if text is truncated and adds `htmlTitle` with full text\n *\n * ## Usage\n *\n * ```tsx\n * const { containerRef, textRef } = useTruncationTitle({ content: 'saurabhdaware99@gmail.com' });\n *\n * <Box ref={containerRef}>\n * <BaseText ref={textRef} truncateAfterLines={1}>\n * saurabhdaware99@gmail.com\n * </BaseText>\n * </Box>\n * ```\n */\nconst useTruncationTitle = ({\n content,\n}: {\n /**\n * content that you want to set as htmlTitle\n */\n content?: string;\n}): {\n containerRef: React.RefObject<HTMLDivElement>;\n textRef: React.RefObject<HTMLParagraphElement>;\n} => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const textRef = React.useRef<HTMLParagraphElement>(null);\n\n React.useEffect(() => {\n if (!textRef.current || !containerRef.current) {\n return;\n }\n\n if (textRef.current.scrollHeight > containerRef.current.clientHeight && content) {\n textRef.current.setAttribute('title', content);\n }\n }, [content]);\n\n return {\n containerRef,\n textRef,\n };\n};\n\nexport { useTruncationTitle };\n"],"names":["useTruncationTitle","_ref","content","containerRef","React","useRef","textRef","useEffect","current","scrollHeight","clientHeight","setAttribute"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAUnB;AAAA,EAAA,IATHC,OAAO,GAAAD,IAAA,CAAPC,OAAO,CAAA;AAUP,EAAA,IAAMC,YAAY,GAAGC,cAAK,CAACC,MAAM,CAAiB,IAAI,CAAC,CAAA;AACvD,EAAA,IAAMC,OAAO,GAAGF,cAAK,CAACC,MAAM,CAAuB,IAAI,CAAC,CAAA;EAExDD,cAAK,CAACG,SAAS,CAAC,YAAM;IACpB,IAAI,CAACD,OAAO,CAACE,OAAO,IAAI,CAACL,YAAY,CAACK,OAAO,EAAE;AAC7C,MAAA,OAAA;AACF,KAAA;AAEA,IAAA,IAAIF,OAAO,CAACE,OAAO,CAACC,YAAY,GAAGN,YAAY,CAACK,OAAO,CAACE,YAAY,IAAIR,OAAO,EAAE;MAC/EI,OAAO,CAACE,OAAO,CAACG,YAAY,CAAC,OAAO,EAAET,OAAO,CAAC,CAAA;AAChD,KAAA;AACF,GAAC,EAAE,CAACA,OAAO,CAAC,CAAC,CAAA;EAEb,OAAO;AACLC,IAAAA,YAAY,EAAZA,YAAY;AACZG,IAAAA,OAAO,EAAPA,OAAAA;GACD,CAAA;AACH;;;;"}
@@ -8,12 +8,16 @@ import '../../Typography/index.js';
8
8
  import '../../../tokens/global/index.js';
9
9
  import '../../../utils/index.js';
10
10
  import '../../../utils/makeAccessible/index.js';
11
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
11
+ import '../../Typography/BaseText/index.js';
12
+ import '../../../utils/useTruncationTitle/index.js';
13
+ import { jsx, jsxs } from 'react/jsx-runtime';
12
14
  import { makeSize } from '../../../utils/makeSize/makeSize.js';
13
15
  import { size } from '../../../tokens/global/size.js';
16
+ import { useTruncationTitle } from '../../../utils/useTruncationTitle/useTruncationTitle.web.js';
14
17
  import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.web.js';
15
18
  import { Box } from '../../Box/Box.js';
16
- import { Text } from '../../Typography/Text/Text.js';
19
+ import { BaseText } from '../../Typography/BaseText/BaseText.web.js';
20
+ import { getTextProps, Text } from '../../Typography/Text/Text.js';
17
21
 
18
22
  var _excluded = ["title", "description", "as", "leading", "trailing", "titleSuffix", "isDisabled", "selectionType", "isSelected", "isVisible", "color", "role", "children"];
19
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -53,6 +57,11 @@ var _BaseMenuItem = function _BaseMenuItem(_ref, ref) {
53
57
  role = _ref$role === void 0 ? 'menuitem' : _ref$role,
54
58
  children = _ref.children,
55
59
  props = _objectWithoutProperties(_ref, _excluded);
60
+ var _useTruncationTitle = useTruncationTitle({
61
+ content: title
62
+ }),
63
+ containerRef = _useTruncationTitle.containerRef,
64
+ textRef = _useTruncationTitle.textRef;
56
65
  return /*#__PURE__*/jsx(BaseMenuItemContext.Provider, {
57
66
  value: {
58
67
  color: color,
@@ -75,45 +84,51 @@ var _BaseMenuItem = function _BaseMenuItem(_ref, ref) {
75
84
  isDisabled: isDisabled,
76
85
  selectionType: selectionType
77
86
  }, props), {}, {
78
- children: children ? children : /*#__PURE__*/jsx(Fragment, {
79
- children: /*#__PURE__*/jsxs(Box, {
87
+ children: children ? children : /*#__PURE__*/jsxs(Box, {
88
+ display: "flex",
89
+ alignItems: "flex-start",
90
+ width: "100%",
91
+ justifyContent: "center",
92
+ children: [/*#__PURE__*/jsx(Box, {
80
93
  display: "flex",
81
- alignItems: "flex-start",
82
- width: "100%",
83
94
  justifyContent: "center",
84
- children: [/*#__PURE__*/jsx(Box, {
95
+ alignItems: "center",
96
+ height: itemFirstRowHeight,
97
+ children: leading
98
+ }), /*#__PURE__*/jsxs(Box, {
99
+ paddingLeft: leading ? 'spacing.3' : 'spacing.0',
100
+ paddingRight: "spacing.3",
101
+ display: "flex",
102
+ flexDirection: "column",
103
+ children: [/*#__PURE__*/jsxs(Box, {
85
104
  display: "flex",
86
- justifyContent: "center",
87
105
  alignItems: "center",
106
+ flexDirection: "row",
88
107
  height: itemFirstRowHeight,
89
- children: leading
90
- }), /*#__PURE__*/jsxs(Box, {
91
- paddingLeft: leading ? 'spacing.3' : 'spacing.0',
92
- paddingRight: "spacing.3",
93
- display: "flex",
94
- flexDirection: "column",
95
- children: [/*#__PURE__*/jsxs(Box, {
96
- display: "flex",
97
- alignItems: "center",
98
- flexDirection: "row",
99
- height: itemFirstRowHeight,
100
- children: [/*#__PURE__*/jsx(Text, {
101
- truncateAfterLines: 1,
102
- color: menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][isDisabled ? 'disabled' : 'default'],
103
- children: title
104
- }), titleSuffix]
105
- }), /*#__PURE__*/jsx(Box, {
106
- children: description ? /*#__PURE__*/jsx(Text, {
107
- color: menuItemDescriptionColor[isDisabled ? 'disabled' : 'default'],
108
- size: "small",
109
- children: description
110
- }) : null
111
- })]
108
+ ref: containerRef,
109
+ children: [/*#__PURE__*/jsx(BaseText, _objectSpread(_objectSpread({
110
+ as: "p",
111
+ ref: textRef,
112
+ truncateAfterLines: 1,
113
+ wordBreak: "break-all"
114
+ }, getTextProps({
115
+ size: 'medium',
116
+ color: menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][isDisabled ? 'disabled' : 'default'],
117
+ weight: 'regular'
118
+ })), {}, {
119
+ children: title
120
+ })), titleSuffix]
112
121
  }), /*#__PURE__*/jsx(Box, {
113
- marginLeft: "auto",
114
- children: trailing
122
+ children: description ? /*#__PURE__*/jsx(Text, {
123
+ color: menuItemDescriptionColor[isDisabled ? 'disabled' : 'default'],
124
+ size: "small",
125
+ children: description
126
+ }) : null
115
127
  })]
116
- })
128
+ }), /*#__PURE__*/jsx(Box, {
129
+ marginLeft: "auto",
130
+ children: trailing
131
+ })]
117
132
  })
118
133
  }))
119
134
  });
@@ -1 +1 @@
1
- {"version":3,"file":"BaseMenuItem.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseMenuItemProps } from '../types';\nimport { BaseMenuItemContext } from '../BaseMenuContext';\nimport { StyledMenuItemContainer } from './StyledMenuItemContainer';\nimport { Box } from '~components/Box';\nimport { Text } from '~components/Typography';\nimport { size } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeElementRef } from '~utils/types';\n\nconst menuItemTitleColor = {\n negative: {\n default: 'feedback.text.negative.intense',\n disabled: 'interactive.text.gray.disabled',\n },\n normal: { default: 'interactive.text.gray.normal', disabled: 'interactive.text.gray.disabled' },\n} as const;\n\nconst menuItemDescriptionColor = {\n default: 'interactive.text.gray.muted',\n disabled: 'interactive.text.gray.disabled',\n} as const;\n\n// This is the height of item excluding the description to make sure description comes at the bottom and other first row items are center aligned\nconst itemFirstRowHeight = makeSize(size[20]);\n\nconst _BaseMenuItem: React.ForwardRefRenderFunction<BladeElementRef, BaseMenuItemProps> = (\n {\n title,\n description,\n as,\n leading,\n trailing,\n titleSuffix,\n isDisabled,\n selectionType = 'single',\n isSelected,\n isVisible = true,\n color,\n role = 'menuitem',\n children,\n ...props\n },\n ref,\n): React.ReactElement => {\n return (\n <BaseMenuItemContext.Provider value={{ color, isDisabled }}>\n <StyledMenuItemContainer\n ref={ref as never}\n as={as}\n type=\"button\"\n disabled={isDisabled}\n {...makeAccessible({\n role,\n current: role === 'menuitem' || role === 'menuitemcheckbox' ? isSelected : undefined,\n disabled: isDisabled,\n selected: isSelected,\n })}\n color={color}\n isVisible={isVisible}\n isSelected={isSelected}\n isDisabled={isDisabled}\n selectionType={selectionType}\n {...props}\n >\n {children ? (\n children\n ) : (\n <>\n <Box display=\"flex\" alignItems=\"flex-start\" width=\"100%\" justifyContent=\"center\">\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n height={itemFirstRowHeight}\n >\n {leading}\n </Box>\n <Box\n paddingLeft={leading ? 'spacing.3' : 'spacing.0'}\n paddingRight=\"spacing.3\"\n display=\"flex\"\n flexDirection=\"column\"\n >\n <Box\n display=\"flex\"\n alignItems=\"center\"\n flexDirection=\"row\"\n height={itemFirstRowHeight}\n >\n <Text\n truncateAfterLines={1}\n color={\n menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][\n isDisabled ? 'disabled' : 'default'\n ]\n }\n >\n {title}\n </Text>\n {titleSuffix}\n </Box>\n <Box>\n {description ? (\n <Text\n color={menuItemDescriptionColor[isDisabled ? 'disabled' : 'default']}\n size=\"small\"\n >\n {description}\n </Text>\n ) : null}\n </Box>\n </Box>\n <Box marginLeft=\"auto\">{trailing}</Box>\n </Box>\n </>\n )}\n </StyledMenuItemContainer>\n </BaseMenuItemContext.Provider>\n );\n};\n\nconst BaseMenuItem = React.forwardRef(_BaseMenuItem);\n\nexport { BaseMenuItem };\n"],"names":["menuItemTitleColor","negative","disabled","normal","menuItemDescriptionColor","itemFirstRowHeight","makeSize","size","_BaseMenuItem","_ref","ref","title","description","as","leading","trailing","titleSuffix","isDisabled","_ref$selectionType","selectionType","isSelected","_ref$isVisible","isVisible","color","_ref$role","role","children","props","_objectWithoutProperties","_excluded","_jsx","BaseMenuItemContext","Provider","value","StyledMenuItemContainer","_objectSpread","type","makeAccessible","current","undefined","selected","_Fragment","_jsxs","Box","display","alignItems","width","justifyContent","height","paddingLeft","paddingRight","flexDirection","Text","truncateAfterLines","marginLeft","BaseMenuItem","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,kBAAkB,GAAG;AACzBC,EAAAA,QAAQ,EAAE;AACR,IAAA,SAAA,EAAS,gCAAgC;AACzCC,IAAAA,QAAQ,EAAE,gCAAA;GACX;AACDC,E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,WAAM,CAAC,CAAA;SACpC,CAAA;OACL,CAAA;KAEmB,CAAA,CAAA;AAAC,GACE,CAAC,CAAA;AAEnC,CAAC,CAAA;AAED,IAAMwC,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAACjD,aAAa;;;;"}
1
+ {"version":3,"file":"BaseMenuItem.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseMenuItemProps } from '../types';\nimport { BaseMenuItemContext } from '../BaseMenuContext';\nimport { StyledMenuItemContainer } from './StyledMenuItemContainer';\nimport { Box } from '~components/Box';\nimport { getTextProps, Text } from '~components/Typography';\nimport { size } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeElementRef } from '~utils/types';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { useTruncationTitle } from '~utils/useTruncationTitle';\n\nconst menuItemTitleColor = {\n negative: {\n default: 'feedback.text.negative.intense',\n disabled: 'interactive.text.gray.disabled',\n },\n normal: { default: 'interactive.text.gray.normal', disabled: 'interactive.text.gray.disabled' },\n} as const;\n\nconst menuItemDescriptionColor = {\n default: 'interactive.text.gray.muted',\n disabled: 'interactive.text.gray.disabled',\n} as const;\n\n// This is the height of item excluding the description to make sure description comes at the bottom and other first row items are center aligned\nconst itemFirstRowHeight = makeSize(size[20]);\n\nconst _BaseMenuItem: React.ForwardRefRenderFunction<BladeElementRef, BaseMenuItemProps> = (\n {\n title,\n description,\n as,\n leading,\n trailing,\n titleSuffix,\n isDisabled,\n selectionType = 'single',\n isSelected,\n isVisible = true,\n color,\n role = 'menuitem',\n children,\n ...props\n },\n ref,\n): React.ReactElement => {\n const { containerRef, textRef } = useTruncationTitle({ content: title });\n return (\n <BaseMenuItemContext.Provider value={{ color, isDisabled }}>\n <StyledMenuItemContainer\n ref={ref as never}\n as={as}\n type=\"button\"\n disabled={isDisabled}\n {...makeAccessible({\n role,\n current: role === 'menuitem' || role === 'menuitemcheckbox' ? isSelected : undefined,\n disabled: isDisabled,\n selected: isSelected,\n })}\n color={color}\n isVisible={isVisible}\n isSelected={isSelected}\n isDisabled={isDisabled}\n selectionType={selectionType}\n {...props}\n >\n {children ? (\n children\n ) : (\n <Box display=\"flex\" alignItems=\"flex-start\" width=\"100%\" justifyContent=\"center\">\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n height={itemFirstRowHeight}\n >\n {leading}\n </Box>\n <Box\n paddingLeft={leading ? 'spacing.3' : 'spacing.0'}\n paddingRight=\"spacing.3\"\n display=\"flex\"\n flexDirection=\"column\"\n >\n <Box\n display=\"flex\"\n alignItems=\"center\"\n flexDirection=\"row\"\n height={itemFirstRowHeight}\n ref={containerRef as never}\n >\n <BaseText\n as=\"p\"\n ref={textRef as never}\n truncateAfterLines={1}\n wordBreak=\"break-all\"\n {...getTextProps({\n size: 'medium',\n color:\n menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][\n isDisabled ? 'disabled' : 'default'\n ],\n weight: 'regular',\n })}\n >\n {title}\n </BaseText>\n {titleSuffix}\n </Box>\n <Box>\n {description ? (\n <Text\n color={menuItemDescriptionColor[isDisabled ? 'disabled' : 'default']}\n size=\"small\"\n >\n {description}\n </Text>\n ) : null}\n </Box>\n </Box>\n <Box marginLeft=\"auto\">{trailing}</Box>\n </Box>\n )}\n </StyledMenuItemContainer>\n </BaseMenuItemContext.Provider>\n );\n};\n\nconst BaseMenuItem = React.forwardRef(_BaseMenuItem);\n\nexport { BaseMenuItem };\n"],"names":["menuItemTitleColor","negative","disabled","normal","menuItemDescriptionColor","itemFirstRowHeight","makeSize","size","_BaseMenuItem","_ref","ref","title","description","as","leading","trailing","titleSuffix","isDisabled","_ref$selectionType","selectionType","isSelected","_ref$isVisible","isVisible","color","_ref$role","role","children","props","_objectWithoutProperties","_excluded","_useTruncationTitle","useTruncationTitle","content","containerRef","textRef","_jsx","BaseMenuItemContext","Provider","value","StyledMenuItemContainer","_objectSpread","type","makeAccessible","current","undefined","selected","_jsxs","Box","display","alignItems","width","justifyContent","height","paddingLeft","paddingRight","flexDirection","BaseText","truncateAfterLines","wordBreak","getTextProps","weight","Text","marginLeft","BaseMenuItem","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,kBAAkB,GAAG;AACzBC,EAAAA,QAAQ,EAAE;AACR,IAAA,SAAA,EAAS,gCAAgC;AACzCC,IAAAA,QAAQ,EAAE,gCAAA;GACX;AACDC,EAAAA,MAAM,EAAE;AAAE,IAAA,SAAA,EAAS,8BAA8B;AAAED,IAAAA,QAAQ,EAAE,gCAAA;AAAiC,GAAA;AAChG,CAAU,CAAA;AAEV,IAAME,wBAAwB,GAAG;AAC/B,EAAA,SAAA,EAAS,6BAA6B;AACtCF,EAAAA,QAAQ,EAAE,gCAAA;AACZ,CAAU,CAAA;;AAEV;AACA,IAAMG,kBAAkB,GAAGC,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;AAE7C,IAAMC,aAAiF,GAAG,SAApFA,aAAiFA,CAAAC,IAAA,EAiBrFC,GAAG,EACoB;AAAA,EAAA,IAhBrBC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,EAAE,GAAAJ,IAAA,CAAFI,EAAE;IACFC,OAAO,GAAAL,IAAA,CAAPK,OAAO;IACPC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;IACRC,WAAW,GAAAP,IAAA,CAAXO,WAAW;IACXC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IAAAC,kBAAA,GAAAT,IAAA,CACVU,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,kBAAA;IACxBE,UAAU,GAAAX,IAAA,CAAVW,UAAU;IAAAC,cAAA,GAAAZ,IAAA,CACVa,SAAS;AAATA,IAAAA,SAAS,GAAAD,cA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AA;AAAW,aAAA,EACjBC,YAAY,CAAC;AACfpD,cAAAA,IAAI,EAAE,QAAQ;AACdgB,cAAAA,KAAK,EACHvB,kBAAkB,CAACuB,KAAK,KAAK,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC,CAC9DN,UAAU,GAAG,UAAU,GAAG,SAAS,CACpC;AACH2C,cAAAA,MAAM,EAAE,SAAA;AACV,aAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAlC,cAAAA,QAAA,EAEDf,KAAAA;aACO,CAAA,CAAC,EACVK,WAAW,CAAA;AAAA,WACT,CAAC,eACNmB,GAAA,CAACY,GAAG,EAAA;AAAArB,YAAAA,QAAA,EACDd,WAAW,gBACVuB,GAAA,CAAC0B,IAAI,EAAA;cACHtC,KAAK,EAAEnB,wBAAwB,CAACa,UAAU,GAAG,UAAU,GAAG,SAAS,CAAE;AACrEV,cAAAA,IAAI,EAAC,OAAO;AAAAmB,cAAAA,QAAA,EAEXd,WAAAA;AAAW,aACR,CAAC,GACL,IAAA;AAAI,WACL,CAAC,CAAA;AAAA,SACH,CAAC,eACNuB,GAAA,CAACY,GAAG,EAAA;AAACe,UAAAA,UAAU,EAAC,MAAM;AAAApC,UAAAA,QAAA,EAAEX,QAAAA;AAAQ,SAAM,CAAC,CAAA;OACpC,CAAA;KAEgB,CAAA,CAAA;AAAC,GACE,CAAC,CAAA;AAEnC,CAAC,CAAA;AAED,IAAMgD,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAACzD,aAAa;;;;"}
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
- import 'react';
3
+ import React__default from 'react';
4
4
  import styled from 'styled-components';
5
5
  import getBaseTextStyles from './getBaseTextStyles.js';
6
6
  import '../../../utils/metaAttribute/index.js';
@@ -52,7 +52,7 @@ var StyledBaseText = /*#__PURE__*/styled.div.withConfig({
52
52
  theme: props.theme
53
53
  })), styledPropsCSSObject);
54
54
  });
55
- var BaseText = function BaseText(_ref2) {
55
+ var _BaseText = function _BaseText(_ref2, ref) {
56
56
  var id = _ref2.id,
57
57
  color = _ref2.color,
58
58
  fontFamily = _ref2.fontFamily,
@@ -76,7 +76,9 @@ var BaseText = function BaseText(_ref2) {
76
76
  componentName = _ref2$componentName === void 0 ? MetaConstants.BaseText : _ref2$componentName,
77
77
  testID = _ref2.testID,
78
78
  styledProps = _objectWithoutProperties(_ref2, _excluded2);
79
- return /*#__PURE__*/jsx(StyledBaseText, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getStyledProps(styledProps)), {}, {
79
+ return /*#__PURE__*/jsx(StyledBaseText, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
80
+ ref: ref
81
+ }, getStyledProps(styledProps)), {}, {
80
82
  color: color,
81
83
  fontFamily: fontFamily,
82
84
  fontSize: fontSize,
@@ -100,6 +102,7 @@ var BaseText = function BaseText(_ref2) {
100
102
  children: children
101
103
  }));
102
104
  };
105
+ var BaseText = /*#__PURE__*/React__default.forwardRef(_BaseText);
103
106
 
104
107
  export { BaseText };
105
108
  //# sourceMappingURL=BaseText.web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseText.web.js","sources":["../../../../../../../src/components/Typography/BaseText/BaseText.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport styled from 'styled-components';\nimport getBaseTextStyles from './getBaseTextStyles';\nimport type { BaseTextProps, StyledBaseTextProps } from './types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps, useStyledProps } from '~components/Box/styledProps';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { omitPropsFromHTML } from '~utils/omitPropsFromHTML';\n\nconst StyledBaseText = styled.div.withConfig({\n shouldForwardProp: omitPropsFromHTML,\n displayName: 'StyledBaseText',\n})<StyledBaseTextProps>(\n ({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n wordBreak,\n opacity,\n ...props\n }) => {\n const styledPropsCSSObject = useStyledProps(props);\n return {\n ...getBaseTextStyles({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n wordBreak,\n opacity,\n theme: props.theme,\n }),\n ...styledPropsCSSObject,\n };\n },\n);\n\nexport const BaseText = ({\n id,\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n lineHeight,\n letterSpacing,\n as,\n textAlign,\n children,\n truncateAfterLines,\n wordBreak,\n opacity,\n className,\n style,\n accessibilityProps = {},\n componentName = MetaConstants.BaseText,\n testID,\n ...styledProps\n}: BaseTextProps): ReactElement => {\n return (\n <StyledBaseText\n {...getStyledProps(styledProps)}\n color={color}\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={fontWeight}\n fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n lineHeight={lineHeight}\n letterSpacing={letterSpacing}\n as={as}\n textAlign={textAlign}\n numberOfLines={truncateAfterLines}\n wordBreak={wordBreak}\n opacity={opacity}\n className={className}\n style={style}\n id={id}\n {...makeAccessible(accessibilityProps)}\n {...metaAttribute({ name: componentName, testID })}\n >\n {children}\n </StyledBaseText>\n );\n};\n"],"names":["StyledBaseText","styled","div","withConfig","shouldForwardProp","omitPropsFromHTML","displayName","_ref","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","letterSpacing","textAlign","wordBreak","opacity","props","_objectWithoutProperties","_excluded","styledPropsCSSObject","useStyledProps","_objectSpread","getBaseTextStyles","theme","BaseText","_ref2","id","as","children","truncateAfterLines","className","style","_ref2$accessibilityPr","accessibilityProps","_ref2$componentName","componentName","MetaConstants","testID","styledProps","_excluded2","_jsx","getStyledProps","makeAccessible","metaAttribute","name"],"mappings":";;;;;;;;;;;;;;;;;;;;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AAA,EAAAc,UAAA,CAAA,CAAA;AAEd,EAAA,oBACEC,GAAA,CAAC5C,cAAc,EAAAyB,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA,EAAA,EACToB,cAAc,CAACH,WAAW,CAAC,CAAA,EAAA,EAAA,EAAA;AAC/BlC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCE,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,aAAa,EAAEA,aAAc;AAC7Be,IAAAA,EAAE,EAAEA,EAAG;AACPd,IAAAA,SAAS,EAAEA,SAAU;AACrBH,IAAAA,aAAa,EAAEmB,kBAAmB;AAClCf,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBe,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,KAAK,EAAEA,KAAM;AACbL,IAAAA,EAAE,EAAEA,EAAAA;AAAG,GAAA,EACHgB,cAAc,CAACT,kBAAkB,CAAC,CAAA,EAClCU,aAAa,CAAC;AAAEC,IAAAA,IAAI,EAAET,aAAa;AAAEE,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAT,IAAAA,QAAA,EAEjDA,QAAAA;AAAQ,GAAA,CACK,CAAC,CAAA;AAErB;;;;"}
1
+ {"version":3,"file":"BaseText.web.js","sources":["../../../../../../../src/components/Typography/BaseText/BaseText.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport styled from 'styled-components';\nimport getBaseTextStyles from './getBaseTextStyles';\nimport type { BaseTextProps, StyledBaseTextProps } from './types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps, useStyledProps } from '~components/Box/styledProps';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { omitPropsFromHTML } from '~utils/omitPropsFromHTML';\nimport type { BladeElementRef } from '~utils/types';\n\nconst StyledBaseText = styled.div.withConfig({\n shouldForwardProp: omitPropsFromHTML,\n displayName: 'StyledBaseText',\n})<StyledBaseTextProps>(\n ({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n wordBreak,\n opacity,\n ...props\n }) => {\n const styledPropsCSSObject = useStyledProps(props);\n return {\n ...getBaseTextStyles({\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n numberOfLines,\n lineHeight,\n letterSpacing,\n textAlign,\n wordBreak,\n opacity,\n theme: props.theme,\n }),\n ...styledPropsCSSObject,\n };\n },\n);\n\nconst _BaseText: React.ForwardRefRenderFunction<BladeElementRef, BaseTextProps> = (\n {\n id,\n color,\n fontFamily,\n fontSize,\n fontWeight,\n fontStyle,\n textDecorationLine,\n lineHeight,\n letterSpacing,\n as,\n textAlign,\n children,\n truncateAfterLines,\n wordBreak,\n opacity,\n className,\n style,\n accessibilityProps = {},\n componentName = MetaConstants.BaseText,\n testID,\n ...styledProps\n },\n ref,\n): ReactElement => {\n return (\n <StyledBaseText\n ref={ref as never}\n {...getStyledProps(styledProps)}\n color={color}\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={fontWeight}\n fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n lineHeight={lineHeight}\n letterSpacing={letterSpacing}\n as={as}\n textAlign={textAlign}\n numberOfLines={truncateAfterLines}\n wordBreak={wordBreak}\n opacity={opacity}\n className={className}\n style={style}\n id={id}\n {...makeAccessible(accessibilityProps)}\n {...metaAttribute({ name: componentName, testID })}\n >\n {children}\n </StyledBaseText>\n );\n};\n\nconst BaseText = React.forwardRef(_BaseText);\nexport { BaseText };\n"],"names":["StyledBaseText","styled","div","withConfig","shouldForwardProp","omitPropsFromHTML","displayName","_ref","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","letterSpacing","textAlign","wordBreak","opacity","props","_objectWithoutProperties","_excluded","styledPropsCSSObject","useStyledProps","_objectSpread","getBaseTextStyles","theme","_BaseText","_ref2","ref","id","as","children","truncateAfterLines","className","style","_ref2$accessibilityPr","accessibilityProps","_ref2$componentName","componentName","MetaConstants","BaseText","testID","styledProps","_excluded2","_jsx","getStyledProps","makeAccessible","metaAttribute","name","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,cAAc,gBAAGC,MAAM,CAACC,GAAG,CAACC,UAAU,CAAC;AAC3CC,EAAAA,iBAAiB,EAAEC,iBAAiB;AACpCC,EAAAA,WAAW,EAAE,gBAAA;AACf,CAAC,CAAC,CACA,UAAAC,IAAA,EAcM;AAAA,EAAA,IAbJC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IACVC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,kBAAkB,GAAAN,IAAA,CAAlBM,kBAAkB;IAClBC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,aAAa,GAAAT,IAAA,CAAbS,aAAa;IACbC,SAAS,GAAAV,IAAA,CAATU,SAAS;IACTC,SAAS,GAAAX,IAAA,CAATW,SAAS;IACTC,OAAO,GAAAZ,IAAA,CAAPY,OAAO;AACJC,IAAAA,KAAK,GAAAC,wBAAA,CAAAd,IAAA,EAAAe,SAAA,CAAA,CAAA;AAER,EAAA,IAAMC,oBAAoB,GAAGC,cAAc,CAACJ,KAAK,CAAC,CAAA;AAClD,EAAA,OAAAK,aAAA,CAAAA,aAAA,C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,CAAC,CAAA,EAClCW,aAAa,CAAC;AAAEC,IAAAA,IAAI,EAAEV,aAAa;AAAEG,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAV,IAAAA,QAAA,EAEjDA,QAAAA;AAAQ,GAAA,CACK,CAAC,CAAA;AAErB,CAAC,CAAA;AAED,IAAMS,QAAQ,gBAAGS,cAAK,CAACC,UAAU,CAACxB,SAAS;;;;"}
@@ -0,0 +1,2 @@
1
+ export { useTruncationTitle } from './useTruncationTitle.web.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import React__default from 'react';
2
+
3
+ /**
4
+ * Utility function that takes checks if text is truncated and adds `htmlTitle` with full text
5
+ *
6
+ * ## Usage
7
+ *
8
+ * ```tsx
9
+ * const { containerRef, textRef } = useTruncationTitle({ content: 'saurabhdaware99@gmail.com' });
10
+ *
11
+ * <Box ref={containerRef}>
12
+ * <BaseText ref={textRef} truncateAfterLines={1}>
13
+ * saurabhdaware99@gmail.com
14
+ * </BaseText>
15
+ * </Box>
16
+ * ```
17
+ */
18
+ var useTruncationTitle = function useTruncationTitle(_ref) {
19
+ var content = _ref.content;
20
+ var containerRef = React__default.useRef(null);
21
+ var textRef = React__default.useRef(null);
22
+ React__default.useEffect(function () {
23
+ if (!textRef.current || !containerRef.current) {
24
+ return;
25
+ }
26
+ if (textRef.current.scrollHeight > containerRef.current.clientHeight && content) {
27
+ textRef.current.setAttribute('title', content);
28
+ }
29
+ }, [content]);
30
+ return {
31
+ containerRef: containerRef,
32
+ textRef: textRef
33
+ };
34
+ };
35
+
36
+ export { useTruncationTitle };
37
+ //# sourceMappingURL=useTruncationTitle.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTruncationTitle.web.js","sources":["../../../../../../src/utils/useTruncationTitle/useTruncationTitle.web.tsx"],"sourcesContent":["import React from 'react';\n\n/**\n * Utility function that takes checks if text is truncated and adds `htmlTitle` with full text\n *\n * ## Usage\n *\n * ```tsx\n * const { containerRef, textRef } = useTruncationTitle({ content: 'saurabhdaware99@gmail.com' });\n *\n * <Box ref={containerRef}>\n * <BaseText ref={textRef} truncateAfterLines={1}>\n * saurabhdaware99@gmail.com\n * </BaseText>\n * </Box>\n * ```\n */\nconst useTruncationTitle = ({\n content,\n}: {\n /**\n * content that you want to set as htmlTitle\n */\n content?: string;\n}): {\n containerRef: React.RefObject<HTMLDivElement>;\n textRef: React.RefObject<HTMLParagraphElement>;\n} => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const textRef = React.useRef<HTMLParagraphElement>(null);\n\n React.useEffect(() => {\n if (!textRef.current || !containerRef.current) {\n return;\n }\n\n if (textRef.current.scrollHeight > containerRef.current.clientHeight && content) {\n textRef.current.setAttribute('title', content);\n }\n }, [content]);\n\n return {\n containerRef,\n textRef,\n };\n};\n\nexport { useTruncationTitle };\n"],"names":["useTruncationTitle","_ref","content","containerRef","React","useRef","textRef","useEffect","current","scrollHeight","clientHeight","setAttribute"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAUnB;AAAA,EAAA,IATHC,OAAO,GAAAD,IAAA,CAAPC,OAAO,CAAA;AAUP,EAAA,IAAMC,YAAY,GAAGC,cAAK,CAACC,MAAM,CAAiB,IAAI,CAAC,CAAA;AACvD,EAAA,IAAMC,OAAO,GAAGF,cAAK,CAACC,MAAM,CAAuB,IAAI,CAAC,CAAA;EAExDD,cAAK,CAACG,SAAS,CAAC,YAAM;IACpB,IAAI,CAACD,OAAO,CAACE,OAAO,IAAI,CAACL,YAAY,CAACK,OAAO,EAAE;AAC7C,MAAA,OAAA;AACF,KAAA;AAEA,IAAA,IAAIF,OAAO,CAACE,OAAO,CAACC,YAAY,GAAGN,YAAY,CAACK,OAAO,CAACE,YAAY,IAAIR,OAAO,EAAE;MAC/EI,OAAO,CAACE,OAAO,CAACG,YAAY,CAAC,OAAO,EAAET,OAAO,CAAC,CAAA;AAChD,KAAA;AACF,GAAC,EAAE,CAACA,OAAO,CAAC,CAAC,CAAA;EAEb,OAAO;AACLC,IAAAA,YAAY,EAAZA,YAAY;AACZG,IAAAA,OAAO,EAAPA,OAAAA;GACD,CAAA;AACH;;;;"}
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.24.2",
4
+ "version": "11.24.3",
5
5
  "license": "MIT",
6
6
  "engines": {
7
7
  "node": ">=18.12.1"