@razorpay/blade 12.36.0 → 12.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/build/lib/native/components/Typography/BaseText/BaseText.native.js +1 -1
  2. package/build/lib/native/components/Typography/BaseText/BaseText.native.js.map +1 -1
  3. package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js +1 -1
  4. package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
  5. package/build/lib/native/components/Typography/Code/Code.js +1 -1
  6. package/build/lib/native/components/Typography/Code/Code.js.map +1 -1
  7. package/build/lib/native/components/Typography/Display/Display.js +1 -1
  8. package/build/lib/native/components/Typography/Display/Display.js.map +1 -1
  9. package/build/lib/native/components/Typography/Heading/Heading.js +1 -1
  10. package/build/lib/native/components/Typography/Heading/Heading.js.map +1 -1
  11. package/build/lib/native/components/Typography/Text/Text.js +1 -1
  12. package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
  13. package/build/lib/web/development/components/Tooltip/Tooltip.web.js +2 -2
  14. package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
  15. package/build/lib/web/development/components/Typography/BaseText/BaseText.web.js +7 -3
  16. package/build/lib/web/development/components/Typography/BaseText/BaseText.web.js.map +1 -1
  17. package/build/lib/web/development/components/Typography/BaseText/getBaseTextStyles.js +4 -2
  18. package/build/lib/web/development/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
  19. package/build/lib/web/development/components/Typography/Code/Code.js +3 -1
  20. package/build/lib/web/development/components/Typography/Code/Code.js.map +1 -1
  21. package/build/lib/web/development/components/Typography/Display/Display.js +4 -2
  22. package/build/lib/web/development/components/Typography/Display/Display.js.map +1 -1
  23. package/build/lib/web/development/components/Typography/Heading/Heading.js +3 -1
  24. package/build/lib/web/development/components/Typography/Heading/Heading.js.map +1 -1
  25. package/build/lib/web/development/components/Typography/Text/Text.js +4 -2
  26. package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
  27. package/build/lib/web/production/components/Tooltip/Tooltip.web.js +2 -2
  28. package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
  29. package/build/lib/web/production/components/Typography/BaseText/BaseText.web.js +7 -3
  30. package/build/lib/web/production/components/Typography/BaseText/BaseText.web.js.map +1 -1
  31. package/build/lib/web/production/components/Typography/BaseText/getBaseTextStyles.js +4 -2
  32. package/build/lib/web/production/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
  33. package/build/lib/web/production/components/Typography/Code/Code.js +3 -1
  34. package/build/lib/web/production/components/Typography/Code/Code.js.map +1 -1
  35. package/build/lib/web/production/components/Typography/Display/Display.js +4 -2
  36. package/build/lib/web/production/components/Typography/Display/Display.js.map +1 -1
  37. package/build/lib/web/production/components/Typography/Heading/Heading.js +3 -1
  38. package/build/lib/web/production/components/Typography/Heading/Heading.js.map +1 -1
  39. package/build/lib/web/production/components/Typography/Text/Text.js +4 -2
  40. package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
  41. package/build/types/components/index.d.ts +9 -2
  42. package/build/types/components/index.native.d.ts +9 -2
  43. package/package.json +1 -1
@@ -9,7 +9,7 @@ import { useStyledProps } from '../../Box/styledProps/useStyledProps.js';
9
9
  import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.native.js';
10
10
  import { jsx } from 'react/jsx-runtime';
