@coinbase/cds-web 8.25.1 → 8.27.0

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dts/alpha/select/DefaultSelectControl.d.ts +1 -1
  3. package/dts/alpha/select/DefaultSelectControl.d.ts.map +1 -1
  4. package/dts/alpha/select/DefaultSelectDropdown.d.ts.map +1 -1
  5. package/dts/alpha/select/DefaultSelectOptionGroup.d.ts +8 -0
  6. package/dts/alpha/select/DefaultSelectOptionGroup.d.ts.map +1 -0
  7. package/dts/alpha/select/Select.d.ts +21 -454
  8. package/dts/alpha/select/Select.d.ts.map +1 -1
  9. package/dts/alpha/select/index.d.ts +2 -0
  10. package/dts/alpha/select/index.d.ts.map +1 -1
  11. package/dts/alpha/select/types.d.ts +594 -0
  12. package/dts/alpha/select/types.d.ts.map +1 -0
  13. package/dts/alpha/select-chip/SelectChip.d.ts +26 -0
  14. package/dts/alpha/select-chip/SelectChip.d.ts.map +1 -0
  15. package/dts/alpha/select-chip/SelectChipControl.d.ts +13 -0
  16. package/dts/alpha/select-chip/SelectChipControl.d.ts.map +1 -0
  17. package/dts/alpha/select-chip/index.d.ts +3 -0
  18. package/dts/alpha/select-chip/index.d.ts.map +1 -0
  19. package/dts/cells/CellAccessory.d.ts +1 -1
  20. package/dts/cells/CellAccessory.d.ts.map +1 -1
  21. package/dts/chips/Chip.d.ts.map +1 -1
  22. package/dts/chips/SelectChip.d.ts +8 -0
  23. package/dts/chips/SelectChip.d.ts.map +1 -1
  24. package/dts/controls/SearchInput.d.ts +1 -1
  25. package/esm/alpha/select/DefaultSelectControl.js +46 -8
  26. package/esm/alpha/select/DefaultSelectDropdown.js +137 -60
  27. package/esm/alpha/select/DefaultSelectOptionGroup.js +118 -0
  28. package/esm/alpha/select/Select.js +16 -31
  29. package/esm/alpha/select/index.js +3 -1
  30. package/esm/alpha/select/types.js +46 -0
  31. package/esm/alpha/select-chip/SelectChip.js +50 -0
  32. package/esm/alpha/select-chip/SelectChipControl.js +116 -0
  33. package/esm/alpha/select-chip/index.js +2 -0
  34. package/esm/cells/CellAccessory.js +9 -0
  35. package/esm/chips/Chip.js +5 -2
  36. package/esm/chips/SelectChip.js +10 -0
  37. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- const _excluded = ["value", "type", "options", "onChange", "open", "setOpen", "disabled", "disableClickOutsideClose", "placeholder", "helperText", "compact", "label", "labelVariant", "accessibilityLabel", "accessibilityRoles", "controlAccessibilityLabel", "selectAllLabel", "emptyOptionsLabel", "clearAllLabel", "hideSelectAll", "defaultOpen", "startNode", "endNode", "variant", "maxSelectedOptionsToShow", "hiddenSelectedOptionsLabel", "removeSelectedOptionAccessibilityLabel", "accessory", "media", "end", "SelectOptionComponent", "SelectAllOptionComponent", "SelectDropdownComponent", "SelectControlComponent", "SelectEmptyDropdownContentsComponent", "style", "styles", "className", "classNames", "testID"];
