Skip to content

Commit 02018da

Browse files
committed
chore(progress-bar): add deprecation warning for over-background
1 parent 9751470 commit 02018da

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

.changeset/easy-jobs-brush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@spectrum-web-components/progress-bar': patch
3+
---
4+
5+
**Added**: Deprecation warning for the over-background attribute.

packages/progress-bar/README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
<sp-alert-banner open variant="info">
2-
<div class="spectrum-InLineAlert-header">
3-
<span>Deprecated</span>
4-
</div>
5-
<div class="spectrum-InLineAlert-content">
6-
The <code>over-background</code> attribute has been deprecated and will be removed in a future release. Use <code>static-color="white"</code> instead.
7-
</div>
8-
</sp-alert-banner>
9-
101
## Overview
112

123
An `<sp-progress-bar>` is used to visually show the progression of a system operation such as downloading, uploading, processing, etc. By default, progress bars have a blue fill that shows the progress.
@@ -151,7 +142,7 @@ A progress bar can be either determinate or indeterminate as signified by `[inde
151142
The above `sp-progress-bar` also leverages the `aria-label` attribute in place of the `label` attribute in ensure that the element is labelled correctly without that label appearing visibly in the UI.
152143

153144
</sp-tab-panel>
154-
<sp-tab value="side-label">Side Label</sp-tab>
145+
<sp-tab value="side-label">Side label</sp-tab>
155146
<sp-tab-panel value="side-label">
156147

157148
A progress bar can be delivered with its labeling displayed above its visual indicator or to either side. Use the boolean `[side-label]` attribute to define where this content should appear.

packages/progress-bar/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
},
7272
"types": "./src/index.d.ts",
7373
"customElements": "custom-elements.json",
74+
"deprecationNotice": "The over-background attribute has been deprecated and will be removed in a future release. Use static-color='white' instead.",
7475
"sideEffects": [
7576
"./sp-*.js",
7677
"./**/*.dev.js"

packages/progress-bar/src/ProgressBar.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ export class ProgressBar extends SizedMixin(
146146
}
147147

148148
if (window.__swc.DEBUG) {
149+
if (changes.has('over-background')) {
150+
window.__swc.warn(
151+
this,
152+
`The "over-background" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use "static-color='white'" instead.`,
153+
'https://opensource.adobe.com/spectrum-web-components/components/progress-bar/#variants',
154+
{ level: 'deprecation' }
155+
);
156+
}
157+
149158
if (
150159
!this.label &&
151160
!this.getAttribute('aria-label') &&

0 commit comments

Comments
 (0)