11
11
 
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
+ var _excluded=["color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","letterSpacing","textAlign","textTransform","as","opacity"],_excluded2=["id","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","lineHeight","textAlign","children","truncateAfterLines","textTransform","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,textTransform=_ref.textTransform;_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,textTransform:textTransform,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,textTransform=_ref2.textTransform,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,textTransform:textTransform},makeAccessible(accessibilityProps),metaAttribute({name:componentName,testID:testID}),{children:children}));};var BaseText=React__default.forwardRef(_BaseText);
13
13
 
14
14
  export { BaseText };
15
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 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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,aAAa,CAAAD,mBAAA,GAAGE,KAAAA,CAAAA,CAAAA,aAAa,CAACC,QAAQ,CAAAH,mBAAA,CACtCI,MAAM,CAAAb,KAAA,CAANa,MAAM,CACHC,WAAW,CAAAvB,wBAAA,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;;;;"}
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 textTransform,\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 textTransform,\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 textTransform,\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 textTransform={textTransform}\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","textTransform","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":";;;;;;;;;;;2aAUA,IAAMA,cAAc,CAAGC,MAAM,CAACC,IAAI,CAChC,SAAAC,IAAA,CAeM,CAdJ,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,CACTC,aAAa,CAAAX,IAAA,CAAbW,aAAa,CACXX,IAAA,CAAFY,EAAE,KACFC,OAAO,CAAAb,IAAA,CAAPa,OAAO,CACJC,KAAK,CAAAC,wBAAA,CAAAf,IAAA,CAAAgB,SAAA,EAER,IAAMC,oBAAoB,CAAGC,cAAc,CAACJ,KAAK,CAAC,CAElD,OAAAK,MAAA,CAAAC,MAAA,CAAA,EAAA,CACKC,iBAAiB,CAAC,CACnBpB,KAAK,CAALA,KAAK,CACLC,UAAU,CAAVA,UAAU,CACVC,QAAQ,CAARA,QAAQ,CACRC,UAAU,CAAVA,UAAU,CACVC,SAAS,CAATA,SAAS,CACTC,kBAAkB,CAAlBA,kBAAkB,CAClBC,aAAa,CAAbA,aAAa,CACbC,UAAU,CAAVA,UAAU,CACVC,aAAa,CAAbA,aAAa,CACbC,SAAS,CAATA,SAAS,CACTG,OAAO,CAAPA,OAAO,CACPF,aAAa,CAA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gB,cAAc,CAACH,WAAW,CAAC,CAAA,CAC/BrC,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,CACvBI,EAAE,CAAE8B,SAAU,CACdhC,SAAS,CAAEA,SAAU,CACrBH,aAAa,CAAEqB,kBAAmB,CAClCf,OAAO,CAAEA,OAAQ,CACjBgB,SAAS,CAAEA,SAAU,CACrBC,KAAK,CAAEA,KAAM,CACbJ,EAAE,CAAEA,EAAG,CACPf,aAAa,CAAEA,aAAc,CAAA,CACzBgC,cAAc,CAACX,kBAAkB,CAAC,CAClCY,aAAa,CAAC,CAAEC,IAAI,CAAEX,aAAa,CAAEG,MAAM,CAANA,MAAO,CAAC,CAAC,CAAAV,CAAAA,QAAA,CAEjDA,QAAQ,CACK,CAAA,CAAC,CAErB,CAAC,CAEK,IAAAS,QAAQ,CAAGU,cAAK,CAACC,UAAU,CAACxB,SAAS;;;;"}
@@ -7,7 +7,7 @@ import { isReactNative } from '../../../utils/platform/isReactNative.js';
7
7
  import '../../BladeProvider/useTheme.js';
8
8
  import { makeLetterSpacing } from '../../../utils/makeLetterSpacing/makeLetterSpacing.js';
9
9
 
10
- var getBaseTextStyles=function getBaseTextStyles(_ref){var _ref$color=_ref.color,color=_ref$color===void 0?'surface.text.gray.normal':_ref$color,_ref$fontFamily=_ref.fontFamily,fontFamily=_ref$fontFamily===void 0?'text':_ref$fontFamily,_ref$fontSize=_ref.fontSize,fontSize=_ref$fontSize===void 0?200:_ref$fontSize,_ref$fontWeight=_ref.fontWeight,fontWeight=_ref$fontWeight===void 0?'regular':_ref$fontWeight,_ref$fontStyle=_ref.fontStyle,fontStyle=_ref$fontStyle===void 0?'normal':_ref$fontStyle,_ref$textDecorationLi=_ref.textDecorationLine,textDecorationLine=_ref$textDecorationLi===void 0?'none':_ref$textDecorationLi,numberOfLines=_ref.numberOfLines,wordBreak=_ref.wordBreak,_ref$lineHeight=_ref.lineHeight,lineHeight=_ref$lineHeight===void 0?100:_ref$lineHeight,_ref$letterSpacing=_ref.letterSpacing,letterSpacing=_ref$letterSpacing===void 0?100:_ref$letterSpacing,textAlign=_ref.textAlign,opacity=_ref.opacity,theme=_ref.theme;var textColor=color==='currentColor'?'currentColor':getIn(theme.colors,color);var themeFontFamily=theme.typography.fonts.family[fontFamily];var themeFontSize=makeTypographySize(theme.typography.fonts.size[fontSize]);var themeFontWeight=theme.typography.fonts.weight[fontWeight];var themeLineHeight=makeTypographySize(theme.typography.lineHeights[lineHeight]);var themeLetterSpacing=makeLetterSpacing(theme.typography.letterSpacings[letterSpacing],theme.typography.fonts.size[fontSize]);var truncateStyles={};var wordBreakStyles={};if(numberOfLines!==undefined){if(isReactNative()){truncateStyles={};}else {truncateStyles={overflow:'hidden',display:'-webkit-box','line-clamp':`${numberOfLines}`,'-webkit-line-clamp':`${numberOfLines}`,'-webkit-box-orient':'vertical',overflowWrap:'break-word'};}}if(wordBreak!==undefined){if(isReactNative()){wordBreakStyles={};}else {wordBreakStyles={wordBreak:wordBreak};}}return Object.assign({color:textColor,fontFamily:themeFontFamily,fontSize:themeFontSize,fontWeight:themeFontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine},textDecorationLine!=='none'&&{textDecorationColor:textColor},{lineHeight:themeLineHeight,letterSpacing:themeLetterSpacing,textAlign:textAlign,margin:0,padding:0,opacity:opacity},truncateStyles,wordBreakStyles);};
10
+ var getBaseTextStyles=function getBaseTextStyles(_ref){var _ref$color=_ref.color,color=_ref$color===void 0?'surface.text.gray.normal':_ref$color,_ref$fontFamily=_ref.fontFamily,fontFamily=_ref$fontFamily===void 0?'text':_ref$fontFamily,_ref$fontSize=_ref.fontSize,fontSize=_ref$fontSize===void 0?200:_ref$fontSize,_ref$fontWeight=_ref.fontWeight,fontWeight=_ref$fontWeight===void 0?'regular':_ref$fontWeight,_ref$fontStyle=_ref.fontStyle,fontStyle=_ref$fontStyle===void 0?'normal':_ref$fontStyle,_ref$textDecorationLi=_ref.textDecorationLine,textDecorationLine=_ref$textDecorationLi===void 0?'none':_ref$textDecorationLi,numberOfLines=_ref.numberOfLines,wordBreak=_ref.wordBreak,_ref$lineHeight=_ref.lineHeight,lineHeight=_ref$lineHeight===void 0?100:_ref$lineHeight,_ref$letterSpacing=_ref.letterSpacing,letterSpacing=_ref$letterSpacing===void 0?100:_ref$letterSpacing,textAlign=_ref.textAlign,opacity=_ref.opacity,theme=_ref.theme,textTransform=_ref.textTransform;var textColor=color==='currentColor'?'currentColor':getIn(theme.colors,color);var themeFontFamily=theme.typography.fonts.family[fontFamily];var themeFontSize=makeTypographySize(theme.typography.fonts.size[fontSize]);var themeFontWeight=theme.typography.fonts.weight[fontWeight];var themeLineHeight=makeTypographySize(theme.typography.lineHeights[lineHeight]);var themeLetterSpacing=makeLetterSpacing(theme.typography.letterSpacings[letterSpacing],theme.typography.fonts.size[fontSize]);var truncateStyles={};var wordBreakStyles={};if(numberOfLines!==undefined){if(isReactNative()){truncateStyles={};}else {truncateStyles={overflow:'hidden',display:'-webkit-box','line-clamp':`${numberOfLines}`,'-webkit-line-clamp':`${numberOfLines}`,'-webkit-box-orient':'vertical',overflowWrap:'break-word'};}}if(wordBreak!==undefined){if(isReactNative()){wordBreakStyles={};}else {wordBreakStyles={wordBreak:wordBreak};}}return Object.assign({color:textColor,fontFamily:themeFontFamily,fontSize:themeFontSize,fontWeight:themeFontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine},textDecorationLine!=='none'&&{textDecorationColor:textColor},{lineHeight:themeLineHeight,letterSpacing:themeLetterSpacing,textAlign:textAlign,margin:0,padding:0,opacity:opacity,textTransform:textTransform},truncateStyles,wordBreakStyles);};
11
11
 
12
12
  export { getBaseTextStyles as default };
13
13
  //# sourceMappingURL=getBaseTextStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBaseTextStyles.js","sources":["../../../../../../src/components/Typography/BaseText/getBaseTextStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { StyledBaseTextProps } from './types';\nimport getIn from '~utils/lodashButBetter/get';\nimport { makeTypographySize } from '~utils/makeTypographySize';\nimport { isReactNative } from '~utils';\nimport { makeLetterSpacing } from '~utils/makeLetterSpacing';\n\nconst getBaseTextStyles = ({\n color = 'surface.text.gray.normal',\n fontFamily = 'text',\n fontSize = 200,\n fontWeight = 'regular',\n fontStyle = 'normal',\n textDecorationLine = 'none',\n numberOfLines,\n wordBreak,\n lineHeight = 100,\n letterSpacing = 100,\n textAlign,\n opacity,\n theme,\n}: StyledBaseTextProps): CSSObject => {\n const textColor = color === 'currentColor' ? 'currentColor' : getIn(theme.colors, color);\n const themeFontFamily = theme.typography.fonts.family[fontFamily];\n const themeFontSize = makeTypographySize(theme.typography.fonts.size[fontSize]);\n const themeFontWeight = theme.typography.fonts.weight[fontWeight];\n const themeLineHeight = makeTypographySize(theme.typography.lineHeights[lineHeight]);\n const themeLetterSpacing = makeLetterSpacing(\n theme.typography.letterSpacings[letterSpacing],\n theme.typography.fonts.size[fontSize],\n );\n let truncateStyles: CSSObject = {};\n let wordBreakStyles: CSSObject = {};\n if (numberOfLines !== undefined) {\n if (isReactNative()) {\n truncateStyles = {};\n } else {\n truncateStyles = {\n overflow: 'hidden',\n display: '-webkit-box',\n 'line-clamp': `${numberOfLines}`,\n '-webkit-line-clamp': `${numberOfLines}`,\n '-webkit-box-orient': 'vertical',\n overflowWrap: 'break-word',\n };\n }\n }\n if (wordBreak !== undefined) {\n if (isReactNative()) {\n wordBreakStyles = {};\n } else {\n wordBreakStyles = {\n wordBreak,\n };\n }\n }\n\n return {\n color: textColor,\n fontFamily: themeFontFamily,\n fontSize: themeFontSize,\n fontWeight: themeFontWeight,\n fontStyle,\n textDecorationLine,\n ...(textDecorationLine !== 'none' && {\n textDecorationColor: textColor,\n }),\n lineHeight: themeLineHeight,\n letterSpacing: themeLetterSpacing,\n textAlign,\n margin: 0,\n padding: 0,\n opacity,\n ...truncateStyles,\n ...wordBreakStyles,\n };\n};\n\nexport default getBaseTextStyles;\n"],"names":["getBaseTextStyles","_ref","_ref$color","color","_ref$fontFamily","fontFamily","_ref$fontSize","fontSize","_ref$fontWeight","fontWeight","_ref$fontStyle","fontStyle","_ref$textDecorationLi","textDecorationLine","numberOfLines","wordBreak","_ref$lineHeight","lineHeight","_ref$letterSpacing","letterSpacing","textAlign","opacity","theme","textColor","getIn","colors","themeFontFamily","typography","fonts","family","themeFontSize","makeTypographySize","size","themeFontWeight","weight","themeLineHeight","lineHeights","themeLetterSpacing","makeLetterSpacing","letterSpacings","truncateStyles","wordBreakStyles","undefined","isReactNative","overflow","display","overflowWrap","Object","assign","textDecorationColor","margin","padding"],"mappings":";;;;;;;;;AAOM,IAAAA,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAAC,IAAA,CAce,CAAAC,IAAAA,UAAA,CAAAD,IAAA,CAbpCE,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,0BAA0B,CAAAA,UAAA,CAAAE,eAAA,CAAAH,IAAA,CAClCI,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAA,KAAA,CAAA,CAAG,MAAM,CAAAA,eAAA,CAAAE,aAAA,CAAAL,IAAA,CACnBM,QAAQ,CAARA,QAAQ,CAAAD,aAAA,GAAA,KAAA,CAAA,CAAG,GAAG,CAAAA,aAAA,CAAAE,eAAA,CAAAP,IAAA,CACdQ,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAA,KAAA,CAAA,CAAG,SAAS,CAAAA,eAAA,CAAAE,cAAA,CAAAT,IAAA,CACtBU,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,QAAQ,CAAAA,cAAA,CAAAE,qBAAA,CAAAX,IAAA,CACpBY,kBAAkB,CAAlBA,kBAAkB,CAAAD,qBAAA,GAAA,KAA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AAS,CAAE,CAC/B,GAAIC,aAAa,EAAE,CAAE,CACnBH,cAAc,CAAG,EAAE,CACrB,CAAC,KAAM,CACLA,cAAc,CAAG,CACfI,QAAQ,CAAE,QAAQ,CAClBC,OAAO,CAAE,aAAa,CACtB,YAAY,CAAG,CAAA,EAAE/B,aAAc,CAAA,CAAC,CAChC,oBAAoB,CAAG,CAAEA,EAAAA,aAAc,CAAC,CAAA,CACxC,oBAAoB,CAAE,UAAU,CAChCgC,YAAY,CAAE,YAChB,CAAC,CACH,CACF,CACA,GAAI/B,SAAS,GAAK2B,SAAS,CAAE,CAC3B,GAAIC,aAAa,EAAE,CAAE,CACnBF,eAAe,CAAG,EAAE,CACtB,CAAC,KAAM,CACLA,eAAe,CAAG,CAChB1B,SAAS,CAATA,SACF,CAAC,CACH,CACF,CAEA,OAAAgC,MAAA,CAAAC,MAAA,CACE7C,CAAAA,KAAK,CAAEoB,SAAS,CAChBlB,UAAU,CAAEqB,eAAe,CAC3BnB,QAAQ,CAAEuB,aAAa,CACvBrB,UAAU,CAAEwB,eAAe,CAC3BtB,SAAS,CAATA,SAAS,CACTE,kBAAkB,CAAlBA,kBAAkB,CAAA,CACdA,kBAAkB,GAAK,MAAM,EAAI,CACnCoC,mBAAmB,CAAE1B,SACvB,CAAC,EACDN,UAAU,CAAEkB,eAAe,CAC3BhB,aAAa,CAAEkB,kBAAkB,CACjCjB,SAAS,CAATA,SAAS,CACT8B,MAAM,CAAE,CAAC,CACTC,OAAO,CAAE,CAAC,CACV9B,OAAO,CAAPA,OAAO,CACJmB,CAAAA,cAAc,CACdC,eAAe,EAEtB;;;;"}
1
+ {"version":3,"file":"getBaseTextStyles.js","sources":["../../../../../../src/components/Typography/BaseText/getBaseTextStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { StyledBaseTextProps } from './types';\nimport getIn from '~utils/lodashButBetter/get';\nimport { makeTypographySize } from '~utils/makeTypographySize';\nimport { isReactNative } from '~utils';\nimport { makeLetterSpacing } from '~utils/makeLetterSpacing';\n\nconst getBaseTextStyles = ({\n color = 'surface.text.gray.normal',\n fontFamily = 'text',\n fontSize = 200,\n fontWeight = 'regular',\n fontStyle = 'normal',\n textDecorationLine = 'none',\n numberOfLines,\n wordBreak,\n lineHeight = 100,\n letterSpacing = 100,\n textAlign,\n opacity,\n theme,\n textTransform,\n}: StyledBaseTextProps): CSSObject => {\n const textColor = color === 'currentColor' ? 'currentColor' : getIn(theme.colors, color);\n const themeFontFamily = theme.typography.fonts.family[fontFamily];\n const themeFontSize = makeTypographySize(theme.typography.fonts.size[fontSize]);\n const themeFontWeight = theme.typography.fonts.weight[fontWeight];\n const themeLineHeight = makeTypographySize(theme.typography.lineHeights[lineHeight]);\n const themeLetterSpacing = makeLetterSpacing(\n theme.typography.letterSpacings[letterSpacing],\n theme.typography.fonts.size[fontSize],\n );\n let truncateStyles: CSSObject = {};\n let wordBreakStyles: CSSObject = {};\n if (numberOfLines !== undefined) {\n if (isReactNative()) {\n truncateStyles = {};\n } else {\n truncateStyles = {\n overflow: 'hidden',\n display: '-webkit-box',\n 'line-clamp': `${numberOfLines}`,\n '-webkit-line-clamp': `${numberOfLines}`,\n '-webkit-box-orient': 'vertical',\n overflowWrap: 'break-word',\n };\n }\n }\n if (wordBreak !== undefined) {\n if (isReactNative()) {\n wordBreakStyles = {};\n } else {\n wordBreakStyles = {\n wordBreak,\n };\n }\n }\n\n return {\n color: textColor,\n fontFamily: themeFontFamily,\n fontSize: themeFontSize,\n fontWeight: themeFontWeight,\n fontStyle,\n textDecorationLine,\n ...(textDecorationLine !== 'none' && {\n textDecorationColor: textColor,\n }),\n lineHeight: themeLineHeight,\n letterSpacing: themeLetterSpacing,\n textAlign,\n margin: 0,\n padding: 0,\n opacity,\n textTransform,\n ...truncateStyles,\n ...wordBreakStyles,\n };\n};\n\nexport default getBaseTextStyles;\n"],"names":["getBaseTextStyles","_ref","_ref$color","color","_ref$fontFamily","fontFamily","_ref$fontSize","fontSize","_ref$fontWeight","fontWeight","_ref$fontStyle","fontStyle","_ref$textDecorationLi","textDecorationLine","numberOfLines","wordBreak","_ref$lineHeight","lineHeight","_ref$letterSpacing","letterSpacing","textAlign","opacity","theme","textTransform","textColor","getIn","colors","themeFontFamily","typography","fonts","family","themeFontSize","makeTypographySize","size","themeFontWeight","weight","themeLineHeight","lineHeights","themeLetterSpacing","makeLetterSpacing","letterSpacings","truncateStyles","wordBreakStyles","undefined","isReactNative","overflow","display","overflowWrap","Object","assign","textDecorationColor","margin","padding"],"mappings":";;;;;;;;;AAOM,IAAAA,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAAC,IAAA,CAee,CAAAC,IAAAA,UAAA,CAAAD,IAAA,CAdpCE,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,0BAA0B,CAAAA,UAAA,CAAAE,eAAA,CAAAH,IAAA,CAClCI,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAA,KAAA,CAAA,CAAG,MAAM,CAAAA,eAAA,CAAAE,aAAA,CAAAL,IAAA,CACnBM,QAAQ,CAARA,QAAQ,CAAAD,aAAA,GAAG,KAAA,CAAA,CAAA,GAAG,CAAAA,aAAA,CAAAE,eAAA,CAAAP,IAAA,CACdQ,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAG,KAAA,CAAA,CAAA,SAAS,CAAAA,eAAA,CAAAE,cAAA,CAAAT,IAAA,CACtBU,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAG,KAAA,CAAA,CAAA,QAAQ,CAAAA,cAAA,CAAAE,qBAAA,CAAAX,IAAA,CACpBY,kBAAkB,CAAlBA,kBAAkB,CAAAD,qBAAA,GAAG,KAAA,CAAA,CAAA,MAAM,CAAAA,qBAAA,CAC3BE,aAAa,CAAAb,IAAA,CAAba,aAAa,CACbC,SAAS,CAAAd,IAAA,CAATc,SAAS,CAAAC,eAAA,CAAAf,IAAA,CACTgB,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAA,KAAA,CA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E,aAAa,CACtB,YAAY,CAAG,CAAA,EAAEhC,aAAc,CAAA,CAAC,CAChC,oBAAoB,CAAG,CAAA,EAAEA,aAAc,CAAA,CAAC,CACxC,oBAAoB,CAAE,UAAU,CAChCiC,YAAY,CAAE,YAChB,CAAC,CACH,CACF,CACA,GAAIhC,SAAS,GAAK4B,SAAS,CAAE,CAC3B,GAAIC,aAAa,EAAE,CAAE,CACnBF,eAAe,CAAG,EAAE,CACtB,CAAC,KAAM,CACLA,eAAe,CAAG,CAChB3B,SAAS,CAATA,SACF,CAAC,CACH,CACF,CAEA,OAAAiC,MAAA,CAAAC,MAAA,EACE9C,KAAK,CAAEqB,SAAS,CAChBnB,UAAU,CAAEsB,eAAe,CAC3BpB,QAAQ,CAAEwB,aAAa,CACvBtB,UAAU,CAAEyB,eAAe,CAC3BvB,SAAS,CAATA,SAAS,CACTE,kBAAkB,CAAlBA,kBAAkB,CAAA,CACdA,kBAAkB,GAAK,MAAM,EAAI,CACnCqC,mBAAmB,CAAE1B,SACvB,CAAC,CACDP,CAAAA,UAAU,CAAEmB,eAAe,CAC3BjB,aAAa,CAAEmB,kBAAkB,CACjClB,SAAS,CAATA,SAAS,CACT+B,MAAM,CAAE,CAAC,CACTC,OAAO,CAAE,CAAC,CACV/B,OAAO,CAAPA,OAAO,CACPE,aAAa,CAAbA,aAAa,CAAA,CACVkB,cAAc,CACdC,eAAe,CAAA,CAEtB;;;;"}
@@ -17,7 +17,7 @@ import { metaAttribute } from '../../../utils/metaAttribute/metaAttribute.native
17
17
  import { MetaConstants } from '../../../utils/metaAttribute/metaConstants.js';
18
18
  import { jsx } from 'react/jsx-runtime';
19
19
 
20
- var _excluded=["children","size","weight","isHighlighted","color","testID"];var platformType=getPlatformType();var isPlatformWeb=platformType==='browser'||platformType==='node';var getCodeFontSizeAndLineHeight=function getCodeFontSizeAndLineHeight(size){switch(size){case'medium':return {fontSize:75,lineHeight:75};case'small':return {fontSize:25,lineHeight:25};default:if(__DEV__){throwBladeError({moduleName:'Code',message:`Unexpected size: ${size}`});}return undefined;}};var CodeContainer=styled(BaseBox)(function(props){var padding=`${makeSpace(props.theme.spacing[0])} ${makeSpace(props.theme.spacing[2])}`;return {padding:padding,backgroundColor:props.isHighlighted?props.theme.colors.feedback.background.neutral.subtle:undefined,borderRadius:props.theme.border.radius.medium,display:isPlatformWeb?'inline-block':'flex',alignSelf:isPlatformWeb?undefined:'center',verticalAlign:'middle',lineHeight:makeTypographySize(props.theme.typography.lineHeights[0])};});var getCodeColor=function getCodeColor(_ref){var isHighlighted=_ref.isHighlighted,color=_ref.color;if(isHighlighted){if(__DEV__){if(color){throwBladeError({moduleName:'Code',message:'`color` prop cannot be used without `isHighlighted={false}`'});}}return 'surface.text.gray.subtle';}if(color){return color;}return 'surface.text.gray.normal';};var _Code=function _Code(_ref2,ref){var children=_ref2.children,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,_ref2$isHighlighted=_ref2.isHighlighted,isHighlighted=_ref2$isHighlighted===void 0?true:_ref2$isHighlighted,color=_ref2.color,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded);var _ref3=getCodeFontSizeAndLineHeight(size),fontSize=_ref3.fontSize,lineHeight=_ref3.lineHeight;var codeTextColor=React__default.useMemo(function(){return getCodeColor({isHighlighted:isHighlighted,color:color});},[isHighlighted,color]);return jsx(CodeContainer,Object.assign({ref:ref,size:size,isHighlighted:isHighlighted,as:isPlatformWeb?'span':undefined},metaAttribute({name:MetaConstants.Code,testID:testID}),getStyledProps(styledProps),{children:jsx(BaseText,{color:codeTextColor,fontFamily:"code",fontSize:fontSize,fontWeight:weight,as:isPlatformWeb?'code':undefined,lineHeight:lineHeight,children:children})}));};var Code=React__default.forwardRef(_Code);
20
+ var _excluded=["children","size","weight","isHighlighted","color","testID","textTransform"];var platformType=getPlatformType();var isPlatformWeb=platformType==='browser'||platformType==='node';var getCodeFontSizeAndLineHeight=function getCodeFontSizeAndLineHeight(size){switch(size){case'medium':return {fontSize:75,lineHeight:75};case'small':return {fontSize:25,lineHeight:25};default:if(__DEV__){throwBladeError({moduleName:'Code',message:`Unexpected size: ${size}`});}return undefined;}};var CodeContainer=styled(BaseBox)(function(props){var padding=`${makeSpace(props.theme.spacing[0])} ${makeSpace(props.theme.spacing[2])}`;return {padding:padding,backgroundColor:props.isHighlighted?props.theme.colors.feedback.background.neutral.subtle:undefined,borderRadius:props.theme.border.radius.medium,display:isPlatformWeb?'inline-block':'flex',alignSelf:isPlatformWeb?undefined:'center',verticalAlign:'middle',lineHeight:makeTypographySize(props.theme.typography.lineHeights[0])};});var getCodeColor=function getCodeColor(_ref){var isHighlighted=_ref.isHighlighted,color=_ref.color;if(isHighlighted){if(__DEV__){if(color){throwBladeError({moduleName:'Code',message:'`color` prop cannot be used without `isHighlighted={false}`'});}}return 'surface.text.gray.subtle';}if(color){return color;}return 'surface.text.gray.normal';};var _Code=function _Code(_ref2,ref){var children=_ref2.children,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,_ref2$isHighlighted=_ref2.isHighlighted,isHighlighted=_ref2$isHighlighted===void 0?true:_ref2$isHighlighted,color=_ref2.color,testID=_ref2.testID,textTransform=_ref2.textTransform,styledProps=_objectWithoutProperties(_ref2,_excluded);var _ref3=getCodeFontSizeAndLineHeight(size),fontSize=_ref3.fontSize,lineHeight=_ref3.lineHeight;var codeTextColor=React__default.useMemo(function(){return getCodeColor({isHighlighted:isHighlighted,color:color});},[isHighlighted,color]);return jsx(CodeContainer,Object.assign({ref:ref,size:size,isHighlighted:isHighlighted,as:isPlatformWeb?'span':undefined},metaAttribute({name:MetaConstants.Code,testID:testID}),getStyledProps(styledProps),{children:jsx(BaseText,{color:codeTextColor,fontFamily:"code",fontSize:fontSize,fontWeight:weight,as:isPlatformWeb?'code':undefined,lineHeight:lineHeight,textTransform:textTransform,children:children})}));};var Code=React__default.forwardRef(_Code);
21
21
 
