@basic-ui/core 0.0.29 → 0.0.33
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/build/cjs/index.js +90 -71
- package/build/cjs/index.js.map +1 -1
- package/build/esm/FocusLock/useFocusLock.js +21 -7
- package/build/esm/FocusLock/useFocusLock.js.map +1 -1
- package/build/esm/Menu/MenuList.js +7 -5
- package/build/esm/Menu/MenuList.js.map +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +1 -0
- package/build/esm/Tooltip/Tooltip.js +10 -3
- package/build/esm/Tooltip/Tooltip.js.map +1 -1
- package/build/esm/Tooltip/stateMachine.d.ts +17 -19
- package/build/esm/Tooltip/stateMachine.js +45 -49
- package/build/esm/Tooltip/stateMachine.js.map +1 -1
- package/build/esm/Tooltip/useTooltip.js +9 -9
- package/build/esm/Tooltip/useTooltip.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +384 -89
- package/package.json +5 -5
- package/src/Accordion/Accordion.story.tsx +72 -0
- package/src/Accordion/Accordion.tsx +51 -0
- package/src/Accordion/AccordionBody.tsx +53 -0
- package/src/Accordion/AccordionHeader.tsx +165 -0
- package/src/Accordion/AccordionItem.tsx +43 -0
- package/src/Accordion/context.ts +35 -0
- package/src/Accordion/index.ts +4 -0
- package/src/Accordion/scopeQuery.ts +7 -0
- package/src/Accordion/styles.css +21 -0
- package/src/CheckBox/CheckBox.tsx +41 -0
- package/src/CheckBox/index.ts +1 -0
- package/src/ComboBox/ComboBox.story.tsx +118 -0
- package/src/ComboBox/Combobox.tsx +153 -0
- package/src/ComboBox/ComboboxButton.tsx +60 -0
- package/src/ComboBox/ComboboxInput.tsx +178 -0
- package/src/ComboBox/ComboboxLabel.tsx +32 -0
- package/src/ComboBox/ComboboxList.tsx +47 -0
- package/src/ComboBox/ComboboxOption.tsx +107 -0
- package/src/ComboBox/ComboboxPopover.tsx +58 -0
- package/src/ComboBox/cities.ts +23194 -0
- package/src/ComboBox/context.ts +33 -0
- package/src/ComboBox/hooks.tsx +428 -0
- package/src/ComboBox/index.ts +8 -0
- package/src/ComboBox/makeHash.ts +19 -0
- package/src/ComboBox/scopeQuery.ts +6 -0
- package/src/ComboBox/styles.css +30 -0
- package/src/FocusLock/FocusLock.tsx +59 -0
- package/src/FocusLock/index.ts +1 -0
- package/src/FocusLock/tabUtils.ts +28 -0
- package/src/FocusLock/useFocusLock.ts +61 -0
- package/src/List/List.story.tsx +17 -0
- package/src/List/List.tsx +17 -0
- package/src/List/ListItem.tsx +23 -0
- package/src/List/context.ts +19 -0
- package/src/List/index.ts +2 -0
- package/src/Menu/.gitkeep +0 -0
- package/src/Menu/Menu.story.tsx +158 -0
- package/src/Menu/Menu.tsx +60 -0
- package/src/Menu/MenuButton.tsx +83 -0
- package/src/Menu/MenuItem.tsx +83 -0
- package/src/Menu/MenuList.tsx +201 -0
- package/src/Menu/MenuPopover.tsx +25 -0
- package/src/Menu/context.ts +32 -0
- package/src/Menu/index.ts +5 -0
- package/src/Menu/scope.ts +7 -0
- package/src/Menu/styles.css +42 -0
- package/src/Modal/Modal.story.tsx +242 -0
- package/src/Modal/Modal.tsx +42 -0
- package/src/Modal/ModalBackdrop.tsx +72 -0
- package/src/Modal/NavDrawer.story.tsx +157 -0
- package/src/Modal/index.ts +2 -0
- package/src/Modal/styles.css +46 -0
- package/src/Popover/.gitkeep +0 -0
- package/src/Popper/Popper.story.tsx +267 -0
- package/src/Popper/Popper.tsx +149 -0
- package/src/Popper/PopperArrow.tsx +36 -0
- package/src/Popper/context.ts +9 -0
- package/src/Popper/index.ts +3 -0
- package/src/Popper/styles.css +60 -0
- package/src/Portal/Portal.tsx +20 -0
- package/src/Portal/index.ts +1 -0
- package/src/RadioButton/RadioButton.story.tsx +73 -0
- package/src/RadioButton/RadioButton.tsx +48 -0
- package/src/RadioButton/RadioGroup.tsx +56 -0
- package/src/RadioButton/context.ts +19 -0
- package/src/RadioButton/index.ts +2 -0
- package/src/SkipNav/SkipNav.tsx +16 -0
- package/src/SkipNav/index.tsx +1 -0
- package/src/Spinner/Spinner.story.tsx +30 -0
- package/src/Spinner/Spinner.tsx +112 -0
- package/src/Spinner/SpinnerButton.tsx +48 -0
- package/src/Spinner/context.ts +21 -0
- package/src/Spinner/index.ts +2 -0
- package/src/Spinner/styles.css +23 -0
- package/src/Tabs/Tab.story.tsx +78 -0
- package/src/Tabs/Tab.tsx +131 -0
- package/src/Tabs/TabList.tsx +63 -0
- package/src/Tabs/TabPanel.tsx +52 -0
- package/src/Tabs/TabPanels.tsx +30 -0
- package/src/Tabs/Tabs.tsx +47 -0
- package/src/Tabs/context.ts +30 -0
- package/src/Tabs/index.tsx +5 -0
- package/src/Tabs/scopeQuery.ts +6 -0
- package/src/Tabs/styles.css +0 -0
- package/src/Tooltip/.gitkeep +0 -0
- package/src/Tooltip/Tooltip.story.tsx +59 -0
- package/src/Tooltip/Tooltip.tsx +48 -0
- package/src/Tooltip/index.ts +1 -0
- package/src/Tooltip/stateMachine.ts +196 -0
- package/src/Tooltip/styles.css +17 -0
- package/src/Tooltip/useTooltip.ts +128 -0
- package/src/hooks/index.ts +14 -0
- package/src/hooks/useAutoFocus.ts +13 -0
- package/src/hooks/useChildrenCounter.ts +50 -0
- package/src/hooks/useControlledState.ts +37 -0
- package/src/hooks/useFocusReturn.ts +23 -0
- package/src/hooks/useFocusState.ts +28 -0
- package/src/hooks/useGestureHandlers.ts +217 -0
- package/src/hooks/useId.ts +18 -0
- package/src/hooks/useMeasure.ts +33 -0
- package/src/hooks/useOnClickOutside.ts +32 -0
- package/src/hooks/useOnKeyDown.ts +18 -0
- package/src/hooks/useReducerMachine.ts +59 -0
- package/src/hooks/useRemoveBodyScroll.ts +37 -0
- package/src/hooks/useScope.ts +51 -0
- package/src/hooks/useThrottle.ts +19 -0
- package/src/index.ts +19 -0
- package/src/utils/assignRef.ts +27 -0
- package/src/utils/clamp.ts +3 -0
- package/src/utils/createSubscription.ts +16 -0
- package/src/utils/getCircularIndex.ts +7 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/rubberBandClamp.ts +25 -0
- package/src/utils/wrapEvent.ts +20 -0
package/build/cjs/index.js
CHANGED
|
@@ -1634,6 +1634,7 @@ const getTabblableNodes = parentNode => {
|
|
|
1634
1634
|
return Array.from(parentNode.querySelectorAll(tabblable));
|
|
1635
1635
|
};
|
|
1636
1636
|
|
|
1637
|
+
const focusLockStack = [];
|
|
1637
1638
|
function useFocusLock(ref, opts) {
|
|
1638
1639
|
const {
|
|
1639
1640
|
enabled = true,
|
|
@@ -1641,28 +1642,41 @@ function useFocusLock(ref, opts) {
|
|
|
1641
1642
|
lockEndRef
|
|
1642
1643
|
} = opts;
|
|
1643
1644
|
react.useEffect(() => {
|
|
1644
|
-
|
|
1645
|
+
const rootEl = ref.current;
|
|
1646
|
+
|
|
1647
|
+
if (enabled && rootEl) {
|
|
1648
|
+
focusLockStack.push(rootEl);
|
|
1649
|
+
|
|
1645
1650
|
const listener = event => {
|
|
1651
|
+
const isActiveFocusLock = focusLockStack[focusLockStack.length - 1] === rootEl;
|
|
1652
|
+
|
|
1653
|
+
if (!isActiveFocusLock) {
|
|
1654
|
+
// Not the currently focused lock. Forget about it.
|
|
1655
|
+
return;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1646
1658
|
if (event.target === lockEndRef.current) {
|
|
1647
|
-
|
|
1659
|
+
rootEl.focus();
|
|
1648
1660
|
} else if (event.target === lockStartRef.current) {
|
|
1649
|
-
const nodes = getTabblableNodes(
|
|
1661
|
+
const nodes = getTabblableNodes(rootEl);
|
|
1650
1662
|
|
|
1651
1663
|
if (nodes.length > 0) {
|
|
1652
1664
|
const nodeToFocus = nodes.length - 1;
|
|
1653
1665
|
nodes[nodeToFocus].focus();
|
|
1654
1666
|
} else {
|
|
1655
|
-
|
|
1667
|
+
rootEl.focus();
|
|
1656
1668
|
}
|
|
1657
|
-
} else if (document !== event.target &&
|
|
1669
|
+
} else if (document !== event.target && rootEl !== event.target && !rootEl.contains(event.target)) {
|
|
1658
1670
|
event.preventDefault();
|
|
1659
|
-
|
|
1671
|
+
rootEl.focus();
|
|
1660
1672
|
}
|
|
1661
1673
|
};
|
|
1662
1674
|
|
|
1663
1675
|
document.addEventListener('focusin', listener);
|
|
1664
1676
|
return () => {
|
|
1665
|
-
document.removeEventListener('focusin', listener);
|
|
1677
|
+
document.removeEventListener('focusin', listener); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1678
|
+
|
|
1679
|
+
focusLockStack.pop();
|
|
1666
1680
|
};
|
|
1667
1681
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1668
1682
|
|
|
@@ -1893,7 +1907,7 @@ function queryScope(type, props) {
|
|
|
1893
1907
|
|
|
1894
1908
|
const useEnhancedEffect$1 = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
|
|
1895
1909
|
const MenuList = /*#__PURE__*/react.forwardRef(function MenuList(props, forwardedRef) {
|
|
1896
|
-
var _buttonRef$
|
|
1910
|
+
var _buttonRef$current3;
|
|
1897
1911
|
|
|
1898
1912
|
const {
|
|
1899
1913
|
as: Comp = 'ul',
|
|
@@ -1944,7 +1958,9 @@ const MenuList = /*#__PURE__*/react.forwardRef(function MenuList(props, forwarde
|
|
|
1944
1958
|
setMounted(true);
|
|
1945
1959
|
}, [mounted, navigationItem, onNavigate, openWithArrowKeyRef, scope, defaultActiveItemValue]);
|
|
1946
1960
|
useOnClickOutside(menuListRef, e => {
|
|
1947
|
-
|
|
1961
|
+
var _buttonRef$current;
|
|
1962
|
+
|
|
1963
|
+
if (e.target instanceof HTMLElement && e.target !== buttonRef.current && !((_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(e.target))) {
|
|
1948
1964
|
onChange && onChange(e, false);
|
|
1949
1965
|
}
|
|
1950
1966
|
|
|
@@ -1956,12 +1972,12 @@ const MenuList = /*#__PURE__*/react.forwardRef(function MenuList(props, forwarde
|
|
|
1956
1972
|
case 'Escape':
|
|
1957
1973
|
case 'Tab':
|
|
1958
1974
|
{
|
|
1959
|
-
var _buttonRef$
|
|
1975
|
+
var _buttonRef$current2;
|
|
1960
1976
|
|
|
1961
1977
|
onChange && onChange(e, false);
|
|
1962
1978
|
e.preventDefault(); // prevents focusing on next element, because we will be handling it
|
|
1963
1979
|
|
|
1964
|
-
(_buttonRef$
|
|
1980
|
+
(_buttonRef$current2 = buttonRef.current) == null ? void 0 : _buttonRef$current2.focus();
|
|
1965
1981
|
break;
|
|
1966
1982
|
}
|
|
1967
1983
|
|
|
@@ -2046,7 +2062,7 @@ const MenuList = /*#__PURE__*/react.forwardRef(function MenuList(props, forwarde
|
|
|
2046
2062
|
ref: assignMultipleRefs(forwardedRef, menuListRef),
|
|
2047
2063
|
id: menuListIdRef.current,
|
|
2048
2064
|
role: "menu",
|
|
2049
|
-
"aria-labelledby": (_buttonRef$
|
|
2065
|
+
"aria-labelledby": (_buttonRef$current3 = buttonRef.current) == null ? void 0 : _buttonRef$current3.id,
|
|
2050
2066
|
"data-menu-list": "",
|
|
2051
2067
|
tabIndex: "-1",
|
|
2052
2068
|
onKeyDown: wrapEvent(onKeyDown, handleKeyDown)
|
|
@@ -2739,7 +2755,7 @@ let restTimeout;
|
|
|
2739
2755
|
function startRestTimer() {
|
|
2740
2756
|
window.clearTimeout(restTimeout);
|
|
2741
2757
|
restTimeout = window.setTimeout(() => {
|
|
2742
|
-
send(
|
|
2758
|
+
send(Rest, undefined);
|
|
2743
2759
|
}, 200);
|
|
2744
2760
|
}
|
|
2745
2761
|
|
|
@@ -2752,7 +2768,7 @@ let leavingVisibleTimer;
|
|
|
2752
2768
|
|
|
2753
2769
|
function startLeavingVisibleTimer() {
|
|
2754
2770
|
window.clearTimeout(leavingVisibleTimer);
|
|
2755
|
-
leavingVisibleTimer = window.setTimeout(() => send(
|
|
2771
|
+
leavingVisibleTimer = window.setTimeout(() => send(TimeComplete, undefined), 100);
|
|
2756
2772
|
}
|
|
2757
2773
|
|
|
2758
2774
|
function clearLeavingVisibleTimer() {
|
|
@@ -2761,35 +2777,31 @@ function clearLeavingVisibleTimer() {
|
|
|
2761
2777
|
// State machine
|
|
2762
2778
|
|
|
2763
2779
|
|
|
2764
|
-
|
|
2780
|
+
// Nothing goin' on
|
|
2781
|
+
const Idle = 'IDLE'; // We're considering showing the tooltip, but we're gonna wait a sec
|
|
2765
2782
|
|
|
2766
|
-
|
|
2767
|
-
TooltipStates["Idle"] = "IDLE";
|
|
2768
|
-
TooltipStates["Focused"] = "FOCUSED";
|
|
2769
|
-
TooltipStates["Visible"] = "VISIBLE";
|
|
2770
|
-
TooltipStates["LeavingVisible"] = "LEAVING_VISIBLE";
|
|
2771
|
-
TooltipStates["Dismissed"] = "DISMISSED";
|
|
2772
|
-
})(TooltipStates || (TooltipStates = {}));
|
|
2783
|
+
const Focused = 'FOCUSED'; // It's on!
|
|
2773
2784
|
|
|
2774
|
-
|
|
2785
|
+
const Visible = 'VISIBLE'; // Focus has left, but we want to keep it visible for a sec
|
|
2775
2786
|
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
TooltipEventTypes["Focus"] = "FOCUS";
|
|
2779
|
-
TooltipEventTypes["GlobalMouseMove"] = "GLOBAL_MOUSE_MOVE";
|
|
2780
|
-
TooltipEventTypes["MouseDown"] = "MOUSE_DOWN";
|
|
2781
|
-
TooltipEventTypes["MouseEnter"] = "MOUSE_ENTER";
|
|
2782
|
-
TooltipEventTypes["MouseLeave"] = "MOUSE_LEAVE";
|
|
2783
|
-
TooltipEventTypes["MouseMove"] = "MOUSE_MOVE";
|
|
2784
|
-
TooltipEventTypes["Rest"] = "REST";
|
|
2785
|
-
TooltipEventTypes["SelectWithKeyboard"] = "SELECT_WITH_KEYBOARD";
|
|
2786
|
-
TooltipEventTypes["TimeComplete"] = "TIME_COMPLETE";
|
|
2787
|
-
})(TooltipEventTypes || (TooltipEventTypes = {}));
|
|
2787
|
+
const LeavingVisible = 'LEAVING_VISIBLE'; // The user clicked the tool, so we want to hide the thing, we can't just use
|
|
2788
|
+
// IDLE because we need to ignore mousemove, etc.
|
|
2788
2789
|
|
|
2790
|
+
const Dismissed = 'DISMISSED';
|
|
2791
|
+
const Blur = 'BLUR';
|
|
2792
|
+
const Focus = 'FOCUS';
|
|
2793
|
+
const GlobalMouseMove = 'GLOBAL_MOUSE_MOVE';
|
|
2794
|
+
const MouseDown = 'MOUSE_DOWN';
|
|
2795
|
+
const MouseEnter = 'MOUSE_ENTER';
|
|
2796
|
+
const MouseLeave = 'MOUSE_LEAVE';
|
|
2797
|
+
const MouseMove = 'MOUSE_MOVE';
|
|
2798
|
+
const Rest = 'REST';
|
|
2799
|
+
const SelectWithKeyboard = 'SELECT_WITH_KEYBOARD';
|
|
2800
|
+
const TimeComplete = 'TIME_COMPLETE';
|
|
2789
2801
|
const subscription = createSubscription();
|
|
2790
2802
|
const state = {
|
|
2791
2803
|
current: {
|
|
2792
|
-
state:
|
|
2804
|
+
state: Idle,
|
|
2793
2805
|
id: ''
|
|
2794
2806
|
}
|
|
2795
2807
|
};
|
|
@@ -2799,40 +2811,40 @@ function clearContextId() {
|
|
|
2799
2811
|
}
|
|
2800
2812
|
|
|
2801
2813
|
const chart = {
|
|
2802
|
-
initial:
|
|
2814
|
+
initial: Idle,
|
|
2803
2815
|
states: {
|
|
2804
|
-
[
|
|
2816
|
+
[Idle]: {
|
|
2805
2817
|
enter: () => {
|
|
2806
2818
|
clearContextId();
|
|
2807
2819
|
},
|
|
2808
2820
|
on: {
|
|
2809
|
-
[
|
|
2810
|
-
[
|
|
2821
|
+
[MouseEnter]: Focused,
|
|
2822
|
+
[Focus]: Visible
|
|
2811
2823
|
}
|
|
2812
2824
|
},
|
|
2813
|
-
[
|
|
2825
|
+
[Focused]: {
|
|
2814
2826
|
enter: startRestTimer,
|
|
2815
2827
|
leave: clearRestTimer,
|
|
2816
2828
|
on: {
|
|
2817
|
-
[
|
|
2818
|
-
[
|
|
2819
|
-
[
|
|
2820
|
-
[
|
|
2821
|
-
[
|
|
2829
|
+
[MouseMove]: Focused,
|
|
2830
|
+
[MouseLeave]: Idle,
|
|
2831
|
+
[MouseDown]: Dismissed,
|
|
2832
|
+
[Blur]: Idle,
|
|
2833
|
+
[Rest]: Visible
|
|
2822
2834
|
}
|
|
2823
2835
|
},
|
|
2824
|
-
[
|
|
2836
|
+
[Visible]: {
|
|
2825
2837
|
on: {
|
|
2826
|
-
[
|
|
2827
|
-
[
|
|
2828
|
-
[
|
|
2829
|
-
[
|
|
2830
|
-
[
|
|
2831
|
-
[
|
|
2832
|
-
[
|
|
2838
|
+
[Focus]: Focused,
|
|
2839
|
+
[MouseEnter]: Focused,
|
|
2840
|
+
[MouseLeave]: LeavingVisible,
|
|
2841
|
+
[Blur]: LeavingVisible,
|
|
2842
|
+
[MouseDown]: Dismissed,
|
|
2843
|
+
[SelectWithKeyboard]: Dismissed,
|
|
2844
|
+
[GlobalMouseMove]: LeavingVisible
|
|
2833
2845
|
}
|
|
2834
2846
|
},
|
|
2835
|
-
[
|
|
2847
|
+
[LeavingVisible]: {
|
|
2836
2848
|
enter: () => {
|
|
2837
2849
|
startLeavingVisibleTimer();
|
|
2838
2850
|
},
|
|
@@ -2841,18 +2853,18 @@ const chart = {
|
|
|
2841
2853
|
clearContextId();
|
|
2842
2854
|
},
|
|
2843
2855
|
on: {
|
|
2844
|
-
[
|
|
2845
|
-
[
|
|
2846
|
-
[
|
|
2856
|
+
[MouseEnter]: Visible,
|
|
2857
|
+
[Focus]: Visible,
|
|
2858
|
+
[TimeComplete]: Idle
|
|
2847
2859
|
}
|
|
2848
2860
|
},
|
|
2849
|
-
[
|
|
2861
|
+
[Dismissed]: {
|
|
2850
2862
|
leave: () => {
|
|
2851
2863
|
clearContextId();
|
|
2852
2864
|
},
|
|
2853
2865
|
on: {
|
|
2854
|
-
[
|
|
2855
|
-
[
|
|
2866
|
+
[MouseLeave]: Idle,
|
|
2867
|
+
[Blur]: Idle
|
|
2856
2868
|
}
|
|
2857
2869
|
}
|
|
2858
2870
|
}
|
|
@@ -2915,35 +2927,35 @@ function useTooltip(childProps, childRef, tooltipProps) {
|
|
|
2915
2927
|
const id = useId('');
|
|
2916
2928
|
react.useEffect(() => {
|
|
2917
2929
|
subscription.subscribe(() => {
|
|
2918
|
-
setVisible((state.current.state ===
|
|
2930
|
+
setVisible((state.current.state === Visible || state.current.state === LeavingVisible) && state.current.id === id);
|
|
2919
2931
|
});
|
|
2920
2932
|
}, [id]);
|
|
2921
2933
|
|
|
2922
2934
|
function handleMouseEnter() {
|
|
2923
|
-
send(
|
|
2935
|
+
send(MouseEnter, {
|
|
2924
2936
|
id
|
|
2925
2937
|
});
|
|
2926
2938
|
}
|
|
2927
2939
|
|
|
2928
2940
|
function handleMouseMove() {
|
|
2929
|
-
send(
|
|
2941
|
+
send(MouseMove, {
|
|
2930
2942
|
id
|
|
2931
2943
|
});
|
|
2932
2944
|
}
|
|
2933
2945
|
|
|
2934
2946
|
function handleMouseLeave() {
|
|
2935
|
-
send(
|
|
2947
|
+
send(MouseLeave);
|
|
2936
2948
|
}
|
|
2937
2949
|
|
|
2938
2950
|
function handleMouseDown() {
|
|
2939
2951
|
// Allow quick click from one tool to another
|
|
2940
2952
|
if (state.current.id === id) {
|
|
2941
|
-
send(
|
|
2953
|
+
send(MouseDown);
|
|
2942
2954
|
}
|
|
2943
2955
|
}
|
|
2944
2956
|
|
|
2945
2957
|
function handleFocus() {
|
|
2946
|
-
send(
|
|
2958
|
+
send(Focus, {
|
|
2947
2959
|
id
|
|
2948
2960
|
});
|
|
2949
2961
|
}
|
|
@@ -2951,13 +2963,13 @@ function useTooltip(childProps, childRef, tooltipProps) {
|
|
|
2951
2963
|
function handleBlur() {
|
|
2952
2964
|
// Allow quick click from one tool to another
|
|
2953
2965
|
if (state.current.id === id) {
|
|
2954
|
-
send(
|
|
2966
|
+
send(Blur, undefined);
|
|
2955
2967
|
}
|
|
2956
2968
|
}
|
|
2957
2969
|
|
|
2958
2970
|
function handleKeyDown(event) {
|
|
2959
2971
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
2960
|
-
send(
|
|
2972
|
+
send(SelectWithKeyboard);
|
|
2961
2973
|
}
|
|
2962
2974
|
}
|
|
2963
2975
|
|
|
@@ -2998,9 +3010,10 @@ const Tooltip = /*#__PURE__*/react.forwardRef(function Tooltip(props, forwardedR
|
|
|
2998
3010
|
const {
|
|
2999
3011
|
as: Comp = 'div',
|
|
3000
3012
|
innerAs,
|
|
3001
|
-
children
|
|
3013
|
+
children,
|
|
3014
|
+
disabled = false
|
|
3002
3015
|
} = props,
|
|
3003
|
-
otherProps = _objectWithoutPropertiesLoose__default['default'](props, ["as", "innerAs", "children"]);
|
|
3016
|
+
otherProps = _objectWithoutPropertiesLoose__default['default'](props, ["as", "innerAs", "children", "disabled"]);
|
|
3004
3017
|
|
|
3005
3018
|
const child = react.Children.only(children);
|
|
3006
3019
|
const [childProps, _ref] = useTooltip(child.props, child.ref, otherProps);
|
|
@@ -3010,6 +3023,12 @@ const Tooltip = /*#__PURE__*/react.forwardRef(function Tooltip(props, forwardedR
|
|
|
3010
3023
|
} = _ref,
|
|
3011
3024
|
tooltipProps = _objectWithoutPropertiesLoose__default['default'](_ref, ["visible"]);
|
|
3012
3025
|
|
|
3026
|
+
if (disabled) {
|
|
3027
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
3028
|
+
children: child
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3013
3032
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3014
3033
|
children: [/*#__PURE__*/react.cloneElement(child, childProps), visible && /*#__PURE__*/jsxRuntime.jsx(Comp, _extends__default['default']({
|
|
3015
3034
|
as: innerAs,
|