Skip to content

Commit

Permalink
fix(spinner): remove deprecated color-palette (#1769)
Browse files Browse the repository at this point in the history
* fix(spinner): remove deprecated color-palette property

* chore(spinner): add changeset

* chore(spinner): lint
  • Loading branch information
zeroedin authored Aug 20, 2024
1 parent 5a0761b commit 347d29e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-foxes-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rhds/elements": patch
---

`<rh-spinner>`: remove deprecated color-palette property
19 changes: 0 additions & 19 deletions elements/rh-spinner/rh-spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ export type SpinnerSize = RhSpinner['size'];
* A spinner indicates that an action is in progress.
* It appears as an animated circle over the section that is loading,
* and it may include a text label
*
* @summary Notifies users their action is being processed or loaded
*
* @slot - Optional text label below the animated circle.
*
*/
@customElement('rh-spinner')
export class RhSpinner extends LitElement {
Expand All @@ -43,22 +40,6 @@ export class RhSpinner extends LitElement {
<slot></slot>
`;
}

// START hack for removal of contextProvider. delete for version 2.0
/**
* @deprecated Use Color context instead. See https://ux.redhat.com/foundations/color/context/
*/
@property({ attribute: 'color-palette' }) colorPalette?: string;

willUpdate() {
const [cp] = this.getAttribute('color-palette')?.match(/^dark|^light/) ?? [];
if (cp) {
this.on = cp as 'dark' | 'light';
// eslint-disable-next-line no-console
console.warn(`[rh-spinner]: do not use color-palette, it is deprecated`);
}
}
// END hack
}

declare global {
Expand Down

0 comments on commit 347d29e

Please sign in to comment.