@automattic/charts 0.56.4 → 0.56.6
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/CHANGELOG.md +16 -0
- package/dist/charts/bar-chart/index.cjs +6 -6
- package/dist/charts/bar-chart/index.css +1 -4
- package/dist/charts/bar-chart/index.css.map +1 -1
- package/dist/charts/bar-chart/index.d.cts +2 -8
- package/dist/charts/bar-chart/index.d.ts +2 -8
- package/dist/charts/bar-chart/index.js +5 -5
- package/dist/charts/bar-list-chart/index.cjs +7 -7
- package/dist/charts/bar-list-chart/index.css +1 -4
- package/dist/charts/bar-list-chart/index.css.map +1 -1
- package/dist/charts/bar-list-chart/index.d.cts +2 -2
- package/dist/charts/bar-list-chart/index.d.ts +2 -2
- package/dist/charts/bar-list-chart/index.js +6 -6
- package/dist/charts/conversion-funnel-chart/index.cjs +5 -5
- package/dist/charts/conversion-funnel-chart/index.css +1 -4
- package/dist/charts/conversion-funnel-chart/index.css.map +1 -1
- package/dist/charts/conversion-funnel-chart/index.d.cts +2 -1
- package/dist/charts/conversion-funnel-chart/index.d.ts +2 -1
- package/dist/charts/conversion-funnel-chart/index.js +4 -4
- package/dist/charts/geo-chart/index.cjs +4 -4
- package/dist/charts/geo-chart/index.css +1 -4
- package/dist/charts/geo-chart/index.css.map +1 -1
- package/dist/charts/geo-chart/index.d.cts +2 -1
- package/dist/charts/geo-chart/index.d.ts +2 -1
- package/dist/charts/geo-chart/index.js +3 -3
- package/dist/charts/leaderboard-chart/index.cjs +5 -5
- package/dist/charts/leaderboard-chart/index.css +1 -4
- package/dist/charts/leaderboard-chart/index.css.map +1 -1
- package/dist/charts/leaderboard-chart/index.d.cts +3 -2
- package/dist/charts/leaderboard-chart/index.d.ts +3 -2
- package/dist/charts/leaderboard-chart/index.js +4 -4
- package/dist/charts/line-chart/index.cjs +6 -6
- package/dist/charts/line-chart/index.css +1 -4
- package/dist/charts/line-chart/index.css.map +1 -1
- package/dist/charts/line-chart/index.d.cts +2 -8
- package/dist/charts/line-chart/index.d.ts +2 -8
- package/dist/charts/line-chart/index.js +5 -5
- package/dist/charts/pie-chart/index.cjs +6 -4
- package/dist/charts/pie-chart/index.cjs.map +1 -1
- package/dist/charts/pie-chart/index.css +13 -7
- package/dist/charts/pie-chart/index.css.map +1 -1
- package/dist/charts/pie-chart/index.d.cts +2 -1
- package/dist/charts/pie-chart/index.d.ts +2 -1
- package/dist/charts/pie-chart/index.js +5 -3
- package/dist/charts/pie-semi-circle-chart/index.cjs +6 -4
- package/dist/charts/pie-semi-circle-chart/index.cjs.map +1 -1
- package/dist/charts/pie-semi-circle-chart/index.css +12 -13
- package/dist/charts/pie-semi-circle-chart/index.css.map +1 -1
- package/dist/charts/pie-semi-circle-chart/index.d.cts +5 -2
- package/dist/charts/pie-semi-circle-chart/index.d.ts +5 -2
- package/dist/charts/pie-semi-circle-chart/index.js +5 -3
- package/dist/charts/sparkline/index.cjs +7 -7
- package/dist/charts/sparkline/index.css +1 -4
- package/dist/charts/sparkline/index.css.map +1 -1
- package/dist/charts/sparkline/index.js +6 -6
- package/dist/{chunk-ZXEFMKVP.cjs → chunk-3EXJP67N.cjs} +7 -7
- package/dist/{chunk-ZXEFMKVP.cjs.map → chunk-3EXJP67N.cjs.map} +1 -1
- package/dist/{chunk-HNEG3EFJ.cjs → chunk-55ZCOYDF.cjs} +117 -132
- package/dist/chunk-55ZCOYDF.cjs.map +1 -0
- package/dist/{chunk-KKPZ4MVF.js → chunk-7FDQGBY7.js} +145 -119
- package/dist/chunk-7FDQGBY7.js.map +1 -0
- package/dist/{chunk-7QDEU3KN.cjs → chunk-ASLARV7L.cjs} +6 -6
- package/dist/chunk-ASLARV7L.cjs.map +1 -0
- package/dist/chunk-BXFD7JIG.cjs +401 -0
- package/dist/chunk-BXFD7JIG.cjs.map +1 -0
- package/dist/{chunk-KMYJJTSR.cjs → chunk-CAFJRZPZ.cjs} +12 -12
- package/dist/{chunk-KMYJJTSR.cjs.map → chunk-CAFJRZPZ.cjs.map} +1 -1
- package/dist/{chunk-WMWAUOQ4.js → chunk-E62LCBGD.js} +4 -4
- package/dist/{chunk-ZY4FXLMM.js → chunk-GWBS65VC.js} +3 -3
- package/dist/{chunk-MEIVKY4K.js → chunk-IS5YYLTV.js} +18 -18
- package/dist/{chunk-MEIVKY4K.js.map → chunk-IS5YYLTV.js.map} +1 -1
- package/dist/{chunk-5N77S5N3.cjs → chunk-K6TGILHX.cjs} +8 -8
- package/dist/{chunk-5N77S5N3.cjs.map → chunk-K6TGILHX.cjs.map} +1 -1
- package/dist/{chunk-EBDUXL5K.js → chunk-KHQPN77E.js} +3 -3
- package/dist/{chunk-SEKPIG5K.js → chunk-KNIMXN6Z.js} +2 -2
- package/dist/{chunk-SEKPIG5K.js.map → chunk-KNIMXN6Z.js.map} +1 -1
- package/dist/{chunk-M7PRGJFE.js → chunk-MDRCAGKZ.js} +4 -4
- package/dist/{chunk-RSYD434G.cjs → chunk-NQJE2CC7.cjs} +120 -98
- package/dist/chunk-NQJE2CC7.cjs.map +1 -0
- package/dist/{chunk-66BXSWMW.cjs → chunk-O2JIANHK.cjs} +25 -25
- package/dist/chunk-O2JIANHK.cjs.map +1 -0
- package/dist/{chunk-R23BFDIW.js → chunk-OMS5QIJN.js} +6 -6
- package/dist/chunk-OMS5QIJN.js.map +1 -0
- package/dist/{chunk-TYIH5LMV.js → chunk-OP6PHB2U.js} +6 -6
- package/dist/chunk-OP6PHB2U.js.map +1 -0
- package/dist/{chunk-AWNCAKZY.js → chunk-RFSHE3HL.js} +60 -16
- package/dist/chunk-RFSHE3HL.js.map +1 -0
- package/dist/{chunk-FZYJM5PN.js → chunk-SSFFCBCF.js} +6 -6
- package/dist/chunk-SSFFCBCF.js.map +1 -0
- package/dist/{chunk-I5467ZJ5.cjs → chunk-SUDERBUA.cjs} +2 -2
- package/dist/{chunk-I5467ZJ5.cjs.map → chunk-SUDERBUA.cjs.map} +1 -1
- package/dist/{chunk-SH32YSZO.cjs → chunk-UFRBUT2D.cjs} +19 -19
- package/dist/{chunk-SH32YSZO.cjs.map → chunk-UFRBUT2D.cjs.map} +1 -1
- package/dist/{chunk-CMHPXSCI.js → chunk-VPAEBI2F.js} +109 -87
- package/dist/chunk-VPAEBI2F.js.map +1 -0
- package/dist/{chunk-CERFRCXD.cjs → chunk-X7JL2NYJ.cjs} +24 -24
- package/dist/chunk-X7JL2NYJ.cjs.map +1 -0
- package/dist/{chunk-PGJAZN2H.js → chunk-XD2HV7M5.js} +77 -92
- package/dist/chunk-XD2HV7M5.js.map +1 -0
- package/dist/{chunk-GBDFC74U.cjs → chunk-YAXY5L7I.cjs} +7 -7
- package/dist/{chunk-GBDFC74U.cjs.map → chunk-YAXY5L7I.cjs.map} +1 -1
- package/dist/{chunk-LSV7F26B.cjs → chunk-YDVHT7GS.cjs} +77 -33
- package/dist/chunk-YDVHT7GS.cjs.map +1 -0
- package/dist/components/legend/index.cjs +2 -2
- package/dist/components/legend/index.css +1 -4
- package/dist/components/legend/index.css.map +1 -1
- package/dist/components/legend/index.d.cts +2 -1
- package/dist/components/legend/index.d.ts +2 -1
- package/dist/components/legend/index.js +1 -1
- package/dist/components/tooltip/index.d.cts +2 -1
- package/dist/components/tooltip/index.d.ts +2 -1
- package/dist/hooks/index.cjs +2 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.css +1 -4
- package/dist/hooks/index.css.map +1 -1
- package/dist/hooks/index.d.cts +10 -7
- package/dist/hooks/index.d.ts +10 -7
- package/dist/hooks/index.js +3 -3
- package/dist/index.cjs +14 -14
- package/dist/index.css +24 -16
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +13 -13
- package/dist/{leaderboard-chart-B5gWcqe7.d.ts → leaderboard-chart-BSgEw_Um.d.ts} +1 -1
- package/dist/{leaderboard-chart-C_6QDcqj.d.cts → leaderboard-chart-COtgamhe.d.cts} +1 -1
- package/dist/providers/index.cjs +2 -2
- package/dist/providers/index.css +1 -4
- package/dist/providers/index.css.map +1 -1
- package/dist/providers/index.d.cts +3 -2
- package/dist/providers/index.d.ts +3 -2
- package/dist/providers/index.js +1 -1
- package/dist/{themes-BDVaIfBz.d.cts → themes-CVR5rmIs.d.cts} +1 -1
- package/dist/{themes-mcS8QNkQ.d.ts → themes-DQzmaSze.d.ts} +1 -1
- package/dist/{types-BCFQlzTM.d.cts → types-CzdN7rUe.d.cts} +12 -3
- package/dist/{types-BCFQlzTM.d.ts → types-CzdN7rUe.d.ts} +12 -3
- package/dist/utils/index.d.cts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/package.json +10 -10
- package/src/charts/bar-chart/bar-chart.tsx +2 -9
- package/src/charts/bar-chart/test/bar-chart.test.tsx +3 -3
- package/src/charts/line-chart/line-chart.tsx +2 -2
- package/src/charts/line-chart/test/line-chart.test.tsx +3 -3
- package/src/charts/line-chart/types.ts +0 -7
- package/src/charts/pie-chart/pie-chart.module.scss +14 -3
- package/src/charts/pie-chart/pie-chart.tsx +172 -148
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +17 -11
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +147 -119
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +46 -6
- package/src/charts/private/with-responsive/test/with-responsive.test.tsx +5 -5
- package/src/charts/private/with-responsive/with-responsive.tsx +8 -7
- package/src/hooks/index.ts +1 -1
- package/src/hooks/test/use-chart-margin.test.tsx +44 -0
- package/src/hooks/test/{use-element-height.test.tsx → use-element-size.test.tsx} +45 -36
- package/src/hooks/use-chart-margin.tsx +92 -6
- package/src/hooks/use-element-size.ts +43 -0
- package/src/hooks/use-tooltip-portal-relocator.module.scss +1 -4
- package/src/hooks/use-tooltip-portal-relocator.ts +11 -0
- package/src/types.ts +13 -3
- package/dist/chunk-4YYROZDJ.cjs +0 -375
- package/dist/chunk-4YYROZDJ.cjs.map +0 -1
- package/dist/chunk-66BXSWMW.cjs.map +0 -1
- package/dist/chunk-7QDEU3KN.cjs.map +0 -1
- package/dist/chunk-AWNCAKZY.js.map +0 -1
- package/dist/chunk-CERFRCXD.cjs.map +0 -1
- package/dist/chunk-CMHPXSCI.js.map +0 -1
- package/dist/chunk-FZYJM5PN.js.map +0 -1
- package/dist/chunk-HNEG3EFJ.cjs.map +0 -1
- package/dist/chunk-KKPZ4MVF.js.map +0 -1
- package/dist/chunk-LSV7F26B.cjs.map +0 -1
- package/dist/chunk-PGJAZN2H.js.map +0 -1
- package/dist/chunk-R23BFDIW.js.map +0 -1
- package/dist/chunk-RSYD434G.cjs.map +0 -1
- package/dist/chunk-TYIH5LMV.js.map +0 -1
- package/src/hooks/use-element-height.ts +0 -37
- /package/dist/{chunk-WMWAUOQ4.js.map → chunk-E62LCBGD.js.map} +0 -0
- /package/dist/{chunk-ZY4FXLMM.js.map → chunk-GWBS65VC.js.map} +0 -0
- /package/dist/{chunk-EBDUXL5K.js.map → chunk-KHQPN77E.js.map} +0 -0
- /package/dist/{chunk-M7PRGJFE.js.map → chunk-MDRCAGKZ.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSUDERBUAcjs = require('./chunk-SUDERBUA.cjs');
|
|
4
4
|
|
|
5
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
5
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useRefWithInit.js
|
|
6
6
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
|
|
7
7
|
var UNINITIALIZED = {};
|
|
8
8
|
function useRefWithInit(init, initArg) {
|
|
@@ -13,7 +13,7 @@ function useRefWithInit(init, initArg) {
|
|
|
13
13
|
return ref;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
16
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/formatErrorMessage.js
|
|
17
17
|
function formatErrorMessage(code, ...args) {
|
|
18
18
|
const url = new URL("https://base-ui.com/production-error");
|
|
19
19
|
url.searchParams.set("code", code.toString());
|
|
@@ -21,10 +21,10 @@ function formatErrorMessage(code, ...args) {
|
|
|
21
21
|
return `Base UI error #${code}; visit ${url} for the full message.`;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
24
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useRenderElement.js
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
27
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useMergedRefs.js
|
|
28
28
|
function useMergedRefs(a, b, c, d) {
|
|
29
29
|
const forkRef = useRefWithInit(createForkRef).current;
|
|
30
30
|
if (didChange(forkRef, a, b, c, d)) {
|
|
@@ -113,17 +113,17 @@ function update(forkRef, refs) {
|
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
116
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/getReactElementRef.js
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
119
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/reactVersion.js
|
|
120
120
|
|
|
121
121
|
var majorVersion = parseInt(React2.version, 10);
|
|
122
122
|
function isReactVersionAtLeast(reactVersionToCheck) {
|
|
123
123
|
return majorVersion >= reactVersionToCheck;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
126
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/getReactElementRef.js
|
|
127
127
|
function getReactElementRef(element) {
|
|
128
128
|
if (!/* @__PURE__ */ React3.isValidElement(element)) {
|
|
129
129
|
return null;
|
|
@@ -133,7 +133,7 @@ function getReactElementRef(element) {
|
|
|
133
133
|
return _nullishCoalesce((isReactVersionAtLeast(19) ? _optionalChain([propsWithRef, 'optionalAccess', _ => _.ref]) : reactElement.ref), () => ( null));
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
136
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/mergeObjects.js
|
|
137
137
|
function mergeObjects(a, b) {
|
|
138
138
|
if (a && !b) {
|
|
139
139
|
return a;
|
|
@@ -150,7 +150,7 @@ function mergeObjects(a, b) {
|
|
|
150
150
|
return void 0;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
153
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/getStateAttributesProps.js
|
|
154
154
|
function getStateAttributesProps(state, customMapping) {
|
|
155
155
|
const props = {};
|
|
156
156
|
for (const key in state) {
|
|
@@ -171,17 +171,17 @@ function getStateAttributesProps(state, customMapping) {
|
|
|
171
171
|
return props;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
174
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveClassName.js
|
|
175
175
|
function resolveClassName(className, state) {
|
|
176
176
|
return typeof className === "function" ? className(state) : className;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
179
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveStyle.js
|
|
180
180
|
function resolveStyle(style, state) {
|
|
181
181
|
return typeof style === "function" ? style(state) : style;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
184
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/merge-props/mergeProps.js
|
|
185
185
|
var EMPTY_PROPS = {};
|
|
186
186
|
function mergeProps(a, b, c, d, e) {
|
|
187
187
|
let merged = {
|
|
@@ -304,11 +304,11 @@ function isSyntheticEvent(event) {
|
|
|
304
304
|
return event != null && typeof event === "object" && "nativeEvent" in event;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.
|
|
307
|
+
// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/empty.js
|
|
308
308
|
var EMPTY_ARRAY = Object.freeze([]);
|
|
309
309
|
var EMPTY_OBJECT = Object.freeze({});
|
|
310
310
|
|
|
311
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
311
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useRenderElement.js
|
|
312
312
|
|
|
313
313
|
function useRenderElement(element, componentProps, params = {}) {
|
|
314
314
|
const renderProp = componentProps.render;
|
|
@@ -390,12 +390,12 @@ function renderTag(Tag, props) {
|
|
|
390
390
|
return /* @__PURE__ */ React4.createElement(Tag, props);
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.
|
|
393
|
+
// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/use-render/useRender.js
|
|
394
394
|
function useRender(params) {
|
|
395
395
|
return useRenderElement(_nullishCoalesce(params.defaultTagName, () => ( "div")), params, params);
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
-
// ../../../node_modules/.pnpm/@wordpress+ui@0.
|
|
398
|
+
// ../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/stack/stack.mjs
|
|
399
399
|
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='71d20935c2']")) {
|
|
400
400
|
const style = document.createElement("style");
|
|
401
401
|
style.setAttribute("data-wp-hash", "71d20935c2");
|
|
@@ -403,7 +403,7 @@ if (typeof document !== "undefined" && !document.head.querySelector("style[data-
|
|
|
403
403
|
document.head.appendChild(style);
|
|
404
404
|
}
|
|
405
405
|
var style_default = { "stack": "_19ce0419607e1896__stack" };
|
|
406
|
-
var Stack =
|
|
406
|
+
var Stack = _chunkSUDERBUAcjs.forwardRef.call(void 0, function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
|
|
407
407
|
const style = {
|
|
408
408
|
gap: gap && `var(--wpds-dimension-gap-${gap})`,
|
|
409
409
|
alignItems: align,
|
|
@@ -422,4 +422,4 @@ var Stack = _chunkI5467ZJ5cjs.forwardRef.call(void 0, function Stack2({ directio
|
|
|
422
422
|
|
|
423
423
|
|
|
424
424
|
exports.Stack = Stack;
|
|
425
|
-
//# sourceMappingURL=chunk-
|
|
425
|
+
//# sourceMappingURL=chunk-UFRBUT2D.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-SH32YSZO.cjs","../../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.26_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.4_@types+react@18.3.26_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.1.0_@types+react@18.3.26_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.4_@types+react@18.3.26_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.4_@types+react@18.3.26_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.4_@types+react@18.3.26_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.4_@types+react@18.3.26_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.1.0_@types+react@18.3.26_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.1.0_@types+react@18.3.26_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.1.0_@types+react@18.3.26_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.1.0_@types+react@18.3.26_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.4_@types+react@18.3.26_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.1.0_@types+react@18.3.26_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.6.0_@types+react@18.3.26_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.6.0_@types+react@18.3.26_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/src/stack/stack.tsx"],"names":["result","Stack"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACFA,qNAAuB;AACvB,IAAM,cAAA,EAAgB,CAAC,CAAA;AAUhB,SAAS,cAAA,CAAe,IAAA,EAAM,OAAA,EAAS;AAC5C,EAAA,MAAM,IAAA,EAAY,KAAA,CAAA,MAAA,CAAO,aAAa,CAAA;AACtC,EAAA,GAAA,CAAI,GAAA,CAAI,QAAA,IAAY,aAAA,EAAe;AACjC,IAAA,GAAA,CAAI,QAAA,EAAU,IAAA,CAAK,OAAO,CAAA;AAAA,EAC5B;AACA,EAAA,OAAO,GAAA;AACT;ADLA;AACA;AENe,SAAR,kBAAA,CAAoC,IAAA,EAAA,GAAS,IAAA,EAAM;AACxD,EAAA,MAAM,IAAA,EAAM,IAAI,GAAA,CAAI,sCAAsC,CAAA;AAC1D,EAAA,GAAA,CAAI,YAAA,CAAa,GAAA,CAAI,MAAA,EAAQ,IAAA,CAAK,QAAA,CAAS,CAAC,CAAA;AAC5C,EAAA,IAAA,CAAK,OAAA,CAAQ,CAAA,GAAA,EAAA,GAAO,GAAA,CAAI,YAAA,CAAa,MAAA,CAAO,QAAA,EAAU,GAAG,CAAC,CAAA;AAC1D,EAA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,MAAA;AACH,MAAA;AACQ,MAAA;AACZ,IAAA;AACH,EAAA;AACmB,EAAA;AACG,IAAA;AACb,MAAA;AACF,MAAA;AACQ,MAAA;AACZ,IAAA;AACH,EAAA;AAC0B,EAAA;AAC5B;AH0RsC;AACA;AalYJ;AACD,EAAA;AACjC;AboYsC;AACA;Ac7Yd;AACA,EAAA;AACY,EAAA;AACR,EAAA;AACI,EAAA;AAChC;AACwB;ACGgDC;AAIpC,EAAA;AACtB,IAAA;AACA,IAAA;AACI,IAAA;AACD,IAAA;AACL,IAAA;AACX,EAAA;AAE2B,EAAA;AAC1B,IAAA;AACA,IAAA;AAC4C,IAAA;AAC3C,EAAA;AAEK,EAAA;AACN;AfwYoC;AACA;AACA;AACA","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-SH32YSZO.cjs","sourcesContent":[null,"'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}\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 return /*#__PURE__*/React.cloneElement(render, 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' && !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 StackProps } from './types';\nimport styles from './style.module.css';\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 && `var(--wpds-dimension-gap-${ 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"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-UFRBUT2D.cjs","../../../../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","../../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/formatErrorMessage.js","../../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useRenderElement.js","../../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useMergedRefs.js","../../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/getReactElementRef.js","../../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/reactVersion.js","../../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/mergeObjects.js","../../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/getStateAttributesProps.js","../../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveClassName.js","../../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveStyle.js","../../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/merge-props/mergeProps.js","../../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/empty.js","../../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/use-render/useRender.js","../../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/src/stack/style.module.css","../../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/src/stack/stack.tsx"],"names":["result","Stack"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACFA,qNAAuB;AACvB,IAAM,cAAA,EAAgB,CAAC,CAAA;AAUhB,SAAS,cAAA,CAAe,IAAA,EAAM,OAAA,EAAS;AAC5C,EAAA,MAAM,IAAA,EAAY,KAAA,CAAA,MAAA,CAAO,aAAa,CAAA;AACtC,EAAA,GAAA,CAAI,GAAA,CAAI,QAAA,IAAY,aAAA,EAAe;AACjC,IAAA,GAAA,CAAI,QAAA,EAAU,IAAA,CAAK,OAAO,CAAA;AAAA,EAC5B;AACA,EAAA,OAAO,GAAA;AACT;ADLA;AACA;AENe,SAAR,kBAAA,CAAoC,IAAA,EAAA,GAAS,IAAA,EAAM;AACxD,EAAA,MAAM,IAAA,EAAM,IAAI,GAAA,CAAI,sCAAsC,CAAA;AAC1D,EAAA,GAAA,CAAI,YAAA,CAAa,GAAA,CAAI,MAAA,EAAQ,IAAA,CAAK,QAAA,CAAS,CAAC,CAAA;AAC5C,EAAA,IAAA,CAAK,OAAA,CAAQ,CAAA,GAAA,EAAA,GAAO,GAAA,CAAI,YAAA,CAAa,MAAA,CAAO,QAAA,EAAU,GAAG,CAAC,CAAA;AAC1D,EAAA,OAAO,CAAA,eAAA,EAAkB,IAAI,CAAA,QAAA,EAAW,GAAG,CAAA,sBAAA,CAAA;AAC7C;AFQA;AAC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AAA;AACQ,MAAA;AACZ,IAAA;AACH,EAAA;AAC0B,EAAA;AAC5B;AH0RsC;AACA;AalYJ;AACD,EAAA;AACjC;AboYsC;AACA;Ac7Yd;AACA,EAAA;AACY,EAAA;AACR,EAAA;AACI,EAAA;AAChC;AACwB;ACGgDC;AAIpC,EAAA;AACtB,IAAA;AACA,IAAA;AACI,IAAA;AACD,IAAA;AACL,IAAA;AACX,EAAA;AAE2B,EAAA;AAC1B,IAAA;AACA,IAAA;AAC4C,IAAA;AAC3C,EAAA;AAEK,EAAA;AACN;AfwYoC;AACA;AACA;AACA","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-UFRBUT2D.cjs","sourcesContent":[null,"'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}\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 return /*#__PURE__*/React.cloneElement(render, 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' && !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 StackProps } from './types';\nimport styles from './style.module.css';\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 && `var(--wpds-dimension-gap-${ 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"]}
|
|
@@ -9,9 +9,12 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
BaseTooltip
|
|
11
11
|
} from "./chunk-BPYKWMI7.js";
|
|
12
|
+
import {
|
|
13
|
+
Stack
|
|
14
|
+
} from "./chunk-IS5YYLTV.js";
|
|
12
15
|
import {
|
|
13
16
|
withResponsive
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OP6PHB2U.js";
|
|
15
18
|
import {
|
|
16
19
|
GlobalChartsContext,
|
|
17
20
|
GlobalChartsProvider,
|
|
@@ -20,11 +23,11 @@ import {
|
|
|
20
23
|
useChartId,
|
|
21
24
|
useChartLegendItems,
|
|
22
25
|
useChartRegistration,
|
|
23
|
-
|
|
26
|
+
useElementSize,
|
|
24
27
|
useGlobalChartsContext,
|
|
25
28
|
useInteractiveLegendData,
|
|
26
29
|
usePrefersReducedMotion
|
|
27
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-RFSHE3HL.js";
|
|
28
31
|
import {
|
|
29
32
|
attachSubComponents
|
|
30
33
|
} from "./chunk-TE63Y5PX.js";
|
|
@@ -40,8 +43,9 @@ import { useCallback, useContext, useMemo } from "react";
|
|
|
40
43
|
|
|
41
44
|
// src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss
|
|
42
45
|
var pie_semi_circle_chart_module_default = {
|
|
46
|
+
"pie-semi-circle-chart--responsive": "a8ccharts-V0wiEb",
|
|
47
|
+
"pie-semi-circle-chart__svg-wrapper": "a8ccharts-hGowej",
|
|
43
48
|
"pie-semi-circle-chart": "a8ccharts-8tyaQj",
|
|
44
|
-
"pie-semi-circle-chart--legend-top": "a8ccharts-M1lF7A",
|
|
45
49
|
"label": "a8ccharts-EKZS3j",
|
|
46
50
|
"note": "a8ccharts-v85A8-"
|
|
47
51
|
};
|
|
@@ -59,6 +63,7 @@ var renderDefaultPieSemiCircleTooltip = ({
|
|
|
59
63
|
});
|
|
60
64
|
};
|
|
61
65
|
var PAD_ANGLE = 0.03;
|
|
66
|
+
var DEFAULT_WIDTH = 400;
|
|
62
67
|
var validateData = (data) => {
|
|
63
68
|
if (!data.length) {
|
|
64
69
|
return {
|
|
@@ -88,7 +93,8 @@ var validateData = (data) => {
|
|
|
88
93
|
var PieSemiCircleChartInternal = ({
|
|
89
94
|
data,
|
|
90
95
|
chartId: providedChartId,
|
|
91
|
-
width
|
|
96
|
+
width: propWidth,
|
|
97
|
+
height: propHeight,
|
|
92
98
|
thickness = 0.4,
|
|
93
99
|
clockwise = true,
|
|
94
100
|
withTooltips = false,
|
|
@@ -109,10 +115,11 @@ var PieSemiCircleChartInternal = ({
|
|
|
109
115
|
children,
|
|
110
116
|
tooltipOffsetX = 0,
|
|
111
117
|
tooltipOffsetY = -15,
|
|
112
|
-
renderTooltip = renderDefaultPieSemiCircleTooltip
|
|
118
|
+
renderTooltip = renderDefaultPieSemiCircleTooltip,
|
|
119
|
+
gap = "md"
|
|
113
120
|
}) => {
|
|
114
121
|
const chartId = useChartId(providedChartId);
|
|
115
|
-
const [
|
|
122
|
+
const [svgWrapperRef, svgWrapperWidth, svgWrapperHeight] = useElementSize();
|
|
116
123
|
const {
|
|
117
124
|
tooltipOpen,
|
|
118
125
|
tooltipLeft,
|
|
@@ -194,12 +201,15 @@ var PieSemiCircleChartInternal = ({
|
|
|
194
201
|
metadata: chartMetadata
|
|
195
202
|
});
|
|
196
203
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
204
|
+
const effectiveWidth = propWidth || DEFAULT_WIDTH;
|
|
197
205
|
if (!isValid) {
|
|
206
|
+
const errorWidth = propHeight ? Math.min(propWidth || propHeight * 2, propHeight * 2) : effectiveWidth;
|
|
207
|
+
const errorHeight = errorWidth / 2;
|
|
198
208
|
return /* @__PURE__ */ _jsx("div", {
|
|
199
209
|
className: pie_semi_circle_chart_module_default["pie-semi-circle-chart"],
|
|
200
210
|
children: /* @__PURE__ */ _jsx("svg", {
|
|
201
|
-
width,
|
|
202
|
-
height:
|
|
211
|
+
width: errorWidth,
|
|
212
|
+
height: errorHeight,
|
|
203
213
|
children: /* @__PURE__ */ _jsx("text", {
|
|
204
214
|
x: "50%",
|
|
205
215
|
y: "50%",
|
|
@@ -210,9 +220,11 @@ var PieSemiCircleChartInternal = ({
|
|
|
210
220
|
})
|
|
211
221
|
});
|
|
212
222
|
}
|
|
223
|
+
const availableWidth = svgWrapperWidth > 0 ? svgWrapperWidth : effectiveWidth;
|
|
224
|
+
const availableHeight = svgWrapperHeight > 0 ? svgWrapperHeight : propHeight || effectiveWidth / 2;
|
|
225
|
+
const width = Math.min(availableWidth, availableHeight * 2);
|
|
213
226
|
const height = width / 2;
|
|
214
|
-
const
|
|
215
|
-
const radius = Math.min(width / 2, chartHeight);
|
|
227
|
+
const radius = height;
|
|
216
228
|
const innerRadius = radius * (1 - thickness);
|
|
217
229
|
const dataWithIndex = visibleData.map((d) => {
|
|
218
230
|
const originalIndex = data.findIndex((item) => item.label === d.label);
|
|
@@ -223,79 +235,100 @@ var PieSemiCircleChartInternal = ({
|
|
|
223
235
|
});
|
|
224
236
|
const startAngle = clockwise ? -Math.PI / 2 : Math.PI / 2;
|
|
225
237
|
const endAngle = clockwise ? Math.PI / 2 : -Math.PI / 2;
|
|
238
|
+
const legendElement = showLegend && /* @__PURE__ */ _jsx(Legend, {
|
|
239
|
+
orientation: legendOrientation,
|
|
240
|
+
position: legendPosition,
|
|
241
|
+
alignment: legendAlignment,
|
|
242
|
+
maxWidth: legendMaxWidth,
|
|
243
|
+
textOverflow: legendTextOverflow,
|
|
244
|
+
legendItemClassName,
|
|
245
|
+
shape: legendShape,
|
|
246
|
+
chartId,
|
|
247
|
+
interactive: legendInteractive
|
|
248
|
+
});
|
|
226
249
|
return /* @__PURE__ */ _jsx(SingleChartContext.Provider, {
|
|
227
250
|
value: {
|
|
228
251
|
chartId,
|
|
229
252
|
chartWidth: width,
|
|
230
|
-
chartHeight:
|
|
253
|
+
chartHeight: height
|
|
231
254
|
},
|
|
232
|
-
children: /* @__PURE__ */ _jsxs(
|
|
255
|
+
children: /* @__PURE__ */ _jsxs(Stack, {
|
|
233
256
|
ref: containerRef,
|
|
257
|
+
direction: "column",
|
|
258
|
+
gap,
|
|
234
259
|
className: clsx("pie-semi-circle-chart", pie_semi_circle_chart_module_default["pie-semi-circle-chart"], {
|
|
235
|
-
[pie_semi_circle_chart_module_default["pie-semi-circle-chart--
|
|
260
|
+
[pie_semi_circle_chart_module_default["pie-semi-circle-chart--responsive"]]: !propWidth && !propHeight
|
|
236
261
|
}, className),
|
|
237
|
-
|
|
238
|
-
width,
|
|
239
|
-
height:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
mask: animation && !prefersReducedMotion ? `url(#radial-wipe-${chartId})` : null,
|
|
253
|
-
children: allSegmentsHidden ? /* @__PURE__ */ _jsx("text", {
|
|
254
|
-
textAnchor: "middle",
|
|
255
|
-
y: -radius / 2,
|
|
256
|
-
fill: "#ccc",
|
|
257
|
-
fontSize: "14",
|
|
258
|
-
fontFamily: "-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif",
|
|
259
|
-
children: __("All segments are hidden. Click legend items to show data.", "jetpack-charts")
|
|
260
|
-
}) : /* @__PURE__ */ _jsxs(_Fragment, {
|
|
261
|
-
children: [/* @__PURE__ */ _jsx(Pie, {
|
|
262
|
-
data: dataWithIndex,
|
|
263
|
-
pieValue: accessors.value,
|
|
264
|
-
outerRadius: radius,
|
|
262
|
+
style: {
|
|
263
|
+
width: propWidth || void 0,
|
|
264
|
+
height: propHeight || void 0
|
|
265
|
+
},
|
|
266
|
+
children: [legendPosition === "top" && legendElement, /* @__PURE__ */ _jsx("div", {
|
|
267
|
+
ref: svgWrapperRef,
|
|
268
|
+
className: pie_semi_circle_chart_module_default["pie-semi-circle-chart__svg-wrapper"],
|
|
269
|
+
children: /* @__PURE__ */ _jsxs("svg", {
|
|
270
|
+
width,
|
|
271
|
+
height,
|
|
272
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
273
|
+
children: [/* @__PURE__ */ _jsx("defs", {
|
|
274
|
+
children: /* @__PURE__ */ _jsx(radial_wipe_animation_default, {
|
|
275
|
+
id: `radial-wipe-${chartId}`,
|
|
276
|
+
radius,
|
|
265
277
|
innerRadius,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
278
|
+
startAngle: "-180deg",
|
|
279
|
+
wipePercentage: 50
|
|
280
|
+
})
|
|
281
|
+
}), /* @__PURE__ */ _jsx(Group, {
|
|
282
|
+
top: height,
|
|
283
|
+
left: width / 2,
|
|
284
|
+
mask: animation && !prefersReducedMotion ? `url(#radial-wipe-${chartId})` : null,
|
|
285
|
+
children: allSegmentsHidden ? /* @__PURE__ */ _jsx("text", {
|
|
286
|
+
textAnchor: "middle",
|
|
287
|
+
y: -radius / 2,
|
|
288
|
+
fill: "#ccc",
|
|
289
|
+
fontSize: "14",
|
|
290
|
+
fontFamily: "-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif",
|
|
291
|
+
children: __("All segments are hidden. Click legend items to show data.", "jetpack-charts")
|
|
292
|
+
}) : /* @__PURE__ */ _jsxs(_Fragment, {
|
|
293
|
+
children: [/* @__PURE__ */ _jsx(Pie, {
|
|
294
|
+
data: dataWithIndex,
|
|
295
|
+
pieValue: accessors.value,
|
|
296
|
+
outerRadius: radius,
|
|
297
|
+
innerRadius,
|
|
298
|
+
cornerRadius: 3,
|
|
299
|
+
padAngle: PAD_ANGLE,
|
|
300
|
+
startAngle,
|
|
301
|
+
endAngle,
|
|
302
|
+
pieSort: accessors.sort,
|
|
303
|
+
children: (pie) => {
|
|
304
|
+
return pie.arcs.map((arc) => /* @__PURE__ */ _jsx("g", {
|
|
305
|
+
onMouseMove: withTooltips ? handleArcMouseMove(arc) : void 0,
|
|
306
|
+
onMouseLeave: withTooltips ? handleMouseLeave : void 0,
|
|
307
|
+
children: /* @__PURE__ */ _jsx("path", {
|
|
308
|
+
d: pie.path(arc) || "",
|
|
309
|
+
fill: accessors.fill(arc.data)
|
|
310
|
+
})
|
|
311
|
+
}, arc.data.label));
|
|
312
|
+
}
|
|
313
|
+
}), /* @__PURE__ */ _jsxs(Group, {
|
|
314
|
+
children: [/* @__PURE__ */ _jsx(Text, {
|
|
315
|
+
textAnchor: "middle",
|
|
316
|
+
verticalAnchor: "start",
|
|
317
|
+
y: -40,
|
|
318
|
+
className: pie_semi_circle_chart_module_default.label,
|
|
319
|
+
children: label
|
|
320
|
+
}), /* @__PURE__ */ _jsx(Text, {
|
|
321
|
+
textAnchor: "middle",
|
|
322
|
+
verticalAnchor: "start",
|
|
323
|
+
y: -20,
|
|
324
|
+
className: pie_semi_circle_chart_module_default.note,
|
|
325
|
+
children: note
|
|
326
|
+
})]
|
|
327
|
+
}), !allSegmentsHidden && svgChildren]
|
|
328
|
+
})
|
|
329
|
+
})]
|
|
330
|
+
})
|
|
331
|
+
}), legendPosition !== "top" && legendElement, withTooltips && tooltipOpen && tooltipData && /* @__PURE__ */ _jsx(TooltipInPortal, {
|
|
299
332
|
top: tooltipTop || 0,
|
|
300
333
|
left: tooltipLeft || 0,
|
|
301
334
|
children: /* @__PURE__ */ _jsx("div", {
|
|
@@ -304,17 +337,6 @@ var PieSemiCircleChartInternal = ({
|
|
|
304
337
|
tooltipData
|
|
305
338
|
})
|
|
306
339
|
})
|
|
307
|
-
}), showLegend && /* @__PURE__ */ _jsx(Legend, {
|
|
308
|
-
orientation: legendOrientation,
|
|
309
|
-
position: legendPosition,
|
|
310
|
-
alignment: legendAlignment,
|
|
311
|
-
maxWidth: legendMaxWidth,
|
|
312
|
-
textOverflow: legendTextOverflow,
|
|
313
|
-
legendItemClassName,
|
|
314
|
-
shape: legendShape,
|
|
315
|
-
ref: legendRef,
|
|
316
|
-
chartId,
|
|
317
|
-
interactive: legendInteractive
|
|
318
340
|
}), htmlChildren, otherChildren]
|
|
319
341
|
})
|
|
320
342
|
});
|
|
@@ -348,4 +370,4 @@ export {
|
|
|
348
370
|
PieSemiCircleChart,
|
|
349
371
|
PieSemiCircleChartResponsive
|
|
350
372
|
};
|
|
351
|
-
//# sourceMappingURL=chunk-
|
|
373
|
+
//# sourceMappingURL=chunk-VPAEBI2F.js.map
|