@eightshift/ui-components 4.0.0 → 5.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.
Files changed (144) hide show
  1. package/package.json +101 -101
  2. package/dist/Button-CvzGKGCo.js +0 -185
  3. package/dist/Collection-ddre1L5v.js +0 -2332
  4. package/dist/Color-MV5kBVXr.js +0 -2452
  5. package/dist/ColorSwatch-BqQfVu4L.js +0 -64
  6. package/dist/ComboBox-jQ-dk95U.js +0 -1906
  7. package/dist/Dialog-DX1aiYyE.js +0 -2300
  8. package/dist/FieldError-52GVSGgC.js +0 -42
  9. package/dist/FocusScope-Cri5BFRz.js +0 -831
  10. package/dist/Form-Cq3fu75_.js +0 -5
  11. package/dist/Group-_emcIVxI.js +0 -48
  12. package/dist/Heading-B2153VXe.js +0 -16
  13. package/dist/Hidden-rE6uR-lr.js +0 -41
  14. package/dist/Input-BxpFEIXV.js +0 -133
  15. package/dist/Label-icmbmNdI.js +0 -17
  16. package/dist/List-BYNHbol3.js +0 -593
  17. package/dist/ListBox-mJ4nQaL7.js +0 -581
  18. package/dist/NumberFormatter-DA8u1Ot7.js +0 -140
  19. package/dist/OverlayArrow-BB0CWwdq.js +0 -629
  20. package/dist/RSPContexts-2lR5GG9p.js +0 -14
  21. package/dist/Select-aab027f3.esm--EmXjiL3.js +0 -2469
  22. package/dist/Separator-D9moUgP8.js +0 -322
  23. package/dist/Slider-rz2XRMGm.js +0 -853
  24. package/dist/Text-DVSAPY-K.js +0 -16
  25. package/dist/VisuallyHidden-f9zX67a_.js +0 -48
  26. package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
  27. package/dist/assets/index.css +0 -37
  28. package/dist/assets/style-admin.css +0 -5255
  29. package/dist/assets/style-editor.css +0 -5255
  30. package/dist/assets/style.css +0 -5261
  31. package/dist/assets/wp-font-enhancements.css +0 -8
  32. package/dist/assets/wp-ui-enhancements.css +0 -299
  33. package/dist/components/animated-visibility/animated-visibility.js +0 -105
  34. package/dist/components/base-control/base-control.js +0 -86
  35. package/dist/components/breakpoint-preview/breakpoint-preview.js +0 -161
  36. package/dist/components/button/button.js +0 -387
  37. package/dist/components/checkbox/checkbox.js +0 -320
  38. package/dist/components/color-pickers/color-picker.js +0 -272
  39. package/dist/components/color-pickers/color-swatch.js +0 -58
  40. package/dist/components/color-pickers/gradient-editor.js +0 -534
  41. package/dist/components/color-pickers/solid-color-picker.js +0 -1567
  42. package/dist/components/component-toggle/component-toggle.js +0 -158
  43. package/dist/components/container-panel/container-panel.js +0 -131
  44. package/dist/components/draggable/draggable-context.js +0 -5
  45. package/dist/components/draggable/draggable-handle.js +0 -46
  46. package/dist/components/draggable/draggable.js +0 -6207
  47. package/dist/components/draggable-list/draggable-list-context.js +0 -5
  48. package/dist/components/draggable-list/draggable-list-item.js +0 -77
  49. package/dist/components/draggable-list/draggable-list.js +0 -151
  50. package/dist/components/expandable/expandable.js +0 -342
  51. package/dist/components/index.js +0 -137
  52. package/dist/components/input-field/input-field.js +0 -231
  53. package/dist/components/item-collection/item-collection.js +0 -59
  54. package/dist/components/layout/hstack.js +0 -30
  55. package/dist/components/layout/vstack.js +0 -30
  56. package/dist/components/link-input/link-input.js +0 -293
  57. package/dist/components/matrix-align/matrix-align.js +0 -134
  58. package/dist/components/menu/menu.js +0 -285
  59. package/dist/components/modal/modal.js +0 -305
  60. package/dist/components/notice/notice.js +0 -123
  61. package/dist/components/number-picker/number-picker.js +0 -292
  62. package/dist/components/option-select/option-select.js +0 -264
  63. package/dist/components/options-panel/options-panel.js +0 -158
  64. package/dist/components/placeholders/file-placeholder.js +0 -42
  65. package/dist/components/placeholders/image-placeholder.js +0 -88
  66. package/dist/components/placeholders/media-placeholder.js +0 -63
  67. package/dist/components/popover/popover.js +0 -207
  68. package/dist/components/radio/radio.js +0 -579
  69. package/dist/components/repeater/repeater-context.js +0 -5
  70. package/dist/components/repeater/repeater-item.js +0 -119
  71. package/dist/components/repeater/repeater.js +0 -280
  72. package/dist/components/responsive/mini-responsive.js +0 -498
  73. package/dist/components/responsive/responsive-legacy.js +0 -343
  74. package/dist/components/responsive/responsive.js +0 -580
  75. package/dist/components/responsive-preview/responsive-preview.js +0 -123
  76. package/dist/components/rich-label/rich-label.js +0 -66
  77. package/dist/components/select/async-multi-select.js +0 -157
  78. package/dist/components/select/async-single-select.js +0 -137
  79. package/dist/components/select/custom-select-default-components.js +0 -38
  80. package/dist/components/select/multi-select-components.js +0 -8
  81. package/dist/components/select/multi-select.js +0 -151
  82. package/dist/components/select/react-select-component-wrappers.js +0 -90
  83. package/dist/components/select/shared.js +0 -26
  84. package/dist/components/select/single-select.js +0 -131
  85. package/dist/components/select/styles.js +0 -49
  86. package/dist/components/select/v2/async-select.js +0 -297
  87. package/dist/components/select/v2/shared.js +0 -24
  88. package/dist/components/select/v2/single-select.js +0 -990
  89. package/dist/components/slider/column-config-slider.js +0 -210
  90. package/dist/components/slider/slider.js +0 -343
  91. package/dist/components/slider/utils.js +0 -84
  92. package/dist/components/spacer/spacer.js +0 -97
  93. package/dist/components/tabs/tabs.js +0 -702
  94. package/dist/components/toggle/switch.js +0 -155
  95. package/dist/components/toggle/toggle.js +0 -64
  96. package/dist/components/toggle-button/toggle-button.js +0 -324
  97. package/dist/components/tooltip/tooltip.js +0 -525
  98. package/dist/context-D2KUdwNL.js +0 -92
  99. package/dist/default-i18n-CT_oS1Fy.js +0 -922
  100. package/dist/filterDOMProps-EDDcM64A.js +0 -28
  101. package/dist/icons/block-icon.js +0 -42
  102. package/dist/icons/generic-color-swatch.js +0 -113
  103. package/dist/icons/icons.js +0 -30371
  104. package/dist/icons/index.js +0 -11
  105. package/dist/icons/jsx-svg.js +0 -50
  106. package/dist/index-641ee5b8.esm-BPz6U6sJ.js +0 -3137
  107. package/dist/index-BKGQ6jGS.js +0 -44
  108. package/dist/index-BYHhzLf-.js +0 -444
  109. package/dist/index.js +0 -139
  110. package/dist/lite-DVmmD_-j.js +0 -7
  111. package/dist/modifiers.esm-BuJQPI1X.js +0 -31
  112. package/dist/multi-select-components-BlZZoNXC.js +0 -3744
  113. package/dist/number-GajL10e1.js +0 -36
  114. package/dist/react-jsx-parser.min-DZCiis5V.js +0 -11753
  115. package/dist/react-select-async.esm-CwUoej5h.js +0 -107
  116. package/dist/react-select.esm-DcwYxadV.js +0 -15
  117. package/dist/style-admin.js +0 -1
  118. package/dist/style-editor.js +0 -1
  119. package/dist/style.js +0 -1
  120. package/dist/textSelection-0UUS8Yfg.js +0 -46
  121. package/dist/useButton-BpOKDWEN.js +0 -71
  122. package/dist/useEvent-B0b-6KBr.js +0 -23
  123. package/dist/useFocusRing-CV5l3lf6.js +0 -107
  124. package/dist/useFormReset-C5OggHsw.js +0 -22
  125. package/dist/useFormValidation-DhDNSjws.js +0 -224
  126. package/dist/useHover-DwDr6ozG.js +0 -900
  127. package/dist/useLabel-D7HkNEHT.js +0 -27
  128. package/dist/useLabels-D8cxd1Z8.js +0 -23
  129. package/dist/useListState-UGlN5-7P.js +0 -161
  130. package/dist/useLocalizedStringFormatter-CFP1YZWQ.js +0 -121
  131. package/dist/useNumberField-CEAj7Mrj.js +0 -1204
  132. package/dist/useNumberFormatter-321rAb4J.js +0 -13
  133. package/dist/usePress-DNW8qpY6.js +0 -664
  134. package/dist/useSingleSelectListState-DC0wWTUM.js +0 -38
  135. package/dist/useToggle-BrpmSOB-.js +0 -59
  136. package/dist/useToggleState-CmQX3SoX.js +0 -19
  137. package/dist/utilities/array-helpers.js +0 -56
  138. package/dist/utilities/debounce-throttle.js +0 -123
  139. package/dist/utilities/es-dash.js +0 -376
  140. package/dist/utilities/index.js +0 -27
  141. package/dist/utilities/text-helpers.js +0 -136
  142. package/dist/utils-DkCSC521.js +0 -370
  143. package/dist/wp/wp-font-enhancements.js +0 -1
  144. package/dist/wp/wp-ui-enhancements.js +0 -1
