@coinbase/cds-mobile 8.24.0 → 8.25.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 +10 -0
- package/dts/tag/Tag.d.ts +11 -0
- package/dts/tag/Tag.d.ts.map +1 -1
- package/esm/tag/Tag.js +4 -3
- package/esm/tag/__figma__/Tag.figma.js +8 -0
- package/esm/tag/__stories__/Tag.stories.js +20 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,16 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.25.1 ((12/1/2025, 11:18 AM PST))
|
|
12
|
+
|
|
13
|
+
This is an artificial version bump with no new change.
|
|
14
|
+
|
|
15
|
+
## 8.25.0 (12/1/2025 PST)
|
|
16
|
+
|
|
17
|
+
#### 🚀 Updates
|
|
18
|
+
|
|
19
|
+
- Add emphasis prop to Tag. [[#197](https://github.com/coinbase/cds/pull/197)]
|
|
20
|
+
|
|
11
21
|
## 8.24.0 (12/1/2025 PST)
|
|
12
22
|
|
|
13
23
|
#### 🚀 Updates
|
package/dts/tag/Tag.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
SharedAccessibilityProps,
|
|
6
6
|
SharedProps,
|
|
7
7
|
TagColorScheme,
|
|
8
|
+
TagEmphasis,
|
|
8
9
|
TagIntent,
|
|
9
10
|
} from '@coinbase/cds-common/types';
|
|
10
11
|
import { type BoxProps } from '../layout';
|
|
@@ -17,6 +18,11 @@ export type TagBaseProps = SharedProps &
|
|
|
17
18
|
* @default informational
|
|
18
19
|
*/
|
|
19
20
|
intent?: TagIntent;
|
|
21
|
+
/**
|
|
22
|
+
* Specify the emphasis of the Tag.
|
|
23
|
+
* @default 'low' when informational intent, 'high' when promotional intent
|
|
24
|
+
*/
|
|
25
|
+
emphasis?: TagEmphasis;
|
|
20
26
|
/**
|
|
21
27
|
* Specify the colorScheme of the Tag
|
|
22
28
|
* @default blue
|
|
@@ -42,6 +48,11 @@ export declare const Tag: React.MemoExoticComponent<
|
|
|
42
48
|
* @default informational
|
|
43
49
|
*/
|
|
44
50
|
intent?: TagIntent;
|
|
51
|
+
/**
|
|
52
|
+
* Specify the emphasis of the Tag.
|
|
53
|
+
* @default 'low' when informational intent, 'high' when promotional intent
|
|
54
|
+
*/
|
|
55
|
+
emphasis?: TagEmphasis;
|
|
45
56
|
/**
|
|
46
57
|
* Specify the colorScheme of the Tag
|
|
47
58
|
* @default blue
|
package/dts/tag/Tag.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAOjE,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EACX,cAAc,EACd,SAAS,EACV,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAG/C,MAAM,MAAM,YAAY,GAAG,WAAW,GACpC,wBAAwB,GAAG;IACzB,yCAAyC;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,sCAAsC;IACtC,UAAU,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC;IACrC,gCAAgC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;CACjC,CAAC;AAEJ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;;;OAGG;eACQ,WAAW;IACtB;;;OAGG;kBACW,cAAc;IAC5B,sCAAsC;iBACzB,SAAS,CAAC,aAAa;IACpC,gCAAgC;YACxB,SAAS,CAAC,aAAa;IAC/B,0EAA0E;eAC/D,QAAQ,CAAC,UAAU,CAAC;kGAqDlC,CAAC"}
|
package/esm/tag/Tag.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const _excluded = ["children", "intent", "colorScheme", "background", "color", "alignItems", "justifyContent", "testID"];
|
|
1
|
+
const _excluded = ["children", "intent", "emphasis", "colorScheme", "background", "color", "alignItems", "justifyContent", "testID"];
|
|
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 } from 'react';
|
|
5
|
-
import { tagBorderRadiusMap,
|
|
5
|
+
import { tagBorderRadiusMap, tagEmphasisColorMap, tagFontMap, tagHorizontalSpacing } from '@coinbase/cds-common/tokens/tags';
|
|
6
6
|
import { useTheme } from '../hooks/useTheme';
|
|
7
7
|
import { Box } from '../layout';
|
|
8
8
|
import { Text } from '../typography/Text';
|
|
@@ -11,6 +11,7 @@ export const Tag = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forwardedRef
|
|
|
11
11
|
let {
|
|
12
12
|
children,
|
|
13
13
|
intent = 'informational',
|
|
14
|
+
emphasis = intent === 'informational' ? 'low' : 'high',
|
|
14
15
|
colorScheme = 'blue',
|
|
15
16
|
background: customBackground,
|
|
16
17
|
color: customColor,
|
|
@@ -23,7 +24,7 @@ export const Tag = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, forwardedRef
|
|
|
23
24
|
const {
|
|
24
25
|
background,
|
|
25
26
|
foreground
|
|
26
|
-
} =
|
|
27
|
+
} = tagEmphasisColorMap[emphasis][colorScheme];
|
|
27
28
|
const backgroundColor = "rgb(" + theme.spectrum[customBackground != null ? customBackground : background] + ")";
|
|
28
29
|
const color = "rgb(" + theme.spectrum[customColor != null ? customColor : foreground] + ")";
|
|
29
30
|
return /*#__PURE__*/_jsx(Box, _extends({
|
|
@@ -12,6 +12,10 @@ figma.connect(Tag, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-
|
|
|
12
12
|
intent: 'informational'
|
|
13
13
|
},
|
|
14
14
|
props: {
|
|
15
|
+
emphasis: figma.enum('emphasis', {
|
|
16
|
+
high: 'high',
|
|
17
|
+
low: 'low'
|
|
18
|
+
}),
|
|
15
19
|
colorScheme: figma.enum('colorScheme', {
|
|
16
20
|
green: 'green',
|
|
17
21
|
purple: 'purple',
|
|
@@ -47,6 +51,10 @@ figma.connect(Tag, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-
|
|
|
47
51
|
intent: 'promotional'
|
|
48
52
|
},
|
|
49
53
|
props: {
|
|
54
|
+
emphasis: figma.enum('emphasis', {
|
|
55
|
+
high: 'high',
|
|
56
|
+
low: 'low'
|
|
57
|
+
}),
|
|
50
58
|
colorScheme: figma.enum('colorScheme', {
|
|
51
59
|
green: 'green',
|
|
52
60
|
purple: 'purple',
|
|
@@ -6,6 +6,7 @@ import { Tag } from '../Tag';
|
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
const tagProps = {
|
|
8
8
|
intent: ['informational', 'promotional'],
|
|
9
|
+
emphasis: ['high', 'low'],
|
|
9
10
|
colorScheme: ['green', 'purple', 'blue', 'yellow', 'red', 'gray']
|
|
10
11
|
};
|
|
11
12
|
const tagMap = tagProps.intent.map(intent => {
|
|
@@ -20,7 +21,25 @@ const tagStories = {
|
|
|
20
21
|
children: 'Default tag',
|
|
21
22
|
colorScheme: 'blue'
|
|
22
23
|
}],
|
|
23
|
-
all:
|
|
24
|
+
all: [...tagProps.colorScheme.map(scheme => ({
|
|
25
|
+
intent: 'informational',
|
|
26
|
+
emphasis: 'high',
|
|
27
|
+
colorScheme: scheme,
|
|
28
|
+
children: startCase(scheme) + " (High Informational)"
|
|
29
|
+
})), ...tagProps.colorScheme.map(scheme => ({
|
|
30
|
+
intent: 'promotional',
|
|
31
|
+
colorScheme: scheme,
|
|
32
|
+
children: startCase(scheme) + " (High)"
|
|
33
|
+
})), ...tagProps.colorScheme.map(scheme => ({
|
|
34
|
+
intent: 'informational',
|
|
35
|
+
colorScheme: scheme,
|
|
36
|
+
children: startCase(scheme) + " (Low)"
|
|
37
|
+
})), ...tagProps.colorScheme.map(scheme => ({
|
|
38
|
+
intent: 'promotional',
|
|
39
|
+
emphasis: 'low',
|
|
40
|
+
colorScheme: scheme,
|
|
41
|
+
children: startCase(scheme) + " (Low Promotional)"
|
|
42
|
+
}))],
|
|
24
43
|
wildcard: [{
|
|
25
44
|
children: 'Atlanta',
|
|
26
45
|
background: 'blue100',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.25.1",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"react-native-svg": "^14.1.0"
|
|
155
155
|
},
|
|
156
156
|
"dependencies": {
|
|
157
|
-
"@coinbase/cds-common": "^8.
|
|
157
|
+
"@coinbase/cds-common": "^8.25.1",
|
|
158
158
|
"@coinbase/cds-icons": "^5.7.0",
|
|
159
159
|
"@coinbase/cds-illustrations": "^4.28.0",
|
|
160
160
|
"@coinbase/cds-lottie-files": "^3.3.3",
|