1
+ const _excluded = ["value", "type", "options", "onChange", "open", "setOpen", "disabled", "disableClickOutsideClose", "placeholder", "helperText", "compact", "label", "labelVariant", "accessibilityLabel", "accessibilityRoles", "controlAccessibilityLabel", "selectAllLabel", "emptyOptionsLabel", "clearAllLabel", "hideSelectAll", "defaultOpen", "startNode", "endNode", "variant", "maxSelectedOptionsToShow", "hiddenSelectedOptionsLabel", "removeSelectedOptionAccessibilityLabel", "accessory", "media", "end", "SelectOptionComponent", "SelectAllOptionComponent", "SelectDropdownComponent", "SelectControlComponent", "SelectEmptyDropdownContentsComponent", "SelectOptionGroupComponent", "style", "styles", "className", "classNames", "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; }
@@ -19,36 +19,16 @@ import { DefaultSelectControl } from './DefaultSelectControl';
19
19
  import { DefaultSelectDropdown } from './DefaultSelectDropdown';
20
20
  import { DefaultSelectEmptyDropdownContents } from './DefaultSelectEmptyDropdownContents';
21
21
  import { DefaultSelectOption } from './DefaultSelectOption';
22
+ import { DefaultSelectOptionGroup } from './DefaultSelectOptionGroup';
23
+
24
+ // Re-export all types for backward compatibility
22
25
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
+ // Re-export the type guard function
27
+ export { isSelectOptionGroup } from './types';
23
28
  export const defaultAccessibilityRoles = {
24
29
  dropdown: 'listbox',
25
30
  option: 'option'
26
31
  };
27
-
28
- /**
29
- * Configuration for a single option in the Select component
30
- */
31
-
32
- /**
33
- * Props for individual option components within the Select dropdown
34
- */
35
-
36
- /**
37
- * Custom UI to render for an option in the Select component options array
38
- */
39
-
40
- /**
41
- * Props for the select control component (the clickable input that opens the dropdown)
42
- */
43
-
44
- /**
45
- * Props for the dropdown component that contains the list of options
46
- */
47
-
48
- /**
49
- * Props for the Select component
50
- */
51
-
52
32
  const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
53
33
  let {
54
34
  value,
@@ -86,6 +66,7 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
86
66
  SelectDropdownComponent = DefaultSelectDropdown,
87
67
  SelectControlComponent = DefaultSelectControl,
88
68
  SelectEmptyDropdownContentsComponent = DefaultSelectEmptyDropdownContents,
69
+ SelectOptionGroupComponent = DefaultSelectOptionGroup,
89
70
  style,
90
71
  styles,
91
72
  className,
@@ -103,7 +84,8 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
103
84
  floatingStyles
104
85
  } = useFloating({
105
86
  open,
106
- middleware: [flip()]
87
+ middleware: [flip()],
88
+ placement: 'bottom-start'
107
89
  });
108
90
  useClickOutside(() => !disableClickOutsideClose && setOpen(false), {
109
91
  ref: refs.floating,
@@ -136,8 +118,9 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
136
118
  optionDescription: styles === null || styles === void 0 ? void 0 : styles.optionDescription,
137
119
  selectAllDivider: styles === null || styles === void 0 ? void 0 : styles.selectAllDivider,
138
120
  emptyContentsContainer: styles === null || styles === void 0 ? void 0 : styles.emptyContentsContainer,
139
- emptyContentsText: styles === null || styles === void 0 ? void 0 : styles.emptyContentsText
140
- }), [floatingStyles, styles === null || styles === void 0 ? void 0 : styles.dropdown, styles === null || styles === void 0 ? void 0 : styles.option, styles === null || styles === void 0 ? void 0 : styles.optionBlendStyles, styles === null || styles === void 0 ? void 0 : styles.optionCell, styles === null || styles === void 0 ? void 0 : styles.optionContent, styles === null || styles === void 0 ? void 0 : styles.optionLabel, styles === null || styles === void 0 ? void 0 : styles.optionDescription, styles === null || styles === void 0 ? void 0 : styles.selectAllDivider, styles === null || styles === void 0 ? void 0 : styles.emptyContentsContainer, styles === null || styles === void 0 ? void 0 : styles.emptyContentsText]);
121
+ emptyContentsText: styles === null || styles === void 0 ? void 0 : styles.emptyContentsText,
122
+ optionGroup: styles === null || styles === void 0 ? void 0 : styles.optionGroup
123
+ }), [floatingStyles, styles === null || styles === void 0 ? void 0 : styles.dropdown, styles === null || styles === void 0 ? void 0 : styles.option, styles === null || styles === void 0 ? void 0 : styles.optionBlendStyles, styles === null || styles === void 0 ? void 0 : styles.optionCell, styles === null || styles === void 0 ? void 0 : styles.optionContent, styles === null || styles === void 0 ? void 0 : styles.optionLabel, styles === null || styles === void 0 ? void 0 : styles.optionDescription, styles === null || styles === void 0 ? void 0 : styles.selectAllDivider, styles === null || styles === void 0 ? void 0 : styles.emptyContentsContainer, styles === null || styles === void 0 ? void 0 : styles.emptyContentsText, styles === null || styles === void 0 ? void 0 : styles.optionGroup]);
141
124
  const dropdownClassNames = useMemo(() => ({
142
125
  root: classNames === null || classNames === void 0 ? void 0 : classNames.dropdown,
143
126
  option: classNames === null || classNames === void 0 ? void 0 : classNames.option,
@@ -147,8 +130,9 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
147
130
  optionDescription: classNames === null || classNames === void 0 ? void 0 : classNames.optionDescription,
148
131
  selectAllDivider: classNames === null || classNames === void 0 ? void 0 : classNames.selectAllDivider,
149
132
  emptyContentsContainer: classNames === null || classNames === void 0 ? void 0 : classNames.emptyContentsContainer,
150
- emptyContentsText: classNames === null || classNames === void 0 ? void 0 : classNames.emptyContentsText
151
- }), [classNames === null || classNames === void 0 ? void 0 : classNames.dropdown, classNames === null || classNames === void 0 ? void 0 : classNames.option, classNames === null || classNames === void 0 ? void 0 : classNames.optionCell, classNames === null || classNames === void 0 ? void 0 : classNames.optionContent, classNames === null || classNames === void 0 ? void 0 : classNames.optionLabel, classNames === null || classNames === void 0 ? void 0 : classNames.optionDescription, classNames === null || classNames === void 0 ? void 0 : classNames.selectAllDivider, classNames === null || classNames === void 0 ? void 0 : classNames.emptyContentsContainer, classNames === null || classNames === void 0 ? void 0 : classNames.emptyContentsText]);
133
+ emptyContentsText: classNames === null || classNames === void 0 ? void 0 : classNames.emptyContentsText,
134
+ optionGroup: classNames === null || classNames === void 0 ? void 0 : classNames.optionGroup
135
+ }), [classNames === null || classNames === void 0 ? void 0 : classNames.dropdown, classNames === null || classNames === void 0 ? void 0 : classNames.option, classNames === null || classNames === void 0 ? void 0 : classNames.optionCell, classNames === null || classNames === void 0 ? void 0 : classNames.optionContent, classNames === null || classNames === void 0 ? void 0 : classNames.optionLabel, classNames === null || classNames === void 0 ? void 0 : classNames.optionDescription, classNames === null || classNames === void 0 ? void 0 : classNames.selectAllDivider, classNames === null || classNames === void 0 ? void 0 : classNames.emptyContentsContainer, classNames === null || classNames === void 0 ? void 0 : classNames.emptyContentsText, classNames === null || classNames === void 0 ? void 0 : classNames.optionGroup]);
152
136
  const containerRef = useRef(null);
