@razorpay/blade 12.30.0 → 12.31.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.
@@ -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' | '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,CAAE,IAAI,CAAE,IAAI,CAAU,CAkB9D,IAAAC,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CASvB,CARH,IAAAC,EAAE,CAAAD,IAAA,CAAFC,EAAE,CACFC,IA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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 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,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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,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 +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' | '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","_objectSpread","getStyledProps","Heading","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;AAWA,IAAMA,aAAa,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;IAkB9DC,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EASvB;AAAA,EAAA,IARHC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IACFC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,MAAM,GAAAL,IAAA,CAANK,MAAM,CAAA;AAKN,EAAA,IAAMC,KAAsC,GAAG;AAC7CF,IAAAA,KAAK,EAALA,KAAK;AACLG,IAAAA,QAAQ,EAAE,GAAG;AACbC,IAAAA,UAAU,EAAEL,MAAM,KAAA,IAAA,IAANA,MAAM,KAANA,KAAAA,CAAAA,GAAAA,MAAM,GAAI,UAAU;AAChCM,IAAAA,SAAS,EAAE,QAAQ;AACnBC,IAAAA,UAAU,EAAE,GAAG;AACfC,IAAAA,UAAU,EAAE,SAAS;AACrBC,IAAAA,kBAAkB,EAAEC,aAAa,EAAE,GAAG;AAAEC,MAAAA,IAAI,EAAE,SAAA;KAAW,GAAG,EAAE;AAC9DC,IAAAA,aAAa,EAAE,SAAS;AACxBV,IAAAA,MAAM,EAANA,MAAAA;GACD,CAAA;EAED,IAAIH,IAAI,KAAK,OAAO,EAAE;IACpBI,KAAK,CAACC,QAAQ,GAAG,GAAG,CAAA;IACpBD,KAAK,CAACI,UAAU,GAAG,GAAG,CAAA;IACtBJ,KAAK,CAACL,EAAE,GAAG,IAAI,CAAA;AACjB,GAAC,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AQ;;;;"}
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","_objectSpread","getStyledProps","Heading","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;AAWA,IAAMA,aAAa,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;IAkB9DC,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EASvB;AAAA,EAAA,IARHC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IACFC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,KAAK,GAAAJ,IAAA,C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AAC,CAAC,CAAA;EAElE,IAAMQ,KAAK,GAAGP,eAAe,CAAC;AAAEE,IAAAA,EAAE,EAAFA,EAAE;AAAEC,IAAAA,IAAI,EAAJA,IAAI;AAAEC,IAAAA,MAAM,EAANA,MAAM;AAAEC,IAAAA,KAAK,EAALA,KAAK;AAAEC,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA;EAElE,oBACEyB,GAAA,CAACC,QAAQ,EAAAC,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA,EAAA,EACH1B,KAAK,CAAA,EAAA,EAAA,EAAA;AACTY,IAAAA,GAAG,EAAEA,GAAI;AACTK,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCC,IAAAA,SAAS,EAAEA,SAAAA;GACPQ,EAAAA,cAAc,CAACP,WAAW,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAJ,IAAAA,QAAA,EAE9BA,QAAAA;AAAQ,GAAA,CACD,CAAC,CAAA;AAEf,CAAC,CAAA;AAED,IAAMY,OAAO,gBAAGC,cAAK,CAACC,UAAU,CAACpB,QAAQ;;;;"}
@@ -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' | '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","_objectSpread","getStyledProps","Heading","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;AAWA,IAAMA,aAAa,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;IAkB9DC,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EASvB;AAAA,EAAA,IARHC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IACFC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,MAAM,GAAAL,IAAA,CAANK,MAAM,CAAA;AAKN,EAAA,IAAMC,KAAsC,GAAG;AAC7CF,IAAAA,KAAK,EAALA,KAAK;AACLG,IAAAA,QAAQ,EAAE,GAAG;AACbC,IAAAA,UAAU,EAAEL,MAAM,KAAA,IAAA,IAANA,MAAM,KAANA,KAAAA,CAAAA,GAAAA,MAAM,GAAI,UAAU;AAChCM,IAAAA,SAAS,EAAE,QAAQ;AACnBC,IAAAA,UAAU,EAAE,GAAG;AACfC,IAAAA,UAAU,EAAE,SAAS;AACrBC,IAAAA,kBAAkB,EAAEC,aAAa,EAAE,GAAG;AAAEC,MAAAA,IAAI,EAAE,SAAA;KAAW,GAAG,EAAE;AAC9DC,IAAAA,aAAa,EAAE,SAAS;AACxBV,IAAAA,MAAM,EAANA,MAAA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AAAA,cAAc,CAACP,WAAW,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAJ,IAAAA,QAAA,EAE9BA,QAAAA;AAAQ,GAAA,CACD,CAAC,CAAA;AAEf,CAAC,CAAA;AAED,IAAMY,OAAO,gBAAGC,cAAK,CAACC,UAAU,CAACpB,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 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","_objectSpread","getStyledProps","Heading","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;AAWA,IAAMA,aAAa,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;IAkB9DC,eAAe,G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W,GAAAC,wBAAA,CAAAV,KAAA,EAAAW,SAAA,CAAA,CAAA;AAIhBC,EAAAA,iBAAiB,CAAC;AAAEd,IAAAA,aAAa,EAAE,SAAS;AAAEd,IAAAA,EAAE,EAAFA,EAAE;AAAEH,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,CAAA;EAElE,IAAMQ,KAAK,GAAGP,eAAe,CAAC;AAAEE,IAAAA,EAAE,EAAFA,EAAE;AAAEC,IAAAA,IAAI,EAAJA,IAAI;AAAEC,IAAAA,MAAM,EAANA,MAAM;AAAEC,IAAAA,KAAK,EAALA,KAAK;AAAEC,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA;EAElE,oBACEyB,GAAA,CAACC,QAAQ,EAAAC,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA,EAAA,EACH1B,KAAK,CAAA,EAAA,EAAA,EAAA;AACTY,IAAAA,GAAG,EAAEA,GAAI;AACTK,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCC,IAAAA,SAAS,EAAEA,SAAAA;GACPQ,EAAAA,cAAc,CAACP,WAAW,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAJ,IAAAA,QAAA,EAE9BA,QAAAA;AAAQ,GAAA,CACD,CAAC,CAAA;AAEf,CAAC,CAAA;AAED,IAAMY,OAAO,gBAAGC,cAAK,CAACC,UAAU,CAACpB,QAAQ;;;;"}
@@ -10512,7 +10512,7 @@ type HeadingProps = {
10512
10512
  * **Note** This takes priority over `type` and `contrast` prop to decide color of heading
10513
10513
  */
10514
10514
  color?: BaseTextProps['color'];
10515
- weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'semibold'>;
10515
+ weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;
10516
10516
  children: React__default.ReactNode;
10517
10517
  textAlign?: BaseTextProps['textAlign'];
10518
10518
  textDecorationLine?: BaseTextProps['textDecorationLine'];
@@ -10528,7 +10528,7 @@ declare const Heading: React__default.ForwardRefExoticComponent<{
10528
10528
  * **Note** This takes priority over `type` and `contrast` prop to decide color of heading
10529
10529
  */
10530
10530
  color?: BaseTextProps['color'];
10531
- weight?: "regular" | "semibold" | undefined;
10531
+ weight?: "medium" | "regular" | "semibold" | undefined;
10532
10532
  children: React__default.ReactNode;
10533
10533
  textAlign?: BaseTextProps['textAlign'];
10534
10534
  textDecorationLine?: BaseTextProps['textDecorationLine'];
@@ -6632,7 +6632,7 @@ type HeadingProps = {
6632
6632
  * **Note** This takes priority over `type` and `contrast` prop to decide color of heading
6633
6633
  */
6634
6634
  color?: BaseTextProps['color'];
6635
- weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'semibold'>;
6635
+ weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;
6636
6636
  children: React__default.ReactNode;
6637
6637
  textAlign?: BaseTextProps['textAlign'];
6638
6638
  textDecorationLine?: BaseTextProps['textDecorationLine'];
@@ -6648,7 +6648,7 @@ declare const Heading: React__default.ForwardRefExoticComponent<{
6648
6648
  * **Note** This takes priority over `type` and `contrast` prop to decide color of heading
6649
6649
  */
6650
6650
  color?: BaseTextProps['color'];
6651
- weight?: "regular" | "semibold" | undefined;
6651
+ weight?: "medium" | "regular" | "semibold" | undefined;
6652
6652
  children: React__default.ReactNode;
6653
6653
  textAlign?: BaseTextProps['textAlign'];
6654
6654
  textDecorationLine?: BaseTextProps['textDecorationLine'];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@razorpay/blade",
3
3
  "description": "The Design System that powers Razorpay",
4
- "version": "12.30.0",
4
+ "version": "12.31.0",
5
5
  "license": "MIT",
6
6
  "engines": {
7
7
  "node": ">=18.12.1"