@@ -1,136 +0,0 @@
1
- /**
2
- * Slices the string in the middle and inputs the provided separator so that the string is maxLength characters long.
3
- *
4
- * @param {string} input - String to slice.
5
- * @param {number} maxLength - Maximum allowed string length.
6
- * @param {string} [separator='...'] - Separator to insert.
7
- *
8
- * @access public
9
- *
10
- * @returns {string|Error} Truncated string or error if separator length exceeds maxLength.
11
- *
12
- * Usage:
13
- * ```js
14
- * truncateMiddle('https://eightshift.com/contact/', 22);
15
- * ```
16
- *
17
- * Output:
18
- * ```js
19
- * "https://ei.../contact/"
20
- *
21
- * @preserve
22
- */
23
- const truncateMiddle = (input, maxLength, separator = "...") => {
24
- if (!input) {
25
- return null;
26
- }
27
- if ((input == null ? void 0 : input.length) <= maxLength) {
28
- return input;
29
- }
30
- if (separator.length + 1 > maxLength) {
31
- throw new Error("Separator length exceeds the passed maximum length, string wouldn't be visible.");
32
- }
33
- const maxStringLength = maxLength - separator.length;
34
- const leftPartLength = Math.ceil(maxStringLength / 2);
35
- const rightPartLength = Math.floor(maxStringLength / 2);
36
- const leftPart = input.slice(0, leftPartLength).trim();
37
- const rightPart = rightPartLength > 0 ? input.slice(-1 * rightPartLength).trim() : "";
38
- return `${leftPart}${separator}${rightPart}`;
39
- };
40
- /**
41
- * Un-escapes HTML entities.
42
- *
43
- * @param {string} input - Input string.
44
- *
45
- * @access public
46
- *
47
- * @returns {string} String with HTML entities unescaped.
48
- *
49
- * Usage:
50
- * ```js
51
- * unescapeHTML('Test&#38;Up');
52
- * ```
53
- *
54
- * Output:
55
- * ```js
56
- * Test&Up
57
- * ```
58
- *
59
- * @preserve
60
- */
61
- const unescapeHTML = (input = "") => new DOMParser().parseFromString(input, "text/html").documentElement.textContent;
62
- /**
63
- * Limits the string to the maximum length and adds the provided separator in case the string is longer.
64
- *
65
- * @param {string} input - String to slice.
66
- * @param {number} maxLength - Maximum allowed string length.
67
- * @param {string} [separator='...'] - Separator to insert.
68
- *
69
- * @access public
70
- *
71
- * @returns {string|Error} Truncated string or error if separator length exceeds maxLength.
72
- *
73
- * Usage:
74
- * ```js
75
- * truncate('Hello this is a string', 13); // => "Hello this..."
76
- * ```
77
- *
78
- * @preserve
79
- */
80
- const truncate = (input, maxLength, separator = "...") => {
81
- if (!input) {
82
- return null;
83
- }
84
- if ((input == null ? void 0 : input.length) <= maxLength) {
85
- return input;
86
- }
87
- if (separator.length + 1 > maxLength) {
88
- throw new Error("Separator length exceeds the passed maximum length, string wouldn't be visible.");
89
- }
90
- const maxStringLength = maxLength - separator.length;
91
- const leftPart = input.slice(0, maxStringLength).trim();
92
- return `${leftPart}${separator}`;
93
- };
94
- /**
95
- * Slices the string at the end and inputs the provided separator so that the string is maxLength characters long.
96
- *
97
- * @param {string} input - String to slice.
98
- * @param {number} maxLength - Maximum allowed string length.
99
- * @param {string} [separator='...'] - Separator to insert.
100
- *
101
- * @access public
102
- *
103
- * @returns {string|Error} Truncated string or error if separator length exceeds maxLength.
104
- *
105
- * Usage:
106
- * ```js
107
- * truncateMiddle('https://eightshift.com/contact/', 22);
108
- * ```
109
- *
110
- * Output:
111
- * ```js
112
- * "https://ei.../contact/"
113
- *
114
- * @preserve
115
- */
116
- const truncateEnd = (input, maxLength, separator = "...") => {
117
- if (!input) {
118
- return null;
119
- }
120
- if ((input == null ? void 0 : input.length) <= maxLength) {
121
- return input;
122
- }
123
- if (separator.length + 1 > maxLength) {
124
- throw new Error("Separator length exceeds the passed maximum length, string wouldn't be visible.");
125
- }
126
- const maxStringLength = maxLength - separator.length;
127
- const leftPartLength = Math.ceil(maxStringLength);
128
- const leftPart = input.slice(0, leftPartLength).trim();
129
- return `${leftPart}${separator}`;
130
- };
131
- export {
132
- truncate,
133
- truncateEnd,
134
- truncateMiddle,
135
- unescapeHTML
136
- };
@@ -1,370 +0,0 @@
1
- import React__default, { useRef, useCallback, useState, useContext, useEffect, useMemo } from "react";
2
- const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== "undefined" ? React__default.useLayoutEffect : () => {
3
- };
4
- function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
5
- const ref = useRef(null);
6
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
7
- ref.current = fn;
8
- }, [
9
- fn
10
- ]);
11
- return useCallback((...args) => {
12
- const f = ref.current;
13
- return f === null || f === void 0 ? void 0 : f(...args);
14
- }, []);
15
- }
16
- function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
17
- let [value, setValue] = useState(defaultValue);
18
- let effect = useRef(null);
19
- let nextRef = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
20
- if (!effect.current) return;
21
- let newValue = effect.current.next();
22
- if (newValue.done) {
23
- effect.current = null;
24
- return;
25
- }
26
- if (value === newValue.value) nextRef();
27
- else setValue(newValue.value);
28
- });
29
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
30
- if (effect.current) nextRef();
31
- });
32
- let queue = $8ae05eaa5c114e9c$export$7f54fc3180508a52((fn) => {
33
- effect.current = fn(value);
34
- nextRef();
35
- });
36
- return [
37
- value,
38
- queue
39
- ];
40
- }
41
- const $b5e257d569688ac6$var$defaultContext = {
42
- prefix: String(Math.round(Math.random() * 1e10)),
43
- current: 0
44
- };
45
- const $b5e257d569688ac6$var$SSRContext = /* @__PURE__ */ React__default.createContext($b5e257d569688ac6$var$defaultContext);
46
- const $b5e257d569688ac6$var$IsSSRContext = /* @__PURE__ */ React__default.createContext(false);
47
- let $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
48
- let $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap();
49
- function $b5e257d569688ac6$var$useCounter(isDisabled = false) {
50
- let ctx = useContext($b5e257d569688ac6$var$SSRContext);
51
- let ref = useRef(null);
52
- if (ref.current === null && !isDisabled) {
53
- var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
54
- let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = React__default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 ? void 0 : (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
55
- if (currentOwner) {
56
- let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner);
57
- if (prevComponentValue == null)
58
- $b5e257d569688ac6$var$componentIds.set(currentOwner, {
59
- id: ctx.current,
60
- state: currentOwner.memoizedState
61
- });
62
- else if (currentOwner.memoizedState !== prevComponentValue.state) {
63
- ctx.current = prevComponentValue.id;
64
- $b5e257d569688ac6$var$componentIds.delete(currentOwner);
65
- }
66
- }
67
- ref.current = ++ctx.current;
68
- }
69
- return ref.current;
70
- }
71
- function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) {
72
- let ctx = useContext($b5e257d569688ac6$var$SSRContext);
73
- if (ctx === $b5e257d569688ac6$var$defaultContext && !$b5e257d569688ac6$var$canUseDOM) console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
74
- let counter = $b5e257d569688ac6$var$useCounter(!!defaultId);
75
- let prefix = ctx === $b5e257d569688ac6$var$defaultContext && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${ctx.prefix}`;
76
- return defaultId || `${prefix}-${counter}`;
77
- }
78
- function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) {
79
- let id = React__default.useId();
80
- let [didSSR] = useState($b5e257d569688ac6$export$535bd6ca7f90a273());
81
- let prefix = didSSR || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
82
- return defaultId || `${prefix}-${id}`;
83
- }
84
- const $b5e257d569688ac6$export$619500959fc48b26 = typeof React__default["useId"] === "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
85
- function $b5e257d569688ac6$var$getSnapshot() {
86
- return false;
87
- }
88
- function $b5e257d569688ac6$var$getServerSnapshot() {
89
- return true;
90
- }
91
- function $b5e257d569688ac6$var$subscribe(onStoreChange) {
92
- return () => {
93
- };
94
- }
95
- function $b5e257d569688ac6$export$535bd6ca7f90a273() {
96
- if (typeof React__default["useSyncExternalStore"] === "function") return React__default["useSyncExternalStore"]($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot);
97
- return useContext($b5e257d569688ac6$var$IsSSRContext);
98
- }
99
- let $bdb11010cef70236$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
100
- let $bdb11010cef70236$export$d41a04c74483c6ef = /* @__PURE__ */ new Map();
101
- let $bdb11010cef70236$var$registry;
102
- if (typeof FinalizationRegistry !== "undefined") $bdb11010cef70236$var$registry = new FinalizationRegistry((heldValue) => {
103
- $bdb11010cef70236$export$d41a04c74483c6ef.delete(heldValue);
104
- });
105
- function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
106
- let [value, setValue] = useState(defaultId);
107
- let nextId = useRef(null);
108
- let res = $b5e257d569688ac6$export$619500959fc48b26(value);
109
- let cleanupRef = useRef(null);
110
- if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.register(cleanupRef, res);
111
- if ($bdb11010cef70236$var$canUseDOM) {
112
- const cacheIdRef = $bdb11010cef70236$export$d41a04c74483c6ef.get(res);
113
- if (cacheIdRef && !cacheIdRef.includes(nextId)) cacheIdRef.push(nextId);
114
- else $bdb11010cef70236$export$d41a04c74483c6ef.set(res, [
115
- nextId
116
- ]);
117
- }
118
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
119
- let r2 = res;
120
- return () => {
121
- if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.unregister(cleanupRef);
122
- $bdb11010cef70236$export$d41a04c74483c6ef.delete(r2);
123
- };
124
- }, [
125
- res
126
- ]);
127
- useEffect(() => {
128
- let newId = nextId.current;
129
- if (newId) setValue(newId);
130
- return () => {
131
- if (newId) nextId.current = null;
132
- };
133
- });
134
- return res;
135
- }
136
- function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
137
- if (idA === idB) return idA;
138
- let setIdsA = $bdb11010cef70236$export$d41a04c74483c6ef.get(idA);
139
- if (setIdsA) {
140
- setIdsA.forEach((ref) => ref.current = idB);
141
- return idB;
142
- }
143
- let setIdsB = $bdb11010cef70236$export$d41a04c74483c6ef.get(idB);
144
- if (setIdsB) {
145
- setIdsB.forEach((ref) => ref.current = idA);
146
- return idA;
147
- }
148
- return idB;
149
- }
150
- function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
151
- let id = $bdb11010cef70236$export$f680877a34711e37();
152
- let [resolvedId, setResolvedId] = $1dbecbe27a04f9af$export$14d238f342723f25(id);
153
- let updateId = useCallback(() => {
154
- setResolvedId(function* () {
155
- yield id;
156
- yield document.getElementById(id) ? id : void 0;
157
- });
158
- }, [
159
- id,
160
- setResolvedId
161
- ]);
162
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(updateId, [
163
- id,
164
- updateId,
165
- ...depArray
166
- ]);
167
- return resolvedId;
168
- }
169
- function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
170
- return (...args) => {
171
- for (let callback of callbacks) if (typeof callback === "function") callback(...args);
172
- };
173
- }
174
- function r(e) {
175
- var t, f, n = "";
176
- if ("string" == typeof e || "number" == typeof e) n += e;
177
- else if ("object" == typeof e) if (Array.isArray(e)) {
178
- var o = e.length;
179
- for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
180
- } else for (f in e) e[f] && (n && (n += " "), n += f);
181
- return n;
182
- }
183
- function clsx() {
184
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
185
- return n;
186
- }
187
- function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
188
- let result = {
189
- ...args[0]
190
- };
191
- for (let i = 1; i < args.length; i++) {
192
- let props = args[i];
193
- for (let key in props) {
194
- let a = result[key];
195
- let b = props[key];
196
- if (typeof a === "function" && typeof b === "function" && // This is a lot faster than a regex.
197
- key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
198
- 65 && key.charCodeAt(2) <= /* 'Z' */
199
- 90) result[key] = $ff5963eb1fccf552$export$e08e3b67e392101e(a, b);
200
- else if ((key === "className" || key === "UNSAFE_className") && typeof a === "string" && typeof b === "string") result[key] = clsx(a, b);
201
- else if (key === "id" && a && b) result.id = $bdb11010cef70236$export$cd8c9cb68f842629(a, b);
202
- else result[key] = b !== void 0 ? b : a;
203
- }
204
- }
205
- return result;
206
- }
207
- function $5dc95899b306f630$export$c9058316764c140e(...refs) {
208
- if (refs.length === 1 && refs[0]) return refs[0];
209
- return (value) => {
210
- for (let ref of refs) {
211
- if (typeof ref === "function") ref(value);
212
- else if (ref != null) ref.current = value;
213
- }
214
- };
215
- }
216
- function $df56164dff5785e2$export$4338b53315abf666(forwardedRef) {
217
- const objRef = useRef(null);
218
- return useMemo(() => ({
219
- get current() {
220
- return objRef.current;
221
- },
222
- set current(value) {
223
- objRef.current = value;
224
- if (typeof forwardedRef === "function") forwardedRef(value);
225
- else if (forwardedRef) forwardedRef.current = value;
226
- }
227
- }), [
228
- forwardedRef
229
- ]);
230
- }
231
- const $64fa3d84918910a7$export$c62b8e45d58ddad9 = Symbol("default");
232
- function $64fa3d84918910a7$export$2881499e37b75b9a({ values, children }) {
233
- for (let [Context, value] of values)
234
- children = /* @__PURE__ */ React__default.createElement(Context.Provider, {
235
- value
236
- }, children);
237
- return children;
238
- }
239
- function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
240
- let { className, style, children, defaultClassName, defaultChildren, defaultStyle, values } = props;
241
- return useMemo(() => {
242
- let computedClassName;
243
- let computedStyle;
244
- let computedChildren;
245
- if (typeof className === "function") computedClassName = className({
246
- ...values,
247
- defaultClassName
248
- });
249
- else computedClassName = className;
250
- if (typeof style === "function") computedStyle = style({
251
- ...values,
252
- defaultStyle: defaultStyle || {}
253
- });
254
- else computedStyle = style;
255
- if (typeof children === "function") computedChildren = children({
256
- ...values,
257
- defaultChildren
258
- });
259
- else if (children == null) computedChildren = defaultChildren;
260
- else computedChildren = children;
261
- return {
262
- className: computedClassName !== null && computedClassName !== void 0 ? computedClassName : defaultClassName,
263
- style: computedStyle || defaultStyle ? {
264
- ...defaultStyle,
265
- ...computedStyle
266
- } : void 0,
267
- children: computedChildren !== null && computedChildren !== void 0 ? computedChildren : defaultChildren,
268
- "data-rac": ""
269
- };
270
- }, [
271
- className,
272
- style,
273
- children,
274
- defaultClassName,
275
- defaultChildren,
276
- defaultStyle,
277
- values
278
- ]);
279
- }
280
- function $64fa3d84918910a7$export$fabf2dc03a41866e(context, slot) {
281
- let ctx = useContext(context);
282
- if (slot === null)
283
- return null;
284
- if (ctx && typeof ctx === "object" && "slots" in ctx && ctx.slots) {
285
- let slotKey = slot || $64fa3d84918910a7$export$c62b8e45d58ddad9;
286
- if (!ctx.slots[slotKey]) {
287
- let availableSlots = new Intl.ListFormat().format(Object.keys(ctx.slots).map((p) => `"${p}"`));
288
- let errorMessage = slot ? `Invalid slot "${slot}".` : "A slot prop is required.";
289
- throw new Error(`${errorMessage} Valid slot names are ${availableSlots}.`);
290
- }
291
- return ctx.slots[slotKey];
292
- }
293
- return ctx;
294
- }
295
- function $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, context) {
296
- let ctx = $64fa3d84918910a7$export$fabf2dc03a41866e(context, props.slot) || {};
297
- let { ref: contextRef, ...contextProps } = ctx;
298
- let mergedRef = $df56164dff5785e2$export$4338b53315abf666(useMemo(() => $5dc95899b306f630$export$c9058316764c140e(ref, contextRef), [
299
- ref,
300
- contextRef
301
- ]));
302
- let mergedProps = $3ef42575df84b30b$export$9d1611c77c2fe928(contextProps, props);
303
- if ("style" in contextProps && contextProps.style && "style" in props && props.style) {
304
- if (typeof contextProps.style === "function" || typeof props.style === "function")
305
- mergedProps.style = (renderProps) => {
306
- let contextStyle = typeof contextProps.style === "function" ? contextProps.style(renderProps) : contextProps.style;
307
- let defaultStyle = {
308
- ...renderProps.defaultStyle,
309
- ...contextStyle
310
- };
311
- let style = typeof props.style === "function" ? props.style({
312
- ...renderProps,
313
- defaultStyle
314
- }) : props.style;
315
- return {
316
- ...defaultStyle,
317
- ...style
318
- };
319
- };
320
- else
321
- mergedProps.style = {
322
- ...contextProps.style,
323
- ...props.style
324
- };
325
- }
326
- return [
327
- mergedProps,
328
- mergedRef
329
- ];
330
- }
331
- function $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(initialState = true) {
332
- let [hasSlot, setHasSlot] = useState(initialState);
333
- let hasRun = useRef(false);
334
- let ref = useCallback((el) => {
335
- hasRun.current = true;
336
- setHasSlot(!!el);
337
- }, []);
338
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
339
- if (!hasRun.current) setHasSlot(false);
340
- }, []);
341
- return [
342
- ref,
343
- hasSlot
344
- ];
345
- }
346
- function $64fa3d84918910a7$export$ef03459518577ad4(props) {
347
- const prefix = /^(data-.*)$/;
348
- let filteredProps = {};
349
- for (const prop in props) if (!prefix.test(prop)) filteredProps[prop] = props[prop];
350
- return filteredProps;
351
- }
352
- export {
353
- $64fa3d84918910a7$export$fabf2dc03a41866e as $,
354
- $64fa3d84918910a7$export$29f1550f4b0d4415 as a,
355
- $64fa3d84918910a7$export$4d86445c2cf5e3 as b,
356
- clsx as c,
357
- $3ef42575df84b30b$export$9d1611c77c2fe928 as d,
358
- $bdb11010cef70236$export$f680877a34711e37 as e,
359
- $8ae05eaa5c114e9c$export$7f54fc3180508a52 as f,
360
- $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 as g,
361
- $64fa3d84918910a7$export$ef03459518577ad4 as h,
362
- $64fa3d84918910a7$export$2881499e37b75b9a as i,
363
- $bdb11010cef70236$export$b4cc09c592e8fdb8 as j,
364
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as k,
365
- $df56164dff5785e2$export$4338b53315abf666 as l,
366
- $5dc95899b306f630$export$c9058316764c140e as m,
367
- $b5e257d569688ac6$export$535bd6ca7f90a273 as n,
368
- $64fa3d84918910a7$export$c62b8e45d58ddad9 as o,
369
- $ff5963eb1fccf552$export$e08e3b67e392101e as p
370
- };
@@ -1 +0,0 @@
1
- import '../assets/wp-font-enhancements.css';
@@ -1 +0,0 @@
1
- import '../assets/wp-ui-enhancements.css';