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

MWPW-154147: add spectrum switch component #3264

Merged
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
18 changes: 9 additions & 9 deletions libs/features/spectrum-web-components/dist/checkbox.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions libs/features/spectrum-web-components/dist/switch.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions libs/features/spectrum-web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@spectrum-web-components/search": "^0.47.2",
"@spectrum-web-components/shared": "^0.47.2",
"@spectrum-web-components/sidenav": "^0.47.2",
"@spectrum-web-components/switch": "^0.47.2",
"@spectrum-web-components/tabs": "^0.47.2",
"@spectrum-web-components/textfield": "^0.47.2",
"@spectrum-web-components/theme": "^0.47.2",
Expand Down
1 change: 1 addition & 0 deletions libs/features/spectrum-web-components/src/checkbox.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import '@spectrum-web-components/checkbox/sp-checkbox.js';
export * from '@spectrum-web-components/checkbox/src/CheckboxBase.js';
3 changes: 3 additions & 0 deletions libs/features/spectrum-web-components/src/switch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* eslint-disable no-unused-vars */
/* eslint-disable import/no-unresolved */
import '@spectrum-web-components/switch/sp-switch.js';
39 changes: 39 additions & 0 deletions test/features/spectrum-web-components/switch.test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<script src="../../../libs/features/spectrum-web-components/dist/theme.js" type="module"></script>
<script src="../../../libs/features/spectrum-web-components/dist/switch.js" type="module"></script>

<style>
sp-theme {
height: 100%;
width: 100%;
}
</style>

<script type="module">
import { runTests } from '@web/test-runner-mocha';
import { expect } from '@esm-bundle/chai';

runTests(async () => {
describe('Spectrum: switch module', async () => {
it('sp-switch has a shadow-root', () => {
expect(document.querySelector('sp-switch').shadowRoot).to.exist;
});
});
});
</script>
</head>

<body>
<script type="module">

</script>
<sp-theme theme="spectrum" color="light" scale="medium">
<sp-switch size="m"></sp-switch>
</sp-theme>
</body>

</html>
Loading