@coinbase/cds-web 8.21.3 → 8.21.4

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
+ ## 8.21.4 (11/18/2025 PST)
12
+
13
+ #### 🐞 Fixes
14
+
15
+ - Update styling of DefaultSelectControl to use compact chips. [[#156](https://github.com/coinbase/cds/pull/156)]
16
+
11
17
  ## 8.21.3 ((11/17/2025, 10:03 AM PST))
12
18
 
13
19
  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,KAAK,EAAE,kBAAkB,EAAgB,UAAU,EAAE,MAAM,UAAU,CAAC;AAmB7E,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;AAgUxB,eAAO,MAAM,oBAAoB,EAAoC,wBAAwB,CAAC"}
1
+ {"version":3,"file":"DefaultSelectControl.d.ts","sourceRoot":"","sources":["../../../src/alpha/select/DefaultSelectControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAe9E,OAAO,KAAK,EAAE,kBAAkB,EAAgB,UAAU,EAAE,MAAM,UAAU,CAAC;AAyB7E,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;AAyUxB,eAAO,MAAM,oBAAoB,EAAoC,wBAAwB,CAAC"}
@@ -7,7 +7,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
7
7
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
8
8
  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; }
9
9
  import React, { forwardRef, memo, useCallback, useMemo, useRef } from 'react';
10
- import { Chip } from '../../chips/Chip';
11
10
  import { InputChip } from '../../chips/InputChip';
12
11
  import { HelperText } from '../../controls/HelperText';
13
12
  import { InputLabel } from '../../controls/InputLabel';
@@ -19,6 +18,11 @@ import { Pressable } from '../../system/Pressable';
19
18
  import { Text } from '../../typography/Text';
20
19
  import { findClosestNonDisabledNodeIndex } from '../../utils/findClosestNonDisabledNodeIndex';
21
20
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
+ // The height is smaller for the inside label variant since the label takes
22
+ // up space above the input.
23
+ const LABEL_VARIANT_INSIDE_HEIGHT = 32;
24
+ const COMPACT_HEIGHT = 40;
25
+ const DEFAULT_HEIGHT = 56;
22
26
  const noFocusOutlineCss = "noFocusOutlineCss-n1gl6kcn";
23
27
  const variantColor = {
24
28
  foreground: 'fg',
@@ -93,6 +97,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
93
97
  noScaleOnPress: true,
94
98
  className: classNames === null || classNames === void 0 ? void 0 : classNames.controlLabelNode,
95
99
  disabled: disabled,
100
+ height: 28,
96
101
  onClick: () => setOpen(s => !s),
97
102
  style: styles === null || styles === void 0 ? void 0 : styles.controlLabelNode,
98
103
  tabIndex: -1,
@@ -116,15 +121,21 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
116
121
  var _option$value, _ref2, _ref3, _option$label;
117
122
  const accessibilityLabel = typeof option.label === 'string' ? option.label : typeof option.description === 'string' ? option.description : (_option$value = option.value) !== null && _option$value !== void 0 ? _option$value : '';
118
123
  return /*#__PURE__*/_jsx(InputChip, {
124
+ compact: true,
119
125
  "data-selected-value": true,
120
126
  accessibilityLabel: "".concat(removeSelectedOptionAccessibilityLabel, " ").concat(accessibilityLabel),
127
+ borderWidth: 0,
121
128
  disabled: option.disabled,
122
129
  invertColorScheme: false,
123
130
  maxWidth: 200,
124
131
  onClick: event => handleUnselectValue(event, index),
125
132
  children: (_ref2 = (_ref3 = (_option$label = option.label) !== null && _option$label !== void 0 ? _option$label : option.description) !== null && _ref3 !== void 0 ? _ref3 : option.value) !== null && _ref2 !== void 0 ? _ref2 : ''
126
133
  }, option.value);
127
- }), value.length - maxSelectedOptionsToShow > 0 && /*#__PURE__*/_jsx(Chip, {
134
+ }), value.length - maxSelectedOptionsToShow > 0 && /*#__PURE__*/_jsx(InputChip, {
135
+ compact: true,
136
+ borderWidth: 0,
137
+ end: null,
138
+ invertColorScheme: false,
128
139
  children: "+".concat(value.length - maxSelectedOptionsToShow, " ").concat(hiddenSelectedOptionsLabel)
129
140
  })]
130
141
  });
@@ -151,10 +162,11 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
151
162
  "aria-haspopup": ariaHaspopup,
152
163
  background: "transparent",
