@coinbase/cds-mobile 8.16.4 → 8.17.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,22 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  <!-- template-start -->
10
10
 
11
+ ## 8.17.1 (10/16/2025 PST)
12
+
13
+ #### 🐞 Fixes
14
+
15
+ - Remove console.error() call on action props for Banner. [[#113](https://github.com/coinbase/cds/pull/113)]
16
+
17
+ ## 8.17.0 ((10/16/2025, 07:14 AM PST))
18
+
19
+ This is an artificial version bump with no new change.
20
+
21
+ ## 8.16.5 (10/16/2025 PST)
22
+
23
+ #### 🐞 Fixes
24
+
25
+ - Fix onMount Stepper animations when step other than first is initially active. [[#109](https://github.com/coinbase/cds/pull/109)]
26
+
11
27
  ## 8.16.4 (10/15/2025 PST)
12
28
 
13
29
  #### 🐞 Fixes
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../src/banner/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAChG,OAAO,KAAK,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAMpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAsB7C,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,2GAA2G;IAC3G,OAAO,EAAE,aAAa,CAAC;IACvB,6CAA6C;IAC7C,SAAS,EAAE,QAAQ,CAAC;IACpB,uCAAuC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4HAA4H;IAC5H,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC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E,MAAM,CAAC;IACrC,yDAAyD;IACzD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;SAGK;IACL,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;SAGK;IACL,YAAY,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAEhF,eAAO,MAAM,MAAM;IAhDjB,2GAA2G;aAClG,aAAa;IACtB,6CAA6C;eAClC,QAAQ;IACnB,uCAAuC;sBACrB,OAAO;IACzB,4HAA4H;oBAC5G,KAAK,CAAC,SAAS;IAC/B,2HAA2H;sBACzG,KAAK,CAAC,SAAS;IACjC,2DAA2D;YACnD,KAAK,CAAC,SAAS;IACvB,wBAAwB;eACb,KAAK,CAAC,SAAS;IAC1B;;;SAGK;kBACS,OAAO;IACrB,gDAAgD;cACtC,MAAM,IAAI;IACpB,gFAAgF;oBAChE,MAAM;IACtB,gCAAgC;YACxB,KAAK,CAAC,SAAS;IACvB;;;SAGK;mBACU,kBAAkB;IACjC,uDAAuD;kCACzB,MAAM;IACpC,yDAAyD;8BAC/B,MAAM;IAChC;;;SAGK;eACM,OAAO;IAClB;;;SAGK;mBACU,SAAS,CAAC,YAAY;gFAmNtC,CAAC"}
@@ -3,7 +3,6 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
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, isValidElement, memo, useCallback, useMemo, useState } from 'react';
5
5
  import { variants } from '@coinbase/cds-common/tokens/banner';
6
- import { isDevelopment } from '@coinbase/cds-utils';
7
6
  import { Collapsible } from '../collapsible/Collapsible';
8
7
  import { useTheme } from '../hooks/useTheme';
9
8
  import { Icon } from '../icons';
@@ -73,35 +72,33 @@ export const Banner = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Banner(
73
72
  iconButtonColor,
74
73
  borderColor
75
74
  } = variants[variant];
76
-
77
- // Ensure primaryActions are themed to match the variant
78
75
  const clonedPrimaryAction = useMemo(() => {
79
- if (/*#__PURE__*/isValidElement(primaryAction) && (primaryAction == null ? void 0 : primaryAction.type) === Link) {
76
+ if (! /*#__PURE__*/isValidElement(primaryAction)) return null;
77
+ if (primaryAction.type === Link) {
80
78
  return /*#__PURE__*/React.cloneElement(primaryAction, _extends({
81
79
  font: 'label1',
82
80
  color: primaryActionColor,
83
81
  testID: testID + "-action--primary"
84
82
  }, primaryAction.props));
83
+ } else {
84
+ return /*#__PURE__*/React.cloneElement(primaryAction, _extends({
85
+ testID: testID + "-action--primary"
86
+ }, primaryAction.props));
85
87
  }
86
-
87
- // Throw warning in dev
88
- if (/*#__PURE__*/isValidElement(primaryAction) && isDevelopment()) {
89
- console.error('Banner primaryAction needs to be a CDS Link component');
90
- }
91
- return primaryAction;
92
88
  }, [primaryAction, primaryActionColor, testID]);
93
89
  const clonedSecondaryAction = useMemo(() => {
94
- if (/*#__PURE__*/isValidElement(secondaryAction) && secondaryAction.type === Link) {
90
+ if (! /*#__PURE__*/isValidElement(secondaryAction)) return null;
91
+ if (secondaryAction.type === Link) {
95
92
  return /*#__PURE__*/React.cloneElement(secondaryAction, _extends({
96
93
  font: 'label1',
97
94
  color: secondaryActionColor,
98
95
  testID: testID + "-action--secondary"
99
96
  }, secondaryAction.props));
97
+ } else {
98
+ return /*#__PURE__*/React.cloneElement(secondaryAction, _extends({
99
+ testID: testID + "-action--secondary"
100
+ }, secondaryAction.props));
100
101
  }
101
- if (/*#__PURE__*/isValidElement(secondaryAction) && isDevelopment()) {
102
- console.error('Banner secondaryAction needs to be a CDS Link component');
103
- }
104
- return secondaryAction;
105
102
  }, [secondaryAction, secondaryActionColor, testID]);
106
103
  const marginStyles = useMemo(() => ({
107
104
  margin,
@@ -2,6 +2,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
2
2
  import React from 'react';
3
3
  import { loremIpsum } from '@coinbase/cds-common/internal/data/loremIpsum';
4
4
  import { NoopFn as noopFn } from '@coinbase/cds-common/utils/mockUtils';
5
+ import { Button } from '../../buttons';
5
6
  import { Example, ExampleScreen } from '../../examples/ExampleScreen';
6
7
  import { Spacer, VStack } from '../../layout';
7
8
  import { Link } from '../../typography/Link';
@@ -91,6 +92,22 @@ const Banners = _ref => {
91
92
  }), /*#__PURE__*/_jsx(Banner, _extends({}, props, {
92
93
  primaryAction: primaryAction,
93
94
  secondaryAction: secondaryAction
95
+ })), /*#__PURE__*/_jsx(Text, {
96
+ font: "title1",
97
+ children: "Primary Action is not a Link"
98
+ }), /*#__PURE__*/_jsx(Banner, _extends({}, props, {
99
+ primaryAction: /*#__PURE__*/_jsx(Button, {
100
+ compact: true,
101
+ children: "Primary Action"
102
+ })
103
+ })), /*#__PURE__*/_jsx(Text, {
104
+ font: "title1",
105
+ children: "Secondary Action is not a Link"
106
+ }), /*#__PURE__*/_jsx(Banner, _extends({}, props, {
107
+ secondaryAction: /*#__PURE__*/_jsx(Button, {
108
+ compact: true,
109
+ children: "Secondary Action"
110
+ })
94
111
  })), /*#__PURE__*/_jsxs(Text, {
95
112
  font: "title1",
96
113
  children: [title, " Long Text with Action"]
@@ -107,7 +107,7 @@ const StepperBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
107
107
  const previousComplete = (_usePreviousValue = usePreviousValue(complete)) != null ? _usePreviousValue : false;
108
108
  const previousActiveStepIndex = (_usePreviousValue2 = usePreviousValue(activeStepIndex)) != null ? _usePreviousValue2 : -1;
109
109
  const [progressSprings, progressSpringsApi] = useSprings(steps.length, index => ({
110
- progress: complete || activeStepIndex >= 0 && index <= activeStepIndex ? 1 : 0,
110
+ progress: complete ? 1 : 0,
111
111
  config: progressSpringConfig,
112
112
  immediate: !animate || disableAnimateOnMount && !hasMounted
113
113
  }));
@@ -117,7 +117,7 @@ const StepperBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
117
117
  let isAnimatingForward = false;
118
118
 
119
119
  // Case when going from not-complete to complete
120
- if (complete !== previousComplete) {
120
+ if (Boolean(complete) !== previousComplete) {
121
121
  if (complete) {
122
122
  // Going to complete: animate from activeStepIndex+1 to end
123
123
  stepsToAnimate = Array.from({
@@ -1,4 +1,4 @@
1
- const _excluded = ["steps", "activeStepId", "title"],
1
+ const _excluded = ["steps", "defaultActiveStepId", "title"],
2
2
  _excluded2 = ["onPress"],
3
3
  _excluded3 = ["active", "complete", "visited"];
4
4
  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); }
@@ -75,14 +75,14 @@ const twoLevelSteps = [{
75
75
  const StepperHorizontalExample = _ref => {
76
76
  let {
77
77
  steps = basicSteps,
78
- activeStepId,
78
+ defaultActiveStepId,
79
79
  title
80
80
  } = _ref,
81
81
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
82
82
  const [renderKey, setRenderKey] = useState(0);
83
83
  const [stepperState, stepperApi] = useStepper({
84
84
  steps,
85
- defaultActiveStepId: activeStepId
85
+ defaultActiveStepId
86
86
  });
87
87
  const [complete, setComplete] = useState(false);
88
88
  const activeIndex = stepperState.activeStepId ? steps.findIndex(step => step.id === stepperState.activeStepId) : -1;
@@ -199,7 +199,6 @@ const StepperHorizontalExample = _ref => {
199
199
  // ------------------------------------------------------------
200
200
  const NoActiveStep = () => {
201
201
  return /*#__PURE__*/_jsx(StepperHorizontalExample, {
202
- activeStepId: null,
203
202
  steps: basicSteps,
204
203
  title: "No Active Step"
205
204
  });
@@ -242,7 +241,7 @@ const StepperHorizontalScreen = () => {
242
241
  children: [/*#__PURE__*/_jsx(Example, {
243
242
  title: "Default",
244
243
  children: /*#__PURE__*/_jsx(StepperHorizontalExample, {
245
- activeStepId: basicSteps[2].id,
244
+ defaultActiveStepId: basicSteps[2].id,
246
245
  steps: basicSteps
247
246
  })
248
247
  }), /*#__PURE__*/_jsx(Example, {
@@ -258,13 +257,13 @@ const StepperHorizontalScreen = () => {
258
257
  }), /*#__PURE__*/_jsx(Example, {
259
258
  title: "No Label Text",
260
259
  children: /*#__PURE__*/_jsx(StepperHorizontalExample, {
261
- activeStepId: noLabelSteps[0].id,
260
+ defaultActiveStepId: noLabelSteps[0].id,
262
261
  steps: noLabelSteps
263
262
  })
264
263
  }), /*#__PURE__*/_jsx(Example, {
265
264
  title: "Long Text",
266
265
  children: /*#__PURE__*/_jsx(StepperHorizontalExample, {
267
- activeStepId: longLabelSteps[0].id,
266
+ defaultActiveStepId: longLabelSteps[0].id,
268
267
  steps: longLabelSteps
269
268
  })
270
269
  }), /*#__PURE__*/_jsx(Example, {
@@ -287,13 +286,13 @@ const StepperHorizontalScreen = () => {
287
286
  size: "s"
288
287
  }, props));
289
288
  },
290
- activeStepId: basicSteps[0].id,
289
+ defaultActiveStepId: basicSteps[0].id,
291
290
  steps: basicSteps
292
291
  })
293
292
  }), /*#__PURE__*/_jsx(Example, {
294
293
  title: "Nested Steps",
295
294
  children: /*#__PURE__*/_jsx(StepperHorizontalExample, {
296
- activeStepId: twoLevelSteps[0].id,
295
+ defaultActiveStepId: twoLevelSteps[0].id,
297
296
  steps: twoLevelSteps
298
297
  })
299
298
  }), /*#__PURE__*/_jsx(Example, {
@@ -302,22 +301,22 @@ const StepperHorizontalScreen = () => {
302
301
  gap: 4,
303
302
  children: [/*#__PURE__*/_jsx(StepperHorizontalExample, {
304
303
  StepperLabelComponent: null,
305
- activeStepId: basicSteps[0].id,
304
+ defaultActiveStepId: basicSteps[0].id,
306
305
  steps: basicSteps,
307
306
  title: "StepperLabelComponent = null"
308
307
  }), /*#__PURE__*/_jsx(StepperHorizontalExample, {
309
308
  StepperProgressComponent: null,
310
- activeStepId: basicSteps[0].id,
309
+ defaultActiveStepId: basicSteps[0].id,
311
310
  steps: basicSteps,
312
311
  title: "StepperProgressComponent = null"
313
312
  }), /*#__PURE__*/_jsx(StepperHorizontalExample, {
314
313
  StepperIconComponent: null,
315
- activeStepId: basicSteps[0].id,
314
+ defaultActiveStepId: basicSteps[0].id,
316
315
  steps: basicSteps,
317
316
  title: "StepperIconComponent = null"
318
317
  }), /*#__PURE__*/_jsx(StepperHorizontalExample, {
319
318
  StepperHeaderComponent: null,
320
- activeStepId: basicSteps[0].id,
319
+ defaultActiveStepId: basicSteps[0].id,
321
320
  steps: basicSteps,
322
321
  title: "StepperHeaderComponent = null"
323
322
  })]
@@ -1,4 +1,4 @@
1
- const _excluded = ["steps", "activeStepId", "title", "initialComplete", "skipParentSteps", "renderWithApi"];
1
+ const _excluded = ["steps", "defaultActiveStepId", "title", "initialComplete", "skipParentSteps", "renderWithApi"];
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, { useState } from 'react';
@@ -19,7 +19,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
19
19
  const StepperVerticalExample = _ref => {
20
20
  let {
21
21
  steps,
22
- activeStepId,
22
+ defaultActiveStepId,
23
23
  title,
24
24
  initialComplete,
25
25
  skipParentSteps,
@@ -29,7 +29,7 @@ const StepperVerticalExample = _ref => {
29
29
  const [renderKey, setRenderKey] = useState(0);
30
30
  const [stepperState, stepperApi] = useStepper({
31
31
  steps,
32
- defaultActiveStepId: activeStepId,
32
+ defaultActiveStepId,
33
33
  skipParentSteps
34
34
  });
35
35
  const [complete, setComplete] = useState(initialComplete || false);
@@ -164,6 +164,7 @@ const Default = () => {
164
164
  }];
165
165
  return /*#__PURE__*/_jsx(StepperVerticalExample, {
166
166
  completedStepAccessibilityLabel: "Finished",
167
+ defaultActiveStepId: steps[0].id,
167
168
  steps: steps
168
169
  });
169
170
  };
@@ -186,7 +187,6 @@ const NoActiveStep = () => {
186
187
  label: 'Final step'
187
188
  }];
188
189
  return /*#__PURE__*/_jsx(StepperVerticalExample, {
189
- activeStepId: null,
190
190
  steps: steps,
191
191
  title: "No Active Step"
192
192
  });
@@ -330,7 +330,7 @@ const CustomIconsAndStyles = () => {
330
330
  label: 'Final step'
331
331
  }];
332
332
  return /*#__PURE__*/_jsx(StepperVerticalExample, {
333
- activeStepId: steps[0].id,
333
+ defaultActiveStepId: steps[0].id,
334
334
  steps: steps,
335
335
  styles: {
336
336
  progress: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-mobile",
3
- "version": "8.16.4",
3
+ "version": "8.17.1",
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.4",
153
+ "@coinbase/cds-common": "^8.17.1",
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",