bootstrap-rn 0.4.5 → 0.4.7
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/lib/module/Context.js.map +1 -1
- package/lib/module/Provider.js +3 -7
- package/lib/module/Provider.js.map +1 -1
- package/lib/module/components/Body.js +10 -5
- package/lib/module/components/Body.js.map +1 -1
- package/lib/module/components/buttons/Button.js +10 -8
- package/lib/module/components/buttons/Button.js.map +1 -1
- package/lib/module/components/close/CloseButton.js +7 -3
- package/lib/module/components/close/CloseButton.js.map +1 -1
- package/lib/module/components/collapse/useCollapse.js +2 -3
- package/lib/module/components/collapse/useCollapse.js.map +1 -1
- package/lib/module/components/dropdown/Dropdown.js +1 -2
- package/lib/module/components/dropdown/Dropdown.js.map +1 -1
- package/lib/module/components/dropdown/DropdownContext.js.map +1 -1
- package/lib/module/components/dropdown/DropdownMenu.js +33 -59
- package/lib/module/components/dropdown/DropdownMenu.js.map +1 -1
- package/lib/module/components/dropdown/useDismissDropdown.js +5 -4
- package/lib/module/components/dropdown/useDismissDropdown.js.map +1 -1
- package/lib/module/components/dropdown/useDropdown.js +35 -11
- package/lib/module/components/dropdown/useDropdown.js.map +1 -1
- package/lib/module/components/dropdown/useToggleDropdown.js +4 -6
- package/lib/module/components/dropdown/useToggleDropdown.js.map +1 -1
- package/lib/module/components/forms/FormCheckInput.js +1 -1
- package/lib/module/components/forms/Input.js +1 -1
- package/lib/module/components/forms/internals/PickerNative.js +1 -1
- package/lib/module/components/forms/internals/PickerNative.js.map +1 -1
- package/lib/module/components/helpers/BackdropHandler.js +6 -92
- package/lib/module/components/helpers/BackdropHandler.js.map +1 -1
- package/lib/module/components/helpers/BackdropHandler.web.js +8 -0
- package/lib/module/components/helpers/BackdropHandler.web.js.map +1 -0
- package/lib/module/components/helpers/Dialog.js +29 -0
- package/lib/module/components/helpers/Dialog.js.map +1 -0
- package/lib/module/components/helpers/Dialog.web.js +117 -0
- package/lib/module/components/helpers/Dialog.web.js.map +1 -0
- package/lib/module/components/helpers/Portal.js +5 -0
- package/lib/module/components/helpers/Portal.js.map +1 -0
- package/lib/module/components/helpers/Portal.web.js +16 -0
- package/lib/module/components/helpers/Portal.web.js.map +1 -0
- package/lib/module/components/helpers/PortalHost.js +5 -0
- package/lib/module/components/helpers/PortalHost.js.map +1 -0
- package/lib/module/components/helpers/PortalHost.web.js +15 -0
- package/lib/module/components/helpers/PortalHost.web.js.map +1 -0
- package/lib/module/components/modal/Modal.js +58 -47
- package/lib/module/components/modal/Modal.js.map +1 -1
- package/lib/module/components/modal/ModalContext.js.map +1 -1
- package/lib/module/components/modal/ModalTitle.js +6 -0
- package/lib/module/components/modal/ModalTitle.js.map +1 -1
- package/lib/module/components/modal/useModal.js +4 -13
- package/lib/module/components/modal/useModal.js.map +1 -1
- package/lib/module/components/nav/useTabbable.js +2 -3
- package/lib/module/components/nav/useTabbable.js.map +1 -1
- package/lib/module/components/navbar/NavbarToggler.js +1 -1
- package/lib/module/components/navbar/useNavbar.js +2 -3
- package/lib/module/components/navbar/useNavbar.js.map +1 -1
- package/lib/module/components/offcanvas/Offcanvas.js +84 -83
- package/lib/module/components/offcanvas/Offcanvas.js.map +1 -1
- package/lib/module/components/offcanvas/OffcanvasContext.js.map +1 -1
- package/lib/module/components/offcanvas/OffcanvasTitle.js +6 -0
- package/lib/module/components/offcanvas/OffcanvasTitle.js.map +1 -1
- package/lib/module/components/offcanvas/useOffcanvas.js +6 -14
- package/lib/module/components/offcanvas/useOffcanvas.js.map +1 -1
- package/lib/module/components/pagination/PaginationItem.js +39 -39
- package/lib/module/components/popover/Popover.js +6 -8
- package/lib/module/components/popover/Popover.js.map +1 -1
- package/lib/module/components/popover/PopoverArrow.js +18 -9
- package/lib/module/components/popover/PopoverArrow.js.map +1 -1
- package/lib/module/components/popover/PopoverContext.js.map +1 -1
- package/lib/module/components/popover/injectPopover.js +48 -45
- package/lib/module/components/popover/injectPopover.js.map +1 -1
- package/lib/module/components/tooltip/Tooltip.js +7 -23
- package/lib/module/components/tooltip/Tooltip.js.map +1 -1
- package/lib/module/components/tooltip/TooltipArrow.js +22 -12
- package/lib/module/components/tooltip/TooltipArrow.js.map +1 -1
- package/lib/module/components/tooltip/TooltipContext.js.map +1 -1
- package/lib/module/components/tooltip/injectTooltip.js +46 -42
- package/lib/module/components/tooltip/injectTooltip.js.map +1 -1
- package/lib/module/hooks/useBackgroundNative.js.map +1 -1
- package/lib/module/hooks/useFocusRing.js +13 -0
- package/lib/module/hooks/useFocusRing.js.map +1 -0
- package/lib/module/hooks/useFocusRing.web.js +5 -0
- package/lib/module/hooks/useFocusRing.web.js.map +1 -0
- package/lib/module/hooks/useInteractionState.js +11 -11
- package/lib/module/hooks/useInteractionState.js.map +1 -1
- package/lib/module/hooks/useOverlay.js +121 -0
- package/lib/module/hooks/useOverlay.js.map +1 -0
- package/lib/module/hooks/useOverlay.web.js +113 -0
- package/lib/module/hooks/useOverlay.web.js.map +1 -0
- package/lib/module/hooks/useScrollbarEffects.js +7 -60
- package/lib/module/hooks/useScrollbarEffects.js.map +1 -1
- package/lib/module/hooks/useScrollbarEffects.web.js +59 -0
- package/lib/module/hooks/useScrollbarEffects.web.js.map +1 -0
- package/lib/module/index.js +3 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/style/StyleSheet.js +1 -3
- package/lib/module/style/StyleSheet.js.map +1 -1
- package/lib/module/theme/variables.js +9 -9
- package/lib/module/utils.js +0 -11
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/Context.d.ts +0 -1
- package/lib/typescript/Context.d.ts.map +1 -1
- package/lib/typescript/Provider.d.ts.map +1 -1
- package/lib/typescript/components/Body.d.ts +2 -2
- package/lib/typescript/components/Body.d.ts.map +1 -1
- package/lib/typescript/components/Link.d.ts +1 -1
- package/lib/typescript/components/Link.d.ts.map +1 -1
- package/lib/typescript/components/Pressable.d.ts +1 -1
- package/lib/typescript/components/Pressable.d.ts.map +1 -1
- package/lib/typescript/components/TextInput.d.ts +3 -3
- package/lib/typescript/components/TextInput.d.ts.map +1 -1
- package/lib/typescript/components/buttons/Button.d.ts +1 -1
- package/lib/typescript/components/buttons/Button.d.ts.map +1 -1
- package/lib/typescript/components/close/CloseButton.d.ts +1 -1
- package/lib/typescript/components/close/CloseButton.d.ts.map +1 -1
- package/lib/typescript/components/collapse/useCollapse.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/Dropdown.d.ts +0 -1
- package/lib/typescript/components/dropdown/Dropdown.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/DropdownContext.d.ts +14 -3
- package/lib/typescript/components/dropdown/DropdownContext.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/DropdownMenu.d.ts +0 -1
- package/lib/typescript/components/dropdown/DropdownMenu.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/useDismissDropdown.d.ts +1 -1
- package/lib/typescript/components/dropdown/useDismissDropdown.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/useDropdown.d.ts +38 -4
- package/lib/typescript/components/dropdown/useDropdown.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/useToggleDropdown.d.ts +4 -3
- package/lib/typescript/components/dropdown/useToggleDropdown.d.ts.map +1 -1
- package/lib/typescript/components/forms/Picker.d.ts +1 -1
- package/lib/typescript/components/forms/internals/PickerNative.d.ts +1 -1
- package/lib/typescript/components/forms/internals/PickerNative.d.ts.map +1 -1
- package/lib/typescript/components/forms/internals/PickerWeb.d.ts +1 -1
- package/lib/typescript/components/forms/internals/PickerWeb.d.ts.map +1 -1
- package/lib/typescript/components/helpers/BackdropHandler.d.ts +2 -11
- package/lib/typescript/components/helpers/BackdropHandler.d.ts.map +1 -1
- package/lib/typescript/components/helpers/BackdropHandler.web.d.ts +3 -0
- package/lib/typescript/components/helpers/BackdropHandler.web.d.ts.map +1 -0
- package/lib/typescript/components/helpers/Dialog.d.ts +15 -0
- package/lib/typescript/components/helpers/Dialog.d.ts.map +1 -0
- package/lib/typescript/components/helpers/Dialog.web.d.ts +15 -0
- package/lib/typescript/components/helpers/Dialog.web.d.ts.map +1 -0
- package/lib/typescript/components/helpers/Portal.d.ts +8 -0
- package/lib/typescript/components/helpers/Portal.d.ts.map +1 -0
- package/lib/typescript/components/helpers/Portal.web.d.ts +8 -0
- package/lib/typescript/components/helpers/Portal.web.d.ts.map +1 -0
- package/lib/typescript/components/helpers/PortalHost.d.ts +6 -0
- package/lib/typescript/components/helpers/PortalHost.d.ts.map +1 -0
- package/lib/typescript/components/helpers/PortalHost.web.d.ts +7 -0
- package/lib/typescript/components/helpers/PortalHost.web.d.ts.map +1 -0
- package/lib/typescript/components/list-group/ListGroup.d.ts +1 -1
- package/lib/typescript/components/list-group/ListGroupItemAction.d.ts +1 -1
- package/lib/typescript/components/list-group/ListGroupItemAction.d.ts.map +1 -1
- package/lib/typescript/components/modal/Modal.d.ts +1 -1
- package/lib/typescript/components/modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/modal/ModalContext.d.ts +1 -0
- package/lib/typescript/components/modal/ModalContext.d.ts.map +1 -1
- package/lib/typescript/components/modal/ModalTitle.d.ts.map +1 -1
- package/lib/typescript/components/modal/useModal.d.ts +2 -1
- package/lib/typescript/components/modal/useModal.d.ts.map +1 -1
- package/lib/typescript/components/nav/Nav.d.ts +1 -1
- package/lib/typescript/components/nav/NavLink.d.ts +1 -1
- package/lib/typescript/components/nav/NavLink.d.ts.map +1 -1
- package/lib/typescript/components/nav/useTabbable.d.ts.map +1 -1
- package/lib/typescript/components/navbar/Navbar.d.ts +2 -2
- package/lib/typescript/components/navbar/NavbarBrand.d.ts +1 -1
- package/lib/typescript/components/navbar/NavbarBrand.d.ts.map +1 -1
- package/lib/typescript/components/navbar/NavbarToggler.d.ts +1 -1
- package/lib/typescript/components/navbar/NavbarToggler.d.ts.map +1 -1
- package/lib/typescript/components/navbar/useNavbar.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/Offcanvas.d.ts +1 -4
- package/lib/typescript/components/offcanvas/Offcanvas.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/OffcanvasContext.d.ts +3 -1
- package/lib/typescript/components/offcanvas/OffcanvasContext.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/OffcanvasTitle.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/useOffcanvas.d.ts +3 -1
- package/lib/typescript/components/offcanvas/useOffcanvas.d.ts.map +1 -1
- package/lib/typescript/components/popover/Popover.d.ts +3 -4
- package/lib/typescript/components/popover/Popover.d.ts.map +1 -1
- package/lib/typescript/components/popover/PopoverArrow.d.ts.map +1 -1
- package/lib/typescript/components/popover/PopoverContext.d.ts +3 -4
- package/lib/typescript/components/popover/PopoverContext.d.ts.map +1 -1
- package/lib/typescript/components/popover/injectPopover.d.ts +5 -7
- package/lib/typescript/components/popover/injectPopover.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/Tooltip.d.ts +3 -4
- package/lib/typescript/components/tooltip/Tooltip.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/TooltipArrow.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/TooltipContext.d.ts +3 -4
- package/lib/typescript/components/tooltip/TooltipContext.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/injectTooltip.d.ts +5 -7
- package/lib/typescript/components/tooltip/injectTooltip.d.ts.map +1 -1
- package/lib/typescript/hooks/useBackgroundNative.d.ts.map +1 -1
- package/lib/typescript/hooks/useFocusRing.d.ts +3 -0
- package/lib/typescript/hooks/useFocusRing.d.ts.map +1 -0
- package/lib/typescript/hooks/useFocusRing.web.d.ts +3 -0
- package/lib/typescript/hooks/useFocusRing.web.d.ts.map +1 -0
- package/lib/typescript/hooks/useInteractionState.d.ts +7 -7
- package/lib/typescript/hooks/useInteractionState.d.ts.map +1 -1
- package/lib/typescript/hooks/useOverlay.d.ts +64 -0
- package/lib/typescript/hooks/useOverlay.d.ts.map +1 -0
- package/lib/typescript/hooks/useOverlay.web.d.ts +37 -0
- package/lib/typescript/hooks/useOverlay.web.d.ts.map +1 -0
- package/lib/typescript/hooks/useScrollbarEffects.d.ts.map +1 -1
- package/lib/typescript/hooks/useScrollbarEffects.web.d.ts +7 -0
- package/lib/typescript/hooks/useScrollbarEffects.web.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/style/StyleSheet.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +12 -6
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils.d.ts +2 -3
- package/lib/typescript/utils.d.ts.map +1 -1
- package/package.json +92 -87
- package/src/Context.ts +37 -38
- package/src/Provider.tsx +61 -66
- package/src/components/Body.tsx +22 -22
- package/src/components/TextInput.tsx +66 -66
- package/src/components/buttons/Button.tsx +381 -379
- package/src/components/close/CloseButton.tsx +142 -138
- package/src/components/collapse/useCollapse.ts +25 -26
- package/src/components/dropdown/Dropdown.tsx +77 -80
- package/src/components/dropdown/DropdownContext.ts +14 -3
- package/src/components/dropdown/DropdownMenu.tsx +243 -284
- package/src/components/dropdown/useDismissDropdown.ts +30 -29
- package/src/components/dropdown/useDropdown.ts +55 -38
- package/src/components/dropdown/useToggleDropdown.ts +31 -32
- package/src/components/forms/FormCheckInput.tsx +268 -268
- package/src/components/forms/Input.tsx +220 -220
- package/src/components/forms/internals/PickerNative.tsx +9 -10
- package/src/components/helpers/BackdropHandler.tsx +5 -119
- package/src/components/helpers/BackdropHandler.web.tsx +6 -0
- package/src/components/helpers/Dialog.tsx +49 -0
- package/src/components/helpers/Dialog.web.tsx +145 -0
- package/src/components/helpers/Portal.tsx +10 -0
- package/src/components/helpers/Portal.web.tsx +22 -0
- package/src/components/helpers/PortalHost.tsx +7 -0
- package/src/components/helpers/PortalHost.web.tsx +14 -0
- package/src/components/modal/Modal.tsx +60 -46
- package/src/components/modal/ModalContext.ts +12 -11
- package/src/components/modal/ModalTitle.tsx +41 -31
- package/src/components/modal/useModal.ts +13 -25
- package/src/components/nav/useTabbable.ts +31 -32
- package/src/components/navbar/NavbarToggler.tsx +130 -130
- package/src/components/navbar/useNavbar.ts +30 -31
- package/src/components/offcanvas/Offcanvas.tsx +92 -95
- package/src/components/offcanvas/OffcanvasContext.ts +13 -11
- package/src/components/offcanvas/OffcanvasTitle.tsx +43 -33
- package/src/components/offcanvas/useOffcanvas.ts +12 -20
- package/src/components/pagination/PaginationItem.tsx +139 -139
- package/src/components/popover/Popover.tsx +87 -90
- package/src/components/popover/PopoverArrow.tsx +22 -6
- package/src/components/popover/PopoverContext.ts +13 -18
- package/src/components/popover/injectPopover.tsx +63 -55
- package/src/components/tooltip/Tooltip.tsx +79 -98
- package/src/components/tooltip/TooltipArrow.tsx +26 -8
- package/src/components/tooltip/TooltipContext.ts +13 -18
- package/src/components/tooltip/injectTooltip.tsx +62 -53
- package/src/hooks/useAction.ts +78 -78
- package/src/hooks/useBackgroundNative.tsx +6 -4
- package/src/hooks/useFocusRing.ts +13 -0
- package/src/hooks/useFocusRing.web.ts +3 -0
- package/src/hooks/useInteractionState.ts +75 -81
- package/src/hooks/useOverlay.ts +197 -0
- package/src/hooks/useOverlay.web.ts +190 -0
- package/src/hooks/useScrollbarEffects.ts +5 -83
- package/src/hooks/useScrollbarEffects.web.ts +83 -0
- package/src/index.ts +5 -5
- package/src/style/StyleSheet.ts +2 -5
- package/src/theme/variables.ts +1420 -1420
- package/src/types.ts +14 -14
- package/src/utils.ts +4 -22
- package/lib/module/components/SafeAreaView.js +0 -44
- package/lib/module/components/SafeAreaView.js.map +0 -1
- package/lib/module/components/helpers/Overlay.js +0 -50
- package/lib/module/components/helpers/Overlay.js.map +0 -1
- package/lib/module/hooks/useIdentifier.js +0 -14
- package/lib/module/hooks/useIdentifier.js.map +0 -1
- package/lib/module/hooks/useTrigger.js +0 -97
- package/lib/module/hooks/useTrigger.js.map +0 -1
- package/lib/typescript/components/SafeAreaView.d.ts +0 -13
- package/lib/typescript/components/SafeAreaView.d.ts.map +0 -1
- package/lib/typescript/components/helpers/Overlay.d.ts +0 -28
- package/lib/typescript/components/helpers/Overlay.d.ts.map +0 -1
- package/lib/typescript/hooks/useIdentifier.d.ts +0 -2
- package/lib/typescript/hooks/useIdentifier.d.ts.map +0 -1
- package/lib/typescript/hooks/useTrigger.d.ts +0 -33
- package/lib/typescript/hooks/useTrigger.d.ts.map +0 -1
- package/src/components/SafeAreaView.tsx +0 -71
- package/src/components/helpers/Overlay.tsx +0 -81
- package/src/hooks/useIdentifier.ts +0 -15
- package/src/hooks/useTrigger.ts +0 -141
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import StyleSheet from '../../style/StyleSheet';
|
|
3
|
-
import css from '../../style/css';
|
|
4
|
-
import Heading from '../Heading';
|
|
5
|
-
import { getStyles } from '../../utils';
|
|
6
|
-
import type { TextProps, TextRef } from '../Text';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import StyleSheet from '../../style/StyleSheet';
|
|
3
|
+
import css from '../../style/css';
|
|
4
|
+
import Heading from '../Heading';
|
|
5
|
+
import { getStyles } from '../../utils';
|
|
6
|
+
import type { TextProps, TextRef } from '../Text';
|
|
7
|
+
import useForcedContext from '../../hooks/useForcedContext';
|
|
8
|
+
import OffcanvasContext from './OffcanvasContext';
|
|
9
|
+
|
|
10
|
+
export interface OffcanvasTitleProps extends TextProps {}
|
|
11
|
+
|
|
12
|
+
const styles = StyleSheet.create({
|
|
13
|
+
'.offcanvas-title': css`
|
|
14
|
+
margin-bottom: 0;
|
|
15
|
+
line-height: $font-size-base * $offcanvas-title-line-height;
|
|
16
|
+
`,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const OffcanvasTitle = React.forwardRef<TextRef, OffcanvasTitleProps>(
|
|
20
|
+
(props, ref) => {
|
|
21
|
+
const { children, style, ...elementProps } = props;
|
|
22
|
+
|
|
23
|
+
const { identifier } = useForcedContext(OffcanvasContext);
|
|
24
|
+
|
|
25
|
+
const classes = getStyles(styles, ['.offcanvas-title']);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Heading
|
|
29
|
+
id={`${identifier}-title`}
|
|
30
|
+
size={5}
|
|
31
|
+
{...elementProps}
|
|
32
|
+
ref={ref}
|
|
33
|
+
style={[classes, style]}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
</Heading>
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
OffcanvasTitle.displayName = 'OffcanvasTitle';
|
|
42
|
+
|
|
43
|
+
export default OffcanvasTitle;
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return () => {
|
|
15
|
-
context?.scrollbars.show();
|
|
16
|
-
};
|
|
17
|
-
}, [visible, scroll, context?.scrollbars]);
|
|
18
|
-
|
|
19
|
-
return useMemo(() => ({}), []); // You can return any memoized value here if needed
|
|
20
|
-
}
|
|
1
|
+
import { useId, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
export default function useOffcanvas() {
|
|
4
|
+
const identifier = useId();
|
|
5
|
+
|
|
6
|
+
return useMemo(
|
|
7
|
+
() => ({
|
|
8
|
+
identifier,
|
|
9
|
+
}),
|
|
10
|
+
[],
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
|
-
import StyleSheet from '../../style/StyleSheet';
|
|
4
|
-
import css from '../../style/css';
|
|
5
|
-
import { getStyles } from '../../utils';
|
|
6
|
-
import View, { ViewProps, ViewRef } from '../View';
|
|
7
|
-
import useForcedContext from '../../hooks/useForcedContext';
|
|
8
|
-
import ListContext from '../helpers/ListContext';
|
|
9
|
-
|
|
10
|
-
export interface PaginationItemProps extends ViewProps {
|
|
11
|
-
active?: boolean;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const styles = StyleSheet.create({
|
|
16
|
-
'.pagination-item': css`
|
|
17
|
-
padding-bottom: $pagination-padding-y;
|
|
18
|
-
padding-top: $pagination-padding-y;
|
|
19
|
-
padding-left: $pagination-padding-x;
|
|
20
|
-
padding-right: $pagination-padding-x;
|
|
21
|
-
border: $list-group-border-width solid $list-group-border-color;
|
|
22
|
-
|
|
23
|
-
&:hover {
|
|
24
|
-
color: $pagination-hover-color;
|
|
25
|
-
background-color: $pagination-hover-bg;
|
|
26
|
-
border-color: $pagination-hover-border-color;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&:focus {
|
|
30
|
-
color: $pagination-focus-color;
|
|
31
|
-
background-color: $pagination-focus-bg;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
`,
|
|
36
|
-
'.pagination-item:first-child': css`
|
|
37
|
-
border-top-left-radius: $list-group-border-radius;
|
|
38
|
-
border-bottom-left-radius: $list-group-border-radius;
|
|
39
|
-
`,
|
|
40
|
-
'.pagination-item:last-child': css`
|
|
41
|
-
border-top-right-radius: $list-group-border-radius;
|
|
42
|
-
border-bottom-right-radius: $list-group-border-radius;
|
|
43
|
-
`,
|
|
44
|
-
'.pagination-item.active': css`
|
|
45
|
-
color: $pagination-active-color;
|
|
46
|
-
background-color: $pagination-active-bg;
|
|
47
|
-
border-color: $pagination-active-border-color;
|
|
48
|
-
`,
|
|
49
|
-
'.pagination-item.disabled': css`
|
|
50
|
-
color: $pagination-disabled-color;
|
|
51
|
-
background-color: $pagination-disabled-bg;
|
|
52
|
-
border-color: $pagination-disabled-border-color;
|
|
53
|
-
`,
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
const PaginationItem = React.forwardRef<ViewRef, PaginationItemProps>(
|
|
57
|
-
(props, ref) => {
|
|
58
|
-
const {
|
|
59
|
-
children,
|
|
60
|
-
active = false,
|
|
61
|
-
disabled = false,
|
|
62
|
-
style,
|
|
63
|
-
textStyle,
|
|
64
|
-
...elementProps
|
|
65
|
-
} = props;
|
|
66
|
-
|
|
67
|
-
const { first, last } = useForcedContext(ListContext);
|
|
68
|
-
|
|
69
|
-
const classes = getStyles(styles, [
|
|
70
|
-
'.pagination-item',
|
|
71
|
-
first && '.pagination-item:first-child',
|
|
72
|
-
last && '.pagination-item:last-child',
|
|
73
|
-
active && '.pagination-item.active',
|
|
74
|
-
disabled && '.pagination-item.disabled',
|
|
75
|
-
]);
|
|
76
|
-
|
|
77
|
-
const textClasses = getStyles(styles, [
|
|
78
|
-
active && '.pagination-item.active',
|
|
79
|
-
disabled && '.pagination-item.disabled',
|
|
80
|
-
]);
|
|
81
|
-
|
|
82
|
-
const role = Platform.OS === 'web' ? 'listitem' : undefined;
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<View
|
|
86
|
-
{...elementProps}
|
|
87
|
-
ref={ref}
|
|
88
|
-
role={role}
|
|
89
|
-
style={[classes, style]}
|
|
90
|
-
textStyle={[textClasses, textStyle]}
|
|
91
|
-
>
|
|
92
|
-
{children}
|
|
93
|
-
</View>
|
|
94
|
-
);
|
|
95
|
-
},
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
PaginationItem.displayName = 'PaginationItem';
|
|
99
|
-
|
|
100
|
-
export default PaginationItem;
|
|
101
|
-
|
|
102
|
-
/*
|
|
103
|
-
$pagination-padding-y: .375rem;
|
|
104
|
-
$pagination-padding-x: .75rem;
|
|
105
|
-
$pagination-padding-y-sm: .25rem;
|
|
106
|
-
$pagination-padding-x-sm: .5rem;
|
|
107
|
-
$pagination-padding-y-lg: .75rem;
|
|
108
|
-
$pagination-padding-x-lg: 1.5rem;
|
|
109
|
-
|
|
110
|
-
$pagination-color: $link-color;
|
|
111
|
-
$pagination-bg: $white;
|
|
112
|
-
$pagination-border-width: $border-width;
|
|
113
|
-
$pagination-border-radius: $border-radius;
|
|
114
|
-
$pagination-margin-start: -$pagination-border-width;
|
|
115
|
-
$pagination-border-color: $gray-300;
|
|
116
|
-
|
|
117
|
-
$pagination-focus-color: $link-hover-color;
|
|
118
|
-
$pagination-focus-bg: $gray-200;
|
|
119
|
-
$pagination-focus-box-shadow: $input-btn-focus-box-shadow;
|
|
120
|
-
$pagination-focus-outline: 0;
|
|
121
|
-
|
|
122
|
-
$pagination-hover-color: $link-hover-color;
|
|
123
|
-
$pagination-hover-bg: $gray-200;
|
|
124
|
-
$pagination-hover-border-color: $gray-300;
|
|
125
|
-
|
|
126
|
-
$pagination-active-color: $component-active-color;
|
|
127
|
-
$pagination-active-bg: $component-active-bg;
|
|
128
|
-
$pagination-active-border-color: $pagination-active-bg;
|
|
129
|
-
|
|
130
|
-
$pagination-disabled-color: $gray-600;
|
|
131
|
-
$pagination-disabled-bg: $white;
|
|
132
|
-
$pagination-disabled-border-color: $gray-300;
|
|
133
|
-
|
|
134
|
-
$pagination-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
|
135
|
-
|
|
136
|
-
$pagination-border-radius-sm: $border-radius-sm;
|
|
137
|
-
$pagination-border-radius-lg: $border-radius-lg;
|
|
138
|
-
|
|
139
|
-
*/
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import StyleSheet from '../../style/StyleSheet';
|
|
4
|
+
import css from '../../style/css';
|
|
5
|
+
import { getStyles } from '../../utils';
|
|
6
|
+
import View, { ViewProps, ViewRef } from '../View';
|
|
7
|
+
import useForcedContext from '../../hooks/useForcedContext';
|
|
8
|
+
import ListContext from '../helpers/ListContext';
|
|
9
|
+
|
|
10
|
+
export interface PaginationItemProps extends ViewProps {
|
|
11
|
+
active?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const styles = StyleSheet.create({
|
|
16
|
+
'.pagination-item': css`
|
|
17
|
+
padding-bottom: $pagination-padding-y;
|
|
18
|
+
padding-top: $pagination-padding-y;
|
|
19
|
+
padding-left: $pagination-padding-x;
|
|
20
|
+
padding-right: $pagination-padding-x;
|
|
21
|
+
border: $list-group-border-width solid $list-group-border-color;
|
|
22
|
+
|
|
23
|
+
&:hover {
|
|
24
|
+
color: $pagination-hover-color;
|
|
25
|
+
background-color: $pagination-hover-bg;
|
|
26
|
+
border-color: $pagination-hover-border-color;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:focus {
|
|
30
|
+
color: $pagination-focus-color;
|
|
31
|
+
background-color: $pagination-focus-bg;
|
|
32
|
+
// box-shadow: $pagination-focus-box-shadow;
|
|
33
|
+
// outline: $pagination-focus-outline;
|
|
34
|
+
}
|
|
35
|
+
`,
|
|
36
|
+
'.pagination-item:first-child': css`
|
|
37
|
+
border-top-left-radius: $list-group-border-radius;
|
|
38
|
+
border-bottom-left-radius: $list-group-border-radius;
|
|
39
|
+
`,
|
|
40
|
+
'.pagination-item:last-child': css`
|
|
41
|
+
border-top-right-radius: $list-group-border-radius;
|
|
42
|
+
border-bottom-right-radius: $list-group-border-radius;
|
|
43
|
+
`,
|
|
44
|
+
'.pagination-item.active': css`
|
|
45
|
+
color: $pagination-active-color;
|
|
46
|
+
background-color: $pagination-active-bg;
|
|
47
|
+
border-color: $pagination-active-border-color;
|
|
48
|
+
`,
|
|
49
|
+
'.pagination-item.disabled': css`
|
|
50
|
+
color: $pagination-disabled-color;
|
|
51
|
+
background-color: $pagination-disabled-bg;
|
|
52
|
+
border-color: $pagination-disabled-border-color;
|
|
53
|
+
`,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const PaginationItem = React.forwardRef<ViewRef, PaginationItemProps>(
|
|
57
|
+
(props, ref) => {
|
|
58
|
+
const {
|
|
59
|
+
children,
|
|
60
|
+
active = false,
|
|
61
|
+
disabled = false,
|
|
62
|
+
style,
|
|
63
|
+
textStyle,
|
|
64
|
+
...elementProps
|
|
65
|
+
} = props;
|
|
66
|
+
|
|
67
|
+
const { first, last } = useForcedContext(ListContext);
|
|
68
|
+
|
|
69
|
+
const classes = getStyles(styles, [
|
|
70
|
+
'.pagination-item',
|
|
71
|
+
first && '.pagination-item:first-child',
|
|
72
|
+
last && '.pagination-item:last-child',
|
|
73
|
+
active && '.pagination-item.active',
|
|
74
|
+
disabled && '.pagination-item.disabled',
|
|
75
|
+
]);
|
|
76
|
+
|
|
77
|
+
const textClasses = getStyles(styles, [
|
|
78
|
+
active && '.pagination-item.active',
|
|
79
|
+
disabled && '.pagination-item.disabled',
|
|
80
|
+
]);
|
|
81
|
+
|
|
82
|
+
const role = Platform.OS === 'web' ? 'listitem' : undefined;
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<View
|
|
86
|
+
{...elementProps}
|
|
87
|
+
ref={ref}
|
|
88
|
+
role={role}
|
|
89
|
+
style={[classes, style]}
|
|
90
|
+
textStyle={[textClasses, textStyle]}
|
|
91
|
+
>
|
|
92
|
+
{children}
|
|
93
|
+
</View>
|
|
94
|
+
);
|
|
95
|
+
},
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
PaginationItem.displayName = 'PaginationItem';
|
|
99
|
+
|
|
100
|
+
export default PaginationItem;
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
$pagination-padding-y: .375rem;
|
|
104
|
+
$pagination-padding-x: .75rem;
|
|
105
|
+
$pagination-padding-y-sm: .25rem;
|
|
106
|
+
$pagination-padding-x-sm: .5rem;
|
|
107
|
+
$pagination-padding-y-lg: .75rem;
|
|
108
|
+
$pagination-padding-x-lg: 1.5rem;
|
|
109
|
+
|
|
110
|
+
$pagination-color: $link-color;
|
|
111
|
+
$pagination-bg: $white;
|
|
112
|
+
$pagination-border-width: $border-width;
|
|
113
|
+
$pagination-border-radius: $border-radius;
|
|
114
|
+
$pagination-margin-start: -$pagination-border-width;
|
|
115
|
+
$pagination-border-color: $gray-300;
|
|
116
|
+
|
|
117
|
+
$pagination-focus-color: $link-hover-color;
|
|
118
|
+
$pagination-focus-bg: $gray-200;
|
|
119
|
+
$pagination-focus-box-shadow: $input-btn-focus-box-shadow;
|
|
120
|
+
$pagination-focus-outline: 0;
|
|
121
|
+
|
|
122
|
+
$pagination-hover-color: $link-hover-color;
|
|
123
|
+
$pagination-hover-bg: $gray-200;
|
|
124
|
+
$pagination-hover-border-color: $gray-300;
|
|
125
|
+
|
|
126
|
+
$pagination-active-color: $component-active-color;
|
|
127
|
+
$pagination-active-bg: $component-active-bg;
|
|
128
|
+
$pagination-active-border-color: $pagination-active-bg;
|
|
129
|
+
|
|
130
|
+
$pagination-disabled-color: $gray-600;
|
|
131
|
+
$pagination-disabled-bg: $white;
|
|
132
|
+
$pagination-disabled-border-color: $gray-300;
|
|
133
|
+
|
|
134
|
+
$pagination-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
|
135
|
+
|
|
136
|
+
$pagination-border-radius-sm: $border-radius-sm;
|
|
137
|
+
$pagination-border-radius-lg: $border-radius-lg;
|
|
138
|
+
|
|
139
|
+
*/
|
|
@@ -1,90 +1,87 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
|
-
import StyleSheet from '../../style/StyleSheet';
|
|
4
|
-
import { getStyles
|
|
5
|
-
import css from '../../style/css';
|
|
6
|
-
import View, { ViewProps, ViewRef } from '../View';
|
|
7
|
-
import PopoverArrow from './PopoverArrow';
|
|
8
|
-
import PopoverHeader from './PopoverHeader';
|
|
9
|
-
import PopoverBody from './PopoverBody';
|
|
10
|
-
import PopoverContext from './PopoverContext';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
export interface PopoverProps extends ViewProps {
|
|
14
|
-
placement?:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
background-
|
|
28
|
-
|
|
29
|
-
border: $popover-border-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
Header: PopoverHeader,
|
|
89
|
-
Body: PopoverBody,
|
|
90
|
-
});
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import StyleSheet from '../../style/StyleSheet';
|
|
4
|
+
import { getStyles } from '../../utils';
|
|
5
|
+
import css from '../../style/css';
|
|
6
|
+
import View, { ViewProps, ViewRef } from '../View';
|
|
7
|
+
import PopoverArrow from './PopoverArrow';
|
|
8
|
+
import PopoverHeader from './PopoverHeader';
|
|
9
|
+
import PopoverBody from './PopoverBody';
|
|
10
|
+
import PopoverContext from './PopoverContext';
|
|
11
|
+
import type { OverlayPhysicalPlacement } from '../../types';
|
|
12
|
+
|
|
13
|
+
export interface PopoverProps extends ViewProps {
|
|
14
|
+
placement?: OverlayPhysicalPlacement;
|
|
15
|
+
floating?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const styles = StyleSheet.create({
|
|
19
|
+
'.popover': css`
|
|
20
|
+
position: absolute;
|
|
21
|
+
// top: 0;
|
|
22
|
+
// left: 0 #{"/* rtl:ignore */"};
|
|
23
|
+
// z-index: $zindex-popover;
|
|
24
|
+
// display: block;
|
|
25
|
+
max-width: $popover-max-width;
|
|
26
|
+
background-color: $popover-bg;
|
|
27
|
+
// background-clip: padding-box;
|
|
28
|
+
border: $popover-border-width solid $popover-border-color;
|
|
29
|
+
border-radius: $popover-border-radius;
|
|
30
|
+
// @include box-shadow($popover-box-shadow);
|
|
31
|
+
`,
|
|
32
|
+
'.popover --text': css`
|
|
33
|
+
// Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element.
|
|
34
|
+
// So reset our font and text properties to avoid inheriting weird values.
|
|
35
|
+
// @include reset-text();
|
|
36
|
+
font-size: $popover-font-size;
|
|
37
|
+
// Allow breaking very long words so they don't overflow the popover's bounds
|
|
38
|
+
// word-wrap: break-word;
|
|
39
|
+
`,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const Popover = React.forwardRef<ViewRef, PopoverProps>((props, ref) => {
|
|
43
|
+
const {
|
|
44
|
+
children,
|
|
45
|
+
placement = 'right',
|
|
46
|
+
floating,
|
|
47
|
+
style,
|
|
48
|
+
textStyle,
|
|
49
|
+
...elementProps
|
|
50
|
+
} = props;
|
|
51
|
+
|
|
52
|
+
const popover = useMemo(
|
|
53
|
+
() => ({
|
|
54
|
+
placement,
|
|
55
|
+
floating,
|
|
56
|
+
}),
|
|
57
|
+
[placement, floating],
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const classes = getStyles(styles, ['.popover']);
|
|
61
|
+
const textClasses = getStyles(styles, ['.popover --text']);
|
|
62
|
+
|
|
63
|
+
// Accessiblity role tooltip is only supported on web.
|
|
64
|
+
const role = Platform.OS === 'web' ? 'tooltip' : undefined;
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<View
|
|
68
|
+
{...elementProps}
|
|
69
|
+
ref={ref}
|
|
70
|
+
role={role}
|
|
71
|
+
style={[classes, style]}
|
|
72
|
+
textStyle={[textClasses, textStyle]}
|
|
73
|
+
>
|
|
74
|
+
<PopoverContext.Provider value={popover}>
|
|
75
|
+
{children}
|
|
76
|
+
</PopoverContext.Provider>
|
|
77
|
+
</View>
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
Popover.displayName = 'Popover';
|
|
82
|
+
|
|
83
|
+
export default Object.assign(Popover, {
|
|
84
|
+
Arrow: PopoverArrow,
|
|
85
|
+
Header: PopoverHeader,
|
|
86
|
+
Body: PopoverBody,
|
|
87
|
+
});
|
|
@@ -6,7 +6,7 @@ import { getStyles } from '../../utils';
|
|
|
6
6
|
import css from '../../style/css';
|
|
7
7
|
import useForcedContext from '../../hooks/useForcedContext';
|
|
8
8
|
import PopoverContext from './PopoverContext';
|
|
9
|
-
import type { ThemeVariables } from '../../types';
|
|
9
|
+
import type { OverlayPlacement, ThemeVariables } from '../../types';
|
|
10
10
|
|
|
11
11
|
export interface PopoverArrowProps extends ViewProps {}
|
|
12
12
|
|
|
@@ -159,27 +159,43 @@ const styles = StyleSheet.create({
|
|
|
159
159
|
`,
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
+
const transformPlacement = (placement: OverlayPlacement) => {
|
|
163
|
+
if (placement === 'left') {
|
|
164
|
+
return 'start';
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (placement === 'right') {
|
|
168
|
+
return 'end';
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return placement;
|
|
172
|
+
};
|
|
173
|
+
|
|
162
174
|
const PopoverArrow = React.forwardRef<ViewRef, PopoverArrowProps>(
|
|
163
175
|
(props, ref) => {
|
|
164
176
|
const { style, ...elementProps } = props;
|
|
165
177
|
|
|
166
|
-
const
|
|
178
|
+
const context = useForcedContext(PopoverContext);
|
|
179
|
+
|
|
180
|
+
// For some reason the classes are named start/end, but they always define
|
|
181
|
+
// the overlay on the left/right placement, so it has no effect on RTL.
|
|
182
|
+
const placement = transformPlacement(context.placement);
|
|
167
183
|
|
|
168
184
|
const classes = getStyles(styles, [
|
|
169
185
|
'.popover-arrow',
|
|
170
|
-
|
|
186
|
+
context.floating && `.bs-popover-${placement} .popover-arrow`,
|
|
171
187
|
]);
|
|
172
188
|
const beforeClasses = getStyles(styles, [
|
|
173
189
|
'.popover-arrow::before',
|
|
174
|
-
|
|
190
|
+
context.floating && `.bs-popover-${placement} .popover-arrow::before`,
|
|
175
191
|
]);
|
|
176
192
|
const afterClasses = getStyles(styles, [
|
|
177
193
|
'.popover-arrow::after',
|
|
178
|
-
|
|
194
|
+
context.floating && `.bs-popover-${placement} .popover-arrow::after`,
|
|
179
195
|
]);
|
|
180
196
|
|
|
181
197
|
return (
|
|
182
|
-
<View {...elementProps} ref={ref} style={[classes,
|
|
198
|
+
<View {...elementProps} ref={ref} style={[classes, style]}>
|
|
183
199
|
<View style={beforeClasses} />
|
|
184
200
|
<View style={afterClasses} />
|
|
185
201
|
</View>
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const PopoverContext = React.createContext<PopoverContextType | null>(null);
|
|
15
|
-
|
|
16
|
-
PopoverContext.displayName = 'PopoverContext';
|
|
17
|
-
|
|
18
|
-
export default PopoverContext;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OverlayPlacement } from '../../types';
|
|
3
|
+
|
|
4
|
+
type PopoverContextType = {
|
|
5
|
+
placement: OverlayPlacement;
|
|
6
|
+
floating?: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const PopoverContext = React.createContext<PopoverContextType | null>(null);
|
|
10
|
+
|
|
11
|
+
PopoverContext.displayName = 'PopoverContext';
|
|
12
|
+
|
|
13
|
+
export default PopoverContext;
|