@redis-ui/components 47.3.3 → 47.5.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/AppSelectionMenu/components/Compose/Compose.cjs +1 -1
- package/dist/AppSelectionMenu/components/Compose/Compose.js +1 -1
- package/dist/BoxSelectionGroup/hooks/useBoxSelectionGroup.cjs +1 -1
- package/dist/BoxSelectionGroup/hooks/useBoxSelectionGroup.js +1 -1
- package/dist/Checkbox/components/Compose/Compose.cjs +1 -1
- package/dist/Checkbox/components/Compose/Compose.js +1 -1
- package/dist/Checkbox/components/Indicator/Indicator.style.cjs +2 -2
- package/dist/Checkbox/components/Indicator/Indicator.style.js +3 -3
- package/dist/Drawer/components/Description/Description.cjs +1 -1
- package/dist/Drawer/components/Description/Description.js +1 -1
- package/dist/Drawer/components/Header/components/Title/Title.cjs +1 -1
- package/dist/Drawer/components/Header/components/Title/Title.js +1 -1
- package/dist/Inputs/PasswordInput/components/PasswordInput.context.cjs +1 -1
- package/dist/Inputs/PasswordInput/components/PasswordInput.context.js +1 -1
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.cjs +1 -1
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.js +1 -1
- package/dist/Inputs/components/Context/InputValue.context.d.ts +1 -1
- package/dist/Inputs/components/Context/InputValueProvider.cjs +1 -1
- package/dist/Inputs/components/Context/InputValueProvider.js +1 -1
- package/dist/Inputs/components/Context/NumericInputValueProvider.cjs +1 -1
- package/dist/Inputs/components/Context/NumericInputValueProvider.js +1 -1
- package/dist/Inputs/components/InputTag/InputTag.cjs +1 -1
- package/dist/Inputs/components/InputTag/InputTag.js +1 -1
- package/dist/Loader/Loader.cjs +1 -1
- package/dist/Loader/Loader.js +1 -1
- package/dist/Modal/components/Content/components/Description/Description.cjs +1 -1
- package/dist/Modal/components/Content/components/Description/Description.js +1 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.cjs +1 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.js +1 -1
- package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.cjs +1 -1
- package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.d.ts +1 -1
- package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.js +1 -1
- package/dist/MultiSelect/components/Content/components/SelectAll/SelectAll.cjs +11 -7
- package/dist/MultiSelect/components/Content/components/SelectAll/SelectAll.js +12 -8
- package/dist/RadioGroup/components/Compose/Compose.cjs +2 -2
- package/dist/RadioGroup/components/Compose/Compose.js +2 -2
- package/dist/ScreenReaderAnnounce/ScreenReaderAnnounce.cjs +1 -1
- package/dist/ScreenReaderAnnounce/ScreenReaderAnnounce.js +1 -1
- package/dist/Section/components/Compose/Compose.cjs +1 -1
- package/dist/Section/components/Compose/Compose.js +1 -1
- package/dist/Section/components/Header/components/CollapseButton/CollapseButton.cjs +1 -1
- package/dist/Section/components/Header/components/CollapseButton/CollapseButton.js +1 -1
- package/dist/Select/components/Context/hooks/useSelectContextApi.d.ts +1 -1
- package/dist/Select/components/Trigger/components/Compose/Compose.cjs +1 -1
- package/dist/Select/components/Trigger/components/Compose/Compose.js +1 -1
- package/dist/Slider/components/Compose/Compose.cjs +1 -1
- package/dist/Slider/components/Compose/Compose.js +1 -1
- package/dist/Switch/components/Compose/Compose.cjs +1 -1
- package/dist/Switch/components/Compose/Compose.js +1 -1
- package/dist/Toast/Toaster.style.cjs +2 -2
- package/dist/Toast/Toaster.style.js +2 -2
- package/dist/Toast/core/mapping.helpers.cjs +1 -1
- package/dist/Toast/core/mapping.helpers.js +1 -1
- package/dist/Typography/hooks/useEllipsisTooltip.d.ts +1 -1
- package/dist/node_modules/@radix-ui/primitive/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.cjs +108 -62
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +108 -62
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.cjs +5 -4
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +5 -4
- package/dist/node_modules/@radix-ui/react-collection/dist/index.cjs +4 -2
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +5 -3
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +16 -2
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +16 -2
- package/dist/node_modules/@radix-ui/react-context/dist/index.cjs +8 -8
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.cjs +6 -4
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +6 -4
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs +4 -3
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +4 -3
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +4 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +4 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-menu/dist/index.cjs +8 -5
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +8 -5
- package/dist/node_modules/@radix-ui/react-popover/dist/index.cjs +6 -4
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +6 -4
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +4 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +4 -1
- package/dist/node_modules/@radix-ui/react-presence/dist/index.cjs +16 -6
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +16 -5
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs +3 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +3 -1
- package/dist/node_modules/@radix-ui/react-progress/dist/index.cjs +2 -2
- package/dist/node_modules/@radix-ui/react-progress/dist/index.js +2 -2
- package/dist/node_modules/@radix-ui/{react-slider → react-progress}/node_modules/@radix-ui/react-context/dist/index.cjs +2 -1
- package/dist/node_modules/@radix-ui/{react-switch → react-progress}/node_modules/@radix-ui/react-context/dist/index.js +2 -1
- package/dist/node_modules/@radix-ui/{react-slider → react-progress}/node_modules/@radix-ui/react-primitive/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/{react-switch → react-progress}/node_modules/@radix-ui/react-primitive/dist/index.js +4 -2
- package/dist/node_modules/@radix-ui/{react-slider → react-progress}/node_modules/@radix-ui/react-slot/dist/index.cjs +14 -4
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-slot/dist/index.js +97 -0
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.cjs +16 -11
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +16 -11
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +11 -6
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +11 -6
- package/dist/node_modules/@radix-ui/react-select/dist/index.cjs +56 -35
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +57 -36
- package/dist/node_modules/@radix-ui/react-slider/dist/index.cjs +35 -35
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +10 -10
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +55 -39
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +54 -38
- package/dist/node_modules/@radix-ui/react-switch/dist/index.cjs +27 -23
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +17 -13
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.cjs +2 -1
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +2 -1
- package/dist/node_modules/@radix-ui/react-toggle/dist/index.cjs +4 -3
- package/dist/node_modules/@radix-ui/react-toggle/dist/index.js +4 -3
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs +33 -17
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +33 -17
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +29 -16
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +29 -16
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +14 -11
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +14 -11
- package/dist/node_modules/@tanstack/hotkeys/dist/constants.cjs +389 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/constants.js +383 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/format.cjs +22 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/format.js +22 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.cjs +363 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.js +363 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.cjs +111 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.js +107 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/match.cjs +59 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/match.js +59 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/parse.cjs +143 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/parse.js +141 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.cjs +10 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.js +8 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs +121 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.js +120 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.cjs +9 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.js +9 -0
- package/dist/node_modules/@tanstack/store/dist/alien.cjs +183 -0
- package/dist/node_modules/@tanstack/store/dist/alien.js +182 -0
- package/dist/node_modules/@tanstack/store/dist/atom.cjs +161 -0
- package/dist/node_modules/@tanstack/store/dist/atom.js +160 -0
- package/dist/node_modules/@tanstack/store/dist/store.cjs +25 -0
- package/dist/node_modules/@tanstack/store/dist/store.js +25 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +8 -2
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +8 -2
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.cjs +3 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +3 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +4 -2
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +4 -2
- package/dist/{node_modules/@radix-ui/react-switch → packages/components}/node_modules/@radix-ui/react-primitive/dist/index.cjs +5 -3
- package/dist/{node_modules/@radix-ui/react-slider → packages/components}/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
- package/dist/packages/components/node_modules/@radix-ui/react-slot/dist/index.cjs +99 -0
- package/dist/{node_modules/@radix-ui/react-slider → packages/components}/node_modules/@radix-ui/react-slot/dist/index.js +14 -4
- package/dist/packages/components/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +32 -0
- package/dist/packages/components/node_modules/@radix-ui/react-visually-hidden/dist/index.js +30 -0
- package/dist/{node_modules → packages/components/node_modules}/react-toastify/dist/react-toastify.esm.cjs +3 -3
- package/dist/{node_modules → packages/components/node_modules}/react-toastify/dist/react-toastify.esm.js +2 -2
- package/package.json +19 -15
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/number/dist/index.cjs +0 -6
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/number/dist/index.js +0 -6
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/primitive/dist/index.cjs +0 -9
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/primitive/dist/index.js +0 -9
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.cjs +0 -81
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.js +0 -79
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +0 -31
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -28
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-context/dist/index.js +0 -67
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-direction/dist/index.cjs +0 -12
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-direction/dist/index.js +0 -10
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +0 -57
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +0 -7
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -5
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-previous/dist/index.cjs +0 -19
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-size/dist/index.cjs +0 -41
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-size/dist/index.js +0 -39
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/primitive/dist/index.cjs +0 -9
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/primitive/dist/index.js +0 -9
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +0 -31
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -28
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-context/dist/index.cjs +0 -69
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -82
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-slot/dist/index.js +0 -80
- package/dist/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.cjs +0 -289
- package/dist/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js +0 -288
|
@@ -5,21 +5,21 @@ react = require_runtime.__toESM(react, 1);
|
|
|
5
5
|
//#region ../../node_modules/@radix-ui/react-context/dist/index.mjs
|
|
6
6
|
function createContext2(rootComponentName, defaultContext) {
|
|
7
7
|
const Context = react.createContext(defaultContext);
|
|
8
|
-
|
|
8
|
+
const Provider = (props) => {
|
|
9
9
|
const { children, ...context } = props;
|
|
10
10
|
const value = react.useMemo(() => context, Object.values(context));
|
|
11
11
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Context.Provider, {
|
|
12
12
|
value,
|
|
13
13
|
children
|
|
14
14
|
});
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
16
17
|
function useContext2(consumerName) {
|
|
17
18
|
const context = react.useContext(Context);
|
|
18
19
|
if (context) return context;
|
|
19
20
|
if (defaultContext !== void 0) return defaultContext;
|
|
20
21
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
21
22
|
}
|
|
22
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
23
23
|
return [Provider, useContext2];
|
|
24
24
|
}
|
|
25
25
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
@@ -28,23 +28,23 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
28
28
|
const BaseContext = react.createContext(defaultContext);
|
|
29
29
|
const index = defaultContexts.length;
|
|
30
30
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
31
|
-
|
|
31
|
+
const Provider = (props) => {
|
|
32
32
|
const { scope, children, ...context } = props;
|
|
33
|
-
const Context = scope?.[scopeName][index] || BaseContext;
|
|
33
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
34
34
|
const value = react.useMemo(() => context, Object.values(context));
|
|
35
35
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Context.Provider, {
|
|
36
36
|
value,
|
|
37
37
|
children
|
|
38
38
|
});
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
40
41
|
function useContext2(consumerName, scope) {
|
|
41
|
-
const Context = scope?.[scopeName][index] || BaseContext;
|
|
42
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
42
43
|
const context = react.useContext(Context);
|
|
43
44
|
if (context) return context;
|
|
44
45
|
if (defaultContext !== void 0) return defaultContext;
|
|
45
46
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
46
47
|
}
|
|
47
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
48
48
|
return [Provider, useContext2];
|
|
49
49
|
}
|
|
50
50
|
const createScope = () => {
|
|
@@ -3,21 +3,21 @@ import * as React$1 from "react";
|
|
|
3
3
|
//#region ../../node_modules/@radix-ui/react-context/dist/index.mjs
|
|
4
4
|
function createContext2(rootComponentName, defaultContext) {
|
|
5
5
|
const Context = React$1.createContext(defaultContext);
|
|
6
|
-
|
|
6
|
+
const Provider = (props) => {
|
|
7
7
|
const { children, ...context } = props;
|
|
8
8
|
const value = React$1.useMemo(() => context, Object.values(context));
|
|
9
9
|
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
10
10
|
value,
|
|
11
11
|
children
|
|
12
12
|
});
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
14
15
|
function useContext2(consumerName) {
|
|
15
16
|
const context = React$1.useContext(Context);
|
|
16
17
|
if (context) return context;
|
|
17
18
|
if (defaultContext !== void 0) return defaultContext;
|
|
18
19
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
19
20
|
}
|
|
20
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
21
21
|
return [Provider, useContext2];
|
|
22
22
|
}
|
|
23
23
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
@@ -26,23 +26,23 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
26
26
|
const BaseContext = React$1.createContext(defaultContext);
|
|
27
27
|
const index = defaultContexts.length;
|
|
28
28
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
29
|
-
|
|
29
|
+
const Provider = (props) => {
|
|
30
30
|
const { scope, children, ...context } = props;
|
|
31
|
-
const Context = scope?.[scopeName][index] || BaseContext;
|
|
31
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
32
32
|
const value = React$1.useMemo(() => context, Object.values(context));
|
|
33
33
|
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
34
34
|
value,
|
|
35
35
|
children
|
|
36
36
|
});
|
|
37
|
-
}
|
|
37
|
+
};
|
|
38
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
38
39
|
function useContext2(consumerName, scope) {
|
|
39
|
-
const Context = scope?.[scopeName][index] || BaseContext;
|
|
40
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
40
41
|
const context = React$1.useContext(Context);
|
|
41
42
|
if (context) return context;
|
|
42
43
|
if (defaultContext !== void 0) return defaultContext;
|
|
43
44
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
44
45
|
}
|
|
45
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
46
46
|
return [Provider, useContext2];
|
|
47
47
|
}
|
|
48
48
|
const createScope = () => {
|
|
@@ -25,10 +25,11 @@ var Dialog = (props) => {
|
|
|
25
25
|
const { __scopeDialog, children, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
26
26
|
const triggerRef = react.useRef(null);
|
|
27
27
|
const contentRef = react.useRef(null);
|
|
28
|
-
const [open
|
|
28
|
+
const [open, setOpen] = require_index$11.useControllableState({
|
|
29
29
|
prop: openProp,
|
|
30
|
-
defaultProp: defaultOpen,
|
|
31
|
-
onChange: onOpenChange
|
|
30
|
+
defaultProp: defaultOpen ?? false,
|
|
31
|
+
onChange: onOpenChange,
|
|
32
|
+
caller: DIALOG_NAME
|
|
32
33
|
});
|
|
33
34
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogProvider, {
|
|
34
35
|
scope: __scopeDialog,
|
|
@@ -95,11 +96,12 @@ var DialogOverlay = react.forwardRef((props, forwardedRef) => {
|
|
|
95
96
|
}) : null;
|
|
96
97
|
});
|
|
97
98
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
99
|
+
var Slot = require_index$3.createSlot("DialogOverlay.RemoveScroll");
|
|
98
100
|
var DialogOverlayImpl = react.forwardRef((props, forwardedRef) => {
|
|
99
101
|
const { __scopeDialog, ...overlayProps } = props;
|
|
100
102
|
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
101
103
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Combination.default, {
|
|
102
|
-
as:
|
|
104
|
+
as: Slot,
|
|
103
105
|
allowPinchZoom: true,
|
|
104
106
|
shards: [context.contentRef],
|
|
105
107
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$4.Primitive.div, {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { composeEventHandlers } from "../../primitive/dist/index.js";
|
|
3
3
|
import { useComposedRefs } from "../../react-compose-refs/dist/index.js";
|
|
4
4
|
import { createContext2, createContextScope } from "../../react-context/dist/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createSlot } from "../../react-slot/dist/index.js";
|
|
6
6
|
import { Primitive } from "../../react-primitive/dist/index.js";
|
|
7
7
|
import { DismissableLayer } from "../../react-dismissable-layer/dist/index.js";
|
|
8
8
|
import { useFocusGuards } from "../../react-focus-guards/dist/index.js";
|
|
@@ -23,10 +23,11 @@ var Dialog = (props) => {
|
|
|
23
23
|
const { __scopeDialog, children, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
24
24
|
const triggerRef = React$1.useRef(null);
|
|
25
25
|
const contentRef = React$1.useRef(null);
|
|
26
|
-
const [open
|
|
26
|
+
const [open, setOpen] = useControllableState({
|
|
27
27
|
prop: openProp,
|
|
28
|
-
defaultProp: defaultOpen,
|
|
29
|
-
onChange: onOpenChange
|
|
28
|
+
defaultProp: defaultOpen ?? false,
|
|
29
|
+
onChange: onOpenChange,
|
|
30
|
+
caller: DIALOG_NAME
|
|
30
31
|
});
|
|
31
32
|
return /* @__PURE__ */ jsx(DialogProvider, {
|
|
32
33
|
scope: __scopeDialog,
|
|
@@ -93,6 +94,7 @@ var DialogOverlay = React$1.forwardRef((props, forwardedRef) => {
|
|
|
93
94
|
}) : null;
|
|
94
95
|
});
|
|
95
96
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
97
|
+
var Slot = createSlot("DialogOverlay.RemoveScroll");
|
|
96
98
|
var DialogOverlayImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
97
99
|
const { __scopeDialog, ...overlayProps } = props;
|
|
98
100
|
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
@@ -19,10 +19,11 @@ var DropdownMenu = (props) => {
|
|
|
19
19
|
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
20
20
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
21
21
|
const triggerRef = react.useRef(null);
|
|
22
|
-
const [open
|
|
22
|
+
const [open, setOpen] = require_index$5.useControllableState({
|
|
23
23
|
prop: openProp,
|
|
24
|
-
defaultProp: defaultOpen,
|
|
25
|
-
onChange: onOpenChange
|
|
24
|
+
defaultProp: defaultOpen ?? false,
|
|
25
|
+
onChange: onOpenChange,
|
|
26
|
+
caller: DROPDOWN_MENU_NAME
|
|
26
27
|
});
|
|
27
28
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DropdownMenuProvider, {
|
|
28
29
|
scope: __scopeDropdownMenu,
|
|
@@ -17,10 +17,11 @@ var DropdownMenu = (props) => {
|
|
|
17
17
|
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
18
18
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
19
19
|
const triggerRef = React$1.useRef(null);
|
|
20
|
-
const [open
|
|
20
|
+
const [open, setOpen] = useControllableState({
|
|
21
21
|
prop: openProp,
|
|
22
|
-
defaultProp: defaultOpen,
|
|
23
|
-
onChange: onOpenChange
|
|
22
|
+
defaultProp: defaultOpen ?? false,
|
|
23
|
+
onChange: onOpenChange,
|
|
24
|
+
caller: DROPDOWN_MENU_NAME
|
|
24
25
|
});
|
|
25
26
|
return /* @__PURE__ */ jsx(DropdownMenuProvider, {
|
|
26
27
|
scope: __scopeDropdownMenu,
|
|
@@ -20,7 +20,10 @@ function createFocusGuard() {
|
|
|
20
20
|
const element = document.createElement("span");
|
|
21
21
|
element.setAttribute("data-radix-focus-guard", "");
|
|
22
22
|
element.tabIndex = 0;
|
|
23
|
-
element.style.
|
|
23
|
+
element.style.outline = "none";
|
|
24
|
+
element.style.opacity = "0";
|
|
25
|
+
element.style.position = "fixed";
|
|
26
|
+
element.style.pointerEvents = "none";
|
|
24
27
|
return element;
|
|
25
28
|
}
|
|
26
29
|
//#endregion
|
|
@@ -18,7 +18,10 @@ function createFocusGuard() {
|
|
|
18
18
|
const element = document.createElement("span");
|
|
19
19
|
element.setAttribute("data-radix-focus-guard", "");
|
|
20
20
|
element.tabIndex = 0;
|
|
21
|
-
element.style.
|
|
21
|
+
element.style.outline = "none";
|
|
22
|
+
element.style.opacity = "0";
|
|
23
|
+
element.style.position = "fixed";
|
|
24
|
+
element.style.pointerEvents = "none";
|
|
22
25
|
return element;
|
|
23
26
|
}
|
|
24
27
|
//#endregion
|
|
@@ -3,7 +3,7 @@ const require_index = require("../../react-use-layout-effect/dist/index.cjs");
|
|
|
3
3
|
let react = require("react");
|
|
4
4
|
react = require_runtime.__toESM(react, 1);
|
|
5
5
|
//#region ../../node_modules/@radix-ui/react-id/dist/index.mjs
|
|
6
|
-
var useReactId = react["useId".toString()] || (() => void 0);
|
|
6
|
+
var useReactId = react[" useId ".trim().toString()] || (() => void 0);
|
|
7
7
|
var count = 0;
|
|
8
8
|
function useId(deterministicId) {
|
|
9
9
|
const [id, setId] = react.useState(useReactId());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useLayoutEffect2 } from "../../react-use-layout-effect/dist/index.js";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
//#region ../../node_modules/@radix-ui/react-id/dist/index.mjs
|
|
4
|
-
var useReactId = React$1["useId".toString()] || (() => void 0);
|
|
4
|
+
var useReactId = React$1[" useId ".trim().toString()] || (() => void 0);
|
|
5
5
|
var count = 0;
|
|
6
6
|
function useId(deterministicId) {
|
|
7
7
|
const [id, setId] = React$1.useState(useReactId());
|
|
@@ -183,6 +183,7 @@ var MenuRootContentNonModal = react.forwardRef((props, forwardedRef) => {
|
|
|
183
183
|
onDismiss: () => context.onOpenChange(false)
|
|
184
184
|
});
|
|
185
185
|
});
|
|
186
|
+
var Slot = require_index$3.createSlot("MenuContent.ScrollLock");
|
|
186
187
|
var MenuContentImpl = react.forwardRef((props, forwardedRef) => {
|
|
187
188
|
const { __scopeMenu, loop = false, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEntryFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, disableOutsideScroll, ...contentProps } = props;
|
|
188
189
|
const context = useMenuContext(CONTENT_NAME, __scopeMenu);
|
|
@@ -201,7 +202,7 @@ var MenuContentImpl = react.forwardRef((props, forwardedRef) => {
|
|
|
201
202
|
const lastPointerXRef = react.useRef(0);
|
|
202
203
|
const ScrollLockWrapper = disableOutsideScroll ? require_Combination.default : react.Fragment;
|
|
203
204
|
const scrollLockWrapperProps = disableOutsideScroll ? {
|
|
204
|
-
as:
|
|
205
|
+
as: Slot,
|
|
205
206
|
allowPinchZoom: true
|
|
206
207
|
} : void 0;
|
|
207
208
|
const handleTypeaheadSearch = (key) => {
|
|
@@ -742,10 +743,12 @@ function isPointInPolygon(point, polygon) {
|
|
|
742
743
|
const { x, y } = point;
|
|
743
744
|
let inside = false;
|
|
744
745
|
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
745
|
-
const
|
|
746
|
-
const
|
|
747
|
-
const
|
|
748
|
-
const
|
|
746
|
+
const ii = polygon[i];
|
|
747
|
+
const jj = polygon[j];
|
|
748
|
+
const xi = ii.x;
|
|
749
|
+
const yi = ii.y;
|
|
750
|
+
const xj = jj.x;
|
|
751
|
+
const yj = jj.y;
|
|
749
752
|
if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) inside = !inside;
|
|
750
753
|
}
|
|
751
754
|
return inside;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { composeEventHandlers } from "../../primitive/dist/index.js";
|
|
3
3
|
import { composeRefs, useComposedRefs } from "../../react-compose-refs/dist/index.js";
|
|
4
4
|
import { createContextScope } from "../../react-context/dist/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createSlot } from "../../react-slot/dist/index.js";
|
|
6
6
|
import { Primitive, dispatchDiscreteCustomEvent } from "../../react-primitive/dist/index.js";
|
|
7
7
|
import { useCallbackRef } from "../../react-use-callback-ref/dist/index.js";
|
|
8
8
|
import { DismissableLayer } from "../../react-dismissable-layer/dist/index.js";
|
|
@@ -180,6 +180,7 @@ var MenuRootContentNonModal = React$1.forwardRef((props, forwardedRef) => {
|
|
|
180
180
|
onDismiss: () => context.onOpenChange(false)
|
|
181
181
|
});
|
|
182
182
|
});
|
|
183
|
+
var Slot = createSlot("MenuContent.ScrollLock");
|
|
183
184
|
var MenuContentImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
184
185
|
const { __scopeMenu, loop = false, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEntryFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, disableOutsideScroll, ...contentProps } = props;
|
|
185
186
|
const context = useMenuContext(CONTENT_NAME, __scopeMenu);
|
|
@@ -738,10 +739,12 @@ function isPointInPolygon(point, polygon) {
|
|
|
738
739
|
const { x, y } = point;
|
|
739
740
|
let inside = false;
|
|
740
741
|
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
741
|
-
const
|
|
742
|
-
const
|
|
743
|
-
const
|
|
744
|
-
const
|
|
742
|
+
const ii = polygon[i];
|
|
743
|
+
const jj = polygon[j];
|
|
744
|
+
const xi = ii.x;
|
|
745
|
+
const yi = ii.y;
|
|
746
|
+
const xj = jj.x;
|
|
747
|
+
const yj = jj.y;
|
|
745
748
|
if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) inside = !inside;
|
|
746
749
|
}
|
|
747
750
|
return inside;
|
|
@@ -28,10 +28,11 @@ var Popover = (props) => {
|
|
|
28
28
|
const popperScope = usePopperScope(__scopePopover);
|
|
29
29
|
const triggerRef = react.useRef(null);
|
|
30
30
|
const [hasCustomAnchor, setHasCustomAnchor] = react.useState(false);
|
|
31
|
-
const [open
|
|
31
|
+
const [open, setOpen] = require_index$12.useControllableState({
|
|
32
32
|
prop: openProp,
|
|
33
|
-
defaultProp: defaultOpen,
|
|
34
|
-
onChange: onOpenChange
|
|
33
|
+
defaultProp: defaultOpen ?? false,
|
|
34
|
+
onChange: onOpenChange,
|
|
35
|
+
caller: POPOVER_NAME
|
|
35
36
|
});
|
|
36
37
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$9.Root2, {
|
|
37
38
|
...popperScope,
|
|
@@ -127,6 +128,7 @@ var PopoverContent = react.forwardRef((props, forwardedRef) => {
|
|
|
127
128
|
});
|
|
128
129
|
});
|
|
129
130
|
PopoverContent.displayName = CONTENT_NAME;
|
|
131
|
+
var Slot = require_index$3.createSlot("PopoverContent.RemoveScroll");
|
|
130
132
|
var PopoverContentModal = react.forwardRef((props, forwardedRef) => {
|
|
131
133
|
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
132
134
|
const contentRef = react.useRef(null);
|
|
@@ -137,7 +139,7 @@ var PopoverContentModal = react.forwardRef((props, forwardedRef) => {
|
|
|
137
139
|
if (content) return require_index$13.hideOthers(content);
|
|
138
140
|
}, []);
|
|
139
141
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Combination.default, {
|
|
140
|
-
as:
|
|
142
|
+
as: Slot,
|
|
141
143
|
allowPinchZoom: true,
|
|
142
144
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverContentImpl, {
|
|
143
145
|
...props,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { composeEventHandlers } from "../../primitive/dist/index.js";
|
|
3
3
|
import { useComposedRefs } from "../../react-compose-refs/dist/index.js";
|
|
4
4
|
import { createContextScope } from "../../react-context/dist/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createSlot } from "../../react-slot/dist/index.js";
|
|
6
6
|
import { Primitive } from "../../react-primitive/dist/index.js";
|
|
7
7
|
import { DismissableLayer } from "../../react-dismissable-layer/dist/index.js";
|
|
8
8
|
import { useFocusGuards } from "../../react-focus-guards/dist/index.js";
|
|
@@ -26,10 +26,11 @@ var Popover = (props) => {
|
|
|
26
26
|
const popperScope = usePopperScope(__scopePopover);
|
|
27
27
|
const triggerRef = React$1.useRef(null);
|
|
28
28
|
const [hasCustomAnchor, setHasCustomAnchor] = React$1.useState(false);
|
|
29
|
-
const [open
|
|
29
|
+
const [open, setOpen] = useControllableState({
|
|
30
30
|
prop: openProp,
|
|
31
|
-
defaultProp: defaultOpen,
|
|
32
|
-
onChange: onOpenChange
|
|
31
|
+
defaultProp: defaultOpen ?? false,
|
|
32
|
+
onChange: onOpenChange,
|
|
33
|
+
caller: POPOVER_NAME
|
|
33
34
|
});
|
|
34
35
|
return /* @__PURE__ */ jsx(Root2$1, {
|
|
35
36
|
...popperScope,
|
|
@@ -125,6 +126,7 @@ var PopoverContent = React$1.forwardRef((props, forwardedRef) => {
|
|
|
125
126
|
});
|
|
126
127
|
});
|
|
127
128
|
PopoverContent.displayName = CONTENT_NAME;
|
|
129
|
+
var Slot = createSlot("PopoverContent.RemoveScroll");
|
|
128
130
|
var PopoverContentModal = React$1.forwardRef((props, forwardedRef) => {
|
|
129
131
|
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
130
132
|
const contentRef = React$1.useRef(null);
|
|
@@ -33,8 +33,11 @@ var PopperAnchor = react.forwardRef((props, forwardedRef) => {
|
|
|
33
33
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
34
34
|
const ref = react.useRef(null);
|
|
35
35
|
const composedRefs = require_index.useComposedRefs(forwardedRef, ref);
|
|
36
|
+
const anchorRef = react.useRef(null);
|
|
36
37
|
react.useEffect(() => {
|
|
37
|
-
|
|
38
|
+
const previousAnchor = anchorRef.current;
|
|
39
|
+
anchorRef.current = virtualRef?.current || ref.current;
|
|
40
|
+
if (previousAnchor !== anchorRef.current) context.onAnchorChange(anchorRef.current);
|
|
38
41
|
});
|
|
39
42
|
return virtualRef ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$2.Primitive.div, {
|
|
40
43
|
...anchorProps,
|
|
@@ -31,8 +31,11 @@ var PopperAnchor = React$1.forwardRef((props, forwardedRef) => {
|
|
|
31
31
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
32
32
|
const ref = React$1.useRef(null);
|
|
33
33
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
34
|
+
const anchorRef = React$1.useRef(null);
|
|
34
35
|
React$1.useEffect(() => {
|
|
35
|
-
|
|
36
|
+
const previousAnchor = anchorRef.current;
|
|
37
|
+
anchorRef.current = virtualRef?.current || ref.current;
|
|
38
|
+
if (previousAnchor !== anchorRef.current) context.onAnchorChange(anchorRef.current);
|
|
36
39
|
});
|
|
37
40
|
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, {
|
|
38
41
|
...anchorProps,
|
|
@@ -4,8 +4,6 @@ const require_index = require("../../react-compose-refs/dist/index.cjs");
|
|
|
4
4
|
const require_index$1 = require("../../react-use-layout-effect/dist/index.cjs");
|
|
5
5
|
let react = require("react");
|
|
6
6
|
react = require_runtime.__toESM(react, 1);
|
|
7
|
-
let react_dom = require("react-dom");
|
|
8
|
-
react_dom = require_runtime.__toESM(react_dom, 1);
|
|
9
7
|
//#region ../../node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
10
8
|
function useStateMachine(initialState, machine) {
|
|
11
9
|
return react.useReducer((state, event) => {
|
|
@@ -22,7 +20,7 @@ var Presence = (props) => {
|
|
|
22
20
|
Presence.displayName = "Presence";
|
|
23
21
|
function usePresence(present) {
|
|
24
22
|
const [node, setNode] = react.useState();
|
|
25
|
-
const stylesRef = react.useRef(
|
|
23
|
+
const stylesRef = react.useRef(null);
|
|
26
24
|
const prevPresentRef = react.useRef(present);
|
|
27
25
|
const prevAnimationNameRef = react.useRef("none");
|
|
28
26
|
const [state, send] = useStateMachine(present ? "mounted" : "unmounted", {
|
|
@@ -55,9 +53,20 @@ function usePresence(present) {
|
|
|
55
53
|
}, [present, send]);
|
|
56
54
|
require_index$1.useLayoutEffect2(() => {
|
|
57
55
|
if (node) {
|
|
56
|
+
let timeoutId;
|
|
57
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
58
58
|
const handleAnimationEnd = (event) => {
|
|
59
|
-
const isCurrentAnimation = getAnimationName(stylesRef.current).includes(event.animationName);
|
|
60
|
-
if (event.target === node && isCurrentAnimation)
|
|
59
|
+
const isCurrentAnimation = getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));
|
|
60
|
+
if (event.target === node && isCurrentAnimation) {
|
|
61
|
+
send("ANIMATION_END");
|
|
62
|
+
if (!prevPresentRef.current) {
|
|
63
|
+
const currentFillMode = node.style.animationFillMode;
|
|
64
|
+
node.style.animationFillMode = "forwards";
|
|
65
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
66
|
+
if (node.style.animationFillMode === "forwards") node.style.animationFillMode = currentFillMode;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
61
70
|
};
|
|
62
71
|
const handleAnimationStart = (event) => {
|
|
63
72
|
if (event.target === node) prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
@@ -66,6 +75,7 @@ function usePresence(present) {
|
|
|
66
75
|
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
67
76
|
node.addEventListener("animationend", handleAnimationEnd);
|
|
68
77
|
return () => {
|
|
78
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
69
79
|
node.removeEventListener("animationstart", handleAnimationStart);
|
|
70
80
|
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
71
81
|
node.removeEventListener("animationend", handleAnimationEnd);
|
|
@@ -75,7 +85,7 @@ function usePresence(present) {
|
|
|
75
85
|
return {
|
|
76
86
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
77
87
|
ref: react.useCallback((node2) => {
|
|
78
|
-
|
|
88
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
79
89
|
setNode(node2);
|
|
80
90
|
}, [])
|
|
81
91
|
};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { useComposedRefs } from "../../react-compose-refs/dist/index.js";
|
|
3
3
|
import { useLayoutEffect2 } from "../../react-use-layout-effect/dist/index.js";
|
|
4
4
|
import * as React2 from "react";
|
|
5
|
-
import * as ReactDOM$1 from "react-dom";
|
|
6
5
|
//#region ../../node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
7
6
|
function useStateMachine(initialState, machine) {
|
|
8
7
|
return React2.useReducer((state, event) => {
|
|
@@ -19,7 +18,7 @@ var Presence = (props) => {
|
|
|
19
18
|
Presence.displayName = "Presence";
|
|
20
19
|
function usePresence(present) {
|
|
21
20
|
const [node, setNode] = React2.useState();
|
|
22
|
-
const stylesRef = React2.useRef(
|
|
21
|
+
const stylesRef = React2.useRef(null);
|
|
23
22
|
const prevPresentRef = React2.useRef(present);
|
|
24
23
|
const prevAnimationNameRef = React2.useRef("none");
|
|
25
24
|
const [state, send] = useStateMachine(present ? "mounted" : "unmounted", {
|
|
@@ -52,9 +51,20 @@ function usePresence(present) {
|
|
|
52
51
|
}, [present, send]);
|
|
53
52
|
useLayoutEffect2(() => {
|
|
54
53
|
if (node) {
|
|
54
|
+
let timeoutId;
|
|
55
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
55
56
|
const handleAnimationEnd = (event) => {
|
|
56
|
-
const isCurrentAnimation = getAnimationName(stylesRef.current).includes(event.animationName);
|
|
57
|
-
if (event.target === node && isCurrentAnimation)
|
|
57
|
+
const isCurrentAnimation = getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));
|
|
58
|
+
if (event.target === node && isCurrentAnimation) {
|
|
59
|
+
send("ANIMATION_END");
|
|
60
|
+
if (!prevPresentRef.current) {
|
|
61
|
+
const currentFillMode = node.style.animationFillMode;
|
|
62
|
+
node.style.animationFillMode = "forwards";
|
|
63
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
64
|
+
if (node.style.animationFillMode === "forwards") node.style.animationFillMode = currentFillMode;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
58
68
|
};
|
|
59
69
|
const handleAnimationStart = (event) => {
|
|
60
70
|
if (event.target === node) prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
@@ -63,6 +73,7 @@ function usePresence(present) {
|
|
|
63
73
|
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
64
74
|
node.addEventListener("animationend", handleAnimationEnd);
|
|
65
75
|
return () => {
|
|
76
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
66
77
|
node.removeEventListener("animationstart", handleAnimationStart);
|
|
67
78
|
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
68
79
|
node.removeEventListener("animationend", handleAnimationEnd);
|
|
@@ -72,7 +83,7 @@ function usePresence(present) {
|
|
|
72
83
|
return {
|
|
73
84
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
74
85
|
ref: React2.useCallback((node2) => {
|
|
75
|
-
|
|
86
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
76
87
|
setNode(node2);
|
|
77
88
|
}, [])
|
|
78
89
|
};
|
|
@@ -20,13 +20,15 @@ var Primitive = [
|
|
|
20
20
|
"nav",
|
|
21
21
|
"ol",
|
|
22
22
|
"p",
|
|
23
|
+
"select",
|
|
23
24
|
"span",
|
|
24
25
|
"svg",
|
|
25
26
|
"ul"
|
|
26
27
|
].reduce((primitive, node) => {
|
|
28
|
+
const Slot = require_index.createSlot(`Primitive.${node}`);
|
|
27
29
|
const Node = react.forwardRef((props, forwardedRef) => {
|
|
28
30
|
const { asChild, ...primitiveProps } = props;
|
|
29
|
-
const Comp = asChild ?
|
|
31
|
+
const Comp = asChild ? Slot : node;
|
|
30
32
|
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
31
33
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
|
|
32
34
|
...primitiveProps,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createSlot } from "../../react-slot/dist/index.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import * as ReactDOM$1 from "react-dom";
|
|
@@ -17,10 +17,12 @@ var Primitive = [
|
|
|
17
17
|
"nav",
|
|
18
18
|
"ol",
|
|
19
19
|
"p",
|
|
20
|
+
"select",
|
|
20
21
|
"span",
|
|
21
22
|
"svg",
|
|
22
23
|
"ul"
|
|
23
24
|
].reduce((primitive, node) => {
|
|
25
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
24
26
|
const Node = React$1.forwardRef((props, forwardedRef) => {
|
|
25
27
|
const { asChild, ...primitiveProps } = props;
|
|
26
28
|
const Comp = asChild ? Slot : node;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_runtime = require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
-
const require_index = require("
|
|
4
|
-
const require_index$1 = require("
|
|
3
|
+
const require_index = require("../node_modules/@radix-ui/react-context/dist/index.cjs");
|
|
4
|
+
const require_index$1 = require("../node_modules/@radix-ui/react-primitive/dist/index.cjs");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
let react = require("react");
|
|
7
7
|
react = require_runtime.__toESM(react, 1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createContextScope } from "
|
|
3
|
-
import { Primitive } from "
|
|
2
|
+
import { createContextScope } from "../node_modules/@radix-ui/react-context/dist/index.js";
|
|
3
|
+
import { Primitive } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import * as React$1 from "react";
|
|
6
6
|
//#region ../../node_modules/@radix-ui/react-progress/dist/index.mjs
|
|
@@ -2,11 +2,12 @@ const require_runtime = require("../../../../../../../_virtual/_rolldown/runtime
|
|
|
2
2
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
3
|
let react = require("react");
|
|
4
4
|
react = require_runtime.__toESM(react, 1);
|
|
5
|
-
//#region ../../node_modules/@radix-ui/react-
|
|
5
|
+
//#region ../../node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
6
6
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
7
7
|
let defaultContexts = [];
|
|
8
8
|
function createContext3(rootComponentName, defaultContext) {
|
|
9
9
|
const BaseContext = react.createContext(defaultContext);
|
|
10
|
+
BaseContext.displayName = rootComponentName + "Context";
|
|
10
11
|
const index = defaultContexts.length;
|
|
11
12
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
12
13
|
const Provider = (props) => {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
//#region ../../node_modules/@radix-ui/react-
|
|
3
|
+
//#region ../../node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
4
4
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
5
5
|
let defaultContexts = [];
|
|
6
6
|
function createContext3(rootComponentName, defaultContext) {
|
|
7
7
|
const BaseContext = React$1.createContext(defaultContext);
|
|
8
|
+
BaseContext.displayName = rootComponentName + "Context";
|
|
8
9
|
const index = defaultContexts.length;
|
|
9
10
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
10
11
|
const Provider = (props) => {
|
|
@@ -5,7 +5,7 @@ let react = require("react");
|
|
|
5
5
|
react = require_runtime.__toESM(react, 1);
|
|
6
6
|
let react_dom = require("react-dom");
|
|
7
7
|
react_dom = require_runtime.__toESM(react_dom, 1);
|
|
8
|
-
//#region ../../node_modules/@radix-ui/react-
|
|
8
|
+
//#region ../../node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
9
9
|
var Primitive = [
|
|
10
10
|
"a",
|
|
11
11
|
"button",
|