@automattic/charts 1.12.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/TOKENS.md +8 -1
- package/dist/index.cjs +4038 -5207
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +15 -18
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +113 -1281
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/charts/area-chart/area-chart.tsx +3 -2
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss +7 -7
- package/src/charts/line-chart/line-chart.module.scss +3 -3
- package/src/charts/line-chart/line-chart.tsx +3 -2
- package/src/charts/line-chart/test/line-chart.test.tsx +44 -4
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +1 -1
- package/src/charts/private/test/time-axis.test.ts +182 -0
- package/src/charts/private/time-axis.ts +84 -5
- package/src/charts/private/x-zoom/test/x-zoom.test.tsx +52 -7
- package/src/charts/private/x-zoom/x-zoom.module.scss +7 -15
- package/src/charts/private/x-zoom/x-zoom.tsx +29 -40
- package/src/components/legend/private/base-legend.module.scss +1 -1
- package/src/components/tooltip/base-tooltip.module.scss +1 -1
- package/src/components/trend-indicator/trend-indicator.module.scss +1 -1
- package/src/index.ts +1 -0
- package/src/types.ts +15 -0
package/dist/index.js
CHANGED
|
@@ -14,8 +14,7 @@ import { useTooltip, useTooltipInPortal } from "@visx/tooltip";
|
|
|
14
14
|
import { createScale, getTicks, scaleBand, scaleOrdinal, scaleTime } from "@visx/scale";
|
|
15
15
|
import { Group } from "@visx/group";
|
|
16
16
|
import { LegendItem, LegendLabel, LegendOrdinal, LegendShape } from "@visx/legend";
|
|
17
|
-
import {
|
|
18
|
-
import { Icon, chevronRight } from "@wordpress/icons";
|
|
17
|
+
import { IconButton, Stack, Text as Text$1 } from "@wordpress/ui";
|
|
19
18
|
import { LinearGradient } from "@visx/gradient";
|
|
20
19
|
import { curveCatmullRom, curveLinear, curveMonotoneX } from "@visx/curve";
|
|
21
20
|
import { useParentSize } from "@visx/responsive";
|
|
@@ -23,8 +22,10 @@ import { Annotation, CircleSubject, Connector, HtmlLabel, Label, LineSubject } f
|
|
|
23
22
|
import { PatternCircles, PatternHexagons, PatternLines, PatternWaves } from "@visx/pattern";
|
|
24
23
|
import { Chart } from "react-google-charts";
|
|
25
24
|
import DOMPurify from "dompurify";
|
|
25
|
+
import { __assign } from "tslib";
|
|
26
26
|
import "@babel/runtime/helpers/esm/extends";
|
|
27
27
|
import "@babel/runtime/helpers/extends";
|
|
28
|
+
import { Icon, chevronRight } from "@wordpress/icons";
|
|
28
29
|
import { Pie } from "@visx/shape";
|
|
29
30
|
//#region \0rolldown/runtime.js
|
|
30
31
|
var __create = Object.create;
|
|
@@ -1450,1262 +1451,6 @@ const useGlobalChartsTheme = () => {
|
|
|
1450
1451
|
return useContext(GlobalChartsContext)?.theme ?? defaultTheme;
|
|
1451
1452
|
};
|
|
1452
1453
|
//#endregion
|
|
1453
|
-
//#region ../../../node_modules/.pnpm/is-plain-object@5.0.0/node_modules/is-plain-object/dist/is-plain-object.mjs
|
|
1454
|
-
/*!
|
|
1455
|
-
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
1456
|
-
*
|
|
1457
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
1458
|
-
* Released under the MIT License.
|
|
1459
|
-
*/
|
|
1460
|
-
function isObject(o) {
|
|
1461
|
-
return Object.prototype.toString.call(o) === "[object Object]";
|
|
1462
|
-
}
|
|
1463
|
-
function isPlainObject(o) {
|
|
1464
|
-
var ctor, prot;
|
|
1465
|
-
if (isObject(o) === false) return false;
|
|
1466
|
-
ctor = o.constructor;
|
|
1467
|
-
if (ctor === void 0) return true;
|
|
1468
|
-
prot = ctor.prototype;
|
|
1469
|
-
if (isObject(prot) === false) return false;
|
|
1470
|
-
if (prot.hasOwnProperty("isPrototypeOf") === false) return false;
|
|
1471
|
-
return true;
|
|
1472
|
-
}
|
|
1473
|
-
//#endregion
|
|
1474
|
-
//#region ../../../node_modules/.pnpm/lower-case@2.0.2/node_modules/lower-case/dist.es2015/index.js
|
|
1475
|
-
/**
|
|
1476
|
-
* Lower case as a function.
|
|
1477
|
-
*/
|
|
1478
|
-
function lowerCase(str) {
|
|
1479
|
-
return str.toLowerCase();
|
|
1480
|
-
}
|
|
1481
|
-
//#endregion
|
|
1482
|
-
//#region ../../../node_modules/.pnpm/no-case@3.0.4/node_modules/no-case/dist.es2015/index.js
|
|
1483
|
-
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
|
1484
|
-
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
1485
|
-
/**
|
|
1486
|
-
* Normalize the string into something other libraries can manipulate easier.
|
|
1487
|
-
*/
|
|
1488
|
-
function noCase(input, options) {
|
|
1489
|
-
if (options === void 0) options = {};
|
|
1490
|
-
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
|
|
1491
|
-
var result = replace$1(replace$1(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
|
1492
|
-
var start = 0;
|
|
1493
|
-
var end = result.length;
|
|
1494
|
-
while (result.charAt(start) === "\0") start++;
|
|
1495
|
-
while (result.charAt(end - 1) === "\0") end--;
|
|
1496
|
-
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
1497
|
-
}
|
|
1498
|
-
/**
|
|
1499
|
-
* Replace `re` in the input string with the replacement value.
|
|
1500
|
-
*/
|
|
1501
|
-
function replace$1(input, re, value) {
|
|
1502
|
-
if (re instanceof RegExp) return input.replace(re, value);
|
|
1503
|
-
return re.reduce(function(input, re) {
|
|
1504
|
-
return input.replace(re, value);
|
|
1505
|
-
}, input);
|
|
1506
|
-
}
|
|
1507
|
-
//#endregion
|
|
1508
|
-
//#region ../../../node_modules/.pnpm/dot-case@3.0.4/node_modules/dot-case/dist.es2015/index.js
|
|
1509
|
-
function dotCase(input, options) {
|
|
1510
|
-
if (options === void 0) options = {};
|
|
1511
|
-
return noCase(input, __assign({ delimiter: "." }, options));
|
|
1512
|
-
}
|
|
1513
|
-
//#endregion
|
|
1514
|
-
//#region ../../../node_modules/.pnpm/param-case@3.0.4/node_modules/param-case/dist.es2015/index.js
|
|
1515
|
-
function paramCase(input, options) {
|
|
1516
|
-
if (options === void 0) options = {};
|
|
1517
|
-
return dotCase(input, __assign({ delimiter: "-" }, options));
|
|
1518
|
-
}
|
|
1519
|
-
//#endregion
|
|
1520
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/error.mjs
|
|
1521
|
-
let set$1;
|
|
1522
|
-
if (process.env.NODE_ENV !== "production") set$1 = /* @__PURE__ */ new Set();
|
|
1523
|
-
function error(...messages) {
|
|
1524
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1525
|
-
const messageKey = messages.join(" ");
|
|
1526
|
-
if (!set$1.has(messageKey)) {
|
|
1527
|
-
set$1.add(messageKey);
|
|
1528
|
-
console.error(`Base UI: ${messageKey}`);
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
//#endregion
|
|
1533
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/safeReact.mjs
|
|
1534
|
-
/**
|
|
1535
|
-
* A clone of the React namespace for reading APIs that may be missing in older
|
|
1536
|
-
* supported React versions. Bundlers can rewrite direct `React.someNewApi`
|
|
1537
|
-
* reads into named imports, which breaks React 17. Reading from this cloned
|
|
1538
|
-
* object keeps those lookups optional.
|
|
1539
|
-
*
|
|
1540
|
-
* @see https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379
|
|
1541
|
-
*/
|
|
1542
|
-
const SafeReact = { ...React };
|
|
1543
|
-
//#endregion
|
|
1544
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/useRefWithInit.mjs
|
|
1545
|
-
const UNINITIALIZED = {};
|
|
1546
|
-
/**
|
|
1547
|
-
* A React.useRef() that is initialized with a function. Note that it accepts an optional
|
|
1548
|
-
* initialization argument, so the initialization function doesn't need to be an inline closure.
|
|
1549
|
-
*
|
|
1550
|
-
* @usage
|
|
1551
|
-
* const ref = useRefWithInit(sortColumns, columns)
|
|
1552
|
-
*/
|
|
1553
|
-
function useRefWithInit(init, initArg) {
|
|
1554
|
-
const ref = React.useRef(UNINITIALIZED);
|
|
1555
|
-
if (ref.current === UNINITIALIZED) ref.current = init(initArg);
|
|
1556
|
-
return ref;
|
|
1557
|
-
}
|
|
1558
|
-
//#endregion
|
|
1559
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/useStableCallback.mjs
|
|
1560
|
-
const useInsertionEffect$1 = SafeReact.useInsertionEffect;
|
|
1561
|
-
const useSafeInsertionEffect = useInsertionEffect$1 && useInsertionEffect$1 !== SafeReact.useLayoutEffect ? useInsertionEffect$1 : (fn) => fn();
|
|
1562
|
-
/**
|
|
1563
|
-
* Stabilizes the function passed so it's always the same between renders.
|
|
1564
|
-
*
|
|
1565
|
-
* The function becomes non-reactive to any values it captures.
|
|
1566
|
-
* It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.
|
|
1567
|
-
*
|
|
1568
|
-
* The function must only be called inside effects and event handlers, never during render (which throws an error).
|
|
1569
|
-
*
|
|
1570
|
-
* This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.
|
|
1571
|
-
*/
|
|
1572
|
-
function useStableCallback(callback) {
|
|
1573
|
-
const stable = useRefWithInit(createStableCallback).current;
|
|
1574
|
-
stable.next = callback;
|
|
1575
|
-
useSafeInsertionEffect(stable.effect);
|
|
1576
|
-
return stable.trampoline;
|
|
1577
|
-
}
|
|
1578
|
-
function createStableCallback() {
|
|
1579
|
-
const stable = {
|
|
1580
|
-
next: void 0,
|
|
1581
|
-
callback: assertNotCalled,
|
|
1582
|
-
trampoline: (...args) => stable.callback?.(...args),
|
|
1583
|
-
effect: () => {
|
|
1584
|
-
stable.callback = stable.next;
|
|
1585
|
-
}
|
|
1586
|
-
};
|
|
1587
|
-
return stable;
|
|
1588
|
-
}
|
|
1589
|
-
function assertNotCalled() {
|
|
1590
|
-
if (process.env.NODE_ENV !== "production") throw new Error("Base UI: Cannot call an event handler while rendering.");
|
|
1591
|
-
}
|
|
1592
|
-
//#endregion
|
|
1593
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs
|
|
1594
|
-
const noop = () => {};
|
|
1595
|
-
const useIsoLayoutEffect = typeof document !== "undefined" ? React.useLayoutEffect : noop;
|
|
1596
|
-
//#endregion
|
|
1597
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/warn.mjs
|
|
1598
|
-
let set;
|
|
1599
|
-
if (process.env.NODE_ENV !== "production") set = /* @__PURE__ */ new Set();
|
|
1600
|
-
function warn(...messages) {
|
|
1601
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1602
|
-
const messageKey = messages.join(" ");
|
|
1603
|
-
if (!set.has(messageKey)) {
|
|
1604
|
-
set.add(messageKey);
|
|
1605
|
-
console.warn(`Base UI: ${messageKey}`);
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
//#endregion
|
|
1610
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/formatErrorMessage.mjs
|
|
1611
|
-
/**
|
|
1612
|
-
* Creates a formatErrorMessage function with a custom URL and prefix.
|
|
1613
|
-
* @param baseUrl - The base URL for the error page (e.g., 'https://base-ui.com/production-error')
|
|
1614
|
-
* @param prefix - The prefix for the error message (e.g., 'Base UI')
|
|
1615
|
-
* @returns A function that formats error messages with the given URL and prefix
|
|
1616
|
-
*/
|
|
1617
|
-
function createFormatErrorMessage(baseUrl, prefix) {
|
|
1618
|
-
return function formatErrorMessage(code, ...args) {
|
|
1619
|
-
const url = new URL(baseUrl);
|
|
1620
|
-
url.searchParams.set("code", code.toString());
|
|
1621
|
-
args.forEach((arg) => url.searchParams.append("args[]", arg));
|
|
1622
|
-
return `${prefix} error #${code}; visit ${url} for the full message.`;
|
|
1623
|
-
};
|
|
1624
|
-
}
|
|
1625
|
-
/**
|
|
1626
|
-
* WARNING: Don't import this directly. It's imported by the code generated by
|
|
1627
|
-
* `@mui/internal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`
|
|
1628
|
-
* constructors to ensure the plugin works as expected. Supported patterns include:
|
|
1629
|
-
* throw new Error('My message');
|
|
1630
|
-
* throw new Error(`My message: ${foo}`);
|
|
1631
|
-
* throw new Error(`My message: ${foo}` + 'another string');
|
|
1632
|
-
* ...
|
|
1633
|
-
*/
|
|
1634
|
-
const formatErrorMessage = createFormatErrorMessage("https://base-ui.com/production-error", "Base UI");
|
|
1635
|
-
//#endregion
|
|
1636
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/useMergedRefs.mjs
|
|
1637
|
-
/**
|
|
1638
|
-
* Merges refs into a single memoized callback ref or `null`.
|
|
1639
|
-
* This makes sure multiple refs are updated together and have the same value.
|
|
1640
|
-
*
|
|
1641
|
-
* This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,
|
|
1642
|
-
* use `useMergedRefsN` instead.
|
|
1643
|
-
*/
|
|
1644
|
-
function useMergedRefs(a, b, c, d) {
|
|
1645
|
-
const forkRef = useRefWithInit(createForkRef).current;
|
|
1646
|
-
if (didChange(forkRef, a, b, c, d)) update(forkRef, [
|
|
1647
|
-
a,
|
|
1648
|
-
b,
|
|
1649
|
-
c,
|
|
1650
|
-
d
|
|
1651
|
-
]);
|
|
1652
|
-
return forkRef.callback;
|
|
1653
|
-
}
|
|
1654
|
-
/**
|
|
1655
|
-
* Merges an array of refs into a single memoized callback ref or `null`.
|
|
1656
|
-
*
|
|
1657
|
-
* If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.
|
|
1658
|
-
*/
|
|
1659
|
-
function useMergedRefsN(refs) {
|
|
1660
|
-
const forkRef = useRefWithInit(createForkRef).current;
|
|
1661
|
-
if (didChangeN(forkRef, refs)) update(forkRef, refs);
|
|
1662
|
-
return forkRef.callback;
|
|
1663
|
-
}
|
|
1664
|
-
function createForkRef() {
|
|
1665
|
-
return {
|
|
1666
|
-
callback: null,
|
|
1667
|
-
cleanup: null,
|
|
1668
|
-
refs: []
|
|
1669
|
-
};
|
|
1670
|
-
}
|
|
1671
|
-
function didChange(forkRef, a, b, c, d) {
|
|
1672
|
-
return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
|
|
1673
|
-
}
|
|
1674
|
-
function didChangeN(forkRef, newRefs) {
|
|
1675
|
-
return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
|
|
1676
|
-
}
|
|
1677
|
-
function update(forkRef, refs) {
|
|
1678
|
-
forkRef.refs = refs;
|
|
1679
|
-
if (refs.every((ref) => ref == null)) {
|
|
1680
|
-
forkRef.callback = null;
|
|
1681
|
-
return;
|
|
1682
|
-
}
|
|
1683
|
-
forkRef.callback = (instance) => {
|
|
1684
|
-
if (forkRef.cleanup) {
|
|
1685
|
-
forkRef.cleanup();
|
|
1686
|
-
forkRef.cleanup = null;
|
|
1687
|
-
}
|
|
1688
|
-
if (instance != null) {
|
|
1689
|
-
const cleanupCallbacks = Array(refs.length).fill(null);
|
|
1690
|
-
for (let i = 0; i < refs.length; i += 1) {
|
|
1691
|
-
const ref = refs[i];
|
|
1692
|
-
if (ref == null) continue;
|
|
1693
|
-
switch (typeof ref) {
|
|
1694
|
-
case "function": {
|
|
1695
|
-
const refCleanup = ref(instance);
|
|
1696
|
-
if (typeof refCleanup === "function") cleanupCallbacks[i] = refCleanup;
|
|
1697
|
-
break;
|
|
1698
|
-
}
|
|
1699
|
-
case "object":
|
|
1700
|
-
ref.current = instance;
|
|
1701
|
-
break;
|
|
1702
|
-
default:
|
|
1703
|
-
}
|
|
1704
|
-
}
|
|
1705
|
-
forkRef.cleanup = () => {
|
|
1706
|
-
for (let i = 0; i < refs.length; i += 1) {
|
|
1707
|
-
const ref = refs[i];
|
|
1708
|
-
if (ref == null) continue;
|
|
1709
|
-
switch (typeof ref) {
|
|
1710
|
-
case "function": {
|
|
1711
|
-
const cleanupCallback = cleanupCallbacks[i];
|
|
1712
|
-
if (typeof cleanupCallback === "function") cleanupCallback();
|
|
1713
|
-
else ref(null);
|
|
1714
|
-
break;
|
|
1715
|
-
}
|
|
1716
|
-
case "object":
|
|
1717
|
-
ref.current = null;
|
|
1718
|
-
break;
|
|
1719
|
-
default:
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
|
-
};
|
|
1723
|
-
}
|
|
1724
|
-
};
|
|
1725
|
-
}
|
|
1726
|
-
//#endregion
|
|
1727
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/reactVersion.mjs
|
|
1728
|
-
const majorVersion = parseInt(React.version, 10);
|
|
1729
|
-
function isReactVersionAtLeast(reactVersionToCheck) {
|
|
1730
|
-
return majorVersion >= reactVersionToCheck;
|
|
1731
|
-
}
|
|
1732
|
-
//#endregion
|
|
1733
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/getReactElementRef.mjs
|
|
1734
|
-
/**
|
|
1735
|
-
* Extracts the `ref` from a React element, handling different React versions.
|
|
1736
|
-
*/
|
|
1737
|
-
function getReactElementRef(element) {
|
|
1738
|
-
if (!/*#__PURE__*/ React.isValidElement(element)) return null;
|
|
1739
|
-
const reactElement = element;
|
|
1740
|
-
const propsWithRef = reactElement.props;
|
|
1741
|
-
return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
|
|
1742
|
-
}
|
|
1743
|
-
//#endregion
|
|
1744
|
-
//#region ../../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/mergeObjects.mjs
|
|
1745
|
-
function mergeObjects(a, b) {
|
|
1746
|
-
if (a && !b) return a;
|
|
1747
|
-
if (!a && b) return b;
|
|
1748
|
-
if (a || b) return {
|
|
1749
|
-
...a,
|
|
1750
|
-
...b
|
|
1751
|
-
};
|
|
1752
|
-
}
|
|
1753
|
-
Object.freeze([]);
|
|
1754
|
-
const EMPTY_OBJECT = Object.freeze({});
|
|
1755
|
-
//#endregion
|
|
1756
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
|
|
1757
|
-
function getStateAttributesProps(state, customMapping) {
|
|
1758
|
-
const props = {};
|
|
1759
|
-
for (const key in state) {
|
|
1760
|
-
const value = state[key];
|
|
1761
|
-
if (customMapping?.hasOwnProperty(key)) {
|
|
1762
|
-
const customProps = customMapping[key](value);
|
|
1763
|
-
if (customProps != null) Object.assign(props, customProps);
|
|
1764
|
-
continue;
|
|
1765
|
-
}
|
|
1766
|
-
if (value === true) props[`data-${key.toLowerCase()}`] = "";
|
|
1767
|
-
else if (value) props[`data-${key.toLowerCase()}`] = value.toString();
|
|
1768
|
-
}
|
|
1769
|
-
return props;
|
|
1770
|
-
}
|
|
1771
|
-
//#endregion
|
|
1772
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/utils/resolveClassName.mjs
|
|
1773
|
-
/**
|
|
1774
|
-
* If the provided className is a string, it will be returned as is.
|
|
1775
|
-
* Otherwise, the function will call the className function with the state as the first argument.
|
|
1776
|
-
*
|
|
1777
|
-
* @param className
|
|
1778
|
-
* @param state
|
|
1779
|
-
*/
|
|
1780
|
-
function resolveClassName(className, state) {
|
|
1781
|
-
return typeof className === "function" ? className(state) : className;
|
|
1782
|
-
}
|
|
1783
|
-
//#endregion
|
|
1784
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/utils/resolveStyle.mjs
|
|
1785
|
-
/**
|
|
1786
|
-
* If the provided style is an object, it will be returned as is.
|
|
1787
|
-
* Otherwise, the function will call the style function with the state as the first argument.
|
|
1788
|
-
*
|
|
1789
|
-
* @param style
|
|
1790
|
-
* @param state
|
|
1791
|
-
*/
|
|
1792
|
-
function resolveStyle(style, state) {
|
|
1793
|
-
return typeof style === "function" ? style(state) : style;
|
|
1794
|
-
}
|
|
1795
|
-
//#endregion
|
|
1796
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/merge-props/mergeProps.mjs
|
|
1797
|
-
const EMPTY_PROPS = {};
|
|
1798
|
-
/**
|
|
1799
|
-
* Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite
|
|
1800
|
-
* the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.
|
|
1801
|
-
*
|
|
1802
|
-
* Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).
|
|
1803
|
-
* For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing
|
|
1804
|
-
* by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),
|
|
1805
|
-
* all handlers always execute without prevention capability.
|
|
1806
|
-
*
|
|
1807
|
-
* The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).
|
|
1808
|
-
* The `style` prop is merged with rightmost styles overwriting the prior ones.
|
|
1809
|
-
*
|
|
1810
|
-
* Props can either be provided as objects or as functions that take the previous props as an argument.
|
|
1811
|
-
* The function will receive the merged props up to that point (going from left to right):
|
|
1812
|
-
* so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.
|
|
1813
|
-
* The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).
|
|
1814
|
-
*
|
|
1815
|
-
* Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.
|
|
1816
|
-
* They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.
|
|
1817
|
-
*
|
|
1818
|
-
* @important **`ref` is not merged.**
|
|
1819
|
-
* @param a Props object to merge.
|
|
1820
|
-
* @param b Props object to merge. The function will overwrite conflicting props from `a`.
|
|
1821
|
-
* @param c Props object to merge. The function will overwrite conflicting props from previous parameters.
|
|
1822
|
-
* @param d Props object to merge. The function will overwrite conflicting props from previous parameters.
|
|
1823
|
-
* @param e Props object to merge. The function will overwrite conflicting props from previous parameters.
|
|
1824
|
-
* @returns The merged props.
|
|
1825
|
-
* @public
|
|
1826
|
-
*/
|
|
1827
|
-
function mergeProps(a, b, c, d, e) {
|
|
1828
|
-
if (!c && !d && !e && !a) return createInitialMergedProps(b);
|
|
1829
|
-
let merged = createInitialMergedProps(a);
|
|
1830
|
-
if (b) merged = mergeInto(merged, b);
|
|
1831
|
-
if (c) merged = mergeInto(merged, c);
|
|
1832
|
-
if (d) merged = mergeInto(merged, d);
|
|
1833
|
-
if (e) merged = mergeInto(merged, e);
|
|
1834
|
-
return merged;
|
|
1835
|
-
}
|
|
1836
|
-
/**
|
|
1837
|
-
* Merges an arbitrary number of React props using the same logic as {@link mergeProps}.
|
|
1838
|
-
* This function accepts an array of props instead of individual arguments.
|
|
1839
|
-
*
|
|
1840
|
-
* This has slightly lower performance than {@link mergeProps} due to accepting an array
|
|
1841
|
-
* instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or
|
|
1842
|
-
* fewer prop sets for better performance.
|
|
1843
|
-
*
|
|
1844
|
-
* @param props Array of props to merge.
|
|
1845
|
-
* @returns The merged props.
|
|
1846
|
-
* @see mergeProps
|
|
1847
|
-
* @public
|
|
1848
|
-
*/
|
|
1849
|
-
function mergePropsN(props) {
|
|
1850
|
-
if (props.length === 0) return EMPTY_PROPS;
|
|
1851
|
-
if (props.length === 1) return createInitialMergedProps(props[0]);
|
|
1852
|
-
let merged = createInitialMergedProps(props[0]);
|
|
1853
|
-
for (let i = 1; i < props.length; i += 1) merged = mergeInto(merged, props[i]);
|
|
1854
|
-
return merged;
|
|
1855
|
-
}
|
|
1856
|
-
function createInitialMergedProps(inputProps) {
|
|
1857
|
-
if (isPropsGetter(inputProps)) return { ...resolvePropsGetter(inputProps, EMPTY_PROPS) };
|
|
1858
|
-
return copyInitialProps(inputProps);
|
|
1859
|
-
}
|
|
1860
|
-
function mergeInto(merged, inputProps) {
|
|
1861
|
-
if (isPropsGetter(inputProps)) return resolvePropsGetter(inputProps, merged);
|
|
1862
|
-
return mutablyMergeInto(merged, inputProps);
|
|
1863
|
-
}
|
|
1864
|
-
function copyInitialProps(inputProps) {
|
|
1865
|
-
const copiedProps = { ...inputProps };
|
|
1866
|
-
for (const propName in copiedProps) {
|
|
1867
|
-
const propValue = copiedProps[propName];
|
|
1868
|
-
if (isEventHandler(propName, propValue)) copiedProps[propName] = wrapEventHandler(propValue);
|
|
1869
|
-
}
|
|
1870
|
-
return copiedProps;
|
|
1871
|
-
}
|
|
1872
|
-
/**
|
|
1873
|
-
* Merges two sets of props. In case of conflicts, the external props take precedence.
|
|
1874
|
-
*/
|
|
1875
|
-
function mutablyMergeInto(mergedProps, externalProps) {
|
|
1876
|
-
if (!externalProps) return mergedProps;
|
|
1877
|
-
for (const propName in externalProps) {
|
|
1878
|
-
const externalPropValue = externalProps[propName];
|
|
1879
|
-
switch (propName) {
|
|
1880
|
-
case "style":
|
|
1881
|
-
mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
|
|
1882
|
-
break;
|
|
1883
|
-
case "className":
|
|
1884
|
-
mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
|
|
1885
|
-
break;
|
|
1886
|
-
default: if (isEventHandler(propName, externalPropValue)) mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
|
|
1887
|
-
else mergedProps[propName] = externalPropValue;
|
|
1888
|
-
}
|
|
1889
|
-
}
|
|
1890
|
-
return mergedProps;
|
|
1891
|
-
}
|
|
1892
|
-
function isEventHandler(key, value) {
|
|
1893
|
-
const code0 = key.charCodeAt(0);
|
|
1894
|
-
const code1 = key.charCodeAt(1);
|
|
1895
|
-
const code2 = key.charCodeAt(2);
|
|
1896
|
-
return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
|
|
1897
|
-
}
|
|
1898
|
-
function isPropsGetter(inputProps) {
|
|
1899
|
-
return typeof inputProps === "function";
|
|
1900
|
-
}
|
|
1901
|
-
function resolvePropsGetter(inputProps, previousProps) {
|
|
1902
|
-
if (isPropsGetter(inputProps)) return inputProps(previousProps);
|
|
1903
|
-
return inputProps ?? EMPTY_PROPS;
|
|
1904
|
-
}
|
|
1905
|
-
function mergeEventHandlers(ourHandler, theirHandler) {
|
|
1906
|
-
if (!theirHandler) return ourHandler;
|
|
1907
|
-
if (!ourHandler) return wrapEventHandler(theirHandler);
|
|
1908
|
-
return (...args) => {
|
|
1909
|
-
const event = args[0];
|
|
1910
|
-
if (isSyntheticEvent(event)) {
|
|
1911
|
-
const baseUIEvent = event;
|
|
1912
|
-
makeEventPreventable(baseUIEvent);
|
|
1913
|
-
const result = theirHandler(...args);
|
|
1914
|
-
if (!baseUIEvent.baseUIHandlerPrevented) ourHandler?.(...args);
|
|
1915
|
-
return result;
|
|
1916
|
-
}
|
|
1917
|
-
const result = theirHandler(...args);
|
|
1918
|
-
ourHandler?.(...args);
|
|
1919
|
-
return result;
|
|
1920
|
-
};
|
|
1921
|
-
}
|
|
1922
|
-
function wrapEventHandler(handler) {
|
|
1923
|
-
if (!handler) return handler;
|
|
1924
|
-
return (...args) => {
|
|
1925
|
-
const event = args[0];
|
|
1926
|
-
if (isSyntheticEvent(event)) makeEventPreventable(event);
|
|
1927
|
-
return handler(...args);
|
|
1928
|
-
};
|
|
1929
|
-
}
|
|
1930
|
-
function makeEventPreventable(event) {
|
|
1931
|
-
event.preventBaseUIHandler = () => {
|
|
1932
|
-
event.baseUIHandlerPrevented = true;
|
|
1933
|
-
};
|
|
1934
|
-
return event;
|
|
1935
|
-
}
|
|
1936
|
-
function mergeClassNames(ourClassName, theirClassName) {
|
|
1937
|
-
if (theirClassName) {
|
|
1938
|
-
if (ourClassName) return theirClassName + " " + ourClassName;
|
|
1939
|
-
return theirClassName;
|
|
1940
|
-
}
|
|
1941
|
-
return ourClassName;
|
|
1942
|
-
}
|
|
1943
|
-
function isSyntheticEvent(event) {
|
|
1944
|
-
return event != null && typeof event === "object" && "nativeEvent" in event;
|
|
1945
|
-
}
|
|
1946
|
-
//#endregion
|
|
1947
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/internals/useRenderElement.mjs
|
|
1948
|
-
/**
|
|
1949
|
-
* Renders a Base UI element.
|
|
1950
|
-
*
|
|
1951
|
-
* @param element The default HTML element to render. Can be overridden by the `render` prop.
|
|
1952
|
-
* @param componentProps An object containing the `render` and `className` props to be used for element customization. Other props are ignored.
|
|
1953
|
-
* @param params Additional parameters for rendering the element.
|
|
1954
|
-
*/
|
|
1955
|
-
function useRenderElement(element, componentProps, params = {}) {
|
|
1956
|
-
const renderProp = componentProps.render;
|
|
1957
|
-
const outProps = useRenderElementProps(componentProps, params);
|
|
1958
|
-
if (params.enabled === false) return null;
|
|
1959
|
-
return evaluateRenderProp(element, renderProp, outProps, params.state ?? EMPTY_OBJECT);
|
|
1960
|
-
}
|
|
1961
|
-
/**
|
|
1962
|
-
* Computes render element final props.
|
|
1963
|
-
*/
|
|
1964
|
-
function useRenderElementProps(componentProps, params = {}) {
|
|
1965
|
-
const { className: classNameProp, style: styleProp, render: renderProp } = componentProps;
|
|
1966
|
-
const { state = EMPTY_OBJECT, ref, props, stateAttributesMapping, enabled = true } = params;
|
|
1967
|
-
const className = enabled ? resolveClassName(classNameProp, state) : void 0;
|
|
1968
|
-
const style = enabled ? resolveStyle(styleProp, state) : void 0;
|
|
1969
|
-
const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
|
|
1970
|
-
const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
|
|
1971
|
-
const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
|
|
1972
|
-
if (typeof document !== "undefined") if (!enabled) useMergedRefs(null, null);
|
|
1973
|
-
else if (Array.isArray(ref)) outProps.ref = useMergedRefsN([
|
|
1974
|
-
outProps.ref,
|
|
1975
|
-
getReactElementRef(renderProp),
|
|
1976
|
-
...ref
|
|
1977
|
-
]);
|
|
1978
|
-
else outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
|
|
1979
|
-
if (!enabled) return EMPTY_OBJECT;
|
|
1980
|
-
if (className !== void 0) outProps.className = mergeClassNames(outProps.className, className);
|
|
1981
|
-
if (style !== void 0) outProps.style = mergeObjects(outProps.style, style);
|
|
1982
|
-
return outProps;
|
|
1983
|
-
}
|
|
1984
|
-
function resolveRenderFunctionProps(props) {
|
|
1985
|
-
if (Array.isArray(props)) return mergePropsN(props);
|
|
1986
|
-
return mergeProps(void 0, props);
|
|
1987
|
-
}
|
|
1988
|
-
const REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
1989
|
-
const COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
|
|
1990
|
-
const LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
|
|
1991
|
-
function evaluateRenderProp(element, render, props, state) {
|
|
1992
|
-
if (render) {
|
|
1993
|
-
if (typeof render === "function") {
|
|
1994
|
-
if (process.env.NODE_ENV !== "production") warnIfRenderPropLooksLikeComponent(render);
|
|
1995
|
-
return render(props, state);
|
|
1996
|
-
}
|
|
1997
|
-
const mergedProps = mergeProps(props, render.props);
|
|
1998
|
-
mergedProps.ref = props.ref;
|
|
1999
|
-
let newElement = render;
|
|
2000
|
-
if (newElement?.$$typeof === REACT_LAZY_TYPE) newElement = React.Children.toArray(render)[0];
|
|
2001
|
-
if (process.env.NODE_ENV !== "production") {
|
|
2002
|
-
if (!/*#__PURE__*/ React.isValidElement(newElement)) throw new Error([
|
|
2003
|
-
"Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.",
|
|
2004
|
-
"A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.",
|
|
2005
|
-
"https://base-ui.com/r/invalid-render-prop"
|
|
2006
|
-
].join("\n"));
|
|
2007
|
-
}
|
|
2008
|
-
return /*#__PURE__*/ React.cloneElement(newElement, mergedProps);
|
|
2009
|
-
}
|
|
2010
|
-
if (element) {
|
|
2011
|
-
if (typeof element === "string") return renderTag(element, props);
|
|
2012
|
-
}
|
|
2013
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: Render element or function are not defined." : formatErrorMessage(8));
|
|
2014
|
-
}
|
|
2015
|
-
function warnIfRenderPropLooksLikeComponent(renderFn) {
|
|
2016
|
-
const functionName = renderFn.name;
|
|
2017
|
-
if (functionName.length === 0) return;
|
|
2018
|
-
if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) return;
|
|
2019
|
-
if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) return;
|
|
2020
|
-
warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
|
|
2021
|
-
}
|
|
2022
|
-
function renderTag(Tag, props) {
|
|
2023
|
-
if (Tag === "button") return /*#__PURE__*/ createElement("button", {
|
|
2024
|
-
type: "button",
|
|
2025
|
-
...props,
|
|
2026
|
-
key: props.key
|
|
2027
|
-
});
|
|
2028
|
-
if (Tag === "img") return /*#__PURE__*/ createElement("img", {
|
|
2029
|
-
alt: "",
|
|
2030
|
-
...props,
|
|
2031
|
-
key: props.key
|
|
2032
|
-
});
|
|
2033
|
-
return /*#__PURE__*/ React.createElement(Tag, props);
|
|
2034
|
-
}
|
|
2035
|
-
//#endregion
|
|
2036
|
-
//#region ../../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
2037
|
-
function hasWindow() {
|
|
2038
|
-
return typeof window !== "undefined";
|
|
2039
|
-
}
|
|
2040
|
-
function getWindow(node) {
|
|
2041
|
-
var _node$ownerDocument;
|
|
2042
|
-
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
2043
|
-
}
|
|
2044
|
-
function isHTMLElement(value) {
|
|
2045
|
-
if (!hasWindow()) return false;
|
|
2046
|
-
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
2047
|
-
}
|
|
2048
|
-
//#endregion
|
|
2049
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
|
|
2050
|
-
const CompositeRootContext = /*#__PURE__*/ React.createContext(void 0);
|
|
2051
|
-
if (process.env.NODE_ENV !== "production") CompositeRootContext.displayName = "CompositeRootContext";
|
|
2052
|
-
function useCompositeRootContext(optional = false) {
|
|
2053
|
-
const context = React.useContext(CompositeRootContext);
|
|
2054
|
-
if (context === void 0 && !optional) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage(16));
|
|
2055
|
-
return context;
|
|
2056
|
-
}
|
|
2057
|
-
//#endregion
|
|
2058
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs
|
|
2059
|
-
function useFocusableWhenDisabled(parameters) {
|
|
2060
|
-
const { focusableWhenDisabled, disabled, composite = false, tabIndex: tabIndexProp = 0, isNativeButton } = parameters;
|
|
2061
|
-
const isFocusableComposite = composite && focusableWhenDisabled !== false;
|
|
2062
|
-
const isNonFocusableComposite = composite && focusableWhenDisabled === false;
|
|
2063
|
-
return { props: React.useMemo(() => {
|
|
2064
|
-
const additionalProps = { onKeyDown(event) {
|
|
2065
|
-
if (disabled && focusableWhenDisabled && event.key !== "Tab") event.preventDefault();
|
|
2066
|
-
} };
|
|
2067
|
-
if (!composite) {
|
|
2068
|
-
additionalProps.tabIndex = tabIndexProp;
|
|
2069
|
-
if (!isNativeButton && disabled) additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
|
|
2070
|
-
}
|
|
2071
|
-
if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) additionalProps["aria-disabled"] = disabled;
|
|
2072
|
-
if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) additionalProps.disabled = disabled;
|
|
2073
|
-
return additionalProps;
|
|
2074
|
-
}, [
|
|
2075
|
-
composite,
|
|
2076
|
-
disabled,
|
|
2077
|
-
focusableWhenDisabled,
|
|
2078
|
-
isFocusableComposite,
|
|
2079
|
-
isNonFocusableComposite,
|
|
2080
|
-
isNativeButton,
|
|
2081
|
-
tabIndexProp
|
|
2082
|
-
]) };
|
|
2083
|
-
}
|
|
2084
|
-
//#endregion
|
|
2085
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/internals/use-button/useButton.mjs
|
|
2086
|
-
function useButton(parameters = {}) {
|
|
2087
|
-
const { disabled = false, focusableWhenDisabled, tabIndex = 0, native: isNativeButton = true, composite: compositeProp } = parameters;
|
|
2088
|
-
const elementRef = React.useRef(null);
|
|
2089
|
-
const compositeRootContext = useCompositeRootContext(true);
|
|
2090
|
-
const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
|
|
2091
|
-
const { props: focusableWhenDisabledProps } = useFocusableWhenDisabled({
|
|
2092
|
-
focusableWhenDisabled,
|
|
2093
|
-
disabled,
|
|
2094
|
-
composite: isCompositeItem,
|
|
2095
|
-
tabIndex,
|
|
2096
|
-
isNativeButton
|
|
2097
|
-
});
|
|
2098
|
-
if (process.env.NODE_ENV !== "production") React.useEffect(() => {
|
|
2099
|
-
if (!elementRef.current) return;
|
|
2100
|
-
const isButtonTag = isButtonElement(elementRef.current);
|
|
2101
|
-
if (isNativeButton) {
|
|
2102
|
-
if (!isButtonTag) error(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${SafeReact.captureOwnerStack?.() || ""}`);
|
|
2103
|
-
} else if (isButtonTag) error(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${SafeReact.captureOwnerStack?.() || ""}`);
|
|
2104
|
-
}, [isNativeButton]);
|
|
2105
|
-
const updateDisabled = React.useCallback(() => {
|
|
2106
|
-
const element = elementRef.current;
|
|
2107
|
-
if (!isButtonElement(element)) return;
|
|
2108
|
-
if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === void 0 && element.disabled) element.disabled = false;
|
|
2109
|
-
}, [
|
|
2110
|
-
disabled,
|
|
2111
|
-
focusableWhenDisabledProps.disabled,
|
|
2112
|
-
isCompositeItem
|
|
2113
|
-
]);
|
|
2114
|
-
useIsoLayoutEffect(updateDisabled, [updateDisabled]);
|
|
2115
|
-
return {
|
|
2116
|
-
getButtonProps: React.useCallback((externalProps = {}) => {
|
|
2117
|
-
const { onClick: externalOnClick, onMouseDown: externalOnMouseDown, onKeyUp: externalOnKeyUp, onKeyDown: externalOnKeyDown, onPointerDown: externalOnPointerDown, ...otherExternalProps } = externalProps;
|
|
2118
|
-
return mergeProps({
|
|
2119
|
-
onClick(event) {
|
|
2120
|
-
if (disabled) {
|
|
2121
|
-
event.preventDefault();
|
|
2122
|
-
return;
|
|
2123
|
-
}
|
|
2124
|
-
externalOnClick?.(event);
|
|
2125
|
-
},
|
|
2126
|
-
onMouseDown(event) {
|
|
2127
|
-
if (!disabled) externalOnMouseDown?.(event);
|
|
2128
|
-
},
|
|
2129
|
-
onKeyDown(event) {
|
|
2130
|
-
if (disabled) return;
|
|
2131
|
-
makeEventPreventable(event);
|
|
2132
|
-
externalOnKeyDown?.(event);
|
|
2133
|
-
if (event.baseUIHandlerPrevented) return;
|
|
2134
|
-
const isCurrentTarget = event.target === event.currentTarget;
|
|
2135
|
-
const currentTarget = event.currentTarget;
|
|
2136
|
-
const isButton = isButtonElement(currentTarget);
|
|
2137
|
-
const isLink = !isNativeButton && isValidLinkElement(currentTarget);
|
|
2138
|
-
const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);
|
|
2139
|
-
const isEnterKey = event.key === "Enter";
|
|
2140
|
-
const isSpaceKey = event.key === " ";
|
|
2141
|
-
const role = currentTarget.getAttribute("role");
|
|
2142
|
-
const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell";
|
|
2143
|
-
if (isCurrentTarget && isCompositeItem && isSpaceKey) {
|
|
2144
|
-
if (event.defaultPrevented && isTextNavigationRole) return;
|
|
2145
|
-
event.preventDefault();
|
|
2146
|
-
if (isLink || isNativeButton && isButton) {
|
|
2147
|
-
currentTarget.click();
|
|
2148
|
-
event.preventBaseUIHandler();
|
|
2149
|
-
} else if (shouldClick) {
|
|
2150
|
-
externalOnClick?.(event);
|
|
2151
|
-
event.preventBaseUIHandler();
|
|
2152
|
-
}
|
|
2153
|
-
return;
|
|
2154
|
-
}
|
|
2155
|
-
if (shouldClick) {
|
|
2156
|
-
if (!isNativeButton && (isSpaceKey || isEnterKey)) event.preventDefault();
|
|
2157
|
-
if (!isNativeButton && isEnterKey) externalOnClick?.(event);
|
|
2158
|
-
}
|
|
2159
|
-
},
|
|
2160
|
-
onKeyUp(event) {
|
|
2161
|
-
if (disabled) return;
|
|
2162
|
-
makeEventPreventable(event);
|
|
2163
|
-
externalOnKeyUp?.(event);
|
|
2164
|
-
if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") {
|
|
2165
|
-
event.preventDefault();
|
|
2166
|
-
return;
|
|
2167
|
-
}
|
|
2168
|
-
if (event.baseUIHandlerPrevented) return;
|
|
2169
|
-
if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && event.key === " ") externalOnClick?.(event);
|
|
2170
|
-
},
|
|
2171
|
-
onPointerDown(event) {
|
|
2172
|
-
if (disabled) {
|
|
2173
|
-
event.preventDefault();
|
|
2174
|
-
return;
|
|
2175
|
-
}
|
|
2176
|
-
externalOnPointerDown?.(event);
|
|
2177
|
-
}
|
|
2178
|
-
}, isNativeButton ? { type: "button" } : { role: "button" }, focusableWhenDisabledProps, otherExternalProps);
|
|
2179
|
-
}, [
|
|
2180
|
-
disabled,
|
|
2181
|
-
focusableWhenDisabledProps,
|
|
2182
|
-
isCompositeItem,
|
|
2183
|
-
isNativeButton
|
|
2184
|
-
]),
|
|
2185
|
-
buttonRef: useStableCallback((element) => {
|
|
2186
|
-
elementRef.current = element;
|
|
2187
|
-
updateDisabled();
|
|
2188
|
-
})
|
|
2189
|
-
};
|
|
2190
|
-
}
|
|
2191
|
-
function isButtonElement(elem) {
|
|
2192
|
-
return isHTMLElement(elem) && elem.tagName === "BUTTON";
|
|
2193
|
-
}
|
|
2194
|
-
function isValidLinkElement(elem) {
|
|
2195
|
-
return Boolean(elem?.tagName === "A" && elem?.href);
|
|
2196
|
-
}
|
|
2197
|
-
//#endregion
|
|
2198
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/button/Button.mjs
|
|
2199
|
-
/**
|
|
2200
|
-
* A button component that can be used to trigger actions.
|
|
2201
|
-
* Renders a `<button>` element.
|
|
2202
|
-
*
|
|
2203
|
-
* Documentation: [Base UI Button](https://base-ui.com/react/components/button)
|
|
2204
|
-
*/
|
|
2205
|
-
const Button$2 = /*#__PURE__*/ React.forwardRef(function Button(componentProps, forwardedRef) {
|
|
2206
|
-
const { render, className, disabled = false, focusableWhenDisabled = false, nativeButton = true, style, ...elementProps } = componentProps;
|
|
2207
|
-
const { getButtonProps, buttonRef } = useButton({
|
|
2208
|
-
disabled,
|
|
2209
|
-
focusableWhenDisabled,
|
|
2210
|
-
native: nativeButton
|
|
2211
|
-
});
|
|
2212
|
-
return useRenderElement("button", componentProps, {
|
|
2213
|
-
state: { disabled },
|
|
2214
|
-
ref: [forwardedRef, buttonRef],
|
|
2215
|
-
props: [elementProps, getButtonProps]
|
|
2216
|
-
});
|
|
2217
|
-
});
|
|
2218
|
-
if (process.env.NODE_ENV !== "production") Button$2.displayName = "Button";
|
|
2219
|
-
//#endregion
|
|
2220
|
-
//#region ../../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/use-render/useRender.mjs
|
|
2221
|
-
/**
|
|
2222
|
-
* Renders a Base UI element.
|
|
2223
|
-
*
|
|
2224
|
-
* @public
|
|
2225
|
-
*/
|
|
2226
|
-
function useRender(params) {
|
|
2227
|
-
return useRenderElement(params.defaultTagName ?? "div", params, params);
|
|
2228
|
-
}
|
|
2229
|
-
//#endregion
|
|
2230
|
-
//#region ../../../node_modules/.pnpm/@wordpress+ui@0.17.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/ui/build-module/text/text.mjs
|
|
2231
|
-
var STYLE_HASH_ATTRIBUTE$3 = "data-wp-hash";
|
|
2232
|
-
function getRuntime$3() {
|
|
2233
|
-
const globalScope = globalThis;
|
|
2234
|
-
if (globalScope.__wpStyleRuntime) return globalScope.__wpStyleRuntime;
|
|
2235
|
-
globalScope.__wpStyleRuntime = {
|
|
2236
|
-
documents: /* @__PURE__ */ new Map(),
|
|
2237
|
-
styles: /* @__PURE__ */ new Map(),
|
|
2238
|
-
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
2239
|
-
};
|
|
2240
|
-
if (typeof document !== "undefined") registerDocument$3(document);
|
|
2241
|
-
return globalScope.__wpStyleRuntime;
|
|
2242
|
-
}
|
|
2243
|
-
function documentContainsStyleHash$3(targetDocument, hash) {
|
|
2244
|
-
if (!targetDocument.head) return false;
|
|
2245
|
-
for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE$3}]`)) if (style.getAttribute(STYLE_HASH_ATTRIBUTE$3) === hash) return true;
|
|
2246
|
-
return false;
|
|
2247
|
-
}
|
|
2248
|
-
function injectStyle$3(targetDocument, hash, css) {
|
|
2249
|
-
if (!targetDocument.head) return;
|
|
2250
|
-
const runtime = getRuntime$3();
|
|
2251
|
-
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
2252
|
-
if (!injectedStyles) {
|
|
2253
|
-
injectedStyles = /* @__PURE__ */ new Set();
|
|
2254
|
-
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
2255
|
-
}
|
|
2256
|
-
if (injectedStyles.has(hash)) return;
|
|
2257
|
-
if (documentContainsStyleHash$3(targetDocument, hash)) {
|
|
2258
|
-
injectedStyles.add(hash);
|
|
2259
|
-
return;
|
|
2260
|
-
}
|
|
2261
|
-
const style = targetDocument.createElement("style");
|
|
2262
|
-
style.setAttribute(STYLE_HASH_ATTRIBUTE$3, hash);
|
|
2263
|
-
style.appendChild(targetDocument.createTextNode(css));
|
|
2264
|
-
targetDocument.head.appendChild(style);
|
|
2265
|
-
injectedStyles.add(hash);
|
|
2266
|
-
}
|
|
2267
|
-
function registerDocument$3(targetDocument) {
|
|
2268
|
-
const runtime = getRuntime$3();
|
|
2269
|
-
runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
|
|
2270
|
-
for (const [hash, css] of runtime.styles) injectStyle$3(targetDocument, hash, css);
|
|
2271
|
-
return () => {
|
|
2272
|
-
const count = runtime.documents.get(targetDocument);
|
|
2273
|
-
if (count === void 0) return;
|
|
2274
|
-
if (count <= 1) {
|
|
2275
|
-
runtime.documents.delete(targetDocument);
|
|
2276
|
-
return;
|
|
2277
|
-
}
|
|
2278
|
-
runtime.documents.set(targetDocument, count - 1);
|
|
2279
|
-
};
|
|
2280
|
-
}
|
|
2281
|
-
function registerStyle$3(hash, css) {
|
|
2282
|
-
const runtime = getRuntime$3();
|
|
2283
|
-
runtime.styles.set(hash, css);
|
|
2284
|
-
for (const targetDocument of runtime.documents.keys()) injectStyle$3(targetDocument, hash, css);
|
|
2285
|
-
}
|
|
2286
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle$3("0c5702ddca", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}");
|
|
2287
|
-
var style_default$3 = {
|
|
2288
|
-
"text": "_83ed8a8da5dd50ea__text",
|
|
2289
|
-
"heading-2xl": "_14437cfb77831647__heading-2xl",
|
|
2290
|
-
"heading-xl": "_3c78b7fa9b4072dd__heading-xl",
|
|
2291
|
-
"heading-lg": "aa58f227716bcde2__heading-lg",
|
|
2292
|
-
"heading-md": "fc4da56d8dfe52c4__heading-md",
|
|
2293
|
-
"heading-sm": "a9b78c7c82e8dff7__heading-sm",
|
|
2294
|
-
"body-xl": "_305ff559e52180d5__body-xl",
|
|
2295
|
-
"body-lg": "ca1aa3fc2029e958__body-lg",
|
|
2296
|
-
"body-md": "_131101940be12424__body-md",
|
|
2297
|
-
"body-sm": "_0e8d87a42c1f75fa__body-sm"
|
|
2298
|
-
};
|
|
2299
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle$3("d390e935a7", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}");
|
|
2300
|
-
var global_css_defense_default$1 = {
|
|
2301
|
-
"button": "_6defc79820e382c6__button",
|
|
2302
|
-
"input": "d2cff2e5dea83bd1__input",
|
|
2303
|
-
"textarea": "_547d86373d02e108__textarea",
|
|
2304
|
-
"div": "_8c15fd0ed9f28ba4__div",
|
|
2305
|
-
"p": "_43cec3e1eec1066d__p",
|
|
2306
|
-
"heading": "e97669c6d9a38497__heading",
|
|
2307
|
-
"a": "_2c0831b0499dbd6e__a"
|
|
2308
|
-
};
|
|
2309
|
-
var Text$1 = forwardRef$1(function Text2({ variant = "body-md", render, className, ...props }, ref) {
|
|
2310
|
-
return useRender({
|
|
2311
|
-
render,
|
|
2312
|
-
defaultTagName: "span",
|
|
2313
|
-
ref,
|
|
2314
|
-
props: mergeProps(props, { className: clsx(style_default$3.text, global_css_defense_default$1.heading, global_css_defense_default$1.p, style_default$3[variant], className) })
|
|
2315
|
-
});
|
|
2316
|
-
});
|
|
2317
|
-
//#endregion
|
|
2318
|
-
//#region ../../../node_modules/.pnpm/@wordpress+dom-ready@4.51.0/node_modules/@wordpress/dom-ready/build-module/index.mjs
|
|
2319
|
-
function domReady(callback) {
|
|
2320
|
-
if (typeof document === "undefined") return;
|
|
2321
|
-
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
2322
|
-
callback();
|
|
2323
|
-
return;
|
|
2324
|
-
}
|
|
2325
|
-
document.addEventListener("DOMContentLoaded", callback);
|
|
2326
|
-
}
|
|
2327
|
-
//#endregion
|
|
2328
|
-
//#region ../../../node_modules/.pnpm/@wordpress+a11y@4.51.0/node_modules/@wordpress/a11y/build-module/script/add-container.mjs
|
|
2329
|
-
function addContainer(ariaLive = "polite") {
|
|
2330
|
-
const container = document.createElement("div");
|
|
2331
|
-
container.id = `a11y-speak-${ariaLive}`;
|
|
2332
|
-
container.className = "a11y-speak-region";
|
|
2333
|
-
container.setAttribute("style", "position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;word-break:normal !important;");
|
|
2334
|
-
container.setAttribute("aria-live", ariaLive);
|
|
2335
|
-
container.setAttribute("aria-relevant", "additions text");
|
|
2336
|
-
container.setAttribute("aria-atomic", "true");
|
|
2337
|
-
const { body } = document;
|
|
2338
|
-
if (body) body.appendChild(container);
|
|
2339
|
-
return container;
|
|
2340
|
-
}
|
|
2341
|
-
//#endregion
|
|
2342
|
-
//#region ../../../node_modules/.pnpm/@wordpress+a11y@4.51.0/node_modules/@wordpress/a11y/build-module/script/add-intro-text.mjs
|
|
2343
|
-
function addIntroText() {
|
|
2344
|
-
const introText = document.createElement("p");
|
|
2345
|
-
introText.id = "a11y-speak-intro-text";
|
|
2346
|
-
introText.className = "a11y-speak-intro-text";
|
|
2347
|
-
introText.textContent = __("Notifications");
|
|
2348
|
-
introText.setAttribute("style", "position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;word-break:normal !important;");
|
|
2349
|
-
introText.setAttribute("hidden", "");
|
|
2350
|
-
const { body } = document;
|
|
2351
|
-
if (body) body.appendChild(introText);
|
|
2352
|
-
return introText;
|
|
2353
|
-
}
|
|
2354
|
-
//#endregion
|
|
2355
|
-
//#region ../../../node_modules/.pnpm/@wordpress+a11y@4.51.0/node_modules/@wordpress/a11y/build-module/shared/clear.mjs
|
|
2356
|
-
function clear() {
|
|
2357
|
-
const regions = document.getElementsByClassName("a11y-speak-region");
|
|
2358
|
-
const introText = document.getElementById("a11y-speak-intro-text");
|
|
2359
|
-
for (let i = 0; i < regions.length; i++) regions[i].textContent = "";
|
|
2360
|
-
if (introText) introText.setAttribute("hidden", "hidden");
|
|
2361
|
-
}
|
|
2362
|
-
//#endregion
|
|
2363
|
-
//#region ../../../node_modules/.pnpm/@wordpress+a11y@4.51.0/node_modules/@wordpress/a11y/build-module/shared/filter-message.mjs
|
|
2364
|
-
var previousMessage = "";
|
|
2365
|
-
function filterMessage(message) {
|
|
2366
|
-
message = message.replace(/<[^<>]+>/g, " ");
|
|
2367
|
-
if (previousMessage === message) message += "\xA0";
|
|
2368
|
-
previousMessage = message;
|
|
2369
|
-
return message;
|
|
2370
|
-
}
|
|
2371
|
-
//#endregion
|
|
2372
|
-
//#region ../../../node_modules/.pnpm/@wordpress+a11y@4.51.0/node_modules/@wordpress/a11y/build-module/shared/index.mjs
|
|
2373
|
-
function speak(message, ariaLive) {
|
|
2374
|
-
clear();
|
|
2375
|
-
message = filterMessage(message);
|
|
2376
|
-
const introText = document.getElementById("a11y-speak-intro-text");
|
|
2377
|
-
const containerAssertive = document.getElementById("a11y-speak-assertive");
|
|
2378
|
-
const containerPolite = document.getElementById("a11y-speak-polite");
|
|
2379
|
-
if (containerAssertive && ariaLive === "assertive") containerAssertive.textContent = message;
|
|
2380
|
-
else if (containerPolite) containerPolite.textContent = message;
|
|
2381
|
-
if (introText) introText.removeAttribute("hidden");
|
|
2382
|
-
}
|
|
2383
|
-
//#endregion
|
|
2384
|
-
//#region ../../../node_modules/.pnpm/@wordpress+a11y@4.51.0/node_modules/@wordpress/a11y/build-module/index.mjs
|
|
2385
|
-
function setup() {
|
|
2386
|
-
const introText = document.getElementById("a11y-speak-intro-text");
|
|
2387
|
-
const containerAssertive = document.getElementById("a11y-speak-assertive");
|
|
2388
|
-
const containerPolite = document.getElementById("a11y-speak-polite");
|
|
2389
|
-
if (introText === null) addIntroText();
|
|
2390
|
-
if (containerAssertive === null) addContainer("assertive");
|
|
2391
|
-
if (containerPolite === null) addContainer("polite");
|
|
2392
|
-
}
|
|
2393
|
-
domReady(setup);
|
|
2394
|
-
//#endregion
|
|
2395
|
-
//#region ../../../node_modules/.pnpm/@wordpress+ui@0.17.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/ui/build-module/button/button.mjs
|
|
2396
|
-
var STYLE_HASH_ATTRIBUTE$2 = "data-wp-hash";
|
|
2397
|
-
function getRuntime$2() {
|
|
2398
|
-
const globalScope = globalThis;
|
|
2399
|
-
if (globalScope.__wpStyleRuntime) return globalScope.__wpStyleRuntime;
|
|
2400
|
-
globalScope.__wpStyleRuntime = {
|
|
2401
|
-
documents: /* @__PURE__ */ new Map(),
|
|
2402
|
-
styles: /* @__PURE__ */ new Map(),
|
|
2403
|
-
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
2404
|
-
};
|
|
2405
|
-
if (typeof document !== "undefined") registerDocument$2(document);
|
|
2406
|
-
return globalScope.__wpStyleRuntime;
|
|
2407
|
-
}
|
|
2408
|
-
function documentContainsStyleHash$2(targetDocument, hash) {
|
|
2409
|
-
if (!targetDocument.head) return false;
|
|
2410
|
-
for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE$2}]`)) if (style.getAttribute(STYLE_HASH_ATTRIBUTE$2) === hash) return true;
|
|
2411
|
-
return false;
|
|
2412
|
-
}
|
|
2413
|
-
function injectStyle$2(targetDocument, hash, css) {
|
|
2414
|
-
if (!targetDocument.head) return;
|
|
2415
|
-
const runtime = getRuntime$2();
|
|
2416
|
-
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
2417
|
-
if (!injectedStyles) {
|
|
2418
|
-
injectedStyles = /* @__PURE__ */ new Set();
|
|
2419
|
-
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
2420
|
-
}
|
|
2421
|
-
if (injectedStyles.has(hash)) return;
|
|
2422
|
-
if (documentContainsStyleHash$2(targetDocument, hash)) {
|
|
2423
|
-
injectedStyles.add(hash);
|
|
2424
|
-
return;
|
|
2425
|
-
}
|
|
2426
|
-
const style = targetDocument.createElement("style");
|
|
2427
|
-
style.setAttribute(STYLE_HASH_ATTRIBUTE$2, hash);
|
|
2428
|
-
style.appendChild(targetDocument.createTextNode(css));
|
|
2429
|
-
targetDocument.head.appendChild(style);
|
|
2430
|
-
injectedStyles.add(hash);
|
|
2431
|
-
}
|
|
2432
|
-
function registerDocument$2(targetDocument) {
|
|
2433
|
-
const runtime = getRuntime$2();
|
|
2434
|
-
runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
|
|
2435
|
-
for (const [hash, css] of runtime.styles) injectStyle$2(targetDocument, hash, css);
|
|
2436
|
-
return () => {
|
|
2437
|
-
const count = runtime.documents.get(targetDocument);
|
|
2438
|
-
if (count === void 0) return;
|
|
2439
|
-
if (count <= 1) {
|
|
2440
|
-
runtime.documents.delete(targetDocument);
|
|
2441
|
-
return;
|
|
2442
|
-
}
|
|
2443
|
-
runtime.documents.set(targetDocument, count - 1);
|
|
2444
|
-
};
|
|
2445
|
-
}
|
|
2446
|
-
function registerStyle$2(hash, css) {
|
|
2447
|
-
const runtime = getRuntime$2();
|
|
2448
|
-
runtime.styles.set(hash, css);
|
|
2449
|
-
for (const targetDocument of runtime.documents.keys()) injectStyle$2(targetDocument, hash, css);
|
|
2450
|
-
}
|
|
2451
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle$2("4c317b0736", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:var(--wpds-typography-font-weight-medium,499);--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-strong-disabled,#8d8d8d);--wp-ui-button-padding-block:var(--wpds-dimension-padding-xs,4px);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:var(--wpds-dimension-size-lg,40px);--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-icon-margin:calc((var(--wpds-dimension-size-2xs, 16px) - var(--wpds-dimension-size-sm, 24px))/2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:padding-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid;border-block-end-color:transparent;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:transparent;border-radius:50%;box-sizing:border-box;content:\"\";display:block;height:var(--wp-ui-button-font-size);inset-inline-start:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}@media (forced-colors:active){border-block-end-style:none;border-bottom-color:ButtonText;border-inline-start-style:none;border-left-color:ButtonText;border-right-color:ButtonText;border-top-color:ButtonText}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-block:0;--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:var(--wpds-dimension-size-sm,24px)}._9f6fc6553aeb36fe__icon{margin:var(--wp-ui-button-icon-margin)}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-brand-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000)}}.e722a8f96726aa99__is-neutral{&.ad0619a3217c6a5b__is-minimal[aria-pressed=true],&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-strong-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:var(--wpds-dimension-size-md,32px)}._914b42f315c0e580__is-loading:not(.abbb272e2ce49bd6__is-unstyled){color:transparent;&:not([data-disabled]):is(:hover,:active,:focus){color:transparent}@media (forced-colors:active){color:ButtonFace}*{opacity:0}&:before{opacity:1;transition-delay:.05s;@media not (prefers-reduced-motion){animation:_5a1d53da6f830c8d__loading-animation 1s linear infinite}}}}@keyframes _5a1d53da6f830c8d__loading-animation{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}}");
|
|
2452
|
-
var style_default$2 = {
|
|
2453
|
-
"button": "_97b0fc33c028be1a__button",
|
|
2454
|
-
"is-unstyled": "abbb272e2ce49bd6__is-unstyled",
|
|
2455
|
-
"is-loading": "_914b42f315c0e580__is-loading",
|
|
2456
|
-
"is-small": "_908205475f9f2a92__is-small",
|
|
2457
|
-
"icon": "_9f6fc6553aeb36fe__icon",
|
|
2458
|
-
"is-brand": "dd460c965226cc77__is-brand",
|
|
2459
|
-
"is-outline": "_62d5a778b7b258ee__is-outline",
|
|
2460
|
-
"is-minimal": "ad0619a3217c6a5b__is-minimal",
|
|
2461
|
-
"is-neutral": "e722a8f96726aa99__is-neutral",
|
|
2462
|
-
"is-solid": "b50b3358c5fb4d0b__is-solid",
|
|
2463
|
-
"is-compact": "cf59cf1b69629838__is-compact",
|
|
2464
|
-
"loading-animation": "_5a1d53da6f830c8d__loading-animation"
|
|
2465
|
-
};
|
|
2466
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle$2("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
|
|
2467
|
-
var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
|
|
2468
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle$2("5f8e7aa0bc", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
|
|
2469
|
-
var focus_default = {
|
|
2470
|
-
"outset-ring--focus": "_08e8a2e44959f892__outset-ring--focus",
|
|
2471
|
-
"outset-ring--focus-except-active": "e25b2bdd7aa21721__outset-ring--focus-except-active",
|
|
2472
|
-
"outset-ring--focus-visible": "d0541bc9dd9dc7b6__outset-ring--focus-visible",
|
|
2473
|
-
"outset-ring--focus-within": "cd83dfc2126a0846__outset-ring--focus-within",
|
|
2474
|
-
"outset-ring--focus-within-except-active": "_970d04df7376df67__outset-ring--focus-within-except-active",
|
|
2475
|
-
"outset-ring--focus-within-visible": "c5cb3ee4bddaa8e4__outset-ring--focus-within-visible",
|
|
2476
|
-
"outset-ring--focus-parent-visible": "ecadb9e080e2dfa5__outset-ring--focus-parent-visible"
|
|
2477
|
-
};
|
|
2478
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle$2("d390e935a7", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}");
|
|
2479
|
-
var global_css_defense_default = {
|
|
2480
|
-
"button": "_6defc79820e382c6__button",
|
|
2481
|
-
"input": "d2cff2e5dea83bd1__input",
|
|
2482
|
-
"textarea": "_547d86373d02e108__textarea",
|
|
2483
|
-
"div": "_8c15fd0ed9f28ba4__div",
|
|
2484
|
-
"p": "_43cec3e1eec1066d__p",
|
|
2485
|
-
"heading": "e97669c6d9a38497__heading",
|
|
2486
|
-
"a": "_2c0831b0499dbd6e__a"
|
|
2487
|
-
};
|
|
2488
|
-
var Button$1 = forwardRef$1(function Button2({ tone = "brand", variant = "solid", size = "default", className, focusableWhenDisabled = true, disabled, loading, loadingAnnouncement = __("Loading"), children, ...props }, ref) {
|
|
2489
|
-
const mergedClassName = clsx(global_css_defense_default.button, resets_default["box-sizing"], focus_default["outset-ring--focus-except-active"], variant !== "unstyled" && style_default$2.button, style_default$2[`is-${tone}`], style_default$2[`is-${variant}`], style_default$2[`is-${size}`], loading && style_default$2["is-loading"], className);
|
|
2490
|
-
useEffect$1(() => {
|
|
2491
|
-
if (loading && loadingAnnouncement) speak(loadingAnnouncement);
|
|
2492
|
-
}, [loading, loadingAnnouncement]);
|
|
2493
|
-
return /* @__PURE__ */ jsx(Button$2, {
|
|
2494
|
-
ref,
|
|
2495
|
-
className: mergedClassName,
|
|
2496
|
-
focusableWhenDisabled,
|
|
2497
|
-
disabled: disabled ?? loading,
|
|
2498
|
-
...props,
|
|
2499
|
-
children
|
|
2500
|
-
});
|
|
2501
|
-
});
|
|
2502
|
-
//#endregion
|
|
2503
|
-
//#region ../../../node_modules/.pnpm/@wordpress+primitives@4.51.0_@types+react@18.3.28_react@18.3.1/node_modules/@wordpress/primitives/build-module/svg/index.mjs
|
|
2504
|
-
var SVG = forwardRef$1(
|
|
2505
|
-
/**
|
|
2506
|
-
* @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
|
|
2507
|
-
* Other props will be passed through to svg component.
|
|
2508
|
-
* @param {React.ForwardedRef<SVGSVGElement>} ref The forwarded ref to the SVG element.
|
|
2509
|
-
*
|
|
2510
|
-
* @return {React.JSX.Element} Stop component
|
|
2511
|
-
*/
|
|
2512
|
-
({ className, isPressed, ...props }, ref) => {
|
|
2513
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
2514
|
-
...props,
|
|
2515
|
-
className: clsx(className, { "is-pressed": isPressed }) || void 0,
|
|
2516
|
-
"aria-hidden": true,
|
|
2517
|
-
focusable: false,
|
|
2518
|
-
ref
|
|
2519
|
-
});
|
|
2520
|
-
}
|
|
2521
|
-
);
|
|
2522
|
-
SVG.displayName = "SVG";
|
|
2523
|
-
//#endregion
|
|
2524
|
-
//#region ../../../node_modules/.pnpm/@wordpress+ui@0.17.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/ui/build-module/icon/icon.mjs
|
|
2525
|
-
var Icon$2 = forwardRef$1(function Icon2({ icon, size = 24, ...restProps }, ref) {
|
|
2526
|
-
return /* @__PURE__ */ jsx(SVG, {
|
|
2527
|
-
ref,
|
|
2528
|
-
...icon.props,
|
|
2529
|
-
...restProps,
|
|
2530
|
-
width: size,
|
|
2531
|
-
height: size
|
|
2532
|
-
});
|
|
2533
|
-
});
|
|
2534
|
-
//#endregion
|
|
2535
|
-
//#region ../../../node_modules/.pnpm/@wordpress+ui@0.17.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/ui/build-module/button/icon.mjs
|
|
2536
|
-
var STYLE_HASH_ATTRIBUTE$1 = "data-wp-hash";
|
|
2537
|
-
function getRuntime$1() {
|
|
2538
|
-
const globalScope = globalThis;
|
|
2539
|
-
if (globalScope.__wpStyleRuntime) return globalScope.__wpStyleRuntime;
|
|
2540
|
-
globalScope.__wpStyleRuntime = {
|
|
2541
|
-
documents: /* @__PURE__ */ new Map(),
|
|
2542
|
-
styles: /* @__PURE__ */ new Map(),
|
|
2543
|
-
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
2544
|
-
};
|
|
2545
|
-
if (typeof document !== "undefined") registerDocument$1(document);
|
|
2546
|
-
return globalScope.__wpStyleRuntime;
|
|
2547
|
-
}
|
|
2548
|
-
function documentContainsStyleHash$1(targetDocument, hash) {
|
|
2549
|
-
if (!targetDocument.head) return false;
|
|
2550
|
-
for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE$1}]`)) if (style.getAttribute(STYLE_HASH_ATTRIBUTE$1) === hash) return true;
|
|
2551
|
-
return false;
|
|
2552
|
-
}
|
|
2553
|
-
function injectStyle$1(targetDocument, hash, css) {
|
|
2554
|
-
if (!targetDocument.head) return;
|
|
2555
|
-
const runtime = getRuntime$1();
|
|
2556
|
-
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
2557
|
-
if (!injectedStyles) {
|
|
2558
|
-
injectedStyles = /* @__PURE__ */ new Set();
|
|
2559
|
-
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
2560
|
-
}
|
|
2561
|
-
if (injectedStyles.has(hash)) return;
|
|
2562
|
-
if (documentContainsStyleHash$1(targetDocument, hash)) {
|
|
2563
|
-
injectedStyles.add(hash);
|
|
2564
|
-
return;
|
|
2565
|
-
}
|
|
2566
|
-
const style = targetDocument.createElement("style");
|
|
2567
|
-
style.setAttribute(STYLE_HASH_ATTRIBUTE$1, hash);
|
|
2568
|
-
style.appendChild(targetDocument.createTextNode(css));
|
|
2569
|
-
targetDocument.head.appendChild(style);
|
|
2570
|
-
injectedStyles.add(hash);
|
|
2571
|
-
}
|
|
2572
|
-
function registerDocument$1(targetDocument) {
|
|
2573
|
-
const runtime = getRuntime$1();
|
|
2574
|
-
runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
|
|
2575
|
-
for (const [hash, css] of runtime.styles) injectStyle$1(targetDocument, hash, css);
|
|
2576
|
-
return () => {
|
|
2577
|
-
const count = runtime.documents.get(targetDocument);
|
|
2578
|
-
if (count === void 0) return;
|
|
2579
|
-
if (count <= 1) {
|
|
2580
|
-
runtime.documents.delete(targetDocument);
|
|
2581
|
-
return;
|
|
2582
|
-
}
|
|
2583
|
-
runtime.documents.set(targetDocument, count - 1);
|
|
2584
|
-
};
|
|
2585
|
-
}
|
|
2586
|
-
function registerStyle$1(hash, css) {
|
|
2587
|
-
const runtime = getRuntime$1();
|
|
2588
|
-
runtime.styles.set(hash, css);
|
|
2589
|
-
for (const targetDocument of runtime.documents.keys()) injectStyle$1(targetDocument, hash, css);
|
|
2590
|
-
}
|
|
2591
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle$1("4c317b0736", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:var(--wpds-typography-font-weight-medium,499);--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-strong-disabled,#8d8d8d);--wp-ui-button-padding-block:var(--wpds-dimension-padding-xs,4px);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:var(--wpds-dimension-size-lg,40px);--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-icon-margin:calc((var(--wpds-dimension-size-2xs, 16px) - var(--wpds-dimension-size-sm, 24px))/2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:padding-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid;border-block-end-color:transparent;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:transparent;border-radius:50%;box-sizing:border-box;content:\"\";display:block;height:var(--wp-ui-button-font-size);inset-inline-start:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}@media (forced-colors:active){border-block-end-style:none;border-bottom-color:ButtonText;border-inline-start-style:none;border-left-color:ButtonText;border-right-color:ButtonText;border-top-color:ButtonText}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-block:0;--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:var(--wpds-dimension-size-sm,24px)}._9f6fc6553aeb36fe__icon{margin:var(--wp-ui-button-icon-margin)}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-brand-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000)}}.e722a8f96726aa99__is-neutral{&.ad0619a3217c6a5b__is-minimal[aria-pressed=true],&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-strong-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:var(--wpds-dimension-size-md,32px)}._914b42f315c0e580__is-loading:not(.abbb272e2ce49bd6__is-unstyled){color:transparent;&:not([data-disabled]):is(:hover,:active,:focus){color:transparent}@media (forced-colors:active){color:ButtonFace}*{opacity:0}&:before{opacity:1;transition-delay:.05s;@media not (prefers-reduced-motion){animation:_5a1d53da6f830c8d__loading-animation 1s linear infinite}}}}@keyframes _5a1d53da6f830c8d__loading-animation{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}}");
|
|
2592
|
-
var style_default$1 = {
|
|
2593
|
-
"button": "_97b0fc33c028be1a__button",
|
|
2594
|
-
"is-unstyled": "abbb272e2ce49bd6__is-unstyled",
|
|
2595
|
-
"is-loading": "_914b42f315c0e580__is-loading",
|
|
2596
|
-
"is-small": "_908205475f9f2a92__is-small",
|
|
2597
|
-
"icon": "_9f6fc6553aeb36fe__icon",
|
|
2598
|
-
"is-brand": "dd460c965226cc77__is-brand",
|
|
2599
|
-
"is-outline": "_62d5a778b7b258ee__is-outline",
|
|
2600
|
-
"is-minimal": "ad0619a3217c6a5b__is-minimal",
|
|
2601
|
-
"is-neutral": "e722a8f96726aa99__is-neutral",
|
|
2602
|
-
"is-solid": "b50b3358c5fb4d0b__is-solid",
|
|
2603
|
-
"is-compact": "cf59cf1b69629838__is-compact",
|
|
2604
|
-
"loading-animation": "_5a1d53da6f830c8d__loading-animation"
|
|
2605
|
-
};
|
|
2606
|
-
var ButtonIcon = forwardRef$1(function ButtonIcon2({ className, icon, ...props }, ref) {
|
|
2607
|
-
return /* @__PURE__ */ jsx(Icon$2, {
|
|
2608
|
-
ref,
|
|
2609
|
-
icon,
|
|
2610
|
-
className: clsx(style_default$1.icon, className),
|
|
2611
|
-
size: 24,
|
|
2612
|
-
...props
|
|
2613
|
-
});
|
|
2614
|
-
});
|
|
2615
|
-
//#endregion
|
|
2616
|
-
//#region ../../../node_modules/.pnpm/@wordpress+ui@0.17.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/ui/build-module/button/index.mjs
|
|
2617
|
-
ButtonIcon.displayName = "Button.Icon";
|
|
2618
|
-
var Button = Object.assign(Button$1, {
|
|
2619
|
-
/**
|
|
2620
|
-
* An icon component specifically designed to work well when rendered inside
|
|
2621
|
-
* a `Button` component.
|
|
2622
|
-
*/
|
|
2623
|
-
Icon: ButtonIcon });
|
|
2624
|
-
//#endregion
|
|
2625
|
-
//#region ../../../node_modules/.pnpm/@wordpress+ui@0.17.0_@types+react@18.3.28_date-fns@4.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/ui/build-module/stack/stack.mjs
|
|
2626
|
-
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
2627
|
-
function getRuntime() {
|
|
2628
|
-
const globalScope = globalThis;
|
|
2629
|
-
if (globalScope.__wpStyleRuntime) return globalScope.__wpStyleRuntime;
|
|
2630
|
-
globalScope.__wpStyleRuntime = {
|
|
2631
|
-
documents: /* @__PURE__ */ new Map(),
|
|
2632
|
-
styles: /* @__PURE__ */ new Map(),
|
|
2633
|
-
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
2634
|
-
};
|
|
2635
|
-
if (typeof document !== "undefined") registerDocument(document);
|
|
2636
|
-
return globalScope.__wpStyleRuntime;
|
|
2637
|
-
}
|
|
2638
|
-
function documentContainsStyleHash(targetDocument, hash) {
|
|
2639
|
-
if (!targetDocument.head) return false;
|
|
2640
|
-
for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) return true;
|
|
2641
|
-
return false;
|
|
2642
|
-
}
|
|
2643
|
-
function injectStyle(targetDocument, hash, css) {
|
|
2644
|
-
if (!targetDocument.head) return;
|
|
2645
|
-
const runtime = getRuntime();
|
|
2646
|
-
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
2647
|
-
if (!injectedStyles) {
|
|
2648
|
-
injectedStyles = /* @__PURE__ */ new Set();
|
|
2649
|
-
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
2650
|
-
}
|
|
2651
|
-
if (injectedStyles.has(hash)) return;
|
|
2652
|
-
if (documentContainsStyleHash(targetDocument, hash)) {
|
|
2653
|
-
injectedStyles.add(hash);
|
|
2654
|
-
return;
|
|
2655
|
-
}
|
|
2656
|
-
const style = targetDocument.createElement("style");
|
|
2657
|
-
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
|
|
2658
|
-
style.appendChild(targetDocument.createTextNode(css));
|
|
2659
|
-
targetDocument.head.appendChild(style);
|
|
2660
|
-
injectedStyles.add(hash);
|
|
2661
|
-
}
|
|
2662
|
-
function registerDocument(targetDocument) {
|
|
2663
|
-
const runtime = getRuntime();
|
|
2664
|
-
runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
|
|
2665
|
-
for (const [hash, css] of runtime.styles) injectStyle(targetDocument, hash, css);
|
|
2666
|
-
return () => {
|
|
2667
|
-
const count = runtime.documents.get(targetDocument);
|
|
2668
|
-
if (count === void 0) return;
|
|
2669
|
-
if (count <= 1) {
|
|
2670
|
-
runtime.documents.delete(targetDocument);
|
|
2671
|
-
return;
|
|
2672
|
-
}
|
|
2673
|
-
runtime.documents.set(targetDocument, count - 1);
|
|
2674
|
-
};
|
|
2675
|
-
}
|
|
2676
|
-
function registerStyle(hash, css) {
|
|
2677
|
-
const runtime = getRuntime();
|
|
2678
|
-
runtime.styles.set(hash, css);
|
|
2679
|
-
for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
|
|
2680
|
-
}
|
|
2681
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
|
|
2682
|
-
var style_default = { "stack": "_19ce0419607e1896__stack" };
|
|
2683
|
-
var gapTokens = {
|
|
2684
|
-
xs: "var(--wpds-dimension-gap-xs, 4px)",
|
|
2685
|
-
sm: "var(--wpds-dimension-gap-sm, 8px)",
|
|
2686
|
-
md: "var(--wpds-dimension-gap-md, 12px)",
|
|
2687
|
-
lg: "var(--wpds-dimension-gap-lg, 16px)",
|
|
2688
|
-
xl: "var(--wpds-dimension-gap-xl, 24px)",
|
|
2689
|
-
"2xl": "var(--wpds-dimension-gap-2xl, 32px)",
|
|
2690
|
-
"3xl": "var(--wpds-dimension-gap-3xl, 40px)"
|
|
2691
|
-
};
|
|
2692
|
-
var Stack = forwardRef$1(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
|
|
2693
|
-
return useRender({
|
|
2694
|
-
render,
|
|
2695
|
-
ref,
|
|
2696
|
-
props: mergeProps(props, {
|
|
2697
|
-
style: {
|
|
2698
|
-
gap: gap && gapTokens[gap],
|
|
2699
|
-
alignItems: align,
|
|
2700
|
-
justifyContent: justify,
|
|
2701
|
-
flexDirection: direction,
|
|
2702
|
-
flexWrap: wrap
|
|
2703
|
-
},
|
|
2704
|
-
className: style_default.stack
|
|
2705
|
-
})
|
|
2706
|
-
});
|
|
2707
|
-
});
|
|
2708
|
-
//#endregion
|
|
2709
1454
|
//#region src/components/legend/utils/value-or-identity.ts
|
|
2710
1455
|
/**
|
|
2711
1456
|
* Returns an object's value if defined, or the object.
|
|
@@ -3501,11 +2246,37 @@ const formatHourTick = (timestamp) => {
|
|
|
3501
2246
|
hour12: true
|
|
3502
2247
|
});
|
|
3503
2248
|
};
|
|
3504
|
-
const
|
|
2249
|
+
const formatDateOrHourTick = (timestamp) => {
|
|
2250
|
+
const date = new Date(timestamp);
|
|
2251
|
+
return date.getHours() === 0 && date.getMinutes() === 0 ? formatDateTick$1(timestamp) : formatHourTick(timestamp);
|
|
2252
|
+
};
|
|
2253
|
+
const formatMonthOrYearTick = (timestamp) => {
|
|
2254
|
+
const date = new Date(timestamp);
|
|
2255
|
+
return date.getMonth() === 0 ? formatYearTick(timestamp) : date.toLocaleDateString(void 0, { month: "short" });
|
|
2256
|
+
};
|
|
2257
|
+
const getPointSpacingInHours = (sortedData) => {
|
|
2258
|
+
return sortedData.reduce((spacing, datom) => datom.data.reduce((seriesSpacing, point, index) => {
|
|
2259
|
+
const previous = datom.data[index - 1];
|
|
2260
|
+
if (previous?.date === void 0 || point?.date === void 0) return seriesSpacing;
|
|
2261
|
+
return Math.min(seriesSpacing, Math.abs(differenceInHours(point.date, previous.date)));
|
|
2262
|
+
}, spacing), Number.POSITIVE_INFINITY);
|
|
2263
|
+
};
|
|
2264
|
+
const SPACING_BY_RESOLUTION = {
|
|
2265
|
+
hour: 1,
|
|
2266
|
+
day: 24,
|
|
2267
|
+
week: 168,
|
|
2268
|
+
month: 672
|
|
2269
|
+
};
|
|
2270
|
+
const getFormatter = (sortedData, tickResolution) => {
|
|
2271
|
+
if (tickResolution === "year") return formatYearTick;
|
|
3505
2272
|
const minX = Math.min(...sortedData.map((datom) => datom.data.at(0)?.date));
|
|
3506
2273
|
const maxX = Math.max(...sortedData.map((datom) => datom.data.at(-1)?.date));
|
|
3507
|
-
|
|
3508
|
-
|
|
2274
|
+
const spacingInHours = tickResolution ? SPACING_BY_RESOLUTION[tickResolution] : getPointSpacingInHours(sortedData);
|
|
2275
|
+
const isSubDaily = spacingInHours < 23;
|
|
2276
|
+
const diffInHours = Math.abs(differenceInHours(maxX, minX));
|
|
2277
|
+
if (diffInHours <= 24 && isSubDaily) return formatHourTick;
|
|
2278
|
+
if (diffInHours <= 168 && isSubDaily) return formatDateOrHourTick;
|
|
2279
|
+
if (Math.abs(differenceInYears(maxX, minX)) <= 1) return Number.isFinite(spacingInHours) && spacingInHours >= 672 ? formatMonthOrYearTick : formatDateTick$1;
|
|
3509
2280
|
return formatYearTick;
|
|
3510
2281
|
};
|
|
3511
2282
|
const guessOptimalNumTicks = (data, chartWidth, tickFormatter) => {
|
|
@@ -3742,14 +2513,8 @@ function ZoomClip({ active, chartId, children }) {
|
|
|
3742
2513
|
}
|
|
3743
2514
|
/**
|
|
3744
2515
|
* Visible icon-only reset control rendered as an HTML overlay on top of the
|
|
3745
|
-
* chart container, using the WPDS `
|
|
3746
|
-
* `position: relative` container so the button anchors correctly.
|
|
3747
|
-
*
|
|
3748
|
-
* `IconButton` would be the natural fit, but it renders a Base UI tooltip whose
|
|
3749
|
-
* CommonJS `use-sync-external-store` dependency makes Rolldown emit a dynamic
|
|
3750
|
-
* `require()` into `dist`, which throws on evaluation in WordPress Script
|
|
3751
|
-
* Module consumers. `Button` gives the same treatment without that dependency;
|
|
3752
|
-
* the tooltip is replaced by `aria-label` + `title`.
|
|
2516
|
+
* chart container, using the WPDS `IconButton`. The host should wrap its SVG in
|
|
2517
|
+
* a `position: relative` container so the button anchors correctly.
|
|
3753
2518
|
*
|
|
3754
2519
|
* @param props - Props.
|
|
3755
2520
|
* @param props.onClick - Click handler. Typically the `reset` from `useXZoom`.
|
|
@@ -3759,17 +2524,15 @@ function ZoomResetButton({ onClick }) {
|
|
|
3759
2524
|
const stopActivationKeys = useCallback((event) => {
|
|
3760
2525
|
if (event.key === "Enter" || event.key === " ") event.stopPropagation();
|
|
3761
2526
|
}, []);
|
|
3762
|
-
|
|
3763
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
2527
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
3764
2528
|
className: x_zoom_module_default["x-zoom__reset"],
|
|
3765
2529
|
onKeyDown: stopActivationKeys,
|
|
3766
|
-
|
|
3767
|
-
title: label,
|
|
2530
|
+
label: __("Reset zoom", "jetpack-charts"),
|
|
3768
2531
|
variant: "outline",
|
|
3769
2532
|
tone: "neutral",
|
|
3770
2533
|
size: "small",
|
|
3771
2534
|
onClick,
|
|
3772
|
-
|
|
2535
|
+
icon: /* @__PURE__ */ jsx("svg", {
|
|
3773
2536
|
viewBox: "0 0 24 24",
|
|
3774
2537
|
fill: "none",
|
|
3775
2538
|
stroke: "currentColor",
|
|
@@ -3800,7 +2563,7 @@ function ZoomResetButton({ onClick }) {
|
|
|
3800
2563
|
})
|
|
3801
2564
|
]
|
|
3802
2565
|
})
|
|
3803
|
-
})
|
|
2566
|
+
})
|
|
3804
2567
|
});
|
|
3805
2568
|
}
|
|
3806
2569
|
//#endregion
|
|
@@ -4372,7 +3135,8 @@ const LineChartInternal = forwardRef(({ data, chartId: providedChartId, width, h
|
|
|
4372
3135
|
totalPoints: dataSorted[0]?.data.length || 0
|
|
4373
3136
|
});
|
|
4374
3137
|
const chartOptions = useMemo(() => {
|
|
4375
|
-
const
|
|
3138
|
+
const { tickResolution, ...xAxisOptions } = options?.axis?.x ?? {};
|
|
3139
|
+
const formatter = xAxisOptions.tickFormat || getFormatter(dataSorted, tickResolution);
|
|
4376
3140
|
return {
|
|
4377
3141
|
axis: {
|
|
4378
3142
|
x: {
|
|
@@ -4380,7 +3144,7 @@ const LineChartInternal = forwardRef(({ data, chartId: providedChartId, width, h
|
|
|
4380
3144
|
numTicks: guessOptimalNumTicks(dataSorted, width, formatter),
|
|
4381
3145
|
tickFormat: formatter,
|
|
4382
3146
|
display: true,
|
|
4383
|
-
...
|
|
3147
|
+
...xAxisOptions
|
|
4384
3148
|
},
|
|
4385
3149
|
y: {
|
|
4386
3150
|
orientation: "left",
|
|
@@ -4846,7 +3610,8 @@ const AreaChartInternal = forwardRef(({ data, chartId: providedChartId, width, h
|
|
|
4846
3610
|
rescaleYOnVisibility
|
|
4847
3611
|
]);
|
|
4848
3612
|
const chartOptions = useMemo(() => {
|
|
4849
|
-
const
|
|
3613
|
+
const { tickResolution, ...xAxisOptions } = options?.axis?.x ?? {};
|
|
3614
|
+
const formatter = xAxisOptions.tickFormat || getFormatter(dataSorted, tickResolution);
|
|
4850
3615
|
return {
|
|
4851
3616
|
axis: {
|
|
4852
3617
|
x: {
|
|
@@ -4854,7 +3619,7 @@ const AreaChartInternal = forwardRef(({ data, chartId: providedChartId, width, h
|
|
|
4854
3619
|
numTicks: guessOptimalNumTicks(dataSorted, width, formatter),
|
|
4855
3620
|
tickFormat: formatter,
|
|
4856
3621
|
display: true,
|
|
4857
|
-
...
|
|
3622
|
+
...xAxisOptions
|
|
4858
3623
|
},
|
|
4859
3624
|
y: {
|
|
4860
3625
|
orientation: "left",
|
|
@@ -7067,6 +5832,73 @@ const HeatmapChartResponsiveInner = (props) => /* @__PURE__ */ jsx(HeatmapChartW
|
|
|
7067
5832
|
HeatmapChartResponsiveInner.displayName = "HeatmapChart";
|
|
7068
5833
|
const HeatmapChartResponsive = attachSubComponents(withResponsive(HeatmapChartResponsiveInner), { Legend: HeatmapLegend });
|
|
7069
5834
|
//#endregion
|
|
5835
|
+
//#region ../../../node_modules/.pnpm/is-plain-object@5.0.0/node_modules/is-plain-object/dist/is-plain-object.mjs
|
|
5836
|
+
/*!
|
|
5837
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
5838
|
+
*
|
|
5839
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
5840
|
+
* Released under the MIT License.
|
|
5841
|
+
*/
|
|
5842
|
+
function isObject(o) {
|
|
5843
|
+
return Object.prototype.toString.call(o) === "[object Object]";
|
|
5844
|
+
}
|
|
5845
|
+
function isPlainObject(o) {
|
|
5846
|
+
var ctor, prot;
|
|
5847
|
+
if (isObject(o) === false) return false;
|
|
5848
|
+
ctor = o.constructor;
|
|
5849
|
+
if (ctor === void 0) return true;
|
|
5850
|
+
prot = ctor.prototype;
|
|
5851
|
+
if (isObject(prot) === false) return false;
|
|
5852
|
+
if (prot.hasOwnProperty("isPrototypeOf") === false) return false;
|
|
5853
|
+
return true;
|
|
5854
|
+
}
|
|
5855
|
+
//#endregion
|
|
5856
|
+
//#region ../../../node_modules/.pnpm/lower-case@2.0.2/node_modules/lower-case/dist.es2015/index.js
|
|
5857
|
+
/**
|
|
5858
|
+
* Lower case as a function.
|
|
5859
|
+
*/
|
|
5860
|
+
function lowerCase(str) {
|
|
5861
|
+
return str.toLowerCase();
|
|
5862
|
+
}
|
|
5863
|
+
//#endregion
|
|
5864
|
+
//#region ../../../node_modules/.pnpm/no-case@3.0.4/node_modules/no-case/dist.es2015/index.js
|
|
5865
|
+
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
|
5866
|
+
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
5867
|
+
/**
|
|
5868
|
+
* Normalize the string into something other libraries can manipulate easier.
|
|
5869
|
+
*/
|
|
5870
|
+
function noCase(input, options) {
|
|
5871
|
+
if (options === void 0) options = {};
|
|
5872
|
+
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
|
|
5873
|
+
var result = replace$1(replace$1(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
|
5874
|
+
var start = 0;
|
|
5875
|
+
var end = result.length;
|
|
5876
|
+
while (result.charAt(start) === "\0") start++;
|
|
5877
|
+
while (result.charAt(end - 1) === "\0") end--;
|
|
5878
|
+
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
5879
|
+
}
|
|
5880
|
+
/**
|
|
5881
|
+
* Replace `re` in the input string with the replacement value.
|
|
5882
|
+
*/
|
|
5883
|
+
function replace$1(input, re, value) {
|
|
5884
|
+
if (re instanceof RegExp) return input.replace(re, value);
|
|
5885
|
+
return re.reduce(function(input, re) {
|
|
5886
|
+
return input.replace(re, value);
|
|
5887
|
+
}, input);
|
|
5888
|
+
}
|
|
5889
|
+
//#endregion
|
|
5890
|
+
//#region ../../../node_modules/.pnpm/dot-case@3.0.4/node_modules/dot-case/dist.es2015/index.js
|
|
5891
|
+
function dotCase(input, options) {
|
|
5892
|
+
if (options === void 0) options = {};
|
|
5893
|
+
return noCase(input, __assign({ delimiter: "." }, options));
|
|
5894
|
+
}
|
|
5895
|
+
//#endregion
|
|
5896
|
+
//#region ../../../node_modules/.pnpm/param-case@3.0.4/node_modules/param-case/dist.es2015/index.js
|
|
5897
|
+
function paramCase(input, options) {
|
|
5898
|
+
if (options === void 0) options = {};
|
|
5899
|
+
return dotCase(input, __assign({ delimiter: "-" }, options));
|
|
5900
|
+
}
|
|
5901
|
+
//#endregion
|
|
7070
5902
|
//#region ../../../node_modules/.pnpm/@wordpress+components@37.0.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.mjs
|
|
7071
5903
|
function useUpdateEffect(effect, deps) {
|
|
7072
5904
|
const mountedRef = useRef$1(false);
|
|
@@ -8931,10 +7763,10 @@ var require_es6 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
8931
7763
|
};
|
|
8932
7764
|
}));
|
|
8933
7765
|
//#endregion
|
|
8934
|
-
//#region ../../../node_modules/.pnpm/@wordpress+warning@3.
|
|
7766
|
+
//#region ../../../node_modules/.pnpm/@wordpress+warning@3.52.0/node_modules/@wordpress/warning/build-module/utils.mjs
|
|
8935
7767
|
var logged = /* @__PURE__ */ new Set();
|
|
8936
7768
|
//#endregion
|
|
8937
|
-
//#region ../../../node_modules/.pnpm/@wordpress+warning@3.
|
|
7769
|
+
//#region ../../../node_modules/.pnpm/@wordpress+warning@3.52.0/node_modules/@wordpress/warning/build-module/index.mjs
|
|
8938
7770
|
function isDev() {
|
|
8939
7771
|
return globalThis.SCRIPT_DEBUG === true;
|
|
8940
7772
|
}
|