@coinbase/cds-web 9.15.0 → 9.17.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.
- package/CHANGELOG.md +12 -0
- package/dts/alpha/select-chip/SelectChip.d.ts +6 -12
- package/dts/alpha/select-chip/SelectChip.d.ts.map +1 -1
- package/dts/alpha/select-chip/SelectChipControl.d.ts +50 -5
- package/dts/alpha/select-chip/SelectChipControl.d.ts.map +1 -1
- package/dts/alpha/select-chip/index.d.ts +1 -1
- package/dts/alpha/select-chip/index.d.ts.map +1 -1
- package/dts/alpha/tabbed-chips/TabbedChips.d.ts +4 -1
- package/dts/alpha/tabbed-chips/TabbedChips.d.ts.map +1 -1
- package/dts/chips/Chip.d.ts.map +1 -1
- package/dts/chips/ChipProps.d.ts +36 -2
- package/dts/chips/ChipProps.d.ts.map +1 -1
- package/dts/chips/InputChip.d.ts.map +1 -1
- package/dts/visualizations/chart/utils/bar.d.ts.map +1 -1
- package/dts/visualizations/chart/utils/gradient.d.ts +9 -0
- package/dts/visualizations/chart/utils/gradient.d.ts.map +1 -1
- package/esm/alpha/select-chip/SelectChip.js +58 -29
- package/esm/alpha/select-chip/SelectChipControl.js +41 -11
- package/esm/alpha/select-chip/index.js +1 -1
- package/esm/alpha/tabbed-chips/TabbedChips.js +3 -2
- package/esm/chips/Chip.js +15 -7
- package/esm/chips/InputChip.js +25 -6
- package/esm/visualizations/chart/utils/bar.js +8 -2
- package/esm/visualizations/chart/utils/gradient.js +60 -27
- package/package.json +3 -3
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
|
+
## 9.17.0 (8/14/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🚀 Updates
|
|
14
|
+
|
|
15
|
+
- Feat: support charts gradients for bars. [[#844](https://github.com/coinbase/cds/pull/844)]
|
|
16
|
+
|
|
17
|
+
## 9.16.0 (8/13/2026 PST)
|
|
18
|
+
|
|
19
|
+
#### 🚀 Updates
|
|
20
|
+
|
|
21
|
+
- Deprecate invertColorScheme in favor of new, canoncical active prop for the Chip family of props. [[#843](https://github.com/coinbase/cds/pull/843)]
|
|
22
|
+
|
|
11
23
|
## 9.15.0 (8/11/2026 PST)
|
|
12
24
|
|
|
13
25
|
#### 🚀 Updates
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ChipBaseProps } from '../../chips/ChipProps';
|
|
3
2
|
import { type SelectRef } from '../select/Select';
|
|
4
3
|
import type { SelectProps, SelectType } from '../select/types';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
'invertColorScheme' | 'numberOfLines' | 'maxWidth' | 'size' | 'compact'
|
|
8
|
-
> & {
|
|
9
|
-
/**
|
|
10
|
-
* Override the displayed value in the chip control.
|
|
11
|
-
* Useful for avoiding truncation, especially in multi-select scenarios where multiple option labels might be too long to display.
|
|
12
|
-
* When provided, this value takes precedence over the default label generation.
|
|
13
|
-
*/
|
|
14
|
-
displayValue?: React.ReactNode;
|
|
15
|
-
};
|
|
4
|
+
import { type SelectChipControlChipProps, type SelectChipControlProps } from './SelectChipControl';
|
|
5
|
+
export type SelectChipBaseProps = Pick<SelectChipControlProps, keyof SelectChipControlChipProps>;
|
|
16
6
|
export type SelectChipProps<
|
|
17
7
|
Type extends SelectType = 'single',
|
|
18
8
|
SelectOptionValue extends string = string,
|
|
@@ -26,6 +16,10 @@ export type SelectChipProps<
|
|
|
26
16
|
| 'maxWidth'
|
|
27
17
|
| 'size'
|
|
28
18
|
| 'compact'
|
|
19
|
+
| 'bordered'
|
|
20
|
+
| 'borderWidth'
|
|
21
|
+
| 'borderColor'
|
|
22
|
+
| 'borderRadius'
|
|
29
23
|
>;
|
|
30
24
|
export declare const SelectChip: <
|
|
31
25
|
Type extends SelectType = 'single',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectChip.d.ts","sourceRoot":"","sources":["../../../src/alpha/select-chip/SelectChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectChip.d.ts","sourceRoot":"","sources":["../../../src/alpha/select-chip/SelectChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAIzD,OAAO,EAAU,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAsB,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEnF,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,sBAAsB,EAAE,MAAM,0BAA0B,CAAC,CAAC;AAEjG,MAAM,MAAM,eAAe,CACzB,IAAI,SAAS,UAAU,GAAG,QAAQ,EAClC,iBAAiB,SAAS,MAAM,GAAG,MAAM,IACvC,mBAAmB,GACrB,IAAI,CACF,WAAW,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAClC,wBAAwB,GACxB,YAAY,GACZ,cAAc,GACd,SAAS,GACT,UAAU,GACV,MAAM,GACN,SAAS,GACT,UAAU,GACV,aAAa,GACb,aAAa,GACb,cAAc,CACjB,CAAC;AAuIJ,eAAO,MAAM,UAAU,EAA0B,CAC/C,IAAI,SAAS,UAAU,GAAG,QAAQ,EAClC,iBAAiB,SAAS,MAAM,GAAG,MAAM,EAEzC,KAAK,EAAE,eAAe,CAAC,IAAI,EAAE,iBAAiB,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;CAAE,KAC7E,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -1,13 +1,58 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ChipBaseProps } from '../../chips/ChipProps';
|
|
2
3
|
import { type SelectControlProps, type SelectType } from '../select/types';
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Chip props accepted by {@link SelectChipControl} and forwarded to {@link MediaChip}.
|
|
6
|
+
* Includes selection state, layout, borders, and `displayValue` for the control label.
|
|
7
|
+
*/
|
|
8
|
+
export type SelectChipControlChipProps = Pick<
|
|
9
|
+
ChipBaseProps,
|
|
10
|
+
| 'active'
|
|
11
|
+
| 'activeBackground'
|
|
12
|
+
| 'activeColor'
|
|
13
|
+
| 'background'
|
|
14
|
+
| 'color'
|
|
15
|
+
| 'invertColorScheme'
|
|
16
|
+
| 'inverted'
|
|
17
|
+
| 'numberOfLines'
|
|
18
|
+
| 'maxWidth'
|
|
19
|
+
| 'size'
|
|
20
|
+
| 'compact'
|
|
21
|
+
| 'borderWidth'
|
|
22
|
+
| 'borderColor'
|
|
23
|
+
| 'bordered'
|
|
24
|
+
| 'borderRadius'
|
|
25
|
+
> & {
|
|
26
|
+
/**
|
|
27
|
+
* Override the displayed value in the chip control.
|
|
28
|
+
* Useful for avoiding truncation, especially in multi-select scenarios where multiple option labels might be too long to display.
|
|
29
|
+
* When provided, this value takes precedence over the default label generation.
|
|
30
|
+
*/
|
|
31
|
+
displayValue?: React.ReactNode;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* SelectControlProps fields superseded by {@link SelectChipControlChipProps}.
|
|
35
|
+
* Omit is required: intersection would merge overlapping keys (e.g. `size` as SelectSize &
|
|
36
|
+
* ChipSize, `background` as responsive Box vs chip tokens) instead of replacing select-scale
|
|
37
|
+
* definitions.
|
|
38
|
+
*/
|
|
39
|
+
type SelectControlPropsReplacedByChipProps = keyof Pick<
|
|
40
|
+
SelectControlProps,
|
|
41
|
+
'size' | 'compact' | 'borderWidth' | 'borderColor' | 'bordered' | 'borderRadius'
|
|
42
|
+
>;
|
|
43
|
+
export type SelectChipControlProps<
|
|
44
|
+
Type extends SelectType = 'single',
|
|
45
|
+
SelectOptionValue extends string = string,
|
|
46
|
+
> = Omit<SelectControlProps<Type, SelectOptionValue>, SelectControlPropsReplacedByChipProps> &
|
|
47
|
+
SelectChipControlChipProps;
|
|
48
|
+
/** Generic memo components need an explicit cast for the public polymorphic signature. */
|
|
4
49
|
export declare const SelectChipControl: <
|
|
5
50
|
Type extends SelectType,
|
|
6
51
|
SelectOptionValue extends string = string,
|
|
7
52
|
>(
|
|
8
|
-
props:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
53
|
+
props: SelectChipControlProps<Type, SelectOptionValue> & {
|
|
54
|
+
ref?: React.Ref<HTMLElement>;
|
|
55
|
+
},
|
|
12
56
|
) => React.ReactElement;
|
|
57
|
+
export {};
|
|
13
58
|
//# sourceMappingURL=SelectChipControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectChipControl.d.ts","sourceRoot":"","sources":["../../../src/alpha/select-chip/SelectChipControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectChipControl.d.ts","sourceRoot":"","sources":["../../../src/alpha/select-chip/SelectChipControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,aAAa,EACX,QAAQ,GACR,kBAAkB,GAClB,aAAa,GACb,YAAY,GACZ,OAAO,GACP,mBAAmB,GACnB,UAAU,GACV,eAAe,GACf,UAAU,GACV,MAAM,GACN,SAAS,GACT,aAAa,GACb,aAAa,GACb,UAAU,GACV,cAAc,CACjB,GAAG;IACF;;;;OAIG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC,CAAC;AAEF;;;;;GAKG;AACH,KAAK,qCAAqC,GAAG,MAAM,IAAI,CACrD,kBAAkB,EAClB,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,cAAc,CACjF,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAChC,IAAI,SAAS,UAAU,GAAG,QAAQ,EAClC,iBAAiB,SAAS,MAAM,GAAG,MAAM,IACvC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,qCAAqC,CAAC,GAC1F,0BAA0B,CAAC;AA0K7B,0FAA0F;AAC1F,eAAO,MAAM,iBAAiB,EAAiC,CAC7D,IAAI,SAAS,UAAU,EACvB,iBAAiB,SAAS,MAAM,GAAG,MAAM,EAEzC,KAAK,EAAE,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,CAAC,GAAG;IACvD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B,KACE,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/alpha/select-chip/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/alpha/select-chip/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -15,11 +15,14 @@ export type TabbedChipProps<TabId extends string = string> = Omit<
|
|
|
15
15
|
Component?: React.FC<Omit<ChipProps, 'children'> & TabValue<TabId>>;
|
|
16
16
|
/**
|
|
17
17
|
* Custom background color applied to the chip when it is the active tab.
|
|
18
|
-
*
|
|
18
|
+
* Skips color-scheme inversion and paints this token directly. Any `start`,
|
|
19
|
+
* `end`, or custom tab content must set explicit colors to match.
|
|
19
20
|
*/
|
|
20
21
|
activeBackground?: MediaChipBaseProps['background'];
|
|
21
22
|
/**
|
|
22
23
|
* Custom foreground color applied to the chip label when it is the active tab.
|
|
24
|
+
* Skips color-scheme inversion when set. Any `start`, `end`, or custom tab
|
|
25
|
+
* content must set explicit colors to match.
|
|
23
26
|
*/
|
|
24
27
|
activeColor?: MediaChipBaseProps['color'];
|
|
25
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabbedChips.d.ts","sourceRoot":"","sources":["../../../src/alpha/tabbed-chips/TabbedChips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8E,MAAM,OAAO,CAAC;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAG1E,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAa,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI3E,OAAO,EAAU,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE1F,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"TabbedChips.d.ts","sourceRoot":"","sources":["../../../src/alpha/tabbed-chips/TabbedChips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8E,MAAM,OAAO,CAAC;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;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E,KAAK,CAAC,YAAY,CAAC;AA+GxB,eAAO,MAAM,WAAW,EAA2B,aAAa,CAAC"}
|
package/dts/chips/Chip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../src/chips/Chip.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvD,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AAqBpC;;;;GAIG;AACH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../src/chips/Chip.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvD,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AAqBpC;;;;GAIG;AACH,eAAO,MAAM,IAAI,4JAiJhB,CAAC"}
|
package/dts/chips/ChipProps.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
1
2
|
import type { SharedAccessibilityProps } from '@coinbase/cds-common/types/SharedAccessibilityProps';
|
|
2
3
|
import type { SharedProps } from '@coinbase/cds-common/types/SharedProps';
|
|
4
|
+
import type { StyleProps } from '../styles/styleProps';
|
|
3
5
|
import type {
|
|
4
6
|
PressableBaseProps,
|
|
5
7
|
PressableDefaultElement,
|
|
@@ -30,18 +32,50 @@ export type ChipBaseProps = SharedProps &
|
|
|
30
32
|
* @default 200
|
|
31
33
|
*/
|
|
32
34
|
maxWidth?: PressableBaseProps['maxWidth'];
|
|
35
|
+
/**
|
|
36
|
+
* When true, emphasizes the Chip with higher contrast by inverting the color
|
|
37
|
+
* scheme for everything rendered inside the Chip — including `background`,
|
|
38
|
+
* `color`, icons, and other token-based colors. Those props are resolved
|
|
39
|
+
* against the opposite color scheme, matching the legacy `invertColorScheme`
|
|
40
|
+
* behavior.
|
|
41
|
+
*
|
|
42
|
+
* Set `activeBackground` and/or `activeColor` to opt out of inversion and
|
|
43
|
+
* paint explicit active colors instead.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
active?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Background color applied when `active` is true. When set, the Chip skips
|
|
49
|
+
* color-scheme inversion and uses this token directly.
|
|
50
|
+
*
|
|
51
|
+
* **Warning:** `start`, `end`, and `children` ReactNodes are not updated
|
|
52
|
+
* automatically — pass explicit `color` props on nested icons and other
|
|
53
|
+
* content so they match the active palette.
|
|
54
|
+
*/
|
|
55
|
+
activeBackground?: ThemeVars.Color;
|
|
56
|
+
/**
|
|
57
|
+
* Foreground color applied when `active` is true. When set, the Chip skips
|
|
58
|
+
* color-scheme inversion and uses this token for string labels.
|
|
59
|
+
*
|
|
60
|
+
* **Warning:** `start`, `end`, and `children` ReactNodes are not updated
|
|
61
|
+
* automatically — pass explicit `color` props on nested icons and other
|
|
62
|
+
* content so they match the active palette.
|
|
63
|
+
*/
|
|
64
|
+
activeColor?: StyleProps['color'];
|
|
33
65
|
/**
|
|
34
66
|
* Invert the foreground and background colors to emphasize the Chip.
|
|
35
67
|
* Depending on your theme, it may be dangerous to use this prop in conjunction with `transparentWhileInactive`.
|
|
36
68
|
* @default false
|
|
37
|
-
* @deprecated Use the
|
|
38
|
-
* @deprecationExpectedRemoval
|
|
69
|
+
* @deprecated Use the `active` prop instead. This will be removed in a future major release.
|
|
70
|
+
* @deprecationExpectedRemoval v11
|
|
39
71
|
*/
|
|
40
72
|
inverted?: boolean;
|
|
41
73
|
/**
|
|
42
74
|
* Invert the foreground and background colors to emphasize the Chip.
|
|
43
75
|
* Depending on your theme, it may be dangerous to use this prop in conjunction with `transparentWhileInactive`.
|
|
44
76
|
* @default false
|
|
77
|
+
* @deprecated Use the `active` prop instead. This will be removed in a future major release.
|
|
78
|
+
* @deprecationExpectedRemoval v11
|
|
45
79
|
*/
|
|
46
80
|
invertColorScheme?: boolean;
|
|
47
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipProps.d.ts","sourceRoot":"","sources":["../../src/chips/ChipProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,GAAG,CAAC;AAElC,MAAM,MAAM,aAAa,GAAG,WAAW,GACrC,IAAI,CACF,cAAc,CAAC,uBAAuB,CAAC,EACrC,UAAU,GACV,SAAS,GACT,OAAO,GACP,eAAe,GACf,mBAAmB,GACnB,yBAAyB,GACzB,UAAU,GACV,OAAO,CACV,GACD,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,GAAG;IACrD,iDAAiD;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,wCAAwC;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"ChipProps.d.ts","sourceRoot":"","sources":["../../src/chips/ChipProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCA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AAkE;IAClE,MAAM,CAAC,EAAE;QACP,mBAAmB;QACnB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC3B,sBAAsB;QACtB,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC/B,CAAC;IACF,uEAAuE;IACvE,UAAU,CAAC,EAAE;QACX,mBAAmB;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,sBAAsB;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEJ,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC;AAEtC,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,SAAS,GAAG;IACV;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputChip.d.ts","sourceRoot":"","sources":["../../src/chips/InputChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAKhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"InputChip.d.ts","sourceRoot":"","sources":["../../src/chips/InputChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAKhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,SAAS,kGA8CrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/utils/bar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,E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AAM;IACd,8FAA8F;eACnF,CAAC,MAAM,EAAE,MAAM,CAAC;IAC3B,yEAAyE;qBACxD,OAAO;IAm7BzB"}
|
|
@@ -49,6 +49,15 @@ export declare const evaluateGradientAtValue: (
|
|
|
49
49
|
dataValue: number,
|
|
50
50
|
scale: ChartScaleFunction,
|
|
51
51
|
) => string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Evaluates the opacity at a specific data value based on gradient stops.
|
|
54
|
+
* Returns undefined when no stops define opacity.
|
|
55
|
+
*/
|
|
56
|
+
export declare const evaluateGradientOpacityAtValue: (
|
|
57
|
+
stops: GradientStop[],
|
|
58
|
+
dataValue: number,
|
|
59
|
+
scale: ChartScaleFunction,
|
|
60
|
+
) => number | undefined;
|
|
52
61
|
/**
|
|
53
62
|
* Creates a gradient configuration for SVG components.
|
|
54
63
|
* Processes a GradientDefinition into a renderable GradientConfig.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradient.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/utils/gradient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,SAAS,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACjB;;;OAGG;IACH,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,YAAY,EAA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B,KACxB,MAAM,GAAG,SAcX,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,kBAAkB,EAC5B,QAAQ,kBAAkB,EAC1B,QAAQ,kBAAkB,EAC1B,SAAQ,oBAAiC,KACxC,YAAY,EAAE,GAAG,SAsBnB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,YAAY,UAAU,EAAE,WAAU,MAAU,KAAG,MAc1E,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GACzB,YAAY,UAAU,EACtB,eAAe,MAAM,EACrB,MAAM,MAAM,EACZ,aAAa,MAAM,EACnB,iBAAiB,MAAM,EACvB,OAAM,GAAG,GAAG,GAAS,KACpB,kBA0BF,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const _excluded = ["
|
|
1
|
+
const _excluded = ["active", "invertColorScheme", "inverted", "value"],
|
|
2
|
+
_excluded2 = ["active", "activeBackground", "activeColor", "background", "color", "numberOfLines", "maxWidth", "displayValue", "size", "compact", "borderWidth", "borderColor", "bordered", "borderRadius", "invertColorScheme", "inverted"];
|
|
2
3
|
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
4
|
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
5
|
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; }
|
|
@@ -7,33 +8,22 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
7
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
8
9
|
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
10
|
import React, { forwardRef, memo, useMemo } from 'react';
|
|
11
|
+
import { getSelectChipActive } from '@coinbase/cds-common/chips/getSelectChipActive';
|
|
10
12
|
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
11
13
|
import { Select } from '../select/Select';
|
|
12
14
|
import { SelectChipControl } from './SelectChipControl';
|
|
13
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
16
|
/**
|
|
15
|
-
* Creates a wrapper component that injects
|
|
16
|
-
*
|
|
17
|
-
*
|
|
17
|
+
* Creates a wrapper component that injects chip-specific props into SelectChipControl.
|
|
18
|
+
* Select only forwards generic control props to `SelectControlComponent`; chip styling
|
|
19
|
+
* and `active` are owned by SelectChip and must be closed over here.
|
|
18
20
|
*/
|
|
19
|
-
function createSelectChipControlWrapper(
|
|
20
|
-
let {
|
|
21
|
-
invertColorScheme,
|
|
22
|
-
numberOfLines,
|
|
23
|
-
maxWidth,
|
|
24
|
-
displayValue,
|
|
25
|
-
size,
|
|
26
|
-
compact
|
|
27
|
-
} = _ref;
|
|
21
|
+
function createSelectChipControlWrapper(chipProps) {
|
|
28
22
|
return /*#__PURE__*/memo(/*#__PURE__*/forwardRef((controlProps, controlRef) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
invertColorScheme: invertColorScheme,
|
|
34
|
-
maxWidth: maxWidth,
|
|
35
|
-
numberOfLines: numberOfLines,
|
|
36
|
-
size: size
|
|
23
|
+
// Chip props are spread last so they win at runtime; the cast bridges overlapping keys
|
|
24
|
+
// (`size`, borders) where SelectControlProps and SelectChipBaseProps use different types.
|
|
25
|
+
return /*#__PURE__*/_jsx(SelectChipControl, _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, controlProps), chipProps)), {}, {
|
|
26
|
+
ref: controlRef
|
|
37
27
|
}));
|
|
38
28
|
}));
|
|
39
29
|
}
|
|
@@ -43,24 +33,63 @@ function createSelectChipControlWrapper(_ref) {
|
|
|
43
33
|
* Supports both single and multi selection via Select's `type` prop.
|
|
44
34
|
*/
|
|
45
35
|
const SelectChipComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
46
|
-
|
|
36
|
+
// Resolve `active` from instance props before config merge so state-aware resolvers
|
|
37
|
+
// (active vs inactive border styling) see the final selection state. `value` and
|
|
38
|
+
// legacy invert props are pulled out with `active` and passed back explicitly because
|
|
39
|
+
// they feed that resolution and must remain available to the config resolver input.
|
|
47
40
|
const {
|
|
41
|
+
active: activeProp,
|
|
48
42
|
invertColorScheme,
|
|
43
|
+
inverted,
|
|
44
|
+
value
|
|
45
|
+
} = _props,
|
|
46
|
+
restProps = _objectWithoutProperties(_props, _excluded);
|
|
47
|
+
const resolvedActive = getSelectChipActive(activeProp, value, invertColorScheme, inverted);
|
|
48
|
+
const mergedProps = useComponentConfig('SelectChip', _objectSpread(_objectSpread({}, restProps), {}, {
|
|
49
|
+
value,
|
|
50
|
+
active: resolvedActive,
|
|
51
|
+
invertColorScheme,
|
|
52
|
+
inverted
|
|
53
|
+
}));
|
|
54
|
+
// SelectChip composes Select + MediaChip; peel chip props off merged props so the rest
|
|
55
|
+
// can flow to `<Select>` without chip-only fields leaking into the select interface.
|
|
56
|
+
const {
|
|
57
|
+
active,
|
|
58
|
+
activeBackground,
|
|
59
|
+
activeColor,
|
|
60
|
+
background,
|
|
61
|
+
color,
|
|
49
62
|
numberOfLines,
|
|
50
63
|
maxWidth,
|
|
51
64
|
displayValue,
|
|
52
65
|
size,
|
|
53
|
-
compact
|
|
66
|
+
compact,
|
|
67
|
+
borderWidth,
|
|
68
|
+
borderColor,
|
|
69
|
+
bordered,
|
|
70
|
+
borderRadius,
|
|
71
|
+
invertColorScheme: mergedInvertColorScheme,
|
|
72
|
+
inverted: mergedInverted
|
|
54
73
|
} = mergedProps,
|
|
55
|
-
|
|
74
|
+
selectProps = _objectWithoutProperties(mergedProps, _excluded2);
|
|
56
75
|
const WrappedSelectChipControl = useMemo(() => createSelectChipControlWrapper({
|
|
57
|
-
|
|
76
|
+
active,
|
|
77
|
+
activeBackground,
|
|
78
|
+
activeColor,
|
|
79
|
+
background,
|
|
80
|
+
color,
|
|
58
81
|
numberOfLines,
|
|
59
82
|
maxWidth,
|
|
60
83
|
displayValue,
|
|
61
84
|
size,
|
|
62
|
-
compact
|
|
63
|
-
|
|
85
|
+
compact,
|
|
86
|
+
borderWidth,
|
|
87
|
+
borderColor,
|
|
88
|
+
bordered,
|
|
89
|
+
borderRadius,
|
|
90
|
+
invertColorScheme: mergedInvertColorScheme,
|
|
91
|
+
inverted: mergedInverted
|
|
92
|
+
}), [active, activeBackground, activeColor, background, color, displayValue, numberOfLines, maxWidth, size, compact, borderWidth, borderColor, bordered, borderRadius, mergedInvertColorScheme, mergedInverted]);
|
|
64
93
|
return /*#__PURE__*/_jsx(Select, _objectSpread({
|
|
65
94
|
ref: ref,
|
|
66
95
|
SelectControlComponent: WrappedSelectChipControl,
|
|
@@ -68,8 +97,8 @@ const SelectChipComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, r
|
|
|
68
97
|
dropdown: {
|
|
69
98
|
width: 'max-content'
|
|
70
99
|
}
|
|
71
|
-
},
|
|
72
|
-
},
|
|
100
|
+
}, selectProps.styles)
|
|
101
|
+
}, selectProps));
|
|
73
102
|
}));
|
|
74
103
|
SelectChipComponent.displayName = 'SelectChip';
|
|
75
104
|
export const SelectChip = SelectChipComponent;
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import React, { forwardRef, memo, useMemo } from 'react';
|
|
2
|
+
import { getSelectChipHasValue } from '@coinbase/cds-common/chips/getSelectChipActive';
|
|
2
3
|
import { MediaChip } from '../../chips/MediaChip';
|
|
3
4
|
import { AnimatedCaret } from '../../motion/AnimatedCaret';
|
|
4
5
|
import { isSelectOptionGroup } from '../select/types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Chip props accepted by {@link SelectChipControl} and forwarded to {@link MediaChip}.
|
|
9
|
+
* Includes selection state, layout, borders, and `displayValue` for the control label.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* SelectControlProps fields superseded by {@link SelectChipControlChipProps}.
|
|
14
|
+
* Omit is required: intersection would merge overlapping keys (e.g. `size` as SelectSize &
|
|
15
|
+
* ChipSize, `background` as responsive Box vs chip tokens) instead of replacing select-scale
|
|
16
|
+
* definitions.
|
|
17
|
+
*/
|
|
5
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
19
|
const SelectChipControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
7
20
|
let {
|
|
@@ -20,16 +33,26 @@ const SelectChipControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_r
|
|
|
20
33
|
maxSelectedOptionsToShow = 2,
|
|
21
34
|
hiddenSelectedOptionsLabel = 'more',
|
|
22
35
|
label,
|
|
36
|
+
disabled,
|
|
23
37
|
compact,
|
|
24
38
|
size,
|
|
39
|
+
active,
|
|
40
|
+
activeBackground,
|
|
41
|
+
activeColor,
|
|
42
|
+
background,
|
|
43
|
+
color,
|
|
25
44
|
invertColorScheme,
|
|
45
|
+
inverted,
|
|
26
46
|
numberOfLines,
|
|
27
|
-
disabled,
|
|
28
47
|
maxWidth,
|
|
29
|
-
displayValue
|
|
48
|
+
displayValue,
|
|
49
|
+
borderWidth,
|
|
50
|
+
borderColor,
|
|
51
|
+
bordered,
|
|
52
|
+
borderRadius
|
|
30
53
|
} = _ref;
|
|
31
54
|
const isMultiSelect = type === 'multi';
|
|
32
|
-
const hasValue =
|
|
55
|
+
const hasValue = getSelectChipHasValue(value);
|
|
33
56
|
|
|
34
57
|
// Map of options to their values
|
|
35
58
|
// If multiple options share the same value, the first occurrence wins (matches native HTML select behavior)
|
|
@@ -84,32 +107,36 @@ const SelectChipControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_r
|
|
|
84
107
|
const opt = optionsMap.get(value);
|
|
85
108
|
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;
|
|
86
109
|
}, [hasValue, label, placeholder, displayValue, isMultiSelect, optionsMap, value, maxSelectedOptionsToShow, hiddenSelectedOptionsLabel]);
|
|
110
|
+
const resolvedColor = active && activeColor !== undefined ? activeColor : color;
|
|
87
111
|
const endNode = useMemo(() => {
|
|
112
|
+
// Match Chip's label color. `fg` still inverts with the chip when active uses theme inversion.
|
|
88
113
|
return customEndNode !== null && customEndNode !== void 0 ? customEndNode : /*#__PURE__*/_jsx(AnimatedCaret, {
|
|
89
114
|
active: true,
|
|
90
|
-
color:
|
|
115
|
+
color: resolvedColor !== null && resolvedColor !== void 0 ? resolvedColor : 'fg',
|
|
91
116
|
rotate: open ? 0 : 180,
|
|
92
117
|
size: "xs"
|
|
93
118
|
});
|
|
94
|
-
}, [customEndNode,
|
|
95
|
-
const color = useMemo(() => {
|
|
96
|
-
return hasValue ? 'fgInverse' : 'fg';
|
|
97
|
-
}, [hasValue]);
|
|
98
|
-
const background = useMemo(() => {
|
|
99
|
-
return hasValue ? 'bgInverse' : 'bgSecondary';
|
|
100
|
-
}, [hasValue]);
|
|
119
|
+
}, [customEndNode, open, resolvedColor]);
|
|
101
120
|
return /*#__PURE__*/_jsx(MediaChip, {
|
|
102
121
|
ref: ref,
|
|
103
122
|
noScaleOnPress: true,
|
|
104
123
|
accessibilityLabel: accessibilityLabel,
|
|
124
|
+
active: active,
|
|
125
|
+
activeBackground: activeBackground,
|
|
126
|
+
activeColor: activeColor,
|
|
105
127
|
"aria-haspopup": ariaHaspopup,
|
|
106
128
|
background: background,
|
|
129
|
+
bordered: bordered,
|
|
130
|
+
borderColor: borderColor,
|
|
131
|
+
borderRadius: borderRadius,
|
|
132
|
+
borderWidth: borderWidth,
|
|
107
133
|
className: className,
|
|
108
134
|
color: color,
|
|
109
135
|
compact: compact,
|
|
110
136
|
disabled: disabled,
|
|
111
137
|
end: endNode,
|
|
112
138
|
invertColorScheme: invertColorScheme,
|
|
139
|
+
inverted: inverted,
|
|
113
140
|
maxWidth: maxWidth,
|
|
114
141
|
numberOfLines: numberOfLines,
|
|
115
142
|
onClick: () => setOpen(s => !s),
|
|
@@ -119,4 +146,7 @@ const SelectChipControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_r
|
|
|
119
146
|
children: labelContent
|
|
120
147
|
});
|
|
121
148
|
}));
|
|
149
|
+
SelectChipControlComponent.displayName = 'SelectChipControl';
|
|
150
|
+
|
|
151
|
+
/** Generic memo components need an explicit cast for the public polymorphic signature. */
|
|
122
152
|
export const SelectChipControl = SelectChipControlComponent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './SelectChip';
|
|
2
|
-
export
|
|
2
|
+
export { SelectChipControl } from './SelectChipControl';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["label", "id", "activeBackground", "activeColor", "color"],
|
|
1
|
+
const _excluded = ["label", "id", "Component", "activeBackground", "activeColor", "color"],
|
|
2
2
|
_excluded2 = ["tabs", "activeTab", "onChange", "TabComponent", "testID", "background", "gap", "previousArrowAccessibilityLabel", "nextArrowAccessibilityLabel", "width", "TabsActiveIndicatorComponent", "disabled", "compact", "size", "styles", "classNames", "autoScrollOffset"];
|
|
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; }
|
|
@@ -23,6 +23,7 @@ const DefaultTabComponent = _ref => {
|
|
|
23
23
|
let {
|
|
24
24
|
label = '',
|
|
25
25
|
id,
|
|
26
|
+
Component: _Component,
|
|
26
27
|
activeBackground,
|
|
27
28
|
activeColor,
|
|
28
29
|
color
|
|
@@ -47,10 +48,10 @@ const DefaultTabComponent = _ref => {
|
|
|
47
48
|
}, [isActive]);
|
|
48
49
|
return /*#__PURE__*/_jsx(MediaChip, _objectSpread(_objectSpread({
|
|
49
50
|
ref: chipRef,
|
|
51
|
+
active: isActive && !activeBackground,
|
|
50
52
|
"aria-selected": isActive,
|
|
51
53
|
background: isActive && activeBackground ? activeBackground : undefined,
|
|
52
54
|
color: isActive && activeColor ? activeColor : color,
|
|
53
|
-
invertColorScheme: isActive && !activeBackground,
|
|
54
55
|
onClick: handleClick,
|
|
55
56
|
role: "tab",
|
|
56
57
|
width: "max-content"
|
package/esm/chips/Chip.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["as", "alignItems", "width", "height", "compact", "size", "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"];
|
|
1
|
+
const _excluded = ["as", "alignItems", "width", "height", "compact", "size", "gap", "start", "end", "paddingX", "paddingY", "padding", "paddingTop", "paddingBottom", "paddingStart", "paddingEnd", "justifyContent", "children", "maxWidth", "active", "activeBackground", "activeColor", "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; }
|
|
@@ -64,6 +64,9 @@ export const Chip = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Chip(_pro
|
|
|
64
64
|
justifyContent,
|
|
65
65
|
children,
|
|
66
66
|
maxWidth = chipMaxWidth,
|
|
67
|
+
active = false,
|
|
68
|
+
activeBackground,
|
|
69
|
+
activeColor,
|
|
67
70
|
invertColorScheme,
|
|
68
71
|
inverted,
|
|
69
72
|
numberOfLines = 1,
|
|
@@ -80,9 +83,14 @@ export const Chip = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Chip(_pro
|
|
|
80
83
|
onClick
|
|
81
84
|
} = mergedProps,
|
|
82
85
|
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
83
|
-
const
|
|
86
|
+
const hasActiveColorOverrides = activeBackground !== undefined || activeColor !== undefined;
|
|
87
|
+
const activeUsesThemeInversion = active && !hasActiveColorOverrides;
|
|
88
|
+
const shouldInvert = Boolean(invertColorScheme !== null && invertColorScheme !== void 0 ? invertColorScheme : inverted) || activeUsesThemeInversion;
|
|
89
|
+
const WrapperComponent = shouldInvert ? InvertedThemeProvider : Fragment;
|
|
90
|
+
const resolvedBackground = active && activeBackground !== undefined ? activeBackground : background;
|
|
91
|
+
const resolvedColor = active && activeColor !== undefined ? activeColor : color;
|
|
84
92
|
const containerProps = {
|
|
85
|
-
background,
|
|
93
|
+
background: resolvedBackground,
|
|
86
94
|
borderRadius,
|
|
87
95
|
className: cx(transitionCss, className, classNames === null || classNames === void 0 ? void 0 : classNames.root),
|
|
88
96
|
style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root),
|
|
@@ -107,19 +115,19 @@ export const Chip = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Chip(_pro
|
|
|
107
115
|
paddingY: paddingY,
|
|
108
116
|
style: _objectSpread(_objectSpread({}, contentStyle), styles === null || styles === void 0 ? void 0 : styles.content),
|
|
109
117
|
children: [start, typeof children === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
110
|
-
color:
|
|
118
|
+
color: resolvedColor,
|
|
111
119
|
flexShrink: 1,
|
|
112
120
|
font: font,
|
|
113
121
|
numberOfLines: numberOfLines,
|
|
114
122
|
children: children
|
|
115
123
|
}) : children ? /*#__PURE__*/_jsx(Box, {
|
|
116
|
-
color:
|
|
124
|
+
color: resolvedColor,
|
|
117
125
|
flexShrink: 1,
|
|
118
126
|
children: children
|
|
119
127
|
}) : null, end]
|
|
120
128
|
});
|
|
121
|
-
}, [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,
|
|
122
|
-
return /*#__PURE__*/_jsx(WrapperComponent, _objectSpread(_objectSpread({}, inverted ? {
|
|
129
|
+
}, [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, resolvedColor, font, numberOfLines, end]);
|
|
130
|
+
return /*#__PURE__*/_jsx(WrapperComponent, _objectSpread(_objectSpread({}, shouldInvert && inverted ? {
|
|
123
131
|
display: 'content'
|
|
124
132
|
} : {}), {}, {
|
|
125
133
|
children: onClick ? /*#__PURE__*/_jsx(Pressable, _objectSpread(_objectSpread(_objectSpread({
|
package/esm/chips/InputChip.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const _excluded = ["
|
|
1
|
+
const _excluded = ["active", "invertColorScheme", "inverted"],
|
|
2
|
+
_excluded2 = ["value", "children", "accessibilityLabel", "testID", "active", "invertColorScheme", "inverted"];
|
|
2
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; }
|
|
3
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; }
|
|
4
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; }
|
|
@@ -12,18 +13,34 @@ import { Icon } from '../icons/Icon';
|
|
|
12
13
|
import { MediaChip } from './MediaChip';
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
export const InputChip = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
15
|
-
const
|
|
16
|
+
const {
|
|
17
|
+
active: activeProp,
|
|
18
|
+
invertColorScheme,
|
|
19
|
+
inverted
|
|
20
|
+
} = _props,
|
|
21
|
+
restProps = _objectWithoutProperties(_props, _excluded);
|
|
22
|
+
// Default before component config so state-aware resolvers (active borders) see the
|
|
23
|
+
// same active semantics as the rendered chip.
|
|
24
|
+
const active = activeProp !== null && activeProp !== void 0 ? activeProp : invertColorScheme === undefined && inverted === undefined ? true : false;
|
|
25
|
+
const mergedProps = useComponentConfig('InputChip', _objectSpread(_objectSpread({}, restProps), {}, {
|
|
26
|
+
active,
|
|
27
|
+
invertColorScheme,
|
|
28
|
+
inverted
|
|
29
|
+
}));
|
|
16
30
|
const {
|
|
17
31
|
value,
|
|
18
32
|
children = value,
|
|
19
33
|
accessibilityLabel = typeof children === 'string' ? "Remove ".concat(children) : 'Remove option',
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
testID = 'input-chip',
|
|
35
|
+
active: _active,
|
|
36
|
+
invertColorScheme: mergedInvertColorScheme,
|
|
37
|
+
inverted: mergedInverted
|
|
22
38
|
} = mergedProps,
|
|
23
|
-
props = _objectWithoutProperties(mergedProps,
|
|
39
|
+
props = _objectWithoutProperties(mergedProps, _excluded2);
|
|
24
40
|
return /*#__PURE__*/_jsx(MediaChip, _objectSpread(_objectSpread({
|
|
25
41
|
ref: ref,
|
|
26
42
|
accessibilityLabel: accessibilityLabel,
|
|
43
|
+
active: active,
|
|
27
44
|
end: /*#__PURE__*/_jsx(Icon, {
|
|
28
45
|
active: true,
|
|
29
46
|
color: "fg",
|
|
@@ -31,7 +48,9 @@ export const InputChip = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref)
|
|
|
31
48
|
size: "xs",
|
|
32
49
|
testID: testID ? "".concat(testID, "-close-icon") : 'input-chip-close-icon'
|
|
33
50
|
}),
|
|
34
|
-
invertColorScheme:
|
|
51
|
+
invertColorScheme: mergedInvertColorScheme,
|
|
52
|
+
inverted: mergedInverted,
|
|
53
|
+
testID: testID
|
|
35
54
|
}, props), {}, {
|
|
36
55
|
children: children
|
|
37
56
|
}));
|
|
@@ -7,7 +7,7 @@ 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 { defaultAxisId as fallbackAxisId } from './axis';
|
|
10
|
-
import { evaluateGradientAtValue } from './gradient';
|
|
10
|
+
import { evaluateGradientAtValue, evaluateGradientOpacityAtValue } from './gradient';
|
|
11
11
|
import { defaultTransition } from './transition';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -869,6 +869,7 @@ export function getBars(params) {
|
|
|
869
869
|
// Skip bars that would have zero or negative height
|
|
870
870
|
if (length <= 0) return;
|
|
871
871
|
let barFill = (_s$color = s.color) !== null && _s$color !== void 0 ? _s$color : defaultFill;
|
|
872
|
+
let barFillOpacity = defaultFillOpacity;
|
|
872
873
|
|
|
873
874
|
// Evaluate gradient if provided (using precomputed stops)
|
|
874
875
|
const seriesGradientConfig = seriesGradients.find(g => (g === null || g === void 0 ? void 0 : g.seriesId) === s.id);
|
|
@@ -887,6 +888,10 @@ export function getBars(params) {
|
|
|
887
888
|
if (evaluatedColor) {
|
|
888
889
|
barFill = evaluatedColor;
|
|
889
890
|
}
|
|
891
|
+
const evaluatedOpacity = evaluateGradientOpacityAtValue(seriesGradientConfig.stops, evalValue, seriesGradientConfig.scale);
|
|
892
|
+
if (evaluatedOpacity !== undefined) {
|
|
893
|
+
barFillOpacity = defaultFillOpacity !== undefined ? defaultFillOpacity * evaluatedOpacity : evaluatedOpacity;
|
|
894
|
+
}
|
|
890
895
|
}
|
|
891
896
|
allBars.push({
|
|
892
897
|
seriesId: s.id,
|
|
@@ -894,6 +899,7 @@ export function getBars(params) {
|
|
|
894
899
|
length,
|
|
895
900
|
dataValue: value,
|
|
896
901
|
fill: barFill,
|
|
902
|
+
fillOpacity: barFillOpacity,
|
|
897
903
|
roundTop,
|
|
898
904
|
roundBottom,
|
|
899
905
|
shouldApplyGap,
|
|
@@ -943,7 +949,7 @@ export function getBars(params) {
|
|
|
943
949
|
dataY: layout === 'vertical' ? bar.dataValue : categoryValue,
|
|
944
950
|
origin: barOrigins[i],
|
|
945
951
|
borderRadius,
|
|
946
|
-
fillOpacity:
|
|
952
|
+
fillOpacity: bar.fillOpacity,
|
|
947
953
|
stroke: defaultStroke,
|
|
948
954
|
strokeWidth: defaultStrokeWidth,
|
|
949
955
|
minSize: initialBarMinSizes[i],
|
|
@@ -63,21 +63,15 @@ const processGradientStops = (stops, scale) => {
|
|
|
63
63
|
}).sort((a, b) => a.offset - b.offset);
|
|
64
64
|
return normalizedStops;
|
|
65
65
|
};
|
|
66
|
+
const GRADIENT_OFFSET_EPSILON = 1e-10;
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* @param dataValue - The data value to evaluate (for band scales, this is the index)
|
|
71
|
-
* @param scale - The scale to use for value mapping (handles log scales correctly)
|
|
72
|
-
* @returns The color string at this data value, or undefined if invalid
|
|
69
|
+
* Returns stop indices and blend progress for a data value.
|
|
70
|
+
* When startIndex === endIndex, use that stop directly; otherwise blend with t.
|
|
73
71
|
*/
|
|
74
|
-
|
|
72
|
+
const getGradientStopInterpolation = (stops, dataValue, scale) => {
|
|
75
73
|
if (stops.length === 0) return;
|
|
76
74
|
|
|
77
|
-
// Use srgb color space to match our linearGradient which uses srgb color space
|
|
78
|
-
// https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty
|
|
79
|
-
const colorSpace = 'srgb';
|
|
80
|
-
|
|
81
75
|
// Use scale to map values to positions (handles log scales correctly)
|
|
82
76
|
// For numeric scales: scale(value) returns pixel position
|
|
83
77
|
// We normalize these positions to 0-1 based on the range
|
|
@@ -85,11 +79,11 @@ export const evaluateGradientAtValue = (stops, dataValue, scale) => {
|
|
|
85
79
|
const [rangeMin, rangeMax] = Array.isArray(scaleRange) ? scaleRange : [scaleRange, scaleRange]; // fallback for band scales
|
|
86
80
|
|
|
87
81
|
const rangeSpan = Math.abs(rangeMax - rangeMin);
|
|
88
|
-
if (rangeSpan === 0) return
|
|
82
|
+
if (rangeSpan === 0) return [0, 0, 0];
|
|
89
83
|
|
|
90
84
|
// Map dataValue through scale to get position
|
|
91
85
|
const dataPosition = scale(dataValue);
|
|
92
|
-
if (dataPosition === undefined) return
|
|
86
|
+
if (dataPosition === undefined) return [0, 0, 0];
|
|
93
87
|
|
|
94
88
|
// Normalize to 0-1 based on range
|
|
95
89
|
const normalizedValue = Math.max(0, Math.min(1, Math.abs(dataPosition - rangeMin) / rangeSpan));
|
|
@@ -98,38 +92,77 @@ export const evaluateGradientAtValue = (stops, dataValue, scale) => {
|
|
|
98
92
|
const positions = stops.map(stop => stop.offset);
|
|
99
93
|
|
|
100
94
|
// Find which segment we're in
|
|
101
|
-
if (normalizedValue < positions[0])
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (normalizedValue >= positions[positions.length - 1]) {
|
|
105
|
-
return stops[stops.length - 1].color;
|
|
106
|
-
}
|
|
95
|
+
if (normalizedValue < positions[0]) return [0, 0, 0];
|
|
96
|
+
const lastIndex = stops.length - 1;
|
|
97
|
+
if (normalizedValue >= positions[lastIndex]) return [lastIndex, lastIndex, 0];
|
|
107
98
|
|
|
108
99
|
// Check if normalizedValue matches any stop offset exactly (for hard transitions)
|
|
109
100
|
for (let i = 0; i < stops.length; i++) {
|
|
110
|
-
if (Math.abs(normalizedValue - stops[i].offset) <
|
|
101
|
+
if (Math.abs(normalizedValue - stops[i].offset) < GRADIENT_OFFSET_EPSILON) {
|
|
111
102
|
// Found exact match - check if there are multiple stops at this offset (hard transition)
|
|
112
|
-
// Use the LAST
|
|
103
|
+
// Use the LAST stop at this offset for hard transitions
|
|
113
104
|
let lastIndexAtOffset = i;
|
|
114
|
-
while (lastIndexAtOffset + 1 < stops.length && Math.abs(stops[lastIndexAtOffset + 1].offset - stops[i].offset) <
|
|
105
|
+
while (lastIndexAtOffset + 1 < stops.length && Math.abs(stops[lastIndexAtOffset + 1].offset - stops[i].offset) < GRADIENT_OFFSET_EPSILON) {
|
|
115
106
|
lastIndexAtOffset++;
|
|
116
107
|
}
|
|
117
|
-
return
|
|
108
|
+
return [lastIndexAtOffset, lastIndexAtOffset, 0];
|
|
118
109
|
}
|
|
119
110
|
}
|
|
120
111
|
|
|
121
|
-
// Find the two
|
|
112
|
+
// Find the two stops to mix based on normalized positions
|
|
122
113
|
for (let i = 0; i < positions.length - 1; i++) {
|
|
123
114
|
const start = positions[i];
|
|
124
115
|
const end = positions[i + 1];
|
|
125
116
|
if (normalizedValue >= start && normalizedValue <= end) {
|
|
126
|
-
|
|
127
|
-
|
|
117
|
+
if (end === start) return [i, i, 0];
|
|
118
|
+
const t = (normalizedValue - start) / (end - start);
|
|
119
|
+
return [i, i + 1, t];
|
|
128
120
|
}
|
|
129
121
|
}
|
|
130
122
|
|
|
131
|
-
// If we didn't reach any to be mixed, return the last
|
|
132
|
-
return
|
|
123
|
+
// If we didn't reach any to be mixed, return the last stop
|
|
124
|
+
return [lastIndex, lastIndex, 0];
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Evaluates the color at a specific data value based on the gradient stops, ignoring opacity.
|
|
129
|
+
* @param stops - The gradient stops configuration
|
|
130
|
+
* @param dataValue - The data value to evaluate (for band scales, this is the index)
|
|
131
|
+
* @param scale - The scale to use for value mapping (handles log scales correctly)
|
|
132
|
+
* @returns The color string at this data value, or undefined if invalid
|
|
133
|
+
*/
|
|
134
|
+
export const evaluateGradientAtValue = (stops, dataValue, scale) => {
|
|
135
|
+
const interpolation = getGradientStopInterpolation(stops, dataValue, scale);
|
|
136
|
+
if (!interpolation) return;
|
|
137
|
+
const [startIndex, endIndex, t] = interpolation;
|
|
138
|
+
|
|
139
|
+
// Use srgb color space to match our linearGradient which uses srgb color space
|
|
140
|
+
// https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty
|
|
141
|
+
const colorSpace = 'srgb';
|
|
142
|
+
if (startIndex === endIndex) return stops[startIndex].color;
|
|
143
|
+
|
|
144
|
+
// Mix colors between the resolved stops
|
|
145
|
+
return "color-mix(in ".concat(colorSpace, ", ").concat(stops[endIndex].color, " ").concat(t * 100, "%, ").concat(stops[startIndex].color, ")");
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Evaluates the opacity at a specific data value based on gradient stops.
|
|
150
|
+
* Returns undefined when no stops define opacity.
|
|
151
|
+
*/
|
|
152
|
+
export const evaluateGradientOpacityAtValue = (stops, dataValue, scale) => {
|
|
153
|
+
var _stops$startIndex$opa, _stops$endIndex$opaci;
|
|
154
|
+
if (stops.length === 0) return;
|
|
155
|
+
if (stops.every(stop => {
|
|
156
|
+
var _stop$opacity2;
|
|
157
|
+
return ((_stop$opacity2 = stop.opacity) !== null && _stop$opacity2 !== void 0 ? _stop$opacity2 : 1) === 1;
|
|
158
|
+
})) return;
|
|
159
|
+
const interpolation = getGradientStopInterpolation(stops, dataValue, scale);
|
|
160
|
+
if (!interpolation) return;
|
|
161
|
+
const [startIndex, endIndex, t] = interpolation;
|
|
162
|
+
const startOpacity = (_stops$startIndex$opa = stops[startIndex].opacity) !== null && _stops$startIndex$opa !== void 0 ? _stops$startIndex$opa : 1;
|
|
163
|
+
if (startIndex === endIndex) return startOpacity;
|
|
164
|
+
const endOpacity = (_stops$endIndex$opaci = stops[endIndex].opacity) !== null && _stops$endIndex$opaci !== void 0 ? _stops$endIndex$opaci : 1;
|
|
165
|
+
return startOpacity + (endOpacity - startOpacity) * t;
|
|
133
166
|
};
|
|
134
167
|
|
|
135
168
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-web",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.17.0",
|
|
4
4
|
"description": "Coinbase Design System - Web",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -227,9 +227,9 @@
|
|
|
227
227
|
"react-dom": "^18.0.0 || ~19.1.2"
|
|
228
228
|
},
|
|
229
229
|
"dependencies": {
|
|
230
|
-
"@coinbase/cds-common": "^9.
|
|
230
|
+
"@coinbase/cds-common": "^9.17.0",
|
|
231
231
|
"@coinbase/cds-icons": "^5.21.0",
|
|
232
|
-
"@coinbase/cds-illustrations": "^4.
|
|
232
|
+
"@coinbase/cds-illustrations": "^4.48.0",
|
|
233
233
|
"@coinbase/cds-lottie-files": "^3.3.4",
|
|
234
234
|
"@coinbase/cds-utils": "^2.3.5",
|
|
235
235
|
"@floating-ui/react-dom": "^2.1.1",
|