22
22
  export { Code };
23
23
  //# sourceMappingURL=Code.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Code.js","sources":["../../../../../../src/components/Typography/Code/Code.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { FontSize, Typography } from '~tokens/global';\nimport type { BladeElementRef, StringChildrenType, TestID } from '~utils/types';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeTypographySize } from '~utils/makeTypographySize';\nimport { throwBladeError } from '~utils/logger';\n\ntype CodeCommonProps = {\n /**\n * Sets the color of the Heading component.\n */\n children: StringChildrenType;\n /**\n * Decides the fontSize and padding of Code\n *\n * @default small\n */\n size?: Extract<BaseTextSizes, 'small' | 'medium'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'bold'>;\n isHighlighted?: boolean;\n color?: BaseTextProps['color'];\n} & TestID &\n StyledPropsBlade;\n\ntype CodeHighlightedProps = CodeCommonProps & {\n /**\n * Adds background color to highlight the text\n *\n * @default true\n */\n isHighlighted?: true;\n /**\n * color prop can only be added when `isHighlighted` is set to `false`\n */\n color?: undefined;\n};\n\ntype CodeNonHighlightedProps = CodeCommonProps & {\n /**\n * Adds background color to highlight the text\n *\n * @default true\n */\n isHighlighted: false;\n /**\n * color prop to set color of text when `isHighlighted` is set to false\n */\n color?: BaseTextProps['color'];\n};\n\nexport type CodeProps = CodeHighlightedProps | CodeNonHighlightedProps;\n\ntype CodeContainerProps = {\n size: CodeProps['size'];\n isHighlighted: CodeProps['isHighlighted'];\n};\n\nconst platformType = getPlatformType();\nconst isPlatformWeb = platformType === 'browser' || platformType === 'node';\n\nconst getCodeFontSizeAndLineHeight = (\n size: CodeProps['size'],\n): { fontSize: keyof FontSize; lineHeight: keyof Typography['lineHeights'] } | undefined => {\n switch (size) {\n case 'medium':\n return { fontSize: 75, lineHeight: 75 };\n case 'small':\n return { fontSize: 25, lineHeight: 25 };\n default:\n if (__DEV__) {\n throwBladeError({\n moduleName: 'Code',\n message: `Unexpected size: ${size}`,\n });\n }\n return undefined;\n }\n};\n\nconst CodeContainer = styled(BaseBox)<CodeContainerProps>((props) => {\n const padding = `${makeSpace(props.theme.spacing[0])} ${makeSpace(props.theme.spacing[2])}`;\n return {\n padding,\n backgroundColor: props.isHighlighted\n ? props.theme.colors.feedback.background.neutral.subtle\n : undefined,\n borderRadius: props.theme.border.radius.medium,\n display: isPlatformWeb ? 'inline-block' : 'flex',\n alignSelf: isPlatformWeb ? undefined : 'center',\n verticalAlign: 'middle',\n lineHeight: makeTypographySize(props.theme.typography.lineHeights[0]),\n };\n});\n\nconst getCodeColor = ({\n isHighlighted,\n color,\n}: Pick<CodeProps, 'isHighlighted' | 'color'>): CodeProps['color'] => {\n if (isHighlighted) {\n if (__DEV__) {\n if (color) {\n throwBladeError({\n moduleName: 'Code',\n message: '`color` prop cannot be used without `isHighlighted={false}`',\n });\n }\n }\n\n return 'surface.text.gray.subtle';\n }\n\n if (color) {\n return color;\n }\n\n return 'surface.text.gray.normal';\n};\n\nconst _Code = (\n {\n children,\n size = 'small',\n weight = 'regular',\n isHighlighted = true,\n color,\n testID,\n ...styledProps\n }: CodeProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const { fontSize, lineHeight } = getCodeFontSizeAndLineHeight(size)!;\n const codeTextColor = React.useMemo<CodeProps['color']>(\n () => getCodeColor({ isHighlighted, color }),\n [isHighlighted, color],\n );\n\n return (\n <CodeContainer\n ref={ref as never}\n size={size}\n isHighlighted={isHighlighted}\n as={isPlatformWeb ? 'span' : undefined}\n {...metaAttribute({ name: MetaConstants.Code, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseText\n color={codeTextColor}\n fontFamily=\"code\"\n fontSize={fontSize}\n fontWeight={weight}\n as={isPlatformWeb ? 'code' : undefined}\n lineHeight={lineHeight}\n >\n {children}\n </BaseText>\n </CodeContainer>\n );\n};\n\n/**\n * Code component can be used for displaying token, variable names, or inlined code snippets.\n *\n * ## Usage\n *\n * ### In Web\n * In web, you can use it inside `Text` component or individually. The component is set to display `inline-block`\n *\n * ```tsx\n * <Text>\n * Lorem ipsum <Code>SENTRY_TOKEN</Code> normal text\n * </Text>\n * ```\n *\n * ### In React Native\n *\n * In React Native, you would have to align it using flex to make sure the Code and the surrounding text is correctly aligned\n *\n * ```tsx\n * <Box flexWrap=\"wrap\" flexDirection=\"row\" alignItems=\"flex-start\">\n * <Text>Lorem ipsum </Text>\n * <Code>SENTRY_TOKEN</Code>\n * <Text> normal text</Text>\n * </Box>\n * ```\n */\nconst Code = React.forwardRef(_Code);\n\nexport { Code };\n"],"names":["platformType","getPlatformType","isPlatformWeb","getCodeFontSizeAndLineHeight","size","fontSize","lineHeight","__DEV__","throwBladeError","moduleName","message","undefined","CodeContainer","styled","BaseBox","props","padding","makeSpace","theme","spacing","backgroundColor","isHighlighted","colors","feedback","background","neutral","subtle","borderRadius","border","radius","medium","display","alignSelf","verticalAlign","makeTypographySize","typography","lineHeights","getCodeColor","_ref","color","_Code","_ref2","ref","children","_ref2$size","_ref2$weight","weight","_ref2$isHighlighted","testID","styledProps","_objectWithoutProperties","_excluded","_ref3","codeTextColor","React","useMemo","_jsx","Object","assign","as","metaAttribute","name","MetaConstants","Code","getStyledProps","BaseText","fontFamily","fontWeight","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,MAAA,CAAA,QAAA,CAAA,eAAA,CAAA,OAAA,CAAA,QAAA,CAAA,CAiEA,IAAMA,YAAY,CAAGC,eAAe,EAAE,CACtC,IAAMC,aA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,aAAa,CAAGC,cAAK,CAACC,OAAO,CACjC,UAAM,CAAA,OAAAlB,YAAY,CAAC,CAAEhB,aAAa,CAAbA,aAAa,CAAEkB,KAAK,CAALA,KAAM,CAAC,CAAC,CAC5C,CAAA,CAAA,CAAClB,aAAa,CAAEkB,KAAK,CACvB,CAAC,CAED,OACEiB,GAAA,CAAC5C,aAAa,CAAA6C,MAAA,CAAAC,MAAA,CAAA,CACZhB,GAAG,CAAEA,GAAa,CAClBtC,IAAI,CAAEA,IAAK,CACXiB,aAAa,CAAEA,aAAc,CAC7BsC,EAAE,CAAEzD,aAAa,CAAG,MAAM,CAAGS,SAAU,CAAA,CACnCiD,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,IAAI,CAAEf,MAAM,CAANA,MAAO,CAAC,CAAC,CACnDgB,cAAc,CAACf,WAAW,CAAC,CAAAN,CAAAA,QAAA,CAE/Ba,GAAA,CAACS,QAAQ,CAAA,CACP1B,KAAK,CAAEc,aAAc,CACrBa,UAAU,CAAC,MAAM,CACjB7D,QAAQ,CAAEA,QAAS,CACnB8D,UAAU,CAAErB,MAAO,CACnBa,EAAE,CAAEzD,aAAa,CAAG,MAAM,CAAGS,SAAU,CACvCL,UAAU,CAAEA,UAAW,CAAAqC,QAAA,CAEtBA,QAAQ,CACD,CAAC,CAAA,CACE,CAAC,CAEpB,CAAC,CA4BK,IAAAoB,IAAI,CAAGT,cAAK,CAACc,UAAU,CAAC5B,KAAK;;;;"}
