bootstrap-rn 0.4.6 → 0.4.8
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 +8 -1
- 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/Picker.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 +31 -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 -48
- 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 -82
- 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.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 +28 -21
- package/src/Context.ts +37 -38
- package/src/Provider.tsx +61 -66
- package/src/components/Body.tsx +68 -53
- 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/Picker.tsx +1 -1
- 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 +42 -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 -48
- 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 +91 -92
- 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 -42
- 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 -12
- 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 -64
- package/src/components/helpers/Overlay.tsx +0 -81
- package/src/hooks/useIdentifier.ts +0 -15
- package/src/hooks/useTrigger.ts +0 -141
|
@@ -1,379 +1,381 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import invariant from 'tiny-invariant';
|
|
3
|
-
import Pressable, { PressableRef, PressableProps } from '../Pressable';
|
|
4
|
-
import { THEME_COLORS } from '../../theme/proxies';
|
|
5
|
-
import { shadeColor, colorContrast } from '../../theme/functions';
|
|
6
|
-
import ButtonGroupContext, {
|
|
7
|
-
ButtonGroupContextType,
|
|
8
|
-
} from '../button-group/ButtonGroupContext';
|
|
9
|
-
import StyleSheet from '../../style/StyleSheet';
|
|
10
|
-
import css from '../../style/css';
|
|
11
|
-
import { getStyles, each } from '../../utils';
|
|
12
|
-
import useToggleButton from './useToggleButton';
|
|
13
|
-
import ListContext from '../helpers/ListContext';
|
|
14
|
-
import type { ThemeVariables } from '../../types';
|
|
15
|
-
|
|
16
|
-
type ButtonThemeColors = keyof typeof THEME_COLORS | 'link';
|
|
17
|
-
|
|
18
|
-
export interface ButtonProps extends PressableProps {
|
|
19
|
-
color?: ButtonThemeColors;
|
|
20
|
-
size?: 'lg' | 'sm';
|
|
21
|
-
outline?: boolean;
|
|
22
|
-
active?: boolean;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const styles = StyleSheet.create({
|
|
27
|
-
'.btn': css`
|
|
28
|
-
flex-direction: row; // added for bootstrap-rn
|
|
29
|
-
justify-content: center; // added for bootstrap-rn
|
|
30
|
-
// display: inline-block;
|
|
31
|
-
@include platform(web) {
|
|
32
|
-
// cursor: if($enable-button-pointers, pointer, null);
|
|
33
|
-
}
|
|
34
|
-
user-select: none;
|
|
35
|
-
background-color: transparent;
|
|
36
|
-
border: $btn-border-width solid transparent;
|
|
37
|
-
padding: $btn-padding-y $btn-padding-x;
|
|
38
|
-
// Manually declare to provide an override to the browser default
|
|
39
|
-
border-radius: $btn-border-radius;
|
|
40
|
-
// @include transition($btn-transition);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
color: $
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
group && '.btn-
|
|
336
|
-
group
|
|
337
|
-
group &&
|
|
338
|
-
group &&
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
{
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import invariant from 'tiny-invariant';
|
|
3
|
+
import Pressable, { PressableRef, PressableProps } from '../Pressable';
|
|
4
|
+
import { THEME_COLORS } from '../../theme/proxies';
|
|
5
|
+
import { shadeColor, colorContrast } from '../../theme/functions';
|
|
6
|
+
import ButtonGroupContext, {
|
|
7
|
+
ButtonGroupContextType,
|
|
8
|
+
} from '../button-group/ButtonGroupContext';
|
|
9
|
+
import StyleSheet from '../../style/StyleSheet';
|
|
10
|
+
import css from '../../style/css';
|
|
11
|
+
import { getStyles, each } from '../../utils';
|
|
12
|
+
import useToggleButton from './useToggleButton';
|
|
13
|
+
import ListContext from '../helpers/ListContext';
|
|
14
|
+
import type { ThemeVariables } from '../../types';
|
|
15
|
+
|
|
16
|
+
type ButtonThemeColors = keyof typeof THEME_COLORS | 'link';
|
|
17
|
+
|
|
18
|
+
export interface ButtonProps extends PressableProps {
|
|
19
|
+
color?: ButtonThemeColors;
|
|
20
|
+
size?: 'lg' | 'sm';
|
|
21
|
+
outline?: boolean;
|
|
22
|
+
active?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const styles = StyleSheet.create({
|
|
27
|
+
'.btn': css`
|
|
28
|
+
flex-direction: row; // added for bootstrap-rn
|
|
29
|
+
justify-content: center; // added for bootstrap-rn
|
|
30
|
+
// display: inline-block;
|
|
31
|
+
@include platform(web) {
|
|
32
|
+
// cursor: if($enable-button-pointers, pointer, null);
|
|
33
|
+
}
|
|
34
|
+
user-select: none;
|
|
35
|
+
background-color: transparent;
|
|
36
|
+
border: $btn-border-width solid transparent;
|
|
37
|
+
padding: $btn-padding-y $btn-padding-x;
|
|
38
|
+
// Manually declare to provide an override to the browser default
|
|
39
|
+
border-radius: $btn-border-radius;
|
|
40
|
+
// @include transition($btn-transition);
|
|
41
|
+
|
|
42
|
+
@include platform(web) {
|
|
43
|
+
&:focus-visible {
|
|
44
|
+
outline-style: none; // outline: 0;
|
|
45
|
+
box-shadow: $btn-focus-box-shadow;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:active {
|
|
49
|
+
// box-shadow: $btn-active-box-shadow;
|
|
50
|
+
|
|
51
|
+
&:focus-visible {
|
|
52
|
+
box-shadow: $btn-focus-box-shadow; // , $btn-active-box-shadow;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`,
|
|
57
|
+
'.btn --text': css`
|
|
58
|
+
font-family: $btn-font-family;
|
|
59
|
+
font-weight: $btn-font-weight;
|
|
60
|
+
line-height: $btn-font-size * $btn-line-height;
|
|
61
|
+
color: $body-color;
|
|
62
|
+
text-align: center;
|
|
63
|
+
text-decoration: none; // if($link-decoration == none, null, none);
|
|
64
|
+
white-space: $btn-white-space;
|
|
65
|
+
vertical-align: middle;
|
|
66
|
+
font-size: $btn-font-size;
|
|
67
|
+
|
|
68
|
+
&:hover {
|
|
69
|
+
color: $body-color;
|
|
70
|
+
text-decoration: none; // if($link-decoration == none, null, none);
|
|
71
|
+
}
|
|
72
|
+
`,
|
|
73
|
+
'.btn.disabled': css`
|
|
74
|
+
pointer-events: none;
|
|
75
|
+
opacity: $btn-disabled-opacity;
|
|
76
|
+
// @include box-shadow(none);
|
|
77
|
+
`,
|
|
78
|
+
...each(THEME_COLORS, (color, value) => ({
|
|
79
|
+
[`.btn-${color}`]: css`
|
|
80
|
+
background-color: ${value};
|
|
81
|
+
border-color: ${value};
|
|
82
|
+
// @include box-shadow($btn-box-shadow);
|
|
83
|
+
|
|
84
|
+
&:hover {
|
|
85
|
+
background-color: ${shadeColor(
|
|
86
|
+
value,
|
|
87
|
+
(t: ThemeVariables) => t['btn-hover-bg-shade-amount'],
|
|
88
|
+
)};
|
|
89
|
+
border-color: ${shadeColor(
|
|
90
|
+
value,
|
|
91
|
+
(t: ThemeVariables) => t['btn-hover-border-shade-amount'],
|
|
92
|
+
)};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:focus-visible {
|
|
96
|
+
background-color: ${shadeColor(
|
|
97
|
+
value,
|
|
98
|
+
(t: ThemeVariables) => t['btn-hover-bg-shade-amount'],
|
|
99
|
+
)};
|
|
100
|
+
border-color: ${shadeColor(
|
|
101
|
+
value,
|
|
102
|
+
(t: ThemeVariables) => t['btn-hover-border-shade-amount'],
|
|
103
|
+
)};
|
|
104
|
+
/* @if $enable-shadows {
|
|
105
|
+
@include box-shadow($btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
|
|
106
|
+
} @else {
|
|
107
|
+
// Avoid using mixin so we can pass custom focus shadow properly
|
|
108
|
+
box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
|
|
109
|
+
} */
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:active {
|
|
113
|
+
background-color: ${shadeColor(
|
|
114
|
+
value,
|
|
115
|
+
(t: ThemeVariables) => t['btn-active-bg-shade-amount'],
|
|
116
|
+
)};
|
|
117
|
+
// Remove CSS gradients if they're enabled
|
|
118
|
+
// background-image: if($enable-gradients, none, null);
|
|
119
|
+
border-color: ${shadeColor(
|
|
120
|
+
value,
|
|
121
|
+
(t: ThemeVariables) => t['btn-active-border-shade-amount'],
|
|
122
|
+
)};
|
|
123
|
+
}
|
|
124
|
+
`,
|
|
125
|
+
[`.btn-${color} --text`]: css`
|
|
126
|
+
color: ${colorContrast(value)};
|
|
127
|
+
|
|
128
|
+
&:hover {
|
|
129
|
+
color: ${colorContrast(value)};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&:focus-visible {
|
|
133
|
+
color: ${colorContrast(value)};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&:active {
|
|
137
|
+
color: ${colorContrast(value)};
|
|
138
|
+
}
|
|
139
|
+
`,
|
|
140
|
+
[`.btn-${color}.active`]: css`
|
|
141
|
+
background-color: ${shadeColor(
|
|
142
|
+
value,
|
|
143
|
+
(t: ThemeVariables) => t['btn-active-bg-shade-amount'],
|
|
144
|
+
)};
|
|
145
|
+
// Remove CSS gradients if they're enabled
|
|
146
|
+
// background-image: if($enable-gradients, none, null);
|
|
147
|
+
border-color: ${shadeColor(
|
|
148
|
+
value,
|
|
149
|
+
(t: ThemeVariables) => t['btn-active-border-shade-amount'],
|
|
150
|
+
)};
|
|
151
|
+
`,
|
|
152
|
+
[`.btn-${color}.active --text`]: css`
|
|
153
|
+
color: ${colorContrast(value)};
|
|
154
|
+
`,
|
|
155
|
+
[`.btn-${color}.disabled`]: css`
|
|
156
|
+
$disabled-background: ${value};
|
|
157
|
+
$disabled-border: ${value};
|
|
158
|
+
|
|
159
|
+
background-color: $disabled-background;
|
|
160
|
+
// Remove CSS gradients if they're enabled
|
|
161
|
+
// background-image: if($enable-gradients, none, null);
|
|
162
|
+
border-color: $disabled-border;
|
|
163
|
+
`,
|
|
164
|
+
[`.btn-${color}.disabled --text`]: css`
|
|
165
|
+
$disabled-color: ${colorContrast(value)};
|
|
166
|
+
|
|
167
|
+
color: $disabled-color;
|
|
168
|
+
`,
|
|
169
|
+
[`.btn-outline-${color}`]: css`
|
|
170
|
+
border-color: ${value};
|
|
171
|
+
|
|
172
|
+
&:hover {
|
|
173
|
+
background-color: ${value};
|
|
174
|
+
border-color: ${value};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&:focus-visible {
|
|
178
|
+
// box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&:active {
|
|
182
|
+
background-color: ${value};
|
|
183
|
+
border-color: ${value};
|
|
184
|
+
|
|
185
|
+
/* &:focus {
|
|
186
|
+
@if $enable-shadows {
|
|
187
|
+
@include box-shadow(
|
|
188
|
+
$btn-active-box-shadow,
|
|
189
|
+
0 0 0 $btn-focus-width rgba($color, 0.5)
|
|
190
|
+
);
|
|
191
|
+
} @else {
|
|
192
|
+
// Avoid using mixin so we can pass custom focus shadow properly
|
|
193
|
+
box-shadow: 0 0 0 $btn-focus-width rgba($color, 0.5);
|
|
194
|
+
}
|
|
195
|
+
} */
|
|
196
|
+
}
|
|
197
|
+
`,
|
|
198
|
+
[`.btn-outline-${color} --text`]: css`
|
|
199
|
+
color: ${value};
|
|
200
|
+
|
|
201
|
+
&:hover {
|
|
202
|
+
color: ${colorContrast(value)};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&:active {
|
|
206
|
+
color: ${colorContrast(value)};
|
|
207
|
+
}
|
|
208
|
+
`,
|
|
209
|
+
[`.btn-outline-${color}.disabled`]: css`
|
|
210
|
+
background-color: transparent;
|
|
211
|
+
`,
|
|
212
|
+
[`.btn-outline-${color}.disabled --text`]: css`
|
|
213
|
+
color: ${value};
|
|
214
|
+
`,
|
|
215
|
+
})),
|
|
216
|
+
'.btn-link --text': css`
|
|
217
|
+
font-weight: $font-weight-normal;
|
|
218
|
+
color: $btn-link-color;
|
|
219
|
+
text-decoration-color: $btn-link-color; // added for bootstrap-rn
|
|
220
|
+
text-decoration-line: $link-decoration;
|
|
221
|
+
|
|
222
|
+
&:hover {
|
|
223
|
+
color: $btn-link-hover-color;
|
|
224
|
+
text-decoration-color: $btn-link-hover-color; // added for bootstrap-rn
|
|
225
|
+
text-decoration-line: $link-hover-decoration;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&:focus-visible {
|
|
229
|
+
text-decoration-line: $link-hover-decoration;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// No need for an active state here
|
|
233
|
+
`,
|
|
234
|
+
'.btn-link.disabled --text': css`
|
|
235
|
+
color: $btn-link-disabled-color;
|
|
236
|
+
`,
|
|
237
|
+
'.btn-lg': css`
|
|
238
|
+
padding: $btn-padding-y-lg $btn-padding-x-lg;
|
|
239
|
+
// Manually declare to provide an override to the browser default
|
|
240
|
+
border-radius: $btn-border-radius-lg;
|
|
241
|
+
`,
|
|
242
|
+
'.btn-lg --text': css`
|
|
243
|
+
line-height: $btn-font-size-lg * $btn-line-height;
|
|
244
|
+
font-size: $btn-font-size-lg;
|
|
245
|
+
`,
|
|
246
|
+
'.btn-sm': css`
|
|
247
|
+
padding: $btn-padding-y-sm $btn-padding-x-sm;
|
|
248
|
+
// Manually declare to provide an override to the browser default
|
|
249
|
+
border-radius: $btn-border-radius-sm;
|
|
250
|
+
`,
|
|
251
|
+
'.btn-sm --text': css`
|
|
252
|
+
line-height: $btn-font-size-sm * $btn-line-height;
|
|
253
|
+
font-size: $btn-font-size-sm;
|
|
254
|
+
`,
|
|
255
|
+
'.btn-group > .btn': css`
|
|
256
|
+
position: relative;
|
|
257
|
+
// flex: 1 1 auto;
|
|
258
|
+
|
|
259
|
+
&:hover {
|
|
260
|
+
z-index: 1;
|
|
261
|
+
}
|
|
262
|
+
&:focus-visible {
|
|
263
|
+
z-index: 1;
|
|
264
|
+
}
|
|
265
|
+
&:active {
|
|
266
|
+
z-index: 1;
|
|
267
|
+
}
|
|
268
|
+
`,
|
|
269
|
+
'.btn-group > .btn.active': css`
|
|
270
|
+
z-index: 2; // 1;
|
|
271
|
+
`,
|
|
272
|
+
'.btn-group > .btn:not(:first-child)': css`
|
|
273
|
+
margin-left: -$btn-border-width;
|
|
274
|
+
border-top-left-radius: 0;
|
|
275
|
+
border-bottom-left-radius: 0;
|
|
276
|
+
`,
|
|
277
|
+
'.btn-group > .btn:not(:last-child)': css`
|
|
278
|
+
border-top-right-radius: 0;
|
|
279
|
+
border-bottom-right-radius: 0;
|
|
280
|
+
`,
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
const getVariant = (color: ButtonThemeColors, outline?: boolean) => {
|
|
284
|
+
if (color === 'link') {
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (outline) {
|
|
289
|
+
return `.btn-outline-${color}`;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return `.btn-${color}`;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const hasSize = (
|
|
296
|
+
value: string,
|
|
297
|
+
group: ButtonGroupContextType | null,
|
|
298
|
+
size?: string,
|
|
299
|
+
) => {
|
|
300
|
+
if (size !== undefined || !group) {
|
|
301
|
+
return size === value;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return group.size === value;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
const Button = React.forwardRef<PressableRef, ButtonProps>((props, ref) => {
|
|
308
|
+
const {
|
|
309
|
+
children,
|
|
310
|
+
color = 'primary',
|
|
311
|
+
size,
|
|
312
|
+
outline = false,
|
|
313
|
+
active = false,
|
|
314
|
+
disabled = false,
|
|
315
|
+
style,
|
|
316
|
+
activeStyle,
|
|
317
|
+
textStyle,
|
|
318
|
+
activeTextStyle,
|
|
319
|
+
...elementProps
|
|
320
|
+
} = props;
|
|
321
|
+
|
|
322
|
+
invariant(
|
|
323
|
+
color !== 'link' || !outline,
|
|
324
|
+
'Button link variant is only available as non outline style.',
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
const listItem = useContext(ListContext);
|
|
328
|
+
const group = useContext(ButtonGroupContext);
|
|
329
|
+
|
|
330
|
+
const classes = getStyles(styles, [
|
|
331
|
+
'.btn',
|
|
332
|
+
getVariant(color, outline),
|
|
333
|
+
disabled && '.btn.disabled',
|
|
334
|
+
disabled && `${getVariant(color, outline)}.disabled`,
|
|
335
|
+
hasSize('lg', group, size) && '.btn-lg',
|
|
336
|
+
hasSize('sm', group, size) && '.btn-sm',
|
|
337
|
+
group && '.btn-group > .btn',
|
|
338
|
+
group && active && '.btn-group > .btn.active',
|
|
339
|
+
group && !listItem?.first && '.btn-group > .btn:not(:first-child)',
|
|
340
|
+
group && !listItem?.last && '.btn-group > .btn:not(:last-child)',
|
|
341
|
+
]);
|
|
342
|
+
|
|
343
|
+
const activeClasses = getStyles(styles, [
|
|
344
|
+
`${getVariant(color, outline)}.active`,
|
|
345
|
+
]);
|
|
346
|
+
|
|
347
|
+
const textClasses = getStyles(styles, [
|
|
348
|
+
'.btn --text',
|
|
349
|
+
`${getVariant(color, outline)} --text`,
|
|
350
|
+
color === 'link' && '.btn-link --text',
|
|
351
|
+
disabled && `${getVariant(color, outline)}.disabled --text`,
|
|
352
|
+
disabled && color === 'link' && '.btn-link.disabled --text',
|
|
353
|
+
hasSize('lg', group, size) && '.btn-lg --text',
|
|
354
|
+
hasSize('sm', group, size) && '.btn-sm --text',
|
|
355
|
+
]);
|
|
356
|
+
|
|
357
|
+
const activeTextClasses = getStyles(styles, [
|
|
358
|
+
`${getVariant(color, outline)}.active --text`,
|
|
359
|
+
]);
|
|
360
|
+
|
|
361
|
+
return (
|
|
362
|
+
<Pressable
|
|
363
|
+
{...elementProps}
|
|
364
|
+
ref={ref}
|
|
365
|
+
active={active}
|
|
366
|
+
disabled={disabled}
|
|
367
|
+
style={[...classes, style]}
|
|
368
|
+
activeStyle={[...activeClasses, activeStyle]}
|
|
369
|
+
textStyle={[...textClasses, textStyle]}
|
|
370
|
+
activeTextStyle={[...activeTextClasses, activeTextStyle]}
|
|
371
|
+
>
|
|
372
|
+
{children}
|
|
373
|
+
</Pressable>
|
|
374
|
+
);
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
Button.displayName = 'Button';
|
|
378
|
+
|
|
379
|
+
export default Object.assign(Button, {
|
|
380
|
+
useToggle: useToggleButton,
|
|
381
|
+
});
|