@coinbase/cds-mobile 9.4.2 → 9.4.3
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.3 (6/23/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Fix: Add `activeBackground` and `activeColor` props to alpha `TabbedChips`. `activeBackground` sets a custom chip background color when active (replacing the default `invertColorScheme` behavior); `activeColor` sets a custom chip label text color when active. [[#766](https://github.com/coinbase/cds/pull/766)]
|
|
16
|
+
|
|
11
17
|
## 9.4.2 ((6/23/2026, 07:32 AM PST))
|
|
12
18
|
|
|
13
19
|
This is an artificial version bump with no new change.
|
|
@@ -5,6 +5,7 @@ import type { TabValue } from '@coinbase/cds-common/tabs/useTabs';
|
|
|
5
5
|
import type { SharedAccessibilityProps } from '@coinbase/cds-common/types/SharedAccessibilityProps';
|
|
6
6
|
import type { SharedProps } from '@coinbase/cds-common/types/SharedProps';
|
|
7
7
|
import type { ChipProps } from '../../chips/ChipProps';
|
|
8
|
+
import { type MediaChipBaseProps } from '../../chips/MediaChip';
|
|
8
9
|
import { type BoxProps } from '../../layout/Box';
|
|
9
10
|
import { type TabsBaseProps, type TabsProps } from '../../tabs/Tabs';
|
|
10
11
|
export type TabbedChipProps<TabId extends string = string> = Omit<
|
|
@@ -13,6 +14,15 @@ export type TabbedChipProps<TabId extends string = string> = Omit<
|
|
|
13
14
|
> &
|
|
14
15
|
TabValue<TabId> & {
|
|
15
16
|
Component?: React.FC<Omit<ChipProps, 'children'> & TabValue<TabId>>;
|
|
17
|
+
/**
|
|
18
|
+
* Custom background color applied to the chip when it is the active tab.
|
|
19
|
+
* When set, takes precedence over the default `invertColorScheme` behavior.
|
|
20
|
+
*/
|
|
21
|
+
activeBackground?: MediaChipBaseProps['background'];
|
|
22
|
+
/**
|
|
23
|
+
* Custom foreground color applied to the chip label when it is the active tab.
|
|
24
|
+
*/
|
|
25
|
+
activeColor?: MediaChipBaseProps['color'];
|
|
16
26
|
};
|
|
17
27
|
export type TabbedChipsBaseProps<TabId extends string = string> = Omit<
|
|
18
28
|
TabsBaseProps<TabId>,
|
|
@@ -21,6 +31,7 @@ export type TabbedChipsBaseProps<TabId extends string = string> = Omit<
|
|
|
21
31
|
| 'tabs'
|
|
22
32
|
| 'onActiveTabElementChange'
|
|
23
33
|
| 'activeBackground'
|
|
34
|
+
| 'activeColor'
|
|
24
35
|
> & {
|
|
25
36
|
tabs: TabbedChipProps<TabId>[];
|
|
26
37
|
TabComponent?: React.FC<TabbedChipProps<TabId>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabbedChips.d.ts","sourceRoot":"","sources":["../../../src/alpha/tabbed-chips/TabbedChips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"TabbedChips.d.ts","sourceRoot":"","sources":["../../../src/alpha/tabbed-chips/TabbedChips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,IAAI,EAA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KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,4BAA4B,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,8BAA8B,CAAC,CAAC;IAChF;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,oBAAoB,CAAC,KAAK,CAAC,GACvF,WAAW,GACX,wBAAwB,GAAG;IACzB;;;OAGG;IACH,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1B,MAAM,CAAC,EAAE;QACP,6BAA6B;QAC7B,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B,wBAAwB;QACxB,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC7B,CAAC;CACH,CAAC;AAEJ,KAAK,aAAa,GAAG,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EACjD,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,YAAY,CAAC;AAiFxB,eAAO,MAAM,WAAW,EAA2B,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["label", "id"],
|
|
1
|
+
const _excluded = ["label", "id", "activeBackground", "activeColor", "color"],
|
|
2
2
|
_excluded2 = ["tabs", "activeTab", "testID", "TabComponent", "onChange", "width", "gap", "compact", "styles", "autoScrollOffset"];
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
@@ -15,7 +15,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
15
|
const DefaultTabComponent = _ref => {
|
|
16
16
|
let {
|
|
17
17
|
label = '',
|
|
18
|
-
id
|
|
18
|
+
id,
|
|
19
|
+
activeBackground,
|
|
20
|
+
activeColor,
|
|
21
|
+
color
|
|
19
22
|
} = _ref,
|
|
20
23
|
tabProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21
24
|
const {
|
|
@@ -28,7 +31,9 @@ const DefaultTabComponent = _ref => {
|
|
|
28
31
|
accessibilityState: {
|
|
29
32
|
selected: isActive
|
|
30
33
|
},
|
|
31
|
-
|
|
34
|
+
background: isActive && activeBackground ? activeBackground : undefined,
|
|
35
|
+
color: isActive && activeColor ? activeColor : color,
|
|
36
|
+
invertColorScheme: isActive && !activeBackground,
|
|
32
37
|
onPress: handlePress
|
|
33
38
|
}, tabProps, {
|
|
34
39
|
children: label
|
|
@@ -60,6 +60,12 @@ const tabsWithStart = defaultTabs.map(tab => _extends({}, tab, {
|
|
|
60
60
|
const compactTabsWithStart = defaultTabs.map(tab => _extends({}, tab, {
|
|
61
61
|
start: /*#__PURE__*/_jsx(RemoteImage, _extends({}, compactAssetIconProps))
|
|
62
62
|
}));
|
|
63
|
+
const activeBackgroundTabs = defaultTabs.map(tab => _extends({}, tab, {
|
|
64
|
+
activeBackground: 'bgPositive'
|
|
65
|
+
}));
|
|
66
|
+
const activeColorTabs = defaultTabs.map(tab => _extends({}, tab, {
|
|
67
|
+
activeColor: 'fgPositive'
|
|
68
|
+
}));
|
|
63
69
|
const TabbedChipsScreen = () => {
|
|
64
70
|
return /*#__PURE__*/_jsxs(ExampleScreen, {
|
|
65
71
|
children: [/*#__PURE__*/_jsx(Example, {
|
|
@@ -102,6 +108,16 @@ const TabbedChipsScreen = () => {
|
|
|
102
108
|
autoScrollOffset: 100,
|
|
103
109
|
tabs: sampleTabs
|
|
104
110
|
})
|
|
111
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
112
|
+
title: "With activeBackground",
|
|
113
|
+
children: /*#__PURE__*/_jsx(Demo, {
|
|
114
|
+
tabs: activeBackgroundTabs
|
|
115
|
+
})
|
|
116
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
117
|
+
title: "With activeColor",
|
|
118
|
+
children: /*#__PURE__*/_jsx(Demo, {
|
|
119
|
+
tabs: activeColorTabs
|
|
120
|
+
})
|
|
105
121
|
})]
|
|
106
122
|
});
|
|
107
123
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.3",
|
|
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.
|
|
209
|
+
"@coinbase/cds-common": "^9.4.3",
|
|
210
210
|
"@coinbase/cds-icons": "^5.19.0",
|
|
211
211
|
"@coinbase/cds-illustrations": "^4.43.0",
|
|
212
212
|
"@coinbase/cds-lottie-files": "^3.3.4",
|