@coinbase/cds-mobile 8.62.1 → 8.66.1
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/CHANGELOG.md +56 -0
- package/dts/cells/Cell.d.ts.map +1 -1
- package/dts/overlays/modal/ModalHeader.d.ts +1 -1
- package/dts/overlays/modal/ModalHeader.d.ts.map +1 -1
- package/dts/stepper/Stepper.d.ts.map +1 -1
- package/dts/tabs/DefaultTab.d.ts +50 -0
- package/dts/tabs/DefaultTab.d.ts.map +1 -0
- package/dts/tabs/DefaultTabsActiveIndicator.d.ts +11 -0
- package/dts/tabs/DefaultTabsActiveIndicator.d.ts.map +1 -0
- package/dts/tabs/TabIndicator.d.ts +2 -0
- package/dts/tabs/TabIndicator.d.ts.map +1 -1
- package/dts/tabs/TabLabel.d.ts +2 -0
- package/dts/tabs/TabLabel.d.ts.map +1 -1
- package/dts/tabs/TabNavigation.d.ts +16 -0
- package/dts/tabs/TabNavigation.d.ts.map +1 -1
- package/dts/tabs/Tabs.d.ts +26 -11
- package/dts/tabs/Tabs.d.ts.map +1 -1
- package/dts/tabs/index.d.ts +2 -0
- package/dts/tabs/index.d.ts.map +1 -1
- package/dts/tour/DefaultTourStepArrow.d.ts +1 -1
- package/dts/tour/DefaultTourStepArrow.d.ts.map +1 -1
- package/dts/tour/Tour.d.ts +28 -2
- package/dts/tour/Tour.d.ts.map +1 -1
- package/dts/tour/TourStep.d.ts +3 -0
- package/dts/tour/TourStep.d.ts.map +1 -1
- package/esm/cells/Cell.js +2 -1
- package/esm/cells/__stories__/ListCell.stories.js +2 -0
- package/esm/icons/__figma__/Icon.figma.js +1771 -868
- package/esm/overlays/__stories__/ModalCustomHeader.stories.js +86 -0
- package/esm/overlays/modal/ModalHeader.js +13 -4
- package/esm/stepper/Stepper.js +4 -3
- package/esm/tabs/DefaultTab.js +75 -0
- package/esm/tabs/DefaultTabsActiveIndicator.js +58 -0
- package/esm/tabs/TabIndicator.js +2 -0
- package/esm/tabs/TabLabel.js +2 -0
- package/esm/tabs/TabNavigation.js +20 -0
- package/esm/tabs/Tabs.js +17 -13
- package/esm/tabs/__stories__/Tabs.stories.js +165 -64
- package/esm/tabs/index.js +2 -0
- package/esm/tour/DefaultTourStepArrow.js +1 -2
- package/esm/tour/Tour.js +23 -7
- package/esm/tour/TourStep.js +11 -6
- package/package.json +4 -6
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
1
|
import React, { forwardRef, memo, useMemo } from 'react';
|
|
3
2
|
import { Box } from '../layout/Box';
|
|
4
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -25,7 +24,7 @@ export const DefaultTourStepArrow = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_
|
|
|
25
24
|
if (placement.includes('bottom')) arrowStyle.top = 0.5 * -height;
|
|
26
25
|
if (placement.includes('left')) arrowStyle.right = 0.5 * -width;
|
|
27
26
|
if (placement.includes('right')) arrowStyle.left = 0.5 * -width;
|
|
28
|
-
return
|
|
27
|
+
return [arrowStyle, style];
|
|
29
28
|
}, [arrow, placement, style, width, height, hideArrow]);
|
|
30
29
|
return /*#__PURE__*/_jsx(Box, {
|
|
31
30
|
ref: ref,
|
package/esm/tour/Tour.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useCallback, useRef } from 'react';
|
|
3
|
-
import { Modal, View } from 'react-native';
|
|
2
|
+
import React, { useCallback, useMemo, useRef } from 'react';
|
|
3
|
+
import { Modal, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { OverlayContentContext } from '@coinbase/cds-common/overlays/OverlayContentContext';
|
|
5
5
|
import { TourContext } from '@coinbase/cds-common/tour/TourContext';
|
|
6
6
|
import { useTour } from '@coinbase/cds-common/tour/useTour';
|
|
@@ -14,8 +14,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
const overlayContentContextValue = {
|
|
15
15
|
isTour: true
|
|
16
16
|
};
|
|
17
|
+
|
|
18
|
+
// ------------ SUBCOMPONENT PROP TYPES ------------
|
|
19
|
+
|
|
20
|
+
// ------------ SUBCOMPONENT TYPES ------------
|
|
21
|
+
|
|
17
22
|
const TourComponent = _props => {
|
|
18
|
-
var
|
|
23
|
+
var _ref, _activeTourStep$hideO, _activeTourStep$tourM, _activeTourStep$tourM2;
|
|
19
24
|
const mergedProps = useComponentConfig('Tour', _props);
|
|
20
25
|
const {
|
|
21
26
|
steps,
|
|
@@ -29,6 +34,7 @@ const TourComponent = _props => {
|
|
|
29
34
|
hideOverlay,
|
|
30
35
|
tourMaskPadding,
|
|
31
36
|
tourMaskBorderRadius,
|
|
37
|
+
styles,
|
|
32
38
|
accessibilityLabel,
|
|
33
39
|
accessibilityLabelledBy,
|
|
34
40
|
id,
|
|
@@ -39,13 +45,20 @@ const TourComponent = _props => {
|
|
|
39
45
|
const defaultTourStepShiftPadding = theme.space[4];
|
|
40
46
|
const tourStepArrowRef = useRef(null);
|
|
41
47
|
const RenderedTourStep = activeTourStep == null ? void 0 : activeTourStep.Component;
|
|
42
|
-
|
|
48
|
+
// activeTourStep.ArrowComponent references old, deprecated type in cds-common
|
|
49
|
+
const RenderedTourStepArrow = (_ref = activeTourStep == null ? void 0 : activeTourStep.ArrowComponent) != null ? _ref : TourStepArrowComponent;
|
|
43
50
|
const [animation, animationApi] = useSpring(() => ({
|
|
44
51
|
from: {
|
|
45
52
|
opacity: 0
|
|
46
53
|
},
|
|
47
54
|
config: springConfig.slow
|
|
48
55
|
}), []);
|
|
56
|
+
|
|
57
|
+
// StyleSheet.flatten is needed because styles?.mask/stepContainer are StyleProp<ViewStyle>,
|
|
58
|
+
// which may be arrays. Unlike RN's Animated.View, react-spring's animated.View only accepts
|
|
59
|
+
// plain style objects, so we must flatten before merging with the spring animation values.
|
|
60
|
+
const maskStyles = useMemo(() => _extends({}, animation, StyleSheet.flatten(styles == null ? void 0 : styles.mask)), [animation, styles == null ? void 0 : styles.mask]);
|
|
61
|
+
const stepContainerStyles = useMemo(() => _extends({}, animation, StyleSheet.flatten(styles == null ? void 0 : styles.stepContainer)), [animation, styles == null ? void 0 : styles.stepContainer]);
|
|
49
62
|
const {
|
|
50
63
|
refs,
|
|
51
64
|
floatingStyles,
|
|
@@ -124,9 +137,11 @@ const TourComponent = _props => {
|
|
|
124
137
|
animationType: "none",
|
|
125
138
|
id: id,
|
|
126
139
|
presentationStyle: "overFullScreen",
|
|
140
|
+
style: styles == null ? void 0 : styles.root,
|
|
127
141
|
testID: testID,
|
|
128
142
|
children: [!((_activeTourStep$hideO = activeTourStep.hideOverlay) != null ? _activeTourStep$hideO : hideOverlay) && !!activeTourStepTarget && /*#__PURE__*/_jsx(animated.View, {
|
|
129
|
-
style:
|
|
143
|
+
style: maskStyles,
|
|
144
|
+
testID: "tour-mask",
|
|
130
145
|
children: /*#__PURE__*/_jsx(TourMaskComponent, {
|
|
131
146
|
activeTourStepTarget: activeTourStepTarget,
|
|
132
147
|
borderRadius: (_activeTourStep$tourM = activeTourStep.tourMaskBorderRadius) != null ? _activeTourStep$tourM : tourMaskBorderRadius,
|
|
@@ -137,12 +152,13 @@ const TourComponent = _props => {
|
|
|
137
152
|
collapsable: false,
|
|
138
153
|
style: floatingStyles,
|
|
139
154
|
children: /*#__PURE__*/_jsxs(animated.View, {
|
|
140
|
-
style:
|
|
155
|
+
style: stepContainerStyles,
|
|
156
|
+
testID: "tour-step-container",
|
|
141
157
|
children: [/*#__PURE__*/_jsx(RenderedTourStepArrow, {
|
|
142
158
|
ref: tourStepArrowRef,
|
|
143
159
|
arrow: arrow,
|
|
144
160
|
placement: placement,
|
|
145
|
-
style:
|
|
161
|
+
style: styles == null ? void 0 : styles.stepArrow
|
|
146
162
|
}), /*#__PURE__*/_jsx(RenderedTourStep, _extends({}, activeTourStep))]
|
|
147
163
|
})
|
|
148
164
|
})]
|
package/esm/tour/TourStep.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
const _excluded = ["id", "children"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
1
4
|
import React, { useCallback } from 'react';
|
|
2
5
|
import { View } from 'react-native';
|
|
3
6
|
import { useTourContext } from '@coinbase/cds-common/tour/TourContext';
|
|
@@ -9,17 +12,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
12
|
*/
|
|
10
13
|
export const TourStep = _ref => {
|
|
11
14
|
let {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
id,
|
|
16
|
+
children
|
|
17
|
+
} = _ref,
|
|
18
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
15
19
|
const {
|
|
16
20
|
activeTourStep,
|
|
17
21
|
setActiveTourStepTarget
|
|
18
22
|
} = useTourContext();
|
|
19
23
|
const refCallback = useCallback(ref => (activeTourStep == null ? void 0 : activeTourStep.id) === id && ref && setActiveTourStepTarget(ref), [activeTourStep, id, setActiveTourStepTarget]);
|
|
20
|
-
return /*#__PURE__*/_jsx(View, {
|
|
24
|
+
return /*#__PURE__*/_jsx(View, _extends({
|
|
21
25
|
ref: refCallback,
|
|
22
|
-
collapsable: false
|
|
26
|
+
collapsable: false
|
|
27
|
+
}, props, {
|
|
23
28
|
children: children
|
|
24
|
-
});
|
|
29
|
+
}));
|
|
25
30
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.66.1",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -189,7 +189,6 @@
|
|
|
189
189
|
"react-native": "^0.74.5",
|
|
190
190
|
"react-native-gesture-handler": "^2.16.2",
|
|
191
191
|
"react-native-inappbrowser-reborn": "^3.7.0",
|
|
192
|
-
"react-native-linear-gradient": "^2.8.3",
|
|
193
192
|
"react-native-navigation-bar-color": "^2.0.2",
|
|
194
193
|
"react-native-reanimated": "^3.14.0",
|
|
195
194
|
"react-native-safe-area-context": "^4.10.5",
|
|
@@ -197,9 +196,9 @@
|
|
|
197
196
|
"react-native-svg": "^14.1.0"
|
|
198
197
|
},
|
|
199
198
|
"dependencies": {
|
|
200
|
-
"@coinbase/cds-common": "^8.
|
|
201
|
-
"@coinbase/cds-icons": "^5.
|
|
202
|
-
"@coinbase/cds-illustrations": "^4.
|
|
199
|
+
"@coinbase/cds-common": "^8.66.1",
|
|
200
|
+
"@coinbase/cds-icons": "^5.16.0",
|
|
201
|
+
"@coinbase/cds-illustrations": "^4.38.0",
|
|
203
202
|
"@coinbase/cds-lottie-files": "^3.3.4",
|
|
204
203
|
"@coinbase/cds-utils": "^2.3.5",
|
|
205
204
|
"@floating-ui/react-native": "^0.10.5",
|
|
@@ -225,7 +224,6 @@
|
|
|
225
224
|
"react-native-accessibility-engine": "^3.2.0",
|
|
226
225
|
"react-native-gesture-handler": "2.16.2",
|
|
227
226
|
"react-native-inappbrowser-reborn": "3.7.0",
|
|
228
|
-
"react-native-linear-gradient": "2.8.3",
|
|
229
227
|
"react-native-navigation-bar-color": "2.0.2",
|
|
230
228
|
"react-native-reanimated": "3.14.0",
|
|
231
229
|
"react-native-safe-area-context": "4.10.5",
|