@automattic/charts 0.56.5 → 0.56.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +135 -0
- package/CHANGELOG.md +17 -0
- package/README.md +2 -1
- package/dist/charts/bar-chart/index.cjs +6 -6
- package/dist/charts/bar-chart/index.css +1 -4
- package/dist/charts/bar-chart/index.css.map +1 -1
- package/dist/charts/bar-chart/index.d.cts +2 -8
- package/dist/charts/bar-chart/index.d.ts +2 -8
- package/dist/charts/bar-chart/index.js +5 -5
- package/dist/charts/bar-list-chart/index.cjs +7 -7
- package/dist/charts/bar-list-chart/index.css +1 -4
- package/dist/charts/bar-list-chart/index.css.map +1 -1
- package/dist/charts/bar-list-chart/index.d.cts +2 -2
- package/dist/charts/bar-list-chart/index.d.ts +2 -2
- package/dist/charts/bar-list-chart/index.js +6 -6
- package/dist/charts/conversion-funnel-chart/index.cjs +5 -5
- package/dist/charts/conversion-funnel-chart/index.css +1 -4
- package/dist/charts/conversion-funnel-chart/index.css.map +1 -1
- package/dist/charts/conversion-funnel-chart/index.d.cts +2 -1
- package/dist/charts/conversion-funnel-chart/index.d.ts +2 -1
- package/dist/charts/conversion-funnel-chart/index.js +4 -4
- package/dist/charts/geo-chart/index.cjs +4 -4
- package/dist/charts/geo-chart/index.css +1 -4
- package/dist/charts/geo-chart/index.css.map +1 -1
- package/dist/charts/geo-chart/index.d.cts +2 -1
- package/dist/charts/geo-chart/index.d.ts +2 -1
- package/dist/charts/geo-chart/index.js +3 -3
- package/dist/charts/leaderboard-chart/index.cjs +5 -5
- package/dist/charts/leaderboard-chart/index.css +1 -4
- package/dist/charts/leaderboard-chart/index.css.map +1 -1
- package/dist/charts/leaderboard-chart/index.d.cts +3 -2
- package/dist/charts/leaderboard-chart/index.d.ts +3 -2
- package/dist/charts/leaderboard-chart/index.js +4 -4
- package/dist/charts/line-chart/index.cjs +6 -6
- package/dist/charts/line-chart/index.css +1 -4
- package/dist/charts/line-chart/index.css.map +1 -1
- package/dist/charts/line-chart/index.d.cts +2 -8
- package/dist/charts/line-chart/index.d.ts +2 -8
- package/dist/charts/line-chart/index.js +5 -5
- package/dist/charts/pie-chart/index.cjs +6 -4
- package/dist/charts/pie-chart/index.cjs.map +1 -1
- package/dist/charts/pie-chart/index.css +13 -7
- package/dist/charts/pie-chart/index.css.map +1 -1
- package/dist/charts/pie-chart/index.d.cts +2 -1
- package/dist/charts/pie-chart/index.d.ts +2 -1
- package/dist/charts/pie-chart/index.js +5 -3
- package/dist/charts/pie-semi-circle-chart/index.cjs +6 -4
- package/dist/charts/pie-semi-circle-chart/index.cjs.map +1 -1
- package/dist/charts/pie-semi-circle-chart/index.css +12 -13
- package/dist/charts/pie-semi-circle-chart/index.css.map +1 -1
- package/dist/charts/pie-semi-circle-chart/index.d.cts +5 -2
- package/dist/charts/pie-semi-circle-chart/index.d.ts +5 -2
- package/dist/charts/pie-semi-circle-chart/index.js +5 -3
- package/dist/charts/sparkline/index.cjs +7 -7
- package/dist/charts/sparkline/index.css +1 -4
- package/dist/charts/sparkline/index.css.map +1 -1
- package/dist/charts/sparkline/index.js +6 -6
- package/dist/{chunk-NGHXTIUE.cjs → chunk-3EXJP67N.cjs} +7 -7
- package/dist/{chunk-NGHXTIUE.cjs.map → chunk-3EXJP67N.cjs.map} +1 -1
- package/dist/{chunk-FIFSYVN6.cjs → chunk-55ZCOYDF.cjs} +117 -132
- package/dist/chunk-55ZCOYDF.cjs.map +1 -0
- package/dist/{chunk-LT4YOIMM.js → chunk-7FDQGBY7.js} +145 -119
- package/dist/chunk-7FDQGBY7.js.map +1 -0
- package/dist/{chunk-7QDEU3KN.cjs → chunk-ASLARV7L.cjs} +6 -6
- package/dist/chunk-ASLARV7L.cjs.map +1 -0
- package/dist/chunk-BXFD7JIG.cjs +401 -0
- package/dist/chunk-BXFD7JIG.cjs.map +1 -0
- package/dist/{chunk-XCXAWMJQ.cjs → chunk-CAFJRZPZ.cjs} +12 -12
- package/dist/{chunk-XCXAWMJQ.cjs.map → chunk-CAFJRZPZ.cjs.map} +1 -1
- package/dist/{chunk-KHRPRH4V.js → chunk-E62LCBGD.js} +4 -4
- package/dist/{chunk-PCOI2GT5.js → chunk-GWBS65VC.js} +3 -3
- package/dist/{chunk-MEIVKY4K.js → chunk-IS5YYLTV.js} +18 -18
- package/dist/{chunk-MEIVKY4K.js.map → chunk-IS5YYLTV.js.map} +1 -1
- package/dist/{chunk-Q6G3BGCL.cjs → chunk-K6TGILHX.cjs} +8 -8
- package/dist/{chunk-Q6G3BGCL.cjs.map → chunk-K6TGILHX.cjs.map} +1 -1
- package/dist/{chunk-X6GX4QUJ.js → chunk-KHQPN77E.js} +3 -3
- package/dist/{chunk-SEKPIG5K.js → chunk-KNIMXN6Z.js} +2 -2
- package/dist/{chunk-SEKPIG5K.js.map → chunk-KNIMXN6Z.js.map} +1 -1
- package/dist/{chunk-AFWQR3SM.js → chunk-MDRCAGKZ.js} +4 -4
- package/dist/{chunk-TKPK4RFS.cjs → chunk-NQJE2CC7.cjs} +120 -98
- package/dist/chunk-NQJE2CC7.cjs.map +1 -0
- package/dist/{chunk-FY325WQ4.cjs → chunk-O2JIANHK.cjs} +25 -25
- package/dist/chunk-O2JIANHK.cjs.map +1 -0
- package/dist/{chunk-DLSUC7RN.js → chunk-OMS5QIJN.js} +6 -6
- package/dist/chunk-OMS5QIJN.js.map +1 -0
- package/dist/{chunk-TYIH5LMV.js → chunk-OP6PHB2U.js} +6 -6
- package/dist/chunk-OP6PHB2U.js.map +1 -0
- package/dist/{chunk-32ESS4MV.js → chunk-RFSHE3HL.js} +17 -7
- package/dist/chunk-RFSHE3HL.js.map +1 -0
- package/dist/{chunk-KXSLMOW5.js → chunk-SSFFCBCF.js} +6 -6
- package/dist/chunk-SSFFCBCF.js.map +1 -0
- package/dist/{chunk-I5467ZJ5.cjs → chunk-SUDERBUA.cjs} +2 -2
- package/dist/{chunk-I5467ZJ5.cjs.map → chunk-SUDERBUA.cjs.map} +1 -1
- package/dist/{chunk-SH32YSZO.cjs → chunk-UFRBUT2D.cjs} +19 -19
- package/dist/{chunk-SH32YSZO.cjs.map → chunk-UFRBUT2D.cjs.map} +1 -1
- package/dist/{chunk-7TQSPLIN.js → chunk-VPAEBI2F.js} +109 -87
- package/dist/chunk-VPAEBI2F.js.map +1 -0
- package/dist/{chunk-IHESL7H5.cjs → chunk-X7JL2NYJ.cjs} +24 -24
- package/dist/chunk-X7JL2NYJ.cjs.map +1 -0
- package/dist/{chunk-DBY6C4O2.js → chunk-XD2HV7M5.js} +77 -92
- package/dist/chunk-XD2HV7M5.js.map +1 -0
- package/dist/{chunk-LTPJPIDP.cjs → chunk-YAXY5L7I.cjs} +7 -7
- package/dist/{chunk-LTPJPIDP.cjs.map → chunk-YAXY5L7I.cjs.map} +1 -1
- package/dist/{chunk-EJJO2QNB.cjs → chunk-YDVHT7GS.cjs} +17 -7
- package/dist/chunk-YDVHT7GS.cjs.map +1 -0
- package/dist/components/legend/index.cjs +2 -2
- package/dist/components/legend/index.css +1 -4
- package/dist/components/legend/index.css.map +1 -1
- package/dist/components/legend/index.d.cts +2 -1
- package/dist/components/legend/index.d.ts +2 -1
- package/dist/components/legend/index.js +1 -1
- package/dist/components/tooltip/index.d.cts +2 -1
- package/dist/components/tooltip/index.d.ts +2 -1
- package/dist/hooks/index.cjs +2 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.css +1 -4
- package/dist/hooks/index.css.map +1 -1
- package/dist/hooks/index.d.cts +10 -7
- package/dist/hooks/index.d.ts +10 -7
- package/dist/hooks/index.js +3 -3
- package/dist/index.cjs +14 -14
- package/dist/index.css +24 -16
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +13 -13
- package/dist/{leaderboard-chart-B5gWcqe7.d.ts → leaderboard-chart-BSgEw_Um.d.ts} +1 -1
- package/dist/{leaderboard-chart-C_6QDcqj.d.cts → leaderboard-chart-COtgamhe.d.cts} +1 -1
- package/dist/providers/index.cjs +2 -2
- package/dist/providers/index.css +1 -4
- package/dist/providers/index.css.map +1 -1
- package/dist/providers/index.d.cts +3 -2
- package/dist/providers/index.d.ts +3 -2
- package/dist/providers/index.js +1 -1
- package/dist/{themes-BDVaIfBz.d.cts → themes-CVR5rmIs.d.cts} +1 -1
- package/dist/{themes-mcS8QNkQ.d.ts → themes-DQzmaSze.d.ts} +1 -1
- package/dist/{types-BCFQlzTM.d.ts → types-CzdN7rUe.d.cts} +12 -3
- package/dist/{types-BCFQlzTM.d.cts → types-CzdN7rUe.d.ts} +12 -3
- package/dist/utils/index.d.cts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/package.json +9 -9
- package/src/charts/bar-chart/bar-chart.tsx +2 -9
- package/src/charts/bar-chart/test/bar-chart.test.tsx +3 -3
- package/src/charts/line-chart/line-chart.tsx +2 -2
- package/src/charts/line-chart/test/line-chart.test.tsx +3 -3
- package/src/charts/line-chart/types.ts +0 -7
- package/src/charts/pie-chart/pie-chart.module.scss +14 -3
- package/src/charts/pie-chart/pie-chart.tsx +172 -148
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +17 -11
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +147 -119
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +46 -6
- package/src/charts/private/with-responsive/test/with-responsive.test.tsx +5 -5
- package/src/charts/private/with-responsive/with-responsive.tsx +8 -7
- package/src/hooks/index.ts +1 -1
- package/src/hooks/test/{use-element-height.test.tsx → use-element-size.test.tsx} +45 -36
- package/src/hooks/use-element-size.ts +43 -0
- package/src/hooks/use-tooltip-portal-relocator.module.scss +1 -4
- package/src/hooks/use-tooltip-portal-relocator.ts +11 -0
- package/src/types.ts +13 -3
- package/dist/chunk-32ESS4MV.js.map +0 -1
- package/dist/chunk-7QDEU3KN.cjs.map +0 -1
- package/dist/chunk-7TQSPLIN.js.map +0 -1
- package/dist/chunk-DBY6C4O2.js.map +0 -1
- package/dist/chunk-DLSUC7RN.js.map +0 -1
- package/dist/chunk-EJJO2QNB.cjs.map +0 -1
- package/dist/chunk-FIFSYVN6.cjs.map +0 -1
- package/dist/chunk-FY325WQ4.cjs.map +0 -1
- package/dist/chunk-IHESL7H5.cjs.map +0 -1
- package/dist/chunk-JL4ZKKZU.cjs +0 -375
- package/dist/chunk-JL4ZKKZU.cjs.map +0 -1
- package/dist/chunk-KXSLMOW5.js.map +0 -1
- package/dist/chunk-LT4YOIMM.js.map +0 -1
- package/dist/chunk-TKPK4RFS.cjs.map +0 -1
- package/dist/chunk-TYIH5LMV.js.map +0 -1
- package/src/hooks/use-element-height.ts +0 -37
- /package/dist/{chunk-KHRPRH4V.js.map → chunk-E62LCBGD.js.map} +0 -0
- /package/dist/{chunk-PCOI2GT5.js.map → chunk-GWBS65VC.js.map} +0 -0
- /package/dist/{chunk-X6GX4QUJ.js.map → chunk-KHQPN77E.js.map} +0 -0
- /package/dist/{chunk-AFWQR3SM.js.map → chunk-MDRCAGKZ.js.map} +0 -0
|
@@ -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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;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;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ACjB,EAAA;AACa,EAAA;AACrB,IAAA;AACT,EAAA;AAC8B,EAAA;AACK,EAAA;AACrC;AAK+B;AACvB,EAAA;AACO,IAAA;AACJ,IAAA;AACC,IAAA;AACN,EAAA;AACE,EAAA;AACI,IAAA;AACR,IAAA;AACA,IAAA;AACA,IAAA;AACU,IAAA;AACR,EAAA;AACwB,EAAA;AACJ,EAAA;AACK,EAAA;AACF,EAAA;AAQH,EAAA;AACR,IAAA;AACY,MAAA;AACK,IAAA;AACE,MAAA;AAC1B,IAAA;AACwB,MAAA;AAC/B,IAAA;AACF,EAAA;AACc,EAAA;AACL,IAAA;AACT,EAAA;AAC6B,EAAA;AACN,IAAA;AACvB,EAAA;AACyB,EAAA;AACO,IAAA;AAChC,EAAA;AACO,EAAA;AACT;AACqC;AACvB,EAAA;AACwB,IAAA;AACN,MAAA;AAC5B,IAAA;AAC+B,IAAA;AACP,IAAA;AACE,IAAA;AAC5B,EAAA;AACa,EAAA;AACsB,IAAA;AACA,MAAA;AACjC,IAAA;AACF,EAAA;AAG4B,EAAA;AAC9B;AAC+B;AACP,EAAA;AACA,IAAA;AACZ,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-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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx","../src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss"],"sourcesContent":["import { Group } from '@visx/group';\nimport { Pie } from '@visx/shape';\nimport { Text } from '@visx/text';\nimport { useTooltip, useTooltipInPortal } from '@visx/tooltip';\nimport { __ } from '@wordpress/i18n';\nimport { Stack } from '@wordpress/ui';\nimport clsx from 'clsx';\nimport { useCallback, useContext, useMemo } from 'react';\nimport { Legend, useChartLegendItems } from '../../components/legend';\nimport { BaseTooltip } from '../../components/tooltip';\nimport { useElementSize, useInteractiveLegendData, usePrefersReducedMotion } from '../../hooks';\nimport { GlobalChartsProvider, useChartId, useChartRegistration, useGlobalChartsContext, GlobalChartsContext } from '../../providers';\nimport { attachSubComponents } from '../../utils';\nimport { ChartSVG, ChartHTML, useChartChildren } from '../private/chart-composition';\nimport { RadialWipeAnimation } from '../private/radial-wipe-animation';\nimport { SingleChartContext } from '../private/single-chart-context';\nimport { withResponsive } from '../private/with-responsive';\nimport styles from './pie-semi-circle-chart.module.scss';\n\n/**\n * Parameters passed to the renderTooltip function for semi-circle charts.\n */\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\n/**\n * Default tooltip renderer for semi-circle pie charts.\n * Renders a BaseTooltip with the hovered segment's data.\n *\n * @param {PieSemiCircleChartRenderTooltipParams} params - The tooltip parameters containing the hovered data point\n * @return {ReactNode} The rendered tooltip content\n */\nconst renderDefaultPieSemiCircleTooltip = ({\n tooltipData\n}) => {\n return /*#__PURE__*/_jsx(BaseTooltip, {\n data: tooltipData,\n top: 0,\n left: 0,\n renderContainer: false\n });\n};\nconst PAD_ANGLE = 0.03; // Padding between segments\nconst DEFAULT_WIDTH = 400;\n\n// Base props type with optional responsive properties\n\n// Composition API types\n\n/**\n * Validates the semi-circle pie chart data\n * @param data - The data to validate\n * @return Object containing validation result and error message\n */\nconst validateData = data => {\n if (!data.length) {\n return {\n isValid: false,\n message: 'No data available'\n };\n }\n\n // Check for negative values\n const hasNegativeValues = data.some(item => item.percentage < 0 || item.value < 0);\n if (hasNegativeValues) {\n return {\n isValid: false,\n message: 'Invalid data: Negative values are not allowed'\n };\n }\n\n // Validate total percentage is greater than 0\n const totalPercentage = data.reduce((sum, item) => sum + item.percentage, 0);\n if (totalPercentage <= 0) {\n return {\n isValid: false,\n message: 'Invalid percentage total: Must be greater than 0'\n };\n }\n return {\n isValid: true,\n message: ''\n };\n};\nconst PieSemiCircleChartInternal = ({\n data,\n chartId: providedChartId,\n width: propWidth,\n height: propHeight,\n thickness = 0.4,\n clockwise = true,\n withTooltips = false,\n showLegend = false,\n legendOrientation = 'horizontal',\n legendPosition = 'bottom',\n legendAlignment = 'center',\n legendMaxWidth,\n legendTextOverflow = 'wrap',\n legendItemClassName,\n legendShape = 'circle',\n legendValueDisplay = 'percentage',\n legendInteractive = false,\n label,\n animation,\n note,\n className,\n children,\n tooltipOffsetX = 0,\n tooltipOffsetY = -15,\n renderTooltip = renderDefaultPieSemiCircleTooltip,\n gap = 'md'\n}) => {\n const chartId = useChartId(providedChartId);\n // Measure the SVG wrapper to calculate constrained dimensions\n const [svgWrapperRef, svgWrapperWidth, svgWrapperHeight] = useElementSize();\n const {\n tooltipOpen,\n tooltipLeft,\n tooltipTop,\n tooltipData,\n hideTooltip,\n showTooltip\n } = useTooltip();\n\n // Set up portal tooltip for better z-index handling\n // We get containerBounds to cancel out stale offsets in the position calculation\n const {\n containerRef,\n TooltipInPortal,\n containerBounds\n } = useTooltipInPortal({\n detectBounds: true,\n scroll: true,\n debounce: 0\n });\n const handleMouseMove = useCallback((event, arc) => {\n // Don't show tooltip until container bounds are measured\n if (containerBounds.width === 0 || containerBounds.height === 0) {\n return;\n }\n\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:\n // (clientX - containerBounds.left) + containerBounds.left + scrollX = clientX + scrollX\n // This gives correct page coordinates regardless of stale bounds.\n showTooltip({\n tooltipData: arc.data,\n tooltipLeft: event.clientX - containerBounds.left + tooltipOffsetX,\n tooltipTop: event.clientY - containerBounds.top + tooltipOffsetY\n });\n }, [containerBounds.width, containerBounds.height, containerBounds.left, containerBounds.top, showTooltip, tooltipOffsetX, tooltipOffsetY]);\n const handleMouseLeave = useCallback(() => {\n hideTooltip();\n }, [hideTooltip]);\n const handleArcMouseMove = useCallback(arc => event => {\n handleMouseMove(event, arc);\n }, [handleMouseMove]);\n\n // Validate data first to get validation result\n const {\n isValid,\n message\n } = validateData(data);\n const {\n getElementStyles,\n isSeriesVisible\n } = useGlobalChartsContext();\n\n // Filter and recalculate data for interactive legends\n const {\n visibleData,\n allSegmentsHidden,\n legendData\n } = useInteractiveLegendData({\n data,\n chartId,\n legendInteractive,\n isSeriesVisible\n });\n\n // Define accessors with useMemo to avoid changing dependencies\n const accessors = useMemo(() => ({\n value: d => d.value,\n sort: (a, b) => b.value - a.value,\n fill: d => getElementStyles({\n data: d,\n index: d.index\n }).color\n }), [getElementStyles]);\n\n // Memoize legend options to prevent unnecessary re-calculations\n const legendOptions = useMemo(() => ({\n showValues: true,\n legendValueDisplay\n }), [legendValueDisplay]);\n\n // Create legend items using legendData (has recalculated percentages for visible items)\n const legendItems = useChartLegendItems(legendData, legendOptions);\n\n // Process children to extract compound components\n const {\n svgChildren,\n htmlChildren,\n otherChildren\n } = useChartChildren(children, 'PieSemiCircleChart');\n\n // Memoize metadata to prevent unnecessary re-registration\n const chartMetadata = useMemo(() => ({\n thickness,\n clockwise\n }), [thickness, clockwise]);\n\n // Register chart with context only if data is valid\n useChartRegistration({\n chartId,\n legendItems,\n chartType: 'pie-semi-circle',\n isDataValid: isValid,\n metadata: chartMetadata\n });\n const prefersReducedMotion = usePrefersReducedMotion();\n const effectiveWidth = propWidth || DEFAULT_WIDTH;\n if (!isValid) {\n const errorWidth = propHeight ? Math.min(propWidth || propHeight * 2, propHeight * 2) : effectiveWidth;\n const errorHeight = errorWidth / 2;\n return /*#__PURE__*/_jsx(\"div\", {\n className: styles['pie-semi-circle-chart'],\n children: /*#__PURE__*/_jsx(\"svg\", {\n width: errorWidth,\n height: errorHeight,\n children: /*#__PURE__*/_jsx(\"text\", {\n x: \"50%\",\n y: \"50%\",\n textAnchor: \"middle\",\n className: styles.error,\n children: message\n })\n })\n });\n }\n\n // Calculate chart dimensions maintaining the 2:1 width-to-height ratio.\n // Use measured SVG wrapper dimensions to respect height constraints, falling back\n // to explicit props during initial render before measurement is available.\n const availableWidth = svgWrapperWidth > 0 ? svgWrapperWidth : effectiveWidth;\n const availableHeight = svgWrapperHeight > 0 ? svgWrapperHeight : propHeight || effectiveWidth / 2;\n // Constrain width so that height (= width / 2) never exceeds the available height\n const width = Math.min(availableWidth, availableHeight * 2);\n const height = width / 2;\n const radius = height; // For a semi-circle, radius equals the SVG height\n const innerRadius = radius * (1 - thickness);\n\n // Map data with index for color assignment\n // When interactive, we need to find the original index to maintain consistent colors\n const dataWithIndex = visibleData.map(d => {\n const originalIndex = data.findIndex(item => item.label === d.label);\n return {\n ...d,\n index: originalIndex >= 0 ? originalIndex : 0\n };\n });\n\n // Configure pie angles based on clockwise direction\n const startAngle = clockwise ? -Math.PI / 2 : Math.PI / 2;\n const endAngle = clockwise ? Math.PI / 2 : -Math.PI / 2;\n const legendElement = showLegend && /*#__PURE__*/_jsx(Legend, {\n orientation: legendOrientation,\n position: legendPosition,\n alignment: legendAlignment,\n maxWidth: legendMaxWidth,\n textOverflow: legendTextOverflow,\n legendItemClassName: legendItemClassName,\n shape: legendShape,\n chartId: chartId,\n interactive: legendInteractive\n });\n return /*#__PURE__*/_jsx(SingleChartContext.Provider, {\n value: {\n chartId,\n chartWidth: width,\n chartHeight: height\n },\n children: /*#__PURE__*/_jsxs(Stack, {\n ref: containerRef,\n direction: \"column\",\n gap: gap,\n className: clsx('pie-semi-circle-chart', styles['pie-semi-circle-chart'], {\n [styles['pie-semi-circle-chart--responsive']]: !propWidth && !propHeight\n }, className),\n style: {\n width: propWidth || undefined,\n height: propHeight || undefined\n },\n children: [legendPosition === 'top' && legendElement, /*#__PURE__*/_jsx(\"div\", {\n ref: svgWrapperRef,\n className: styles['pie-semi-circle-chart__svg-wrapper'],\n children: /*#__PURE__*/_jsxs(\"svg\", {\n width: width,\n height: height,\n viewBox: `0 0 ${width} ${height}`,\n children: [/*#__PURE__*/_jsx(\"defs\", {\n children: /*#__PURE__*/_jsx(RadialWipeAnimation, {\n id: `radial-wipe-${chartId}`,\n radius: radius,\n innerRadius: innerRadius,\n startAngle: \"-180deg\",\n wipePercentage: 50\n })\n }), /*#__PURE__*/_jsx(Group, {\n top: height,\n left: width / 2,\n mask: animation && !prefersReducedMotion ? `url(#radial-wipe-${chartId})` : null,\n children: allSegmentsHidden ? /*#__PURE__*/_jsx(\"text\", {\n textAnchor: \"middle\",\n y: -radius / 2,\n fill: \"#ccc\",\n fontSize: \"14\",\n fontFamily: \"-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif\",\n children: __('All segments are hidden. Click legend items to show data.', 'jetpack-charts')\n }) : /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(Pie, {\n data: dataWithIndex,\n pieValue: accessors.value,\n outerRadius: radius,\n innerRadius: innerRadius,\n cornerRadius: 3,\n padAngle: PAD_ANGLE,\n startAngle: startAngle,\n endAngle: endAngle,\n pieSort: accessors.sort,\n children: pie => {\n return pie.arcs.map(arc => /*#__PURE__*/_jsx(\"g\", {\n onMouseMove: withTooltips ? handleArcMouseMove(arc) : undefined,\n onMouseLeave: withTooltips ? handleMouseLeave : undefined,\n children: /*#__PURE__*/_jsx(\"path\", {\n d: pie.path(arc) || '',\n fill: accessors.fill(arc.data)\n })\n }, arc.data.label));\n }\n }), /*#__PURE__*/_jsxs(Group, {\n children: [/*#__PURE__*/_jsx(Text, {\n textAnchor: \"middle\",\n verticalAnchor: \"start\",\n y: -40 // Position above the chart with space for note\n ,\n className: styles.label,\n children: label\n }), /*#__PURE__*/_jsx(Text, {\n textAnchor: \"middle\",\n verticalAnchor: \"start\",\n y: -20 // Position between label and chart\n ,\n className: styles.note,\n children: note\n })]\n }), !allSegmentsHidden && svgChildren]\n })\n })]\n })\n }), legendPosition !== 'top' && legendElement, withTooltips && tooltipOpen && tooltipData && /*#__PURE__*/_jsx(TooltipInPortal, {\n top: tooltipTop || 0,\n left: tooltipLeft || 0,\n children: /*#__PURE__*/_jsx(\"div\", {\n role: \"tooltip\",\n children: renderTooltip({\n tooltipData\n })\n })\n }), htmlChildren, otherChildren]\n })\n });\n};\nconst PieSemiCircleChartWithProvider = 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(PieSemiCircleChartInternal, {\n ...props\n });\n }\n\n // Otherwise, create our own GlobalChartsProvider\n return /*#__PURE__*/_jsx(GlobalChartsProvider, {\n children: /*#__PURE__*/_jsx(PieSemiCircleChartInternal, {\n ...props\n })\n });\n};\nPieSemiCircleChartWithProvider.displayName = 'PieSemiCircleChart';\n\n// Create PieSemiCircleChart with composition API\nconst PieSemiCircleChart = attachSubComponents(PieSemiCircleChartWithProvider, {\n Legend: Legend,\n SVG: ChartSVG,\n HTML: ChartHTML\n});\n\n// Create responsive PieSemiCircleChart with composition API\nconst PieSemiCircleChartResponsive = attachSubComponents(withResponsive(PieSemiCircleChartWithProvider), {\n Legend: Legend,\n SVG: ChartSVG,\n HTML: ChartHTML\n});\nexport { PieSemiCircleChartResponsive as default, PieSemiCircleChart as PieSemiCircleChartUnresponsive };","import 'css-chunk:src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss';export default {\n \"pie-semi-circle-chart--responsive\": \"a8ccharts-V0wiEb\",\n \"pie-semi-circle-chart__svg-wrapper\": \"a8ccharts-hGowej\",\n \"pie-semi-circle-chart\": \"a8ccharts-8tyaQj\",\n \"label\": \"a8ccharts-EKZS3j\",\n \"note\": \"a8ccharts-v85A8-\"\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAa;A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,gCAAgC;AAAA,EAC7E;AAAA,EACA,KAAK;AAAA,EACL,MAAM;AACR,CAAC;AAGD,IAAM,+BAA+B,oBAAoB,eAAe,8BAA8B,GAAG;AAAA,EACvG;AAAA,EACA,KAAK;AAAA,EACL,MAAM;AACR,CAAC;","names":[]}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
var _chunkY3NNQMAXcjs = require('./chunk-Y3NNQMAX.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkUFRBUT2Dcjs = require('./chunk-UFRBUT2D.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkASLARV7Lcjs = require('./chunk-ASLARV7L.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -25,7 +25,7 @@ var _chunk7QDEU3KNcjs = require('./chunk-7QDEU3KN.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkYDVHT7GScjs = require('./chunk-YDVHT7GS.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -293,18 +293,18 @@ var BarChartInternal = ({
|
|
|
293
293
|
gap = "md"
|
|
294
294
|
}) => {
|
|
295
295
|
const horizontal = orientation === "horizontal";
|
|
296
|
-
const chartId =
|
|
297
|
-
const theme =
|
|
298
|
-
const dataSorted =
|
|
299
|
-
const dataWithVisibleZeros =
|
|
296
|
+
const chartId = _chunkYDVHT7GScjs.useChartId.call(void 0, providedChartId);
|
|
297
|
+
const theme = _chunkYDVHT7GScjs.useXYChartTheme.call(void 0, data);
|
|
298
|
+
const dataSorted = _chunkYDVHT7GScjs.useChartDataTransform.call(void 0, data);
|
|
299
|
+
const dataWithVisibleZeros = _chunkYDVHT7GScjs.useZeroValueDisplay.call(void 0, dataSorted, {
|
|
300
300
|
enabled: showZeroValues
|
|
301
301
|
});
|
|
302
|
-
const legendItems =
|
|
302
|
+
const legendItems = _chunkYDVHT7GScjs.useChartLegendItems.call(void 0, dataSorted);
|
|
303
303
|
const chartOptions = useBarChartOptions(dataWithVisibleZeros, horizontal, options);
|
|
304
|
-
const defaultMargin =
|
|
305
|
-
const [svgWrapperRef, svgWrapperHeight] =
|
|
304
|
+
const defaultMargin = _chunkYDVHT7GScjs.useChartMargin.call(void 0, height, chartOptions, dataSorted, theme, horizontal);
|
|
305
|
+
const [svgWrapperRef, , svgWrapperHeight] = _chunkYDVHT7GScjs.useElementSize.call(void 0, );
|
|
306
306
|
const chartRef = _react.useRef.call(void 0, null);
|
|
307
|
-
const hasLegendChild =
|
|
307
|
+
const hasLegendChild = _chunkYDVHT7GScjs.useHasLegendChild.call(void 0, children);
|
|
308
308
|
const chartHeight = svgWrapperHeight > 0 ? svgWrapperHeight : height;
|
|
309
309
|
const hasLegend = showLegend || hasLegendChild;
|
|
310
310
|
const isWaitingForMeasurement = hasLegend ? svgWrapperHeight === 0 : !chartHeight;
|
|
@@ -327,8 +327,8 @@ var BarChartInternal = ({
|
|
|
327
327
|
const {
|
|
328
328
|
getElementStyles,
|
|
329
329
|
isSeriesVisible
|
|
330
|
-
} =
|
|
331
|
-
const providerTheme =
|
|
330
|
+
} = _chunkYDVHT7GScjs.useGlobalChartsContext.call(void 0, );
|
|
331
|
+
const providerTheme = _chunkYDVHT7GScjs.useGlobalChartsTheme.call(void 0, );
|
|
332
332
|
const seriesWithVisibility = _react.useMemo.call(void 0, () => {
|
|
333
333
|
if (!chartId || !legendInteractive) {
|
|
334
334
|
return dataWithVisibleZeros.map((series, index) => ({
|
|
@@ -449,14 +449,14 @@ var BarChartInternal = ({
|
|
|
449
449
|
orientation,
|
|
450
450
|
withPatterns
|
|
451
451
|
}), [orientation, withPatterns]);
|
|
452
|
-
|
|
452
|
+
_chunkYDVHT7GScjs.useChartRegistration.call(void 0, {
|
|
453
453
|
chartId,
|
|
454
454
|
legendItems,
|
|
455
455
|
chartType: "bar",
|
|
456
456
|
isDataValid,
|
|
457
457
|
metadata: chartMetadata
|
|
458
458
|
});
|
|
459
|
-
const prefersReducedMotion =
|
|
459
|
+
const prefersReducedMotion = _chunkYDVHT7GScjs.usePrefersReducedMotion.call(void 0, );
|
|
460
460
|
if (error) {
|
|
461
461
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {
|
|
462
462
|
className: _clsx2.default.call(void 0, "bar-chart", bar_chart_module_default["bar-chart"]),
|
|
@@ -465,7 +465,7 @@ var BarChartInternal = ({
|
|
|
465
465
|
}
|
|
466
466
|
const gridVisibility = _nullishCoalesce(gridVisibilityProp, () => ( chartOptions.gridVisibility));
|
|
467
467
|
const highlightedBarStyle = createKeyboardHighlightStyle();
|
|
468
|
-
const legendElement = showLegend && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
468
|
+
const legendElement = showLegend && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDVHT7GScjs.Legend, {
|
|
469
469
|
orientation: legendOrientation,
|
|
470
470
|
position: legendPosition,
|
|
471
471
|
alignment: legendAlignment,
|
|
@@ -477,13 +477,13 @@ var BarChartInternal = ({
|
|
|
477
477
|
chartId,
|
|
478
478
|
interactive: legendInteractive
|
|
479
479
|
});
|
|
480
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
480
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDVHT7GScjs.SingleChartContext.Provider, {
|
|
481
481
|
value: {
|
|
482
482
|
chartId,
|
|
483
483
|
chartWidth: width,
|
|
484
484
|
chartHeight
|
|
485
485
|
},
|
|
486
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
486
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUFRBUT2Dcjs.Stack, {
|
|
487
487
|
direction: "column",
|
|
488
488
|
gap,
|
|
489
489
|
className: _clsx2.default.call(void 0, "bar-chart", bar_chart_module_default["bar-chart"], {
|
|
@@ -584,13 +584,13 @@ var BarChartInternal = ({
|
|
|
584
584
|
});
|
|
585
585
|
};
|
|
586
586
|
var BarChartWithProvider = (props) => {
|
|
587
|
-
const existingContext = _react.useContext.call(void 0,
|
|
587
|
+
const existingContext = _react.useContext.call(void 0, _chunkYDVHT7GScjs.GlobalChartsContext);
|
|
588
588
|
if (existingContext) {
|
|
589
589
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BarChartInternal, {
|
|
590
590
|
...props
|
|
591
591
|
});
|
|
592
592
|
}
|
|
593
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
593
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDVHT7GScjs.GlobalChartsProvider, {
|
|
594
594
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BarChartInternal, {
|
|
595
595
|
...props
|
|
596
596
|
})
|
|
@@ -598,14 +598,14 @@ var BarChartWithProvider = (props) => {
|
|
|
598
598
|
};
|
|
599
599
|
BarChartWithProvider.displayName = "BarChart";
|
|
600
600
|
var BarChart = _chunkZVGEDXDPcjs.attachSubComponents.call(void 0, BarChartWithProvider, {
|
|
601
|
-
Legend:
|
|
601
|
+
Legend: _chunkYDVHT7GScjs.Legend
|
|
602
602
|
});
|
|
603
|
-
var BarChartResponsive = _chunkZVGEDXDPcjs.attachSubComponents.call(void 0,
|
|
604
|
-
Legend:
|
|
603
|
+
var BarChartResponsive = _chunkZVGEDXDPcjs.attachSubComponents.call(void 0, _chunkASLARV7Lcjs.withResponsive.call(void 0, BarChartWithProvider), {
|
|
604
|
+
Legend: _chunkYDVHT7GScjs.Legend
|
|
605
605
|
});
|
|
606
606
|
|
|
607
607
|
|
|
608
608
|
|
|
609
609
|
|
|
610
610
|
exports.BarChart = BarChart; exports.BarChartResponsive = BarChartResponsive;
|
|
611
|
-
//# sourceMappingURL=chunk-
|
|
611
|
+
//# sourceMappingURL=chunk-X7JL2NYJ.cjs.map
|