@coinbase/cds-mobile 8.16.3 → 8.16.4
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 +6 -0
- package/dts/overlays/drawer/Drawer.d.ts.map +1 -1
- package/dts/overlays/handlebar/HandleBar.d.ts +5 -1
- package/dts/overlays/handlebar/HandleBar.d.ts.map +1 -1
- package/esm/overlays/drawer/Drawer.js +20 -35
- package/esm/overlays/handlebar/HandleBar.js +27 -15
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.16.4 (10/15/2025 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Fix Android Tray handle bar unfocusable issue. [[#99](https://github.com/coinbase/cds/pull/99)] [DX-4932]
|
|
16
|
+
|
|
11
17
|
## 8.16.3 (10/14/2025 PST)
|
|
12
18
|
|
|
13
19
|
#### 🐞 Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/overlays/drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAahF,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,EAAE,CAAC;IAAE,WAAW,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CAAC;AAEzE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gDAAgD;IAChD,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,WAAW,GACvC,IAAI,CAA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;OAGG;6BACsB,OAAO;IAChC;;;OAGG;yCACkC,OAAO;IAC5C;;;SAGK;oBACW,OAAO;IACvB,uDAAuD;qBACtC,MAAM,IAAI;IAC3B;;;OAGG;wCACiC,OAAO;IAC3C,oEAAoE;aAC3D,MAAM,IAAI;IAEnB;;;OAGG;qCAC8B,MAAM;IACvC;;;OAGG;kCAC2B,MAAM;IACpC;;;OAGG;mBACY,oBAAoB,GAAG,KAAK,CAAC,SAAS;6CAwLxD,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ViewProps } from 'react-native';
|
|
2
|
+
export type HandleBarProps = ViewProps & {
|
|
3
|
+
/** Callback fired when the handlebar is pressed via accessibility action */
|
|
4
|
+
onAccessibilityPress?: () => void;
|
|
5
|
+
};
|
|
2
6
|
export declare const HandleBar: {
|
|
3
|
-
(props:
|
|
7
|
+
({ onAccessibilityPress, ...props }: HandleBarProps): import('react/jsx-runtime').JSX.Element;
|
|
4
8
|
displayName: string;
|
|
5
9
|
};
|
|
6
10
|
//# sourceMappingURL=HandleBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandleBar.d.ts","sourceRoot":"","sources":["../../../src/overlays/handlebar/HandleBar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"HandleBar.d.ts","sourceRoot":"","sources":["../../../src/overlays/handlebar/HandleBar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA4B,SAAS,EAAE,MAAM,cAAc,CAAC;AAKxE,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IACvC,4EAA4E;IAC5E,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,SAAS;yCAAwC,cAAc;;CAiC3E,CAAC"}
|
|
@@ -2,7 +2,7 @@ const _excluded = ["children", "pin", "onCloseComplete", "preventDismissGestures
|
|
|
2
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
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; }
|
|
4
4
|
import React, { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
5
|
-
import { Animated, Modal, Platform, StyleSheet, useWindowDimensions
|
|
5
|
+
import { Animated, Modal, Platform, StyleSheet, useWindowDimensions } from 'react-native';
|
|
6
6
|
import { drawerAnimationDefaultDuration, MAX_OVER_DRAG } from '@coinbase/cds-common/animation/drawer';
|
|
7
7
|
import { OverlayContentContext } from '@coinbase/cds-common/overlays/OverlayContentContext';
|
|
8
8
|
import { horizontalDrawerPercentageOfView, verticalDrawerPercentageOfView as defaultVerticalDrawerPercentageOfView } from '@coinbase/cds-common/tokens/drawer';
|
|
@@ -118,34 +118,12 @@ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(
|
|
|
118
118
|
overflow: 'hidden'
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
|
-
const combinedStyles = [cardStyles.spacing, drawerAnimationStyles];
|
|
122
121
|
useImperativeHandle(ref, () => ({
|
|
123
122
|
handleClose
|
|
124
123
|
}), [handleClose]);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (shouldShowHandleBar) {
|
|
129
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
130
|
-
children: [/*#__PURE__*/_jsx(HandleBar, {
|
|
131
|
-
accessibilityLabel: handleBarAccessibilityLabel,
|
|
132
|
-
accessibilityRole: "button",
|
|
133
|
-
onAccessibilityTap: handleClose
|
|
134
|
-
}), /*#__PURE__*/_jsx(Box, {
|
|
135
|
-
borderRadius: 400,
|
|
136
|
-
style: shouldShowHandleBar && cardStyles.overflowStyles,
|
|
137
|
-
children: typeof children === 'function' ? children({
|
|
138
|
-
handleClose
|
|
139
|
-
}) : children
|
|
140
|
-
})]
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
return /*#__PURE__*/_jsx(View, {
|
|
144
|
-
children: typeof children === 'function' ? children({
|
|
145
|
-
handleClose
|
|
146
|
-
}) : children
|
|
147
|
-
});
|
|
148
|
-
}, [shouldShowHandleBar, cardStyles, children, handleClose, handleBarAccessibilityLabel]);
|
|
124
|
+
const content = useMemo(() => typeof children === 'function' ? children({
|
|
125
|
+
handleClose
|
|
126
|
+
}) : children, [children, handleClose]);
|
|
149
127
|
return /*#__PURE__*/_jsx(Modal, _extends({
|
|
150
128
|
hardwareAccelerated: true,
|
|
151
129
|
transparent: true,
|
|
@@ -163,20 +141,27 @@ export const Drawer = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Drawer(
|
|
|
163
141
|
onTouchStart: handleOverlayPress,
|
|
164
142
|
opacity: opacityAnimation,
|
|
165
143
|
testID: "drawer-overlay"
|
|
166
|
-
}), /*#__PURE__*/
|
|
144
|
+
}), /*#__PURE__*/_jsxs(Box, _extends({}, getPanGestureHandlers, {
|
|
167
145
|
animated: true,
|
|
168
|
-
|
|
169
|
-
bordered: activeColorScheme === 'dark',
|
|
170
|
-
elevation: 2,
|
|
171
|
-
maxHeight: !isPinHorizontal ? verticalDrawerMaxHeight : '100%',
|
|
172
|
-
onAccessibilityEscape: handleClose,
|
|
173
|
-
pin: pin,
|
|
174
|
-
style: combinedStyles
|
|
146
|
+
onAccessibilityEscape: handleClose
|
|
175
147
|
// close modal when user performs the "escape" accessibility gesture
|
|
176
148
|
// https://reactnative.dev/docs/accessibility#onaccessibilityescape-ios
|
|
177
149
|
,
|
|
150
|
+
pin: pin,
|
|
151
|
+
style: drawerAnimationStyles,
|
|
178
152
|
width: isPinHorizontal ? horizontalDrawerWidth : '100%',
|
|
179
|
-
children:
|
|
153
|
+
children: [shouldShowHandleBar && /*#__PURE__*/_jsx(HandleBar, {
|
|
154
|
+
accessibilityLabel: handleBarAccessibilityLabel,
|
|
155
|
+
accessibilityRole: "button",
|
|
156
|
+
onAccessibilityPress: handleClose
|
|
157
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
158
|
+
borderRadius: isPinHorizontal ? 0 : 400,
|
|
159
|
+
bordered: activeColorScheme === 'dark',
|
|
160
|
+
elevation: 2,
|
|
161
|
+
maxHeight: !isPinHorizontal ? verticalDrawerMaxHeight : '100%',
|
|
162
|
+
style: [cardStyles.spacing, shouldShowHandleBar && cardStyles.overflowStyles],
|
|
163
|
+
children: content
|
|
164
|
+
})]
|
|
180
165
|
}))]
|
|
181
166
|
})
|
|
182
167
|
}));
|
|
@@ -1,19 +1,37 @@
|
|
|
1
|
+
const _excluded = ["onAccessibilityPress"];
|
|
1
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); }
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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; }
|
|
4
|
+
import { useCallback } from 'react';
|
|
5
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
6
|
+
import { handleBarHeight } from '@coinbase/cds-common/tokens/drawer';
|
|
5
7
|
import { useTheme } from '../../hooks/useTheme';
|
|
6
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const HandleBar =
|
|
9
|
+
export const HandleBar = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
onAccessibilityPress
|
|
12
|
+
} = _ref,
|
|
13
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
8
14
|
const theme = useTheme();
|
|
9
15
|
const handleBarBackgroundColor = theme.color.bgSecondary;
|
|
10
16
|
const handleBarStyles = {
|
|
11
|
-
backgroundColor: handleBarBackgroundColor
|
|
12
|
-
marginBottom: theme.space[2]
|
|
17
|
+
backgroundColor: handleBarBackgroundColor
|
|
13
18
|
};
|
|
14
|
-
|
|
19
|
+
const touchableAreaStyles = {
|
|
20
|
+
paddingBottom: theme.space[2],
|
|
21
|
+
paddingTop: theme.space[2]
|
|
22
|
+
};
|
|
23
|
+
const handleAccessibilityAction = useCallback(event => {
|
|
24
|
+
if (event.nativeEvent.actionName === 'activate') {
|
|
25
|
+
onAccessibilityPress == null || onAccessibilityPress();
|
|
26
|
+
}
|
|
27
|
+
}, [onAccessibilityPress]);
|
|
28
|
+
return /*#__PURE__*/_jsx(Pressable, _extends({
|
|
15
29
|
accessible: true,
|
|
16
|
-
|
|
30
|
+
accessibilityActions: onAccessibilityPress ? [{
|
|
31
|
+
name: 'activate'
|
|
32
|
+
}] : undefined,
|
|
33
|
+
onAccessibilityAction: handleAccessibilityAction,
|
|
34
|
+
style: [styles.touchableArea, touchableAreaStyles],
|
|
17
35
|
testID: "handleBar"
|
|
18
36
|
}, props, {
|
|
19
37
|
children: /*#__PURE__*/_jsx(View, {
|
|
@@ -23,13 +41,7 @@ export const HandleBar = props => {
|
|
|
23
41
|
};
|
|
24
42
|
const styles = StyleSheet.create({
|
|
25
43
|
touchableArea: {
|
|
26
|
-
|
|
27
|
-
top: -handleBarOffset,
|
|
28
|
-
left: 0,
|
|
29
|
-
right: 0,
|
|
30
|
-
height: handleBarOffset,
|
|
31
|
-
alignItems: 'center',
|
|
32
|
-
justifyContent: 'flex-end'
|
|
44
|
+
alignItems: 'center'
|
|
33
45
|
},
|
|
34
46
|
handleBar: {
|
|
35
47
|
width: 64,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "8.16.
|
|
3
|
+
"version": "8.16.4",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"react-native-svg": "^14.1.0"
|
|
151
151
|
},
|
|
152
152
|
"dependencies": {
|
|
153
|
-
"@coinbase/cds-common": "^8.16.
|
|
153
|
+
"@coinbase/cds-common": "^8.16.4",
|
|
154
154
|
"@coinbase/cds-icons": "^5.4.2",
|
|
155
155
|
"@coinbase/cds-illustrations": "^4.24.0",
|
|
156
156
|
"@coinbase/cds-lottie-files": "^3.3.2",
|