153
137
  useImperativeHandle(ref, () => Object.assign(containerRef.current, {
154
138
  open,
@@ -194,6 +178,7 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
194
178
  SelectAllOptionComponent: SelectAllOptionComponent,
195
179
  SelectEmptyDropdownContentsComponent: SelectEmptyDropdownContentsComponent,
196
180
  SelectOptionComponent: SelectOptionComponent,
181
+ SelectOptionGroupComponent: SelectOptionGroupComponent,
197
182
  accessibilityLabel: accessibilityLabel,
198
183
  accessibilityRoles: accessibilityRoles,
199
184
  accessory: accessory,
@@ -3,4 +3,6 @@ export * from './DefaultSelectControl';
3
3
  export * from './DefaultSelectDropdown';
4
4
  export * from './DefaultSelectEmptyDropdownContents';
5
5
  export * from './DefaultSelectOption';
6
- export * from './Select';
6
+ export * from './DefaultSelectOptionGroup';
7
+ export * from './Select';
8
+ export * from './types';
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Configuration for a single option in the Select component
3
+ */
4
+
5
+ /**
6
+ * Props for individual option components within the Select dropdown
7
+ */
8
+
9
+ /**
10
+ * Custom UI to render for an option in the Select component options array
11
+ */
12
+
13
+ /**
14
+ * Configuration for a group of options in the Select component
15
+ */
16
+
17
+ /**
18
+ * Props for the option group component in the Select dropdown
19
+ */
20
+
21
+ /**
22
+ * Custom UI to render for an option group in the Select component options array
23
+ */
24
+
25
+ /**
26
+ * Array of options for the Select component. Can be individual options or groups with `label` and `options`
27
+ */
28
+
29
+ /**
30
+ * Type guard to check if an option is a group
31
+ */
32
+ export function isSelectOptionGroup(option) {
33
+ return 'options' in option && Array.isArray(option.options) && 'label' in option;
34
+ }
35
+
36
+ /**
37
+ * Props for the dropdown component that contains the list of options
38
+ */
39
+
40
+ /**
41
+ * Props for the select control component (the clickable input that opens the dropdown)
42
+ */
43
+
44
+ /**
45
+ * Props for the Select component
46
+ */
@@ -0,0 +1,50 @@
1
+ const _excluded = ["invertColorScheme", "numberOfLines"];
2
+ 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; }
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
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
8
+ 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); }
9
+ import React, { forwardRef, memo, useMemo } from 'react';
10
+ import { Select } from '../select/Select';
11
+ import { SelectChipControl } from './SelectChipControl';
12
+
13
+ /**
14
+ * Chip-styled Select control built on top of the Alpha Select.
15
+ * Supports both single and multi selection via Select's `type` prop.
16
+ */
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ /**
19
+ * Creates a wrapper component that injects invertColorScheme and numberOfLines
20
+ * into SelectChipControl. This is needed because Select doesn't pass these props
21
+ * to SelectControlComponent, but SelectChipControl requires them.
22
+ */
23
+ function createSelectChipControlWrapper(invertColorScheme, numberOfLines) {
24
+ return /*#__PURE__*/memo(/*#__PURE__*/forwardRef((controlProps, controlRef) => {
25
+ return /*#__PURE__*/_jsx(SelectChipControl, _objectSpread(_objectSpread({}, controlProps), {}, {
26
+ ref: controlRef,
27
+ invertColorScheme: invertColorScheme,
28
+ numberOfLines: numberOfLines
29
+ }));
30
+ }));
31
+ }
32
+ const SelectChipComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
33
+ let {
34
+ invertColorScheme,
35
+ numberOfLines
36
+ } = _ref,
37
+ props = _objectWithoutProperties(_ref, _excluded);
38
+ const WrappedSelectChipControl = useMemo(() => createSelectChipControlWrapper(invertColorScheme, numberOfLines), [invertColorScheme, numberOfLines]);
39
+ return /*#__PURE__*/_jsx(Select, _objectSpread({
40
+ ref: ref,
41
+ SelectControlComponent: WrappedSelectChipControl,
42
+ styles: _objectSpread({
43
+ dropdown: {
44
+ width: 'max-content'
45
+ }
46
+ }, props.styles)
47
+ }, props));
48
+ }));
49
+ SelectChipComponent.displayName = 'SelectChip';
50
+ export const SelectChip = SelectChipComponent;
@@ -0,0 +1,116 @@
1
+ import React, { forwardRef, memo, useMemo } from 'react';
2
+ import { MediaChip } from '../../chips';
3
+ import { AnimatedCaret } from '../../motion/AnimatedCaret';
4
+ import { isSelectOptionGroup } from '../select/types';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const SelectChipControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
7
+ let {
8
+ type,
9
+ options,
10
+ value,
11
+ placeholder,
12
+ setOpen,
13
+ startNode,
14
+ endNode: customEndNode,
15
+ open,
16
+ accessibilityLabel,
17
+ ariaHaspopup = 'listbox',
18
+ className,
19
+ style,
20
+ maxSelectedOptionsToShow = 2,
21
+ hiddenSelectedOptionsLabel = 'more',
22
+ label,
23
+ compact,
24
+ invertColorScheme,
25
+ numberOfLines,
26
+ disabled
27
+ } = _ref;
28
+ const isMultiSelect = type === 'multi';
29
+ const hasValue = value !== null && !(Array.isArray(value) && value.length === 0);
30
+
31
+ // Map of options to their values
32
+ // If multiple options share the same value, the first occurrence wins (matches native HTML select behavior)
33
+ const optionsMap = useMemo(() => {
34
+ const map = new Map();
35
+ const isDev = process.env.NODE_ENV !== 'production';
36
+ options.forEach((option, optionIndex) => {
37
+ if (isSelectOptionGroup(option)) {
38
+ option.options.forEach((groupOption, groupOptionIndex) => {
39
+ if (groupOption.value !== null) {
40
+ const value = groupOption.value;
41
+ // Only set if not already present (first wins)
42
+ if (!map.has(value)) {
43
+ map.set(value, groupOption);
44
+ } else if (isDev) {
45
+ console.warn("[Select] Duplicate option value detected: \"".concat(value, "\". ") + "The first occurrence will be used for display. " + "Found duplicate in group \"".concat(option.label, "\" at index ").concat(groupOptionIndex, ". ") + "First occurrence was at option index ".concat(optionIndex, "."));
46
+ }
47
+ }
48
+ });
49
+ } else {
50
+ const singleOption = option;
51
+ if (singleOption.value !== null) {
52
+ const value = singleOption.value;
53
+ // Only set if not already present (first wins)
54
+ if (!map.has(value)) {
55
+ map.set(value, singleOption);
56
+ } else if (isDev) {
57
+ var _ref2, _existingOption$label;
58
+ const existingOption = map.get(value);
59
+ console.warn("[Select] Duplicate option value detected: \"".concat(value, "\". ") + "The first occurrence will be used for display. " + "Found duplicate at option index ".concat(optionIndex, ". ") + "First occurrence label: \"".concat((_ref2 = (_existingOption$label = existingOption === null || existingOption === void 0 ? void 0 : existingOption.label) !== null && _existingOption$label !== void 0 ? _existingOption$label : existingOption === null || existingOption === void 0 ? void 0 : existingOption.value) !== null && _ref2 !== void 0 ? _ref2 : 'unknown', "\"."));
60
+ }
61
+ }
62
+ }
63
+ });
64
+ return map;
65
+ }, [options]);
66
+ const labelContent = useMemo(() => {
67
+ var _ref3, _ref6, _ref7, _ref8, _opt$label2;
68
+ if (!hasValue) return (_ref3 = label !== null && label !== void 0 ? label : placeholder) !== null && _ref3 !== void 0 ? _ref3 : null;
69
+ if (isMultiSelect) {
70
+ const values = value;
71
+ const visible = values.slice(0, maxSelectedOptionsToShow);
72
+ const labels = visible.map(v => {
73
+ var _ref4, _ref5, _opt$label;
74
+ const opt = optionsMap.get(v);
75
+ return (_ref4 = (_ref5 = (_opt$label = opt === null || opt === void 0 ? void 0 : opt.label) !== null && _opt$label !== void 0 ? _opt$label : opt === null || opt === void 0 ? void 0 : opt.description) !== null && _ref5 !== void 0 ? _ref5 : opt === null || opt === void 0 ? void 0 : opt.value) !== null && _ref4 !== void 0 ? _ref4 : '';
76
+ }).filter(Boolean);
77
+ const hiddenCount = values.length - visible.length;
78
+ return hiddenCount > 0 ? "".concat(labels.join(', '), " +").concat(hiddenCount, " ").concat(hiddenSelectedOptionsLabel) : labels.join(', ');
79
+ }
80
+ const opt = optionsMap.get(value);
81
+ return (_ref6 = (_ref7 = (_ref8 = (_opt$label2 = opt === null || opt === void 0 ? void 0 : opt.label) !== null && _opt$label2 !== void 0 ? _opt$label2 : opt === null || opt === void 0 ? void 0 : opt.description) !== null && _ref8 !== void 0 ? _ref8 : opt === null || opt === void 0 ? void 0 : opt.value) !== null && _ref7 !== void 0 ? _ref7 : placeholder) !== null && _ref6 !== void 0 ? _ref6 : null;
82
+ }, [hasValue, label, placeholder, isMultiSelect, optionsMap, value, maxSelectedOptionsToShow, hiddenSelectedOptionsLabel]);
83
+ const endNode = useMemo(() => {
84
+ return customEndNode !== null && customEndNode !== void 0 ? customEndNode : /*#__PURE__*/_jsx(AnimatedCaret, {
85
+ active: true,
86
+ color: hasValue ? 'fgInverse' : 'fg',
87
+ rotate: open ? 0 : 180,
88
+ size: "xs"
89
+ });
90
+ }, [customEndNode, hasValue, open]);
91
+ const color = useMemo(() => {
92
+ return hasValue ? 'fgInverse' : 'fg';
93
+ }, [hasValue]);
94
+ const background = useMemo(() => {
95
+ return hasValue ? 'bgInverse' : 'bgSecondary';
96
+ }, [hasValue]);
97
+ return /*#__PURE__*/_jsx(MediaChip, {
98
+ ref: ref,
99
+ noScaleOnPress: true,
100
+ accessibilityLabel: accessibilityLabel,
101
+ "aria-haspopup": ariaHaspopup,
102
+ background: background,
103
+ className: className,
104
+ color: color,
105
+ compact: compact,
106
+ disabled: disabled,
107
+ end: endNode,
108
+ invertColorScheme: invertColorScheme,
109
+ numberOfLines: numberOfLines,
110
+ onClick: () => setOpen(s => !s),
111
+ start: startNode,
112
+ style: style,
113
+ children: labelContent
114
+ });
115
+ }));
116
+ export const SelectChipControl = SelectChipControlComponent;
@@ -0,0 +1,2 @@
1
+ export * from './SelectChip';
2
+ export * from './SelectChipControl';
@@ -39,6 +39,15 @@ export const CellAccessory = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function
39
39
  size: "s"
