bootstrap-rn 0.4.4 → 0.4.6
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/components/Body.js +2 -2
- package/lib/module/components/Body.js.map +1 -1
- package/lib/module/components/SafeAreaView.js +42 -0
- package/lib/module/components/SafeAreaView.js.map +1 -0
- package/lib/module/components/helpers/Overlay.js +2 -13
- package/lib/module/components/helpers/Overlay.js.map +1 -1
- package/lib/module/components/modal/Modal.js +7 -3
- package/lib/module/components/modal/Modal.js.map +1 -1
- package/lib/module/components/offcanvas/Offcanvas.js +65 -67
- package/lib/module/components/offcanvas/Offcanvas.js.map +1 -1
- package/lib/module/components/popover/PopoverArrow.js +28 -0
- package/lib/module/components/popover/PopoverArrow.js.map +1 -1
- package/lib/module/components/tooltip/TooltipArrow.js +16 -0
- package/lib/module/components/tooltip/TooltipArrow.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/components/Body.d.ts.map +1 -1
- package/lib/typescript/components/SafeAreaView.d.ts +12 -0
- package/lib/typescript/components/SafeAreaView.d.ts.map +1 -0
- package/lib/typescript/components/helpers/Overlay.d.ts.map +1 -1
- package/lib/typescript/components/modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/Offcanvas.d.ts.map +1 -1
- package/lib/typescript/components/popover/PopoverArrow.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/TooltipArrow.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +85 -85
- package/src/components/Body.tsx +53 -58
- package/src/components/SafeAreaView.tsx +64 -0
- package/src/components/helpers/Overlay.tsx +2 -13
- package/src/components/modal/Modal.tsx +243 -234
- package/src/components/offcanvas/Offcanvas.tsx +245 -245
- package/src/components/popover/PopoverArrow.tsx +192 -164
- package/src/components/tooltip/TooltipArrow.tsx +118 -102
- package/src/index.ts +3 -0
- package/src/theme/variables.ts +1420 -1420
|
@@ -1,164 +1,192 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import View, { ViewProps, ViewRef } from '../View';
|
|
3
|
-
import { subtract } from '../../theme/functions';
|
|
4
|
-
import StyleSheet from '../../style/StyleSheet';
|
|
5
|
-
import { getStyles } from '../../utils';
|
|
6
|
-
import css from '../../style/css';
|
|
7
|
-
import useForcedContext from '../../hooks/useForcedContext';
|
|
8
|
-
import PopoverContext from './PopoverContext';
|
|
9
|
-
import type { ThemeVariables } from '../../types';
|
|
10
|
-
|
|
11
|
-
export interface PopoverArrowProps extends ViewProps {}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
border-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
border-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
bottom:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
border-top-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
bottom:
|
|
56
|
-
border-top-
|
|
57
|
-
border-right-
|
|
58
|
-
border-left-
|
|
59
|
-
border-bottom-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
border-
|
|
83
|
-
border-
|
|
84
|
-
border-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
top: 0;
|
|
94
|
-
border-
|
|
95
|
-
border-
|
|
96
|
-
border-
|
|
97
|
-
border-
|
|
98
|
-
border-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
`,
|
|
108
|
-
'.bs-popover-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
width: $popover-arrow-height;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
border-
|
|
122
|
-
border-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
border-
|
|
127
|
-
border-
|
|
128
|
-
border-
|
|
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
|
-
PopoverArrow
|
|
163
|
-
|
|
164
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import View, { ViewProps, ViewRef } from '../View';
|
|
3
|
+
import { subtract } from '../../theme/functions';
|
|
4
|
+
import StyleSheet from '../../style/StyleSheet';
|
|
5
|
+
import { getStyles } from '../../utils';
|
|
6
|
+
import css from '../../style/css';
|
|
7
|
+
import useForcedContext from '../../hooks/useForcedContext';
|
|
8
|
+
import PopoverContext from './PopoverContext';
|
|
9
|
+
import type { ThemeVariables } from '../../types';
|
|
10
|
+
|
|
11
|
+
export interface PopoverArrowProps extends ViewProps {}
|
|
12
|
+
|
|
13
|
+
// Note: Border colors are defined for each side, because it seems like that the new react native
|
|
14
|
+
// architecture overwrites border colors from a previous style on Android.
|
|
15
|
+
// Example: `.bs-popover-top .popover-arrow::before` overwrites `.popover-arrow::before`
|
|
16
|
+
|
|
17
|
+
const styles = StyleSheet.create({
|
|
18
|
+
'.popover-arrow': css`
|
|
19
|
+
position: absolute;
|
|
20
|
+
// display: block;
|
|
21
|
+
width: $popover-arrow-width;
|
|
22
|
+
height: $popover-arrow-height;
|
|
23
|
+
`,
|
|
24
|
+
'.popover-arrow::before': css`
|
|
25
|
+
position: absolute;
|
|
26
|
+
// display: block;
|
|
27
|
+
// content: "";
|
|
28
|
+
border-top-color: transparent;
|
|
29
|
+
border-right-color: transparent;
|
|
30
|
+
border-left-color: transparent;
|
|
31
|
+
border-bottom-color: transparent;
|
|
32
|
+
border-style: solid;
|
|
33
|
+
`,
|
|
34
|
+
'.popover-arrow::after': css`
|
|
35
|
+
position: absolute;
|
|
36
|
+
// display: block;
|
|
37
|
+
// content: "";
|
|
38
|
+
border-top-color: transparent;
|
|
39
|
+
border-right-color: transparent;
|
|
40
|
+
border-left-color: transparent;
|
|
41
|
+
border-bottom-color: transparent;
|
|
42
|
+
border-style: solid;
|
|
43
|
+
`,
|
|
44
|
+
'.bs-popover-top .popover-arrow': css`
|
|
45
|
+
bottom: ${subtract(
|
|
46
|
+
(t: ThemeVariables) => `-${t['popover-arrow-height']}`,
|
|
47
|
+
(t: ThemeVariables) => t['popover-border-width'],
|
|
48
|
+
)};
|
|
49
|
+
`,
|
|
50
|
+
'.bs-popover-top .popover-arrow::before': css`
|
|
51
|
+
bottom: 0;
|
|
52
|
+
border-top-width: $popover-arrow-height;
|
|
53
|
+
border-right-width: $popover-arrow-width * 0.5;
|
|
54
|
+
border-left-width: $popover-arrow-width * 0.5;
|
|
55
|
+
border-bottom-width: 0;
|
|
56
|
+
border-top-color: $popover-arrow-outer-color;
|
|
57
|
+
border-right-color: transparent; // added for bootstrap-rn
|
|
58
|
+
border-left-color: transparent; // added for bootstrap-rn
|
|
59
|
+
border-bottom-color: transparent; // added for bootstrap-rn
|
|
60
|
+
`,
|
|
61
|
+
'.bs-popover-top .popover-arrow::after': css`
|
|
62
|
+
bottom: $popover-border-width;
|
|
63
|
+
border-top-width: $popover-arrow-height;
|
|
64
|
+
border-right-width: $popover-arrow-width * 0.5;
|
|
65
|
+
border-left-width: $popover-arrow-width * 0.5;
|
|
66
|
+
border-bottom-width: 0;
|
|
67
|
+
border-top-color: $popover-arrow-color;
|
|
68
|
+
border-right-color: transparent; // added for bootstrap-rn
|
|
69
|
+
border-left-color: transparent; // added for bootstrap-rn
|
|
70
|
+
border-bottom-color: transparent; // added for bootstrap-rn
|
|
71
|
+
`,
|
|
72
|
+
'.bs-popover-end .popover-arrow': css`
|
|
73
|
+
left: ${subtract(
|
|
74
|
+
(t: ThemeVariables) => `-${t['popover-arrow-height']}`,
|
|
75
|
+
(t: ThemeVariables) => t['popover-border-width'],
|
|
76
|
+
)};
|
|
77
|
+
width: $popover-arrow-height;
|
|
78
|
+
height: $popover-arrow-width;
|
|
79
|
+
`,
|
|
80
|
+
'.bs-popover-end .popover-arrow::before': css`
|
|
81
|
+
left: 0;
|
|
82
|
+
border-top-width: $popover-arrow-width * 0.5;
|
|
83
|
+
border-right-width: $popover-arrow-height;
|
|
84
|
+
border-left-width: 0;
|
|
85
|
+
border-bottom-width: $popover-arrow-width * 0.5;
|
|
86
|
+
border-top-color: transparent; // added for bootstrap-rn
|
|
87
|
+
border-right-color: $popover-arrow-outer-color;
|
|
88
|
+
border-left-color: transparent; // added for bootstrap-rn
|
|
89
|
+
border-bottom-color: transparent; // added for bootstrap-rn
|
|
90
|
+
`,
|
|
91
|
+
'.bs-popover-end .popover-arrow::after': css`
|
|
92
|
+
left: $popover-border-width;
|
|
93
|
+
border-top-width: $popover-arrow-width * 0.5;
|
|
94
|
+
border-right-width: $popover-arrow-height;
|
|
95
|
+
border-left-width: 0;
|
|
96
|
+
border-bottom-width: $popover-arrow-width * 0.5;
|
|
97
|
+
border-top-color: transparent; // added for bootstrap-rn
|
|
98
|
+
border-right-color: $popover-arrow-color;
|
|
99
|
+
border-left-color: transparent; // added for bootstrap-rn
|
|
100
|
+
border-bottom-color: transparent; // added for bootstrap-rn
|
|
101
|
+
`,
|
|
102
|
+
'.bs-popover-bottom .popover-arrow': css`
|
|
103
|
+
top: ${subtract(
|
|
104
|
+
(t: ThemeVariables) => `-${t['popover-arrow-height']}`,
|
|
105
|
+
(t: ThemeVariables) => t['popover-border-width'],
|
|
106
|
+
)};
|
|
107
|
+
`,
|
|
108
|
+
'.bs-popover-bottom .popover-arrow::before': css`
|
|
109
|
+
top: 0;
|
|
110
|
+
border-top-width: 0;
|
|
111
|
+
border-right-width: $popover-arrow-width * 0.5;
|
|
112
|
+
border-left-width: $popover-arrow-width * 0.5;
|
|
113
|
+
border-bottom-width: $popover-arrow-height;
|
|
114
|
+
border-top-color: transparent; // added for bootstrap-rn
|
|
115
|
+
border-right-color: transparent; // added for bootstrap-rn
|
|
116
|
+
border-left-color: transparent; // added for bootstrap-rn
|
|
117
|
+
border-bottom-color: $popover-arrow-outer-color;
|
|
118
|
+
`,
|
|
119
|
+
'.bs-popover-bottom .popover-arrow::after': css`
|
|
120
|
+
top: $popover-border-width;
|
|
121
|
+
border-top-width: 0;
|
|
122
|
+
border-right-width: $popover-arrow-width * 0.5;
|
|
123
|
+
border-left-width: $popover-arrow-width * 0.5;
|
|
124
|
+
border-bottom-width: $popover-arrow-height;
|
|
125
|
+
border-top-color: transparent; // added for bootstrap-rn
|
|
126
|
+
border-right-color: transparent; // added for bootstrap-rn
|
|
127
|
+
border-left-color: transparent; // added for bootstrap-rn
|
|
128
|
+
border-bottom-color: $popover-arrow-color;
|
|
129
|
+
`,
|
|
130
|
+
'.bs-popover-start .popover-arrow': css`
|
|
131
|
+
right: ${subtract(
|
|
132
|
+
(t: ThemeVariables) => `-${t['popover-arrow-height']}`,
|
|
133
|
+
(t: ThemeVariables) => t['popover-border-width'],
|
|
134
|
+
)};
|
|
135
|
+
width: $popover-arrow-height;
|
|
136
|
+
height: $popover-arrow-width;
|
|
137
|
+
`,
|
|
138
|
+
'.bs-popover-start .popover-arrow::before': css`
|
|
139
|
+
right: 0;
|
|
140
|
+
border-top-width: $popover-arrow-width * 0.5;
|
|
141
|
+
border-right-width: 0;
|
|
142
|
+
border-left-width: $popover-arrow-height;
|
|
143
|
+
border-bottom-width: $popover-arrow-width * 0.5;
|
|
144
|
+
border-top-color: transparent; // added for bootstrap-rn
|
|
145
|
+
border-right-color: transparent; // added for bootstrap-rn
|
|
146
|
+
border-left-color: $popover-arrow-outer-color;
|
|
147
|
+
border-bottom-color: transparent; // added for bootstrap-rn
|
|
148
|
+
`,
|
|
149
|
+
'.bs-popover-start .popover-arrow::after': css`
|
|
150
|
+
right: $popover-border-width;
|
|
151
|
+
border-top-width: $popover-arrow-width * 0.5;
|
|
152
|
+
border-right-width: 0;
|
|
153
|
+
border-left-width: $popover-arrow-height;
|
|
154
|
+
border-bottom-width: $popover-arrow-width * 0.5;
|
|
155
|
+
border-top-color: transparent; // added for bootstrap-rn
|
|
156
|
+
border-right-color: transparent; // added for bootstrap-rn
|
|
157
|
+
border-left-color: $popover-arrow-color;
|
|
158
|
+
border-bottom-color: transparent; // added for bootstrap-rn
|
|
159
|
+
`,
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const PopoverArrow = React.forwardRef<ViewRef, PopoverArrowProps>(
|
|
163
|
+
(props, ref) => {
|
|
164
|
+
const { style, ...elementProps } = props;
|
|
165
|
+
|
|
166
|
+
const { placement, arrowStyle, popper } = useForcedContext(PopoverContext);
|
|
167
|
+
|
|
168
|
+
const classes = getStyles(styles, [
|
|
169
|
+
'.popover-arrow',
|
|
170
|
+
popper && `.bs-popover-${placement} .popover-arrow`,
|
|
171
|
+
]);
|
|
172
|
+
const beforeClasses = getStyles(styles, [
|
|
173
|
+
'.popover-arrow::before',
|
|
174
|
+
popper && `.bs-popover-${placement} .popover-arrow::before`,
|
|
175
|
+
]);
|
|
176
|
+
const afterClasses = getStyles(styles, [
|
|
177
|
+
'.popover-arrow::after',
|
|
178
|
+
popper && `.bs-popover-${placement} .popover-arrow::after`,
|
|
179
|
+
]);
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<View {...elementProps} ref={ref} style={[classes, arrowStyle, style]}>
|
|
183
|
+
<View style={beforeClasses} />
|
|
184
|
+
<View style={afterClasses} />
|
|
185
|
+
</View>
|
|
186
|
+
);
|
|
187
|
+
},
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
PopoverArrow.displayName = 'PopoverArrow';
|
|
191
|
+
|
|
192
|
+
export default PopoverArrow;
|
|
@@ -1,102 +1,118 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import View, { ViewProps, ViewRef } from '../View';
|
|
3
|
-
import StyleSheet from '../../style/StyleSheet';
|
|
4
|
-
import { getStyles } from '../../utils';
|
|
5
|
-
import css from '../../style/css';
|
|
6
|
-
import useForcedContext from '../../hooks/useForcedContext';
|
|
7
|
-
import TooltipContext from './TooltipContext';
|
|
8
|
-
|
|
9
|
-
export interface TooltipArrowProps extends ViewProps {}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
border-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
bottom:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
border-top-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
top: 0;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
bottom: -
|
|
56
|
-
border-top-
|
|
57
|
-
border-right-
|
|
58
|
-
border-left-
|
|
59
|
-
border-bottom-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
left: -
|
|
69
|
-
border-
|
|
70
|
-
border-
|
|
71
|
-
border-
|
|
72
|
-
border-
|
|
73
|
-
border-
|
|
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
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import View, { ViewProps, ViewRef } from '../View';
|
|
3
|
+
import StyleSheet from '../../style/StyleSheet';
|
|
4
|
+
import { getStyles } from '../../utils';
|
|
5
|
+
import css from '../../style/css';
|
|
6
|
+
import useForcedContext from '../../hooks/useForcedContext';
|
|
7
|
+
import TooltipContext from './TooltipContext';
|
|
8
|
+
|
|
9
|
+
export interface TooltipArrowProps extends ViewProps {}
|
|
10
|
+
|
|
11
|
+
// Note: Border colors are defined for each side, because it seems like that the new react native
|
|
12
|
+
// architecture overwrites border colors from a previous style on Android.
|
|
13
|
+
// Example: `.bs-tooltip-top .tooltip-arrow::before` overwrites `.tooltip-arrow::before`
|
|
14
|
+
|
|
15
|
+
const styles = StyleSheet.create({
|
|
16
|
+
'.tooltip-arrow': css`
|
|
17
|
+
position: absolute;
|
|
18
|
+
// display: block;
|
|
19
|
+
width: $tooltip-arrow-width;
|
|
20
|
+
height: $tooltip-arrow-height;
|
|
21
|
+
`,
|
|
22
|
+
'.tooltip-arrow::before': css`
|
|
23
|
+
position: absolute;
|
|
24
|
+
// content: "";
|
|
25
|
+
border-top-color: transparent;
|
|
26
|
+
border-right-color: transparent;
|
|
27
|
+
border-left-color: transparent;
|
|
28
|
+
border-bottom-color: transparent;
|
|
29
|
+
border-style: solid;
|
|
30
|
+
`,
|
|
31
|
+
'.bs-tooltip-top .tooltip-arrow': css`
|
|
32
|
+
bottom: 0;
|
|
33
|
+
`,
|
|
34
|
+
'.bs-tooltip-top .tooltip-arrow::before': css`
|
|
35
|
+
top: -1px;
|
|
36
|
+
border-top-width: $tooltip-arrow-height;
|
|
37
|
+
border-right-width: $tooltip-arrow-width * 0.5;
|
|
38
|
+
border-left-width: $tooltip-arrow-width * 0.5;
|
|
39
|
+
border-bottom-width: 0;
|
|
40
|
+
border-top-color: $tooltip-arrow-color;
|
|
41
|
+
border-right-color: transparent; // added for bootstrap-rn
|
|
42
|
+
border-left-color: transparent; // added for bootstrap-rn
|
|
43
|
+
border-bottom-color: transparent; // added for bootstrap-rn
|
|
44
|
+
`,
|
|
45
|
+
'.bs-tooltip-end .tooltip-arrow': css`
|
|
46
|
+
left: 0;
|
|
47
|
+
width: $tooltip-arrow-height;
|
|
48
|
+
height: $tooltip-arrow-width;
|
|
49
|
+
`,
|
|
50
|
+
'.bs-tooltip-end .tooltip-arrow::before': css`
|
|
51
|
+
right: -1px;
|
|
52
|
+
border-top-width: $tooltip-arrow-width * 0.5;
|
|
53
|
+
border-right-width: $tooltip-arrow-height;
|
|
54
|
+
border-left-width: 0;
|
|
55
|
+
border-bottom-width: $tooltip-arrow-width * 0.5;
|
|
56
|
+
border-top-color: transparent; // added for bootstrap-rn
|
|
57
|
+
border-right-color: $tooltip-arrow-color;
|
|
58
|
+
border-left-color: transparent; // added for bootstrap-rn
|
|
59
|
+
border-bottom-color: transparent; // added for bootstrap-rn
|
|
60
|
+
`,
|
|
61
|
+
'.bs-tooltip-bottom .tooltip-arrow': css`
|
|
62
|
+
top: 0;
|
|
63
|
+
`,
|
|
64
|
+
'.bs-tooltip-bottom .tooltip-arrow::before': css`
|
|
65
|
+
bottom: -1px;
|
|
66
|
+
border-top-width: 0;
|
|
67
|
+
border-right-width: $tooltip-arrow-width * 0.5;
|
|
68
|
+
border-left-width: $tooltip-arrow-width * 0.5;
|
|
69
|
+
border-bottom-width: $tooltip-arrow-height;
|
|
70
|
+
border-top-color: transparent; // added for bootstrap-rn
|
|
71
|
+
border-right-color: transparent; // added for bootstrap-rn
|
|
72
|
+
border-left-color: transparent; // added for bootstrap-rn
|
|
73
|
+
border-bottom-color: $tooltip-arrow-color;
|
|
74
|
+
`,
|
|
75
|
+
'.bs-tooltip-start .tooltip-arrow': css`
|
|
76
|
+
right: 0;
|
|
77
|
+
width: $tooltip-arrow-height;
|
|
78
|
+
height: $tooltip-arrow-width;
|
|
79
|
+
`,
|
|
80
|
+
'.bs-tooltip-start .tooltip-arrow::before': css`
|
|
81
|
+
left: -1px;
|
|
82
|
+
border-top-width: $tooltip-arrow-width * 0.5;
|
|
83
|
+
border-right-width: 0;
|
|
84
|
+
border-left-width: $tooltip-arrow-height;
|
|
85
|
+
border-bottom-width: $tooltip-arrow-width * 0.5;
|
|
86
|
+
border-top-color: transparent; // added for bootstrap-rn
|
|
87
|
+
border-right-color: transparent; // added for bootstrap-rn
|
|
88
|
+
border-left-color: $tooltip-arrow-color;
|
|
89
|
+
border-bottom-color: transparent; // added for bootstrap-rn
|
|
90
|
+
`,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const TooltipArrow = React.forwardRef<ViewRef, TooltipArrowProps>(
|
|
94
|
+
(props, ref) => {
|
|
95
|
+
const { style, ...elementProps } = props;
|
|
96
|
+
|
|
97
|
+
const { placement, arrowStyle, popper } = useForcedContext(TooltipContext);
|
|
98
|
+
|
|
99
|
+
const classes = getStyles(styles, [
|
|
100
|
+
'.tooltip-arrow',
|
|
101
|
+
popper && `.bs-tooltip-${placement} .tooltip-arrow`,
|
|
102
|
+
]);
|
|
103
|
+
const beforeClasses = getStyles(styles, [
|
|
104
|
+
'.tooltip-arrow::before',
|
|
105
|
+
popper && `.bs-tooltip-${placement} .tooltip-arrow::before`,
|
|
106
|
+
]);
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<View {...elementProps} ref={ref} style={[classes, arrowStyle, style]}>
|
|
110
|
+
<View style={beforeClasses} />
|
|
111
|
+
</View>
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
TooltipArrow.displayName = 'TooltipArrow';
|
|
117
|
+
|
|
118
|
+
export default TooltipArrow;
|
package/src/index.ts
CHANGED
|
@@ -210,6 +210,9 @@ export type { SwitchProps } from './components/forms/Switch';
|
|
|
210
210
|
export { default as Spinner } from './components/spinners/Spinner';
|
|
211
211
|
export type { SpinnerProps } from './components/spinners/Spinner';
|
|
212
212
|
|
|
213
|
+
export { default as SafeAreaView } from './components/SafeAreaView';
|
|
214
|
+
export type { SafeAreaViewProps } from './components/SafeAreaView';
|
|
215
|
+
|
|
213
216
|
export { default as ScrollView } from './components/ScrollView';
|
|
214
217
|
export type { ScrollViewProps } from './components/ScrollView';
|
|
215
218
|
|