@automattic/charts 0.56.7 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +28 -98
- package/CHANGELOG.md +30 -0
- package/dist/charts/bar-chart/index.cjs +7 -6
- package/dist/charts/bar-chart/index.cjs.map +1 -1
- package/dist/charts/bar-chart/index.css +12 -24
- package/dist/charts/bar-chart/index.css.map +1 -1
- package/dist/charts/bar-chart/index.d.cts +3 -4
- package/dist/charts/bar-chart/index.d.ts +3 -4
- package/dist/charts/bar-chart/index.js +6 -5
- package/dist/charts/bar-list-chart/index.cjs +8 -7
- package/dist/charts/bar-list-chart/index.cjs.map +1 -1
- package/dist/charts/bar-list-chart/index.css +12 -24
- package/dist/charts/bar-list-chart/index.css.map +1 -1
- package/dist/charts/bar-list-chart/index.d.cts +3 -3
- package/dist/charts/bar-list-chart/index.d.ts +3 -3
- package/dist/charts/bar-list-chart/index.js +7 -6
- package/dist/charts/conversion-funnel-chart/index.cjs +5 -6
- package/dist/charts/conversion-funnel-chart/index.cjs.map +1 -1
- package/dist/charts/conversion-funnel-chart/index.css +0 -94
- package/dist/charts/conversion-funnel-chart/index.css.map +1 -1
- package/dist/charts/conversion-funnel-chart/index.d.cts +1 -1
- package/dist/charts/conversion-funnel-chart/index.d.ts +1 -1
- package/dist/charts/conversion-funnel-chart/index.js +4 -5
- package/dist/charts/geo-chart/index.cjs +4 -4
- package/dist/charts/geo-chart/index.css +0 -94
- package/dist/charts/geo-chart/index.css.map +1 -1
- package/dist/charts/geo-chart/index.d.cts +1 -1
- package/dist/charts/geo-chart/index.d.ts +1 -1
- package/dist/charts/geo-chart/index.js +3 -3
- package/dist/charts/leaderboard-chart/index.cjs +7 -6
- package/dist/charts/leaderboard-chart/index.cjs.map +1 -1
- package/dist/charts/leaderboard-chart/index.css +20 -33
- package/dist/charts/leaderboard-chart/index.css.map +1 -1
- package/dist/charts/leaderboard-chart/index.d.cts +3 -3
- package/dist/charts/leaderboard-chart/index.d.ts +3 -3
- package/dist/charts/leaderboard-chart/index.js +6 -5
- package/dist/charts/line-chart/index.cjs +7 -6
- package/dist/charts/line-chart/index.cjs.map +1 -1
- package/dist/charts/line-chart/index.css +12 -24
- package/dist/charts/line-chart/index.css.map +1 -1
- package/dist/charts/line-chart/index.d.cts +3 -4
- package/dist/charts/line-chart/index.d.ts +3 -4
- package/dist/charts/line-chart/index.js +6 -5
- package/dist/charts/pie-chart/index.cjs +7 -7
- package/dist/charts/pie-chart/index.css +12 -24
- package/dist/charts/pie-chart/index.css.map +1 -1
- package/dist/charts/pie-chart/index.d.cts +7 -13
- package/dist/charts/pie-chart/index.d.ts +7 -13
- package/dist/charts/pie-chart/index.js +6 -6
- package/dist/charts/pie-semi-circle-chart/index.cjs +7 -7
- package/dist/charts/pie-semi-circle-chart/index.css +12 -24
- package/dist/charts/pie-semi-circle-chart/index.css.map +1 -1
- package/dist/charts/pie-semi-circle-chart/index.d.cts +7 -13
- package/dist/charts/pie-semi-circle-chart/index.d.ts +7 -13
- package/dist/charts/pie-semi-circle-chart/index.js +6 -6
- package/dist/charts/sparkline/index.cjs +8 -7
- package/dist/charts/sparkline/index.cjs.map +1 -1
- package/dist/charts/sparkline/index.css +12 -24
- package/dist/charts/sparkline/index.css.map +1 -1
- package/dist/charts/sparkline/index.js +7 -6
- package/dist/{chunk-RFSHE3HL.js → chunk-2I67QUIV.js} +84 -431
- package/dist/chunk-2I67QUIV.js.map +1 -0
- package/dist/{chunk-OMS5QIJN.js → chunk-2ICEEQOC.js} +31 -25
- package/dist/chunk-2ICEEQOC.js.map +1 -0
- package/dist/{chunk-GWBS65VC.js → chunk-4B7BL2DD.js} +3 -3
- package/dist/{chunk-7FDQGBY7.js → chunk-4OXMTKAL.js} +24 -24
- package/dist/chunk-4OXMTKAL.js.map +1 -0
- package/dist/{chunk-SSFFCBCF.js → chunk-B6NLZFRW.js} +32 -26
- package/dist/chunk-B6NLZFRW.js.map +1 -0
- package/dist/{chunk-3EXJP67N.cjs → chunk-BBAUQOW6.cjs} +9 -9
- package/dist/{chunk-3EXJP67N.cjs.map → chunk-BBAUQOW6.cjs.map} +1 -1
- package/dist/{chunk-NQJE2CC7.cjs → chunk-CMMHCTBX.cjs} +45 -45
- package/dist/chunk-CMMHCTBX.cjs.map +1 -0
- package/dist/{chunk-O2JIANHK.cjs → chunk-CPPXJATQ.cjs} +51 -45
- package/dist/chunk-CPPXJATQ.cjs.map +1 -0
- package/dist/{chunk-MDRCAGKZ.js → chunk-DKU775VC.js} +3 -3
- package/dist/{chunk-BXFD7JIG.cjs → chunk-GRA7Y2ZG.cjs} +46 -46
- package/dist/chunk-GRA7Y2ZG.cjs.map +1 -0
- package/dist/{chunk-TE63Y5PX.js → chunk-JJIMABHT.js} +10 -3
- package/dist/chunk-JJIMABHT.js.map +1 -0
- package/dist/{chunk-KHQPN77E.js → chunk-KJHWXOCZ.js} +4 -4
- package/dist/{chunk-6CCZL2JJ.js → chunk-KRWGSOJ2.js} +30 -2
- package/dist/chunk-KRWGSOJ2.js.map +1 -0
- package/dist/{chunk-VPAEBI2F.js → chunk-LTFH7SEG.js} +24 -24
- package/dist/chunk-LTFH7SEG.js.map +1 -0
- package/dist/{chunk-E62LCBGD.js → chunk-MUNOKLLE.js} +3 -3
- package/dist/{chunk-ZVGEDXDP.cjs → chunk-MXGLYWVP.cjs} +10 -3
- package/dist/chunk-MXGLYWVP.cjs.map +1 -0
- package/dist/{chunk-55ZCOYDF.cjs → chunk-OYC34VTO.cjs} +252 -827
- package/dist/chunk-OYC34VTO.cjs.map +1 -0
- package/dist/{chunk-CAFJRZPZ.cjs → chunk-PQL5I3F6.cjs} +17 -17
- package/dist/{chunk-CAFJRZPZ.cjs.map → chunk-PQL5I3F6.cjs.map} +1 -1
- package/dist/{chunk-UFRBUT2D.cjs → chunk-REZTQ4PH.cjs} +87 -24
- package/dist/chunk-REZTQ4PH.cjs.map +1 -0
- package/dist/{chunk-RCY6XLGU.cjs → chunk-TZRUHQOH.cjs} +36 -8
- package/dist/chunk-TZRUHQOH.cjs.map +1 -0
- package/dist/{chunk-XD2HV7M5.js → chunk-UTYVIOWZ.js} +226 -801
- package/dist/chunk-UTYVIOWZ.js.map +1 -0
- package/dist/{chunk-YAXY5L7I.cjs → chunk-W2LDIX26.cjs} +5 -5
- package/dist/{chunk-YAXY5L7I.cjs.map → chunk-W2LDIX26.cjs.map} +1 -1
- package/dist/{chunk-K6TGILHX.cjs → chunk-WSG64BVN.cjs} +6 -6
- package/dist/{chunk-K6TGILHX.cjs.map → chunk-WSG64BVN.cjs.map} +1 -1
- package/dist/chunk-WTQYGUNF.js +400 -0
- package/dist/chunk-WTQYGUNF.js.map +1 -0
- package/dist/{chunk-YDVHT7GS.cjs → chunk-WYK7EL5R.cjs} +100 -447
- package/dist/chunk-WYK7EL5R.cjs.map +1 -0
- package/dist/{chunk-X7JL2NYJ.cjs → chunk-XC4KHJYX.cjs} +51 -45
- package/dist/chunk-XC4KHJYX.cjs.map +1 -0
- package/dist/chunk-XVBH5XHE.cjs +400 -0
- package/dist/chunk-XVBH5XHE.cjs.map +1 -0
- package/dist/{chunk-IS5YYLTV.js → chunk-YAFQVVDI.js} +85 -22
- package/dist/chunk-YAFQVVDI.js.map +1 -0
- package/dist/components/legend/index.cjs +4 -3
- package/dist/components/legend/index.cjs.map +1 -1
- package/dist/components/legend/index.css +12 -24
- package/dist/components/legend/index.css.map +1 -1
- package/dist/components/legend/index.d.cts +4 -4
- package/dist/components/legend/index.d.ts +4 -4
- package/dist/components/legend/index.js +3 -2
- package/dist/components/tooltip/index.d.cts +1 -1
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/hooks/index.cjs +3 -5
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.css +0 -94
- package/dist/hooks/index.css.map +1 -1
- package/dist/hooks/index.d.cts +9 -13
- package/dist/hooks/index.d.ts +9 -13
- package/dist/hooks/index.js +2 -4
- package/dist/index.cjs +18 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +20 -33
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +17 -16
- package/dist/{leaderboard-chart-COtgamhe.d.cts → leaderboard-chart-BSbg0ufV.d.cts} +3 -11
- package/dist/{leaderboard-chart-BSgEw_Um.d.ts → leaderboard-chart-odEYxxEC.d.ts} +3 -11
- package/dist/{legend-C9ahiwOt.d.cts → legend-DFkosEvC.d.cts} +1 -1
- package/dist/{legend-jjMmhSg3.d.ts → legend-DLswHhOk.d.ts} +1 -1
- package/dist/providers/index.cjs +3 -3
- package/dist/providers/index.css +0 -94
- package/dist/providers/index.css.map +1 -1
- package/dist/providers/index.d.cts +3 -3
- package/dist/providers/index.d.ts +3 -3
- package/dist/providers/index.js +2 -2
- package/dist/{themes-CVR5rmIs.d.cts → themes-D0qc5JaW.d.cts} +2 -2
- package/dist/{themes-DQzmaSze.d.ts → themes-itO4Ht5g.d.ts} +2 -2
- package/dist/{types-BBwg4Evw.d.cts → types-B5f6XQ7Q.d.cts} +1 -1
- package/dist/{types-DQNnq5Fr.d.ts → types-BsHooDbM.d.ts} +1 -1
- package/dist/{types-C05PdDJa.d.cts → types-BuSrRM4p.d.ts} +15 -23
- package/dist/{types-CzdN7rUe.d.cts → types-ChOUI9-N.d.cts} +90 -46
- package/dist/{types-CzdN7rUe.d.ts → types-ChOUI9-N.d.ts} +90 -46
- package/dist/{types-C05PdDJa.d.ts → types-Dfw9VOKI.d.cts} +15 -23
- package/dist/utils/index.cjs +2 -2
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +10 -8
- package/src/charts/bar-chart/bar-chart.tsx +19 -19
- package/src/charts/bar-chart/test/bar-chart.test.tsx +78 -31
- package/src/charts/conversion-funnel-chart/test/conversion-funnel-chart.test.tsx +2 -2
- package/src/charts/leaderboard-chart/hooks/use-leaderboard-legend-items.ts +0 -2
- package/src/charts/leaderboard-chart/leaderboard-chart.module.scss +9 -10
- package/src/charts/leaderboard-chart/leaderboard-chart.tsx +124 -102
- package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +61 -33
- package/src/charts/leaderboard-chart/test/use-leaderboard-legend-items.test.tsx +2 -5
- package/src/charts/leaderboard-chart/types.ts +2 -15
- package/src/charts/line-chart/line-chart.tsx +18 -17
- package/src/charts/line-chart/test/line-chart.test.tsx +49 -27
- package/src/charts/line-chart/types.ts +0 -1
- package/src/charts/pie-chart/pie-chart.tsx +23 -23
- package/src/charts/pie-chart/test/composition-api.test.tsx +41 -0
- package/src/charts/pie-chart/test/pie-chart.test.tsx +9 -9
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +21 -24
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +33 -5
- package/src/charts/private/chart-composition/index.ts +2 -0
- package/src/charts/private/chart-composition/render-legend-slot.ts +22 -0
- package/src/charts/private/chart-composition/test/render-legend-slot.test.tsx +60 -0
- package/src/charts/private/chart-composition/test/use-chart-children.test.tsx +91 -0
- package/src/charts/private/chart-composition/use-chart-children.ts +34 -2
- package/src/components/legend/private/base-legend.module.scss +19 -37
- package/src/components/legend/private/base-legend.tsx +32 -24
- package/src/components/legend/test/legend.test.tsx +148 -52
- package/src/components/legend/types.ts +23 -24
- package/src/hooks/index.ts +0 -1
- package/src/hooks/test/use-zero-value-display.test.tsx +206 -0
- package/src/hooks/use-zero-value-display.ts +52 -23
- package/src/providers/chart-context/test/chart-context.test.tsx +12 -6
- package/src/providers/chart-context/themes.ts +6 -4
- package/src/types.ts +93 -44
- package/src/utils/date-parsing.ts +10 -1
- package/src/utils/get-styles.ts +1 -1
- package/src/utils/test/date-parsing.test.ts +12 -0
- package/src/utils/test/get-styles.test.ts +12 -10
- package/src/utils/test/resolve-css-var.test.ts +2 -2
- package/tsup.config.ts +1 -1
- package/dist/chunk-55ZCOYDF.cjs.map +0 -1
- package/dist/chunk-6CCZL2JJ.js.map +0 -1
- package/dist/chunk-7FDQGBY7.js.map +0 -1
- package/dist/chunk-BXFD7JIG.cjs.map +0 -1
- package/dist/chunk-IS5YYLTV.js.map +0 -1
- package/dist/chunk-KNIMXN6Z.js +0 -51
- package/dist/chunk-KNIMXN6Z.js.map +0 -1
- package/dist/chunk-NQJE2CC7.cjs.map +0 -1
- package/dist/chunk-O2JIANHK.cjs.map +0 -1
- package/dist/chunk-OMS5QIJN.js.map +0 -1
- package/dist/chunk-RCY6XLGU.cjs.map +0 -1
- package/dist/chunk-RFSHE3HL.js.map +0 -1
- package/dist/chunk-SSFFCBCF.js.map +0 -1
- package/dist/chunk-SUDERBUA.cjs +0 -51
- package/dist/chunk-SUDERBUA.cjs.map +0 -1
- package/dist/chunk-TE63Y5PX.js.map +0 -1
- package/dist/chunk-UFRBUT2D.cjs.map +0 -1
- package/dist/chunk-VPAEBI2F.js.map +0 -1
- package/dist/chunk-X7JL2NYJ.cjs.map +0 -1
- package/dist/chunk-XD2HV7M5.js.map +0 -1
- package/dist/chunk-YDVHT7GS.cjs.map +0 -1
- package/dist/chunk-ZVGEDXDP.cjs.map +0 -1
- package/src/hooks/use-has-legend-child.ts +0 -22
- /package/dist/{chunk-GWBS65VC.js.map → chunk-4B7BL2DD.js.map} +0 -0
- /package/dist/{chunk-MDRCAGKZ.js.map → chunk-DKU775VC.js.map} +0 -0
- /package/dist/{chunk-KHQPN77E.js.map → chunk-KJHWXOCZ.js.map} +0 -0
- /package/dist/{chunk-E62LCBGD.js.map → chunk-MUNOKLLE.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkREZTQ4PHcjs = require('./chunk-REZTQ4PH.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -9,11 +9,11 @@ var _chunkUFRBUT2Dcjs = require('./chunk-UFRBUT2D.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkWYK7EL5Rcjs = require('./chunk-WYK7EL5R.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkMXGLYWVPcjs = require('./chunk-MXGLYWVP.cjs');
|
|
17
17
|
|
|
18
18
|
// src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx
|
|
19
19
|
var _tooltip = require('@visx/tooltip');
|
|
@@ -115,13 +115,13 @@ var ConversionFunnelChartInternal = ({
|
|
|
115
115
|
renderMainMetric,
|
|
116
116
|
renderTooltip
|
|
117
117
|
}) => {
|
|
118
|
-
const chartId =
|
|
118
|
+
const chartId = _chunkWYK7EL5Rcjs.useChartId.call(void 0, providedChartId);
|
|
119
119
|
const {
|
|
120
120
|
conversionFunnelChart: conversionFunnelChartSettings
|
|
121
|
-
} =
|
|
121
|
+
} = _chunkWYK7EL5Rcjs.useGlobalChartsTheme.call(void 0, );
|
|
122
122
|
const {
|
|
123
123
|
getElementStyles
|
|
124
|
-
} =
|
|
124
|
+
} = _chunkWYK7EL5Rcjs.useGlobalChartsContext.call(void 0, );
|
|
125
125
|
const chartRef = _react.useRef.call(void 0, null);
|
|
126
126
|
const selectedBarRef = _react.useRef.call(void 0, null);
|
|
127
127
|
const {
|
|
@@ -258,11 +258,11 @@ var ConversionFunnelChartInternal = ({
|
|
|
258
258
|
};
|
|
259
259
|
const isPositiveChange = _optionalChain([changeIndicator, 'optionalAccess', _6 => _6.startsWith, 'call', _7 => _7("+")]);
|
|
260
260
|
const changeColor = isPositiveChange ? positiveChangeColor : negativeChangeColor;
|
|
261
|
-
const barBackgroundColor = backgroundColor ||
|
|
261
|
+
const barBackgroundColor = backgroundColor || _chunkMXGLYWVPcjs.hexToRgba.call(void 0, barColor, 0.08) || "rgba(0, 0, 0, 0.08)";
|
|
262
262
|
const renderDefaultMainMetric = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
|
|
263
263
|
children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", {
|
|
264
264
|
className: conversion_funnel_chart_module_default["main-rate"],
|
|
265
|
-
children:
|
|
265
|
+
children: _chunkMXGLYWVPcjs.formatPercentage.call(void 0, mainRate)
|
|
266
266
|
}), changeIndicator && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", {
|
|
267
267
|
className: conversion_funnel_chart_module_default["change-indicator"],
|
|
268
268
|
style: {
|
|
@@ -277,7 +277,7 @@ var ConversionFunnelChartInternal = ({
|
|
|
277
277
|
children: step.label
|
|
278
278
|
}), /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", {
|
|
279
279
|
className: conversion_funnel_chart_module_default["tooltip-content"],
|
|
280
|
-
children: [
|
|
280
|
+
children: [_chunkMXGLYWVPcjs.formatPercentage.call(void 0, step.rate), ` \u2022 ${_nullishCoalesce(step.count, () => ( "no"))} items`]
|
|
281
281
|
})]
|
|
282
282
|
});
|
|
283
283
|
const isDataValid = Boolean(steps && steps.length > 0);
|
|
@@ -286,16 +286,16 @@ var ConversionFunnelChartInternal = ({
|
|
|
286
286
|
changeIndicator,
|
|
287
287
|
stepsCount: _optionalChain([steps, 'optionalAccess', _8 => _8.length]) || 0
|
|
288
288
|
}), [mainRate, changeIndicator, _optionalChain([steps, 'optionalAccess', _9 => _9.length])]);
|
|
289
|
-
|
|
289
|
+
_chunkWYK7EL5Rcjs.useChartRegistration.call(void 0, {
|
|
290
290
|
chartId,
|
|
291
291
|
legendItems: [],
|
|
292
292
|
chartType: "conversion-funnel",
|
|
293
293
|
isDataValid,
|
|
294
294
|
metadata: chartMetadata
|
|
295
295
|
});
|
|
296
|
-
const prefersReducedMotion =
|
|
296
|
+
const prefersReducedMotion = _chunkWYK7EL5Rcjs.usePrefersReducedMotion.call(void 0, );
|
|
297
297
|
if (!isDataValid) {
|
|
298
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
298
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkREZTQ4PHcjs.Stack, {
|
|
299
299
|
direction: "column",
|
|
300
300
|
className: _clsx2.default.call(void 0, conversion_funnel_chart_module_default.conversionFunnelChart, loading && conversion_funnel_chart_module_default.loading, className),
|
|
301
301
|
style: {
|
|
@@ -310,7 +310,7 @@ var ConversionFunnelChartInternal = ({
|
|
|
310
310
|
}
|
|
311
311
|
const maxRate = Math.max(...steps.map((step) => step.rate));
|
|
312
312
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
|
|
313
|
-
children: [/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
313
|
+
children: [/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkREZTQ4PHcjs.Stack, {
|
|
314
314
|
direction: "column",
|
|
315
315
|
ref: (node) => {
|
|
316
316
|
portalContainerRef(node);
|
|
@@ -353,7 +353,7 @@ var ConversionFunnelChartInternal = ({
|
|
|
353
353
|
className: conversion_funnel_chart_module_default["step-rate"]
|
|
354
354
|
}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", {
|
|
355
355
|
className: conversion_funnel_chart_module_default["step-rate"],
|
|
356
|
-
children:
|
|
356
|
+
children: _chunkMXGLYWVPcjs.formatPercentage.call(void 0, step.rate)
|
|
357
357
|
})]
|
|
358
358
|
}), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {
|
|
359
359
|
className: _clsx2.default.call(void 0, conversion_funnel_chart_module_default["bar-container"], isBlurred && conversion_funnel_chart_module_default.disabled),
|
|
@@ -401,13 +401,13 @@ var ConversionFunnelChartInternal = ({
|
|
|
401
401
|
});
|
|
402
402
|
};
|
|
403
403
|
var ConversionFunnelChartWithProvider = (props) => {
|
|
404
|
-
const existingContext = _react.useContext.call(void 0,
|
|
404
|
+
const existingContext = _react.useContext.call(void 0, _chunkWYK7EL5Rcjs.GlobalChartsContext);
|
|
405
405
|
if (existingContext) {
|
|
406
406
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ConversionFunnelChartInternal, {
|
|
407
407
|
...props
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
410
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWYK7EL5Rcjs.GlobalChartsProvider, {
|
|
411
411
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ConversionFunnelChartInternal, {
|
|
412
412
|
...props
|
|
413
413
|
})
|
|
@@ -418,4 +418,4 @@ ConversionFunnelChartWithProvider.displayName = "ConversionFunnelChart";
|
|
|
418
418
|
|
|
419
419
|
|
|
420
420
|
exports.ConversionFunnelChartWithProvider = ConversionFunnelChartWithProvider;
|
|
421
|
-
//# sourceMappingURL=chunk-
|
|
421
|
+
//# sourceMappingURL=chunk-PQL5I3F6.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-CAFJRZPZ.cjs","../src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx","../src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss","../src/charts/conversion-funnel-chart/private/use-funnel-selection.ts"],"names":["useCallback"],"mappings":"AAAA;AACE;AACF,wDAA6B;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QAAA,GAAW,CAAC;AAAA,gBAC9D,CAAC,CAAA;AAAA,gBACD,KAAA,EAAO;AAAA,kBACL,MAAA,EAAQ,CAAA,EAAA;AACR,kBAAA;AACF,gBAAA;AACD,cAAA;AACD,YAAA;AACM,UAAA;AACX,QAAA;AACD,MAAA;AACe,IAAA;AACX,MAAA;AACE,QAAA;AACO,QAAA;AACR,QAAA;AACC,QAAA;AACK,QAAA;AACR,MAAA;AAGgB,MAAA;AACD,MAAA;AAAK,QAAA;AAEvB,QAAA;AACK,UAAA;AACC,UAAA;AACK,UAAA;AACD,UAAA;AACZ,QAAA;AAAe,QAAA;AAAC,MAAA;AACd,IAAA;AACL,EAAA;AACH;AAQM;AACoB,EAAA;AAGH,EAAA;AACC,IAAA;AACf,MAAA;AACJ,IAAA;AACH,EAAA;AAGoB,EAAA;AACK,IAAA;AAClB,MAAA;AACJ,IAAA;AACF,EAAA;AACH;AACA;ADM2B;AACA;AACA;AACA","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-CAFJRZPZ.cjs","sourcesContent":[null,"import { useTooltip, useTooltipInPortal } from '@visx/tooltip';\nimport { Stack } from '@wordpress/ui';\nimport clsx from 'clsx';\nimport { useRef, useMemo, useEffect, useCallback, useContext } from 'react';\nimport { usePrefersReducedMotion } from '../../hooks';\nimport { GlobalChartsProvider, GlobalChartsContext, useChartId, useChartRegistration, useGlobalChartsTheme, useGlobalChartsContext } from '../../providers';\nimport { formatPercentage, hexToRgba } from '../../utils';\nimport styles from './conversion-funnel-chart.module.scss';\nimport { useFunnelSelection } from './private';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * Internal ConversionFunnelChart component with chart registration\n *\n * @param props - Component props\n * @param props.chartId - Optional unique identifier for the chart\n * @param props.mainRate - Main conversion rate to highlight\n * @param props.changeIndicator - Change indicator (e.g., +2%, -1.5%)\n * @param props.steps - Array of funnel steps\n * @param props.loading - Whether the chart is in loading state\n * @param props.animation - Whether to show chart animation on initial render or not\n * @param props.className - Additional CSS class name\n * @param props.height - Height of the chart container. Falls back to style.height if set, otherwise defaults to \"100%\".\n * @param props.style - Custom styling\n * @param props.renderStepLabel - Custom render function for step labels\n * @param props.renderStepRate - Custom render function for step rates\n * @param props.renderMainMetric - Custom render function for the entire main metric section\n * @param props.renderTooltip - Custom render function for tooltip content\n * @return JSX element representing the conversion funnel chart\n */\nconst ConversionFunnelChartInternal = ({\n mainRate,\n changeIndicator,\n steps,\n loading = false,\n animation,\n className,\n chartId: providedChartId,\n height,\n style,\n renderStepLabel,\n renderStepRate,\n renderMainMetric,\n renderTooltip\n}) => {\n const chartId = useChartId(providedChartId);\n const {\n conversionFunnelChart: conversionFunnelChartSettings\n } = useGlobalChartsTheme();\n const {\n getElementStyles\n } = useGlobalChartsContext();\n const chartRef = useRef(null);\n const selectedBarRef = useRef(null);\n\n // Use @visx/tooltip hooks for tooltip positioning\n const {\n tooltipData,\n tooltipLeft,\n tooltipTop,\n tooltipOpen,\n showTooltip,\n hideTooltip\n } = useTooltip();\n\n // Use custom hook for selection management\n const {\n handleBarClick,\n handleBarKeyDown,\n clearSelection,\n getStepState\n } = useFunnelSelection(hideTooltip);\n const {\n containerRef: portalContainerRef,\n TooltipInPortal,\n containerBounds\n } = useTooltipInPortal({\n // use TooltipWithBounds for boundary detection\n detectBounds: true,\n // when tooltip containers are scrolled, this will correctly update the Tooltip position\n scroll: true\n });\n\n // Wrapper to clear selectedBarRef after clearing selection\n const clearSelectionAndRef = useCallback(() => {\n clearSelection();\n selectedBarRef.current = null;\n hideTooltip();\n }, [clearSelection, hideTooltip]);\n\n // Helper function to show tooltip at specific coordinates\n const showTooltipAt = useCallback((step, x, y) => {\n showTooltip({\n tooltipData: step,\n tooltipLeft: x,\n tooltipTop: y - 10\n });\n }, [showTooltip]);\n\n // Helper function to get tooltip coordinates for mouse events\n // Use clientX/Y and subtract containerBounds to cancel out any stale offset.\n // TooltipInPortal calculates: tooltipLeft + containerBounds.left + scrollX\n // By passing (clientX - containerBounds.left), we get correct page coordinates\n // regardless of whether bounds are stale (e.g., after dashboard customization).\n const getMouseTooltipCoords = useCallback(event => {\n // Don't return coords until container bounds are measured\n if (containerBounds.width === 0 || containerBounds.height === 0) {\n return null;\n }\n return {\n x: event.clientX - containerBounds.left,\n y: event.clientY - containerBounds.top\n };\n }, [containerBounds.width, containerBounds.height, containerBounds.left, containerBounds.top]);\n\n // Helper function to get tooltip coordinates for keyboard events\n // Use fresh getBoundingClientRect() and subtract containerBounds to cancel out stale offset.\n const getKeyboardTooltipCoords = useCallback(event => {\n // Don't return coords until container bounds are measured\n if (containerBounds.width === 0 || containerBounds.height === 0) {\n return null;\n }\n const rect = event.currentTarget.getBoundingClientRect();\n // Calculate center of element in viewport coordinates, then subtract containerBounds\n const x = rect.left + rect.width / 2 - containerBounds.left;\n const y = rect.top - containerBounds.top;\n return {\n x,\n y\n };\n }, [containerBounds.width, containerBounds.height, containerBounds.left, containerBounds.top]);\n\n // Helper function to handle step interaction (both click and keyboard)\n const handleStepInteraction = useCallback((step, event, interactionType) => {\n // Store reference to the interacted element\n selectedBarRef.current = event.currentTarget;\n\n // Check if deselecting the same step\n const {\n isClicked\n } = getStepState(step.id);\n if (isClicked) {\n // Deselecting - clear selection (tooltip will be hidden by hook)\n if (interactionType === 'click') {\n handleBarClick(step.id);\n } else {\n handleBarKeyDown(step.id, event);\n }\n return;\n }\n\n // Selecting - handle selection and show tooltip\n if (interactionType === 'click') {\n handleBarClick(step.id);\n const coords = getMouseTooltipCoords(event);\n if (coords) {\n showTooltipAt(step, coords.x, coords.y);\n }\n } else {\n handleBarKeyDown(step.id, event);\n const coords = getKeyboardTooltipCoords(event);\n if (coords) {\n showTooltipAt(step, coords.x, coords.y);\n }\n }\n }, [getStepState, handleBarClick, handleBarKeyDown, showTooltipAt, getMouseTooltipCoords, getKeyboardTooltipCoords]);\n\n // Create handler factories to avoid arrow functions in JSX\n const stepHandlers = useMemo(() => {\n const handlers = new Map();\n steps.forEach(step => {\n const onClick = event => {\n event.stopPropagation();\n handleStepInteraction(step, event, 'click');\n };\n const onKeyDown = event => {\n if (event.key === 'Enter' || event.key === ' ') {\n handleStepInteraction(step, event, 'keyboard');\n } else {\n // For other keys (like Escape), just handle the selection\n selectedBarRef.current = event.currentTarget;\n handleBarKeyDown(step.id, event);\n }\n };\n handlers.set(step.id, {\n onClick,\n onKeyDown\n });\n });\n return handlers;\n }, [steps, handleStepInteraction, handleBarKeyDown]);\n\n // Handle document-level click to clear selection when clicking outside selected bar\n useEffect(() => {\n const handleDocumentClick = event => {\n // Only clear selection if there's an active selection and click is outside the selected bar\n if (selectedBarRef.current && !selectedBarRef.current.contains(event.target)) {\n clearSelectionAndRef();\n }\n };\n document.addEventListener('mousedown', handleDocumentClick);\n return () => {\n document.removeEventListener('mousedown', handleDocumentClick);\n };\n }, [clearSelectionAndRef]);\n\n // Resolve height: explicit height prop > style.height > default 100%\n const resolvedHeight = height ?? style?.height ?? '100%';\n\n // Get component settings from theme with fallbacks\n const {\n primaryColor,\n backgroundColor,\n positiveChangeColor,\n negativeChangeColor\n } = conversionFunnelChartSettings;\n\n // Resolve bar color using getElementStyles with primaryColor as override\n const {\n color: barColor\n } = getElementStyles ? getElementStyles({\n index: 0,\n overrideColor: primaryColor\n }) : {\n color: primaryColor || '#000000'\n };\n\n // Determine change indicator color\n const isPositiveChange = changeIndicator?.startsWith('+');\n const changeColor = isPositiveChange ? positiveChangeColor : negativeChangeColor;\n\n // Create light background version of primary color if not set\n const barBackgroundColor = backgroundColor || hexToRgba(barColor, 0.08) || 'rgba(0, 0, 0, 0.08)';\n\n // Default main metric rendering function\n const renderDefaultMainMetric = () => /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(\"span\", {\n className: styles['main-rate'],\n children: formatPercentage(mainRate)\n }), changeIndicator && /*#__PURE__*/_jsx(\"span\", {\n className: styles['change-indicator'],\n style: {\n color: changeColor\n },\n children: changeIndicator\n })]\n });\n\n // Default tooltip rendering function\n const renderDefaultTooltip = step => /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(\"div\", {\n className: styles['tooltip-title'],\n children: step.label\n }), /*#__PURE__*/_jsxs(\"div\", {\n className: styles['tooltip-content'],\n children: [formatPercentage(step.rate), ` • ${step.count ?? 'no'} items`]\n })]\n });\n\n // Validate data\n const isDataValid = Boolean(steps && steps.length > 0);\n\n // Memoize metadata to prevent unnecessary re-registration\n const chartMetadata = useMemo(() => ({\n mainRate,\n changeIndicator,\n stepsCount: steps?.length || 0\n }), [mainRate, changeIndicator, steps?.length]);\n useChartRegistration({\n chartId,\n legendItems: [],\n chartType: 'conversion-funnel',\n isDataValid,\n metadata: chartMetadata\n });\n const prefersReducedMotion = usePrefersReducedMotion();\n\n // Handle empty or undefined data\n if (!isDataValid) {\n return /*#__PURE__*/_jsx(Stack, {\n direction: \"column\",\n className: clsx(styles.conversionFunnelChart, loading && styles.loading, className),\n style: {\n ...style,\n height: resolvedHeight\n },\n children: /*#__PURE__*/_jsx(\"div\", {\n className: styles['empty-state'],\n children: loading ? 'Loading...' : 'No data available'\n })\n });\n }\n\n // Calculate bar heights relative to the maximum (first step)\n const maxRate = Math.max(...steps.map(step => step.rate));\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsxs(Stack, {\n direction: \"column\",\n ref: node => {\n // Set containerRef for @visx coordinate system\n portalContainerRef(node);\n chartRef.current = node;\n },\n className: clsx(styles.conversionFunnelChart, loading && styles.loading, className),\n style: {\n ...style,\n height: resolvedHeight\n },\n children: [renderMainMetric ? renderMainMetric({\n mainRate,\n changeIndicator,\n className: styles['main-metric'],\n changeColor\n }) : /*#__PURE__*/_jsx(\"div\", {\n className: styles['main-metric'],\n children: renderDefaultMainMetric()\n }), /*#__PURE__*/_jsx(\"div\", {\n className: styles['funnel-container'],\n children: steps.map((step, index) => {\n const barHeight = step.rate / maxRate * 100;\n const {\n isBlurred\n } = getStepState(step.id);\n return /*#__PURE__*/_jsxs(\"div\", {\n className: clsx(styles['funnel-step'], isBlurred && styles.blurred),\n children: [/*#__PURE__*/_jsxs(\"div\", {\n className: styles['step-header'],\n children: [renderStepLabel ? renderStepLabel({\n step,\n index,\n className: styles['step-label']\n }) : /*#__PURE__*/_jsx(\"span\", {\n className: styles['step-label'],\n children: step.label\n }), renderStepRate ? renderStepRate({\n step,\n index,\n className: styles['step-rate']\n }) : /*#__PURE__*/_jsx(\"span\", {\n className: styles['step-rate'],\n children: formatPercentage(step.rate)\n })]\n }), /*#__PURE__*/_jsx(\"div\", {\n className: clsx(styles['bar-container'], isBlurred && styles.disabled),\n onClick: stepHandlers.get(step.id)?.onClick,\n onKeyDown: stepHandlers.get(step.id)?.onKeyDown,\n role: \"button\",\n tabIndex: isBlurred ? -1 : 0,\n \"aria-label\": step.label,\n style: {\n backgroundColor: barBackgroundColor\n },\n children: /*#__PURE__*/_jsx(\"div\", {\n className: clsx(styles['funnel-bar'], {\n [styles['funnel-bar--animated']]: animation && !loading && !prefersReducedMotion\n }),\n style: {\n height: `${barHeight}%`,\n backgroundColor: barColor\n }\n })\n })]\n }, step.id);\n })\n })]\n }), tooltipOpen && tooltipData && (() => {\n const tooltipContent = renderTooltip ? renderTooltip({\n step: tooltipData,\n index: steps.findIndex(s => s.id === tooltipData.id),\n top: tooltipTop,\n left: tooltipLeft,\n className: styles['tooltip-wrapper']\n }) : renderDefaultTooltip(tooltipData);\n\n // Don't render tooltip if renderTooltip returns falsy\n if (!tooltipContent) return null;\n return /*#__PURE__*/_jsx(TooltipInPortal\n // set this to random so it correctly updates with parent bounds\n , {\n top: tooltipTop,\n left: tooltipLeft,\n className: styles['tooltip-wrapper'],\n children: tooltipContent\n }, Math.random());\n })()]\n });\n};\n\n/**\n * ConversionFunnelChart component with provider wrapper\n *\n * @param props - Component props\n * @return JSX element representing the conversion funnel chart\n */\nconst ConversionFunnelChartWithProvider = 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(ConversionFunnelChartInternal, {\n ...props\n });\n }\n\n // Otherwise, create our own GlobalChartsProvider\n return /*#__PURE__*/_jsx(GlobalChartsProvider, {\n children: /*#__PURE__*/_jsx(ConversionFunnelChartInternal, {\n ...props\n })\n });\n};\nConversionFunnelChartWithProvider.displayName = 'ConversionFunnelChart';\nexport { ConversionFunnelChartWithProvider as default };","import 'css-chunk:src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss';export default {\n \"conversionFunnelChart\": \"a8ccharts-lK-YNK\",\n \"loading\": \"a8ccharts-DbHKK5\",\n \"main-metric\": \"a8ccharts-61WPYr\",\n \"main-rate\": \"a8ccharts-RRRI6x\",\n \"change-indicator\": \"a8ccharts-661iwx\",\n \"funnel-container\": \"a8ccharts-Z7EGnW\",\n \"funnel-step\": \"a8ccharts-VqFY0l\",\n \"blurred\": \"a8ccharts-7dTRBs\",\n \"step-header\": \"a8ccharts-2JsQiV\",\n \"step-label\": \"a8ccharts-6OabC4\",\n \"step-rate\": \"a8ccharts-9wSZ6n\",\n \"bar-container\": \"a8ccharts-sSmCTi\",\n \"disabled\": \"a8ccharts-PLWVAW\",\n \"funnel-bar\": \"a8ccharts-EzczI-\",\n \"selected\": \"a8ccharts-wNpZEu\",\n \"funnel-bar--animated\": \"a8ccharts-68HQJl\",\n \"stretch\": \"a8ccharts-CmtieZ\",\n \"tooltip-wrapper\": \"a8ccharts-2TeoCn\",\n \"tooltip-title\": \"a8ccharts-jkRitH\",\n \"tooltip-content\": \"a8ccharts-8jgT-3\",\n \"empty-state\": \"a8ccharts-Ml6MMr\"\n};","import { useCallback, useState } from 'react';\n\n/**\n * Custom hook to manage funnel bar selection state and interactions\n * @param hideTooltip - Function to hide tooltip when selection is cleared\n * @return Object containing selection state and event handlers\n */\nexport const useFunnelSelection = ( hideTooltip?: () => void ) => {\n\tconst [ clickedStep, setClickedStep ] = useState< string | null >( null );\n\n\t// Handle bar click\n\tconst handleBarClick = useCallback(\n\t\t( stepId: string ) => {\n\t\t\tif ( clickedStep === stepId ) {\n\t\t\t\t// If clicking the same step, deselect it\n\t\t\t\tsetClickedStep( null );\n\t\t\t\thideTooltip?.();\n\t\t\t} else {\n\t\t\t\t// Otherwise, select this step\n\t\t\t\tsetClickedStep( stepId );\n\t\t\t}\n\t\t},\n\t\t[ clickedStep, hideTooltip ]\n\t);\n\n\t// Handle bar keydown\n\tconst handleBarKeyDown = useCallback(\n\t\t( stepId: string, event: React.KeyboardEvent ) => {\n\t\t\tif ( event.key === 'Enter' || event.key === ' ' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( clickedStep === stepId ) {\n\t\t\t\t\tsetClickedStep( null );\n\t\t\t\t\thideTooltip?.();\n\t\t\t\t} else {\n\t\t\t\t\tsetClickedStep( stepId );\n\t\t\t\t}\n\t\t\t} else if ( event.key === 'Escape' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetClickedStep( null );\n\t\t\t\thideTooltip?.();\n\t\t\t}\n\t\t},\n\t\t[ clickedStep, hideTooltip ]\n\t);\n\n\t// Clear selection (for chart-level click)\n\tconst clearSelection = useCallback( () => {\n\t\tsetClickedStep( null );\n\t\thideTooltip?.();\n\t}, [ hideTooltip ] );\n\n\t// Get step state helpers\n\tconst getStepState = useCallback(\n\t\t( stepId: string ) => ( {\n\t\t\tisClicked: clickedStep === stepId,\n\t\t\tisBlurred: clickedStep !== null && clickedStep !== stepId,\n\t\t} ),\n\t\t[ clickedStep ]\n\t);\n\n\treturn {\n\t\tclickedStep,\n\t\thandleBarClick,\n\t\thandleBarKeyDown,\n\t\tclearSelection,\n\t\tgetStepState,\n\t};\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-PQL5I3F6.cjs","../src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx","../src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss","../src/charts/conversion-funnel-chart/private/use-funnel-selection.ts"],"names":["useCallback"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACjBA,wCAA+C;AAE/C,wEAAiB;AACjB,8BAAoE;ADkBpE;AACA;AEtB0F,IAAO,uCAAA,EAAQ;AAAA,EACvG,uBAAA,EAAyB,kBAAA;AAAA,EACzB,SAAA,EAAW,kBAAA;AAAA,EACX,aAAA,EAAe,kBAAA;AAAA,EACf,WAAA,EAAa,kBAAA;AAAA,EACb,kBAAA,EAAoB,kBAAA;AAAA,EACpB,kBAAA,EAAoB,kBAAA;AAAA,EACpB,aAAA,EAAe,kBAAA;AAAA,EACf,SAAA,EAAW,kBAAA;AAAA,EACX,aAAA,EAAe,kBAAA;AAAA,EACf,YAAA,EAAc,kBAAA;AAAA,EACd,WAAA,EAAa,kBAAA;AAAA,EACb,eAAA,EAAiB,kBAAA;AAAA,EACjB,UAAA,EAAY,kBAAA;AAAA,EACZ,YAAA,EAAc,kBAAA;AAAA,EACd,UAAA,EAAY,kBAAA;AAAA,EACZ,sBAAA,EAAwB,kBAAA;AAAA,EACxB,SAAA,EAAW,kBAAA;AAAA,EACX,iBAAA,EAAmB,kBAAA;AAAA,EACnB,eAAA,EAAiB,kBAAA;AAAA,EACjB,iBAAA,EAAmB,kBAAA;AAAA,EACnB,aAAA,EAAe;AACjB,CAAA;AFwBA;AACA;AG/CA;AAOO,IAAM,mBAAA,EAAqB,CAAE,WAAA,EAAA,GAA8B;AACjE,EAAA,MAAM,CAAE,WAAA,EAAa,cAAe,EAAA,EAAI,6BAAA,IAAgC,CAAA;AAGxE,EAAA,MAAM,eAAA,EAAiB,gCAAA;AAAA,IACtB,CAAE,MAAA,EAAA,GAAoB;AACrB,MAAA,GAAA,CAAK,YAAA,IAAgB,MAAA,EAAS;AAE7B,QAAA,cAAA,CAAg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A,EAAG;AAAA,kBACpC,CAAC,sCAAA,CAAO,sBAAsB,CAAC,CAAA,EAAG,UAAA,GAAa,CAAC,QAAA,GAAW,CAAC;AAAA,gBAC9D,CAAC,CAAA;AAAA,gBACD,KAAA,EAAO;AAAA,kBACL,MAAA,EAAQ,CAAA,EAAA;AACR,kBAAA;AACF,gBAAA;AACD,cAAA;AACD,YAAA;AACM,UAAA;AACX,QAAA;AACD,MAAA;AACe,IAAA;AACX,MAAA;AACE,QAAA;AACO,QAAA;AACR,QAAA;AACC,QAAA;AACK,QAAA;AACR,MAAA;AAGgB,MAAA;AACD,MAAA;AAAK,QAAA;AAEvB,QAAA;AACK,UAAA;AACC,UAAA;AACK,UAAA;AACD,UAAA;AACZ,QAAA;AAAe,QAAA;AAAC,MAAA;AACd,IAAA;AACL,EAAA;AACH;AAQM;AACoB,EAAA;AAGH,EAAA;AACC,IAAA;AACf,MAAA;AACJ,IAAA;AACH,EAAA;AAGoB,EAAA;AACK,IAAA;AAClB,MAAA;AACJ,IAAA;AACF,EAAA;AACH;AACA;ADM2B;AACA;AACA;AACA","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-PQL5I3F6.cjs","sourcesContent":[null,"import { useTooltip, useTooltipInPortal } from '@visx/tooltip';\nimport { Stack } from '@wordpress/ui';\nimport clsx from 'clsx';\nimport { useRef, useMemo, useEffect, useCallback, useContext } from 'react';\nimport { usePrefersReducedMotion } from '../../hooks';\nimport { GlobalChartsProvider, GlobalChartsContext, useChartId, useChartRegistration, useGlobalChartsTheme, useGlobalChartsContext } from '../../providers';\nimport { formatPercentage, hexToRgba } from '../../utils';\nimport styles from './conversion-funnel-chart.module.scss';\nimport { useFunnelSelection } from './private';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * Internal ConversionFunnelChart component with chart registration\n *\n * @param props - Component props\n * @param props.chartId - Optional unique identifier for the chart\n * @param props.mainRate - Main conversion rate to highlight\n * @param props.changeIndicator - Change indicator (e.g., +2%, -1.5%)\n * @param props.steps - Array of funnel steps\n * @param props.loading - Whether the chart is in loading state\n * @param props.animation - Whether to show chart animation on initial render or not\n * @param props.className - Additional CSS class name\n * @param props.height - Height of the chart container. Falls back to style.height if set, otherwise defaults to \"100%\".\n * @param props.style - Custom styling\n * @param props.renderStepLabel - Custom render function for step labels\n * @param props.renderStepRate - Custom render function for step rates\n * @param props.renderMainMetric - Custom render function for the entire main metric section\n * @param props.renderTooltip - Custom render function for tooltip content\n * @return JSX element representing the conversion funnel chart\n */\nconst ConversionFunnelChartInternal = ({\n mainRate,\n changeIndicator,\n steps,\n loading = false,\n animation,\n className,\n chartId: providedChartId,\n height,\n style,\n renderStepLabel,\n renderStepRate,\n renderMainMetric,\n renderTooltip\n}) => {\n const chartId = useChartId(providedChartId);\n const {\n conversionFunnelChart: conversionFunnelChartSettings\n } = useGlobalChartsTheme();\n const {\n getElementStyles\n } = useGlobalChartsContext();\n const chartRef = useRef(null);\n const selectedBarRef = useRef(null);\n\n // Use @visx/tooltip hooks for tooltip positioning\n const {\n tooltipData,\n tooltipLeft,\n tooltipTop,\n tooltipOpen,\n showTooltip,\n hideTooltip\n } = useTooltip();\n\n // Use custom hook for selection management\n const {\n handleBarClick,\n handleBarKeyDown,\n clearSelection,\n getStepState\n } = useFunnelSelection(hideTooltip);\n const {\n containerRef: portalContainerRef,\n TooltipInPortal,\n containerBounds\n } = useTooltipInPortal({\n // use TooltipWithBounds for boundary detection\n detectBounds: true,\n // when tooltip containers are scrolled, this will correctly update the Tooltip position\n scroll: true\n });\n\n // Wrapper to clear selectedBarRef after clearing selection\n const clearSelectionAndRef = useCallback(() => {\n clearSelection();\n selectedBarRef.current = null;\n hideTooltip();\n }, [clearSelection, hideTooltip]);\n\n // Helper function to show tooltip at specific coordinates\n const showTooltipAt = useCallback((step, x, y) => {\n showTooltip({\n tooltipData: step,\n tooltipLeft: x,\n tooltipTop: y - 10\n });\n }, [showTooltip]);\n\n // Helper function to get tooltip coordinates for mouse events\n // Use clientX/Y and subtract containerBounds to cancel out any stale offset.\n // TooltipInPortal calculates: tooltipLeft + containerBounds.left + scrollX\n // By passing (clientX - containerBounds.left), we get correct page coordinates\n // regardless of whether bounds are stale (e.g., after dashboard customization).\n const getMouseTooltipCoords = useCallback(event => {\n // Don't return coords until container bounds are measured\n if (containerBounds.width === 0 || containerBounds.height === 0) {\n return null;\n }\n return {\n x: event.clientX - containerBounds.left,\n y: event.clientY - containerBounds.top\n };\n }, [containerBounds.width, containerBounds.height, containerBounds.left, containerBounds.top]);\n\n // Helper function to get tooltip coordinates for keyboard events\n // Use fresh getBoundingClientRect() and subtract containerBounds to cancel out stale offset.\n const getKeyboardTooltipCoords = useCallback(event => {\n // Don't return coords until container bounds are measured\n if (containerBounds.width === 0 || containerBounds.height === 0) {\n return null;\n }\n const rect = event.currentTarget.getBoundingClientRect();\n // Calculate center of element in viewport coordinates, then subtract containerBounds\n const x = rect.left + rect.width / 2 - containerBounds.left;\n const y = rect.top - containerBounds.top;\n return {\n x,\n y\n };\n }, [containerBounds.width, containerBounds.height, containerBounds.left, containerBounds.top]);\n\n // Helper function to handle step interaction (both click and keyboard)\n const handleStepInteraction = useCallback((step, event, interactionType) => {\n // Store reference to the interacted element\n selectedBarRef.current = event.currentTarget;\n\n // Check if deselecting the same step\n const {\n isClicked\n } = getStepState(step.id);\n if (isClicked) {\n // Deselecting - clear selection (tooltip will be hidden by hook)\n if (interactionType === 'click') {\n handleBarClick(step.id);\n } else {\n handleBarKeyDown(step.id, event);\n }\n return;\n }\n\n // Selecting - handle selection and show tooltip\n if (interactionType === 'click') {\n handleBarClick(step.id);\n const coords = getMouseTooltipCoords(event);\n if (coords) {\n showTooltipAt(step, coords.x, coords.y);\n }\n } else {\n handleBarKeyDown(step.id, event);\n const coords = getKeyboardTooltipCoords(event);\n if (coords) {\n showTooltipAt(step, coords.x, coords.y);\n }\n }\n }, [getStepState, handleBarClick, handleBarKeyDown, showTooltipAt, getMouseTooltipCoords, getKeyboardTooltipCoords]);\n\n // Create handler factories to avoid arrow functions in JSX\n const stepHandlers = useMemo(() => {\n const handlers = new Map();\n steps.forEach(step => {\n const onClick = event => {\n event.stopPropagation();\n handleStepInteraction(step, event, 'click');\n };\n const onKeyDown = event => {\n if (event.key === 'Enter' || event.key === ' ') {\n handleStepInteraction(step, event, 'keyboard');\n } else {\n // For other keys (like Escape), just handle the selection\n selectedBarRef.current = event.currentTarget;\n handleBarKeyDown(step.id, event);\n }\n };\n handlers.set(step.id, {\n onClick,\n onKeyDown\n });\n });\n return handlers;\n }, [steps, handleStepInteraction, handleBarKeyDown]);\n\n // Handle document-level click to clear selection when clicking outside selected bar\n useEffect(() => {\n const handleDocumentClick = event => {\n // Only clear selection if there's an active selection and click is outside the selected bar\n if (selectedBarRef.current && !selectedBarRef.current.contains(event.target)) {\n clearSelectionAndRef();\n }\n };\n document.addEventListener('mousedown', handleDocumentClick);\n return () => {\n document.removeEventListener('mousedown', handleDocumentClick);\n };\n }, [clearSelectionAndRef]);\n\n // Resolve height: explicit height prop > style.height > default 100%\n const resolvedHeight = height ?? style?.height ?? '100%';\n\n // Get component settings from theme with fallbacks\n const {\n primaryColor,\n backgroundColor,\n positiveChangeColor,\n negativeChangeColor\n } = conversionFunnelChartSettings;\n\n // Resolve bar color using getElementStyles with primaryColor as override\n const {\n color: barColor\n } = getElementStyles ? getElementStyles({\n index: 0,\n overrideColor: primaryColor\n }) : {\n color: primaryColor || '#000000'\n };\n\n // Determine change indicator color\n const isPositiveChange = changeIndicator?.startsWith('+');\n const changeColor = isPositiveChange ? positiveChangeColor : negativeChangeColor;\n\n // Create light background version of primary color if not set\n const barBackgroundColor = backgroundColor || hexToRgba(barColor, 0.08) || 'rgba(0, 0, 0, 0.08)';\n\n // Default main metric rendering function\n const renderDefaultMainMetric = () => /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(\"span\", {\n className: styles['main-rate'],\n children: formatPercentage(mainRate)\n }), changeIndicator && /*#__PURE__*/_jsx(\"span\", {\n className: styles['change-indicator'],\n style: {\n color: changeColor\n },\n children: changeIndicator\n })]\n });\n\n // Default tooltip rendering function\n const renderDefaultTooltip = step => /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(\"div\", {\n className: styles['tooltip-title'],\n children: step.label\n }), /*#__PURE__*/_jsxs(\"div\", {\n className: styles['tooltip-content'],\n children: [formatPercentage(step.rate), ` • ${step.count ?? 'no'} items`]\n })]\n });\n\n // Validate data\n const isDataValid = Boolean(steps && steps.length > 0);\n\n // Memoize metadata to prevent unnecessary re-registration\n const chartMetadata = useMemo(() => ({\n mainRate,\n changeIndicator,\n stepsCount: steps?.length || 0\n }), [mainRate, changeIndicator, steps?.length]);\n useChartRegistration({\n chartId,\n legendItems: [],\n chartType: 'conversion-funnel',\n isDataValid,\n metadata: chartMetadata\n });\n const prefersReducedMotion = usePrefersReducedMotion();\n\n // Handle empty or undefined data\n if (!isDataValid) {\n return /*#__PURE__*/_jsx(Stack, {\n direction: \"column\",\n className: clsx(styles.conversionFunnelChart, loading && styles.loading, className),\n style: {\n ...style,\n height: resolvedHeight\n },\n children: /*#__PURE__*/_jsx(\"div\", {\n className: styles['empty-state'],\n children: loading ? 'Loading...' : 'No data available'\n })\n });\n }\n\n // Calculate bar heights relative to the maximum (first step)\n const maxRate = Math.max(...steps.map(step => step.rate));\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsxs(Stack, {\n direction: \"column\",\n ref: node => {\n // Set containerRef for @visx coordinate system\n portalContainerRef(node);\n chartRef.current = node;\n },\n className: clsx(styles.conversionFunnelChart, loading && styles.loading, className),\n style: {\n ...style,\n height: resolvedHeight\n },\n children: [renderMainMetric ? renderMainMetric({\n mainRate,\n changeIndicator,\n className: styles['main-metric'],\n changeColor\n }) : /*#__PURE__*/_jsx(\"div\", {\n className: styles['main-metric'],\n children: renderDefaultMainMetric()\n }), /*#__PURE__*/_jsx(\"div\", {\n className: styles['funnel-container'],\n children: steps.map((step, index) => {\n const barHeight = step.rate / maxRate * 100;\n const {\n isBlurred\n } = getStepState(step.id);\n return /*#__PURE__*/_jsxs(\"div\", {\n className: clsx(styles['funnel-step'], isBlurred && styles.blurred),\n children: [/*#__PURE__*/_jsxs(\"div\", {\n className: styles['step-header'],\n children: [renderStepLabel ? renderStepLabel({\n step,\n index,\n className: styles['step-label']\n }) : /*#__PURE__*/_jsx(\"span\", {\n className: styles['step-label'],\n children: step.label\n }), renderStepRate ? renderStepRate({\n step,\n index,\n className: styles['step-rate']\n }) : /*#__PURE__*/_jsx(\"span\", {\n className: styles['step-rate'],\n children: formatPercentage(step.rate)\n })]\n }), /*#__PURE__*/_jsx(\"div\", {\n className: clsx(styles['bar-container'], isBlurred && styles.disabled),\n onClick: stepHandlers.get(step.id)?.onClick,\n onKeyDown: stepHandlers.get(step.id)?.onKeyDown,\n role: \"button\",\n tabIndex: isBlurred ? -1 : 0,\n \"aria-label\": step.label,\n style: {\n backgroundColor: barBackgroundColor\n },\n children: /*#__PURE__*/_jsx(\"div\", {\n className: clsx(styles['funnel-bar'], {\n [styles['funnel-bar--animated']]: animation && !loading && !prefersReducedMotion\n }),\n style: {\n height: `${barHeight}%`,\n backgroundColor: barColor\n }\n })\n })]\n }, step.id);\n })\n })]\n }), tooltipOpen && tooltipData && (() => {\n const tooltipContent = renderTooltip ? renderTooltip({\n step: tooltipData,\n index: steps.findIndex(s => s.id === tooltipData.id),\n top: tooltipTop,\n left: tooltipLeft,\n className: styles['tooltip-wrapper']\n }) : renderDefaultTooltip(tooltipData);\n\n // Don't render tooltip if renderTooltip returns falsy\n if (!tooltipContent) return null;\n return /*#__PURE__*/_jsx(TooltipInPortal\n // set this to random so it correctly updates with parent bounds\n , {\n top: tooltipTop,\n left: tooltipLeft,\n className: styles['tooltip-wrapper'],\n children: tooltipContent\n }, Math.random());\n })()]\n });\n};\n\n/**\n * ConversionFunnelChart component with provider wrapper\n *\n * @param props - Component props\n * @return JSX element representing the conversion funnel chart\n */\nconst ConversionFunnelChartWithProvider = 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(ConversionFunnelChartInternal, {\n ...props\n });\n }\n\n // Otherwise, create our own GlobalChartsProvider\n return /*#__PURE__*/_jsx(GlobalChartsProvider, {\n children: /*#__PURE__*/_jsx(ConversionFunnelChartInternal, {\n ...props\n })\n });\n};\nConversionFunnelChartWithProvider.displayName = 'ConversionFunnelChart';\nexport { ConversionFunnelChartWithProvider as default };","import 'css-chunk:src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss';export default {\n \"conversionFunnelChart\": \"a8ccharts-lK-YNK\",\n \"loading\": \"a8ccharts-DbHKK5\",\n \"main-metric\": \"a8ccharts-61WPYr\",\n \"main-rate\": \"a8ccharts-RRRI6x\",\n \"change-indicator\": \"a8ccharts-661iwx\",\n \"funnel-container\": \"a8ccharts-Z7EGnW\",\n \"funnel-step\": \"a8ccharts-VqFY0l\",\n \"blurred\": \"a8ccharts-7dTRBs\",\n \"step-header\": \"a8ccharts-2JsQiV\",\n \"step-label\": \"a8ccharts-6OabC4\",\n \"step-rate\": \"a8ccharts-9wSZ6n\",\n \"bar-container\": \"a8ccharts-sSmCTi\",\n \"disabled\": \"a8ccharts-PLWVAW\",\n \"funnel-bar\": \"a8ccharts-EzczI-\",\n \"selected\": \"a8ccharts-wNpZEu\",\n \"funnel-bar--animated\": \"a8ccharts-68HQJl\",\n \"stretch\": \"a8ccharts-CmtieZ\",\n \"tooltip-wrapper\": \"a8ccharts-2TeoCn\",\n \"tooltip-title\": \"a8ccharts-jkRitH\",\n \"tooltip-content\": \"a8ccharts-8jgT-3\",\n \"empty-state\": \"a8ccharts-Ml6MMr\"\n};","import { useCallback, useState } from 'react';\n\n/**\n * Custom hook to manage funnel bar selection state and interactions\n * @param hideTooltip - Function to hide tooltip when selection is cleared\n * @return Object containing selection state and event handlers\n */\nexport const useFunnelSelection = ( hideTooltip?: () => void ) => {\n\tconst [ clickedStep, setClickedStep ] = useState< string | null >( null );\n\n\t// Handle bar click\n\tconst handleBarClick = useCallback(\n\t\t( stepId: string ) => {\n\t\t\tif ( clickedStep === stepId ) {\n\t\t\t\t// If clicking the same step, deselect it\n\t\t\t\tsetClickedStep( null );\n\t\t\t\thideTooltip?.();\n\t\t\t} else {\n\t\t\t\t// Otherwise, select this step\n\t\t\t\tsetClickedStep( stepId );\n\t\t\t}\n\t\t},\n\t\t[ clickedStep, hideTooltip ]\n\t);\n\n\t// Handle bar keydown\n\tconst handleBarKeyDown = useCallback(\n\t\t( stepId: string, event: React.KeyboardEvent ) => {\n\t\t\tif ( event.key === 'Enter' || event.key === ' ' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( clickedStep === stepId ) {\n\t\t\t\t\tsetClickedStep( null );\n\t\t\t\t\thideTooltip?.();\n\t\t\t\t} else {\n\t\t\t\t\tsetClickedStep( stepId );\n\t\t\t\t}\n\t\t\t} else if ( event.key === 'Escape' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetClickedStep( null );\n\t\t\t\thideTooltip?.();\n\t\t\t}\n\t\t},\n\t\t[ clickedStep, hideTooltip ]\n\t);\n\n\t// Clear selection (for chart-level click)\n\tconst clearSelection = useCallback( () => {\n\t\tsetClickedStep( null );\n\t\thideTooltip?.();\n\t}, [ hideTooltip ] );\n\n\t// Get step state helpers\n\tconst getStepState = useCallback(\n\t\t( stepId: string ) => ( {\n\t\t\tisClicked: clickedStep === stepId,\n\t\t\tisBlurred: clickedStep !== null && clickedStep !== stepId,\n\t\t} ),\n\t\t[ clickedStep ]\n\t);\n\n\treturn {\n\t\tclickedStep,\n\t\thandleBarClick,\n\t\thandleBarKeyDown,\n\t\tclearSelection,\n\t\tgetStepState,\n\t};\n};\n"]}
|
|
@@ -1,9 +1,39 @@
|
|
|
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; }
|
|
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; }// ../../../node_modules/.pnpm/@wordpress+element@6.41.0/node_modules/@wordpress/element/build-module/react.mjs
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
2
31
|
|
|
3
|
-
var _chunkSUDERBUAcjs = require('./chunk-SUDERBUA.cjs');
|
|
4
32
|
|
|
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
33
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
|
|
34
|
+
|
|
35
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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
|
|
36
|
+
|
|
7
37
|
var UNINITIALIZED = {};
|
|
8
38
|
function useRefWithInit(init, initArg) {
|
|
9
39
|
const ref = React.useRef(UNINITIALIZED);
|
|
@@ -13,7 +43,7 @@ function useRefWithInit(init, initArg) {
|
|
|
13
43
|
return ref;
|
|
14
44
|
}
|
|
15
45
|
|
|
16
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.
|
|
46
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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
47
|
function formatErrorMessage(code, ...args) {
|
|
18
48
|
const url = new URL("https://base-ui.com/production-error");
|
|
19
49
|
url.searchParams.set("code", code.toString());
|
|
@@ -21,10 +51,10 @@ function formatErrorMessage(code, ...args) {
|
|
|
21
51
|
return `Base UI error #${code}; visit ${url} for the full message.`;
|
|
22
52
|
}
|
|
23
53
|
|
|
24
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
54
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.2.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
55
|
|
|
26
56
|
|
|
27
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.
|
|
57
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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
58
|
function useMergedRefs(a, b, c, d) {
|
|
29
59
|
const forkRef = useRefWithInit(createForkRef).current;
|
|
30
60
|
if (didChange(forkRef, a, b, c, d)) {
|
|
@@ -113,17 +143,17 @@ function update(forkRef, refs) {
|
|
|
113
143
|
};
|
|
114
144
|
}
|
|
115
145
|
|
|
116
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.
|
|
146
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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
147
|
|
|
118
148
|
|
|
119
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.
|
|
149
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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
150
|
|
|
121
151
|
var majorVersion = parseInt(React2.version, 10);
|
|
122
152
|
function isReactVersionAtLeast(reactVersionToCheck) {
|
|
123
153
|
return majorVersion >= reactVersionToCheck;
|
|
124
154
|
}
|
|
125
155
|
|
|
126
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.
|
|
156
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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
157
|
function getReactElementRef(element) {
|
|
128
158
|
if (!/* @__PURE__ */ React3.isValidElement(element)) {
|
|
129
159
|
return null;
|
|
@@ -133,7 +163,7 @@ function getReactElementRef(element) {
|
|
|
133
163
|
return _nullishCoalesce((isReactVersionAtLeast(19) ? _optionalChain([propsWithRef, 'optionalAccess', _ => _.ref]) : reactElement.ref), () => ( null));
|
|
134
164
|
}
|
|
135
165
|
|
|
136
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.
|
|
166
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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
167
|
function mergeObjects(a, b) {
|
|
138
168
|
if (a && !b) {
|
|
139
169
|
return a;
|
|
@@ -150,7 +180,7 @@ function mergeObjects(a, b) {
|
|
|
150
180
|
return void 0;
|
|
151
181
|
}
|
|
152
182
|
|
|
153
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
183
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.2.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
184
|
function getStateAttributesProps(state, customMapping) {
|
|
155
185
|
const props = {};
|
|
156
186
|
for (const key in state) {
|
|
@@ -171,17 +201,17 @@ function getStateAttributesProps(state, customMapping) {
|
|
|
171
201
|
return props;
|
|
172
202
|
}
|
|
173
203
|
|
|
174
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
204
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.2.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
205
|
function resolveClassName(className, state) {
|
|
176
206
|
return typeof className === "function" ? className(state) : className;
|
|
177
207
|
}
|
|
178
208
|
|
|
179
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
209
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.2.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
210
|
function resolveStyle(style, state) {
|
|
181
211
|
return typeof style === "function" ? style(state) : style;
|
|
182
212
|
}
|
|
183
213
|
|
|
184
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
214
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.2.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
215
|
var EMPTY_PROPS = {};
|
|
186
216
|
function mergeProps(a, b, c, d, e) {
|
|
187
217
|
let merged = {
|
|
@@ -304,11 +334,11 @@ function isSyntheticEvent(event) {
|
|
|
304
334
|
return event != null && typeof event === "object" && "nativeEvent" in event;
|
|
305
335
|
}
|
|
306
336
|
|
|
307
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.
|
|
337
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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
338
|
var EMPTY_ARRAY = Object.freeze([]);
|
|
309
339
|
var EMPTY_OBJECT = Object.freeze({});
|
|
310
340
|
|
|
311
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
341
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.2.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
342
|
|
|
313
343
|
function useRenderElement(element, componentProps, params = {}) {
|
|
314
344
|
const renderProp = componentProps.render;
|
|
@@ -356,6 +386,7 @@ function useRenderElementProps(componentProps, params = {}) {
|
|
|
356
386
|
}
|
|
357
387
|
return outProps;
|
|
358
388
|
}
|
|
389
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
359
390
|
function evaluateRenderProp(element, render, props, state) {
|
|
360
391
|
if (render) {
|
|
361
392
|
if (typeof render === "function") {
|
|
@@ -363,7 +394,17 @@ function evaluateRenderProp(element, render, props, state) {
|
|
|
363
394
|
}
|
|
364
395
|
const mergedProps = mergeProps(props, render.props);
|
|
365
396
|
mergedProps.ref = props.ref;
|
|
366
|
-
|
|
397
|
+
let newElement = render;
|
|
398
|
+
if (_optionalChain([newElement, 'optionalAccess', _6 => _6.$$typeof]) === REACT_LAZY_TYPE) {
|
|
399
|
+
const children = React4.Children.toArray(render);
|
|
400
|
+
newElement = children[0];
|
|
401
|
+
}
|
|
402
|
+
if (process.env.NODE_ENV !== "production") {
|
|
403
|
+
if (!/* @__PURE__ */ React4.isValidElement(newElement)) {
|
|
404
|
+
throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps);
|
|
367
408
|
}
|
|
368
409
|
if (element) {
|
|
369
410
|
if (typeof element === "string") {
|
|
@@ -390,22 +431,31 @@ function renderTag(Tag, props) {
|
|
|
390
431
|
return /* @__PURE__ */ React4.createElement(Tag, props);
|
|
391
432
|
}
|
|
392
433
|
|
|
393
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.
|
|
434
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.2.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
435
|
function useRender(params) {
|
|
395
436
|
return useRenderElement(_nullishCoalesce(params.defaultTagName, () => ( "div")), params, params);
|
|
396
437
|
}
|
|
397
438
|
|
|
398
|
-
// ../../../node_modules/.pnpm/@wordpress+ui@0.
|
|
399
|
-
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='71d20935c2']")) {
|
|
439
|
+
// ../../../node_modules/.pnpm/@wordpress+ui@0.8.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
|
|
440
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='71d20935c2']")) {
|
|
400
441
|
const style = document.createElement("style");
|
|
401
442
|
style.setAttribute("data-wp-hash", "71d20935c2");
|
|
402
443
|
style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}"));
|
|
403
444
|
document.head.appendChild(style);
|
|
404
445
|
}
|
|
405
446
|
var style_default = { "stack": "_19ce0419607e1896__stack" };
|
|
406
|
-
var
|
|
447
|
+
var gapTokens = {
|
|
448
|
+
xs: "var(--wpds-dimension-gap-xs, 4px)",
|
|
449
|
+
sm: "var(--wpds-dimension-gap-sm, 8px)",
|
|
450
|
+
md: "var(--wpds-dimension-gap-md, 12px)",
|
|
451
|
+
lg: "var(--wpds-dimension-gap-lg, 16px)",
|
|
452
|
+
xl: "var(--wpds-dimension-gap-xl, 24px)",
|
|
453
|
+
"2xl": "var(--wpds-dimension-gap-2xl, 32px)",
|
|
454
|
+
"3xl": "var(--wpds-dimension-gap-3xl, 40px)"
|
|
455
|
+
};
|
|
456
|
+
var Stack = _react.forwardRef.call(void 0, function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
|
|
407
457
|
const style = {
|
|
408
|
-
gap: gap &&
|
|
458
|
+
gap: gap && gapTokens[gap],
|
|
409
459
|
alignItems: align,
|
|
410
460
|
justifyContent: justify,
|
|
411
461
|
flexDirection: direction,
|
|
@@ -421,5 +471,18 @@ var Stack = _chunkSUDERBUAcjs.forwardRef.call(void 0, function Stack2({ directio
|
|
|
421
471
|
|
|
422
472
|
|
|
423
473
|
|
|
424
|
-
|
|
425
|
-
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
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.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; exports.Stack = Stack;
|
|
488
|
+
//# sourceMappingURL=chunk-REZTQ4PH.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-REZTQ4PH.cjs","../../../../node_modules/.pnpm/@wordpress+element@6.41.0/node_modules/@wordpress/element/src/react.ts","../../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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","../../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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","../../../../node_modules/.pnpm/@base-ui+react@1.2.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","../../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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","../../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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","../../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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","../../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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","../../../../node_modules/.pnpm/@base-ui+react@1.2.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","../../../../node_modules/.pnpm/@base-ui+react@1.2.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","../../../../node_modules/.pnpm/@base-ui+react@1.2.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","../../../../node_modules/.pnpm/@base-ui+react@1.2.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","../../../../node_modules/.pnpm/@base-ui+utils@0.2.5_@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","../../../../node_modules/.pnpm/@base-ui+react@1.2.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","../../../../node_modules/.pnpm/@wordpress+ui@0.8.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/src/stack/style.module.css","../../../../node_modules/.pnpm/@wordpress+ui@0.8.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/src/stack/stack.t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Aetbd;AACA,EAAA;AACY,EAAA;AACR,EAAA;AACI,EAAA;AAChC;AACwB;ACEqB;AACxC,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACG,EAAA;AACA,EAAA;AACR;AAMwEC;AAIpC,EAAA;AACP,IAAA;AACf,IAAA;AACI,IAAA;AACD,IAAA;AACL,IAAA;AACX,EAAA;AAE2B,EAAA;AAC1B,IAAA;AACA,IAAA;AAC4C,IAAA;AAC3C,EAAA;AAEK,EAAA;AACN;AhB6aoC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-REZTQ4PH.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","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useRefWithInit(sortColumns, columns)\n */\n\nexport function useRefWithInit(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","/**\n * WARNING: Don't import this directly. It's imported by the code generated by\n * `@mui/interal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`\n * constructors to ensure the plugin works as expected. Supported patterns include:\n * throw new Error('My message');\n * throw new Error(`My message: ${foo}`);\n * throw new Error(`My message: ${foo}` + 'another string');\n * ...\n */\nexport default function formatErrorMessage(code, ...args) {\n const url = new URL('https://base-ui.com/production-error');\n url.searchParams.set('code', code.toString());\n args.forEach(arg => url.searchParams.append('args[]', arg));\n return `Base UI error #${code}; visit ${url} for the full message.`;\n}","import _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useMergedRefs, useMergedRefsN } from '@base-ui/utils/useMergedRefs';\nimport { getReactElementRef } from '@base-ui/utils/getReactElementRef';\nimport { mergeObjects } from '@base-ui/utils/mergeObjects';\nimport { getStateAttributesProps } from \"./getStateAttributesProps.js\";\nimport { resolveClassName } from \"./resolveClassName.js\";\nimport { resolveStyle } from \"./resolveStyle.js\";\nimport { mergeProps, mergePropsN, mergeClassNames } from \"../merge-props/index.js\";\nimport { EMPTY_OBJECT } from \"./constants.js\";\nimport { createElement as _createElement } from \"react\";\n/**\n * Renders a Base UI element.\n *\n * @param element The default HTML element to render. Can be overridden by the `render` prop.\n * @param componentProps An object containing the `render` and `className` props to be used for element customization. Other props are ignored.\n * @param params Additional parameters for rendering the element.\n */\nexport function useRenderElement(element, componentProps, params = {}) {\n const renderProp = componentProps.render;\n const outProps = useRenderElementProps(componentProps, params);\n if (params.enabled === false) {\n return null;\n }\n const state = params.state ?? EMPTY_OBJECT;\n return evaluateRenderProp(element, renderProp, outProps, state);\n}\n\n/**\n * Computes render element final props.\n */\nfunction useRenderElementProps(componentProps, params = {}) {\n const {\n className: classNameProp,\n style: styleProp,\n render: renderProp\n } = componentProps;\n const {\n state = EMPTY_OBJECT,\n ref,\n props,\n stateAttributesMapping,\n enabled = true\n } = params;\n const className = enabled ? resolveClassName(classNameProp, state) : undefined;\n const style = enabled ? resolveStyle(styleProp, state) : undefined;\n const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;\n const outProps = enabled ? mergeObjects(stateProps, Array.isArray(props) ? mergePropsN(props) : props) ?? EMPTY_OBJECT : EMPTY_OBJECT;\n\n // SAFETY: The `useMergedRefs` functions use a single hook to store the same value,\n // switching between them at runtime is safe. If this assertion fails, React will\n // throw at runtime anyway.\n // This also skips the `useMergedRefs` call on the server, which is fine because\n // refs are not used on the server side.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (typeof document !== 'undefined') {\n if (!enabled) {\n useMergedRefs(null, null);\n } else if (Array.isArray(ref)) {\n outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);\n } else {\n outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);\n }\n }\n if (!enabled) {\n return EMPTY_OBJECT;\n }\n if (className !== undefined) {\n outProps.className = mergeClassNames(outProps.className, className);\n }\n if (style !== undefined) {\n outProps.style = mergeObjects(outProps.style, style);\n }\n return outProps;\n}\n\n// The symbol React uses internally for lazy components\n// https://github.com/facebook/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31\n//\n// TODO delete once https://github.com/facebook/react/issues/32392 is fixed\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy');\nfunction evaluateRenderProp(element, render, props, state) {\n if (render) {\n if (typeof render === 'function') {\n return render(props, state);\n }\n const mergedProps = mergeProps(props, render.props);\n mergedProps.ref = props.ref;\n let newElement = render;\n\n // Workaround for https://github.com/facebook/react/issues/32392\n // This works because the toArray() logic unwrap lazy element type in\n // https://github.com/facebook/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186\n if (newElement?.$$typeof === REACT_LAZY_TYPE) {\n const children = React.Children.toArray(render);\n newElement = children[0];\n }\n\n // There is a high number of indirections, the error message thrown by React.cloneElement() is\n // hard to use for developers, this logic provides a better context.\n //\n // Our general guideline is to never change the control flow depending on the environment.\n // However, React.cloneElement() throws if React.isValidElement() is false,\n // so we can throw before with custom message.\n if (process.env.NODE_ENV !== 'production') {\n if (! /*#__PURE__*/React.isValidElement(newElement)) {\n throw new Error(['Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.', 'A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.', 'https://base-ui.com/r/invalid-render-prop'].join('\\n'));\n }\n }\n return /*#__PURE__*/React.cloneElement(newElement, mergedProps);\n }\n if (element) {\n if (typeof element === 'string') {\n return renderTag(element, props);\n }\n }\n // Unreachable, but the typings on `useRenderElement` need to be reworked\n // to annotate it correctly.\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: Render element or function are not defined.' : _formatErrorMessage(8));\n}\nfunction renderTag(Tag, props) {\n if (Tag === 'button') {\n return /*#__PURE__*/_createElement(\"button\", {\n type: \"button\",\n ...props,\n key: props.key\n });\n }\n if (Tag === 'img') {\n return /*#__PURE__*/_createElement(\"img\", {\n alt: \"\",\n ...props,\n key: props.key\n });\n }\n return /*#__PURE__*/React.createElement(Tag, props);\n}","import { useRefWithInit } from \"./useRefWithInit.js\";\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n * This makes sure multiple refs are updated together and have the same value.\n *\n * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,\n * use `useMergedRefsN` instead.\n */\n\nexport function useMergedRefs(a, b, c, d) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChange(forkRef, a, b, c, d)) {\n update(forkRef, [a, b, c, d]);\n }\n return forkRef.callback;\n}\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n *\n * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.\n */\nexport function useMergedRefsN(refs) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChangeN(forkRef, refs)) {\n update(forkRef, refs);\n }\n return forkRef.callback;\n}\nfunction createForkRef() {\n return {\n callback: null,\n cleanup: null,\n refs: []\n };\n}\nfunction didChange(forkRef, a, b, c, d) {\n // prettier-ignore\n return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;\n}\nfunction didChangeN(forkRef, newRefs) {\n return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);\n}\nfunction update(forkRef, refs) {\n forkRef.refs = refs;\n if (refs.every(ref => ref == null)) {\n forkRef.callback = null;\n return;\n }\n forkRef.callback = instance => {\n if (forkRef.cleanup) {\n forkRef.cleanup();\n forkRef.cleanup = null;\n }\n if (instance != null) {\n const cleanupCallbacks = Array(refs.length).fill(null);\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const refCleanup = ref(instance);\n if (typeof refCleanup === 'function') {\n cleanupCallbacks[i] = refCleanup;\n }\n break;\n }\n case 'object':\n {\n ref.current = instance;\n break;\n }\n default:\n }\n }\n forkRef.cleanup = () => {\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const cleanupCallback = cleanupCallbacks[i];\n if (typeof cleanupCallback === 'function') {\n cleanupCallback();\n } else {\n ref(null);\n }\n break;\n }\n case 'object':\n {\n ref.current = null;\n break;\n }\n default:\n }\n }\n };\n }\n };\n}","import * as React from 'react';\nimport { isReactVersionAtLeast } from \"./reactVersion.js\";\n\n/**\n * Extracts the `ref` from a React element, handling different React versions.\n */\nexport function getReactElementRef(element) {\n if (! /*#__PURE__*/React.isValidElement(element)) {\n return null;\n }\n const reactElement = element;\n const propsWithRef = reactElement.props;\n return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;\n}","import * as React from 'react';\nconst majorVersion = parseInt(React.version, 10);\nexport function isReactVersionAtLeast(reactVersionToCheck) {\n return majorVersion >= reactVersionToCheck;\n}","export function mergeObjects(a, b) {\n if (a && !b) {\n return a;\n }\n if (!a && b) {\n return b;\n }\n if (a || b) {\n return {\n ...a,\n ...b\n };\n }\n return undefined;\n}","export function getStateAttributesProps(state, customMapping) {\n const props = {};\n\n /* eslint-disable-next-line guard-for-in */\n for (const key in state) {\n const value = state[key];\n if (customMapping?.hasOwnProperty(key)) {\n const customProps = customMapping[key](value);\n if (customProps != null) {\n Object.assign(props, customProps);\n }\n continue;\n }\n if (value === true) {\n props[`data-${key.toLowerCase()}`] = '';\n } else if (value) {\n props[`data-${key.toLowerCase()}`] = value.toString();\n }\n }\n return props;\n}","/**\n * If the provided className is a string, it will be returned as is.\n * Otherwise, the function will call the className function with the state as the first argument.\n *\n * @param className\n * @param state\n */\nexport function resolveClassName(className, state) {\n return typeof className === 'function' ? className(state) : className;\n}","/**\n * If the provided style is an object, it will be returned as is.\n * Otherwise, the function will call the style function with the state as the first argument.\n *\n * @param style\n * @param state\n */\nexport function resolveStyle(style, state) {\n return typeof style === 'function' ? style(state) : style;\n}","import { mergeObjects } from '@base-ui/utils/mergeObjects';\nconst EMPTY_PROPS = {};\n\n/* eslint-disable id-denylist */\n/**\n * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite\n * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.\n *\n * Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).\n * For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing\n * by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),\n * all handlers always execute without prevention capability.\n *\n * The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).\n * The `style` prop is merged with rightmost styles overwriting the prior ones.\n *\n * Props can either be provided as objects or as functions that take the previous props as an argument.\n * The function will receive the merged props up to that point (going from left to right):\n * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.\n * The function is responsible for chaining event handlers if needed (i.e. we don't run the merge logic).\n *\n * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.\n * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.\n *\n * @important **`ref` is not merged.**\n * @param a Props object to merge.\n * @param b Props object to merge. The function will overwrite conflicting props from `a`.\n * @param c Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param d Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param e Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @returns The merged props.\n * @public\n */\n\nexport function mergeProps(a, b, c, d, e) {\n // We need to mutably own `merged`\n let merged = {\n ...resolvePropsGetter(a, EMPTY_PROPS)\n };\n if (b) {\n merged = mergeOne(merged, b);\n }\n if (c) {\n merged = mergeOne(merged, c);\n }\n if (d) {\n merged = mergeOne(merged, d);\n }\n if (e) {\n merged = mergeOne(merged, e);\n }\n return merged;\n}\n/* eslint-enable id-denylist */\n\n/**\n * Merges an arbitrary number of React props using the same logic as {@link mergeProps}.\n * This function accepts an array of props instead of individual arguments.\n *\n * This has slightly lower performance than {@link mergeProps} due to accepting an array\n * instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or\n * fewer prop sets for better performance.\n *\n * @param props Array of props to merge.\n * @returns The merged props.\n * @see mergeProps\n * @public\n */\nexport function mergePropsN(props) {\n if (props.length === 0) {\n return EMPTY_PROPS;\n }\n if (props.length === 1) {\n return resolvePropsGetter(props[0], EMPTY_PROPS);\n }\n\n // We need to mutably own `merged`\n let merged = {\n ...resolvePropsGetter(props[0], EMPTY_PROPS)\n };\n for (let i = 1; i < props.length; i += 1) {\n merged = mergeOne(merged, props[i]);\n }\n return merged;\n}\nfunction mergeOne(merged, inputProps) {\n if (isPropsGetter(inputProps)) {\n return inputProps(merged);\n }\n return mutablyMergeInto(merged, inputProps);\n}\n\n/**\n * Merges two sets of props. In case of conflicts, the external props take precedence.\n */\nfunction mutablyMergeInto(mergedProps, externalProps) {\n if (!externalProps) {\n return mergedProps;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const propName in externalProps) {\n const externalPropValue = externalProps[propName];\n switch (propName) {\n case 'style':\n {\n mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);\n break;\n }\n case 'className':\n {\n mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);\n break;\n }\n default:\n {\n if (isEventHandler(propName, externalPropValue)) {\n mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);\n } else {\n mergedProps[propName] = externalPropValue;\n }\n }\n }\n }\n return mergedProps;\n}\nfunction isEventHandler(key, value) {\n // This approach is more efficient than using a regex.\n const code0 = key.charCodeAt(0);\n const code1 = key.charCodeAt(1);\n const code2 = key.charCodeAt(2);\n return code0 === 111 /* o */ && code1 === 110 /* n */ && code2 >= 65 /* A */ && code2 <= 90 /* Z */ && (typeof value === 'function' || typeof value === 'undefined');\n}\nfunction isPropsGetter(inputProps) {\n return typeof inputProps === 'function';\n}\nfunction resolvePropsGetter(inputProps, previousProps) {\n if (isPropsGetter(inputProps)) {\n return inputProps(previousProps);\n }\n return inputProps ?? EMPTY_PROPS;\n}\nfunction mergeEventHandlers(ourHandler, theirHandler) {\n if (!theirHandler) {\n return ourHandler;\n }\n if (!ourHandler) {\n return theirHandler;\n }\n return event => {\n if (isSyntheticEvent(event)) {\n const baseUIEvent = event;\n makeEventPreventable(baseUIEvent);\n const result = theirHandler(baseUIEvent);\n if (!baseUIEvent.baseUIHandlerPrevented) {\n ourHandler?.(baseUIEvent);\n }\n return result;\n }\n const result = theirHandler(event);\n ourHandler?.(event);\n return result;\n };\n}\nexport function makeEventPreventable(event) {\n event.preventBaseUIHandler = () => {\n event.baseUIHandlerPrevented = true;\n };\n return event;\n}\nexport function mergeClassNames(ourClassName, theirClassName) {\n if (theirClassName) {\n if (ourClassName) {\n // eslint-disable-next-line prefer-template\n return theirClassName + ' ' + ourClassName;\n }\n return theirClassName;\n }\n return ourClassName;\n}\nfunction isSyntheticEvent(event) {\n return event != null && typeof event === 'object' && 'nativeEvent' in event;\n}","export function NOOP() {}\nexport const EMPTY_ARRAY = Object.freeze([]);\nexport const EMPTY_OBJECT = Object.freeze({});","import { useRenderElement } from \"../utils/useRenderElement.js\";\n/**\n * Renders a Base UI element.\n *\n * @public\n */\nexport function useRender(params) {\n return useRenderElement(params.defaultTagName ?? 'div', params, params);\n}","if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='71d20935c2']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"71d20935c2\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"stack\":\"_19ce0419607e1896__stack\"};\n","import { useRender, mergeProps } from '@base-ui/react';\nimport { forwardRef } from '@wordpress/element';\nimport type { GapSize } from '@wordpress/theme';\nimport { type StackProps } from './types';\nimport styles from './style.module.css';\n\n// Static map so that the build-time token fallback plugin can inject fallback\n// values into each `var()` call.\nconst gapTokens: Record< GapSize, string > = {\n\txs: 'var(--wpds-dimension-gap-xs, 4px)',\n\tsm: 'var(--wpds-dimension-gap-sm, 8px)',\n\tmd: 'var(--wpds-dimension-gap-md, 12px)',\n\tlg: 'var(--wpds-dimension-gap-lg, 16px)',\n\txl: 'var(--wpds-dimension-gap-xl, 24px)',\n\t'2xl': 'var(--wpds-dimension-gap-2xl, 32px)',\n\t'3xl': 'var(--wpds-dimension-gap-3xl, 40px)',\n};\n\n/**\n * A flexible layout component using CSS Flexbox for consistent spacing and alignment.\n * Built on design tokens for predictable spacing values.\n */\nexport const Stack = forwardRef< HTMLDivElement, StackProps >( function Stack(\n\t{ direction, gap, align, justify, wrap, render, ...props },\n\tref\n) {\n\tconst style: React.CSSProperties = {\n\t\tgap: gap && gapTokens[ gap ],\n\t\talignItems: align,\n\t\tjustifyContent: justify,\n\t\tflexDirection: direction,\n\t\tflexWrap: wrap,\n\t};\n\n\tconst element = useRender( {\n\t\trender,\n\t\tref,\n\t\tprops: mergeProps< 'div' >( props, { style, className: styles.stack } ),\n\t} );\n\n\treturn element;\n} );\n"]}
|