@coinbase/cds-mobile 9.0.0-rc.3 β 9.0.0
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 +26 -8
- package/README.md +2 -2
- package/dts/buttons/Button.d.ts.map +1 -1
- package/dts/buttons/IconButton.d.ts.map +1 -1
- package/dts/controls/NativeInput.d.ts +12 -2
- package/dts/controls/NativeInput.d.ts.map +1 -1
- package/dts/controls/SearchInput.d.ts +1 -1
- package/dts/controls/TextInput.d.ts +5 -2
- package/dts/controls/TextInput.d.ts.map +1 -1
- package/dts/visualizations/chart/gradient/Gradient.d.ts.map +1 -1
- package/esm/buttons/IconButton.js +4 -2
- package/esm/controls/NativeInput.js +3 -1
- package/esm/controls/TextInput.js +20 -16
- package/esm/visualizations/chart/area/__stories__/AreaChart.stories.js +44 -2
- package/esm/visualizations/chart/gradient/Gradient.js +11 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,23 +8,41 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
-
## 9.0.0
|
|
11
|
+
## 9.0.0 (5/20/2026 PST)
|
|
12
|
+
|
|
13
|
+
CDS 9 is here!!
|
|
14
|
+
|
|
15
|
+
For more details and to help upgrading from CDS 8 using our automated migration tool, see our official [upgrade guide](https://cds.coinbase.com/guides/v9-upgrade-guide)!
|
|
16
|
+
|
|
17
|
+
#### π₯ Breaking
|
|
18
|
+
|
|
19
|
+
- Peer dependency range updated: React 19 & React Native 0.81.5 (Expo SDK 54)
|
|
20
|
+
- Removed remaining instances of fixed height/width values across all components which may cause subtle layout shifts in your app.
|
|
21
|
+
- Some component propsβ types have narrowed in response to React 19 upgrade.
|
|
22
|
+
- Read our upgrade guilde for more details!
|
|
12
23
|
|
|
13
24
|
#### π Updates
|
|
14
25
|
|
|
15
|
-
-
|
|
26
|
+
- Migrated full set of components from mobile-visualization package to new `visualizations/chart` and `visualizations/sparkline` sub-paths.
|
|
27
|
+
- Read our upgrade guilde for more details!
|
|
16
28
|
|
|
17
|
-
##
|
|
29
|
+
## 8.75.2 ((5/19/2026, 01:13 PM PST))
|
|
18
30
|
|
|
19
|
-
|
|
31
|
+
This is an artificial version bump with no new change.
|
|
20
32
|
|
|
21
|
-
|
|
33
|
+
## 8.75.1 ((5/19/2026, 07:30 AM PST))
|
|
22
34
|
|
|
23
|
-
|
|
35
|
+
This is an artificial version bump with no new change.
|
|
24
36
|
|
|
25
|
-
|
|
37
|
+
## 8.75.0 (5/15/2026 PST)
|
|
38
|
+
|
|
39
|
+
#### π Updates
|
|
40
|
+
|
|
41
|
+
- Feat: support selectionColor on Inputs. [[#688](https://github.com/coinbase/cds/pull/688)]
|
|
42
|
+
|
|
43
|
+
#### π Fixes
|
|
26
44
|
|
|
27
|
-
-
|
|
45
|
+
- Fix: set proper height for TextInput for inside labelVariant. [[#688](https://github.com/coinbase/cds/pull/688)]
|
|
28
46
|
|
|
29
47
|
## 8.74.3 ((5/14/2026, 05:35 PM PST))
|
|
30
48
|
|
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@ Components for React Native.
|
|
|
6
6
|
|
|
7
7
|
Add the relative path to the CDS icon font to your react-native.config.js. If your project lives in the monorepo this lives in the root `react-native.config.js` file. There is an example for CDS playground in there.
|
|
8
8
|
|
|
9
|
-
In this monorepo, run the `
|
|
9
|
+
In this monorepo, run the `expo-app` targets from the repo root:
|
|
10
10
|
|
|
11
|
-
- `yarn nx run
|
|
11
|
+
- `yarn nx run expo-app:launch:ios-debug` or `yarn nx run expo-app:launch:android-debug` for local debug launch
|
|
12
12
|
|
|
13
13
|
### Outside monorepo
|
|
14
14
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/buttons/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiE,MAAM,OAAO,CAAC;AACtF,OAAO,EAA+C,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iCAAiC;aACxB,OAAO;IAChB;;;OAGG;cACO,iBAAiB;IAC3B,wEAAwE;aAC/D;QACP,6BAA6B;QAC7B,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B,oCAAoC;QACpC,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B,sCAAsC;QACtC,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACvC;wCAuFJ,CAAC"}
|
|
@@ -30,13 +30,18 @@ export type NativeInputProps = {
|
|
|
30
30
|
* @default body
|
|
31
31
|
*/
|
|
32
32
|
font?: ThemeVars.Font;
|
|
33
|
+
/**
|
|
34
|
+
* Color of the selection (including caret).
|
|
35
|
+
* @default fgPrimary
|
|
36
|
+
*/
|
|
37
|
+
selectionColor?: ThemeVars.Color;
|
|
33
38
|
} & SharedProps &
|
|
34
39
|
Pick<TextInputBaseProps, 'compact'> &
|
|
35
40
|
Pick<
|
|
36
41
|
SharedAccessibilityProps,
|
|
37
42
|
'accessibilityLabel' | 'accessibilityLabelledBy' | 'accessibilityHint'
|
|
38
43
|
> &
|
|
39
|
-
Omit<TextInputProps, 'textAlign'>;
|
|
44
|
+
Omit<TextInputProps, 'textAlign' | 'selectionColor'>;
|
|
40
45
|
export declare const NativeInput: React.NamedExoticComponent<
|
|
41
46
|
{
|
|
42
47
|
/**
|
|
@@ -62,13 +67,18 @@ export declare const NativeInput: React.NamedExoticComponent<
|
|
|
62
67
|
* @default body
|
|
63
68
|
*/
|
|
64
69
|
font?: ThemeVars.Font;
|
|
70
|
+
/**
|
|
71
|
+
* Color of the selection (including caret).
|
|
72
|
+
* @default fgPrimary
|
|
73
|
+
*/
|
|
74
|
+
selectionColor?: ThemeVars.Color;
|
|
65
75
|
} & SharedProps &
|
|
66
76
|
Pick<TextInputBaseProps, 'compact'> &
|
|
67
77
|
Pick<
|
|
68
78
|
SharedAccessibilityProps,
|
|
69
79
|
'accessibilityLabel' | 'accessibilityHint' | 'accessibilityLabelledBy'
|
|
70
80
|
> &
|
|
71
|
-
Omit<TextInputProps, 'textAlign'> &
|
|
81
|
+
Omit<TextInputProps, 'textAlign' | 'selectionColor'> &
|
|
72
82
|
React.RefAttributes<TextInput>
|
|
73
83
|
>;
|
|
74
84
|
//# sourceMappingURL=NativeInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeInput.d.ts","sourceRoot":"","sources":["../../src/controls/NativeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAa,cAAc,EAAa,SAAS,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAIpG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;SAGK;IACL,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACzC;;;SAGK;IACL,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC;IAClD;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeInput.d.ts","sourceRoot":"","sources":["../../src/controls/NativeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAA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ACjD;;;OAGG;WACI,SAAS,CAAC,IAAI;IACrB;;;OAGG;qBACc,SAAS,CAAC,KAAK;uPAqGjC,CAAC"}
|
|
@@ -167,7 +167,7 @@ export declare const SearchInput: React.NamedExoticComponent<
|
|
|
167
167
|
bordered?: boolean;
|
|
168
168
|
} & Omit<
|
|
169
169
|
import('react-native').TextInputProps,
|
|
170
|
-
'value' | 'textAlign' | 'onChange' | 'onChangeText'
|
|
170
|
+
'value' | 'textAlign' | 'selectionColor' | 'onChange' | 'onChangeText'
|
|
171
171
|
> & {
|
|
172
172
|
value?: import('react-native').TextInputProps['value'];
|
|
173
173
|
onChange?: import('react-native').TextInputProps['onChange'];
|
|
@@ -75,7 +75,7 @@ export type TextInputBaseProps = SharedProps &
|
|
|
75
75
|
bordered?: boolean;
|
|
76
76
|
};
|
|
77
77
|
export type TextInputProps = TextInputBaseProps &
|
|
78
|
-
Omit<RNTextInputProps, 'value' | 'onChange' | 'onChangeText' | 'textAlign'> & {
|
|
78
|
+
Omit<RNTextInputProps, 'value' | 'onChange' | 'onChangeText' | 'textAlign' | 'selectionColor'> & {
|
|
79
79
|
value?: RNTextInputProps['value'];
|
|
80
80
|
onChange?: RNTextInputProps['onChange'];
|
|
81
81
|
onChangeText?: RNTextInputProps['onChangeText'];
|
|
@@ -152,7 +152,10 @@ export declare const TextInput: React.NamedExoticComponent<
|
|
|
152
152
|
* @default true
|
|
153
153
|
*/
|
|
154
154
|
bordered?: boolean;
|
|
155
|
-
} & Omit<
|
|
155
|
+
} & Omit<
|
|
156
|
+
RNTextInputProps,
|
|
157
|
+
'value' | 'textAlign' | 'selectionColor' | 'onChange' | 'onChangeText'
|
|
158
|
+
> & {
|
|
156
159
|
value?: RNTextInputProps['value'];
|
|
157
160
|
onChange?: RNTextInputProps['onChange'];
|
|
158
161
|
onChangeText?: RNTextInputProps['onChangeText'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/controls/T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,KAAK,CAAC,SAAS;IAC3B;;;;OAIG;eACQ,OAAO;;YAKV,gBAAgB,CAAC,OAAO,CAAC;eACtB,gBAAgB,CAAC,UAAU,CAAC;mBACxB,gBAAgB,CAAC,cAAc,CAAC;IAC/C;;;OAGG;gBACS,cAAc;IAC1B;;;OAGG;gBACS,gBAAgB,CAAC,WAAW,CAAC,GAAG,OAAO;qCA0QtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gradient.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/gradient/Gradient.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAyD,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAClG,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG;IAC9C;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"Gradient.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/gradient/Gradient.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAyD,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAClG,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG;IAC9C;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,qDAyJpB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["name", "active", "variant", "transparent", "compact", "background", "color", "borderColor", "iconSize", "borderWidth", "borderRadius", "feedback", "flush", "padding", "loading", "progressCircleSize", "style", "styles", "accessibilityHint", "accessibilityLabel"];
|
|
1
|
+
const _excluded = ["name", "active", "variant", "alignSelf", "transparent", "compact", "background", "color", "borderColor", "iconSize", "borderWidth", "borderRadius", "feedback", "flush", "padding", "loading", "progressCircleSize", "style", "styles", "accessibilityHint", "accessibilityLabel"];
|
|
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 { forwardRef, memo } from 'react';
|
|
@@ -15,6 +15,8 @@ export const IconButton = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref
|
|
|
15
15
|
name,
|
|
16
16
|
active,
|
|
17
17
|
variant = 'secondary',
|
|
18
|
+
alignSelf = 'flex-start',
|
|
19
|
+
// prevents stretching when placed in a flex container
|
|
18
20
|
transparent,
|
|
19
21
|
compact = true,
|
|
20
22
|
background,
|
|
@@ -47,7 +49,7 @@ export const IconButton = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref
|
|
|
47
49
|
accessibilityHint: accessibilityHint,
|
|
48
50
|
accessibilityLabel: loading ? (accessibilityLabel != null ? accessibilityLabel : '') + ", loading" : accessibilityLabel,
|
|
49
51
|
alignItems: "center",
|
|
50
|
-
alignSelf:
|
|
52
|
+
alignSelf: alignSelf,
|
|
51
53
|
background: backgroundValue,
|
|
52
54
|
borderColor: borderColorValue,
|
|
53
55
|
borderRadius: borderRadius,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["containerSpacing", "testID", "align", "disabled", "textAlign", "font", "accessibilityLabel", "compact", "style"];
|
|
1
|
+
const _excluded = ["containerSpacing", "testID", "align", "disabled", "textAlign", "font", "accessibilityLabel", "compact", "selectionColor", "style"];
|
|
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, useMemo } from 'react';
|
|
@@ -16,6 +16,7 @@ export const NativeInput = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref)
|
|
|
16
16
|
font = 'body',
|
|
17
17
|
accessibilityLabel,
|
|
18
18
|
compact,
|
|
19
|
+
selectionColor = 'fgPrimary',
|
|
19
20
|
style
|
|
20
21
|
} = _ref,
|
|
21
22
|
editableInputAddonProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
@@ -57,6 +58,7 @@ export const NativeInput = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref)
|
|
|
57
58
|
editable: !disabled,
|
|
58
59
|
keyboardAppearance: theme.activeColorScheme,
|
|
59
60
|
placeholderTextColor: theme.color.fgMuted,
|
|
61
|
+
selectionColor: theme.color[selectionColor],
|
|
60
62
|
style: inputRootStyles,
|
|
61
63
|
testID: testID,
|
|
62
64
|
textAlign: textAlign !== 'unset' ? textAlign : undefined
|
|
@@ -27,7 +27,7 @@ const variantColorMap = {
|
|
|
27
27
|
secondary: 'bgSecondary'
|
|
28
28
|
};
|
|
29
29
|
export const TextInput = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
30
|
-
var _testIDMap$end, _testIDMap$helperText, _testIDMap$label;
|
|
30
|
+
var _testIDMap$end, _testIDMap$helperText, _testIDMap$label, _testIDMap$label2;
|
|
31
31
|
const mergedProps = useComponentConfig('TextInput', _props);
|
|
32
32
|
const {
|
|
33
33
|
label,
|
|
@@ -166,29 +166,33 @@ export const TextInput = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref)
|
|
|
166
166
|
containerSpacing: containerSpacing,
|
|
167
167
|
disabled: disabled,
|
|
168
168
|
font: font,
|
|
169
|
+
selectionColor: variantColorMap[focusedVariant],
|
|
169
170
|
testID: testID
|
|
170
171
|
}, editableInputAddonProps)),
|
|
171
172
|
labelNode: !compact && (labelNode && labelVariant !== 'inside' ? labelNode : hasLabel && /*#__PURE__*/_jsx(Pressable, {
|
|
172
173
|
accessibilityRole: "button",
|
|
173
174
|
disabled: disabled,
|
|
174
175
|
onPress: handleNodePress,
|
|
175
|
-
children:
|
|
176
|
-
|
|
176
|
+
children: labelVariant === 'inside' && labelNode ? /*#__PURE__*/_jsx(Box, {
|
|
177
|
+
background: readOnlyInputBackground,
|
|
178
|
+
paddingEnd: 2,
|
|
177
179
|
paddingStart: start ? 0.5 : 2,
|
|
180
|
+
children: labelNode
|
|
181
|
+
}) : labelVariant === 'inside' ? /*#__PURE__*/_jsx(InputLabel, {
|
|
182
|
+
background: readOnlyInputBackground,
|
|
183
|
+
color: labelColor,
|
|
184
|
+
font: labelFont,
|
|
178
185
|
paddingEnd: 2,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
children: label
|
|
190
|
-
}))
|
|
191
|
-
}))
|
|
186
|
+
paddingStart: start ? 0.5 : 2,
|
|
187
|
+
paddingY: 0,
|
|
188
|
+
testID: (_testIDMap$label = testIDMap == null ? void 0 : testIDMap.label) != null ? _testIDMap$label : '',
|
|
189
|
+
children: label
|
|
190
|
+
}) : /*#__PURE__*/_jsx(InputLabel, {
|
|
191
|
+
color: labelColor,
|
|
192
|
+
font: labelFont,
|
|
193
|
+
testID: (_testIDMap$label2 = testIDMap == null ? void 0 : testIDMap.label) != null ? _testIDMap$label2 : '',
|
|
194
|
+
children: label
|
|
195
|
+
})
|
|
192
196
|
})),
|
|
193
197
|
labelVariant: labelVariant,
|
|
194
198
|
startNode: (compact && hasLabel || !!start) && /*#__PURE__*/_jsx(Box, {
|
|
@@ -1,9 +1,10 @@
|
|
|
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 { memo, useCallback } from 'react';
|
|
2
|
+
import { memo, useCallback, useState } from 'react';
|
|
3
3
|
import { candles as btcCandles } from '@coinbase/cds-common/internal/data/candles';
|
|
4
|
+
import { Button } from '../../../../buttons/Button';
|
|
4
5
|
import { Example, ExampleScreen } from '../../../../examples/ExampleScreen';
|
|
5
6
|
import { useTheme } from '../../../../hooks/useTheme';
|
|
6
|
-
import { VStack } from '../../../../layout';
|
|
7
|
+
import { Box, VStack } from '../../../../layout';
|
|
7
8
|
import { DefaultReferenceLineLabel, DottedLine, ReferenceLine } from '../../line';
|
|
8
9
|
import { Scrubber } from '../../scrubber/Scrubber';
|
|
9
10
|
import { AreaChart } from '..';
|
|
@@ -211,6 +212,44 @@ const AxisBaselineThresholdExample = () => {
|
|
|
211
212
|
})]
|
|
212
213
|
});
|
|
213
214
|
};
|
|
215
|
+
|
|
216
|
+
// Regression repro for CDS-2065. The default baseline is 0; alternating between
|
|
217
|
+
// an all-positive dataset (2 gradient stops) and a negative-crossing dataset
|
|
218
|
+
// (3 gradient stops) causes the Gradient component to swap stop counts between
|
|
219
|
+
// renders. Before the fix this crashed with `ReanimatedError: Positions array
|
|
220
|
+
// must have the same size as colors array`.
|
|
221
|
+
const positiveOnlyData = [10, 25, 15, 40, 30, 50, 35];
|
|
222
|
+
const crossesBaselineData = [-20, 25, -15, 40, -30, 50, 35];
|
|
223
|
+
const BaselineCrossingExample = () => {
|
|
224
|
+
const [crosses, setCrosses] = useState(false);
|
|
225
|
+
const data = crosses ? crossesBaselineData : positiveOnlyData;
|
|
226
|
+
return /*#__PURE__*/_jsxs(VStack, {
|
|
227
|
+
gap: 2,
|
|
228
|
+
children: [/*#__PURE__*/_jsx(AreaChart, {
|
|
229
|
+
showLines: true,
|
|
230
|
+
showYAxis: true,
|
|
231
|
+
accessibilityLabel: "Area chart toggling across the y-axis baseline",
|
|
232
|
+
height: 220,
|
|
233
|
+
series: [{
|
|
234
|
+
id: 'flow',
|
|
235
|
+
data
|
|
236
|
+
}],
|
|
237
|
+
type: "gradient",
|
|
238
|
+
yAxis: {
|
|
239
|
+
baseline: 0,
|
|
240
|
+
showGrid: true
|
|
241
|
+
}
|
|
242
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
243
|
+
paddingX: 2,
|
|
244
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
245
|
+
compact: true,
|
|
246
|
+
onPress: () => setCrosses(c => !c),
|
|
247
|
+
variant: "secondary",
|
|
248
|
+
children: "Toggle baseline crossing"
|
|
249
|
+
})
|
|
250
|
+
})]
|
|
251
|
+
});
|
|
252
|
+
};
|
|
214
253
|
const AreaChartStories = () => {
|
|
215
254
|
return /*#__PURE__*/_jsxs(ExampleScreen, {
|
|
216
255
|
children: [/*#__PURE__*/_jsx(Example, {
|
|
@@ -238,6 +277,9 @@ const AreaChartStories = () => {
|
|
|
238
277
|
},
|
|
239
278
|
children: /*#__PURE__*/_jsx(Scrubber, {})
|
|
240
279
|
})
|
|
280
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
281
|
+
title: "Baseline Crossing (CDS-2065 repro)",
|
|
282
|
+
children: /*#__PURE__*/_jsx(BaselineCrossingExample, {})
|
|
241
283
|
}), /*#__PURE__*/_jsx(Example, {
|
|
242
284
|
title: "Axis Baseline",
|
|
243
285
|
children: /*#__PURE__*/_jsx(AreaChart, {
|
|
@@ -64,7 +64,7 @@ export const Gradient = /*#__PURE__*/memo(_ref => {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
// Extract colors and positions for LinearGradient.
|
|
67
|
-
const
|
|
67
|
+
const targetColors = useMemo(() => (stops != null ? stops : []).map(stop => {
|
|
68
68
|
var _stop$opacity;
|
|
69
69
|
return getColorWithOpacity(stop.color, (_stop$opacity = stop.opacity) != null ? _stop$opacity : 1);
|
|
70
70
|
}), [stops]);
|
|
@@ -73,6 +73,11 @@ export const Gradient = /*#__PURE__*/memo(_ref => {
|
|
|
73
73
|
const startY = useSharedValue(targetStart.y);
|
|
74
74
|
const endX = useSharedValue(targetEnd.x);
|
|
75
75
|
const endY = useSharedValue(targetEnd.y);
|
|
76
|
+
|
|
77
|
+
// colors lives on the worklet so it flips in lockstep with positions; updating
|
|
78
|
+
// it via useMemo on the JS thread races the worklet-driven positions and Skia
|
|
79
|
+
// can paint mismatched array sizes when the stop count changes.
|
|
80
|
+
const currentColors = useSharedValue(targetColors);
|
|
76
81
|
const fromPositions = useSharedValue(targetPositions);
|
|
77
82
|
const toPositions = useSharedValue(targetPositions);
|
|
78
83
|
const positionsProgress = useSharedValue(1);
|
|
@@ -88,6 +93,7 @@ export const Gradient = /*#__PURE__*/memo(_ref => {
|
|
|
88
93
|
startY.value = targetStart.y;
|
|
89
94
|
endX.value = targetEnd.x;
|
|
90
95
|
endY.value = targetEnd.y;
|
|
96
|
+
currentColors.value = targetColors;
|
|
91
97
|
fromPositions.value = [...targetPositions];
|
|
92
98
|
toPositions.value = [...targetPositions];
|
|
93
99
|
positionsProgress.value = 1;
|
|
@@ -99,16 +105,18 @@ export const Gradient = /*#__PURE__*/memo(_ref => {
|
|
|
99
105
|
endY.value = buildTransition(targetEnd.y, transition);
|
|
100
106
|
const canAnimatePositions = toPositions.value.length === targetPositions.length;
|
|
101
107
|
if (canAnimatePositions) {
|
|
108
|
+
currentColors.value = targetColors;
|
|
102
109
|
fromPositions.value = [...toPositions.value];
|
|
103
110
|
toPositions.value = [...targetPositions];
|
|
104
111
|
positionsProgress.value = 0;
|
|
105
112
|
positionsProgress.value = buildTransition(1, transition);
|
|
106
113
|
} else {
|
|
114
|
+
currentColors.value = targetColors;
|
|
107
115
|
fromPositions.value = [...targetPositions];
|
|
108
116
|
toPositions.value = [...targetPositions];
|
|
109
117
|
positionsProgress.value = 1;
|
|
110
118
|
}
|
|
111
|
-
}, [transition, targetStart.x, targetStart.y, targetEnd.x, targetEnd.y, targetPositions, startX, startY, endX, endY, fromPositions, toPositions, positionsProgress, shouldRender]);
|
|
119
|
+
}, [transition, targetStart.x, targetStart.y, targetEnd.x, targetEnd.y, targetColors, targetPositions, startX, startY, endX, endY, currentColors, fromPositions, toPositions, positionsProgress, shouldRender]);
|
|
112
120
|
const start = useDerivedValue(() => {
|
|
113
121
|
return {
|
|
114
122
|
x: startX.value,
|
|
@@ -121,6 +129,7 @@ export const Gradient = /*#__PURE__*/memo(_ref => {
|
|
|
121
129
|
y: endY.value
|
|
122
130
|
};
|
|
123
131
|
}, [endX, endY]);
|
|
132
|
+
const colors = useDerivedValue(() => currentColors.value, [currentColors]);
|
|
124
133
|
const positions = useDerivedValue(() => {
|
|
125
134
|
const from = fromPositions.value;
|
|
126
135
|
const to = toPositions.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "9.0.0
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
"react-native-worklets": "0.5.2"
|
|
203
203
|
},
|
|
204
204
|
"dependencies": {
|
|
205
|
-
"@coinbase/cds-common": "^9.0.0
|
|
205
|
+
"@coinbase/cds-common": "^9.0.0",
|
|
206
206
|
"@coinbase/cds-icons": "^5.16.0",
|
|
207
207
|
"@coinbase/cds-illustrations": "^4.40.1",
|
|
208
208
|
"@coinbase/cds-lottie-files": "^3.3.4",
|