@wix/site-ui 1.347.0 → 1.348.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/{6706.js → 1093.js} +3 -3
- package/dist/{8724.js → 1219.js} +2 -2
- package/dist/{7373.js → 1288.js} +8 -2
- package/dist/{5299.js → 1381.js} +98 -127
- package/dist/{3056.js → 1607.js} +32 -34
- package/dist/1629.js +2 -0
- package/dist/1669.js +75 -0
- package/dist/1718.js +26 -0
- package/dist/{1477.js → 201.js} +17 -26
- package/dist/2221.js +9 -0
- package/dist/{2445.js → 226.js} +12 -48
- package/dist/2387.js +7 -0
- package/dist/2580.js +6 -0
- package/dist/{1500.js → 2859.js} +10 -34
- package/dist/3014.js +178 -0
- package/dist/{6247.js → 3054.js} +3 -3
- package/dist/{7642.js → 3093.js} +1 -1
- package/dist/3189.js +5 -0
- package/dist/{7564.js → 331.js} +2 -2
- package/dist/3357.js +7 -0
- package/dist/{487.js → 3398.js} +38 -39
- package/dist/3502.js +224 -0
- package/dist/3695.js +50 -0
- package/dist/3829.js +1 -1
- package/dist/{6588.js → 3859.js} +115 -92
- package/dist/{3670.js → 3910.js} +28 -21
- package/dist/392.js +7 -0
- package/dist/{4549.js → 4155.js} +11 -3
- package/dist/4226.js +7 -0
- package/dist/{6329.js → 4229.js} +1 -1
- package/dist/4293.js +3 -0
- package/dist/4346.js +853 -2
- package/dist/{285.js → 4472.js} +3 -3
- package/dist/4605.js +207 -0
- package/dist/{7366.js → 488.js} +60 -7
- package/dist/{8750.js → 497.js} +190 -375
- package/dist/4989.js +35 -0
- package/dist/{6270.js → 510.js} +157 -196
- package/dist/5258.js +26 -0
- package/dist/{5036.js → 5275.js} +0 -3
- package/dist/{8171.js → 5298.js} +90 -102
- package/dist/5473.js +11 -0
- package/dist/{4745.js → 5490.js} +3 -1
- package/dist/{6089.js → 5561.js} +869 -786
- package/dist/{8996.js → 5595.js} +4 -3
- package/dist/5890.js +25 -0
- package/dist/{6046.js → 5969.js} +1 -1
- package/dist/5984.js +38 -0
- package/dist/{8527.js → 6006.js} +3 -3
- package/dist/6040.js +97 -0
- package/dist/{8758.js → 6137.js} +10 -8
- package/dist/{4281.js → 6140.js} +18 -10
- package/dist/{8960.js → 6191.js} +2 -2
- package/dist/6240.js +121 -0
- package/dist/{4490.js → 6373.js} +7 -5
- package/dist/{904.js → 6487.js} +19 -17
- package/dist/{9635.js → 6498.js} +1 -1
- package/dist/6499.js +4 -7
- package/dist/6508.js +7 -0
- package/dist/{8225.js → 6540.js} +1 -0
- package/dist/6551.js +46 -0
- package/dist/{9369.js → 6620.js} +35 -34
- package/dist/{4143.js → 6838.js} +19 -10
- package/dist/6902.js +48 -0
- package/dist/6904.js +51 -0
- package/dist/70.js +24 -0
- package/dist/7024.js +39 -0
- package/dist/{6882.js → 721.js} +737 -362
- package/dist/{951.js → 7270.js} +4 -4
- package/dist/{3485.js → 7323.js} +143 -111
- package/dist/{7541.js → 7488.js} +2 -2
- package/dist/{4863.js → 7542.js} +7 -6
- package/dist/7551.js +28 -0
- package/dist/{7021.js → 7640.js} +1 -1
- package/dist/{353.js → 7692.js} +3 -7
- package/dist/{4707.js → 7930.js} +2 -2
- package/dist/{8052.js → 8.js} +80 -64
- package/dist/{6914.js → 8129.js} +3 -15
- package/dist/{3319.js → 8358.js} +62 -63
- package/dist/{5864.js → 8407.js} +13 -13
- package/dist/8488.js +15 -0
- package/dist/{4768.js → 8495.js} +1 -1
- package/dist/8734.js +171 -0
- package/dist/{1763.js → 9018.js} +205 -331
- package/dist/9053.js +29 -0
- package/dist/9067.js +41 -0
- package/dist/{2861.js → 9120.js} +2 -2
- package/dist/{42.js → 9197.js} +2 -2
- package/dist/{9189.js → 9248.js} +36 -17
- package/dist/{2801.js → 9252.js} +4 -9
- package/dist/9295.js +7 -0
- package/dist/9303.js +8 -0
- package/dist/{167.js → 9374.js} +1 -1
- package/dist/{9352.js → 9540.js} +17 -47
- package/dist/9576.js +51 -0
- package/dist/{8272.js → 9591.js} +36 -46
- package/dist/{6107.js → 9770.js} +2 -2
- package/dist/{5085.js → 9880.js} +6 -3
- package/dist/Accordion/index.d.ts +207 -41
- package/dist/Accordion/index.js +75 -177
- package/dist/AlertDialog/index.d.ts +440 -140
- package/dist/AlertDialog/index.js +3 -13
- package/dist/Autocomplete/index.d.ts +722 -150
- package/dist/Autocomplete/index.js +16 -29
- package/dist/Avatar/index.d.ts +38 -3
- package/dist/Avatar/index.js +82 -28
- package/dist/Breadcrumbs/index.d.ts +63 -91
- package/dist/Breadcrumbs/index.js +1 -1
- package/dist/Button/index.d.ts +11 -0
- package/dist/Button/index.js +2 -2
- package/dist/Checkbox/index.d.ts +206 -36
- package/dist/Checkbox/index.js +293 -8
- package/dist/CheckboxField/index.css +1 -1
- package/dist/CheckboxField/index.d.ts +40 -36
- package/dist/CheckboxGroup/index.d.ts +50 -36
- package/dist/CheckboxGroup/index.js +87 -58
- package/dist/CheckboxGroupField/index.css +1 -1
- package/dist/Collapsible/index.d.ts +128 -36
- package/dist/Collapsible/index.js +21 -25
- package/dist/Combobox/index.d.ts +801 -158
- package/dist/Combobox/index.js +70 -114
- package/dist/ContextMenu/index.d.ts +1162 -195
- package/dist/ContextMenu/index.js +46 -36
- package/dist/Dialog/index.d.ts +425 -133
- package/dist/Dialog/index.js +8 -4
- package/dist/Drawer/index.d.ts +589 -144
- package/dist/Drawer/index.js +482 -562
- package/dist/Field/index.css +1 -1
- package/dist/Field/index.d.ts +341 -42
- package/dist/Field/index.js +123 -273
- package/dist/Fieldset/index.d.ts +11 -0
- package/dist/Fieldset/index.js +10 -17
- package/dist/Form/index.d.ts +43 -39
- package/dist/Form/index.js +58 -50
- package/dist/Input/index.css +1 -1
- package/dist/Input/index.d.ts +94 -42
- package/dist/Input/index.js +1 -1
- package/dist/Menu/index.d.ts +1140 -175
- package/dist/Menu/index.js +51 -67
- package/dist/Menubar/index.d.ts +651 -173
- package/dist/Menubar/index.js +12 -16
- package/dist/Meter/index.js +21 -18
- package/dist/NavigationMenu/index.d.ts +370 -86
- package/dist/NavigationMenu/index.js +144 -178
- package/dist/NumberField/index.css +1 -1
- package/dist/NumberField/index.d.ts +507 -47
- package/dist/NumberField/index.js +434 -718
- package/dist/Popover/index.d.ts +561 -142
- package/dist/Popover/index.js +181 -252
- package/dist/PreviewCard/index.d.ts +507 -143
- package/dist/PreviewCard/index.js +97 -151
- package/dist/Progress/index.d.ts +117 -3
- package/dist/Progress/index.js +37 -36
- package/dist/Radio/index.d.ts +177 -7
- package/dist/Radio/index.js +54 -70
- package/dist/RadioField/index.css +1 -1
- package/dist/RadioField/index.d.ts +23 -7
- package/dist/RadioGroup/index.d.ts +51 -37
- package/dist/RadioGroup/index.js +60 -51
- package/dist/RadioGroupField/index.css +1 -1
- package/dist/RadioGroupField/index.d.ts +40 -37
- package/dist/ScrollArea/index.d.ts +295 -1
- package/dist/ScrollArea/index.js +256 -324
- package/dist/Select/index.d.ts +516 -123
- package/dist/Select/index.js +513 -635
- package/dist/SelectField/index.css +1 -1
- package/dist/SelectField/index.d.ts +109 -134
- package/dist/SelectField/index.js +5 -1
- package/dist/Separator/index.d.ts +12 -0
- package/dist/Separator/index.js +1 -1
- package/dist/Slider/index.d.ts +383 -64
- package/dist/Slider/index.js +298 -374
- package/dist/Switch/index.d.ts +184 -37
- package/dist/Switch/index.js +44 -58
- package/dist/Tabs/index.d.ts +220 -35
- package/dist/Tabs/index.js +199 -193
- package/dist/Toast/index.d.ts +280 -64
- package/dist/Toast/index.js +299 -374
- package/dist/Toggle/index.d.ts +55 -35
- package/dist/Toggle/index.js +19 -13
- package/dist/ToggleGroup/index.d.ts +62 -35
- package/dist/ToggleGroup/index.js +13 -31
- package/dist/Toolbar/index.d.ts +117 -2
- package/dist/Toolbar/index.js +31 -43
- package/dist/Tooltip/index.d.ts +507 -150
- package/dist/Tooltip/index.js +163 -213
- package/dist/index.d.ts +12912 -5382
- package/package.json +3 -3
- package/dist/2205.js +0 -26
- package/dist/2274.js +0 -34
- package/dist/2287.js +0 -17
- package/dist/3020.js +0 -7
- package/dist/3021.js +0 -72
- package/dist/3140.js +0 -4
- package/dist/3248.js +0 -307
- package/dist/4026.js +0 -12
- package/dist/4922.js +0 -15
- package/dist/5659.js +0 -4
- package/dist/5992.js +0 -447
- package/dist/6330.js +0 -30
- package/dist/6535.js +0 -72
- package/dist/6917.js +0 -55
- package/dist/7725.js +0 -10
- package/dist/7871.js +0 -38
- package/dist/8106.js +0 -239
- package/dist/8685.js +0 -102
- package/dist/8935.js +0 -8
- package/dist/8971.js +0 -40
- package/dist/8979.js +0 -10
- package/dist/9048.js +0 -52
- package/dist/9087.js +0 -256
- package/dist/9255.js +0 -136
- /package/dist/{1457.js → 1068.js} +0 -0
- /package/dist/{6003.js → 1234.js} +0 -0
- /package/dist/{4723.js → 1282.js} +0 -0
- /package/dist/{6825.js → 1876.js} +0 -0
- /package/dist/{5778.js → 1885.js} +0 -0
- /package/dist/{2445.js.LICENSE.txt → 226.js.LICENSE.txt} +0 -0
- /package/dist/{1279.js → 3278.js} +0 -0
- /package/dist/{3296.js → 5568.js} +0 -0
- /package/dist/{8685.css → 6240.css} +0 -0
- /package/dist/{9829.js → 6488.js} +0 -0
- /package/dist/{9863.js → 6534.js} +0 -0
- /package/dist/{4495.js → 7718.js} +0 -0
- /package/dist/{3395.js → 8866.js} +0 -0
- /package/dist/{2418.js → 9837.js} +0 -0
package/dist/9053.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useCompositeRootContext } from "./1219.js";
|
|
2
|
+
import { useCompositeListItem } from "./9576.js";
|
|
3
|
+
import { useMergedRefs } from "./9591.js";
|
|
4
|
+
import * as __rspack_external_react from "react";
|
|
5
|
+
function useCompositeItem(params = {}) {
|
|
6
|
+
const { highlightItemOnHover, highlightedIndex, onHighlightedIndexChange } = useCompositeRootContext();
|
|
7
|
+
const { ref, index } = useCompositeListItem(params);
|
|
8
|
+
const isHighlighted = highlightedIndex === index;
|
|
9
|
+
const itemRef = __rspack_external_react.useRef(null);
|
|
10
|
+
const mergedRef = useMergedRefs(ref, itemRef);
|
|
11
|
+
const compositeProps = {
|
|
12
|
+
tabIndex: isHighlighted ? 0 : -1,
|
|
13
|
+
onFocus () {
|
|
14
|
+
onHighlightedIndexChange(index);
|
|
15
|
+
},
|
|
16
|
+
onMouseMove () {
|
|
17
|
+
const item = itemRef.current;
|
|
18
|
+
if (!highlightItemOnHover || !item) return;
|
|
19
|
+
const disabled = item.hasAttribute('disabled') || 'true' === item.ariaDisabled;
|
|
20
|
+
if (!isHighlighted && !disabled) item.focus();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
compositeProps,
|
|
25
|
+
compositeRef: mergedRef,
|
|
26
|
+
index
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export { useCompositeItem };
|
package/dist/9067.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useTransitionStatus } from "./7542.js";
|
|
2
|
+
import { useRenderElement } from "./9591.js";
|
|
3
|
+
import { transitionStatusMapping } from "./8488.js";
|
|
4
|
+
import { useOpenChangeComplete } from "./6620.js";
|
|
5
|
+
import * as __rspack_external_react from "react";
|
|
6
|
+
const ItemIndicator_ItemIndicator = /*#__PURE__*/ __rspack_external_react.memo(/*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
7
|
+
const { render, className, style, keepMounted, selected, ...elementProps } = componentProps;
|
|
8
|
+
const indicatorRef = __rspack_external_react.useRef(null);
|
|
9
|
+
const { transitionStatus, setMounted } = useTransitionStatus(selected);
|
|
10
|
+
const state = {
|
|
11
|
+
selected,
|
|
12
|
+
transitionStatus
|
|
13
|
+
};
|
|
14
|
+
const element = useRenderElement('span', componentProps, {
|
|
15
|
+
ref: [
|
|
16
|
+
forwardedRef,
|
|
17
|
+
indicatorRef
|
|
18
|
+
],
|
|
19
|
+
state,
|
|
20
|
+
props: [
|
|
21
|
+
{
|
|
22
|
+
'aria-hidden': true,
|
|
23
|
+
children: '✔️'
|
|
24
|
+
},
|
|
25
|
+
elementProps
|
|
26
|
+
],
|
|
27
|
+
stateAttributesMapping: transitionStatusMapping
|
|
28
|
+
});
|
|
29
|
+
useOpenChangeComplete({
|
|
30
|
+
batch: true,
|
|
31
|
+
enabled: !selected,
|
|
32
|
+
open: selected,
|
|
33
|
+
ref: indicatorRef,
|
|
34
|
+
onComplete () {
|
|
35
|
+
if (!selected) setMounted(false);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return element;
|
|
39
|
+
}));
|
|
40
|
+
if ("production" !== process.env.NODE_ENV) ItemIndicator_ItemIndicator.displayName = "ItemIndicator";
|
|
41
|
+
export { ItemIndicator_ItemIndicator };
|
package/dist/{2861.js → 9120.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { EMPTY_ARRAY } from "./9591.js";
|
|
1
2
|
import * as __rspack_external_react from "react";
|
|
2
|
-
const EMPTY = [];
|
|
3
3
|
function useOnMount(fn) {
|
|
4
|
-
__rspack_external_react.useEffect(fn,
|
|
4
|
+
__rspack_external_react.useEffect(fn, EMPTY_ARRAY);
|
|
5
5
|
}
|
|
6
6
|
export { useOnMount };
|
package/dist/{42.js → 9197.js}
RENAMED
package/dist/{9189.js → 9248.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { getWindow, isHTMLElement } from "./3829.js";
|
|
2
|
+
import { useCompositeRootContext } from "./1219.js";
|
|
3
|
+
import { useIsoLayoutEffect, SafeReact } from "./3357.js";
|
|
4
|
+
import { error } from "./4293.js";
|
|
5
|
+
import { mergeProps, makeEventPreventable } from "./9591.js";
|
|
6
|
+
import { useStableCallback } from "./7488.js";
|
|
7
7
|
import * as __rspack_external_react from "react";
|
|
8
8
|
function useFocusableWhenDisabled(parameters) {
|
|
9
9
|
const { focusableWhenDisabled, disabled, composite = false, tabIndex: tabIndexProp = 0, isNativeButton } = parameters;
|
|
@@ -35,6 +35,19 @@ function useFocusableWhenDisabled(parameters) {
|
|
|
35
35
|
props
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
+
function dispatchClickWithModifiers(target, sourceEvent, { detail = 0, pointerType = '' } = {}) {
|
|
39
|
+
target.dispatchEvent(new (getWindow(target)).PointerEvent('click', {
|
|
40
|
+
bubbles: true,
|
|
41
|
+
cancelable: true,
|
|
42
|
+
composed: true,
|
|
43
|
+
detail,
|
|
44
|
+
pointerType,
|
|
45
|
+
shiftKey: sourceEvent.shiftKey,
|
|
46
|
+
ctrlKey: sourceEvent.ctrlKey,
|
|
47
|
+
altKey: sourceEvent.altKey,
|
|
48
|
+
metaKey: sourceEvent.metaKey
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
38
51
|
function useButton(parameters = {}) {
|
|
39
52
|
const { disabled = false, focusableWhenDisabled, tabIndex = 0, native: isNativeButton = true, composite: compositeProp } = parameters;
|
|
40
53
|
const elementRef = __rspack_external_react.useRef(null);
|
|
@@ -103,18 +116,21 @@ function useButton(parameters = {}) {
|
|
|
103
116
|
if (isCurrentTarget && isCompositeItem && isSpaceKey) {
|
|
104
117
|
if (event.defaultPrevented && isTextNavigationRole) return;
|
|
105
118
|
event.preventDefault();
|
|
106
|
-
if (
|
|
107
|
-
currentTarget.click();
|
|
108
|
-
event.preventBaseUIHandler();
|
|
109
|
-
} else if (shouldClick) {
|
|
110
|
-
externalOnClick?.(event);
|
|
119
|
+
if (!isNativeButton || isButton) {
|
|
111
120
|
event.preventBaseUIHandler();
|
|
121
|
+
dispatchClickWithModifiers(currentTarget, event);
|
|
112
122
|
}
|
|
113
123
|
return;
|
|
114
124
|
}
|
|
115
|
-
if (shouldClick) {
|
|
116
|
-
if (
|
|
117
|
-
|
|
125
|
+
if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {
|
|
126
|
+
if (isCurrentTarget && isLink && isSpaceKey) event.preventDefault();
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (event.defaultPrevented) return;
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
if (isEnterKey) {
|
|
132
|
+
event.preventBaseUIHandler();
|
|
133
|
+
dispatchClickWithModifiers(currentTarget, event);
|
|
118
134
|
}
|
|
119
135
|
},
|
|
120
136
|
onKeyUp (event) {
|
|
@@ -123,7 +139,10 @@ function useButton(parameters = {}) {
|
|
|
123
139
|
externalOnKeyUp?.(event);
|
|
124
140
|
if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && ' ' === event.key) return void event.preventDefault();
|
|
125
141
|
if (event.baseUIHandlerPrevented) return;
|
|
126
|
-
if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && ' ' === event.key)
|
|
142
|
+
if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && ' ' === event.key) {
|
|
143
|
+
event.preventBaseUIHandler();
|
|
144
|
+
dispatchClickWithModifiers(event.currentTarget, event);
|
|
145
|
+
}
|
|
127
146
|
},
|
|
128
147
|
onPointerDown (event) {
|
|
129
148
|
if (disabled) return void event.preventDefault();
|
|
@@ -153,6 +172,6 @@ function isButtonElement(elem) {
|
|
|
153
172
|
return isHTMLElement(elem) && 'BUTTON' === elem.tagName;
|
|
154
173
|
}
|
|
155
174
|
function isValidLinkElement(elem) {
|
|
156
|
-
return
|
|
175
|
+
return isHTMLElement(elem) && 'A' === elem.tagName && Boolean(elem.href);
|
|
157
176
|
}
|
|
158
|
-
export { useButton, useFocusableWhenDisabled };
|
|
177
|
+
export { dispatchClickWithModifiers, useButton, useFocusableWhenDisabled };
|
package/dist/{2801.js → 9252.js}
RENAMED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import { useStableCallback } from "./
|
|
2
|
-
import { useIsoLayoutEffect } from "./
|
|
1
|
+
import { useStableCallback } from "./7488.js";
|
|
2
|
+
import { useIsoLayoutEffect } from "./3357.js";
|
|
3
3
|
import * as __rspack_external_react from "react";
|
|
4
4
|
function useValueChanged(value, onChange) {
|
|
5
5
|
const valueRef = __rspack_external_react.useRef(value);
|
|
6
6
|
const onChangeCallback = useStableCallback(onChange);
|
|
7
7
|
useIsoLayoutEffect(()=>{
|
|
8
|
-
if (valueRef.current
|
|
9
|
-
|
|
8
|
+
if (valueRef.current !== value) onChangeCallback(valueRef.current);
|
|
9
|
+
valueRef.current = value;
|
|
10
10
|
}, [
|
|
11
11
|
value,
|
|
12
12
|
onChangeCallback
|
|
13
13
|
]);
|
|
14
|
-
useIsoLayoutEffect(()=>{
|
|
15
|
-
valueRef.current = value;
|
|
16
|
-
}, [
|
|
17
|
-
value
|
|
18
|
-
]);
|
|
19
14
|
}
|
|
20
15
|
export { useValueChanged };
|
package/dist/9295.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function getFiniteAnimations(element, options) {
|
|
2
|
+
return element.getAnimations(options).filter((animation)=>{
|
|
3
|
+
const timing = animation.effect?.getTiming();
|
|
4
|
+
return timing?.duration !== 1 / 0 && timing?.iterations !== 1 / 0;
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
export { getFiniteAnimations };
|
package/dist/9303.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { keyboard, pointer } from "./9837.js";
|
|
2
|
+
function getHighlightReason(event) {
|
|
3
|
+
if (null == event) return "none";
|
|
4
|
+
if (event.type.startsWith('key')) return keyboard;
|
|
5
|
+
if (event.type.startsWith('mouse') || event.type.startsWith('pointer')) return pointer;
|
|
6
|
+
return "none";
|
|
7
|
+
}
|
|
8
|
+
export { getHighlightReason };
|
package/dist/{167.js → 9374.js}
RENAMED
package/dist/{9352.js → 9540.js}
RENAMED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { FOCUSABLE_POPUP_PROPS } from "./
|
|
7
|
-
import { COMPOSITE_KEYS } from "./
|
|
8
|
-
import { FloatingFocusManager } from "./
|
|
2
|
+
import { useDialogPortalContext, useDialogRootContext, dialogStateAttributesMapping } from "./510.js";
|
|
3
|
+
import { useRenderElement } from "./9591.js";
|
|
4
|
+
import { popupTransitionStateMapping } from "./6904.js";
|
|
5
|
+
import { useOpenChangeComplete } from "./6620.js";
|
|
6
|
+
import { createDefaultInitialFocus, FOCUSABLE_POPUP_PROPS } from "./4346.js";
|
|
7
|
+
import { COMPOSITE_KEYS } from "./2859.js";
|
|
8
|
+
import { FloatingFocusManager } from "./7323.js";
|
|
9
9
|
import * as __rspack_external_react from "react";
|
|
10
|
-
const stateAttributesMapping = {
|
|
11
|
-
...popupStateMapping,
|
|
12
|
-
...transitionStatusMapping
|
|
13
|
-
};
|
|
14
10
|
const DialogBackdrop_DialogBackdrop = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
15
11
|
const { render, className, style, forceRender = false, ...elementProps } = componentProps;
|
|
16
|
-
const
|
|
12
|
+
const store = useDialogRootContext();
|
|
17
13
|
const open = store.useState('open');
|
|
18
14
|
const nested = store.useState('nested');
|
|
19
15
|
const mounted = store.useState('mounted');
|
|
@@ -28,7 +24,7 @@ const DialogBackdrop_DialogBackdrop = /*#__PURE__*/ __rspack_external_react.forw
|
|
|
28
24
|
store.context.backdropRef,
|
|
29
25
|
forwardedRef
|
|
30
26
|
],
|
|
31
|
-
stateAttributesMapping:
|
|
27
|
+
stateAttributesMapping: popupTransitionStateMapping,
|
|
32
28
|
props: [
|
|
33
29
|
{
|
|
34
30
|
role: 'presentation',
|
|
@@ -44,31 +40,10 @@ const DialogBackdrop_DialogBackdrop = /*#__PURE__*/ __rspack_external_react.forw
|
|
|
44
40
|
});
|
|
45
41
|
});
|
|
46
42
|
if ("production" !== process.env.NODE_ENV) DialogBackdrop_DialogBackdrop.displayName = "DialogBackdrop";
|
|
47
|
-
|
|
48
|
-
DialogPopupCssVars["nestedDialogs"] = "--nested-dialogs";
|
|
49
|
-
return DialogPopupCssVars;
|
|
50
|
-
}({});
|
|
51
|
-
let DialogPopupDataAttributes_DialogPopupDataAttributes = function(DialogPopupDataAttributes) {
|
|
52
|
-
DialogPopupDataAttributes[DialogPopupDataAttributes["open"] = popupStateMapping_CommonPopupDataAttributes.open] = "open";
|
|
53
|
-
DialogPopupDataAttributes[DialogPopupDataAttributes["closed"] = popupStateMapping_CommonPopupDataAttributes.closed] = "closed";
|
|
54
|
-
DialogPopupDataAttributes[DialogPopupDataAttributes["startingStyle"] = popupStateMapping_CommonPopupDataAttributes.startingStyle] = "startingStyle";
|
|
55
|
-
DialogPopupDataAttributes[DialogPopupDataAttributes["endingStyle"] = popupStateMapping_CommonPopupDataAttributes.endingStyle] = "endingStyle";
|
|
56
|
-
DialogPopupDataAttributes["nested"] = "data-nested";
|
|
57
|
-
DialogPopupDataAttributes["nestedDialogOpen"] = "data-nested-dialog-open";
|
|
58
|
-
return DialogPopupDataAttributes;
|
|
59
|
-
}({});
|
|
60
|
-
const DialogPopup_stateAttributesMapping = {
|
|
61
|
-
...popupStateMapping,
|
|
62
|
-
...transitionStatusMapping,
|
|
63
|
-
nestedDialogOpen (value) {
|
|
64
|
-
return value ? {
|
|
65
|
-
[DialogPopupDataAttributes_DialogPopupDataAttributes.nestedDialogOpen]: ''
|
|
66
|
-
} : null;
|
|
67
|
-
}
|
|
68
|
-
};
|
|
43
|
+
const nestedDialogs = '--nested-dialogs';
|
|
69
44
|
const DialogPopup_DialogPopup = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
70
45
|
const { render, className, style, finalFocus, initialFocus, ...elementProps } = componentProps;
|
|
71
|
-
const
|
|
46
|
+
const store = useDialogRootContext();
|
|
72
47
|
const descriptionElementId = store.useState("descriptionElementId");
|
|
73
48
|
const disablePointerDismissal = store.useState('disablePointerDismissal');
|
|
74
49
|
const floatingRootContext = store.useState('floatingRootContext');
|
|
@@ -83,7 +58,6 @@ const DialogPopup_DialogPopup = /*#__PURE__*/ __rspack_external_react.forwardRef
|
|
|
83
58
|
const transitionStatus = store.useState('transitionStatus');
|
|
84
59
|
const role = store.useState('role');
|
|
85
60
|
const floatingId = floatingRootContext.useState('floatingId');
|
|
86
|
-
const popupId = elementProps.id ?? floatingId;
|
|
87
61
|
useDialogPortalContext();
|
|
88
62
|
useOpenChangeComplete({
|
|
89
63
|
open,
|
|
@@ -92,11 +66,7 @@ const DialogPopup_DialogPopup = /*#__PURE__*/ __rspack_external_react.forwardRef
|
|
|
92
66
|
if (open) store.context.onOpenChangeComplete?.(true);
|
|
93
67
|
}
|
|
94
68
|
});
|
|
95
|
-
|
|
96
|
-
if ('touch' === interactionType) return store.context.popupRef.current;
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
const resolvedInitialFocus = void 0 === initialFocus ? defaultInitialFocus : initialFocus;
|
|
69
|
+
const resolvedInitialFocus = void 0 === initialFocus ? createDefaultInitialFocus(store.context.popupRef) : initialFocus;
|
|
100
70
|
const nestedDialogOpen = nestedOpenDialogCount > 0;
|
|
101
71
|
const setPopupElement = store.useStateSetter('popupElement');
|
|
102
72
|
const state = {
|
|
@@ -110,9 +80,9 @@ const DialogPopup_DialogPopup = /*#__PURE__*/ __rspack_external_react.forwardRef
|
|
|
110
80
|
props: [
|
|
111
81
|
rootPopupProps,
|
|
112
82
|
{
|
|
113
|
-
id:
|
|
114
|
-
'aria-labelledby': titleElementId
|
|
115
|
-
'aria-describedby': descriptionElementId
|
|
83
|
+
id: floatingId,
|
|
84
|
+
'aria-labelledby': titleElementId,
|
|
85
|
+
'aria-describedby': descriptionElementId,
|
|
116
86
|
role,
|
|
117
87
|
...FOCUSABLE_POPUP_PROPS,
|
|
118
88
|
hidden: !mounted,
|
|
@@ -120,7 +90,7 @@ const DialogPopup_DialogPopup = /*#__PURE__*/ __rspack_external_react.forwardRef
|
|
|
120
90
|
if (COMPOSITE_KEYS.has(event.key)) event.stopPropagation();
|
|
121
91
|
},
|
|
122
92
|
style: {
|
|
123
|
-
[
|
|
93
|
+
[nestedDialogs]: nestedOpenDialogCount
|
|
124
94
|
}
|
|
125
95
|
},
|
|
126
96
|
elementProps
|
|
@@ -130,7 +100,7 @@ const DialogPopup_DialogPopup = /*#__PURE__*/ __rspack_external_react.forwardRef
|
|
|
130
100
|
store.context.popupRef,
|
|
131
101
|
setPopupElement
|
|
132
102
|
],
|
|
133
|
-
stateAttributesMapping:
|
|
103
|
+
stateAttributesMapping: dialogStateAttributesMapping
|
|
134
104
|
});
|
|
135
105
|
return /*#__PURE__*/ jsx(FloatingFocusManager, {
|
|
136
106
|
context: floatingRootContext,
|
package/dist/9576.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useCompositeListContext } from "./5275.js";
|
|
2
|
+
import { useIsoLayoutEffect } from "./3357.js";
|
|
3
|
+
import * as __rspack_external_react from "react";
|
|
4
|
+
function useCompositeListItem(params = {}) {
|
|
5
|
+
const { guess, label, metadata, textRef, index: externalIndex } = params;
|
|
6
|
+
const { register, unregister, subscribeMapChange, nextIndexRef } = useCompositeListContext();
|
|
7
|
+
const indexRef = __rspack_external_react.useRef(-1);
|
|
8
|
+
const [internalIndex, setInternalIndex] = __rspack_external_react.useState(null == externalIndex && guess ? ()=>{
|
|
9
|
+
if (-1 === indexRef.current) {
|
|
10
|
+
const newIndex = nextIndexRef.current;
|
|
11
|
+
nextIndexRef.current += 1;
|
|
12
|
+
indexRef.current = newIndex;
|
|
13
|
+
}
|
|
14
|
+
return indexRef.current;
|
|
15
|
+
} : -1);
|
|
16
|
+
const index = externalIndex ?? internalIndex;
|
|
17
|
+
const componentRef = __rspack_external_react.useRef(null);
|
|
18
|
+
const ref = __rspack_external_react.useCallback((node)=>{
|
|
19
|
+
const previousNode = componentRef.current;
|
|
20
|
+
if (previousNode) unregister(previousNode);
|
|
21
|
+
componentRef.current = node;
|
|
22
|
+
if (node) register(node, {
|
|
23
|
+
metadata: metadata ?? null,
|
|
24
|
+
index: externalIndex ?? null,
|
|
25
|
+
label,
|
|
26
|
+
textRef
|
|
27
|
+
});
|
|
28
|
+
}, [
|
|
29
|
+
externalIndex,
|
|
30
|
+
register,
|
|
31
|
+
unregister,
|
|
32
|
+
metadata,
|
|
33
|
+
label,
|
|
34
|
+
textRef
|
|
35
|
+
]);
|
|
36
|
+
useIsoLayoutEffect(()=>{
|
|
37
|
+
if (null != externalIndex) return;
|
|
38
|
+
return subscribeMapChange((map)=>{
|
|
39
|
+
const i = componentRef.current ? map.get(componentRef.current)?.index : null;
|
|
40
|
+
if (null != i) setInternalIndex(i);
|
|
41
|
+
});
|
|
42
|
+
}, [
|
|
43
|
+
externalIndex,
|
|
44
|
+
subscribeMapChange
|
|
45
|
+
]);
|
|
46
|
+
return {
|
|
47
|
+
ref,
|
|
48
|
+
index
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export { useCompositeListItem };
|
package/dist/{8272.js → 9591.js}
RENAMED
|
@@ -5,6 +5,25 @@ function useRefWithInit(init, initArg) {
|
|
|
5
5
|
if (ref.current === UNINITIALIZED) ref.current = init(initArg);
|
|
6
6
|
return ref;
|
|
7
7
|
}
|
|
8
|
+
let loggedMessages;
|
|
9
|
+
if ('production' !== process.env.NODE_ENV) loggedMessages = new Set();
|
|
10
|
+
function createLogOnce(severity, prefix) {
|
|
11
|
+
return function(...messages) {
|
|
12
|
+
if ('production' !== process.env.NODE_ENV) {
|
|
13
|
+
const message = messages.join(' ');
|
|
14
|
+
const output = prefix ? `${prefix}: ${message}` : message;
|
|
15
|
+
const key = `${severity}:${output}`;
|
|
16
|
+
if (!loggedMessages.has(key)) {
|
|
17
|
+
loggedMessages.add(key);
|
|
18
|
+
if ('warn' === severity) console.warn(output);
|
|
19
|
+
else console.error(output);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function NOOP() {}
|
|
25
|
+
const EMPTY_ARRAY = Object.freeze([]);
|
|
26
|
+
const EMPTY_OBJECT = Object.freeze({});
|
|
8
27
|
function useMergedRefs(a, b, c, d) {
|
|
9
28
|
const forkRef = useRefWithInit(createForkRef).current;
|
|
10
29
|
if (didChange(forkRef, a, b, c, d)) update(forkRef, [
|
|
@@ -82,19 +101,6 @@ function update(forkRef, refs) {
|
|
|
82
101
|
}
|
|
83
102
|
};
|
|
84
103
|
}
|
|
85
|
-
function NOOP() {}
|
|
86
|
-
const EMPTY_ARRAY = Object.freeze([]);
|
|
87
|
-
const EMPTY_OBJECT = Object.freeze({});
|
|
88
|
-
function createFormatErrorMessage(baseUrl, prefix) {
|
|
89
|
-
return function(code, ...args) {
|
|
90
|
-
const url = new URL(baseUrl);
|
|
91
|
-
url.searchParams.set('code', code.toString());
|
|
92
|
-
args.forEach((arg)=>url.searchParams.append('args[]', arg));
|
|
93
|
-
return `${prefix} error #${code}; visit ${url} for the full message.`;
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
const formatErrorMessage_formatErrorMessage = createFormatErrorMessage('https://base-ui.com/production-error', 'Base UI');
|
|
97
|
-
const esm_formatErrorMessage = formatErrorMessage_formatErrorMessage;
|
|
98
104
|
const majorVersion = parseInt(__rspack_external_react.version, 10);
|
|
99
105
|
function isReactVersionAtLeast(reactVersionToCheck) {
|
|
100
106
|
return majorVersion >= reactVersionToCheck;
|
|
@@ -113,17 +119,7 @@ function mergeObjects(a, b) {
|
|
|
113
119
|
...b
|
|
114
120
|
};
|
|
115
121
|
}
|
|
116
|
-
|
|
117
|
-
if ('production' !== process.env.NODE_ENV) set = new Set();
|
|
118
|
-
function warn(...messages) {
|
|
119
|
-
if ('production' !== process.env.NODE_ENV) {
|
|
120
|
-
const messageKey = messages.join(' ');
|
|
121
|
-
if (!set.has(messageKey)) {
|
|
122
|
-
set.add(messageKey);
|
|
123
|
-
console.warn(`Base UI: ${messageKey}`);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
122
|
+
const warn = createLogOnce('warn', 'Base UI');
|
|
127
123
|
function getStateAttributesProps(state, customMapping) {
|
|
128
124
|
const props = {};
|
|
129
125
|
for(const key in state){
|
|
@@ -163,12 +159,12 @@ function mergePropsN(props) {
|
|
|
163
159
|
}
|
|
164
160
|
function createInitialMergedProps(inputProps) {
|
|
165
161
|
if (isPropsGetter(inputProps)) return {
|
|
166
|
-
...
|
|
162
|
+
...inputProps(EMPTY_PROPS)
|
|
167
163
|
};
|
|
168
164
|
return copyInitialProps(inputProps);
|
|
169
165
|
}
|
|
170
166
|
function mergeInto(merged, inputProps) {
|
|
171
|
-
if (isPropsGetter(inputProps)) return
|
|
167
|
+
if (isPropsGetter(inputProps)) return inputProps(merged);
|
|
172
168
|
return mutablyMergeInto(merged, inputProps);
|
|
173
169
|
}
|
|
174
170
|
function copyInitialProps(inputProps) {
|
|
@@ -208,10 +204,6 @@ function isEventHandler(key, value) {
|
|
|
208
204
|
function isPropsGetter(inputProps) {
|
|
209
205
|
return 'function' == typeof inputProps;
|
|
210
206
|
}
|
|
211
|
-
function resolvePropsGetter(inputProps, previousProps) {
|
|
212
|
-
if (isPropsGetter(inputProps)) return inputProps(previousProps);
|
|
213
|
-
return inputProps ?? EMPTY_PROPS;
|
|
214
|
-
}
|
|
215
207
|
function mergeEventHandlers(ourHandler, theirHandler) {
|
|
216
208
|
if (!theirHandler) return ourHandler;
|
|
217
209
|
if (!ourHandler) return wrapEventHandler(theirHandler);
|
|
@@ -254,14 +246,15 @@ function isSyntheticEvent(event) {
|
|
|
254
246
|
return null != event && 'object' == typeof event && 'nativeEvent' in event;
|
|
255
247
|
}
|
|
256
248
|
function useRenderElement(element, componentProps, params = {}) {
|
|
257
|
-
|
|
258
|
-
|
|
249
|
+
let renderProp = componentProps.render;
|
|
250
|
+
if (false !== params.enabled) renderProp = unwrapLazyRenderProp(renderProp);
|
|
251
|
+
const outProps = useRenderElementProps(componentProps, params, renderProp);
|
|
259
252
|
if (false === params.enabled) return null;
|
|
260
253
|
const state = params.state ?? EMPTY_OBJECT;
|
|
261
254
|
return evaluateRenderProp(element, renderProp, outProps, state);
|
|
262
255
|
}
|
|
263
|
-
function useRenderElementProps(componentProps, params
|
|
264
|
-
const { className: classNameProp, style: styleProp
|
|
256
|
+
function useRenderElementProps(componentProps, params, renderProp) {
|
|
257
|
+
const { className: classNameProp, style: styleProp } = componentProps;
|
|
265
258
|
const { state = EMPTY_OBJECT, ref, props, stateAttributesMapping, enabled = true } = params;
|
|
266
259
|
const className = enabled ? resolveClassName(classNameProp, state) : void 0;
|
|
267
260
|
const style = enabled ? resolveStyle(styleProp, state) : void 0;
|
|
@@ -287,6 +280,11 @@ function resolveRenderFunctionProps(props) {
|
|
|
287
280
|
const REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
288
281
|
const COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
|
|
289
282
|
const LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
|
|
283
|
+
function unwrapLazyRenderProp(render) {
|
|
284
|
+
if (render?.$$typeof !== REACT_LAZY_TYPE) return render;
|
|
285
|
+
const unwrapped = __rspack_external_react.Children.toArray(render)[0];
|
|
286
|
+
return /*#__PURE__*/ __rspack_external_react.isValidElement(unwrapped) ? unwrapped : render;
|
|
287
|
+
}
|
|
290
288
|
function evaluateRenderProp(element, render, props, state) {
|
|
291
289
|
if (render) {
|
|
292
290
|
if ('function' == typeof render) {
|
|
@@ -295,20 +293,12 @@ function evaluateRenderProp(element, render, props, state) {
|
|
|
295
293
|
}
|
|
296
294
|
const mergedProps = mergeProps(props, render.props);
|
|
297
295
|
mergedProps.ref = props.ref;
|
|
298
|
-
let newElement = render;
|
|
299
|
-
if (newElement?.$$typeof === REACT_LAZY_TYPE) {
|
|
300
|
-
const children = __rspack_external_react.Children.toArray(render);
|
|
301
|
-
newElement = children[0];
|
|
302
|
-
}
|
|
303
296
|
if ('production' !== process.env.NODE_ENV) {
|
|
304
|
-
if (!/*#__PURE__*/ __rspack_external_react.isValidElement(
|
|
297
|
+
if (!/*#__PURE__*/ __rspack_external_react.isValidElement(render)) throw new Error("Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.\nA valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.\nhttps://base-ui.com/r/invalid-render-prop");
|
|
305
298
|
}
|
|
306
|
-
return /*#__PURE__*/ __rspack_external_react.cloneElement(
|
|
307
|
-
}
|
|
308
|
-
if (element) {
|
|
309
|
-
if ('string' == typeof element) return renderTag(element, props);
|
|
299
|
+
return /*#__PURE__*/ __rspack_external_react.cloneElement(render, mergedProps);
|
|
310
300
|
}
|
|
311
|
-
|
|
301
|
+
return renderTag(element, props);
|
|
312
302
|
}
|
|
313
303
|
function warnIfRenderPropLooksLikeComponent(renderFn) {
|
|
314
304
|
const functionName = renderFn.name;
|
|
@@ -330,4 +320,4 @@ function renderTag(Tag, props) {
|
|
|
330
320
|
});
|
|
331
321
|
return /*#__PURE__*/ __rspack_external_react.createElement(Tag, props);
|
|
332
322
|
}
|
|
333
|
-
export { EMPTY_ARRAY, EMPTY_OBJECT, NOOP,
|
|
323
|
+
export { EMPTY_ARRAY, EMPTY_OBJECT, NOOP, createLogOnce, isReactVersionAtLeast, makeEventPreventable, mergeProps, resolveStyle, unwrapLazyRenderProp, useMergedRefs, useRefWithInit, useRenderElement, warn };
|
package/dist/{6107.js → 9770.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { utils_formatErrorMessage } from "./5473.js";
|
|
2
2
|
import * as __rspack_external_react from "react";
|
|
3
3
|
const ToolbarRootContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
|
|
4
4
|
if ("production" !== process.env.NODE_ENV) ToolbarRootContext.displayName = "ToolbarRootContext";
|
|
5
5
|
function useToolbarRootContext(optional) {
|
|
6
6
|
const context = __rspack_external_react.useContext(ToolbarRootContext);
|
|
7
|
-
if (void 0 === context && !optional) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.' :
|
|
7
|
+
if (void 0 === context && !optional) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.' : utils_formatErrorMessage(69));
|
|
8
8
|
return context;
|
|
9
9
|
}
|
|
10
10
|
export { ToolbarRootContext, useToolbarRootContext };
|
package/dist/{5085.js → 9880.js}
RENAMED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { NOOP } from "./
|
|
1
|
+
import { NOOP } from "./9591.js";
|
|
2
2
|
import * as __rspack_external_react from "react";
|
|
3
3
|
const FormContext = /*#__PURE__*/ __rspack_external_react.createContext({
|
|
4
|
+
elementRef: {
|
|
5
|
+
current: null
|
|
6
|
+
},
|
|
4
7
|
formRef: {
|
|
5
8
|
current: {
|
|
6
9
|
fields: new Map()
|
|
@@ -9,8 +12,8 @@ const FormContext = /*#__PURE__*/ __rspack_external_react.createContext({
|
|
|
9
12
|
errors: {},
|
|
10
13
|
clearErrors: NOOP,
|
|
11
14
|
validationMode: 'onSubmit',
|
|
12
|
-
|
|
13
|
-
current:
|
|
15
|
+
submitCountRef: {
|
|
16
|
+
current: 0
|
|
14
17
|
}
|
|
15
18
|
});
|
|
16
19
|
if ("production" !== process.env.NODE_ENV) FormContext.displayName = "FormContext";
|