@coinbase/cds-mobile 9.4.0 → 9.4.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 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
+ ## 9.4.1 (6/15/2026 PST)
12
+
13
+ #### 🐞 Fixes
14
+
15
+ - Fix: Modal appearance props now apply to the modal card. [[#758](https://github.com/coinbase/cds/pull/758)]
16
+
11
17
  ## 9.4.0 (6/15/2026 PST)
12
18
 
13
19
  #### 🚀 Updates
@@ -1,12 +1,53 @@
1
1
  import React from 'react';
2
- import type { ModalProps as RNModalProps, ViewStyle } from 'react-native';
2
+ import type { ModalProps as RNModalProps, StyleProp, ViewStyle } from 'react-native';
3
3
  import { type ModalContextValue } from '@coinbase/cds-common/overlays/ModalContext';
4
4
  import type { SharedProps } from '@coinbase/cds-common/types/SharedProps';
5
+ import type { BoxProps } from '../../layout/Box';
5
6
  type ModalChildrenRenderProps = {
6
7
  closeModal: () => void;
7
8
  };
9
+ /**
10
+ * Appearance style props forwarded to the visible dialog surface (rather than the
11
+ * underlying React Native Modal, which silently ignores them).
12
+ */
13
+ type DialogStyleProps = Pick<
14
+ BoxProps,
15
+ | 'background'
16
+ | 'color'
17
+ | 'borderColor'
18
+ | 'borderWidth'
19
+ | 'borderRadius'
20
+ | 'borderTopLeftRadius'
21
+ | 'borderTopRightRadius'
22
+ | 'borderBottomLeftRadius'
23
+ | 'borderBottomRightRadius'
24
+ | 'borderTopWidth'
25
+ | 'borderBottomWidth'
26
+ | 'borderStartWidth'
27
+ | 'borderEndWidth'
28
+ | 'bordered'
29
+ | 'borderedTop'
30
+ | 'borderedBottom'
31
+ | 'borderedStart'
32
+ | 'borderedEnd'
33
+ | 'borderedHorizontal'
34
+ | 'borderedVertical'
35
+ | 'elevation'
36
+ | 'padding'
37
+ | 'paddingX'
38
+ | 'paddingY'
39
+ | 'paddingTop'
40
+ | 'paddingBottom'
41
+ | 'paddingStart'
42
+ | 'paddingEnd'
43
+ | 'minWidth'
44
+ | 'minHeight'
45
+ | 'maxWidth'
46
+ | 'maxHeight'
47
+ >;
8
48
  export type ModalBaseProps = SharedProps &
9
49
  ModalContextValue &
50
+ DialogStyleProps &
10
51
  Omit<RNModalProps, 'children' | 'visible' | 'onRequestClose' | 'animationType'> & {
11
52
  /** Component to render as the Modal content */
12
53
  children?: React.ReactNode | ((props: ModalChildrenRenderProps) => React.ReactNode);
@@ -19,12 +60,20 @@ export type ModalBaseProps = SharedProps &
19
60
  * */
20
61
  width?: number;
21
62
  zIndex?: ViewStyle['zIndex'];
63
+ /** Custom styles for individual elements of the Modal */
64
+ styles?: {
65
+ /** Visible modal card element */
66
+ modal?: StyleProp<ViewStyle>;
67
+ /** Safe area region wrapping the modal children */
68
+ safeArea?: StyleProp<ViewStyle>;
69
+ };
22
70
  };
23
71
  export type ModalRefBaseProps = Pick<ModalBaseProps, 'onRequestClose'>;
24
72
  export type ModalProps = ModalBaseProps;
25
73
  export declare const Modal: React.NamedExoticComponent<
26
74
  SharedProps &
27
75
  ModalContextValue &
76
+ DialogStyleProps &
28
77
  Omit<RNModalProps, 'children' | 'visible' | 'onRequestClose' | 'animationType'> & {
29
78
  /** Component to render as the Modal content */
30
79
  children?: React.ReactNode | ((props: ModalChildrenRenderProps) => React.ReactNode);
@@ -37,6 +86,13 @@ export declare const Modal: React.NamedExoticComponent<
37
86
  * */
38
87
  width?: number;
39
88
  zIndex?: ViewStyle['zIndex'];
89
+ /** Custom styles for individual elements of the Modal */
90
+ styles?: {
91
+ /** Visible modal card element */
92
+ modal?: StyleProp<ViewStyle>;
93
+ /** Safe area region wrapping the modal children */
94
+ safeArea?: StyleProp<ViewStyle>;
95
+ };
40
96
  } & React.RefAttributes<ModalRefBaseProps>
41
97
  >;
42
98
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../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M,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC7B,yDAAyD;IACzD,MAAM,CAAC,EAAE;QACP,iCAAiC;QACjC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7B,mDAAmD;QACnD,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACjC,CAAC;CACH,CAAC;AAEJ,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAEvE,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC;AAMxC,eAAO,MAAM,KAAK;IA5Bd,+CAA+C;eACpC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,wBAAwB,KAAK,KAAK,CAAC,SAAS,CAAC;IACnF;;OAEG;iBACU,MAAM,IAAI;IACvB;;SAEK;YACG,MAAM;aACL,SAAS,CAAC,QAAQ,CAAC;IAC5B,yDAAyD;aAChD;QACP,iCAAiC;QACjC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7B,mDAAmD;QACnD,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACjC;2CAkKJ,CAAC"}
@@ -1,4 +1,4 @@
1
- const _excluded = ["children", "visible", "onRequestClose", "onDidClose", "hideDividers", "hideCloseButton"];
1
+ const _excluded = ["children", "visible", "onRequestClose", "onDidClose", "hideDividers", "hideCloseButton", "styles", "background", "color", "borderColor", "borderWidth", "borderRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderTopWidth", "borderBottomWidth", "borderStartWidth", "borderEndWidth", "bordered", "borderedTop", "borderedBottom", "borderedStart", "borderedEnd", "borderedHorizontal", "borderedVertical", "elevation", "padding", "paddingX", "paddingY", "paddingTop", "paddingBottom", "paddingStart", "paddingEnd", "minWidth", "minHeight", "maxWidth", "maxHeight"];
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, useState } from 'react';
@@ -10,6 +10,11 @@ import { OverlayContentContext } from '@coinbase/cds-common/overlays/OverlayCont
10
10
  import { useComponentConfig } from '../../hooks/useComponentConfig';
11
11
  import { VStack } from '../../layout/VStack';
12
12
  import { useModalAnimation } from './useModalAnimation';
13
+
14
+ /**
15
+ * Appearance style props forwarded to the visible dialog surface (rather than the
16
+ * underlying React Native Modal, which silently ignores them).
17
+ */
13
18
  import { jsx as _jsx } from "react/jsx-runtime";
14
19
  const overlayContentContextValue = {
15
20
  isModal: true
@@ -23,7 +28,41 @@ export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) =>
23
28
  onRequestClose,
24
29
  onDidClose,
25
30
  hideDividers,
26
- hideCloseButton
31
+ hideCloseButton,
32
+ styles: customStyles,
33
+ // Dialog surface appearance
34
+ background,
35
+ color,
36
+ borderColor,
37
+ borderWidth,
38
+ borderRadius,
39
+ borderTopLeftRadius,
40
+ borderTopRightRadius,
41
+ borderBottomLeftRadius,
42
+ borderBottomRightRadius,
43
+ borderTopWidth,
44
+ borderBottomWidth,
45
+ borderStartWidth,
46
+ borderEndWidth,
47
+ bordered,
48
+ borderedTop,
49
+ borderedBottom,
50
+ borderedStart,
51
+ borderedEnd,
52
+ borderedHorizontal,
53
+ borderedVertical,
54
+ elevation = 2,
55
+ padding,
56
+ paddingX,
57
+ paddingY,
58
+ paddingTop,
59
+ paddingBottom,
60
+ paddingStart,
61
+ paddingEnd,
62
+ minWidth,
63
+ minHeight,
64
+ maxWidth,
65
+ maxHeight
27
66
  } = props,
