@razorpay/blade 12.62.0 → 12.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  2. package/build/lib/native/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  3. package/build/lib/native/components/Box/Box.js.map +1 -1
  4. package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponentsContext.js +6 -0
  5. package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponentsContext.js.map +1 -0
  6. package/build/lib/native/components/Charts/CommonChartComponents/tokens.js +4 -0
  7. package/build/lib/native/components/Charts/CommonChartComponents/tokens.js.map +1 -0
  8. package/build/lib/native/components/Typography/Display/Display.js +2 -1
  9. package/build/lib/native/components/Typography/Display/Display.js.map +1 -1
  10. package/build/lib/native/components/Typography/Heading/Heading.js +2 -1
  11. package/build/lib/native/components/Typography/Heading/Heading.js.map +1 -1
  12. package/build/lib/native/components/Typography/Text/Text.js +1 -1
  13. package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
  14. package/build/lib/native/components/index.js +2 -0
  15. package/build/lib/native/components/index.js.map +1 -1
  16. package/build/lib/native/tokens/global/colors.js +1 -1
  17. package/build/lib/native/tokens/global/colors.js.map +1 -1
  18. package/build/lib/native/tokens/theme/bladeTheme.js +1 -1
  19. package/build/lib/native/tokens/theme/bladeTheme.js.map +1 -1
  20. package/build/lib/native/tokens/theme/theme.js.map +1 -1
  21. package/build/lib/native/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js +1 -1
  22. package/build/lib/native/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js.map +1 -1
  23. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  24. package/build/lib/web/development/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  25. package/build/lib/web/development/components/Box/Box.js.map +1 -1
  26. package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js +140 -38
  27. package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
  28. package/build/lib/web/development/components/Charts/BarChart/BarChart.web.js +121 -57
  29. package/build/lib/web/development/components/Charts/BarChart/BarChart.web.js.map +1 -1
  30. package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js +145 -92
  31. package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
  32. package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponentsContext.js +15 -0
  33. package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponentsContext.js.map +1 -0
  34. package/build/lib/web/development/components/Charts/CommonChartComponents/index.js +2 -0
  35. package/build/lib/web/development/components/Charts/CommonChartComponents/index.js.map +1 -1
  36. package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js +2 -1
  37. package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js.map +1 -1
  38. package/build/lib/web/development/components/Charts/DonutChart/DonutChart.web.js +202 -69
  39. package/build/lib/web/development/components/Charts/DonutChart/DonutChart.web.js.map +1 -1
  40. package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js +84 -32
  41. package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js.map +1 -1
  42. package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js +33 -0
  43. package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js.map +1 -0
  44. package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/index.js +2 -0
  45. package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/index.js.map +1 -0
  46. package/build/lib/web/development/components/Charts/utils/getHighestColorInRange.js +53 -0
  47. package/build/lib/web/development/components/Charts/utils/getHighestColorInRange.js.map +1 -0
  48. package/build/lib/web/development/components/Charts/utils/index.js +5 -0
  49. package/build/lib/web/development/components/Charts/utils/index.js.map +1 -1
  50. package/build/lib/web/development/components/Charts/utils/isSequentialColor.js +35 -0
  51. package/build/lib/web/development/components/Charts/utils/isSequentialColor.js.map +1 -0
  52. package/build/lib/web/development/components/Charts/utils/sanitizeString/index.js +2 -0
  53. package/build/lib/web/development/components/Charts/utils/sanitizeString/index.js.map +1 -0
  54. package/build/lib/web/development/components/Charts/utils/sanitizeString/sanitizeString.js +30 -0
  55. package/build/lib/web/development/components/Charts/utils/sanitizeString/sanitizeString.js.map +1 -0
  56. package/build/lib/web/development/components/Charts/utils/tokens.js +7 -0
  57. package/build/lib/web/development/components/Charts/utils/tokens.js.map +1 -0
  58. package/build/lib/web/development/components/Charts/utils/useColorTheme.js +32 -11
  59. package/build/lib/web/development/components/Charts/utils/useColorTheme.js.map +1 -1
  60. package/build/lib/web/development/components/Typography/BaseText/BaseText.web.js +4 -2
  61. package/build/lib/web/development/components/Typography/BaseText/BaseText.web.js.map +1 -1
  62. package/build/lib/web/development/components/Typography/Display/Display.js +4 -2
  63. package/build/lib/web/development/components/Typography/Display/Display.js.map +1 -1
  64. package/build/lib/web/development/components/Typography/Heading/Heading.js +4 -2
  65. package/build/lib/web/development/components/Typography/Heading/Heading.js.map +1 -1
  66. package/build/lib/web/development/components/Typography/Text/Text.js +4 -2
  67. package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
  68. package/build/lib/web/development/components/index.js +2 -0
  69. package/build/lib/web/development/components/index.js.map +1 -1
  70. package/build/lib/web/development/tokens/global/colors.js +48 -48
  71. package/build/lib/web/development/tokens/global/colors.js.map +1 -1
  72. package/build/lib/web/development/tokens/theme/bladeTheme.js +139 -111
  73. package/build/lib/web/development/tokens/theme/bladeTheme.js.map +1 -1
  74. package/build/lib/web/development/tokens/theme/theme.js.map +1 -1
  75. package/build/lib/web/development/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js +1 -1
  76. package/build/lib/web/development/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js.map +1 -1
  77. package/build/lib/web/development/utils/omitPropsFromHTML/index.js +7 -0
  78. package/build/lib/web/development/utils/omitPropsFromHTML/index.js.map +1 -1
  79. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  80. package/build/lib/web/production/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  81. package/build/lib/web/production/components/Box/Box.js.map +1 -1
  82. package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js +140 -38
  83. package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
  84. package/build/lib/web/production/components/Charts/BarChart/BarChart.web.js +121 -57
  85. package/build/lib/web/production/components/Charts/BarChart/BarChart.web.js.map +1 -1
  86. package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js +145 -92
  87. package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
  88. package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponentsContext.js +15 -0
  89. package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponentsContext.js.map +1 -0
  90. package/build/lib/web/production/components/Charts/CommonChartComponents/index.js +2 -0
  91. package/build/lib/web/production/components/Charts/CommonChartComponents/index.js.map +1 -1
  92. package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js +2 -1
  93. package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js.map +1 -1
  94. package/build/lib/web/production/components/Charts/DonutChart/DonutChart.web.js +202 -69
  95. package/build/lib/web/production/components/Charts/DonutChart/DonutChart.web.js.map +1 -1
  96. package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js +84 -32
  97. package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js.map +1 -1
  98. package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js +33 -0
  99. package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js.map +1 -0
  100. package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/index.js +2 -0
  101. package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/index.js.map +1 -0
  102. package/build/lib/web/production/components/Charts/utils/getHighestColorInRange.js +53 -0
  103. package/build/lib/web/production/components/Charts/utils/getHighestColorInRange.js.map +1 -0
  104. package/build/lib/web/production/components/Charts/utils/index.js +5 -0
  105. package/build/lib/web/production/components/Charts/utils/index.js.map +1 -1
  106. package/build/lib/web/production/components/Charts/utils/isSequentialColor.js +35 -0
  107. package/build/lib/web/production/components/Charts/utils/isSequentialColor.js.map +1 -0
  108. package/build/lib/web/production/components/Charts/utils/sanitizeString/index.js +2 -0
  109. package/build/lib/web/production/components/Charts/utils/sanitizeString/index.js.map +1 -0
  110. package/build/lib/web/production/components/Charts/utils/sanitizeString/sanitizeString.js +30 -0
  111. package/build/lib/web/production/components/Charts/utils/sanitizeString/sanitizeString.js.map +1 -0
  112. package/build/lib/web/production/components/Charts/utils/tokens.js +7 -0
  113. package/build/lib/web/production/components/Charts/utils/tokens.js.map +1 -0
  114. package/build/lib/web/production/components/Charts/utils/useColorTheme.js +32 -11
  115. package/build/lib/web/production/components/Charts/utils/useColorTheme.js.map +1 -1
  116. package/build/lib/web/production/components/Typography/BaseText/BaseText.web.js +4 -2
  117. package/build/lib/web/production/components/Typography/BaseText/BaseText.web.js.map +1 -1
  118. package/build/lib/web/production/components/Typography/Display/Display.js +4 -2
  119. package/build/lib/web/production/components/Typography/Display/Display.js.map +1 -1
  120. package/build/lib/web/production/components/Typography/Heading/Heading.js +4 -2
  121. package/build/lib/web/production/components/Typography/Heading/Heading.js.map +1 -1
  122. package/build/lib/web/production/components/Typography/Text/Text.js +4 -2
  123. package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
  124. package/build/lib/web/production/components/index.js +2 -0
  125. package/build/lib/web/production/components/index.js.map +1 -1
  126. package/build/lib/web/production/tokens/global/colors.js +48 -48
  127. package/build/lib/web/production/tokens/global/colors.js.map +1 -1
  128. package/build/lib/web/production/tokens/theme/bladeTheme.js +139 -111
  129. package/build/lib/web/production/tokens/theme/bladeTheme.js.map +1 -1
  130. package/build/lib/web/production/tokens/theme/theme.js.map +1 -1
  131. package/build/lib/web/production/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js +1 -1
  132. package/build/lib/web/production/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js.map +1 -1
  133. package/build/lib/web/production/utils/omitPropsFromHTML/index.js +7 -0
  134. package/build/lib/web/production/utils/omitPropsFromHTML/index.js.map +1 -1
  135. package/build/types/components/index.d.ts +86 -30
  136. package/build/types/components/index.native.d.ts +84 -28
  137. package/build/types/tokens/index.d.ts +6 -6
  138. package/build/types/tokens/index.native.d.ts +6 -6
  139. package/build/types/utils/index.d.ts +29 -6
  140. package/build/types/utils/index.native.d.ts +29 -6
  141. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"BaseHeader.js","sources":["../../../../../src/components/BaseHeaderFooter/BaseHeader.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport type { ReactDOMAttributes } from '@use-gesture/react/dist/declarations/src/types';\nimport { Divider } from '~components/Divider';\nimport type { DividerProps } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Heading, Text } from '~components/Typography';\nimport { IconButton } from '~components/Button/IconButton';\nimport { ChevronLeftIcon, CloseIcon } from '~components/Icons';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport type { BoxProps } from '~components/Box';\nimport { Box } from '~components/Box';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { isReactNative, makeSize } from '~utils';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport { logger, throwBladeError } from '~utils/logger';\nimport { size as sizeToken } from '~tokens/global';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype BaseHeaderProps = {\n title?: string;\n subtitle?: string;\n /**\n * Leading part of the header placed at the left most side of the header\n */\n leading?: React.ReactNode;\n /**\n * Trailing part of the header placed at the right most side of the header\n */\n trailing?: React.ReactNode;\n /**\n * Placed adjacent to the title text\n */\n titleSuffix?: React.ReactNode;\n /**\n * @default true\n */\n showDivider?: boolean;\n /**\n * @default false\n */\n showBackButton?: boolean;\n\n /**\n * Slot for rendering any trailing interaction element into BaseHeader.\n *\n * E.g. Used in accordion to render CollapsibleChevronIcon\n */\n trailingInteractionElement?: React.ReactNode;\n\n /**\n * Decides size of the Header\n */\n size?: 'xlarge' | 'large' | 'medium';\n /**\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Disabled state of BaseHeader\n *\n * @default false\n */\n isDisabled?: boolean;\n\n paddingX?: BoxProps['paddingX'];\n marginY?: BoxProps['marginY'];\n marginTop?: BoxProps['marginTop'];\n marginBottom?: BoxProps['marginBottom'];\n alignItems?: BoxProps['alignItems'];\n dividerProps?: DividerProps;\n\n onCloseButtonClick?: () => void;\n onBackButtonClick?: () => void;\n closeButtonRef?: React.MutableRefObject<any>;\n backButtonRef?: React.MutableRefObject<any>;\n metaComponentName?: string;\n /**\n * inner child of BottomSheetHeader. Meant to be used for AutoComplete only\n */\n children?: React.ReactElement | React.ReactElement[];\n /**\n * Background image of the header\n *\n * You can use this for adding gradients.\n */\n backgroundImage?: BoxProps['backgroundImage'];\n /**\n * So we add a wrapper with custom styles in elements like leading, trailing interaction elements and trailing.\n * this props allows you to control that.\n *\n * For example, in Accordion, we add a wrapper with flex to center the icon (in some cases)\n *\n * @default false\n */\n shouldAlignLeadingAndTrailingElementsToCenter?: boolean;\n} & Pick<\n ReactDOMAttributes,\n | 'onClickCapture'\n | 'onKeyDown'\n | 'onKeyUp'\n | 'onLostPointerCapture'\n | 'onPointerCancel'\n | 'onPointerDown'\n | 'onPointerMove'\n | 'onPointerUp'\n> &\n TestID &\n DataAnalyticsAttribute;\n\ntype TrailingComponents = 'Button' | 'Badge' | 'Link' | 'Text' | 'Amount';\n\nconst commonCenterBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nconst centerBoxProps: { xlarge: BoxProps; large: BoxProps; medium: BoxProps } = {\n xlarge: {\n ...commonCenterBoxProps,\n height: '28px',\n },\n large: {\n ...commonCenterBoxProps,\n // We want to align title, icon, titleSuffix, trailing, closeButton to baseline\n // But we also want to keep them center aligned to each other\n // So we add a virtual Box around these slots with 28px and center align them to that box\n // We have done similar thing in figma as well (which is where this 28px comes from)\n height: '28px',\n },\n medium: {\n ...commonCenterBoxProps,\n height: '20px',\n },\n};\n\nconst absolutePositionedButton = {\n position: 'absolute',\n top: 'spacing.0',\n right: 'spacing.0',\n} as const;\n\nconst sizeTokensMapping = {\n xlarge: {\n title: 'small',\n type: 'heading',\n },\n large: {\n title: 'large',\n type: 'text',\n },\n medium: {\n title: 'medium',\n type: 'text',\n },\n} as const;\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n large: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n IconButton: {\n size: 'large',\n },\n Badge: {\n size: 'medium',\n },\n Link: {\n size: 'medium',\n },\n Text: {\n size: 'medium',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'medium',\n },\n },\n xlarge: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n IconButton: {\n size: 'large',\n },\n Badge: {\n size: 'medium',\n },\n Link: {\n size: 'medium',\n },\n Text: {\n size: 'medium',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'medium',\n },\n },\n medium: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n IconButton: {\n size: 'large',\n },\n Badge: {\n size: 'small',\n },\n Link: {\n size: 'small',\n },\n Text: {\n size: 'small',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'small',\n },\n },\n} as const;\n\nconst useTrailingRestriction = ({\n trailing,\n size,\n}: {\n size: NonNullable<BaseHeaderProps['size']>;\n trailing: BaseHeaderProps['trailing'];\n}): React.ReactNode => {\n const [\n validatedTrailingComponent,\n setValidatedTrailingComponent,\n ] = React.useState<React.ReactElement | null>(null);\n\n // validate and restrict sub component props in trailing prop\n React.useEffect(() => {\n if (React.isValidElement(trailing)) {\n const trailingComponentType = getComponentId(trailing) as TrailingComponents;\n const restrictedProps = propRestrictionMap[size][trailingComponentType];\n\n const allowedComponents = Object.keys(propRestrictionMap[size]);\n if (__DEV__) {\n if (!restrictedProps) {\n throwBladeError({\n message: `Only one of \\`${allowedComponents.join(\n ', ',\n )}\\` component is accepted as trailing`,\n moduleName: 'Header',\n });\n }\n }\n\n const restrictedPropKeys = Object.keys(propRestrictionMap[size][trailingComponentType]);\n for (const prop of restrictedPropKeys) {\n if (trailing?.props?.hasOwnProperty(prop)) {\n logger({\n message: `Do not pass \"${prop}\" to \"${trailingComponentType}\" while inside Header trailing, because we override it.`,\n moduleName: 'Header',\n type: 'warn',\n });\n }\n }\n setValidatedTrailingComponent(\n React.cloneElement(trailing as React.ReactElement, restrictedProps),\n );\n }\n }, [trailing, size]);\n\n return validatedTrailingComponent;\n};\n\nconst _BaseHeader = ({\n title,\n subtitle,\n leading,\n titleSuffix,\n trailing,\n showDivider = true,\n showBackButton = false,\n showCloseButton = true,\n onBackButtonClick,\n onCloseButtonClick,\n closeButtonRef,\n backButtonRef,\n testID,\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n metaComponentName,\n paddingX,\n marginY,\n marginBottom,\n marginTop,\n size = 'large',\n isDisabled,\n children,\n trailingInteractionElement,\n backgroundImage,\n alignItems = 'flex-start',\n dividerProps,\n shouldAlignLeadingAndTrailingElementsToCenter = false,\n ...rest\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction({ trailing, size });\n const shouldWrapTitle = titleSuffix && trailing && showBackButton && showCloseButton;\n const hasOnlyChildren = children && !(title || subtitle || titleSuffix || leading);\n\n const webOnlyEventHandlers: Record<string, any> = isReactNative()\n ? {}\n : {\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n };\n\n const renderTrailingInteractionElementWithChildren = (): React.ReactNode => {\n if (trailingInteractionElement && children) {\n return (\n <Box\n alignSelf={shouldAlignLeadingAndTrailingElementsToCenter ? 'center' : 'flex-start'}\n {...centerBoxProps[size]}\n >\n {trailingInteractionElement}\n </Box>\n );\n }\n return null;\n };\n\n const renderTrailingInteractionElementWithoutChildren = (): React.ReactNode => {\n if (trailingInteractionElement && !children) {\n return (\n <Box\n {...centerBoxProps[size]}\n alignSelf={shouldAlignLeadingAndTrailingElementsToCenter ? 'center' : undefined}\n >\n {trailingInteractionElement}\n </Box>\n );\n }\n return null;\n };\n\n const renderLeadingElement = (): React.ReactNode => {\n if (Boolean(leading)) {\n return (\n <BaseBox\n marginRight=\"spacing.3\"\n {...centerBoxProps[size]}\n alignSelf={shouldAlignLeadingAndTrailingElementsToCenter ? 'center' : undefined}\n >\n {leading}\n </BaseBox>\n );\n }\n return null;\n };\n\n const renderTrailingElement = (): React.ReactNode => {\n if (shouldAlignLeadingAndTrailingElementsToCenter && validatedTrailingComponent) {\n return (\n <BaseBox marginRight=\"spacing.5\" display=\"flex\" alignItems=\"center\" justifyContent=\"center\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n );\n }\n if (validatedTrailingComponent) {\n return (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n );\n }\n return null;\n };\n\n return (\n <BaseBox\n {...metaAttribute({ name: metaComponentName, testID })}\n {...makeAnalyticsAttribute(rest)}\n backgroundImage={backgroundImage}\n >\n <BaseBox\n marginY={marginY ?? { base: 'spacing.5', m: 'spacing.6' }}\n paddingX={paddingX ?? { base: 'spacing.5', m: 'spacing.6' }}\n marginTop={marginTop}\n marginBottom={marginBottom}\n touchAction=\"none\"\n {...webOnlyEventHandlers}\n >\n <BaseBox position=\"relative\" display=\"flex\" flexDirection=\"row\" userSelect=\"none\">\n {showBackButton ? (\n <BaseBox overflow=\"visible\" marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>\n <IconButton\n ref={backButtonRef}\n size=\"large\"\n icon={ChevronLeftIcon}\n onClick={() => onBackButtonClick?.()}\n accessibilityLabel=\"Back\"\n />\n </Box>\n </BaseBox>\n ) : null}\n {hasOnlyChildren ? null : (\n <BaseBox\n paddingRight=\"spacing.5\"\n marginRight=\"auto\"\n flex=\"auto\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems={alignItems}\n >\n {renderLeadingElement()}\n <BaseBox flex=\"auto\">\n <BaseBox\n // Explicitly setting maxWidth in React Native because text is not being wrapped properly when multiple fix width components are rendered in header\n // In web, flex containers seem to work a expected\n // @todo: resolve this if we figure out some better solution later\n maxWidth={isReactNative() && shouldWrapTitle ? '100px' : undefined}\n flexShrink={0}\n display=\"flex\"\n flexDirection=\"row\"\n >\n {title ? (\n sizeTokensMapping[size].type === 'heading' ? (\n <Heading\n as=\"h2\"\n marginTop={makeSize(sizeToken['1'])}\n size={sizeTokensMapping[size].title}\n weight=\"semibold\"\n color={\n isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'\n }\n wordBreak=\"break-word\"\n >\n {title}\n </Heading>\n ) : (\n <Text\n size={sizeTokensMapping[size].title}\n marginTop={makeSize(sizeToken['1'])}\n weight=\"semibold\"\n color={\n isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'\n }\n wordBreak=\"break-word\"\n >\n {title}\n </Text>\n )\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps[size]}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text\n variant=\"body\"\n size=\"small\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n >\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n )}\n {renderTrailingElement()}\n\n {showCloseButton ? (\n <Box {...(hasOnlyChildren ? absolutePositionedButton : centerBoxProps[size])}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n {renderTrailingInteractionElementWithoutChildren()}\n </BaseBox>\n <BaseBox\n display=\"flex\"\n width=\"100%\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n >\n <Box width=\"100%\">{children}</Box>\n {renderTrailingInteractionElementWithChildren()}\n </BaseBox>\n </BaseBox>\n {showDivider ? <Divider {...dividerProps} /> : null}\n </BaseBox>\n );\n};\n\nconst BaseHeader = assignWithoutSideEffects(_BaseHeader, {\n componentId: 'BaseHeader',\n});\n\nexport type { BaseHeaderProps };\nexport { BaseHeader };\n"],"names":["commonCenterBoxProps","display","alignItems","justifyContent","centerBoxProps","xlarge","Object","assign","height","large","medium","absolutePositionedButton","position","top","right","sizeTokensMapping","title","type","propRestrictionMap","Button","size","variant","IconButton","Badge","Link","Text","Amount","useTrailingRestriction","_ref","trailing","_React$useState","React","useState","_React$useState2","_slicedToArray","validatedTrailingComponent","setValidatedTrailingComponent","useEffect","isValidElement","trailingComponentType","getComponentId","restrictedProps","allowedComponents","keys","__DEV__","throwBladeError","message","join","moduleName","restrictedPropKeys","prop","_trailing$props","props","hasOwnProperty","logger","cloneElement","_BaseHeader","_ref2","subtitle","leading","titleSuffix","_ref2$showDivider","showDivider","_ref2$showBackButton","showBackButton","_ref2$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","paddingX","marginY","marginBottom","marginTop","_ref2$size","isDisabled","children","trailingInteractionElement","backgroundImage","_ref2$alignItems","dividerProps","_ref2$shouldAlignLead","shouldAlignLeadingAndTrailingElementsToCenter","rest","_objectWithoutProperties","_excluded","shouldWrapTitle","hasOnlyChildren","webOnlyEventHandlers","isReactNative","renderTrailingInteractionElementWithChildren","_jsx","Box","alignSelf","renderTrailingInteractionElementWithoutChildren","undefined","renderLeadingElement","Boolean","BaseBox","marginRight","renderTrailingElement","_jsxs","metaAttribute","name","makeAnalyticsAttribute","base","m","touchAction","flexDirection","userSelect","overflow","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","flexShrink","Heading","as","makeSize","sizeToken","weight","color","wordBreak","marginLeft","CloseIcon","width","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;siBAkHA,IAAMA,oBAA8B,CAAG,CACrCC,OAAO,CAAE,MAAM,CACfC,UAAU,CAAE,QAAQ,CACpBC,cAAc,CAAE,QAClB,CAAC,CAED,IAAMC,cAAuE,CAAG,CAC9EC,MAAM,CAAAC,MAAA,CAAAC,MAAA,CACDP,EAAAA,CAAAA,oBAAoB,CACvBQ,CAAAA,MAAM,CAAE,MAAM,CAAA,CACf,CACDC,KAAK,CAAAH,MAAA,CAA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AAU,CAChBb,kBAAkB,CAAC,OAAO,CAC1BD,OAAO,CAAE,SAAAA,SAAM,CAAA,OAAAzD,kBAAkB,EAAA,IAAA,CAAA,KAAA,CAAA,CAAlBA,kBAAkB,EAAI,CAAC,CAAA,CACvC,CAAC,CAAA,CACC,CAAC,CACJ,IAAI,CACPqC,+CAA+C,EAAE,CAC3C,CAAA,CAAC,CACVO,IAAA,CAACH,OAAO,CAAA,CACN5G,OAAO,CAAC,MAAM,CACd2I,KAAK,CAAC,MAAM,CACZrB,aAAa,CAAC,KAAK,CACnBrH,UAAU,CAAC,QAAQ,CACnBC,cAAc,CAAC,eAAe,CAAAoF,QAAA,CAAA,CAE9Be,GAAA,CAACC,GAAG,CAACqC,CAAAA,KAAK,CAAC,MAAM,CAAArD,QAAA,CAAEA,QAAQ,CAAM,CAAC,CACjCc,4CAA4C,EAAE,CACxC,CAAA,CAAC,CACH,CAAA,CAAA,CAAC,CACTvC,WAAW,CAAGwC,GAAA,CAACuC,OAAO,CAAAvI,MAAA,CAAAC,MAAA,IAAKoF,YAAY,CAAG,CAAC,CAAG,IAAI,CAAA,CAAA,CAC5C,CAAC,CAEd,CAAC,CAEK,IAAAmD,UAAU,CAAGC,wBAAwB,CAACvF,WAAW,CAAE,CACvDwF,WAAW,CAAE,YACf,CAAC;;;;"}
