@wix/site-ui 1.30.0 → 1.31.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/dist/1268.js +99 -0
- package/dist/1279.js +7 -0
- package/dist/1457.js +10 -0
- package/dist/1477.js +106 -0
- package/dist/1500.js +111 -0
- package/dist/167.js +6 -0
- package/dist/2274.js +34 -0
- package/dist/2287.js +17 -0
- package/dist/2418.js +31 -0
- package/dist/2801.js +20 -0
- package/dist/285.js +86 -0
- package/dist/2861.js +6 -0
- package/dist/3020.js +7 -0
- package/dist/3021.js +72 -0
- package/dist/3056.js +229 -0
- package/dist/3140.js +4 -0
- package/dist/3248.js +307 -0
- package/dist/3296.js +4 -0
- package/dist/3319.js +400 -0
- package/dist/3395.js +4 -0
- package/dist/3485.js +854 -0
- package/dist/353.js +14 -0
- package/dist/3670.js +418 -0
- package/dist/3829.js +113 -0
- package/dist/4026.js +12 -0
- package/dist/4143.js +46 -0
- package/dist/42.js +32 -0
- package/dist/4281.js +30 -0
- package/dist/4346.js +2 -0
- package/dist/4388.js +418 -0
- package/dist/4490.js +32 -0
- package/dist/4495.js +9 -0
- package/dist/4549.js +24 -0
- package/dist/4586.js +41 -0
- package/dist/4586.js.LICENSE.txt +19 -0
- package/dist/4707.js +19 -0
- package/dist/4723.js +7 -0
- package/dist/4745.js +7 -0
- package/dist/4768.js +35 -0
- package/dist/4922.js +15 -0
- package/dist/5036.js +17 -0
- package/dist/5085.js +20 -0
- package/dist/5299.js +597 -0
- package/dist/5659.js +4 -0
- package/dist/5778.js +10 -0
- package/dist/5864.js +86 -0
- package/dist/5992.js +913 -0
- package/dist/5992.js.LICENSE.txt +19 -0
- package/dist/6003.js +10 -0
- package/dist/6046.js +29 -0
- package/dist/6089.js +2355 -0
- package/dist/6107.js +10 -0
- package/dist/6247.js +20 -0
- package/dist/6270.js +487 -0
- package/dist/6329.js +32 -0
- package/dist/6330.js +30 -0
- package/dist/6499.js +7 -0
- package/dist/6535.js +71 -0
- package/dist/6588.js +382 -0
- package/dist/6706.js +16 -0
- package/dist/6825.js +7 -0
- package/dist/6882.js +1562 -0
- package/dist/6914.js +30 -0
- package/dist/7021.js +13 -0
- package/dist/7366.js +83 -0
- package/dist/7373.js +25 -0
- package/dist/7541.js +25 -0
- package/dist/7564.js +10 -0
- package/dist/7642.js +20 -0
- package/dist/7725.js +10 -0
- package/dist/7871.js +38 -0
- package/dist/8052.js +352 -0
- package/dist/8106.js +238 -0
- package/dist/8171.js +346 -0
- package/dist/8225.js +21 -0
- package/dist/8272.js +333 -0
- package/dist/8527.js +58 -0
- package/dist/8724.js +10 -0
- package/dist/8750.js +1920 -0
- package/dist/8758.js +43 -0
- package/dist/880.js +149 -0
- package/dist/8935.js +8 -0
- package/dist/8960.js +22 -0
- package/dist/8971.js +40 -0
- package/dist/8979.js +10 -0
- package/dist/8996.js +71 -0
- package/dist/904.js +121 -0
- package/dist/9048.js +52 -0
- package/dist/9087.js +256 -0
- package/dist/9189.js +158 -0
- package/dist/9255.js +136 -0
- package/dist/9352.js +148 -0
- package/dist/951.js +22 -0
- package/dist/9635.js +22 -0
- package/dist/9829.js +4 -0
- package/dist/9863.js +8 -0
- package/dist/Accordion/index.d.ts +569 -12
- package/dist/Accordion/index.js +423 -8
- package/dist/AlertDialog/index.d.ts +1417 -18
- package/dist/AlertDialog/index.js +34 -14
- package/dist/Autocomplete/index.d.ts +1861 -38
- package/dist/Autocomplete/index.js +98 -24
- package/dist/Avatar/index.d.ts +129 -7
- package/dist/Avatar/index.js +149 -6
- package/dist/Breadcrumbs/index.d.ts +960 -7
- package/dist/Breadcrumbs/index.js +5 -5
- package/dist/Button/index.d.ts +88 -6
- package/dist/Button/index.js +27 -3
- package/dist/Checkbox/index.d.ts +425 -5
- package/dist/Checkbox/index.js +45 -5
- package/dist/CheckboxGroup/index.d.ts +318 -3
- package/dist/CheckboxGroup/index.js +166 -3
- package/dist/Collapsible/index.d.ts +377 -7
- package/dist/Collapsible/index.js +160 -6
- package/dist/Combobox/index.d.ts +1984 -48
- package/dist/Combobox/index.js +352 -29
- package/dist/ContextMenu/index.d.ts +2340 -36
- package/dist/ContextMenu/index.js +197 -22
- package/dist/Dialog/index.d.ts +1355 -18
- package/dist/Dialog/index.js +16 -14
- package/dist/Drawer/index.d.ts +1653 -18
- package/dist/Drawer/index.js +2797 -20
- package/dist/Field/index.d.ts +655 -15
- package/dist/Field/index.js +677 -10
- package/dist/Fieldset/index.d.ts +94 -5
- package/dist/Fieldset/index.js +68 -5
- package/dist/Form/index.d.ts +331 -2
- package/dist/Form/index.js +106 -3
- package/dist/Input/index.d.ts +692 -3
- package/dist/Input/index.js +10 -3
- package/dist/Menu/index.d.ts +2301 -36
- package/dist/Menu/index.js +365 -26
- package/dist/Menubar/index.d.ts +2301 -3
- package/dist/Menubar/index.js +105 -3
- package/dist/Meter/index.d.ts +175 -11
- package/dist/Meter/index.js +129 -9
- package/dist/NavigationMenu/index.d.ts +978 -28
- package/dist/NavigationMenu/index.js +1034 -17
- package/dist/NumberField/index.d.ts +612 -15
- package/dist/NumberField/index.js +1409 -11
- package/dist/Popover/index.d.ts +1655 -20
- package/dist/Popover/index.js +792 -17
- package/dist/PreviewCard/index.d.ts +1523 -14
- package/dist/PreviewCard/index.js +679 -14
- package/dist/Progress/index.d.ts +183 -11
- package/dist/Progress/index.js +181 -9
- package/dist/Radio/index.d.ts +185 -6
- package/dist/Radio/index.js +253 -6
- package/dist/RadioGroup/index.d.ts +341 -2
- package/dist/RadioGroup/index.js +154 -3
- package/dist/ScrollArea/index.d.ts +265 -13
- package/dist/ScrollArea/index.js +892 -10
- package/dist/Select/index.d.ts +1493 -38
- package/dist/Select/index.js +1824 -23
- package/dist/Separator/index.d.ts +80 -6
- package/dist/Separator/index.js +3 -3
- package/dist/Slider/index.d.ts +678 -16
- package/dist/Slider/index.js +1199 -11
- package/dist/Switch/index.d.ts +393 -5
- package/dist/Switch/index.js +208 -6
- package/dist/Tabs/index.d.ts +523 -12
- package/dist/Tabs/index.js +685 -9
- package/dist/Toggle/index.d.ts +305 -2
- package/dist/Toggle/index.js +76 -3
- package/dist/ToggleGroup/index.d.ts +316 -2
- package/dist/ToggleGroup/index.js +102 -3
- package/dist/Toolbar/index.d.ts +282 -13
- package/dist/Toolbar/index.js +230 -9
- package/dist/Tooltip/index.d.ts +1572 -14
- package/dist/Tooltip/index.js +965 -14
- package/dist/index.d.ts +12749 -652
- package/dist/rslib-runtime.js +18 -0
- package/package.json +3 -3
package/dist/4346.js
ADDED
package/dist/4388.js
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { stateAttributesMapping_TransitionStatusDataAttributes } from "./880.js";
|
|
3
|
+
import { useIsoLayoutEffect } from "./6499.js";
|
|
4
|
+
import { isSafari } from "./8971.js";
|
|
5
|
+
import { visuallyHidden } from "./8225.js";
|
|
6
|
+
import { isNode, getComputedStyle, getNodeName, isShadowRoot, isHTMLElement } from "./3829.js";
|
|
7
|
+
import { contains, activeElement } from "./4549.js";
|
|
8
|
+
import { isElementVisible } from "./3319.js";
|
|
9
|
+
import { ownerDocument } from "./9829.js";
|
|
10
|
+
import { createAttribute } from "./5992.js";
|
|
11
|
+
import { useRenderElement, EMPTY_OBJECT } from "./8272.js";
|
|
12
|
+
import { useId } from "./6046.js";
|
|
13
|
+
import { useStableCallback } from "./7541.js";
|
|
14
|
+
import { mergeCleanups } from "./4495.js";
|
|
15
|
+
import { addEventListener } from "./4723.js";
|
|
16
|
+
import { createChangeEventDetails } from "./4768.js";
|
|
17
|
+
import { focusOut } from "./2418.js";
|
|
18
|
+
import * as __rspack_external_react from "react";
|
|
19
|
+
import * as __rspack_external_react_dom_7136dc57 from "react-dom";
|
|
20
|
+
let popupStateMapping_CommonPopupDataAttributes = function(CommonPopupDataAttributes) {
|
|
21
|
+
CommonPopupDataAttributes["open"] = "data-open";
|
|
22
|
+
CommonPopupDataAttributes["closed"] = "data-closed";
|
|
23
|
+
CommonPopupDataAttributes[CommonPopupDataAttributes["startingStyle"] = stateAttributesMapping_TransitionStatusDataAttributes.startingStyle] = "startingStyle";
|
|
24
|
+
CommonPopupDataAttributes[CommonPopupDataAttributes["endingStyle"] = stateAttributesMapping_TransitionStatusDataAttributes.endingStyle] = "endingStyle";
|
|
25
|
+
CommonPopupDataAttributes["anchorHidden"] = "data-anchor-hidden";
|
|
26
|
+
CommonPopupDataAttributes["side"] = "data-side";
|
|
27
|
+
CommonPopupDataAttributes["align"] = "data-align";
|
|
28
|
+
return CommonPopupDataAttributes;
|
|
29
|
+
}({});
|
|
30
|
+
let popupStateMapping_CommonTriggerDataAttributes = /*#__PURE__*/ function(CommonTriggerDataAttributes) {
|
|
31
|
+
CommonTriggerDataAttributes["popupOpen"] = "data-popup-open";
|
|
32
|
+
CommonTriggerDataAttributes["pressed"] = "data-pressed";
|
|
33
|
+
return CommonTriggerDataAttributes;
|
|
34
|
+
}({});
|
|
35
|
+
const TRIGGER_HOOK = {
|
|
36
|
+
[popupStateMapping_CommonTriggerDataAttributes.popupOpen]: ''
|
|
37
|
+
};
|
|
38
|
+
const PRESSABLE_TRIGGER_HOOK = {
|
|
39
|
+
[popupStateMapping_CommonTriggerDataAttributes.popupOpen]: '',
|
|
40
|
+
[popupStateMapping_CommonTriggerDataAttributes.pressed]: ''
|
|
41
|
+
};
|
|
42
|
+
const POPUP_OPEN_HOOK = {
|
|
43
|
+
[popupStateMapping_CommonPopupDataAttributes.open]: ''
|
|
44
|
+
};
|
|
45
|
+
const POPUP_CLOSED_HOOK = {
|
|
46
|
+
[popupStateMapping_CommonPopupDataAttributes.closed]: ''
|
|
47
|
+
};
|
|
48
|
+
const ANCHOR_HIDDEN_HOOK = {
|
|
49
|
+
[popupStateMapping_CommonPopupDataAttributes.anchorHidden]: ''
|
|
50
|
+
};
|
|
51
|
+
const triggerOpenStateMapping = {
|
|
52
|
+
open (value) {
|
|
53
|
+
if (value) return TRIGGER_HOOK;
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const pressableTriggerOpenStateMapping = {
|
|
58
|
+
open (value) {
|
|
59
|
+
if (value) return PRESSABLE_TRIGGER_HOOK;
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const popupStateMapping = {
|
|
64
|
+
open (value) {
|
|
65
|
+
if (value) return POPUP_OPEN_HOOK;
|
|
66
|
+
return POPUP_CLOSED_HOOK;
|
|
67
|
+
},
|
|
68
|
+
anchorHidden (value) {
|
|
69
|
+
if (value) return ANCHOR_HIDDEN_HOOK;
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const FocusGuard_FocusGuard = /*#__PURE__*/ __rspack_external_react.forwardRef(function(props, ref) {
|
|
74
|
+
const [role, setRole] = __rspack_external_react.useState();
|
|
75
|
+
useIsoLayoutEffect(()=>{
|
|
76
|
+
if (isSafari) setRole('button');
|
|
77
|
+
}, []);
|
|
78
|
+
const restProps = {
|
|
79
|
+
tabIndex: 0,
|
|
80
|
+
role
|
|
81
|
+
};
|
|
82
|
+
return /*#__PURE__*/ jsx("span", {
|
|
83
|
+
...props,
|
|
84
|
+
ref: ref,
|
|
85
|
+
style: visuallyHidden,
|
|
86
|
+
"aria-hidden": role ? void 0 : true,
|
|
87
|
+
...restProps,
|
|
88
|
+
"data-base-ui-focus-guard": ""
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
if ("production" !== process.env.NODE_ENV) FocusGuard_FocusGuard.displayName = "FocusGuard";
|
|
92
|
+
const CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';
|
|
93
|
+
function getParentElement(element) {
|
|
94
|
+
const assignedSlot = element.assignedSlot;
|
|
95
|
+
if (assignedSlot) return assignedSlot;
|
|
96
|
+
if (element.parentElement) return element.parentElement;
|
|
97
|
+
const rootNode = element.getRootNode();
|
|
98
|
+
return isShadowRoot(rootNode) ? rootNode.host : null;
|
|
99
|
+
}
|
|
100
|
+
function getDetailsSummary(details) {
|
|
101
|
+
for (const child of Array.from(details.children))if ('summary' === getNodeName(child)) return child;
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
function isWithinOpenDetailsSummary(element, details) {
|
|
105
|
+
const summary = getDetailsSummary(details);
|
|
106
|
+
return !!summary && (element === summary || contains(summary, element));
|
|
107
|
+
}
|
|
108
|
+
function isFocusableCandidate(element) {
|
|
109
|
+
const nodeName = element ? getNodeName(element) : '';
|
|
110
|
+
return null != element && element.matches(CANDIDATE_SELECTOR) && ('summary' !== nodeName || null != element.parentElement && 'details' === getNodeName(element.parentElement) && getDetailsSummary(element.parentElement) === element) && ('details' !== nodeName || null == getDetailsSummary(element)) && ('input' !== nodeName || 'hidden' !== element.type);
|
|
111
|
+
}
|
|
112
|
+
function isFocusableElement(element) {
|
|
113
|
+
if (!isFocusableCandidate(element) || !element.isConnected || element.matches(':disabled')) return false;
|
|
114
|
+
for(let current = element; current; current = getParentElement(current)){
|
|
115
|
+
const isAncestor = current !== element;
|
|
116
|
+
const isSlot = 'slot' === getNodeName(current);
|
|
117
|
+
if (current.hasAttribute('inert')) return false;
|
|
118
|
+
if (isAncestor && 'details' === getNodeName(current) && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute('hidden') || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) return false;
|
|
119
|
+
}
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
function isVisibleInTabbableTree(element, isAncestor) {
|
|
123
|
+
const styles = getComputedStyle(element);
|
|
124
|
+
if (!isAncestor) return isElementVisible(element, styles);
|
|
125
|
+
return 'none' !== styles.display;
|
|
126
|
+
}
|
|
127
|
+
function getTabIndex(element) {
|
|
128
|
+
const tabIndex = element.tabIndex;
|
|
129
|
+
if (tabIndex < 0) {
|
|
130
|
+
const nodeName = getNodeName(element);
|
|
131
|
+
if ('details' === nodeName || 'audio' === nodeName || 'video' === nodeName || isHTMLElement(element) && element.isContentEditable) return 0;
|
|
132
|
+
}
|
|
133
|
+
return tabIndex;
|
|
134
|
+
}
|
|
135
|
+
function getNamedRadioInput(element) {
|
|
136
|
+
if ('input' !== getNodeName(element)) return null;
|
|
137
|
+
const input = element;
|
|
138
|
+
return 'radio' === input.type && '' !== input.name ? input : null;
|
|
139
|
+
}
|
|
140
|
+
function isTabbableRadio(element, candidates) {
|
|
141
|
+
const input = getNamedRadioInput(element);
|
|
142
|
+
if (!input) return true;
|
|
143
|
+
const checkedRadio = candidates.find((candidate)=>{
|
|
144
|
+
const radio = getNamedRadioInput(candidate);
|
|
145
|
+
return radio?.name === input.name && radio.form === input.form && radio.checked;
|
|
146
|
+
});
|
|
147
|
+
if (checkedRadio) return checkedRadio === input;
|
|
148
|
+
return candidates.find((candidate)=>{
|
|
149
|
+
const radio = getNamedRadioInput(candidate);
|
|
150
|
+
return radio?.name === input.name && radio.form === input.form;
|
|
151
|
+
}) === input;
|
|
152
|
+
}
|
|
153
|
+
function getComposedChildren(container) {
|
|
154
|
+
if (isHTMLElement(container) && 'slot' === getNodeName(container)) {
|
|
155
|
+
const assignedElements = container.assignedElements({
|
|
156
|
+
flatten: true
|
|
157
|
+
});
|
|
158
|
+
if (assignedElements.length > 0) return assignedElements;
|
|
159
|
+
}
|
|
160
|
+
if (isHTMLElement(container) && container.shadowRoot) return Array.from(container.shadowRoot.children);
|
|
161
|
+
return Array.from(container.children);
|
|
162
|
+
}
|
|
163
|
+
function appendCandidates(container, list) {
|
|
164
|
+
getComposedChildren(container).forEach((child)=>{
|
|
165
|
+
if (isFocusableCandidate(child)) list.push(child);
|
|
166
|
+
appendCandidates(child, list);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function appendMatchingElements(container, selector, list) {
|
|
170
|
+
getComposedChildren(container).forEach((child)=>{
|
|
171
|
+
if (isHTMLElement(child) && child.matches(selector)) list.push(child);
|
|
172
|
+
appendMatchingElements(child, selector, list);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function isTabbable(element) {
|
|
176
|
+
return isFocusableElement(element) && getTabIndex(element) >= 0;
|
|
177
|
+
}
|
|
178
|
+
function focusable(container) {
|
|
179
|
+
const candidates = [];
|
|
180
|
+
appendCandidates(container, candidates);
|
|
181
|
+
return candidates.filter(isFocusableElement);
|
|
182
|
+
}
|
|
183
|
+
function tabbable(container) {
|
|
184
|
+
const candidates = focusable(container);
|
|
185
|
+
return candidates.filter((element)=>getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));
|
|
186
|
+
}
|
|
187
|
+
function getTabbableIn(container, dir) {
|
|
188
|
+
const list = tabbable(container);
|
|
189
|
+
const len = list.length;
|
|
190
|
+
if (0 === len) return;
|
|
191
|
+
const active = activeElement(ownerDocument(container));
|
|
192
|
+
const index = list.indexOf(active);
|
|
193
|
+
const nextIndex = -1 === index ? 1 === dir ? 0 : len - 1 : index + dir;
|
|
194
|
+
return list[nextIndex];
|
|
195
|
+
}
|
|
196
|
+
function getNextTabbable(referenceElement) {
|
|
197
|
+
return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;
|
|
198
|
+
}
|
|
199
|
+
function getPreviousTabbable(referenceElement) {
|
|
200
|
+
return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;
|
|
201
|
+
}
|
|
202
|
+
function getTabbableNearElement(referenceElement, dir) {
|
|
203
|
+
if (!referenceElement) return null;
|
|
204
|
+
const list = tabbable(ownerDocument(referenceElement).body);
|
|
205
|
+
const elementCount = list.length;
|
|
206
|
+
if (0 === elementCount) return null;
|
|
207
|
+
const index = list.indexOf(referenceElement);
|
|
208
|
+
if (-1 === index) return null;
|
|
209
|
+
const nextIndex = (index + dir + elementCount) % elementCount;
|
|
210
|
+
return list[nextIndex];
|
|
211
|
+
}
|
|
212
|
+
function getTabbableAfterElement(referenceElement) {
|
|
213
|
+
return getTabbableNearElement(referenceElement, 1);
|
|
214
|
+
}
|
|
215
|
+
function getTabbableBeforeElement(referenceElement) {
|
|
216
|
+
return getTabbableNearElement(referenceElement, -1);
|
|
217
|
+
}
|
|
218
|
+
function isOutsideEvent(event, container) {
|
|
219
|
+
const containerElement = container || event.currentTarget;
|
|
220
|
+
const relatedTarget = event.relatedTarget;
|
|
221
|
+
return !relatedTarget || !contains(containerElement, relatedTarget);
|
|
222
|
+
}
|
|
223
|
+
function disableFocusInside(container) {
|
|
224
|
+
const tabbableElements = tabbable(container);
|
|
225
|
+
tabbableElements.forEach((element)=>{
|
|
226
|
+
element.dataset.tabindex = element.getAttribute('tabindex') || '';
|
|
227
|
+
element.setAttribute('tabindex', '-1');
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function enableFocusInside(container) {
|
|
231
|
+
const elements = [];
|
|
232
|
+
appendMatchingElements(container, '[data-tabindex]', elements);
|
|
233
|
+
elements.forEach((element)=>{
|
|
234
|
+
const tabindex = element.dataset.tabindex;
|
|
235
|
+
delete element.dataset.tabindex;
|
|
236
|
+
if (tabindex) element.setAttribute('tabindex', tabindex);
|
|
237
|
+
else element.removeAttribute('tabindex');
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
const DISABLED_TRANSITIONS_STYLE = {
|
|
241
|
+
style: {
|
|
242
|
+
transition: 'none'
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
const CLICK_TRIGGER_IDENTIFIER = 'data-base-ui-click-trigger';
|
|
246
|
+
const BASE_UI_SWIPE_IGNORE_ATTRIBUTE = 'data-base-ui-swipe-ignore';
|
|
247
|
+
const BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;
|
|
248
|
+
const DROPDOWN_COLLISION_AVOIDANCE = {
|
|
249
|
+
fallbackAxisSide: 'none'
|
|
250
|
+
};
|
|
251
|
+
const POPUP_COLLISION_AVOIDANCE = {
|
|
252
|
+
fallbackAxisSide: 'end'
|
|
253
|
+
};
|
|
254
|
+
const ownerVisuallyHidden = {
|
|
255
|
+
clipPath: 'inset(50%)',
|
|
256
|
+
position: 'fixed',
|
|
257
|
+
top: 0,
|
|
258
|
+
left: 0
|
|
259
|
+
};
|
|
260
|
+
const PortalContext = /*#__PURE__*/ __rspack_external_react.createContext(null);
|
|
261
|
+
if ("production" !== process.env.NODE_ENV) PortalContext.displayName = "PortalContext";
|
|
262
|
+
const usePortalContext = ()=>__rspack_external_react.useContext(PortalContext);
|
|
263
|
+
const attr = createAttribute('portal');
|
|
264
|
+
function useFloatingPortalNode(props = {}) {
|
|
265
|
+
const { ref, container: containerProp, componentProps = EMPTY_OBJECT, elementProps } = props;
|
|
266
|
+
const uniqueId = useId();
|
|
267
|
+
const portalContext = usePortalContext();
|
|
268
|
+
const parentPortalNode = portalContext?.portalNode;
|
|
269
|
+
const [containerElement, setContainerElement] = __rspack_external_react.useState(null);
|
|
270
|
+
const [portalNode, setPortalNode] = __rspack_external_react.useState(null);
|
|
271
|
+
const setPortalNodeRef = useStableCallback((node)=>{
|
|
272
|
+
if (null !== node) setPortalNode(node);
|
|
273
|
+
});
|
|
274
|
+
const containerRef = __rspack_external_react.useRef(null);
|
|
275
|
+
useIsoLayoutEffect(()=>{
|
|
276
|
+
if (null === containerProp) {
|
|
277
|
+
if (containerRef.current) {
|
|
278
|
+
containerRef.current = null;
|
|
279
|
+
setPortalNode(null);
|
|
280
|
+
setContainerElement(null);
|
|
281
|
+
}
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (null == uniqueId) return;
|
|
285
|
+
const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;
|
|
286
|
+
if (null == resolvedContainer) {
|
|
287
|
+
if (containerRef.current) {
|
|
288
|
+
containerRef.current = null;
|
|
289
|
+
setPortalNode(null);
|
|
290
|
+
setContainerElement(null);
|
|
291
|
+
}
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (containerRef.current !== resolvedContainer) {
|
|
295
|
+
containerRef.current = resolvedContainer;
|
|
296
|
+
setPortalNode(null);
|
|
297
|
+
setContainerElement(resolvedContainer);
|
|
298
|
+
}
|
|
299
|
+
}, [
|
|
300
|
+
containerProp,
|
|
301
|
+
parentPortalNode,
|
|
302
|
+
uniqueId
|
|
303
|
+
]);
|
|
304
|
+
const portalElement = useRenderElement('div', componentProps, {
|
|
305
|
+
ref: [
|
|
306
|
+
ref,
|
|
307
|
+
setPortalNodeRef
|
|
308
|
+
],
|
|
309
|
+
props: [
|
|
310
|
+
{
|
|
311
|
+
id: uniqueId,
|
|
312
|
+
[attr]: ''
|
|
313
|
+
},
|
|
314
|
+
elementProps
|
|
315
|
+
]
|
|
316
|
+
});
|
|
317
|
+
const portalSubtree = containerElement && portalElement ? /*#__PURE__*/ __rspack_external_react_dom_7136dc57.createPortal(portalElement, containerElement) : null;
|
|
318
|
+
return {
|
|
319
|
+
portalNode,
|
|
320
|
+
portalSubtree
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
const FloatingPortal_FloatingPortal = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
324
|
+
const { render, className, style, children, container, renderGuards, ...elementProps } = componentProps;
|
|
325
|
+
const { portalNode, portalSubtree } = useFloatingPortalNode({
|
|
326
|
+
container,
|
|
327
|
+
ref: forwardedRef,
|
|
328
|
+
componentProps,
|
|
329
|
+
elementProps
|
|
330
|
+
});
|
|
331
|
+
const beforeOutsideRef = __rspack_external_react.useRef(null);
|
|
332
|
+
const afterOutsideRef = __rspack_external_react.useRef(null);
|
|
333
|
+
const beforeInsideRef = __rspack_external_react.useRef(null);
|
|
334
|
+
const afterInsideRef = __rspack_external_react.useRef(null);
|
|
335
|
+
const [focusManagerState, setFocusManagerState] = __rspack_external_react.useState(null);
|
|
336
|
+
const focusInsideDisabledRef = __rspack_external_react.useRef(false);
|
|
337
|
+
const modal = focusManagerState?.modal;
|
|
338
|
+
const open = focusManagerState?.open;
|
|
339
|
+
const shouldRenderGuards = 'boolean' == typeof renderGuards ? renderGuards : !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;
|
|
340
|
+
__rspack_external_react.useEffect(()=>{
|
|
341
|
+
if (!portalNode || modal) return;
|
|
342
|
+
function onFocus(event) {
|
|
343
|
+
if (portalNode && event.relatedTarget && isOutsideEvent(event)) if ('focusin' === event.type) {
|
|
344
|
+
if (focusInsideDisabledRef.current) {
|
|
345
|
+
enableFocusInside(portalNode);
|
|
346
|
+
focusInsideDisabledRef.current = false;
|
|
347
|
+
}
|
|
348
|
+
} else {
|
|
349
|
+
disableFocusInside(portalNode);
|
|
350
|
+
focusInsideDisabledRef.current = true;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return mergeCleanups(addEventListener(portalNode, 'focusin', onFocus, true), addEventListener(portalNode, 'focusout', onFocus, true));
|
|
354
|
+
}, [
|
|
355
|
+
portalNode,
|
|
356
|
+
modal
|
|
357
|
+
]);
|
|
358
|
+
__rspack_external_react.useEffect(()=>{
|
|
359
|
+
if (!portalNode || false !== open) return;
|
|
360
|
+
enableFocusInside(portalNode);
|
|
361
|
+
focusInsideDisabledRef.current = false;
|
|
362
|
+
}, [
|
|
363
|
+
open,
|
|
364
|
+
portalNode
|
|
365
|
+
]);
|
|
366
|
+
const portalContextValue = __rspack_external_react.useMemo(()=>({
|
|
367
|
+
beforeOutsideRef,
|
|
368
|
+
afterOutsideRef,
|
|
369
|
+
beforeInsideRef,
|
|
370
|
+
afterInsideRef,
|
|
371
|
+
portalNode,
|
|
372
|
+
setFocusManagerState
|
|
373
|
+
}), [
|
|
374
|
+
portalNode
|
|
375
|
+
]);
|
|
376
|
+
return /*#__PURE__*/ jsxs(__rspack_external_react.Fragment, {
|
|
377
|
+
children: [
|
|
378
|
+
portalSubtree,
|
|
379
|
+
/*#__PURE__*/ jsxs(PortalContext.Provider, {
|
|
380
|
+
value: portalContextValue,
|
|
381
|
+
children: [
|
|
382
|
+
shouldRenderGuards && portalNode && /*#__PURE__*/ jsx(FocusGuard_FocusGuard, {
|
|
383
|
+
"data-type": "outside",
|
|
384
|
+
ref: beforeOutsideRef,
|
|
385
|
+
onFocus: (event)=>{
|
|
386
|
+
if (isOutsideEvent(event, portalNode)) beforeInsideRef.current?.focus();
|
|
387
|
+
else {
|
|
388
|
+
const domReference = focusManagerState ? focusManagerState.domReference : null;
|
|
389
|
+
const prevTabbable = getPreviousTabbable(domReference);
|
|
390
|
+
prevTabbable?.focus();
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}),
|
|
394
|
+
shouldRenderGuards && portalNode && /*#__PURE__*/ jsx("span", {
|
|
395
|
+
"aria-owns": portalNode.id,
|
|
396
|
+
style: ownerVisuallyHidden
|
|
397
|
+
}),
|
|
398
|
+
portalNode && /*#__PURE__*/ __rspack_external_react_dom_7136dc57.createPortal(children, portalNode),
|
|
399
|
+
shouldRenderGuards && portalNode && /*#__PURE__*/ jsx(FocusGuard_FocusGuard, {
|
|
400
|
+
"data-type": "outside",
|
|
401
|
+
ref: afterOutsideRef,
|
|
402
|
+
onFocus: (event)=>{
|
|
403
|
+
if (isOutsideEvent(event, portalNode)) afterInsideRef.current?.focus();
|
|
404
|
+
else {
|
|
405
|
+
const domReference = focusManagerState ? focusManagerState.domReference : null;
|
|
406
|
+
const nextTabbable = getNextTabbable(domReference);
|
|
407
|
+
nextTabbable?.focus();
|
|
408
|
+
if (focusManagerState?.closeOnFocusOut) focusManagerState?.onOpenChange(false, createChangeEventDetails(focusOut, event.nativeEvent));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
})
|
|
412
|
+
]
|
|
413
|
+
})
|
|
414
|
+
]
|
|
415
|
+
});
|
|
416
|
+
});
|
|
417
|
+
if ("production" !== process.env.NODE_ENV) FloatingPortal_FloatingPortal.displayName = "FloatingPortal";
|
|
418
|
+
export { BASE_UI_SWIPE_IGNORE_SELECTOR, CLICK_TRIGGER_IDENTIFIER, DISABLED_TRANSITIONS_STYLE, DROPDOWN_COLLISION_AVOIDANCE, FloatingPortal_FloatingPortal, FocusGuard_FocusGuard, POPUP_COLLISION_AVOIDANCE, disableFocusInside, enableFocusInside, focusable, getNextTabbable, getPreviousTabbable, getTabbableAfterElement, getTabbableBeforeElement, isOutsideEvent, isTabbable, ownerVisuallyHidden, popupStateMapping, popupStateMapping_CommonPopupDataAttributes, popupStateMapping_CommonTriggerDataAttributes, pressableTriggerOpenStateMapping, tabbable, triggerOpenStateMapping, useFloatingPortalNode, usePortalContext };
|
package/dist/4490.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useBaseUiId } from "./6046.js";
|
|
2
|
+
import { useIsoLayoutEffect } from "./6499.js";
|
|
3
|
+
import * as __rspack_external_react from "react";
|
|
4
|
+
function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {
|
|
5
|
+
const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = __rspack_external_react.useState();
|
|
6
|
+
const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : void 0);
|
|
7
|
+
const ariaLabelledBy = explicitAriaLabelledBy ?? labelId ?? fallbackAriaLabelledBy;
|
|
8
|
+
useIsoLayoutEffect(()=>{
|
|
9
|
+
const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || !enableFallback ? void 0 : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);
|
|
10
|
+
if (fallbackAriaLabelledBy !== nextAriaLabelledBy) setFallbackAriaLabelledBy(nextAriaLabelledBy);
|
|
11
|
+
});
|
|
12
|
+
return ariaLabelledBy;
|
|
13
|
+
}
|
|
14
|
+
function getAriaLabelledBy(labelSource, generatedLabelId) {
|
|
15
|
+
const label = findAssociatedLabel(labelSource);
|
|
16
|
+
if (!label) return;
|
|
17
|
+
if (!label.id && generatedLabelId) label.id = generatedLabelId;
|
|
18
|
+
return label.id || void 0;
|
|
19
|
+
}
|
|
20
|
+
function findAssociatedLabel(labelSource) {
|
|
21
|
+
if (!labelSource) return;
|
|
22
|
+
const parent = labelSource.parentElement;
|
|
23
|
+
if (parent && 'LABEL' === parent.tagName) return parent;
|
|
24
|
+
const controlId = labelSource.id;
|
|
25
|
+
if (controlId) {
|
|
26
|
+
const nextSibling = labelSource.nextElementSibling;
|
|
27
|
+
if (nextSibling && nextSibling.htmlFor === controlId) return nextSibling;
|
|
28
|
+
}
|
|
29
|
+
const labels = labelSource.labels;
|
|
30
|
+
return labels && labels[0];
|
|
31
|
+
}
|
|
32
|
+
export { useAriaLabelledBy };
|
package/dist/4495.js
ADDED
package/dist/4549.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isShadowRoot } from "./3829.js";
|
|
2
|
+
function activeElement(doc) {
|
|
3
|
+
let element = doc.activeElement;
|
|
4
|
+
while(element?.shadowRoot?.activeElement != null)element = element.shadowRoot.activeElement;
|
|
5
|
+
return element;
|
|
6
|
+
}
|
|
7
|
+
function contains(parent, child) {
|
|
8
|
+
if (!parent || !child) return false;
|
|
9
|
+
const rootNode = child.getRootNode?.();
|
|
10
|
+
if (parent.contains(child)) return true;
|
|
11
|
+
if (rootNode && isShadowRoot(rootNode)) {
|
|
12
|
+
let next = child;
|
|
13
|
+
while(next){
|
|
14
|
+
if (parent === next) return true;
|
|
15
|
+
next = next.parentNode || next.host;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
function getTarget(event) {
|
|
21
|
+
if ('composedPath' in event) return event.composedPath()[0];
|
|
22
|
+
return event.target;
|
|
23
|
+
}
|
|
24
|
+
export { activeElement, contains, getTarget };
|
package/dist/4586.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*! LICENSE: 4586.js.LICENSE.txt */
|
|
2
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
|
+
import * as __rspack_external_react from "react";
|
|
4
|
+
__webpack_require__.add({
|
|
5
|
+
"../../node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
6
|
+
/**
|
|
7
|
+
* @license React
|
|
8
|
+
* use-sync-external-store.development.js
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/ if ("production" !== process.env.NODE_ENV) {
|
|
15
|
+
"u" > typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
16
|
+
var useSyncExternalStore$jscomp$inline_1 = __webpack_require__("react?f15c").useSyncExternalStore;
|
|
17
|
+
console.error("The main 'use-sync-external-store' entry point is not supported; all it does is re-export useSyncExternalStore from the 'react' package, so it only works with React 18+.\n\nIf you wish to support React 16 and 17, import from 'use-sync-external-store/shim' instead. It will fall back to a shimmed implementation when the native one is not available.\n\nIf you only support React 18+, you can import directly from 'react'.");
|
|
18
|
+
exports.useSyncExternalStore = useSyncExternalStore$jscomp$inline_1;
|
|
19
|
+
"u" > typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"../../node_modules/use-sync-external-store/cjs/use-sync-external-store.production.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
23
|
+
/**
|
|
24
|
+
* @license React
|
|
25
|
+
* use-sync-external-store.production.js
|
|
26
|
+
*
|
|
27
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the MIT license found in the
|
|
30
|
+
* LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/ var useSyncExternalStore = __webpack_require__("react?f15c").useSyncExternalStore;
|
|
32
|
+
exports.useSyncExternalStore = useSyncExternalStore;
|
|
33
|
+
},
|
|
34
|
+
"../../node_modules/use-sync-external-store/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
35
|
+
if ('production' === process.env.NODE_ENV) module.exports = __webpack_require__("../../node_modules/use-sync-external-store/cjs/use-sync-external-store.production.js");
|
|
36
|
+
else module.exports = __webpack_require__("../../node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js");
|
|
37
|
+
},
|
|
38
|
+
"react?f15c" (module) {
|
|
39
|
+
module.exports = __rspack_external_react;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store.development.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @license React
|
|
13
|
+
* use-sync-external-store.production.js
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the MIT license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/
|
package/dist/4707.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useRefWithInit } from "./8272.js";
|
|
2
|
+
import { useIsoLayoutEffect } from "./6499.js";
|
|
3
|
+
function useValueAsRef(value) {
|
|
4
|
+
const latest = useRefWithInit(createLatestRef, value).current;
|
|
5
|
+
latest.next = value;
|
|
6
|
+
useIsoLayoutEffect(latest.effect);
|
|
7
|
+
return latest;
|
|
8
|
+
}
|
|
9
|
+
function createLatestRef(value) {
|
|
10
|
+
const latest = {
|
|
11
|
+
current: value,
|
|
12
|
+
next: value,
|
|
13
|
+
effect: ()=>{
|
|
14
|
+
latest.current = latest.next;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return latest;
|
|
18
|
+
}
|
|
19
|
+
export { useValueAsRef };
|
package/dist/4723.js
ADDED
package/dist/4745.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const FOCUSABLE_ATTRIBUTE = 'data-base-ui-focusable';
|
|
2
|
+
const TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
3
|
+
const ARROW_LEFT = 'ArrowLeft';
|
|
4
|
+
const ARROW_RIGHT = 'ArrowRight';
|
|
5
|
+
const ARROW_UP = 'ArrowUp';
|
|
6
|
+
const ARROW_DOWN = 'ArrowDown';
|
|
7
|
+
export { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, FOCUSABLE_ATTRIBUTE, TYPEABLE_SELECTOR };
|
package/dist/4768.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EMPTY_OBJECT } from "./8272.js";
|
|
2
|
+
function createChangeEventDetails(reason, event, trigger, customProperties) {
|
|
3
|
+
let canceled = false;
|
|
4
|
+
let allowPropagation = false;
|
|
5
|
+
const custom = customProperties ?? EMPTY_OBJECT;
|
|
6
|
+
const details = {
|
|
7
|
+
reason,
|
|
8
|
+
event: event ?? new Event('base-ui'),
|
|
9
|
+
cancel () {
|
|
10
|
+
canceled = true;
|
|
11
|
+
},
|
|
12
|
+
allowPropagation () {
|
|
13
|
+
allowPropagation = true;
|
|
14
|
+
},
|
|
15
|
+
get isCanceled () {
|
|
16
|
+
return canceled;
|
|
17
|
+
},
|
|
18
|
+
get isPropagationAllowed () {
|
|
19
|
+
return allowPropagation;
|
|
20
|
+
},
|
|
21
|
+
trigger,
|
|
22
|
+
...custom
|
|
23
|
+
};
|
|
24
|
+
return details;
|
|
25
|
+
}
|
|
26
|
+
function createGenericEventDetails(reason, event, customProperties) {
|
|
27
|
+
const custom = customProperties ?? EMPTY_OBJECT;
|
|
28
|
+
const details = {
|
|
29
|
+
reason,
|
|
30
|
+
event: event ?? new Event('base-ui'),
|
|
31
|
+
...custom
|
|
32
|
+
};
|
|
33
|
+
return details;
|
|
34
|
+
}
|
|
35
|
+
export { createChangeEventDetails, createGenericEventDetails };
|
package/dist/4922.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PopupTriggerMap, FloatingRootStore } from "./5992.js";
|
|
2
|
+
function getEmptyRootContext() {
|
|
3
|
+
return new FloatingRootStore({
|
|
4
|
+
open: false,
|
|
5
|
+
transitionStatus: void 0,
|
|
6
|
+
floatingElement: null,
|
|
7
|
+
referenceElement: null,
|
|
8
|
+
triggerElements: new PopupTriggerMap(),
|
|
9
|
+
floatingId: void 0,
|
|
10
|
+
syncOnly: false,
|
|
11
|
+
nested: false,
|
|
12
|
+
onOpenChange: void 0
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export { getEmptyRootContext };
|
package/dist/5036.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as __rspack_external_react from "react";
|
|
2
|
+
const CompositeListContext = /*#__PURE__*/ __rspack_external_react.createContext({
|
|
3
|
+
register: ()=>{},
|
|
4
|
+
unregister: ()=>{},
|
|
5
|
+
subscribeMapChange: ()=>()=>{},
|
|
6
|
+
elementsRef: {
|
|
7
|
+
current: []
|
|
8
|
+
},
|
|
9
|
+
nextIndexRef: {
|
|
10
|
+
current: 0
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
if ("production" !== process.env.NODE_ENV) CompositeListContext.displayName = "CompositeListContext";
|
|
14
|
+
function useCompositeListContext() {
|
|
15
|
+
return __rspack_external_react.useContext(CompositeListContext);
|
|
16
|
+
}
|
|
17
|
+
export { CompositeListContext, useCompositeListContext };
|