Skip to content

Commit c905f9f

Browse files
alisonaileabenelan
authored andcommitted
feat(chip): deprecate pressed in favor of press (#11389)
**Related Issue:** #10832 #7180 ## Summary Deprecate `--calcite-chip-select-icon-color-pressed` token. Add `--calcite-chip-select-icon-color-press: Specifies the component's selection element icon color when active.`
1 parent 4707dc3 commit c905f9f

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

packages/calcite-components/src/components/chip/chip.e2e.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ describe("calcite-chip", () => {
289289
});
290290
describe("selected", () => {
291291
themed(html`<calcite-chip selection-mode="single" selected>Layers</calcite-chip>`, {
292-
"--calcite-chip-select-icon-color-pressed": {
292+
"--calcite-chip-select-icon-color-press": {
293293
shadowSelector: `.${CSS.selectIcon}`,
294294
targetProp: "color",
295295
},
@@ -305,5 +305,14 @@ describe("calcite-chip", () => {
305305
},
306306
});
307307
});
308+
309+
describe("deprecated", () => {
310+
themed(html`<calcite-chip selection-mode="single" selected>Layers</calcite-chip>`, {
311+
"--calcite-chip-select-icon-color-pressed": {
312+
shadowSelector: `.${CSS.selectIcon}`,
313+
targetProp: "color",
314+
},
315+
});
316+
});
308317
});
309318
});

packages/calcite-components/src/components/chip/chip.scss

+8-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
*
66
* @prop --calcite-chip-background-color: Specifies the component's background color.
77
* @prop --calcite-chip-border-color: Specifies the component's border color.
8+
* @prop --calcite-chip-close-icon-color: Specifies the component's close element icon color.
89
* @prop --calcite-chip-corner-radius: Specifies the component's corner radius.
9-
* @prop --calcite-chip-text-color: Specifies the component's text color.
1010
* @prop --calcite-chip-icon-color: Specifies the component's icon color.
11-
* @prop --calcite-chip-close-icon-color: Specifies the component's close element icon color.
11+
* @prop --calcite-chip-select-icon-color-press: Specifies the component's selection element icon color when active.
12+
* @prop --calcite-chip-select-icon-color-pressed: [Deprecated] Use `--calcite-chip-select-icon-color-press`. Specifies the component's selection element icon color when active.
1213
* @prop --calcite-chip-select-icon-color: Specifies the component's selection element icon color.
13-
* @prop --calcite-chip-select-icon-color-pressed: Specifies the component's selection element icon color when active.
14+
* @prop --calcite-chip-text-color: Specifies the component's text color.
1415
*
1516
*/
1617

@@ -475,7 +476,10 @@
475476
position: relative;
476477
visibility: visible;
477478
opacity: var(--calcite-opacity-half, 0.5);
478-
color: var(--calcite-chip-select-icon-color-pressed, var(--calcite-chip-select-icon-color, currentColor));
479+
color: var(
480+
--calcite-chip-select-icon-color-press,
481+
var(--calcite-chip-select-icon-color-pressed, var(--calcite-chip-select-icon-color, currentColor))
482+
);
479483
}
480484
}
481485

packages/calcite-components/src/custom-theme/chips.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { html } from "../../support/formatting";
33
export const chipTokens = {
44
calciteChipBackgroundColor: "",
55
calciteChipBorderColor: "",
6+
calciteChipCloseIconColor: "",
67
calciteChipCornerRadius: "",
7-
calciteChipTextColor: "",
88
calciteChipIconColor: "",
9-
calciteChipCloseIconColor: "",
9+
calciteChipSelectIconColorPress: "",
1010
calciteChipSelectIconColor: "",
11-
calciteChipSelectIconColorPressed: "",
11+
calciteChipTextColor: "",
1212
};
1313

1414
export const chips = html`<div>

packages/calcite-components/src/demos/chip.html

+8-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,14 @@
9696
}
9797

9898
.themed-children-card calcite-chip:first-of-type {
99-
--calcite-color-foreground-2: rgb(222 239 220);
100-
--calcite-color-text-1: var(--calcite-color-status-success);
101-
--calcite-icon-color: var(--calcite-color-status-success);
99+
--calcite-chip-background-color: rgb(222 239 220);
100+
--calcite-chip-border-color: rgb(222 100 100);
101+
--calcite-chip-close-icon-color: var(--calcite-color-status-danger);
102+
--calcite-chip-corner-radius: 5px;
103+
--calcite-chip-icon-color: var(--calcite-color-status-success);
104+
--calcite-chip-select-icon-color-press: var(--calcite-color-status-success-press);
105+
--calcite-chip-select-icon-color: var(--calcite-color-status-success-hover);
106+
--calcite-chip-text-color: var(--calcite-color-status-success);
102107
}
103108

104109
.themed-children-card calcite-chip:nth-of-type(2) {

0 commit comments

Comments
 (0)