Skip to content

Commit

Permalink
chore(theme): remove spectrum-two beta warning (#4975)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubencarvalho authored Jan 24, 2025
1 parent f26a46b commit cdf6890
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
12 changes: 0 additions & 12 deletions tools/theme/src/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export class Theme extends HTMLElement implements ThemeKindProvider {
} else if (attrName === 'system') {
this.system = value as SystemVariant;
this._provideSystemContext();
warnBetaSystem(this, value as SystemVariant);
} else if (attrName === 'dir') {
this.dir = value as 'ltr' | 'rtl' | '';
}
Expand Down Expand Up @@ -436,17 +435,6 @@ export class Theme extends HTMLElement implements ThemeKindProvider {
}
}

function warnBetaSystem(instance: Theme, value: SystemVariant): void {
if (window.__swc.DEBUG && value === 'spectrum-two') {
window.__swc.warn(
instance,
'You are currently using the beta version of the Spectrum Two system. Consumption of this system may be subject to unexpected changes before the 1.0 release of SWC.',
'https://s2.spectrum.adobe.com/',
{ level: 'high' }
);
}
}

function checkForIssues(
instance: Theme,
system: SystemVariant | '',
Expand Down
26 changes: 0 additions & 26 deletions tools/theme/test/theme-devmode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,5 @@ describe('Theme', () => {
},
});
});

it('warns in Dev Mode when you use Spectrum Two theme ', async () => {
const el = await fixture<Theme>(html`
<sp-theme
system="spectrum-two"
color="dark"
scale="medium"
></sp-theme>
`);

await elementUpdated(el);

expect(consoleWarnStub.called).to.be.true;
const spyCall = consoleWarnStub.getCall(0);
expect(
(spyCall.args.at(0) as string).includes('beta version'),
'confirm "beta-theme"-centric message'
).to.be.true;
expect(spyCall.args.at(-1), 'confirm `data` shape').to.deep.equal({
data: {
localName: 'sp-theme',
type: 'api',
level: 'high',
},
});
});
});
});

0 comments on commit cdf6890

Please sign in to comment.