Skip to content

Commit e1afb5c

Browse files
aramos-adobecastastrophe
authored andcommitted
feat(progresscircle): update story and hcm
1 parent 6fa08f1 commit e1afb5c

File tree

4 files changed

+12
-38
lines changed

4 files changed

+12
-38
lines changed

.changeset/itchy-kids-travel.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Progress circle S2 migration
66

7-
This is the S2 migration of the progress circle. It has changed to an svg element to allow CSS styles such as `stroke-linecap`. This was necessary to match the design.
7+
This is the S2 migration of the progress circle. The original markup has changed to an svg and circle element to allow CSS styles such as `stroke-linecap`. This was necessary to match the design. The `--small/--medium/--large` sizing classes have been deprecated in favor of t-shirt classes `--sizeS/--sizeM/--sizeL`
88

99
### Animation
1010

@@ -13,12 +13,6 @@ This animation was created by React Spectrum and used to keep the same speed and
1313

1414
### Added tokens
1515

16-
`--spectrum-in-field-progress-circle-edge-to-fill`
17-
`--spectrum-in-field-progress-circle-size-75`
18-
`--spectrum-in-field-progress-circle-size-100`
19-
`--spectrum-in-field-progress-circle-size-200`
20-
`--spectrum-in-field-progress-circle-size-300`
21-
2216
### Removed styles & mods
2317

2418
`--spectrum-progress-circle-track-border-color-over-background`

components/progresscircle/index.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
Copyright 2023 Adobe. All rights reserved.
2+
Copyright 2024 Adobe. All rights reserved.
33
This file is licensed to you under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License. You may obtain a copy
55
of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -14,7 +14,7 @@ governing permissions and limitations under the License.
1414

1515
.spectrum-ProgressCircle {
1616
/* circle unfilled border color */
17-
--spectrum-progress-circle-track-border-color: var(--spectrum-gray-200);
17+
--spectrum-progress-circle-track-border-color: var(--spectrum-track-color);
1818

1919
--spectrum-progress-circle-track-border-color-over-background: var(--spectrum-transparent-white-400);
2020
--spectrum-progress-circle-fill-border-color-over-background: var(--spectrum-transparent-white-1000);
@@ -42,6 +42,7 @@ governing permissions and limitations under the License.
4242
.spectrum-ProgressCircle {
4343
/* fill is bright color */
4444
--highcontrast-progress-circle-fill-border-color: Highlight;
45+
--highcontrast-progressbar-track-color: Canvas;
4546
}
4647
}
4748

@@ -76,7 +77,7 @@ governing permissions and limitations under the License.
7677

7778
.spectrum-ProgressCircle-track {
7879
stroke-width: var(--mod-progress-circle-thickness, var(--spectrum-progress-circle-thickness));
79-
stroke: var(--mod-progress-circle-track-border-color, var(--spectrum-progress-circle-track-border-color));
80+
stroke: var(--highcontrast-progressbar-track-color, var(--mod-progress-circle-track-border-color, var(--spectrum-progress-circle-track-border-color)));
8081
}
8182

8283
/* circle progress filled */
@@ -92,8 +93,8 @@ governing permissions and limitations under the License.
9293
.spectrum-ProgressCircle-fill {
9394
will-change: transform;
9495
animation:
95-
1s infinite spectrum-fills-rotate 0.2s,
96-
1s infinite spectrum-dashoffset-animation 0s;
96+
1s cubic-bezier(.6, .1, .3, .9) infinite spectrum-fills-rotate,
97+
1s cubic-bezier(.25, .1, .25, 1.3) infinite spectrum-dashoffset-animation;
9798
transform-origin: center;
9899
}
99100
}

components/progresscircle/stories/progresscircle.stories.js

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Sizes } from "@spectrum-css/preview/decorators";
22
import { disableDefaultModes } from "@spectrum-css/preview/modes";
3-
import { isIndeterminate, size } from "@spectrum-css/preview/types";
4-
import metadata from "../dist/metadata.json";
3+
import { isIndeterminate, size, staticColor } from "@spectrum-css/preview/types";
4+
import metadata from "../metadata/metadata.json";
55
import packageJson from "../package.json";
66
import { ProgressCircleGroup } from "./progresscircle.test.js";
77
import { Template } from "./template.js";
@@ -15,17 +15,7 @@ export default {
1515
argTypes: {
1616
size: size(["s", "m", "l"]),
1717
isIndeterminate,
18-
staticColor: {
19-
name: "Static color",
20-
description: "Variants that can be used when the progress circle needs to be placed on top of a colored background or a visual.",
21-
type: { name: "string" },
22-
table: {
23-
type: { summary: "string" },
24-
category: "Advanced",
25-
},
26-
options: ["white", "black"],
27-
control: "select",
28-
},
18+
staticColor,
2919
value: {
3020
control: {
3121
type: "range",
@@ -48,7 +38,6 @@ export default {
4838
},
4939
packageJson,
5040
metadata,
51-
layout: "centered"
5241
},
5342
};
5443

@@ -119,7 +108,7 @@ StaticWhiteIndeterminate.parameters = {
119108
chromatic: { disableSnapshot: true },
120109
};
121110

122-
export const StaticBlackDeterminate = Template.bind({});
111+
export const StaticBlackDeterminate = Sizing.bind({});
123112
StaticBlackDeterminate.tags = ["!dev"];
124113
StaticBlackDeterminate.storyName = "Static black, default";
125114
StaticBlackDeterminate.args = {
@@ -130,7 +119,7 @@ StaticBlackDeterminate.parameters = {
130119
chromatic: { disableSnapshot: true },
131120
};
132121

133-
export const StaticBlackIndeterminate = Template.bind({});
122+
export const StaticBlackIndeterminate = Sizing.bind({});
134123
StaticBlackIndeterminate.tags = ["!dev"];
135124
StaticBlackIndeterminate.storyName = "Static black, indeterminate";
136125
StaticBlackIndeterminate.args = {

components/progresscircle/stories/template.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,3 @@ export const Template = ({
5959
</div>
6060
`;
6161
};
62-
63-
export const ProgressCircleGroup = (args) => html`
64-
${window.isChromatic() ? html`
65-
${Template(args)}
66-
${Template({
67-
...args,
68-
isIndeterminate: true,
69-
})}
70-
` : Template(args)}
71-
`;

0 commit comments

Comments
 (0)