Skip to content

Commit 4bd5612

Browse files
authored
feat(activity-indicator): update to new visual language (#2027)
1 parent 9695d8a commit 4bd5612

File tree

311 files changed

+1092
-526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

311 files changed

+1092
-526
lines changed

.changeset/solid-mugs-jog.md

Lines changed: 10 additions & 0 deletions

packages/stacks-classic/lib/components/activity-indicator/activity-indicator.a11y.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ describe("activity-indicator", () => {
55
runA11yTests({
66
baseClass: "s-activity-indicator",
77
variants: ["danger", "success", "warning"],
8+
modifiers: {
9+
primary: ["sm"],
10+
},
811
children: {
912
default: `<div class="v-visible-sr">New activity</div>`,
1013
new: `new<div class="v-visible-sr">New activity</div>`,
1114
},
15+
excludedTestids: [
16+
/^s-activity-indicator-(?=.*sm).*new$/, // s-activity-indicator with content in sm size not supported
17+
],
1218
});
1319
});
Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.s-activity-indicator {
2-
--_ai-translucent: var(--translucent-secondary);
32
--_ai-bg: var(--theme-secondary-400);
43
--_ai-fc: var(--white);
4+
--_ai-min-size: var(--su-static16);
5+
--_ai-p: 0 calc(var(--su-static4) - var(--su-static1));
56

67
.highcontrast-mode({
78
--_ai-bg: var(--theme-secondary-500);
@@ -10,7 +11,6 @@
1011
// VARIANTS
1112
&&__danger {
1213
--_ai-bg: var(--red-400);
13-
--_ai-translucent: var(--translucent-error);
1414

1515
.highcontrast-mode({
1616
--_ai-bg: var(--red-500);
@@ -19,7 +19,6 @@
1919

2020
&&__success {
2121
--_ai-bg: var(--green-400);
22-
--_ai-translucent: var(--translucent-success);
2322

2423
.highcontrast-mode({
2524
--_ai-bg: var(--green-500);
@@ -29,25 +28,31 @@
2928
&&__warning {
3029
--_ai-bg: var(--yellow-400);
3130
--_ai-fc: var(--_black-static);
32-
--_ai-translucent: var(--translucent-warning);
3331

3432
.highcontrast-mode({
3533
--_ai-bg: var(--yellow-500); // needs to be here to override default high contrast
3634
--_ai-fc: var(--white);
3735
});
3836
}
3937

38+
&&__sm {
39+
--_ai-min-size: calc(var(--su-static8) + var(--su-static2));
40+
--_ai-p: 0;
41+
}
42+
4043
background-color: var(--_ai-bg);
41-
box-shadow: 0 0 0 var(--su-static4) var(--_ai-translucent);
4244
color: var(--_ai-fc);
45+
min-width: var(--_ai-min-size);
46+
min-height: var(--_ai-min-size);
47+
padding: var(--_ai-p);
4348

4449
border-radius: 1000px;
45-
display: inline-block;
50+
display: inline-flex;
4651
font-size: var(--fs-fine);
47-
font-weight: 700;
48-
line-height: 1.1; // Custom line-height to satisfy 1x screens
49-
min-width: var(--su-static12);
50-
min-height: var(--su-static12);
51-
padding: var(--su2) var(--su4);
52+
font-weight: 600;
53+
line-height: 1.1;
54+
text-align: center;
55+
align-items: center;
56+
justify-content: center;
5257
text-transform: uppercase;
5358
}

packages/stacks-classic/lib/components/activity-indicator/activity-indicator.visual.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ describe("activity-indicator", () => {
66
runVisualTests({
77
baseClass: "s-activity-indicator",
88
variants: ["danger", "success", "warning"],
9+
modifiers: {
10+
primary: ["sm"],
11+
},
912
children: {
1013
default: `<div class="v-visible-sr">New activity</div>`,
1114
new: `new<div class="v-visible-sr">New activity</div>`,
1215
},
16+
excludedTestids: [
17+
/^s-activity-indicator-(?=.*sm).*new$/, // s-activity-indicator with content in sm size not supported
18+
],
1319
template: ({ component, testid }) => html`
1420
<div
1521
class="d-inline-flex ai-center jc-center hs1 ws1 p8"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:117d67d686a488f9754cb953d7dad967e9d239fbd0cf4a8085b930bd49f7fdb8
3-
size 1531
2+
oid sha256:65a3aef25fae7c8f3bbefb536af7d17ffb7046540240648dafe8dcd2cd90fa2b
3+
size 1141
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:32b831d421bd04d081085e0be97cadda06e5506a779bea7eda0267e96ebca624
3+
size 544
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:b4ee315ffc4434c2283919aba0bb601178d43f95bfda70270d993b09829b2bb0
3-
size 830
2+
oid sha256:feefab91e9a9d9fc86bfe508e38c3c6a170a74ea67d8d51ec3f59586e7ef6165
3+
size 668
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:851226ef16bc876368653376b232803fccd1b82b1c30b07812bc57aa7de6d2d5
3-
size 1628
2+
oid sha256:36cc82e0f9ad34c977093c8c4cb3b4b9648c2191ffdfe1297019dd79b2aa7a1a
3+
size 1140
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:e4bc529ee895220dd89de246c8aff7759a3c7e1a9f17f16a012907fd59616d89
3+
size 554
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:d8155c03641d72244f79a0fb282c6be7e6376cd61492a236e447d997418d76f6
3-
size 1635
2+
oid sha256:7baeb9881de1af00649bda81cb1d261f56eeb9b85b330fd2e62ba13219747565
3+
size 1127

0 commit comments

Comments
 (0)