@coinbase/cds-web 8.47.4 → 8.48.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 +12 -0
- package/dts/alpha/select/DefaultSelectControl.d.ts.map +1 -1
- package/dts/tag/Tag.d.ts +13 -0
- package/dts/tag/Tag.d.ts.map +1 -1
- package/esm/alpha/select/DefaultSelectControl.css +2 -1
- package/esm/alpha/select/DefaultSelectControl.js +11 -1
- package/esm/tag/Tag.css +1 -0
- package/esm/tag/Tag.js +44 -12
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,18 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.48.1 (2/25/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Truncate text mid-word in multi-select chips. [[#412](https://github.com/coinbase/cds/pull/412)]
|
|
16
|
+
|
|
17
|
+
## 8.48.0 (2/24/2026 PST)
|
|
18
|
+
|
|
19
|
+
#### 🚀 Updates
|
|
20
|
+
|
|
21
|
+
- Add start/end icon/node support to Tag. [[#421](https://github.com/coinbase/cds/pull/421)]
|
|
22
|
+
|
|
11
23
|
## 8.47.4 ((2/23/2026, 03:04 PM PST))
|
|
12
24
|
|
|
13
25
|
This is an artificial version bump with no new change.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultSelectControl.d.ts","sourceRoot":"","sources":["../../../src/alpha/select/DefaultSelectControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAgB9E,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,UAAU,EAChB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultSelectControl.d.ts","sourceRoot":"","sources":["../../../src/alpha/select/DefaultSelectControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAgB9E,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,UAAU,EAChB,MAAM,UAAU,CAAC;AAkClB,KAAK,wBAAwB,GAAG,CAC9B,IAAI,SAAS,UAAU,EACvB,iBAAiB,SAAS,MAAM,GAAG,MAAM,EAEzC,KAAK,EAAE,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;CAAE,KAClF,KAAK,CAAC,YAAY,CAAC;AAsbxB,eAAO,MAAM,oBAAoB,EAAoC,wBAAwB,CAAC"}
|
package/dts/tag/Tag.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
3
3
|
import type {
|
|
4
|
+
IconName,
|
|
4
5
|
SharedAccessibilityProps,
|
|
5
6
|
SharedProps,
|
|
6
7
|
TagColorScheme,
|
|
@@ -34,6 +35,18 @@ export type TagBaseProps = SharedProps &
|
|
|
34
35
|
color?: ThemeVars.SpectrumColor;
|
|
35
36
|
/** Setting a custom max width for this tag will enable text truncation */
|
|
36
37
|
maxWidth?: BoxProps<BoxDefaultElement>['maxWidth'];
|
|
38
|
+
/** Set the start node */
|
|
39
|
+
start?: React.ReactNode;
|
|
40
|
+
/** Icon to render at the start of the tag. */
|
|
41
|
+
startIcon?: IconName;
|
|
42
|
+
/** Whether the start icon is active */
|
|
43
|
+
startIconActive?: boolean;
|
|
44
|
+
/** Set the end node */
|
|
45
|
+
end?: React.ReactNode;
|
|
46
|
+
/** Icon to render at the end of the tag. */
|
|
47
|
+
endIcon?: IconName;
|
|
48
|
+
/** Whether the end icon is active */
|
|
49
|
+
endIconActive?: boolean;
|
|
37
50
|
};
|
|
38
51
|
export type TagProps = TagBaseProps &
|
|
39
52
|
Omit<BoxProps<BoxDefaultElement>, 'color' | 'background' | 'children' | 'maxWidth'>;
|
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,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAOjE,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EACX,cAAc,EACd,WAAW,EACX,SAAS,EACV,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAOjE,OAAO,KAAK,EACV,QAAQ,EACR,wBAAwB,EACxB,WAAW,EACX,cAAc,EACd,WAAW,EACX,SAAS,EACV,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAO,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQ3E,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C,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,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;;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,iBAAiB,CAAC,CAAC,UAAU,CAAC,CAAC;IACnD,yBAAyB;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,uCAAuC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB;IACvB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,qCAAqC;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEJ,MAAM,MAAM,QAAQ,GAAG,YAAY,GACjC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC;AAEtF,eAAO,MAAM,GAAG,yHAgFf,CAAC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
@layer cds{.noFocusOutlineCss-n1gl6kcn:focus,.noFocusOutlineCss-n1gl6kcn:focus-visible,.noFocusOutlineCss-n1gl6kcn:focus-within{outline:none;}
|
|
1
|
+
@layer cds{.noFocusOutlineCss-n1gl6kcn:focus,.noFocusOutlineCss-n1gl6kcn:focus-visible,.noFocusOutlineCss-n1gl6kcn:focus-within{outline:none;}
|
|
2
|
+
.selectedOptionChipContentCss-s1kle8pq{min-width:0;}.selectedOptionChipContentCss-s1kle8pq > :not(:last-child){min-width:0;max-width:100%;}}
|
|
@@ -27,6 +27,7 @@ const LABEL_VARIANT_INSIDE_HEIGHT = 32;
|
|
|
27
27
|
const COMPACT_HEIGHT = 40;
|
|
28
28
|
const DEFAULT_HEIGHT = 56;
|
|
29
29
|
const noFocusOutlineCss = "noFocusOutlineCss-n1gl6kcn";
|
|
30
|
+
const selectedOptionChipContentCss = "selectedOptionChipContentCss-s1kle8pq";
|
|
30
31
|
const variantColor = {
|
|
31
32
|
foreground: 'fg',
|
|
32
33
|
positive: 'fgPositive',
|
|
@@ -190,11 +191,20 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
190
191
|
"data-selected-value": true,
|
|
191
192
|
accessibilityLabel: "".concat(removeSelectedOptionAccessibilityLabel, " ").concat(accessibilityLabel),
|
|
192
193
|
borderWidth: 0,
|
|
194
|
+
classNames: {
|
|
195
|
+
content: selectedOptionChipContentCss
|
|
196
|
+
},
|
|
193
197
|
disabled: option.disabled,
|
|
194
198
|
invertColorScheme: false,
|
|
195
199
|
maxWidth: 200,
|
|
196
200
|
onClick: event => handleUnselectValue(event, index),
|
|
197
|
-
children: (
|
|
201
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
202
|
+
color: "fg",
|
|
203
|
+
flexShrink: 1,
|
|
204
|
+
font: "label1",
|
|
205
|
+
overflow: "truncate",
|
|
206
|
+
children: (_ref7 = (_ref8 = (_option$label3 = option.label) !== null && _option$label3 !== void 0 ? _option$label3 : option.description) !== null && _ref8 !== void 0 ? _ref8 : option.value) !== null && _ref7 !== void 0 ? _ref7 : ''
|
|
207
|
+
})
|
|
198
208
|
}, option.value);
|
|
199
209
|
}), value.length - maxSelectedOptionsToShow > 0 && /*#__PURE__*/_jsx(InputChip, {
|
|
200
210
|
compact: true,
|
package/esm/tag/Tag.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer cds{.nodeCss-n1hf567u{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}}
|
package/esm/tag/Tag.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["children", "intent", "emphasis", "colorScheme", "background", "color", "display", "alignItems", "justifyContent", "testID"];
|
|
1
|
+
const _excluded = ["children", "intent", "emphasis", "colorScheme", "background", "color", "start", "startIcon", "startIconActive", "end", "endIcon", "endIconActive", "display", "alignItems", "gap", "justifyContent", "paddingY", "testID"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -9,9 +9,11 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
9
9
|
import React, { forwardRef, memo, useMemo } from 'react';
|
|
10
10
|
import { tagBorderRadiusMap, tagEmphasisColorMap, tagFontMap, tagHorizontalSpacing } from '@coinbase/cds-common/tokens/tags';
|
|
11
11
|
import { useTheme } from '../hooks/useTheme';
|
|
12
|
+
import { Icon } from '../icons/Icon';
|
|
12
13
|
import { Box } from '../layout/Box';
|
|
13
14
|
import { Text } from '../typography/Text';
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
const nodeCss = "nodeCss-n1hf567u";
|
|
15
17
|
export const tagStaticClassName = 'cds-tag';
|
|
16
18
|
export const Tag = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tag(_ref, forwardedRef) {
|
|
17
19
|
let {
|
|
@@ -21,9 +23,17 @@ export const Tag = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tag(_ref,
|
|
|
21
23
|
colorScheme = 'blue',
|
|
22
24
|
background: customBackground,
|
|
23
25
|
color: customColor,
|
|
26
|
+
start,
|
|
27
|
+
startIcon,
|
|
28
|
+
startIconActive,
|
|
29
|
+
end,
|
|
30
|
+
endIcon,
|
|
31
|
+
endIconActive,
|
|
24
32
|
display = 'inline-flex',
|
|
25
33
|
alignItems = 'center',
|
|
34
|
+
gap = 0.5,
|
|
26
35
|
justifyContent = 'center',
|
|
36
|
+
paddingY = 0.25,
|
|
27
37
|
testID = tagStaticClassName
|
|
28
38
|
} = _ref,
|
|
29
39
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -33,12 +43,10 @@ export const Tag = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tag(_ref,
|
|
|
33
43
|
foreground
|
|
34
44
|
} = tagEmphasisColorMap[emphasis][colorScheme];
|
|
35
45
|
const boxStyles = useMemo(() => ({
|
|
36
|
-
backgroundColor: "rgb(".concat(theme.spectrum[customBackground !== null && customBackground !== void 0 ? customBackground : background], ")")
|
|
37
|
-
}), [background, customBackground, theme.spectrum]);
|
|
38
|
-
const textStyles = useMemo(() => ({
|
|
46
|
+
backgroundColor: "rgb(".concat(theme.spectrum[customBackground !== null && customBackground !== void 0 ? customBackground : background], ")"),
|
|
39
47
|
color: "rgb(".concat(theme.spectrum[customColor !== null && customColor !== void 0 ? customColor : foreground], ")")
|
|
40
|
-
}), [foreground, customColor, theme.spectrum]);
|
|
41
|
-
return /*#__PURE__*/
|
|
48
|
+
}), [background, customBackground, foreground, customColor, theme.spectrum]);
|
|
49
|
+
return /*#__PURE__*/_jsxs(Box, _objectSpread(_objectSpread({
|
|
42
50
|
ref: forwardedRef,
|
|
43
51
|
alignItems: alignItems,
|
|
44
52
|
background: "bg",
|
|
@@ -46,19 +54,43 @@ export const Tag = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Tag(_ref,
|
|
|
46
54
|
className: tagStaticClassName,
|
|
47
55
|
"data-testid": testID,
|
|
48
56
|
display: display,
|
|
57
|
+
gap: gap,
|
|
49
58
|
justifyContent: justifyContent,
|
|
50
59
|
paddingX: tagHorizontalSpacing[intent],
|
|
51
|
-
paddingY:
|
|
60
|
+
paddingY: paddingY,
|
|
52
61
|
style: boxStyles,
|
|
53
62
|
testID: testID
|
|
54
63
|
}, props), {}, {
|
|
55
|
-
children: /*#__PURE__*/_jsx(
|
|
64
|
+
children: [start ? /*#__PURE__*/_jsx("span", {
|
|
65
|
+
className: nodeCss,
|
|
66
|
+
children: start
|
|
67
|
+
}) : startIcon ? /*#__PURE__*/_jsx("span", {
|
|
68
|
+
className: nodeCss,
|
|
69
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
70
|
+
active: startIconActive,
|
|
71
|
+
color: "currentColor",
|
|
72
|
+
name: startIcon,
|
|
73
|
+
size: "xs"
|
|
74
|
+
})
|
|
75
|
+
}) : null, /*#__PURE__*/_jsx(Text, {
|
|
76
|
+
color: "currentColor",
|
|
56
77
|
display: "inline",
|
|
57
78
|
font: tagFontMap[intent],
|
|
58
79
|
overflow: "truncate",
|
|
59
|
-
style: textStyles,
|
|
60
80
|
testID: "".concat(testID, "--text"),
|
|
61
81
|
children: children
|
|
62
|
-
})
|
|
82
|
+
}), end ? /*#__PURE__*/_jsx("span", {
|
|
83
|
+
className: nodeCss,
|
|
84
|
+
children: end
|
|
85
|
+
}) : endIcon ? /*#__PURE__*/_jsx("span", {
|
|
86
|
+
className: nodeCss,
|
|
87
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
88
|
+
active: endIconActive,
|
|
89
|
+
color: "currentColor",
|
|
90
|
+
name: endIcon,
|
|
91
|
+
size: "xs"
|
|
92
|
+
})
|
|
93
|
+
}) : null]
|
|
63
94
|
}));
|
|
64
|
-
}));
|
|
95
|
+
}));
|
|
96
|
+
import "./Tag.css";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-web",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.48.1",
|
|
4
4
|
"description": "Coinbase Design System - Web",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
"react-dom": "^18.3.1"
|
|
208
208
|
},
|
|
209
209
|
"dependencies": {
|
|
210
|
-
"@coinbase/cds-common": "^8.
|
|
210
|
+
"@coinbase/cds-common": "^8.48.1",
|
|
211
211
|
"@coinbase/cds-icons": "^5.11.0",
|
|
212
212
|
"@coinbase/cds-illustrations": "^4.31.0",
|
|
213
213
|
"@coinbase/cds-lottie-files": "^3.3.4",
|