@sproutsocial/seeds-react-data-viz 0.16.0 → 0.17.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 (66) hide show
  1. package/dist/annotations-CjFoRPXf.d.mts +20 -0
  2. package/dist/annotations-CjFoRPXf.d.ts +20 -0
  3. package/dist/axis-WOeYkTO1.d.mts +44 -0
  4. package/dist/axis-WOeYkTO1.d.ts +44 -0
  5. package/dist/bar/index.d.mts +4 -2
  6. package/dist/bar/index.d.ts +4 -2
  7. package/dist/bar/index.js +14 -10
  8. package/dist/bar/index.js.map +1 -1
  9. package/dist/{axis-PJwu5Xmo.d.ts → chartBase-C-l7yYGx.d.ts} +6 -60
  10. package/dist/{axis-DXzufRRj.d.mts → chartBase-Cn_5CUJi.d.mts} +6 -60
  11. package/dist/{chunk-XVV7PYQE.js → chunk-2K7PFHIM.js} +101 -254
  12. package/dist/chunk-2K7PFHIM.js.map +1 -0
  13. package/dist/chunk-6D7P3IOT.js +150 -0
  14. package/dist/chunk-6D7P3IOT.js.map +1 -0
  15. package/dist/chunk-CYQXUAJC.js +169 -0
  16. package/dist/chunk-CYQXUAJC.js.map +1 -0
  17. package/dist/chunk-VVGBJOFH.js +68 -0
  18. package/dist/chunk-VVGBJOFH.js.map +1 -0
  19. package/dist/{chunk-EEVKTTT3.js → chunk-WEKDYQ4T.js} +1 -1
  20. package/dist/chunk-WEKDYQ4T.js.map +1 -0
  21. package/dist/donut/index.d.mts +48 -0
  22. package/dist/donut/index.d.ts +48 -0
  23. package/dist/donut/index.js +125 -0
  24. package/dist/donut/index.js.map +1 -0
  25. package/dist/esm/bar/index.js +11 -7
  26. package/dist/esm/bar/index.js.map +1 -1
  27. package/dist/esm/chunk-AUJ3EWRH.js +68 -0
  28. package/dist/esm/chunk-AUJ3EWRH.js.map +1 -0
  29. package/dist/esm/{chunk-ZXXFRUVF.js → chunk-LPQXJJNT.js} +94 -247
  30. package/dist/esm/chunk-LPQXJJNT.js.map +1 -0
  31. package/dist/esm/chunk-NAKJY5PA.js +150 -0
  32. package/dist/esm/chunk-NAKJY5PA.js.map +1 -0
  33. package/dist/esm/chunk-XMYGML25.js +169 -0
  34. package/dist/esm/chunk-XMYGML25.js.map +1 -0
  35. package/dist/esm/{chunk-LC3HGWDD.js → chunk-Z4LOM4OZ.js} +1 -1
  36. package/dist/esm/chunk-Z4LOM4OZ.js.map +1 -0
  37. package/dist/esm/donut/index.js +125 -0
  38. package/dist/esm/donut/index.js.map +1 -0
  39. package/dist/esm/export/index.js.map +1 -1
  40. package/dist/esm/index.js +20 -164
  41. package/dist/esm/index.js.map +1 -1
  42. package/dist/esm/line-area/index.js +12 -7
  43. package/dist/esm/line-area/index.js.map +1 -1
  44. package/dist/esm/sparkline/index.js +123 -0
  45. package/dist/esm/sparkline/index.js.map +1 -0
  46. package/dist/export/index.js.map +1 -1
  47. package/dist/index.d.mts +26 -23
  48. package/dist/index.d.ts +26 -23
  49. package/dist/index.js +113 -257
  50. package/dist/index.js.map +1 -1
  51. package/dist/line-area/index.d.mts +7 -4
  52. package/dist/line-area/index.d.ts +7 -4
  53. package/dist/line-area/index.js +15 -10
  54. package/dist/line-area/index.js.map +1 -1
  55. package/dist/sparkline/index.d.mts +75 -0
  56. package/dist/sparkline/index.d.ts +75 -0
  57. package/dist/sparkline/index.js +123 -0
  58. package/dist/sparkline/index.js.map +1 -0
  59. package/dist/sparkline.css +76 -0
  60. package/dist/{types-B7ILUQ6_.d.mts → types-DxrhdAdn.d.mts} +3 -3
  61. package/dist/{types-B7ILUQ6_.d.ts → types-DxrhdAdn.d.ts} +3 -3
  62. package/package.json +15 -3
  63. package/dist/chunk-EEVKTTT3.js.map +0 -1
  64. package/dist/chunk-XVV7PYQE.js.map +0 -1
  65. package/dist/esm/chunk-LC3HGWDD.js.map +0 -1
  66. package/dist/esm/chunk-ZXXFRUVF.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-EEVKTTT3.js","../src/components/ColorBox/ColorBox.tsx","../../seeds-react-theme-provider/src/index.tsx","../src/components/ColorBox/DatavizColorBox.tsx","../src/components/ColorBox/NetworkColorBox.tsx","../src/components/ChartLegend/components/ChartLegendLabel.tsx","../src/components/ChartLegend/ChartLegend.tsx","../src/components/ChartTooltip/ChartTooltip.tsx","../src/components/ChartTooltip/components/ChartTooltipFooter.tsx","../src/components/ChartTooltip/components/ChartTooltipHeader.tsx","../src/components/ChartTooltip/components/ChartTooltipPortal.tsx","../src/components/ChartTable/ChartTable.tsx","../src/components/ChartTooltip/components/ChartTooltipTable.tsx","../src/components/ChartTooltip/components/ChartTooltipTitle.tsx","../src/helpers/transformDataToSeries.ts","../src/helpers/transformTimeSeriesTooltipData.ts","../src/helpers/yAxisLabelFormatter.ts","../src/helpers/xAxisLabelFormatter.ts","../src/helpers/isHourlyTimeData.ts","../src/helpers/isCategoricalHourData.ts","../src/helpers/getStorybookRandomColor.ts","../src/helpers/getStorybookCategoricalData.ts","../src/helpers/getStorybookSparseTimelineData.ts","../src/styles/chartStyles.ts","../src/components/ChartLegend/components/ChartLegendLabelContentWithIcon.tsx"],"names":["jsx","props"],"mappings":"AAAA;ACAA,yHAAkC;AAClC,8DAAuC;ADEvC;AACA;AEJA,8BAAuB;AACvB;AACE;AACA;AFMF;AEJA,kEAAsB;AA6BpB,+CAAA;AAZF,IAAM,kBAAA,EAAoB,mCAAA,CAAA;AFT1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;ACpBA;AAgBI;AATG,IAAM,SAAA,EAAW,CAAC;AAAA,EACvB,QAAA,EAAU,cAAA;AAAA,EACV,OAAA,EAAS,MAAA;AAAA,EACT,MAAA,EAAQ,MAAA;AAAA,EACR,SAAA,EAAW,KAAA;AAAA,EACX,aAAA,EAAe,KAAA;AAAA,EACf,GAAG;AACL,CAAA,EAAA,GAAyB;AACvB,EAAA,uBACEA,6BA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AA;AAAA;AAAA;AAAA;AAAA;AAclB;AAAyB,EAAA;AAMb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAoBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA;AAUC;AvB0rBH;AACA;AwBt5BF;AACA;AAeQ;AAPD;AAEH,EAAA;AAAyC,IAAA;AACvC,IAAA;AAEF,EAAA;AACE,IAAA;AAEK,MAAA;AAAA,MAAA;AACA,IAAA;AAKP,EAAA;AACF;AxB64BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-EEVKTTT3.js","sourcesContent":[null,"import { css, type CSSProp } from \"styled-components\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport ThemeProvider from \"@sproutsocial/seeds-react-theme-provider\";\nimport { type TypeSproutTheme } from \"@sproutsocial/seeds-react-theme\";\n\nexport type TypeColorBoxProps = TypeBoxProps;\n\n/**\n * ColorBox extends Box to apply basic styles.\n */\nexport const ColorBox = ({\n display = \"inline-block\",\n height = \"16px\",\n width = \"16px\",\n minWidth = width,\n borderRadius = \"400\",\n ...props\n}: TypeColorBoxProps) => {\n return (\n <Box\n {...props}\n display={display}\n height={height}\n width={width}\n minWidth={minWidth}\n borderRadius={borderRadius}\n css={\n css`\n cursor: ${(\n props: typeof ThemeProvider & {\n onClick: ((e: React.MouseEvent<HTMLElement>) => void) | void;\n }\n ) => (props?.onClick ? \"pointer\" : \"default\")};\n ` as CSSProp<TypeSproutTheme>\n }\n />\n );\n};\n","import * as React from \"react\";\nimport {\n ThemeProvider as BaseThemeProvider,\n createGlobalStyle,\n} from \"styled-components\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\nimport type {\n TypeSproutTheme,\n TypeTheme,\n} from \"@sproutsocial/seeds-react-theme\";\n\n// We can append additional themes types here\ntype TypeAllThemes = TypeTheme | TypeSproutTheme;\n\ntype TypeProps = {\n readonly theme?: TypeAllThemes;\n readonly children?: React.ReactNode;\n};\n\n// CSS custom properties for token values that cannot be represented in SCSS maps\n// (e.g. radial-gradient + color-mix). These are injected here so styled-components\n// consumers get the values without needing to load the compiled SCSS theme CSS.\nconst GlobalTokenStyles = createGlobalStyle`\n :root {\n --color-container-bg-ai-generated: radial-gradient(\n circle at bottom left,\n color-mix(in srgb, #205bc3, transparent 80%) 0%,\n color-mix(in srgb, #6f5ed3, transparent 80%) 61%,\n color-mix(in srgb, #f282f5, transparent 80%) 100%\n ), #f3f4f4;\n }\n`;\n\nconst ThemeProvider = (props: TypeProps) => (\n <BaseThemeProvider {...props} theme={props.theme || theme}>\n <GlobalTokenStyles />\n {props.children}\n </BaseThemeProvider>\n);\n\nexport default ThemeProvider;\n","import type * as React from \"react\";\nimport styled from \"styled-components\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\nimport { ColorBox, type TypeColorBoxProps } from \"./ColorBox\";\n\nexport type TypeDatavizColorBoxProps = Readonly<\n Partial<TypeColorBoxProps> & {\n colorIndex: number;\n }\n>;\nexport type TypeDatavizColorBox = (\n props: TypeDatavizColorBoxProps\n) => React.JSXElementConstructor<TypeDatavizColorBoxProps>;\n\n/**\n * DatavizColorBox extends ColorBox to set the background color from a rotation of <a href=\"https://seeds.sproutsocial.com/visual/dataviz#color-combinations-for-general-sprout-social-data-visualizations\">dataviz colors</a>.\n */\nexport const DatavizColorBox = styled(ColorBox).attrs(\n ({ colorIndex }: TypeDatavizColorBoxProps) => ({\n style: {\n background: getDatavizColor(colorIndex),\n opacity: getDatavizOpacity(colorIndex),\n },\n })\n)<TypeDatavizColorBoxProps>``;\n\nexport const getDatavizColor = (colorIndex: number): string =>\n theme.colors.DATAVIZ_COLORS_LIST[\n colorIndex % theme.colors.DATAVIZ_COLORS_LIST.length\n ] || \"\";\n\nexport const getDatavizOpacity = (colorIndex: number): number => {\n const opacitySteps = [1, 0.6, 0.4, 0.2];\n const opacityStep =\n Math.floor(colorIndex / theme.colors.DATAVIZ_COLORS_LIST.length) %\n opacitySteps.length;\n // @ts-ignore\n return opacitySteps[opacityStep];\n};\n\n// information on 8 digit hex codes can be found here: https://css-tricks.com/8-digit-hex-codes/\nexport const getDatavizColorWithAlpha = (colorIndex: number): string => {\n const color = getDatavizColor(colorIndex);\n const opacity = getDatavizOpacity(colorIndex);\n\n // make sure the opacity is always between 0 and 1\n if (opacity < 0 || opacity > 1) {\n return color;\n }\n\n // sourced from https://stackoverflow.com/a/66143374\n return `${color}${Math.floor(opacity * 255)\n .toString(16)\n .padStart(2, \"0\")}`;\n};\n","import NETWORK_COLORS from \"@sproutsocial/seeds-networkcolor\";\n\nimport { ColorBox, type TypeColorBoxProps } from \"./ColorBox\";\n\n// $Keys<typeof NETWORK_COLORS>\ntype TypeNetworkColor =\n | \"NETWORK_COLOR_TWITTER\"\n | \"NETWORK_COLOR_TWITTER_LIKE\"\n | \"NETWORK_COLOR_FACEBOOK\"\n | \"NETWORK_COLOR_FACEBOOK_AUDIENCE_NETWORK\"\n | \"NETWORK_COLOR_LINKEDIN\"\n | \"NETWORK_COLOR_INSTAGRAM\"\n | \"NETWORK_COLOR_FEEDLY\"\n | \"NETWORK_COLOR_ANALYTICS\"\n | \"NETWORK_COLOR_YOUTUBE\"\n | \"NETWORK_COLOR_MESSENGER\"\n | \"NETWORK_COLOR_SNAPCHAT\"\n | \"NETWORK_COLOR_PINTEREST\"\n | \"NETWORK_COLOR_REDDIT\"\n | \"NETWORK_COLOR_TUMBLR\"\n | \"NETWORK_COLOR_GOOGLE_MY_BUSINESS\"\n | \"NETWORK_COLOR_TIKTOK\"\n | \"NETWORK_COLOR_TRIPADVISOR\"\n | \"NETWORK_COLOR_GLASSDOOR\"\n | \"NETWORK_COLOR_SALESFORCE\"\n | \"NETWORK_COLOR_ZENDESK\"\n | \"NETWORK_COLOR_HUBSPOT\"\n | \"NETWORK_COLOR_MICROSOFT_DYNAMICS\";\n\ntype TypeNetworkColorBoxProps = Readonly<\n TypeColorBoxProps & {\n networkColor: TypeNetworkColor;\n }\n>;\n\n/**\n * NetworkColorBox extends ColorBox to set the background color to a <a href=\"https://seeds.sproutsocial.com/visual/color#full-color-palette\">network color</a>.\n */\nexport const NetworkColorBox = ({\n networkColor,\n ...props\n}: TypeNetworkColorBoxProps) => {\n return <ColorBox {...props} bg={NETWORK_COLORS[networkColor]} />;\n};\n","import styled from \"styled-components\";\nimport { memo } from \"react\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\n\nimport type { TypeLegendLabel } from \"../ChartLegend\";\n\nimport { ColorBox } from \"../../ColorBox\";\n\nconst StyledBox = styled(Box)<TypeBoxProps>`\n list-style: none;\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[300]};\n`;\n\nexport type TypeChartLegendLabelProps = Readonly<{\n children: TypeLegendLabel[\"content\"];\n color: TypeLegendLabel[\"color\"];\n // optional\n containerBoxProps?: TypeBoxProps;\n}>;\n\nexport const ChartLegendLabel = memo<TypeChartLegendLabelProps>(\n function ChartLegendLabel({\n children,\n color = \"#CCC\",\n containerBoxProps = {},\n }: TypeChartLegendLabelProps) {\n return (\n <StyledBox {...containerBoxProps}>\n <ColorBox bg={color} />\n <Text as=\"div\" fontSize={200} color=\"text.subtext\">\n {children}\n </Text>\n </StyledBox>\n );\n }\n);\n","import { memo } from \"react\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\n\nimport { ChartLegendLabel } from \"./components/ChartLegendLabel\";\n\nexport type TypeLegendLabel = Readonly<{\n content: React.ReactNode;\n color?: string;\n}>;\n\nexport type TypeChartLegendProps = Readonly<{\n legendLabels: ReadonlyArray<TypeLegendLabel>;\n // optional\n containerBoxProps?: TypeBoxProps;\n stacked?: boolean;\n}>;\n\nexport const ChartLegend = memo<TypeChartLegendProps>(function ChartLegend({\n legendLabels,\n containerBoxProps = {},\n stacked = false,\n}: TypeChartLegendProps) {\n return (\n <Box\n as=\"ul\"\n aria-hidden=\"true\"\n display=\"flex\"\n justifyContent=\"center\"\n flexDirection={stacked ? \"column\" : \"row\"}\n flexWrap=\"wrap\"\n columnGap={450}\n rowGap={200}\n m={0}\n p={0}\n {...containerBoxProps}\n >\n {legendLabels.map(({ color, content }, index) => (\n <ChartLegendLabel\n key={`chart-legend-label-${index}`}\n color={color || theme.colors.DATAVIZ_COLORS_LIST[index]}\n containerBoxProps={{ as: \"li\" }}\n >\n {content}\n </ChartLegendLabel>\n ))}\n </Box>\n );\n});\n","import { memo } from \"react\";\nimport styled from \"styled-components\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\n// styled components\nconst StyledBox = styled(Box)`\n .Icon,\n .logo {\n stroke: none;\n }\n`;\n\n// Chart Tooltip\ntype TypeChartTooltipProps = Readonly<{\n children: React.ReactNode;\n}>;\n\nexport const ChartTooltip = memo<TypeChartTooltipProps>(function ChartTooltip({\n children,\n}: TypeChartTooltipProps) {\n return (\n <StyledBox\n bg=\"container.background.base\"\n boxShadow=\"medium\"\n border={500}\n borderColor=\"container.border.base\"\n borderRadius={500}\n p={400}\n minWidth={285}\n >\n <Box display=\"flex\" flexDirection=\"column\" gap={350}>\n {children}\n </Box>\n </StyledBox>\n );\n});\n","import { memo } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\ntype TypeChartTooltipFooterProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipFooter = memo<TypeChartTooltipFooterProps>(\n function ChartTooltipFooter({ children }: TypeChartTooltipFooterProps) {\n return (\n <Box\n borderTop={500}\n borderColor=\"container.border.base\"\n mx={-400}\n mb={-200}\n px={400}\n pt={350}\n >\n {children}\n </Box>\n );\n }\n);\n","import { memo } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\ntype TypeChartTooltipHeaderProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipHeader = memo<TypeChartTooltipHeaderProps>(\n function ChartTooltipHeader({ children }: TypeChartTooltipHeaderProps) {\n return (\n <Box\n borderBottom={500}\n borderColor=\"container.border.base\"\n mx={-400}\n mt={-200}\n px={400}\n pb={350}\n >\n {children}\n </Box>\n );\n }\n);\n","import { memo, useState, useRef, useEffect, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport type {\n Tooltip,\n Chart,\n TooltipFormatterContextObject,\n TooltipFormatterCallbackFunction,\n} from \"highcharts\";\n\ninterface ExtendedHighchartsTooltip extends Tooltip {\n label: {\n box: { attr({ height, width }: { height: number; width: number }): void };\n text: { element: HTMLElement };\n };\n}\n\nexport const generateChartTooltipPortalId = (chartId: number) =>\n `highcharts-custom-tooltip-${chartId}`;\n\ntype ChartTooltipPortalProps = Readonly<{\n chart: Chart;\n renderContent: (context: TooltipFormatterContextObject) => ReactNode;\n}>;\n\nexport const ChartTooltipPortal = memo<ChartTooltipPortalProps>(\n function ChartTooltipPortal({\n chart,\n renderContent,\n }: ChartTooltipPortalProps) {\n const isInitialized = useRef<boolean>(false);\n const [node, setNode] = useState<HTMLElement | null>(null);\n const [context, setContext] =\n useState<TooltipFormatterContextObject | null>(null);\n\n useEffect(() => {\n const formatter: TooltipFormatterCallbackFunction = function () {\n // Ensures that tooltip DOM container is rendered before React portal is created.\n if (!isInitialized.current) {\n isInitialized.current = true;\n chart.tooltip.refresh.apply(chart.tooltip, [this.point]);\n chart.tooltip.hide(0);\n }\n\n setContext(this);\n\n return `<div id=\"${generateChartTooltipPortalId(\n chart.index\n )}\" role='tooltip'></div>`;\n };\n\n chart.update({ tooltip: { formatter } });\n }, [chart]);\n\n useEffect(() => {\n // In some cases tooltip is not available on the chart yet\n if (context?.series?.chart?.tooltip) {\n const tooltip = context.series.chart\n .tooltip as ExtendedHighchartsTooltip;\n const textElement = tooltip.label.text.element;\n\n tooltip.label.box.attr({\n height: textElement.offsetHeight,\n width: textElement.offsetWidth,\n });\n\n setNode(\n document.getElementById(generateChartTooltipPortalId(chart.index))\n );\n }\n }, [context, chart.index]);\n\n return node && context ? createPortal(renderContent(context), node) : null;\n }\n);\n","import { memo } from \"react\";\nimport styled from \"styled-components\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\nimport { Table as SeedsTable } from \"@sproutsocial/seeds-react-table\";\n\nconst StyledSeedsTable = styled<typeof SeedsTable>(SeedsTable)`\n tbody tr:last-child {\n border-bottom: none;\n }\n tr:last-child td,\n tr:last-child th {\n padding-bottom: 0;\n }\n tr:first-child td,\n tr:first-child th {\n padding-top: 0;\n }\n tr th {\n padding-left: 0;\n }\n tr td:last-child {\n padding-right: 0;\n }\n`;\n\nconst StyledSeedsTableRow = styled(SeedsTable.TableRow)<{\n $isAppendedRow?: boolean;\n}>`\n ${({ $isAppendedRow, theme }) =>\n $isAppendedRow\n ? `border-top: 2px solid ${theme.colors.container.border.base}`\n : \"\"}\n`;\n\nexport type TypeChartTableProps = Readonly<{\n rows: ReadonlyArray<{\n cells: ReadonlyArray<{\n content: React.ReactNode;\n align?: React.ComponentProps<typeof SeedsTable.Cell>[\"align\"];\n colSpan?: React.ComponentProps<typeof SeedsTable.Cell>[\"colSpan\"];\n }>;\n isAppendedRow?: boolean;\n }>;\n}>;\n\nexport const ChartTable = memo<TypeChartTableProps>(function ChartTable({\n rows,\n}: TypeChartTableProps) {\n if (!rows || rows.length === 0) {\n return null;\n }\n\n return (\n <StyledSeedsTable>\n <SeedsTable.TableBody>\n {rows.map(({ cells, isAppendedRow }, rowIndex) => {\n if (!cells || cells.length === 0) {\n return null;\n }\n\n return (\n <StyledSeedsTableRow\n key={`chart-tooltip-table-row-${rowIndex}`}\n $isAppendedRow={isAppendedRow}\n >\n {cells.map(\n ({ content, align = \"left\", colSpan = 1 }, cellIndex) => {\n const uniqueIdentifier = `chart-tooltip-table-cell-${cellIndex}`;\n return (\n <SeedsTable.Cell\n key={uniqueIdentifier}\n id={uniqueIdentifier}\n scope={cellIndex === 0 ? \"row\" : undefined}\n align={align}\n colSpan={colSpan}\n py={200}\n >\n <Text.SmallBodyCopy as=\"div\">\n {content}\n </Text.SmallBodyCopy>\n </SeedsTable.Cell>\n );\n }\n )}\n </StyledSeedsTableRow>\n );\n })}\n </SeedsTable.TableBody>\n </StyledSeedsTable>\n );\n});\n","import { memo } from \"react\";\n\nimport { ChartTable, type TypeChartTableProps } from \"../../ChartTable\";\n\nexport type TypeChartTooltipTableProps = {\n rows: TypeChartTableProps[\"rows\"];\n};\n\nexport const ChartTooltipTable = memo<TypeChartTooltipTableProps>(\n function ChartTooltipTable({ rows }: TypeChartTooltipTableProps) {\n return <ChartTable rows={rows} />;\n }\n);\n","import { memo } from \"react\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\n\ntype TypeChartTooltipTitleProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipTitle = memo<TypeChartTooltipTitleProps>(\n function ChartTooltipTitle({ children }: TypeChartTooltipTitleProps) {\n return <Text.SmallSubHeadline as=\"p\">{children}</Text.SmallSubHeadline>;\n }\n);\n","import type {\n SeriesSplineOptions,\n SeriesAreasplineOptions,\n SeriesColumnOptions,\n} from \"highcharts\";\n\nimport type { TypeAreaChartProps } from \"../components/AreaChart\";\nimport type { TypeLineChartProps } from \"../components/LineChart\";\nimport type { TypeVerticalBarChartProps, TypeSeriesType } from \"../types\";\n\ntype TypeTimeSeriesOptions =\n | SeriesSplineOptions\n | SeriesAreasplineOptions\n | SeriesColumnOptions;\n\n// returns a transformed set of data to series with some logic for handling null values\nexport const transformDataToSeries = (\n {\n data,\n }: {\n data:\n | TypeAreaChartProps[\"data\"]\n | TypeLineChartProps[\"data\"]\n | TypeVerticalBarChartProps[\"data\"];\n },\n type: TypeSeriesType\n): TypeTimeSeriesOptions[] => {\n // Check if we have categorical data (string x values)\n const hasCategoricalData = data.some((series) =>\n series.points.some((point) => typeof point.x === \"string\")\n );\n\n return data.map((dataItem, dataIndex) => {\n const points = dataItem.points || [];\n const dataPoints = points.map((point, pointsIndex) => {\n let enableMarker = false;\n const isFirstPoint = pointsIndex === 0;\n const isLastPoint = pointsIndex === points.length - 1;\n\n // @ts-ignore\n const previousY = isFirstPoint ? null : points[pointsIndex - 1].y;\n // @ts-ignore\n const nextY = isLastPoint ? null : points[pointsIndex + 1].y;\n\n if (isFirstPoint && nextY === null) {\n // if the first point has data and the second point is null, show a marker for the first point\n enableMarker = true;\n } else if (isLastPoint && previousY === null) {\n // if the last point has data and the second to last point is null, show a marker for the last point\n enableMarker = true;\n } else if (previousY === null && nextY === null) {\n // if the a point has null values on both sides, show a marker\n enableMarker = true;\n }\n\n return {\n x: hasCategoricalData ? pointsIndex : point.x,\n y: point.y,\n marker: {\n enabled: enableMarker ? enableMarker : undefined,\n symbol: enableMarker ? \"circle\" : undefined,\n },\n // For categorical data, store the original category name\n ...(hasCategoricalData && { name: point.x }),\n };\n });\n\n return {\n colorIndex: dataIndex,\n data: dataPoints as TypeTimeSeriesOptions[\"data\"],\n name: dataItem.name as TypeTimeSeriesOptions[\"name\"],\n type: type,\n };\n });\n};\n","import type { TooltipFormatterContextObject } from \"highcharts\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\n\nimport type { TypeAreaChartProps } from \"../components/AreaChart\";\nimport type { TypeLineChartProps } from \"../components/LineChart\";\nimport type { TypeChartTooltipProps } from \"../types\";\n\ntype TypeTransformTimeSeriesTooltipDataProps = Readonly<{\n context: TooltipFormatterContextObject;\n data: TypeAreaChartProps[\"data\"] | TypeLineChartProps[\"data\"];\n}>;\ntype TypeTransformTimeSeriesTooltipDataReturn = TypeChartTooltipProps[\"data\"];\n\nexport const transformTimeSeriesTooltipData = ({\n context,\n data,\n}: TypeTransformTimeSeriesTooltipDataProps): TypeTransformTimeSeriesTooltipDataReturn => {\n // @ts-ignore\n return (context.series.chart.series || []).map((series, index) => {\n const pointIndex = context.point.index;\n const y = series?.points?.[pointIndex]?.y;\n\n return {\n color:\n data[index]?.styles?.color || theme.colors.DATAVIZ_COLORS_LIST[index],\n ...(data[index]?.icon ? { icon: data[index]?.icon } : {}),\n name: series.name,\n value: typeof y === \"number\" ? y : null,\n };\n });\n};\n","import type {\n AxisLabelsFormatterContextObject,\n AxisTickPositionsArray,\n} from \"highcharts\";\nimport { formatDuration } from \"@sproutsocial/seeds-react-duration\";\nimport { formatNumeral } from \"@sproutsocial/seeds-react-numeral\";\n\nimport type { TypeChartNumberFormat } from \"../types\";\n\ntype TypeYAxisLabelFormatterProps = Readonly<{\n numberLocale: Intl.LocalesArgument;\n textLocale: Intl.LocalesArgument;\n tickPositions: AxisTickPositionsArray;\n value: AxisLabelsFormatterContextObject[\"value\"];\n // optional\n currency?: string;\n numberFormat?: TypeChartNumberFormat;\n}>;\n\nexport const yAxisLabelFormatter = ({\n numberLocale,\n textLocale,\n tickPositions,\n value,\n currency = \"USD\",\n numberFormat = \"decimal\",\n}: TypeYAxisLabelFormatterProps): string => {\n const numberValue = Number(value);\n\n if (numberValue === 0) {\n return formatNumeral({\n locale: numberLocale as string,\n number: numberValue,\n });\n }\n\n if (numberFormat === \"duration\") {\n return formatDuration({\n display: \"narrow\",\n locale: textLocale,\n milliseconds: numberValue,\n });\n }\n\n // Seeds formatNumeral helper starts abbreviating numbers above 10,000. this maxValue logic\n // helps bring that threshold down to 1,000 if the last tick on the y axis is greater than 9,999\n // so we render \"2k 4k 6k 8k 10k\" instead of \"2,000 4,000 6,000 8,000 10k\"\n const maxValue =\n tickPositions && tickPositions.length > 0\n ? tickPositions[tickPositions.length - 1]\n : undefined;\n const abbreviate =\n typeof maxValue === \"number\" && maxValue > 9999 ? 1000 : true;\n\n return formatNumeral({\n abbreviate,\n currency,\n format: numberFormat,\n locale: numberLocale as string,\n number: numberValue,\n });\n};\n","import type {\n AxisLabelsFormatterContextObject,\n AxisTickPositionsArray,\n} from \"highcharts\";\n\nimport type {\n ExtendedTimeTicksInfoObject,\n TypeChartTimeFormat,\n} from \"../types\";\n\nconst getDatePartsInTimezone = (date: Date, timezone: string) => {\n const formatter = new Intl.DateTimeFormat(\"en-US\", {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n timeZone: timezone,\n });\n const parts = formatter.formatToParts(date);\n return {\n day: parseInt(parts.find((p) => p.type === \"day\")?.value ?? \"0\", 10),\n month: parseInt(parts.find((p) => p.type === \"month\")?.value ?? \"0\", 10),\n year: parseInt(parts.find((p) => p.type === \"year\")?.value ?? \"0\", 10),\n };\n};\n\ntype TypeXAxisLabelFormatterProps = Readonly<{\n textLocale: Intl.LocalesArgument;\n tickPositions: AxisTickPositionsArray;\n unitName: ExtendedTimeTicksInfoObject[\"unitName\"];\n value: AxisLabelsFormatterContextObject[\"value\"];\n // optional\n timeFormat?: TypeChartTimeFormat;\n timezone?: string;\n}>;\n\nexport const xAxisLabelFormatter = ({\n textLocale,\n tickPositions = [],\n unitName,\n value,\n // optional\n timeFormat = \"12\",\n timezone = \"UTC\",\n}: TypeXAxisLabelFormatterProps): string => {\n // Handle categorical (string) data\n if (typeof value === \"string\") {\n return `<span>${value}</span>`;\n }\n const tickIndex = tickPositions.indexOf(value as number);\n const isFirst = tickIndex === 0;\n const previousValue = tickPositions[tickIndex - 1];\n\n const valueDate = new Date(value);\n const valueParts = getDatePartsInTimezone(valueDate, timezone);\n const previousValueDate = previousValue ? new Date(previousValue) : undefined;\n const previousValueParts = previousValueDate\n ? getDatePartsInTimezone(previousValueDate, timezone)\n : undefined;\n\n let firstPartOptions = {};\n let secondPartOptions = {};\n\n switch (unitName) {\n case \"hour\":\n firstPartOptions =\n timeFormat === \"24\"\n ? { hour: \"numeric\", minute: \"numeric\", hour12: false }\n : { hour: \"numeric\" };\n if (isFirst || valueParts.day !== previousValueParts?.day) {\n secondPartOptions = { day: \"numeric\", month: \"short\" };\n }\n break;\n case \"day\":\n case \"week\":\n firstPartOptions = { day: \"numeric\" };\n if (isFirst || valueParts.month !== previousValueParts?.month) {\n secondPartOptions = { month: \"short\" };\n }\n break;\n case \"month\":\n firstPartOptions = { month: \"short\" };\n if (isFirst || valueParts.year !== previousValueParts?.year) {\n secondPartOptions = { year: \"numeric\" };\n }\n break;\n case \"year\":\n firstPartOptions = { year: \"numeric\" };\n break;\n default:\n firstPartOptions = {};\n break;\n }\n\n const firstPart = new Intl.DateTimeFormat(textLocale, {\n ...firstPartOptions,\n timeZone: timezone,\n }).format(valueDate);\n const secondPart =\n Object.keys(secondPartOptions).length > 0\n ? new Intl.DateTimeFormat(textLocale, {\n ...secondPartOptions,\n timeZone: timezone,\n }).format(valueDate)\n : undefined;\n\n return `<span>${firstPart}</span>${\n secondPart ? `<span>${secondPart}</span>` : \"\"\n }`;\n};\n","/**\n * Helper to detect if data is hourly time data (all x values are hours of the same day)\n * @param data - Array of series data with points containing x values\n * @returns boolean indicating if all x values are hours of the same day\n * @deprecated Auto-detection of hourly data is deprecated. v2 is declarative:\n * use `xAxis={{ type: \"datetime\", timeFormat: \"12\" | \"24\" }}` + a top-level\n * `timezone` instead of relying on implicit detection. See\n * `seeds-tooling/seeds-codemod-cli/src/usage-patterns/VERTICALBARCHARTV1_PATTERNS.md`\n * (CE-8).\n */\nexport function isHourlyTimeData(\n data: ReadonlyArray<\n Readonly<{ points: ReadonlyArray<{ x: number | string }> }>\n >\n): boolean {\n // Return false if there is no data.\n if (!data.length) return false;\n\n // Flatten all data points into a single array of x values.\n const xVals = data.flatMap((series) => series.points.map((p) => p.x));\n\n // Return false if there are no x values.\n if (!xVals.length) return false;\n\n // Return false if any x values are strings (categorical data)\n if (xVals.some((x) => typeof x === \"string\")) return false;\n\n // Check if all x values are on the same calendar date.\n // We do this by converting each timestamp to a YYYY-MM-DD string and checking if there's only one unique date string.\n const dates = (xVals as number[]).map((x) => {\n const d = new Date(x);\n return `${d.getUTCFullYear()}-${d.getUTCMonth()}-${d.getUTCDate()}`;\n });\n const uniqueDates = new Set(dates);\n if (uniqueDates.size !== 1) return false;\n\n // Check if all x values are exactly on the hour (e.g., 2:00:00, not 2:00:01).\n // We also check that the hour is within the valid 0-23 range.\n return (xVals as number[]).every((x) => {\n const d = new Date(x);\n const hour = d.getUTCHours();\n const minutes = d.getUTCMinutes();\n const seconds = d.getUTCSeconds();\n return hour >= 0 && hour <= 23 && minutes === 0 && seconds === 0;\n });\n}\n","/**\n * Helper to detect if data is categorical hour data (all x values are hour strings)\n * Supports both 12-hour format (\"12 AM\", \"1 PM\") and 24-hour format (\"00:00\", \"13:00\", \"23:00\")\n * @param data - Array of series data with points containing x values\n * @returns boolean indicating if all x values are hour strings\n * @deprecated Auto-detection of hourly data is deprecated. v2 is declarative:\n * use `xAxis={{ type: \"datetime\", timeFormat: \"12\" | \"24\" }}` + a top-level\n * `timezone` instead of relying on implicit detection. See\n * `seeds-tooling/seeds-codemod-cli/src/usage-patterns/VERTICALBARCHARTV1_PATTERNS.md`\n * (CE-8).\n */\nexport function isCategoricalHourData(\n data: ReadonlyArray<\n Readonly<{ points: ReadonlyArray<{ x: number | string }> }>\n >\n): boolean {\n // Return false if there is no data.\n if (!data.length) return false;\n\n // Flatten all data points into a single array of x values.\n const xVals = data.flatMap((series) => series.points.map((p) => p.x));\n\n // Return false if there are no x values.\n if (!xVals.length) return false;\n\n // Return false if any x values are not strings (numerical data)\n if (xVals.some((x) => typeof x !== \"string\")) return false;\n\n // Check if all x values match either 12-hour or 24-hour format patterns\n const hour12Pattern = /^\\d{1,2} (AM|PM)$/; // \"12 AM\", \"1 PM\", \"10 AM\"\n const hour24Pattern = /^([01]?\\d|2[0-3]):([0-5]\\d)$/; // \"00:00\", \"13:00\", \"23:59\"\n\n const stringValues = xVals as string[];\n\n // Check if all values match 12-hour format\n const allMatch12Hour = stringValues.every((x) => hour12Pattern.test(x));\n\n // Check if all values match 24-hour format\n const allMatch24Hour = stringValues.every((x) => hour24Pattern.test(x));\n\n return allMatch12Hour || allMatch24Hour;\n}\n","export const getStorybookRandomColor = (): string => {\n const letters = \"0123456789ABCDEF\";\n let color = \"#\";\n for (let i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n};\n","import { getStorybookRandomColor } from \"./getStorybookRandomColor\";\n\nexport const getStorybookCategoricalData = ({\n showNulls,\n showNegativeValues,\n numberOfSeries,\n yAxisMax,\n showCustomColors,\n showDashedLines,\n categoryType,\n}: {\n showNulls: boolean;\n showNegativeValues: boolean;\n numberOfSeries: number;\n yAxisMax: number;\n showCustomColors: boolean;\n showDashedLines: boolean;\n categoryType: \"hours\" | \"hours24\" | \"days\" | \"months\" | \"custom\";\n}) => {\n // Define different category sets\n const categoryOptions = {\n hours: [\n \"12 AM\",\n \"1 AM\",\n \"2 AM\",\n \"3 AM\",\n \"4 AM\",\n \"5 AM\",\n \"6 AM\",\n \"7 AM\",\n \"8 AM\",\n \"9 AM\",\n \"10 AM\",\n \"11 AM\",\n \"12 PM\",\n \"1 PM\",\n \"2 PM\",\n \"3 PM\",\n \"4 PM\",\n \"5 PM\",\n \"6 PM\",\n \"7 PM\",\n \"8 PM\",\n \"9 PM\",\n \"10 PM\",\n \"11 PM\",\n ],\n hours24: [\n \"00:00\",\n \"01:00\",\n \"02:00\",\n \"03:00\",\n \"04:00\",\n \"05:00\",\n \"06:00\",\n \"07:00\",\n \"08:00\",\n \"09:00\",\n \"10:00\",\n \"11:00\",\n \"12:00\",\n \"13:00\",\n \"14:00\",\n \"15:00\",\n \"16:00\",\n \"17:00\",\n \"18:00\",\n \"19:00\",\n \"20:00\",\n \"21:00\",\n \"22:00\",\n \"23:00\",\n ],\n days: [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n ],\n months: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n custom: [\n \"Category A\",\n \"Category B\",\n \"Category C\",\n \"Category D\",\n \"Category E\",\n ],\n };\n\n const categories = categoryOptions[categoryType];\n const numberOfPoints = categories.length;\n\n return [...Array(numberOfSeries).keys()].map((seriesIndex) => {\n let nullsArray: ReadonlyArray<number> = [];\n\n if (showNulls) {\n const nullsArrayLength = Math.floor(numberOfPoints / 5);\n nullsArray = [...Array(nullsArrayLength)].map(() =>\n Math.floor(Math.random() * numberOfPoints)\n );\n }\n\n return {\n points: categories.map((category, pointIndex) => {\n const showNull =\n nullsArray && nullsArray.length > 0\n ? nullsArray.includes(pointIndex)\n : false;\n const randomValue = Math.random();\n const positiveOrNegativeYAxisMax = showNegativeValues\n ? randomValue < 0.5\n ? -yAxisMax\n : yAxisMax\n : yAxisMax;\n\n return {\n x: category,\n y: showNull\n ? null\n : Math.floor(randomValue * positiveOrNegativeYAxisMax),\n };\n }),\n name: `Series ${seriesIndex + 1}`,\n styles: {\n color: showCustomColors ? getStorybookRandomColor() : undefined,\n pattern: showDashedLines ? \"dashed\" : \"solid\",\n },\n };\n });\n};\n","import { getStorybookRandomColor } from \"./getStorybookRandomColor\";\n\nexport const getStorybookSparseTimelineData = ({\n showNulls,\n showNegativeValues,\n numberOfSeries,\n yAxisMax,\n showCustomColors,\n showDashedLines,\n numberOfPoints = 5,\n timeSpanHours = 24,\n}: {\n showNulls: boolean;\n showNegativeValues: boolean;\n numberOfSeries: number;\n yAxisMax: number;\n showCustomColors: boolean;\n showDashedLines: boolean;\n numberOfPoints?: number;\n timeSpanHours?: number;\n}) => {\n const seriesNames = [\n \"Posts Published\",\n \"Comments\",\n \"Likes\",\n \"Shares\",\n \"Clicks\",\n \"Views\",\n \"Saves\",\n \"Reposts\",\n \"Mentions\",\n \"Reactions\",\n ];\n\n const baseDate = new Date(\"2024-01-01T00:00:00Z\");\n const timeSpanMs = timeSpanHours * 60 * 60 * 1000;\n\n return [...Array(numberOfSeries).keys()].map((seriesIndex) => {\n let nullsArray: ReadonlyArray<number> = [];\n\n if (showNulls) {\n const nullsArrayLength = Math.floor(numberOfPoints / 5);\n nullsArray = [...Array(nullsArrayLength)].map(() =>\n Math.floor(Math.random() * numberOfPoints)\n );\n }\n\n // Generate random timestamps for this series\n const timestamps = [...Array(numberOfPoints)]\n .map(() => {\n const randomOffset = Math.random() * timeSpanMs;\n return baseDate.getTime() + randomOffset;\n })\n .sort((a, b) => a - b); // Sort chronologically\n\n return {\n points: timestamps.map((timestamp, pointIndex) => {\n const showNull =\n nullsArray && nullsArray.length > 0\n ? nullsArray.includes(pointIndex)\n : false;\n const randomValue = Math.random();\n const positiveOrNegativeYAxisMax = showNegativeValues\n ? randomValue < 0.5\n ? -yAxisMax\n : yAxisMax\n : yAxisMax;\n\n return {\n x: timestamp,\n y: showNull\n ? null\n : Math.floor(randomValue * positiveOrNegativeYAxisMax),\n };\n }),\n name: seriesNames[seriesIndex] || `Series ${seriesIndex + 1}`,\n styles: {\n color: showCustomColors ? getStorybookRandomColor() : undefined,\n pattern: showDashedLines ? \"dashed\" : \"solid\",\n },\n };\n });\n};\n","import { css, createGlobalStyle } from \"styled-components\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\nimport {\n type TypeChartStyleColor,\n type TypeChartStyleHasOnClick,\n type TypeChartStylePattern,\n} from \"../types\";\nimport \"highcharts/css/highcharts.css\";\n\nexport const GlobalChartStyleOverrides = createGlobalStyle`\n // USAGE NOTE:\n // Put general styles in baseChartStyles instead when possible to avoid excessive global styling.\n // This global component is only for styles that can't override highcharts defaults when scoped.\n\n .highcharts-tooltip-container {\n z-index: 7 !important;\n }\n .highcharts-tooltip-box {\n fill: transparent !important;\n }\n`;\n\n// options that should apply to all charts\nexport const baseChartStyles = css<\n Readonly<{ $colors: ReadonlyArray<TypeChartStyleColor> }>\n>`\n --highcharts-background-color: ${({ theme }) =>\n theme.colors.container.background.base};\n\n // set color variables and map to each series\n ${({ $colors }) =>\n $colors\n .map((color, index) => {\n const chartColor = color || theme.colors.DATAVIZ_COLORS_LIST[index];\n return `\n\t\t\t\t// map colors to custom assigned colors or fallback to default data viz color rotation\n\t\t\t\t--highcharts-color-${index}: ${chartColor};\n\n\t\t\t\t// highcharts already accounts for 10 series, but if we have more, we need to add them\n\t\t\t\t.highcharts-color-${index} {\n\t\t\t\t\tcolor: var(--highcharts-color-${index});\n\t\t\t\t\tstroke: var(--highcharts-color-${index});\n\t\t\t\t\tfill: var(--highcharts-color-${index});\n\t\t\t\t}`;\n })\n .join(\"\\n\")}\n\n // set overall chart background color\n .highcharts-background {\n fill: ${({ theme }) => theme.colors.container.background.base};\n }\n\n g.highcharts-annotation-label {\n display: none;\n }\n\n div.highcharts-annotation-label {\n top: 0 !important;\n transform: translateX(-50%); // centers the label on the targeted axis point\n pointer-events: none; // prevents tooltip hover from being interrupted by this element since it renders after on the dom\n }\n`;\n\n// options that should apply to time series charts\nexport const timeSeriesChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${baseChartStyles}\n\n // vertical crosshair styles\n\t.highcharts-crosshair {\n stroke: ${({ theme }) => theme.colors.container.border.decorative.neutral};\n stroke-width: 1;\n }\n\n // axis and gridline styles\n .highcharts-grid-line {\n stroke: ${({ theme }) => theme.colors.container.border.base};\n }\n\n .highcharts-axis-line {\n stroke: ${({ theme }) => theme.colors.container.border.base};\n }\n\n .highcharts-tick {\n stroke: none;\n }\n .highcharts-xaxis-labels,\n .highcharts-yaxis-labels {\n // v1 HTML labels (useHTML: true). v2 SVG label styles live in\n // charts/shared/styles.ts (axisLabelV2Styles) — don't add v2 rules here.\n > span {\n font-family: ${({ theme }) => theme.fontFamily};\n ${({ theme }) => theme.typography[100]};\n font-weight: ${({ theme }) => theme.fontWeights.normal};\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n }\n .highcharts-xaxis-labels {\n // v1 HTML stacked labels (useHTML: true). v2 SVG stacked-label styles live\n // in charts/shared/styles.ts (axisLabelV2Styles).\n > span {\n display: flex;\n flex-direction: column;\n align-items: center;\n > span:nth-of-type(2) {\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n }\n\n // we don't want to drop the opacity when another item is hovered\n .highcharts-series-inactive {\n opacity: 1;\n }\n\n // apply cursor pointer when click functionality is turned on\n ${({ $hasOnClick }) =>\n $hasOnClick &&\n `\n \t\t\t.highcharts-series,\n \t\t\t.highcharts-point {\n \t\t\t\tcursor: pointer;\n \t\t\t}\n \t\t\t.highcharts-plot-background,\n \t\t\t.highcharts-crosshair,\n \t\t\t.highcharts-grid-line {\n \t\t\t\tfill: transparent;\n \t\t\t\tcursor: pointer;\n \t\t}`}\n\n path.highcharts-plot-line.y-axis-zero-line {\n stroke: ${({ theme }) => theme.colors.container.border.decorative.neutral};\n }\n`;\n\n// options that should apply to line charts\nexport const lineChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $patterns: ReadonlyArray<TypeChartStylePattern>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${timeSeriesChartStyles}\n\n // set the line stroke\n\t.highcharts-graph {\n stroke-width: 3;\n }\n\n // dashed line styles\n ${({ $patterns }) =>\n $patterns.map((pattern, index) => {\n return pattern === \"dashed\"\n ? `\n \t\t\t\t\t// highcharts already accounts for 10 series, but if we have more, we need to add them\n \t\t\t\t\t.highcharts-series-${index} {\n \t\t\t\t\t\tstroke-dasharray: 2, 8;\n \t\t\t\t\t}`\n : \"\";\n })}\n`;\n\n// options that should apply to area charts\nexport const areaChartStyles = css`\n ${timeSeriesChartStyles}\n\n // don't need to show a stroke for the line part of each area\n\t.highcharts-graph {\n stroke-width: 0;\n }\n\n // fill areas to full opacity\n .highcharts-area {\n fill-opacity: 1;\n }\n`;\n\n// options that should apply to donut charts\nexport const donutChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${baseChartStyles}\n\n // remove 250ms fade in/out when hovering over different donut chart slices\n\t.highcharts-point {\n transition: opacity 0s;\n }\n\n // remove stroke on donut slices\n .highcharts-pie-series .highcharts-point {\n stroke: none;\n }\n\n // don't reduce opacity when hovering\n .highcharts-point-hover {\n fill-opacity: none;\n }\n\n // apply cursor pointer when click functionality is turned on\n ${({ $hasOnClick }) =>\n $hasOnClick &&\n `\n \t\t\t.highcharts-series,\n \t\t\t.highcharts-point {\n \t\t\t\tcursor: pointer;\n \t\t\t}\n \t\t\t.highcharts-plot-background,\n \t\t\t.highcharts-crosshair,\n \t\t\t.highcharts-grid-line {\n \t\t\t\tfill: transparent;\n \t\t\t\tcursor: pointer;\n \t\t}`}\n`;\n","import { memo } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\nexport type TypeChartLegendLabelContentWithIconProps = Readonly<{\n children: React.ReactNode;\n // optional\n icon?: React.ReactNode;\n}>;\n\nexport const ChartLegendLabelContentWithIcon =\n memo<TypeChartLegendLabelContentWithIconProps>(\n function ChartLegendLabelContentWithIcon({\n children,\n icon,\n }: TypeChartLegendLabelContentWithIconProps) {\n return icon ? (\n <Box display=\"flex\" alignItems=\"center\" gap={200}>\n {icon}\n {children}\n </Box>\n ) : (\n children\n );\n }\n );\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-XVV7PYQE.js","../src/charts/shared/chartBase.tsx","../src/charts/shared/ChartAnnotationMarkerPortal.tsx","../src/charts/shared/DefaultChartTooltip.tsx","../src/charts/shared/formatters/valueFormatter.ts","../src/charts/shared/SeriesLegend.tsx","../src/charts/shared/chartExport.ts","../src/charts/shared/annotations.ts","../src/charts/shared/baseChartOptions.ts","../src/charts/shared/formatters/datetimeFormatter.ts","../src/charts/shared/axisOptions.ts","../src/charts/shared/valueAxisLabelFormatter.ts"],"names":["ChartAnnotationMarkerP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,IAAA;AAMA,IAAA;AAGC,IAAA;AACT,EAAA;AACF;AX4rBiB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-XVV7PYQE.js","sourcesContent":[null,"// Engine boundary for the v2 chart architecture. The only file under `charts/`\n// that imports from \"highcharts\". See `charts/README.md` for invariants.\n\nimport Highcharts from \"highcharts\";\nimport { HighchartsReact } from \"highcharts-react-official\";\nimport highchartsAccessibility from \"highcharts/modules/accessibility\";\nimport highchartsAnnotations from \"highcharts/modules/annotations\";\nimport highchartsExporting from \"highcharts/modules/exporting\";\nimport highchartsOfflineExporting from \"highcharts/modules/offline-exporting\";\nimport highchartsExportData from \"highcharts/modules/export-data\";\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport { ChartTooltipPortal } from \"../../components/ChartTooltip/components/ChartTooltipPortal\";\nimport { transformTimeSeriesTooltipData } from \"../../helpers\";\nimport { GlobalChartStyleOverrides } from \"../../styles/chartStyles\";\nimport { ChartAnnotationMarkerPortal } from \"./ChartAnnotationMarkerPortal\";\nimport { DefaultChartTooltip } from \"./DefaultChartTooltip\";\nimport { SeriesLegend } from \"./SeriesLegend\";\nimport type { TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport type { TypeTheme } from \"@sproutsocial/seeds-react-theme\";\nimport { defaultFilename } from \"./chartExport\";\nimport type { ChartAnnotationLookup } from \"./annotations\";\nimport type { ValueFormat } from \"./formatters/valueFormatter\";\nimport type { ChartExportHandle } from \"./chartExport\";\nimport type { TypeChartStyleColor, TypeChartStylePattern } from \"../../types\";\n\nhighchartsAccessibility(Highcharts);\nhighchartsAnnotations(Highcharts);\n// `exporting` must register before `offline-exporting` and `export-data`, which\n// extend it. `exporting` adds a native context (hamburger) button by default;\n// `ChartRenderer` disables it on the chart options so v2 charts expose export\n// only through the `onReady` handle. Export is client-side/offline only —\n// we never call the Highcharts export server.\nhighchartsExporting(Highcharts);\nhighchartsOfflineExporting(Highcharts);\nhighchartsExportData(Highcharts);\n\n/** Highcharts series type. `column` is vertical bars; `bar` is horizontal bars. */\nexport type SeedsChartType =\n | \"column\"\n | \"bar\"\n | \"line\"\n | \"spline\"\n | \"area\"\n | \"areaspline\";\n\nexport interface SeedsChartMarkerOptions {\n enabled?: boolean;\n symbol?: \"circle\";\n}\n\n/** Object form of a series point — carries an optional per-point `marker` override. */\nexport interface SeedsChartDataPoint {\n x?: number;\n y: number | null;\n marker?: SeedsChartMarkerOptions;\n}\n\nexport interface SeedsChartSeriesOptions {\n type: SeedsChartType;\n name: string;\n data: Array<number | null | [number, number | null] | SeedsChartDataPoint>;\n color?: string;\n}\n\n/**\n * Seeds-local shape of the `this` context Highcharts binds when invoking an\n * axis-label `formatter`. Models only the fields our default formatter reads\n * (`value` and `axis.tickPositions`).\n */\nexport interface SeedsAxisLabelFormatterContext {\n value: number | string;\n axis: { tickPositions?: ReadonlyArray<number> };\n}\n\nexport interface SeedsChartAxisLabelOptions {\n useHTML?: boolean;\n /** Show the axis tick labels. Maps to Highcharts' `labels.enabled`; defaults to shown. */\n enabled?: boolean;\n /** `this`-bound tick-label formatter returning the rendered string. */\n formatter?: (this: SeedsAxisLabelFormatterContext) => string;\n}\n\n/**\n * Highcharts datetime tick-label formats, keyed by the auto-selected tick unit.\n * Only the units the chart families set are modeled; Highcharts merges the rest\n * with its own defaults.\n */\nexport interface SeedsChartDateTimeLabelFormats {\n hour?: string;\n day?: string;\n week?: string;\n month?: string;\n year?: string;\n}\n\nexport interface SeedsChartAxisTitleOptions {\n text: string;\n}\n\nexport interface SeedsChartXAxisOptions {\n type?: \"category\" | \"datetime\" | \"linear\";\n categories?: Array<string>;\n crosshair?: boolean;\n min?: number;\n max?: number;\n labels?: SeedsChartAxisLabelOptions;\n dateTimeLabelFormats?: SeedsChartDateTimeLabelFormats;\n}\n\nexport interface SeedsChartYAxisOptions {\n min?: number;\n max?: number;\n /** Soft minimum — the axis won't start above this value, but may extend below it for negative data. */\n softMin?: number;\n /** Soft maximum — the axis won't end below this value, but may extend above it. */\n softMax?: number;\n gridLineWidth?: number;\n title?: SeedsChartAxisTitleOptions;\n labels?: SeedsChartAxisLabelOptions;\n}\n\nexport interface SeedsChartTooltipOptions {\n enabled?: boolean;\n // `useHTML` is intentionally not here — it's hardcoded `true` at the engine\n // boundary (ChartRenderer) because the tooltip portal can't work without it.\n outside?: boolean;\n padding?: number;\n shape?: \"rect\" | \"callout\";\n shared?: boolean;\n hideDelay?: number;\n valueSuffix?: string;\n}\n\nexport interface SeedsChartSeriesPlotOptions {\n animation?: boolean;\n /** Stacking applied across all series. Used by the line/area family for `stacked-area`. */\n stacking?: \"normal\" | \"percent\";\n /** Point-level event wiring (e.g. click). The events shape is family-agnostic. */\n point?: { events?: SeedsChartPointEvents };\n /** Default point-marker visibility. The line/area family disables markers and re-enables them per isolated point. */\n marker?: SeedsChartMarkerOptions;\n}\n\nexport interface SeedsChartPointEventContext {\n x: number | string;\n series: {\n chart: {\n series: ReadonlyArray<{\n type: string;\n data: ReadonlyArray<{\n x: number | string;\n graphic?: { element?: Element };\n }>;\n }>;\n };\n };\n}\n\nexport interface SeedsChartPointEvents {\n mouseOver?: (this: SeedsChartPointEventContext) => void;\n mouseOut?: (this: SeedsChartPointEventContext) => void;\n click?: (event: { point: { x: number | string } }) => void;\n}\n\nexport interface SeedsChartColumnPointOptions {\n events?: SeedsChartPointEvents;\n}\n\nexport interface SeedsChartColumnPlotOptions {\n stacking?: \"normal\" | \"percent\";\n pointPadding?: number;\n groupPadding?: number;\n pointWidth?: number;\n borderRadius?: number;\n borderWidth?: number;\n point?: SeedsChartColumnPointOptions;\n}\n\n/** Type-scoped stacking for filled line-area variants (parity with `column`). */\nexport interface SeedsChartAreaPlotOptions {\n stacking?: \"normal\" | \"percent\";\n}\n\nexport interface SeedsChartPlotOptions {\n series?: SeedsChartSeriesPlotOptions;\n // `column` (vertical bars) and `bar` (horizontal bars) take the same option\n // shape; the bar adapter assigns one config under whichever key is active.\n column?: SeedsChartColumnPlotOptions;\n bar?: SeedsChartColumnPlotOptions;\n area?: SeedsChartAreaPlotOptions;\n areaspline?: SeedsChartAreaPlotOptions;\n}\n\nexport interface SeedsChartChartOptions {\n type: SeedsChartType;\n styledMode?: boolean;\n animation?: boolean;\n marginTop?: number;\n}\n\nexport interface SeedsChartAnnotationLabelOptions {\n point: { x: number; y: number; xAxis: 0; yAxis: 0 };\n /** Highcharts shows a default label if this is empty; pass `\" \"` to suppress. */\n text?: string;\n}\n\n/**\n * Shared options applied to every label in a Highcharts annotation block.\n * `useHTML: true` is load-bearing — it makes Highcharts attach an HTML\n * `graphic.div` to each label, which `ChartAnnotationMarkerPortal` portals\n * React content into. Without it, labels render as SVG `<text>` and the\n * portal finds no containers.\n */\nexport interface SeedsChartAnnotationLabelOptionsShared {\n useHTML?: boolean;\n padding?: number;\n}\n\nexport interface SeedsChartAnnotationsOptions {\n labels?: SeedsChartAnnotationLabelOptions[];\n labelOptions?: SeedsChartAnnotationLabelOptionsShared;\n}\n\nexport interface SeedsChartAccessibilityOptions {\n description?: string;\n}\n\nexport interface SeedsChartTitleOptions {\n text?: string;\n}\n\nexport interface SeedsChartCreditsOptions {\n enabled?: boolean;\n}\n\nexport interface SeedsChartLegendOptions {\n enabled?: boolean;\n}\n\n/** Maps to Highcharts `time` — chart-global; `timezone` only affects datetime axes. */\nexport interface SeedsChartTimeOptions {\n timezone?: string;\n}\n\nexport interface SeedsChartOptions {\n chart?: SeedsChartChartOptions;\n accessibility?: SeedsChartAccessibilityOptions;\n title?: SeedsChartTitleOptions;\n credits?: SeedsChartCreditsOptions;\n legend?: SeedsChartLegendOptions;\n tooltip?: SeedsChartTooltipOptions;\n time?: SeedsChartTimeOptions;\n xAxis?: SeedsChartXAxisOptions;\n yAxis?: SeedsChartYAxisOptions;\n plotOptions?: SeedsChartPlotOptions;\n series?: Array<SeedsChartSeriesOptions>;\n annotations?: SeedsChartAnnotationsOptions[];\n}\n\nexport interface SeedsChartSetupSeriesInput {\n color?: string;\n pattern?: TypeChartStylePattern;\n}\n\nexport interface UseSeedsChartSetupParams<\n T extends SeedsChartSetupSeriesInput = SeedsChartSetupSeriesInput\n> {\n series: Array<T>;\n /** Opt-in for the pattern array. Families that apply patterns (line, area) pass `true`. */\n includePatterns?: boolean;\n /**\n * Resolved effective cap (the family default, or the consumer's explicit\n * value). Series beyond it are dropped. Omit to disable capping entirely.\n */\n seriesLimit?: number;\n /**\n * Whether the consumer set `seriesLimit` explicitly. Suppresses the over-limit\n * warning (an explicit cap is intentional, not an accidental overflow).\n * Default `false`.\n */\n isSeriesLimitOverridden?: boolean;\n /** Opt out of the over-limit warning. Default `false`. */\n hideSeriesLimitWarning?: boolean;\n /** Component name used in the over-limit warning message (kept generic for future families). */\n componentName?: string;\n}\n\nexport interface UseSeedsChartSetupResult<\n T extends SeedsChartSetupSeriesInput = SeedsChartSetupSeriesInput\n> {\n theme: TypeTheme;\n colors: Array<TypeChartStyleColor>;\n patterns: Array<TypeChartStylePattern>;\n /** Series after applying the (optional) cap. Referentially equal to the input when no cap applies. */\n series: Array<T>;\n}\n\nexport function useSeedsChartSetup<\n T extends SeedsChartSetupSeriesInput = SeedsChartSetupSeriesInput\n>({\n series,\n includePatterns = false,\n seriesLimit,\n isSeriesLimitOverridden = false,\n hideSeriesLimitWarning = false,\n componentName,\n}: UseSeedsChartSetupParams<T>): UseSeedsChartSetupResult<T> {\n const theme = useTheme() as TypeTheme;\n const palette = theme.colors.DATAVIZ_COLORS_LIST;\n\n // Cap the series at the resolved limit. Memoized so the input reference is\n // preserved when no cap applies, keeping the colors/patterns memos\n // referentially stable.\n const cappedSeries = useMemo<Array<T>>(\n () =>\n seriesLimit !== undefined &&\n seriesLimit >= 1 &&\n series.length > seriesLimit\n ? series.slice(0, seriesLimit)\n : series,\n [series, seriesLimit]\n );\n\n // Warn when the limit was exceeded, was not explicitly overridden by the\n // consumer, and the warning isn't suppressed. Keyed off the gating conditions\n // so it fires when those change rather than on every render.\n useEffect(() => {\n if (\n seriesLimit !== undefined &&\n seriesLimit >= 1 &&\n series.length > seriesLimit &&\n !isSeriesLimitOverridden &&\n !hideSeriesLimitWarning &&\n componentName != null\n ) {\n console.warn(\n `${componentName}: Maximum number of series (${seriesLimit}) exceeded. Only the first ${seriesLimit} series will be displayed.`\n );\n }\n }, [\n series.length,\n seriesLimit,\n isSeriesLimitOverridden,\n hideSeriesLimitWarning,\n componentName,\n ]);\n\n const colors = useMemo<Array<TypeChartStyleColor>>(() => {\n const out: TypeChartStyleColor[] = [];\n const paletteLen = palette.length;\n for (let i = 0; i < cappedSeries.length; i++) {\n const s = cappedSeries[i]!;\n out.push(s.color ?? palette[i % paletteLen] ?? \"\");\n }\n return out;\n }, [cappedSeries, palette]);\n\n const patterns = useMemo<Array<TypeChartStylePattern>>(() => {\n if (!includePatterns) return [];\n const out: TypeChartStylePattern[] = [];\n for (let i = 0; i < cappedSeries.length; i++) {\n const s = cappedSeries[i]!;\n out.push(s.pattern ?? \"solid\");\n }\n return out;\n }, [cappedSeries, includePatterns]);\n\n return { theme, colors, patterns, series: cappedSeries };\n}\n\nexport interface ChartRendererSeries {\n name: string;\n color?: string;\n /** Seeds icon or partner-logo name rendered before the series name in the legend label. */\n icon?: TypeIconName;\n}\n\nexport interface ChartTooltipDataRow {\n color: TypeChartStyleColor;\n name: string;\n value: number | null;\n}\n\n/** Tooltip render-prop signature for v2 charts. */\nexport interface ChartTooltipProps {\n data: ChartTooltipDataRow[];\n /** Resolved x-axis position. Category name for category axes, numeric for time/linear. */\n position: number | string;\n /** Resolved chart timezone — pass to date formatters when `position` is a numeric timestamp. Undefined on category axes. */\n timezone?: string;\n /** Declarative annotation anchored at this position, if any. Rendered in the tooltip header. */\n annotation?: {\n icon?: TypeIconName;\n color?: string;\n title?: string;\n description?: string;\n };\n /** True when the chart has an `onClick` handler — used by the default tooltip to render the click-label footer. */\n hasOnClick?: boolean;\n /** Footer content shown in the default tooltip when the chart is clickable. */\n tooltipClickLabel?: ReactNode;\n /** Content shown in place of a row's value when the value is null. Defaults to an em-dash. */\n invalidNumberLabel?: ReactNode;\n /** Declarative value format for the tooltip value cell. Omit for raw rendering. Applied at full precision (abbreviation off). */\n valueFormat?: ValueFormat;\n}\n\nexport interface ChartRendererProps {\n options: SeedsChartOptions;\n series: Array<ChartRendererSeries>;\n /** Theme-aware palette resolved by `useSeedsChartSetup`. Used as the swatch color for any series that doesn't carry an explicit `color`. */\n colors: ReadonlyArray<TypeChartStyleColor>;\n /** Override for the default tooltip content. Portal is always rendered — `GlobalChartStyleOverrides` makes Highcharts' native tooltip box transparent. */\n tooltip?: (args: ChartTooltipProps) => ReactNode;\n /**\n * Resolved annotations keyed by numeric x. Drives both the in-chart marker\n * portal and the tooltip-header `annotation` injection. The family component\n * builds this map (resolving category-string positions to indices); the\n * renderer is axis-type agnostic.\n */\n annotationLookup?: ChartAnnotationLookup;\n /** Forwarded into the default tooltip so it can render the click-label footer. */\n hasOnClick?: boolean;\n /** Forwarded into the default tooltip for click-label footer rendering. */\n tooltipClickLabel?: ReactNode;\n /** Resolved chart timezone, forwarded to the tooltip so its date title matches the axis ticks. Undefined on category axes. */\n timezone?: string;\n /** Forwarded into the default tooltip as the null-value override. */\n invalidNumberLabel?: ReactNode;\n /** Forwarded into the default tooltip to format the value cell declaratively. */\n valueFormat?: ValueFormat;\n /**\n * Fired once per chart instance with an opaque {@link ChartExportHandle} for\n * triggering PNG/SVG/PDF/CSV downloads. Re-fires only on a genuine remount,\n * never on data or prop updates.\n */\n onReady?: (handle: ChartExportHandle) => void;\n}\n\n/**\n * Runtime shape of one Highcharts annotation label — only the fields the\n * marker portal reads. Re-exported so the portal stays inside the engine\n * boundary (no direct \"highcharts\" import).\n */\nexport interface ChartAnnotationRuntimeLabel {\n graphic?: { div?: HTMLDivElement };\n options?: { point?: { x?: number } };\n}\n\n/** Runtime shape of one Highcharts annotation block (a group of labels). */\nexport interface ChartAnnotationRuntime {\n labels?: ChartAnnotationRuntimeLabel[];\n}\n\n/** Highcharts doesn't include the `annotations` array on its `Chart` type. */\ninterface ChartWithAnnotations extends Highcharts.Chart {\n annotations?: ChartAnnotationRuntime[];\n}\n\n/**\n * Theme→options map for the `styledMode: false` export clone, which can't see\n * the scoped CSS v2 charts normally style with. Mirrors `styles/chartStyles`.\n */\nfunction buildExportChartOptions(\n theme: TypeTheme,\n colors: ReadonlyArray<TypeChartStyleColor>\n): Highcharts.Options {\n // Line, gridline, and label styling are identical for both axes.\n const axisOptions = {\n lineColor: theme.colors.container.border.base,\n gridLineColor: theme.colors.container.border.base,\n labels: {\n style: {\n color: theme.colors.text.subtext,\n fontFamily: theme.fontFamily,\n fontSize: theme.typography[100].fontSize,\n fontWeight: String(theme.fontWeights.normal),\n },\n },\n };\n return {\n chart: {\n styledMode: false,\n backgroundColor: theme.colors.container.background.base,\n },\n // Series without an explicit `color` fall through to this palette by index.\n colors: [...colors],\n // The on-screen legend is a React sibling (`SeriesLegend`) outside the chart\n // SVG, so the export can't capture it. Turn on Highcharts' native legend for\n // the clone instead, themed to approximate the Seeds `ChartLegend` (centered\n // row of swatch + `text.subtext` label). It can't reproduce per-series Seeds\n // icons — those series show colour + name only.\n legend: {\n enabled: true,\n symbolRadius: 4,\n symbolHeight: 12,\n symbolWidth: 12,\n itemStyle: {\n color: theme.colors.text.subtext,\n fontFamily: theme.fontFamily,\n fontSize: theme.typography[200].fontSize,\n fontWeight: String(theme.fontWeights.normal),\n },\n },\n xAxis: {\n ...axisOptions,\n crosshair: {\n color: theme.colors.container.border.decorative.neutral,\n width: 1,\n },\n },\n // No zero-line: the `y-axis-zero-line` rule in chartStyles is a v1 leftover;\n // the v2 bar adapter never creates that plotLine.\n yAxis: axisOptions,\n } as Highcharts.Options;\n}\n\n/**\n * Build the opaque export handle for a chart instance. Lives here — not in\n * `chartExport.ts` — because it closes over the live `Highcharts.Chart`, which\n * never leaves the engine boundary. The returned {@link ChartExportHandle} is\n * Highcharts-free.\n *\n * PDF lazy-loads jspdf + svg2pdf.js (a deferred chunk) on first use.\n */\nfunction createChartExportHandle(\n chart: Highcharts.Chart,\n getExportChartOptions: () => Highcharts.Options\n): ChartExportHandle {\n const resolveName = (filename?: string) =>\n filename ?? defaultFilename(chart.options.chart?.type, new Date());\n\n const exportImage = async (\n type: Highcharts.ExportingMimeTypeValue,\n filename?: string\n ): Promise<void> => {\n // Read options at call time, not when the handle was built: a light/dark\n // toggle updates the chart in place without re-firing `onReady`, so the\n // export must reflect the current theme. 2nd arg is deep-merged, so\n // `labels.style` here merges with the live axis `formatter`, not clobbers it.\n chart.exportChartLocal(\n { type, filename: resolveName(filename) },\n getExportChartOptions()\n );\n };\n\n return {\n exportPNG: ({ filename } = {}) => exportImage(\"image/png\", filename),\n exportSVG: ({ filename } = {}) => exportImage(\"image/svg+xml\", filename),\n exportPDF: async ({ filename } = {}): Promise<void> => {\n // Lazy-load jspdf + svg2pdf.js (deferred chunk) and expose `window.jspdf`\n // before exporting, so Highcharts' offline-exporting renders the PDF\n // locally rather than fetching the libs from its CDN.\n const { loadPdfExportLibs } = await import(\"./pdfExportLibs\");\n loadPdfExportLibs();\n await exportImage(\"application/pdf\", filename);\n },\n exportCSV: async ({ filename } = {}): Promise<void> => {\n // `downloadCSV()` reads the filename from `chart.options.exporting.filename`\n // via `getFilename()`. Set it transiently (direct mutation — no `update()`,\n // so no redraw) so the per-call override and generated default both apply,\n // then restore the previous value.\n const exporting = (chart.options.exporting ??= {});\n const previous = exporting.filename;\n exporting.filename = resolveName(filename);\n try {\n chart.downloadCSV();\n } finally {\n exporting.filename = previous;\n }\n },\n };\n}\n\nexport function ChartRenderer({\n options,\n series,\n colors,\n tooltip,\n annotationLookup,\n hasOnClick,\n tooltipClickLabel,\n timezone,\n invalidNumberLabel,\n valueFormat,\n onReady,\n}: ChartRendererProps) {\n const [chart, setChart] = useState<Highcharts.Chart | null>(null);\n const [plotHeight, setPlotHeight] = useState(0);\n const renderTooltip = tooltip ?? DefaultChartTooltip;\n const theme = useTheme() as TypeTheme;\n\n // Hold the live theme + palette in a ref so the export handle reads the\n // *current* theme at call time (see `createChartExportHandle`). A dark-mode\n // toggle updates this each render without re-firing `onReady`.\n const exportThemeRef = useRef({ theme, colors });\n exportThemeRef.current = { theme, colors };\n\n // Capture only the live chart. Highcharts reuses a chart's `callback` when it\n // builds the throwaway clone for export (`new chart.constructor(options,\n // chart.callback)` in exporting/offline-exporting, with `chart.forExport:\n // true`). That clone is destroyed the instant its SVG is captured, so binding\n // React state to it would leave a destroyed chart whose next `update()` reads\n // `options.responsive` on `undefined` and throws.\n const captureChart = useCallback((chartInstance: Highcharts.Chart) => {\n const forExport = (\n chartInstance.options.chart as { forExport?: boolean } | undefined\n )?.forExport;\n if (!forExport) {\n setChart(chartInstance);\n // Seed plotHeight in the same commit as the chart so markers render with\n // it, not a frame later (the pop-in). The redraw handler keeps it current.\n setPlotHeight(chartInstance.plotHeight);\n }\n }, []);\n\n // Hold `onReady` in a ref so an inline callback (new identity each render)\n // doesn't re-fire the effect below — it should fire on instance change only.\n const onReadyRef = useRef(onReady);\n onReadyRef.current = onReady;\n\n // Fire `onReady` once per chart instance. The chart callback runs only on\n // instance creation — data/prop changes call `chart.update()` on the same\n // instance and don't re-run it — so keying on `[chart]` gives once-per-instance\n // semantics: re-fires on a genuine remount, never on a data update.\n useEffect(() => {\n if (!chart) return;\n onReadyRef.current?.(\n createChartExportHandle(chart, () =>\n buildExportChartOptions(\n exportThemeRef.current.theme,\n exportThemeRef.current.colors\n )\n )\n );\n }, [chart]);\n\n // Track the chart's actual plot-area height so the annotation marker line\n // spans it. Re-reads on Highcharts' `redraw` event (covers window resizes,\n // data updates, anything that re-lays-out the plot area).\n useEffect(() => {\n if (!chart) return;\n setPlotHeight(chart.plotHeight);\n const unbind = Highcharts.addEvent(chart, \"redraw\", () => {\n setPlotHeight(chart.plotHeight);\n });\n return () => unbind();\n }, [chart]);\n\n // Stable ref across internal re-renders (setChart/setPlotHeight): HighchartsReact\n // keys its update effect on the options ref and redraws on change, so a fresh\n // object each render would redraw — and re-flicker the annotations — every time.\n const highchartsOptions = useMemo(\n () =>\n ({\n ...options,\n // useHTML is load-bearing: the tooltip portal's target div only mounts\n // when the label renders as HTML, not SVG (see `charts/README.md`).\n tooltip: { ...options.tooltip, useHTML: true },\n // Client-side/offline export only; native context button hidden (export\n // is exposed via the `onReady` handle).\n exporting: {\n fallbackToExportServer: false,\n buttons: { contextButton: { enabled: false } },\n },\n } as Highcharts.Options),\n [options]\n );\n\n // Safety net: no series → render nothing. Families are expected to early-return\n // before calling hooks to avoid wasted work, but this guards future families\n // that forget. See `charts/README.md` (\"Empty-data handling\").\n if (series.length === 0) return null;\n\n const chartWithAnnotations = chart as ChartWithAnnotations | null;\n const hasRenderedAnnotations =\n !!chartWithAnnotations?.annotations?.length &&\n !!annotationLookup?.size &&\n plotHeight > 0;\n\n return (\n <>\n <GlobalChartStyleOverrides />\n <HighchartsReact\n highcharts={Highcharts}\n // Structural cast at the engine seam — the only place we touch Highcharts' option types.\n options={highchartsOptions}\n callback={captureChart}\n />\n {hasRenderedAnnotations ? (\n <ChartAnnotationMarkerPortal\n annotationLookup={annotationLookup}\n annotationContext={chartWithAnnotations!.annotations![0]!}\n chartContainer={chartWithAnnotations!.container}\n plotHeight={plotHeight}\n />\n ) : null}\n {chart ? (\n <ChartTooltipPortal\n chart={chart}\n renderContent={(context) => {\n // Drop v1's `readonly` array wrapper and `icon` field at the seam —\n // the v2 surface is mutable and doesn't expose row-level icons.\n const data: ChartTooltipDataRow[] = transformTimeSeriesTooltipData({\n context,\n data: series.map((s, i) => ({\n name: s.name,\n points: [],\n styles: { color: s.color ?? colors[i] ?? \"\" },\n })),\n }).map((row) => ({\n color: row.color,\n name: row.name,\n value: row.value,\n }));\n // `context.x` is Highcharts' field; we expose it to v2 consumers as\n // `position` for the tooltip header (the category name on category\n // axes, the numeric coordinate on time/linear axes). The annotation\n // lookup is keyed numerically, so resolve by `context.point.x`\n // (numeric on every axis type) rather than `context.x`.\n const position = context.x as number | string;\n const resolved = annotationLookup?.get(context.point.x as number);\n const annotation = resolved\n ? {\n icon: resolved.icon,\n color: resolved.color,\n title: resolved.title,\n description: resolved.description,\n }\n : undefined;\n return renderTooltip({\n data,\n position,\n annotation,\n hasOnClick,\n tooltipClickLabel,\n timezone,\n invalidNumberLabel,\n valueFormat,\n });\n }}\n />\n ) : null}\n <Box mt={350}>\n <SeriesLegend\n items={series.map((s, i) => ({\n name: s.name,\n icon: s.icon,\n color: s.color ?? colors[i] ?? \"\",\n }))}\n />\n </Box>\n </>\n );\n}\n","// Portals DS-owned marker content into Highcharts annotation containers. The\n// marker shape (icon + vertical line in the configured color) is rendered\n// internally — consumers don't supply React nodes. See CE-7.\n\nimport { memo, useEffect, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport { Icon } from \"@sproutsocial/seeds-react-icon\";\nimport type { ChartAnnotationLookup, ChartAnnotation } from \"./annotations\";\nimport type {\n ChartAnnotationRuntime,\n ChartAnnotationRuntimeLabel,\n} from \"./chartBase\";\n\nfunction ChartAnnotationMarker({\n annotation,\n lineHeight,\n}: {\n annotation: ChartAnnotation;\n /** Vertical pixel length of the marker line. Driven by `chart.plotHeight`\n * so the line spans the chart's full plot area regardless of chart size. */\n lineHeight: number;\n}) {\n return (\n <Box display=\"flex\" flexDirection=\"column\" alignItems=\"center\" gap={200}>\n {annotation.icon ? (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n width=\"20px\"\n height=\"20px\"\n bg=\"icon.base\"\n borderRadius=\"50%\"\n >\n <Icon name={annotation.icon} size=\"mini\" color=\"icon.inverse\" />\n </Box>\n ) : null}\n <Box\n height={`${lineHeight}px`}\n width=\"0.5px\"\n bg={annotation.color ?? \"neutral.200\"}\n />\n </Box>\n );\n}\n\n// v2-specific marker attribute. Distinct from v1's `data-annotation-marker`\n// so v1 and v2 portals don't sweep each other's containers when both render\n// side-by-side (e.g. in the v1↔v2 comparison story).\nconst MARKER_ATTR = \"data-v2-chart-annotation-marker\";\n\nexport const ChartAnnotationMarkerPortal = memo(\n function ChartAnnotationMarkerPortal({\n annotationLookup,\n annotationContext,\n chartContainer,\n plotHeight,\n }: {\n annotationLookup: ChartAnnotationLookup;\n annotationContext: ChartAnnotationRuntime;\n /** The chart's own DOM root — every query is scoped here to keep\n * multi-chart renders from interfering. */\n chartContainer: HTMLElement;\n /** Highcharts' current plot-area height in pixels. Drives the marker\n * line length so it spans the chart's plot area at any chart size. */\n plotHeight: number;\n }) {\n const annotationContainers = useRef<Record<number, HTMLDivElement>>({});\n const [, setRenderCount] = useState(0);\n const forceRender = () => setRenderCount((prev) => prev + 1);\n\n useEffect(() => {\n if (!annotationContext.labels) return;\n\n const newContainers: Record<number, HTMLDivElement> = {};\n const existingAnnotationContainers = chartContainer.querySelectorAll(\n `div[${MARKER_ATTR}='true']`\n );\n\n // 1. Mark this chart's existing markers as stale before updating.\n // Highcharts doesn't clean these up, so we sweep them below.\n existingAnnotationContainers.forEach((annotation) =>\n annotation.setAttribute(MARKER_ATTR, \"false\")\n );\n\n annotationContext.labels.forEach((label: ChartAnnotationRuntimeLabel) => {\n const labelElement = label.graphic?.div;\n if (!labelElement) return;\n\n // 2. Reuse this label's existing marker div when present — Highcharts\n // repositions (rather than recreates) annotation graphics across\n // redraws, so reusing keeps the React portal mounted and avoids the\n // teardown→recreate flash. Only create one when absent.\n let annotationDiv = labelElement.querySelector<HTMLDivElement>(\n `div[${MARKER_ATTR}]`\n );\n if (!annotationDiv) {\n annotationDiv = document.createElement(\"div\");\n labelElement.appendChild(annotationDiv);\n }\n annotationDiv.setAttribute(MARKER_ATTR, \"true\");\n\n const xValue = label.options?.point?.x as number;\n newContainers[xValue] = annotationDiv;\n });\n\n annotationContainers.current = newContainers;\n forceRender();\n\n // 4. Within this chart's container, remove `.highcharts-annotation`\n // parents that no longer have any live v2 marker child.\n requestAnimationFrame(() => {\n chartContainer\n .querySelectorAll(\"div.highcharts-annotation\")\n .forEach((annotationDiv) => {\n const reactAnnotations = annotationDiv.querySelectorAll(\n `div[${MARKER_ATTR}]`\n );\n const hasActiveAnnotations = Array.from(reactAnnotations).some(\n (div) => div.getAttribute(MARKER_ATTR) === \"true\"\n );\n if (!hasActiveAnnotations) annotationDiv.remove();\n });\n });\n }, [annotationContext.labels, annotationLookup, chartContainer]);\n\n return (\n <>\n {Object.entries(annotationContainers.current).map(\n ([xValue, container]) => {\n const annotation = annotationLookup.get(Number(xValue));\n return annotation\n ? createPortal(\n <ChartAnnotationMarker\n annotation={annotation}\n lineHeight={plotHeight}\n />,\n container\n )\n : null;\n }\n )}\n </>\n );\n }\n);\n","// Minimal: no locale / currency / duration formatting. Consumers needing those pass their own `tooltip` render prop.\n\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport { Icon, type TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\n\nimport { ChartLegendLabel } from \"../../components/ChartLegend/components/ChartLegendLabel\";\nimport {\n ChartTooltip,\n ChartTooltipFooter,\n ChartTooltipHeader,\n ChartTooltipTable,\n ChartTooltipTitle,\n type TypeChartTooltipTableProps,\n} from \"../../components/ChartTooltip\";\nimport type { ChartTooltipProps } from \"./chartBase\";\nimport { valueFormatter } from \"./formatters/valueFormatter\";\n\nfunction formatTitle(position: number | string, timezone?: string): string {\n if (typeof position === \"string\") return position;\n // `timeZone` aligns the title with the chart's configured timezone (which\n // governs the axis ticks). Omitting it would format in the browser's local\n // zone and disagree with the ticks by up to a day.\n return new Date(position).toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n weekday: \"long\",\n timeZone: timezone,\n });\n}\n\n// Inlined (not v1's `ChartXAnnotationDetails`) because that component requires\n// both iconName and text together — v2's `ChartAnnotation` documents icon,\n// title, and description as independently optional, so the renderer has to\n// match that contract instead of dropping fields silently.\nfunction AnnotationHeader({\n icon,\n title,\n description,\n}: {\n icon?: TypeIconName;\n title?: string;\n description?: string;\n}) {\n const hasIconOrTitle = Boolean(icon || title);\n if (!hasIconOrTitle && !description) return null;\n return (\n <>\n {hasIconOrTitle ? (\n <ChartTooltipHeader>\n <Box display=\"flex\" alignItems=\"center\" gap={300}>\n {icon ? <Icon name={icon} size=\"mini\" color=\"icon.base\" /> : null}\n {title ? (\n <Text color=\"text.body\" fontSize={200}>\n {title}\n </Text>\n ) : null}\n </Box>\n </ChartTooltipHeader>\n ) : null}\n {description ? (\n <ChartTooltipHeader>\n <Text fontSize={200} color=\"text.subtext\">\n {description}\n </Text>\n </ChartTooltipHeader>\n ) : null}\n </>\n );\n}\n\nexport function DefaultChartTooltip({\n data,\n position,\n annotation,\n hasOnClick,\n tooltipClickLabel,\n timezone,\n invalidNumberLabel,\n valueFormat,\n}: ChartTooltipProps) {\n const rows = data.map((d) => ({\n cells: [\n {\n content: (\n <ChartLegendLabel color={d.color}>\n <Text aria-label={`${d.name}: `}>{d.name}</Text>\n </ChartLegendLabel>\n ),\n },\n {\n // Format non-null values through the shared formatter when a\n // `valueFormat` is supplied. Tooltip values are always full precision\n // (`abbreviate: false`) — the axis tick scan never applies here (v1\n // parity: the bar tooltip always passed `abbreviate={false}`).\n content: (\n <Text>\n {d.value == null\n ? invalidNumberLabel ?? \"—\"\n : valueFormat\n ? valueFormatter({\n ...valueFormat,\n value: d.value,\n abbreviate: false,\n })\n : d.value}\n </Text>\n ),\n align: \"right\" as const,\n },\n ],\n }));\n\n return (\n <ChartTooltip>\n {annotation ? (\n <AnnotationHeader\n icon={annotation.icon}\n title={annotation.title}\n description={annotation.description}\n />\n ) : null}\n <ChartTooltipTitle>{formatTitle(position, timezone)}</ChartTooltipTitle>\n <ChartTooltipTable rows={rows as TypeChartTooltipTableProps[\"rows\"]} />\n {hasOnClick && tooltipClickLabel ? (\n <ChartTooltipFooter>\n {typeof tooltipClickLabel === \"string\" ? (\n <Box display=\"flex\" alignItems=\"center\" gap={300}>\n <Icon name=\"hand-pointer-clicking-outline\" color=\"icon.base\" />\n <Text color=\"text.subtext\" fontSize={200}>\n {tooltipClickLabel}\n </Text>\n </Box>\n ) : (\n tooltipClickLabel\n )}\n </ChartTooltipFooter>\n ) : null}\n </ChartTooltip>\n );\n}\n","import { formatDuration } from \"@sproutsocial/seeds-react-duration\";\nimport { formatNumeral } from \"@sproutsocial/seeds-react-numeral\";\n\nimport type { TypeChartNumberFormat } from \"../../../types\";\n\nexport type TypeValuePercentInput = \"decimal\" | \"whole\";\n\nexport type TypeValueFormatterOptions = Readonly<{\n /** The raw numeric value. For duration, milliseconds. */\n value: number;\n /** default \"decimal\" */\n numberFormat?: TypeChartNumberFormat;\n /** Only used when numberFormat === \"currency\". default \"USD\" */\n currency?: string;\n /** true → 10k threshold; number → max(1000, abs(n)); false → never. default true */\n abbreviate?: boolean | number;\n /** \"decimal\" scales 0.42 → \"42%\"; \"whole\" treats 42 → \"42%\". default \"decimal\" */\n percentInput?: TypeValuePercentInput;\n /** locale for decimal/currency/percent (formatNumeral) */\n numberLocale?: Intl.LocalesArgument;\n /** locale for duration (formatDuration) */\n textLocale?: Intl.LocalesArgument;\n}>;\n\n/**\n * Pure value formatter for v2 charts. Turns a numeric value plus declarative\n * config into a display string. Composes `formatNumeral` (decimal/currency/\n * percent) and `formatDuration` (duration). Contains no chart-engine types or\n * imports — it upholds the \"engine boundary is one file\" invariant documented\n * in `src/charts/README.md`.\n *\n * The axis-wide \"smart 1k/10k\" abbreviation scan that v1's `yAxisLabelFormatter`\n * derives from `tickPositions` is not available to a pure per-value function;\n * callers pass the lowered threshold via `abbreviate` (a number) instead.\n */\nexport function valueFormatter({\n value,\n numberFormat = \"decimal\",\n currency = \"USD\",\n abbreviate = true,\n percentInput = \"decimal\",\n numberLocale,\n textLocale,\n}: TypeValueFormatterOptions): string {\n const numberValue = Number(value);\n\n // v1 parity: render 0 as a bare \"0\" for every format (clean axis origin) —\n // not \"$0.00\" / \"0%\" / a duration-zero. Matches v1's yAxisLabelFormatter,\n // which checks zero first, before any format branch. Revisit if design\n // wants per-format zero rendering later.\n if (numberValue === 0) {\n return formatNumeral({ locale: numberLocale as string, number: 0 });\n }\n\n if (numberFormat === \"duration\") {\n return formatDuration({\n display: \"narrow\",\n locale: textLocale,\n milliseconds: numberValue,\n });\n }\n\n if (numberFormat === \"percent\") {\n const whole = percentInput === \"decimal\" ? numberValue * 100 : numberValue;\n return formatNumeral({\n format: \"percent\",\n locale: numberLocale as string,\n number: whole,\n });\n }\n\n // decimal | currency\n return formatNumeral({\n abbreviate,\n currency,\n format: numberFormat,\n locale: numberLocale as string,\n number: numberValue,\n });\n}\n\n/**\n * Declarative value-format config for axis ticks and the default tooltip — the\n * full {@link TypeValueFormatterOptions} surface minus `value`, which is\n * supplied per-tick / per-row by the caller (the adapter and tooltip).\n */\nexport type ValueFormat = Omit<TypeValueFormatterOptions, \"value\">;\n","import { memo } from \"react\";\nimport { Icon, type TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport { ChartLegend } from \"../../components/ChartLegend\";\nimport { ChartLegendLabelContentWithIcon } from \"../../components/ChartLegend/components/ChartLegendLabelContentWithIcon\";\n\nexport interface SeriesLegendItem {\n name: string;\n /** Resolved swatch color — caller is responsible for resolving against the active theme. */\n color: string;\n /** Seeds icon or partner-logo name rendered before the series name. */\n icon?: TypeIconName;\n}\n\nexport interface SeriesLegendProps {\n items: ReadonlyArray<SeriesLegendItem>;\n}\n\n// Internal to `ChartRenderer` — not intended for standalone use. Swatch\n// colors must be resolved by the caller (the chart base does this via\n// `useSeedsChartSetup`) so we keep a single source of truth for the\n// theme-aware palette. If this ever becomes a publicly-exposed primitive,\n// add a `useTheme()` fallback here and relax `item.color` to optional.\nexport const SeriesLegend = memo<SeriesLegendProps>(function SeriesLegend({\n items,\n}) {\n const labels = items.map((item) => ({\n content: (\n <ChartLegendLabelContentWithIcon\n icon={\n item.icon ? (\n <Icon name={item.icon} fixedWidth aria-hidden />\n ) : undefined\n }\n >\n {item.name}\n </ChartLegendLabelContentWithIcon>\n ),\n color: item.color,\n }));\n return <ChartLegend legendLabels={labels} />;\n});\n","// Public, Highcharts-free surface for the v2 chart export API. This module\n// imports nothing — it is a leaf so it can never form an import cycle with\n// `chartBase`. The `createChartExportHandle` factory that closes over the live\n// `Highcharts.Chart` lives in `chartBase.tsx` (the one file allowed to import\n// \"highcharts\"); the instance never crosses this boundary.\n//\n/**\n * Opaque export API handed to consumers via `ChartRenderer`'s `onReady`. Each\n * callable closes over the chart instance and triggers a client-side download;\n * an optional `filename` overrides the generated default. No Highcharts type,\n * ref, or method shape crosses this boundary.\n */\nexport interface ChartExportHandle {\n exportPNG: (opts?: { filename?: string }) => Promise<void>;\n exportSVG: (opts?: { filename?: string }) => Promise<void>;\n exportPDF: (opts?: { filename?: string }) => Promise<void>;\n exportCSV: (opts?: { filename?: string }) => Promise<void>;\n}\n\n/**\n * Canonical client-side export formats offered by `ChartExportMenu`. Co-located\n * with `ChartExportHandle` so the format vocabulary lives next to the handle it\n * maps onto; this leaf imports nothing, so re-exporting it carries no cycle risk.\n */\nexport type ChartExportFormat = \"png\" | \"svg\" | \"pdf\" | \"csv\";\n\n/**\n * Default download filename when a consumer doesn't pass a `filename` override:\n * `chart-<type>-<YYYY-MM-DD-HH-mm-ss>`, lowercased with non-alphanumerics\n * collapsed to hyphens. The full datetime (not just the date) avoids collisions\n * between charts exported on the same day. `type` comes from the chart's\n * `chart.type`; it falls back to `chart` when absent.\n */\nexport function defaultFilename(type: string | undefined, now: Date): string {\n const iso = now.toISOString();\n const stamp = `${iso.slice(0, 10)}-${iso.slice(11, 19).replace(/:/g, \"-\")}`;\n return slugify(type ? `chart-${type}-${stamp}` : `chart-${stamp}`);\n}\n\nfunction slugify(value: string): string {\n return value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\n","// Shared annotation plumbing across v2 chart families. Currently consumed by\n// BarChart; v2 Line/Area will share the same `annotations` shape and reuse\n// `buildAnnotationConfig` directly. Annotation data is purely numeric —\n// the module has no knowledge of `categories`; resolving a numeric position to\n// a display name is the tooltip's job (see chartBase `renderContent`).\n\nimport type { TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport type { SeedsChartAnnotationsOptions } from \"./chartBase\";\n\n/**\n * Annotations keyed by the numeric Highcharts index. Both consumers resolve\n * numerically: the marker portal reads `label.point.x` and the tooltip reads\n * `context.point.x` (numeric on both category and datetime axes).\n */\nexport type ChartAnnotationLookup = Map<number, ChartAnnotation>;\n\n/**\n * Declarative annotation shape — the DS renders the marker and tooltip header\n * internally; consumers don't supply render functions. See CE-7.\n */\nexport interface ChartAnnotation {\n /** Numeric x-axis coordinate — a category index (category axes) or the raw coordinate (datetime/linear axes). */\n position: number;\n /** Icon shown above the chart at `position` and inline with `title` in the tooltip header. */\n icon?: TypeIconName;\n /** Color applied to the marker's vertical line. */\n color?: string;\n /** Tooltip header line 1. */\n title?: string;\n /** Tooltip header line 2. */\n description?: string;\n}\n\n/**\n * Build the Highcharts `annotations` config and a parallel lookup keyed by the\n * numeric `position`. Both consumers (chart adapter for Highcharts, ChartRenderer\n * for the portal + tooltip) read from the same numeric lookup to stay aligned.\n */\nexport function buildAnnotationConfig(\n annotations: ChartAnnotation[] | undefined\n): {\n annotations: SeedsChartAnnotationsOptions[] | undefined;\n lookup: ChartAnnotationLookup | undefined;\n} {\n if (!annotations?.length) {\n return { annotations: undefined, lookup: undefined };\n }\n const labels: {\n point: { x: number; y: number; xAxis: 0; yAxis: 0 };\n text: string;\n }[] = [];\n const lookup: ChartAnnotationLookup = new Map();\n for (const annotation of annotations) {\n const { position } = annotation;\n labels.push({\n // Highcharts anchor — always uses `x` regardless of chart orientation.\n point: { x: position, y: 0, xAxis: 0, yAxis: 0 },\n // Space (not empty) — Highcharts reverts to its built-in label text on empty string.\n text: \" \",\n });\n // Keyed by the numeric position only. The marker portal reads\n // `label.point.x` and the tooltip reads `context.point.x` — both numeric on\n // every axis type, so no category-name keying is needed.\n lookup.set(position, annotation);\n }\n if (labels.length === 0) {\n return { annotations: undefined, lookup: undefined };\n }\n return {\n // `useHTML: true` makes Highcharts attach an HTML `graphic.div` to each\n // label, which the marker portal needs as its render target. `padding: 0`\n // removes Highcharts' default left padding so markers stay centered.\n annotations: [{ labels, labelOptions: { useHTML: true, padding: 0 } }],\n lookup,\n };\n}\n","import type { SeedsChartOptions, SeedsChartType } from \"./chartBase\";\n\ninterface BaseChartOptionsInput {\n /** Highcharts chart/series type for the family (`column`, `line`, `area`, `pie`, …). */\n type: SeedsChartType;\n /** Accessibility description (Highcharts `accessibility.description`). */\n description: string;\n /** Appended to each tooltip value (e.g. `\" MT\"`, `\"%\"`). */\n valueSuffix?: string;\n /** Reserve top margin for content drawn above the plot area (e.g. annotation markers). */\n reserveTopMargin?: boolean;\n /**\n * Resolved IANA timezone for the chart (`time.timezone`) — governs datetime\n * ticks and the tooltip date. Pass the value from `resolveTooltipTimezone`;\n * `undefined` (a category axis) omits `time` entirely.\n */\n timezone?: string;\n}\n\n/**\n * The chart options shared by *every* v2 chart family, independent of axis type:\n * styled-mode + animation-off, the accessibility description, Highcharts' native\n * title/credits/legend disabled (Seeds renders its own legend), and the tooltip-\n * portal config. Families spread the result and add their own axes, `plotOptions`,\n * `series`, and `annotations`.\n *\n * This is the family-agnostic base layer — donut (no axes) consumes it just as\n * the X/Y families do. Axis/series/X-Y-specific sharing lives elsewhere\n * (`axisOptions` + the X/Y pattern-sharing spike), layered on top of this.\n */\nexport function buildBaseChartOptions({\n type,\n description,\n valueSuffix,\n reserveTopMargin = false,\n timezone,\n}: BaseChartOptionsInput): Pick<\n SeedsChartOptions,\n | \"chart\"\n | \"accessibility\"\n | \"title\"\n | \"credits\"\n | \"legend\"\n | \"tooltip\"\n | \"time\"\n> {\n return {\n chart: {\n type,\n styledMode: true,\n animation: false,\n ...(reserveTopMargin ? { marginTop: 24 } : {}),\n },\n accessibility: { description },\n title: { text: \"\" },\n credits: { enabled: false },\n legend: { enabled: false },\n tooltip: {\n enabled: true,\n outside: true,\n padding: 0,\n shape: \"rect\",\n shared: true,\n hideDelay: 0,\n valueSuffix,\n },\n // Chart-global in Highcharts; only meaningful for datetime axes, so it's\n // present only when a timezone was resolved (omitted for category axes).\n ...(timezone ? { time: { timezone } } : {}),\n };\n}\n","/**\n * Pure, Highcharts-free datetime axis label formatter for v2 chart families.\n *\n * Ports v1's `helpers/xAxisLabelFormatter` into a rendering-agnostic shape: it\n * returns a `{ primary, secondary? }` object instead of an HTML string, leaving\n * SVG rendering to the caller. The timezone- and DST-correct boundary detection\n * (calendar parts read in the target timezone) and the per-granularity\n * `Intl.DateTimeFormat` option sets are a near-verbatim port of v1.\n *\n * The one net-new piece versus v1 is granularity derivation: v1 receives\n * `unitName` from Highcharts, but `charts/` may not depend on Highcharts types\n * (see `charts/README.md` invariants), so granularity is derived from the\n * spacing of `tickPositions`.\n */\n\n// Local types — defined here rather than imported from the Highcharts package\n// or v1's src/types.ts, to keep charts/ self-contained per the README invariant.\nexport type DatetimeTimeFormat = \"12\" | \"24\";\n\nexport type DatetimeLabel = Readonly<{\n primary: string;\n /** Omitted (undefined) when the tick is not on a unit boundary. */\n secondary?: string;\n}>;\n\ntype DatetimeGranularity = \"hour\" | \"day\" | \"week\" | \"month\" | \"year\";\n\ntype DatetimeFormatterInput = Readonly<{\n /** ms-epoch tick value, or a categorical string passed through verbatim. */\n value: number | string;\n /** Full tick array — used for boundary lookup and granularity derivation. */\n tickPositions: readonly number[];\n // optional\n /** IANA timezone. Defaults to \"UTC\". */\n timezone?: string;\n /** \"12\" | \"24\" hour clock for the hour granularity. Defaults to \"12\". */\n timeFormat?: DatetimeTimeFormat;\n /** Locale for Intl formatting. Defaults to \"en-US\". */\n textLocale?: Intl.LocalesArgument;\n}>;\n\nconst HOUR_MS = 3_600_000;\nconst DAY_MS = 86_400_000;\nconst WEEK_MS = 604_800_000;\n// Granularity cutoffs use the *minimum* month/year length, not the average, so\n// calendar-aligned axes classify correctly: a real Highcharts month-unit axis\n// sits 28–31d apart and a year-unit axis 365–366d apart. Comparing the median\n// tick delta against the *average* month (30.44d) / year (365.25d) length\n// misclassified a 28-day February month gap as \"week\" and a 365-day non-leap\n// year as \"month\". Bias to the minimum so the shortest real span still reads as\n// \"month\" / \"year\".\nconst MIN_MONTH_MS = 2_419_200_000; // 28 days (shortest month, non-leap Feb)\nconst MIN_YEAR_MS = 31_536_000_000; // 365 days (shortest, non-leap year)\n\n/**\n * Reads the calendar day/month/year of a date *in the target timezone* via\n * `Intl.DateTimeFormat(...).formatToParts`. This is what makes boundary\n * detection timezone- and DST-correct (a 25-hour \"fall back\" day still rolls\n * the day over on the correct local-midnight tick). Ported verbatim from v1.\n */\nconst getDatePartsInTimezone = (date: Date, timezone: string) => {\n const formatter = new Intl.DateTimeFormat(\"en-US\", {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n timeZone: timezone,\n });\n const parts = formatter.formatToParts(date);\n return {\n day: parseInt(parts.find((p) => p.type === \"day\")?.value ?? \"0\", 10),\n month: parseInt(parts.find((p) => p.type === \"month\")?.value ?? \"0\", 10),\n year: parseInt(parts.find((p) => p.type === \"year\")?.value ?? \"0\", 10),\n };\n};\n\n/**\n * Derives the axis granularity from the median delta between consecutive\n * `tickPositions`. Median (not mean) so an irregular first/last gap does not\n * skew the result. With fewer than two ticks there is no spacing to measure, so\n * we default to \"day\".\n *\n * Note: \"day\" and \"week\" produce identical output (same primary/secondary\n * option sets), so the day/week threshold is cosmetic and never changes a label.\n * The week↔month and month↔year cutoffs do change output, so they compare\n * against the *minimum* month/year length (not the average); see MIN_MONTH_MS /\n * MIN_YEAR_MS for why calendar-aligned axes would otherwise be misclassified.\n */\nconst deriveGranularity = (\n tickPositions: readonly number[]\n): DatetimeGranularity => {\n if (tickPositions.length < 2) {\n return \"day\";\n }\n\n const deltas: number[] = [];\n for (let i = 1; i < tickPositions.length; i++) {\n const curr = tickPositions[i];\n const prev = tickPositions[i - 1];\n // Both reads are in range by the loop bounds (1 <= i < length); the guard\n // only satisfies noUncheckedIndexedAccess and is unreachable at runtime.\n if (curr === undefined || prev === undefined) {\n continue;\n }\n deltas.push(Math.abs(curr - prev));\n }\n deltas.sort((a, b) => a - b);\n\n const mid = Math.floor(deltas.length / 2);\n // `length >= 2` is guaranteed by the early return above, so `deltas` has at\n // least one element and `deltas[mid]` is always defined; `deltas[mid - 1]` is\n // only read on the even-length branch, where it is guaranteed in range too.\n const upper = deltas[mid]!;\n const lower = deltas[mid - 1];\n const median =\n deltas.length % 2 === 0 && lower !== undefined\n ? (lower + upper) / 2\n : upper;\n\n if (median < DAY_MS) {\n return \"hour\";\n }\n if (median < WEEK_MS) {\n return \"day\";\n }\n if (median < MIN_MONTH_MS) {\n return \"week\";\n }\n if (median < MIN_YEAR_MS) {\n return \"month\";\n }\n return \"year\";\n};\n\n/**\n * Derives a datetime tick's two-line stacked label as a rendering-agnostic\n * `{ primary, secondary? }` object. `secondary` is emitted only on a unit\n * boundary (the first tick, or when the relevant calendar part changes versus\n * the previous tick), matching v1's two-line semantics.\n *\n * Categorical (string) values and non-finite numbers are passed through as\n * `{ primary: String(value) }` with no secondary, so callers always get a\n * stable, markup-free string rather than \"Invalid Date\".\n */\nexport function datetimeFormatter({\n value,\n tickPositions = [],\n // optional\n timezone = \"UTC\",\n timeFormat = \"12\",\n textLocale = \"en-US\",\n}: DatetimeFormatterInput): DatetimeLabel {\n // Categorical (string) data, and non-finite timestamps, pass through.\n if (typeof value === \"string\" || !Number.isFinite(value)) {\n return { primary: String(value) };\n }\n\n const granularity = deriveGranularity(tickPositions);\n\n const tickIndex = tickPositions.indexOf(value);\n const isFirst = tickIndex === 0;\n const previousValue = tickPositions[tickIndex - 1];\n\n const valueDate = new Date(value);\n const valueParts = getDatePartsInTimezone(valueDate, timezone);\n const previousValueDate = previousValue ? new Date(previousValue) : undefined;\n const previousValueParts = previousValueDate\n ? getDatePartsInTimezone(previousValueDate, timezone)\n : undefined;\n\n let firstPartOptions: Intl.DateTimeFormatOptions = {};\n let secondPartOptions: Intl.DateTimeFormatOptions = {};\n\n switch (granularity) {\n case \"hour\":\n firstPartOptions =\n timeFormat === \"24\"\n ? { hour: \"numeric\", minute: \"numeric\", hour12: false }\n : { hour: \"numeric\" };\n if (isFirst || valueParts.day !== previousValueParts?.day) {\n secondPartOptions = { day: \"numeric\", month: \"short\" };\n }\n break;\n case \"day\":\n case \"week\":\n firstPartOptions = { day: \"numeric\" };\n if (isFirst || valueParts.month !== previousValueParts?.month) {\n secondPartOptions = { month: \"short\" };\n }\n break;\n case \"month\":\n firstPartOptions = { month: \"short\" };\n if (isFirst || valueParts.year !== previousValueParts?.year) {\n secondPartOptions = { year: \"numeric\" };\n }\n break;\n case \"year\":\n firstPartOptions = { year: \"numeric\" };\n break;\n default:\n firstPartOptions = {};\n break;\n }\n\n const primary = new Intl.DateTimeFormat(textLocale, {\n ...firstPartOptions,\n timeZone: timezone,\n }).format(valueDate);\n\n if (Object.keys(secondPartOptions).length > 0) {\n const secondary = new Intl.DateTimeFormat(textLocale, {\n ...secondPartOptions,\n timeZone: timezone,\n }).format(valueDate);\n return { primary, secondary };\n }\n\n return { primary };\n}\n","// Shared adapter helpers for the X/Y chart families (bar, line-area, …). Each\n// family's adapter still owns its `chart.type`, `plotOptions`, `series`, and\n// value (y) axis; these utilities cover the dimensional-axis + timezone wiring\n// that is identical across families, so it lives in one place.\n//\n// Deliberately granular (one concern per function) rather than a single base-\n// options builder, so a non-X/Y family like donut can reuse the subset that\n// applies to it. The broader shared-shell + value-axis sharing is left to the\n// X/Y pattern-sharing spike — the value axis in particular diverges per family\n// today (e.g. bar's declarative `format` from CE-41), so it stays per-family.\n\nimport type { DimensionalAxis } from \"./axis\";\nimport type {\n SeedsAxisLabelFormatterContext,\n SeedsChartXAxisOptions,\n} from \"./chartBase\";\nimport { datetimeFormatter } from \"./formatters/datetimeFormatter\";\nimport type { DatetimeTimeFormat } from \"./formatters/datetimeFormatter\";\n\n// Datetime tick labels: a granularity-aware, timezone/DST-correct two-line\n// stacked label via the shared `datetimeFormatter`, rendered as SVG. `<br/>` is a\n// line break in Highcharts' SVG text (styledMode, useHTML: false); the secondary\n// token is wrapped in a <span> — rendered as a <tspan> — styled by the\n// `.highcharts-xaxis-labels` rule in `styles/chartStyles.ts`.\nfunction makeDatetimeAxisLabelFormatter(\n timezone: string,\n timeFormat: DatetimeTimeFormat | undefined\n) {\n return function (this: SeedsAxisLabelFormatterContext): string {\n const { primary, secondary } = datetimeFormatter({\n value: this.value,\n tickPositions: this.axis.tickPositions ?? [],\n timezone,\n timeFormat,\n });\n return secondary\n ? `${primary}<br/><span class=\"hc-axis-label-secondary\">${secondary}</span>`\n : primary;\n };\n}\n\n/**\n * Builds the dimensional (x) axis options shared by the X/Y chart families.\n * Category axes pass their labels through; datetime axes get the granularity-\n * aware two-line label formatter. `timezone` is only consulted for datetime.\n */\nexport function buildDimensionalAxis(\n axis: DimensionalAxis,\n timezone: string\n): SeedsChartXAxisOptions {\n if (axis.type === \"datetime\") {\n return {\n type: \"datetime\",\n crosshair: axis.crosshair,\n labels: {\n formatter: makeDatetimeAxisLabelFormatter(timezone, axis.timeFormat),\n },\n };\n }\n return {\n type: \"category\",\n categories: [...axis.categories],\n crosshair: axis.crosshair,\n };\n}\n\n/**\n * The timezone shared by datetime-axis ticks (`time.timezone`) and the tooltip\n * date formatter, so they can never disagree about the day. Defaults to `\"UTC\"`\n * on a datetime axis; `undefined` on a category axis (timezone is meaningless).\n */\nexport function resolveTooltipTimezone(\n axis: DimensionalAxis,\n timezone?: string\n): string | undefined {\n return axis.type === \"datetime\" ? timezone ?? \"UTC\" : undefined;\n}\n","import { formatNumeral } from \"@sproutsocial/seeds-react-numeral\";\n\nimport type { SeedsAxisLabelFormatterContext } from \"./chartBase\";\nimport { valueFormatter, type ValueFormat } from \"./formatters/valueFormatter\";\n\n/**\n * Fixed internal locale for the default value-axis formatter. Pins the en-US\n * compact symbols (2K / 1.2M / 1.2B) so output is deterministic regardless of\n * the environment's locale resolution.\n * TODO: consumer-facing locale and an override surface may be added later.\n */\nconst FIXED_LOCALE = \"en-US\";\n\n/**\n * Derive formatNumeral's `abbreviate` threshold from the axis tick scan.\n *\n * formatNumeral abbreviates above 10,000 by default; passing a numeric\n * `abbreviate` lowers that threshold to that value. When the top tick exceeds\n * 9,999 we lower it to 1,000 so the whole axis reads \"2K 4K 6K 8K 10K\" rather\n * than a mixed \"2,000 4,000 6,000 8,000 10K\". Otherwise `true` keeps the default\n * 10,000 threshold. Centralizes the 9,999 rule for both formatters below.\n */\nfunction deriveAbbreviateFromTicks(\n context: SeedsAxisLabelFormatterContext\n): boolean | number {\n const tickPositions = context.axis.tickPositions;\n const maxValue =\n tickPositions && tickPositions.length > 0\n ? tickPositions[tickPositions.length - 1]\n : undefined;\n return typeof maxValue === \"number\" && maxValue > 9999 ? 1000 : true;\n}\n\n/**\n * Internal, zero-config default value-axis label formatter for v2 chart\n * families. Abbreviates value-axis ticks (1.20K / 1.20M / 1.20B); decimal mode\n * only. Zero renders \"0\". Decimal compact precision is fixed at two fraction\n * digits, so abbreviated ticks always carry two decimals.\n *\n * Wired as a Highcharts `yAxis.labels.formatter`, invoked `this`-bound with the\n * Seeds-local context.\n */\nexport function defaultValueAxisLabelFormatter(\n this: SeedsAxisLabelFormatterContext\n): string {\n const numberValue = Number(this.value);\n\n if (numberValue === 0) {\n return formatNumeral({ locale: FIXED_LOCALE, number: 0 });\n }\n\n const abbreviate = deriveAbbreviateFromTicks(this);\n\n return formatNumeral({\n abbreviate,\n format: \"decimal\",\n locale: FIXED_LOCALE,\n number: numberValue,\n });\n}\n\n/**\n * Build a `format`-driven value-axis label formatter that runs a declarative\n * {@link ValueFormat} through the shared {@link valueFormatter}. Reuses the same\n * `tickPositions` scan as {@link defaultValueAxisLabelFormatter} so the\n * axis-wide \"smart 1k/10k\" abbreviation is preserved for decimal/currency ticks.\n *\n * Wired as a Highcharts `yAxis.labels.formatter`; invoked `this`-bound with the\n * Seeds-local context. The returned formatter never carries chart-engine types,\n * keeping the engine boundary intact.\n */\nexport function makeValueAxisLabelFormatter(format: ValueFormat) {\n return function (this: SeedsAxisLabelFormatterContext): string {\n const numberValue = Number(this.value);\n\n // Honor an explicit `abbreviate: false` opt-out; otherwise derive the\n // threshold from the same tick scan as the default formatter (abbreviation\n // only affects decimal/currency — percent and duration ignore it inside\n // valueFormatter).\n const abbreviate =\n format.abbreviate === false ? false : deriveAbbreviateFromTicks(this);\n\n return valueFormatter({ ...format, value: numberValue, abbreviate });\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/ColorBox/ColorBox.tsx","../../../seeds-react-theme-provider/src/index.tsx","../../src/components/ColorBox/DatavizColorBox.tsx","../../src/components/ColorBox/NetworkColorBox.tsx","../../src/components/ChartLegend/components/ChartLegendLabel.tsx","../../src/components/ChartLegend/ChartLegend.tsx","../../src/components/ChartTooltip/ChartTooltip.tsx","../../src/components/ChartTooltip/components/ChartTooltipFooter.tsx","../../src/components/ChartTooltip/components/ChartTooltipHeader.tsx","../../src/components/ChartTooltip/components/ChartTooltipPortal.tsx","../../src/components/ChartTable/ChartTable.tsx","../../src/components/ChartTooltip/components/ChartTooltipTable.tsx","../../src/components/ChartTooltip/components/ChartTooltipTitle.tsx","../../src/helpers/transformDataToSeries.ts","../../src/helpers/transformTimeSeriesTooltipData.ts","../../src/helpers/yAxisLabelFormatter.ts","../../src/helpers/xAxisLabelFormatter.ts","../../src/helpers/isHourlyTimeData.ts","../../src/helpers/isCategoricalHourData.ts","../../src/helpers/getStorybookRandomColor.ts","../../src/helpers/getStorybookCategoricalData.ts","../../src/helpers/getStorybookSparseTimelineData.ts","../../src/styles/chartStyles.ts","../../src/components/ChartLegend/components/ChartLegendLabelContentWithIcon.tsx"],"sourcesContent":["import { css, type CSSProp } from \"styled-components\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport ThemeProvider from \"@sproutsocial/seeds-react-theme-provider\";\nimport { type TypeSproutTheme } from \"@sproutsocial/seeds-react-theme\";\n\nexport type TypeColorBoxProps = TypeBoxProps;\n\n/**\n * ColorBox extends Box to apply basic styles.\n */\nexport const ColorBox = ({\n display = \"inline-block\",\n height = \"16px\",\n width = \"16px\",\n minWidth = width,\n borderRadius = \"400\",\n ...props\n}: TypeColorBoxProps) => {\n return (\n <Box\n {...props}\n display={display}\n height={height}\n width={width}\n minWidth={minWidth}\n borderRadius={borderRadius}\n css={\n css`\n cursor: ${(\n props: typeof ThemeProvider & {\n onClick: ((e: React.MouseEvent<HTMLElement>) => void) | void;\n }\n ) => (props?.onClick ? \"pointer\" : \"default\")};\n ` as CSSProp<TypeSproutTheme>\n }\n />\n );\n};\n","import * as React from \"react\";\nimport {\n ThemeProvider as BaseThemeProvider,\n createGlobalStyle,\n} from \"styled-components\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\nimport type {\n TypeSproutTheme,\n TypeTheme,\n} from \"@sproutsocial/seeds-react-theme\";\n\n// We can append additional themes types here\ntype TypeAllThemes = TypeTheme | TypeSproutTheme;\n\ntype TypeProps = {\n readonly theme?: TypeAllThemes;\n readonly children?: React.ReactNode;\n};\n\n// CSS custom properties for token values that cannot be represented in SCSS maps\n// (e.g. radial-gradient + color-mix). These are injected here so styled-components\n// consumers get the values without needing to load the compiled SCSS theme CSS.\nconst GlobalTokenStyles = createGlobalStyle`\n :root {\n --color-container-bg-ai-generated: radial-gradient(\n circle at bottom left,\n color-mix(in srgb, #205bc3, transparent 80%) 0%,\n color-mix(in srgb, #6f5ed3, transparent 80%) 61%,\n color-mix(in srgb, #f282f5, transparent 80%) 100%\n ), #f3f4f4;\n }\n`;\n\nconst ThemeProvider = (props: TypeProps) => (\n <BaseThemeProvider {...props} theme={props.theme || theme}>\n <GlobalTokenStyles />\n {props.children}\n </BaseThemeProvider>\n);\n\nexport default ThemeProvider;\n","import type * as React from \"react\";\nimport styled from \"styled-components\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\nimport { ColorBox, type TypeColorBoxProps } from \"./ColorBox\";\n\nexport type TypeDatavizColorBoxProps = Readonly<\n Partial<TypeColorBoxProps> & {\n colorIndex: number;\n }\n>;\nexport type TypeDatavizColorBox = (\n props: TypeDatavizColorBoxProps\n) => React.JSXElementConstructor<TypeDatavizColorBoxProps>;\n\n/**\n * DatavizColorBox extends ColorBox to set the background color from a rotation of <a href=\"https://seeds.sproutsocial.com/visual/dataviz#color-combinations-for-general-sprout-social-data-visualizations\">dataviz colors</a>.\n */\nexport const DatavizColorBox = styled(ColorBox).attrs(\n ({ colorIndex }: TypeDatavizColorBoxProps) => ({\n style: {\n background: getDatavizColor(colorIndex),\n opacity: getDatavizOpacity(colorIndex),\n },\n })\n)<TypeDatavizColorBoxProps>``;\n\nexport const getDatavizColor = (colorIndex: number): string =>\n theme.colors.DATAVIZ_COLORS_LIST[\n colorIndex % theme.colors.DATAVIZ_COLORS_LIST.length\n ] || \"\";\n\nexport const getDatavizOpacity = (colorIndex: number): number => {\n const opacitySteps = [1, 0.6, 0.4, 0.2];\n const opacityStep =\n Math.floor(colorIndex / theme.colors.DATAVIZ_COLORS_LIST.length) %\n opacitySteps.length;\n // @ts-ignore\n return opacitySteps[opacityStep];\n};\n\n// information on 8 digit hex codes can be found here: https://css-tricks.com/8-digit-hex-codes/\nexport const getDatavizColorWithAlpha = (colorIndex: number): string => {\n const color = getDatavizColor(colorIndex);\n const opacity = getDatavizOpacity(colorIndex);\n\n // make sure the opacity is always between 0 and 1\n if (opacity < 0 || opacity > 1) {\n return color;\n }\n\n // sourced from https://stackoverflow.com/a/66143374\n return `${color}${Math.floor(opacity * 255)\n .toString(16)\n .padStart(2, \"0\")}`;\n};\n","import NETWORK_COLORS from \"@sproutsocial/seeds-networkcolor\";\n\nimport { ColorBox, type TypeColorBoxProps } from \"./ColorBox\";\n\n// $Keys<typeof NETWORK_COLORS>\ntype TypeNetworkColor =\n | \"NETWORK_COLOR_TWITTER\"\n | \"NETWORK_COLOR_TWITTER_LIKE\"\n | \"NETWORK_COLOR_FACEBOOK\"\n | \"NETWORK_COLOR_FACEBOOK_AUDIENCE_NETWORK\"\n | \"NETWORK_COLOR_LINKEDIN\"\n | \"NETWORK_COLOR_INSTAGRAM\"\n | \"NETWORK_COLOR_FEEDLY\"\n | \"NETWORK_COLOR_ANALYTICS\"\n | \"NETWORK_COLOR_YOUTUBE\"\n | \"NETWORK_COLOR_MESSENGER\"\n | \"NETWORK_COLOR_SNAPCHAT\"\n | \"NETWORK_COLOR_PINTEREST\"\n | \"NETWORK_COLOR_REDDIT\"\n | \"NETWORK_COLOR_TUMBLR\"\n | \"NETWORK_COLOR_GOOGLE_MY_BUSINESS\"\n | \"NETWORK_COLOR_TIKTOK\"\n | \"NETWORK_COLOR_TRIPADVISOR\"\n | \"NETWORK_COLOR_GLASSDOOR\"\n | \"NETWORK_COLOR_SALESFORCE\"\n | \"NETWORK_COLOR_ZENDESK\"\n | \"NETWORK_COLOR_HUBSPOT\"\n | \"NETWORK_COLOR_MICROSOFT_DYNAMICS\";\n\ntype TypeNetworkColorBoxProps = Readonly<\n TypeColorBoxProps & {\n networkColor: TypeNetworkColor;\n }\n>;\n\n/**\n * NetworkColorBox extends ColorBox to set the background color to a <a href=\"https://seeds.sproutsocial.com/visual/color#full-color-palette\">network color</a>.\n */\nexport const NetworkColorBox = ({\n networkColor,\n ...props\n}: TypeNetworkColorBoxProps) => {\n return <ColorBox {...props} bg={NETWORK_COLORS[networkColor]} />;\n};\n","import styled from \"styled-components\";\nimport { memo } from \"react\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\n\nimport type { TypeLegendLabel } from \"../ChartLegend\";\n\nimport { ColorBox } from \"../../ColorBox\";\n\nconst StyledBox = styled(Box)<TypeBoxProps>`\n list-style: none;\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[300]};\n`;\n\nexport type TypeChartLegendLabelProps = Readonly<{\n children: TypeLegendLabel[\"content\"];\n color: TypeLegendLabel[\"color\"];\n // optional\n containerBoxProps?: TypeBoxProps;\n}>;\n\nexport const ChartLegendLabel = memo<TypeChartLegendLabelProps>(\n function ChartLegendLabel({\n children,\n color = \"#CCC\",\n containerBoxProps = {},\n }: TypeChartLegendLabelProps) {\n return (\n <StyledBox {...containerBoxProps}>\n <ColorBox bg={color} />\n <Text as=\"div\" fontSize={200} color=\"text.subtext\">\n {children}\n </Text>\n </StyledBox>\n );\n }\n);\n","import { memo } from \"react\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\n\nimport { ChartLegendLabel } from \"./components/ChartLegendLabel\";\n\nexport type TypeLegendLabel = Readonly<{\n content: React.ReactNode;\n color?: string;\n}>;\n\nexport type TypeChartLegendProps = Readonly<{\n legendLabels: ReadonlyArray<TypeLegendLabel>;\n // optional\n containerBoxProps?: TypeBoxProps;\n stacked?: boolean;\n}>;\n\nexport const ChartLegend = memo<TypeChartLegendProps>(function ChartLegend({\n legendLabels,\n containerBoxProps = {},\n stacked = false,\n}: TypeChartLegendProps) {\n return (\n <Box\n as=\"ul\"\n aria-hidden=\"true\"\n display=\"flex\"\n justifyContent=\"center\"\n flexDirection={stacked ? \"column\" : \"row\"}\n flexWrap=\"wrap\"\n columnGap={450}\n rowGap={200}\n m={0}\n p={0}\n {...containerBoxProps}\n >\n {legendLabels.map(({ color, content }, index) => (\n <ChartLegendLabel\n key={`chart-legend-label-${index}`}\n color={color || theme.colors.DATAVIZ_COLORS_LIST[index]}\n containerBoxProps={{ as: \"li\" }}\n >\n {content}\n </ChartLegendLabel>\n ))}\n </Box>\n );\n});\n","import { memo } from \"react\";\nimport styled from \"styled-components\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\n// styled components\nconst StyledBox = styled(Box)`\n .Icon,\n .logo {\n stroke: none;\n }\n`;\n\n// Chart Tooltip\ntype TypeChartTooltipProps = Readonly<{\n children: React.ReactNode;\n}>;\n\nexport const ChartTooltip = memo<TypeChartTooltipProps>(function ChartTooltip({\n children,\n}: TypeChartTooltipProps) {\n return (\n <StyledBox\n bg=\"container.background.base\"\n boxShadow=\"medium\"\n border={500}\n borderColor=\"container.border.base\"\n borderRadius={500}\n p={400}\n minWidth={285}\n >\n <Box display=\"flex\" flexDirection=\"column\" gap={350}>\n {children}\n </Box>\n </StyledBox>\n );\n});\n","import { memo } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\ntype TypeChartTooltipFooterProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipFooter = memo<TypeChartTooltipFooterProps>(\n function ChartTooltipFooter({ children }: TypeChartTooltipFooterProps) {\n return (\n <Box\n borderTop={500}\n borderColor=\"container.border.base\"\n mx={-400}\n mb={-200}\n px={400}\n pt={350}\n >\n {children}\n </Box>\n );\n }\n);\n","import { memo } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\ntype TypeChartTooltipHeaderProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipHeader = memo<TypeChartTooltipHeaderProps>(\n function ChartTooltipHeader({ children }: TypeChartTooltipHeaderProps) {\n return (\n <Box\n borderBottom={500}\n borderColor=\"container.border.base\"\n mx={-400}\n mt={-200}\n px={400}\n pb={350}\n >\n {children}\n </Box>\n );\n }\n);\n","import { memo, useState, useRef, useEffect, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport type {\n Tooltip,\n Chart,\n TooltipFormatterContextObject,\n TooltipFormatterCallbackFunction,\n} from \"highcharts\";\n\ninterface ExtendedHighchartsTooltip extends Tooltip {\n label: {\n box: { attr({ height, width }: { height: number; width: number }): void };\n text: { element: HTMLElement };\n };\n}\n\nexport const generateChartTooltipPortalId = (chartId: number) =>\n `highcharts-custom-tooltip-${chartId}`;\n\ntype ChartTooltipPortalProps = Readonly<{\n chart: Chart;\n renderContent: (context: TooltipFormatterContextObject) => ReactNode;\n}>;\n\nexport const ChartTooltipPortal = memo<ChartTooltipPortalProps>(\n function ChartTooltipPortal({\n chart,\n renderContent,\n }: ChartTooltipPortalProps) {\n const isInitialized = useRef<boolean>(false);\n const [node, setNode] = useState<HTMLElement | null>(null);\n const [context, setContext] =\n useState<TooltipFormatterContextObject | null>(null);\n\n useEffect(() => {\n const formatter: TooltipFormatterCallbackFunction = function () {\n // Ensures that tooltip DOM container is rendered before React portal is created.\n if (!isInitialized.current) {\n isInitialized.current = true;\n chart.tooltip.refresh.apply(chart.tooltip, [this.point]);\n chart.tooltip.hide(0);\n }\n\n setContext(this);\n\n return `<div id=\"${generateChartTooltipPortalId(\n chart.index\n )}\" role='tooltip'></div>`;\n };\n\n chart.update({ tooltip: { formatter } });\n }, [chart]);\n\n useEffect(() => {\n // In some cases tooltip is not available on the chart yet\n if (context?.series?.chart?.tooltip) {\n const tooltip = context.series.chart\n .tooltip as ExtendedHighchartsTooltip;\n const textElement = tooltip.label.text.element;\n\n tooltip.label.box.attr({\n height: textElement.offsetHeight,\n width: textElement.offsetWidth,\n });\n\n setNode(\n document.getElementById(generateChartTooltipPortalId(chart.index))\n );\n }\n }, [context, chart.index]);\n\n return node && context ? createPortal(renderContent(context), node) : null;\n }\n);\n","import { memo } from \"react\";\nimport styled from \"styled-components\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\nimport { Table as SeedsTable } from \"@sproutsocial/seeds-react-table\";\n\nconst StyledSeedsTable = styled<typeof SeedsTable>(SeedsTable)`\n tbody tr:last-child {\n border-bottom: none;\n }\n tr:last-child td,\n tr:last-child th {\n padding-bottom: 0;\n }\n tr:first-child td,\n tr:first-child th {\n padding-top: 0;\n }\n tr th {\n padding-left: 0;\n }\n tr td:last-child {\n padding-right: 0;\n }\n`;\n\nconst StyledSeedsTableRow = styled(SeedsTable.TableRow)<{\n $isAppendedRow?: boolean;\n}>`\n ${({ $isAppendedRow, theme }) =>\n $isAppendedRow\n ? `border-top: 2px solid ${theme.colors.container.border.base}`\n : \"\"}\n`;\n\nexport type TypeChartTableProps = Readonly<{\n rows: ReadonlyArray<{\n cells: ReadonlyArray<{\n content: React.ReactNode;\n align?: React.ComponentProps<typeof SeedsTable.Cell>[\"align\"];\n colSpan?: React.ComponentProps<typeof SeedsTable.Cell>[\"colSpan\"];\n }>;\n isAppendedRow?: boolean;\n }>;\n}>;\n\nexport const ChartTable = memo<TypeChartTableProps>(function ChartTable({\n rows,\n}: TypeChartTableProps) {\n if (!rows || rows.length === 0) {\n return null;\n }\n\n return (\n <StyledSeedsTable>\n <SeedsTable.TableBody>\n {rows.map(({ cells, isAppendedRow }, rowIndex) => {\n if (!cells || cells.length === 0) {\n return null;\n }\n\n return (\n <StyledSeedsTableRow\n key={`chart-tooltip-table-row-${rowIndex}`}\n $isAppendedRow={isAppendedRow}\n >\n {cells.map(\n ({ content, align = \"left\", colSpan = 1 }, cellIndex) => {\n const uniqueIdentifier = `chart-tooltip-table-cell-${cellIndex}`;\n return (\n <SeedsTable.Cell\n key={uniqueIdentifier}\n id={uniqueIdentifier}\n scope={cellIndex === 0 ? \"row\" : undefined}\n align={align}\n colSpan={colSpan}\n py={200}\n >\n <Text.SmallBodyCopy as=\"div\">\n {content}\n </Text.SmallBodyCopy>\n </SeedsTable.Cell>\n );\n }\n )}\n </StyledSeedsTableRow>\n );\n })}\n </SeedsTable.TableBody>\n </StyledSeedsTable>\n );\n});\n","import { memo } from \"react\";\n\nimport { ChartTable, type TypeChartTableProps } from \"../../ChartTable\";\n\nexport type TypeChartTooltipTableProps = {\n rows: TypeChartTableProps[\"rows\"];\n};\n\nexport const ChartTooltipTable = memo<TypeChartTooltipTableProps>(\n function ChartTooltipTable({ rows }: TypeChartTooltipTableProps) {\n return <ChartTable rows={rows} />;\n }\n);\n","import { memo } from \"react\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\n\ntype TypeChartTooltipTitleProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipTitle = memo<TypeChartTooltipTitleProps>(\n function ChartTooltipTitle({ children }: TypeChartTooltipTitleProps) {\n return <Text.SmallSubHeadline as=\"p\">{children}</Text.SmallSubHeadline>;\n }\n);\n","import type {\n SeriesSplineOptions,\n SeriesAreasplineOptions,\n SeriesColumnOptions,\n} from \"highcharts\";\n\nimport type { TypeAreaChartProps } from \"../components/AreaChart\";\nimport type { TypeLineChartProps } from \"../components/LineChart\";\nimport type { TypeVerticalBarChartProps, TypeSeriesType } from \"../types\";\n\ntype TypeTimeSeriesOptions =\n | SeriesSplineOptions\n | SeriesAreasplineOptions\n | SeriesColumnOptions;\n\n// returns a transformed set of data to series with some logic for handling null values\nexport const transformDataToSeries = (\n {\n data,\n }: {\n data:\n | TypeAreaChartProps[\"data\"]\n | TypeLineChartProps[\"data\"]\n | TypeVerticalBarChartProps[\"data\"];\n },\n type: TypeSeriesType\n): TypeTimeSeriesOptions[] => {\n // Check if we have categorical data (string x values)\n const hasCategoricalData = data.some((series) =>\n series.points.some((point) => typeof point.x === \"string\")\n );\n\n return data.map((dataItem, dataIndex) => {\n const points = dataItem.points || [];\n const dataPoints = points.map((point, pointsIndex) => {\n let enableMarker = false;\n const isFirstPoint = pointsIndex === 0;\n const isLastPoint = pointsIndex === points.length - 1;\n\n // @ts-ignore\n const previousY = isFirstPoint ? null : points[pointsIndex - 1].y;\n // @ts-ignore\n const nextY = isLastPoint ? null : points[pointsIndex + 1].y;\n\n if (isFirstPoint && nextY === null) {\n // if the first point has data and the second point is null, show a marker for the first point\n enableMarker = true;\n } else if (isLastPoint && previousY === null) {\n // if the last point has data and the second to last point is null, show a marker for the last point\n enableMarker = true;\n } else if (previousY === null && nextY === null) {\n // if the a point has null values on both sides, show a marker\n enableMarker = true;\n }\n\n return {\n x: hasCategoricalData ? pointsIndex : point.x,\n y: point.y,\n marker: {\n enabled: enableMarker ? enableMarker : undefined,\n symbol: enableMarker ? \"circle\" : undefined,\n },\n // For categorical data, store the original category name\n ...(hasCategoricalData && { name: point.x }),\n };\n });\n\n return {\n colorIndex: dataIndex,\n data: dataPoints as TypeTimeSeriesOptions[\"data\"],\n name: dataItem.name as TypeTimeSeriesOptions[\"name\"],\n type: type,\n };\n });\n};\n","import type { TooltipFormatterContextObject } from \"highcharts\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\n\nimport type { TypeAreaChartProps } from \"../components/AreaChart\";\nimport type { TypeLineChartProps } from \"../components/LineChart\";\nimport type { TypeChartTooltipProps } from \"../types\";\n\ntype TypeTransformTimeSeriesTooltipDataProps = Readonly<{\n context: TooltipFormatterContextObject;\n data: TypeAreaChartProps[\"data\"] | TypeLineChartProps[\"data\"];\n}>;\ntype TypeTransformTimeSeriesTooltipDataReturn = TypeChartTooltipProps[\"data\"];\n\nexport const transformTimeSeriesTooltipData = ({\n context,\n data,\n}: TypeTransformTimeSeriesTooltipDataProps): TypeTransformTimeSeriesTooltipDataReturn => {\n // @ts-ignore\n return (context.series.chart.series || []).map((series, index) => {\n const pointIndex = context.point.index;\n const y = series?.points?.[pointIndex]?.y;\n\n return {\n color:\n data[index]?.styles?.color || theme.colors.DATAVIZ_COLORS_LIST[index],\n ...(data[index]?.icon ? { icon: data[index]?.icon } : {}),\n name: series.name,\n value: typeof y === \"number\" ? y : null,\n };\n });\n};\n","import type {\n AxisLabelsFormatterContextObject,\n AxisTickPositionsArray,\n} from \"highcharts\";\nimport { formatDuration } from \"@sproutsocial/seeds-react-duration\";\nimport { formatNumeral } from \"@sproutsocial/seeds-react-numeral\";\n\nimport type { TypeChartNumberFormat } from \"../types\";\n\ntype TypeYAxisLabelFormatterProps = Readonly<{\n numberLocale: Intl.LocalesArgument;\n textLocale: Intl.LocalesArgument;\n tickPositions: AxisTickPositionsArray;\n value: AxisLabelsFormatterContextObject[\"value\"];\n // optional\n currency?: string;\n numberFormat?: TypeChartNumberFormat;\n}>;\n\nexport const yAxisLabelFormatter = ({\n numberLocale,\n textLocale,\n tickPositions,\n value,\n currency = \"USD\",\n numberFormat = \"decimal\",\n}: TypeYAxisLabelFormatterProps): string => {\n const numberValue = Number(value);\n\n if (numberValue === 0) {\n return formatNumeral({\n locale: numberLocale as string,\n number: numberValue,\n });\n }\n\n if (numberFormat === \"duration\") {\n return formatDuration({\n display: \"narrow\",\n locale: textLocale,\n milliseconds: numberValue,\n });\n }\n\n // Seeds formatNumeral helper starts abbreviating numbers above 10,000. this maxValue logic\n // helps bring that threshold down to 1,000 if the last tick on the y axis is greater than 9,999\n // so we render \"2k 4k 6k 8k 10k\" instead of \"2,000 4,000 6,000 8,000 10k\"\n const maxValue =\n tickPositions && tickPositions.length > 0\n ? tickPositions[tickPositions.length - 1]\n : undefined;\n const abbreviate =\n typeof maxValue === \"number\" && maxValue > 9999 ? 1000 : true;\n\n return formatNumeral({\n abbreviate,\n currency,\n format: numberFormat,\n locale: numberLocale as string,\n number: numberValue,\n });\n};\n","import type {\n AxisLabelsFormatterContextObject,\n AxisTickPositionsArray,\n} from \"highcharts\";\n\nimport type {\n ExtendedTimeTicksInfoObject,\n TypeChartTimeFormat,\n} from \"../types\";\n\nconst getDatePartsInTimezone = (date: Date, timezone: string) => {\n const formatter = new Intl.DateTimeFormat(\"en-US\", {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n timeZone: timezone,\n });\n const parts = formatter.formatToParts(date);\n return {\n day: parseInt(parts.find((p) => p.type === \"day\")?.value ?? \"0\", 10),\n month: parseInt(parts.find((p) => p.type === \"month\")?.value ?? \"0\", 10),\n year: parseInt(parts.find((p) => p.type === \"year\")?.value ?? \"0\", 10),\n };\n};\n\ntype TypeXAxisLabelFormatterProps = Readonly<{\n textLocale: Intl.LocalesArgument;\n tickPositions: AxisTickPositionsArray;\n unitName: ExtendedTimeTicksInfoObject[\"unitName\"];\n value: AxisLabelsFormatterContextObject[\"value\"];\n // optional\n timeFormat?: TypeChartTimeFormat;\n timezone?: string;\n}>;\n\nexport const xAxisLabelFormatter = ({\n textLocale,\n tickPositions = [],\n unitName,\n value,\n // optional\n timeFormat = \"12\",\n timezone = \"UTC\",\n}: TypeXAxisLabelFormatterProps): string => {\n // Handle categorical (string) data\n if (typeof value === \"string\") {\n return `<span>${value}</span>`;\n }\n const tickIndex = tickPositions.indexOf(value as number);\n const isFirst = tickIndex === 0;\n const previousValue = tickPositions[tickIndex - 1];\n\n const valueDate = new Date(value);\n const valueParts = getDatePartsInTimezone(valueDate, timezone);\n const previousValueDate = previousValue ? new Date(previousValue) : undefined;\n const previousValueParts = previousValueDate\n ? getDatePartsInTimezone(previousValueDate, timezone)\n : undefined;\n\n let firstPartOptions = {};\n let secondPartOptions = {};\n\n switch (unitName) {\n case \"hour\":\n firstPartOptions =\n timeFormat === \"24\"\n ? { hour: \"numeric\", minute: \"numeric\", hour12: false }\n : { hour: \"numeric\" };\n if (isFirst || valueParts.day !== previousValueParts?.day) {\n secondPartOptions = { day: \"numeric\", month: \"short\" };\n }\n break;\n case \"day\":\n case \"week\":\n firstPartOptions = { day: \"numeric\" };\n if (isFirst || valueParts.month !== previousValueParts?.month) {\n secondPartOptions = { month: \"short\" };\n }\n break;\n case \"month\":\n firstPartOptions = { month: \"short\" };\n if (isFirst || valueParts.year !== previousValueParts?.year) {\n secondPartOptions = { year: \"numeric\" };\n }\n break;\n case \"year\":\n firstPartOptions = { year: \"numeric\" };\n break;\n default:\n firstPartOptions = {};\n break;\n }\n\n const firstPart = new Intl.DateTimeFormat(textLocale, {\n ...firstPartOptions,\n timeZone: timezone,\n }).format(valueDate);\n const secondPart =\n Object.keys(secondPartOptions).length > 0\n ? new Intl.DateTimeFormat(textLocale, {\n ...secondPartOptions,\n timeZone: timezone,\n }).format(valueDate)\n : undefined;\n\n return `<span>${firstPart}</span>${\n secondPart ? `<span>${secondPart}</span>` : \"\"\n }`;\n};\n","/**\n * Helper to detect if data is hourly time data (all x values are hours of the same day)\n * @param data - Array of series data with points containing x values\n * @returns boolean indicating if all x values are hours of the same day\n * @deprecated Auto-detection of hourly data is deprecated. v2 is declarative:\n * use `xAxis={{ type: \"datetime\", timeFormat: \"12\" | \"24\" }}` + a top-level\n * `timezone` instead of relying on implicit detection. See\n * `seeds-tooling/seeds-codemod-cli/src/usage-patterns/VERTICALBARCHARTV1_PATTERNS.md`\n * (CE-8).\n */\nexport function isHourlyTimeData(\n data: ReadonlyArray<\n Readonly<{ points: ReadonlyArray<{ x: number | string }> }>\n >\n): boolean {\n // Return false if there is no data.\n if (!data.length) return false;\n\n // Flatten all data points into a single array of x values.\n const xVals = data.flatMap((series) => series.points.map((p) => p.x));\n\n // Return false if there are no x values.\n if (!xVals.length) return false;\n\n // Return false if any x values are strings (categorical data)\n if (xVals.some((x) => typeof x === \"string\")) return false;\n\n // Check if all x values are on the same calendar date.\n // We do this by converting each timestamp to a YYYY-MM-DD string and checking if there's only one unique date string.\n const dates = (xVals as number[]).map((x) => {\n const d = new Date(x);\n return `${d.getUTCFullYear()}-${d.getUTCMonth()}-${d.getUTCDate()}`;\n });\n const uniqueDates = new Set(dates);\n if (uniqueDates.size !== 1) return false;\n\n // Check if all x values are exactly on the hour (e.g., 2:00:00, not 2:00:01).\n // We also check that the hour is within the valid 0-23 range.\n return (xVals as number[]).every((x) => {\n const d = new Date(x);\n const hour = d.getUTCHours();\n const minutes = d.getUTCMinutes();\n const seconds = d.getUTCSeconds();\n return hour >= 0 && hour <= 23 && minutes === 0 && seconds === 0;\n });\n}\n","/**\n * Helper to detect if data is categorical hour data (all x values are hour strings)\n * Supports both 12-hour format (\"12 AM\", \"1 PM\") and 24-hour format (\"00:00\", \"13:00\", \"23:00\")\n * @param data - Array of series data with points containing x values\n * @returns boolean indicating if all x values are hour strings\n * @deprecated Auto-detection of hourly data is deprecated. v2 is declarative:\n * use `xAxis={{ type: \"datetime\", timeFormat: \"12\" | \"24\" }}` + a top-level\n * `timezone` instead of relying on implicit detection. See\n * `seeds-tooling/seeds-codemod-cli/src/usage-patterns/VERTICALBARCHARTV1_PATTERNS.md`\n * (CE-8).\n */\nexport function isCategoricalHourData(\n data: ReadonlyArray<\n Readonly<{ points: ReadonlyArray<{ x: number | string }> }>\n >\n): boolean {\n // Return false if there is no data.\n if (!data.length) return false;\n\n // Flatten all data points into a single array of x values.\n const xVals = data.flatMap((series) => series.points.map((p) => p.x));\n\n // Return false if there are no x values.\n if (!xVals.length) return false;\n\n // Return false if any x values are not strings (numerical data)\n if (xVals.some((x) => typeof x !== \"string\")) return false;\n\n // Check if all x values match either 12-hour or 24-hour format patterns\n const hour12Pattern = /^\\d{1,2} (AM|PM)$/; // \"12 AM\", \"1 PM\", \"10 AM\"\n const hour24Pattern = /^([01]?\\d|2[0-3]):([0-5]\\d)$/; // \"00:00\", \"13:00\", \"23:59\"\n\n const stringValues = xVals as string[];\n\n // Check if all values match 12-hour format\n const allMatch12Hour = stringValues.every((x) => hour12Pattern.test(x));\n\n // Check if all values match 24-hour format\n const allMatch24Hour = stringValues.every((x) => hour24Pattern.test(x));\n\n return allMatch12Hour || allMatch24Hour;\n}\n","export const getStorybookRandomColor = (): string => {\n const letters = \"0123456789ABCDEF\";\n let color = \"#\";\n for (let i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n};\n","import { getStorybookRandomColor } from \"./getStorybookRandomColor\";\n\nexport const getStorybookCategoricalData = ({\n showNulls,\n showNegativeValues,\n numberOfSeries,\n yAxisMax,\n showCustomColors,\n showDashedLines,\n categoryType,\n}: {\n showNulls: boolean;\n showNegativeValues: boolean;\n numberOfSeries: number;\n yAxisMax: number;\n showCustomColors: boolean;\n showDashedLines: boolean;\n categoryType: \"hours\" | \"hours24\" | \"days\" | \"months\" | \"custom\";\n}) => {\n // Define different category sets\n const categoryOptions = {\n hours: [\n \"12 AM\",\n \"1 AM\",\n \"2 AM\",\n \"3 AM\",\n \"4 AM\",\n \"5 AM\",\n \"6 AM\",\n \"7 AM\",\n \"8 AM\",\n \"9 AM\",\n \"10 AM\",\n \"11 AM\",\n \"12 PM\",\n \"1 PM\",\n \"2 PM\",\n \"3 PM\",\n \"4 PM\",\n \"5 PM\",\n \"6 PM\",\n \"7 PM\",\n \"8 PM\",\n \"9 PM\",\n \"10 PM\",\n \"11 PM\",\n ],\n hours24: [\n \"00:00\",\n \"01:00\",\n \"02:00\",\n \"03:00\",\n \"04:00\",\n \"05:00\",\n \"06:00\",\n \"07:00\",\n \"08:00\",\n \"09:00\",\n \"10:00\",\n \"11:00\",\n \"12:00\",\n \"13:00\",\n \"14:00\",\n \"15:00\",\n \"16:00\",\n \"17:00\",\n \"18:00\",\n \"19:00\",\n \"20:00\",\n \"21:00\",\n \"22:00\",\n \"23:00\",\n ],\n days: [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n ],\n months: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n custom: [\n \"Category A\",\n \"Category B\",\n \"Category C\",\n \"Category D\",\n \"Category E\",\n ],\n };\n\n const categories = categoryOptions[categoryType];\n const numberOfPoints = categories.length;\n\n return [...Array(numberOfSeries).keys()].map((seriesIndex) => {\n let nullsArray: ReadonlyArray<number> = [];\n\n if (showNulls) {\n const nullsArrayLength = Math.floor(numberOfPoints / 5);\n nullsArray = [...Array(nullsArrayLength)].map(() =>\n Math.floor(Math.random() * numberOfPoints)\n );\n }\n\n return {\n points: categories.map((category, pointIndex) => {\n const showNull =\n nullsArray && nullsArray.length > 0\n ? nullsArray.includes(pointIndex)\n : false;\n const randomValue = Math.random();\n const positiveOrNegativeYAxisMax = showNegativeValues\n ? randomValue < 0.5\n ? -yAxisMax\n : yAxisMax\n : yAxisMax;\n\n return {\n x: category,\n y: showNull\n ? null\n : Math.floor(randomValue * positiveOrNegativeYAxisMax),\n };\n }),\n name: `Series ${seriesIndex + 1}`,\n styles: {\n color: showCustomColors ? getStorybookRandomColor() : undefined,\n pattern: showDashedLines ? \"dashed\" : \"solid\",\n },\n };\n });\n};\n","import { getStorybookRandomColor } from \"./getStorybookRandomColor\";\n\nexport const getStorybookSparseTimelineData = ({\n showNulls,\n showNegativeValues,\n numberOfSeries,\n yAxisMax,\n showCustomColors,\n showDashedLines,\n numberOfPoints = 5,\n timeSpanHours = 24,\n}: {\n showNulls: boolean;\n showNegativeValues: boolean;\n numberOfSeries: number;\n yAxisMax: number;\n showCustomColors: boolean;\n showDashedLines: boolean;\n numberOfPoints?: number;\n timeSpanHours?: number;\n}) => {\n const seriesNames = [\n \"Posts Published\",\n \"Comments\",\n \"Likes\",\n \"Shares\",\n \"Clicks\",\n \"Views\",\n \"Saves\",\n \"Reposts\",\n \"Mentions\",\n \"Reactions\",\n ];\n\n const baseDate = new Date(\"2024-01-01T00:00:00Z\");\n const timeSpanMs = timeSpanHours * 60 * 60 * 1000;\n\n return [...Array(numberOfSeries).keys()].map((seriesIndex) => {\n let nullsArray: ReadonlyArray<number> = [];\n\n if (showNulls) {\n const nullsArrayLength = Math.floor(numberOfPoints / 5);\n nullsArray = [...Array(nullsArrayLength)].map(() =>\n Math.floor(Math.random() * numberOfPoints)\n );\n }\n\n // Generate random timestamps for this series\n const timestamps = [...Array(numberOfPoints)]\n .map(() => {\n const randomOffset = Math.random() * timeSpanMs;\n return baseDate.getTime() + randomOffset;\n })\n .sort((a, b) => a - b); // Sort chronologically\n\n return {\n points: timestamps.map((timestamp, pointIndex) => {\n const showNull =\n nullsArray && nullsArray.length > 0\n ? nullsArray.includes(pointIndex)\n : false;\n const randomValue = Math.random();\n const positiveOrNegativeYAxisMax = showNegativeValues\n ? randomValue < 0.5\n ? -yAxisMax\n : yAxisMax\n : yAxisMax;\n\n return {\n x: timestamp,\n y: showNull\n ? null\n : Math.floor(randomValue * positiveOrNegativeYAxisMax),\n };\n }),\n name: seriesNames[seriesIndex] || `Series ${seriesIndex + 1}`,\n styles: {\n color: showCustomColors ? getStorybookRandomColor() : undefined,\n pattern: showDashedLines ? \"dashed\" : \"solid\",\n },\n };\n });\n};\n","import { css, createGlobalStyle } from \"styled-components\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\nimport {\n type TypeChartStyleColor,\n type TypeChartStyleHasOnClick,\n type TypeChartStylePattern,\n} from \"../types\";\nimport \"highcharts/css/highcharts.css\";\n\nexport const GlobalChartStyleOverrides = createGlobalStyle`\n // USAGE NOTE:\n // Put general styles in baseChartStyles instead when possible to avoid excessive global styling.\n // This global component is only for styles that can't override highcharts defaults when scoped.\n\n .highcharts-tooltip-container {\n z-index: 7 !important;\n }\n .highcharts-tooltip-box {\n fill: transparent !important;\n }\n`;\n\n// options that should apply to all charts\nexport const baseChartStyles = css<\n Readonly<{ $colors: ReadonlyArray<TypeChartStyleColor> }>\n>`\n --highcharts-background-color: ${({ theme }) =>\n theme.colors.container.background.base};\n\n // set color variables and map to each series\n ${({ $colors }) =>\n $colors\n .map((color, index) => {\n const chartColor = color || theme.colors.DATAVIZ_COLORS_LIST[index];\n return `\n\t\t\t\t// map colors to custom assigned colors or fallback to default data viz color rotation\n\t\t\t\t--highcharts-color-${index}: ${chartColor};\n\n\t\t\t\t// highcharts already accounts for 10 series, but if we have more, we need to add them\n\t\t\t\t.highcharts-color-${index} {\n\t\t\t\t\tcolor: var(--highcharts-color-${index});\n\t\t\t\t\tstroke: var(--highcharts-color-${index});\n\t\t\t\t\tfill: var(--highcharts-color-${index});\n\t\t\t\t}`;\n })\n .join(\"\\n\")}\n\n // set overall chart background color\n .highcharts-background {\n fill: ${({ theme }) => theme.colors.container.background.base};\n }\n\n g.highcharts-annotation-label {\n display: none;\n }\n\n div.highcharts-annotation-label {\n top: 0 !important;\n transform: translateX(-50%); // centers the label on the targeted axis point\n pointer-events: none; // prevents tooltip hover from being interrupted by this element since it renders after on the dom\n }\n`;\n\n// options that should apply to time series charts\nexport const timeSeriesChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${baseChartStyles}\n\n // vertical crosshair styles\n\t.highcharts-crosshair {\n stroke: ${({ theme }) => theme.colors.container.border.decorative.neutral};\n stroke-width: 1;\n }\n\n // axis and gridline styles\n .highcharts-grid-line {\n stroke: ${({ theme }) => theme.colors.container.border.base};\n }\n\n .highcharts-axis-line {\n stroke: ${({ theme }) => theme.colors.container.border.base};\n }\n\n .highcharts-tick {\n stroke: none;\n }\n .highcharts-xaxis-labels,\n .highcharts-yaxis-labels {\n // v1 HTML labels (useHTML: true). v2 SVG label styles live in\n // charts/shared/styles.ts (axisLabelV2Styles) — don't add v2 rules here.\n > span {\n font-family: ${({ theme }) => theme.fontFamily};\n ${({ theme }) => theme.typography[100]};\n font-weight: ${({ theme }) => theme.fontWeights.normal};\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n }\n .highcharts-xaxis-labels {\n // v1 HTML stacked labels (useHTML: true). v2 SVG stacked-label styles live\n // in charts/shared/styles.ts (axisLabelV2Styles).\n > span {\n display: flex;\n flex-direction: column;\n align-items: center;\n > span:nth-of-type(2) {\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n }\n\n // we don't want to drop the opacity when another item is hovered\n .highcharts-series-inactive {\n opacity: 1;\n }\n\n // apply cursor pointer when click functionality is turned on\n ${({ $hasOnClick }) =>\n $hasOnClick &&\n `\n \t\t\t.highcharts-series,\n \t\t\t.highcharts-point {\n \t\t\t\tcursor: pointer;\n \t\t\t}\n \t\t\t.highcharts-plot-background,\n \t\t\t.highcharts-crosshair,\n \t\t\t.highcharts-grid-line {\n \t\t\t\tfill: transparent;\n \t\t\t\tcursor: pointer;\n \t\t}`}\n\n path.highcharts-plot-line.y-axis-zero-line {\n stroke: ${({ theme }) => theme.colors.container.border.decorative.neutral};\n }\n`;\n\n// options that should apply to line charts\nexport const lineChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $patterns: ReadonlyArray<TypeChartStylePattern>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${timeSeriesChartStyles}\n\n // set the line stroke\n\t.highcharts-graph {\n stroke-width: 3;\n }\n\n // dashed line styles\n ${({ $patterns }) =>\n $patterns.map((pattern, index) => {\n return pattern === \"dashed\"\n ? `\n \t\t\t\t\t// highcharts already accounts for 10 series, but if we have more, we need to add them\n \t\t\t\t\t.highcharts-series-${index} {\n \t\t\t\t\t\tstroke-dasharray: 2, 8;\n \t\t\t\t\t}`\n : \"\";\n })}\n`;\n\n// options that should apply to area charts\nexport const areaChartStyles = css`\n ${timeSeriesChartStyles}\n\n // don't need to show a stroke for the line part of each area\n\t.highcharts-graph {\n stroke-width: 0;\n }\n\n // fill areas to full opacity\n .highcharts-area {\n fill-opacity: 1;\n }\n`;\n\n// options that should apply to donut charts\nexport const donutChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${baseChartStyles}\n\n // remove 250ms fade in/out when hovering over different donut chart slices\n\t.highcharts-point {\n transition: opacity 0s;\n }\n\n // remove stroke on donut slices\n .highcharts-pie-series .highcharts-point {\n stroke: none;\n }\n\n // don't reduce opacity when hovering\n .highcharts-point-hover {\n fill-opacity: none;\n }\n\n // apply cursor pointer when click functionality is turned on\n ${({ $hasOnClick }) =>\n $hasOnClick &&\n `\n \t\t\t.highcharts-series,\n \t\t\t.highcharts-point {\n \t\t\t\tcursor: pointer;\n \t\t\t}\n \t\t\t.highcharts-plot-background,\n \t\t\t.highcharts-crosshair,\n \t\t\t.highcharts-grid-line {\n \t\t\t\tfill: transparent;\n \t\t\t\tcursor: pointer;\n \t\t}`}\n`;\n","import { memo } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\nexport type TypeChartLegendLabelContentWithIconProps = Readonly<{\n children: React.ReactNode;\n // optional\n icon?: React.ReactNode;\n}>;\n\nexport const ChartLegendLabelContentWithIcon =\n memo<TypeChartLegendLabelContentWithIconProps>(\n function ChartLegendLabelContentWithIcon({\n children,\n icon,\n }: TypeChartLegendLabelContentWithIconProps) {\n return icon ? (\n <Box display=\"flex\" alignItems=\"center\" gap={200}>\n {icon}\n {children}\n </Box>\n ) : (\n children\n );\n }\n );\n"],"mappings":";AAAA,SAAS,WAAyB;AAClC,SAAS,WAA8B;;;ACDvC,OAAuB;AACvB;EACE,iBAAiB;EACjB;OACK;AACP,SAAS,aAAa;AA6BpB,SACE,KADF,YAAA;AAZF,IAAM,oBAAoB;;;;;;;;;;;;ADnB1B,OAAqC;AAgBjC,gBAAAA,YAAA;AATG,IAAM,WAAW,CAAC;AAAA,EACvB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,eAAe;AAAA,EACf,GAAG;AACL,MAAyB;AACvB,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,KACE;AAAA,oBACY,CACRC,WAGIA,QAAO,UAAU,YAAY,SAAU;AAAA;AAAA;AAAA,EAGnD;AAEJ;;;AEpCA,OAAO,YAAY;AACnB,SAAS,SAAAC,cAAa;AAef,IAAM,kBAAkB,OAAO,QAAQ,EAAE;AAAA,EAC9C,CAAC,EAAE,WAAW,OAAiC;AAAA,IAC7C,OAAO;AAAA,MACL,YAAY,gBAAgB,UAAU;AAAA,MACtC,SAAS,kBAAkB,UAAU;AAAA,IACvC;AAAA,EACF;AACF;AAEO,IAAM,kBAAkB,CAAC,eAC9BC,OAAM,OAAO,oBACX,aAAaA,OAAM,OAAO,oBAAoB,MAChD,KAAK;AAEA,IAAM,oBAAoB,CAAC,eAA+B;AAC/D,QAAM,eAAe,CAAC,GAAG,KAAK,KAAK,GAAG;AACtC,QAAM,cACJ,KAAK,MAAM,aAAaA,OAAM,OAAO,oBAAoB,MAAM,IAC/D,aAAa;AAEf,SAAO,aAAa,WAAW;AACj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Y;AACrB,SAAS,OAAAC,YAAW;AAeZ,iBAAAC,aAAA;AAPD,IAAM,kCACXF;AAAA,EACE,SAASG,iCAAgC;AAAA,IACvC;AAAA,IACA;AAAA,EACF,GAA6C;AAC3C,WAAO,OACL,gBAAAD,MAACD,MAAA,EAAI,SAAQ,QAAO,YAAW,UAAS,KAAK,KAC1C;AAAA;AAAA,MACA;AAAA,OACH,IAEA;AAAA,EAEJ;AACF;","names":["jsx","props","theme","theme","jsx","styled","Box","jsx","jsxs","styled","Box","theme","ChartLegendLabel","memo","Box","theme","jsx","memo","ChartLegend","Box","theme","memo","styled","Box","jsx","StyledBox","ChartTooltip","memo","Box","jsx","ChartTooltipFooter","memo","Box","jsx","ChartTooltipHeader","memo","ChartTooltipPortal","memo","styled","Text","jsx","theme","ChartTable","memo","jsx","memo","ChartTooltipTable","memo","Text","jsx","ChartTooltipTitle","theme","css","createGlobalStyle","theme","createGlobalStyle","css","theme","memo","Box","jsxs","ChartLegendLabelContentWithIcon"]}