@automattic/charts 0.56.5 → 0.56.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +135 -0
- package/CHANGELOG.md +17 -0
- package/README.md +2 -1
- package/dist/charts/bar-chart/index.cjs +6 -6
- package/dist/charts/bar-chart/index.css +1 -4
- package/dist/charts/bar-chart/index.css.map +1 -1
- package/dist/charts/bar-chart/index.d.cts +2 -8
- package/dist/charts/bar-chart/index.d.ts +2 -8
- package/dist/charts/bar-chart/index.js +5 -5
- package/dist/charts/bar-list-chart/index.cjs +7 -7
- package/dist/charts/bar-list-chart/index.css +1 -4
- package/dist/charts/bar-list-chart/index.css.map +1 -1
- package/dist/charts/bar-list-chart/index.d.cts +2 -2
- package/dist/charts/bar-list-chart/index.d.ts +2 -2
- package/dist/charts/bar-list-chart/index.js +6 -6
- package/dist/charts/conversion-funnel-chart/index.cjs +5 -5
- package/dist/charts/conversion-funnel-chart/index.css +1 -4
- package/dist/charts/conversion-funnel-chart/index.css.map +1 -1
- package/dist/charts/conversion-funnel-chart/index.d.cts +2 -1
- package/dist/charts/conversion-funnel-chart/index.d.ts +2 -1
- package/dist/charts/conversion-funnel-chart/index.js +4 -4
- package/dist/charts/geo-chart/index.cjs +4 -4
- package/dist/charts/geo-chart/index.css +1 -4
- package/dist/charts/geo-chart/index.css.map +1 -1
- package/dist/charts/geo-chart/index.d.cts +2 -1
- package/dist/charts/geo-chart/index.d.ts +2 -1
- package/dist/charts/geo-chart/index.js +3 -3
- package/dist/charts/leaderboard-chart/index.cjs +5 -5
- package/dist/charts/leaderboard-chart/index.css +1 -4
- package/dist/charts/leaderboard-chart/index.css.map +1 -1
- package/dist/charts/leaderboard-chart/index.d.cts +3 -2
- package/dist/charts/leaderboard-chart/index.d.ts +3 -2
- package/dist/charts/leaderboard-chart/index.js +4 -4
- package/dist/charts/line-chart/index.cjs +6 -6
- package/dist/charts/line-chart/index.css +1 -4
- package/dist/charts/line-chart/index.css.map +1 -1
- package/dist/charts/line-chart/index.d.cts +2 -8
- package/dist/charts/line-chart/index.d.ts +2 -8
- package/dist/charts/line-chart/index.js +5 -5
- package/dist/charts/pie-chart/index.cjs +6 -4
- package/dist/charts/pie-chart/index.cjs.map +1 -1
- package/dist/charts/pie-chart/index.css +13 -7
- package/dist/charts/pie-chart/index.css.map +1 -1
- package/dist/charts/pie-chart/index.d.cts +2 -1
- package/dist/charts/pie-chart/index.d.ts +2 -1
- package/dist/charts/pie-chart/index.js +5 -3
- package/dist/charts/pie-semi-circle-chart/index.cjs +6 -4
- package/dist/charts/pie-semi-circle-chart/index.cjs.map +1 -1
- package/dist/charts/pie-semi-circle-chart/index.css +12 -13
- package/dist/charts/pie-semi-circle-chart/index.css.map +1 -1
- package/dist/charts/pie-semi-circle-chart/index.d.cts +5 -2
- package/dist/charts/pie-semi-circle-chart/index.d.ts +5 -2
- package/dist/charts/pie-semi-circle-chart/index.js +5 -3
- package/dist/charts/sparkline/index.cjs +7 -7
- package/dist/charts/sparkline/index.css +1 -4
- package/dist/charts/sparkline/index.css.map +1 -1
- package/dist/charts/sparkline/index.js +6 -6
- package/dist/{chunk-NGHXTIUE.cjs → chunk-3EXJP67N.cjs} +7 -7
- package/dist/{chunk-NGHXTIUE.cjs.map → chunk-3EXJP67N.cjs.map} +1 -1
- package/dist/{chunk-FIFSYVN6.cjs → chunk-55ZCOYDF.cjs} +117 -132
- package/dist/chunk-55ZCOYDF.cjs.map +1 -0
- package/dist/{chunk-LT4YOIMM.js → chunk-7FDQGBY7.js} +145 -119
- package/dist/chunk-7FDQGBY7.js.map +1 -0
- package/dist/{chunk-7QDEU3KN.cjs → chunk-ASLARV7L.cjs} +6 -6
- package/dist/chunk-ASLARV7L.cjs.map +1 -0
- package/dist/chunk-BXFD7JIG.cjs +401 -0
- package/dist/chunk-BXFD7JIG.cjs.map +1 -0
- package/dist/{chunk-XCXAWMJQ.cjs → chunk-CAFJRZPZ.cjs} +12 -12
- package/dist/{chunk-XCXAWMJQ.cjs.map → chunk-CAFJRZPZ.cjs.map} +1 -1
- package/dist/{chunk-KHRPRH4V.js → chunk-E62LCBGD.js} +4 -4
- package/dist/{chunk-PCOI2GT5.js → chunk-GWBS65VC.js} +3 -3
- package/dist/{chunk-MEIVKY4K.js → chunk-IS5YYLTV.js} +18 -18
- package/dist/{chunk-MEIVKY4K.js.map → chunk-IS5YYLTV.js.map} +1 -1
- package/dist/{chunk-Q6G3BGCL.cjs → chunk-K6TGILHX.cjs} +8 -8
- package/dist/{chunk-Q6G3BGCL.cjs.map → chunk-K6TGILHX.cjs.map} +1 -1
- package/dist/{chunk-X6GX4QUJ.js → chunk-KHQPN77E.js} +3 -3
- package/dist/{chunk-SEKPIG5K.js → chunk-KNIMXN6Z.js} +2 -2
- package/dist/{chunk-SEKPIG5K.js.map → chunk-KNIMXN6Z.js.map} +1 -1
- package/dist/{chunk-AFWQR3SM.js → chunk-MDRCAGKZ.js} +4 -4
- package/dist/{chunk-TKPK4RFS.cjs → chunk-NQJE2CC7.cjs} +120 -98
- package/dist/chunk-NQJE2CC7.cjs.map +1 -0
- package/dist/{chunk-FY325WQ4.cjs → chunk-O2JIANHK.cjs} +25 -25
- package/dist/chunk-O2JIANHK.cjs.map +1 -0
- package/dist/{chunk-DLSUC7RN.js → chunk-OMS5QIJN.js} +6 -6
- package/dist/chunk-OMS5QIJN.js.map +1 -0
- package/dist/{chunk-TYIH5LMV.js → chunk-OP6PHB2U.js} +6 -6
- package/dist/chunk-OP6PHB2U.js.map +1 -0
- package/dist/{chunk-32ESS4MV.js → chunk-RFSHE3HL.js} +17 -7
- package/dist/chunk-RFSHE3HL.js.map +1 -0
- package/dist/{chunk-KXSLMOW5.js → chunk-SSFFCBCF.js} +6 -6
- package/dist/chunk-SSFFCBCF.js.map +1 -0
- package/dist/{chunk-I5467ZJ5.cjs → chunk-SUDERBUA.cjs} +2 -2
- package/dist/{chunk-I5467ZJ5.cjs.map → chunk-SUDERBUA.cjs.map} +1 -1
- package/dist/{chunk-SH32YSZO.cjs → chunk-UFRBUT2D.cjs} +19 -19
- package/dist/{chunk-SH32YSZO.cjs.map → chunk-UFRBUT2D.cjs.map} +1 -1
- package/dist/{chunk-7TQSPLIN.js → chunk-VPAEBI2F.js} +109 -87
- package/dist/chunk-VPAEBI2F.js.map +1 -0
- package/dist/{chunk-IHESL7H5.cjs → chunk-X7JL2NYJ.cjs} +24 -24
- package/dist/chunk-X7JL2NYJ.cjs.map +1 -0
- package/dist/{chunk-DBY6C4O2.js → chunk-XD2HV7M5.js} +77 -92
- package/dist/chunk-XD2HV7M5.js.map +1 -0
- package/dist/{chunk-LTPJPIDP.cjs → chunk-YAXY5L7I.cjs} +7 -7
- package/dist/{chunk-LTPJPIDP.cjs.map → chunk-YAXY5L7I.cjs.map} +1 -1
- package/dist/{chunk-EJJO2QNB.cjs → chunk-YDVHT7GS.cjs} +17 -7
- package/dist/chunk-YDVHT7GS.cjs.map +1 -0
- package/dist/components/legend/index.cjs +2 -2
- package/dist/components/legend/index.css +1 -4
- package/dist/components/legend/index.css.map +1 -1
- package/dist/components/legend/index.d.cts +2 -1
- package/dist/components/legend/index.d.ts +2 -1
- package/dist/components/legend/index.js +1 -1
- package/dist/components/tooltip/index.d.cts +2 -1
- package/dist/components/tooltip/index.d.ts +2 -1
- package/dist/hooks/index.cjs +2 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.css +1 -4
- package/dist/hooks/index.css.map +1 -1
- package/dist/hooks/index.d.cts +10 -7
- package/dist/hooks/index.d.ts +10 -7
- package/dist/hooks/index.js +3 -3
- package/dist/index.cjs +14 -14
- package/dist/index.css +24 -16
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +13 -13
- package/dist/{leaderboard-chart-B5gWcqe7.d.ts → leaderboard-chart-BSgEw_Um.d.ts} +1 -1
- package/dist/{leaderboard-chart-C_6QDcqj.d.cts → leaderboard-chart-COtgamhe.d.cts} +1 -1
- package/dist/providers/index.cjs +2 -2
- package/dist/providers/index.css +1 -4
- package/dist/providers/index.css.map +1 -1
- package/dist/providers/index.d.cts +3 -2
- package/dist/providers/index.d.ts +3 -2
- package/dist/providers/index.js +1 -1
- package/dist/{themes-BDVaIfBz.d.cts → themes-CVR5rmIs.d.cts} +1 -1
- package/dist/{themes-mcS8QNkQ.d.ts → themes-DQzmaSze.d.ts} +1 -1
- package/dist/{types-BCFQlzTM.d.ts → types-CzdN7rUe.d.cts} +12 -3
- package/dist/{types-BCFQlzTM.d.cts → types-CzdN7rUe.d.ts} +12 -3
- package/dist/utils/index.d.cts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/package.json +9 -9
- package/src/charts/bar-chart/bar-chart.tsx +2 -9
- package/src/charts/bar-chart/test/bar-chart.test.tsx +3 -3
- package/src/charts/line-chart/line-chart.tsx +2 -2
- package/src/charts/line-chart/test/line-chart.test.tsx +3 -3
- package/src/charts/line-chart/types.ts +0 -7
- package/src/charts/pie-chart/pie-chart.module.scss +14 -3
- package/src/charts/pie-chart/pie-chart.tsx +172 -148
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +17 -11
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +147 -119
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +46 -6
- package/src/charts/private/with-responsive/test/with-responsive.test.tsx +5 -5
- package/src/charts/private/with-responsive/with-responsive.tsx +8 -7
- package/src/hooks/index.ts +1 -1
- package/src/hooks/test/{use-element-height.test.tsx → use-element-size.test.tsx} +45 -36
- package/src/hooks/use-element-size.ts +43 -0
- package/src/hooks/use-tooltip-portal-relocator.module.scss +1 -4
- package/src/hooks/use-tooltip-portal-relocator.ts +11 -0
- package/src/types.ts +13 -3
- package/dist/chunk-32ESS4MV.js.map +0 -1
- package/dist/chunk-7QDEU3KN.cjs.map +0 -1
- package/dist/chunk-7TQSPLIN.js.map +0 -1
- package/dist/chunk-DBY6C4O2.js.map +0 -1
- package/dist/chunk-DLSUC7RN.js.map +0 -1
- package/dist/chunk-EJJO2QNB.cjs.map +0 -1
- package/dist/chunk-FIFSYVN6.cjs.map +0 -1
- package/dist/chunk-FY325WQ4.cjs.map +0 -1
- package/dist/chunk-IHESL7H5.cjs.map +0 -1
- package/dist/chunk-JL4ZKKZU.cjs +0 -375
- package/dist/chunk-JL4ZKKZU.cjs.map +0 -1
- package/dist/chunk-KXSLMOW5.js.map +0 -1
- package/dist/chunk-LT4YOIMM.js.map +0 -1
- package/dist/chunk-TKPK4RFS.cjs.map +0 -1
- package/dist/chunk-TYIH5LMV.js.map +0 -1
- package/src/hooks/use-element-height.ts +0 -37
- /package/dist/{chunk-KHRPRH4V.js.map → chunk-E62LCBGD.js.map} +0 -0
- /package/dist/{chunk-PCOI2GT5.js.map → chunk-GWBS65VC.js.map} +0 -0
- /package/dist/{chunk-X6GX4QUJ.js.map → chunk-KHQPN77E.js.map} +0 -0
- /package/dist/{chunk-AFWQR3SM.js.map → chunk-MDRCAGKZ.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-deep-memo.ts","../src/hooks/use-chart-mouse-handler.ts","../src/hooks/use-xychart-theme.ts","../src/providers/chart-context/global-charts-provider.tsx","../src/hooks/use-tooltip-portal-relocator.ts","../src/hooks/use-tooltip-portal-relocator.module.scss","../src/providers/chart-context/private/get-chart-color.ts","../src/providers/chart-context/themes.ts","../src/providers/chart-context/hooks/use-global-charts-context.ts","../src/providers/chart-context/hooks/use-chart-id.ts","../src/providers/chart-context/hooks/use-chart-registration.ts","../src/providers/chart-context/hooks/use-global-charts-theme.ts","../src/hooks/use-chart-data-transform.ts","../src/hooks/use-chart-margin.tsx","../src/hooks/use-element-size.ts","../src/hooks/use-has-legend-child.ts","../src/components/legend/legend.tsx","../src/charts/private/single-chart-context/single-chart-context.tsx","../src/charts/private/single-chart-context/use-single-chart-context.ts","../src/components/legend/private/base-legend.tsx","../src/components/legend/utils/value-or-identity.ts","../src/components/legend/utils/label-transform-factory.ts","../src/components/legend/private/base-legend.module.scss","../src/components/legend/hooks/use-chart-legend-items.ts","../src/hooks/use-text-truncation.ts","../src/hooks/use-zero-value-display.ts","../src/hooks/use-interactive-legend-data.ts","../src/hooks/use-prefers-reduced-motion.ts"],"sourcesContent":["import isEqual from 'fast-deep-equal';\nimport { useRef } from 'react';\n\n/**\n * Custom hook to memoize a value using deep equality comparison.\n * Prevents unnecessary re-renders when objects have the same content but different references.\n *\n * @param value - The value to memoize with deep equality comparison\n * @return The memoized value that only changes when deeply different\n */\nexport const useDeepMemo = < T >( value: T ): T => {\n\tconst ref = useRef< T >( value );\n\n\tif ( ! isEqual( ref.current, value ) ) {\n\t\tref.current = value;\n\t}\n\n\treturn ref.current;\n};\n","import { localPoint } from '@visx/event';\nimport { useTooltip } from '@visx/tooltip';\nimport { useCallback, type MouseEvent } from 'react';\nimport type { DataPoint } from '../types';\n\ntype UseChartMouseHandlerProps = {\n\t/**\n\t * Whether tooltips are enabled\n\t */\n\twithTooltips: boolean;\n\t/**\n\t * Horizontal offset for tooltip positioning in pixels (default: 0)\n\t */\n\toffsetX?: number;\n\t/**\n\t * Vertical offset for tooltip positioning in pixels (default: -10)\n\t */\n\toffsetY?: number;\n};\n\ntype UseChartMouseHandlerReturn = {\n\t/**\n\t * Handler for mouse move events\n\t */\n\tonMouseMove: ( event: MouseEvent< SVGElement >, data: DataPoint ) => void;\n\t/**\n\t * Handler for mouse leave events\n\t */\n\tonMouseLeave: () => void;\n\t/**\n\t * Whether the tooltip is currently open\n\t */\n\ttooltipOpen: boolean;\n\t/**\n\t * The current tooltip data\n\t */\n\ttooltipData: DataPoint | null;\n\t/**\n\t * The current tooltip left position\n\t */\n\ttooltipLeft: number | undefined;\n\t/**\n\t * The current tooltip top position\n\t */\n\ttooltipTop: number | undefined;\n};\n\n/**\n * Hook to handle mouse interactions for chart components\n *\n * @param {UseChartMouseHandlerProps} props - Hook configuration\n * @return {UseChartMouseHandlerReturn} Object containing handlers and tooltip state\n */\nexport const useChartMouseHandler = ( {\n\twithTooltips,\n\toffsetX = 0,\n\toffsetY = -10,\n}: UseChartMouseHandlerProps ): UseChartMouseHandlerReturn => {\n\tconst { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =\n\t\tuseTooltip< DataPoint >();\n\n\tconst onMouseMove = useCallback(\n\t\t( event: MouseEvent< SVGElement >, data: DataPoint ) => {\n\t\t\tif ( ! withTooltips ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst coords = localPoint( event );\n\t\t\tif ( ! coords ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tshowTooltip( {\n\t\t\t\ttooltipData: data,\n\t\t\t\ttooltipLeft: coords.x + offsetX,\n\t\t\t\ttooltipTop: coords.y + offsetY,\n\t\t\t} );\n\t\t},\n\t\t[ withTooltips, showTooltip, offsetX, offsetY ]\n\t);\n\n\tconst onMouseLeave = useCallback( () => {\n\t\tif ( ! withTooltips ) {\n\t\t\treturn;\n\t\t}\n\t\thideTooltip();\n\t}, [ withTooltips, hideTooltip ] );\n\n\treturn {\n\t\tonMouseMove,\n\t\tonMouseLeave,\n\t\ttooltipOpen,\n\t\ttooltipData: tooltipData || null,\n\t\ttooltipLeft,\n\t\ttooltipTop,\n\t};\n};\n","import { buildChartTheme } from '@visx/xychart';\nimport { useMemo } from 'react';\nimport { useGlobalChartsTheme } from '../providers';\nimport type { SeriesData } from '../types';\n\nexport const useXYChartTheme = ( data: SeriesData[] ) => {\n\tconst theme = useGlobalChartsTheme();\n\n\treturn useMemo( () => {\n\t\tconst seriesColors = ( data ?? [] )\n\t\t\t.map( series => series.options?.stroke )\n\t\t\t.filter( ( color ): color is string => Boolean( color ) );\n\n\t\treturn buildChartTheme( {\n\t\t\t...theme,\n\t\t\tcolors: [ ...seriesColors, ...( theme.colors ?? [] ) ],\n\t\t} );\n\t}, [ theme, data ] );\n};\n","import { hsl as d3Hsl } from '@visx/vendor/d3-color';\nimport { createContext, useCallback, useMemo, useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport { useTooltipPortalRelocator } from '../../hooks/use-tooltip-portal-relocator';\nimport { getItemShapeStyles, getSeriesLineStyles, mergeThemes, resolveCssVariable, normalizeColorToHex } from '../../utils';\nimport { getChartColor } from './private/get-chart-color';\nimport { defaultTheme } from './themes';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const GlobalChartsContext = /*#__PURE__*/createContext(null);\nexport const GlobalChartsProvider = ({\n children,\n theme,\n portalContainer\n}) => {\n const [charts, setCharts] = useState(() => new Map());\n // Track hidden series per chart: chartId -> Set<seriesLabel>\n const [hiddenSeries, setHiddenSeries] = useState(() => new Map());\n\n // Ref to the wrapper element for resolving scoped CSS variables\n const wrapperRef = useRef(null);\n\n // Relocate tooltip portals into the wrapper (or a consumer-provided container) for z-index control.\n useTooltipPortalRelocator(portalContainer ?? wrapperRef);\n const providerTheme = useMemo(() => {\n return theme ? mergeThemes(defaultTheme, theme) : defaultTheme;\n }, [theme]);\n\n // Cache expensive color computations that only change when theme colors change\n // Using useState + useLayoutEffect instead of useMemo to ensure CSS variables\n // in <style> tags are applied to the DOM before we try to resolve them\n const [colorCache, setColorCache] = useState(() => ({\n colors: [],\n hues: [],\n existingHslColors: [],\n minHue: 360,\n maxHue: 0\n }));\n\n // Compute color cache after DOM is updated (so CSS variables are available)\n // Resolves CSS variables from the wrapper element's scope to handle scoped variables\n // Note: Only re-runs when providerTheme changes, not when wrapper element changes.\n // This is intentional, as wrapperRef is expected to be stable for the lifetime of the provider.\n useLayoutEffect(() => {\n const {\n colors\n } = providerTheme;\n const resolvedColors = [];\n const hues = [];\n const existingHslColors = [];\n let minHue = 360;\n let maxHue = 0;\n\n // Process all colors once and cache the results\n if (Array.isArray(colors)) {\n for (const color of colors) {\n if (color && typeof color === 'string') {\n let colorValue = color;\n\n // Handle CSS custom properties - resolve them to actual values\n // Supports both '--var-name' and 'var(--var-name)' formats\n // Use wrapper element to resolve scoped CSS variables\n if (color.startsWith('--') || color.startsWith('var(')) {\n const resolved = resolveCssVariable(color, wrapperRef.current);\n if (resolved === null || resolved === '') {\n continue;\n }\n colorValue = resolved;\n }\n\n // Process hex colors\n if (colorValue.startsWith('#')) {\n resolvedColors.push(colorValue);\n const hslColor = d3Hsl(colorValue);\n // d3Hsl returns NaN values for invalid colors\n if (!isNaN(hslColor.h)) {\n const hslTuple = [hslColor.h, hslColor.s * 100, hslColor.l * 100];\n hues.push(hslTuple[0]);\n existingHslColors.push(hslTuple);\n minHue = Math.min(minHue, hslTuple[0]);\n maxHue = Math.max(maxHue, hslTuple[0]);\n }\n }\n }\n }\n }\n setColorCache({\n colors: resolvedColors,\n hues,\n existingHslColors,\n minHue,\n maxHue\n });\n }, [providerTheme]);\n const [groupToColorMap, setGroupToColorMap] = useState(() => new Map());\n\n // Reset group color mappings when theme colors change\n useEffect(() => {\n // Create a completely new Map instance to trigger dependencies, e.g. useChartLegendItems\n setGroupToColorMap(new Map());\n }, [providerTheme.colors]);\n const registerChart = useCallback((id, data) => {\n setCharts(prev => new Map(prev).set(id, data));\n }, []);\n const unregisterChart = useCallback(id => {\n setCharts(prev => {\n const newMap = new Map(prev);\n newMap.delete(id);\n return newMap;\n });\n }, []);\n const getChartData = useCallback(id => {\n return charts.get(id);\n }, [charts]);\n const resolveColor = useCallback(({\n group,\n index,\n overrideColor\n }) => {\n // Highest precedence: eg. explicit series stroke or chart color prop\n if (overrideColor) {\n return normalizeColorToHex(overrideColor, wrapperRef.current, resolveCssVariable);\n }\n\n // If group provided, maintain a stable assignment\n if (group) {\n const existing = groupToColorMap.get(group);\n if (existing) {\n return existing;\n }\n\n // Use map size as index to assign colors sequentially (0, 1, 2...)\n // ensuring each new group gets the next available palette color\n const assignedCount = groupToColorMap.size;\n const color = getChartColor(assignedCount, colorCache);\n groupToColorMap.set(group, color);\n return color;\n }\n return getChartColor(index, colorCache);\n }, [colorCache, groupToColorMap]);\n const getElementStyles = useCallback(({\n data,\n index,\n overrideColor,\n legendShape\n }) => {\n const isSeriesData = data && typeof data === 'object' && 'data' in data && 'options' in data;\n const isPointPercentageData = data && typeof data === 'object' && 'percentage' in data;\n return {\n color: resolveColor({\n group: data?.group,\n index,\n overrideColor: overrideColor || isSeriesData && data?.options?.stroke || isPointPercentageData && data?.color\n }),\n lineStyles: isSeriesData ? getSeriesLineStyles(data, index, providerTheme) : {},\n glyph: providerTheme.glyphs?.[index],\n shapeStyles: isSeriesData ? getItemShapeStyles(data, index, providerTheme, legendShape) : {}\n };\n }, [providerTheme, resolveColor]);\n\n // Series visibility management methods\n const toggleSeriesVisibility = useCallback((chartId, seriesLabel) => {\n setHiddenSeries(prev => {\n const newMap = new Map(prev);\n const chartHidden = newMap.get(chartId) || new Set();\n const newSet = new Set(chartHidden);\n if (newSet.has(seriesLabel)) {\n newSet.delete(seriesLabel);\n } else {\n newSet.add(seriesLabel);\n }\n if (newSet.size === 0) {\n newMap.delete(chartId);\n } else {\n newMap.set(chartId, newSet);\n }\n return newMap;\n });\n }, []);\n const isSeriesVisible = useCallback((chartId, seriesLabel) => {\n const chartHidden = hiddenSeries.get(chartId);\n return !chartHidden || !chartHidden.has(seriesLabel);\n }, [hiddenSeries]);\n const getHiddenSeries = useCallback(chartId => {\n const set = hiddenSeries.get(chartId);\n return set ? new Set(set) : new Set();\n }, [hiddenSeries]);\n const value = useMemo(() => ({\n charts,\n registerChart,\n unregisterChart,\n getChartData,\n theme: providerTheme,\n getElementStyles,\n toggleSeriesVisibility,\n isSeriesVisible,\n getHiddenSeries\n }), [charts, registerChart, unregisterChart, getChartData, providerTheme, getElementStyles, toggleSeriesVisibility, isSeriesVisible, getHiddenSeries]);\n return /*#__PURE__*/_jsx(GlobalChartsContext.Provider, {\n value: value,\n children: /*#__PURE__*/_jsx(\"div\", {\n ref: wrapperRef,\n style: {\n display: 'contents'\n },\n children: children\n })\n });\n};","import { useEffect } from 'react';\nimport styles from './use-tooltip-portal-relocator.module.scss';\nimport type { RefObject } from 'react';\n\n/**\n * Detects whether a DOM node is a visx chart tooltip portal.\n *\n * visx renders tooltips via `ReactDOM.createPortal` into plain `<div>` elements\n * appended to `document.body`. These portals have no id or className and contain\n * a child element with the class `visx-tooltip`.\n * @param node - The DOM node to check.\n * @return Whether the node is a visx tooltip portal div.\n */\nfunction isVisxPortalNode( node: Node ): node is HTMLDivElement {\n\treturn (\n\t\tnode instanceof HTMLDivElement &&\n\t\tnode.parentElement === document.body &&\n\t\t! node.id &&\n\t\t! node.className &&\n\t\tnode.querySelector( '.visx-tooltip' ) !== null\n\t);\n}\n\n// Shared state for the document.body.removeChild patch.\n// Reference-counted so multiple hook instances can coexist safely.\nlet patchRefCount = 0;\nlet origRemoveChild: typeof document.body.removeChild | null = null;\nlet patchedRemoveChild: typeof document.body.removeChild | null = null;\nconst relocatedNodes = new WeakSet< Node >();\n\n/**\n * Installs (or increments the ref count of) the shared removeChild patch.\n */\nfunction installRemoveChildPatch() {\n\tif ( patchRefCount++ > 0 ) {\n\t\treturn;\n\t}\n\torigRemoveChild = document.body.removeChild;\n\tpatchedRemoveChild = function < T extends Node >( this: HTMLElement, child: T ): T {\n\t\tif ( relocatedNodes.has( child ) && child.parentNode !== this ) {\n\t\t\trelocatedNodes.delete( child );\n\t\t\tchild.parentNode?.removeChild( child );\n\t\t\treturn child;\n\t\t}\n\t\treturn origRemoveChild!.call( this, child );\n\t};\n\tdocument.body.removeChild = patchedRemoveChild;\n}\n\n/**\n * Decrements the ref count and removes the patch when no instances remain.\n * If another library has since wrapped our patch, we leave it in place to\n * avoid breaking their chain — our function becomes a transparent pass-through\n * once all relocated nodes have been cleaned up.\n */\nfunction uninstallRemoveChildPatch() {\n\tif ( --patchRefCount > 0 ) {\n\t\treturn;\n\t}\n\t// Only revert if removeChild is still our function. If something else\n\t// has wrapped it, reverting would break their patch.\n\tif ( document.body.removeChild === patchedRemoveChild ) {\n\t\tdocument.body.removeChild = origRemoveChild!;\n\t}\n\torigRemoveChild = null;\n\tpatchedRemoveChild = null;\n}\n\n/**\n * Relocates visx chart tooltip portals from `document.body` into a target\n * container element. This allows the tooltips to participate in the same CSS\n * stacking context as other elements in the container (e.g. a sticky header),\n * so z-index ordering works correctly between them.\n *\n * The relocated portal divs use `position: fixed` at the viewport origin to\n * preserve the tooltip coordinate system (visx calculates positions relative\n * to the viewport).\n *\n * Because the visx Portal class calls `document.body.removeChild(node)` during\n * unmount, we patch `document.body.removeChild` to gracefully handle nodes that\n * were moved out of body. Without this, React throws a \"not a child of this\n * node\" error when tooltips unmount.\n *\n * **Important:** The container and its ancestors must not have CSS `transform`,\n * `perspective`, or `filter` properties set, as these create a new containing\n * block for `position: fixed` children, breaking viewport-relative positioning.\n *\n * @param containerRef - Ref to the element that portals should be relocated into.\n * The element referenced here, or one of its ancestors,\n * should establish the desired stacking context (for example\n * by using position and z-index).\n */\nexport function useTooltipPortalRelocator(\n\tcontainerRef: RefObject< HTMLElement | null > | undefined\n) {\n\tuseEffect( () => {\n\t\tconst container = containerRef?.current;\n\t\tif ( ! container ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Track nodes relocated by this instance so we can move them back on cleanup.\n\t\tconst instanceNodes = new Set< Node >();\n\n\t\tconst relocateNode = ( node: Node ) => {\n\t\t\tif ( ! isVisxPortalNode( node ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hide the portal immediately to prevent the tooltip from\n\t\t\t// flashing at (0,0) before visx calculates the correct position.\n\t\t\tnode.style.opacity = '0';\n\n\t\t\t// Position the portal at the viewport origin so visx's\n\t\t\t// absolute-positioned tooltip coordinates remain correct.\n\t\t\t// Zero-size with overflow: visible so it doesn't affect layout\n\t\t\t// but tooltip content still renders. pointerEvents: none on the\n\t\t\t// wrapper is intentional — tooltip inner elements manage their own.\n\t\t\tnode.classList.add( styles.relocatedPortal );\n\n\t\t\t// Remember the focused element before moving the node — relocating\n\t\t\t// a DOM subtree causes the browser to blur any focused descendants.\n\t\t\tconst { activeElement } = node.ownerDocument;\n\t\t\tconst focusedElement =\n\t\t\t\tactiveElement instanceof HTMLElement && node.contains( activeElement )\n\t\t\t\t\t? activeElement\n\t\t\t\t\t: null;\n\n\t\t\t// Insert at the start of the container (before header and content).\n\t\t\tcontainer.insertBefore( node, container.firstChild );\n\t\t\trelocatedNodes.add( node );\n\t\t\tinstanceNodes.add( node );\n\n\t\t\t// Restore focus that was lost due to the DOM move.\n\t\t\tif ( focusedElement ) {\n\t\t\t\tfocusedElement.focus();\n\t\t\t}\n\n\t\t\t// Reveal after two animation frames so visx has positioned the tooltip.\n\t\t\trequestAnimationFrame( () => {\n\t\t\t\trequestAnimationFrame( () => {\n\t\t\t\t\tnode.style.opacity = '';\n\t\t\t\t} );\n\t\t\t} );\n\t\t};\n\n\t\t// Patch document.body.removeChild so visx Portal unmount doesn't throw\n\t\t// when it tries to remove a node we already moved out of body.\n\t\tinstallRemoveChildPatch();\n\n\t\t// Relocate any portals that already exist.\n\t\tfor ( const child of Array.from( document.body.children ) ) {\n\t\t\trelocateNode( child );\n\t\t}\n\n\t\t// Watch for new portals being appended to body.\n\t\tconst observer = new MutationObserver( mutations => {\n\t\t\tfor ( const mutation of mutations ) {\n\t\t\t\tfor ( const node of mutation.addedNodes ) {\n\t\t\t\t\trelocateNode( node );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\tobserver.observe( document.body, { childList: true } );\n\n\t\treturn () => {\n\t\t\t// Disconnect first to avoid the observer re-relocating nodes\n\t\t\t// as we move them back to body.\n\t\t\tobserver.disconnect();\n\n\t\t\t// Move relocated nodes back to body so visx can clean them up\n\t\t\t// normally with the original removeChild.\n\t\t\tfor ( const node of instanceNodes ) {\n\t\t\t\tif ( node instanceof HTMLElement ) {\n\t\t\t\t\tnode.classList.remove( styles.relocatedPortal );\n\t\t\t\t}\n\t\t\t\tif ( node.parentNode === container ) {\n\t\t\t\t\tdocument.body.appendChild( node );\n\t\t\t\t}\n\t\t\t\trelocatedNodes.delete( node );\n\t\t\t}\n\t\t\tinstanceNodes.clear();\n\n\t\t\tuninstallRemoveChildPatch();\n\t\t};\n\t}, [ containerRef ] );\n}\n","import 'css-chunk:src/hooks/use-tooltip-portal-relocator.module.scss';export default {\n \"relocatedPortal\": \"a8ccharts-jCw5dQ\"\n};","import { hsl as d3Hsl } from '@visx/vendor/d3-color';\nimport { getColorDistance } from '../../../utils';\n\nexport interface ColorCache {\n\tcolors: string[];\n\thues: number[];\n\texistingHslColors: Array< [ number, number, number ] >;\n\tminHue: number;\n\tmaxHue: number;\n}\n\n/**\n * Golden ratio for mathematically pleasing color distribution\n * Used to generate evenly spaced hues that are visually distinct\n */\nconst GOLDEN_RATIO = 0.618033988749;\n\n/**\n * Minimum perceptual distance between colors to ensure visual distinction\n * Based on weighted HSL distance calculation optimized for chart readability\n */\nconst MIN_COLOR_DISTANCE = 25;\n\n/**\n * Maximum attempts to find a sufficiently different color\n * Prevents infinite loops while allowing reasonable search space\n */\nconst MAX_COLOR_GENERATION_ATTEMPTS = 50;\n\n/**\n * Color variation attempt offset\n * Small increment to explore slightly different color variations per attempt\n */\nconst VARIATION_ATTEMPT_OFFSET = 0.1;\n\n// Saturation configuration for generated colors\n\n/**\n * Base saturation percentage for generated colors\n * 45% provides muted, professional colors without being washed out\n */\nconst BASE_SATURATION = 45;\n\n/**\n * Number of saturation variation steps\n * Creates 3 different saturation levels for variety\n */\nconst SATURATION_VARIATION_STEPS = 3;\n\n/**\n * Saturation increment per variation step\n * 10% increments provide subtle variation while keeping colors muted\n * Results in saturation levels: 45%, 55%, 65%\n */\nconst SATURATION_INCREMENT = 10;\n\n// Lightness configuration for WCAG AA accessibility compliance\n\n/**\n * Base lightness percentage for generated colors\n * 35% ensures sufficient contrast against white backgrounds for WCAG AA compliance\n * WCAG AA requires 4.5:1 contrast ratio for normal text\n */\nconst BASE_LIGHTNESS = 35;\n\n/**\n * Number of lightness variation steps\n * Creates 4 different lightness levels for variety\n */\nconst LIGHTNESS_VARIATION_STEPS = 4;\n\n/**\n * Lightness increment per variation step\n * 8% increments provide subtle lightness variation while maintaining accessibility\n * Results in lightness levels: 35%, 43%, 51%, 59%\n * All levels maintain WCAG AA compliance against white backgrounds\n */\nconst LIGHTNESS_INCREMENT = 8;\n\n// Hue range expansion and constraints\n\n/**\n * Minimum hue range in degrees to ensure sufficient color variety\n * 60 degrees provides reasonable color spread even for narrow palettes\n */\nconst MIN_HUE_RANGE_DEGREES = 60;\n\n/**\n * Hue range expansion factor\n * 1.3x expansion provides slightly more variety than the original palette\n */\nconst HUE_RANGE_EXPANSION_FACTOR = 1.3;\n\n/**\n * Threshold for detecting hue wrap-around (color wheel boundary crossing)\n * 180 degrees indicates the colors span more than half the color wheel\n */\nconst HUE_WRAP_THRESHOLD_DEGREES = 180;\n\n/**\n * Full color wheel rotation in degrees\n */\nconst FULL_HUE_ROTATION_DEGREES = 360;\n\n/**\n * Factor for single color hue range\n */\nconst SINGLE_COLOR_HUE_RANGE_FACTOR = 0.33;\n\n/**\n * Get a color from the colors array or generate a new color using the golden ratio\n *\n * @param index - the index of the color to get\n * @param colorCache - pre-computed color data for performance\n * @return a color from the colors array or a new color using the golden ratio\n */\nexport const getChartColor = ( index: number, colorCache: ColorCache ): string => {\n\tconst {\n\t\tcolors,\n\t\thues,\n\t\texistingHslColors,\n\t\tminHue: cachedMinHue,\n\t\tmaxHue: cachedMaxHue,\n\t} = colorCache;\n\n\tif ( index < colors.length ) {\n\t\treturn colors[ index ];\n\t}\n\n\tlet minHue = cachedMinHue;\n\tlet maxHue = cachedMaxHue;\n\n\t// Generate additional colors using golden ratio, avoiding similar colors\n\tfor ( let attempt = 0; attempt < MAX_COLOR_GENERATION_ATTEMPTS; attempt++ ) {\n\t\t// Calculate hue using golden ratio distribution with variation per attempt\n\t\t// Formula: ((base_index + attempt_variation) * golden_ratio * 360°) mod 360°\n\t\t// This ensures mathematically pleasing spacing while allowing slight shifts per attempt\n\t\tlet hue =\n\t\t\t( ( index - colors.length + attempt * VARIATION_ATTEMPT_OFFSET ) *\n\t\t\t\tGOLDEN_RATIO *\n\t\t\t\tFULL_HUE_ROTATION_DEGREES ) %\n\t\t\tFULL_HUE_ROTATION_DEGREES;\n\n\t\t// If we have existing colors, constrain new colors to their hue range\n\t\tif ( hues.length > 0 ) {\n\t\t\t// Handle hue wrap-around (e.g., if colors span across 0 degrees)\n\t\t\tlet hueRange = maxHue - minHue;\n\n\t\t\t// If there's only one color, use a set hue range for limited variety\n\t\t\tif ( hues.length === 1 ) {\n\t\t\t\thueRange = FULL_HUE_ROTATION_DEGREES * SINGLE_COLOR_HUE_RANGE_FACTOR;\n\t\t\t} else if ( hueRange > HUE_WRAP_THRESHOLD_DEGREES ) {\n\t\t\t\t// If the range is very large, it might be wrapping around the color wheel\n\t\t\t\t// Check if a smaller range exists when considering wrap-around\n\t\t\t\tconst altMinHue = Math.min( ...hues.filter( h => h > HUE_WRAP_THRESHOLD_DEGREES ) );\n\t\t\t\tconst altMaxHue =\n\t\t\t\t\tMath.max( ...hues.filter( h => h < HUE_WRAP_THRESHOLD_DEGREES ) ) +\n\t\t\t\t\tFULL_HUE_ROTATION_DEGREES;\n\t\t\t\tconst altRange = altMaxHue - altMinHue;\n\n\t\t\t\tif ( altRange < hueRange ) {\n\t\t\t\t\tminHue = altMinHue;\n\t\t\t\t\tmaxHue = altMaxHue;\n\t\t\t\t\thueRange = altRange;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Expand the range slightly to provide some variation\n\t\t\tconst expandedRange = Math.max(\n\t\t\t\thueRange * HUE_RANGE_EXPANSION_FACTOR,\n\t\t\t\tMIN_HUE_RANGE_DEGREES\n\t\t\t);\n\t\t\tconst rangeCenter = ( minHue + maxHue ) / 2;\n\t\t\tconst expandedMin = rangeCenter - expandedRange / 2;\n\n\t\t\t// Map the generated hue to the expanded range\n\t\t\thue = expandedMin + ( hue / FULL_HUE_ROTATION_DEGREES ) * expandedRange;\n\n\t\t\t// Normalize to 0-360 range\n\t\t\thue =\n\t\t\t\t( ( hue % FULL_HUE_ROTATION_DEGREES ) + FULL_HUE_ROTATION_DEGREES ) %\n\t\t\t\tFULL_HUE_ROTATION_DEGREES;\n\t\t}\n\n\t\tconst saturation =\n\t\t\tBASE_SATURATION + ( ( index + attempt ) % SATURATION_VARIATION_STEPS ) * SATURATION_INCREMENT;\n\t\tconst lightness =\n\t\t\tBASE_LIGHTNESS + ( ( index + attempt ) % LIGHTNESS_VARIATION_STEPS ) * LIGHTNESS_INCREMENT;\n\n\t\tconst candidateHsl: [ number, number, number ] = [ hue, saturation, lightness ];\n\n\t\t// Check if this color is sufficiently different from existing colors\n\t\tlet isSufficientlyDifferent = true;\n\t\tfor ( const existingHsl of existingHslColors ) {\n\t\t\tif ( getColorDistance( candidateHsl, existingHsl ) < MIN_COLOR_DISTANCE ) {\n\t\t\t\tisSufficientlyDifferent = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( isSufficientlyDifferent ) {\n\t\t\t// d3-color uses 0-1 scale for saturation and lightness\n\t\t\treturn d3Hsl( Math.round( hue ), saturation / 100, lightness / 100 ).formatHex();\n\t\t}\n\t}\n\n\t// Fallback if we couldn't find a sufficiently different color\n\t// Formula: ((base_index) * golden_ratio * 360°) mod 360°\n\t// This ensures mathematically pleasing spacing while maintaining consistency\n\tconst fallbackHue =\n\t\t( ( index - colors.length ) * GOLDEN_RATIO * FULL_HUE_ROTATION_DEGREES ) %\n\t\tFULL_HUE_ROTATION_DEGREES;\n\tconst fallbackSaturation =\n\t\tBASE_SATURATION + ( index % SATURATION_VARIATION_STEPS ) * SATURATION_INCREMENT;\n\tconst fallbackLightness =\n\t\tBASE_LIGHTNESS + ( index % LIGHTNESS_VARIATION_STEPS ) * LIGHTNESS_INCREMENT;\n\t// d3-color uses 0-1 scale for saturation and lightness\n\treturn d3Hsl(\n\t\tMath.round( fallbackHue ),\n\t\tfallbackSaturation / 100,\n\t\tfallbackLightness / 100\n\t).formatHex();\n};\n","import type { CompleteChartTheme } from '../../types';\n\n/**\n * Default theme configuration\n */\nconst defaultTheme: CompleteChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: 'transparent', // label background color (transparent by default)\n\tlabelTextColor: '#FFFFFF', // label text color (white to match original behavior)\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#DCDCDE',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 4,\n\tgridColor: '',\n\tgridColorDark: '',\n\txTickLineStyles: { stroke: 'black' },\n\txAxisLineStyles: { stroke: '#DCDCDE', strokeWidth: 1 },\n\tlegendLabelStyles: {\n\t\tcolor: 'var(--jp-gray-80, #2c3338)',\n\t},\n\tlegendContainerStyles: {},\n\tseriesLineStyles: [],\n\tlegendShapeStyles: [],\n\tglyphs: [],\n\tsvgLabelSmall: { fill: 'var(--jp-gray-80, #2c3338)' },\n\tannotationStyles: {\n\t\tlabel: {\n\t\t\tanchorLineStroke: 'var(--jp-gray-80, #2c3338)',\n\t\t\tbackgroundFill: '#fff',\n\t\t},\n\t\tconnector: {\n\t\t\tstroke: 'var(--jp-gray-80, #2c3338)',\n\t\t},\n\t\tcircleSubject: {\n\t\t\tstroke: 'transparent',\n\t\t\tfill: 'var(--jp-gray-80, #2c3338)',\n\t\t\tradius: 5,\n\t\t},\n\t},\n\tgeoChart: {\n\t\tfeatureFillColor: 'var(--jp-gray-0, #f6f7f7)',\n\t},\n\tleaderboardChart: {\n\t\trowGap: 12,\n\t\tcolumnGap: 4,\n\t\tlabelSpacing: 1.5,\n\t\tdeltaColors: [ '#FF8C8F', '#757575', '#1F9828' ], // [negative, neutral, positive]\n\t},\n\tconversionFunnelChart: {\n\t\tbackgroundColor: '#F3F4F6',\n\t\tpositiveChangeColor: '#1F9828',\n\t\tnegativeChangeColor: '#FF8C8F',\n\t},\n\tlineChart: {\n\t\tlineStyles: {\n\t\t\tcomparison: {\n\t\t\t\tstrokeDasharray: '4 4',\n\t\t\t\tstrokeLinecap: 'square',\n\t\t\t},\n\t\t},\n\t},\n\tsparkline: {\n\t\tmargin: { top: 2, right: 2, bottom: 2, left: 2 },\n\t\tstrokeWidth: 1.5,\n\t},\n};\n\nexport { defaultTheme };\n","import { useContext } from 'react';\nimport { GlobalChartsContext } from '../global-charts-provider';\nimport type { GlobalChartsContextValue } from '../types';\n\nexport const useGlobalChartsContext = (): GlobalChartsContextValue => {\n\tconst context = useContext( GlobalChartsContext );\n\tif ( ! context ) {\n\t\tthrow new Error( 'useGlobalChartsContext must be used within a GlobalChartsProvider' );\n\t}\n\treturn context;\n};\n","import { useId } from 'react';\n\nexport const useChartId = ( providedId?: string ): string => {\n\tconst generatedId = useId();\n\treturn providedId || generatedId;\n};\n","import { useEffect, useMemo } from 'react';\nimport { useDeepMemo } from '../../../hooks';\nimport { useGlobalChartsContext } from './use-global-charts-context';\nimport type { BaseLegendItem } from '../../../components/legend';\n\nexport const useChartRegistration = ( {\n\tchartId,\n\tlegendItems,\n\tchartType,\n\tisDataValid,\n\tmetadata,\n}: {\n\tchartId: string;\n\tlegendItems: BaseLegendItem[];\n\tchartType: string;\n\tisDataValid: boolean;\n\tmetadata?: Record< string, unknown >;\n} ): void => {\n\tconst { registerChart, unregisterChart } = useGlobalChartsContext();\n\n\t// Memoize legendItems with deep comparison to prevent infinite loops\n\tconst stableLegendItems = useDeepMemo( legendItems );\n\n\t// Memoize metadata to prevent unnecessary re-renders\n\tconst memoizedMetadata = useMemo( () => metadata, [ metadata ] );\n\n\tuseEffect( () => {\n\t\t// Only register if data is valid\n\t\tif ( isDataValid ) {\n\t\t\tregisterChart( chartId, {\n\t\t\t\tlegendItems: stableLegendItems,\n\t\t\t\tchartType,\n\t\t\t\tmetadata: memoizedMetadata,\n\t\t\t} );\n\t\t}\n\n\t\treturn () => {\n\t\t\tunregisterChart( chartId );\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\tchartId,\n\t\tstableLegendItems,\n\t\tchartType,\n\t\tmemoizedMetadata,\n\t\tisDataValid,\n\t\t// Removed registerChart and unregisterChart from dependencies\n\t\t// They are stable functions created with useCallback and empty deps\n\t] );\n};\n","import { useContext } from 'react';\nimport { GlobalChartsContext } from '../global-charts-provider';\nimport { defaultTheme } from '../themes';\nimport type { CompleteChartTheme } from '../../../types';\n\n/**\n * Hook to get the global chart theme from GlobalChartsProvider\n *\n * @return The global chart theme\n */\nexport const useGlobalChartsTheme = (): CompleteChartTheme => {\n\t// Get context but don't throw if it doesn't exist (for testing or standalone usage)\n\tconst context = useContext( GlobalChartsContext );\n\tconst globalTheme = context?.theme;\n\n\treturn globalTheme ?? defaultTheme;\n};\n","import { useMemo } from 'react';\nimport { parseAsLocalDate } from '../utils';\nimport type { SeriesData } from '../types';\n\n/**\n * Hook that transforms and sorts chart data, handling date parsing and sorting\n *\n * This hook extracts the common data transformation logic used in both line-chart\n * and bar-chart components. It:\n * 1. Parses date strings into Date objects using parseAsLocalDate\n * 2. Sorts data points by date when date properties are present\n * 3. Returns the original data unchanged when no date properties are found\n *\n * @param {SeriesData[]} data - The raw chart data to transform\n * @return {SeriesData[]} The transformed and sorted data\n */\nexport const useChartDataTransform = ( data: SeriesData[] ) => {\n\treturn useMemo( () => {\n\t\t// Check if the first data point has date or dateString properties\n\t\tconst firstPoint = data?.[ 0 ]?.data?.[ 0 ];\n\t\tconst hasDateProperties = firstPoint && ( 'date' in firstPoint || 'dateString' in firstPoint );\n\n\t\t// If no date properties found, return data unchanged\n\t\tif ( ! hasDateProperties ) {\n\t\t\treturn data;\n\t\t}\n\n\t\t// Transform and sort data with date properties\n\t\treturn data.map( series => ( {\n\t\t\t...series,\n\t\t\tdata: series.data\n\t\t\t\t.map( point => {\n\t\t\t\t\tlet date: Date | undefined;\n\n\t\t\t\t\tif ( 'date' in point && point.date ) {\n\t\t\t\t\t\tdate = point.date;\n\t\t\t\t\t} else if ( 'dateString' in point && point.dateString ) {\n\t\t\t\t\t\tdate = parseAsLocalDate( point.dateString );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...point,\n\t\t\t\t\t\tdate,\n\t\t\t\t\t};\n\t\t\t\t} )\n\t\t\t\t.sort( ( a, b ) => {\n\t\t\t\t\tif ( ! a.date || ! b.date ) return 0;\n\t\t\t\t\treturn a.date.getTime() - b.date.getTime();\n\t\t\t\t} ),\n\t\t} ) );\n\t}, [ data ] );\n};\n","import { createScale, getTicks } from '@visx/scale';\nimport { useMemo } from 'react';\nimport { getLongestTickWidth } from '../utils';\n/**\n * Base top margin used when no dynamic adjustments are necessary.\n */\nconst DEFAULT_MARGIN_TOP = 10;\n\n/**\n * Base right margin used when no dynamic adjustments are necessary.\n */\nconst DEFAULT_MARGIN_RIGHT = 20;\n\n/**\n * Base bottom margin used for charts with a bottom X-axis.\n * This is large enough for typical font sizes and will be increased\n * dynamically when tick labels require more space.\n */\nconst DEFAULT_MARGIN_BOTTOM = 20;\n\n/**\n * Base left margin used when no dynamic adjustments are necessary.\n */\nconst DEFAULT_MARGIN_LEFT = 20;\n\n/**\n * Bottom margin to use when the X-axis is rendered at the top.\n * We only need a small buffer below the chart in that case.\n */\nconst DEFAULT_BOTTOM_FOR_TOP_AXIS = 10;\n\n/**\n * Fallback font size used when we cannot derive a font size\n * from the theme or axis styles for X-axis tick labels.\n */\nconst DEFAULT_FONT_SIZE = 12;\n\n/**\n * Fallback tick length used when tickLength is not provided\n * by the theme for either axis.\n */\nconst DEFAULT_TICK_LENGTH = 8;\n\n/**\n * Fallback width used for Y-axis tick labels when we cannot\n * measure them via getLongestTickWidth.\n */\nconst DEFAULT_Y_TICK_WIDTH = 40;\nconst resolveFontSize = val => {\n if (typeof val === 'number' && !isNaN(val)) {\n return val;\n }\n if (typeof val === 'string') {\n const parsed = parseFloat(val);\n return isNaN(parsed) ? undefined : parsed;\n }\n return undefined;\n};\nconst getXAxisLabelMetrics = (theme, orientation) => {\n const xAxisStyles = orientation === 'top' ? theme.axisStyles?.x?.top : theme.axisStyles?.x?.bottom;\n const fontSize = resolveFontSize(xAxisStyles?.axisLabel?.fontSize) || resolveFontSize(theme.svgLabelSmall?.fontSize) || DEFAULT_FONT_SIZE;\n const tickLength = xAxisStyles?.tickLength ?? DEFAULT_TICK_LENGTH;\n return {\n fontSize,\n tickLength\n };\n};\nexport const useChartMargin = (height, options, data, theme, horizontal = false) => {\n const yTicks = useMemo(() => {\n const allDataPoints = data.flatMap(series => series.data);\n if (horizontal) {\n // When horizontal, y ticks renders fixed tick labels.\n return allDataPoints.map(d => d.label || options.axis?.y?.tickFormat(d.date.getTime(), 0, []));\n }\n const minY = Math.min(...allDataPoints.map(d => d.value));\n const maxY = Math.max(...allDataPoints.map(d => d.value));\n const yScale = createScale({\n ...options.yScale,\n domain: [minY, maxY],\n range: [height, 0]\n });\n return getTicks(yScale, options.axis?.y?.numTicks);\n }, [options, data, height, horizontal]);\n return useMemo(() => {\n // Default margin is for bottom axis labels.\n const defaultMargin = {\n top: DEFAULT_MARGIN_TOP,\n right: DEFAULT_MARGIN_RIGHT,\n bottom: DEFAULT_MARGIN_BOTTOM,\n left: DEFAULT_MARGIN_LEFT\n };\n\n // Auto-calculate margin for y axis labels based on orientation and tick width.\n const yAxisOrientation = options.axis?.y?.orientation;\n const yAxisStyles = yAxisOrientation === 'right' ? theme.axisStyles.y.right : theme.axisStyles.y.left;\n const yTickWidth = getLongestTickWidth(yTicks, options.axis?.y?.tickFormat, yAxisStyles.axisLabel);\n const yMarginValue = (yTickWidth ?? DEFAULT_Y_TICK_WIDTH) + (yAxisStyles?.tickLength ?? 0);\n if (yAxisOrientation === 'right') {\n defaultMargin.right = yMarginValue;\n } else {\n defaultMargin.left = yMarginValue;\n }\n\n // Dynamically compute X-axis margin (bottom by default, or top if orientation is 'top').\n // This mirrors Y-axis behavior where margin is based on label size and tick length,\n // but keeps the padding minimal so consumers can control container spacing themselves.\n const xOrientation = options.axis?.x?.orientation === 'top' ? 'top' : 'bottom';\n const {\n fontSize,\n tickLength\n } = getXAxisLabelMetrics(theme, xOrientation);\n const computedXMargin = fontSize + tickLength;\n if (xOrientation === 'top') {\n defaultMargin.top = Math.max(defaultMargin.top, computedXMargin);\n defaultMargin.bottom = DEFAULT_BOTTOM_FOR_TOP_AXIS;\n } else {\n defaultMargin.bottom = Math.max(defaultMargin.bottom, computedXMargin);\n }\n return defaultMargin;\n }, [options, theme, yTicks]);\n};","import { useState, useCallback, useRef } from 'react';\n\n/**\n * Hook to measure the width and height of a DOM element.\n * Returns a ref callback to attach to the element and the current dimensions in pixels.\n *\n * @param {object} props - Optional props.\n * @param {number} props.initialWidth - The initial width to use.\n * @param {number} props.initialHeight - The initial height to use.\n *\n * @return {[Function, number, number]} A tuple containing a ref callback, width, and height in pixels\n */\nexport function useElementSize< T extends HTMLElement = HTMLDivElement >( {\n\tinitialWidth = 0,\n\tinitialHeight = 0,\n}: {\n\tinitialWidth?: number;\n\tinitialHeight?: number;\n} = {} ): [ ( node: T | null ) => void, number, number ] {\n\tconst [ width, setWidth ] = useState( initialWidth );\n\tconst [ height, setHeight ] = useState( initialHeight );\n\tconst observerRef = useRef< ResizeObserver | null >( null );\n\n\tconst refCallback = useCallback( ( node: T | null ) => {\n\t\tif ( observerRef.current ) {\n\t\t\tobserverRef.current.disconnect();\n\t\t\tobserverRef.current = null;\n\t\t}\n\t\tif ( node ) {\n\t\t\tconst handleResize = () => {\n\t\t\t\tconst rect = node.getBoundingClientRect();\n\t\t\t\tsetWidth( rect.width || 0 );\n\t\t\t\tsetHeight( rect.height || 0 );\n\t\t\t};\n\t\t\thandleResize();\n\t\t\tconst resizeObserver = new ResizeObserver( handleResize );\n\t\t\tresizeObserver.observe( node );\n\t\t\tobserverRef.current = resizeObserver;\n\t\t}\n\t}, [] );\n\n\treturn [ refCallback, width, height ];\n}\n","import { Children, isValidElement, useMemo, type ReactNode } from 'react';\nimport { Legend } from '../components/legend';\n\n/**\n * Hook to detect if children contain a Legend component (composition pattern).\n *\n * @param {ReactNode} children - React children to search through\n * @return {boolean} Whether a Legend component is present in children\n */\nexport function useHasLegendChild( children: ReactNode ): boolean {\n\treturn useMemo( () => {\n\t\tlet found = false;\n\n\t\tChildren.forEach( children, child => {\n\t\t\tif ( isValidElement( child ) && child.type === Legend ) {\n\t\t\t\tfound = true;\n\t\t\t}\n\t\t} );\n\n\t\treturn found;\n\t}, [ children ] );\n}\n","import { useContext, useMemo, forwardRef } from 'react';\nimport { SingleChartContext } from '../../charts/private/single-chart-context';\nimport { GlobalChartsContext } from '../../providers';\nimport { BaseLegend } from './private';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const Legend = /*#__PURE__*/forwardRef(({\n chartId,\n items,\n ...props\n}, ref) => {\n // Get context but don't throw if it doesn't exist\n const context = useContext(GlobalChartsContext);\n const singleChartContext = useContext(SingleChartContext);\n\n // When chartId is used, it is standalone mode\n // When chartId is not provided, we use the context's chartId, meaning it is in a single chart context\n const contextChartId = chartId ?? singleChartContext?.chartId;\n\n // Use useMemo to ensure re-rendering when context changes\n const contextItems = useMemo(() => {\n return contextChartId && context ? context.getChartData(contextChartId)?.legendItems : undefined;\n }, [contextChartId, context]);\n\n // Provided items take precedence over context items\n const legendItems = items || contextItems;\n if (!legendItems) {\n return null;\n }\n return /*#__PURE__*/_jsx(BaseLegend, {\n ref: ref,\n items: legendItems,\n ...props,\n chartId: contextChartId\n });\n});","import { createContext } from 'react';\n\n// Local context for chart implicit state sharing\n\nexport const ChartInstanceContext = /*#__PURE__*/createContext(null);\n\n// Backward compatibility exports\nexport const SingleChartContext = ChartInstanceContext;","import { useContext } from 'react';\nimport { ChartInstanceContext, type ChartInstanceContextValue } from './single-chart-context';\n\nexport const useChartInstanceContext = (): ChartInstanceContextValue => {\n\tconst context = useContext( ChartInstanceContext );\n\tif ( ! context ) {\n\t\tthrow new Error( 'useChartInstanceContext must be used within a Chart component' );\n\t}\n\treturn context;\n};\n\nexport const useSingleChartContext = useChartInstanceContext;\n","import { Group } from '@visx/group';\nimport { LegendItem, LegendLabel, LegendOrdinal, LegendShape } from '@visx/legend';\nimport { scaleOrdinal } from '@visx/scale';\nimport clsx from 'clsx';\nimport { forwardRef, useCallback, useContext } from 'react';\nimport { useTextTruncation } from '../../../hooks';\nimport { GlobalChartsContext, useGlobalChartsTheme } from '../../../providers';\nimport { valueOrIdentity, valueOrIdentityString, labelTransformFactory } from '../utils';\nimport styles from './base-legend.module.scss';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst orientationToFlexDirection = {\n horizontal: 'row',\n vertical: 'column'\n};\n\n// Component for legend text with truncation detection\n// Moved outside BaseLegend to prevent recreation on every render\nconst LegendText = ({\n text,\n textOverflow,\n maxWidth\n}) => {\n const isEllipsis = maxWidth != null && textOverflow === 'ellipsis';\n const [textRef, isTruncated] = useTextTruncation(Boolean(isEllipsis));\n return /*#__PURE__*/_jsx(\"span\", {\n ref: textRef,\n className: clsx(styles['legend-item-text'], maxWidth != null && styles[`legend-item-text--${textOverflow}`]),\n style: {\n ...(maxWidth != null && {\n maxWidth,\n minWidth: 0\n })\n },\n title: isEllipsis && isTruncated ? text : undefined,\n children: text\n });\n};\n\n/*\n * Base legend component that displays color-coded items with labels based on visx LegendOrdinal.\n * We avoid using LegendOrdinal directly to enable support for advanced features such as interactivity.\n */\nexport const BaseLegend = /*#__PURE__*/forwardRef(({\n items,\n className,\n orientation = 'horizontal',\n position = 'bottom',\n alignment = 'center',\n maxWidth,\n textOverflow = 'wrap',\n shape = 'rect',\n fill = valueOrIdentityString,\n size = valueOrIdentityString,\n labelFormat = valueOrIdentity,\n labelTransform = labelTransformFactory,\n shapeWidth = 16,\n shapeHeight = 16,\n shapeMargin = '2px 4px 2px 0',\n labelAlign = 'left',\n labelFlex = '0 0 auto',\n // Use natural width instead of expanding to fill space\n labelMargin = '0 4px',\n itemMargin = '0',\n itemDirection = 'row',\n legendLabelProps,\n legendItemClassName,\n render,\n interactive = false,\n chartId,\n ...legendItemProps\n}, ref) => {\n const theme = useGlobalChartsTheme();\n const context = useContext(GlobalChartsContext);\n const legendScale = scaleOrdinal({\n domain: items.map(item => item.label),\n range: items.map(item => item.color)\n });\n const domain = legendScale.domain();\n const getShapeStyle = useCallback(({\n index\n }) => items[index]?.shapeStyle, [items]);\n\n // Handle legend item clicks for interactive mode\n const handleLegendClick = useCallback(seriesLabel => {\n if (interactive && chartId && context) {\n context.toggleSeriesVisibility(chartId, seriesLabel);\n }\n }, [interactive, chartId, context]);\n\n // Check if a series is visible\n const isSeriesVisible = useCallback(seriesLabel => {\n if (!interactive || !chartId || !context) {\n return true;\n }\n return context.isSeriesVisible(chartId, seriesLabel);\n }, [interactive, chartId, context]);\n\n // Create event handlers to avoid inline arrow functions\n const createClickHandler = useCallback(labelText => {\n if (!interactive) {\n return undefined;\n }\n return () => handleLegendClick(labelText);\n }, [interactive, handleLegendClick]);\n const createKeyDownHandler = useCallback(labelText => {\n if (!interactive) {\n return undefined;\n }\n return event => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleLegendClick(labelText);\n }\n };\n }, [interactive, handleLegendClick]);\n return render ? render(items) : /*#__PURE__*/_jsx(LegendOrdinal, {\n scale: legendScale,\n labelFormat: labelFormat,\n labelTransform: labelTransform,\n children: labels => /*#__PURE__*/_jsx(\"div\", {\n ref: ref,\n role: \"list\",\n className: clsx(styles.legend, styles[`legend--${orientation}`], styles[`legend--alignment-${alignment}`], styles[`legend--position-${position}`], className),\n style: {\n flexDirection: orientationToFlexDirection[orientation],\n ...theme.legendContainerStyles\n },\n children: labels.map((label, i) => {\n const visible = isSeriesVisible(label.text);\n const handleClick = createClickHandler(label.text);\n const handleKeyDown = createKeyDownHandler(label.text);\n return /*#__PURE__*/_jsxs(LegendItem, {\n className: clsx('visx-legend-item', styles['legend-item'], interactive && styles['legend-item--interactive'], !visible && styles['legend-item--inactive'], legendItemClassName),\n margin: itemMargin,\n flexDirection: orientation === 'vertical' && alignment === 'end' ? 'row-reverse' : itemDirection,\n onClick: handleClick,\n onKeyDown: handleKeyDown,\n role: interactive ? 'button' : undefined,\n tabIndex: interactive ? 0 : undefined,\n \"aria-pressed\": interactive ? visible : undefined,\n \"aria-label\": interactive ? `${label.text}: ${visible ? 'visible' : 'hidden'}. Toggle visibility.` : undefined,\n ...legendItemProps,\n children: [items[i]?.renderGlyph ? /*#__PURE__*/_jsx(\"svg\", {\n width: items[i]?.glyphSize * 2,\n height: items[i]?.glyphSize * 2,\n children: /*#__PURE__*/_jsx(Group, {\n children: items[i]?.renderGlyph({\n key: `legend-glyph-${label.text}`,\n datum: {},\n index: i,\n color: fill(label),\n size: items[i]?.glyphSize,\n x: items[i]?.glyphSize,\n y: items[i]?.glyphSize\n })\n })\n }) : /*#__PURE__*/_jsx(LegendShape, {\n shape: shape,\n height: shapeHeight,\n width: shapeWidth,\n margin: shapeMargin,\n item: domain[i],\n itemIndex: i,\n label: label,\n fill: fill,\n size: size,\n shapeStyle: getShapeStyle\n }), /*#__PURE__*/_jsxs(LegendLabel, {\n className: clsx('visx-legend-label', styles['legend-item-label']),\n style: {\n justifyContent: labelAlign,\n flex: labelFlex,\n margin: labelMargin,\n ...theme.legendLabelStyles\n },\n ...legendLabelProps,\n children: [/*#__PURE__*/_jsx(LegendText, {\n text: label.text,\n textOverflow: textOverflow,\n maxWidth: maxWidth\n }), items.find(item => item.label === label.text)?.value && /*#__PURE__*/_jsxs(\"span\", {\n className: styles['legend-item-value'],\n children: ['\\u00A0', items.find(item => item.label === label.text)?.value]\n })]\n })]\n }, `legend-${label.text}-${i}`);\n })\n })\n });\n});","export type ValueOrIdentity< T > = T | { value?: T };\n\n/**\n * Returns an object's value if defined, or the object.\n * @param _ - The object to return the value of.\n * @return The value of the object, or the object itself.\n */\nexport function valueOrIdentity< T >( _: ValueOrIdentity< T > ): T {\n\tif ( _ && typeof _ === 'object' && 'value' in _ && typeof _.value !== 'undefined' )\n\t\treturn _.value;\n\treturn _ as T;\n}\n\n/**\n * Returns an object's value if defined, or the object, coerced to a string.\n * @param _ - The object to return the value of.\n * @return The value of the object, or the object itself.\n */\nexport function valueOrIdentityString< T >( _: ValueOrIdentity< T > ): string {\n\treturn String( valueOrIdentity( _ ) );\n}\n","import type { ItemTransformer, LabelFormatter } from '@visx/legend/lib/types';\nimport type { AnyD3Scale, ScaleInput } from '@visx/scale';\n\n/**\n * Returns a function which takes a Datum and index as input, and returns a formatted label object.\n * @param {object} root0 - The object to return the value of.\n * @param {AnyD3Scale} root0.scale - The scale to use.\n * @param {LabelFormatter<ScaleInput<Scale>>} root0.labelFormat - The label format to use.\n * @return {ItemTransformer<ScaleInput<Scale>, ReturnType<Scale>>} The label transform factory.\n */\nexport function labelTransformFactory< Scale extends AnyD3Scale >( {\n\tscale,\n\tlabelFormat,\n}: {\n\tscale: Scale;\n\tlabelFormat: LabelFormatter< ScaleInput< Scale > >;\n} ): ItemTransformer< ScaleInput< Scale >, ReturnType< Scale > > {\n\treturn ( d, i ) => ( {\n\t\tdatum: d,\n\t\tindex: i,\n\t\ttext: `${ labelFormat( d, i ) }`,\n\t\tvalue: scale( d ),\n\t} );\n}\n","import 'css-chunk:src/components/legend/private/base-legend.module.scss';export default {\n \"legend--horizontal\": \"a8ccharts-AELBvX\",\n \"legend--vertical\": \"a8ccharts-fX8uQe\",\n \"legend--alignment-start\": \"a8ccharts-DEe0wg\",\n \"legend--alignment-center\": \"a8ccharts-WBKF9I\",\n \"legend--alignment-end\": \"a8ccharts-JfwMng\",\n \"legend--position-top\": \"a8ccharts-8Y73Kh\",\n \"legend--position-bottom\": \"a8ccharts-TVM-IY\",\n \"legend-item\": \"a8ccharts-Vflwq8\",\n \"legend-item--interactive\": \"a8ccharts-qGsavM\",\n \"legend-item--inactive\": \"a8ccharts-ZtDY-Q\",\n \"legend-item-label\": \"a8ccharts-2H65Kr\",\n \"legend-item-text--wrap\": \"a8ccharts-faSDBI\",\n \"legend-item-text--ellipsis\": \"a8ccharts-FISUIO\",\n \"legend-item-value\": \"a8ccharts-DTZlT-\"\n};","import { formatNumber } from '@automattic/number-formatters';\nimport { useMemo } from 'react';\nimport {\n\tuseGlobalChartsContext,\n\ttype GetElementStylesParams,\n\ttype ElementStyles,\n} from '../../../providers';\nimport { formatPercentage } from '../../../utils';\nimport type { SeriesData, DataPointDate, DataPointPercentage } from '../../../types';\nimport type { BaseLegendItem } from '../types';\nimport type { LegendShape } from '@visx/legend/lib/types';\nimport type { GlyphProps } from '@visx/xychart';\nimport type { ReactNode } from 'react';\n\nexport type LegendValueDisplay = 'percentage' | 'value' | 'valueDisplay' | 'none';\n\nexport interface ChartLegendOptions {\n\twithGlyph?: boolean;\n\tglyphSize?: number;\n\trenderGlyph?: < Datum extends object >( props: GlyphProps< Datum > ) => ReactNode;\n\tshowValues?: boolean;\n\tlegendValueDisplay?: LegendValueDisplay;\n\tlegendShape?: LegendShape< SeriesData[], number >;\n}\n\n/**\n * Formats the value for a data point based on its type and display preference\n * @param point - The data point to format\n * @param showValues - Whether to show values or return empty string\n * @param legendValueDisplay - What type of value to display\n * @return Formatted value string\n */\nfunction formatPointValue(\n\tpoint: DataPointDate | DataPointPercentage,\n\tshowValues: boolean,\n\tlegendValueDisplay: LegendValueDisplay = 'percentage'\n): string {\n\tif ( ! showValues || legendValueDisplay === 'none' ) {\n\t\treturn '';\n\t}\n\n\t// Handle DataPointPercentage (pie chart data)\n\tif ( 'percentage' in point ) {\n\t\tconst percentagePoint = point as DataPointPercentage;\n\t\tswitch ( legendValueDisplay ) {\n\t\t\tcase 'percentage':\n\t\t\t\treturn formatPercentage( percentagePoint.percentage );\n\t\t\tcase 'value':\n\t\t\t\treturn formatNumber( percentagePoint.value );\n\t\t\tcase 'valueDisplay':\n\t\t\t\treturn percentagePoint.valueDisplay || formatNumber( percentagePoint.value );\n\t\t\tdefault:\n\t\t\t\treturn '';\n\t\t}\n\t}\n\n\t// Handle DataPointDate (time series data)\n\tif ( 'value' in point ) {\n\t\treturn point.value !== null ? formatNumber( point.value ) : '';\n\t}\n\n\treturn '';\n}\n\n/**\n * Applies glyph configuration to a legend item if needed\n * @param baseItem - The base legend item\n * @param withGlyph - Whether to include glyph rendering\n * @param glyph - Glyph component from theme\n * @param renderGlyph - Custom glyph render function\n * @param glyphSize - Size of the glyph\n * @return The legend item with glyph configuration applied if applicable\n */\nfunction applyGlyphToLegendItem(\n\tbaseItem: BaseLegendItem,\n\twithGlyph: boolean,\n\tglyph?: < Datum extends object >( props: GlyphProps< Datum > ) => ReactNode,\n\trenderGlyph?: < Datum extends object >( props: GlyphProps< Datum > ) => ReactNode,\n\tglyphSize?: number\n): BaseLegendItem {\n\tif ( withGlyph ) {\n\t\tconst glyphToUse = glyph || renderGlyph;\n\t\tif ( glyphToUse ) {\n\t\t\treturn {\n\t\t\t\t...baseItem,\n\t\t\t\tglyphSize,\n\t\t\t\trenderGlyph: glyphToUse,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn baseItem;\n}\n\n/**\n * Processes SeriesData into legend items\n * @param seriesData - The series data to process\n * @param getElementStyles - Function to get element styles\n * @param showValues - Whether to show values in legend\n * @param withGlyph - Whether to include glyph rendering\n * @param glyphSize - Size of the glyph\n * @param renderGlyph - Component to render the glyph\n * @param legendShape - The shape type for legend items (string literal or React component)\n * @return Array of processed legend items\n */\nfunction processSeriesData(\n\tseriesData: SeriesData[],\n\tgetElementStyles: ( params: GetElementStylesParams ) => ElementStyles,\n\tshowValues: boolean,\n\twithGlyph: boolean,\n\tglyphSize: number,\n\trenderGlyph?: < Datum extends object >( props: GlyphProps< Datum > ) => ReactNode,\n\tlegendShape?: LegendShape< SeriesData[], number >\n): BaseLegendItem[] {\n\tconst mapper = ( series: SeriesData, index: number ) => {\n\t\tconst { color, glyph, shapeStyles } = getElementStyles( {\n\t\t\tdata: series,\n\t\t\tindex,\n\t\t\tlegendShape,\n\t\t} );\n\n\t\tconst baseItem: BaseLegendItem = {\n\t\t\tlabel: series.label,\n\t\t\tvalue: showValues ? series.data?.length?.toString() || '0' : '',\n\t\t\tcolor,\n\t\t\tshapeStyle: shapeStyles,\n\t\t};\n\n\t\treturn applyGlyphToLegendItem( baseItem, withGlyph, glyph, renderGlyph, glyphSize );\n\t};\n\n\treturn seriesData.map( mapper );\n}\n\n/**\n * Processes point data into legend items\n * @param pointData - The point data to process\n * @param getElementStyles - Function to get element styles\n * @param showValues - Whether to show values in legend\n * @param legendValueDisplay - What type of value to display\n * @param withGlyph - Whether to include glyph rendering\n * @param glyphSize - Size of the glyph\n * @param renderGlyph - Component to render the glyph\n * @param legendShape - The shape type for legend items (string literal or React component)\n * @return Array of processed legend items\n */\nfunction processPointData(\n\tpointData: ( DataPointDate | DataPointPercentage )[],\n\tgetElementStyles: ( params: GetElementStylesParams ) => ElementStyles,\n\tshowValues: boolean,\n\tlegendValueDisplay: LegendValueDisplay,\n\twithGlyph: boolean,\n\tglyphSize: number,\n\trenderGlyph?: < Datum extends object >( props: GlyphProps< Datum > ) => ReactNode,\n\tlegendShape?: LegendShape< SeriesData[], number >\n): BaseLegendItem[] {\n\tconst mapper = ( point: DataPointDate | DataPointPercentage, index: number ) => {\n\t\tconst { color, glyph, shapeStyles } = getElementStyles( {\n\t\t\tdata: point as DataPointPercentage,\n\t\t\tindex,\n\t\t\tlegendShape,\n\t\t} );\n\n\t\tconst baseItem: BaseLegendItem = {\n\t\t\tlabel: point.label,\n\t\t\tvalue: formatPointValue( point, showValues, legendValueDisplay ),\n\t\t\tcolor,\n\t\t\tshapeStyle: shapeStyles,\n\t\t};\n\n\t\treturn applyGlyphToLegendItem( baseItem, withGlyph, glyph, renderGlyph, glyphSize );\n\t};\n\n\treturn pointData.map( mapper );\n}\n\n/**\n * Hook to transform chart data into legend items\n * @param data - The chart data to transform\n * @param options - Configuration options for legend generation\n * @param legendShape - The shape type for legend items (string literal or React component)\n * @return Array of legend items ready for display\n */\nexport function useChartLegendItems<\n\tT extends SeriesData[] | DataPointDate[] | DataPointPercentage[],\n>(\n\tdata: T,\n\toptions: ChartLegendOptions = {},\n\tlegendShape?: LegendShape< SeriesData[], number >\n): BaseLegendItem[] {\n\tconst {\n\t\tshowValues = false,\n\t\tlegendValueDisplay = 'percentage',\n\t\twithGlyph = false,\n\t\tglyphSize = 8,\n\t\trenderGlyph,\n\t} = options;\n\tconst { getElementStyles } = useGlobalChartsContext();\n\n\treturn useMemo( () => {\n\t\tif ( ! data || ! Array.isArray( data ) || data.length === 0 ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Handle SeriesData (multiple series with data points)\n\t\tif ( 'data' in data[ 0 ] ) {\n\t\t\treturn processSeriesData(\n\t\t\t\tdata as SeriesData[],\n\t\t\t\tgetElementStyles,\n\t\t\t\tshowValues,\n\t\t\t\twithGlyph,\n\t\t\t\tglyphSize,\n\t\t\t\trenderGlyph,\n\t\t\t\tlegendShape\n\t\t\t);\n\t\t}\n\n\t\t// Handle DataPointDate or DataPointPercentage (single data points)\n\t\treturn processPointData(\n\t\t\tdata as ( DataPointDate | DataPointPercentage )[],\n\t\t\tgetElementStyles,\n\t\t\tshowValues,\n\t\t\tlegendValueDisplay,\n\t\t\twithGlyph,\n\t\t\tglyphSize,\n\t\t\trenderGlyph,\n\t\t\tlegendShape\n\t\t);\n\t}, [\n\t\tdata,\n\t\tgetElementStyles,\n\t\tshowValues,\n\t\tlegendValueDisplay,\n\t\twithGlyph,\n\t\tglyphSize,\n\t\trenderGlyph,\n\t\tlegendShape,\n\t] );\n}\n","import { useCallback, useRef, useState } from 'react';\n\n/**\n * Hook to detect if text content is truncated within its container.\n * Uses ResizeObserver to dynamically track changes in element size.\n *\n * @param enabled - Whether truncation detection should be active. Defaults to true.\n * @return A tuple containing:\n * - [0] refCallback: Function to attach to the text element as a ref\n * - [1] isTruncated: Boolean indicating if the text is currently truncated\n *\n * @example\n * ```tsx\n * const [textRef, isTruncated] = useTextTruncation(true);\n *\n * return (\n * <span ref={textRef} title={isTruncated ? fullText : undefined}>\n * {text}\n * </span>\n * );\n * ```\n */\nexport function useTextTruncation(\n\tenabled: boolean = true\n): [ ( node: HTMLElement | null ) => void, boolean ] {\n\tconst [ isTruncated, setIsTruncated ] = useState( false );\n\tconst observerRef = useRef< ResizeObserver | null >( null );\n\n\tconst refCallback = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\t// Cleanup existing observer\n\t\t\tif ( observerRef.current ) {\n\t\t\t\tobserverRef.current.disconnect();\n\t\t\t\tobserverRef.current = null;\n\t\t\t}\n\n\t\t\tif ( node && enabled ) {\n\t\t\t\tconst checkTruncation = () => {\n\t\t\t\t\t// Check if content width exceeds container width (indicates truncation)\n\t\t\t\t\tconst truncated = node.scrollWidth > node.clientWidth;\n\t\t\t\t\tsetIsTruncated( truncated );\n\t\t\t\t};\n\n\t\t\t\t// Initial check\n\t\t\t\tcheckTruncation();\n\n\t\t\t\t// Watch for size changes\n\t\t\t\tconst resizeObserver = new ResizeObserver( checkTruncation );\n\t\t\t\tresizeObserver.observe( node );\n\t\t\t\tobserverRef.current = resizeObserver;\n\t\t\t} else {\n\t\t\t\tsetIsTruncated( false );\n\t\t\t}\n\t\t},\n\t\t[ enabled ]\n\t);\n\n\treturn [ refCallback, isTruncated ];\n}\n","import { useMemo } from 'react';\nimport type { SeriesData, DataPointDate } from '../types';\n\nexport type EnhancedDataPoint = DataPointDate & {\n\tvisualValue?: number;\n};\n\nexport interface EnhancedSeriesData extends Omit< SeriesData, 'data' > {\n\tdata: EnhancedDataPoint[];\n}\n\nexport interface UseZeroValueDisplayOptions {\n\tenabled: boolean;\n\tminValueRatio?: number;\n\tmaxValueRatio?: number;\n}\n\nexport const useZeroValueDisplay = (\n\tdata: SeriesData[],\n\toptions: UseZeroValueDisplayOptions = { enabled: false }\n): SeriesData[] | EnhancedSeriesData[] => {\n\tconst { enabled, minValueRatio = 0.6, maxValueRatio = 0.008 } = options;\n\n\treturn useMemo( () => {\n\t\tif ( ! enabled ) return data;\n\n\t\t// Collect all non-zero, non-null values (both positive and negative)\n\t\tconst nonZeroValues: number[] = [];\n\n\t\tfor ( const series of data ) {\n\t\t\tfor ( const point of series.data ) {\n\t\t\t\tif ( point.value !== null && point.value !== 0 ) {\n\t\t\t\t\tnonZeroValues.push( point.value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( nonZeroValues.length === 0 ) return data;\n\n\t\t// Convert to absolute values to find the range\n\t\tconst absoluteValues = nonZeroValues.map( Math.abs );\n\n\t\t// Calculate min and max based on absolute values\n\t\tconst minAbsoluteValue = Math.min( ...absoluteValues );\n\t\tconst maxAbsoluteValue = Math.max( ...absoluteValues );\n\n\t\t// Calculate minimum visible value using absolute range\n\t\tconst minVisibleValue = Math.min(\n\t\t\tminAbsoluteValue * minValueRatio,\n\t\t\tmaxAbsoluteValue * maxValueRatio\n\t\t);\n\n\t\treturn data.map( series => ( {\n\t\t\t...series,\n\t\t\tdata: series.data.map( ( point ): EnhancedDataPoint => {\n\t\t\t\tif ( point.value === 0 ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...point,\n\t\t\t\t\t\tvisualValue: minVisibleValue,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn point;\n\t\t\t} ),\n\t\t} ) );\n\t}, [ data, enabled, minValueRatio, maxValueRatio ] );\n};\n","import { useMemo } from 'react';\n\n/**\n * Data point interface for charts with interactive legends.\n * Requires label for series identification, value for calculations, and percentage for display.\n */\ninterface DataPointWithPercentage {\n\tlabel: string;\n\tvalue: number;\n\tpercentage: number;\n}\n\n/**\n * Parameters for the useInteractiveLegendData hook.\n */\ninterface UseInteractiveLegendDataParams< T extends DataPointWithPercentage > {\n\t/** The chart data to filter based on legend visibility */\n\tdata: T[];\n\t/** Unique chart identifier, required for interactive legends */\n\tchartId: string | undefined;\n\t/** Whether interactive legend filtering is enabled */\n\tlegendInteractive: boolean;\n\t/** Function to check if a series is visible in the legend */\n\tisSeriesVisible: ( chartId: string, label: string ) => boolean;\n}\n\n/**\n * Return value from the useInteractiveLegendData hook.\n */\ninterface UseInteractiveLegendDataResult< T extends DataPointWithPercentage > {\n\t/** Filtered data array containing only visible segments with recalculated percentages */\n\tvisibleData: T[];\n\t/** Boolean indicating if all segments are hidden */\n\tallSegmentsHidden: boolean;\n\t/**\n\t * Legend data with recalculated percentages for visible items.\n\t * Uses original data for hidden items, but shows recalculated percentages for visible ones.\n\t * This ensures the legend displays accurate percentages while maintaining all entries.\n\t */\n\tlegendData: T[];\n}\n\n/**\n * Custom hook to filter and recalculate chart data for interactive legends.\n *\n * When interactive legends are enabled, this hook:\n * 1. Filters data to show only visible series based on legend selection\n * 2. Recalculates percentages so visible segments total 100%\n * 3. Tracks whether all segments are hidden to show empty state\n *\n * This is particularly useful for pie charts, donut charts, and semi-circle charts\n * where segment visibility and percentages need to be dynamically adjusted.\n *\n * @example\n * ```tsx\n * const { visibleData, allSegmentsHidden, legendData } = useInteractiveLegendData({\n * data: chartData,\n * chartId: 'my-pie-chart',\n * legendInteractive: true,\n * isSeriesVisible: (id, label) => context.isSeriesVisible(id, label),\n * });\n *\n * // Use legendData for creating legend items (shows recalculated percentages)\n * const legendItems = useChartLegendItems(legendData, legendOptions);\n *\n * if (allSegmentsHidden) {\n * return <EmptyState />;\n * }\n *\n * // Use visibleData for rendering the chart (only visible segments)\n * return <PieChart data={visibleData} />;\n * ```\n *\n * @param params - Configuration object for the hook\n * @param params.data - The chart data to filter\n * @param params.chartId - Unique identifier for the chart (required for interactive mode)\n * @param params.legendInteractive - Whether to enable interactive filtering\n * @param params.isSeriesVisible - Function to check series visibility\n * @return Object containing visibleData, allSegmentsHidden flag, and legendData with recalculated percentages\n */\nexport const useInteractiveLegendData = < T extends DataPointWithPercentage >( {\n\tdata,\n\tchartId,\n\tlegendInteractive,\n\tisSeriesVisible,\n}: UseInteractiveLegendDataParams< T > ): UseInteractiveLegendDataResult< T > => {\n\t// Filter and recalculate data for interactive legends\n\tconst visibleData = useMemo( () => {\n\t\t// If interactive mode is disabled or no chartId, return all data unchanged\n\t\tif ( ! chartId || ! legendInteractive ) {\n\t\t\treturn data;\n\t\t}\n\n\t\t// Filter to only visible segments based on legend state\n\t\tconst filtered = data.filter( segment => isSeriesVisible( chartId, segment.label ) );\n\n\t\t// If no segments are visible, return empty array\n\t\tif ( filtered.length === 0 ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Recalculate percentages so visible segments total 100%\n\t\tconst totalValue = filtered.reduce( ( sum, segment ) => sum + segment.value, 0 );\n\n\t\treturn filtered.map( segment => ( {\n\t\t\t...segment,\n\t\t\tpercentage: totalValue > 0 ? ( segment.value / totalValue ) * 100 : 0,\n\t\t} ) );\n\t}, [ data, chartId, isSeriesVisible, legendInteractive ] );\n\n\t// Check if all segments are hidden (only relevant in interactive mode)\n\tconst allSegmentsHidden = useMemo( () => {\n\t\treturn legendInteractive && visibleData.length === 0;\n\t}, [ legendInteractive, visibleData ] );\n\n\t// Prepare legend data with recalculated percentages for visible items\n\t// This maintains all legend entries but shows updated percentages for visible segments\n\tconst legendData = useMemo( () => {\n\t\tif ( ! legendInteractive || ! chartId ) {\n\t\t\treturn data;\n\t\t}\n\n\t\t// Map original data to show recalculated percentages for visible items\n\t\treturn data.map( segment => {\n\t\t\tconst isVisible = isSeriesVisible( chartId, segment.label );\n\t\t\tif ( ! isVisible ) {\n\t\t\t\t// Return original data for hidden items\n\t\t\t\treturn segment;\n\t\t\t}\n\n\t\t\t// For visible items, find the recalculated percentage from visibleData\n\t\t\tconst recalculated = visibleData.find( d => d.label === segment.label );\n\t\t\treturn recalculated || segment;\n\t\t} );\n\t}, [ data, visibleData, legendInteractive, chartId, isSeriesVisible ] );\n\n\treturn { visibleData, allSegmentsHidden, legendData };\n};\n","import { useState, useEffect } from 'react';\n\n// 'no-preference' returns false in unsupported browsers,\n// causing a safe fallback to reduced motion instead of animating.\nconst QUERY = '(prefers-reduced-motion: no-preference)';\n\nconst getInitialState = () => ! window.matchMedia( QUERY ).matches;\n\n/**\n * Custom hook to determine if the user prefers reduced motion.\n * @return {boolean} A boolean indicating the user's preference for reduced motion.\n */\nexport function usePrefersReducedMotion() {\n\tconst [ prefersReducedMotion, setPrefersReducedMotion ] = useState( getInitialState );\n\n\tuseEffect( () => {\n\t\tconst mediaQueryList = window.matchMedia( QUERY );\n\n\t\tconst listener = event => {\n\t\t\tsetPrefersReducedMotion( ! event.matches );\n\t\t};\n\n\t\tmediaQueryList.addEventListener( 'change', listener );\n\n\t\treturn () => {\n\t\t\tmediaQueryList.removeEventListener( 'change', listener );\n\t\t};\n\t}, [] );\n\n\treturn prefersReducedMotion;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAO,aAAa;AACpB,SAAS,cAAc;AAShB,IAAM,cAAc,CAAO,UAAiB;AAClD,QAAM,MAAM,OAAa,KAAM;AAE/B,MAAK,CAAE,QAAS,IAAI,SAAS,KAAM,GAAI;AACtC,QAAI,UAAU;AAAA,EACf;AAEA,SAAO,IAAI;AACZ;;;AClBA,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,mBAAoC;AAmDtC,IAAM,uBAAuB,CAAE;AAAA,EACrC;AAAA,EACA,UAAU;AAAA,EACV,UAAU;AACX,MAA8D;AAC7D,QAAM,EAAE,aAAa,aAAa,YAAY,aAAa,aAAa,YAAY,IACnF,WAAwB;AAEzB,QAAM,cAAc;AAAA,IACnB,CAAE,OAAiC,SAAqB;AACvD,UAAK,CAAE,cAAe;AACrB;AAAA,MACD;AAEA,YAAM,SAAS,WAAY,KAAM;AACjC,UAAK,CAAE,QAAS;AACf;AAAA,MACD;AAEA,kBAAa;AAAA,QACZ,aAAa;AAAA,QACb,aAAa,OAAO,IAAI;AAAA,QACxB,YAAY,OAAO,IAAI;AAAA,MACxB,CAAE;AAAA,IACH;AAAA,IACA,CAAE,cAAc,aAAa,SAAS,OAAQ;AAAA,EAC/C;AAEA,QAAM,eAAe,YAAa,MAAM;AACvC,QAAK,CAAE,cAAe;AACrB;AAAA,IACD;AACA,gBAAY;AAAA,EACb,GAAG,CAAE,cAAc,WAAY,CAAE;AAEjC,SAAO;A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AE;AAEtE,SAAO,EAAE,aAAa,mBAAmB,WAAW;AACrD;;;ACzIA,SAAS,YAAAC,WAAU,aAAAC,kBAAiB;AAIpC,IAAM,QAAQ;AAEd,IAAM,kBAAkB,MAAM,CAAE,OAAO,WAAY,KAAM,EAAE;AAMpD,SAAS,0BAA0B;AACzC,QAAM,CAAE,sBAAsB,uBAAwB,IAAID,UAAU,eAAgB;AAEpF,EAAAC,WAAW,MAAM;AAChB,UAAM,iBAAiB,OAAO,WAAY,KAAM;AAEhD,UAAM,WAAW,WAAS;AACzB,8BAAyB,CAAE,MAAM,OAAQ;AAAA,IAC1C;AAEA,mBAAe,iBAAkB,UAAU,QAAS;AAEpD,WAAO,MAAM;AACZ,qBAAe,oBAAqB,UAAU,QAAS;AAAA,IACxD;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SAAO;AACR;","names":["useMemo","d3Hsl","useCallback","useEffect","useRef","useRef","d3Hsl","useEffect","useCallback","useEffect","useMemo","useMemo","useEffect","useContext","useContext","useMemo","useMemo","useMemo","useMemo","useMemo","useState","useCallback","useRef","useMemo","useContext","useMemo","forwardRef","createContext","useContext","useContext","useCallback","useContext","_jsx","useContext","useCallback","_jsx","forwardRef","useContext","useMemo","useMemo","useMemo","useMemo","useCallback","useRef","useState","useMemo","useMemo","useState","useEffect"]}
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-BPYKWMI7.js";
|
|
5
5
|
import {
|
|
6
6
|
Stack
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IS5YYLTV.js";
|
|
8
8
|
import {
|
|
9
9
|
withResponsive
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OP6PHB2U.js";
|
|
11
11
|
import {
|
|
12
12
|
GlobalChartsContext,
|
|
13
13
|
GlobalChartsProvider,
|
|
@@ -18,14 +18,14 @@ import {
|
|
|
18
18
|
useChartLegendItems,
|
|
19
19
|
useChartMargin,
|
|
20
20
|
useChartRegistration,
|
|
21
|
-
|
|
21
|
+
useElementSize,
|
|
22
22
|
useGlobalChartsContext,
|
|
23
23
|
useGlobalChartsTheme,
|
|
24
24
|
useHasLegendChild,
|
|
25
25
|
usePrefersReducedMotion,
|
|
26
26
|
useXYChartTheme,
|
|
27
27
|
useZeroValueDisplay
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-RFSHE3HL.js";
|
|
29
29
|
import {
|
|
30
30
|
attachSubComponents,
|
|
31
31
|
isSafari
|
|
@@ -302,7 +302,7 @@ var BarChartInternal = ({
|
|
|
302
302
|
const legendItems = useChartLegendItems(dataSorted);
|
|
303
303
|
const chartOptions = useBarChartOptions(dataWithVisibleZeros, horizontal, options);
|
|
304
304
|
const defaultMargin = useChartMargin(height, chartOptions, dataSorted, theme, horizontal);
|
|
305
|
-
const [svgWrapperRef, svgWrapperHeight] =
|
|
305
|
+
const [svgWrapperRef, , svgWrapperHeight] = useElementSize();
|
|
306
306
|
const chartRef = useRef(null);
|
|
307
307
|
const hasLegendChild = useHasLegendChild(children);
|
|
308
308
|
const chartHeight = svgWrapperHeight > 0 ? svgWrapperHeight : height;
|
|
@@ -608,4 +608,4 @@ export {
|
|
|
608
608
|
BarChart,
|
|
609
609
|
BarChartResponsive
|
|
610
610
|
};
|
|
611
|
-
//# sourceMappingURL=chunk-
|
|
611
|
+
//# sourceMappingURL=chunk-SSFFCBCF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/bar-chart/bar-chart.tsx","../src/charts/bar-chart/bar-chart.module.scss","../src/charts/bar-chart/private/use-bar-chart-options.ts","../src/charts/bar-chart/private/truncated-tick-component.tsx"],"sourcesContent":["import { formatNumber } from '@automattic/number-formatters';\nimport { PatternLines, PatternCircles, PatternWaves, PatternHexagons } from '@visx/pattern';\nimport { Axis, BarSeries, BarGroup, Grid, XYChart } from '@visx/xychart';\nimport { __ } from '@wordpress/i18n';\nimport { Stack } from '@wordpress/ui';\nimport clsx from 'clsx';\nimport { useCallback, useContext, useState, useRef, useMemo } from 'react';\nimport { Legend, useChartLegendItems } from '../../components/legend';\nimport { AccessibleTooltip, useKeyboardNavigation } from '../../components/tooltip';\nimport { useXYChartTheme, useChartDataTransform, useZeroValueDisplay, useChartMargin, useElementSize, useHasLegendChild, usePrefersReducedMotion } from '../../hooks';\nimport { GlobalChartsProvider, useChartId, useChartRegistration, useGlobalChartsContext, useGlobalChartsTheme, GlobalChartsContext } from '../../providers';\nimport { attachSubComponents } from '../../utils';\nimport { SingleChartContext } from '../private/single-chart-context';\nimport { withResponsive } from '../private/with-responsive';\nimport styles from './bar-chart.module.scss';\nimport { useBarChartOptions } from './private';\n\n// Base props type with optional responsive properties\n\n// Composition API types\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\n// Validation function similar to LineChart\nconst validateData = data => {\n if (!data?.length) return 'No data available';\n const hasInvalidData = data.some(series => series.data.some(point => isNaN(point.value) || point.value === null || point.value === undefined || !point.label && (!('date' in point && point.date) || isNaN(point.date.getTime()))));\n if (hasInvalidData) return 'Invalid data';\n return null;\n};\nconst getPatternId = (chartId, index) => `bar-pattern-${chartId}-${index}`;\nconst BarChartInternal = ({\n data,\n chartId: providedChartId,\n width,\n height,\n className,\n margin,\n withTooltips = false,\n showLegend = false,\n legendOrientation = 'horizontal',\n legendPosition = 'bottom',\n legendAlignment = 'center',\n legendMaxWidth,\n legendTextOverflow = 'wrap',\n legendItemClassName,\n legendShape = 'rect',\n gridVisibility: gridVisibilityProp,\n renderTooltip,\n options = {},\n orientation = 'vertical',\n withPatterns = false,\n showZeroValues = false,\n legendInteractive = false,\n animation,\n children,\n gap = 'md'\n}) => {\n const horizontal = orientation === 'horizontal';\n const chartId = useChartId(providedChartId);\n const theme = useXYChartTheme(data);\n const dataSorted = useChartDataTransform(data);\n\n // Transform data to add a small value for zero bars to make them visible\n const dataWithVisibleZeros = useZeroValueDisplay(dataSorted, {\n enabled: showZeroValues\n });\n\n // Create legend items using the reusable hook\n const legendItems = useChartLegendItems(dataSorted);\n const chartOptions = useBarChartOptions(dataWithVisibleZeros, horizontal, options);\n const defaultMargin = useChartMargin(height, chartOptions, dataSorted, theme, horizontal);\n const [svgWrapperRef,, svgWrapperHeight] = useElementSize();\n const chartRef = useRef(null);\n\n // Check if children contain a Legend component (composition pattern)\n const hasLegendChild = useHasLegendChild(children);\n\n // Use the measured SVG wrapper height, falling back to the passed height if provided.\n // When there's a legend (via prop or composition), we must wait for measurement because\n // the legend takes space and the svg-wrapper height will be less than the total height.\n const chartHeight = svgWrapperHeight > 0 ? svgWrapperHeight : height;\n const hasLegend = showLegend || hasLegendChild;\n const isWaitingForMeasurement = hasLegend ? svgWrapperHeight === 0 : !chartHeight;\n const [selectedIndex, setSelectedIndex] = useState(undefined);\n const [isNavigating, setIsNavigating] = useState(false);\n const totalPoints = Math.max(0, ...data.map(series => series.data?.length || 0)) * data.length;\n\n // Use the keyboard navigation hook\n const {\n tooltipRef,\n onChartFocus,\n onChartBlur,\n onChartKeyDown\n } = useKeyboardNavigation({\n selectedIndex,\n setSelectedIndex,\n isNavigating,\n setIsNavigating,\n chartRef,\n totalPoints\n });\n const {\n getElementStyles,\n isSeriesVisible\n } = useGlobalChartsContext();\n const providerTheme = useGlobalChartsTheme();\n\n // Add visibility information to series when using interactive legends\n const seriesWithVisibility = useMemo(() => {\n if (!chartId || !legendInteractive) {\n return dataWithVisibleZeros.map((series, index) => ({\n series,\n index,\n isVisible: true\n }));\n }\n return dataWithVisibleZeros.map((series, index) => ({\n series,\n index,\n isVisible: isSeriesVisible(chartId, series.label)\n }));\n }, [dataWithVisibleZeros, chartId, isSeriesVisible, legendInteractive]);\n\n // Check if all series are hidden\n const allSeriesHidden = useMemo(() => {\n return seriesWithVisibility.every(({\n isVisible\n }) => !isVisible);\n }, [seriesWithVisibility]);\n const getBarBackground = useCallback(index => () => withPatterns ? `url(#${getPatternId(chartId, index)})` : getElementStyles({\n data: dataSorted[index],\n index\n }).color, [withPatterns, getElementStyles, dataSorted, chartId]);\n const renderDefaultTooltip = useCallback(({\n tooltipData\n }) => {\n const nearestDatum = tooltipData?.nearestDatum?.datum;\n if (!nearestDatum) return null;\n return /*#__PURE__*/_jsxs(\"div\", {\n className: styles['bar-chart__tooltip'],\n children: [/*#__PURE__*/_jsx(\"div\", {\n className: styles['bar-chart__tooltip-header'],\n children: tooltipData?.nearestDatum?.key\n }), /*#__PURE__*/_jsxs(\"div\", {\n className: styles['bar-chart__tooltip-row'],\n children: [/*#__PURE__*/_jsxs(\"span\", {\n className: styles['bar-chart__tooltip-label'],\n children: [chartOptions.tooltip.labelFormatter(nearestDatum.label || (nearestDatum.date ? nearestDatum.date.getTime() : 0), 0, []), \":\"]\n }), /*#__PURE__*/_jsx(\"span\", {\n className: styles['bar-chart__tooltip-value'],\n children: formatNumber(nearestDatum.value)\n })]\n })]\n });\n }, [chartOptions.tooltip]);\n const renderPattern = useCallback((index, color) => {\n const patternType = index % 4;\n const id = getPatternId(chartId, index);\n const commonProps = {\n id,\n stroke: 'white',\n strokeWidth: 1,\n background: color\n };\n switch (patternType) {\n case 0:\n default:\n return /*#__PURE__*/_jsx(PatternLines, {\n ...commonProps,\n width: 5,\n height: 5,\n orientation: ['diagonal']\n }, id);\n case 1:\n return /*#__PURE__*/_jsx(PatternCircles, {\n ...commonProps,\n width: 6,\n height: 6,\n fill: \"white\"\n }, id);\n case 2:\n return /*#__PURE__*/_jsx(PatternWaves, {\n ...commonProps,\n width: 4,\n height: 4\n }, id);\n case 3:\n return /*#__PURE__*/_jsx(PatternHexagons, {\n ...commonProps,\n size: 8,\n height: 3\n }, id);\n }\n }, [chartId]);\n const createPatternBorderStyle = useCallback((index, color) => {\n const patternId = getPatternId(chartId, index);\n return `\n\t\t\t.visx-bar[fill=\"url(#${patternId})\"] {\n\t\t\t\tstroke: ${color};\n\t\t\t\tstroke-width: 1;\n\t\t\t\t}\n\t\t\t`;\n }, [chartId]);\n const createKeyboardHighlightStyle = useCallback(() => {\n if (selectedIndex === undefined) return '';\n\n // Calculate which bar should be highlighted based on selectedIndex\n // Pattern: [series1[0], series2[0], series3[0], series1[1], series2[1], series3[1], ...]\n const maxDataPoints = Math.max(...data.map(s => s.data.length));\n const dataPointIndex = Math.floor(selectedIndex / data.length);\n const seriesIndex = selectedIndex % data.length;\n\n // Only highlight if we're within valid bounds\n if (dataPointIndex >= maxDataPoints || seriesIndex >= data.length) {\n return '';\n }\n const seriesData = data[seriesIndex];\n if (dataPointIndex >= seriesData.data.length) {\n return '';\n }\n\n // Based on the DOM structure analysis:\n // - All bars are in a single .visx-bar-group\n // - Bars are ordered as: [series1[0], series1[1], series2[0], series2[1], ...]\n // - So we need to calculate the actual bar index in the DOM\n const actualBarIndex = seriesIndex * maxDataPoints + dataPointIndex;\n\n // Use a CSS class selector instead of ID since useId() generates invalid CSS ID characters\n const generatedStyles = `\n\t\t\t.bar-chart[data-chart-id=\"bar-chart-${chartId}\"] .visx-bar-group .visx-bar:nth-child(${actualBarIndex + 1}) {\n\t\t\t\tstroke: #005fcc;\n\t\t\t\tstroke-width: 2px;\n\t\t\t}\n\t\t`;\n return generatedStyles;\n }, [selectedIndex, data, chartId]);\n\n // Validate data first\n const error = validateData(dataSorted);\n const isDataValid = !error;\n\n // Memoize metadata to prevent unnecessary re-registration\n const chartMetadata = useMemo(() => ({\n orientation,\n withPatterns\n }), [orientation, withPatterns]);\n\n // Register chart with context only if data is valid\n useChartRegistration({\n chartId,\n legendItems,\n chartType: 'bar',\n isDataValid,\n metadata: chartMetadata\n });\n const prefersReducedMotion = usePrefersReducedMotion();\n if (error) {\n return /*#__PURE__*/_jsx(\"div\", {\n className: clsx('bar-chart', styles['bar-chart']),\n children: error\n });\n }\n const gridVisibility = gridVisibilityProp ?? chartOptions.gridVisibility;\n const highlightedBarStyle = createKeyboardHighlightStyle();\n const legendElement = showLegend && /*#__PURE__*/_jsx(Legend, {\n orientation: legendOrientation,\n position: legendPosition,\n alignment: legendAlignment,\n maxWidth: legendMaxWidth,\n textOverflow: legendTextOverflow,\n legendItemClassName: legendItemClassName,\n className: styles['bar-chart__legend'],\n shape: legendShape,\n chartId: chartId,\n interactive: legendInteractive\n });\n return /*#__PURE__*/_jsx(SingleChartContext.Provider, {\n value: {\n chartId,\n chartWidth: width,\n chartHeight\n },\n children: /*#__PURE__*/_jsxs(Stack, {\n direction: \"column\",\n gap: gap,\n className: clsx('bar-chart', styles['bar-chart'], {\n [styles[`bar-chart--animated${horizontal ? '-horizontal' : ''}`]]: animation && !prefersReducedMotion\n }, className),\n style: {\n width,\n height,\n visibility: isWaitingForMeasurement ? 'hidden' : 'visible'\n },\n \"data-chart-id\": `bar-chart-${chartId}`,\n children: [legendPosition === 'top' && legendElement, /*#__PURE__*/_jsx(\"div\", {\n className: styles['bar-chart__svg-wrapper'],\n ref: svgWrapperRef,\n role: \"grid\",\n \"aria-label\": __('Bar chart', 'jetpack-charts'),\n tabIndex: 0,\n onKeyDown: onChartKeyDown,\n onFocus: onChartFocus,\n onBlur: onChartBlur,\n children: !isWaitingForMeasurement && /*#__PURE__*/_jsx(\"div\", {\n ref: chartRef,\n children: /*#__PURE__*/_jsxs(XYChart, {\n theme: theme,\n width: width,\n height: chartHeight,\n margin: {\n ...defaultMargin,\n ...margin\n },\n xScale: chartOptions.xScale,\n yScale: chartOptions.yScale,\n horizontal: horizontal,\n pointerEventsDataKey: \"nearest\",\n children: [/*#__PURE__*/_jsx(Grid, {\n columns: gridVisibility.includes('y'),\n rows: gridVisibility.includes('x'),\n numTicks: 4\n }), withPatterns && /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(\"defs\", {\n children: dataSorted.map((seriesData, index) => renderPattern(index, getElementStyles({\n data: seriesData,\n index\n }).color))\n }), /*#__PURE__*/_jsx(\"style\", {\n children: dataSorted.map((seriesData, index) => createPatternBorderStyle(index, getElementStyles({\n data: seriesData,\n index\n }).color))\n })]\n }), highlightedBarStyle && /*#__PURE__*/_jsx(\"style\", {\n children: highlightedBarStyle\n }), allSeriesHidden ? /*#__PURE__*/_jsx(\"text\", {\n x: width / 2,\n y: chartHeight / 2,\n textAnchor: \"middle\",\n fill: providerTheme.gridStyles?.stroke || '#ccc',\n fontSize: \"14\",\n fontFamily: \"-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif\",\n children: __('All series are hidden. Click legend items to show data.', 'jetpack-charts')\n }) : null, /*#__PURE__*/_jsx(BarGroup, {\n padding: chartOptions.barGroup.padding,\n children: seriesWithVisibility.map(({\n series: seriesData,\n index,\n isVisible\n }) => {\n // Skip rendering invisible series\n if (!isVisible) {\n return null;\n }\n return /*#__PURE__*/_jsx(BarSeries, {\n dataKey: seriesData?.label,\n data: seriesData.data,\n yAccessor: chartOptions.accessors.yAccessor,\n xAccessor: chartOptions.accessors.xAccessor,\n colorAccessor: getBarBackground(index)\n }, seriesData?.label);\n })\n }), /*#__PURE__*/_jsx(Axis, {\n ...chartOptions.axis.x\n }), /*#__PURE__*/_jsx(Axis, {\n ...chartOptions.axis.y\n }), withTooltips && /*#__PURE__*/_jsx(AccessibleTooltip, {\n detectBounds: true,\n snapTooltipToDatumX: true,\n snapTooltipToDatumY: true,\n renderTooltip: renderTooltip || renderDefaultTooltip,\n selectedIndex: selectedIndex,\n tooltipRef: tooltipRef,\n keyboardFocusedClassName: styles['bar-chart__tooltip--keyboard-focused'],\n series: data,\n mode: \"individual\"\n })]\n })\n })\n }), legendPosition === 'bottom' && legendElement, children]\n })\n });\n};\nconst BarChartWithProvider = props => {\n const existingContext = useContext(GlobalChartsContext);\n\n // If we're already in a GlobalChartsProvider context, don't create a new one\n if (existingContext) {\n return /*#__PURE__*/_jsx(BarChartInternal, {\n ...props\n });\n }\n\n // Otherwise, create our own GlobalChartsProvider\n return /*#__PURE__*/_jsx(GlobalChartsProvider, {\n children: /*#__PURE__*/_jsx(BarChartInternal, {\n ...props\n })\n });\n};\nBarChartWithProvider.displayName = 'BarChart';\n\n// Create BarChart with composition API\nconst BarChart = attachSubComponents(BarChartWithProvider, {\n Legend: Legend\n});\n\n// Create responsive BarChart with composition API\nconst BarChartResponsive = attachSubComponents(withResponsive(BarChartWithProvider), {\n Legend: Legend\n});\nexport { BarChartResponsive as default, BarChart as BarChartUnresponsive };","import 'css-chunk:src/charts/bar-chart/bar-chart.module.scss';export default {\n \"bar-chart__svg-wrapper\": \"a8ccharts-9CsqC0\",\n \"bar-chart\": \"a8ccharts-3gflnB\",\n \"bar-chart--animated\": \"a8ccharts-98W-yu\",\n \"rise\": \"a8ccharts-z6AsiQ\",\n \"bar-chart--animated-horizontal\": \"a8ccharts-HFA3FF\",\n \"stretch\": \"a8ccharts-DQp37O\"\n};","import { formatNumberCompact } from '@automattic/number-formatters';\nimport { useMemo } from 'react';\nimport { TruncatedXTickComponent, TruncatedYTickComponent } from './truncated-tick-component';\nimport type { EnhancedDataPoint } from '../../../hooks/use-zero-value-display';\nimport type { DataPointDate, BaseChartProps, SeriesData } from '../../../types';\nimport type { TickFormatter } from '@visx/axis';\n\nconst formatDateTick = ( timestamp: number ) => {\n\tconst date = new Date( timestamp );\n\treturn date.toLocaleDateString( undefined, {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t} );\n};\n\n/**\n * Get the group padding of a scale.\n *\n * @param scale - The scale to get the group padding of.\n * @return The group padding of the scale.\n */\nconst getGroupPadding = ( scale: Record< string, unknown > ): number => {\n\treturn typeof scale.paddingInner === 'number' ? ( scale.paddingInner as number ) : 0;\n};\n\n/**\n * Returns the merged options for the bar chart, including axis and scale configuration based on the orientation.\n *\n * @param data - The data to be displayed in the chart.\n * @param horizontal - Whether the chart is horizontal or vertical.\n * @param options - The options for the chart.\n * @return The merged options for the chart.\n */\nexport function useBarChartOptions(\n\tdata: SeriesData[],\n\thorizontal: boolean,\n\toptions: BaseChartProps[ 'options' ] = {}\n) {\n\tconst defaultOptions = useMemo( () => {\n\t\tconst bandScale = {\n\t\t\ttype: 'band' as const,\n\t\t\tpadding: 0.2,\n\t\t\tpaddingInner: 0.1,\n\t\t};\n\t\tconst linearScale = {\n\t\t\ttype: 'linear' as const,\n\t\t\tnice: true,\n\t\t\tzero: false,\n\t\t};\n\n\t\tconst labelFormatter = data?.[ 0 ]?.data?.[ 0 ]?.label\n\t\t\t? ( label: string ) => label\n\t\t\t: formatDateTick;\n\t\tconst valueFormatter = formatNumberCompact as TickFormatter< unknown >;\n\n\t\tconst labelAccessor = ( d: DataPointDate ) => d?.label || d?.date;\n\t\tconst valueAccessor = ( d: DataPointDate | EnhancedDataPoint ) => {\n\t\t\t// Use visualValue for bar rendering if available (for zero values), otherwise use value\n\t\t\tconst enhancedPoint = d as EnhancedDataPoint;\n\t\t\treturn enhancedPoint?.visualValue !== undefined ? enhancedPoint.visualValue : d?.value;\n\t\t};\n\n\t\treturn {\n\t\t\tvertical: {\n\t\t\t\txTickFormat: labelFormatter,\n\t\t\t\tyTickFormat: valueFormatter,\n\t\t\t\ttooltipLabelFormatter: labelFormatter,\n\t\t\t\txAccessor: labelAccessor,\n\t\t\t\tyAccessor: valueAccessor,\n\t\t\t\tgridVisibility: 'x',\n\t\t\t\txScale: bandScale,\n\t\t\t\tyScale: linearScale,\n\t\t\t},\n\t\t\thorizontal: {\n\t\t\t\txTickFormat: valueFormatter,\n\t\t\t\tyTickFormat: labelFormatter,\n\t\t\t\ttooltipLabelFormatter: labelFormatter,\n\t\t\t\txAccessor: valueAccessor,\n\t\t\t\tyAccessor: labelAccessor,\n\t\t\t\tgridVisibility: 'y',\n\t\t\t\txScale: linearScale,\n\t\t\t\tyScale: bandScale,\n\t\t\t},\n\t\t};\n\t}, [ data ] );\n\n\treturn useMemo( () => {\n\t\tconst orientationKey = horizontal ? 'horizontal' : 'vertical';\n\t\tconst {\n\t\t\txTickFormat,\n\t\t\tyTickFormat,\n\t\t\ttooltipLabelFormatter: defaultTooltipLabelFormatter,\n\t\t\txAccessor,\n\t\t\tyAccessor,\n\t\t\tgridVisibility,\n\t\t\txScale: baseXScale,\n\t\t\tyScale: baseYScale,\n\t\t} = defaultOptions[ orientationKey ];\n\n\t\tconst xScale = { ...baseXScale, ...( options.xScale || {} ) };\n\t\tconst yScale = { ...baseYScale, ...( options.yScale || {} ) };\n\t\tconst providedToolTipLabelFormatter = horizontal\n\t\t\t? options.axis?.y?.tickFormat\n\t\t\t: options.axis?.x?.tickFormat;\n\n\t\tconst { labelOverflow: xLabelOverflow, ...xAxisOptions } = options.axis?.x || {};\n\t\tconst { labelOverflow: yLabelOverflow, ...yAxisOptions } = options.axis?.y || {};\n\n\t\treturn {\n\t\t\tgridVisibility,\n\t\t\txScale,\n\t\t\tyScale,\n\t\t\taccessors: {\n\t\t\t\txAccessor,\n\t\t\t\tyAccessor,\n\t\t\t},\n\t\t\taxis: {\n\t\t\t\tx: {\n\t\t\t\t\torientation: 'bottom' as const,\n\t\t\t\t\tnumTicks: 4,\n\t\t\t\t\ttickFormat: xTickFormat,\n\t\t\t\t\t...( xLabelOverflow === 'ellipsis' ? { tickComponent: TruncatedXTickComponent } : {} ),\n\t\t\t\t\t...xAxisOptions,\n\t\t\t\t},\n\t\t\t\ty: {\n\t\t\t\t\torientation: 'left' as const,\n\t\t\t\t\tnumTicks: 4,\n\t\t\t\t\ttickFormat: yTickFormat,\n\t\t\t\t\t...( yLabelOverflow === 'ellipsis' ? { tickComponent: TruncatedYTickComponent } : {} ),\n\t\t\t\t\t...yAxisOptions,\n\t\t\t\t},\n\t\t\t},\n\t\t\tbarGroup: {\n\t\t\t\tpadding: getGroupPadding( horizontal ? yScale : xScale ),\n\t\t\t},\n\t\t\ttooltip: {\n\t\t\t\tlabelFormatter: providedToolTipLabelFormatter || defaultTooltipLabelFormatter,\n\t\t\t},\n\t\t};\n\t}, [ defaultOptions, options, horizontal ] );\n}\n","import { DataContext } from '@visx/xychart';\nimport { useContext } from 'react';\nimport { isSafari } from '../../../utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Get the bandwidth of a scale\n *\n * @param scale - The scale to get the bandwidth of\n * @return The bandwidth of the scale\n */\nconst getScaleBandwidth = scale => {\n return scale && 'bandwidth' in scale ? scale.bandwidth() ?? 0 : 0;\n};\n/**\n * Minimum width in pixels for tick labels when scale bandwidth is very small.\n * Prevents labels from collapsing to unreadable widths on dense charts.\n *\n * Trade-off: When bandwidth is less than this minimum (e.g., many bars in a narrow chart),\n * adjacent labels may overlap since each label uses this minimum width regardless of\n * available space. This prioritizes label readability over preventing overlap.\n *\n * For very dense charts where overlap occurs, consider:\n * - Using `numTicks` option to reduce the number of displayed labels\n * - Using `tickFormat` to abbreviate label text\n * - Increasing chart width or reducing data points\n */\nconst MIN_TICK_LABEL_WIDTH = 20;\n\n/**\n * A tick component that renders labels with text truncation (ellipsis) when they exceed\n * the available bandwidth. Shows the full text on hover via native title attribute.\n *\n * Uses foreignObject to embed HTML within SVG, enabling CSS text-overflow: ellipsis.\n * Inherits text styles from tickLabelProps passed by visx Axis component.\n *\n * Note: A minimum label width (MIN_TICK_LABEL_WIDTH) is enforced to keep labels readable.\n * On very dense charts where bandwidth < 20px, this may cause label overlap.\n * See MIN_TICK_LABEL_WIDTH documentation for mitigation strategies.\n *\n * @param props - The props for the truncated tick component\n * @param props.x - The x position of the tick\n * @param props.y - The y position of the tick\n * @param props.formattedValue - The formatted value of the tick\n * @param props.axis - The axis this tick belongs to\n * @param props.textAnchor - The text anchor of the tick\n * @param props.fill - The fill color of the tick\n * @param props.dy - The dy offset of the tick\n *\n * @return The truncated tick component\n */\nexport const TruncatedTickComponent = ({\n x,\n y,\n formattedValue,\n axis,\n textAnchor,\n fill,\n dy,\n ...textProps\n}) => {\n // Get max width of the tick label\n const {\n xScale,\n yScale\n } = useContext(DataContext) || {};\n const scale = axis === 'x' ? xScale : yScale;\n const bandwidth = getScaleBandwidth(scale);\n const maxWidth = Math.max(bandwidth, MIN_TICK_LABEL_WIDTH);\n\n // Map SVG textAnchor to CSS textAlign\n let textAlign = 'center';\n if (textAnchor === 'start') {\n textAlign = 'left';\n } else if (textAnchor === 'end') {\n textAlign = 'right';\n } else if (textAnchor === 'middle') {\n textAlign = 'center';\n }\n\n // Calculate x offset based on text alignment\n let xOffset = 0;\n if (textAlign === 'center') {\n xOffset = -maxWidth / 2;\n } else if (textAlign === 'right') {\n xOffset = -maxWidth;\n }\n\n // Extract compatible style properties from SVG text props\n const {\n fontSize,\n fontFamily,\n fontWeight,\n fontStyle,\n letterSpacing,\n opacity\n } = textProps;\n const textStyles = {\n /**\n * SVG <text> elements are vertically aligned to the baseline by default, but HTML <div> elements inside <foreignObject>\n * are positioned relative to the top-left corner. To visually align the tick label like SVG text,\n * we shift the div up by 100% of its height and adjust by twice the SVG dy value (from visx) to approximate original placement.\n */\n transform: `translateY(calc(-100% + ${dy ?? '0'} * 2))`,\n // Safari doesn't work well with foreignObject positioning. Use position: fixed as a workaround.\n ...(isSafari() ? {\n position: 'fixed'\n } : {}),\n // Apply compatible SVG text styles\n fontSize,\n fontFamily,\n fontWeight,\n fontStyle,\n letterSpacing,\n opacity,\n // Convert svg text styles to CSS styles for the div\n color: fill ?? 'inherit',\n textAlign,\n // Ensure text is truncated with ellipsis, remains on one line, and shows the full value in a tooltip on hover.\n // The surrounding div uses CSS to handle overflow, and the 'title' attribute is set for accessibility.\n width: maxWidth,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n cursor: 'default',\n pointerEvents: 'auto'\n };\n return /*#__PURE__*/_jsx(\"foreignObject\", {\n x: x + xOffset,\n y: y,\n width: maxWidth,\n height: 0,\n overflow: \"visible\",\n children: /*#__PURE__*/_jsx(\"div\", {\n style: textStyles,\n title: formattedValue,\n children: formattedValue\n })\n });\n};\n\n/**\n * Factory function to create a truncated tick component for a specific axis.\n * Returns a component that can be passed to visx's tickComponent prop.\n *\n * @param axis - The axis this tick component is for ('x' or 'y')\n * @return A tick component function compatible with visx's TickRendererProps\n */\nconst createTruncatedTickComponent = axis => props => {\n return /*#__PURE__*/_jsx(TruncatedTickComponent, {\n ...props,\n axis: axis\n });\n};\n\n/**\n * Pre-created tick components for x and y axes.\n * These functions are created once at module initialization and reused,\n * avoiding repeated factory calls when configuring axes.\n */\nexport const TruncatedXTickComponent = createTruncatedTickComponent('x');\nexport const TruncatedYTickComponent = createTruncatedTickComponent('y');"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,cAAc,gBAAgB,cAAc,uBAAuB;AAC5E,SAAS,MAAM,WAAW,UAAU,MAAM,eAAe;AACzD,SAAS,UAAU;AAEnB,OAAO,UAAU;AACjB,SAAS,aAAa,cAAAA,aAAY,UAAU,QAAQ,WAAAC,gBAAe;;;ACNL,IAAO,2BAAQ;AAAA,EAC3E,0BAA0B;AAAA,EAC1B,aAAa;AAAA,EACb,uBAAuB;AAAA,EACvB,QAAQ;AAAA,EACR,kCAAkC;AAAA,EAClC,WAAW;AACb;;;ACPA,SAAS,2BAA2B;AACpC,SAAS,eAAe;;;ACDxB,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAE3B,SAAS,OAAO,YAAY;AAO5B,IAAM,oBAAoB,WAAS;AACjC,SAAO,SAAS,eAAe,QAAQ,MAAM,UAAU,KAAK,IAAI;AAClE;AAcA,IAAM,uBAAuB;AAwBtB,IAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AAEJ,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,IAAI,WAAW,WAAW,KAAK,CAAC;AAChC,QAAM,QAAQ,SAAS,MAAM,SAAS;AACtC,QAAM,YAAY,kBAAkB,KAAK;AACzC,QAAM,WAAW,KAAK,IAAI,WAAW,oBAAoB;AAGzD,MAAI,YAAY;AAChB,MAAI,eAAe,SAAS;AAC1B,gBAAY;AAAA,EACd,WAAW,eAAe,OAAO;AAC/B,gBAAY;AAAA,EACd,WAAW,e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AAkB;AAAA,MAC5C,GAAG;AAAA,IACL,CAAC;AAAA,EACH,CAAC;AACH;AACA,qBAAqB,cAAc;AAGnC,IAAM,WAAW,oBAAoB,sBAAsB;AAAA,EACzD;AACF,CAAC;AAGD,IAAM,qBAAqB,oBAAoB,eAAe,oBAAoB,GAAG;AAAA,EACnF;AACF,CAAC;","names":["useContext","useMemo","_jsx","useMemo","useContext"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../../node_modules/.pnpm/@wordpress+element@6.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../../node_modules/.pnpm/@wordpress+element@6.40.0/node_modules/@wordpress/element/build-module/react.mjs
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -48,4 +48,4 @@ var _react = require('react');
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
exports.Children = _react.Children; exports.cloneElement = _react.cloneElement; exports.createContext = _react.createContext; exports.createElement = _react.createElement; exports.forwardRef = _react.forwardRef; exports.Fragment = _react.Fragment; exports.isValidElement = _react.isValidElement; exports.memo = _react.memo; exports.useCallback = _react.useCallback; exports.useContext = _react.useContext; exports.useEffect = _react.useEffect; exports.useMemo = _react.useMemo; exports.useRef = _react.useRef; exports.useState = _react.useState;
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-SUDERBUA.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-SUDERBUA.cjs","../../../../node_modules/.pnpm/@wordpress+element@6.40.0/node_modules/@wordpress/element/src/react.ts"],"names":[],"mappings":"AAAA;ACIA;AACC;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;ADFD,8BCGO;ADFP;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,iiBAAC","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-SUDERBUA.cjs","sourcesContent":[null,"/**\n * External dependencies\n */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nimport {\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tPureComponent,\n\tStrictMode,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseDeferredValue,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\tuseImperativeHandle,\n\tuseInsertionEffect,\n\tuseLayoutEffect,\n\tuseReducer,\n\tuseRef,\n\tuseState,\n\tuseSyncExternalStore,\n\tuseTransition,\n\tstartTransition,\n\tlazy,\n\tSuspense,\n} from 'react';\nimport type { ReactNode } from 'react';\n\n/**\n * Object containing a React element.\n */\nexport type Element = React.ReactElement;\n\n/**\n * Object containing a React component.\n */\nexport type ComponentType< T = any > = React.ComponentType< T >;\n\n/**\n * Object containing a React synthetic event.\n */\nexport type SyntheticEvent< T = Element > = React.SyntheticEvent< T >;\n\n/**\n * Object containing a React ref object.\n */\nexport type RefObject< T > = React.RefObject< T >;\n\n/**\n * Object containing a React ref callback.\n */\nexport type RefCallback< T > = React.RefCallback< T >;\n\n/**\n * Object containing a React ref.\n */\nexport type Ref< T > = React.Ref< T >;\n\n/**\n * Object that provides utilities for dealing with React children.\n */\nexport { Children };\n\n/**\n * Creates a copy of an element with extended props.\n *\n * @param {Element} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {Element} Cloned element.\n */\nexport { cloneElement };\n\n/**\n * A base class to create WordPress Components (Refs, state and lifecycle hooks)\n */\nexport { Component };\n\n/**\n * Creates a context object containing two components: a provider and consumer.\n *\n * @param {Object} defaultValue A default data stored in the context.\n *\n * @return {Object} Context object.\n */\nexport { createContext };\n\n/**\n * Returns a new element of given type. Type can be either a string tag name or\n * another function which itself returns an element.\n *\n * @param {?(string|Function)} type Tag name or element creator\n * @param {Object} props Element properties, either attribute\n * set to apply to DOM node or values to\n * pass through to element creator\n * @param {...Element} children Descendant elements\n *\n * @return {Element} Element.\n */\nexport { createElement };\n\n/**\n * Returns an object tracking a reference to a rendered element via its\n * `current` property as either a DOMElement or Element, dependent upon the\n * type of element rendered with the ref attribute.\n *\n * @return {Object} Ref object.\n */\nexport { createRef };\n\n/**\n * Component enhancer used to enable passing a ref to its wrapped component.\n * Pass a function argument which receives `props` and `ref` as its arguments,\n * returning an element using the forwarded ref. The return value is a new\n * component which forwards its ref.\n *\n * @param {Function} forwarder Function passed `props` and `ref`, expected to\n * return an element.\n *\n * @return {Component} Enhanced component.\n */\nexport { forwardRef };\n\n/**\n * A component which renders its children without any wrapping element.\n */\nexport { Fragment };\n\n/**\n * Checks if an object is a valid React Element.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid React Element and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://react.dev/reference/react/memo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://react.dev/reference/react/useCallback\n */\nexport { useCallback };\n\n/**\n * @see https://react.dev/reference/react/useContext\n */\nexport { useContext };\n\n/**\n * @see https://react.dev/reference/react/useDebugValue\n */\nexport { useDebugValue };\n\n/**\n * @see https://react.dev/reference/react/useDeferredValue\n */\nexport { useDeferredValue };\n\n/**\n * @see https://react.dev/reference/react/useEffect\n */\nexport { useEffect };\n\n/**\n * @see https://react.dev/reference/react/useId\n */\nexport { useId };\n\n/**\n * @see https://react.dev/reference/react/useImperativeHandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://react.dev/reference/react/useInsertionEffect\n */\nexport { useInsertionEffect };\n\n/**\n * @see https://react.dev/reference/react/useLayoutEffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://react.dev/reference/react/useMemo\n */\nexport { useMemo };\n\n/**\n * @see https://react.dev/reference/react/useReducer\n */\nexport { useReducer };\n\n/**\n * @see https://react.dev/reference/react/useRef\n */\nexport { useRef };\n\n/**\n * @see https://react.dev/reference/react/useState\n */\nexport { useState };\n\n/**\n * @see https://react.dev/reference/react/useSyncExternalStore\n */\nexport { useSyncExternalStore };\n\n/**\n * @see https://react.dev/reference/react/useTransition\n */\nexport { useTransition };\n\n/**\n * @see https://react.dev/reference/react/startTransition\n */\nexport { startTransition };\n\n/**\n * @see https://react.dev/reference/react/lazy\n */\nexport { lazy };\n\n/**\n * @see https://react.dev/reference/react/Suspense\n */\nexport { Suspense };\n\n/**\n * @see https://react.dev/reference/react/PureComponent\n */\nexport { PureComponent };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param childrenArguments - Array of children arguments (array of arrays/strings/objects) to concatenate.\n * @return The concatenated value.\n */\nexport function concatChildren(\n\t...childrenArguments: ReactNode[][]\n): ReactNode[] {\n\treturn childrenArguments.reduce< ReactNode[] >(\n\t\t( accumulator, children, i ) => {\n\t\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\t\tif ( isValidElement( child ) && typeof child !== 'string' ) {\n\t\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\taccumulator.push( child );\n\t\t\t} );\n\n\t\t\treturn accumulator;\n\t\t},\n\t\t[]\n\t);\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param children Children object.\n * @param nodeName Node name.\n *\n * @return The updated children object.\n */\nexport function switchChildrenNodeName(\n\tchildren: ReactNode,\n\tnodeName: string\n): ReactNode {\n\treturn (\n\t\tchildren &&\n\t\tChildren.map( children, ( elt, index ) => {\n\t\t\tif ( typeof elt?.valueOf() === 'string' ) {\n\t\t\t\treturn createElement( nodeName, { key: index }, elt );\n\t\t\t}\n\t\t\tif ( ! isValidElement( elt ) ) {\n\t\t\t\treturn elt;\n\t\t\t}\n\n\t\t\tconst { children: childrenProp, ...props } = elt.props;\n\t\t\treturn createElement(\n\t\t\t\tnodeName,\n\t\t\t\t{ key: index, ...props },\n\t\t\t\tchildrenProp\n\t\t\t);\n\t\t} )\n\t);\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSUDERBUAcjs = require('./chunk-SUDERBUA.cjs');
|
|
4
4
|
|
|
5
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
5
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useRefWithInit.js
|
|
6
6
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
|
|
7
7
|
var UNINITIALIZED = {};
|
|
8
8
|
function useRefWithInit(init, initArg) {
|
|
@@ -13,7 +13,7 @@ function useRefWithInit(init, initArg) {
|
|
|
13
13
|
return ref;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
16
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/formatErrorMessage.js
|
|
17
17
|
function formatErrorMessage(code, ...args) {
|
|
18
18
|
const url = new URL("https://base-ui.com/production-error");
|
|
19
19
|
url.searchParams.set("code", code.toString());
|
|
@@ -21,10 +21,10 @@ function formatErrorMessage(code, ...args) {
|
|
|
21
21
|
return `Base UI error #${code}; visit ${url} for the full message.`;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
24
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useRenderElement.js
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
27
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useMergedRefs.js
|
|
28
28
|
function useMergedRefs(a, b, c, d) {
|
|
29
29
|
const forkRef = useRefWithInit(createForkRef).current;
|
|
30
30
|
if (didChange(forkRef, a, b, c, d)) {
|
|
@@ -113,17 +113,17 @@ function update(forkRef, refs) {
|
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
116
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/getReactElementRef.js
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
119
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/reactVersion.js
|
|
120
120
|
|
|
121
121
|
var majorVersion = parseInt(React2.version, 10);
|
|
122
122
|
function isReactVersionAtLeast(reactVersionToCheck) {
|
|
123
123
|
return majorVersion >= reactVersionToCheck;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
126
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/getReactElementRef.js
|
|
127
127
|
function getReactElementRef(element) {
|
|
128
128
|
if (!/* @__PURE__ */ React3.isValidElement(element)) {
|
|
129
129
|
return null;
|
|
@@ -133,7 +133,7 @@ function getReactElementRef(element) {
|
|
|
133
133
|
return _nullishCoalesce((isReactVersionAtLeast(19) ? _optionalChain([propsWithRef, 'optionalAccess', _ => _.ref]) : reactElement.ref), () => ( null));
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
136
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/mergeObjects.js
|
|
137
137
|
function mergeObjects(a, b) {
|
|
138
138
|
if (a && !b) {
|
|
139
139
|
return a;
|
|
@@ -150,7 +150,7 @@ function mergeObjects(a, b) {
|
|
|
150
150
|
return void 0;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
153
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/getStateAttributesProps.js
|
|
154
154
|
function getStateAttributesProps(state, customMapping) {
|
|
155
155
|
const props = {};
|
|
156
156
|
for (const key in state) {
|
|
@@ -171,17 +171,17 @@ function getStateAttributesProps(state, customMapping) {
|
|
|
171
171
|
return props;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
174
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveClassName.js
|
|
175
175
|
function resolveClassName(className, state) {
|
|
176
176
|
return typeof className === "function" ? className(state) : className;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
179
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveStyle.js
|
|
180
180
|
function resolveStyle(style, state) {
|
|
181
181
|
return typeof style === "function" ? style(state) : style;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
184
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/merge-props/mergeProps.js
|
|
185
185
|
var EMPTY_PROPS = {};
|
|
186
186
|
function mergeProps(a, b, c, d, e) {
|
|
187
187
|
let merged = {
|
|
@@ -304,11 +304,11 @@ function isSyntheticEvent(event) {
|
|
|
304
304
|
return event != null && typeof event === "object" && "nativeEvent" in event;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
307
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/empty.js
|
|
308
308
|
var EMPTY_ARRAY = Object.freeze([]);
|
|
309
309
|
var EMPTY_OBJECT = Object.freeze({});
|
|
310
310
|
|
|
311
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
311
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useRenderElement.js
|
|
312
312
|
|
|
313
313
|
function useRenderElement(element, componentProps, params = {}) {
|
|
314
314
|
const renderProp = componentProps.render;
|
|
@@ -390,12 +390,12 @@ function renderTag(Tag, props) {
|
|
|
390
390
|
return /* @__PURE__ */ React4.createElement(Tag, props);
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
393
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/use-render/useRender.js
|
|
394
394
|
function useRender(params) {
|
|
395
395
|
return useRenderElement(_nullishCoalesce(params.defaultTagName, () => ( "div")), params, params);
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
-
// ../../../node_modules/.pnpm/@wordpress+ui@0.
|
|
398
|
+
// ../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/stack/stack.mjs
|
|
399
399
|
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='71d20935c2']")) {
|
|
400
400
|
const style = document.createElement("style");
|
|
401
401
|
style.setAttribute("data-wp-hash", "71d20935c2");
|
|
@@ -403,7 +403,7 @@ if (typeof document !== "undefined" && !document.head.querySelector("style[data-
|
|
|
403
403
|
document.head.appendChild(style);
|
|
404
404
|
}
|
|
405
405
|
var style_default = { "stack": "_19ce0419607e1896__stack" };
|
|
406
|
-
var Stack =
|
|
406
|
+
var Stack = _chunkSUDERBUAcjs.forwardRef.call(void 0, function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
|
|
407
407
|
const style = {
|
|
408
408
|
gap: gap && `var(--wpds-dimension-gap-${gap})`,
|
|
409
409
|
alignItems: align,
|
|
@@ -422,4 +422,4 @@ var Stack = _chunkI5467ZJ5cjs.forwardRef.call(void 0, function Stack2({ directio
|
|
|
422
422
|
|
|
423
423
|
|
|
424
424
|
exports.Stack = Stack;
|
|
425
|
-
//# sourceMappingURL=chunk-
|
|
425
|
+
//# sourceMappingURL=chunk-UFRBUT2D.cjs.map
|