1
+ {"version":3,"file":"Code.js","sources":["../../../../../../src/components/Typography/Code/Code.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { FontSize, Typography } from '~tokens/global';\nimport type { BladeElementRef, StringChildrenType, TestID } from '~utils/types';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeTypographySize } from '~utils/makeTypographySize';\nimport { throwBladeError } from '~utils/logger';\n\ntype CodeCommonProps = {\n /**\n * Sets the color of the Heading component.\n */\n children: StringChildrenType;\n /**\n * Decides the fontSize and padding of Code\n *\n * @default small\n */\n size?: Extract<BaseTextSizes, 'small' | 'medium'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'bold'>;\n isHighlighted?: boolean;\n textTransform?: BaseTextProps['textTransform'];\n color?: BaseTextProps['color'];\n} & TestID &\n StyledPropsBlade;\n\ntype CodeHighlightedProps = CodeCommonProps & {\n /**\n * Adds background color to highlight the text\n *\n * @default true\n */\n isHighlighted?: true;\n /**\n * color prop can only be added when `isHighlighted` is set to `false`\n */\n color?: undefined;\n};\n\ntype CodeNonHighlightedProps = CodeCommonProps & {\n /**\n * Adds background color to highlight the text\n *\n * @default true\n */\n isHighlighted: false;\n /**\n * color prop to set color of text when `isHighlighted` is set to false\n */\n color?: BaseTextProps['color'];\n};\n\nexport type CodeProps = CodeHighlightedProps | CodeNonHighlightedProps;\n\ntype CodeContainerProps = {\n size: CodeProps['size'];\n isHighlighted: CodeProps['isHighlighted'];\n};\n\nconst platformType = getPlatformType();\nconst isPlatformWeb = platformType === 'browser' || platformType === 'node';\n\nconst getCodeFontSizeAndLineHeight = (\n size: CodeProps['size'],\n): { fontSize: keyof FontSize; lineHeight: keyof Typography['lineHeights'] } | undefined => {\n switch (size) {\n case 'medium':\n return { fontSize: 75, lineHeight: 75 };\n case 'small':\n return { fontSize: 25, lineHeight: 25 };\n default:\n if (__DEV__) {\n throwBladeError({\n moduleName: 'Code',\n message: `Unexpected size: ${size}`,\n });\n }\n return undefined;\n }\n};\n\nconst CodeContainer = styled(BaseBox)<CodeContainerProps>((props) => {\n const padding = `${makeSpace(props.theme.spacing[0])} ${makeSpace(props.theme.spacing[2])}`;\n return {\n padding,\n backgroundColor: props.isHighlighted\n ? props.theme.colors.feedback.background.neutral.subtle\n : undefined,\n borderRadius: props.theme.border.radius.medium,\n display: isPlatformWeb ? 'inline-block' : 'flex',\n alignSelf: isPlatformWeb ? undefined : 'center',\n verticalAlign: 'middle',\n lineHeight: makeTypographySize(props.theme.typography.lineHeights[0]),\n };\n});\n\nconst getCodeColor = ({\n isHighlighted,\n color,\n}: Pick<CodeProps, 'isHighlighted' | 'color'>): CodeProps['color'] => {\n if (isHighlighted) {\n if (__DEV__) {\n if (color) {\n throwBladeError({\n moduleName: 'Code',\n message: '`color` prop cannot be used without `isHighlighted={false}`',\n });\n }\n }\n\n return 'surface.text.gray.subtle';\n }\n\n if (color) {\n return color;\n }\n\n return 'surface.text.gray.normal';\n};\n\nconst _Code = (\n {\n children,\n size = 'small',\n weight = 'regular',\n isHighlighted = true,\n color,\n testID,\n textTransform,\n ...styledProps\n }: CodeProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const { fontSize, lineHeight } = getCodeFontSizeAndLineHeight(size)!;\n const codeTextColor = React.useMemo<CodeProps['color']>(\n () => getCodeColor({ isHighlighted, color }),\n [isHighlighted, color],\n );\n\n return (\n <CodeContainer\n ref={ref as never}\n size={size}\n isHighlighted={isHighlighted}\n as={isPlatformWeb ? 'span' : undefined}\n {...metaAttribute({ name: MetaConstants.Code, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseText\n color={codeTextColor}\n fontFamily=\"code\"\n fontSize={fontSize}\n fontWeight={weight}\n as={isPlatformWeb ? 'code' : undefined}\n lineHeight={lineHeight}\n textTransform={textTransform}\n >\n {children}\n </BaseText>\n </CodeContainer>\n );\n};\n\n/**\n * Code component can be used for displaying token, variable names, or inlined code snippets.\n *\n * ## Usage\n *\n * ### In Web\n * In web, you can use it inside `Text` component or individually. The component is set to display `inline-block`\n *\n * ```tsx\n * <Text>\n * Lorem ipsum <Code>SENTRY_TOKEN</Code> normal text\n * </Text>\n * ```\n *\n * ### In React Native\n *\n * In React Native, you would have to align it using flex to make sure the Code and the surrounding text is correctly aligned\n *\n * ```tsx\n * <Box flexWrap=\"wrap\" flexDirection=\"row\" alignItems=\"flex-start\">\n * <Text>Lorem ipsum </Text>\n * <Code>SENTRY_TOKEN</Code>\n * <Text> normal text</Text>\n * </Box>\n * ```\n */\nconst Code = React.forwardRef(_Code);\n\nexport { Code };\n"],"names":["platformType","getPlatformType","isPlatformWeb","getCodeFontSizeAndLineHeight","size","fontSize","lineHeight","__DEV__","throwBladeError","moduleName","message","undefined","CodeContainer","styled","BaseBox","props","padding","makeSpace","theme","spacing","backgroundColor","isHighlighted","colors","feedback","background","neutral","subtle","borderRadius","border","radius","medium","display","alignSelf","verticalAlign","makeTypographySize","typography","lineHeights","getCodeColor","_ref","color","_Code","_ref2","ref","children","_ref2$size","_ref2$weight","weight","_ref2$isHighlighted","testID","textTransform","styledProps","_objectWithoutProperties","_excluded","_ref3","codeTextColor","React","useMemo","_jsx","Object","assign","as","metaAttribute","name","MetaConstants","Code","getStyledProps","BaseText","fontFamily","fontWeight","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,MAAA,CAAA,QAAA,CAAA,eAAA,CAAA,OAAA,CAAA,QAAA,CAAA,eAAA,CAAA,CAkEA,IAAMA,YAAY,CAAGC,eAAe,EAAE,CACtC,IAAMC,aAAa,CAAGF,YAAY,GAAK,SAAS,EAAIA,YAAY,GAAK,MAAM,CAE3E,IAAMG,4BAA4B,CAAG,SAA/BA,4BAA4BA,CAChCC,IAAuB,CACmE,CAC1F,OAAQA,IAAI,EACV,IAAK,QAAQ,CACX,OAAO,CAAEC,QAAQ,CAAE,EAAE,CAAEC,UAAU,CAAE,EAAG,CAAC,CACzC,IAAK,OAAO,CACV,OAAO,CAAED,QAAQ,CAAE,EAAE,CAAEC,UAAU,CAAE,EAAG,CAAC,CACzC,QACE,GAAIC,OAAO,CAAE,CACXC,eAAe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,aAAc,CAC7BuC,EAAE,CAAE1D,aAAa,CAAG,MAAM,CAAGS,SAAU,CACnCkD,CAAAA,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,IAAI,CAAEhB,MAAM,CAANA,MAAO,CAAC,CAAC,CACnDiB,cAAc,CAACf,WAAW,CAAC,CAAAP,CAAAA,QAAA,CAE/Bc,GAAA,CAACS,QAAQ,EACP3B,KAAK,CAAEe,aAAc,CACrBa,UAAU,CAAC,MAAM,CACjB9D,QAAQ,CAAEA,QAAS,CACnB+D,UAAU,CAAEtB,MAAO,CACnBc,EAAE,CAAE1D,aAAa,CAAG,MAAM,CAAGS,SAAU,CACvCL,UAAU,CAAEA,UAAW,CACvB2C,aAAa,CAAEA,aAAc,CAAAN,QAAA,CAE5BA,QAAQ,CACD,CAAC,CAAA,CACE,CAAC,CAEpB,CAAC,CA4BK,IAAAqB,IAAI,CAAGT,cAAK,CAACc,UAAU,CAAC7B,KAAK;;;;"}
@@ -11,7 +11,7 @@ import { getPlatformType } from '../../../utils/getPlatformType/getPlatformType.
11
11
  import '../../BladeProvider/useTheme.js';
12
12
  import { jsx } from 'react/jsx-runtime';
13
13
 
14
- var _excluded=["as","size","weight","color","children","testID","textAlign","textDecorationLine"];var validAsValues=['span','h1','h2','h3','h4','h5','h6'];var getProps=function getProps(_ref){var as=_ref.as,size=_ref.size,weight=_ref.weight,color=_ref.color,testID=_ref.testID;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var letterSpacing=weight==='medium'||weight==='regular'?50:100;var props={color:color,fontSize:800,fontWeight:weight,fontStyle:'normal',lineHeight:800,fontFamily:'heading',accessibilityProps:isPlatformWeb?{}:{role:'heading'},componentName:'display',testID:testID,letterSpacing:letterSpacing};if(size==='small'){props.fontSize=800;props.lineHeight=800;}else if(size==='medium'){props.fontSize=900;props.lineHeight=900;}else if(size==='large'){props.fontSize=1000;props.lineHeight=1000;}else if(size==='xlarge'){props.fontSize=1100;props.lineHeight=1100;}props.as=isPlatformWeb?'h1':undefined;props.as=as||props.as;return props;};var _Display=function _Display(_ref2,ref){var as=_ref2.as,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'semibold':_ref2$weight,_ref2$color=_ref2.color,color=_ref2$color===void 0?'surface.text.gray.normal':_ref2$color,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,styledProps=_objectWithoutProperties(_ref2,_excluded);useValidateAsProp({componentName:'Display',as:as,validAsValues:validAsValues});var props=getProps({as:as,size:size,color:color,weight:weight,testID:testID});return jsx(BaseText,Object.assign({ref:ref},props,{textAlign:textAlign,textDecorationLine:textDecorationLine},getStyledProps(styledProps),{children:children}));};var Display=React__default.forwardRef(_Display);
14
+ var _excluded=["as","size","weight","color","children","testID","textAlign","textDecorationLine","textTransform"];var validAsValues=['span','h1','h2','h3','h4','h5','h6'];var getProps=function getProps(_ref){var as=_ref.as,size=_ref.size,weight=_ref.weight,color=_ref.color,testID=_ref.testID;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var letterSpacing=weight==='medium'||weight==='regular'?50:100;var props={color:color,fontSize:800,fontWeight:weight,fontStyle:'normal',lineHeight:800,fontFamily:'heading',accessibilityProps:isPlatformWeb?{}:{role:'heading'},componentName:'display',testID:testID,letterSpacing:letterSpacing};if(size==='small'){props.fontSize=800;props.lineHeight=800;}else if(size==='medium'){props.fontSize=900;props.lineHeight=900;}else if(size==='large'){props.fontSize=1000;props.lineHeight=1000;}else if(size==='xlarge'){props.fontSize=1100;props.lineHeight=1100;}props.as=isPlatformWeb?'h1':undefined;props.as=as||props.as;return props;};var _Display=function _Display(_ref2,ref){var as=_ref2.as,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'semibold':_ref2$weight,_ref2$color=_ref2.color,color=_ref2$color===void 0?'surface.text.gray.normal':_ref2$color,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,textTransform=_ref2.textTransform,styledProps=_objectWithoutProperties(_ref2,_excluded);useValidateAsProp({componentName:'Display',as:as,validAsValues:validAsValues});var props=getProps({as:as,size:size,color:color,weight:weight,testID:testID});return jsx(BaseText,Object.assign({ref:ref},props,{textAlign:textAlign,textDecorationLine:textDecorationLine,textTransform:textTransform},getStyledProps(styledProps),{children:children}));};var Display=React__default.forwardRef(_Display);
15
15
 
16
16
  export { Display };
17
17
  //# sourceMappingURL=Display.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Display.js","sources":["../../../../../../src/components/Typography/Display/Display.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { BladeElementRef, TestID } from '~utils/types';\nimport { getPlatformType } from '~utils';\n\nconst validAsValues = ['span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nexport type DisplayProps = {\n as?: typeof validAsValues[number];\n /**\n * Overrides the color of the Display component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of title\n */\n color?: BaseTextProps['color'];\n size?: Extract<BaseTextSizes, 'small' | 'medium' | 'large' | 'xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n children: React.ReactNode;\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n} & TestID &\n StyledPropsBlade;\n\nconst getProps = ({\n as,\n size,\n weight,\n color,\n testID,\n}: Pick<DisplayProps, 'as' | 'size' | 'color' | 'weight' | 'testID'>): Omit<\n BaseTextProps,\n 'children'\n> => {\n const isPlatformWeb = getPlatformType() === 'browser' || getPlatformType() === 'node';\n const letterSpacing = weight === 'medium' || weight === 'regular' ? 50 : 100;\n const props: Omit<BaseTextProps, 'children'> = {\n color,\n fontSize: 800,\n fontWeight: weight,\n fontStyle: 'normal',\n lineHeight: 800,\n fontFamily: 'heading',\n accessibilityProps: isPlatformWeb ? {} : { role: 'heading' },\n componentName: 'display',\n testID,\n letterSpacing,\n };\n\n if (size === 'small') {\n props.fontSize = 800;\n props.lineHeight = 800;\n } else if (size === 'medium') {\n props.fontSize = 900;\n props.lineHeight = 900;\n } else if (size === 'large') {\n props.fontSize = 1000;\n props.lineHeight = 1000;\n } else if (size === 'xlarge') {\n props.fontSize = 1100;\n props.lineHeight = 1100;\n }\n\n props.as = isPlatformWeb ? 'h1' : undefined;\n // override the computed `as` prop if user passed an `as` prop\n props.as = as || props.as;\n return props;\n};\n\nconst _Display = (\n {\n as,\n size = 'small',\n weight = 'semibold',\n color = 'surface.text.gray.normal',\n children,\n testID,\n textAlign,\n textDecorationLine,\n ...styledProps\n }: DisplayProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n useValidateAsProp({ componentName: 'Display', as, validAsValues });\n\n const props = getProps({ as, size, color, weight, testID });\n\n return (\n <BaseText\n ref={ref}\n {...props}\n textAlign={textAlign}\n textDecorationLine={textDecorationLine}\n {...getStyledProps(styledProps)}\n >\n {children}\n </BaseText>\n );\n};\n\nconst Display = React.forwardRef(_Display);\nexport { Display };\n"],"names":["validAsValues","getProps","_ref","as","size","weight","color","testID","isPlatformWeb","getPlatformType","letterSpacing","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","accessibilityProps","role","componentName","undefined","_Display","_ref2","ref","_ref2$size","_ref2$weight","_ref2$color","children","textAlign","textDecorationLine","styledProps","_objectWithoutProperties","_excluded","useValidateAsProp","_jsx","BaseText","Object","assign","getStyledProps","Display","React","forwardRef"],"mappings":";;;;;;;;;;;;;kGAUA,IAAMA,aAAa,CAAG,CAAC,MAAM,CAAE,IAAI,CAAE,IAAI,CAAE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,QAAQ,CAAAC,MAAA,CAAAC,MAAA,CACPd,CAAAA,GAAG,CAAEA,GAAI,CACLZ,CAAAA,KAAK,CACTiB,CAAAA,SAAS,CAAEA,SAAU,CACrBC,kBAAkB,CAAEA,kBAAmB,CAAA,CACnCS,cAAc,CAACR,WAAW,CAAC,CAAAH,CAAAA,QAAA,CAE9BA,QAAQ,CACD,CAAA,CAAC,CAEf,CAAC,CAEK,IAAAY,OAAO,CAAGC,cAAK,CAACC,UAAU,CAACpB,QAAQ;;;;"}
1
+ {"version":3,"file":"Display.js","sources":["../../../../../../src/components/Typography/Display/Display.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { BladeElementRef, TestID } from '~utils/types';\nimport { getPlatformType } from '~utils';\n\nconst validAsValues = ['span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nexport type DisplayProps = {\n as?: typeof validAsValues[number];\n /**\n * Overrides the color of the Display component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of title\n */\n color?: BaseTextProps['color'];\n size?: Extract<BaseTextSizes, 'small' | 'medium' | 'large' | 'xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n children: React.ReactNode;\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n textTransform?: BaseTextProps['textTransform'];\n} & TestID &\n StyledPropsBlade;\n\nconst getProps = ({\n as,\n size,\n weight,\n color,\n testID,\n}: Pick<DisplayProps, 'as' | 'size' | 'color' | 'weight' | 'testID'>): Omit<\n BaseTextProps,\n 'children'\n> => {\n const isPlatformWeb = getPlatformType() === 'browser' || getPlatformType() === 'node';\n const letterSpacing = weight === 'medium' || weight === 'regular' ? 50 : 100;\n const props: Omit<BaseTextProps, 'children'> = {\n color,\n fontSize: 800,\n fontWeight: weight,\n fontStyle: 'normal',\n lineHeight: 800,\n fontFamily: 'heading',\n accessibilityProps: isPlatformWeb ? {} : { role: 'heading' },\n componentName: 'display',\n testID,\n letterSpacing,\n };\n\n if (size === 'small') {\n props.fontSize = 800;\n props.lineHeight = 800;\n } else if (size === 'medium') {\n props.fontSize = 900;\n props.lineHeight = 900;\n } else if (size === 'large') {\n props.fontSize = 1000;\n props.lineHeight = 1000;\n } else if (size === 'xlarge') {\n props.fontSize = 1100;\n props.lineHeight = 1100;\n }\n\n props.as = isPlatformWeb ? 'h1' : undefined;\n // override the computed `as` prop if user passed an `as` prop\n props.as = as || props.as;\n return props;\n};\n\nconst _Display = (\n {\n as,\n size = 'small',\n weight = 'semibold',\n color = 'surface.text.gray.normal',\n children,\n testID,\n textAlign,\n textDecorationLine,\n textTransform,\n ...styledProps\n }: DisplayProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n useValidateAsProp({ componentName: 'Display', as, validAsValues });\n\n const props = getProps({ as, size, color, weight, testID });\n\n return (\n <BaseText\n ref={ref}\n {...props}\n textAlign={textAlign}\n textDecorationLine={textDecorationLine}\n textTransform={textTransform}\n {...getStyledProps(styledProps)}\n >\n {children}\n </BaseText>\n );\n};\n\nconst Display = React.forwardRef(_Display);\nexport { Display };\n"],"names":["validAsValues","getProps","_ref","as","size","weight","color","testID","isPlatformWeb","getPlatformType","letterSpacing","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","accessibilityProps","role","componentName","undefined","_Display","_ref2","ref","_ref2$size","_ref2$weight","_ref2$color","children","textAlign","textDecorationLine","textTransform","styledProps","_objectWithoutProperties","_excluded","useValidateAsProp","_jsx","BaseText","Object","assign","getStyledProps","Display","React","forwardRef"],"mappings":";;;;;;;;;;;;;kHAUA,IAAMA,aAAa,CAAG,CAAC,MAAM,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE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CAANA,MAAO,CAAC,CAAC,CAE3D,OACE4B,GAAA,CAACC,QAAQ,CAAAC,MAAA,CAAAC,MAAA,CAAA,CACPf,GAAG,CAAEA,GAAI,CACLZ,CAAAA,KAAK,CACTiB,CAAAA,SAAS,CAAEA,SAAU,CACrBC,kBAAkB,CAAEA,kBAAmB,CACvCC,aAAa,CAAEA,aAAc,CAAA,CACzBS,cAAc,CAACR,WAAW,CAAC,CAAAJ,CAAAA,QAAA,CAE9BA,QAAQ,CACD,CAAA,CAAC,CAEf,CAAC,CAEK,IAAAa,OAAO,CAAGC,cAAK,CAACC,UAAU,CAACrB,QAAQ;;;;"}
@@ -11,7 +11,7 @@ import { isReactNative } from '../../../utils/platform/isReactNative.js';
11
11
  import '../../BladeProvider/useTheme.js';
12
12
  import { jsx } from 'react/jsx-runtime';
13
13
 
14
- var _excluded=["as","size","weight","color","children","testID","textAlign","textDecorationLine","wordBreak"];var validAsValues=['span','h1','h2','h3','h4','h5','h6'];var getHeadingProps=function getHeadingProps(_ref){var as=_ref.as,size=_ref.size,weight=_ref.weight,color=_ref.color,testID=_ref.testID;var props={color:color,fontSize:300,fontWeight:weight!=null?weight:'semibold',fontStyle:'normal',lineHeight:300,fontFamily:'heading',accessibilityProps:isReactNative()?{role:'heading'}:{},componentName:'heading',testID:testID};if(size==='small'){props.fontSize=300;props.lineHeight=300;props.as='h6';}else if(size==='medium'){props.fontSize=400;props.lineHeight=400;props.as='h5';}else if(size==='large'){props.fontSize=500;props.lineHeight=500;props.as='h4';}else if(size==='xlarge'){props.fontSize=600;props.lineHeight=600;props.as='h3';}else if(size==='2xlarge'){props.fontSize=700;props.lineHeight=700;props.as='h2';}props.as=as||props.as;return props;};var _Heading=function _Heading(_ref2,ref){var as=_ref2.as,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'semibold':_ref2$weight,_ref2$color=_ref2.color,color=_ref2$color===void 0?'surface.text.gray.normal':_ref2$color,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,wordBreak=_ref2.wordBreak,styledProps=_objectWithoutProperties(_ref2,_excluded);useValidateAsProp({componentName:'Heading',as:as,validAsValues:validAsValues});var props=getHeadingProps({as:as,size:size,weight:weight,color:color,testID:testID});return jsx(BaseText,Object.assign({},props,{ref:ref,textAlign:textAlign,textDecorationLine:textDecorationLine,wordBreak:wordBreak},getStyledProps(styledProps),{children:children}));};var Heading=React__default.forwardRef(_Heading);
14
+ var _excluded=["as","size","weight","color","children","testID","textAlign","textDecorationLine","wordBreak","textTransform"];var validAsValues=['span','h1','h2','h3','h4','h5','h6'];var getHeadingProps=function getHeadingProps(_ref){var as=_ref.as,size=_ref.size,weight=_ref.weight,color=_ref.color,testID=_ref.testID;var props={color:color,fontSize:300,fontWeight:weight!=null?weight:'semibold',fontStyle:'normal',lineHeight:300,fontFamily:'heading',accessibilityProps:isReactNative()?{role:'heading'}:{},componentName:'heading',testID:testID};if(size==='small'){props.fontSize=300;props.lineHeight=300;props.as='h6';}else if(size==='medium'){props.fontSize=400;props.lineHeight=400;props.as='h5';}else if(size==='large'){props.fontSize=500;props.lineHeight=500;props.as='h4';}else if(size==='xlarge'){props.fontSize=600;props.lineHeight=600;props.as='h3';}else if(size==='2xlarge'){props.fontSize=700;props.lineHeight=700;props.as='h2';}props.as=as||props.as;return props;};var _Heading=function _Heading(_ref2,ref){var as=_ref2.as,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'semibold':_ref2$weight,_ref2$color=_ref2.color,color=_ref2$color===void 0?'surface.text.gray.normal':_ref2$color,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,wordBreak=_ref2.wordBreak,textTransform=_ref2.textTransform,styledProps=_objectWithoutProperties(_ref2,_excluded);useValidateAsProp({componentName:'Heading',as:as,validAsValues:validAsValues});var props=getHeadingProps({as:as,size:size,weight:weight,color:color,testID:testID});return jsx(BaseText,Object.assign({},props,{ref:ref,textAlign:textAlign,textDecorationLine:textDecorationLine,textTransform:textTransform,wordBreak:wordBreak},getStyledProps(styledProps),{children:children}));};var Heading=React__default.forwardRef(_Heading);
15
15
 
16
16
  export { Heading, getHeadingProps };
17
17
  //# sourceMappingURL=Heading.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.js","sources":["../../../../../../src/components/Typography/Heading/Heading.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport React from 'react';\nimport type { ReactElement } from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { isReactNative } from '~utils';\nimport type { BladeElementRef, TestID } from '~utils/types';\n\nconst validAsValues = ['span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nexport type HeadingProps = {\n as?: typeof validAsValues[number];\n /**\n * Overrides the color of the Heading component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of heading\n */\n color?: BaseTextProps['color'];\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n children: React.ReactNode;\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n size?: Extract<BaseTextSizes, 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge'>;\n wordBreak?: BaseTextProps['wordBreak'];\n} & TestID &\n StyledPropsBlade;\n\nexport const getHeadingProps = ({\n as,\n size,\n weight,\n color,\n testID,\n}: Pick<HeadingProps, 'as' | 'size' | 'weight' | 'color' | 'testID'>): Omit<\n BaseTextProps,\n 'children'\n> => {\n const props: Omit<BaseTextProps, 'children'> = {\n color,\n fontSize: 300,\n fontWeight: weight ?? 'semibold',\n fontStyle: 'normal',\n lineHeight: 300,\n fontFamily: 'heading',\n accessibilityProps: isReactNative() ? { role: 'heading' } : {},\n componentName: 'heading',\n testID,\n };\n\n if (size === 'small') {\n props.fontSize = 300;\n props.lineHeight = 300;\n props.as = 'h6';\n } else if (size === 'medium') {\n props.fontSize = 400;\n props.lineHeight = 400;\n props.as = 'h5';\n } else if (size === 'large') {\n props.fontSize = 500;\n props.lineHeight = 500;\n props.as = 'h4';\n } else if (size === 'xlarge') {\n props.fontSize = 600;\n props.lineHeight = 600;\n props.as = 'h3';\n } else if (size === '2xlarge') {\n props.fontSize = 700;\n props.lineHeight = 700;\n props.as = 'h2';\n }\n\n // override the computed `as` prop if user passed an `as` prop\n props.as = as || props.as;\n return props;\n};\n\nconst _Heading = (\n {\n as,\n size = 'small',\n weight = 'semibold',\n color = 'surface.text.gray.normal',\n children,\n testID,\n textAlign,\n textDecorationLine,\n wordBreak,\n ...styledProps\n }: HeadingProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n useValidateAsProp({ componentName: 'Heading', as, validAsValues });\n\n const props = getHeadingProps({ as, size, weight, color, testID });\n\n return (\n <BaseText\n {...props}\n ref={ref}\n textAlign={textAlign}\n textDecorationLine={textDecorationLine}\n wordBreak={wordBreak}\n {...getStyledProps(styledProps)}\n >\n {children}\n </BaseText>\n );\n};\n\nconst Heading = React.forwardRef(_Heading);\n\nexport { Heading };\n"],"names":["validAsValues","getHeadingProps","_ref","as","size","weight","color","testID","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","accessibilityProps","isReactNative","role","componentName","_Heading","_ref2","ref","_ref2$size","_ref2$weight","_ref2$color","children","textAlign","textDecorationLine","wordBreak","styledProps","_objectWithoutProperties","_excluded","useValidateAsProp","_jsx","BaseText","Object","assign","getStyledProps","Heading","React","forwardRef"],"mappings":";;;;;;;;;;;;;8GAWA,IAAMA,aAAa,CAAG,CAAC,MAAM,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,C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AJA,IAAI,CAAEC,MAAM,CAANA,MAAM,CAAEC,KAAK,CAALA,KAAK,CAAEC,MAAM,CAANA,MAAO,CAAC,CAAC,CAElE,OACEyB,GAAA,CAACC,QAAQ,CAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CACH3B,KAAK,CAAA,CACTY,GAAG,CAAEA,GAAI,CACTK,SAAS,CAAEA,SAAU,CACrBC,kBAAkB,CAAEA,kBAAmB,CACvCC,SAAS,CAAEA,SAAU,CACjBS,CAAAA,cAAc,CAACR,WAAW,CAAC,CAAA,CAAAJ,QAAA,CAE9BA,QAAQ,CAAA,CACD,CAAC,CAEf,CAAC,CAEK,IAAAa,OAAO,CAAGC,cAAK,CAACC,UAAU,CAACrB,QAAQ;;;;"}
1
+ {"version":3,"file":"Heading.js","sources":["../../../../../../src/components/Typography/Heading/Heading.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport React from 'react';\nimport type { ReactElement } from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { isReactNative } from '~utils';\nimport type { BladeElementRef, TestID } from '~utils/types';\n\nconst validAsValues = ['span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nexport type HeadingProps = {\n as?: typeof validAsValues[number];\n /**\n * Overrides the color of the Heading component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of heading\n */\n color?: BaseTextProps['color'];\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n children: React.ReactNode;\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n size?: Extract<BaseTextSizes, 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge'>;\n textTransform?: BaseTextProps['textTransform'];\n wordBreak?: BaseTextProps['wordBreak'];\n} & TestID &\n StyledPropsBlade;\n\nexport const getHeadingProps = ({\n as,\n size,\n weight,\n color,\n testID,\n}: Pick<HeadingProps, 'as' | 'size' | 'weight' | 'color' | 'testID'>): Omit<\n BaseTextProps,\n 'children'\n> => {\n const props: Omit<BaseTextProps, 'children'> = {\n color,\n fontSize: 300,\n fontWeight: weight ?? 'semibold',\n fontStyle: 'normal',\n lineHeight: 300,\n fontFamily: 'heading',\n accessibilityProps: isReactNative() ? { role: 'heading' } : {},\n componentName: 'heading',\n testID,\n };\n\n if (size === 'small') {\n props.fontSize = 300;\n props.lineHeight = 300;\n props.as = 'h6';\n } else if (size === 'medium') {\n props.fontSize = 400;\n props.lineHeight = 400;\n props.as = 'h5';\n } else if (size === 'large') {\n props.fontSize = 500;\n props.lineHeight = 500;\n props.as = 'h4';\n } else if (size === 'xlarge') {\n props.fontSize = 600;\n props.lineHeight = 600;\n props.as = 'h3';\n } else if (size === '2xlarge') {\n props.fontSize = 700;\n props.lineHeight = 700;\n props.as = 'h2';\n }\n\n // override the computed `as` prop if user passed an `as` prop\n props.as = as || props.as;\n return props;\n};\n\nconst _Heading = (\n {\n as,\n size = 'small',\n weight = 'semibold',\n color = 'surface.text.gray.normal',\n children,\n testID,\n textAlign,\n textDecorationLine,\n wordBreak,\n textTransform,\n ...styledProps\n }: HeadingProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n useValidateAsProp({ componentName: 'Heading', as, validAsValues });\n\n const props = getHeadingProps({ as, size, weight, color, testID });\n\n return (\n <BaseText\n {...props}\n ref={ref}\n textAlign={textAlign}\n textDecorationLine={textDecorationLine}\n textTransform={textTransform}\n wordBreak={wordBreak}\n {...getStyledProps(styledProps)}\n >\n {children}\n </BaseText>\n );\n};\n\nconst Heading = React.forwardRef(_Heading);\n\nexport { Heading };\n"],"names":["validAsValues","getHeadingProps","_ref","as","size","weight","color","testID","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","accessibilityProps","isReactNative","role","componentName","_Heading","_ref2","ref","_ref2$size","_ref2$weight","_ref2$color","children","textAlign","textDecorationLine","wordBreak","textTransform","styledProps","_objectWithoutProperties","_excluded","useValidateAsProp","_jsx","BaseText","Object","assign","getStyledProps","Heading","React","forwardRef"],"mappings":";;;;;;;;;;;;;8HAWA,IAAMA,aAAa,CAAG,CAAC,MAAM,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAU,CAmB9D,IAAAC,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CASvB,CAAA,IARHC,EAAE,CAAAD,IAAA,CAAFC,EAAE,CACFC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CACJC,MAAM,CAAAH,IAAA,CAANG,MAAM,CACNC,KAAK,CAAAJ,IAAA,CAALI,KAAK,CACLC,MAAM,CAAAL,IAAA,CAANK,MAAM,CAKN,IAAMC,KAAsC,CAAG,CAC7CF,KAAK,CAALA,KAAK,CACLG,QAAQ,CAAE,GAAG,CACbC,UAAU,CAAEL,MAAM,EAANA,IAAAA,CAAAA,MAAM,CAAI,UAAU,CAChCM,SAAS,CAAE,QAAQ,CACnBC,UAAU,CAAE,GAAG,CACfC,UAAU,CAAE,SAAS,CACrBC,kBAAkB,CAAEC,aAAa,EAAE,CAAG,CAAEC,IAAI,CAAE,SAAU,CAAC,CAAG,EAAE,CAC9DC,aAAa,CAAE,SAAS,CACxBV,MAAM,CAANA,MACF,CAAC,CAED,GAAIH,IAAI,GAAK,OAAO,CAAE,CACpBI,KAAK,CAACC,QAAQ,CAAG,GAAG,CACpBD,KAAK,CAACI,UAAU,CAAG,GAAG,CACtBJ,KAAK,CAACL,EAAE,CAAG,IAAI,CACjB,CAAC,KAAM,GAAIC,IAAI,GAAK,QAAQ,CAAE,CAC5BI,KAAK,CAACC,QAAQ,CAAG,GAAG,CACpBD,KAAK,CAACI,UAAU,CAAG,GAAG,CACtBJ,KAAK,CAACL,EAAE,CAAG,IAAI,CACjB,CA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ATQ,SAAS,CACTC,aAAa,CAAAT,KAAA,CAAbS,aAAa,CACVC,WAAW,CAAAC,wBAAA,CAAAX,KAAA,CAAAY,SAAA,CAIhBC,CAAAA,iBAAiB,CAAC,CAAEf,aAAa,CAAE,SAAS,CAAEd,EAAE,CAAFA,EAAE,CAAEH,aAAa,CAAbA,aAAc,CAAC,CAAC,CAElE,IAAMQ,KAAK,CAAGP,eAAe,CAAC,CAAEE,EAAE,CAAFA,EAAE,CAAEC,IAAI,CAAJA,IAAI,CAAEC,MAAM,CAANA,MAAM,CAAEC,KAAK,CAALA,KAAK,CAAEC,MAAM,CAANA,MAAO,CAAC,CAAC,CAElE,OACE0B,GAAA,CAACC,QAAQ,CAAAC,MAAA,CAAAC,MAAA,CACH5B,EAAAA,CAAAA,KAAK,CACTY,CAAAA,GAAG,CAAEA,GAAI,CACTK,SAAS,CAAEA,SAAU,CACrBC,kBAAkB,CAAEA,kBAAmB,CACvCE,aAAa,CAAEA,aAAc,CAC7BD,SAAS,CAAEA,SAAU,CACjBU,CAAAA,cAAc,CAACR,WAAW,CAAC,CAAA,CAAAL,QAAA,CAE9BA,QAAQ,CAAA,CACD,CAAC,CAEf,CAAC,CAEK,IAAAc,OAAO,CAAGC,cAAK,CAACC,UAAU,CAACtB,QAAQ;;;;"}
@@ -12,7 +12,7 @@ import '../../BladeProvider/useTheme.js';
12
12
  import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
13
13
  import { jsx } from 'react/jsx-runtime';
14
14
 
15
- var _excluded=["as","variant","weight","size","truncateAfterLines","children","color","testID","textAlign","textDecorationLine","wordBreak"];var validAsValues=['p','span','div','abbr','figcaption','cite','q','label'];var getTextProps=function getTextProps(_ref){var variant=_ref.variant,weight=_ref.weight,size=_ref.size,_ref$color=_ref.color,color=_ref$color===void 0?'surface.text.gray.normal':_ref$color,testID=_ref.testID,textAlign=_ref.textAlign,textDecorationLine=_ref.textDecorationLine;var props={color:color,fontSize:100,fontWeight:weight!=null?weight:'regular',fontStyle:'normal',lineHeight:100,fontFamily:'text',componentName:'text',testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine};if(variant==='caption'){if(size&&size!=='small'&&size!=='medium'){if(__DEV__){throwBladeError({moduleName:'Text',message:`size cannot be '${size}' when variant is 'caption'`});}size='small';}}else if(variant!=='caption'&&!size){size='medium';}if(variant==='body'){if(size==='xsmall'){props.fontSize=25;props.lineHeight=25;}if(size==='small'){props.fontSize=75;props.lineHeight=75;}if(size==='medium'){props.fontSize=100;props.lineHeight=100;}if(size==='large'){props.fontSize=200;props.lineHeight=200;}}if(variant==='caption'){if(size==='small'){props.fontSize=50;props.lineHeight=50;props.fontWeight='regular';}if(size==='medium'){props.fontSize=100;props.lineHeight=50;props.fontWeight='regular';}}return props;};var _Text=function _Text(_ref2,ref){var _ref2$as=_ref2.as,as=_ref2$as===void 0?'p':_ref2$as,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'body':_ref2$variant,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,size=_ref2.size,truncateAfterLines=_ref2.truncateAfterLines,children=_ref2.children,color=_ref2.color,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,wordBreak=_ref2.wordBreak,styledProps=_objectWithoutProperties(_ref2,_excluded);var props=Object.assign({as:as,truncateAfterLines:truncateAfterLines,wordBreak:wordBreak},getTextProps({variant:variant,weight:weight,color:color,size:size,testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine}));useValidateAsProp({componentName:'Text',as:as,validAsValues:validAsValues});return jsx(BaseText,Object.assign({ref:ref},props,getStyledProps(styledProps),{children:children}));};var Text=assignWithoutSideEffects(React__default.forwardRef(_Text),{displayName:'Text',componentId:'Text'});
15
+ var _excluded=["as","variant","weight","size","truncateAfterLines","children","color","testID","textAlign","textDecorationLine","wordBreak","textTransform"];var validAsValues=['p','span','div','abbr','figcaption','cite','q','label'];var getTextProps=function getTextProps(_ref){var variant=_ref.variant,weight=_ref.weight,size=_ref.size,_ref$color=_ref.color,color=_ref$color===void 0?'surface.text.gray.normal':_ref$color,testID=_ref.testID,textAlign=_ref.textAlign,textDecorationLine=_ref.textDecorationLine;var props={color:color,fontSize:100,fontWeight:weight!=null?weight:'regular',fontStyle:'normal',lineHeight:100,fontFamily:'text',componentName:'text',testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine};if(variant==='caption'){if(size&&size!=='small'&&size!=='medium'){if(__DEV__){throwBladeError({moduleName:'Text',message:`size cannot be '${size}' when variant is 'caption'`});}size='small';}}else if(variant!=='caption'&&!size){size='medium';}if(variant==='body'){if(size==='xsmall'){props.fontSize=25;props.lineHeight=25;}if(size==='small'){props.fontSize=75;props.lineHeight=75;}if(size==='medium'){props.fontSize=100;props.lineHeight=100;}if(size==='large'){props.fontSize=200;props.lineHeight=200;}}if(variant==='caption'){if(size==='small'){props.fontSize=50;props.lineHeight=50;props.fontWeight='regular';}if(size==='medium'){props.fontSize=100;props.lineHeight=50;props.fontWeight='regular';}}return props;};var _Text=function _Text(_ref2,ref){var _ref2$as=_ref2.as,as=_ref2$as===void 0?'p':_ref2$as,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'body':_ref2$variant,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,size=_ref2.size,truncateAfterLines=_ref2.truncateAfterLines,children=_ref2.children,color=_ref2.color,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,wordBreak=_ref2.wordBreak,textTransform=_ref2.textTransform,styledProps=_objectWithoutProperties(_ref2,_excluded);var props=Object.assign({as:as,truncateAfterLines:truncateAfterLines,wordBreak:wordBreak,textTransform:textTransform},getTextProps({variant:variant,weight:weight,color:color,size:size,testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine}));useValidateAsProp({componentName:'Text',as:as,validAsValues:validAsValues});return jsx(BaseText,Object.assign({ref:ref},props,getStyledProps(styledProps),{children:children}));};var Text=assignWithoutSideEffects(React__default.forwardRef(_Text),{displayName:'Text',componentId:'Text'});
16
16
 
17
17
  export { Text, getTextProps };
18
18
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../../../src/components/Typography/Text/Text.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\n\nconst validAsValues = ['p', 'span', 'div', 'abbr', 'figcaption', 'cite', 'q', 'label'] as const;\ntype TextCommonProps = {\n as?: typeof validAsValues[number];\n truncateAfterLines?: number;\n children: React.ReactNode;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n /**\n * Overrides the color of the Text component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of text\n */\n color?: BaseTextProps['color'];\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n wordBreak?: BaseTextProps['wordBreak'];\n} & TestID &\n StyledPropsBlade;\n\nexport type TextVariant = 'body' | 'caption';\n\ntype TextBodyVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'body'>;\n size?: Extract<BaseTextSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n};\n\ntype TextCaptionVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'caption'>;\n size?: Extract<BaseTextSizes, 'small' | 'medium'>;\n};\n\nexport type TextProps<T> = T extends { variant: infer Variant }\n ? Variant extends 'caption'\n ? TextCaptionVariant\n : Variant extends 'body'\n ? TextBodyVariant\n : T\n : T;\n\ntype GetTextPropsReturn = Omit<BaseTextProps, 'children'>;\ntype GetTextProps<T extends { variant: TextVariant }> = Pick<\n TextProps<T>,\n 'variant' | 'weight' | 'size' | 'color' | 'testID' | 'textAlign' | 'textDecorationLine'\n>;\n\nconst getTextProps = <T extends { variant: TextVariant }>({\n variant,\n weight,\n size,\n color = 'surface.text.gray.normal',\n testID,\n textAlign,\n textDecorationLine,\n}: GetTextProps<T>): GetTextPropsReturn => {\n const props: GetTextPropsReturn = {\n color,\n fontSize: 100,\n fontWeight: weight ?? 'regular',\n fontStyle: 'normal',\n lineHeight: 100,\n fontFamily: 'text',\n componentName: 'text',\n testID,\n textAlign,\n textDecorationLine,\n };\n\n if (variant === 'caption') {\n // variant of caption can only have size of small\n if (size && size !== 'small' && size !== 'medium') {\n if (__DEV__) {\n throwBladeError({\n moduleName: 'Text',\n message: `size cannot be '${size}' when variant is 'caption'`,\n });\n }\n // Set size as small in case of invalid size\n size = 'small';\n }\n } else if (variant !== 'caption' && !size) {\n size = 'medium';\n }\n\n if (variant === 'body') {\n if (size === 'xsmall') {\n props.fontSize = 25;\n props.lineHeight = 25;\n }\n if (size === 'small') {\n props.fontSize = 75;\n props.lineHeight = 75;\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 100;\n }\n if (size === 'large') {\n props.fontSize = 200;\n props.lineHeight = 200;\n }\n }\n if (variant === 'caption') {\n if (size === 'small') {\n props.fontSize = 50;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n }\n\n return props;\n};\n\nconst _Text = <T extends { variant: TextVariant }>(\n {\n as = 'p',\n variant = 'body',\n weight = 'regular',\n size,\n truncateAfterLines,\n children,\n color,\n testID,\n textAlign,\n textDecorationLine,\n wordBreak,\n ...styledProps\n }: TextProps<T>,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const props: Omit<BaseTextProps, 'children'> = {\n as,\n truncateAfterLines,\n wordBreak,\n ...getTextProps({\n variant,\n weight,\n color,\n size,\n testID,\n textAlign,\n textDecorationLine,\n }),\n };\n\n useValidateAsProp({ componentName: 'Text', as, validAsValues });\n\n return (\n <BaseText ref={ref} {...props} {...getStyledProps(styledProps)}>\n {children}\n </BaseText>\n );\n};\n\nconst Text = assignWithoutSideEffects(React.forwardRef(_Text), {\n displayName: 'Text',\n componentId: 'Text',\n});\n\nexport { Text, getTextProps };\n"],"names":["validAsValues","getTextProps","_ref","variant","weight","size","_ref$color","color","testID","textAlign","textDecorationLine","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","componentName","__DEV__","throwBladeError","moduleName","message","_Text","_ref2","ref","_ref2$as","as","_ref2$variant","_ref2$weight","truncateAfterLines","children","wordBreak","styledProps","_objectWithoutProperties","_excluded","Object","assign","useValidateAsProp","_jsx","BaseText","getStyledProps","Text","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;AAEA,IAAA,SAAA,CAAA,CAAA,IAAA,CAAA,SAAA,CAAA,QAAA,CAAA,MAAA,CAAA,oBAAA,CAAA,UAAA,CAAA,OAAA,CAAA,QAAA,CAAA,WAAA,CAAA,oBAAA,CAAA,WAAA,CAAA,CAUA,IAAMA,aAAa,CAAG,CAAC,GAAG,CAAE,MAAM,CAAE,KAAK,CAAE,MAAM,CAAE,YAAY,CAAE,MAAM,CAAE,GAAG,CAAE,OAAO,CAAU,CA4CzF,IAAAC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAQyB,CAAA,IAPzCC,OAAO,CAAAD,IAAA,CAAPC,OAAO,CACPC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,IAAI,CAAAH,IAAA,CAAJG,IAAI,CAAAC,UAAA,CAAAJ,IAAA,CACJK,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,0BAA0B,CAAAA,UAAA,CAClCE,MAAM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CAATQ,SAAS,CACNC,WAAW,CAAAC,wBAAA,CAAAV,KAAA,CAAAW,SAAA,CAAA,CAIhB,IAAMvB,KAAsC,CAAAwB,MAAA,CAAAC,MAAA,EAC1CV,EAAE,CAAFA,EAAE,CACFG,kBAAkB,CAAlBA,kBAAkB,CAClBE,SAAS,CAATA,SAAS,CACN9B,CAAAA,YAAY,CAAC,CACdE,OAAO,CAAPA,OAAO,CACPC,MAAM,CAANA,MAAM,CACNG,KAAK,CAALA,KAAK,CACLF,IAAI,CAAJA,IAAI,CACJG,MAAM,CAANA,MAAM,CACNC,SAAS,CAATA,SAAS,CACTC,kBAAkB,CAAlBA,kBACF,CAAC,CAAC,CACH,CAED2B,iBAAiB,CAAC,CAAEpB,aAAa,CAAE,MAAM,CAAES,EAAE,CAAFA,EAAE,CAAE1B,aAAa,CAAbA,aAAc,CAAC,CAAC,CAE/D,OACEsC,GAAA,CAACC,QAAQ,CAAAJ,MAAA,CAAAC,MAAA,CAAA,CAACZ,GAAG,CAAEA,GAAI,CAAKb,CAAAA,KAAK,CAAM6B,cAAc,CAACR,WAAW,CAAC,CAAAF,CAAAA,QAAA,CAC3DA,QAAQ,CACD,CAAA,CAAC,CAEf,CAAC,CAEK,IAAAW,IAAI,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAACtB,KAAK,CAAC,CAAE,CAC7DuB,WAAW,CAAE,MAAM,CACnBC,WAAW,CAAE,MACf,CAAC;;;;"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../../../src/components/Typography/Text/Text.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\n\nconst validAsValues = ['p', 'span', 'div', 'abbr', 'figcaption', 'cite', 'q', 'label'] as const;\ntype TextCommonProps = {\n as?: typeof validAsValues[number];\n truncateAfterLines?: number;\n children: React.ReactNode;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n /**\n * Overrides the color of the Text component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of text\n */\n color?: BaseTextProps['color'];\n textAlign?: BaseTextProps['textAlign'];\n textTransform?: BaseTextProps['textTransform'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n wordBreak?: BaseTextProps['wordBreak'];\n} & TestID &\n StyledPropsBlade;\n\nexport type TextVariant = 'body' | 'caption';\n\ntype TextBodyVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'body'>;\n size?: Extract<BaseTextSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n};\n\ntype TextCaptionVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'caption'>;\n size?: Extract<BaseTextSizes, 'small' | 'medium'>;\n};\n\nexport type TextProps<T> = T extends { variant: infer Variant }\n ? Variant extends 'caption'\n ? TextCaptionVariant\n : Variant extends 'body'\n ? TextBodyVariant\n : T\n : T;\n\ntype GetTextPropsReturn = Omit<BaseTextProps, 'children'>;\ntype GetTextProps<T extends { variant: TextVariant }> = Pick<\n TextProps<T>,\n | 'variant'\n | 'weight'\n | 'size'\n | 'color'\n | 'testID'\n | 'textAlign'\n | 'textDecorationLine'\n | 'textTransform'\n>;\n\nconst getTextProps = <T extends { variant: TextVariant }>({\n variant,\n weight,\n size,\n color = 'surface.text.gray.normal',\n testID,\n textAlign,\n textDecorationLine,\n}: GetTextProps<T>): GetTextPropsReturn => {\n const props: GetTextPropsReturn = {\n color,\n fontSize: 100,\n fontWeight: weight ?? 'regular',\n fontStyle: 'normal',\n lineHeight: 100,\n fontFamily: 'text',\n componentName: 'text',\n testID,\n textAlign,\n textDecorationLine,\n };\n\n if (variant === 'caption') {\n // variant of caption can only have size of small\n if (size && size !== 'small' && size !== 'medium') {\n if (__DEV__) {\n throwBladeError({\n moduleName: 'Text',\n message: `size cannot be '${size}' when variant is 'caption'`,\n });\n }\n // Set size as small in case of invalid size\n size = 'small';\n }\n } else if (variant !== 'caption' && !size) {\n size = 'medium';\n }\n\n if (variant === 'body') {\n if (size === 'xsmall') {\n props.fontSize = 25;\n props.lineHeight = 25;\n }\n if (size === 'small') {\n props.fontSize = 75;\n props.lineHeight = 75;\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 100;\n }\n if (size === 'large') {\n props.fontSize = 200;\n props.lineHeight = 200;\n }\n }\n if (variant === 'caption') {\n if (size === 'small') {\n props.fontSize = 50;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n }\n\n return props;\n};\n\nconst _Text = <T extends { variant: TextVariant }>(\n {\n as = 'p',\n variant = 'body',\n weight = 'regular',\n size,\n truncateAfterLines,\n children,\n color,\n testID,\n textAlign,\n textDecorationLine,\n wordBreak,\n textTransform,\n ...styledProps\n }: TextProps<T>,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const props: Omit<BaseTextProps, 'children'> = {\n as,\n truncateAfterLines,\n wordBreak,\n textTransform,\n ...getTextProps({\n variant,\n weight,\n color,\n size,\n testID,\n textAlign,\n textDecorationLine,\n }),\n };\n\n useValidateAsProp({ componentName: 'Text', as, validAsValues });\n\n return (\n <BaseText ref={ref} {...props} {...getStyledProps(styledProps)}>\n {children}\n </BaseText>\n );\n};\n\nconst Text = assignWithoutSideEffects(React.forwardRef(_Text), {\n displayName: 'Text',\n componentId: 'Text',\n});\n\nexport { Text, getTextProps };\n"],"names":["validAsValues","getTextProps","_ref","variant","weight","size","_ref$color","color","testID","textAlign","textDecorationLine","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","componentName","__DEV__","throwBladeError","moduleName","message","_Text","_ref2","ref","_ref2$as","as","_ref2$variant","_ref2$weight","truncateAfterLines","children","wordBreak","textTransform","styledProps","_objectWithoutProperties","_excluded","Object","assign","useValidateAsProp","_jsx","BaseText","getStyledProps","Text","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;AAEA,IAAA,SAAA,CAAA,CAAA,IAAA,CAAA,SAAA,CAAA,QAAA,CAAA,MAAA,CAAA,oBAAA,CAAA,UAAA,CAAA,OAAA,CAAA,QAAA,CAAA,WAAA,CAAA,oBAAA,CAAA,WAAA,CAAA,eAAA,CAAA,CAUA,IAAMA,aAAa,CAAG,CAAC,GAAG,CAAE,MAAM,CAAE,KAAK,CAAE,MAAM,CAAE,YAAY,CAAE,MAAM,CAAE,GAAG,CAAE,OAAO,CAAU,CAoDzF,IAAAC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAQyB,KAPzCC,OAAO,CAAAD,IAAA,CAAPC,OAAO,CACPC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,IAAI,CAAAH,IAAA,CAAJG,IAAI,CAAAC,UAAA,CAAAJ,IAAA,CACJK,KAAK,CAALA,KAAK,CAAAD,UAAA,UAAG,0BAA0B,CAAAA,UAAA,CAClCE,MAAM,CAAAN,IAAA,CAANM,MAAM,CACNC,SAAS,CAAAP,IAAA,CAATO,SAAS,CACTC,kBAAkB,CAAAR,IAAA,CAAlBQ,kBAAkB,CAElB,IAAMC,KAAyB,CAAG,CAChCJ,KAAK,CAALA,KAAK,CACLK,QAAQ,CAAE,GAAG,CACbC,UAAU,CAAET,MAAM,EAANA,IAAAA,CAAAA,MAAM,CAAI,SAAS,CAC/BU,SAAS,CAAE,QAAQ,CACnBC,UAAU,CAAE,GAAG,CACfC,UAAU,CAAE,MAAM,CAClBC,aAAa,CAAE,MAAM,CACrBT,MAAM,CAANA,MAAM,CACNC,SAAS,CAATA,SAAS,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G,MAAM,CAANA,MAAM,CACNC,SAAS,CAATA,SAAS,CACTC,kBAAkB,CAAlBA,kBACF,CAAC,CAAC,CACH,CAED4B,iBAAiB,CAAC,CAAErB,aAAa,CAAE,MAAM,CAAES,EAAE,CAAFA,EAAE,CAAE1B,aAAa,CAAbA,aAAc,CAAC,CAAC,CAE/D,OACEuC,GAAA,CAACC,QAAQ,CAAAJ,MAAA,CAAAC,MAAA,CAACb,CAAAA,GAAG,CAAEA,GAAI,CAAA,CAAKb,KAAK,CAAM8B,cAAc,CAACR,WAAW,CAAC,CAAA,CAAAH,QAAA,CAC3DA,QAAQ,CAAA,CACD,CAAC,CAEf,CAAC,CAEK,IAAAY,IAAI,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAACvB,KAAK,CAAC,CAAE,CAC7DwB,WAAW,CAAE,MAAM,CACnBC,WAAW,CAAE,MACf,CAAC;;;;"}
@@ -19,7 +19,7 @@ import { getFloatingPlacementParts } from '../../utils/getFloatingPlacementParts
19
19
  import { componentZIndices } from '../../utils/componentZIndices.js';
20
20
  import '../../utils/makeAnalyticsAttribute/index.js';
21
21
  import '../../utils/assignWithoutSideEffects/index.js';
22
- import { mergeRefs } from '../../utils/useMergeRefs.js';
22
+ import { useMergeRefs } from '../../utils/useMergeRefs.js';
23
23
  import { jsxs, jsx } from 'react/jsx-runtime';
24
24
  import useTheme from '../BladeProvider/useTheme.js';
25
25
  import { size } from '../../tokens/global/size.js';
@@ -112,7 +112,7 @@ var _Tooltip = function _Tooltip(_ref) {
112
112
  value: true,
113
113
  children: [/*#__PURE__*/React__default.cloneElement(children, _objectSpread(_objectSpread({
114
114
  // @ts-expect-error: ref does exist on children prop
115
- ref: mergeRefs(refs.setReference, children.ref)
115
+ ref: useMergeRefs(refs.setReference, children.ref)
116
116
  }, makeAccessible({
117
117
  label: content
118
118
  })), mergeProps(children.props, getReferenceProps()))), isMounted && /*#__PURE__*/jsx(FloatingPortal, {
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.web.js","sources":["../../../../../../src/components/Tooltip/Tooltip.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/restrict-plus-operands */\nimport {\n shift,\n FloatingPortal,\n arrow,\n flip,\n offset,\n useDelayGroup,\n useDelayGroupContext,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useRole,\n useTransitionStyles,\n autoUpdate,\n} from '@floating-ui/react';\nimport React from 'react';\nimport type { TooltipProps } from './types';\nimport { TooltipContent } from './TooltipContent';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './constants';\nimport { TooltipContext } from './TooltipContext';\nimport { componentIds } from './componentIds';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { size } from '~tokens/global';\nimport { useId } from '~utils/useId';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { mergeProps } from '~utils/mergeProps';\nimport { PopupArrow } from '~components/PopupArrow';\nimport { getFloatingPlacementParts } from '~utils/getFloatingPlacementParts';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { mergeRefs } from '~utils/useMergeRefs';\n\nconst _Tooltip = ({\n title,\n content,\n children,\n placement = 'top',\n onOpenChange,\n zIndex = componentZIndices.tooltip,\n ...rest\n}: TooltipProps): React.ReactElement => {\n const { theme } = useTheme();\n const id = useId();\n const [isOpen, setIsOpen] = React.useState(false);\n const arrowRef = React.useRef<SVGSVGElement>(null);\n\n const GAP = theme.spacing[2];\n const [side] = getFloatingPlacementParts(placement);\n const isHorizontal = side === 'left' || side === 'right';\n const isOppositeAxis = side === 'right' || side === 'bottom';\n\n const { refs, floatingStyles, context } = useFloating({\n placement,\n open: isOpen,\n strategy: 'fixed',\n onOpenChange: (open) => {\n setIsOpen(open);\n onOpenChange?.({ isOpen: open });\n },\n middleware: [\n shift({ crossAxis: false, padding: GAP }),\n flip({ padding: GAP }),\n offset(GAP + ARROW_HEIGHT),\n arrow({\n element: arrowRef,\n padding: isHorizontal ? 0 : ARROW_WIDTH,\n }),\n ],\n whileElementsMounted: autoUpdate,\n });\n\n const animationOffset = isOppositeAxis ? -size[4] : size[4];\n const { isMounted, styles } = useTransitionStyles(context, {\n duration: theme.motion.duration.quick,\n initial: {\n opacity: 0,\n transform: `translate${isHorizontal ? 'X' : 'Y'}(${animationOffset}px)`,\n },\n });\n\n useDelayGroup(context, { id });\n const { delay } = useDelayGroupContext();\n const hover = useHover(context, {\n delay,\n move: false,\n });\n const focus = useFocus(context);\n const role = useRole(context, { role: 'tooltip' });\n const { getReferenceProps, getFloatingProps } = useInteractions([role, hover, focus]);\n\n return (\n <TooltipContext.Provider value={true}>\n {React.cloneElement(children, {\n // @ts-expect-error: ref does exist on children prop\n ref: mergeRefs(refs.setReference, children.ref),\n ...makeAccessible({ label: content }),\n ...mergeProps(children.props, getReferenceProps()),\n })}\n {isMounted && (\n <FloatingPortal>\n <BaseBox\n ref={refs.setFloating}\n style={floatingStyles}\n pointerEvents=\"none\"\n zIndex={zIndex}\n {...getFloatingProps()}\n {...metaAttribute({ name: MetaConstants.Tooltip })}\n {...makeAnalyticsAttribute(rest)}\n >\n <TooltipContent\n title={title}\n style={styles}\n arrow={\n <PopupArrow\n ref={arrowRef}\n context={context}\n width={ARROW_WIDTH}\n height={ARROW_HEIGHT}\n fillColor={theme.colors.popup.background.intense}\n strokeColor={theme.colors.popup.border.intense}\n />\n }\n >\n {content}\n </TooltipContent>\n </BaseBox>\n </FloatingPortal>\n )}\n </TooltipContext.Provider>\n );\n};\n\nconst Tooltip = assignWithoutSideEffects(_Tooltip, {\n componentId: componentIds.Tooltip,\n});\n\nexport { Tooltip };\n"],"names":["_Tooltip","_ref","title","content","children","_ref$placement","placement","onOpenChange","_ref$zIndex","zIndex","componentZIndices","tooltip","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","id","useId","_React$useState","React","useState","_React$useState2","_slicedToArray","isOpen","setIsOpen","arrowRef","useRef","GAP","spacing","_getFloatingPlacement","getFloatingPlacementParts","_getFloatingPlacement2","side","isHorizontal","isOppositeAxis","_useFloating","useFloating","open","strategy","middleware","shift","crossAxis","padding","flip","offset","ARROW_HEIGHT","arrow","element","ARROW_WIDTH","whileElementsMounted","autoUpdate","refs","floatingStyles","context","animationOffset","size","_useTransitionStyles","useTransitionStyles","duration","motion","quick","initial","opacity","transform","concat","isMounted","styles","useDelayGroup","_useDelayGroupContext","useDelayGroupContext","delay","hover","useHover","move","focus","useFocus","role","useRole","_useInteractions","useInteractions","getReferenceProps","getFloatingProps","_jsxs","TooltipContext","Provider","value","cloneElement","_objectSpread","ref","mergeRefs","setReference","makeAccessible","label","mergeProps","props","_jsx","FloatingPortal","BaseBox","setFloating","style","pointerEvents","metaAttribute","name","MetaConstants","Tooltip","makeAnalyticsAttribute","TooltipContent","PopupArrow","width","height","fillColor","colors","popup","background","intense","strokeColor","border","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAQ0B;AAAA,EAAA,IAPtCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAAC,cAAA,GAAAJ,IAAA,CACRK,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,cAAA;IACjBE,aAAY,GAAAN,IAAA,CAAZM,YAAY;IAAAC,WAAA,GAAAP,IAAA,CACZQ,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAA,KAAA,CAAA,GAAGE,iBAAiB,CAACC,OAAO,GAAAH,WAAA;AAC/BI,IAAAA,IAAI,GAAAC,wBAAA,CAAAZ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O,EAAAV,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA;QACNC,GAAG,EAAErC,IAAI,CAAC+C,WAAY;AACtBC,QAAAA,KAAK,EAAE/C,cAAe;AACtBgD,QAAAA,aAAa,EAAC,MAAM;AACpB7F,QAAAA,MAAM,EAAEA,MAAAA;AAAO,OAAA,EACX0E,gBAAgB,EAAE,CAAA,EAClBoB,aAAa,CAAC;QAAEC,IAAI,EAAEC,aAAa,CAACC,OAAAA;AAAQ,OAAC,CAAC,CAAA,EAC9CC,sBAAsB,CAAC/F,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;QAAAR,QAAA,eAEhC6F,GAAA,CAACW,cAAc,EAAA;AACb1G,UAAAA,KAAK,EAAEA,KAAM;AACbmG,UAAAA,KAAK,EAAEjC,MAAO;UACdpB,KAAK,eACHiD,GAAA,CAACY,UAAU,EAAA;AACTnB,YAAAA,GAAG,EAAE/D,QAAS;AACd4B,YAAAA,OAAO,EAAEA,OAAQ;AACjBuD,YAAAA,KAAK,EAAE5D,WAAY;AACnB6D,YAAAA,MAAM,EAAEhE,YAAa;YACrBiE,SAAS,EAAE/F,KAAK,CAACgG,MAAM,CAACC,KAAK,CAACC,UAAU,CAACC,OAAQ;YACjDC,WAAW,EAAEpG,KAAK,CAACgG,MAAM,CAACC,KAAK,CAACI,MAAM,CAACF,OAAAA;AAAQ,WAChD,CACF;AAAAhH,UAAAA,QAAA,EAEAD,OAAAA;SACa,CAAA;OACT,CAAA,CAAA;AAAC,KACI,CACjB,CAAA;AAAA,GACsB,CAAC,CAAA;AAE9B,CAAC,CAAA;AAED,IAAMuG,OAAO,gBAAGa,wBAAwB,CAACvH,QAAQ,EAAE;EACjDwH,WAAW,EAAEC,YAAY,CAACf,OAAAA;AAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"Tooltip.web.js","sources":["../../../../../../src/components/Tooltip/Tooltip.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/restrict-plus-operands */\nimport {\n shift,\n FloatingPortal,\n arrow,\n flip,\n offset,\n useDelayGroup,\n useDelayGroupContext,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useRole,\n useTransitionStyles,\n autoUpdate,\n} from '@floating-ui/react';\nimport React from 'react';\nimport type { TooltipProps } from './types';\nimport { TooltipContent } from './TooltipContent';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './constants';\nimport { TooltipContext } from './TooltipContext';\nimport { componentIds } from './componentIds';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { size } from '~tokens/global';\nimport { useId } from '~utils/useId';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { mergeProps } from '~utils/mergeProps';\nimport { PopupArrow } from '~components/PopupArrow';\nimport { getFloatingPlacementParts } from '~utils/getFloatingPlacementParts';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useMergeRefs } from '~utils/useMergeRefs';\n\nconst _Tooltip = ({\n title,\n content,\n children,\n placement = 'top',\n onOpenChange,\n zIndex = componentZIndices.tooltip,\n ...rest\n}: TooltipProps): React.ReactElement => {\n const { theme } = useTheme();\n const id = useId();\n const [isOpen, setIsOpen] = React.useState(false);\n const arrowRef = React.useRef<SVGSVGElement>(null);\n\n const GAP = theme.spacing[2];\n const [side] = getFloatingPlacementParts(placement);\n const isHorizontal = side === 'left' || side === 'right';\n const isOppositeAxis = side === 'right' || side === 'bottom';\n\n const { refs, floatingStyles, context } = useFloating({\n placement,\n open: isOpen,\n strategy: 'fixed',\n onOpenChange: (open) => {\n setIsOpen(open);\n onOpenChange?.({ isOpen: open });\n },\n middleware: [\n shift({ crossAxis: false, padding: GAP }),\n flip({ padding: GAP }),\n offset(GAP + ARROW_HEIGHT),\n arrow({\n element: arrowRef,\n padding: isHorizontal ? 0 : ARROW_WIDTH,\n }),\n ],\n whileElementsMounted: autoUpdate,\n });\n\n const animationOffset = isOppositeAxis ? -size[4] : size[4];\n const { isMounted, styles } = useTransitionStyles(context, {\n duration: theme.motion.duration.quick,\n initial: {\n opacity: 0,\n transform: `translate${isHorizontal ? 'X' : 'Y'}(${animationOffset}px)`,\n },\n });\n\n useDelayGroup(context, { id });\n const { delay } = useDelayGroupContext();\n const hover = useHover(context, {\n delay,\n move: false,\n });\n const focus = useFocus(context);\n const role = useRole(context, { role: 'tooltip' });\n const { getReferenceProps, getFloatingProps } = useInteractions([role, hover, focus]);\n\n return (\n <TooltipContext.Provider value={true}>\n {React.cloneElement(children, {\n // @ts-expect-error: ref does exist on children prop\n ref: useMergeRefs(refs.setReference, children.ref),\n ...makeAccessible({ label: content }),\n ...mergeProps(children.props, getReferenceProps()),\n })}\n {isMounted && (\n <FloatingPortal>\n <BaseBox\n ref={refs.setFloating}\n style={floatingStyles}\n pointerEvents=\"none\"\n zIndex={zIndex}\n {...getFloatingProps()}\n {...metaAttribute({ name: MetaConstants.Tooltip })}\n {...makeAnalyticsAttribute(rest)}\n >\n <TooltipContent\n title={title}\n style={styles}\n arrow={\n <PopupArrow\n ref={arrowRef}\n context={context}\n width={ARROW_WIDTH}\n height={ARROW_HEIGHT}\n fillColor={theme.colors.popup.background.intense}\n strokeColor={theme.colors.popup.border.intense}\n />\n }\n >\n {content}\n </TooltipContent>\n </BaseBox>\n </FloatingPortal>\n )}\n </TooltipContext.Provider>\n );\n};\n\nconst Tooltip = assignWithoutSideEffects(_Tooltip, {\n componentId: componentIds.Tooltip,\n});\n\nexport { Tooltip };\n"],"names":["_Tooltip","_ref","title","content","children","_ref$placement","placement","onOpenChange","_ref$zIndex","zIndex","componentZIndices","tooltip","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","id","useId","_React$useState","React","useState","_React$useState2","_slicedToArray","isOpen","setIsOpen","arrowRef","useRef","GAP","spacing","_getFloatingPlacement","getFloatingPlacementParts","_getFloatingPlacement2","side","isHorizontal","isOppositeAxis","_useFloating","useFloating","open","strategy","middleware","shift","crossAxis","padding","flip","offset","ARROW_HEIGHT","arrow","element","ARROW_WIDTH","whileElementsMounted","autoUpdate","refs","floatingStyles","context","animationOffset","size","_useTransitionStyles","useTransitionStyles","duration","motion","quick","initial","opacity","transform","concat","isMounted","styles","useDelayGroup","_useDelayGroupContext","useDelayGroupContext","delay","hover","useHover","move","focus","useFocus","role","useRole","_useInteractions","useInteractions","getReferenceProps","getFloatingProps","_jsxs","TooltipContext","Provider","value","cloneElement","_objectSpread","ref","useMergeRefs","setReference","makeAccessible","label","mergeProps","props","_jsx","FloatingPortal","BaseBox","setFloating","style","pointerEvents","metaAttribute","name","MetaConstants","Tooltip","makeAnalyticsAttribute","TooltipContent","PopupArrow","width","height","fillColor","colors","popup","background","intense","strokeColor","border","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAQ0B;AAAA,EAAA,IAPtCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAAC,cAAA,GAAAJ,IAAA,CACRK,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,cAAA;IACjBE,aAAY,GAAAN,IAAA,CAAZM,YAAY;IAAAC,WAAA,GAAAP,IAAA,CACZQ,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAA,KAAA,CAAA,GAAGE,iBAAiB,CAACC,OAAO,GAAAH,WAAA;AAC/BI,IAAAA,IAAI,GAAAC,wBAAA,CAAAZ,IAAA,EAAAa,SAAA,CAAA,CAAA;AAEP,EAAA,IAAAC,SAAA,GAAkBC,QAAQ,EAAE;IAApBC,KAAK,GA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AAY;AACtBC,QAAAA,KAAK,EAAE/C,cAAe;AACtBgD,QAAAA,aAAa,EAAC,MAAM;AACpB7F,QAAAA,MAAM,EAAEA,MAAAA;AAAO,OAAA,EACX0E,gBAAgB,EAAE,CAAA,EAClBoB,aAAa,CAAC;QAAEC,IAAI,EAAEC,aAAa,CAACC,OAAAA;AAAQ,OAAC,CAAC,CAAA,EAC9CC,sBAAsB,CAAC/F,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;QAAAR,QAAA,eAEhC6F,GAAA,CAACW,cAAc,EAAA;AACb1G,UAAAA,KAAK,EAAEA,KAAM;AACbmG,UAAAA,KAAK,EAAEjC,MAAO;UACdpB,KAAK,eACHiD,GAAA,CAACY,UAAU,EAAA;AACTnB,YAAAA,GAAG,EAAE/D,QAAS;AACd4B,YAAAA,OAAO,EAAEA,OAAQ;AACjBuD,YAAAA,KAAK,EAAE5D,WAAY;AACnB6D,YAAAA,MAAM,EAAEhE,YAAa;YACrBiE,SAAS,EAAE/F,KAAK,CAACgG,MAAM,CAACC,KAAK,CAACC,UAAU,CAACC,OAAQ;YACjDC,WAAW,EAAEpG,KAAK,CAACgG,MAAM,CAACC,KAAK,CAACI,MAAM,CAACF,OAAAA;AAAQ,WAChD,CACF;AAAAhH,UAAAA,QAAA,EAEAD,OAAAA;SACa,CAAA;OACT,CAAA,CAAA;AAAC,KACI,CACjB,CAAA;AAAA,GACsB,CAAC,CAAA;AAE9B,CAAC,CAAA;AAED,IAAMuG,OAAO,gBAAGa,wBAAwB,CAACvH,QAAQ,EAAE;EACjDwH,WAAW,EAAEC,YAAY,CAACf,OAAAA;AAC5B,CAAC;;;;"}
@@ -14,8 +14,8 @@ import { getStyledProps } from '../../Box/styledProps/getStyledProps.js';
14
14
  import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.web.js';
15
15
  import { metaAttribute } from '../../../utils/metaAttribute/metaAttribute.web.js';
16
16
 
17
- var _excluded = ["color", "fontFamily", "fontSize", "fontWeight", "fontStyle", "textDecorationLine", "numberOfLines", "lineHeight", "letterSpacing", "textAlign", "wordBreak", "opacity"],
18
- _excluded2 = ["id", "color", "fontFamily", "fontSize", "fontWeight", "fontStyle", "textDecorationLine", "lineHeight", "letterSpacing", "as", "textAlign", "children", "truncateAfterLines", "wordBreak", "opacity", "className", "style", "accessibilityProps", "componentName", "testID"];
17
+ var _excluded = ["color", "fontFamily", "fontSize", "fontWeight", "fontStyle", "textDecorationLine", "numberOfLines", "lineHeight", "letterSpacing", "textAlign", "wordBreak", "opacity", "textTransform"],
18
+ _excluded2 = ["id", "color", "fontFamily", "fontSize", "fontWeight", "fontStyle", "textDecorationLine", "lineHeight", "letterSpacing", "as", "textAlign", "children", "truncateAfterLines", "wordBreak", "opacity", "className", "textTransform", "style", "accessibilityProps", "componentName", "testID"];
19
19
  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; }
20
20
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21
21
  var StyledBaseText = /*#__PURE__*/styled.div.withConfig({
@@ -34,6 +34,7 @@ var StyledBaseText = /*#__PURE__*/styled.div.withConfig({
34
34
  textAlign = _ref.textAlign,
35
35
  wordBreak = _ref.wordBreak,
36
36
  opacity = _ref.opacity,
37
+ textTransform = _ref.textTransform,
37
38
  props = _objectWithoutProperties(_ref, _excluded);
38
39
  var styledPropsCSSObject = useStyledProps(props);
39
40
  return _objectSpread(_objectSpread({}, getBaseTextStyles({
@@ -49,6 +50,7 @@ var StyledBaseText = /*#__PURE__*/styled.div.withConfig({
49
50
  textAlign: textAlign,
50
51
  wordBreak: wordBreak,
51
52
  opacity: opacity,
53
+ textTransform: textTransform,
52
54
  theme: props.theme
53
55
  })), styledPropsCSSObject);
54
56
  });
@@ -69,6 +71,7 @@ var _BaseText = function _BaseText(_ref2, ref) {
69
71
  wordBreak = _ref2.wordBreak,
70
72
  opacity = _ref2.opacity,
71
73
  className = _ref2.className,
74
+ textTransform = _ref2.textTransform,
72
75
  style = _ref2.style,
73
76
  _ref2$accessibilityPr = _ref2.accessibilityProps,
74
77
  accessibilityProps = _ref2$accessibilityPr === void 0 ? {} : _ref2$accessibilityPr,
@@ -94,7 +97,8 @@ var _BaseText = function _BaseText(_ref2, ref) {
94
97
  opacity: opacity,
95
98
  className: className,
96
99
  style: style,
97
- id: id
100
+ id: id,
101
+ textTransform: textTransform
98
102
  }, makeAccessible(accessibilityProps)), metaAttribute({
99
103
  name: componentName,
100
104
  testID: testID
@@ -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';\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":";;;;;;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,IAAAA,WAAW,GAAAvB,wBAAA,CAAAQ,KAAA,EAAAgB,UAAA,CAAA,CAAA;EAIhB,oBACEC,GAAA,CAAC9C,cAAc,EAAAyB,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA;AACbK,IAAAA,GAAG,EAAEA,GAAAA;GACDiB,EAAAA,cAAc,CAACH,WAAW,CAAC,CAAA,EAAA,EAAA,EAAA;AAC/BpC,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;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;;;;"}
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 textTransform,\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 textTransform,\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 textTransform,\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 textTransform={textTransform}\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","textTransform","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,EAeM;AAAA,EAAA,IAdJC,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,IAA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AAAA,EAAE,EAAEA,EAAG;AACPhB,IAAAA,SAAS,EAAEA,SAAU;AACrBH,IAAAA,aAAa,EAAEqB,kBAAmB;AAClCjB,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBiB,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,KAAK,EAAEA,KAAM;AACbL,IAAAA,EAAE,EAAEA,EAAG;AACPZ,IAAAA,aAAa,EAAEA,aAAAA;AAAc,GAAA,EACzB6B,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;;;;"}
@@ -30,7 +30,8 @@ var getBaseTextStyles = function getBaseTextStyles(_ref) {
30
30
  letterSpacing = _ref$letterSpacing === void 0 ? 100 : _ref$letterSpacing,
31
31
  textAlign = _ref.textAlign,
32
32
  opacity = _ref.opacity,
33
- theme = _ref.theme;
33
+ theme = _ref.theme,
34
+ textTransform = _ref.textTransform;
34
35
  var textColor = color === 'currentColor' ? 'currentColor' : getIn(theme.colors, color);
35
36
  var themeFontFamily = theme.typography.fonts.family[fontFamily];
36
37
  var themeFontSize = makeTypographySize(theme.typography.fonts.size[fontSize]);
@@ -77,7 +78,8 @@ var getBaseTextStyles = function getBaseTextStyles(_ref) {
77
78
  textAlign: textAlign,
78
79
  margin: 0,
79
80
  padding: 0,
80
- opacity: opacity
81
+ opacity: opacity,
82
+ textTransform: textTransform
81
83
  }, truncateStyles), wordBreakStyles);
82
84
  };
83
85