Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(theme): remove spectrum-two beta warning #4975

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
},
});
});
});
});
Loading