1
+ {"version":3,"file":"BaseHeader.js","sources":["../../../../../src/components/BaseHeaderFooter/BaseHeader.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport type { ReactDOMAttributes } from '@use-gesture/react/dist/declarations/src/types';\nimport { Divider } from '~components/Divider';\nimport type { DividerProps } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Heading, Text } from '~components/Typography';\nimport { IconButton } from '~components/Button/IconButton';\nimport { ChevronLeftIcon, CloseIcon } from '~components/Icons';\nimport type { DataAnalyticsAttribute, TestID, ElementTiming } from '~utils/types';\nimport type { BoxProps } from '~components/Box';\nimport { Box } from '~components/Box';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { isReactNative, makeSize } from '~utils';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport { logger, throwBladeError } from '~utils/logger';\nimport { size as sizeToken } from '~tokens/global';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype BaseHeaderProps = {\n title?: string;\n subtitle?: string;\n /**\n * Leading part of the header placed at the left most side of the header\n */\n leading?: React.ReactNode;\n /**\n * Trailing part of the header placed at the right most side of the header\n */\n trailing?: React.ReactNode;\n /**\n * Placed adjacent to the title text\n */\n titleSuffix?: React.ReactNode;\n /**\n * @default true\n */\n showDivider?: boolean;\n /**\n * @default false\n */\n showBackButton?: boolean;\n\n /**\n * Slot for rendering any trailing interaction element into BaseHeader.\n *\n * E.g. Used in accordion to render CollapsibleChevronIcon\n */\n trailingInteractionElement?: React.ReactNode;\n\n /**\n * Decides size of the Header\n */\n size?: 'xlarge' | 'large' | 'medium';\n /**\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Disabled state of BaseHeader\n *\n * @default false\n */\n isDisabled?: boolean;\n\n paddingX?: BoxProps['paddingX'];\n marginY?: BoxProps['marginY'];\n marginTop?: BoxProps['marginTop'];\n marginBottom?: BoxProps['marginBottom'];\n alignItems?: BoxProps['alignItems'];\n dividerProps?: DividerProps;\n\n onCloseButtonClick?: () => void;\n onBackButtonClick?: () => void;\n closeButtonRef?: React.MutableRefObject<any>;\n backButtonRef?: React.MutableRefObject<any>;\n metaComponentName?: string;\n /**\n * inner child of BottomSheetHeader. Meant to be used for AutoComplete only\n */\n children?: React.ReactElement | React.ReactElement[];\n /**\n * Background image of the header\n *\n * You can use this for adding gradients.\n */\n backgroundImage?: BoxProps['backgroundImage'];\n /**\n * So we add a wrapper with custom styles in elements like leading, trailing interaction elements and trailing.\n * this props allows you to control that.\n *\n * For example, in Accordion, we add a wrapper with flex to center the icon (in some cases)\n *\n * @default false\n */\n shouldAlignLeadingAndTrailingElementsToCenter?: boolean;\n} & Pick<\n ReactDOMAttributes,\n | 'onClickCapture'\n | 'onKeyDown'\n | 'onKeyUp'\n | 'onLostPointerCapture'\n | 'onPointerCancel'\n | 'onPointerDown'\n | 'onPointerMove'\n | 'onPointerUp'\n> &\n TestID &\n ElementTiming &\n DataAnalyticsAttribute;\n\ntype TrailingComponents = 'Button' | 'Badge' | 'Link' | 'Text' | 'Amount';\n\nconst commonCenterBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nconst centerBoxProps: { xlarge: BoxProps; large: BoxProps; medium: BoxProps } = {\n xlarge: {\n ...commonCenterBoxProps,\n height: '28px',\n },\n large: {\n ...commonCenterBoxProps,\n // We want to align title, icon, titleSuffix, trailing, closeButton to baseline\n // But we also want to keep them center aligned to each other\n // So we add a virtual Box around these slots with 28px and center align them to that box\n // We have done similar thing in figma as well (which is where this 28px comes from)\n height: '28px',\n },\n medium: {\n ...commonCenterBoxProps,\n height: '20px',\n },\n};\n\nconst absolutePositionedButton = {\n position: 'absolute',\n top: 'spacing.0',\n right: 'spacing.0',\n} as const;\n\nconst sizeTokensMapping = {\n xlarge: {\n title: 'small',\n type: 'heading',\n },\n large: {\n title: 'large',\n type: 'text',\n },\n medium: {\n title: 'medium',\n type: 'text',\n },\n} as const;\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n large: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n IconButton: {\n size: 'large',\n },\n Badge: {\n size: 'medium',\n },\n Link: {\n size: 'medium',\n },\n Text: {\n size: 'medium',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'medium',\n },\n },\n xlarge: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n IconButton: {\n size: 'large',\n },\n Badge: {\n size: 'medium',\n },\n Link: {\n size: 'medium',\n },\n Text: {\n size: 'medium',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'medium',\n },\n },\n medium: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n IconButton: {\n size: 'large',\n },\n Badge: {\n size: 'small',\n },\n Link: {\n size: 'small',\n },\n Text: {\n size: 'small',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'small',\n },\n },\n} as const;\n\nconst useTrailingRestriction = ({\n trailing,\n size,\n}: {\n size: NonNullable<BaseHeaderProps['size']>;\n trailing: BaseHeaderProps['trailing'];\n}): React.ReactNode => {\n const [\n validatedTrailingComponent,\n setValidatedTrailingComponent,\n ] = React.useState<React.ReactElement | null>(null);\n\n // validate and restrict sub component props in trailing prop\n React.useEffect(() => {\n if (React.isValidElement(trailing)) {\n const trailingComponentType = getComponentId(trailing) as TrailingComponents;\n const restrictedProps = propRestrictionMap[size][trailingComponentType];\n\n const allowedComponents = Object.keys(propRestrictionMap[size]);\n if (__DEV__) {\n if (!restrictedProps) {\n throwBladeError({\n message: `Only one of \\`${allowedComponents.join(\n ', ',\n )}\\` component is accepted as trailing`,\n moduleName: 'Header',\n });\n }\n }\n\n const restrictedPropKeys = Object.keys(propRestrictionMap[size][trailingComponentType]);\n for (const prop of restrictedPropKeys) {\n if (trailing?.props?.hasOwnProperty(prop)) {\n logger({\n message: `Do not pass \"${prop}\" to \"${trailingComponentType}\" while inside Header trailing, because we override it.`,\n moduleName: 'Header',\n type: 'warn',\n });\n }\n }\n setValidatedTrailingComponent(\n React.cloneElement(trailing as React.ReactElement, restrictedProps),\n );\n }\n }, [trailing, size]);\n\n return validatedTrailingComponent;\n};\n\nconst _BaseHeader = ({\n title,\n subtitle,\n leading,\n titleSuffix,\n trailing,\n showDivider = true,\n showBackButton = false,\n showCloseButton = true,\n onBackButtonClick,\n onCloseButtonClick,\n closeButtonRef,\n backButtonRef,\n testID,\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n metaComponentName,\n paddingX,\n marginY,\n marginBottom,\n marginTop,\n size = 'large',\n isDisabled,\n children,\n trailingInteractionElement,\n backgroundImage,\n alignItems = 'flex-start',\n dividerProps,\n shouldAlignLeadingAndTrailingElementsToCenter = false,\n ...rest\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction({ trailing, size });\n const shouldWrapTitle = titleSuffix && trailing && showBackButton && showCloseButton;\n const hasOnlyChildren = children && !(title || subtitle || titleSuffix || leading);\n\n const webOnlyEventHandlers: Record<string, any> = isReactNative()\n ? {}\n : {\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n };\n\n const renderTrailingInteractionElementWithChildren = (): React.ReactNode => {\n if (trailingInteractionElement && children) {\n return (\n <Box\n alignSelf={shouldAlignLeadingAndTrailingElementsToCenter ? 'center' : 'flex-start'}\n {...centerBoxProps[size]}\n >\n {trailingInteractionElement}\n </Box>\n );\n }\n return null;\n };\n\n const renderTrailingInteractionElementWithoutChildren = (): React.ReactNode => {\n if (trailingInteractionElement && !children) {\n return (\n <Box\n {...centerBoxProps[size]}\n alignSelf={shouldAlignLeadingAndTrailingElementsToCenter ? 'center' : undefined}\n >\n {trailingInteractionElement}\n </Box>\n );\n }\n return null;\n };\n\n const renderLeadingElement = (): React.ReactNode => {\n if (Boolean(leading)) {\n return (\n <BaseBox\n marginRight=\"spacing.3\"\n {...centerBoxProps[size]}\n alignSelf={shouldAlignLeadingAndTrailingElementsToCenter ? 'center' : undefined}\n >\n {leading}\n </BaseBox>\n );\n }\n return null;\n };\n\n const renderTrailingElement = (): React.ReactNode => {\n if (shouldAlignLeadingAndTrailingElementsToCenter && validatedTrailingComponent) {\n return (\n <BaseBox marginRight=\"spacing.5\" display=\"flex\" alignItems=\"center\" justifyContent=\"center\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n );\n }\n if (validatedTrailingComponent) {\n return (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n );\n }\n return null;\n };\n\n return (\n <BaseBox\n {...metaAttribute({ name: metaComponentName, testID })}\n {...makeAnalyticsAttribute(rest)}\n backgroundImage={backgroundImage}\n >\n <BaseBox\n marginY={marginY ?? { base: 'spacing.5', m: 'spacing.6' }}\n paddingX={paddingX ?? { base: 'spacing.5', m: 'spacing.6' }}\n marginTop={marginTop}\n marginBottom={marginBottom}\n touchAction=\"none\"\n {...webOnlyEventHandlers}\n >\n <BaseBox position=\"relative\" display=\"flex\" flexDirection=\"row\" userSelect=\"none\">\n {showBackButton ? (\n <BaseBox overflow=\"visible\" marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>\n <IconButton\n ref={backButtonRef}\n size=\"large\"\n icon={ChevronLeftIcon}\n onClick={() => onBackButtonClick?.()}\n accessibilityLabel=\"Back\"\n />\n </Box>\n </BaseBox>\n ) : null}\n {hasOnlyChildren ? null : (\n <BaseBox\n paddingRight=\"spacing.5\"\n marginRight=\"auto\"\n flex=\"auto\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems={alignItems}\n >\n {renderLeadingElement()}\n <BaseBox flex=\"auto\">\n <BaseBox\n // Explicitly setting maxWidth in React Native because text is not being wrapped properly when multiple fix width components are rendered in header\n // In web, flex containers seem to work a expected\n // @todo: resolve this if we figure out some better solution later\n maxWidth={isReactNative() && shouldWrapTitle ? '100px' : undefined}\n flexShrink={0}\n display=\"flex\"\n flexDirection=\"row\"\n >\n {title ? (\n sizeTokensMapping[size].type === 'heading' ? (\n <Heading\n as=\"h2\"\n marginTop={makeSize(sizeToken['1'])}\n size={sizeTokensMapping[size].title}\n weight=\"semibold\"\n color={\n isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'\n }\n wordBreak=\"break-word\"\n >\n {title}\n </Heading>\n ) : (\n <Text\n size={sizeTokensMapping[size].title}\n marginTop={makeSize(sizeToken['1'])}\n weight=\"semibold\"\n color={\n isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'\n }\n wordBreak=\"break-word\"\n >\n {title}\n </Text>\n )\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps[size]}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text\n variant=\"body\"\n size=\"small\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n >\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n )}\n {renderTrailingElement()}\n\n {showCloseButton ? (\n <Box {...(hasOnlyChildren ? absolutePositionedButton : centerBoxProps[size])}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n {renderTrailingInteractionElementWithoutChildren()}\n </BaseBox>\n <BaseBox\n display=\"flex\"\n width=\"100%\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n >\n <Box width=\"100%\">{children}</Box>\n {renderTrailingInteractionElementWithChildren()}\n </BaseBox>\n </BaseBox>\n {showDivider ? <Divider {...dividerProps} /> : null}\n </BaseBox>\n );\n};\n\nconst BaseHeader = assignWithoutSideEffects(_BaseHeader, {\n componentId: 'BaseHeader',\n});\n\nexport type { BaseHeaderProps };\nexport { BaseHeader };\n"],"names":["commonCenterBoxProps","display","alignItems","justifyContent","centerBoxProps","xlarge","Object","assign","height","large","medium","absolutePositionedButton","position","top","right","sizeTokensMapping","title","type","propRestrictionMap","Button","size","variant","IconButton","Badge","Link","Text","Amount","useTrailingRestriction","_ref","trailing","_React$useState","React","useState","_React$useState2","_slicedToArray","validatedTrailingComponent","setValidatedTrailingComponent","useEffect","isValidElement","trailingComponentType","getComponentId","restrictedProps","allowedComponents","keys","__DEV__","throwBladeError","message","join","moduleName","restrictedPropKeys","prop","_trailing$props","props","hasOwnProperty","logger","cloneElement","_BaseHeader","_ref2","subtitle","leading","titleSuffix","_ref2$showDivider","showDivider","_ref2$showBackButton","showBackButton","_ref2$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","paddingX","marginY","marginBottom","marginTop","_ref2$size","isDisabled","children","trailingInteractionElement","backgroundImage","_ref2$alignItems","dividerProps","_ref2$shouldAlignLead","shouldAlignLeadingAndTrailingElementsToCenter","rest","_objectWithoutProperties","_excluded","shouldWrapTitle","hasOnlyChildren","webOnlyEventHandlers","isReactNative","renderTrailingInteractionElementWithChildren","_jsx","Box","alignSelf","renderTrailingInteractionElementWithoutChildren","undefined","renderLeadingElement","Boolean","BaseBox","marginRight","renderTrailingElement","_jsxs","metaAttribute","name","makeAnalyticsAttribute","base","m","touchAction","flexDirection","userSelect","overflow","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","flexShrink","Heading","as","makeSize","sizeToken","weight","color","wordBreak","marginLeft","CloseIcon","width","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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3,"file":"propsTypes.js","sources":["../../../../../../../src/components/Box/BaseBox/types/propsTypes.ts"],"sourcesContent":["import type { View } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport type { MarginProps, PaddingProps, SpacingValueType } from './spacingTypes';\nimport type { MakeObjectResponsive } from './responsiveTypes';\nimport type { Theme } from '~components/BladeProvider';\nimport type { Border, Elevation } from '~tokens/global';\nimport type { DataAnalyticsAttribute, PickCSSByPlatform, TestID } from '~utils/types';\nimport type { Platform } from '~utils';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\ntype LayoutProps = MakeObjectResponsive<\n {\n height: SpacingValueType;\n minHeight: SpacingValueType;\n maxHeight: SpacingValueType;\n width: SpacingValueType;\n minWidth: SpacingValueType;\n maxWidth: SpacingValueType;\n } & PickCSSByPlatform<\n 'display' | 'overflow' | 'overflowX' | 'overflowY' | 'textAlign' | 'whiteSpace'\n >\n>;\n\ntype FlexboxProps = MakeObjectResponsive<\n {\n /**\n * This uses the native gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=gap\n */\n gap: SpacingValueType;\n /**\n * This uses the native row-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=row-gap\n */\n rowGap: SpacingValueType;\n /**\n * This uses the native column-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=column-gap\n */\n columnGap: SpacingValueType;\n /**\n * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container.\n *\n * @see https://developer.mozilla.org/docs/Web/CSS/flex\n */\n flex: string | number;\n } & PickCSSByPlatform<\n | 'flexWrap'\n | 'flexDirection'\n | 'flexGrow'\n | 'flexShrink'\n | 'flexBasis'\n | 'alignItems'\n | 'alignContent'\n | 'alignSelf'\n | 'justifyItems'\n | 'justifyContent'\n | 'justifySelf'\n | 'placeSelf'\n | 'placeItems'\n | 'order'\n >\n>;\n\ntype PositionProps = MakeObjectResponsive<\n {\n top: SpacingValueType;\n right: SpacingValueType;\n bottom: SpacingValueType;\n left: SpacingValueType;\n } & PickCSSByPlatform<'position' | 'zIndex'>\n>;\n\ntype GridProps = MakeObjectResponsive<\n PickCSSByPlatform<\n | 'grid'\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n | 'gridAutoFlow'\n | 'gridAutoRows'\n | 'gridAutoColumns'\n | 'gridTemplate'\n | 'gridTemplateAreas'\n | 'gridTemplateColumns'\n | 'gridTemplateRows'\n >\n>;\n\ntype ColorObjects = 'feedback' | 'surface' | 'interactive';\ntype BorderOnlyColorObjects = 'popup';\ntype BackgroundOnlyColorObjects = 'popup' | 'overlay';\ntype BackgroundColorString<\n T extends ColorObjects | BackgroundOnlyColorObjects\n> = `${T}.background.${DotNotationToken<Theme['colors'][T]['background']>}`;\ntype BorderColorString<\n T extends ColorObjects | BorderOnlyColorObjects\n> = `${T}.border.${DotNotationToken<Theme['colors'][T]['border']>}`;\n\n// Created this as an array so I can reuse it for runtime validation\nconst validBoxAsValues = [\n 'div',\n 'section',\n 'footer',\n 'header',\n 'main',\n 'aside',\n 'nav',\n 'span',\n 'label',\n] as const;\n\ntype BoxAsType = typeof validBoxAsValues[number];\n\n// Visual props that are common for both Box and BaseBox\ntype CommonBoxVisualProps = MakeObjectResponsive<\n {\n borderRadius: keyof Border['radius'];\n borderWidth: keyof Border['width'];\n borderColor:\n | BorderColorString<'surface'>\n | BorderColorString<'popup'>\n | BorderColorString<'interactive'>;\n borderTopWidth: keyof Border['width'];\n borderTopColor: BorderColorString<'surface'>;\n borderRightWidth: keyof Border['width'];\n borderRightColor: BorderColorString<'surface'>;\n borderBottomWidth: keyof Border['width'];\n borderBottomColor: BorderColorString<'surface'>;\n borderLeftWidth: keyof Border['width'];\n borderLeftColor: BorderColorString<'surface'>;\n borderTopLeftRadius: keyof Border['radius'];\n borderTopRightRadius: keyof Border['radius'];\n borderBottomRightRadius: keyof Border['radius'];\n borderBottomLeftRadius: keyof Border['radius'];\n } & PickCSSByPlatform<\n | 'backgroundImage'\n | 'backgroundSize'\n | 'backgroundPosition'\n | 'backgroundOrigin'\n | 'backgroundRepeat'\n | 'pointerEvents'\n | 'opacity'\n | 'visibility'\n | 'transform'\n | 'transformOrigin'\n | 'clipPath'\n | 'borderStyle'\n | 'borderTopStyle'\n | 'borderBottomStyle'\n | 'borderLeftStyle'\n | 'borderRightStyle'\n | 'backdropFilter'\n | 'transition'\n > & {\n /**\n * Sets the elevation for Box\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n */\n elevation?: keyof Elevation;\n }\n>;\n\n// Visual props that are specific BaseBox\n// This is used to ensure some of the more flexible BaseBox props are not passed to Box\ntype BaseBoxVisualProps = MakeObjectResponsive<\n {\n backgroundColor:\n | BackgroundColorString<'feedback'>\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'interactive'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'popup'>\n | 'transparent'\n | (string & Record<never, never>);\n lineHeight: SpacingValueType;\n touchAction: CSSObject['touchAction'];\n userSelect: CSSObject['userSelect'];\n } & PickCSSByPlatform<\n | 'border'\n | 'borderLeft'\n | 'borderRight'\n | 'borderTop'\n | 'borderBottom'\n | 'opacity'\n | 'pointerEvents'\n | 'cursor'\n >\n>;\n\n// Visual props that are specific to Box\ntype BoxVisualProps = MakeObjectResponsive<{\n backgroundColor:\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'feedback'>\n | 'transparent';\n}> & {\n // Intentionally keeping this outside of MakeObjectResponsive since we only want as to be string and not responsive object\n // styled-components do not support passing `as` prop as an object\n as: BoxAsType;\n};\n\ntype StyledPropsBlade = Partial<\n Omit<\n MarginProps &\n Pick<FlexboxProps, 'alignSelf' | 'justifySelf' | 'placeSelf' | 'order' | 'flexWrap'> &\n PositionProps &\n Pick<\n GridProps,\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n > &\n Pick<LayoutProps, 'display'> &\n Pick<CommonBoxVisualProps, 'visibility'>,\n '__brand__'\n >\n>;\n\ntype BoxCallbackProps = Omit<\n Platform.Select<{\n web: {\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseOver: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseEnter: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseLeave: React.MouseEventHandler<HTMLElement>;\n onScroll: React.UIEventHandler<HTMLElement>;\n };\n native: Record<'onMouseOver' | 'onMouseEnter' | 'onMouseLeave' | 'onScroll', undefined>;\n }>,\n '__brand__'\n>;\n\ntype BoxDragAndDropProps = Omit<\n Platform.Select<{\n web: {\n draggable: boolean;\n onDragStart: React.DragEventHandler<HTMLElement>;\n onDragEnter: React.DragEventHandler<HTMLElement>;\n onDragLeave: React.DragEventHandler<HTMLElement>;\n onDragOver: React.DragEventHandler<HTMLElement>;\n onDragEnd: React.DragEventHandler<HTMLElement>;\n onDrop: React.DragEventHandler<HTMLElement>;\n };\n native: Record<\n | 'draggable'\n | 'onDragStart'\n | 'onDragEnter'\n | 'onDragLeave'\n | 'onDragOver'\n | 'onDragEnd'\n | 'onDrop',\n undefined\n >;\n }>,\n '__brand__'\n>;\n\ntype BoxProps = Partial<\n PaddingProps &\n MarginProps &\n LayoutProps &\n FlexboxProps &\n PositionProps &\n GridProps &\n BoxCallbackProps &\n BoxDragAndDropProps &\n CommonBoxVisualProps &\n BoxVisualProps & {\n children?: React.ReactNode | React.ReactNode[];\n tabIndex?: number;\n id?: string;\n } & TestID &\n DataAnalyticsAttribute\n>;\n\n// Visual props have different types for BaseBox and Box. BaseBox has more flexible types and more props exposed.\n// So first we Omit Visual props of Box\n// Then we append BaseBoxVisualProps and some other props for styled-components like class and id\ntype BaseBoxProps = Omit<BoxProps, keyof BoxVisualProps> &\n Partial<\n DataAnalyticsAttribute &\n BaseBoxVisualProps & {\n className?: string;\n id?: string;\n tabIndex?: number;\n }\n > &\n BladeCommonEvents;\n\n// ref prop type\ntype BoxRefType = Platform.Select<{\n web: Omit<HTMLElement, 'style'>;\n native: View;\n}>;\n\nexport type { BaseBoxProps, BoxProps, BoxRefType, StyledPropsBlade, FlexboxProps, GridProps };\nexport { validBoxAsValues };\n"],"names":["validBoxAsValues"],"mappings":"AA+GM,IAAAA,gBAAgB,CAAG,CACvB,KAAK,CACL,SAAS,CACT,QAAQ,CACR,QAAQ,CACR,MAAM,CACN,OAAO,CACP,KAAK,CACL,MAAM,CACN,OAAO;;;;"}
1
+ {"version":3,"file":"propsTypes.js","sources":["../../../../../../../src/components/Box/BaseBox/types/propsTypes.ts"],"sourcesContent":["import type { View } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport type { MarginProps, PaddingProps, SpacingValueType } from './spacingTypes';\nimport type { MakeObjectResponsive } from './responsiveTypes';\nimport type { Theme } from '~components/BladeProvider';\nimport type { Border, Elevation } from '~tokens/global';\nimport type {\n DataAnalyticsAttribute,\n PickCSSByPlatform,\n TestID,\n ElementTiming,\n} from '~utils/types';\nimport type { Platform } from '~utils';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\ntype LayoutProps = MakeObjectResponsive<\n {\n height: SpacingValueType;\n minHeight: SpacingValueType;\n maxHeight: SpacingValueType;\n width: SpacingValueType;\n minWidth: SpacingValueType;\n maxWidth: SpacingValueType;\n } & PickCSSByPlatform<\n 'display' | 'overflow' | 'overflowX' | 'overflowY' | 'textAlign' | 'whiteSpace'\n >\n>;\n\ntype FlexboxProps = MakeObjectResponsive<\n {\n /**\n * This uses the native gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=gap\n */\n gap: SpacingValueType;\n /**\n * This uses the native row-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=row-gap\n */\n rowGap: SpacingValueType;\n /**\n * This uses the native column-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=column-gap\n */\n columnGap: SpacingValueType;\n /**\n * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container.\n *\n * @see https://developer.mozilla.org/docs/Web/CSS/flex\n */\n flex: string | number;\n } & PickCSSByPlatform<\n | 'flexWrap'\n | 'flexDirection'\n | 'flexGrow'\n | 'flexShrink'\n | 'flexBasis'\n | 'alignItems'\n | 'alignContent'\n | 'alignSelf'\n | 'justifyItems'\n | 'justifyContent'\n | 'justifySelf'\n | 'placeSelf'\n | 'placeItems'\n | 'order'\n >\n>;\n\ntype PositionProps = MakeObjectResponsive<\n {\n top: SpacingValueType;\n right: SpacingValueType;\n bottom: SpacingValueType;\n left: SpacingValueType;\n } & PickCSSByPlatform<'position' | 'zIndex'>\n>;\n\ntype GridProps = MakeObjectResponsive<\n PickCSSByPlatform<\n | 'grid'\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n | 'gridAutoFlow'\n | 'gridAutoRows'\n | 'gridAutoColumns'\n | 'gridTemplate'\n | 'gridTemplateAreas'\n | 'gridTemplateColumns'\n | 'gridTemplateRows'\n >\n>;\n\ntype ColorObjects = 'feedback' | 'surface' | 'interactive';\ntype BorderOnlyColorObjects = 'popup';\ntype BackgroundOnlyColorObjects = 'popup' | 'overlay';\ntype BackgroundColorString<\n T extends ColorObjects | BackgroundOnlyColorObjects\n> = `${T}.background.${DotNotationToken<Theme['colors'][T]['background']>}`;\ntype BorderColorString<\n T extends ColorObjects | BorderOnlyColorObjects\n> = `${T}.border.${DotNotationToken<Theme['colors'][T]['border']>}`;\n\n// Created this as an array so I can reuse it for runtime validation\nconst validBoxAsValues = [\n 'div',\n 'section',\n 'footer',\n 'header',\n 'main',\n 'aside',\n 'nav',\n 'span',\n 'label',\n] as const;\n\ntype BoxAsType = typeof validBoxAsValues[number];\n\n// Visual props that are common for both Box and BaseBox\ntype CommonBoxVisualProps = MakeObjectResponsive<\n {\n borderRadius: keyof Border['radius'];\n borderWidth: keyof Border['width'];\n borderColor:\n | BorderColorString<'surface'>\n | BorderColorString<'popup'>\n | BorderColorString<'interactive'>;\n borderTopWidth: keyof Border['width'];\n borderTopColor: BorderColorString<'surface'>;\n borderRightWidth: keyof Border['width'];\n borderRightColor: BorderColorString<'surface'>;\n borderBottomWidth: keyof Border['width'];\n borderBottomColor: BorderColorString<'surface'>;\n borderLeftWidth: keyof Border['width'];\n borderLeftColor: BorderColorString<'surface'>;\n borderTopLeftRadius: keyof Border['radius'];\n borderTopRightRadius: keyof Border['radius'];\n borderBottomRightRadius: keyof Border['radius'];\n borderBottomLeftRadius: keyof Border['radius'];\n } & PickCSSByPlatform<\n | 'backgroundImage'\n | 'backgroundSize'\n | 'backgroundPosition'\n | 'backgroundOrigin'\n | 'backgroundRepeat'\n | 'pointerEvents'\n | 'opacity'\n | 'visibility'\n | 'transform'\n | 'transformOrigin'\n | 'clipPath'\n | 'borderStyle'\n | 'borderTopStyle'\n | 'borderBottomStyle'\n | 'borderLeftStyle'\n | 'borderRightStyle'\n | 'backdropFilter'\n | 'transition'\n > & {\n /**\n * Sets the elevation for Box\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n */\n elevation?: keyof Elevation;\n }\n>;\n\n// Visual props that are specific BaseBox\n// This is used to ensure some of the more flexible BaseBox props are not passed to Box\ntype BaseBoxVisualProps = MakeObjectResponsive<\n {\n backgroundColor:\n | BackgroundColorString<'feedback'>\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'interactive'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'popup'>\n | 'transparent'\n | (string & Record<never, never>);\n lineHeight: SpacingValueType;\n touchAction: CSSObject['touchAction'];\n userSelect: CSSObject['userSelect'];\n } & PickCSSByPlatform<\n | 'border'\n | 'borderLeft'\n | 'borderRight'\n | 'borderTop'\n | 'borderBottom'\n | 'opacity'\n | 'pointerEvents'\n | 'cursor'\n >\n>;\n\n// Visual props that are specific to Box\ntype BoxVisualProps = MakeObjectResponsive<{\n backgroundColor:\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'feedback'>\n | 'transparent';\n}> & {\n // Intentionally keeping this outside of MakeObjectResponsive since we only want as to be string and not responsive object\n // styled-components do not support passing `as` prop as an object\n as: BoxAsType;\n};\n\ntype StyledPropsBlade = Partial<\n Omit<\n MarginProps &\n Pick<FlexboxProps, 'alignSelf' | 'justifySelf' | 'placeSelf' | 'order' | 'flexWrap'> &\n PositionProps &\n Pick<\n GridProps,\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n > &\n Pick<LayoutProps, 'display'> &\n Pick<CommonBoxVisualProps, 'visibility'>,\n '__brand__'\n >\n>;\n\ntype BoxCallbackProps = Omit<\n Platform.Select<{\n web: {\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseOver: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseEnter: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseLeave: React.MouseEventHandler<HTMLElement>;\n onScroll: React.UIEventHandler<HTMLElement>;\n };\n native: Record<'onMouseOver' | 'onMouseEnter' | 'onMouseLeave' | 'onScroll', undefined>;\n }>,\n '__brand__'\n>;\n\ntype BoxDragAndDropProps = Omit<\n Platform.Select<{\n web: {\n draggable: boolean;\n onDragStart: React.DragEventHandler<HTMLElement>;\n onDragEnter: React.DragEventHandler<HTMLElement>;\n onDragLeave: React.DragEventHandler<HTMLElement>;\n onDragOver: React.DragEventHandler<HTMLElement>;\n onDragEnd: React.DragEventHandler<HTMLElement>;\n onDrop: React.DragEventHandler<HTMLElement>;\n };\n native: Record<\n | 'draggable'\n | 'onDragStart'\n | 'onDragEnter'\n | 'onDragLeave'\n | 'onDragOver'\n | 'onDragEnd'\n | 'onDrop',\n undefined\n >;\n }>,\n '__brand__'\n>;\n\ntype BoxProps = Partial<\n PaddingProps &\n MarginProps &\n LayoutProps &\n FlexboxProps &\n PositionProps &\n GridProps &\n BoxCallbackProps &\n BoxDragAndDropProps &\n CommonBoxVisualProps &\n BoxVisualProps & {\n children?: React.ReactNode | React.ReactNode[];\n tabIndex?: number;\n id?: string;\n } & TestID &\n ElementTiming &\n DataAnalyticsAttribute\n>;\n\n// Visual props have different types for BaseBox and Box. BaseBox has more flexible types and more props exposed.\n// So first we Omit Visual props of Box\n// Then we append BaseBoxVisualProps and some other props for styled-components like class and id\ntype BaseBoxProps = Omit<BoxProps, keyof BoxVisualProps> &\n Partial<\n DataAnalyticsAttribute &\n BaseBoxVisualProps & {\n className?: string;\n id?: string;\n tabIndex?: number;\n } & ElementTiming\n > &\n BladeCommonEvents;\n\n// ref prop type\ntype BoxRefType = Platform.Select<{\n web: Omit<HTMLElement, 'style'>;\n native: View;\n}>;\n\nexport type { BaseBoxProps, BoxProps, BoxRefType, StyledPropsBlade, FlexboxProps, GridProps };\nexport { validBoxAsValues };\n"],"names":["validBoxAsValues"],"mappings":"AAoHM,IAAAA,gBAAgB,CAAG,CACvB,KAAK,CACL,SAAS,CACT,QAAQ,CACR,QAAQ,CACR,MAAM,CACN,OAAO,CACP,KAAK,CACL,MAAM,CACN,OAAO;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Box.js","sources":["../../../../../src/components/Box/Box.tsx"],"sourcesContent":["import React from 'react';\nimport BaseBox from './BaseBox';\nimport type { BoxProps, BoxRefType, MakeValueResponsive } from './BaseBox/types';\nimport { validBoxAsValues } from './BaseBox/types/propsTypes';\nimport type { KeysRequired } from '~utils/types';\nimport { isReactNative } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst validateBackgroundString = (stringBackgroundColorValue: string): void => {\n if (__DEV__) {\n if (\n !stringBackgroundColorValue.startsWith('surface.background') &&\n !stringBackgroundColorValue.startsWith('overlay.') &&\n !stringBackgroundColorValue.startsWith('feedback.background') &&\n stringBackgroundColorValue !== 'transparent'\n ) {\n throwBladeError({\n message: `Oops! Currently you can only use \\`transparent\\`, \\`surface.background.*\\`, and \\`overlay.*\\` tokens with backgroundColor property but we received \\`${stringBackgroundColorValue}\\` instead.\\n\\n Do you have a usecase of using other values? Create an issue on https://github.com/razorpay/blade repo to let us know and we can discuss ✨`,\n moduleName: 'Box',\n });\n }\n }\n};\n\nconst validateBackgroundProp = (\n responsiveBackgroundColor: MakeValueResponsive<string | undefined>,\n): void => {\n if (__DEV__) {\n if (responsiveBackgroundColor) {\n if (typeof responsiveBackgroundColor === 'string') {\n validateBackgroundString(responsiveBackgroundColor);\n return;\n }\n\n Object.values(responsiveBackgroundColor).forEach((backgroundColor) => {\n if (typeof backgroundColor === 'string') {\n validateBackgroundString(backgroundColor);\n }\n });\n }\n }\n};\n\n/**\n * This function is to filter out any unexpected props passed by the user\n */\nconst makeBoxProps = (\n props: BoxProps,\n): KeysRequired<Omit<BoxProps, 'testID' | 'id' | '__brand__'>> => {\n return {\n // Layout\n display: props.display,\n overflow: props.overflow,\n overflowX: props.overflowX,\n overflowY: props.overflowY,\n whiteSpace: props.whiteSpace,\n height: props.height,\n minHeight: props.minHeight,\n maxHeight: props.maxHeight,\n width: props.width,\n minWidth: props.minWidth,\n maxWidth: props.maxWidth,\n textAlign: props.textAlign,\n\n // Flex\n flex: props.flex,\n flexWrap: props.flexWrap,\n flexDirection: props.flexDirection,\n flexGrow: props.flexGrow,\n flexShrink: props.flexShrink,\n flexBasis: props.flexBasis,\n alignItems: props.alignItems,\n alignContent: props.alignContent,\n alignSelf: props.alignSelf,\n justifyItems: props.justifyItems,\n justifyContent: props.justifyContent,\n justifySelf: props.justifySelf,\n placeSelf: props.placeSelf,\n placeItems: props.placeItems,\n order: props.order,\n\n // Grid\n grid: props.grid,\n gridColumn: props.gridColumn,\n gridRow: props.gridRow,\n gridRowStart: props.gridRowStart,\n gridRowEnd: props.gridRowEnd,\n gridColumnStart: props.gridColumnStart,\n gridColumnEnd: props.gridColumnEnd,\n gridArea: props.gridArea,\n gridAutoFlow: props.gridAutoFlow,\n gridAutoRows: props.gridAutoRows,\n gridAutoColumns: props.gridAutoColumns,\n gridTemplate: props.gridTemplate,\n gridTemplateAreas: props.gridTemplateAreas,\n gridTemplateColumns: props.gridTemplateColumns,\n gridTemplateRows: props.gridTemplateRows,\n\n // Spacing\n padding: props.padding,\n paddingTop: props.paddingTop,\n paddingBottom: props.paddingBottom,\n paddingRight: props.paddingRight,\n paddingLeft: props.paddingLeft,\n paddingX: props.paddingX,\n paddingY: props.paddingY,\n margin: props.margin,\n marginBottom: props.marginBottom,\n marginTop: props.marginTop,\n marginRight: props.marginRight,\n marginLeft: props.marginLeft,\n marginX: props.marginX,\n marginY: props.marginY,\n gap: props.gap,\n rowGap: props.rowGap,\n columnGap: props.columnGap,\n\n // Position\n position: props.position,\n zIndex: props.zIndex,\n top: props.top,\n right: props.right,\n bottom: props.bottom,\n left: props.left,\n\n // Visual\n backgroundColor: props.backgroundColor,\n backgroundImage: props.backgroundImage,\n backgroundSize: props.backgroundSize,\n backgroundPosition: props.backgroundPosition,\n backgroundOrigin: props.backgroundOrigin,\n backgroundRepeat: props.backgroundRepeat,\n elevation: props.elevation,\n opacity: props.opacity,\n visibility: props.visibility,\n backdropFilter: props.backdropFilter,\n\n // Border\n borderWidth: props.borderWidth,\n borderColor: props.borderColor,\n borderStyle: props.borderStyle,\n borderTopWidth: props.borderTopWidth,\n borderTopColor: props.borderTopColor,\n borderTopStyle: props.borderTopStyle,\n borderRightWidth: props.borderRightWidth,\n borderRightColor: props.borderRightColor,\n borderRightStyle: props.borderRightStyle,\n borderBottomWidth: props.borderBottomWidth,\n borderBottomColor: props.borderBottomColor,\n borderBottomStyle: props.borderBottomStyle,\n borderLeftWidth: props.borderLeftWidth,\n borderLeftColor: props.borderLeftColor,\n borderLeftStyle: props.borderLeftStyle,\n borderRadius: props.borderRadius,\n borderTopLeftRadius: props.borderTopLeftRadius,\n borderTopRightRadius: props.borderTopRightRadius,\n borderBottomRightRadius: props.borderBottomRightRadius,\n borderBottomLeftRadius: props.borderBottomLeftRadius,\n\n // Polygon Support\n transform: props.transform,\n transformOrigin: props.transformOrigin,\n clipPath: props.clipPath,\n\n // Animation\n transition: props.transition,\n\n // callbacks\n onMouseEnter: props.onMouseEnter,\n onMouseLeave: props.onMouseLeave,\n onMouseOver: props.onMouseOver,\n onScroll: props.onScroll,\n\n // Drag and Drop\n draggable: props.draggable,\n onDragStart: props.onDragStart,\n onDragEnd: props.onDragEnd,\n onDragEnter: props.onDragEnter,\n onDragLeave: props.onDragLeave,\n onDragOver: props.onDragOver,\n onDrop: props.onDrop,\n\n pointerEvents: props.pointerEvents,\n children: props.children,\n tabIndex: props.tabIndex,\n as: isReactNative() ? undefined : props.as, // as is not supported on react-native\n };\n};\n\n/**\n * ## Box\n * \n * Box is the basic Layout component.\n *\n *\n * Box components supports most spacing CSS properties like `display`, `padding*`, `flex*`, `height`, `width`, etc.\n *\n * Check out {@linkcode BoxProps BoxPropsType} for complete list of props and [Layout RFC](https://github.com/razorpay/blade/blob/master/rfcs/2023-01-06-layout.md) for more details on API decision.\n * \n * ----\n * \n * ### Usage\n * \n * ```jsx\n * <Box display=\"flex\">\n * ```\n\n * #### Responsive Props\n *\n * ```jsx\n * <Box padding={{ base: 'spacing.3', m: 'spacing.10' }} />\n * ```\n * \n * #### Margin and Padding Shorthands\n * \n * ```jsx\n * <Box padding={[\"spacing.3\", \"spacing.10\"]} />\n * ```\n *\n * ---\n * \n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-box Box Documentation}\n * \n */\nconst _Box: React.ForwardRefRenderFunction<BoxRefType, BoxProps> = (props, ref) => {\n React.useEffect(() => {\n if (__DEV__) {\n validateBackgroundProp(props.backgroundColor);\n }\n }, [props.backgroundColor]);\n\n React.useEffect(() => {\n if (__DEV__) {\n if (props.as) {\n if (isReactNative()) {\n throwBladeError({\n message: '`as` prop is not supported on React Native',\n moduleName: 'Box',\n });\n }\n\n if (!validBoxAsValues.includes(props.as)) {\n throwBladeError({\n message: `Invalid \\`as\\` prop value - ${props.as}. Only ${validBoxAsValues.join(\n ', ',\n )} are valid values`,\n moduleName: 'Box',\n });\n }\n }\n }\n }, [props.as]);\n\n return (\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n id={props.id}\n {...metaAttribute({ name: MetaConstants.Box, testID: props.testID })}\n {...makeBoxProps(props)}\n {...makeAnalyticsAttribute(props)}\n />\n );\n};\n\nconst Box = assignWithoutSideEffects(React.forwardRef(_Box), {\n displayName: 'Box',\n componentId: 'Box',\n});\n\nexport { Box, makeBoxProps };\n"],"names":["validateBackgroundString","stringBackgroundColorValue","__DEV__","startsWith","throwBladeError","message","moduleName","validateBackgroundProp","responsiveBackgroundColor","Object","values","forEach","backgroundColor","makeBoxProps","props","display","overflow","overflowX","overflowY","whiteSpace","height","minHeight","maxHeight","width","minWidth","maxWidth","textAlign","flex","flexWrap","flexDirection","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyItems","justifyContent","justifySelf","placeSelf","placeItems","order","grid","gridColumn","gridRow","gridRowStart","gridRowEnd","gridColumnStart","gridColumnEnd","gridArea","gridAutoFlow","gridAutoRows","gridAutoColumns","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","padding","paddingTop","paddingBottom","paddingRight","paddingLeft","paddingX","paddingY","margin","marginBottom","marginTop","marginRight","marginLeft","marginX","marginY","gap","rowGap","columnGap","position","zIndex","top","right","bottom","left","backgroundImage","backgroundSize","backgroundPosition","backgroundOrigin","backgroundRepeat","elevation","opacity","visibility","backdropFilter","borderWidth","borderColor","borderStyle","borderTopWidth","borderTopColor","borderTopStyle","borderRightWidth","borderRightColor","borderRightStyle","borderBottomWidth","borderBottomColor","borderBottomStyle","borderLeftWidth","borderLeftColor","borderLeftStyle","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","transform","transformOrigin","clipPath","transition","onMouseEnter","onMouseLeave","onMouseOver","onScroll","draggable","onDragStart","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop","pointerEvents","children","tabIndex","as","isReactNative","undefined","_Box","ref","React","useEffect","validBoxAsValues","includes","join","_jsx","BaseBox","assign","id","metaAttribute","name","MetaConstants","Box","testID","makeAnalyticsAttribute","assignWithoutSideEffects","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;AAWA,IAAMA,wBAAwB,CAAG,SAA3BA,wBAAwBA,CAAIC,0BAAkC,CAAW,CAC7E,GAAIC,OAAO,CAAE,CACX,GACE,CAACD,0BAA0B,CAACE,UAAU,CAAC,oBAAoB,CAAC,EAC5D,CAACF,0BAA0B,CAACE,UAAU,CAAC,UAAU,CAAC,EAClD,CAACF,0BAA0B,CAACE,UAAU,CAAC,qBAAqB,CAAC,EAC7DF,0BAA0B,GAAK,aAAa,CAC5C,CACAG,eAAe,CAAC,CACdC,OAAO,CAAE,CAAA,qJAAA,EAAwJJ,0BAA0B,CAAA,0JAAA,CAA4J,CACvVK,UAAU,CAAE,KACd,CAAC,CAAC,CACJ,CACF,CACF,CAAC,CAED,IAAMC,sBAAsB,CAAG,SAAzBA,sBAAsBA,CAC1BC,yBAAkE,CACzD,CACT,GAAIN,OAAO,CAAE,CACX,GAAIM,yBAAyB,CAAE,CAC7B,GAAI,OAAOA,yBAAyB,GAAK,QAAQ,CAAE,CACjDR,wBAAwB,CAACQ,yBAAyB,CAAC,CACnD,OACF,CAEAC,MAAM,CAACC,MAAM,CAACF,yBAAyB,CAAC,CAACG,OAAO,CAAC,SAACC,eAAe,CAAK,CACpE,GAAI,OAAOA,eAAe,GAAK,QAAQ,CAAE,CACvCZ,wBAAwB,CAACY,eAAe,CAAC,CAC3C,CACF,CAAC,CAAC,CACJ,CACF,CACF,CAAC,CAKK,IAAAC,YAAY,CAAG,SAAfA,YAAYA,CAChBC,KAAe,CACiD,CAChE,OAAO,CAELC,OAAO,CAAED,KAAK,CAACC,OAAO,CACtBC,QAAQ,CAAEF,KAAK,CAACE,QAAQ,CACxBC,SAAS,CAAEH,KAAK,CAACG,SAAS,CAC1BC,SAAS,CAAEJ,KAAK,CAACI,SAAS,CAC1BC,UAAU,CAAEL,KAAK,CAACK,UAA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AACC,SAAS,CAAC,UAAM,CACpB,GAAInI,OAAO,CAAE,CACX,GAAIY,KAAK,CAACiH,EAAE,CAAE,CACZ,GAAIC,aAAa,EAAE,CAAE,CACnB5H,eAAe,CAAC,CACdC,OAAO,CAAE,4CAA4C,CACrDC,UAAU,CAAE,KACd,CAAC,CAAC,CACJ,CAEA,GAAI,CAACgI,gBAAgB,CAACC,QAAQ,CAACzH,KAAK,CAACiH,EAAE,CAAC,CAAE,CACxC3H,eAAe,CAAC,CACdC,OAAO,CAAE,CAA+BS,4BAAAA,EAAAA,KAAK,CAACiH,EAAE,CAAUO,OAAAA,EAAAA,gBAAgB,CAACE,IAAI,CAC7E,IACF,CAAC,CAAmB,iBAAA,CAAA,CACpBlI,UAAU,CAAE,KACd,CAAC,CAAC,CACJ,CACF,CACF,CACF,CAAC,CAAE,CAACQ,KAAK,CAACiH,EAAE,CAAC,CAAC,CAEd,OACEU,GAAA,CAACC,OAAO,CAAAjI,MAAA,CAAAkI,MAAA,EAENR,GAAG,CAAEA,GAAW,CAChBS,EAAE,CAAE9H,KAAK,CAAC8H,EAAG,CAAA,CACTC,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,GAAG,CAAEC,MAAM,CAAEnI,KAAK,CAACmI,MAAO,CAAC,CAAC,CAChEpI,YAAY,CAACC,KAAK,CAAC,CACnBoI,sBAAsB,CAACpI,KAAK,CAAC,CAClC,CAAC,CAEN,CAAC,CAEK,IAAAkI,GAAG,CAAGG,wBAAwB,CAACf,cAAK,CAACgB,UAAU,CAAClB,IAAI,CAAC,CAAE,CAC3DmB,WAAW,CAAE,KAAK,CAClBC,WAAW,CAAE,KACf,CAAC;;;;"}
1
+ {"version":3,"file":"Box.js","sources":["../../../../../src/components/Box/Box.tsx"],"sourcesContent":["import React from 'react';\nimport BaseBox from './BaseBox';\nimport type { BoxProps, BoxRefType, MakeValueResponsive } from './BaseBox/types';\nimport { validBoxAsValues } from './BaseBox/types/propsTypes';\nimport type { KeysRequired } from '~utils/types';\nimport { isReactNative } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst validateBackgroundString = (stringBackgroundColorValue: string): void => {\n if (__DEV__) {\n if (\n !stringBackgroundColorValue.startsWith('surface.background') &&\n !stringBackgroundColorValue.startsWith('overlay.') &&\n !stringBackgroundColorValue.startsWith('feedback.background') &&\n stringBackgroundColorValue !== 'transparent'\n ) {\n throwBladeError({\n message: `Oops! Currently you can only use \\`transparent\\`, \\`surface.background.*\\`, and \\`overlay.*\\` tokens with backgroundColor property but we received \\`${stringBackgroundColorValue}\\` instead.\\n\\n Do you have a usecase of using other values? Create an issue on https://github.com/razorpay/blade repo to let us know and we can discuss ✨`,\n moduleName: 'Box',\n });\n }\n }\n};\n\nconst validateBackgroundProp = (\n responsiveBackgroundColor: MakeValueResponsive<string | undefined>,\n): void => {\n if (__DEV__) {\n if (responsiveBackgroundColor) {\n if (typeof responsiveBackgroundColor === 'string') {\n validateBackgroundString(responsiveBackgroundColor);\n return;\n }\n\n Object.values(responsiveBackgroundColor).forEach((backgroundColor) => {\n if (typeof backgroundColor === 'string') {\n validateBackgroundString(backgroundColor);\n }\n });\n }\n }\n};\n\n/**\n * This function is to filter out any unexpected props passed by the user\n */\nconst makeBoxProps = (\n props: BoxProps,\n): KeysRequired<Omit<BoxProps, 'testID' | 'id' | '__brand__' | 'elementtiming'>> => {\n return {\n // Layout\n display: props.display,\n overflow: props.overflow,\n overflowX: props.overflowX,\n overflowY: props.overflowY,\n whiteSpace: props.whiteSpace,\n height: props.height,\n minHeight: props.minHeight,\n maxHeight: props.maxHeight,\n width: props.width,\n minWidth: props.minWidth,\n maxWidth: props.maxWidth,\n textAlign: props.textAlign,\n\n // Flex\n flex: props.flex,\n flexWrap: props.flexWrap,\n flexDirection: props.flexDirection,\n flexGrow: props.flexGrow,\n flexShrink: props.flexShrink,\n flexBasis: props.flexBasis,\n alignItems: props.alignItems,\n alignContent: props.alignContent,\n alignSelf: props.alignSelf,\n justifyItems: props.justifyItems,\n justifyContent: props.justifyContent,\n justifySelf: props.justifySelf,\n placeSelf: props.placeSelf,\n placeItems: props.placeItems,\n order: props.order,\n\n // Grid\n grid: props.grid,\n gridColumn: props.gridColumn,\n gridRow: props.gridRow,\n gridRowStart: props.gridRowStart,\n gridRowEnd: props.gridRowEnd,\n gridColumnStart: props.gridColumnStart,\n gridColumnEnd: props.gridColumnEnd,\n gridArea: props.gridArea,\n gridAutoFlow: props.gridAutoFlow,\n gridAutoRows: props.gridAutoRows,\n gridAutoColumns: props.gridAutoColumns,\n gridTemplate: props.gridTemplate,\n gridTemplateAreas: props.gridTemplateAreas,\n gridTemplateColumns: props.gridTemplateColumns,\n gridTemplateRows: props.gridTemplateRows,\n\n // Spacing\n padding: props.padding,\n paddingTop: props.paddingTop,\n paddingBottom: props.paddingBottom,\n paddingRight: props.paddingRight,\n paddingLeft: props.paddingLeft,\n paddingX: props.paddingX,\n paddingY: props.paddingY,\n margin: props.margin,\n marginBottom: props.marginBottom,\n marginTop: props.marginTop,\n marginRight: props.marginRight,\n marginLeft: props.marginLeft,\n marginX: props.marginX,\n marginY: props.marginY,\n gap: props.gap,\n rowGap: props.rowGap,\n columnGap: props.columnGap,\n\n // Position\n position: props.position,\n zIndex: props.zIndex,\n top: props.top,\n right: props.right,\n bottom: props.bottom,\n left: props.left,\n\n // Visual\n backgroundColor: props.backgroundColor,\n backgroundImage: props.backgroundImage,\n backgroundSize: props.backgroundSize,\n backgroundPosition: props.backgroundPosition,\n backgroundOrigin: props.backgroundOrigin,\n backgroundRepeat: props.backgroundRepeat,\n elevation: props.elevation,\n opacity: props.opacity,\n visibility: props.visibility,\n backdropFilter: props.backdropFilter,\n\n // Border\n borderWidth: props.borderWidth,\n borderColor: props.borderColor,\n borderStyle: props.borderStyle,\n borderTopWidth: props.borderTopWidth,\n borderTopColor: props.borderTopColor,\n borderTopStyle: props.borderTopStyle,\n borderRightWidth: props.borderRightWidth,\n borderRightColor: props.borderRightColor,\n borderRightStyle: props.borderRightStyle,\n borderBottomWidth: props.borderBottomWidth,\n borderBottomColor: props.borderBottomColor,\n borderBottomStyle: props.borderBottomStyle,\n borderLeftWidth: props.borderLeftWidth,\n borderLeftColor: props.borderLeftColor,\n borderLeftStyle: props.borderLeftStyle,\n borderRadius: props.borderRadius,\n borderTopLeftRadius: props.borderTopLeftRadius,\n borderTopRightRadius: props.borderTopRightRadius,\n borderBottomRightRadius: props.borderBottomRightRadius,\n borderBottomLeftRadius: props.borderBottomLeftRadius,\n\n // Polygon Support\n transform: props.transform,\n transformOrigin: props.transformOrigin,\n clipPath: props.clipPath,\n\n // Animation\n transition: props.transition,\n\n // callbacks\n onMouseEnter: props.onMouseEnter,\n onMouseLeave: props.onMouseLeave,\n onMouseOver: props.onMouseOver,\n onScroll: props.onScroll,\n\n // Drag and Drop\n draggable: props.draggable,\n onDragStart: props.onDragStart,\n onDragEnd: props.onDragEnd,\n onDragEnter: props.onDragEnter,\n onDragLeave: props.onDragLeave,\n onDragOver: props.onDragOver,\n onDrop: props.onDrop,\n\n pointerEvents: props.pointerEvents,\n children: props.children,\n tabIndex: props.tabIndex,\n as: isReactNative() ? undefined : props.as, // as is not supported on react-native\n };\n};\n\n/**\n * ## Box\n * \n * Box is the basic Layout component.\n *\n *\n * Box components supports most spacing CSS properties like `display`, `padding*`, `flex*`, `height`, `width`, etc.\n *\n * Check out {@linkcode BoxProps BoxPropsType} for complete list of props and [Layout RFC](https://github.com/razorpay/blade/blob/master/rfcs/2023-01-06-layout.md) for more details on API decision.\n * \n * ----\n * \n * ### Usage\n * \n * ```jsx\n * <Box display=\"flex\">\n * ```\n\n * #### Responsive Props\n *\n * ```jsx\n * <Box padding={{ base: 'spacing.3', m: 'spacing.10' }} />\n * ```\n * \n * #### Margin and Padding Shorthands\n * \n * ```jsx\n * <Box padding={[\"spacing.3\", \"spacing.10\"]} />\n * ```\n *\n * ---\n * \n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-box Box Documentation}\n * \n */\nconst _Box: React.ForwardRefRenderFunction<BoxRefType, BoxProps> = (props, ref) => {\n React.useEffect(() => {\n if (__DEV__) {\n validateBackgroundProp(props.backgroundColor);\n }\n }, [props.backgroundColor]);\n\n React.useEffect(() => {\n if (__DEV__) {\n if (props.as) {\n if (isReactNative()) {\n throwBladeError({\n message: '`as` prop is not supported on React Native',\n moduleName: 'Box',\n });\n }\n\n if (!validBoxAsValues.includes(props.as)) {\n throwBladeError({\n message: `Invalid \\`as\\` prop value - ${props.as}. Only ${validBoxAsValues.join(\n ', ',\n )} are valid values`,\n moduleName: 'Box',\n });\n }\n }\n }\n }, [props.as]);\n\n return (\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n id={props.id}\n {...metaAttribute({ name: MetaConstants.Box, testID: props.testID })}\n {...makeBoxProps(props)}\n {...makeAnalyticsAttribute(props)}\n />\n );\n};\n\nconst Box = assignWithoutSideEffects(React.forwardRef(_Box), {\n displayName: 'Box',\n componentId: 'Box',\n});\n\nexport { Box, makeBoxProps };\n"],"names":["validateBackgroundString","stringBackgroundColorValue","__DEV__","startsWith","throwBladeError","message","moduleName","validateBackgroundProp","responsiveBackgroundColor","Object","values","forEach","backgroundColor","makeBoxProps","props","display","overflow","overflowX","overflowY","whiteSpace","height","minHeight","maxHeight","width","minWidth","maxWidth","textAlign","flex","flexWrap","flexDirection","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyItems","justifyContent","justifySelf","placeSelf","placeItems","order","grid","gridColumn","gridRow","gridRowStart","gridRowEnd","gridColumnStart","gridColumnEnd","gridArea","gridAutoFlow","gridAutoRows","gridAutoColumns","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","padding","paddingTop","paddingBottom","paddingRight","paddingLeft","paddingX","paddingY","margin","marginBottom","marginTop","marginRight","marginLeft","marginX","marginY","gap","rowGap","columnGap","position","zIndex","top","right","bottom","left","backgroundImage","backgroundSize","backgroundPosition","backgroundOrigin","backgroundRepeat","elevation","opacity","visibility","backdropFilter","borderWidth","borderColor","borderStyle","borderTopWidth","borderTopColor","borderTopStyle","borderRightWidth","borderRightColor","borderRightStyle","borderBottomWidth","borderBottomColor","borderBottomStyle","borderLeftWidth","borderLeftColor","borderLeftStyle","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","transform","transformOrigin","clipPath","transition","onMouseEnter","onMouseLeave","onMouseOver","onScroll","draggable","onDragStart","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop","pointerEvents","children","tabIndex","as","isReactNative","undefined","_Box","ref","React","useEffect","validBoxAsValues","includes","join","_jsx","BaseBox","assign","id","metaAttribute","name","MetaConstants","Box","testID","makeAnalyticsAttribute","assignWithoutSideEffects","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;AAWA,IAAMA,wBAAwB,CAAG,SAA3BA,wBAAwBA,CAAIC,0BAAkC,CAAW,CAC7E,GAAIC,OAAO,CAAE,CACX,GACE,CAACD,0BAA0B,CAACE,UAAU,CAAC,oBAAoB,CAAC,EAC5D,CAACF,0BAA0B,CAACE,UAAU,CAAC,UAAU,CAAC,EAClD,CAACF,0BAA0B,CAACE,UAAU,CAAC,qBAAqB,CAAC,EAC7DF,0BAA0B,GAAK,aAAa,CAC5C,CACAG,eAAe,CAAC,CACdC,OAAO,CAAE,CAAA,qJAAA,EAAwJJ,0BAA0B,CAAA,0JAAA,CAA4J,CACvVK,UAAU,CAAE,KACd,CAAC,CAAC,CACJ,CACF,CACF,CAAC,CAED,IAAMC,sBAAsB,CAAG,SAAzBA,sBAAsBA,CAC1BC,yBAAkE,CACzD,CACT,GAAIN,OAAO,CAAE,CACX,GAAIM,yBAAyB,CAAE,CAC7B,GAAI,OAAOA,yBAAyB,GAAK,QAAQ,CAAE,CAC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AAI,CAAEC,aAAa,CAACC,GAAG,CAAEC,MAAM,CAAEnI,KAAK,CAACmI,MAAO,CAAC,CAAC,CAChEpI,YAAY,CAACC,KAAK,CAAC,CACnBoI,sBAAsB,CAACpI,KAAK,CAAC,CAClC,CAAC,CAEN,CAAC,CAEK,IAAAkI,GAAG,CAAGG,wBAAwB,CAACf,cAAK,CAACgB,UAAU,CAAClB,IAAI,CAAC,CAAE,CAC3DmB,WAAW,CAAE,KAAK,CAClBC,WAAW,CAAE,KACf,CAAC;;;;"}
@@ -0,0 +1,6 @@
1
+ import { createContext, useContext } from 'react';
2
+
3
+ var CommonChartComponentsContext=createContext({dataColorMapping:undefined,setDataColorMapping:function setDataColorMapping(){return undefined;},chartName:undefined});var useCommonChartComponentsContext=function useCommonChartComponentsContext(){return useContext(CommonChartComponentsContext);};
4
+
5
+ export { CommonChartComponentsContext, useCommonChartComponentsContext };
6
+ //# sourceMappingURL=CommonChartComponentsContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommonChartComponentsContext.js","sources":["../../../../../../src/components/Charts/CommonChartComponents/CommonChartComponentsContext.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { CommonChartComponentsContextType } from './types';\n\nexport const CommonChartComponentsContext = createContext<CommonChartComponentsContextType>({\n dataColorMapping: undefined,\n setDataColorMapping: () => undefined,\n chartName: undefined,\n});\n\nexport const useCommonChartComponentsContext = (): CommonChartComponentsContextType =>\n useContext(CommonChartComponentsContext);\n"],"names":["CommonChartComponentsContext","createContext","dataColorMapping","undefined","setDataColorMapping","chartName","useCommonChartComponentsContext","useContext"],"mappings":";;AAGa,IAAAA,4BAA4B,CAAGC,aAAa,CAAmC,CAC1FC,gBAAgB,CAAEC,SAAS,CAC3BC,mBAAmB,CAAE,SAAAA,mBAAA,EAAA,CAAA,OAAMD,SAAS,CAAA,CAAA,CACpCE,SAAS,CAAEF,SACb,CAAC,EAEY,IAAAG,+BAA+B,CAAG,SAAlCA,+BAA+BA,UAC1CC,UAAU,CAACP,4BAA4B,CAAC,CAAA;;;;"}
@@ -0,0 +1,4 @@
1
+ var DEFAULT_COLOR='data.background.categorical.gray.moderate';
2
+
3
+ export { DEFAULT_COLOR };
4
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sources":["../../../../../../src/components/Charts/CommonChartComponents/tokens.ts"],"sourcesContent":["const RECT_WIDTH = 80;\nconst RECT_HEIGHT = 30;\nconst TEXT_BASELINE = 15;\n\n// Padding for text inside the rectangle (4px vertical, 8px horizontal)\nconst PADDING_VERTICAL = 4;\nconst PADDING_HORIZONTAL = 8;\n\nconst X_OFFSET = 32;\nconst Y_OFFSET = 14.5;\nconst X_AXIS_TEXT_BASELINE = 24;\n\nconst MIN_WIDTH = RECT_WIDTH;\nconst MAX_WIDTH = 200;\n\nconst DEFAULT_COLOR = 'data.background.categorical.gray.moderate';\n\nconst componentId = {\n chartLegend: 'chart-legend',\n};\n\nexport {\n componentId,\n RECT_WIDTH,\n RECT_HEIGHT,\n TEXT_BASELINE,\n PADDING_VERTICAL,\n PADDING_HORIZONTAL,\n X_OFFSET,\n Y_OFFSET,\n X_AXIS_TEXT_BASELINE,\n MIN_WIDTH,\n MAX_WIDTH,\n DEFAULT_COLOR,\n};\n"],"names":["DEFAULT_COLOR"],"mappings":"AAeM,IAAAA,aAAa,CAAG;;;;"}
@@ -9,9 +9,10 @@ import '../../../tokens/global/typography.js';
9
9
  import '../../../tokens/global/motion.js';
10
10
  import { getPlatformType } from '../../../utils/getPlatformType/getPlatformType.js';
11
11
  import '../../BladeProvider/useTheme.js';
12
+ import { makeAnalyticsAttribute } from '../../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
12
13
  import { jsx } from 'react/jsx-runtime';
13
14
 
14
- var _excluded=["as","size","weight","color","children","testID","textAlign","textDecorationLine","textTransform"];var validAsValues=['span','h1','h2','h3','h4','h5','h6'];var getProps=function getProps(_ref){var as=_ref.as,size=_ref.size,weight=_ref.weight,color=_ref.color,testID=_ref.testID;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var letterSpacing=weight==='medium'||weight==='regular'?50:100;var props={color:color,fontSize:800,fontWeight:weight,fontStyle:'normal',lineHeight:800,fontFamily:'heading',accessibilityProps:isPlatformWeb?{}:{role:'heading'},componentName:'display',testID:testID,letterSpacing:letterSpacing};if(size==='small'){props.fontSize=800;props.lineHeight=800;}else if(size==='medium'){props.fontSize=900;props.lineHeight=900;}else if(size==='large'){props.fontSize=1000;props.lineHeight=1000;}else if(size==='xlarge'){props.fontSize=1100;props.lineHeight=1100;}props.as=isPlatformWeb?'h1':undefined;props.as=as||props.as;return props;};var _Display=function _Display(_ref2,ref){var as=_ref2.as,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'semibold':_ref2$weight,_ref2$color=_ref2.color,color=_ref2$color===void 0?'surface.text.gray.normal':_ref2$color,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,textTransform=_ref2.textTransform,styledProps=_objectWithoutProperties(_ref2,_excluded);useValidateAsProp({componentName:'Display',as:as,validAsValues:validAsValues});var props=getProps({as:as,size:size,color:color,weight:weight,testID:testID});return jsx(BaseText,Object.assign({ref:ref},props,{textAlign:textAlign,textDecorationLine:textDecorationLine,textTransform:textTransform},getStyledProps(styledProps),{children:children}));};var Display=React__default.forwardRef(_Display);
15
+ var _excluded=["as","size","weight","color","children","testID","textAlign","textDecorationLine","textTransform"];var validAsValues=['span','h1','h2','h3','h4','h5','h6'];var getProps=function getProps(_ref){var as=_ref.as,size=_ref.size,weight=_ref.weight,color=_ref.color,testID=_ref.testID;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var letterSpacing=weight==='medium'||weight==='regular'?50:100;var props={color:color,fontSize:800,fontWeight:weight,fontStyle:'normal',lineHeight:800,fontFamily:'heading',accessibilityProps:isPlatformWeb?{}:{role:'heading'},componentName:'display',testID:testID,letterSpacing:letterSpacing};if(size==='small'){props.fontSize=800;props.lineHeight=800;}else if(size==='medium'){props.fontSize=900;props.lineHeight=900;}else if(size==='large'){props.fontSize=1000;props.lineHeight=1000;}else if(size==='xlarge'){props.fontSize=1100;props.lineHeight=1100;}props.as=isPlatformWeb?'h1':undefined;props.as=as||props.as;return props;};var _Display=function _Display(_ref2,ref){var as=_ref2.as,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'semibold':_ref2$weight,_ref2$color=_ref2.color,color=_ref2$color===void 0?'surface.text.gray.normal':_ref2$color,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,textTransform=_ref2.textTransform,styledProps=_objectWithoutProperties(_ref2,_excluded);useValidateAsProp({componentName:'Display',as:as,validAsValues:validAsValues});var props=getProps({as:as,size:size,color:color,weight:weight,testID:testID});return jsx(BaseText,Object.assign({ref:ref},props,{textAlign:textAlign,textDecorationLine:textDecorationLine,textTransform:textTransform},getStyledProps(styledProps),makeAnalyticsAttribute(styledProps),{children:children}));};var Display=React__default.forwardRef(_Display);
15
16
 
16
17
  export { Display };
17
18
  //# sourceMappingURL=Display.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Display.js","sources":["../../../../../../src/components/Typography/Display/Display.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { BladeElementRef, TestID } from '~utils/types';\nimport { getPlatformType } from '~utils';\n\nconst validAsValues = ['span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nexport type DisplayProps = {\n as?: typeof validAsValues[number];\n /**\n * Overrides the color of the Display component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of title\n */\n color?: BaseTextProps['color'];\n size?: Extract<BaseTextSizes, 'small' | 'medium' | 'large' | 'xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n children: React.ReactNode;\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n textTransform?: BaseTextProps['textTransform'];\n} & TestID &\n StyledPropsBlade;\n\nconst getProps = ({\n as,\n size,\n weight,\n color,\n testID,\n}: Pick<DisplayProps, 'as' | 'size' | 'color' | 'weight' | 'testID'>): Omit<\n BaseTextProps,\n 'children'\n> => {\n const isPlatformWeb = getPlatformType() === 'browser' || getPlatformType() === 'node';\n const letterSpacing = weight === 'medium' || weight === 'regular' ? 50 : 100;\n const props: Omit<BaseTextProps, 'children'> = {\n color,\n fontSize: 800,\n fontWeight: weight,\n fontStyle: 'normal',\n lineHeight: 800,\n fontFamily: 'heading',\n accessibilityProps: isPlatformWeb ? {} : { role: 'heading' },\n componentName: 'display',\n testID,\n letterSpacing,\n };\n\n if (size === 'small') {\n props.fontSize = 800;\n props.lineHeight = 800;\n } else if (size === 'medium') {\n props.fontSize = 900;\n props.lineHeight = 900;\n } else if (size === 'large') {\n props.fontSize = 1000;\n props.lineHeight = 1000;\n } else if (size === 'xlarge') {\n props.fontSize = 1100;\n props.lineHeight = 1100;\n }\n\n props.as = isPlatformWeb ? 'h1' : undefined;\n // override the computed `as` prop if user passed an `as` prop\n props.as = as || props.as;\n return props;\n};\n\nconst _Display = (\n {\n as,\n size = 'small',\n weight = 'semibold',\n color = 'surface.text.gray.normal',\n children,\n testID,\n textAlign,\n textDecorationLine,\n textTransform,\n ...styledProps\n }: DisplayProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n useValidateAsProp({ componentName: 'Display', as, validAsValues });\n\n const props = getProps({ as, size, color, weight, testID });\n\n return (\n <BaseText\n ref={ref}\n {...props}\n textAlign={textAlign}\n textDecorationLine={textDecorationLine}\n textTransform={textTransform}\n {...getStyledProps(styledProps)}\n >\n {children}\n </BaseText>\n );\n};\n\nconst Display = React.forwardRef(_Display);\nexport { Display };\n"],"names":["validAsValues","getProps","_ref","as","size","weight","color","testID","isPlatformWeb","getPlatformType","letterSpacing","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","accessibilityProps","role","componentName","undefined","_Display","_ref2","ref","_ref2$size","_ref2$weight","_ref2$color","children","textAlign","textDecorationLine","textTransform","styledProps","_objectWithoutProperties","_excluded","useValidateAsProp","_jsx","BaseText","Object","assign","getStyledProps","Display","React","forwardRef"],"mappings":";;;;;;;;;;;;;kHAUA,IAAMA,aAAa,CAAG,CAAC,MAAM,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAU,CAkB3E,IAAMC,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAST,CAAA,IARHC,EAAE,CAAAD,IAAA,CAAFC,EAAE,CACFC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CACJC,MAAM,CAAAH,IAAA,CAANG,MAAM,CACNC,KAAK,CAAAJ,IAAA,CAALI,KAAK,CACLC,MAAM,CAAAL,IAAA,CAANK,MAAM,CAKN,IAAMC,aAAa,CAAGC,eAAe,EAAE,GAAK,SAAS,EAAIA,eAAe,EAAE,GAAK,MAAM,CACrF,IAAMC,aAAa,CAAGL,MAAM,GAAK,QAAQ,EAAIA,MAAM,GAAK,SAAS,CAAG,EAAE,CAAG,GAAG,CAC5E,IAAMM,KAAsC,CAAG,CAC7CL,KAAK,CAALA,KAAK,CACLM,QAAQ,CAAE,GAAG,CACbC,UAAU,CAAER,MAAM,CAClBS,SAAS,CAAE,QAAQ,CACnBC,UAAU,CAAE,GAAG,CACfC,UAAU,CAAE,SAAS,CACrBC,kBAAkB,CAAET,aAAa,CAAG,EAAE,CAAG,CAAEU,IAAI,CAAE,SAAU,CA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A,CAARK,QAAQ,CACRpB,MAAM,CAAAe,KAAA,CAANf,MAAM,CACNqB,SAAS,CAAAN,KAAA,CAATM,SAAS,CACTC,kBAAkB,CAAAP,KAAA,CAAlBO,kBAAkB,CAClBC,aAAa,CAAAR,KAAA,CAAbQ,aAAa,CACVC,WAAW,CAAAC,wBAAA,CAAAV,KAAA,CAAAW,SAAA,CAIhBC,CAAAA,iBAAiB,CAAC,CAAEf,aAAa,CAAE,SAAS,CAAEhB,EAAE,CAAFA,EAAE,CAAEH,aAAa,CAAbA,aAAc,CAAC,CAAC,CAElE,IAAMW,KAAK,CAAGV,QAAQ,CAAC,CAAEE,EAAE,CAAFA,EAAE,CAAEC,IAAI,CAAJA,IAAI,CAAEE,KAAK,CAALA,KAAK,CAAED,MAAM,CAANA,MAAM,CAAEE,MAAM,CAANA,MAAO,CAAC,CAAC,CAE3D,OACE4B,GAAA,CAACC,QAAQ,CAAAC,MAAA,CAAAC,MAAA,CAAA,CACPf,GAAG,CAAEA,GAAI,CACLZ,CAAAA,KAAK,CACTiB,CAAAA,SAAS,CAAEA,SAAU,CACrBC,kBAAkB,CAAEA,kBAAmB,CACvCC,aAAa,CAAEA,aAAc,CAAA,CACzBS,cAAc,CAACR,WAAW,CAAC,CAAAJ,CAAAA,QAAA,CAE9BA,QAAQ,CACD,CAAA,CAAC,CAEf,CAAC,CAEK,IAAAa,OAAO,CAAGC,cAAK,CAACC,UAAU,CAACrB,QAAQ;;;;"}
1
+ {"version":3,"file":"Display.js","sources":["../../../../../../src/components/Typography/Display/Display.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement } from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { BladeElementRef, TestID, ElementTiming } from '~utils/types';\nimport { getPlatformType } from '~utils';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst validAsValues = ['span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nexport type DisplayProps = {\n as?: typeof validAsValues[number];\n /**\n * Overrides the color of the Display component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of title\n */\n color?: BaseTextProps['color'];\n size?: Extract<BaseTextSizes, 'small' | 'medium' | 'large' | 'xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n children: React.ReactNode;\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n textTransform?: BaseTextProps['textTransform'];\n} & TestID &\n ElementTiming &\n StyledPropsBlade;\n\nconst getProps = ({\n as,\n size,\n weight,\n color,\n testID,\n}: Pick<DisplayProps, 'as' | 'size' | 'color' | 'weight' | 'testID'>): Omit<\n BaseTextProps,\n 'children'\n> => {\n const isPlatformWeb = getPlatformType() === 'browser' || getPlatformType() === 'node';\n const letterSpacing = weight === 'medium' || weight === 'regular' ? 50 : 100;\n const props: Omit<BaseTextProps, 'children'> = {\n color,\n fontSize: 800,\n fontWeight: weight,\n fontStyle: 'normal',\n lineHeight: 800,\n fontFamily: 'heading',\n accessibilityProps: isPlatformWeb ? {} : { role: 'heading' },\n componentName: 'display',\n testID,\n letterSpacing,\n };\n\n if (size === 'small') {\n props.fontSize = 800;\n props.lineHeight = 800;\n } else if (size === 'medium') {\n props.fontSize = 900;\n props.lineHeight = 900;\n } else if (size === 'large') {\n props.fontSize = 1000;\n props.lineHeight = 1000;\n } else if (size === 'xlarge') {\n props.fontSize = 1100;\n props.lineHeight = 1100;\n }\n\n props.as = isPlatformWeb ? 'h1' : undefined;\n // override the computed `as` prop if user passed an `as` prop\n props.as = as || props.as;\n return props;\n};\n\nconst _Display = (\n {\n as,\n size = 'small',\n weight = 'semibold',\n color = 'surface.text.gray.normal',\n children,\n testID,\n textAlign,\n textDecorationLine,\n textTransform,\n ...styledProps\n }: DisplayProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n useValidateAsProp({ componentName: 'Display', as, validAsValues });\n\n const props = getProps({ as, size, color, weight, testID });\n\n return (\n <BaseText\n ref={ref}\n {...props}\n textAlign={textAlign}\n textDecorationLine={textDecorationLine}\n textTransform={textTransform}\n {...getStyledProps(styledProps)}\n {...makeAnalyticsAttribute(styledProps)}\n >\n {children}\n </BaseText>\n );\n};\n\nconst Display = React.forwardRef(_Display);\nexport { Display };\n"],"names":["validAsValues","getProps","_ref","as","size","weight","color","testID","isPlatformWeb","getPlatformType","letterSpacing","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","accessibilityProps","role","componentName","undefined","_Display","_ref2","ref","_ref2$size","_ref2$weight","_ref2$color","children","textAlign","textDecorationLine","textTransform","styledProps","_objectWithoutProperties","_excluded","useValidateAsProp","_jsx","BaseText","Object","assign","getStyledProps","makeAnalyticsAttribute","Display","React","forwardRef"],"mappings":";;;;;;;;;;;;;;kHAWA,IAAMA,aAAa,CAAG,CAAC,MAAM,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAU,CAmB3E,IAAMC,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAST,CAAA,IARHC,EAAE,CAAAD,IAAA,CAAFC,EAAE,CACFC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CACJC,MAAM,CAAAH,IAAA,CAANG,MAAM,CACNC,KAAK,CAAAJ,IAAA,CAALI,KAAK,CACLC,MAAM,CAAAL,IAAA,CAANK,MAAM,CAKN,IAAMC,aAAa,CAAGC,eAAe,EAAE,GAAK,SAAS,EAAIA,eAAe,EAAE,GAAK,MAAM,CACrF,IAAMC,aAAa,CAAGL,MAAM,GAAK,QAAQ,EAAIA,MAAM,GAAK,SAAS,CAAG,EAAE,CAAG,GAAG,CAC5E,IAAMM,KAAsC,CAAG,CAC7CL,KAAK,CAALA,KAAK,CACLM,QAAQ,C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GAAG,KAAA,CAAA,CAAA,UAAU,CAAAA,YAAA,CAAAC,WAAA,CAAAJ,KAAA,CACnBhB,KAAK,CAALA,KAAK,CAAAoB,WAAA,GAAA,KAAA,CAAA,CAAG,0BAA0B,CAAAA,WAAA,CAClCC,QAAQ,CAAAL,KAAA,CAARK,QAAQ,CACRpB,MAAM,CAAAe,KAAA,CAANf,MAAM,CACNqB,SAAS,CAAAN,KAAA,CAATM,SAAS,CACTC,kBAAkB,CAAAP,KAAA,CAAlBO,kBAAkB,CAClBC,aAAa,CAAAR,KAAA,CAAbQ,aAAa,CACVC,WAAW,CAAAC,wBAAA,CAAAV,KAAA,CAAAW,SAAA,EAIhBC,iBAAiB,CAAC,CAAEf,aAAa,CAAE,SAAS,CAAEhB,EAAE,CAAFA,EAAE,CAAEH,aAAa,CAAbA,aAAc,CAAC,CAAC,CAElE,IAAMW,KAAK,CAAGV,QAAQ,CAAC,CAAEE,EAAE,CAAFA,EAAE,CAAEC,IAAI,CAAJA,IAAI,CAAEE,KAAK,CAALA,KAAK,CAAED,MAAM,CAANA,MAAM,CAAEE,MAAM,CAANA,MAAO,CAAC,CAAC,CAE3D,OACE4B,GAAA,CAACC,QAAQ,CAAAC,MAAA,CAAAC,MAAA,CAAA,CACPf,GAAG,CAAEA,GAAI,CAAA,CACLZ,KAAK,CACTiB,CAAAA,SAAS,CAAEA,SAAU,CACrBC,kBAAkB,CAAEA,kBAAmB,CACvCC,aAAa,CAAEA,aAAc,CACzBS,CAAAA,cAAc,CAACR,WAAW,CAAC,CAC3BS,sBAAsB,CAACT,WAAW,CAAC,CAAA,CAAAJ,QAAA,CAEtCA,QAAQ,CAAA,CACD,CAAC,CAEf,CAAC,CAEK,IAAAc,OAAO,CAAGC,cAAK,CAACC,UAAU,CAACtB,QAAQ;;;;"}
@@ -9,9 +9,10 @@ import '../../../tokens/global/typography.js';
9
9
  import '../../../tokens/global/motion.js';
10
10
  import { isReactNative } from '../../../utils/platform/isReactNative.js';
11
11
  import '../../BladeProvider/useTheme.js';
12
+ import { makeAnalyticsAttribute } from '../../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
12
13
  import { jsx } from 'react/jsx-runtime';
13
14
 
14
- var _excluded=["as","size","weight","color","children","testID","textAlign","textDecorationLine","wordBreak","textTransform"];var validAsValues=['span','h1','h2','h3','h4','h5','h6'];var getHeadingProps=function getHeadingProps(_ref){var as=_ref.as,size=_ref.size,weight=_ref.weight,color=_ref.color,testID=_ref.testID;var props={color:color,fontSize:300,fontWeight:weight!=null?weight:'semibold',fontStyle:'normal',lineHeight:300,fontFamily:'heading',accessibilityProps:isReactNative()?{role:'heading'}:{},componentName:'heading',testID:testID};if(size==='small'){props.fontSize=300;props.lineHeight=300;props.as='h6';}else if(size==='medium'){props.fontSize=400;props.lineHeight=400;props.as='h5';}else if(size==='large'){props.fontSize=500;props.lineHeight=500;props.as='h4';}else if(size==='xlarge'){props.fontSize=600;props.lineHeight=600;props.as='h3';}else if(size==='2xlarge'){props.fontSize=700;props.lineHeight=700;props.as='h2';}props.as=as||props.as;return props;};var _Heading=function _Heading(_ref2,ref){var as=_ref2.as,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'semibold':_ref2$weight,_ref2$color=_ref2.color,color=_ref2$color===void 0?'surface.text.gray.normal':_ref2$color,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,wordBreak=_ref2.wordBreak,textTransform=_ref2.textTransform,styledProps=_objectWithoutProperties(_ref2,_excluded);useValidateAsProp({componentName:'Heading',as:as,validAsValues:validAsValues});var props=getHeadingProps({as:as,size:size,weight:weight,color:color,testID:testID});return jsx(BaseText,Object.assign({},props,{ref:ref,textAlign:textAlign,textDecorationLine:textDecorationLine,textTransform:textTransform,wordBreak:wordBreak},getStyledProps(styledProps),{children:children}));};var Heading=React__default.forwardRef(_Heading);
15
+ var _excluded=["as","size","weight","color","children","testID","textAlign","textDecorationLine","wordBreak","textTransform"];var validAsValues=['span','h1','h2','h3','h4','h5','h6'];var getHeadingProps=function getHeadingProps(_ref){var as=_ref.as,size=_ref.size,weight=_ref.weight,color=_ref.color,testID=_ref.testID;var props={color:color,fontSize:300,fontWeight:weight!=null?weight:'semibold',fontStyle:'normal',lineHeight:300,fontFamily:'heading',accessibilityProps:isReactNative()?{role:'heading'}:{},componentName:'heading',testID:testID};if(size==='small'){props.fontSize=300;props.lineHeight=300;props.as='h6';}else if(size==='medium'){props.fontSize=400;props.lineHeight=400;props.as='h5';}else if(size==='large'){props.fontSize=500;props.lineHeight=500;props.as='h4';}else if(size==='xlarge'){props.fontSize=600;props.lineHeight=600;props.as='h3';}else if(size==='2xlarge'){props.fontSize=700;props.lineHeight=700;props.as='h2';}props.as=as||props.as;return props;};var _Heading=function _Heading(_ref2,ref){var as=_ref2.as,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'semibold':_ref2$weight,_ref2$color=_ref2.color,color=_ref2$color===void 0?'surface.text.gray.normal':_ref2$color,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,wordBreak=_ref2.wordBreak,textTransform=_ref2.textTransform,styledProps=_objectWithoutProperties(_ref2,_excluded);useValidateAsProp({componentName:'Heading',as:as,validAsValues:validAsValues});var props=getHeadingProps({as:as,size:size,weight:weight,color:color,testID:testID});return jsx(BaseText,Object.assign({},props,{ref:ref,textAlign:textAlign,textDecorationLine:textDecorationLine,textTransform:textTransform,wordBreak:wordBreak},getStyledProps(styledProps),makeAnalyticsAttribute(styledProps),{children:children}));};var Heading=React__default.forwardRef(_Heading);
15
16
 
16
17
  export { Heading, getHeadingProps };
17
18
  //# sourceMappingURL=Heading.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.js","sources":["../../../../../../src/components/Typography/Heading/Heading.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport React from 'react';\nimport type { ReactElement } from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { isReactNative } from '~utils';\nimport type { BladeElementRef, TestID } from '~utils/types';\n\nconst validAsValues = ['span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nexport type HeadingProps = {\n as?: typeof validAsValues[number];\n /**\n * Overrides the color of the Heading component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of heading\n */\n color?: BaseTextProps['color'];\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n children: React.ReactNode;\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n size?: Extract<BaseTextSizes, 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge'>;\n textTransform?: BaseTextProps['textTransform'];\n wordBreak?: BaseTextProps['wordBreak'];\n} & TestID &\n StyledPropsBlade;\n\nexport const getHeadingProps = ({\n as,\n size,\n weight,\n color,\n testID,\n}: Pick<HeadingProps, 'as' | 'size' | 'weight' | 'color' | 'testID'>): Omit<\n BaseTextProps,\n 'children'\n> => {\n const props: Omit<BaseTextProps, 'children'> = {\n color,\n fontSize: 300,\n fontWeight: weight ?? 'semibold',\n fontStyle: 'normal',\n lineHeight: 300,\n fontFamily: 'heading',\n accessibilityProps: isReactNative() ? { role: 'heading' } : {},\n componentName: 'heading',\n testID,\n };\n\n if (size === 'small') {\n props.fontSize = 300;\n props.lineHeight = 300;\n props.as = 'h6';\n } else if (size === 'medium') {\n props.fontSize = 400;\n props.lineHeight = 400;\n props.as = 'h5';\n } else if (size === 'large') {\n props.fontSize = 500;\n props.lineHeight = 500;\n props.as = 'h4';\n } else if (size === 'xlarge') {\n props.fontSize = 600;\n props.lineHeight = 600;\n props.as = 'h3';\n } else if (size === '2xlarge') {\n props.fontSize = 700;\n props.lineHeight = 700;\n props.as = 'h2';\n }\n\n // override the computed `as` prop if user passed an `as` prop\n props.as = as || props.as;\n return props;\n};\n\nconst _Heading = (\n {\n as,\n size = 'small',\n weight = 'semibold',\n color = 'surface.text.gray.normal',\n children,\n testID,\n textAlign,\n textDecorationLine,\n wordBreak,\n textTransform,\n ...styledProps\n }: HeadingProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n useValidateAsProp({ componentName: 'Heading', as, validAsValues });\n\n const props = getHeadingProps({ as, size, weight, color, testID });\n\n return (\n <BaseText\n {...props}\n ref={ref}\n textAlign={textAlign}\n textDecorationLine={textDecorationLine}\n textTransform={textTransform}\n wordBreak={wordBreak}\n {...getStyledProps(styledProps)}\n >\n {children}\n </BaseText>\n );\n};\n\nconst Heading = React.forwardRef(_Heading);\n\nexport { Heading };\n"],"names":["validAsValues","getHeadingProps","_ref","as","size","weight","color","testID","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","accessibilityProps","isReactNative","role","componentName","_Heading","_ref2","ref","_ref2$size","_ref2$weight","_ref2$color","children","textAlign","textDecorationLine","wordBreak","textTransform","styledProps","_objectWithoutProperties","_excluded","useValidateAsProp","_jsx","BaseText","Object","assign","getStyledProps","Heading","React","forwardRef"],"mappings":";;;;;;;;;;;;;8HAWA,IAAMA,aAAa,CAAG,CAAC,MAAM,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAE,IAAI,CAAU,CAmB9D,IAAAC,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CASvB,CAAA,IARHC,EAAE,CAAAD,IAAA,CAAFC,EAAE,CACFC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CACJC,MAAM,CAAAH,IAAA,CAANG,MAAM,CACNC,KAAK,CAAAJ,IAAA,CAALI,KAAK,CACLC,MAAM,CAAAL,IAAA,CAANK,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AAU,CACrBC,kBAAkB,CAAEA,kBAAmB,CACvCE,aAAa,CAAEA,aAAc,CAC7BD,SAAS,CAAEA,SAAU,CACjBU,CAAAA,cAAc,CAACR,WAAW,CAAC,CAAA,CAAAL,QAAA,CAE9BA,QAAQ,CAAA,CACD,CAAC,CAEf,CAAC,CAEK,IAAAc,OAAO,CAAGC,cAAK,CAACC,UAAU,CAACtB,QAAQ;;;;"}
1
+ {"version":3,"file":"Heading.js","sources":["../../../../../../src/components/Typography/Heading/Heading.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport React from 'react';\nimport type { ReactElement } from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { isReactNative } from '~utils';\nimport type { BladeElementRef, TestID, ElementTiming } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst validAsValues = ['span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nexport type HeadingProps = {\n as?: typeof validAsValues[number];\n /**\n * Overrides the color of the Heading component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of heading\n */\n color?: BaseTextProps['color'];\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n children: React.ReactNode;\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n size?: Extract<BaseTextSizes, 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge'>;\n textTransform?: BaseTextProps['textTransform'];\n wordBreak?: BaseTextProps['wordBreak'];\n} & TestID &\n ElementTiming &\n StyledPropsBlade;\n\nexport const getHeadingProps = ({\n as,\n size,\n weight,\n color,\n testID,\n}: Pick<HeadingProps, 'as' | 'size' | 'weight' | 'color' | 'testID'>): Omit<\n BaseTextProps,\n 'children'\n> => {\n const props: Omit<BaseTextProps, 'children'> = {\n color,\n fontSize: 300,\n fontWeight: weight ?? 'semibold',\n fontStyle: 'normal',\n lineHeight: 300,\n fontFamily: 'heading',\n accessibilityProps: isReactNative() ? { role: 'heading' } : {},\n componentName: 'heading',\n testID,\n };\n\n if (size === 'small') {\n props.fontSize = 300;\n props.lineHeight = 300;\n props.as = 'h6';\n } else if (size === 'medium') {\n props.fontSize = 400;\n props.lineHeight = 400;\n props.as = 'h5';\n } else if (size === 'large') {\n props.fontSize = 500;\n props.lineHeight = 500;\n props.as = 'h4';\n } else if (size === 'xlarge') {\n props.fontSize = 600;\n props.lineHeight = 600;\n props.as = 'h3';\n } else if (size === '2xlarge') {\n props.fontSize = 700;\n props.lineHeight = 700;\n props.as = 'h2';\n }\n\n // override the computed `as` prop if user passed an `as` prop\n props.as = as || props.as;\n return props;\n};\n\nconst _Heading = (\n {\n as,\n size = 'small',\n weight = 'semibold',\n color = 'surface.text.gray.normal',\n children,\n testID,\n textAlign,\n textDecorationLine,\n wordBreak,\n textTransform,\n ...styledProps\n }: HeadingProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n useValidateAsProp({ componentName: 'Heading', as, validAsValues });\n\n const props = getHeadingProps({ as, size, weight, color, testID });\n\n return (\n <BaseText\n {...props}\n ref={ref}\n textAlign={textAlign}\n textDecorationLine={textDecorationLine}\n textTransform={textTransform}\n wordBreak={wordBreak}\n {...getStyledProps(styledProps)}\n {...makeAnalyticsAttribute(styledProps)}\n >\n {children}\n </BaseText>\n );\n};\n\nconst Heading = React.forwardRef(_Heading);\n\nexport { Heading };\n"],"names":["validAsValues","getHeadingProps","_ref","as","size","weight","color","testID","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","accessibilityProps","isReactNative","role","componentName","_Heading","_ref2","ref","_ref2$size","_ref2$weight","_ref2$color","children","textAlign","textDecorationLine","wordBreak","textTransform","styledProps","_objectWithoutProperties","_excluded","useValidateAsProp","_jsx","Ba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A,CAIhBC,iBAAiB,CAAC,CAAEf,aAAa,CAAE,SAAS,CAAEd,EAAE,CAAFA,EAAE,CAAEH,aAAa,CAAbA,aAAc,CAAC,CAAC,CAElE,IAAMQ,KAAK,CAAGP,eAAe,CAAC,CAAEE,EAAE,CAAFA,EAAE,CAAEC,IAAI,CAAJA,IAAI,CAAEC,MAAM,CAANA,MAAM,CAAEC,KAAK,CAALA,KAAK,CAAEC,MAAM,CAANA,MAAO,CAAC,CAAC,CAElE,OACE0B,GAAA,CAACC,QAAQ,CAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CACH5B,KAAK,CAAA,CACTY,GAAG,CAAEA,GAAI,CACTK,SAAS,CAAEA,SAAU,CACrBC,kBAAkB,CAAEA,kBAAmB,CACvCE,aAAa,CAAEA,aAAc,CAC7BD,SAAS,CAAEA,SAAU,CAAA,CACjBU,cAAc,CAACR,WAAW,CAAC,CAC3BS,sBAAsB,CAACT,WAAW,CAAC,CAAA,CAAAL,QAAA,CAEtCA,QAAQ,CAAA,CACD,CAAC,CAEf,CAAC,CAEK,IAAAe,OAAO,CAAGC,cAAK,CAACC,UAAU,CAACvB,QAAQ;;;;"}
@@ -12,7 +12,7 @@ import '../../BladeProvider/useTheme.js';
12
12
  import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
13
13
  import { jsx } from 'react/jsx-runtime';
14
14
 
15
- var _excluded=["as","variant","weight","size","truncateAfterLines","children","color","testID","textAlign","textDecorationLine","wordBreak","textTransform"];var validAsValues=['p','span','div','abbr','figcaption','cite','q','label'];var getTextProps=function getTextProps(_ref){var variant=_ref.variant,weight=_ref.weight,size=_ref.size,_ref$color=_ref.color,color=_ref$color===void 0?'surface.text.gray.normal':_ref$color,testID=_ref.testID,textAlign=_ref.textAlign,textDecorationLine=_ref.textDecorationLine;var props={color:color,fontSize:100,fontWeight:weight!=null?weight:'regular',fontStyle:'normal',lineHeight:100,fontFamily:'text',componentName:'text',testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine};if(variant==='caption'){if(size&&size!=='small'&&size!=='medium'){if(__DEV__){throwBladeError({moduleName:'Text',message:`size cannot be '${size}' when variant is 'caption'`});}size='small';}}else if(variant!=='caption'&&!size){size='medium';}if(variant==='body'){if(size==='xsmall'){props.fontSize=25;props.lineHeight=25;}if(size==='small'){props.fontSize=75;props.lineHeight=75;}if(size==='medium'){props.fontSize=100;props.lineHeight=100;}if(size==='large'){props.fontSize=200;props.lineHeight=200;}}if(variant==='caption'){if(size==='small'){props.fontSize=50;props.lineHeight=50;props.fontWeight='regular';}if(size==='medium'){props.fontSize=100;props.lineHeight=50;props.fontWeight='regular';}}return props;};var _Text=function _Text(_ref2,ref){var _ref2$as=_ref2.as,as=_ref2$as===void 0?'p':_ref2$as,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'body':_ref2$variant,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,size=_ref2.size,truncateAfterLines=_ref2.truncateAfterLines,children=_ref2.children,color=_ref2.color,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,wordBreak=_ref2.wordBreak,textTransform=_ref2.textTransform,styledProps=_objectWithoutProperties(_ref2,_excluded);var props=Object.assign({as:as,truncateAfterLines:truncateAfterLines,wordBreak:wordBreak,textTransform:textTransform},getTextProps({variant:variant,weight:weight,color:color,size:size,testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine}));useValidateAsProp({componentName:'Text',as:as,validAsValues:validAsValues});return jsx(BaseText,Object.assign({ref:ref},props,getStyledProps(styledProps),{children:children}));};var Text=assignWithoutSideEffects(React__default.forwardRef(_Text),{displayName:'Text',componentId:'Text'});
15
+ var _excluded=["as","variant","weight","size","truncateAfterLines","children","color","testID","textAlign","textDecorationLine","wordBreak","textTransform","elementtiming"];var validAsValues=['p','span','div','abbr','figcaption','cite','q','label'];var getTextProps=function getTextProps(_ref){var variant=_ref.variant,weight=_ref.weight,size=_ref.size,_ref$color=_ref.color,color=_ref$color===void 0?'surface.text.gray.normal':_ref$color,testID=_ref.testID,textAlign=_ref.textAlign,textDecorationLine=_ref.textDecorationLine;var props={color:color,fontSize:100,fontWeight:weight!=null?weight:'regular',fontStyle:'normal',lineHeight:100,fontFamily:'text',componentName:'text',testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine};if(variant==='caption'){if(size&&size!=='small'&&size!=='medium'){if(__DEV__){throwBladeError({moduleName:'Text',message:`size cannot be '${size}' when variant is 'caption'`});}size='small';}}else if(variant!=='caption'&&!size){size='medium';}if(variant==='body'){if(size==='xsmall'){props.fontSize=25;props.lineHeight=25;}if(size==='small'){props.fontSize=75;props.lineHeight=75;}if(size==='medium'){props.fontSize=100;props.lineHeight=100;}if(size==='large'){props.fontSize=200;props.lineHeight=200;}}if(variant==='caption'){if(size==='small'){props.fontSize=50;props.lineHeight=50;props.fontWeight='regular';}if(size==='medium'){props.fontSize=100;props.lineHeight=50;props.fontWeight='regular';}}return props;};var _Text=function _Text(_ref2,ref){var _ref2$as=_ref2.as,as=_ref2$as===void 0?'p':_ref2$as,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'body':_ref2$variant,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,size=_ref2.size,truncateAfterLines=_ref2.truncateAfterLines,children=_ref2.children,color=_ref2.color,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,wordBreak=_ref2.wordBreak,textTransform=_ref2.textTransform,elementtiming=_ref2.elementtiming,styledProps=_objectWithoutProperties(_ref2,_excluded);var props=Object.assign({as:as,truncateAfterLines:truncateAfterLines,wordBreak:wordBreak,textTransform:textTransform,elementtiming:elementtiming},getTextProps({variant:variant,weight:weight,color:color,size:size,testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine}));useValidateAsProp({componentName:'Text',as:as,validAsValues:validAsValues});return jsx(BaseText,Object.assign({ref:ref},props,getStyledProps(styledProps),{children:children}));};var Text=assignWithoutSideEffects(React__default.forwardRef(_Text),{displayName:'Text',componentId:'Text'});
16
16
 
17
17
  export { Text, getTextProps };
18
18
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../../../src/components/Typography/Text/Text.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\n\nconst validAsValues = ['p', 'span', 'div', 'abbr', 'figcaption', 'cite', 'q', 'label'] as const;\ntype TextCommonProps = {\n as?: typeof validAsValues[number];\n truncateAfterLines?: number;\n children: React.ReactNode;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n /**\n * Overrides the color of the Text component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of text\n */\n color?: BaseTextProps['color'];\n textAlign?: BaseTextProps['textAlign'];\n textTransform?: BaseTextProps['textTransform'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n wordBreak?: BaseTextProps['wordBreak'];\n} & TestID &\n StyledPropsBlade;\n\nexport type TextVariant = 'body' | 'caption';\n\ntype TextBodyVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'body'>;\n size?: Extract<BaseTextSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n};\n\ntype TextCaptionVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'caption'>;\n size?: Extract<BaseTextSizes, 'small' | 'medium'>;\n};\n\nexport type TextProps<T> = T extends { variant: infer Variant }\n ? Variant extends 'caption'\n ? TextCaptionVariant\n : Variant extends 'body'\n ? TextBodyVariant\n : T\n : T;\n\ntype GetTextPropsReturn = Omit<BaseTextProps, 'children'>;\ntype GetTextProps<T extends { variant: TextVariant }> = Pick<\n TextProps<T>,\n | 'variant'\n | 'weight'\n | 'size'\n | 'color'\n | 'testID'\n | 'textAlign'\n | 'textDecorationLine'\n | 'textTransform'\n>;\n\nconst getTextProps = <T extends { variant: TextVariant }>({\n variant,\n weight,\n size,\n color = 'surface.text.gray.normal',\n testID,\n textAlign,\n textDecorationLine,\n}: GetTextProps<T>): GetTextPropsReturn => {\n const props: GetTextPropsReturn = {\n color,\n fontSize: 100,\n fontWeight: weight ?? 'regular',\n fontStyle: 'normal',\n lineHeight: 100,\n fontFamily: 'text',\n componentName: 'text',\n testID,\n textAlign,\n textDecorationLine,\n };\n\n if (variant === 'caption') {\n // variant of caption can only have size of small\n if (size && size !== 'small' && size !== 'medium') {\n if (__DEV__) {\n throwBladeError({\n moduleName: 'Text',\n message: `size cannot be '${size}' when variant is 'caption'`,\n });\n }\n // Set size as small in case of invalid size\n size = 'small';\n }\n } else if (variant !== 'caption' && !size) {\n size = 'medium';\n }\n\n if (variant === 'body') {\n if (size === 'xsmall') {\n props.fontSize = 25;\n props.lineHeight = 25;\n }\n if (size === 'small') {\n props.fontSize = 75;\n props.lineHeight = 75;\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 100;\n }\n if (size === 'large') {\n props.fontSize = 200;\n props.lineHeight = 200;\n }\n }\n if (variant === 'caption') {\n if (size === 'small') {\n props.fontSize = 50;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n }\n\n return props;\n};\n\nconst _Text = <T extends { variant: TextVariant }>(\n {\n as = 'p',\n variant = 'body',\n weight = 'regular',\n size,\n truncateAfterLines,\n children,\n color,\n testID,\n textAlign,\n textDecorationLine,\n wordBreak,\n textTransform,\n ...styledProps\n }: TextProps<T>,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const props: Omit<BaseTextProps, 'children'> = {\n as,\n truncateAfterLines,\n wordBreak,\n textTransform,\n ...getTextProps({\n variant,\n weight,\n color,\n size,\n testID,\n textAlign,\n textDecorationLine,\n }),\n };\n\n useValidateAsProp({ componentName: 'Text', as, validAsValues });\n\n return (\n <BaseText ref={ref} {...props} {...getStyledProps(styledProps)}>\n {children}\n </BaseText>\n );\n};\n\nconst Text = assignWithoutSideEffects(React.forwardRef(_Text), {\n displayName: 'Text',\n componentId: 'Text',\n});\n\nexport { Text, getTextProps };\n"],"names":["validAsValues","getTextProps","_ref","variant","weight","size","_ref$color","color","testID","textAlign","textDecorationLine","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","componentName","__DEV__","throwBladeError","moduleName","message","_Text","_ref2","ref","_ref2$as","as","_ref2$variant","_ref2$weight","truncateAfterLines","children","wordBreak","textTransform","styledProps","_objectWithoutProperties","_excluded","Object","assign","useValidateAsProp","_jsx","BaseText","getStyledProps","Text","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;AAEA,IAAA,SAAA,CAAA,CAAA,IAAA,CAAA,SAAA,CAAA,QAAA,CAAA,MAAA,CAAA,oBAAA,CAAA,UAAA,CAAA,OAAA,CAAA,QAAA,CAAA,WAAA,CAAA,oBAAA,CAAA,WAAA,CAAA,eAAA,CAAA,CAUA,IAAMA,aAAa,CAAG,CAAC,GAAG,CAAE,MAAM,CAAE,KAAK,CAAE,MAAM,CAAE,YAAY,CAAE,MAAM,CAAE,GAAG,CAAE,OAAO,CAAU,CAoDzF,IAAAC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAQyB,KAPzCC,OAAO,CAAAD,IAAA,CAAPC,OAAO,CACPC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,IAAI,CAAAH,IAAA,CAAJG,IAAI,CAAAC,UAAA,CAAAJ,IAAA,CACJK,KAAK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C,kBAAkB,CAAAa,KAAA,CAAlBb,kBAAkB,CAClBqB,SAAS,CAAAR,KAAA,CAATQ,SAAS,CACTC,aAAa,CAAAT,KAAA,CAAbS,aAAa,CACVC,WAAW,CAAAC,wBAAA,CAAAX,KAAA,CAAAY,SAAA,CAAA,CAIhB,IAAMxB,KAAsC,CAAAyB,MAAA,CAAAC,MAAA,CAC1CX,CAAAA,EAAE,CAAFA,EAAE,CACFG,kBAAkB,CAAlBA,kBAAkB,CAClBE,SAAS,CAATA,SAAS,CACTC,aAAa,CAAbA,aAAa,EACV/B,YAAY,CAAC,CACdE,OAAO,CAAPA,OAAO,CACPC,MAAM,CAANA,MAAM,CACNG,KAAK,CAALA,KAAK,CACLF,IAAI,CAAJA,IAAI,CACJG,MAAM,CAANA,MAAM,CACNC,SAAS,CAATA,SAAS,CACTC,kBAAkB,CAAlBA,kBACF,CAAC,CAAC,CACH,CAED4B,iBAAiB,CAAC,CAAErB,aAAa,CAAE,MAAM,CAAES,EAAE,CAAFA,EAAE,CAAE1B,aAAa,CAAbA,aAAc,CAAC,CAAC,CAE/D,OACEuC,GAAA,CAACC,QAAQ,CAAAJ,MAAA,CAAAC,MAAA,CAACb,CAAAA,GAAG,CAAEA,GAAI,CAAA,CAAKb,KAAK,CAAM8B,cAAc,CAACR,WAAW,CAAC,CAAA,CAAAH,QAAA,CAC3DA,QAAQ,CAAA,CACD,CAAC,CAEf,CAAC,CAEK,IAAAY,IAAI,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAACvB,KAAK,CAAC,CAAE,CAC7DwB,WAAW,CAAE,MAAM,CACnBC,WAAW,CAAE,MACf,CAAC;;;;"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../../../src/components/Typography/Text/Text.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { BladeElementRef, TestID, ElementTiming } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\n\nconst validAsValues = ['p', 'span', 'div', 'abbr', 'figcaption', 'cite', 'q', 'label'] as const;\ntype TextCommonProps = {\n as?: typeof validAsValues[number];\n truncateAfterLines?: number;\n children: React.ReactNode;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n /**\n * Overrides the color of the Text component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of text\n */\n color?: BaseTextProps['color'];\n textAlign?: BaseTextProps['textAlign'];\n textTransform?: BaseTextProps['textTransform'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n wordBreak?: BaseTextProps['wordBreak'];\n} & TestID &\n ElementTiming &\n StyledPropsBlade;\n\nexport type TextVariant = 'body' | 'caption';\n\ntype TextBodyVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'body'>;\n size?: Extract<BaseTextSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n};\n\ntype TextCaptionVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'caption'>;\n size?: Extract<BaseTextSizes, 'small' | 'medium'>;\n};\n\nexport type TextProps<T> = T extends { variant: infer Variant }\n ? Variant extends 'caption'\n ? TextCaptionVariant\n : Variant extends 'body'\n ? TextBodyVariant\n : T\n : T;\n\ntype GetTextPropsReturn = Omit<BaseTextProps, 'children'>;\ntype GetTextProps<T extends { variant: TextVariant }> = Pick<\n TextProps<T>,\n | 'variant'\n | 'weight'\n | 'size'\n | 'color'\n | 'testID'\n | 'textAlign'\n | 'textDecorationLine'\n | 'textTransform'\n>;\n\nconst getTextProps = <T extends { variant: TextVariant }>({\n variant,\n weight,\n size,\n color = 'surface.text.gray.normal',\n testID,\n textAlign,\n textDecorationLine,\n}: GetTextProps<T>): GetTextPropsReturn => {\n const props: GetTextPropsReturn = {\n color,\n fontSize: 100,\n fontWeight: weight ?? 'regular',\n fontStyle: 'normal',\n lineHeight: 100,\n fontFamily: 'text',\n componentName: 'text',\n testID,\n textAlign,\n textDecorationLine,\n };\n\n if (variant === 'caption') {\n // variant of caption can only have size of small\n if (size && size !== 'small' && size !== 'medium') {\n if (__DEV__) {\n throwBladeError({\n moduleName: 'Text',\n message: `size cannot be '${size}' when variant is 'caption'`,\n });\n }\n // Set size as small in case of invalid size\n size = 'small';\n }\n } else if (variant !== 'caption' && !size) {\n size = 'medium';\n }\n\n if (variant === 'body') {\n if (size === 'xsmall') {\n props.fontSize = 25;\n props.lineHeight = 25;\n }\n if (size === 'small') {\n props.fontSize = 75;\n props.lineHeight = 75;\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 100;\n }\n if (size === 'large') {\n props.fontSize = 200;\n props.lineHeight = 200;\n }\n }\n if (variant === 'caption') {\n if (size === 'small') {\n props.fontSize = 50;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n }\n\n return props;\n};\n\nconst _Text = <T extends { variant: TextVariant }>(\n {\n as = 'p',\n variant = 'body',\n weight = 'regular',\n size,\n truncateAfterLines,\n children,\n color,\n testID,\n textAlign,\n textDecorationLine,\n wordBreak,\n textTransform,\n elementtiming,\n ...styledProps\n }: TextProps<T>,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const props: Omit<BaseTextProps, 'children'> = {\n as,\n truncateAfterLines,\n wordBreak,\n textTransform,\n elementtiming,\n ...getTextProps({\n variant,\n weight,\n color,\n size,\n testID,\n textAlign,\n textDecorationLine,\n }),\n };\n\n useValidateAsProp({ componentName: 'Text', as, validAsValues });\n\n return (\n <BaseText ref={ref} {...props} {...getStyledProps(styledProps)}>\n {children}\n </BaseText>\n );\n};\n\nconst Text = assignWithoutSideEffects(React.forwardRef(_Text), {\n displayName: 'Text',\n componentId: 'Text',\n});\n\nexport { Text, getTextProps };\n"],"names":["validAsValues","getTextProps","_ref","variant","weight","size","_ref$color","color","testID","textAlign","textDecorationLine","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","componentName","__DEV__","throwBladeError","moduleName","message","_Text","_ref2","ref","_ref2$as","as","_ref2$variant","_ref2$weight","truncateAfterLines","children","wordBreak","textTransform","elementtiming","styledProps","_objectWithoutProperties","_excluded","Object","assign","useValidateAsProp","_jsx","BaseText","getStyledProps","Text","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;AAEA,IAAA,SAAA,CAAA,CAAA,IAAA,CAAA,SAAA,CAAA,QAAA,CAAA,MAAA,CAAA,oBAAA,CAAA,UAAA,CAAA,OAAA,CAAA,QAAA,CAAA,WAAA,CAAA,oBAAA,CAAA,WAAA,CAAA,eAAA,CAAA,eAAA,CAAA,CAUA,IAAMA,aAAa,CAAG,CAAC,GAAG,CAAE,MAAM,CAAE,KAAK,CAAE,MAAM,CAAE,YAAY,CAAE,MAAM,CAAE,GAAG,CAAE,OAAO,CAAU,CAqDzF,IAAAC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAQyB,CAAA,IAPzCC,OAAO,CAAAD,IAAA,CAAPC,OAAO,CACPC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,IAAI,CAAAH,IAAA,CAAJG,IAAI,CAAAC,UAAA,CAAAJ,IAAA,CACJK,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,0BAA0B,CAAAA,UAAA,CAClCE,MAAM,CAAAN,IAAA,CAANM,MAAM,CACNC,SAAS,CAAAP,IAAA,CAATO,SAAS,CACTC,kBAAkB,CAAAR,IAAA,CAAlBQ,kBAAkB,CAElB,IAAMC,KAAyB,CAAG,CAChCJ,KAAK,CAALA,KAAK,CACLK,QAAQ,CAAE,GAAG,CACb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AlBA,kBAAkB,CAClBE,SAAS,CAATA,SAAS,CACTC,aAAa,CAAbA,aAAa,CACbC,aAAa,CAAbA,aAAa,CAAA,CACVhC,YAAY,CAAC,CACdE,OAAO,CAAPA,OAAO,CACPC,MAAM,CAANA,MAAM,CACNG,KAAK,CAALA,KAAK,CACLF,IAAI,CAAJA,IAAI,CACJG,MAAM,CAANA,MAAM,CACNC,SAAS,CAATA,SAAS,CACTC,kBAAkB,CAAlBA,kBACF,CAAC,CAAC,CACH,CAED6B,iBAAiB,CAAC,CAAEtB,aAAa,CAAE,MAAM,CAAES,EAAE,CAAFA,EAAE,CAAE1B,aAAa,CAAbA,aAAc,CAAC,CAAC,CAE/D,OACEwC,GAAA,CAACC,QAAQ,CAAAJ,MAAA,CAAAC,MAAA,CAAA,CAACd,GAAG,CAAEA,GAAI,CAAKb,CAAAA,KAAK,CAAM+B,cAAc,CAACR,WAAW,CAAC,EAAAJ,QAAA,CAC3DA,QAAQ,CAAA,CACD,CAAC,CAEf,CAAC,CAEK,IAAAa,IAAI,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAACxB,KAAK,CAAC,CAAE,CAC7DyB,WAAW,CAAE,MAAM,CACnBC,WAAW,CAAE,MACf,CAAC;;;;"}
@@ -35,6 +35,8 @@ export { ChartArea, ChartAreaWrapper } from './Charts/AreaChart/AreaChart.native
35
35
  export { ChartDonut, ChartDonutCell, ChartDonutWrapper } from './Charts/DonutChart/DonutChart.native.js';
36
36
  export { ChartBar, ChartBarWrapper } from './Charts/BarChart/BarChart.native.js';
37
37
  export { ChartCartesianGrid, ChartLegend, ChartReferenceLine, ChartTooltip, ChartXAxis, ChartYAxis } from './Charts/CommonChartComponents/CommonChartComponents.native.js';
38
+ export { CommonChartComponentsContext, useCommonChartComponentsContext } from './Charts/CommonChartComponents/CommonChartComponentsContext.js';
39
+ export { DEFAULT_COLOR } from './Charts/CommonChartComponents/tokens.js';
38
40
  export { Chip } from './Chip/Chip.js';
39
41
  export { ChipGroup } from './Chip/ChipGroup.js';
40
42
  export { Collapsible } from './Collapsible/Collapsible.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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