@eightshift/ui-components 5.0.0 → 5.0.1
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/dist/Button-wERNNG0T.js +185 -0
- package/dist/Collection-CKsHTyhc.js +2363 -0
- package/dist/Color-BhgbJF5x.js +2452 -0
- package/dist/ColorSwatch-Bcn6oRSg.js +64 -0
- package/dist/ComboBox-D1LPUwWP.js +1906 -0
- package/dist/Dialog-D190gMbE.js +2298 -0
- package/dist/FieldError-DeUh5Wkw.js +42 -0
- package/dist/FocusScope-C-plSxbS.js +831 -0
- package/dist/Form-Cq3fu75_.js +5 -0
- package/dist/Group-C5iZpSAM.js +48 -0
- package/dist/Heading-D-Pboe4p.js +16 -0
- package/dist/Hidden-rE6uR-lr.js +41 -0
- package/dist/Input--mF4XVE1.js +133 -0
- package/dist/Label-Fp6AwSRn.js +17 -0
- package/dist/List-CZMUbkFU.js +593 -0
- package/dist/ListBox-4oW9kh3R.js +582 -0
- package/dist/NumberFormatter-DA8u1Ot7.js +140 -0
- package/dist/OverlayArrow-BpB9uB_I.js +637 -0
- package/dist/RSPContexts-2lR5GG9p.js +14 -0
- package/dist/Select-aab027f3.esm-BKIJGje-.js +2469 -0
- package/dist/Separator-B88tj5YD.js +323 -0
- package/dist/Slider-CyJzC1bp.js +853 -0
- package/dist/Text-DRpwWot2.js +16 -0
- package/dist/VisuallyHidden-DsKYcRQ_.js +48 -0
- package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
- package/dist/assets/index.css +57 -0
- package/dist/assets/style-admin.css +5864 -0
- package/dist/assets/style-editor.css +5864 -0
- package/dist/assets/style.css +5870 -0
- package/dist/assets/wp-font-enhancements.css +8 -0
- package/dist/assets/wp-ui-enhancements.css +377 -0
- package/dist/components/animated-visibility/animated-visibility.js +105 -0
- package/dist/components/base-control/base-control.js +86 -0
- package/dist/components/breakpoint-preview/breakpoint-preview.js +161 -0
- package/dist/components/button/button.js +387 -0
- package/dist/components/checkbox/checkbox.js +320 -0
- package/dist/components/color-pickers/color-picker.js +272 -0
- package/dist/components/color-pickers/color-swatch.js +59 -0
- package/dist/components/color-pickers/gradient-editor.js +534 -0
- package/dist/components/color-pickers/solid-color-picker.js +1567 -0
- package/dist/components/component-toggle/component-toggle.js +161 -0
- package/dist/components/container-panel/container-panel.js +131 -0
- package/dist/components/draggable/draggable-context.js +5 -0
- package/dist/components/draggable/draggable-handle.js +46 -0
- package/dist/components/draggable/draggable.js +6979 -0
- package/dist/components/draggable-list/draggable-list-context.js +5 -0
- package/dist/components/draggable-list/draggable-list-item.js +77 -0
- package/dist/components/draggable-list/draggable-list.js +151 -0
- package/dist/components/expandable/expandable.js +342 -0
- package/dist/components/index.js +137 -0
- package/dist/components/input-field/input-field.js +231 -0
- package/dist/components/item-collection/item-collection.js +59 -0
- package/dist/components/layout/hstack.js +30 -0
- package/dist/components/layout/vstack.js +30 -0
- package/dist/components/link-input/link-input.js +291 -0
- package/dist/components/matrix-align/matrix-align.js +134 -0
- package/dist/components/menu/menu.js +285 -0
- package/dist/components/modal/modal.js +305 -0
- package/dist/components/notice/notice.js +123 -0
- package/dist/components/number-picker/number-picker.js +292 -0
- package/dist/components/option-select/option-select.js +264 -0
- package/dist/components/options-panel/options-panel.js +158 -0
- package/dist/components/placeholders/file-placeholder.js +42 -0
- package/dist/components/placeholders/image-placeholder.js +88 -0
- package/dist/components/placeholders/media-placeholder.js +63 -0
- package/dist/components/popover/popover.js +207 -0
- package/dist/components/radio/radio.js +579 -0
- package/dist/components/repeater/repeater-context.js +5 -0
- package/dist/components/repeater/repeater-item.js +119 -0
- package/dist/components/repeater/repeater.js +280 -0
- package/dist/components/responsive/mini-responsive.js +498 -0
- package/dist/components/responsive/responsive-legacy.js +343 -0
- package/dist/components/responsive/responsive.js +583 -0
- package/dist/components/responsive-preview/responsive-preview.js +123 -0
- package/dist/components/rich-label/rich-label.js +66 -0
- package/dist/components/select/async-multi-select.js +157 -0
- package/dist/components/select/async-single-select.js +137 -0
- package/dist/components/select/custom-select-default-components.js +38 -0
- package/dist/components/select/multi-select-components.js +8 -0
- package/dist/components/select/multi-select.js +151 -0
- package/dist/components/select/react-select-component-wrappers.js +90 -0
- package/dist/components/select/shared.js +26 -0
- package/dist/components/select/single-select.js +131 -0
- package/dist/components/select/styles.js +49 -0
- package/dist/components/select/v2/async-select.js +297 -0
- package/dist/components/select/v2/shared.js +24 -0
- package/dist/components/select/v2/single-select.js +991 -0
- package/dist/components/slider/column-config-slider.js +210 -0
- package/dist/components/slider/slider.js +345 -0
- package/dist/components/slider/utils.js +94 -0
- package/dist/components/spacer/spacer.js +97 -0
- package/dist/components/tabs/tabs.js +704 -0
- package/dist/components/toggle/switch.js +156 -0
- package/dist/components/toggle/toggle.js +64 -0
- package/dist/components/toggle-button/toggle-button.js +343 -0
- package/dist/components/tooltip/tooltip.js +527 -0
- package/dist/context-BYWrbm1z.js +92 -0
- package/dist/default-i18n-CT_oS1Fy.js +922 -0
- package/dist/filterDOMProps-EDDcM64A.js +28 -0
- package/dist/icons/block-icon.js +42 -0
- package/dist/icons/generic-color-swatch.js +113 -0
- package/dist/icons/icons.js +30371 -0
- package/dist/icons/index.js +11 -0
- package/dist/icons/jsx-svg.js +50 -0
- package/dist/index-641ee5b8.esm-BPU8rMZr.js +3137 -0
- package/dist/index-CFozsmNS.js +28321 -0
- package/dist/index-wl5606BX.js +44 -0
- package/dist/index.js +139 -0
- package/dist/lite-DVmmD_-j.js +7 -0
- package/dist/modifiers.esm-BuJQPI1X.js +31 -0
- package/dist/multi-select-components-Sp-JEFEX.js +3744 -0
- package/dist/number-GajL10e1.js +36 -0
- package/dist/react-jsx-parser.min-DZCiis5V.js +11753 -0
- package/dist/react-select-async.esm-D937XTWW.js +107 -0
- package/dist/react-select.esm-Ciai3aKf.js +15 -0
- package/dist/style-admin.js +1 -0
- package/dist/style-editor.js +1 -0
- package/dist/style.js +1 -0
- package/dist/textSelection-CCcyjiRP.js +46 -0
- package/dist/useButton-BOHxkGQF.js +50 -0
- package/dist/useEvent-D5o_CqDH.js +23 -0
- package/dist/useFocusRing-nMG2uzxS.js +107 -0
- package/dist/useFormReset-DlmRL87g.js +22 -0
- package/dist/useFormValidation-D0_aaK-e.js +224 -0
- package/dist/useHover-VO5tcIli.js +890 -0
- package/dist/useLabel-BKH4fVA4.js +27 -0
- package/dist/useLabels-ntF3rFY0.js +23 -0
- package/dist/useListState-Cq2Nvr-v.js +161 -0
- package/dist/useLocalizedStringFormatter-CGzwx1a0.js +121 -0
- package/dist/useNumberField-C9dmERhP.js +1207 -0
- package/dist/useNumberFormatter-MrRLgvhj.js +13 -0
- package/dist/usePress-DjNo5790.js +677 -0
- package/dist/useSingleSelectListState--r3AAhRj.js +38 -0
- package/dist/useToggle-CQaXLe-O.js +59 -0
- package/dist/useToggleState-C3DLdez5.js +19 -0
- package/dist/utilities/array-helpers.js +56 -0
- package/dist/utilities/debounce-throttle.js +123 -0
- package/dist/utilities/es-dash.js +382 -0
- package/dist/utilities/index.js +27 -0
- package/dist/utilities/text-helpers.js +136 -0
- package/dist/utils-B94NDG0v.js +370 -0
- package/dist/wp/wp-font-enhancements.js +1 -0
- package/dist/wp/wp-ui-enhancements.js +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, e as $bdb11010cef70236$export$f680877a34711e37, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-B94NDG0v.js";
|
|
2
|
+
import React__default, { createContext, useRef, useEffect } from "react";
|
|
3
|
+
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "./Hidden-rE6uR-lr.js";
|
|
4
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
5
|
+
import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "./useButton-BOHxkGQF.js";
|
|
6
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-nMG2uzxS.js";
|
|
7
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "./useHover-VO5tcIli.js";
|
|
8
|
+
const $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY = 7e3;
|
|
9
|
+
let $319e236875307eab$var$liveAnnouncer = null;
|
|
10
|
+
function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
11
|
+
if (!$319e236875307eab$var$liveAnnouncer) {
|
|
12
|
+
$319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer();
|
|
13
|
+
if (!(typeof IS_REACT_ACT_ENVIRONMENT === "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== "undefined")) setTimeout(() => {
|
|
14
|
+
if ($319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.isAttached()) $319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
15
|
+
}, 100);
|
|
16
|
+
else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
17
|
+
} else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
18
|
+
}
|
|
19
|
+
function $319e236875307eab$export$d10ae4f68404609a(assertiveness) {
|
|
20
|
+
if ($319e236875307eab$var$liveAnnouncer) $319e236875307eab$var$liveAnnouncer.clear(assertiveness);
|
|
21
|
+
}
|
|
22
|
+
class $319e236875307eab$var$LiveAnnouncer {
|
|
23
|
+
isAttached() {
|
|
24
|
+
var _this_node;
|
|
25
|
+
return (_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.isConnected;
|
|
26
|
+
}
|
|
27
|
+
createLog(ariaLive) {
|
|
28
|
+
let node = document.createElement("div");
|
|
29
|
+
node.setAttribute("role", "log");
|
|
30
|
+
node.setAttribute("aria-live", ariaLive);
|
|
31
|
+
node.setAttribute("aria-relevant", "additions");
|
|
32
|
+
return node;
|
|
33
|
+
}
|
|
34
|
+
destroy() {
|
|
35
|
+
if (!this.node) return;
|
|
36
|
+
document.body.removeChild(this.node);
|
|
37
|
+
this.node = null;
|
|
38
|
+
}
|
|
39
|
+
announce(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
40
|
+
var _this_assertiveLog, _this_politeLog;
|
|
41
|
+
if (!this.node) return;
|
|
42
|
+
let node = document.createElement("div");
|
|
43
|
+
if (typeof message === "object") {
|
|
44
|
+
node.setAttribute("role", "img");
|
|
45
|
+
node.setAttribute("aria-labelledby", message["aria-labelledby"]);
|
|
46
|
+
} else node.textContent = message;
|
|
47
|
+
if (assertiveness === "assertive") (_this_assertiveLog = this.assertiveLog) === null || _this_assertiveLog === void 0 ? void 0 : _this_assertiveLog.appendChild(node);
|
|
48
|
+
else (_this_politeLog = this.politeLog) === null || _this_politeLog === void 0 ? void 0 : _this_politeLog.appendChild(node);
|
|
49
|
+
if (message !== "") setTimeout(() => {
|
|
50
|
+
node.remove();
|
|
51
|
+
}, timeout);
|
|
52
|
+
}
|
|
53
|
+
clear(assertiveness) {
|
|
54
|
+
if (!this.node) return;
|
|
55
|
+
if ((!assertiveness || assertiveness === "assertive") && this.assertiveLog) this.assertiveLog.innerHTML = "";
|
|
56
|
+
if ((!assertiveness || assertiveness === "polite") && this.politeLog) this.politeLog.innerHTML = "";
|
|
57
|
+
}
|
|
58
|
+
constructor() {
|
|
59
|
+
this.node = null;
|
|
60
|
+
this.assertiveLog = null;
|
|
61
|
+
this.politeLog = null;
|
|
62
|
+
if (typeof document !== "undefined") {
|
|
63
|
+
this.node = document.createElement("div");
|
|
64
|
+
this.node.dataset.liveAnnouncer = "true";
|
|
65
|
+
Object.assign(this.node.style, {
|
|
66
|
+
border: 0,
|
|
67
|
+
clip: "rect(0 0 0 0)",
|
|
68
|
+
clipPath: "inset(50%)",
|
|
69
|
+
height: "1px",
|
|
70
|
+
margin: "-1px",
|
|
71
|
+
overflow: "hidden",
|
|
72
|
+
padding: 0,
|
|
73
|
+
position: "absolute",
|
|
74
|
+
width: "1px",
|
|
75
|
+
whiteSpace: "nowrap"
|
|
76
|
+
});
|
|
77
|
+
this.assertiveLog = this.createLog("assertive");
|
|
78
|
+
this.node.appendChild(this.assertiveLog);
|
|
79
|
+
this.politeLog = this.createLog("polite");
|
|
80
|
+
this.node.appendChild(this.politeLog);
|
|
81
|
+
document.body.prepend(this.node);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const $0393f8ab869a0f1a$export$e9f3bf65a26ce129 = /* @__PURE__ */ createContext(null);
|
|
86
|
+
const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = /* @__PURE__ */ new Set([
|
|
87
|
+
"form",
|
|
88
|
+
"formAction",
|
|
89
|
+
"formEncType",
|
|
90
|
+
"formMethod",
|
|
91
|
+
"formNoValidate",
|
|
92
|
+
"formTarget",
|
|
93
|
+
"name",
|
|
94
|
+
"value"
|
|
95
|
+
]);
|
|
96
|
+
const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /* @__PURE__ */ createContext({});
|
|
97
|
+
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function Button(props, ref) {
|
|
98
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
99
|
+
props = $d2b4bc8c273e7be6$var$disablePendingProps(props);
|
|
100
|
+
let ctx = props;
|
|
101
|
+
let { isPending } = ctx;
|
|
102
|
+
let { buttonProps, isPressed } = $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref);
|
|
103
|
+
let { focusProps, isFocused, isFocusVisible } = $f7dceffc5ad7768b$export$4e328f61c538687f(props);
|
|
104
|
+
let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456({
|
|
105
|
+
...props,
|
|
106
|
+
isDisabled: props.isDisabled || isPending
|
|
107
|
+
});
|
|
108
|
+
let renderValues = {
|
|
109
|
+
isHovered,
|
|
110
|
+
isPressed: (ctx.isPressed || isPressed) && !isPending,
|
|
111
|
+
isFocused,
|
|
112
|
+
isFocusVisible,
|
|
113
|
+
isDisabled: props.isDisabled || false,
|
|
114
|
+
isPending: isPending !== null && isPending !== void 0 ? isPending : false
|
|
115
|
+
};
|
|
116
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
117
|
+
...props,
|
|
118
|
+
values: renderValues,
|
|
119
|
+
defaultClassName: "react-aria-Button"
|
|
120
|
+
});
|
|
121
|
+
let buttonId = $bdb11010cef70236$export$f680877a34711e37(buttonProps.id);
|
|
122
|
+
let progressId = $bdb11010cef70236$export$f680877a34711e37();
|
|
123
|
+
let ariaLabelledby = buttonProps["aria-labelledby"];
|
|
124
|
+
if (isPending) {
|
|
125
|
+
if (ariaLabelledby) ariaLabelledby = `${ariaLabelledby} ${progressId}`;
|
|
126
|
+
else if (buttonProps["aria-label"]) ariaLabelledby = `${buttonId} ${progressId}`;
|
|
127
|
+
}
|
|
128
|
+
let wasPending = useRef(isPending);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
let message = {
|
|
131
|
+
"aria-labelledby": ariaLabelledby || buttonId
|
|
132
|
+
};
|
|
133
|
+
if (!wasPending.current && isFocused && isPending) $319e236875307eab$export$a9b970dcc4ae71a9(message, "assertive");
|
|
134
|
+
else if (wasPending.current && isFocused && !isPending) $319e236875307eab$export$a9b970dcc4ae71a9(message, "assertive");
|
|
135
|
+
wasPending.current = isPending;
|
|
136
|
+
}, [
|
|
137
|
+
isPending,
|
|
138
|
+
isFocused,
|
|
139
|
+
ariaLabelledby,
|
|
140
|
+
buttonId
|
|
141
|
+
]);
|
|
142
|
+
return /* @__PURE__ */ React__default.createElement("button", {
|
|
143
|
+
...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
144
|
+
propNames: $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes
|
|
145
|
+
}),
|
|
146
|
+
...$3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, focusProps, hoverProps),
|
|
147
|
+
...renderProps,
|
|
148
|
+
type: buttonProps.type === "submit" && isPending ? "button" : buttonProps.type,
|
|
149
|
+
id: buttonId,
|
|
150
|
+
ref,
|
|
151
|
+
"aria-labelledby": ariaLabelledby,
|
|
152
|
+
slot: props.slot || void 0,
|
|
153
|
+
"aria-disabled": isPending ? "true" : buttonProps["aria-disabled"],
|
|
154
|
+
"data-disabled": props.isDisabled || void 0,
|
|
155
|
+
"data-pressed": renderValues.isPressed || void 0,
|
|
156
|
+
"data-hovered": isHovered || void 0,
|
|
157
|
+
"data-focused": isFocused || void 0,
|
|
158
|
+
"data-pending": isPending || void 0,
|
|
159
|
+
"data-focus-visible": isFocusVisible || void 0
|
|
160
|
+
}, /* @__PURE__ */ React__default.createElement($0393f8ab869a0f1a$export$e9f3bf65a26ce129.Provider, {
|
|
161
|
+
value: {
|
|
162
|
+
id: progressId
|
|
163
|
+
}
|
|
164
|
+
}, renderProps.children));
|
|
165
|
+
});
|
|
166
|
+
function $d2b4bc8c273e7be6$var$disablePendingProps(props) {
|
|
167
|
+
if (props.isPending) {
|
|
168
|
+
props.onPress = void 0;
|
|
169
|
+
props.onPressStart = void 0;
|
|
170
|
+
props.onPressEnd = void 0;
|
|
171
|
+
props.onPressChange = void 0;
|
|
172
|
+
props.onPressUp = void 0;
|
|
173
|
+
props.onKeyDown = void 0;
|
|
174
|
+
props.onKeyUp = void 0;
|
|
175
|
+
props.onClick = void 0;
|
|
176
|
+
props.href = void 0;
|
|
177
|
+
}
|
|
178
|
+
return props;
|
|
179
|
+
}
|
|
180
|
+
export {
|
|
181
|
+
$d2b4bc8c273e7be6$export$353f5b6fc5456de1 as $,
|
|
182
|
+
$d2b4bc8c273e7be6$export$24d547caef80ccd1 as a,
|
|
183
|
+
$319e236875307eab$export$a9b970dcc4ae71a9 as b,
|
|
184
|
+
$319e236875307eab$export$d10ae4f68404609a as c
|
|
185
|
+
};
|