40
40
  });
41
41
  }
42
+ if (type === 'unselected') {
43
+ icon = /*#__PURE__*/_jsx(Icon, {
44
+ name: "checkmark",
45
+ size: "s",
46
+ style: {
47
+ opacity: 0
48
+ }
49
+ });
50
+ }
42
51
  if (!icon) {
43
52
  return null;
44
53
  }
package/esm/chips/Chip.js CHANGED
@@ -1,4 +1,4 @@
1
- const _excluded = ["as", "alignItems", "width", "height", "compact", "gap", "start", "end", "paddingX", "paddingY", "padding", "paddingTop", "paddingBottom", "paddingStart", "paddingEnd", "justifyContent", "children", "maxWidth", "invertColorScheme", "inverted", "numberOfLines", "testID", "contentStyle", "borderRadius", "background", "style", "className", "styles", "classNames", "font", "onClick"];
1
+ const _excluded = ["as", "alignItems", "width", "height", "compact", "gap", "start", "end", "paddingX", "paddingY", "padding", "paddingTop", "paddingBottom", "paddingStart", "paddingEnd", "justifyContent", "children", "maxWidth", "invertColorScheme", "inverted", "numberOfLines", "testID", "contentStyle", "borderRadius", "background", "style", "className", "styles", "classNames", "font", "color", "onClick"];
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; }
@@ -53,6 +53,7 @@ export const Chip = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Chip(_ref
53
53
  styles,
54
54
  classNames,
55
55
  font = compact ? 'label1' : 'headline',
56
+ color = 'fg',
56
57
  onClick
57
58
  } = _ref,
