@razorpay/blade 12.63.0 → 12.65.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/Badge/Badge.js +1 -1
- package/build/lib/native/components/Badge/Badge.js.map +1 -1
- package/build/lib/native/components/Badge/badgeTokens.js +1 -1
- package/build/lib/native/components/Badge/badgeTokens.js.map +1 -1
- package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponentsContext.js +6 -0
- package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponentsContext.js.map +1 -0
- package/build/lib/native/components/Charts/CommonChartComponents/tokens.js +4 -0
- package/build/lib/native/components/Charts/CommonChartComponents/tokens.js.map +1 -0
- package/build/lib/native/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputTokens.js +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputTokens.js.map +1 -1
- package/build/lib/native/components/QuickFilters/QuickFilter.js +1 -1
- package/build/lib/native/components/QuickFilters/QuickFilter.js.map +1 -1
- package/build/lib/native/components/Radio/Radio.js +1 -1
- package/build/lib/native/components/Radio/Radio.js.map +1 -1
- package/build/lib/native/components/Table/TableContext.js +1 -1
- package/build/lib/native/components/Table/TableContext.js.map +1 -1
- package/build/lib/native/components/Table/tokens.js +1 -1
- package/build/lib/native/components/Table/tokens.js.map +1 -1
- package/build/lib/native/components/index.js +2 -0
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/tokens/global/colors.js +1 -1
- package/build/lib/native/tokens/global/colors.js.map +1 -1
- package/build/lib/native/tokens/global/size.js +1 -1
- package/build/lib/native/tokens/global/size.js.map +1 -1
- package/build/lib/native/tokens/theme/bladeTheme.js +1 -1
- package/build/lib/native/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/native/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/development/components/Badge/Badge.js +4 -0
- package/build/lib/web/development/components/Badge/Badge.js.map +1 -1
- package/build/lib/web/development/components/Badge/badgeTokens.js +4 -0
- package/build/lib/web/development/components/Badge/badgeTokens.js.map +1 -1
- package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js +140 -38
- package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/BarChart/BarChart.web.js +121 -57
- package/build/lib/web/development/components/Charts/BarChart/BarChart.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js +145 -92
- package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponentsContext.js +15 -0
- package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponentsContext.js.map +1 -0
- package/build/lib/web/development/components/Charts/CommonChartComponents/index.js +2 -0
- package/build/lib/web/development/components/Charts/CommonChartComponents/index.js.map +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js +2 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/web/development/components/Charts/DonutChart/DonutChart.web.js +202 -69
- package/build/lib/web/development/components/Charts/DonutChart/DonutChart.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js +84 -32
- package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js +33 -0
- package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/index.js +2 -0
- package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/index.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/getHighestColorInRange.js +53 -0
- package/build/lib/web/development/components/Charts/utils/getHighestColorInRange.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/index.js +5 -0
- package/build/lib/web/development/components/Charts/utils/index.js.map +1 -1
- package/build/lib/web/development/components/Charts/utils/isSequentialColor.js +35 -0
- package/build/lib/web/development/components/Charts/utils/isSequentialColor.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/sanitizeString/index.js +2 -0
- package/build/lib/web/development/components/Charts/utils/sanitizeString/index.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/sanitizeString/sanitizeString.js +30 -0
- package/build/lib/web/development/components/Charts/utils/sanitizeString/sanitizeString.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/tokens.js +7 -0
- package/build/lib/web/development/components/Charts/utils/tokens.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/useColorTheme.js +32 -11
- package/build/lib/web/development/components/Charts/utils/useColorTheme.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js +3 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js +8 -9
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/development/components/FilterChip/tokens.js +1 -1
- package/build/lib/web/development/components/FilterChip/tokens.js.map +1 -1
- package/build/lib/web/development/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +2 -0
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js +11 -0
- package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js.map +1 -1
- package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js +1 -0
- package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/development/components/ListView/ListViewFilters.web.js +13 -102
- package/build/lib/web/development/components/ListView/ListViewFilters.web.js.map +1 -1
- package/build/lib/web/development/components/QuickFilters/QuickFilter.js +2 -1
- package/build/lib/web/development/components/QuickFilters/QuickFilter.js.map +1 -1
- package/build/lib/web/development/components/Radio/Radio.js +4 -2
- package/build/lib/web/development/components/Radio/Radio.js.map +1 -1
- package/build/lib/web/development/components/Table/Table.web.js +3 -1
- package/build/lib/web/development/components/Table/Table.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableBody.web.js +2 -1
- package/build/lib/web/development/components/Table/TableBody.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableContext.js +2 -1
- package/build/lib/web/development/components/Table/TableContext.js.map +1 -1
- package/build/lib/web/development/components/Table/TableFooter.web.js +2 -1
- package/build/lib/web/development/components/Table/TableFooter.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableHeader.web.js +78 -68
- package/build/lib/web/development/components/Table/TableHeader.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TablePagination.web.js +5 -2
- package/build/lib/web/development/components/Table/TablePagination.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableToolbar.web.js +15 -13
- package/build/lib/web/development/components/Table/TableToolbar.web.js.map +1 -1
- package/build/lib/web/development/components/Table/tokens.js +11 -8
- package/build/lib/web/development/components/Table/tokens.js.map +1 -1
- package/build/lib/web/development/components/index.js +2 -0
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/tokens/global/colors.js +48 -48
- package/build/lib/web/development/tokens/global/colors.js.map +1 -1
- package/build/lib/web/development/tokens/global/size.js +2 -0
- package/build/lib/web/development/tokens/global/size.js.map +1 -1
- package/build/lib/web/development/tokens/theme/bladeTheme.js +139 -111
- package/build/lib/web/development/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/web/development/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/production/components/Badge/Badge.js +4 -0
- package/build/lib/web/production/components/Badge/Badge.js.map +1 -1
- package/build/lib/web/production/components/Badge/badgeTokens.js +4 -0
- package/build/lib/web/production/components/Badge/badgeTokens.js.map +1 -1
- package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js +140 -38
- package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/BarChart/BarChart.web.js +121 -57
- package/build/lib/web/production/components/Charts/BarChart/BarChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js +145 -92
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponentsContext.js +15 -0
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponentsContext.js.map +1 -0
- package/build/lib/web/production/components/Charts/CommonChartComponents/index.js +2 -0
- package/build/lib/web/production/components/Charts/CommonChartComponents/index.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js +2 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/web/production/components/Charts/DonutChart/DonutChart.web.js +202 -69
- package/build/lib/web/production/components/Charts/DonutChart/DonutChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js +84 -32
- package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js +33 -0
- package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/index.js +2 -0
- package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/index.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/getHighestColorInRange.js +53 -0
- package/build/lib/web/production/components/Charts/utils/getHighestColorInRange.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/index.js +5 -0
- package/build/lib/web/production/components/Charts/utils/index.js.map +1 -1
- package/build/lib/web/production/components/Charts/utils/isSequentialColor.js +35 -0
- package/build/lib/web/production/components/Charts/utils/isSequentialColor.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/sanitizeString/index.js +2 -0
- package/build/lib/web/production/components/Charts/utils/sanitizeString/index.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/sanitizeString/sanitizeString.js +30 -0
- package/build/lib/web/production/components/Charts/utils/sanitizeString/sanitizeString.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/tokens.js +7 -0
- package/build/lib/web/production/components/Charts/utils/tokens.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/useColorTheme.js +32 -11
- package/build/lib/web/production/components/Charts/utils/useColorTheme.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js +3 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js +8 -9
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/production/components/FilterChip/tokens.js +1 -1
- package/build/lib/web/production/components/FilterChip/tokens.js.map +1 -1
- package/build/lib/web/production/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +2 -0
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js +11 -0
- package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js.map +1 -1
- package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js +1 -0
- package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/production/components/ListView/ListViewFilters.web.js +13 -102
- package/build/lib/web/production/components/ListView/ListViewFilters.web.js.map +1 -1
- package/build/lib/web/production/components/QuickFilters/QuickFilter.js +2 -1
- package/build/lib/web/production/components/QuickFilters/QuickFilter.js.map +1 -1
- package/build/lib/web/production/components/Radio/Radio.js +4 -2
- package/build/lib/web/production/components/Radio/Radio.js.map +1 -1
- package/build/lib/web/production/components/Table/Table.web.js +3 -1
- package/build/lib/web/production/components/Table/Table.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableBody.web.js +2 -1
- package/build/lib/web/production/components/Table/TableBody.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableContext.js +2 -1
- package/build/lib/web/production/components/Table/TableContext.js.map +1 -1
- package/build/lib/web/production/components/Table/TableFooter.web.js +2 -1
- package/build/lib/web/production/components/Table/TableFooter.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableHeader.web.js +78 -68
- package/build/lib/web/production/components/Table/TableHeader.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TablePagination.web.js +5 -2
- package/build/lib/web/production/components/Table/TablePagination.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableToolbar.web.js +15 -13
- package/build/lib/web/production/components/Table/TableToolbar.web.js.map +1 -1
- package/build/lib/web/production/components/Table/tokens.js +11 -8
- package/build/lib/web/production/components/Table/tokens.js.map +1 -1
- package/build/lib/web/production/components/index.js +2 -0
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/tokens/global/colors.js +48 -48
- package/build/lib/web/production/tokens/global/colors.js.map +1 -1
- package/build/lib/web/production/tokens/global/size.js +2 -0
- package/build/lib/web/production/tokens/global/size.js.map +1 -1
- package/build/lib/web/production/tokens/theme/bladeTheme.js +139 -111
- package/build/lib/web/production/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/web/production/tokens/theme/theme.js.map +1 -1
- package/build/types/components/index.d.ts +109 -23
- package/build/types/components/index.native.d.ts +106 -20
- package/build/types/tokens/index.d.ts +8 -6
- package/build/types/tokens/index.native.d.ts +8 -6
- package/build/types/utils/index.d.ts +29 -6
- package/build/types/utils/index.native.d.ts +29 -6
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":["../../../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport type { StyledBadgeProps } from './types';\nimport { StyledBadge } from './StyledBadge';\nimport { iconPadding, iconSize, horizontalPadding, badgeHeight } from './badgeTokens';\nimport type { IconComponent, IconProps } from '~components/Icons';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { FeedbackColors, SubtleOrIntense } from '~tokens/theme/theme';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { Text } from '~components/Typography';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type {\n DataAnalyticsAttribute,\n BladeElementRef,\n StringChildrenType,\n TestID,\n} from '~utils/types';\nimport { getStringFromReactText } from '~src/utils/getStringChildren';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { isReactNative, makeSize } from '~utils';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype BadgeProps = {\n /**\n * Sets the label for the badge.\n *\n */\n children: StringChildrenType;\n /**\n * Sets the color of the badge.\n *\n * @default 'neutral'\n */\n color?: FeedbackColors | 'primary';\n /**\n * Sets the contrast of the badge.\n *\n * @default 'subtle'\n */\n emphasis?: SubtleOrIntense;\n /**\n * Sets the size of the badge.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Icon to be displayed in the badge.\n * Accepts a component of type `IconComponent` from Blade.\n *\n */\n icon?: IconComponent;\n} & TestID &\n StyledPropsBlade &\n DataAnalyticsAttribute;\n\ntype ColorProps = {\n iconColor: IconProps['color'];\n textColor: BaseTextProps['color'];\n backgroundColor: StyledBadgeProps['backgroundColor'];\n};\n\nconst getColorProps = ({\n color,\n emphasis,\n}: {\n color: NonNullable<BadgeProps['color']>;\n emphasis: NonNullable<BadgeProps['emphasis']>;\n}): ColorProps => {\n const props: ColorProps = {\n iconColor: 'feedback.icon.neutral.intense',\n textColor: 'feedback.text.neutral.intense',\n backgroundColor: 'feedback.background.neutral.subtle',\n };\n\n if (color === 'primary') {\n // primary color badge\n props.textColor =\n emphasis === 'intense' ? `surface.text.staticWhite.normal` : `surface.text.primary.normal`;\n props.iconColor =\n emphasis === 'intense' ? `surface.icon.staticWhite.normal` : `surface.icon.primary.normal`;\n props.backgroundColor = `surface.background.primary.${emphasis}`;\n } else {\n // feedback colors badge\n props.textColor =\n emphasis === 'intense' ? `surface.text.staticWhite.normal` : `feedback.text.${color}.intense`;\n props.iconColor =\n emphasis === 'intense' ? `surface.icon.staticWhite.normal` : `feedback.icon.${color}.intense`;\n props.backgroundColor = `feedback.background.${color}.${emphasis}`;\n }\n\n return props;\n};\n\nconst _Badge = (\n {\n children,\n emphasis = 'subtle',\n icon: Icon,\n size = 'medium',\n color = 'neutral',\n testID,\n ...props\n }: BadgeProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const childrenString = getStringFromReactText(children);\n if (__DEV__) {\n if (!childrenString?.trim()) {\n throwBladeError({\n message: 'Text as children is required for Badge.',\n moduleName: 'Badge',\n });\n }\n }\n\n const { backgroundColor, iconColor, textColor } = getColorProps({\n color,\n emphasis,\n });\n\n const badgeTextSizes = {\n small: {\n variant: 'body',\n size: 'xsmall',\n },\n medium: {\n variant: 'body',\n size: 'small',\n },\n large: {\n variant: 'body',\n size: 'small',\n },\n } as const;\n\n return (\n <BaseBox\n ref={ref as never}\n display={(isReactNative() ? 'flex' : 'inline-flex') as never}\n {...metaAttribute({ name: MetaConstants.Badge, testID })}\n {...getStyledProps(props)}\n {...makeAnalyticsAttribute(props)}\n >\n <StyledBadge\n height={makeSize(badgeHeight[size])}\n backgroundColor={backgroundColor}\n size={size}\n textAlign={'left' as never}\n >\n <BaseBox\n paddingX={horizontalPadding[size]}\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent=\"center\"\n alignItems=\"center\"\n overflow=\"hidden\"\n >\n {Icon ? (\n <BaseBox paddingRight={Boolean(Icon) ? iconPadding[size] : 'spacing.0'} display=\"flex\">\n <Icon color={iconColor} size={iconSize[size]} />\n </BaseBox>\n ) : null}\n <Text {...badgeTextSizes[size]} weight=\"medium\" truncateAfterLines={1} color={textColor}>\n {children}\n </Text>\n </BaseBox>\n </StyledBadge>\n </BaseBox>\n );\n};\n\nconst Badge = assignWithoutSideEffects(React.forwardRef(_Badge), {\n displayName: 'Badge',\n componentId: 'Badge',\n});\n\nexport type { BadgeProps };\nexport { Badge };\n"],"names":["getColorProps","_ref","color","emphasis","props","iconColor","textColor","backgroundColor","concat","_Badge","_ref2","ref","children","_ref2$emphasis","Icon","icon","_ref2$size","size","_ref2$color","testID","_objectWithoutProperties","_excluded","childrenString","getStringFromReactText","trim","throwBladeError","message","moduleName","_getColorProps","badgeTextSizes","small","variant","medium","large","_jsx","BaseBox","_objectSpread","display","isReactNative","metaAttribute","name","MetaConstants","Badge","getStyledProps","makeAnalyticsAttribute","StyledBadge","height","makeSize","badgeHeight","textAlign","_jsxs","paddingX","horizontalPadding","flexDirection","justifyContent","alignItems","overflow","paddingRight","Boolean","iconPadding","iconSize","Text","weight","truncateAfterLines","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAMD;AAAA,EAAA,IALhBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,QAAQ,GAAAF,IAAA,CAARE,QAAQ,CAAA;AAKR,EAAA,IAAMC,KAAiB,GAAG;AACxBC,IAAAA,SAAS,EAAE,+BAA+B;AAC1CC,IAAAA,SAAS,EAAE,+BAA+B;AAC1CC,IAAAA,eAAe,EAAE,oCAAA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AAA,CAAA,EAAA,EAAKP,cAAc,CAACZ,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAAE6C,UAAAA,MAAM,EAAC,QAAQ;AAACC,UAAAA,kBAAkB,EAAE,CAAE;AAAC7D,UAAAA,KAAK,EAAEI,SAAU;AAAAM,UAAAA,QAAA,EACrFA,QAAAA;AAAQ,SAAA,CACL,CAAC,CAAA;OACA,CAAA;KACE,CAAA;AAAC,GAAA,CACP,CAAC,CAAA;AAEd,CAAC,CAAA;AAEK8B,IAAAA,KAAK,gBAAGsB,wBAAwB,cAACC,cAAK,CAACC,UAAU,CAACzD,MAAM,CAAC,EAAE;AAC/D0D,EAAAA,WAAW,EAAE,OAAO;AACpBC,EAAAA,WAAW,EAAE,OAAA;AACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../../../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport type { StyledBadgeProps } from './types';\nimport { StyledBadge } from './StyledBadge';\nimport { iconPadding, iconSize, horizontalPadding, badgeHeight } from './badgeTokens';\nimport type { IconComponent, IconProps } from '~components/Icons';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { FeedbackColors, SubtleOrIntense } from '~tokens/theme/theme';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { Text } from '~components/Typography';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type {\n DataAnalyticsAttribute,\n BladeElementRef,\n StringChildrenType,\n TestID,\n} from '~utils/types';\nimport { getStringFromReactText } from '~src/utils/getStringChildren';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { isReactNative, makeSize } from '~utils';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype BadgeProps = {\n /**\n * Sets the label for the badge.\n *\n */\n children: StringChildrenType;\n /**\n * Sets the color of the badge.\n *\n * @default 'neutral'\n */\n color?: FeedbackColors | 'primary';\n /**\n * Sets the contrast of the badge.\n *\n * @default 'subtle'\n */\n emphasis?: SubtleOrIntense;\n /**\n * Sets the size of the badge.\n *\n * @default 'medium'\n */\n size?: 'xsmall' | 'small' | 'medium' | 'large';\n /**\n * Icon to be displayed in the badge.\n * Accepts a component of type `IconComponent` from Blade.\n *\n */\n icon?: IconComponent;\n} & TestID &\n StyledPropsBlade &\n DataAnalyticsAttribute;\n\ntype ColorProps = {\n iconColor: IconProps['color'];\n textColor: BaseTextProps['color'];\n backgroundColor: StyledBadgeProps['backgroundColor'];\n};\n\nconst getColorProps = ({\n color,\n emphasis,\n}: {\n color: NonNullable<BadgeProps['color']>;\n emphasis: NonNullable<BadgeProps['emphasis']>;\n}): ColorProps => {\n const props: ColorProps = {\n iconColor: 'feedback.icon.neutral.intense',\n textColor: 'feedback.text.neutral.intense',\n backgroundColor: 'feedback.background.neutral.subtle',\n };\n\n if (color === 'primary') {\n // primary color badge\n props.textColor =\n emphasis === 'intense' ? `surface.text.staticWhite.normal` : `surface.text.primary.normal`;\n props.iconColor =\n emphasis === 'intense' ? `surface.icon.staticWhite.normal` : `surface.icon.primary.normal`;\n props.backgroundColor = `surface.background.primary.${emphasis}`;\n } else {\n // feedback colors badge\n props.textColor =\n emphasis === 'intense' ? `surface.text.staticWhite.normal` : `feedback.text.${color}.intense`;\n props.iconColor =\n emphasis === 'intense' ? `surface.icon.staticWhite.normal` : `feedback.icon.${color}.intense`;\n props.backgroundColor = `feedback.background.${color}.${emphasis}`;\n }\n\n return props;\n};\n\nconst _Badge = (\n {\n children,\n emphasis = 'subtle',\n icon: Icon,\n size = 'medium',\n color = 'neutral',\n testID,\n ...props\n }: BadgeProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const childrenString = getStringFromReactText(children);\n if (__DEV__) {\n if (!childrenString?.trim()) {\n throwBladeError({\n message: 'Text as children is required for Badge.',\n moduleName: 'Badge',\n });\n }\n }\n\n const { backgroundColor, iconColor, textColor } = getColorProps({\n color,\n emphasis,\n });\n\n const badgeTextSizes = {\n xsmall: {\n variant: 'body',\n size: 'xsmall',\n },\n small: {\n variant: 'body',\n size: 'xsmall',\n },\n medium: {\n variant: 'body',\n size: 'small',\n },\n large: {\n variant: 'body',\n size: 'small',\n },\n } as const;\n\n return (\n <BaseBox\n ref={ref as never}\n display={(isReactNative() ? 'flex' : 'inline-flex') as never}\n {...metaAttribute({ name: MetaConstants.Badge, testID })}\n {...getStyledProps(props)}\n {...makeAnalyticsAttribute(props)}\n >\n <StyledBadge\n height={makeSize(badgeHeight[size])}\n backgroundColor={backgroundColor}\n size={size}\n textAlign={'left' as never}\n >\n <BaseBox\n paddingX={horizontalPadding[size]}\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent=\"center\"\n alignItems=\"center\"\n overflow=\"hidden\"\n >\n {Icon ? (\n <BaseBox paddingRight={Boolean(Icon) ? iconPadding[size] : 'spacing.0'} display=\"flex\">\n <Icon color={iconColor} size={iconSize[size]} />\n </BaseBox>\n ) : null}\n <Text {...badgeTextSizes[size]} weight=\"medium\" truncateAfterLines={1} color={textColor}>\n {children}\n </Text>\n </BaseBox>\n </StyledBadge>\n </BaseBox>\n );\n};\n\nconst Badge = assignWithoutSideEffects(React.forwardRef(_Badge), {\n displayName: 'Badge',\n componentId: 'Badge',\n});\n\nexport type { BadgeProps };\nexport { Badge };\n"],"names":["getColorProps","_ref","color","emphasis","props","iconColor","textColor","backgroundColor","concat","_Badge","_ref2","ref","children","_ref2$emphasis","Icon","icon","_ref2$size","size","_ref2$color","testID","_objectWithoutProperties","_excluded","childrenString","getStringFromReactText","trim","throwBladeError","message","moduleName","_getColorProps","badgeTextSizes","xsmall","variant","small","medium","large","_jsx","BaseBox","_objectSpread","display","isReactNative","metaAttribute","name","MetaConstants","Badge","getStyledProps","makeAnalyticsAttribute","StyledBadge","height","makeSize","badgeHeight","textAlign","_jsxs","paddingX","horizontalPadding","flexDirection","justifyContent","alignItems","overflow","paddingRight","Boolean","iconPadding","iconSize","Text","weight","truncateAfterLines","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAMD;AAAA,EAAA,IALhBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,QAAQ,GAAAF,IAAA,CAARE,QAAQ,CAAA;AAKR,EAAA,IAAMC,KAAiB,GAAG;AACxBC,IAAAA,SAAS,EAAE,+BAA+B;AAC1CC,IAAAA,SAAS,EAAE,+BAA+B;AAC1CC,IAAAA,eAAe,EAAE,oCAAA;GAClB,CAAA;EAED,IAAIL,KAAK,KAAK,SAAS,EAAE;AACvB;AACAE,IAAAA,KAAK,CAACE,SAAS,GACbH,QAAQ,KAAK,SAAS,GAAoE,iCAAA,GAAA,6BAAA,CAAA;AAC5FC,IAAAA,KAAK,CAACC,SAAS,GACbF,QAAQ,KAAK,SAAS,GAAoE,iCAAA,GAAA,6BAAA,CAAA;AAC5FC,IAAAA,KAAK,CAACG,eAAe,GAAA,6BAAA,CAAAC,MAAA,CAAiCL,QAAQ,CAAE,CAAA;AAClE,GAAC,MAAM;AACL;IACAC,KAAK,CAACE,SAAS,GACbH,QAAQ,KAAK,SAAS,GAAAK,iCAAAA,GAAAA,gBAAAA,CAAAA,MAAA,CAAwDN,KAAK,EAAU,UAAA,CAAA,CAAA;IAC/FE,KAAK,CAACC,SAAS,GACbF,QAAQ,KAAK,SAAS,GAAAK,iCAAAA,GAAAA,gBAAAA,CAAAA,MAAA,CAAwDN,KAAK,EAAU,UAAA,CAAA,CAAA;IAC/FE,KAAK,CAACG,eAAe,GAAA,sBAAA,CAAAC,MAAA,CAA0BN,KAAK,EAAAM,GAAAA,CAAAA,CAAAA,MAAA,CAAIL,QAAQ,CAAE,CAAA;AACpE,GAAA;AAEA,EA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|
7
8
|
};
|
|
8
9
|
var horizontalPadding = {
|
|
10
|
+
xsmall: 'spacing.2',
|
|
9
11
|
small: 'spacing.3',
|
|
10
12
|
medium: 'spacing.3',
|
|
11
13
|
large: 'spacing.4'
|
|
12
14
|
};
|
|
13
15
|
var iconPadding = {
|
|
16
|
+
xsmall: 'spacing.1',
|
|
14
17
|
small: 'spacing.1',
|
|
15
18
|
medium: 'spacing.2',
|
|
16
19
|
large: 'spacing.2'
|
|
17
20
|
};
|
|
18
21
|
var iconSize = {
|
|
22
|
+
xsmall: 'xsmall',
|
|
19
23
|
small: 'xsmall',
|
|
20
24
|
medium: 'small',
|
|
21
25
|
large: 'small'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badgeTokens.js","sources":["../../../../../../src/components/Badge/badgeTokens.ts"],"sourcesContent":["import type { BadgeProps } from './Badge';\nimport type { DotNotationSpacingStringToken } from '~utils/types';\nimport type { IconProps } from '~components/Icons';\nimport { size } from '~tokens/global/size';\n\nconst badgeHeight: Record<NonNullable<BadgeProps['size']>, number> = {\n small: size[16],\n medium: size[20],\n large: size[24],\n};\n\nconst horizontalPadding: Record<NonNullable<BadgeProps['size']>, DotNotationSpacingStringToken> = {\n small: 'spacing.3',\n medium: 'spacing.3',\n large: 'spacing.4',\n};\n\nconst iconPadding: Record<NonNullable<BadgeProps['size']>, DotNotationSpacingStringToken> = {\n small: 'spacing.1',\n medium: 'spacing.2',\n large: 'spacing.2',\n};\n\nconst iconSize: Record<NonNullable<BadgeProps['size']>, IconProps['size']> = {\n small: 'xsmall',\n medium: 'small',\n large: 'small',\n};\n\nexport { badgeHeight, horizontalPadding, iconPadding, iconSize };\n"],"names":["badgeHeight","
|
|
1
|
+
{"version":3,"file":"badgeTokens.js","sources":["../../../../../../src/components/Badge/badgeTokens.ts"],"sourcesContent":["import type { BadgeProps } from './Badge';\nimport type { DotNotationSpacingStringToken } from '~utils/types';\nimport type { IconProps } from '~components/Icons';\nimport { size } from '~tokens/global/size';\n\nconst badgeHeight: Record<NonNullable<BadgeProps['size']>, number> = {\n xsmall: size[14],\n small: size[16],\n medium: size[20],\n large: size[24],\n};\n\nconst horizontalPadding: Record<NonNullable<BadgeProps['size']>, DotNotationSpacingStringToken> = {\n xsmall: 'spacing.2',\n small: 'spacing.3',\n medium: 'spacing.3',\n large: 'spacing.4',\n};\n\nconst iconPadding: Record<NonNullable<BadgeProps['size']>, DotNotationSpacingStringToken> = {\n xsmall: 'spacing.1',\n small: 'spacing.1',\n medium: 'spacing.2',\n large: 'spacing.2',\n};\n\nconst iconSize: Record<NonNullable<BadgeProps['size']>, IconProps['size']> = {\n xsmall: 'xsmall',\n small: 'xsmall',\n medium: 'small',\n large: 'small',\n};\n\nexport { badgeHeight, horizontalPadding, iconPadding, iconSize };\n"],"names":["badgeHeight","xsmall","size","small","medium","large","horizontalPadding","iconPadding","iconSize"],"mappings":";;AAKA,IAAMA,WAA4D,GAAG;AACnEC,EAAAA,MAAM,EAAEC,IAAI,CAAC,EAAE,CAAC;AAChBC,EAAAA,KAAK,EAAED,IAAI,CAAC,EAAE,CAAC;AACfE,EAAAA,MAAM,EAAEF,IAAI,CAAC,EAAE,CAAC;EAChBG,KAAK,EAAEH,IAAI,CAAC,EAAE,CAAA;AAChB,EAAC;AAED,IAAMI,iBAAyF,GAAG;AAChGL,EAAAA,MAAM,EAAE,WAAW;AACnBE,EAAAA,KAAK,EAAE,WAAW;AAClBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,KAAK,EAAE,WAAA;AACT,EAAC;AAED,IAAME,WAAmF,GAAG;AAC1FN,EAAAA,MAAM,EAAE,WAAW;AACnBE,EAAAA,KAAK,EAAE,WAAW;AAClBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,KAAK,EAAE,WAAA;AACT,EAAC;AAED,IAAMG,QAAoE,GAAG;AAC3EP,EAAAA,MAAM,EAAE,QAAQ;AAChBE,EAAAA,KAAK,EAAE,QAAQ;AACfC,EAAAA,MAAM,EAAE,OAAO;AACfC,EAAAA,KAAK,EAAE,OAAA;AACT;;;;"}
|
|
@@ -3,6 +3,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { Area as Area$1, ResponsiveContainer, AreaChart } from 'recharts';
|
|
5
5
|
import '../utils/index.js';
|
|
6
|
+
import '../CommonChartComponents/index.js';
|
|
6
7
|
import { componentIds } from './componentIds.js';
|
|
7
8
|
import '../../../utils/makeAnalyticsAttribute/index.js';
|
|
8
9
|
import '../../BladeProvider/index.js';
|
|
@@ -10,15 +11,20 @@ import '../../../utils/metaAttribute/index.js';
|
|
|
10
11
|
import '../../Box/BaseBox/index.js';
|
|
11
12
|
import getIn from '../../../utils/lodashButBetter/get.js';
|
|
12
13
|
import '../../../utils/assignWithoutSideEffects/index.js';
|
|
13
|
-
import
|
|
14
|
+
import '../../../utils/isValidAllowedChildren/index.js';
|
|
15
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
16
|
import useTheme from '../../BladeProvider/useTheme.js';
|
|
15
17
|
import useChartsColorTheme from '../utils/useColorTheme.js';
|
|
18
|
+
import { getHighestColorInRange } from '../utils/getHighestColorInRange.js';
|
|
16
19
|
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
20
|
+
import { getComponentId } from '../../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
|
|
21
|
+
import { assignDataColorMapping } from '../utils/assignDataColorMapping/assignDataColorMapping.js';
|
|
22
|
+
import { CommonChartComponentsContext } from '../CommonChartComponents/CommonChartComponentsContext.js';
|
|
17
23
|
import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
|
|
18
24
|
import { metaAttribute } from '../../../utils/metaAttribute/metaAttribute.web.js';
|
|
19
25
|
import { makeAnalyticsAttribute } from '../../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
|
|
20
26
|
|
|
21
|
-
var _excluded = ["color", "type", "connectNulls", "showLegend", "stackId", "dot", "activeDot", "_index", "_colorTheme"],
|
|
27
|
+
var _excluded = ["color", "type", "connectNulls", "showLegend", "stackId", "dot", "activeDot", "_index", "_colorTheme", "_totalAreas", "dataKey", "name"],
|
|
22
28
|
_excluded2 = ["data", "children", "testID", "colorTheme"];
|
|
23
29
|
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; }
|
|
24
30
|
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; }
|
|
@@ -38,23 +44,32 @@ var Area = function Area(_ref) {
|
|
|
38
44
|
activeDot = _ref$activeDot === void 0 ? true : _ref$activeDot,
|
|
39
45
|
_index = _ref._index,
|
|
40
46
|
_colorTheme = _ref._colorTheme,
|
|
47
|
+
_totalAreas = _ref._totalAreas,
|
|
48
|
+
dataKey = _ref.dataKey,
|
|
49
|
+
name = _ref.name,
|
|
41
50
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
51
|
var _useTheme = useTheme(),
|
|
43
52
|
theme = _useTheme.theme;
|
|
44
53
|
var themeColors = useChartsColorTheme({
|
|
45
|
-
colorTheme: _colorTheme
|
|
54
|
+
colorTheme: _colorTheme,
|
|
55
|
+
chartName: 'area',
|
|
56
|
+
chartDataIndicators: _totalAreas
|
|
46
57
|
});
|
|
47
|
-
var colorToken =
|
|
58
|
+
var colorToken = getIn(theme.colors, color ? getHighestColorInRange({
|
|
59
|
+
colorToken: color
|
|
60
|
+
}) : themeColors[_index !== null && _index !== void 0 ? _index : 0]);
|
|
48
61
|
var animationBegin = theme.motion.delay.gentle;
|
|
49
62
|
var animationDuration = theme.motion.duration.xgentle;
|
|
50
63
|
return /*#__PURE__*/jsx(Area$1, _objectSpread(_objectSpread({}, props), {}, {
|
|
51
|
-
fill:
|
|
64
|
+
fill: "url(#color-".concat(_index, "-").concat(dataKey, ")"),
|
|
65
|
+
dataKey: dataKey,
|
|
66
|
+
name: name,
|
|
52
67
|
stroke: colorToken,
|
|
53
|
-
fillOpacity: 0.
|
|
68
|
+
fillOpacity: 0.5,
|
|
54
69
|
type: type,
|
|
55
70
|
connectNulls: connectNulls,
|
|
56
71
|
legendType: showLegend ? 'rect' : 'none',
|
|
57
|
-
strokeWidth:
|
|
72
|
+
strokeWidth: 1.5,
|
|
58
73
|
dot: dot,
|
|
59
74
|
stackId: stackId,
|
|
60
75
|
activeDot: activeDot,
|
|
@@ -65,40 +80,127 @@ var Area = function Area(_ref) {
|
|
|
65
80
|
var ChartArea = /*#__PURE__*/assignWithoutSideEffects(Area, {
|
|
66
81
|
componentId: componentIds.ChartArea
|
|
67
82
|
});
|
|
83
|
+
var ChartColorGradient = function ChartColorGradient(_ref2) {
|
|
84
|
+
var index = _ref2.index,
|
|
85
|
+
color = _ref2.color,
|
|
86
|
+
totalAreaChartChildren = _ref2.totalAreaChartChildren,
|
|
87
|
+
id = _ref2.id;
|
|
88
|
+
var _useTheme2 = useTheme(),
|
|
89
|
+
colorScheme = _useTheme2.colorScheme,
|
|
90
|
+
theme = _useTheme2.theme;
|
|
91
|
+
var isDarkMode = colorScheme === 'dark';
|
|
92
|
+
var themeColors = useChartsColorTheme({
|
|
93
|
+
colorTheme: 'categorical',
|
|
94
|
+
chartName: 'area',
|
|
95
|
+
chartDataIndicators: totalAreaChartChildren
|
|
96
|
+
});
|
|
97
|
+
var colorToken = getIn(theme.colors, getHighestColorInRange({
|
|
98
|
+
colorToken: color !== null && color !== void 0 ? color : themeColors[index],
|
|
99
|
+
followIntensityMapping: true
|
|
100
|
+
}));
|
|
101
|
+
return /*#__PURE__*/jsxs("linearGradient", {
|
|
102
|
+
id: id,
|
|
103
|
+
x1: "0",
|
|
104
|
+
y1: "0",
|
|
105
|
+
x2: "0",
|
|
106
|
+
y2: "1",
|
|
107
|
+
children: [/*#__PURE__*/jsx("stop", {
|
|
108
|
+
offset: "5%",
|
|
109
|
+
stopColor: colorToken,
|
|
110
|
+
stopOpacity: isDarkMode ? 0.28 : 1
|
|
111
|
+
}), /*#__PURE__*/jsx("stop", {
|
|
112
|
+
offset: "95%",
|
|
113
|
+
stopColor: colorToken,
|
|
114
|
+
stopOpacity: isDarkMode ? 0.12 : 0.32
|
|
115
|
+
})]
|
|
116
|
+
}, id);
|
|
117
|
+
};
|
|
68
118
|
|
|
69
119
|
// Main components
|
|
70
|
-
var ChartAreaWrapper = function ChartAreaWrapper(
|
|
71
|
-
var data =
|
|
72
|
-
children =
|
|
73
|
-
testID =
|
|
74
|
-
|
|
75
|
-
colorTheme =
|
|
76
|
-
restProps = _objectWithoutProperties(
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
120
|
+
var ChartAreaWrapper = function ChartAreaWrapper(_ref3) {
|
|
121
|
+
var data = _ref3.data,
|
|
122
|
+
children = _ref3.children,
|
|
123
|
+
testID = _ref3.testID,
|
|
124
|
+
_ref3$colorTheme = _ref3.colorTheme,
|
|
125
|
+
colorTheme = _ref3$colorTheme === void 0 ? 'categorical' : _ref3$colorTheme,
|
|
126
|
+
restProps = _objectWithoutProperties(_ref3, _excluded2);
|
|
127
|
+
var themeColors = useChartsColorTheme({
|
|
128
|
+
colorTheme: colorTheme,
|
|
129
|
+
chartName: 'area'
|
|
130
|
+
});
|
|
131
|
+
var _React$useMemo = React__default.useMemo(function () {
|
|
132
|
+
var childrenArray = React__default.Children.toArray(children);
|
|
133
|
+
var dataColorMapping = {};
|
|
134
|
+
|
|
135
|
+
// Count ChartLine components
|
|
136
|
+
var totalAreas = childrenArray.filter(function (child) {
|
|
137
|
+
return /*#__PURE__*/React__default.isValidElement(child) && getComponentId(child) === componentIds.ChartArea;
|
|
138
|
+
}).length;
|
|
139
|
+
var AreaChartIndex = 0;
|
|
140
|
+
/**
|
|
141
|
+
* We need to check child of ChartAreaWrapper. if they have any custom color we store that.
|
|
142
|
+
* We need these mapping because colors of tooltip & legend is determine based on this
|
|
143
|
+
* recharts do provide a color but it is hex code and we need blade color token .
|
|
144
|
+
*/
|
|
145
|
+
var modifiedChildren = React__default.Children.map(children, function (child) {
|
|
146
|
+
if (/*#__PURE__*/React__default.isValidElement(child) && getComponentId(child) === componentIds.ChartArea) {
|
|
147
|
+
var _child$props, _child$props2;
|
|
148
|
+
var childColor = child === null || child === void 0 || (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.color;
|
|
149
|
+
var dataKey = child === null || child === void 0 || (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.dataKey;
|
|
150
|
+
if (dataKey) {
|
|
151
|
+
// assign colors to the dataColorMapping, if no color is assigned we assign color in `assignDataColorMapping`
|
|
152
|
+
|
|
153
|
+
dataColorMapping[dataKey] = {
|
|
154
|
+
colorToken: childColor,
|
|
155
|
+
isCustomColor: Boolean(childColor)
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
159
|
+
_index: AreaChartIndex++,
|
|
160
|
+
_colorTheme: colorTheme,
|
|
161
|
+
_totalAreas: totalAreas
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
return child;
|
|
165
|
+
});
|
|
166
|
+
assignDataColorMapping(dataColorMapping, themeColors);
|
|
167
|
+
return {
|
|
168
|
+
modifiedChildren: modifiedChildren,
|
|
169
|
+
totalAreaChartChildren: AreaChartIndex,
|
|
170
|
+
dataColorMapping: dataColorMapping
|
|
171
|
+
};
|
|
172
|
+
}, [children, colorTheme, themeColors]),
|
|
173
|
+
modifiedChildren = _React$useMemo.modifiedChildren,
|
|
174
|
+
totalAreaChartChildren = _React$useMemo.totalAreaChartChildren,
|
|
175
|
+
dataColorMapping = _React$useMemo.dataColorMapping;
|
|
176
|
+
return /*#__PURE__*/jsx(CommonChartComponentsContext.Provider, {
|
|
177
|
+
value: {
|
|
178
|
+
chartName: 'area',
|
|
179
|
+
dataColorMapping: dataColorMapping
|
|
180
|
+
},
|
|
181
|
+
children: /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, metaAttribute({
|
|
182
|
+
name: 'chart-area-container',
|
|
183
|
+
testID: testID
|
|
184
|
+
})), makeAnalyticsAttribute(restProps)), restProps), {}, {
|
|
185
|
+
width: "100%",
|
|
186
|
+
height: "100%",
|
|
187
|
+
children: /*#__PURE__*/jsx(ResponsiveContainer, {
|
|
188
|
+
children: /*#__PURE__*/jsxs(AreaChart, {
|
|
189
|
+
data: data,
|
|
190
|
+
children: [/*#__PURE__*/jsx("defs", {
|
|
191
|
+
children: Object.keys(dataColorMapping).map(function (dataKey, index) {
|
|
192
|
+
return /*#__PURE__*/jsx(ChartColorGradient, {
|
|
193
|
+
id: "color-".concat(index, "-").concat(dataKey),
|
|
194
|
+
index: index,
|
|
195
|
+
color: dataColorMapping[dataKey].colorToken,
|
|
196
|
+
totalAreaChartChildren: totalAreaChartChildren
|
|
197
|
+
}, "color-".concat(index, "-").concat(dataKey));
|
|
198
|
+
})
|
|
199
|
+
}), modifiedChildren]
|
|
200
|
+
})
|
|
99
201
|
})
|
|
100
|
-
})
|
|
101
|
-
})
|
|
202
|
+
}))
|
|
203
|
+
});
|
|
102
204
|
};
|
|
103
205
|
|
|
104
206
|
export { ChartArea, ChartAreaWrapper };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.web.js","sources":["../../../../../../../src/components/Charts/AreaChart/AreaChart.web.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AreaChart as RechartsAreaChart,\n Area as RechartsArea,\n ResponsiveContainer,\n} from 'recharts';\nimport { useChartsColorTheme } from '../utils';\nimport type { ChartAreaProps, ChartAreaWrapperProps } from './types';\nimport { componentIds } from './componentIds';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { useTheme } from '~components/BladeProvider';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport BaseBox from '~components/Box/BaseBox';\nimport getIn from '~utils/lodashButBetter/get';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\nconst Area: React.FC<ChartAreaProps> = ({\n color,\n type = 'monotone',\n connectNulls = false,\n showLegend = true,\n stackId = 1,\n dot = false,\n activeDot = true,\n _index,\n _colorTheme,\n ...props\n}) => {\n const { theme } = useTheme();\n const themeColors = useChartsColorTheme({ colorTheme: _colorTheme });\n const colorToken = color ? getIn(theme.colors, color) : themeColors[_index ?? 0];\n const animationBegin = theme.motion.delay.gentle;\n const animationDuration = theme.motion.duration.xgentle;\n\n return (\n <RechartsArea\n {...props}\n fill={colorToken}\n stroke={colorToken}\n fillOpacity={0.09}\n type={type}\n connectNulls={connectNulls}\n legendType={showLegend ? 'rect' : 'none'}\n strokeWidth={3}\n dot={dot}\n stackId={stackId}\n activeDot={activeDot}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n />\n );\n};\n\nconst ChartArea = assignWithoutSideEffects(Area, {\n componentId: componentIds.ChartArea,\n});\n\n// Main components\nconst ChartAreaWrapper: React.FC<ChartAreaWrapperProps & TestID & DataAnalyticsAttribute> = ({\n data,\n children,\n testID,\n colorTheme = 'default',\n ...restProps\n}) => {\n const modifiedChildren = React.useMemo(() => {\n let AreaChartIndex = 0;\n return React.Children.map(children, (child) => {\n if (React.isValidElement(child) && child.type === componentIds.ChartArea) {\n return React.cloneElement(child, {\n _index: AreaChartIndex++,\n _colorTheme: colorTheme,\n } as Partial<ChartAreaProps>);\n }\n return child;\n });\n }, [children, colorTheme]);\n\n return (\n <BaseBox\n {...metaAttribute({ name: 'chart-area-container', testID })}\n {...makeAnalyticsAttribute(restProps)}\n {...restProps}\n width=\"100%\"\n height=\"100%\"\n >\n <ResponsiveContainer>\n <RechartsAreaChart data={data}>{modifiedChildren}</RechartsAreaChart>\n </ResponsiveContainer>\n </BaseBox>\n );\n};\n\nexport type { ChartAreaWrapperProps, ChartAreaProps };\nexport { ChartAreaWrapper, ChartArea };\n"],"names":["Area","_ref","color","_ref$type","type","_ref$connectNulls","connectNulls","_ref$showLegend","showLegend","_ref$stackId","stackId","_ref$dot","dot","_ref$activeDot","activeDot","_index","_colorTheme","props","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","themeColors","useChartsColorTheme","colorTheme","colorToken","getIn","colors","animationBegin","motion","delay","gentle","animationDuration","duration","xgentle","_jsx","RechartsArea","_objectSpread","fill","stroke","fillOpacity","legendType","strokeWidth","ChartArea","assignWithoutSideEffects","componentId","componentIds","ChartAreaWrapper","_ref2","data","children","testID","_ref2$colorTheme","restProps","_excluded2","modifiedChildren","React","useMemo","AreaChartIndex","Children","map","child","isValidElement","cloneElement","BaseBox","metaAttribute","name","makeAnalyticsAttribute","width","height","ResponsiveContainer","RechartsAreaChart"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAMA,IAA8B,GAAG,SAAjCA,IAA8BA,CAAAC,IAAA,EAW9B;AAAA,EAAA,IAVJC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAAC,SAAA,GAAAF,IAAA,CACLG,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,UAAU,GAAAA,SAA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,GAAG,CAAC,CAAA;IACtB,OAAOF,cAAK,CAACG,QAAQ,CAACC,GAAG,CAACV,QAAQ,EAAE,UAACW,KAAK,EAAK;AAC7C,MAAA,iBAAIL,cAAK,CAACM,cAAc,CAACD,KAAK,CAAC,IAAIA,KAAK,CAAC1D,IAAI,KAAK2C,YAAY,CAACH,SAAS,EAAE;AACxE,QAAA,oBAAOa,cAAK,CAACO,YAAY,CAACF,KAAK,EAAE;UAC/B/C,MAAM,EAAE4C,cAAc,EAAE;AACxB3C,UAAAA,WAAW,EAAES,UAAAA;AACf,SAA4B,CAAC,CAAA;AAC/B,OAAA;AACA,MAAA,OAAOqC,KAAK,CAAA;AACd,KAAC,CAAC,CAAA;AACJ,GAAC,EAAE,CAACX,QAAQ,EAAE1B,UAAU,CAAC,CAAC,CAAA;AAE1B,EAAA,oBACEW,GAAA,CAAC6B,OAAO,EAAA3B,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA,EAAA,EACF4B,aAAa,CAAC;AAAEC,IAAAA,IAAI,EAAE,sBAAsB;AAAEf,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CACvDgB,EAAAA,sBAAsB,CAACd,SAAS,CAAC,GACjCA,SAAS,CAAA,EAAA,EAAA,EAAA;AACbe,IAAAA,KAAK,EAAC,MAAM;AACZC,IAAAA,MAAM,EAAC,MAAM;IAAAnB,QAAA,eAEbf,GAAA,CAACmC,mBAAmB,EAAA;MAAApB,QAAA,eAClBf,GAAA,CAACoC,SAAiB,EAAA;AAACtB,QAAAA,IAAI,EAAEA,IAAK;AAAAC,QAAAA,QAAA,EAAEK,gBAAAA;OAAoC,CAAA;KACjD,CAAA;AAAC,GAAA,CACf,CAAC,CAAA;AAEd;;;;"}
|
|
1
|
+
{"version":3,"file":"AreaChart.web.js","sources":["../../../../../../../src/components/Charts/AreaChart/AreaChart.web.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AreaChart as RechartsAreaChart,\n Area as RechartsArea,\n ResponsiveContainer,\n} from 'recharts';\nimport { getHighestColorInRange, useChartsColorTheme, assignDataColorMapping } from '../utils';\nimport type { DataColorMapping } from '../CommonChartComponents';\nimport { CommonChartComponentsContext } from '../CommonChartComponents';\nimport type { ChartAreaProps, ChartAreaWrapperProps, ChartColorGradientProps } from './types';\nimport { componentIds } from './componentIds';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { useTheme } from '~components/BladeProvider';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport BaseBox from '~components/Box/BaseBox';\nimport getIn from '~utils/lodashButBetter/get';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\n\nconst Area: React.FC<ChartAreaProps> = ({\n color,\n type = 'monotone',\n connectNulls = false,\n showLegend = true,\n stackId = 1,\n dot = false,\n activeDot = true,\n _index,\n _colorTheme,\n _totalAreas,\n dataKey,\n name,\n ...props\n}) => {\n const { theme } = useTheme();\n const themeColors = useChartsColorTheme({\n colorTheme: _colorTheme,\n chartName: 'area',\n chartDataIndicators: _totalAreas,\n });\n const colorToken = getIn(\n theme.colors,\n color ? getHighestColorInRange({ colorToken: color }) : themeColors[_index ?? 0],\n );\n const animationBegin = theme.motion.delay.gentle;\n const animationDuration = theme.motion.duration.xgentle;\n\n return (\n <RechartsArea\n {...props}\n fill={`url(#color-${_index}-${dataKey})`}\n dataKey={dataKey}\n name={name}\n stroke={colorToken}\n fillOpacity={0.5}\n type={type}\n connectNulls={connectNulls}\n legendType={showLegend ? 'rect' : 'none'}\n strokeWidth={1.5}\n dot={dot}\n stackId={stackId}\n activeDot={activeDot}\n animationBegin={animationBegin}\n animationDuration={animationDuration}\n />\n );\n};\n\nconst ChartArea = assignWithoutSideEffects(Area, {\n componentId: componentIds.ChartArea,\n});\n\nconst ChartColorGradient: React.FC<ChartColorGradientProps> = ({\n index,\n color,\n totalAreaChartChildren,\n id,\n}) => {\n const { colorScheme, theme } = useTheme();\n const isDarkMode = colorScheme === 'dark';\n const themeColors = useChartsColorTheme({\n colorTheme: 'categorical',\n chartName: 'area',\n chartDataIndicators: totalAreaChartChildren,\n });\n\n const colorToken = getIn(\n theme.colors,\n getHighestColorInRange({\n colorToken: color ?? themeColors[index],\n followIntensityMapping: true,\n }),\n );\n return (\n <linearGradient id={id} key={id} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"5%\" stopColor={colorToken} stopOpacity={isDarkMode ? 0.28 : 1} />\n <stop offset=\"95%\" stopColor={colorToken} stopOpacity={isDarkMode ? 0.12 : 0.32} />\n </linearGradient>\n );\n};\n\n// Main components\nconst ChartAreaWrapper: React.FC<ChartAreaWrapperProps & TestID & DataAnalyticsAttribute> = ({\n data,\n children,\n testID,\n colorTheme = 'categorical',\n ...restProps\n}) => {\n const themeColors = useChartsColorTheme({\n colorTheme,\n chartName: 'area',\n });\n const { modifiedChildren, totalAreaChartChildren, dataColorMapping } = React.useMemo(() => {\n const childrenArray = React.Children.toArray(children);\n const dataColorMapping: DataColorMapping = {};\n\n // Count ChartLine components\n const totalAreas = childrenArray.filter(\n (child): child is React.ReactElement =>\n React.isValidElement(child) && getComponentId(child) === componentIds.ChartArea,\n ).length;\n\n let AreaChartIndex = 0;\n /**\n * We need to check child of ChartAreaWrapper. if they have any custom color we store that.\n * We need these mapping because colors of tooltip & legend is determine based on this\n * recharts do provide a color but it is hex code and we need blade color token .\n */\n const modifiedChildren = React.Children.map(children, (child) => {\n if (React.isValidElement(child) && getComponentId(child) === componentIds.ChartArea) {\n const childColor = child?.props?.color;\n const dataKey = (child?.props as ChartAreaProps)?.dataKey as string;\n if (dataKey) {\n // assign colors to the dataColorMapping, if no color is assigned we assign color in `assignDataColorMapping`\n\n dataColorMapping[dataKey] = {\n colorToken: childColor,\n isCustomColor: Boolean(childColor),\n };\n }\n return React.cloneElement(child, {\n _index: AreaChartIndex++,\n _colorTheme: colorTheme,\n _totalAreas: totalAreas,\n } as Partial<ChartAreaProps>);\n }\n return child;\n });\n\n assignDataColorMapping(dataColorMapping, themeColors);\n return {\n modifiedChildren,\n totalAreaChartChildren: AreaChartIndex,\n dataColorMapping,\n };\n }, [children, colorTheme, themeColors]);\n\n return (\n <CommonChartComponentsContext.Provider value={{ chartName: 'area', dataColorMapping }}>\n <BaseBox\n {...metaAttribute({ name: 'chart-area-container', testID })}\n {...makeAnalyticsAttribute(restProps)}\n {...restProps}\n width=\"100%\"\n height=\"100%\"\n >\n <ResponsiveContainer>\n <RechartsAreaChart data={data}>\n <defs>\n {Object.keys(dataColorMapping).map((dataKey, index) => (\n <ChartColorGradient\n key={`color-${index}-${dataKey}`}\n id={`color-${index}-${dataKey}`}\n index={index}\n color={dataColorMapping[dataKey].colorToken}\n totalAreaChartChildren={totalAreaChartChildren}\n />\n ))}\n </defs>\n\n {modifiedChildren}\n </RechartsAreaChart>\n </ResponsiveContainer>\n </BaseBox>\n </CommonChartComponentsContext.Provider>\n );\n};\n\nexport type { ChartAreaWrapperProps, ChartAreaProps };\nexport { ChartAreaWrapper, ChartArea };\n"],"names":["Area","_ref","color","_ref$type","type","_ref$connectNulls","connectNulls","_ref$showLegend","showLegend","_ref$stackId","stackId","_ref$dot","dot","_ref$activeDot","activeDot","_index","_colorTheme","_totalAreas","dataKey","name","props","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","themeColors","useChartsColorTheme","colorTheme","chartName","chartDataIndicators","colorToken","getIn","colors","getHighestColorInRange","animationBegin","motion","delay","gentle","animationDuration","duration","xgentle","_jsx","RechartsArea","_objectSpread","fill","concat","stroke","fillOpacity","legendType","strokeWidth","ChartArea","assignWithoutSideEffects","componentId","componentIds","ChartColorGradient","_ref2","index","totalAreaChartChildren","id","_useTheme2","colorScheme","isDarkMode","followIntensityMapping","_jsxs","x1","y1","x2","y2","children","offset","stopColor","stopOpacity","ChartAreaWrapper","_ref3","data","testID","_ref3$colorTheme","restProps","_excluded2","_React$useMemo","React","useMemo","childrenArray","Children","toArray","dataColorMapping","totalAreas","filter","child","isValidElement","getComponentId","length","AreaChartIndex","modifiedChildren","map","_child$props","_child$props2","childColor","isCustomColor","Boolean","cloneElement","assignDataColorMapping","CommonChartComponentsContext","Provider","value","BaseBox","metaAttribute","makeAnalyticsAttribute","width","height","ResponsiveContainer","RechartsAreaChart","Object","keys"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAMA,IAA8B,GAAG,SAAjCA,IAA8BA,CAAAC,IAAA,EAc9B;AAAA,EAAA,IAbJC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAAC,SAAA,GAAAF,IAAA,CACLG,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,UAAU,GAAAA,SAAA;IAAAE,iBAAA,GAAAJ,IAAA,CACjBK,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,iBAAA;IAAAE,eAAA,GAAAN,IAAA,CACpBO,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,eAAA;IAAAE,YAAA,GAAAR,IAAA,CACjBS,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,YAAA;IAAAE,QAAA,GAAAV,IAAA,CACXW,GAAG;AAAHA,IAAAA,GAAG,GAAAD,QAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,QAAA;IAAAE,cAAA,GAAAZ,IAAA,CACXa,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,cAAA;IAChBE,MAAM,GAAAd,IAAA,CAANc,MAAM;IACNC,WAAW,GAAAf,IAAA,CAAXe,WAAW;IACXC,WAAW,GAAAhB,IAAA,CAAXgB,WAAW;IACXC,OAAO,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