@spectrum-web-components/theme 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/core.dev.js +1 -0
- package/core.dev.js.map +1 -1
- package/core.js +1 -1
- package/core.js.map +2 -2
- package/express/scale-large.dev.js +1 -0
- package/express/scale-large.dev.js.map +1 -1
- package/express/scale-large.js +1 -1
- package/express/scale-large.js.map +2 -2
- package/express/scale-medium.dev.js +1 -0
- package/express/scale-medium.dev.js.map +1 -1
- package/express/scale-medium.js +1 -1
- package/express/scale-medium.js.map +2 -2
- package/express/theme-dark.dev.js +1 -0
- package/express/theme-dark.dev.js.map +1 -1
- package/express/theme-dark.js +1 -1
- package/express/theme-dark.js.map +2 -2
- package/express/theme-darkest.dev.js +1 -0
- package/express/theme-darkest.dev.js.map +1 -1
- package/express/theme-darkest.js +1 -1
- package/express/theme-darkest.js.map +2 -2
- package/express/theme-light.dev.js +1 -0
- package/express/theme-light.dev.js.map +1 -1
- package/express/theme-light.js +1 -1
- package/express/theme-light.js.map +2 -2
- package/express/theme-lightest.dev.js +1 -0
- package/express/theme-lightest.dev.js.map +1 -1
- package/express/theme-lightest.js +1 -1
- package/express/theme-lightest.js.map +2 -2
- package/package.json +3 -3
- package/scale-large.dev.js +1 -0
- package/scale-large.dev.js.map +1 -1
- package/scale-large.js +1 -1
- package/scale-large.js.map +2 -2
- package/scale-medium.dev.js +1 -0
- package/scale-medium.dev.js.map +1 -1
- package/scale-medium.js +1 -1
- package/scale-medium.js.map +2 -2
- package/sp-theme.dev.js +1 -0
- package/sp-theme.dev.js.map +1 -1
- package/sp-theme.js +1 -1
- package/sp-theme.js.map +2 -2
- package/src/Theme.dev.js +43 -13
- package/src/Theme.dev.js.map +2 -2
- package/src/Theme.js +1 -1
- package/src/Theme.js.map +2 -2
- package/src/express/core.dev.js +1 -0
- package/src/express/core.dev.js.map +1 -1
- package/src/express/core.js +1 -1
- package/src/express/core.js.map +2 -2
- package/src/express/scale-large.css.dev.js +2 -15
- package/src/express/scale-large.css.dev.js.map +2 -2
- package/src/express/scale-large.css.js +2 -16
- package/src/express/scale-large.css.js.map +3 -3
- package/src/express/scale-medium.css.dev.js +2 -15
- package/src/express/scale-medium.css.dev.js.map +2 -2
- package/src/express/scale-medium.css.js +2 -16
- package/src/express/scale-medium.css.js.map +3 -3
- package/src/express/theme-dark.css.dev.js +3 -2
- package/src/express/theme-dark.css.dev.js.map +2 -2
- package/src/express/theme-dark.css.js +3 -3
- package/src/express/theme-dark.css.js.map +3 -3
- package/src/express/theme-light.css.dev.js +3 -2
- package/src/express/theme-light.css.dev.js.map +2 -2
- package/src/express/theme-light.css.js +3 -3
- package/src/express/theme-light.css.js.map +3 -3
- package/src/express/theme.css.dev.js +28 -3
- package/src/express/theme.css.dev.js.map +2 -2
- package/src/express/theme.css.js +28 -4
- package/src/express/theme.css.js.map +3 -3
- package/src/express/themes.dev.js +1 -0
- package/src/express/themes.dev.js.map +1 -1
- package/src/express/themes.js +1 -1
- package/src/express/themes.js.map +1 -1
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/scale-large.css.dev.js +2 -15
- package/src/scale-large.css.dev.js.map +2 -2
- package/src/scale-large.css.js +2 -16
- package/src/scale-large.css.js.map +3 -3
- package/src/scale-medium.css.dev.js +2 -15
- package/src/scale-medium.css.dev.js.map +2 -2
- package/src/scale-medium.css.js +2 -16
- package/src/scale-medium.css.js.map +3 -3
- package/src/theme-dark.css.dev.js +3 -2
- package/src/theme-dark.css.dev.js.map +2 -2
- package/src/theme-dark.css.js +3 -3
- package/src/theme-dark.css.js.map +3 -3
- package/src/theme-darkest.css.dev.js +3 -2
- package/src/theme-darkest.css.dev.js.map +2 -2
- package/src/theme-darkest.css.js +3 -3
- package/src/theme-darkest.css.js.map +3 -3
- package/src/theme-light.css.dev.js +3 -2
- package/src/theme-light.css.dev.js.map +2 -2
- package/src/theme-light.css.js +3 -3
- package/src/theme-light.css.js.map +3 -3
- package/src/theme-lightest.css.dev.js +3 -2
- package/src/theme-lightest.css.dev.js.map +2 -2
- package/src/theme-lightest.css.js +3 -3
- package/src/theme-lightest.css.js.map +3 -3
- package/src/theme.css.dev.js +28 -3
- package/src/theme.css.dev.js.map +2 -2
- package/src/theme.css.js +28 -4
- package/src/theme.css.js.map +3 -3
- package/src/themes.dev.js +1 -0
- package/src/themes.dev.js.map +1 -1
- package/src/themes.js +1 -1
- package/src/themes.js.map +1 -1
- package/src/typography.css.dev.js +1 -0
- package/src/typography.css.dev.js.map +1 -1
- package/src/typography.css.js +1 -1
- package/src/typography.css.js.map +2 -2
- package/stories/theme.stories.js +56 -14
- package/stories/theme.stories.js.map +1 -1
- package/test/theme-devmode.test.js +29 -2
- package/test/theme-devmode.test.js.map +1 -1
- package/test/theme-lazy.test.js +118 -6
- package/test/theme-lazy.test.js.map +1 -1
- package/test/theme.test-vrt.js +4 -1
- package/test/theme.test-vrt.js.map +1 -1
- package/test/themes.test.js +145 -10
- package/test/themes.test.js.map +1 -1
- package/theme-dark.dev.js +1 -0
- package/theme-dark.dev.js.map +1 -1
- package/theme-dark.js +1 -1
- package/theme-dark.js.map +2 -2
- package/theme-darkest.dev.js +1 -0
- package/theme-darkest.dev.js.map +1 -1
- package/theme-darkest.js +1 -1
- package/theme-darkest.js.map +2 -2
- package/theme-light.dev.js +1 -0
- package/theme-light.dev.js.map +1 -1
- package/theme-light.js +1 -1
- package/theme-light.js.map +2 -2
- package/theme-lightest.dev.js +1 -0
- package/theme-lightest.dev.js.map +1 -1
- package/theme-lightest.js +1 -1
- package/theme-lightest.js.map +2 -2
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["theme.stories.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/switch/sp-switch.js';\nimport '@spectrum-web-components/slider/sp-slider.js';\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport { Color } from '../src/index.js';\n\nexport default {\n component: 'sp-theme',\n title: 'Theme',\n argTypes: {\n colorStop: {\n control: {\n type: 'inline-radio',\n options: ['light', 'dark'],\n },\n },\n },\n args: {\n colorStop: 'light',\n },\n};\n\nconst storyStyles = html`\n <style type=\"text/css\">\n #outer,\n #example {\n width: 500px;\n padding: 3em;\n background-color: var(--spectrum-global-color-gray-100);\n color: var(--spectrum-global-color-gray-800);\n }\n\n #inner {\n margin-top: 2em;\n padding: 2em;\n background-color: var(--spectrum-global-color-gray-100);\n color: var(--spectrum-global-color-gray-800);\n }\n\n #buttons {\n margin-top: 2em;\n }\n </style>\n`;\n\nexport const Default = ({\n colorStop: color,\n}: {\n colorStop: Color;\n}): TemplateResult => {\n return html`\n ${storyStyles}\n <sp-theme\n color=\"${color}\"\n theme=${window.__swc_hack_knobs__.defaultThemeVariant}\n >\n <div id=\"example\">\n <div>\n <sp-slider\n value=\"5\"\n step=\"1\"\n min=\"1\"\n max=\"11\"\n label=\"Volume\"\n id=\"volume-slider\"\n ></sp-slider>\n </div>\n <div><sp-switch>Overdrive</sp-switch></div>\n <sp-button-group id=\"buttons\">\n <sp-button variant=\"primary\" treatment=\"outline\">\n Cancel\n </sp-button>\n <sp-button variant=\"accent\">Continue</sp-button>\n </sp-button-group>\n </div>\n </sp-theme>\n `;\n};\n\nexport const displayFlex = (): TemplateResult => html`\n <style type=\"text/css\">\n #flex-theme {\n display: flex;\n flex-direction: row;\n }\n #flex-theme sp-button {\n flex: 0 0;\n }\n #flex-theme #middle-button {\n flex: 1 0;\n }\n </style>\n <sp-theme\n id=\"flex-theme\"\n color=\"dark\"\n theme=${window.__swc_hack_knobs__.defaultThemeVariant}\n >\n <sp-button>Start</sp-button>\n <sp-button id=\"middle-button\">Middle</sp-button>\n <sp-button>End</sp-button>\n </sp-theme>\n`;\n\nexport const none = (): TemplateResult => html`\n ${storyStyles}\n <div id=\"example\">\n <div>\n <sp-slider\n value=\"5\"\n step=\"1\"\n min=\"1\"\n max=\"11\"\n label=\"Volume\"\n id=\"volume-slider\"\n ></sp-slider>\n </div>\n <div><sp-switch>Overdrive</sp-switch></div>\n <sp-button-group id=\"buttons\">\n <sp-button variant=\"primary\" treatment=\"outline\">Cancel</sp-button>\n <sp-button variant=\"accent\">Continue</sp-button>\n </sp-button-group>\n </div>\n <sp-theme></sp-theme>\n`;\n\nexport const nestedTheme = ({\n colorStop: outer,\n}: {\n colorStop: Color;\n}): TemplateResult => {\n const inner = outer === 'light' ? 'dark' : 'light';\n return html`\n ${storyStyles}\n <sp-theme\n color=\"${outer}\"\n theme=${window.__swc_hack_knobs__.defaultThemeVariant}\n >\n <div id=\"outer\">\n <div>\n <sp-slider\n value=\"5\"\n step=\"1\"\n min=\"1\"\n max=\"11\"\n label=\"Volume\"\n id=\"volume-slider\"\n ></sp-slider>\n </div>\n <div><sp-switch>Overdrive</sp-switch></div>\n <sp-button-group id=\"buttons\">\n <sp-button variant=\"primary\" treatment=\"outline\">\n Cancel\n </sp-button>\n <sp-button variant=\"accent\">Continue</sp-button>\n </sp-button-group>\n <sp-theme\n color=\"${inner}\"\n dir=\"ltr\"\n theme=${window.__swc_hack_knobs__.defaultThemeVariant}\n >\n <div id=\"inner\">\n <div>\n <sp-slider\n value=\"5\"\n step=\"1\"\n min=\"1\"\n max=\"11\"\n label=\"Volume\"\n id=\"volume-slider-inner\"\n ></sp-slider>\n </div>\n <div><sp-switch>Overdrive</sp-switch></div>\n <sp-button-group id=\"buttons-inner\">\n <sp-button variant=\"primary\" treatment=\"outline\">\n Cancel\n </sp-button>\n <sp-button variant=\"accent\">Continue</sp-button>\n </sp-button-group>\n </div>\n </sp-theme>\n </div>\n </sp-theme>\n `;\n};\n\nexport const reverseColorNestedTheme = ({\n colorStop: outer,\n}: {\n colorStop: Color;\n}): TemplateResult => {\n const inner = outer === 'light' ? 'dark' : 'light';\n return html`\n <style type=\"text/css\">\n #outer {\n width: 500px;\n padding: 3em;\n background-color: var(--spectrum-global-color-gray-100);\n color: var(--spectrum-global-color-gray-800);\n }\n\n #inner {\n margin-top: 2em;\n padding: 2em;\n background-color: var(--spectrum-global-color-gray-100);\n color: var(--spectrum-global-color-gray-800);\n }\n\n #buttons {\n margin-top: 2em;\n }\n </style>\n <sp-theme\n color=\"${inner}\"\n theme=${window.__swc_hack_knobs__.defaultThemeVariant}\n >\n <div id=\"outer\">\n <div>\n <sp-slider\n value=\"5\"\n step=\"1\"\n min=\"1\"\n max=\"11\"\n label=\"Volume\"\n id=\"volume-slider\"\n ></sp-slider>\n </div>\n <div><sp-switch>Overdrive</sp-switch></div>\n <sp-button-group id=\"buttons\">\n <sp-button variant=\"primary\" treatment=\"outline\">\n Cancel\n </sp-button>\n <sp-button variant=\"accent\">Continue</sp-button>\n </sp-button-group>\n <sp-theme\n color=\"${outer}\"\n dir=\"rtl\"\n theme=${window.__swc_hack_knobs__.defaultThemeVariant}\n >\n <div id=\"inner\">\n <div>\n <sp-slider\n value=\"5\"\n step=\"1\"\n min=\"1\"\n max=\"11\"\n label=\"Volume\"\n id=\"volume-slider-inner\"\n ></sp-slider>\n </div>\n <div><sp-switch>Overdrive</sp-switch></div>\n <sp-button-group id=\"buttons-inner\">\n <sp-button variant=\"primary\" treatment=\"outline\">\n Cancel\n </sp-button>\n <sp-button variant=\"accent\">Continue</sp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AClB,QAAM,QAAQ,UAAU,UAAU,SAAS;AAC3C,SAAO;AAAA,UACD;AAAA;AAAA,qBAEW;AAAA,oBACD,OAAO,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAqBjB;AAAA;AAAA,4BAED,OAAO,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBtD;AAEO,aAAM,0BAA0B,CAAC;AAAA,EACpC,WAAW;AACf,MAEsB;AAClB,QAAM,QAAQ,UAAU,UAAU,SAAS;AAC3C,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAqBU;AAAA,oBACD,OAAO,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAqBjB;AAAA;AAAA,4BAED,OAAO,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBtD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/theme/sp-theme.js";
|
|
3
|
+
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
4
|
+
import { stub } from "sinon";
|
|
5
|
+
describe("Dev mode", () => {
|
|
6
|
+
window.__swc.verbose = true;
|
|
7
|
+
it("warns in Dev Mode when no attributes or fragments", async () => {
|
|
8
|
+
const consoleWarnStub = stub(console, "warn");
|
|
9
|
+
const el = await fixture(
|
|
10
|
+
html`
|
|
2
11
|
<sp-theme></sp-theme>
|
|
3
|
-
`
|
|
12
|
+
`
|
|
13
|
+
);
|
|
14
|
+
await elementUpdated(el);
|
|
15
|
+
expect(consoleWarnStub.called).to.be.true;
|
|
16
|
+
const spyCall = consoleWarnStub.getCall(0);
|
|
17
|
+
expect(
|
|
18
|
+
spyCall.args.at(0).includes("theme delivery"),
|
|
19
|
+
'confirm "theme delivery"-centric message'
|
|
20
|
+
).to.be.true;
|
|
21
|
+
expect(spyCall.args.at(-1), "confirm `data` shape").to.deep.equal({
|
|
22
|
+
data: {
|
|
23
|
+
localName: "sp-theme",
|
|
24
|
+
type: "api",
|
|
25
|
+
level: "default"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
consoleWarnStub.restore();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
4
31
|
//# sourceMappingURL=theme-devmode.test.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["theme-devmode.test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\nimport { stub } from 'sinon';\n\ndescribe('Dev mode', () => {\n window.__swc.verbose = true;\n it('warns in Dev Mode when no attributes or fragments', async () => {\n const consoleWarnStub = stub(console, 'warn');\n const el = await fixture<Theme>(\n html`\n <sp-theme></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n expect(consoleWarnStub.called).to.be.true;\n const spyCall = consoleWarnStub.getCall(0);\n expect(\n spyCall.args.at(0).includes('theme delivery'),\n 'confirm \"theme delivery\"-centric message'\n ).to.be.true;\n expect(spyCall.args.at(-1), 'confirm `data` shape').to.deep.equal({\n data: {\n localName: 'sp-theme',\n type: 'api',\n level: 'default',\n },\n });\n consoleWarnStub.restore();\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,OAAO;AAEP,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AACtD,SAAS,YAAY;AAErB,SAAS,YAAY,MAAM;AACvB,SAAO,MAAM,UAAU;AACvB,KAAG,qDAAqD,YAAY;AAChE,UAAM,kBAAkB,KAAK,SAAS,MAAM;AAC5C,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA,IAGJ;AAEA,UAAM,eAAe,EAAE;AAEvB,WAAO,gBAAgB,MAAM,EAAE,GAAG,GAAG;AACrC,UAAM,UAAU,gBAAgB,QAAQ,CAAC;AACzC;AAAA,MACI,QAAQ,KAAK,GAAG,CAAC,EAAE,SAAS,gBAAgB;AAAA,MAC5C;AAAA,IACJ,EAAE,GAAG,GAAG;AACR,WAAO,QAAQ,KAAK,GAAG,EAAE,GAAG,sBAAsB,EAAE,GAAG,KAAK,MAAM;AAAA,MAC9D,MAAM;AAAA,QACF,WAAW;AAAA,QACX,MAAM;AAAA,QACN,OAAO;AAAA,MACX;AAAA,IACJ,CAAC;AACD,oBAAgB,QAAQ;AAAA,EAC5B,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/theme-lazy.test.js
CHANGED
|
@@ -1,12 +1,124 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/theme/sp-theme.js";
|
|
3
|
+
import { Theme } from "@spectrum-web-components/theme";
|
|
4
|
+
import coreStyles from "@spectrum-web-components/theme/src/theme.css.js";
|
|
5
|
+
import lightStyles from "@spectrum-web-components/theme/src/theme-light.css.js";
|
|
6
|
+
import lightestStyles from "@spectrum-web-components/theme/src/theme-lightest.css.js";
|
|
7
|
+
import darkStyles from "@spectrum-web-components/theme/src/theme-dark.css.js";
|
|
8
|
+
import darkestStyles from "@spectrum-web-components/theme/src/theme-darkest.css.js";
|
|
9
|
+
import largeStyles from "@spectrum-web-components/theme/src/scale-large.css.js";
|
|
10
|
+
import mediumStyles from "@spectrum-web-components/theme/src/scale-medium.css.js";
|
|
11
|
+
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
12
|
+
describe("Themes - lazy", () => {
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
Theme.themeFragmentsByKind.clear();
|
|
15
|
+
Theme.registerThemeFragment("spectrum", "theme", coreStyles);
|
|
16
|
+
});
|
|
17
|
+
after(() => {
|
|
18
|
+
Theme.registerThemeFragment("light", "color", lightStyles);
|
|
19
|
+
Theme.registerThemeFragment("lightest", "color", lightestStyles);
|
|
20
|
+
Theme.registerThemeFragment("dark", "color", darkStyles);
|
|
21
|
+
Theme.registerThemeFragment("darkest", "color", darkestStyles);
|
|
22
|
+
Theme.registerThemeFragment("large", "scale", largeStyles);
|
|
23
|
+
Theme.registerThemeFragment("medium", "scale", mediumStyles);
|
|
24
|
+
});
|
|
25
|
+
it("loads w/ no themes and none set", async () => {
|
|
26
|
+
const el = await fixture(
|
|
27
|
+
html`
|
|
2
28
|
<sp-theme></sp-theme>
|
|
3
|
-
`
|
|
29
|
+
`
|
|
30
|
+
);
|
|
31
|
+
await elementUpdated(el);
|
|
32
|
+
if (el.shadowRoot.adoptedStyleSheets) {
|
|
33
|
+
expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(1);
|
|
34
|
+
} else {
|
|
35
|
+
expect(
|
|
36
|
+
[...el.shadowRoot.querySelectorAll("style")].length
|
|
37
|
+
).to.equal(1);
|
|
38
|
+
}
|
|
39
|
+
expect(el.color).to.equal("");
|
|
40
|
+
expect(el.scale).to.equal("");
|
|
41
|
+
});
|
|
42
|
+
it("loads w/ themes and none set", async () => {
|
|
43
|
+
const el = await fixture(
|
|
44
|
+
html`
|
|
4
45
|
<sp-theme></sp-theme>
|
|
5
|
-
`
|
|
46
|
+
`
|
|
47
|
+
);
|
|
48
|
+
await elementUpdated(el);
|
|
49
|
+
Theme.registerThemeFragment("light", "color", lightStyles);
|
|
50
|
+
Theme.registerThemeFragment("medium", "scale", mediumStyles);
|
|
51
|
+
await elementUpdated(el);
|
|
52
|
+
if (el.shadowRoot.adoptedStyleSheets) {
|
|
53
|
+
expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(1);
|
|
54
|
+
} else {
|
|
55
|
+
expect(
|
|
56
|
+
[...el.shadowRoot.querySelectorAll("style")].length
|
|
57
|
+
).to.equal(1);
|
|
58
|
+
}
|
|
59
|
+
expect(el.color).to.equal("light");
|
|
60
|
+
expect(el.scale).to.equal("medium");
|
|
61
|
+
});
|
|
62
|
+
it("loads w/ no themes", async () => {
|
|
63
|
+
const el = await fixture(
|
|
64
|
+
html`
|
|
6
65
|
<sp-theme color="lightest" scale="large"></sp-theme>
|
|
7
|
-
`
|
|
66
|
+
`
|
|
67
|
+
);
|
|
68
|
+
await elementUpdated(el);
|
|
69
|
+
if (el.shadowRoot.adoptedStyleSheets) {
|
|
70
|
+
expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(1);
|
|
71
|
+
} else {
|
|
72
|
+
expect(
|
|
73
|
+
[...el.shadowRoot.querySelectorAll("style")].length
|
|
74
|
+
).to.equal(1);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
it("loads w/ not enough themes", async () => {
|
|
78
|
+
const el = await fixture(
|
|
79
|
+
html`
|
|
8
80
|
<sp-theme color="lightest" scale="large"></sp-theme>
|
|
9
|
-
`
|
|
81
|
+
`
|
|
82
|
+
);
|
|
83
|
+
await elementUpdated(el);
|
|
84
|
+
Theme.registerThemeFragment("light", "color", lightStyles);
|
|
85
|
+
Theme.registerThemeFragment("medium", "scale", mediumStyles);
|
|
86
|
+
await elementUpdated(el);
|
|
87
|
+
if (el.shadowRoot.adoptedStyleSheets) {
|
|
88
|
+
expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(1);
|
|
89
|
+
} else {
|
|
90
|
+
expect(
|
|
91
|
+
[...el.shadowRoot.querySelectorAll("style")].length
|
|
92
|
+
).to.equal(1);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
it("loads w/ lazy themes", async () => {
|
|
96
|
+
const el = await fixture(
|
|
97
|
+
html`
|
|
10
98
|
<sp-theme color="lightest" scale="large"></sp-theme>
|
|
11
|
-
`
|
|
99
|
+
`
|
|
100
|
+
);
|
|
101
|
+
await elementUpdated(el);
|
|
102
|
+
Theme.registerThemeFragment("light", "color", lightStyles);
|
|
103
|
+
Theme.registerThemeFragment("medium", "scale", mediumStyles);
|
|
104
|
+
await elementUpdated(el);
|
|
105
|
+
if (el.shadowRoot.adoptedStyleSheets) {
|
|
106
|
+
expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(1);
|
|
107
|
+
} else {
|
|
108
|
+
expect(
|
|
109
|
+
[...el.shadowRoot.querySelectorAll("style")].length
|
|
110
|
+
).to.equal(1);
|
|
111
|
+
}
|
|
112
|
+
Theme.registerThemeFragment("lightest", "color", lightestStyles);
|
|
113
|
+
Theme.registerThemeFragment("large", "scale", largeStyles);
|
|
114
|
+
await elementUpdated(el);
|
|
115
|
+
if (el.shadowRoot.adoptedStyleSheets) {
|
|
116
|
+
expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(3);
|
|
117
|
+
} else {
|
|
118
|
+
expect(
|
|
119
|
+
[...el.shadowRoot.querySelectorAll("style")].length
|
|
120
|
+
).to.equal(3);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
});
|
|
12
124
|
//# sourceMappingURL=theme-lazy.test.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["theme-lazy.test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport { Theme, ThemeFragmentMap } from '@spectrum-web-components/theme';\nimport coreStyles from '@spectrum-web-components/theme/src/theme.css.js';\nimport lightStyles from '@spectrum-web-components/theme/src/theme-light.css.js';\nimport lightestStyles from '@spectrum-web-components/theme/src/theme-lightest.css.js';\nimport darkStyles from '@spectrum-web-components/theme/src/theme-dark.css.js';\nimport darkestStyles from '@spectrum-web-components/theme/src/theme-darkest.css.js';\nimport largeStyles from '@spectrum-web-components/theme/src/scale-large.css.js';\nimport mediumStyles from '@spectrum-web-components/theme/src/scale-medium.css.js';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\ntype TestableThemeConstructor = {\n instances: Set<Theme>;\n themeFragmentsByKind: ThemeFragmentMap;\n};\n\ndescribe('Themes - lazy', () => {\n beforeEach(() => {\n (\n Theme as unknown as TestableThemeConstructor\n ).themeFragmentsByKind.clear();\n // Core is registered by default in `theme.ts`\n Theme.registerThemeFragment('spectrum', 'theme', coreStyles);\n });\n after(() => {\n Theme.registerThemeFragment('light', 'color', lightStyles);\n Theme.registerThemeFragment('lightest', 'color', lightestStyles);\n Theme.registerThemeFragment('dark', 'color', darkStyles);\n Theme.registerThemeFragment('darkest', 'color', darkestStyles);\n Theme.registerThemeFragment('large', 'scale', largeStyles);\n Theme.registerThemeFragment('medium', 'scale', mediumStyles);\n });\n it('loads w/ no themes and none set', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n if (el.shadowRoot.adoptedStyleSheets) {\n expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(1);\n } else {\n expect(\n [...el.shadowRoot.querySelectorAll('style')].length\n ).to.equal(1);\n }\n expect(el.color).to.equal('');\n expect(el.scale).to.equal('');\n });\n it('loads w/ themes and none set', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n Theme.registerThemeFragment('light', 'color', lightStyles);\n Theme.registerThemeFragment('medium', 'scale', mediumStyles);\n\n await elementUpdated(el);\n\n if (el.shadowRoot.adoptedStyleSheets) {\n expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(1);\n } else {\n expect(\n [...el.shadowRoot.querySelectorAll('style')].length\n ).to.equal(1);\n }\n expect(el.color).to.equal('light');\n expect(el.scale).to.equal('medium');\n });\n it('loads w/ no themes', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme color=\"lightest\" scale=\"large\"></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n if (el.shadowRoot.adoptedStyleSheets) {\n expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(1);\n } else {\n expect(\n [...el.shadowRoot.querySelectorAll('style')].length\n ).to.equal(1);\n }\n });\n it('loads w/ not enough themes', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme color=\"lightest\" scale=\"large\"></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n Theme.registerThemeFragment('light', 'color', lightStyles);\n Theme.registerThemeFragment('medium', 'scale', mediumStyles);\n\n await elementUpdated(el);\n\n if (el.shadowRoot.adoptedStyleSheets) {\n expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(1);\n } else {\n expect(\n [...el.shadowRoot.querySelectorAll('style')].length\n ).to.equal(1);\n }\n });\n it('loads w/ lazy themes', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme color=\"lightest\" scale=\"large\"></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n Theme.registerThemeFragment('light', 'color', lightStyles);\n Theme.registerThemeFragment('medium', 'scale', mediumStyles);\n\n await elementUpdated(el);\n\n if (el.shadowRoot.adoptedStyleSheets) {\n expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(1);\n } else {\n expect(\n [...el.shadowRoot.querySelectorAll('style')].length\n ).to.equal(1);\n }\n\n Theme.registerThemeFragment('lightest', 'color', lightestStyles);\n Theme.registerThemeFragment('large', 'scale', largeStyles);\n\n await elementUpdated(el);\n\n if (el.shadowRoot.adoptedStyleSheets) {\n expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(3);\n } else {\n expect(\n [...el.shadowRoot.querySelectorAll('style')].length\n ).to.equal(3);\n }\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,SAAS,aAA+B;AACxC,OAAO,gBAAgB;AACvB,OAAO,iBAAiB;AACxB,OAAO,oBAAoB;AAC3B,OAAO,gBAAgB;AACvB,OAAO,mBAAmB;AAC1B,OAAO,iBAAiB;AACxB,OAAO,kBAAkB;AACzB,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AAOtD,SAAS,iBAAiB,MAAM;AAC5B,aAAW,MAAM;AACb,IACI,MACF,qBAAqB,MAAM;AAE7B,UAAM,sBAAsB,YAAY,SAAS,UAAU;AAAA,EAC/D,CAAC;AACD,QAAM,MAAM;AACR,UAAM,sBAAsB,SAAS,SAAS,WAAW;AACzD,UAAM,sBAAsB,YAAY,SAAS,cAAc;AAC/D,UAAM,sBAAsB,QAAQ,SAAS,UAAU;AACvD,UAAM,sBAAsB,WAAW,SAAS,aAAa;AAC7D,UAAM,sBAAsB,SAAS,SAAS,WAAW;AACzD,UAAM,sB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O,GAAG,WAAW,mBAAmB,MAAM,EAAE,GAAG,MAAM,CAAC;AAAA,IAC9D,OAAO;AACH;AAAA,QACI,CAAC,GAAG,GAAG,WAAW,iBAAiB,OAAO,CAAC,EAAE;AAAA,MACjD,EAAE,GAAG,MAAM,CAAC;AAAA,IAChB;AAAA,EACJ,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/theme.test-vrt.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/theme.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("ThemeStories", stories);
|
|
2
5
|
//# sourceMappingURL=theme.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["theme.test-vrt.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/theme.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ThemeStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,gBAAgB,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/themes.test.js
CHANGED
|
@@ -1,16 +1,86 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/theme/sp-theme.js";
|
|
3
|
+
import "@spectrum-web-components/theme/src/themes.js";
|
|
4
|
+
import { Theme } from "@spectrum-web-components/theme";
|
|
5
|
+
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
6
|
+
import { css } from "@spectrum-web-components/base";
|
|
7
|
+
describe("Themes", () => {
|
|
8
|
+
it("loads - light", async () => {
|
|
9
|
+
const el = await fixture(
|
|
10
|
+
html`
|
|
2
11
|
<sp-theme theme="classic" color="light"></sp-theme>
|
|
3
|
-
`
|
|
12
|
+
`
|
|
13
|
+
);
|
|
14
|
+
await elementUpdated(el);
|
|
15
|
+
expect(el).to.exist;
|
|
16
|
+
expect(el).shadowDom.to.exist;
|
|
17
|
+
});
|
|
18
|
+
it("loads - dark", async () => {
|
|
19
|
+
const el = await fixture(
|
|
20
|
+
html`
|
|
4
21
|
<sp-theme color="dark"></sp-theme>
|
|
5
|
-
`
|
|
22
|
+
`
|
|
23
|
+
);
|
|
24
|
+
await elementUpdated(el);
|
|
25
|
+
expect(el).to.exist;
|
|
26
|
+
expect(el).shadowDom.to.exist;
|
|
27
|
+
});
|
|
28
|
+
it("loads - unkown", async () => {
|
|
29
|
+
const el = await fixture(
|
|
30
|
+
html`
|
|
6
31
|
<sp-theme color="unknown" scale="unknown"></sp-theme>
|
|
7
|
-
`
|
|
32
|
+
`
|
|
33
|
+
);
|
|
34
|
+
await elementUpdated(el);
|
|
35
|
+
expect(el).to.exist;
|
|
36
|
+
expect(el).shadowDom.to.exist;
|
|
37
|
+
});
|
|
38
|
+
it("adds an instance only once", async () => {
|
|
39
|
+
const el = await fixture(
|
|
40
|
+
html`
|
|
8
41
|
<sp-theme theme="express"></sp-theme>
|
|
9
|
-
`
|
|
42
|
+
`
|
|
43
|
+
);
|
|
44
|
+
await elementUpdated(el);
|
|
45
|
+
const testableTheme = Theme;
|
|
46
|
+
expect(testableTheme.instances.has(el), "first").to.be.true;
|
|
47
|
+
expect(testableTheme.instances.size).to.equal(1);
|
|
48
|
+
el.remove();
|
|
49
|
+
expect(testableTheme.instances.has(el), "second").to.be.false;
|
|
50
|
+
expect(testableTheme.instances.size).to.equal(0);
|
|
51
|
+
document.body.append(el);
|
|
52
|
+
expect(testableTheme.instances.has(el), "third").to.be.true;
|
|
53
|
+
expect(testableTheme.instances.size).to.equal(1);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
describe("Lightest", () => {
|
|
57
|
+
it("loads", async () => {
|
|
58
|
+
const el = await fixture(
|
|
59
|
+
html`
|
|
10
60
|
<sp-theme color="lightest"></sp-theme>
|
|
11
|
-
`
|
|
61
|
+
`
|
|
62
|
+
);
|
|
63
|
+
await elementUpdated(el);
|
|
64
|
+
expect(el).to.exist;
|
|
65
|
+
expect(el).shadowDom.to.exist;
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe("Medium", () => {
|
|
69
|
+
it("loads", async () => {
|
|
70
|
+
const el = await fixture(
|
|
71
|
+
html`
|
|
12
72
|
<sp-theme scale="medium"></sp-theme>
|
|
13
|
-
`
|
|
73
|
+
`
|
|
74
|
+
);
|
|
75
|
+
await elementUpdated(el);
|
|
76
|
+
expect(el).to.exist;
|
|
77
|
+
expect(el).shadowDom.to.exist;
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
describe("App styles", () => {
|
|
81
|
+
it("applies app fragments", async () => {
|
|
82
|
+
const el = await fixture(
|
|
83
|
+
html`
|
|
14
84
|
<sp-theme color="light">
|
|
15
85
|
<style>
|
|
16
86
|
div {
|
|
@@ -19,11 +89,76 @@ import"@spectrum-web-components/theme/sp-theme.js";import"@spectrum-web-componen
|
|
|
19
89
|
</style>
|
|
20
90
|
<div></div>
|
|
21
91
|
</sp-theme>
|
|
22
|
-
`
|
|
92
|
+
`
|
|
93
|
+
);
|
|
94
|
+
const div = el.querySelector("div");
|
|
95
|
+
await elementUpdated(el);
|
|
96
|
+
const preStylesDiv = getComputedStyle(div);
|
|
97
|
+
expect(preStylesDiv.paddingBlockStart).to.equal("0px");
|
|
98
|
+
Theme.registerThemeFragment(
|
|
99
|
+
"app",
|
|
100
|
+
"app",
|
|
101
|
+
css`
|
|
23
102
|
:host {
|
|
24
103
|
--app-padding: 10px;
|
|
25
104
|
}
|
|
26
|
-
`
|
|
105
|
+
`
|
|
106
|
+
);
|
|
107
|
+
await elementUpdated(el);
|
|
108
|
+
const postStylesDiv = getComputedStyle(div);
|
|
109
|
+
expect(postStylesDiv.paddingBlockStart).to.equal("10px");
|
|
110
|
+
Theme.themeFragmentsByKind.delete("app");
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
describe("Setting attributes", () => {
|
|
114
|
+
it("loads", async () => {
|
|
115
|
+
const el = await fixture(
|
|
116
|
+
html`
|
|
27
117
|
<sp-theme color="light"></sp-theme>
|
|
28
|
-
`
|
|
118
|
+
`
|
|
119
|
+
);
|
|
120
|
+
await elementUpdated(el);
|
|
121
|
+
expect(el).to.not.be.undefined;
|
|
122
|
+
expect(el.hasAttribute("scale")).to.be.false;
|
|
123
|
+
if (el.shadowRoot.adoptedStyleSheets) {
|
|
124
|
+
expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(2);
|
|
125
|
+
} else {
|
|
126
|
+
expect(
|
|
127
|
+
[...el.shadowRoot.querySelectorAll("style")].length
|
|
128
|
+
).to.equal(2);
|
|
129
|
+
}
|
|
130
|
+
await elementUpdated(el);
|
|
131
|
+
el.setAttribute("scale", "fish");
|
|
132
|
+
expect(el.getAttribute("scale")).to.equal("medium");
|
|
133
|
+
if (el.shadowRoot.adoptedStyleSheets) {
|
|
134
|
+
expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(2);
|
|
135
|
+
} else {
|
|
136
|
+
expect(
|
|
137
|
+
[...el.shadowRoot.querySelectorAll("style")].length
|
|
138
|
+
).to.equal(2);
|
|
139
|
+
}
|
|
140
|
+
el.color = "dark";
|
|
141
|
+
el.scale = "medium";
|
|
142
|
+
await elementUpdated(el);
|
|
143
|
+
expect(el.getAttribute("color")).to.equal("dark");
|
|
144
|
+
expect(el.getAttribute("scale")).to.equal("medium");
|
|
145
|
+
if (el.shadowRoot.adoptedStyleSheets) {
|
|
146
|
+
expect(el.shadowRoot.adoptedStyleSheets.length, "all").to.equal(3);
|
|
147
|
+
} else {
|
|
148
|
+
expect(
|
|
149
|
+
[...el.shadowRoot.querySelectorAll("style")].length
|
|
150
|
+
).to.equal(3);
|
|
151
|
+
}
|
|
152
|
+
el.setAttribute("color", "fish");
|
|
153
|
+
await elementUpdated(el);
|
|
154
|
+
expect(el.getAttribute("color")).to.equal("dark");
|
|
155
|
+
if (el.shadowRoot.adoptedStyleSheets) {
|
|
156
|
+
expect(el.shadowRoot.adoptedStyleSheets.length, "last").to.equal(3);
|
|
157
|
+
} else {
|
|
158
|
+
expect(
|
|
159
|
+
[...el.shadowRoot.querySelectorAll("style")].length
|
|
160
|
+
).to.equal(3);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
});
|
|
29
164
|
//# sourceMappingURL=themes.test.js.map
|
package/test/themes.test.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["themes.test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport { Theme, ThemeFragmentMap } from '@spectrum-web-components/theme';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\nimport { css } from '@spectrum-web-components/base';\n\ntype TestableThemeConstructor = {\n instances: Set<Theme>;\n themeFragmentsByKind: ThemeFragmentMap;\n};\n\ndescribe('Themes', () => {\n it('loads - light', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme theme=\"classic\" color=\"light\"></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n expect(el).to.exist;\n expect(el).shadowDom.to.exist;\n });\n it('loads - dark', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme color=\"dark\"></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n expect(el).to.exist;\n expect(el).shadowDom.to.exist;\n });\n it('loads - unkown', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme color=\"unknown\" scale=\"unknown\"></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n expect(el).to.exist;\n expect(el).shadowDom.to.exist;\n });\n it('adds an instance only once', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme theme=\"express\"></sp-theme>\n `\n );\n\n await elementUpdated(el);\n const testableTheme = Theme as unknown as TestableThemeConstructor;\n expect(testableTheme.instances.has(el), 'first').to.be.true;\n expect(testableTheme.instances.size).to.equal(1);\n\n el.remove();\n expect(testableTheme.instances.has(el), 'second').to.be.false;\n expect(testableTheme.instances.size).to.equal(0);\n\n document.body.append(el);\n expect(testableTheme.instances.has(el), 'third').to.be.true;\n expect(testableTheme.instances.size).to.equal(1);\n });\n});\n\ndescribe('Lightest', () => {\n it('loads', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme color=\"lightest\"></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n expect(el).to.exist;\n expect(el).shadowDom.to.exist;\n });\n});\n\ndescribe('Medium', () => {\n it('loads', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme scale=\"medium\"></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n expect(el).to.exist;\n expect(el).shadowDom.to.exist;\n });\n});\n\ndescribe('App styles', () => {\n it('applies app fragments', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme color=\"light\">\n <style>\n div {\n padding: var(--app-padding);\n }\n </style>\n <div></div>\n </sp-theme>\n `\n );\n const div = el.querySelector('div') as HTMLDivElement;\n\n await elementUpdated(el);\n\n const preStylesDiv = getComputedStyle(div);\n expect(preStylesDiv.paddingBlockStart).to.equal('0px');\n\n Theme.registerThemeFragment(\n 'app',\n 'app',\n css`\n :host {\n --app-padding: 10px;\n }\n `\n );\n await elementUpdated(el);\n\n const postStylesDiv = getComputedStyle(div);\n expect(postStylesDiv.paddingBlockStart).to.equal('10px');\n\n (\n Theme as unknown as TestableThemeConstructor\n ).themeFragmentsByKind.delete('app');\n });\n});\n\ndescribe('Setting attributes', () => {\n it('loads', async () => {\n const el = await fixture<Theme>(\n html`\n <sp-theme color=\"light\"></sp-theme>\n `\n );\n\n await elementUpdated(el);\n\n expect(el).to.not.be.undefined;\n expect(el.hasAttribute('scale')).to.be.false;\n\n if (el.shadowRoot.adoptedStyleSheets) {\n expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(2);\n } else {\n expect(\n [...el.shadowRoot.querySelectorAll('style')].length\n ).to.equal(2);\n }\n\n await elementUpdated(el);\n\n // Invalid initial value falls back to default\n el.setAttribute('scale', 'fish');\n expect(el.getAttribute('scale')).to.equal('medium');\n\n if (el.shadowRoot.adoptedStyleSheets) {\n expect(el.shadowRoot.adoptedStyleSheets.length).to.equal(2);\n } else {\n expect(\n [...el.shadowRoot.querySelectorAll('style')].length\n ).to.equal(2);\n }\n\n el.color = 'dark';\n el.scale = 'medium';\n\n await elementUpdated(el);\n expect(el.getAttribute('color')).to.equal('dark');\n expect(el.getAttribute('scale')).to.equal('medium');\n\n if (el.shadowRoot.adoptedStyleSheets) {\n expect(el.shadowRoot.adoptedStyleSheets.length, 'all').to.equal(3);\n } else {\n expect(\n [...el.shadowRoot.querySelectorAll('style')].length\n ).to.equal(3);\n }\n\n // Invalid second + value fallsback to previous\n el.setAttribute('color', 'fish');\n\n await elementUpdated(el);\n expect(el.getAttribute('color')).to.equal('dark');\n\n if (el.shadowRoot.adoptedStyleSheets) {\n expect(el.shadowRoot.adoptedStyleSheets.length, 'last').to.equal(3);\n } else {\n expect(\n [...el.shadowRoot.querySelectorAll('style')].length\n ).to.equal(3);\n }\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,OAAO;AACP,SAAS,aAA+B;AACxC,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AACtD,SAAS,WAAW;AAOpB,SAAS,UAAU,MAAM;AACrB,KAAG,iBAAiB,YAAY;AAC5B,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA,IAGJ;AAEA,UAAM,eAAe,EAAE;AAEvB,WAAO,EAAE,EAAE,GAAG;AACd,WAAO,EAAE,EAAE,UAAU,GAAG;AAAA,EAC5B,CAAC;AACD,KAAG,gBAAgB,YAAY;AAC3B,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA,IAGJ;AAEA,UAAM,eAAe,EAAE;AAEvB,WAAO,EAAE,EAAE,GAAG;AACd,WAAO,EAAE,EAAE,UAAU,GAAG;AAAA,EAC5B,CAAC;AACD,KAAG,kBAAkB,YAAY;AAC7B,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA,IAGJ;AAEA,UAAM,eAAe,EAAE;AAEvB,WAAO,EAAE,EAAE,GAAG;AACd,WAAO,EAAE,EAAE,UAAU,GAAG;AAAA,EAC5B,CAAC;AACD,KAAG,8BAA8B,YAAY;AACzC,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA,IAGJ;AAEA,UAAM,eAAe,EAAE;AACvB,UAAM,gBAAgB;AACtB,WAAO,cAAc,UAAU,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,GAAG;AACvD,WAAO,cAAc,UAAU,IAAI,EAAE,GAAG,MAAM,CAAC;AAE/C,OAAG,OAAO;AACV,WAAO,cAAc,UAAU,IAAI,EAAE,GAAG,QAAQ,EAAE,GAAG,GAAG;AACxD,WAAO,cAAc,UA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,SAAS,MAAM;AAE/B,UAAM,eAAe,EAAE;AACvB,WAAO,GAAG,aAAa,OAAO,CAAC,EAAE,GAAG,MAAM,MAAM;AAEhD,QAAI,GAAG,WAAW,oBAAoB;AAClC,aAAO,GAAG,WAAW,mBAAmB,QAAQ,MAAM,EAAE,GAAG,MAAM,CAAC;AAAA,IACtE,OAAO;AACH;AAAA,QACI,CAAC,GAAG,GAAG,WAAW,iBAAiB,OAAO,CAAC,EAAE;AAAA,MACjD,EAAE,GAAG,MAAM,CAAC;AAAA,IAChB;AAAA,EACJ,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/theme-dark.dev.js
CHANGED
package/theme-dark.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["theme-dark.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport darkStyles from './src/theme-dark.css.js';\nimport { Theme } from './src/Theme.dev.js'\nimport './core.dev.js'\n\nTheme.registerThemeFragment('dark', 'color', darkStyles);\n"],
|
|
5
|
-
"mappings": "AAYA;
|
|
5
|
+
"mappings": ";AAYA,OAAO,gBAAgB;AACvB,SAAS,aAAa;AACtB,OAAO;AAEP,MAAM,sBAAsB,QAAQ,SAAS,UAAU;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/theme-dark.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"./src/theme-dark.css.js";import{Theme as e}from"./src/Theme.js";import"./core.js";e.registerThemeFragment("dark","color",r);
|
|
1
|
+
"use strict";import r from"./src/theme-dark.css.js";import{Theme as e}from"./src/Theme.js";import"./core.js";e.registerThemeFragment("dark","color",r);
|
|
2
2
|
//# sourceMappingURL=theme-dark.js.map
|
package/theme-dark.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["theme-dark.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport darkStyles from './src/theme-dark.css.js';\nimport { Theme } from './src/Theme.js';\nimport './core.js';\n\nTheme.registerThemeFragment('dark', 'color', darkStyles);\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAYA,OAAOA,MAAgB,0BACvB,OAAS,SAAAC,MAAa,iBACtB,MAAO,YAEPA,EAAM,sBAAsB,OAAQ,QAASD,CAAU",
|
|
6
|
+
"names": ["darkStyles", "Theme"]
|
|
7
7
|
}
|
package/theme-darkest.dev.js
CHANGED
package/theme-darkest.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["theme-darkest.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport darkStyles from './src/theme-darkest.css.js';\nimport { Theme } from './src/Theme.dev.js'\nimport './core.dev.js'\n\nTheme.registerThemeFragment('darkest', 'color', darkStyles);\n"],
|
|
5
|
-
"mappings": "AAYA;
|
|
5
|
+
"mappings": ";AAYA,OAAO,gBAAgB;AACvB,SAAS,aAAa;AACtB,OAAO;AAEP,MAAM,sBAAsB,WAAW,SAAS,UAAU;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/theme-darkest.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"./src/theme-darkest.css.js";import{Theme as e}from"./src/Theme.js";import"./core.js";e.registerThemeFragment("darkest","color",r);
|
|
1
|
+
"use strict";import r from"./src/theme-darkest.css.js";import{Theme as e}from"./src/Theme.js";import"./core.js";e.registerThemeFragment("darkest","color",r);
|
|
2
2
|
//# sourceMappingURL=theme-darkest.js.map
|
package/theme-darkest.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["theme-darkest.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport darkStyles from './src/theme-darkest.css.js';\nimport { Theme } from './src/Theme.js';\nimport './core.js';\n\nTheme.registerThemeFragment('darkest', 'color', darkStyles);\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAYA,OAAOA,MAAgB,6BACvB,OAAS,SAAAC,MAAa,iBACtB,MAAO,YAEPA,EAAM,sBAAsB,UAAW,QAASD,CAAU",
|
|
6
|
+
"names": ["darkStyles", "Theme"]
|
|
7
7
|
}
|
package/theme-light.dev.js
CHANGED
package/theme-light.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["theme-light.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport lightStyles from './src/theme-light.css.js';\nimport { Theme } from './src/Theme.dev.js'\nimport './core.dev.js'\n\nTheme.registerThemeFragment('light', 'color', lightStyles);\n"],
|
|
5
|
-
"mappings": "AAYA;
|
|
5
|
+
"mappings": ";AAYA,OAAO,iBAAiB;AACxB,SAAS,aAAa;AACtB,OAAO;AAEP,MAAM,sBAAsB,SAAS,SAAS,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/theme-light.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"./src/theme-light.css.js";import{Theme as e}from"./src/Theme.js";import"./core.js";e.registerThemeFragment("light","color",r);
|
|
1
|
+
"use strict";import r from"./src/theme-light.css.js";import{Theme as e}from"./src/Theme.js";import"./core.js";e.registerThemeFragment("light","color",r);
|
|
2
2
|
//# sourceMappingURL=theme-light.js.map
|