@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
|
@@ -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 { createSlottable } 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 { useId } from "../../react-id/dist/index.js";
|
|
@@ -22,7 +22,7 @@ var TOOLTIP_OPEN = "tooltip.open";
|
|
|
22
22
|
var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
|
|
23
23
|
var TooltipProvider = (props) => {
|
|
24
24
|
const { __scopeTooltip, delayDuration = DEFAULT_DELAY_DURATION, skipDelayDuration = 300, disableHoverableContent = false, children } = props;
|
|
25
|
-
const
|
|
25
|
+
const isOpenDelayedRef = React$1.useRef(true);
|
|
26
26
|
const isPointerInTransitRef = React$1.useRef(false);
|
|
27
27
|
const skipDelayTimerRef = React$1.useRef(0);
|
|
28
28
|
React$1.useEffect(() => {
|
|
@@ -31,15 +31,15 @@ var TooltipProvider = (props) => {
|
|
|
31
31
|
}, []);
|
|
32
32
|
return /* @__PURE__ */ jsx(TooltipProviderContextProvider, {
|
|
33
33
|
scope: __scopeTooltip,
|
|
34
|
-
|
|
34
|
+
isOpenDelayedRef,
|
|
35
35
|
delayDuration,
|
|
36
36
|
onOpen: React$1.useCallback(() => {
|
|
37
37
|
window.clearTimeout(skipDelayTimerRef.current);
|
|
38
|
-
|
|
38
|
+
isOpenDelayedRef.current = false;
|
|
39
39
|
}, []),
|
|
40
40
|
onClose: React$1.useCallback(() => {
|
|
41
41
|
window.clearTimeout(skipDelayTimerRef.current);
|
|
42
|
-
skipDelayTimerRef.current = window.setTimeout(() =>
|
|
42
|
+
skipDelayTimerRef.current = window.setTimeout(() => isOpenDelayedRef.current = true, skipDelayDuration);
|
|
43
43
|
}, [skipDelayDuration]),
|
|
44
44
|
isPointerInTransitRef,
|
|
45
45
|
onPointerInTransitChange: React$1.useCallback((inTransit) => {
|
|
@@ -53,7 +53,7 @@ TooltipProvider.displayName = PROVIDER_NAME;
|
|
|
53
53
|
var TOOLTIP_NAME = "Tooltip";
|
|
54
54
|
var [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME);
|
|
55
55
|
var Tooltip = (props) => {
|
|
56
|
-
const { __scopeTooltip, children, open: openProp, defaultOpen
|
|
56
|
+
const { __scopeTooltip, children, open: openProp, defaultOpen, onOpenChange, disableHoverableContent: disableHoverableContentProp, delayDuration: delayDurationProp } = props;
|
|
57
57
|
const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);
|
|
58
58
|
const popperScope = usePopperScope(__scopeTooltip);
|
|
59
59
|
const [trigger, setTrigger] = React$1.useState(null);
|
|
@@ -62,27 +62,30 @@ var Tooltip = (props) => {
|
|
|
62
62
|
const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;
|
|
63
63
|
const delayDuration = delayDurationProp ?? providerContext.delayDuration;
|
|
64
64
|
const wasOpenDelayedRef = React$1.useRef(false);
|
|
65
|
-
const [open
|
|
65
|
+
const [open, setOpen] = useControllableState({
|
|
66
66
|
prop: openProp,
|
|
67
|
-
defaultProp: defaultOpen,
|
|
67
|
+
defaultProp: defaultOpen ?? false,
|
|
68
68
|
onChange: (open2) => {
|
|
69
69
|
if (open2) {
|
|
70
70
|
providerContext.onOpen();
|
|
71
71
|
document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));
|
|
72
72
|
} else providerContext.onClose();
|
|
73
73
|
onOpenChange?.(open2);
|
|
74
|
-
}
|
|
74
|
+
},
|
|
75
|
+
caller: TOOLTIP_NAME
|
|
75
76
|
});
|
|
76
77
|
const stateAttribute = React$1.useMemo(() => {
|
|
77
78
|
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
|
78
79
|
}, [open]);
|
|
79
80
|
const handleOpen = React$1.useCallback(() => {
|
|
80
81
|
window.clearTimeout(openTimerRef.current);
|
|
82
|
+
openTimerRef.current = 0;
|
|
81
83
|
wasOpenDelayedRef.current = false;
|
|
82
84
|
setOpen(true);
|
|
83
85
|
}, [setOpen]);
|
|
84
86
|
const handleClose = React$1.useCallback(() => {
|
|
85
87
|
window.clearTimeout(openTimerRef.current);
|
|
88
|
+
openTimerRef.current = 0;
|
|
86
89
|
setOpen(false);
|
|
87
90
|
}, [setOpen]);
|
|
88
91
|
const handleDelayedOpen = React$1.useCallback(() => {
|
|
@@ -90,10 +93,16 @@ var Tooltip = (props) => {
|
|
|
90
93
|
openTimerRef.current = window.setTimeout(() => {
|
|
91
94
|
wasOpenDelayedRef.current = true;
|
|
92
95
|
setOpen(true);
|
|
96
|
+
openTimerRef.current = 0;
|
|
93
97
|
}, delayDuration);
|
|
94
98
|
}, [delayDuration, setOpen]);
|
|
95
99
|
React$1.useEffect(() => {
|
|
96
|
-
return () =>
|
|
100
|
+
return () => {
|
|
101
|
+
if (openTimerRef.current) {
|
|
102
|
+
window.clearTimeout(openTimerRef.current);
|
|
103
|
+
openTimerRef.current = 0;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
97
106
|
}, []);
|
|
98
107
|
return /* @__PURE__ */ jsx(Root2, {
|
|
99
108
|
...popperScope,
|
|
@@ -105,16 +114,19 @@ var Tooltip = (props) => {
|
|
|
105
114
|
trigger,
|
|
106
115
|
onTriggerChange: setTrigger,
|
|
107
116
|
onTriggerEnter: React$1.useCallback(() => {
|
|
108
|
-
if (providerContext.
|
|
117
|
+
if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();
|
|
109
118
|
else handleOpen();
|
|
110
119
|
}, [
|
|
111
|
-
providerContext.
|
|
120
|
+
providerContext.isOpenDelayedRef,
|
|
112
121
|
handleDelayedOpen,
|
|
113
122
|
handleOpen
|
|
114
123
|
]),
|
|
115
124
|
onTriggerLeave: React$1.useCallback(() => {
|
|
116
125
|
if (disableHoverableContent) handleClose();
|
|
117
|
-
else
|
|
126
|
+
else {
|
|
127
|
+
window.clearTimeout(openTimerRef.current);
|
|
128
|
+
openTimerRef.current = 0;
|
|
129
|
+
}
|
|
118
130
|
}, [handleClose, disableHoverableContent]),
|
|
119
131
|
onOpen: handleOpen,
|
|
120
132
|
onClose: handleClose,
|
|
@@ -157,6 +169,7 @@ var TooltipTrigger = React$1.forwardRef((props, forwardedRef) => {
|
|
|
157
169
|
hasPointerMoveOpenedRef.current = false;
|
|
158
170
|
}),
|
|
159
171
|
onPointerDown: composeEventHandlers(props.onPointerDown, () => {
|
|
172
|
+
if (context.open) context.onClose();
|
|
160
173
|
isPointerDownRef.current = true;
|
|
161
174
|
document.addEventListener("pointerup", handlePointerUp, { once: true });
|
|
162
175
|
}),
|
|
@@ -282,6 +295,7 @@ var TooltipContentHoverable = React$1.forwardRef((props, forwardedRef) => {
|
|
|
282
295
|
});
|
|
283
296
|
});
|
|
284
297
|
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
|
298
|
+
var Slottable = createSlottable("TooltipContent");
|
|
285
299
|
var TooltipContentImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
286
300
|
const { __scopeTooltip, children, "aria-label": ariaLabel, onEscapeKeyDown, onPointerDownOutside, ...contentProps } = props;
|
|
287
301
|
const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);
|
|
@@ -424,10 +438,12 @@ function isPointInPolygon(point, polygon) {
|
|
|
424
438
|
const { x, y } = point;
|
|
425
439
|
let inside = false;
|
|
426
440
|
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
427
|
-
const
|
|
428
|
-
const
|
|
429
|
-
const
|
|
430
|
-
const
|
|
441
|
+
const ii = polygon[i];
|
|
442
|
+
const jj = polygon[j];
|
|
443
|
+
const xi = ii.x;
|
|
444
|
+
const yi = ii.y;
|
|
445
|
+
const xj = jj.x;
|
|
446
|
+
const yj = jj.y;
|
|
431
447
|
if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) inside = !inside;
|
|
432
448
|
}
|
|
433
449
|
return inside;
|
|
@@ -1,44 +1,57 @@
|
|
|
1
1
|
const require_runtime = require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_index = require("../../react-use-
|
|
2
|
+
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-use-controllable-state/dist/index.mjs
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
var useInsertionEffect = react[" useInsertionEffect ".trim().toString()] || require_index.useLayoutEffect2;
|
|
7
|
+
function useControllableState({ prop, defaultProp, onChange = () => {}, caller }) {
|
|
8
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
8
9
|
defaultProp,
|
|
9
10
|
onChange
|
|
10
11
|
});
|
|
11
12
|
const isControlled = prop !== void 0;
|
|
12
13
|
const value = isControlled ? prop : uncontrolledProp;
|
|
13
|
-
|
|
14
|
+
{
|
|
15
|
+
const isControlledRef = react.useRef(prop !== void 0);
|
|
16
|
+
react.useEffect(() => {
|
|
17
|
+
const wasControlled = isControlledRef.current;
|
|
18
|
+
if (wasControlled !== isControlled) console.warn(`${caller} is changing from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);
|
|
19
|
+
isControlledRef.current = isControlled;
|
|
20
|
+
}, [isControlled, caller]);
|
|
21
|
+
}
|
|
14
22
|
return [value, react.useCallback((nextValue) => {
|
|
15
23
|
if (isControlled) {
|
|
16
|
-
const value2 =
|
|
17
|
-
if (value2 !== prop)
|
|
24
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
25
|
+
if (value2 !== prop) onChangeRef.current?.(value2);
|
|
18
26
|
} else setUncontrolledProp(nextValue);
|
|
19
27
|
}, [
|
|
20
28
|
isControlled,
|
|
21
29
|
prop,
|
|
22
30
|
setUncontrolledProp,
|
|
23
|
-
|
|
31
|
+
onChangeRef
|
|
24
32
|
])];
|
|
25
33
|
}
|
|
26
34
|
function useUncontrolledState({ defaultProp, onChange }) {
|
|
27
|
-
const
|
|
28
|
-
const [value] = uncontrolledState;
|
|
35
|
+
const [value, setValue] = react.useState(defaultProp);
|
|
29
36
|
const prevValueRef = react.useRef(value);
|
|
30
|
-
const
|
|
37
|
+
const onChangeRef = react.useRef(onChange);
|
|
38
|
+
useInsertionEffect(() => {
|
|
39
|
+
onChangeRef.current = onChange;
|
|
40
|
+
}, [onChange]);
|
|
31
41
|
react.useEffect(() => {
|
|
32
42
|
if (prevValueRef.current !== value) {
|
|
33
|
-
|
|
43
|
+
onChangeRef.current?.(value);
|
|
34
44
|
prevValueRef.current = value;
|
|
35
45
|
}
|
|
36
|
-
}, [
|
|
46
|
+
}, [value, prevValueRef]);
|
|
47
|
+
return [
|
|
37
48
|
value,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
]
|
|
41
|
-
|
|
49
|
+
setValue,
|
|
50
|
+
onChangeRef
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
function isFunction(value) {
|
|
54
|
+
return typeof value === "function";
|
|
42
55
|
}
|
|
43
56
|
//#endregion
|
|
44
57
|
exports.useControllableState = useControllableState;
|
|
@@ -1,42 +1,55 @@
|
|
|
1
|
-
import {
|
|
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-use-controllable-state/dist/index.mjs
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var useInsertionEffect = React$1[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
5
|
+
function useControllableState({ prop, defaultProp, onChange = () => {}, caller }) {
|
|
6
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
6
7
|
defaultProp,
|
|
7
8
|
onChange
|
|
8
9
|
});
|
|
9
10
|
const isControlled = prop !== void 0;
|
|
10
11
|
const value = isControlled ? prop : uncontrolledProp;
|
|
11
|
-
|
|
12
|
+
{
|
|
13
|
+
const isControlledRef = React$1.useRef(prop !== void 0);
|
|
14
|
+
React$1.useEffect(() => {
|
|
15
|
+
const wasControlled = isControlledRef.current;
|
|
16
|
+
if (wasControlled !== isControlled) console.warn(`${caller} is changing from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);
|
|
17
|
+
isControlledRef.current = isControlled;
|
|
18
|
+
}, [isControlled, caller]);
|
|
19
|
+
}
|
|
12
20
|
return [value, React$1.useCallback((nextValue) => {
|
|
13
21
|
if (isControlled) {
|
|
14
|
-
const value2 =
|
|
15
|
-
if (value2 !== prop)
|
|
22
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
23
|
+
if (value2 !== prop) onChangeRef.current?.(value2);
|
|
16
24
|
} else setUncontrolledProp(nextValue);
|
|
17
25
|
}, [
|
|
18
26
|
isControlled,
|
|
19
27
|
prop,
|
|
20
28
|
setUncontrolledProp,
|
|
21
|
-
|
|
29
|
+
onChangeRef
|
|
22
30
|
])];
|
|
23
31
|
}
|
|
24
32
|
function useUncontrolledState({ defaultProp, onChange }) {
|
|
25
|
-
const
|
|
26
|
-
const [value] = uncontrolledState;
|
|
33
|
+
const [value, setValue] = React$1.useState(defaultProp);
|
|
27
34
|
const prevValueRef = React$1.useRef(value);
|
|
28
|
-
const
|
|
35
|
+
const onChangeRef = React$1.useRef(onChange);
|
|
36
|
+
useInsertionEffect(() => {
|
|
37
|
+
onChangeRef.current = onChange;
|
|
38
|
+
}, [onChange]);
|
|
29
39
|
React$1.useEffect(() => {
|
|
30
40
|
if (prevValueRef.current !== value) {
|
|
31
|
-
|
|
41
|
+
onChangeRef.current?.(value);
|
|
32
42
|
prevValueRef.current = value;
|
|
33
43
|
}
|
|
34
|
-
}, [
|
|
44
|
+
}, [value, prevValueRef]);
|
|
45
|
+
return [
|
|
35
46
|
value,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
]
|
|
39
|
-
|
|
47
|
+
setValue,
|
|
48
|
+
onChangeRef
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
function isFunction(value) {
|
|
52
|
+
return typeof value === "function";
|
|
40
53
|
}
|
|
41
54
|
//#endregion
|
|
42
55
|
export { useControllableState };
|
|
@@ -2,6 +2,6 @@ const require_runtime = require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
|
2
2
|
let react = require("react");
|
|
3
3
|
react = require_runtime.__toESM(react, 1);
|
|
4
4
|
//#region ../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
5
|
-
var useLayoutEffect2 =
|
|
5
|
+
var useLayoutEffect2 = globalThis?.document ? react.useLayoutEffect : () => {};
|
|
6
6
|
//#endregion
|
|
7
7
|
exports.useLayoutEffect2 = useLayoutEffect2;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
//#region ../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
3
|
-
var useLayoutEffect2 =
|
|
3
|
+
var useLayoutEffect2 = globalThis?.document ? React$1.useLayoutEffect : () => {};
|
|
4
4
|
//#endregion
|
|
5
5
|
export { useLayoutEffect2 };
|
|
@@ -4,22 +4,25 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
4
4
|
let react = require("react");
|
|
5
5
|
react = require_runtime.__toESM(react, 1);
|
|
6
6
|
//#region ../../node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
7
|
+
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
8
|
+
position: "absolute",
|
|
9
|
+
border: 0,
|
|
10
|
+
width: 1,
|
|
11
|
+
height: 1,
|
|
12
|
+
padding: 0,
|
|
13
|
+
margin: -1,
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
clip: "rect(0, 0, 0, 0)",
|
|
16
|
+
whiteSpace: "nowrap",
|
|
17
|
+
wordWrap: "normal"
|
|
18
|
+
});
|
|
7
19
|
var NAME = "VisuallyHidden";
|
|
8
20
|
var VisuallyHidden = react.forwardRef((props, forwardedRef) => {
|
|
9
21
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.Primitive.span, {
|
|
10
22
|
...props,
|
|
11
23
|
ref: forwardedRef,
|
|
12
24
|
style: {
|
|
13
|
-
|
|
14
|
-
border: 0,
|
|
15
|
-
width: 1,
|
|
16
|
-
height: 1,
|
|
17
|
-
padding: 0,
|
|
18
|
-
margin: -1,
|
|
19
|
-
overflow: "hidden",
|
|
20
|
-
clip: "rect(0, 0, 0, 0)",
|
|
21
|
-
whiteSpace: "nowrap",
|
|
22
|
-
wordWrap: "normal",
|
|
25
|
+
...VISUALLY_HIDDEN_STYLES,
|
|
23
26
|
...props.style
|
|
24
27
|
}
|
|
25
28
|
});
|
|
@@ -28,4 +31,4 @@ VisuallyHidden.displayName = NAME;
|
|
|
28
31
|
var Root = VisuallyHidden;
|
|
29
32
|
//#endregion
|
|
30
33
|
exports.Root = Root;
|
|
31
|
-
exports.
|
|
34
|
+
exports.VISUALLY_HIDDEN_STYLES = VISUALLY_HIDDEN_STYLES;
|
|
@@ -2,22 +2,25 @@ import { Primitive } from "../../react-primitive/dist/index.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
//#region ../../node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
5
|
+
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
6
|
+
position: "absolute",
|
|
7
|
+
border: 0,
|
|
8
|
+
width: 1,
|
|
9
|
+
height: 1,
|
|
10
|
+
padding: 0,
|
|
11
|
+
margin: -1,
|
|
12
|
+
overflow: "hidden",
|
|
13
|
+
clip: "rect(0, 0, 0, 0)",
|
|
14
|
+
whiteSpace: "nowrap",
|
|
15
|
+
wordWrap: "normal"
|
|
16
|
+
});
|
|
5
17
|
var NAME = "VisuallyHidden";
|
|
6
18
|
var VisuallyHidden = React$1.forwardRef((props, forwardedRef) => {
|
|
7
19
|
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
8
20
|
...props,
|
|
9
21
|
ref: forwardedRef,
|
|
10
22
|
style: {
|
|
11
|
-
|
|
12
|
-
border: 0,
|
|
13
|
-
width: 1,
|
|
14
|
-
height: 1,
|
|
15
|
-
padding: 0,
|
|
16
|
-
margin: -1,
|
|
17
|
-
overflow: "hidden",
|
|
18
|
-
clip: "rect(0, 0, 0, 0)",
|
|
19
|
-
whiteSpace: "nowrap",
|
|
20
|
-
wordWrap: "normal",
|
|
23
|
+
...VISUALLY_HIDDEN_STYLES,
|
|
21
24
|
...props.style
|
|
22
25
|
}
|
|
23
26
|
});
|
|
@@ -25,4 +28,4 @@ var VisuallyHidden = React$1.forwardRef((props, forwardedRef) => {
|
|
|
25
28
|
VisuallyHidden.displayName = NAME;
|
|
26
29
|
var Root = VisuallyHidden;
|
|
27
30
|
//#endregion
|
|
28
|
-
export { Root,
|
|
31
|
+
export { Root, VISUALLY_HIDDEN_STYLES };
|