28
67
  restProps = _objectWithoutPropertiesLoose(props, _excluded);
29
68
  const [{
@@ -76,17 +115,47 @@ export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) =>
76
115
  animationType: "none",
77
116
  children: /*#__PURE__*/_jsx(VStack, {
78
117
  animated: true,
79
- elevation: 2,
118
+ background: background,
119
+ borderBottomLeftRadius: borderBottomLeftRadius,
120
+ borderBottomRightRadius: borderBottomRightRadius,
121
+ borderBottomWidth: borderBottomWidth,
122
+ borderColor: borderColor,
123
+ borderEndWidth: borderEndWidth,
124
+ borderRadius: borderRadius,
125
+ borderStartWidth: borderStartWidth,
126
+ borderTopLeftRadius: borderTopLeftRadius,
127
+ borderTopRightRadius: borderTopRightRadius,
128
+ borderTopWidth: borderTopWidth,
129
+ borderWidth: borderWidth,
130
+ bordered: bordered,
131
+ borderedBottom: borderedBottom,
132
+ borderedEnd: borderedEnd,
133
+ borderedHorizontal: borderedHorizontal,
134
+ borderedStart: borderedStart,
135
+ borderedTop: borderedTop,
136
+ borderedVertical: borderedVertical,
137
+ color: color,
138
+ elevation: elevation,
139
+ maxHeight: maxHeight,
140
+ maxWidth: maxWidth,
141
+ minHeight: minHeight,
142
+ minWidth: minWidth,
143
+ padding: padding,
144
+ paddingBottom: paddingBottom,
145
+ paddingEnd: paddingEnd,
146
+ paddingStart: paddingStart,
147
+ paddingTop: paddingTop,
148
+ paddingX: paddingX,
149
+ paddingY: paddingY,
80
150
  pin: "all",
81
- style: {
151
+ style: [{
82
152
  transform: [{
83
153
  scale
84
154
  }],
85
- opacity,
86
- borderWidth: 0
87
- },
155
+ opacity
156
+ }, customStyles == null ? void 0 : customStyles.modal],
88
157
  children: /*#__PURE__*/_jsx(SafeAreaView, {
89
- style: styles.safeAreaContainer,
158
+ style: [styles.safeAreaContainer, customStyles == null ? void 0 : customStyles.safeArea],
90
159
  children: /*#__PURE__*/_jsx(ModalContext.Provider, {
91
160
  value: modalData,
92
161
  children: typeof children === 'function' ? children(renderChildrenProps) : children
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-mobile",
3
- "version": "9.4.0",
3
+ "version": "9.4.1",
4
4
  "description": "Coinbase Design System - Mobile",
5
5
  "repository": {
6
6
  "type": "git",
@@ -206,7 +206,7 @@
206
206
  "react-native-worklets": "0.5.2"
207
207
  },
208
208
  "dependencies": {
209
- "@coinbase/cds-common": "^9.4.0",
209
+ "@coinbase/cds-common": "^9.4.1",
210
210
  "@coinbase/cds-icons": "^5.19.0",
211
211
  "@coinbase/cds-illustrations": "^4.42.0",
212
212
  "@coinbase/cds-lottie-files": "^3.3.4",