@coinbase/cds-web 8.38.3 → 8.38.5
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/combobox/Combobox.d.ts.map +1 -1
- package/dts/alpha/combobox/DefaultComboboxControl.d.ts.map +1 -1
- package/dts/alpha/select/DefaultSelectControl.d.ts.map +1 -1
- package/dts/alpha/select/DefaultSelectDropdown.d.ts.map +1 -1
- package/dts/buttons/Button.d.ts.map +1 -1
- package/dts/overlays/FocusTrap.d.ts.map +1 -1
- package/esm/alpha/combobox/Combobox.js +6 -4
- package/esm/alpha/combobox/DefaultComboboxControl.js +12 -4
- package/esm/alpha/select/DefaultSelectControl.js +27 -12
- package/esm/alpha/select/DefaultSelectDropdown.js +7 -0
- package/esm/alpha/select/Select.js +2 -2
- package/esm/buttons/Button.css +11 -12
- package/esm/buttons/Button.js +22 -14
- package/esm/overlays/FocusTrap.js +1 -0
- 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.38.5 (1/23/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Improve keyboard navigation and ARIA labels on Select and Combobox. [[#250](https://github.com/coinbase/cds/pull/250)]
|
|
16
|
+
|
|
17
|
+
## 8.38.4 (1/22/2026 PST)
|
|
18
|
+
|
|
19
|
+
#### 🐞 Fixes
|
|
20
|
+
|
|
21
|
+
- Fixed spacing props not working on web Button.
|
|
22
|
+
|
|
11
23
|
## 8.38.3 (1/22/2026 PST)
|
|
12
24
|
|
|
13
25
|
#### 🐞 Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../src/alpha/combobox/Combobox.tsx"],"names":[],"mappings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AC;IAC1B,gHAAgH;IAChH,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,aAAa,CACvB,IAAI,SAAS,UAAU,GAAG,QAAQ,EAClC,iBAAiB,SAAS,MAAM,GAAG,MAAM,IACvC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,GAC5C,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;AAEpC,KAAK,iBAAiB,GAAG,CACvB,IAAI,SAAS,UAAU,GAAG,QAAQ,EAClC,iBAAiB,SAAS,MAAM,GAAG,MAAM,EAEzC,KAAK,EAAE,aAAa,CAAC,IAAI,EAAE,iBAAiB,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;CAAE,KAC7E,KAAK,CAAC,YAAY,CAAC;AA8JxB,eAAO,MAAM,QAAQ,EAAmB,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultComboboxControl.d.ts","sourceRoot":"","sources":["../../../src/alpha/combobox/DefaultComboboxControl.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,wBAAwB,EAAwB,MAAM,YAAY,CAAC;AAOjF,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"DefaultComboboxControl.d.ts","sourceRoot":"","sources":["../../../src/alpha/combobox/DefaultComboboxControl.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,wBAAwB,EAAwB,MAAM,YAAY,CAAC;AAOjF,eAAO,MAAM,sBAAsB,EA8H9B,wBAAwB,CAAC"}
|
|
@@ -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;AAyBlB,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;
|
|
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;AAyBlB,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;AA+axB,eAAO,MAAM,oBAAoB,EAAoC,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultSelectDropdown.d.ts","sourceRoot":"","sources":["../../../src/alpha/select/DefaultSelectDropdown.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAsC,UAAU,EAAE,MAAM,UAAU,CAAC;AAMpG,KAAK,yBAAyB,GAAG,CAC/B,IAAI,SAAS,UAAU,EACvB,iBAAiB,SAAS,MAAM,GAAG,MAAM,EAEzC,KAAK,EAAE,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;CAAE,KACtF,KAAK,CAAC,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultSelectDropdown.d.ts","sourceRoot":"","sources":["../../../src/alpha/select/DefaultSelectDropdown.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAsC,UAAU,EAAE,MAAM,UAAU,CAAC;AAMpG,KAAK,yBAAyB,GAAG,CAC/B,IAAI,SAAS,UAAU,EACvB,iBAAiB,SAAS,MAAM,GAAG,MAAM,EAEzC,KAAK,EAAE,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;CAAE,KACtF,KAAK,CAAC,YAAY,CAAC;AAyaxB,eAAO,MAAM,qBAAqB,EAAqC,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/buttons/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACR,wBAAwB,EACxB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,EAAa,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/buttons/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACR,wBAAwB,EACxB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,WAAW,EAAE,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oot":"","sources":["../../src/overlays/FocusTrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAMrD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAGF,eAAO,MAAM,eAAe,UAAiD,CAAC;AA+B9E,eAAO,MAAM,SAAS,4CAiSpB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const _excluded = ["ComboboxControlComponent"],
|
|
2
|
-
_excluded2 = ["type", "value", "onChange", "options", "open", "setOpen", "
|
|
2
|
+
_excluded2 = ["type", "value", "onChange", "options", "open", "setOpen", "label", "accessibilityLabel", "controlAccessibilityLabel", "defaultOpen", "searchText", "onSearch", "defaultSearchText", "filterFunction", "SelectControlComponent", "ComboboxControlComponent", "hideSearchInput"];
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
@@ -58,8 +58,9 @@ const ComboboxBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
58
58
|
options,
|
|
59
59
|
open: openProp,
|
|
60
60
|
setOpen: setOpenProp,
|
|
61
|
-
|
|
62
|
-
accessibilityLabel = 'Combobox
|
|
61
|
+
label,
|
|
62
|
+
accessibilityLabel = typeof label === 'string' ? label : 'Combobox dropdown',
|
|
63
|
+
controlAccessibilityLabel = typeof label === 'string' ? label : 'Combobox control',
|
|
63
64
|
defaultOpen,
|
|
64
65
|
searchText: searchTextProp,
|
|
65
66
|
onSearch: onSearchProp,
|
|
@@ -113,11 +114,12 @@ const ComboboxBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
113
114
|
ref: controlRef,
|
|
114
115
|
SelectControlComponent: ComboboxControl,
|
|
115
116
|
accessibilityLabel: accessibilityLabel,
|
|
117
|
+
controlAccessibilityLabel: controlAccessibilityLabel,
|
|
116
118
|
defaultOpen: defaultOpen,
|
|
119
|
+
label: label,
|
|
117
120
|
onChange: handleChange,
|
|
118
121
|
open: open,
|
|
119
122
|
options: filteredOptions,
|
|
120
|
-
placeholder: placeholder,
|
|
121
123
|
setOpen: setOpen,
|
|
122
124
|
type: type,
|
|
123
125
|
value: value
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["SelectControlComponent", "value", "placeholder", "controlRef", "hideSearchInput", "options", "open", "setOpen", "compact", "searchText", "onSearch"];
|
|
1
|
+
const _excluded = ["SelectControlComponent", "value", "placeholder", "controlRef", "hideSearchInput", "options", "open", "setOpen", "compact", "searchText", "onSearch", "accessibilityLabel"];
|
|
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; }
|
|
@@ -6,7 +6,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
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
|
-
import { memo, useCallback, useEffect, useRef } from 'react';
|
|
9
|
+
import { memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
10
10
|
import { NativeInput } from '../../controls/NativeInput';
|
|
11
11
|
import { HStack } from '../../layout';
|
|
12
12
|
import { NAVIGATION_KEYS } from '../../overlays/FocusTrap';
|
|
@@ -27,7 +27,8 @@ export const DefaultComboboxControl = /*#__PURE__*/memo(_ref => {
|
|
|
27
27
|
setOpen,
|
|
28
28
|
compact,
|
|
29
29
|
searchText,
|
|
30
|
-
onSearch
|
|
30
|
+
onSearch,
|
|
31
|
+
accessibilityLabel
|
|
31
32
|
} = _ref,
|
|
32
33
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
34
|
const searchInputRef = useRef(null);
|
|
@@ -46,8 +47,16 @@ export const DefaultComboboxControl = /*#__PURE__*/memo(_ref => {
|
|
|
46
47
|
event.stopPropagation();
|
|
47
48
|
setOpen(true);
|
|
48
49
|
}, [setOpen]);
|
|
50
|
+
const computedAccessibilityLabel = useMemo(() => {
|
|
51
|
+
let label = accessibilityLabel;
|
|
52
|
+
if (!hasValue && typeof placeholder === 'string') {
|
|
53
|
+
label = "".concat(label, ", ").concat(placeholder);
|
|
54
|
+
}
|
|
55
|
+
return label;
|
|
56
|
+
}, [hasValue, accessibilityLabel, placeholder]);
|
|
49
57
|
return /*#__PURE__*/_jsx(SelectControlComponent, _objectSpread(_objectSpread({
|
|
50
58
|
ref: (_controlRef$current = controlRef.current) === null || _controlRef$current === void 0 ? void 0 : _controlRef$current.refs.setReference,
|
|
59
|
+
accessibilityLabel: computedAccessibilityLabel,
|
|
51
60
|
compact: compact,
|
|
52
61
|
open: open,
|
|
53
62
|
options: options,
|
|
@@ -96,7 +105,6 @@ export const DefaultComboboxControl = /*#__PURE__*/memo(_ref => {
|
|
|
96
105
|
children: placeholder
|
|
97
106
|
})
|
|
98
107
|
}),
|
|
99
|
-
placeholder: null,
|
|
100
108
|
styles: _objectSpread(_objectSpread({}, props.styles), {}, {
|
|
101
109
|
controlEndNode: _objectSpread(_objectSpread({}, (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.controlEndNode), {}, {
|
|
102
110
|
alignItems: hasValue && shouldShowSearchInput ? 'flex-end' : 'center'
|
|
@@ -106,6 +106,25 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
106
106
|
});
|
|
107
107
|
return map;
|
|
108
108
|
}, [options]);
|
|
109
|
+
const singleValueContent = useMemo(() => {
|
|
110
|
+
var _ref3, _ref4, _option$label;
|
|
111
|
+
const option = !isMultiSelect ? optionsMap.get(value) : undefined;
|
|
112
|
+
const label = (_ref3 = (_ref4 = (_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : option === null || option === void 0 ? void 0 : option.description) !== null && _ref4 !== void 0 ? _ref4 : option === null || option === void 0 ? void 0 : option.value) !== null && _ref3 !== void 0 ? _ref3 : placeholder;
|
|
113
|
+
return hasValue ? label : placeholder;
|
|
114
|
+
}, [hasValue, isMultiSelect, optionsMap, placeholder, value]);
|
|
115
|
+
const computedControlAccessibilityLabel = useMemo(() => {
|
|
116
|
+
// For multi-select, set the label to the content of each selected value and the hidden selected options label
|
|
117
|
+
if (isMultiSelect) {
|
|
118
|
+
const selectedValues = value.map(v => {
|
|
119
|
+
var _ref5, _ref6, _option$label2;
|
|
120
|
+
const option = optionsMap.get(v);
|
|
121
|
+
return (_ref5 = (_ref6 = (_option$label2 = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label2 !== void 0 ? _option$label2 : option === null || option === void 0 ? void 0 : option.description) !== null && _ref6 !== void 0 ? _ref6 : option === null || option === void 0 ? void 0 : option.value) !== null && _ref5 !== void 0 ? _ref5 : v;
|
|
122
|
+
}).slice(0, maxSelectedOptionsToShow).join(', ');
|
|
123
|
+
return "".concat(accessibilityLabel, ", ").concat(value.length > 0 ? selectedValues : placeholder !== null && placeholder !== void 0 ? placeholder : '').concat(value.length > maxSelectedOptionsToShow ? ', ' + hiddenSelectedOptionsLabel : '');
|
|
124
|
+
}
|
|
125
|
+
// If value is React node, fallback to only using passed in accessibility label
|
|
126
|
+
return "".concat(accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : '').concat(typeof singleValueContent === 'string' ? ', ' + singleValueContent : '');
|
|
127
|
+
}, [accessibilityLabel, hiddenSelectedOptionsLabel, isMultiSelect, maxSelectedOptionsToShow, optionsMap, placeholder, singleValueContent, value]);
|
|
109
128
|
const controlPressableRef = useRef(null);
|
|
110
129
|
const valueNodeContainerRef = useRef(null);
|
|
111
130
|
const handleUnselectValue = useCallback((event, index) => {
|
|
@@ -156,7 +175,6 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
156
175
|
children: label
|
|
157
176
|
}) : label, [labelVariant, classNames === null || classNames === void 0 ? void 0 : classNames.controlLabelNode, styles === null || styles === void 0 ? void 0 : styles.controlLabelNode, label, setOpen]);
|
|
158
177
|
const valueNode = useMemo(() => {
|
|
159
|
-
var _ref5, _ref6, _option$label2;
|
|
160
178
|
if (hasValue && isMultiSelect) {
|
|
161
179
|
const valuesToShow = value.length <= maxSelectedOptionsToShow ? value : value.slice(0, maxSelectedOptionsToShow);
|
|
162
180
|
const optionsToShow = valuesToShow.map(value => optionsMap.get(value)).filter(option => option !== undefined);
|
|
@@ -164,7 +182,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
164
182
|
flexWrap: "wrap",
|
|
165
183
|
gap: 1,
|
|
166
184
|
children: [optionsToShow.map((option, index) => {
|
|
167
|
-
var _option$value,
|
|
185
|
+
var _option$value, _ref7, _ref8, _option$label3;
|
|
168
186
|
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 : '';
|
|
169
187
|
return /*#__PURE__*/_jsx(InputChip, {
|
|
170
188
|
compact: true,
|
|
@@ -175,7 +193,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
175
193
|
invertColorScheme: false,
|
|
176
194
|
maxWidth: 200,
|
|
177
195
|
onClick: event => handleUnselectValue(event, index),
|
|
178
|
-
children: (
|
|
196
|
+
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 : ''
|
|
179
197
|
}, option.value);
|
|
180
198
|
}), value.length - maxSelectedOptionsToShow > 0 && /*#__PURE__*/_jsx(InputChip, {
|
|
181
199
|
compact: true,
|
|
@@ -186,26 +204,23 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
186
204
|
})]
|
|
187
205
|
});
|
|
188
206
|
}
|
|
189
|
-
|
|
190
|
-
const label = (_ref5 = (_ref6 = (_option$label2 = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label2 !== void 0 ? _option$label2 : option === null || option === void 0 ? void 0 : option.description) !== null && _ref6 !== void 0 ? _ref6 : option === null || option === void 0 ? void 0 : option.value) !== null && _ref5 !== void 0 ? _ref5 : placeholder;
|
|
191
|
-
const content = hasValue ? label : placeholder;
|
|
192
|
-
return typeof content === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
207
|
+
return typeof singleValueContent === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
193
208
|
as: "p",
|
|
194
209
|
color: hasValue ? 'fg' : 'fgMuted',
|
|
195
210
|
display: "block",
|
|
196
211
|
font: "body",
|
|
197
212
|
overflow: "truncate",
|
|
198
213
|
width: "100%",
|
|
199
|
-
children:
|
|
200
|
-
}) :
|
|
201
|
-
}, [hasValue, isMultiSelect,
|
|
214
|
+
children: singleValueContent
|
|
215
|
+
}) : singleValueContent;
|
|
216
|
+
}, [hasValue, isMultiSelect, singleValueContent, value, maxSelectedOptionsToShow, hiddenSelectedOptionsLabel, optionsMap, removeSelectedOptionAccessibilityLabel, handleUnselectValue]);
|
|
202
217
|
const inputNode = useMemo(() =>
|
|
203
218
|
/*#__PURE__*/
|
|
204
219
|
// We don't offer control over setting the role since this must always be a button
|
|
205
220
|
_jsxs(Pressable, {
|
|
206
221
|
ref: controlPressableRef,
|
|
207
222
|
noScaleOnPress: true,
|
|
208
|
-
accessibilityLabel:
|
|
223
|
+
accessibilityLabel: computedControlAccessibilityLabel,
|
|
209
224
|
"aria-haspopup": ariaHaspopup,
|
|
210
225
|
background: "transparent",
|
|
211
226
|
blendStyles: interactableBlendStyles,
|
|
@@ -259,7 +274,7 @@ const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(
|
|
|
259
274
|
children: [valueNode, contentNode]
|
|
260
275
|
})
|
|
261
276
|
})]
|
|
262
|
-
}), [
|
|
277
|
+
}), [computedControlAccessibilityLabel, 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, labelVariant, compact, 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, tabIndex, startNode, shouldShowCompactLabel, labelNode, isMultiSelect, valueNode, contentNode, setOpen]);
|
|
263
278
|
const endNode = useMemo(() => /*#__PURE__*/_jsx(Pressable, {
|
|
264
279
|
"aria-hidden": true,
|
|
265
280
|
flexShrink: 0,
|
|
@@ -159,6 +159,12 @@ const DefaultSelectDropdownComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef
|
|
|
159
159
|
if (!isMultiSelect) setOpen(false);
|
|
160
160
|
}, [onChange, isMultiSelect, setOpen]);
|
|
161
161
|
const handleEscPress = useCallback(() => setOpen(false), [setOpen]);
|
|
162
|
+
const handleKeyDown = useCallback(event => {
|
|
163
|
+
if (event.key === 'Tab') {
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
setOpen(false);
|
|
166
|
+
}
|
|
167
|
+
}, [setOpen]);
|
|
162
168
|
useEffect(() => {
|
|
163
169
|
if (!controlRef.current) return;
|
|
164
170
|
const resizeObserver = new ResizeObserver(entries => {
|
|
@@ -177,6 +183,7 @@ const DefaultSelectDropdownComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef
|
|
|
177
183
|
"aria-multiselectable": isMultiSelect,
|
|
178
184
|
className: cx(classNames === null || classNames === void 0 ? void 0 : classNames.root, className),
|
|
179
185
|
display: "block",
|
|
186
|
+
onKeyDown: handleKeyDown,
|
|
180
187
|
role: accessibilityRoles === null || accessibilityRoles === void 0 ? void 0 : accessibilityRoles.dropdown,
|
|
181
188
|
style: dropdownStyles
|
|
182
189
|
}, props), {}, {
|
|
@@ -41,9 +41,9 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
41
41
|
compact,
|
|
42
42
|
label,
|
|
43
43
|
labelVariant,
|
|
44
|
-
accessibilityLabel = 'Select
|
|
44
|
+
accessibilityLabel = typeof label === 'string' ? label : 'Select dropdown',
|
|
45
45
|
accessibilityRoles = defaultAccessibilityRoles,
|
|
46
|
-
controlAccessibilityLabel,
|
|
46
|
+
controlAccessibilityLabel = typeof label === 'string' ? label : 'Select control',
|
|
47
47
|
selectAllLabel,
|
|
48
48
|
emptyOptionsLabel,
|
|
49
49
|
clearAllLabel,
|
package/esm/buttons/Button.css
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
@layer cds{.baseCss-b99zquh{
|
|
1
|
+
@layer cds{.baseCss-b99zquh{-webkit-text-decoration:none;text-decoration:none;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;text-align:center;vertical-align:middle;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;font-weight:600;position:relative;white-space:nowrap;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;overflow:visible;text-transform:none;}
|
|
2
2
|
.blockCss-b9yox33{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;max-width:100%;white-space:normal;}
|
|
3
|
-
.
|
|
4
|
-
.
|
|
5
|
-
.
|
|
6
|
-
.
|
|
7
|
-
.
|
|
8
|
-
.
|
|
9
|
-
.
|
|
10
|
-
.
|
|
11
|
-
.
|
|
12
|
-
.
|
|
13
|
-
.flushEndCss-f1y0pij6{margin-inline-end:calc(var(--space-2) * -1);}}
|
|
3
|
+
.spinnerContainerCss-s1bhvbb9{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
|
4
|
+
.startNodeCss-s2x7iw5{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;margin-inline-end:var(--space-1);}
|
|
5
|
+
.endNodeCss-eukb6jc{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;margin-inline-start:var(--space-1);}
|
|
6
|
+
.iconCss-ixznik7{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}
|
|
7
|
+
.unsetNoWrapCss-u148mgtl{white-space:unset;}
|
|
8
|
+
.hiddenCss-h1pxicn8{visibility:hidden;}
|
|
9
|
+
.middleNodeCss-m1avpq52{position:relative;}
|
|
10
|
+
.flushSpaceCss-f69rtgb{min-width:unset;margin-inline-start:var(--space-2);margin-inline-end:var(--space-2);}
|
|
11
|
+
.flushStartCss-f1aod6bi{margin-inline-start:calc(var(--space-2) * -1);}
|
|
12
|
+
.flushEndCss-fz9snbo{margin-inline-end:calc(var(--space-2) * -1);}}
|
package/esm/buttons/Button.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["as", "variant", "loading", "transparent", "block", "compact", "children", "start", "startIcon", "startIconActive", "end", "endIcon", "endIconActive", "flush", "noScaleOnPress", "numberOfLines", "background", "color", "className", "height", "borderColor", "borderWidth", "borderRadius", "accessibilityLabel"];
|
|
1
|
+
const _excluded = ["as", "variant", "loading", "transparent", "block", "compact", "children", "start", "startIcon", "startIconActive", "end", "endIcon", "endIconActive", "flush", "noScaleOnPress", "numberOfLines", "background", "color", "className", "height", "borderColor", "borderWidth", "borderRadius", "accessibilityLabel", "padding", "paddingX", "margin", "minWidth"];
|
|
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; }
|
|
@@ -15,20 +15,20 @@ import { Pressable } from '../system/Pressable';
|
|
|
15
15
|
import { Text } from '../typography/Text';
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const COMPONENT_STATIC_CLASSNAME = 'cds-Button';
|
|
18
|
+
const DEFAULT_MIN_WIDTH = 100;
|
|
18
19
|
export const spinnerHeight = 2.5;
|
|
19
20
|
const baseCss = "baseCss-b99zquh";
|
|
20
21
|
const blockCss = "blockCss-b9yox33";
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const flushEndCss = "flushEndCss-f1y0pij6";
|
|
22
|
+
const spinnerContainerCss = "spinnerContainerCss-s1bhvbb9";
|
|
23
|
+
const startNodeCss = "startNodeCss-s2x7iw5";
|
|
24
|
+
const endNodeCss = "endNodeCss-eukb6jc";
|
|
25
|
+
const iconCss = "iconCss-ixznik7";
|
|
26
|
+
const unsetNoWrapCss = "unsetNoWrapCss-u148mgtl";
|
|
27
|
+
const hiddenCss = "hiddenCss-h1pxicn8";
|
|
28
|
+
const middleNodeCss = "middleNodeCss-m1avpq52";
|
|
29
|
+
const flushSpaceCss = "flushSpaceCss-f69rtgb";
|
|
30
|
+
const flushStartCss = "flushStartCss-f1aod6bi";
|
|
31
|
+
const flushEndCss = "flushEndCss-fz9snbo";
|
|
32
32
|
const spinnerStyle = {
|
|
33
33
|
width: '24px',
|
|
34
34
|
height: '24px',
|
|
@@ -64,7 +64,11 @@ export const Button = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
64
64
|
borderColor,
|
|
65
65
|
borderWidth = 100,
|
|
66
66
|
borderRadius = compact ? 700 : 900,
|
|
67
|
-
accessibilityLabel
|
|
67
|
+
accessibilityLabel,
|
|
68
|
+
padding,
|
|
69
|
+
paddingX = padding !== null && padding !== void 0 ? padding : compact ? 2 : 4,
|
|
70
|
+
margin = 0,
|
|
71
|
+
minWidth = compact ? 'auto' : DEFAULT_MIN_WIDTH
|
|
68
72
|
} = _ref,
|
|
69
73
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
70
74
|
const Component = as !== null && as !== void 0 ? as : buttonDefaultElement;
|
|
@@ -83,7 +87,7 @@ export const Button = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
83
87
|
borderColor: borderColorValue,
|
|
84
88
|
borderRadius: borderRadius,
|
|
85
89
|
borderWidth: borderWidth,
|
|
86
|
-
className: cx(COMPONENT_STATIC_CLASSNAME, baseCss,
|
|
90
|
+
className: cx(COMPONENT_STATIC_CLASSNAME, baseCss, numberOfLines && unsetNoWrapCss, hasIcon && iconCss, block && blockCss, flush && flushSpaceCss, flush === 'start' && flushStartCss, flush === 'end' && flushEndCss, className),
|
|
87
91
|
color: colorValue,
|
|
88
92
|
"data-block": block,
|
|
89
93
|
"data-compact": compact,
|
|
@@ -92,7 +96,11 @@ export const Button = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
92
96
|
"data-variant": variant,
|
|
93
97
|
height: height,
|
|
94
98
|
loading: loading,
|
|
99
|
+
margin: margin,
|
|
100
|
+
minWidth: minWidth,
|
|
95
101
|
noScaleOnPress: noScaleOnPress,
|
|
102
|
+
padding: padding,
|
|
103
|
+
paddingX: paddingX,
|
|
96
104
|
transparentWhileInactive: transparent
|
|
97
105
|
}, props), {}, {
|
|
98
106
|
children: [start ? /*#__PURE__*/_jsx("span", {
|
|
@@ -52,6 +52,7 @@ export const FocusTrap = /*#__PURE__*/memo(function FocusTrap(_ref) {
|
|
|
52
52
|
// trap focus for accessibility
|
|
53
53
|
const handleKeyboardNavigation = useCallback((event, element) => {
|
|
54
54
|
var _getBrowserGlobals2;
|
|
55
|
+
if (event.defaultPrevented) return;
|
|
55
56
|
const document = (_getBrowserGlobals2 = getBrowserGlobals()) === null || _getBrowserGlobals2 === void 0 ? void 0 : _getBrowserGlobals2.document;
|
|
56
57
|
const activeElement = document === null || document === void 0 ? void 0 : document.activeElement;
|
|
57
58
|
if (!element || !document) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-web",
|
|
3
|
-
"version": "8.38.
|
|
3
|
+
"version": "8.38.5",
|
|
4
4
|
"description": "Coinbase Design System - Web",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
"react-dom": "^18.3.1"
|
|
204
204
|
},
|
|
205
205
|
"dependencies": {
|
|
206
|
-
"@coinbase/cds-common": "^8.38.
|
|
206
|
+
"@coinbase/cds-common": "^8.38.5",
|
|
207
207
|
"@coinbase/cds-icons": "^5.9.0",
|
|
208
208
|
"@coinbase/cds-illustrations": "^4.29.0",
|
|
209
209
|
"@coinbase/cds-lottie-files": "^3.3.4",
|