@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/{8996.js → 5595.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useRefWithInit } from "./
|
|
2
|
-
import { useOnMount } from "./
|
|
1
|
+
import { useRefWithInit } from "./9591.js";
|
|
2
|
+
import { useOnMount } from "./9120.js";
|
|
3
3
|
const EMPTY = null;
|
|
4
4
|
let LAST_RAF = globalThis.requestAnimationFrame;
|
|
5
5
|
class Scheduler {
|
|
@@ -32,11 +32,12 @@ class Scheduler {
|
|
|
32
32
|
cancel(id) {
|
|
33
33
|
const index = id - this.startId;
|
|
34
34
|
if (index < 0 || index >= this.callbacks.length) return;
|
|
35
|
+
if (null === this.callbacks[index]) return;
|
|
35
36
|
this.callbacks[index] = null;
|
|
36
37
|
this.callbacksCount -= 1;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
+
let scheduler = new Scheduler();
|
|
40
41
|
class AnimationFrame {
|
|
41
42
|
static create() {
|
|
42
43
|
return new AnimationFrame();
|
package/dist/5890.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useFieldRootContext } from "./201.js";
|
|
2
|
+
import { useStableCallback } from "./7488.js";
|
|
3
|
+
import { useIsoLayoutEffect } from "./3357.js";
|
|
4
|
+
function useSetFieldFocused(disabled, focusTargetRef, onFocusedChange) {
|
|
5
|
+
const { setFocused, focusOwnerRef } = useFieldRootContext();
|
|
6
|
+
const setFieldFocused = useStableCallback((focused)=>{
|
|
7
|
+
if (focused ? !disabled : focusOwnerRef.current === setFieldFocused) {
|
|
8
|
+
focusOwnerRef.current = focused && setFieldFocused;
|
|
9
|
+
onFocusedChange?.(focused);
|
|
10
|
+
setFocused(focused);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
useIsoLayoutEffect(()=>{
|
|
14
|
+
const el = focusTargetRef.current;
|
|
15
|
+
const root = el?.getRootNode();
|
|
16
|
+
if (root?.activeElement === el) setFieldFocused(true);
|
|
17
|
+
return ()=>setFieldFocused(false);
|
|
18
|
+
}, [
|
|
19
|
+
disabled,
|
|
20
|
+
focusTargetRef,
|
|
21
|
+
setFieldFocused
|
|
22
|
+
]);
|
|
23
|
+
return setFieldFocused;
|
|
24
|
+
}
|
|
25
|
+
export { useSetFieldFocused };
|
package/dist/{6046.js → 5969.js}
RENAMED
package/dist/5984.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "./4586.js";
|
|
4
|
+
import { isReactVersionAtLeast } from "./9591.js";
|
|
5
|
+
import { useCSPContext } from "./1234.js";
|
|
6
|
+
import * as __rspack_external_react from "react";
|
|
7
|
+
const use_sync_external_store = __webpack_require__("../../node_modules/use-sync-external-store/index.js");
|
|
8
|
+
const emptySubscribe = ()=>()=>{};
|
|
9
|
+
const getTrue = ()=>true;
|
|
10
|
+
const getFalse = ()=>false;
|
|
11
|
+
function useIsHydratedModern() {
|
|
12
|
+
return (0, use_sync_external_store.useSyncExternalStore)(emptySubscribe, getTrue, getFalse);
|
|
13
|
+
}
|
|
14
|
+
function useIsHydratedLegacy() {
|
|
15
|
+
const [hydrated, setHydrated] = __rspack_external_react.useState(false);
|
|
16
|
+
__rspack_external_react.useEffect(()=>{
|
|
17
|
+
setHydrated(true);
|
|
18
|
+
}, []);
|
|
19
|
+
return hydrated;
|
|
20
|
+
}
|
|
21
|
+
const useIsHydrated = isReactVersionAtLeast(18) ? useIsHydratedModern : useIsHydratedLegacy;
|
|
22
|
+
function useIsHydrating() {
|
|
23
|
+
return !useIsHydrated();
|
|
24
|
+
}
|
|
25
|
+
function PrehydrationScript(props) {
|
|
26
|
+
const { script } = props;
|
|
27
|
+
const { nonce } = useCSPContext();
|
|
28
|
+
const isHydrating = useIsHydrating();
|
|
29
|
+
if (!isHydrating) return null;
|
|
30
|
+
return /*#__PURE__*/ jsx("script", {
|
|
31
|
+
nonce: nonce,
|
|
32
|
+
dangerouslySetInnerHTML: {
|
|
33
|
+
__html: script
|
|
34
|
+
},
|
|
35
|
+
suppressHydrationWarning: true
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export { PrehydrationScript, useIsHydrating };
|
package/dist/{8527.js → 6006.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { error } from "./
|
|
1
|
+
import { error } from "./4293.js";
|
|
2
2
|
import * as __rspack_external_react from "react";
|
|
3
3
|
function useControlled({ controlled, default: defaultProp, name, state = 'value' }) {
|
|
4
4
|
const { current: isControlled } = __rspack_external_react.useRef(void 0 !== controlled);
|
|
5
|
-
const [valueState, setValue] = __rspack_external_react.useState(defaultProp);
|
|
6
|
-
const value = isControlled ? controlled : valueState;
|
|
5
|
+
const [valueState, setValue] = __rspack_external_react.useState(()=>defaultProp);
|
|
6
|
+
const value = isControlled && void 0 !== controlled ? controlled : valueState;
|
|
7
7
|
if ('production' !== process.env.NODE_ENV) {
|
|
8
8
|
__rspack_external_react.useEffect(()=>{
|
|
9
9
|
if (isControlled !== (void 0 !== controlled)) error([
|
package/dist/6040.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
2
|
+
import "./4586.js";
|
|
3
|
+
import { NOOP } from "./9591.js";
|
|
4
|
+
import { AnimationFrame } from "./5595.js";
|
|
5
|
+
import { utils_formatErrorMessage } from "./5473.js";
|
|
6
|
+
import { createChangeEventDetails } from "./8495.js";
|
|
7
|
+
import { imperativeAction } from "./9837.js";
|
|
8
|
+
import * as __rspack_external_react from "react";
|
|
9
|
+
const use_sync_external_store = __webpack_require__("../../node_modules/use-sync-external-store/index.js");
|
|
10
|
+
function usePopupHandleStore(handle) {
|
|
11
|
+
const subscribe = __rspack_external_react.useCallback((listener)=>{
|
|
12
|
+
if (void 0 === handle) return NOOP;
|
|
13
|
+
return handle.subscribeStore(listener);
|
|
14
|
+
}, [
|
|
15
|
+
handle
|
|
16
|
+
]);
|
|
17
|
+
const getSnapshot = __rspack_external_react.useCallback(()=>void 0 === handle ? void 0 : handle.store, [
|
|
18
|
+
handle
|
|
19
|
+
]);
|
|
20
|
+
return (0, use_sync_external_store.useSyncExternalStore)(subscribe, getSnapshot, ()=>handle?.serverStore);
|
|
21
|
+
}
|
|
22
|
+
class BasePopupHandle {
|
|
23
|
+
attachedStores = [];
|
|
24
|
+
attachedStoreValue = null;
|
|
25
|
+
storeListeners = new Set();
|
|
26
|
+
constructor(fallbackStore, componentName, throwOnMissingTrigger = true){
|
|
27
|
+
this.fallbackStore = fallbackStore;
|
|
28
|
+
this.componentName = componentName;
|
|
29
|
+
this.throwOnMissingTrigger = throwOnMissingTrigger;
|
|
30
|
+
}
|
|
31
|
+
get attachedStore() {
|
|
32
|
+
return this.attachedStoreValue;
|
|
33
|
+
}
|
|
34
|
+
get store() {
|
|
35
|
+
return this.attachedStoreValue ?? this.fallbackStore;
|
|
36
|
+
}
|
|
37
|
+
get serverStore() {
|
|
38
|
+
return this.fallbackStore;
|
|
39
|
+
}
|
|
40
|
+
subscribeStore(listener) {
|
|
41
|
+
this.storeListeners.add(listener);
|
|
42
|
+
return ()=>{
|
|
43
|
+
this.storeListeners.delete(listener);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
attachStore(newStore) {
|
|
47
|
+
this.attachedStores.push(newStore);
|
|
48
|
+
this.setActiveStore(newStore);
|
|
49
|
+
if ('production' !== process.env.NODE_ENV) {
|
|
50
|
+
if (this.attachedStores.length > 1) {
|
|
51
|
+
const dev = this;
|
|
52
|
+
(dev.overlapWarningFrame ??= AnimationFrame.create()).request(()=>{
|
|
53
|
+
if (this.attachedStores.length > 1) console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle.");
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return ()=>{
|
|
58
|
+
const index = this.attachedStores.lastIndexOf(newStore);
|
|
59
|
+
if (-1 !== index) this.attachedStores.splice(index, 1);
|
|
60
|
+
this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
setActiveStore(store) {
|
|
64
|
+
if (this.attachedStoreValue !== store) {
|
|
65
|
+
this.attachedStoreValue = store;
|
|
66
|
+
this.storeListeners.forEach((listener)=>{
|
|
67
|
+
listener();
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
openByTrigger(triggerId) {
|
|
72
|
+
const attachedStore = this.attachedStore;
|
|
73
|
+
if (null === attachedStore) {
|
|
74
|
+
if ('production' !== process.env.NODE_ENV) console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
let triggerElement;
|
|
78
|
+
if (triggerId) {
|
|
79
|
+
for(let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1)triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);
|
|
80
|
+
triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);
|
|
81
|
+
}
|
|
82
|
+
if (triggerId && !triggerElement) {
|
|
83
|
+
if (this.throwOnMissingTrigger) throw new Error("production" !== process.env.NODE_ENV ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : utils_formatErrorMessage(99, this.componentName, triggerId, this.componentName));
|
|
84
|
+
if ('production' !== process.env.NODE_ENV) console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". The popup will open, but the trigger will not be associated with it.`);
|
|
85
|
+
}
|
|
86
|
+
attachedStore.setOpen(true, createChangeEventDetails(imperativeAction, void 0, triggerElement));
|
|
87
|
+
}
|
|
88
|
+
closePopup() {
|
|
89
|
+
const attachedStore = this.attachedStore;
|
|
90
|
+
if (null === attachedStore) {
|
|
91
|
+
if ('production' !== process.env.NODE_ENV) console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
attachedStore.setOpen(false, createChangeEventDetails(imperativeAction));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export { BasePopupHandle, usePopupHandleStore };
|
package/dist/{8758.js → 6137.js}
RENAMED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { isElement, isHTMLElement } from "./3829.js";
|
|
2
|
-
import { contains } from "./
|
|
3
|
-
import { TYPEABLE_SELECTOR, FOCUSABLE_ATTRIBUTE } from "./
|
|
4
|
-
|
|
2
|
+
import { closest, contains } from "./4155.js";
|
|
3
|
+
import { TYPEABLE_SELECTOR, FOCUSABLE_ATTRIBUTE, jsdom } from "./5490.js";
|
|
4
|
+
const popupOpen = 'data-popup-open';
|
|
5
|
+
const pressed = 'data-pressed';
|
|
6
|
+
const triggerDisabled = 'data-trigger-disabled';
|
|
5
7
|
function isTargetInsideEnabledTrigger(target, triggerElements) {
|
|
6
8
|
if (!isElement(target)) return false;
|
|
7
9
|
const targetElement = target;
|
|
8
|
-
if (triggerElements.hasElement(targetElement)) return !targetElement.hasAttribute(
|
|
9
|
-
for (const [, trigger] of triggerElements.entries())if (contains(trigger, targetElement)) return !trigger.hasAttribute(
|
|
10
|
+
if (triggerElements.hasElement(targetElement)) return !targetElement.hasAttribute(triggerDisabled);
|
|
11
|
+
for (const [, trigger] of triggerElements.entries())if (contains(trigger, targetElement)) return !trigger.hasAttribute(triggerDisabled);
|
|
10
12
|
return false;
|
|
11
13
|
}
|
|
12
14
|
function isEventTargetWithin(event, node) {
|
|
@@ -22,14 +24,14 @@ function isTypeableElement(element) {
|
|
|
22
24
|
return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
|
|
23
25
|
}
|
|
24
26
|
function isInteractiveElement(element) {
|
|
25
|
-
return
|
|
27
|
+
return null != closest(element, `button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`);
|
|
26
28
|
}
|
|
27
29
|
function isTypeableCombobox(element) {
|
|
28
30
|
if (!element) return false;
|
|
29
31
|
return 'combobox' === element.getAttribute('role') && isTypeableElement(element);
|
|
30
32
|
}
|
|
31
33
|
function matchesFocusVisible(element) {
|
|
32
|
-
if (!element ||
|
|
34
|
+
if (!element || jsdom) return true;
|
|
33
35
|
try {
|
|
34
36
|
return element.matches(':focus-visible');
|
|
35
37
|
} catch (_e) {
|
|
@@ -40,4 +42,4 @@ function getFloatingFocusElement(floatingElement) {
|
|
|
40
42
|
if (!floatingElement) return null;
|
|
41
43
|
return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;
|
|
42
44
|
}
|
|
43
|
-
export { getFloatingFocusElement, isEventTargetWithin, isInteractiveElement, isRootElement, isTargetInsideEnabledTrigger, isTypeableCombobox, isTypeableElement, matchesFocusVisible };
|
|
45
|
+
export { getFloatingFocusElement, isEventTargetWithin, isInteractiveElement, isRootElement, isTargetInsideEnabledTrigger, isTypeableCombobox, isTypeableElement, matchesFocusVisible, popupOpen, pressed, triggerDisabled };
|
package/dist/{4281.js → 6140.js}
RENAMED
|
@@ -1,30 +1,38 @@
|
|
|
1
|
-
import { useFieldRootContext } from "./
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true) {
|
|
1
|
+
import { useFieldRootContext } from "./201.js";
|
|
2
|
+
import { useRefWithInit } from "./9591.js";
|
|
3
|
+
import { useIsoLayoutEffect } from "./3357.js";
|
|
4
|
+
function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {
|
|
5
5
|
const { registerFieldControl } = useFieldRootContext();
|
|
6
|
-
const sourceRef =
|
|
7
|
-
if (!sourceRef.current) sourceRef.current = Symbol();
|
|
6
|
+
const sourceRef = useRefWithInit(()=>Symbol());
|
|
8
7
|
useIsoLayoutEffect(()=>{
|
|
9
8
|
const source = sourceRef.current;
|
|
10
|
-
if (!source
|
|
9
|
+
if (!enabled) return void registerFieldControl(source, void 0);
|
|
11
10
|
const registration = {
|
|
12
11
|
controlRef,
|
|
13
12
|
getValue: getFormValueOverride,
|
|
14
13
|
id,
|
|
14
|
+
name,
|
|
15
15
|
value
|
|
16
16
|
};
|
|
17
17
|
registerFieldControl(source, registration);
|
|
18
|
-
return ()=>{
|
|
19
|
-
registerFieldControl(source, void 0);
|
|
20
|
-
};
|
|
21
18
|
}, [
|
|
22
19
|
controlRef,
|
|
23
20
|
enabled,
|
|
24
21
|
getFormValueOverride,
|
|
25
22
|
id,
|
|
23
|
+
name,
|
|
26
24
|
registerFieldControl,
|
|
25
|
+
sourceRef,
|
|
27
26
|
value
|
|
28
27
|
]);
|
|
28
|
+
useIsoLayoutEffect(()=>{
|
|
29
|
+
const source = sourceRef.current;
|
|
30
|
+
return ()=>{
|
|
31
|
+
registerFieldControl(source, void 0);
|
|
32
|
+
};
|
|
33
|
+
}, [
|
|
34
|
+
registerFieldControl,
|
|
35
|
+
sourceRef
|
|
36
|
+
]);
|
|
29
37
|
}
|
|
30
38
|
export { useRegisterFieldControl };
|
package/dist/{8960.js → 6191.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useFloatingPortalNode } from "./
|
|
2
|
+
import { useFloatingPortalNode } from "./3398.js";
|
|
3
3
|
import * as __rspack_external_react from "react";
|
|
4
4
|
import * as __rspack_external_react_dom_7136dc57 from "react-dom";
|
|
5
5
|
const FloatingPortalLite_FloatingPortalLite = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
6
6
|
const { children, container, className, render, style, ...elementProps } = componentProps;
|
|
7
|
-
const { portalNode, portalSubtree } = useFloatingPortalNode({
|
|
7
|
+
const { node: portalNode, subtree: portalSubtree } = useFloatingPortalNode({
|
|
8
8
|
container,
|
|
9
9
|
ref: forwardedRef,
|
|
10
10
|
componentProps,
|
package/dist/6240.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { useLabelableContext, useFieldRootContext, fieldValidityMapping } from "./201.js";
|
|
2
|
+
import { useFormContext } from "./9880.js";
|
|
3
|
+
import { useLabelableId } from "./6551.js";
|
|
4
|
+
import { useStableCallback } from "./7488.js";
|
|
5
|
+
import { useRegisterFieldControl } from "./6140.js";
|
|
6
|
+
import { useIsoLayoutEffect } from "./3357.js";
|
|
7
|
+
import { useValueChanged } from "./9252.js";
|
|
8
|
+
import { useSetFieldFocused } from "./5890.js";
|
|
9
|
+
import { useTimeout } from "./9197.js";
|
|
10
|
+
import { useRenderElement } from "./9591.js";
|
|
11
|
+
import { createChangeEventDetails } from "./8495.js";
|
|
12
|
+
import * as __rspack_external_react from "react";
|
|
13
|
+
const FieldControl_FieldControl = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
14
|
+
const { render, className, id: idProp, name: nameProp, value, disabled: disabledProp = false, onValueChange, defaultValue, autoFocus = false, style, ...elementProps } = componentProps;
|
|
15
|
+
const { state: fieldState, name: fieldName, disabled: fieldDisabled, setTouched, setDirty, validityData, setFilled, validationMode, validation } = useFieldRootContext();
|
|
16
|
+
const { clearErrors, elementRef: formElementRef, submitCountRef } = useFormContext();
|
|
17
|
+
const disabled = fieldDisabled || disabledProp;
|
|
18
|
+
const name = fieldName ?? nameProp;
|
|
19
|
+
const state = {
|
|
20
|
+
...fieldState,
|
|
21
|
+
disabled
|
|
22
|
+
};
|
|
23
|
+
const { labelId } = useLabelableContext();
|
|
24
|
+
const id = useLabelableId({
|
|
25
|
+
id: idProp
|
|
26
|
+
});
|
|
27
|
+
const isControlled = void 0 !== value;
|
|
28
|
+
const serializedValue = null == value ? void 0 : String(value);
|
|
29
|
+
const getValueFromInput = useStableCallback(()=>validation.inputRef.current?.value);
|
|
30
|
+
useRegisterFieldControl(validation.inputRef, id, serializedValue, getValueFromInput, !disabled, nameProp);
|
|
31
|
+
useIsoLayoutEffect(()=>{
|
|
32
|
+
const currentValue = serializedValue ?? validation.inputRef.current?.value;
|
|
33
|
+
if (void 0 !== currentValue) setFilled('' !== currentValue);
|
|
34
|
+
}, [
|
|
35
|
+
serializedValue,
|
|
36
|
+
defaultValue,
|
|
37
|
+
validation.inputRef,
|
|
38
|
+
setFilled
|
|
39
|
+
]);
|
|
40
|
+
useValueChanged(serializedValue, ()=>{
|
|
41
|
+
if (void 0 === serializedValue) return;
|
|
42
|
+
clearErrors(name);
|
|
43
|
+
setDirty(serializedValue !== (validityData.initialValue ?? ''));
|
|
44
|
+
validation.change(serializedValue);
|
|
45
|
+
});
|
|
46
|
+
const inputRef = __rspack_external_react.useRef(null);
|
|
47
|
+
const setFocused = useSetFieldFocused(disabled, inputRef);
|
|
48
|
+
const enterValidationTimeout = useTimeout();
|
|
49
|
+
const element = useRenderElement('input', componentProps, {
|
|
50
|
+
ref: [
|
|
51
|
+
forwardedRef,
|
|
52
|
+
inputRef
|
|
53
|
+
],
|
|
54
|
+
state,
|
|
55
|
+
props: [
|
|
56
|
+
{
|
|
57
|
+
id,
|
|
58
|
+
disabled,
|
|
59
|
+
name,
|
|
60
|
+
ref: validation.inputRef,
|
|
61
|
+
'aria-labelledby': labelId,
|
|
62
|
+
autoFocus,
|
|
63
|
+
...isControlled ? {
|
|
64
|
+
value
|
|
65
|
+
} : {
|
|
66
|
+
defaultValue
|
|
67
|
+
},
|
|
68
|
+
onChange (event) {
|
|
69
|
+
const inputValue = event.currentTarget.value;
|
|
70
|
+
const details = createChangeEventDetails("none", event.nativeEvent);
|
|
71
|
+
onValueChange?.(inputValue, details);
|
|
72
|
+
if (isControlled) return;
|
|
73
|
+
setDirty(inputValue !== (validityData.initialValue ?? ''));
|
|
74
|
+
setFilled('' !== inputValue);
|
|
75
|
+
if (!event.nativeEvent.defaultPrevented && !details.isCanceled) {
|
|
76
|
+
clearErrors(name);
|
|
77
|
+
validation.change(inputValue);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
onFocus () {
|
|
81
|
+
setFocused(true);
|
|
82
|
+
},
|
|
83
|
+
onBlur (event) {
|
|
84
|
+
setTouched(true);
|
|
85
|
+
setFocused(false);
|
|
86
|
+
if ('onBlur' === validationMode) {
|
|
87
|
+
const inputValue = event.currentTarget.value;
|
|
88
|
+
validation.commit(inputValue);
|
|
89
|
+
if (isControlled) queueMicrotask(()=>{
|
|
90
|
+
const nextValue = validation.inputRef.current?.value;
|
|
91
|
+
if (void 0 !== nextValue && nextValue !== inputValue && nextValue !== (validityData.initialValue ?? '')) validation.commit(nextValue);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
onKeyDown (event) {
|
|
96
|
+
if ('INPUT' === event.currentTarget.tagName && 'Enter' === event.key) {
|
|
97
|
+
setTouched(true);
|
|
98
|
+
const value = event.currentTarget.value;
|
|
99
|
+
const form = event.currentTarget.form;
|
|
100
|
+
if (form && form === formElementRef.current && !event.defaultPrevented) {
|
|
101
|
+
const input = event.currentTarget;
|
|
102
|
+
const submitCount = submitCountRef.current;
|
|
103
|
+
enterValidationTimeout.start(0, ()=>{
|
|
104
|
+
if (submitCountRef.current === submitCount) validation.commit(input.value);
|
|
105
|
+
});
|
|
106
|
+
} else validation.commit(value);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
elementProps,
|
|
111
|
+
(props)=>validation.getValidationProps(disabled, props)
|
|
112
|
+
],
|
|
113
|
+
stateAttributesMapping: fieldValidityMapping
|
|
114
|
+
});
|
|
115
|
+
return element;
|
|
116
|
+
});
|
|
117
|
+
if ("production" !== process.env.NODE_ENV) FieldControl_FieldControl.displayName = "FieldControl";
|
|
118
|
+
const Input_module = {
|
|
119
|
+
root: "root-Y7wYn3"
|
|
120
|
+
};
|
|
121
|
+
export { FieldControl_FieldControl, Input_module };
|
package/dist/{4490.js → 6373.js}
RENAMED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { useBaseUiId } from "./
|
|
2
|
-
import { useIsoLayoutEffect } from "./
|
|
1
|
+
import { useBaseUiId } from "./5969.js";
|
|
2
|
+
import { useIsoLayoutEffect } from "./3357.js";
|
|
3
3
|
import * as __rspack_external_react from "react";
|
|
4
|
-
function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {
|
|
4
|
+
function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId, ariaLabel) {
|
|
5
5
|
const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = __rspack_external_react.useState();
|
|
6
6
|
const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : void 0);
|
|
7
|
-
const
|
|
7
|
+
const hasAriaLabel = Boolean(ariaLabel?.trim());
|
|
8
|
+
const implicitLabelId = hasAriaLabel ? void 0 : labelId;
|
|
9
|
+
const ariaLabelledBy = explicitAriaLabelledBy ?? implicitLabelId ?? fallbackAriaLabelledBy;
|
|
8
10
|
useIsoLayoutEffect(()=>{
|
|
9
|
-
const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || !enableFallback ? void 0 : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);
|
|
11
|
+
const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || hasAriaLabel || !enableFallback ? void 0 : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);
|
|
10
12
|
if (fallbackAriaLabelledBy !== nextAriaLabelledBy) setFallbackAriaLabelledBy(nextAriaLabelledBy);
|
|
11
13
|
});
|
|
12
14
|
return ariaLabelledBy;
|
package/dist/{904.js → 6487.js}
RENAMED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { mac } from "./2221.js";
|
|
2
|
+
import { webkit } from "./3189.js";
|
|
3
|
+
import { useTimeout } from "./9197.js";
|
|
3
4
|
import { getWindow, isHTMLElement, isElement } from "./3829.js";
|
|
4
|
-
import { getTarget, contains, activeElement } from "./
|
|
5
|
-
import { ownerDocument } from "./
|
|
6
|
-
import { mergeCleanups } from "./
|
|
7
|
-
import { addEventListener } from "./
|
|
8
|
-
import { triggerPress, triggerFocus, escapeKey } from "./
|
|
9
|
-
import { matchesFocusVisible, isTypeableElement, isTargetInsideEnabledTrigger } from "./
|
|
10
|
-
import { createChangeEventDetails } from "./
|
|
11
|
-
import { createAttribute } from "./
|
|
5
|
+
import { getTarget, contains, activeElement } from "./4155.js";
|
|
6
|
+
import { ownerDocument } from "./6488.js";
|
|
7
|
+
import { mergeCleanups } from "./7718.js";
|
|
8
|
+
import { addEventListener } from "./1282.js";
|
|
9
|
+
import { triggerPress, triggerFocus, escapeKey } from "./9837.js";
|
|
10
|
+
import { matchesFocusVisible, isTypeableElement, isTargetInsideEnabledTrigger } from "./6137.js";
|
|
11
|
+
import { createChangeEventDetails } from "./8495.js";
|
|
12
|
+
import { createAttribute } from "./226.js";
|
|
12
13
|
import * as __rspack_external_react from "react";
|
|
13
|
-
const isMacSafari =
|
|
14
|
-
function useFocus(
|
|
14
|
+
const isMacSafari = mac && webkit;
|
|
15
|
+
function useFocus(store, props = {}) {
|
|
15
16
|
const { enabled = true, delay } = props;
|
|
16
|
-
const store = 'rootStore' in context ? context.rootStore : context;
|
|
17
17
|
const { events, dataRef } = store.context;
|
|
18
18
|
const blockFocusRef = __rspack_external_react.useRef(false);
|
|
19
19
|
const blockedReferenceRef = __rspack_external_react.useRef(null);
|
|
@@ -25,7 +25,10 @@ function useFocus(context, props = {}) {
|
|
|
25
25
|
const win = getWindow(domReference);
|
|
26
26
|
function onBlur() {
|
|
27
27
|
const currentDomReference = store.select('domReferenceElement');
|
|
28
|
-
if (!store.select('open') && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference)))
|
|
28
|
+
if (!store.select('open') && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) {
|
|
29
|
+
blockFocusRef.current = true;
|
|
30
|
+
blockedReferenceRef.current = currentDomReference;
|
|
31
|
+
}
|
|
29
32
|
}
|
|
30
33
|
function onKeyDown() {
|
|
31
34
|
keyboardModalityRef.current = true;
|
|
@@ -81,9 +84,8 @@ function useFocus(context, props = {}) {
|
|
|
81
84
|
}
|
|
82
85
|
const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements);
|
|
83
86
|
const { nativeEvent, currentTarget } = event;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
timeout.start(delayValue, ()=>{
|
|
87
|
+
if (store.select('open') && movedFromOtherEnabledTrigger || !delay) return void store.setOpen(true, createChangeEventDetails(triggerFocus, nativeEvent, currentTarget));
|
|
88
|
+
timeout.start(delay, ()=>{
|
|
87
89
|
if (blockFocusRef.current) return;
|
|
88
90
|
store.setOpen(true, createChangeEventDetails(triggerFocus, nativeEvent, currentTarget));
|
|
89
91
|
});
|
package/dist/{9635.js → 6498.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRenderElement } from "./
|
|
1
|
+
import { useRenderElement } from "./9591.js";
|
|
2
2
|
import * as __rspack_external_react from "react";
|
|
3
3
|
const Separator = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
4
4
|
const { className, render, orientation = 'horizontal', style, ...elementProps } = componentProps;
|
package/dist/6499.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
const noop = ()=>{};
|
|
6
|
-
const useIsoLayoutEffect = "u" > typeof document ? __rspack_external_react.useLayoutEffect : noop;
|
|
7
|
-
export { SafeReact, useIsoLayoutEffect };
|
|
1
|
+
function isElementDisabled(element) {
|
|
2
|
+
return null == element || element.hasAttribute('disabled') || 'true' === element.getAttribute('aria-disabled');
|
|
3
|
+
}
|
|
4
|
+
export { isElementDisabled };
|
package/dist/6508.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as __rspack_external_react from "react";
|
|
2
|
+
const ToolbarGroupContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
|
|
3
|
+
if ("production" !== process.env.NODE_ENV) ToolbarGroupContext.displayName = "ToolbarGroupContext";
|
|
4
|
+
function useToolbarGroupContext() {
|
|
5
|
+
return __rspack_external_react.useContext(ToolbarGroupContext);
|
|
6
|
+
}
|
|
7
|
+
export { ToolbarGroupContext, useToolbarGroupContext };
|
package/dist/{8225.js → 6540.js}
RENAMED
package/dist/6551.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useLabelableContext } from "./201.js";
|
|
2
|
+
import { useBaseUiId } from "./5969.js";
|
|
3
|
+
import { useRefWithInit, NOOP } from "./9591.js";
|
|
4
|
+
import { useStableCallback } from "./7488.js";
|
|
5
|
+
import { useIsoLayoutEffect } from "./3357.js";
|
|
6
|
+
import * as __rspack_external_react from "react";
|
|
7
|
+
function useLabelableId(params = {}) {
|
|
8
|
+
const { id, enabled = true } = params;
|
|
9
|
+
const { controlId, registerControlId, resetControlId } = useLabelableContext();
|
|
10
|
+
const defaultId = useBaseUiId();
|
|
11
|
+
const controlSourceRef = useRefWithInit(()=>Symbol());
|
|
12
|
+
const hasRegisteredRef = __rspack_external_react.useRef(false);
|
|
13
|
+
const hadExplicitIdRef = __rspack_external_react.useRef(false);
|
|
14
|
+
const unregisterControlId = useStableCallback(()=>{
|
|
15
|
+
if (!hasRegisteredRef.current || registerControlId === NOOP) return;
|
|
16
|
+
hasRegisteredRef.current = false;
|
|
17
|
+
registerControlId(controlSourceRef.current, void 0);
|
|
18
|
+
});
|
|
19
|
+
useIsoLayoutEffect(()=>{
|
|
20
|
+
if (!enabled || registerControlId === NOOP) return void unregisterControlId();
|
|
21
|
+
let nextId;
|
|
22
|
+
if (void 0 !== id) {
|
|
23
|
+
hadExplicitIdRef.current = true;
|
|
24
|
+
nextId = id;
|
|
25
|
+
} else {
|
|
26
|
+
if (!hadExplicitIdRef.current) return void resetControlId();
|
|
27
|
+
nextId = defaultId;
|
|
28
|
+
}
|
|
29
|
+
if (void 0 === nextId) return void unregisterControlId();
|
|
30
|
+
hasRegisteredRef.current = true;
|
|
31
|
+
registerControlId(controlSourceRef.current, nextId);
|
|
32
|
+
}, [
|
|
33
|
+
id,
|
|
34
|
+
enabled,
|
|
35
|
+
registerControlId,
|
|
36
|
+
resetControlId,
|
|
37
|
+
defaultId,
|
|
38
|
+
controlSourceRef,
|
|
39
|
+
unregisterControlId
|
|
40
|
+
]);
|
|
41
|
+
useIsoLayoutEffect(()=>unregisterControlId, [
|
|
42
|
+
unregisterControlId
|
|
43
|
+
]);
|
|
44
|
+
return (enabled ? controlId : void 0) ?? id ?? defaultId;
|
|
45
|
+
}
|
|
46
|
+
export { useLabelableId };
|