153
164
  blendStyles: interactableBlendStyles,
165
+ borderWidth: 0,
154
166
  className: cx(noFocusOutlineCss, classNames === null || classNames === void 0 ? void 0 : classNames.controlInputNode),
155
167
  disabled: disabled,
156
168
  focusable: false,
157
- minHeight: isMultiSelect ? 76 : undefined,
169
+ minHeight: labelVariant === 'inside' ? LABEL_VARIANT_INSIDE_HEIGHT : compact ? COMPACT_HEIGHT : DEFAULT_HEIGHT,
158
170
  onClick: () => setOpen(s => !s),
159
171
  paddingStart: 1,
160
172
  style: styles === null || styles === void 0 ? void 0 : styles.controlInputNode,
@@ -172,7 +184,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
172
184
  alignItems: "center",
173
185
  height: "100%",
174
186
  maxWidth: "40%",
175
- padding: 1,
187
+ paddingStart: 1,
176
188
  children: /*#__PURE__*/_jsx(InputLabel, {
177
189
  color: "fg",
178
190
  overflow: "truncate",
@@ -181,7 +193,6 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
181
193
  }) : null, /*#__PURE__*/_jsx(HStack, {
182
194
  alignItems: "center",
183
195
  borderRadius: 200,
184
- height: "100%",
185
196
  justifyContent: "space-between",
186
197
  width: "100%",
187
198
  children: /*#__PURE__*/_jsx(HStack, {
@@ -192,17 +203,16 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
192
203
  flexShrink: 1,
193
204
  flexWrap: "wrap",
194
205
  gap: 1,
195
- height: "100%",
196
206
  justifyContent: shouldShowCompactLabel ? 'flex-end' : 'flex-start',
197
207
  overflow: "auto",
198
- paddingTop: labelVariant === 'inside' ? 0 : compact ? 1 : 2,
208
+ paddingTop: labelVariant === 'inside' ? 0 : undefined,
199
209
  paddingX: 1,
200
- paddingY: labelVariant === 'inside' || compact ? 1 : 2,
210
+ paddingY: labelVariant === 'inside' || compact ? 0.5 : 1.5,
201
211
  style: styles === null || styles === void 0 ? void 0 : styles.controlValueNode,
202
212
  children: valueNode
203
213
  })
204
214
  })]
205
- }), [accessibilityLabel, ariaHaspopup, interactableBlendStyles, classNames === null || classNames === void 0 ? void 0 : classNames.controlInputNode, classNames === null || classNames === void 0 ? void 0 : classNames.controlStartNode, classNames === null || classNames === void 0 ? void 0 : classNames.controlValueNode, disabled, isMultiSelect, styles === null || styles === void 0 ? void 0 : styles.controlInputNode, styles === null || styles === void 0 ? void 0 : styles.controlStartNode, styles === null || styles === void 0 ? void 0 : styles.controlValueNode, startNode, shouldShowCompactLabel, label, labelVariant, compact, valueNode, setOpen]);
215
+ }), [accessibilityLabel, ariaHaspopup, interactableBlendStyles, classNames === null || classNames === void 0 ? void 0 : classNames.controlInputNode, classNames === null || classNames === void 0 ? void 0 : classNames.controlStartNode, classNames === null || classNames === void 0 ? void 0 : classNames.controlValueNode, disabled, styles === null || styles === void 0 ? void 0 : styles.controlInputNode, styles === null || styles === void 0 ? void 0 : styles.controlStartNode, styles === null || styles === void 0 ? void 0 : styles.controlValueNode, startNode, shouldShowCompactLabel, label, labelVariant, compact, valueNode, setOpen]);
206
216
  const endNode = useMemo(() => /*#__PURE__*/_jsx(HStack, {
207
217
  alignItems: "center",
208
218
  className: classNames === null || classNames === void 0 ? void 0 : classNames.controlEndNode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-web",
3
- "version": "8.21.3",
3
+ "version": "8.21.4",
4
4
  "description": "Coinbase Design System - Web",
5
5
  "repository": {
6
6
  "type": "git",
@@ -147,7 +147,7 @@
147
147
  "react-dom": "^18.3.1"
148
148
  },
149
149
  "dependencies": {
150
- "@coinbase/cds-common": "^8.21.3",
150
+ "@coinbase/cds-common": "^8.21.4",
151
151
  "@coinbase/cds-icons": "^5.6.0",
152
152
  "@coinbase/cds-illustrations": "^4.27.0",
153
153
  "@coinbase/cds-lottie-files": "^3.3.3",