Skip to content

Commit

Permalink
MWPW-154147: add spectrum switch component (#3264)
Browse files Browse the repository at this point in the history
* MWPW-154147-spectrum switch

* MWPW-154147-spectrum switch

* MWPW-154147-spectrum switch test

* MWPW-154147-spectrum switch test

---------

Co-authored-by: Sonja Popovic <cod55010@adobe.com>
  • Loading branch information
SonjaPopovic and Sonja Popovic authored Dec 9, 2024
1 parent 57d66cf commit 9884681
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 9 deletions.
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>

0 comments on commit 9884681

Please sign in to comment.