Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(chip): add component tokens #10179

Merged
merged 20 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9507e9a
feat(chip): refactor chip for component tokens
alisonailea Aug 27, 2024
c6d5f1b
test(chip): add component tokens to stories
alisonailea Aug 28, 2024
a7ddcc2
fix(chip): remove mouse state tokens
alisonailea Aug 28, 2024
b226cb9
test(chip): update e2e tests
alisonailea Aug 28, 2024
b052c8d
feat(chip-group): add component tokens
alisonailea Aug 28, 2024
865757a
Merge branch 'dev' of github.com:Esri/calcite-design-system into ali-…
alisonailea Aug 28, 2024
3b0ac61
Revert "feat(chip-group): add component tokens"
alisonailea Aug 30, 2024
2332a09
fix(chip): chip element spacing
alisonailea Aug 31, 2024
5fe9b0c
fix(chip): internal variables in selection states
alisonailea Sep 2, 2024
819021c
fix(chip): minor issues with spacing
alisonailea Sep 6, 2024
798c7c4
fix(chip): add chip-icon-color token
alisonailea Sep 10, 2024
f9d0ec0
fix(chip): add select and close token options
alisonailea Sep 10, 2024
b6e6c97
test(chip): simplify theme tests
alisonailea Sep 11, 2024
d9cad9a
test(chip): fix theme setup
alisonailea Sep 11, 2024
be4ac0f
Revert package.json in test(chip): simplify theme tests”
alisonailea Sep 11, 2024
a709177
refactor(chip): restore —calcite-icon-color styles
alisonailea Sep 12, 2024
89fa877
Merge branch 'dev' of github.com:Esri/calcite-design-system into ali-…
alisonailea Sep 12, 2024
a8e74a8
Merge branch 'dev' into astump/7180-chip
alisonailea Sep 13, 2024
9ce58e7
Merge branch 'dev' into astump/7180-chip
alisonailea Sep 16, 2024
fa3f3e7
chore(custom-theme): fix imports
alisonailea Sep 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* CSS Custom Properties
*
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-chip-group-items-space: Specifies spacing between items in the component.
*
*/

:host {
display: flex;
}
Expand All @@ -6,19 +15,23 @@
display: flex;
inline-size: 100%;
flex-wrap: wrap;
gap: theme("spacing.2");
gap: var(--calcite-chip-group-items-space, var(--calcite-internal-chip-group-items-space, theme("spacing.2")));
}

::slotted(calcite-chip) {
flex: none;
}

:host([scale="s"]) .container {
gap: theme("spacing.1");
--calcite-internal-chip-group-items-space: theme("spacing.1");
}

:host([scale="m"]) .container {
--calcite-internal-chip-group-items-space: theme("spacing.2");
}

:host([scale="l"]) .container {
gap: theme("spacing.3");
--calcite-internal-chip-group-items-space: theme("spacing.3");
}

@include disabled();
Expand Down
31 changes: 30 additions & 1 deletion packages/calcite-components/src/components/chip/chip.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { newE2EPage } from "@stencil/core/testing";
import { accessible, disabled, focusable, hidden, renders, slots, t9n } from "../../tests/commonTests";
import { accessible, disabled, focusable, hidden, renders, slots, t9n, themed } from "../../tests/commonTests";
import { html } from "../../../support/formatting";
import { CSS, SLOTS } from "./resources";

describe("calcite-chip", () => {
Expand Down Expand Up @@ -238,4 +239,32 @@ describe("calcite-chip", () => {
describe("translation support", () => {
t9n("calcite-chip");
});

describe("themed", () => {
describe("default", () => {
themed(html`calcite-chip`, {
"--calcite-chip-background-color": {
shadowSelector: `.${CSS.container}`,
targetProp: "backgroundColor",
},
"--calcite-chip-text-color": {
shadowSelector: `.${CSS.container}`,
targetProp: "color",
},
"--calcite-chip-corner-radius": {
shadowSelector: `.${CSS.container}`,
targetProp: "borderRadius",
},
});
});

describe("outline", () => {
themed(html`<calcite-chip appearance="outline" kind="neutral">Layers</calcite-chip>`, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is kind=neutral important for this test? If so, can we rename the describe block to convey this? Otherwise, let's remove it.

"--calcite-chip-border-color": {
shadowSelector: `.${CSS.container}`,
targetProp: "borderColor",
},
});
});
});
});
Loading
Loading