@razorpay/blade 11.1.1 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/native/components/Amount/Amount.js +4 -3
- package/build/lib/native/components/Amount/Amount.js.map +1 -1
- package/build/lib/native/components/Amount/amountTokens.js +2 -2
- package/build/lib/native/components/Amount/amountTokens.js.map +1 -1
- package/build/lib/web/development/components/Amount/Amount.js +107 -106
- package/build/lib/web/development/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/development/components/Amount/amountTokens.js +1 -415
- package/build/lib/web/development/components/Amount/amountTokens.js.map +1 -1
- package/build/lib/web/production/components/Amount/Amount.js +107 -106
- package/build/lib/web/production/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/production/components/Amount/amountTokens.js +1 -415
- package/build/lib/web/production/components/Amount/amountTokens.js.map +1 -1
- package/build/types/components/index.d.ts +4 -384
- package/build/types/components/index.native.d.ts +4 -384
- package/package.json +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Amount.js","sources":["../../../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React from 'react';\nimport type { AmountTypeProps, Currency } from './amountTokens';\nimport {\n normalAmountSizes,\n getCurrencyAbbreviations,\n currencyIndicatorMapping,\n subtleFontSizes,\n amountLineHeights,\n currencyPositionMapping,\n} from './amountTokens';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { TestID } from '~utils/types';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { objectKeysWithType } from '~utils/objectKeysWithType';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { Text } from '~components/Typography';\nimport { opacity } from '~tokens/global';\nimport type { FontFamily } from '~tokens/global';\n\ntype AmountCommonProps = {\n /**\n * The value to be rendered within the component.\n *\n */\n value: number;\n /**\n * Sets the color of the amount.\n *\n * @default undefined\n */\n color?: BaseTextProps['color'];\n /**\n * Indicates what the suffix of amount should be\n *\n * @default 'decimals'\n */\n suffix?: 'decimals' | 'none' | 'humanize';\n /**\n * Makes the currency indicator(currency symbol/code) and decimal digits small and faded\n *\n * @default true\n */\n isAffixSubtle?: true | false;\n /**\n * Determines the visual representation of the currency, choose between displaying the currency symbol or code.\n *\n * @default 'currency-symbol'\n */\n currencyIndicator?: 'currency-symbol' | 'currency-code';\n /**\n * The currency of the amount. Note that this component\n * only displays the provided value in the specified currency, it does not perform any currency conversion.\n *\n * @default 'INR'\n * */\n currency?: Currency;\n /**\n * If true, the amount text will have a line through it.\n *\n * @default false\n */\n isStrikethrough?: boolean;\n} & TestID &\n StyledPropsBlade;\n\ntype ColorProps = {\n amountValueColor: BaseTextProps['color'];\n};\n\ntype AmountProps = AmountTypeProps & AmountCommonProps;\n\nconst getTextColorProps = ({ color }: { color: AmountProps['color'] }): ColorProps => {\n const props: ColorProps = {\n amountValueColor: 'surface.text.gray.normal',\n };\n if (!color) return props;\n props.amountValueColor = color;\n return props;\n};\n\ninterface AmountValue extends Omit<AmountProps, 'value'> {\n amountValueColor: BaseTextProps['color'];\n value: string;\n size: Exclude<AmountProps['size'], undefined>;\n}\n\nconst AmountValue = ({\n value,\n size = 'medium',\n type = 'body',\n weight = 'regular',\n amountValueColor,\n isAffixSubtle,\n suffix,\n}: AmountValue): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n const affixFontSize = isAffixSubtle ? subtleFontSizes[type][size] : normalAmountSizes[type][size];\n const numberFontFamily: keyof FontFamily = type === 'body' ? 'text' : 'heading';\n if (suffix === 'decimals' && isAffixSubtle) {\n const integer = value.split('.')[0];\n const decimal = value.split('.')[1];\n\n // Native does not support alignItems of Text inside a div, instead we need to wrap is in a Text\n const AmountWrapper = isReactNative ? Text : React.Fragment;\n\n return (\n <AmountWrapper>\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n lineHeight={amountLineHeights[type][size]}\n color={amountValueColor}\n fontFamily={numberFontFamily}\n as={isReactNative ? undefined : 'span'}\n >\n {integer}\n </BaseText>\n <BaseText\n fontWeight={weight}\n fontSize={affixFontSize}\n fontFamily={numberFontFamily}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[8] : 1}\n >\n .{decimal || '00'}\n </BaseText>\n </AmountWrapper>\n );\n }\n return (\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n fontFamily={numberFontFamily}\n color={amountValueColor}\n lineHeight={amountLineHeights[type][size]}\n >\n {value}\n </BaseText>\n );\n};\n\n// This function rounds a number to a specified number of decimal places\n// and floors the result.\nexport const getFlooredFixed = (value: number, decimalPlaces: number): number => {\n const factor = 100 ** decimalPlaces;\n const roundedValue = Math.floor(value * factor) / factor;\n return Number(roundedValue.toFixed(decimalPlaces));\n};\n\nexport const addCommas = (amountValue: number, currency: Currency, decimalPlaces = 0): string => {\n // If the currency is 'INR', set the locale to 'en-IN' (Indian English).\n // Otherwise, set the locale to 'en-US' (U.S. English).\n const locale = currency === 'INR' ? 'en-IN' : 'en-US';\n return amountValue.toLocaleString(locale, { minimumFractionDigits: decimalPlaces });\n};\n/**\n * This function returns the humanized amount\n * ie: for INR 2000 => 2K\n * for MYR 2000000 => 2M\n */\nexport const getHumanizedAmount = ({\n value,\n currency,\n denominationPosition = 'right',\n}: {\n value: number;\n currency: Currency;\n denominationPosition?: 'left' | 'right';\n}): string => {\n let amountValue = value;\n const abbreviations = getCurrencyAbbreviations(currency);\n const abbreviation = abbreviations.find((abbr) => amountValue >= abbr.value);\n\n if (abbreviation) {\n amountValue = amountValue / abbreviation.value;\n const formattedAmountValue = getFlooredFixed(amountValue, 2);\n\n if (denominationPosition === 'right') {\n return `${addCommas(formattedAmountValue, currency)}${abbreviation.symbol}`;\n }\n\n return `${abbreviation.symbol}${addCommas(formattedAmountValue, currency)}`;\n }\n\n return amountValue.toString();\n};\n\ntype FormatAmountWithSuffixType = {\n suffix: AmountProps['suffix'];\n value: number;\n currency: Currency;\n denominationPosition?: 'left' | 'right';\n};\n\nexport const formatAmountWithSuffix = ({\n suffix,\n value,\n currency,\n denominationPosition,\n}: FormatAmountWithSuffixType): string => {\n switch (suffix) {\n case 'decimals': {\n const decimalNumber = getFlooredFixed(value, 2);\n return addCommas(decimalNumber, currency, 2);\n }\n case 'humanize': {\n return getHumanizedAmount({ value, currency, denominationPosition });\n }\n case 'none': {\n return addCommas(getFlooredFixed(value, 0), currency);\n }\n default:\n return addCommas(getFlooredFixed(value, 0), currency);\n }\n};\n\nconst _Amount = ({\n value,\n suffix = 'decimals',\n type = 'body',\n size = 'medium',\n weight = 'regular',\n isAffixSubtle = true,\n isStrikethrough = false,\n color,\n currencyIndicator = 'currency-symbol',\n currency = 'INR',\n testID,\n ...styledProps\n}: AmountProps): ReactElement => {\n if (__DEV__) {\n if (typeof value !== 'number') {\n throwBladeError({\n message: '`value` prop must be of type `number` for Amount.',\n moduleName: 'Amount',\n });\n }\n // @ts-expect-error neutral color should throw error\n if (color === 'neutral') {\n throwBladeError({\n message: '`neutral` color is not supported.',\n moduleName: 'Amount',\n });\n }\n\n const bodySizes = objectKeysWithType(normalAmountSizes.body);\n if ((type === 'body' || !type) && !bodySizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"body\"`,\n moduleName: 'Amount',\n });\n }\n\n const displaySizes = objectKeysWithType(normalAmountSizes.display);\n if (type === 'display' && !displaySizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"display\"`,\n moduleName: 'Amount',\n });\n }\n\n const headingSizes = objectKeysWithType(normalAmountSizes.heading);\n if (type === 'heading' && !headingSizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"heading\"`,\n moduleName: 'Amount',\n });\n }\n }\n\n const currencySymbolOrCode = currencyIndicatorMapping[currency][currencyIndicator];\n const currencyPosition = currencyPositionMapping[currency] || 'left';\n const denominationPosition = currencyPosition === 'left' ? 'right' : 'left';\n const renderedValue = formatAmountWithSuffix({ suffix, value, currency, denominationPosition });\n const { amountValueColor } = getTextColorProps({\n color,\n });\n\n const currencyFontSize = isAffixSubtle\n ? subtleFontSizes[type][size]\n : normalAmountSizes[type][size];\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n flexDirection=\"row\"\n {...metaAttribute({ name: MetaConstants.Amount, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n alignItems=\"baseline\"\n flexDirection=\"row\"\n position=\"relative\"\n >\n {currencyPosition === 'left' && (\n <BaseText\n marginRight=\"spacing.1\"\n fontWeight={weight}\n fontSize={currencyFontSize}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[8] : 1}\n >\n {currencySymbolOrCode}\n </BaseText>\n )}\n <AmountValue\n value={renderedValue}\n amountValueColor={amountValueColor}\n type={type}\n weight={weight}\n size={size}\n isAffixSubtle={isAffixSubtle}\n suffix={suffix}\n />\n {currencyPosition === 'right' && (\n <BaseText\n marginLeft=\"spacing.1\"\n fontWeight={weight}\n fontSize={currencyFontSize}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[8] : 1}\n >\n {currencySymbolOrCode}\n </BaseText>\n )}\n {isStrikethrough && (\n <BaseBox\n // @ts-expect-error - intentionally setting the border color to the color prop for this hacky strikethrough\n borderBottomColor={amountValueColor}\n borderBottomWidth={type === 'body' ? 'thin' : 'thicker'}\n borderBottomStyle=\"solid\"\n position=\"absolute\"\n width=\"100%\"\n top=\"50%\"\n />\n )}\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst Amount = assignWithoutSideEffects(_Amount, {\n displayName: 'Amount',\n componentId: 'Amount',\n});\n\nexport type { AmountProps };\nexport { Amount };\n"],"names":["getTextColorProps","_ref","color","props","amountValueColor","AmountValue","_ref2","value","_ref2$size","size","_ref2$type","type","_ref2$weight","weight","isAffixSubtle","suffix","isReactNative","getPlatformType","affixFontSize","subtleFontSizes","normalAmountSizes","numberFontFamily","integer","split","decimal","AmountWrapper","Text","React","Fragment","_jsxs","children","_jsx","BaseText","fontSize","fontWeight","lineHeight","amountLineHeights","fontFamily","as","undefined","opacity","getFlooredFixed","decimalPlaces","factor","Math","pow","roundedValue","floor","Number","toFixed","addCommas","amountValue","currency","arguments","length","locale","toLocaleString","minimumFractionDigits","getHumanizedAmount","_ref3","_ref3$denominationPos","denominationPosition","abbreviations","getCurrencyAbbreviations","abbreviation","find","abbr","formattedAmountValue","concat","symbol","toString","formatAmountWithSuffix","_ref4","decimalNumber","_Amount","_ref5","_ref5$suffix","_ref5$type","_ref5$size","_ref5$weight","_ref5$isAffixSubtle","_ref5$isStrikethrough","isStrikethrough","_ref5$currencyIndicat","currencyIndicator","_ref5$currency","testID","styledProps","_objectWithoutProperties","_excluded","throwBladeError","message","moduleName","bodySizes","objectKeysWithType","body","includes","displaySizes","display","headingSizes","heading","currencySymbolOrCode","currencyIndicatorMapping","currencyPosition","currencyPositionMapping","renderedValue","_getTextColorProps","currencyFontSize","BaseBox","_objectSpread","flexDirection","metaAttribute","name","MetaConstants","Amount","getStyledProps","alignItems","position","marginRight","marginLeft","borderBottomColor","borderBottomWidth","borderBottomStyle","width","top","assignWithoutSideEffects","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAA+D;AAAA,EAAA,IAAzDC,KAAK,GAAAD,IAAA,CAALC,KAAK,CAAA;AAChC,EAAA,IAAMC,KAAiB,GAAG;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,MAAM;AACZC,QAAAA,GAAG,EAAC,KAAA;AAAK,OACV,CACF,CAAA;KACM,CAAA;AAAC,GAAA,CACH,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMV,MAAM,gBAAGW,wBAAwB,CAACnD,OAAO,EAAE;AAC/CoD,EAAAA,WAAW,EAAE,QAAQ;AACrBC,EAAAA,WAAW,EAAE,QAAA;AACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Amount.js","sources":["../../../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React from 'react';\nimport type { CurrencyCodeType } from '@razorpay/i18nify-js/currency';\nimport { formatNumber, formatNumberByParts } from '@razorpay/i18nify-js/currency';\nimport type { AmountTypeProps } from './amountTokens';\nimport { normalAmountSizes, subtleFontSizes, amountLineHeights } from './amountTokens';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { TestID } from '~utils/types';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { objectKeysWithType } from '~utils/objectKeysWithType';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { Text } from '~components/Typography';\nimport { opacity } from '~tokens/global';\nimport type { FontFamily } from '~tokens/global';\n\ntype AmountCommonProps = {\n /**\n * The value to be rendered within the component.\n *\n */\n value: number;\n /**\n * Sets the color of the amount.\n *\n * @default undefined\n */\n color?: BaseTextProps['color'];\n /**\n * Indicates what the suffix of amount should be\n *\n * @default 'decimals'\n */\n suffix?: 'decimals' | 'none' | 'humanize';\n /**\n * Makes the currency indicator(currency symbol/code) and decimal digits small and faded\n *\n * @default true\n */\n isAffixSubtle?: true | false;\n /**\n * Determines the visual representation of the currency, choose between displaying the currency symbol or code.\n *\n * Note: Currency symbol and code is determined by the locale set in user's browser or set via @razorpay/i18nify-react library.\n *\n * @default 'currency-symbol'\n */\n currencyIndicator?: 'currency-symbol' | 'currency-code';\n /**\n * The currency of the amount. Note that this component\n * only displays the provided value in the specified currency, it does not perform any currency conversion.\n *\n * @default 'INR'\n * */\n currency?: CurrencyCodeType;\n /**\n * If true, the amount text will have a line through it.\n *\n * @default false\n */\n isStrikethrough?: boolean;\n} & TestID &\n StyledPropsBlade;\n\ntype ColorProps = {\n amountValueColor: BaseTextProps['color'];\n};\n\ntype AmountProps = AmountTypeProps & AmountCommonProps;\n\nconst getTextColorProps = ({ color }: { color: AmountProps['color'] }): ColorProps => {\n const props: ColorProps = {\n amountValueColor: 'surface.text.gray.normal',\n };\n if (!color) return props;\n props.amountValueColor = color;\n return props;\n};\n\ntype AmountType = Partial<ReturnType<typeof formatNumberByParts>> & { formatted: string };\n\ninterface AmountValue extends Omit<AmountProps, 'value'> {\n amountValueColor: BaseTextProps['color'];\n amount: AmountType;\n size: Exclude<AmountProps['size'], undefined>;\n}\n\nconst AmountValue = ({\n amount,\n size = 'medium',\n type = 'body',\n weight = 'regular',\n amountValueColor,\n isAffixSubtle,\n suffix,\n}: AmountValue): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n const affixFontSize = isAffixSubtle ? subtleFontSizes[type][size] : normalAmountSizes[type][size];\n const numberFontFamily: keyof FontFamily = type === 'body' ? 'text' : 'heading';\n if (suffix === 'decimals' && isAffixSubtle) {\n // Native does not support alignItems of Text inside a div, instead we need to wrap is in a Text\n const AmountWrapper = isReactNative ? Text : React.Fragment;\n\n return (\n <AmountWrapper>\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n lineHeight={amountLineHeights[type][size]}\n color={amountValueColor}\n fontFamily={numberFontFamily}\n as={isReactNative ? undefined : 'span'}\n >\n {amount.integer}\n </BaseText>\n <BaseText\n fontWeight={weight}\n fontSize={affixFontSize}\n fontFamily={numberFontFamily}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[8] : 1}\n >\n {amount.decimal}\n {amount.fraction}\n </BaseText>\n </AmountWrapper>\n );\n }\n\n return (\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n fontFamily={numberFontFamily}\n color={amountValueColor}\n lineHeight={amountLineHeights[type][size]}\n >\n {amount.formatted}\n </BaseText>\n );\n};\n\ntype FormatAmountWithSuffixType = {\n suffix: AmountProps['suffix'];\n value: number;\n};\n\n/**\n * Returns a parsed object based on the suffix passed in parameters\n * === Logic ===\n * value = 12500.45 \n * if suffix === 'decimals' => {\n \"formatted\": \"12,500.45\",\n \"integer\": \"12,500\",\n \"decimal\": \".\",\n \"fraction\": \"45\",\n \"isPrefixSymbol\": false,\n \"rawParts\": [{\"type\": \"integer\",\"value\": \"12\"},{\"type\": \"group\",\"value\": \",\"},{\"type\": \"integer\",\"value\": \"500\"},{\"type\": \"decimal\",\"value\": \".\"},{\"type\": \"fraction\",\"value\": \"45\"}]\n}\n * else if suffix === 'humanize' => { formatted: \"1.2T\" }\n * else => { formatted: \"1,23,456\" }\n * @returns {AmountType}\n */\nexport const formatAmountWithSuffix = ({\n suffix,\n value,\n}: FormatAmountWithSuffixType): AmountType => {\n try {\n switch (suffix) {\n case 'decimals': {\n const options = {\n intlOptions: {\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n },\n };\n return {\n ...formatNumberByParts(value, options),\n formatted: formatNumber(value, options),\n };\n }\n case 'humanize': {\n const formatted = formatNumber(value, {\n intlOptions: {\n notation: 'compact',\n },\n });\n return {\n formatted,\n };\n }\n\n default: {\n const formatted = formatNumber(value, {\n intlOptions: {\n maximumFractionDigits: 0,\n roundingMode: 'floor',\n },\n });\n return {\n formatted,\n };\n }\n }\n } catch (err: unknown) {\n return {\n formatted: `${value}`,\n };\n }\n};\n\nconst _Amount = ({\n value,\n suffix = 'decimals',\n type = 'body',\n size = 'medium',\n weight = 'regular',\n isAffixSubtle = true,\n isStrikethrough = false,\n color,\n currencyIndicator = 'currency-symbol',\n currency = 'INR',\n testID,\n ...styledProps\n}: AmountProps): ReactElement => {\n if (__DEV__) {\n if (typeof value !== 'number') {\n throwBladeError({\n message: '`value` prop must be of type `number` for Amount.',\n moduleName: 'Amount',\n });\n }\n // @ts-expect-error neutral color should throw error\n if (color === 'neutral') {\n throwBladeError({\n message: '`neutral` color is not supported.',\n moduleName: 'Amount',\n });\n }\n\n const bodySizes = objectKeysWithType(normalAmountSizes.body);\n if ((type === 'body' || !type) && !bodySizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"body\"`,\n moduleName: 'Amount',\n });\n }\n\n const displaySizes = objectKeysWithType(normalAmountSizes.display);\n if (type === 'display' && !displaySizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"display\"`,\n moduleName: 'Amount',\n });\n }\n\n const headingSizes = objectKeysWithType(normalAmountSizes.heading);\n if (type === 'heading' && !headingSizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"heading\"`,\n moduleName: 'Amount',\n });\n }\n }\n\n const { amountValueColor } = getTextColorProps({\n color,\n });\n\n let isPrefixSymbol, currencySymbol;\n try {\n const byParts = formatNumberByParts(value, {\n currency,\n });\n isPrefixSymbol = byParts.isPrefixSymbol;\n currencySymbol = byParts.currency;\n } catch (err: unknown) {\n isPrefixSymbol = true;\n currencySymbol = currency;\n }\n\n const currencyPosition = isPrefixSymbol ? 'left' : 'right';\n const renderedValue = formatAmountWithSuffix({ suffix, value });\n const currencySymbolOrCode = currencyIndicator === 'currency-symbol' ? currencySymbol : currency;\n\n const currencyFontSize = isAffixSubtle\n ? subtleFontSizes[type][size]\n : normalAmountSizes[type][size];\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n flexDirection=\"row\"\n {...metaAttribute({ name: MetaConstants.Amount, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n alignItems=\"baseline\"\n flexDirection=\"row\"\n position=\"relative\"\n >\n {currencyPosition === 'left' && (\n <BaseText\n marginRight=\"spacing.1\"\n fontWeight={weight}\n fontSize={currencyFontSize}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[8] : 1}\n >\n {currencySymbolOrCode}\n </BaseText>\n )}\n <AmountValue\n amount={renderedValue}\n amountValueColor={amountValueColor}\n type={type}\n weight={weight}\n size={size}\n isAffixSubtle={isAffixSubtle}\n suffix={suffix}\n currency={currency}\n />\n {currencyPosition === 'right' && (\n <BaseText\n marginLeft=\"spacing.1\"\n fontWeight={weight}\n fontSize={currencyFontSize}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[8] : 1}\n >\n {currencySymbolOrCode}\n </BaseText>\n )}\n {isStrikethrough && (\n <BaseBox\n // @ts-expect-error - intentionally setting the border color to the color prop for this hacky strikethrough\n borderBottomColor={amountValueColor}\n borderBottomWidth={type === 'body' ? 'thin' : 'thicker'}\n borderBottomStyle=\"solid\"\n position=\"absolute\"\n width=\"100%\"\n top=\"50%\"\n />\n )}\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst Amount = assignWithoutSideEffects(_Amount, {\n displayName: 'Amount',\n componentId: 'Amount',\n});\n\nexport type { AmountProps };\nexport { Amount };\n"],"names":["getTextColorProps","_ref","color","props","amountValueColor","AmountValue","_ref2","amount","_ref2$size","size","_ref2$type","type","_ref2$weight","weight","isAffixSubtle","suffix","isReactNative","getPlatformType","affixFontSize","subtleFontSizes","normalAmountSizes","numberFontFamily","AmountWrapper","Text","React","Fragment","_jsxs","children","_jsx","BaseText","fontSize","fontWeight","lineHeight","amountLineHeights","fontFamily","as","undefined","integer","opacity","decimal","fraction","formatted","formatAmountWithSuffix","_ref3","value","options","intlOptions","maximumFractionDigits","minimumFractionDigits","_objectSpread","formatNumberByParts","formatNumber","notation","roundingMode","err","concat","_Amount","_ref4","_ref4$suffix","_ref4$type","_ref4$size","_ref4$weight","_ref4$isAffixSubtle","_ref4$isStrikethrough","isStrikethrough","_ref4$currencyIndicat","currencyIndicator","_ref4$currency","currency","testID","styledProps","_objectWithoutProperties","_excluded","throwBladeError","message","moduleName","bodySizes","objectKeysWithType","body","includes","displaySizes","display","headingSizes","heading","_getTextColorProps","isPrefixSymbol","currencySymbol","byParts","currencyPosition","renderedValue","currencySymbolOrCode","currencyFontSize","BaseBox","flexDirection","metaAttribute","name","MetaConstants","Amount","getStyledProps","alignItems","position","marginRight","marginLeft","borderBottomColor","borderBottomWidth","borderBottomStyle","width","top","assignWithoutSideEffects","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAA+D;AAAA,EAAA,IAAzDC,KAAK,GAAAD,IAAA,CAALC,KAAK,CAAA;AAChC,EAAA,IAAMC,KAAiB,GAAG;AACxBC,IAAAA,gBAAgB,EAAE,0BAAA;GACnB,CAAA;AACD,EAAA,IAAI,CAACF,KAAK,EAAE,OAAOC,KAAK,CAAA;EACxBA,KAAK,CAACC,gBAAgB,GAAGF,KAAK,CAAA;AAC9B,EAAA,OAAOC,KAAK,CAAA;AACd,CAAC,CAAA;AAUD,IAAME,WAAW,GAAG,SAAdA,WAAWA,CAAAC,KAAA,EAQgB;AAAA,EAAA,IAP/BC,MAAM,GAAAD,KAAA,CAANC,MAAM;IAAAC,UAAA,GAAAF,KAAA,CACNG,IAAI;AAAJA,IAAAA,IAAI,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,UAAA;IAAAE,UAAA,GAAAJ,KAAA,CACfK,IAAI;AAAJA,IAAAA,IAAI,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,UAAA;IAAAE,YAA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AEnB,aAAa,GAAGoB,SAAS,GAAG,MAAO;QACvCE,OAAO,EAAExB,aAAa,GAAGwB,OAAO,CAAC,CAAC,CAAC,GAAG,CAAE;AAAAX,QAAAA,QAAA,EAEvC+D,oBAAAA;AAAoB,OACb,CACX,EACA1B,eAAe,iBACdpC,GAAA,CAACgE,OAAAA;AACC;AAAA,QAAA;AACAW,QAAAA,iBAAiB,EAAEnG,gBAAiB;AACpCoG,QAAAA,iBAAiB,EAAE7F,IAAI,KAAK,MAAM,GAAG,MAAM,GAAG,SAAU;AACxD8F,QAAAA,iBAAiB,EAAC,OAAO;AACzBL,QAAAA,QAAQ,EAAC,UAAU;AACnBM,QAAAA,KAAK,EAAC,MAAM;AACZC,QAAAA,GAAG,EAAC,KAAA;AAAK,OACV,CACF,CAAA;KACM,CAAA;AAAC,GAAA,CACH,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMV,MAAM,gBAAGW,wBAAwB,CAACpD,OAAO,EAAE;AAC/CqD,EAAAA,WAAW,EAAE,QAAQ;AACrBC,EAAAA,WAAW,EAAE,QAAA;AACf,CAAC;;;;"}
|
|
@@ -62,419 +62,5 @@ var amountLineHeights = {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
var currencyIndicatorMapping = {
|
|
67
|
-
AED: {
|
|
68
|
-
'currency-symbol': 'د.إ',
|
|
69
|
-
'currency-code': 'AED'
|
|
70
|
-
},
|
|
71
|
-
ALL: {
|
|
72
|
-
'currency-symbol': 'Lek',
|
|
73
|
-
'currency-code': 'ALL'
|
|
74
|
-
},
|
|
75
|
-
AMD: {
|
|
76
|
-
'currency-symbol': '֏',
|
|
77
|
-
'currency-code': 'AMD'
|
|
78
|
-
},
|
|
79
|
-
ARS: {
|
|
80
|
-
'currency-symbol': 'ARS',
|
|
81
|
-
'currency-code': 'ARS'
|
|
82
|
-
},
|
|
83
|
-
AUD: {
|
|
84
|
-
'currency-symbol': 'A$',
|
|
85
|
-
'currency-code': 'AUD'
|
|
86
|
-
},
|
|
87
|
-
AWG: {
|
|
88
|
-
'currency-symbol': 'Afl.',
|
|
89
|
-
'currency-code': 'AWG'
|
|
90
|
-
},
|
|
91
|
-
BBD: {
|
|
92
|
-
'currency-symbol': '$',
|
|
93
|
-
'currency-code': 'BBD'
|
|
94
|
-
},
|
|
95
|
-
BDT: {
|
|
96
|
-
'currency-symbol': '৳',
|
|
97
|
-
'currency-code': 'BDT'
|
|
98
|
-
},
|
|
99
|
-
BMD: {
|
|
100
|
-
'currency-symbol': '$',
|
|
101
|
-
'currency-code': 'BMD'
|
|
102
|
-
},
|
|
103
|
-
BND: {
|
|
104
|
-
'currency-symbol': 'BND',
|
|
105
|
-
'currency-code': 'BND'
|
|
106
|
-
},
|
|
107
|
-
BOB: {
|
|
108
|
-
'currency-symbol': 'Bs',
|
|
109
|
-
'currency-code': 'BOB'
|
|
110
|
-
},
|
|
111
|
-
BSD: {
|
|
112
|
-
'currency-symbol': 'B$',
|
|
113
|
-
'currency-code': 'BSD'
|
|
114
|
-
},
|
|
115
|
-
BWP: {
|
|
116
|
-
'currency-symbol': 'P',
|
|
117
|
-
'currency-code': 'BWP'
|
|
118
|
-
},
|
|
119
|
-
BZD: {
|
|
120
|
-
'currency-symbol': 'BZ$',
|
|
121
|
-
'currency-code': 'BZD'
|
|
122
|
-
},
|
|
123
|
-
CAD: {
|
|
124
|
-
'currency-symbol': 'C$',
|
|
125
|
-
'currency-code': 'CAD'
|
|
126
|
-
},
|
|
127
|
-
CHF: {
|
|
128
|
-
'currency-symbol': 'CHf',
|
|
129
|
-
'currency-code': 'CHF'
|
|
130
|
-
},
|
|
131
|
-
CNY: {
|
|
132
|
-
'currency-symbol': '¥',
|
|
133
|
-
'currency-code': 'CNY'
|
|
134
|
-
},
|
|
135
|
-
COP: {
|
|
136
|
-
'currency-symbol': 'COL$',
|
|
137
|
-
'currency-code': 'COP'
|
|
138
|
-
},
|
|
139
|
-
CRC: {
|
|
140
|
-
'currency-symbol': '₡',
|
|
141
|
-
'currency-code': 'CRC'
|
|
142
|
-
},
|
|
143
|
-
CUP: {
|
|
144
|
-
'currency-symbol': '$MN',
|
|
145
|
-
'currency-code': 'CUP'
|
|
146
|
-
},
|
|
147
|
-
CZK: {
|
|
148
|
-
'currency-symbol': 'Kč',
|
|
149
|
-
'currency-code': 'CZK'
|
|
150
|
-
},
|
|
151
|
-
DKK: {
|
|
152
|
-
'currency-symbol': 'DKK',
|
|
153
|
-
'currency-code': 'DKK'
|
|
154
|
-
},
|
|
155
|
-
DOP: {
|
|
156
|
-
'currency-symbol': 'RD$',
|
|
157
|
-
'currency-code': 'DOP'
|
|
158
|
-
},
|
|
159
|
-
DZD: {
|
|
160
|
-
'currency-symbol': 'د.ج',
|
|
161
|
-
'currency-code': 'DZD'
|
|
162
|
-
},
|
|
163
|
-
EGP: {
|
|
164
|
-
'currency-symbol': 'E£',
|
|
165
|
-
'currency-code': 'EGP'
|
|
166
|
-
},
|
|
167
|
-
ETB: {
|
|
168
|
-
'currency-symbol': 'ብር',
|
|
169
|
-
'currency-code': 'ETB'
|
|
170
|
-
},
|
|
171
|
-
EUR: {
|
|
172
|
-
'currency-symbol': '€',
|
|
173
|
-
'currency-code': 'EUR'
|
|
174
|
-
},
|
|
175
|
-
FJD: {
|
|
176
|
-
'currency-symbol': 'FJ$',
|
|
177
|
-
'currency-code': 'FJD'
|
|
178
|
-
},
|
|
179
|
-
GBP: {
|
|
180
|
-
'currency-symbol': '£',
|
|
181
|
-
'currency-code': 'GBP'
|
|
182
|
-
},
|
|
183
|
-
GHS: {
|
|
184
|
-
'currency-symbol': 'GH₵',
|
|
185
|
-
'currency-code': 'GHS'
|
|
186
|
-
},
|
|
187
|
-
GIP: {
|
|
188
|
-
'currency-symbol': 'GIP',
|
|
189
|
-
'currency-code': 'GIP'
|
|
190
|
-
},
|
|
191
|
-
GMD: {
|
|
192
|
-
'currency-symbol': 'D',
|
|
193
|
-
'currency-code': 'GMD'
|
|
194
|
-
},
|
|
195
|
-
GTQ: {
|
|
196
|
-
'currency-symbol': 'Q',
|
|
197
|
-
'currency-code': 'GTQ'
|
|
198
|
-
},
|
|
199
|
-
GYD: {
|
|
200
|
-
'currency-symbol': 'G$',
|
|
201
|
-
'currency-code': 'GYD'
|
|
202
|
-
},
|
|
203
|
-
HKD: {
|
|
204
|
-
'currency-symbol': 'HK$',
|
|
205
|
-
'currency-code': 'HKD'
|
|
206
|
-
},
|
|
207
|
-
HNL: {
|
|
208
|
-
'currency-symbol': 'HNL',
|
|
209
|
-
'currency-code': 'HNL'
|
|
210
|
-
},
|
|
211
|
-
HRK: {
|
|
212
|
-
'currency-symbol': 'kn',
|
|
213
|
-
'currency-code': 'HRK'
|
|
214
|
-
},
|
|
215
|
-
HTG: {
|
|
216
|
-
'currency-symbol': 'G',
|
|
217
|
-
'currency-code': 'HTG'
|
|
218
|
-
},
|
|
219
|
-
HUF: {
|
|
220
|
-
'currency-symbol': 'Ft',
|
|
221
|
-
'currency-code': 'HUF'
|
|
222
|
-
},
|
|
223
|
-
IDR: {
|
|
224
|
-
'currency-symbol': 'Rp',
|
|
225
|
-
'currency-code': 'IDR'
|
|
226
|
-
},
|
|
227
|
-
ILS: {
|
|
228
|
-
'currency-symbol': '₪',
|
|
229
|
-
'currency-code': 'ILS'
|
|
230
|
-
},
|
|
231
|
-
INR: {
|
|
232
|
-
'currency-symbol': '₹',
|
|
233
|
-
'currency-code': 'INR'
|
|
234
|
-
},
|
|
235
|
-
JMD: {
|
|
236
|
-
'currency-symbol': 'J$',
|
|
237
|
-
'currency-code': 'JMD'
|
|
238
|
-
},
|
|
239
|
-
KES: {
|
|
240
|
-
'currency-symbol': 'Ksh',
|
|
241
|
-
'currency-code': 'KES'
|
|
242
|
-
},
|
|
243
|
-
KGS: {
|
|
244
|
-
'currency-symbol': 'Лв',
|
|
245
|
-
'currency-code': 'KGS'
|
|
246
|
-
},
|
|
247
|
-
KHR: {
|
|
248
|
-
'currency-symbol': '៛',
|
|
249
|
-
'currency-code': 'KHR'
|
|
250
|
-
},
|
|
251
|
-
KYD: {
|
|
252
|
-
'currency-symbol': 'CI$',
|
|
253
|
-
'currency-code': 'KYD'
|
|
254
|
-
},
|
|
255
|
-
KZT: {
|
|
256
|
-
'currency-symbol': '₸',
|
|
257
|
-
'currency-code': 'KZT'
|
|
258
|
-
},
|
|
259
|
-
LAK: {
|
|
260
|
-
'currency-symbol': '₭',
|
|
261
|
-
'currency-code': 'LAK'
|
|
262
|
-
},
|
|
263
|
-
LKR: {
|
|
264
|
-
'currency-symbol': 'රු',
|
|
265
|
-
'currency-code': 'LKR'
|
|
266
|
-
},
|
|
267
|
-
LRD: {
|
|
268
|
-
'currency-symbol': 'L$',
|
|
269
|
-
'currency-code': 'LRD'
|
|
270
|
-
},
|
|
271
|
-
LSL: {
|
|
272
|
-
'currency-symbol': 'LSL',
|
|
273
|
-
'currency-code': 'LSL'
|
|
274
|
-
},
|
|
275
|
-
MAD: {
|
|
276
|
-
'currency-symbol': 'د.م.',
|
|
277
|
-
'currency-code': 'MAD'
|
|
278
|
-
},
|
|
279
|
-
MDL: {
|
|
280
|
-
'currency-symbol': 'MDL',
|
|
281
|
-
'currency-code': 'MDL'
|
|
282
|
-
},
|
|
283
|
-
MKD: {
|
|
284
|
-
'currency-symbol': 'ден',
|
|
285
|
-
'currency-code': 'MKD'
|
|
286
|
-
},
|
|
287
|
-
MMK: {
|
|
288
|
-
'currency-symbol': 'MMK',
|
|
289
|
-
'currency-code': 'MMK'
|
|
290
|
-
},
|
|
291
|
-
MNT: {
|
|
292
|
-
'currency-symbol': '₮',
|
|
293
|
-
'currency-code': 'MNT'
|
|
294
|
-
},
|
|
295
|
-
MOP: {
|
|
296
|
-
'currency-symbol': 'MOP$',
|
|
297
|
-
'currency-code': 'MOP'
|
|
298
|
-
},
|
|
299
|
-
MUR: {
|
|
300
|
-
'currency-symbol': '₨',
|
|
301
|
-
'currency-code': 'MUR'
|
|
302
|
-
},
|
|
303
|
-
MVR: {
|
|
304
|
-
'currency-symbol': 'Rf',
|
|
305
|
-
'currency-code': 'MVR'
|
|
306
|
-
},
|
|
307
|
-
MWK: {
|
|
308
|
-
'currency-symbol': 'MK',
|
|
309
|
-
'currency-code': 'MWK'
|
|
310
|
-
},
|
|
311
|
-
MXN: {
|
|
312
|
-
'currency-symbol': 'Mex$',
|
|
313
|
-
'currency-code': 'MXN'
|
|
314
|
-
},
|
|
315
|
-
MYR: {
|
|
316
|
-
'currency-symbol': 'RM',
|
|
317
|
-
'currency-code': 'MYR'
|
|
318
|
-
},
|
|
319
|
-
NAD: {
|
|
320
|
-
'currency-symbol': 'N$',
|
|
321
|
-
'currency-code': 'NAD'
|
|
322
|
-
},
|
|
323
|
-
NGN: {
|
|
324
|
-
'currency-symbol': '₦',
|
|
325
|
-
'currency-code': 'NGN'
|
|
326
|
-
},
|
|
327
|
-
NIO: {
|
|
328
|
-
'currency-symbol': 'NIO',
|
|
329
|
-
'currency-code': 'NIO'
|
|
330
|
-
},
|
|
331
|
-
NOK: {
|
|
332
|
-
'currency-symbol': 'NOK',
|
|
333
|
-
'currency-code': 'NOK'
|
|
334
|
-
},
|
|
335
|
-
NPR: {
|
|
336
|
-
'currency-symbol': 'रू',
|
|
337
|
-
'currency-code': 'NPR'
|
|
338
|
-
},
|
|
339
|
-
NZD: {
|
|
340
|
-
'currency-symbol': 'NZ$',
|
|
341
|
-
'currency-code': 'NZD'
|
|
342
|
-
},
|
|
343
|
-
PEN: {
|
|
344
|
-
'currency-symbol': 'S/',
|
|
345
|
-
'currency-code': 'PEN'
|
|
346
|
-
},
|
|
347
|
-
PGK: {
|
|
348
|
-
'currency-symbol': 'PGK',
|
|
349
|
-
'currency-code': 'PGK'
|
|
350
|
-
},
|
|
351
|
-
PHP: {
|
|
352
|
-
'currency-symbol': '₱',
|
|
353
|
-
'currency-code': 'PHP'
|
|
354
|
-
},
|
|
355
|
-
PKR: {
|
|
356
|
-
'currency-symbol': '₨',
|
|
357
|
-
'currency-code': 'PKR'
|
|
358
|
-
},
|
|
359
|
-
QAR: {
|
|
360
|
-
'currency-symbol': 'QR',
|
|
361
|
-
'currency-code': 'QAR'
|
|
362
|
-
},
|
|
363
|
-
RUB: {
|
|
364
|
-
'currency-symbol': '₽',
|
|
365
|
-
'currency-code': 'RUB'
|
|
366
|
-
},
|
|
367
|
-
SAR: {
|
|
368
|
-
'currency-symbol': 'SR',
|
|
369
|
-
'currency-code': 'SAR'
|
|
370
|
-
},
|
|
371
|
-
SCR: {
|
|
372
|
-
'currency-symbol': 'SRe',
|
|
373
|
-
'currency-code': 'SCR'
|
|
374
|
-
},
|
|
375
|
-
SEK: {
|
|
376
|
-
'currency-symbol': 'SEK',
|
|
377
|
-
'currency-code': 'SEK'
|
|
378
|
-
},
|
|
379
|
-
SGD: {
|
|
380
|
-
'currency-symbol': 'S$',
|
|
381
|
-
'currency-code': 'SGD'
|
|
382
|
-
},
|
|
383
|
-
SLL: {
|
|
384
|
-
'currency-symbol': 'Le',
|
|
385
|
-
'currency-code': 'SLL'
|
|
386
|
-
},
|
|
387
|
-
SOS: {
|
|
388
|
-
'currency-symbol': 'Sh.so.',
|
|
389
|
-
'currency-code': 'SOS'
|
|
390
|
-
},
|
|
391
|
-
SSP: {
|
|
392
|
-
'currency-symbol': 'SS£',
|
|
393
|
-
'currency-code': 'SSP'
|
|
394
|
-
},
|
|
395
|
-
SVC: {
|
|
396
|
-
'currency-symbol': '₡',
|
|
397
|
-
'currency-code': 'SVC'
|
|
398
|
-
},
|
|
399
|
-
SZL: {
|
|
400
|
-
'currency-symbol': 'E',
|
|
401
|
-
'currency-code': 'SZL'
|
|
402
|
-
},
|
|
403
|
-
THB: {
|
|
404
|
-
'currency-symbol': '฿',
|
|
405
|
-
'currency-code': 'THB'
|
|
406
|
-
},
|
|
407
|
-
TTD: {
|
|
408
|
-
'currency-symbol': 'TT$',
|
|
409
|
-
'currency-code': 'TTD'
|
|
410
|
-
},
|
|
411
|
-
TZS: {
|
|
412
|
-
'currency-symbol': 'Sh',
|
|
413
|
-
'currency-code': 'TZS'
|
|
414
|
-
},
|
|
415
|
-
USD: {
|
|
416
|
-
'currency-symbol': '$',
|
|
417
|
-
'currency-code': 'USD'
|
|
418
|
-
},
|
|
419
|
-
UYU: {
|
|
420
|
-
'currency-symbol': '$U',
|
|
421
|
-
'currency-code': 'UYU'
|
|
422
|
-
},
|
|
423
|
-
UZS: {
|
|
424
|
-
'currency-symbol': "so'm",
|
|
425
|
-
'currency-code': 'UZS'
|
|
426
|
-
},
|
|
427
|
-
YER: {
|
|
428
|
-
'currency-symbol': '﷼',
|
|
429
|
-
'currency-code': 'YER'
|
|
430
|
-
},
|
|
431
|
-
ZAR: {
|
|
432
|
-
'currency-symbol': 'R',
|
|
433
|
-
'currency-code': 'ZAR'
|
|
434
|
-
},
|
|
435
|
-
KWD: {
|
|
436
|
-
'currency-symbol': 'د.ك',
|
|
437
|
-
'currency-code': 'KWD'
|
|
438
|
-
},
|
|
439
|
-
BHD: {
|
|
440
|
-
'currency-symbol': 'د.ب.',
|
|
441
|
-
'currency-code': 'BHD'
|
|
442
|
-
},
|
|
443
|
-
OMR: {
|
|
444
|
-
'currency-symbol': 'ر.ع.',
|
|
445
|
-
'currency-code': 'OMR'
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
var getCurrencyAbbreviations = function getCurrencyAbbreviations(currency) {
|
|
449
|
-
if (currency === 'INR') {
|
|
450
|
-
return [{
|
|
451
|
-
value: 1e7,
|
|
452
|
-
symbol: 'Cr'
|
|
453
|
-
}, {
|
|
454
|
-
value: 1e5,
|
|
455
|
-
symbol: 'L'
|
|
456
|
-
}, {
|
|
457
|
-
value: 1e3,
|
|
458
|
-
symbol: 'k'
|
|
459
|
-
}];
|
|
460
|
-
}
|
|
461
|
-
return [{
|
|
462
|
-
value: 1e9,
|
|
463
|
-
symbol: 'B'
|
|
464
|
-
}, {
|
|
465
|
-
value: 1e6,
|
|
466
|
-
symbol: 'M'
|
|
467
|
-
}, {
|
|
468
|
-
value: 1e3,
|
|
469
|
-
symbol: 'K'
|
|
470
|
-
}];
|
|
471
|
-
};
|
|
472
|
-
var currencyPositionMapping = {
|
|
473
|
-
DZD: 'right',
|
|
474
|
-
BHD: 'right',
|
|
475
|
-
OMR: 'right',
|
|
476
|
-
KWD: 'right'
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
export { amountLineHeights, currencyIndicatorMapping, currencyPositionMapping, getCurrencyAbbreviations, normalAmountSizes, subtleFontSizes };
|
|
65
|
+
export { amountLineHeights, normalAmountSizes, subtleFontSizes };
|
|
480
66
|
//# sourceMappingURL=amountTokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amountTokens.js","sources":["../../../../../../src/components/Amount/amountTokens.ts"],"sourcesContent":["import type { FontSize, Typography } from '~tokens/global';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\n\ntype AmountSizes = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge';\n\ntype AmountDisplayProps = {\n type?: 'display';\n size?: Extract<AmountSizes, 'small' | 'medium' | 'large' | 'xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n};\n\ntype AmountHeadingProps = {\n type?: 'heading';\n size?: Extract<AmountSizes, 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'semibold'>;\n};\n\ntype AmountBodyProps = {\n type?: 'body';\n size?: Extract<AmountSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n};\n\ntype AmountTypeProps = AmountDisplayProps | AmountHeadingProps | AmountBodyProps;\n\nconst normalAmountSizes: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof FontSize>>\n> = {\n body: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n heading: {\n small: 300,\n medium: 400,\n large: 500,\n xlarge: 600,\n '2xlarge': 700,\n },\n display: {\n small: 800,\n medium: 900,\n large: 1000,\n xlarge: 1100,\n },\n};\n\nconst subtleFontSizes: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof FontSize>>\n> = {\n body: {\n xsmall: normalAmountSizes.body.xsmall,\n small: normalAmountSizes.body.xsmall,\n medium: normalAmountSizes.body.xsmall,\n large: normalAmountSizes.body.small,\n },\n heading: {\n small: normalAmountSizes.body.small,\n medium: normalAmountSizes.body.medium,\n large: normalAmountSizes.body.large,\n xlarge: normalAmountSizes.heading.medium,\n '2xlarge': normalAmountSizes.heading.large,\n },\n display: {\n small: normalAmountSizes.heading.xlarge,\n medium: normalAmountSizes.heading['2xlarge'],\n large: normalAmountSizes.heading['2xlarge'],\n xlarge: normalAmountSizes.display.small,\n },\n};\n\nconst amountLineHeights: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof Typography['lineHeights']>>\n> = {\n body: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n heading: {\n small: 300,\n medium: 400,\n large: 500,\n xlarge: 600,\n '2xlarge': 700,\n },\n display: {\n small: 800,\n medium: 900,\n large: 1000,\n xlarge: 1100,\n },\n};\n\n// All the supported currency codes are taken from Razorpay's Merchant Dashboard codebase\nconst currencyIndicatorMapping = {\n AED: { 'currency-symbol': 'د.إ', 'currency-code': 'AED' },\n ALL: { 'currency-symbol': 'Lek', 'currency-code': 'ALL' },\n AMD: { 'currency-symbol': '֏', 'currency-code': 'AMD' },\n ARS: { 'currency-symbol': 'ARS', 'currency-code': 'ARS' },\n AUD: { 'currency-symbol': 'A$', 'currency-code': 'AUD' },\n AWG: { 'currency-symbol': 'Afl.', 'currency-code': 'AWG' },\n BBD: { 'currency-symbol': '$', 'currency-code': 'BBD' },\n BDT: { 'currency-symbol': '৳', 'currency-code': 'BDT' },\n BMD: { 'currency-symbol': '$', 'currency-code': 'BMD' },\n BND: { 'currency-symbol': 'BND', 'currency-code': 'BND' },\n BOB: { 'currency-symbol': 'Bs', 'currency-code': 'BOB' },\n BSD: { 'currency-symbol': 'B$', 'currency-code': 'BSD' },\n BWP: { 'currency-symbol': 'P', 'currency-code': 'BWP' },\n BZD: { 'currency-symbol': 'BZ$', 'currency-code': 'BZD' },\n CAD: { 'currency-symbol': 'C$', 'currency-code': 'CAD' },\n CHF: { 'currency-symbol': 'CHf', 'currency-code': 'CHF' },\n CNY: { 'currency-symbol': '¥', 'currency-code': 'CNY' },\n COP: { 'currency-symbol': 'COL$', 'currency-code': 'COP' },\n CRC: { 'currency-symbol': '₡', 'currency-code': 'CRC' },\n CUP: { 'currency-symbol': '$MN', 'currency-code': 'CUP' },\n CZK: { 'currency-symbol': 'Kč', 'currency-code': 'CZK' },\n DKK: { 'currency-symbol': 'DKK', 'currency-code': 'DKK' },\n DOP: { 'currency-symbol': 'RD$', 'currency-code': 'DOP' },\n DZD: { 'currency-symbol': 'د.ج', 'currency-code': 'DZD' },\n EGP: { 'currency-symbol': 'E£', 'currency-code': 'EGP' },\n ETB: { 'currency-symbol': 'ብር', 'currency-code': 'ETB' },\n EUR: { 'currency-symbol': '€', 'currency-code': 'EUR' },\n FJD: { 'currency-symbol': 'FJ$', 'currency-code': 'FJD' },\n GBP: { 'currency-symbol': '£', 'currency-code': 'GBP' },\n GHS: { 'currency-symbol': 'GH₵', 'currency-code': 'GHS' },\n GIP: { 'currency-symbol': 'GIP', 'currency-code': 'GIP' },\n GMD: { 'currency-symbol': 'D', 'currency-code': 'GMD' },\n GTQ: { 'currency-symbol': 'Q', 'currency-code': 'GTQ' },\n GYD: { 'currency-symbol': 'G$', 'currency-code': 'GYD' },\n HKD: { 'currency-symbol': 'HK$', 'currency-code': 'HKD' },\n HNL: { 'currency-symbol': 'HNL', 'currency-code': 'HNL' },\n HRK: { 'currency-symbol': 'kn', 'currency-code': 'HRK' },\n HTG: { 'currency-symbol': 'G', 'currency-code': 'HTG' },\n HUF: { 'currency-symbol': 'Ft', 'currency-code': 'HUF' },\n IDR: { 'currency-symbol': 'Rp', 'currency-code': 'IDR' },\n ILS: { 'currency-symbol': '₪', 'currency-code': 'ILS' },\n INR: { 'currency-symbol': '₹', 'currency-code': 'INR' },\n JMD: { 'currency-symbol': 'J$', 'currency-code': 'JMD' },\n KES: { 'currency-symbol': 'Ksh', 'currency-code': 'KES' },\n KGS: { 'currency-symbol': 'Лв', 'currency-code': 'KGS' },\n KHR: { 'currency-symbol': '៛', 'currency-code': 'KHR' },\n KYD: { 'currency-symbol': 'CI$', 'currency-code': 'KYD' },\n KZT: { 'currency-symbol': '₸', 'currency-code': 'KZT' },\n LAK: { 'currency-symbol': '₭', 'currency-code': 'LAK' },\n LKR: { 'currency-symbol': 'රු', 'currency-code': 'LKR' },\n LRD: { 'currency-symbol': 'L$', 'currency-code': 'LRD' },\n LSL: { 'currency-symbol': 'LSL', 'currency-code': 'LSL' },\n MAD: { 'currency-symbol': 'د.م.', 'currency-code': 'MAD' },\n MDL: { 'currency-symbol': 'MDL', 'currency-code': 'MDL' },\n MKD: { 'currency-symbol': 'ден', 'currency-code': 'MKD' },\n MMK: { 'currency-symbol': 'MMK', 'currency-code': 'MMK' },\n MNT: { 'currency-symbol': '₮', 'currency-code': 'MNT' },\n MOP: { 'currency-symbol': 'MOP$', 'currency-code': 'MOP' },\n MUR: { 'currency-symbol': '₨', 'currency-code': 'MUR' },\n MVR: { 'currency-symbol': 'Rf', 'currency-code': 'MVR' },\n MWK: { 'currency-symbol': 'MK', 'currency-code': 'MWK' },\n MXN: { 'currency-symbol': 'Mex$', 'currency-code': 'MXN' },\n MYR: { 'currency-symbol': 'RM', 'currency-code': 'MYR' },\n NAD: { 'currency-symbol': 'N$', 'currency-code': 'NAD' },\n NGN: { 'currency-symbol': '₦', 'currency-code': 'NGN' },\n NIO: { 'currency-symbol': 'NIO', 'currency-code': 'NIO' },\n NOK: { 'currency-symbol': 'NOK', 'currency-code': 'NOK' },\n NPR: { 'currency-symbol': 'रू', 'currency-code': 'NPR' },\n NZD: { 'currency-symbol': 'NZ$', 'currency-code': 'NZD' },\n PEN: { 'currency-symbol': 'S/', 'currency-code': 'PEN' },\n PGK: { 'currency-symbol': 'PGK', 'currency-code': 'PGK' },\n PHP: { 'currency-symbol': '₱', 'currency-code': 'PHP' },\n PKR: { 'currency-symbol': '₨', 'currency-code': 'PKR' },\n QAR: { 'currency-symbol': 'QR', 'currency-code': 'QAR' },\n RUB: { 'currency-symbol': '₽', 'currency-code': 'RUB' },\n SAR: { 'currency-symbol': 'SR', 'currency-code': 'SAR' },\n SCR: { 'currency-symbol': 'SRe', 'currency-code': 'SCR' },\n SEK: { 'currency-symbol': 'SEK', 'currency-code': 'SEK' },\n SGD: { 'currency-symbol': 'S$', 'currency-code': 'SGD' },\n SLL: { 'currency-symbol': 'Le', 'currency-code': 'SLL' },\n SOS: { 'currency-symbol': 'Sh.so.', 'currency-code': 'SOS' },\n SSP: { 'currency-symbol': 'SS£', 'currency-code': 'SSP' },\n SVC: { 'currency-symbol': '₡', 'currency-code': 'SVC' },\n SZL: { 'currency-symbol': 'E', 'currency-code': 'SZL' },\n THB: { 'currency-symbol': '฿', 'currency-code': 'THB' },\n TTD: { 'currency-symbol': 'TT$', 'currency-code': 'TTD' },\n TZS: { 'currency-symbol': 'Sh', 'currency-code': 'TZS' },\n USD: { 'currency-symbol': '$', 'currency-code': 'USD' },\n UYU: { 'currency-symbol': '$U', 'currency-code': 'UYU' },\n UZS: { 'currency-symbol': \"so'm\", 'currency-code': 'UZS' },\n YER: { 'currency-symbol': '﷼', 'currency-code': 'YER' },\n ZAR: { 'currency-symbol': 'R', 'currency-code': 'ZAR' },\n KWD: { 'currency-symbol': 'د.ك', 'currency-code': 'KWD' },\n BHD: { 'currency-symbol': 'د.ب.', 'currency-code': 'BHD' },\n OMR: { 'currency-symbol': 'ر.ع.', 'currency-code': 'OMR' },\n};\n\ntype CurrencyAbbreviation = {\n value: number;\n symbol: string;\n};\n\ntype Currency = keyof typeof currencyIndicatorMapping;\n\nconst getCurrencyAbbreviations = (currency: Currency): CurrencyAbbreviation[] => {\n if (currency === 'INR') {\n return [\n { value: 1e7, symbol: 'Cr' },\n { value: 1e5, symbol: 'L' },\n { value: 1e3, symbol: 'k' },\n ];\n }\n\n return [\n { value: 1e9, symbol: 'B' },\n { value: 1e6, symbol: 'M' },\n { value: 1e3, symbol: 'K' },\n ];\n};\n\nconst currencyPositionMapping: Record<string, string> = {\n DZD: 'right',\n BHD: 'right',\n OMR: 'right',\n KWD: 'right',\n};\n\nexport {\n subtleFontSizes,\n normalAmountSizes,\n amountLineHeights,\n currencyPositionMapping,\n currencyIndicatorMapping,\n getCurrencyAbbreviations,\n};\n\nexport type { Currency, AmountBodyProps, AmountDisplayProps, AmountHeadingProps, AmountTypeProps };\n"],"names":["normalAmountSizes","body","xsmall","small","medium","large","heading","xlarge","display","subtleFontSizes","amountLineHeights","currencyIndicatorMapping","AED","ALL","AMD","ARS","AUD","AWG","BBD","BDT","BMD","BND","BOB","BSD","BWP","BZD","CAD","CHF","CNY","COP","CRC","CUP","CZK","DKK","DOP","DZD","EGP","ETB","EUR","FJD","GBP","GHS","GIP","GMD","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","JMD","KES","KGS","KHR","KYD","KZT","LAK","LKR","LRD","LSL","MAD","MDL","MKD","MMK","MNT","MOP","MUR","MVR","MWK","MXN","MYR","NAD","NGN","NIO","NOK","NPR","NZD","PEN","PGK","PHP","PKR","QAR","RUB","SAR","SCR","SEK","SGD","SLL","SOS","SSP","SVC","SZL","THB","TTD","TZS","USD","UYU","UZS","YER","ZAR","KWD","BHD","OMR","getCurrencyAbbreviations","currency","value","symbol","currencyPositionMapping"],"mappings":"AAyBA,IAAMA,iBAGL,GAAG;AACFC,EAAAA,IAAI,EAAE;AACJC,IAAAA,MAAM,EAAE,EAAE;AACVC,IAAAA,KAAK,EAAE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AK,KAAK,EAAE;AACtB,IAAA,OAAO,CACL;AAAEC,MAAAA,KAAK,EAAE,GAAG;AAAEC,MAAAA,MAAM,EAAE,IAAA;AAAK,KAAC,EAC5B;AAAED,MAAAA,KAAK,EAAE,GAAG;AAAEC,MAAAA,MAAM,EAAE,GAAA;AAAI,KAAC,EAC3B;AAAED,MAAAA,KAAK,EAAE,GAAG;AAAEC,MAAAA,MAAM,EAAE,GAAA;AAAI,KAAC,CAC5B,CAAA;AACH,GAAA;AAEA,EAAA,OAAO,CACL;AAAED,IAAAA,KAAK,EAAE,GAAG;AAAEC,IAAAA,MAAM,EAAE,GAAA;AAAI,GAAC,EAC3B;AAAED,IAAAA,KAAK,EAAE,GAAG;AAAEC,IAAAA,MAAM,EAAE,GAAA;AAAI,GAAC,EAC3B;AAAED,IAAAA,KAAK,EAAE,GAAG;AAAEC,IAAAA,MAAM,EAAE,GAAA;AAAI,GAAC,CAC5B,CAAA;AACH,EAAC;AAED,IAAMC,uBAA+C,GAAG;AACtD5E,EAAAA,GAAG,EAAE,OAAO;AACZsE,EAAAA,GAAG,EAAE,OAAO;AACZC,EAAAA,GAAG,EAAE,OAAO;AACZF,EAAAA,GAAG,EAAE,OAAA;AACP;;;;"}
|
|
1
|
+
{"version":3,"file":"amountTokens.js","sources":["../../../../../../src/components/Amount/amountTokens.ts"],"sourcesContent":["import type { FontSize, Typography } from '~tokens/global';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\n\ntype AmountSizes = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge';\n\ntype AmountDisplayProps = {\n type?: 'display';\n size?: Extract<AmountSizes, 'small' | 'medium' | 'large' | 'xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n};\n\ntype AmountHeadingProps = {\n type?: 'heading';\n size?: Extract<AmountSizes, 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'semibold'>;\n};\n\ntype AmountBodyProps = {\n type?: 'body';\n size?: Extract<AmountSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n};\n\ntype AmountTypeProps = AmountDisplayProps | AmountHeadingProps | AmountBodyProps;\n\nconst normalAmountSizes: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof FontSize>>\n> = {\n body: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n heading: {\n small: 300,\n medium: 400,\n large: 500,\n xlarge: 600,\n '2xlarge': 700,\n },\n display: {\n small: 800,\n medium: 900,\n large: 1000,\n xlarge: 1100,\n },\n};\n\nconst subtleFontSizes: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof FontSize>>\n> = {\n body: {\n xsmall: normalAmountSizes.body.xsmall,\n small: normalAmountSizes.body.xsmall,\n medium: normalAmountSizes.body.xsmall,\n large: normalAmountSizes.body.small,\n },\n heading: {\n small: normalAmountSizes.body.small,\n medium: normalAmountSizes.body.medium,\n large: normalAmountSizes.body.large,\n xlarge: normalAmountSizes.heading.medium,\n '2xlarge': normalAmountSizes.heading.large,\n },\n display: {\n small: normalAmountSizes.heading.xlarge,\n medium: normalAmountSizes.heading['2xlarge'],\n large: normalAmountSizes.heading['2xlarge'],\n xlarge: normalAmountSizes.display.small,\n },\n};\n\nconst amountLineHeights: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof Typography['lineHeights']>>\n> = {\n body: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n heading: {\n small: 300,\n medium: 400,\n large: 500,\n xlarge: 600,\n '2xlarge': 700,\n },\n display: {\n small: 800,\n medium: 900,\n large: 1000,\n xlarge: 1100,\n },\n};\n\nexport { subtleFontSizes, normalAmountSizes, amountLineHeights };\n\nexport type { AmountBodyProps, AmountDisplayProps, AmountHeadingProps, AmountTypeProps };\n"],"names":["normalAmountSizes","body","xsmall","small","medium","large","heading","xlarge","display","subtleFontSizes","amountLineHeights"],"mappings":"AAyBA,IAAMA,iBAGL,GAAG;AACFC,EAAAA,IAAI,EAAE;AACJC,IAAAA,MAAM,EAAE,EAAE;AACVC,IAAAA,KAAK,EAAE,EAAE;AACTC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,KAAK,EAAE,GAAA;GACR;AACDC,EAAAA,OAAO,EAAE;AACPH,IAAAA,KAAK,EAAE,GAAG;AACVC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,KAAK,EAAE,GAAG;AACVE,IAAAA,MAAM,EAAE,GAAG;AACX,IAAA,SAAS,EAAE,GAAA;GACZ;AACDC,EAAAA,OAAO,EAAE;AACPL,IAAAA,KAAK,EAAE,GAAG;AACVC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,KAAK,EAAE,IAAI;AACXE,IAAAA,MAAM,EAAE,IAAA;AACV,GAAA;AACF,EAAC;AAED,IAAME,eAGL,GAAG;AACFR,EAAAA,IAAI,EAAE;AACJC,IAAAA,MAAM,EAAEF,iBAAiB,CAACC,IAAI,CAACC,MAAM;AACrCC,IAAAA,KAAK,EAAEH,iBAAiB,CAACC,IAAI,CAACC,MAAM;AACpCE,IAAAA,MAAM,EAAEJ,iBAAiB,CAACC,IAAI,CAACC,MAAM;AACrCG,IAAAA,KAAK,EAAEL,iBAAiB,CAACC,IAAI,CAACE,KAAAA;GAC/B;AACDG,EAAAA,OAAO,EAAE;AACPH,IAAAA,KAAK,EAAEH,iBAAiB,CAACC,IAAI,CAACE,KAAK;AACnCC,IAAAA,MAAM,EAAEJ,iBAAiB,CAACC,IAAI,CAACG,MAAM;AACrCC,IAAAA,KAAK,EAAEL,iBAAiB,CAACC,IAAI,CAACI,KAAK;AACnCE,IAAAA,MAAM,EAAEP,iBAAiB,CAACM,OAAO,CAACF,MAAM;AACxC,IAAA,SA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