58
59
  props = _objectWithoutProperties(_ref, _excluded);
@@ -83,16 +84,18 @@ export const Chip = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Chip(_ref
83
84
  paddingY: paddingY,
84
85
  style: _objectSpread(_objectSpread({}, contentStyle), styles === null || styles === void 0 ? void 0 : styles.content),
85
86
  children: [start, typeof children === 'string' ? /*#__PURE__*/_jsx(Text, {
87
+ color: color,
86
88
  flexShrink: 1,
87
89
  font: font,
88
90
  numberOfLines: numberOfLines,
89
91
  children: children
90
92
  }) : children ? /*#__PURE__*/_jsx(Box, {
93
+ color: color,
91
94
  flexShrink: 1,
92
95
  children: children
93
96
  }) : null, end]
94
97
  });
95
- }, [alignItems, classNames === null || classNames === void 0 ? void 0 : classNames.content, gap, justifyContent, maxWidth, padding, paddingBottom, paddingEnd, paddingStart, paddingTop, paddingX, paddingY, contentStyle, styles === null || styles === void 0 ? void 0 : styles.content, start, children, font, numberOfLines, end]);
98
+ }, [alignItems, classNames === null || classNames === void 0 ? void 0 : classNames.content, gap, justifyContent, maxWidth, padding, paddingBottom, paddingEnd, paddingStart, paddingTop, paddingX, paddingY, contentStyle, styles === null || styles === void 0 ? void 0 : styles.content, start, children, color, font, numberOfLines, end]);
96
99
  return /*#__PURE__*/_jsx(WrapperComponent, _objectSpread(_objectSpread({}, inverted ? {
97
100
  display: 'content'
98
101
  } : {}), {}, {
@@ -14,6 +14,16 @@ import { AnimatedCaret } from '../motion/AnimatedCaret';
14
14
  import { MediaChip } from './MediaChip';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  export const SELECT_CHIP_DEFAULT_TEST_ID = 'select-chip';
17
+
18
+ /**
19
+ * @deprecated This component is deprecated. Please use the new SelectChip alpha component instead.
20
+ * @see {@link @coinbase/cds-web/alpha/select-chip/SelectChip}
21
+ */
22
+
23
+ /**
24
+ * @deprecated This component is deprecated. Please use the new SelectChip alpha component instead.
25
+ * @see {@link @coinbase/cds-web/alpha/select-chip/SelectChip}
26
+ */
17
27
  export const SelectChip = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function SelectChip(_ref, ref) {
18
28
  var _ref2;
19
29
  let {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-web",
3
- "version": "8.25.1",
3
+ "version": "8.27.0",
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.25.1",
150
+ "@coinbase/cds-common": "^8.27.0",
151
151
  "@coinbase/cds-icons": "^5.7.0",
152
152
  "@coinbase/cds-illustrations": "^4.28.0",
153
153
  "@coinbase/cds-lottie-files": "^3.3.3",