@spectrum-web-components/thumbnail 0.5.6 → 0.5.7-devmode.0
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/package.json +20 -7
- package/sp-thumbnail.dev.js +3 -0
- package/sp-thumbnail.dev.js.map +7 -0
- package/sp-thumbnail.js +3 -14
- package/sp-thumbnail.js.map +7 -1
- package/src/Thumbnail.dev.js +48 -0
- package/src/Thumbnail.dev.js.map +7 -0
- package/src/Thumbnail.js +39 -43
- package/src/Thumbnail.js.map +7 -1
- package/src/index.dev.js +2 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -13
- package/src/index.js.map +7 -1
- package/src/spectrum-thumbnail.css.dev.js +110 -0
- package/src/spectrum-thumbnail.css.dev.js.map +7 -0
- package/src/spectrum-thumbnail.css.js +3 -14
- package/src/spectrum-thumbnail.css.js.map +7 -1
- package/src/thumbnail.css.dev.js +110 -0
- package/src/thumbnail.css.dev.js.map +7 -0
- package/src/thumbnail.css.js +3 -14
- package/src/thumbnail.css.js.map +7 -1
- package/stories/images.js +4 -15
- package/stories/images.js.map +7 -1
- package/stories/thumbnail-sizes.stories.js +15 -24
- package/stories/thumbnail-sizes.stories.js.map +7 -1
- package/stories/thumbnail.stories.js +18 -25
- package/stories/thumbnail.stories.js.map +7 -1
- package/test/benchmark/basic-test.js +6 -17
- package/test/benchmark/basic-test.js.map +7 -1
- package/test/thumbnail-sizes.test-vrt.js +4 -15
- package/test/thumbnail-sizes.test-vrt.js.map +7 -1
- package/test/thumbnail.test-vrt.js +4 -15
- package/test/thumbnail.test-vrt.js.map +7 -1
- package/test/thumbnail.test.js +20 -31
- package/test/thumbnail.test.js.map +7 -1
|
@@ -1,31 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { html } from '@spectrum-web-components/base';
|
|
13
|
-
import '../sp-thumbnail.js';
|
|
14
|
-
import { thumbnail as image } from './images.js';
|
|
1
|
+
import { html } from "@spectrum-web-components/base";
|
|
2
|
+
import "@spectrum-web-components/thumbnail/sp-thumbnail.js";
|
|
3
|
+
import { thumbnail as image } from "./images.js";
|
|
15
4
|
export default {
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
title: "Thumbnail/Sizes",
|
|
6
|
+
component: "sp-thumbnail"
|
|
18
7
|
};
|
|
19
|
-
const thumbnail = ({
|
|
20
|
-
|
|
8
|
+
const thumbnail = ({
|
|
9
|
+
size
|
|
10
|
+
}) => {
|
|
11
|
+
return html`
|
|
21
12
|
<sp-thumbnail size=${size}>
|
|
22
13
|
<img src=${image} alt="Woman crouching" />
|
|
23
14
|
</sp-thumbnail>
|
|
24
15
|
`;
|
|
25
16
|
};
|
|
26
|
-
export const XXS = () => thumbnail({ size:
|
|
27
|
-
export const XS = () => thumbnail({ size:
|
|
28
|
-
export const s = () => thumbnail({ size:
|
|
29
|
-
export const m = () => thumbnail({ size:
|
|
30
|
-
export const l = () => thumbnail({ size:
|
|
31
|
-
//# sourceMappingURL=thumbnail-sizes.stories.js.map
|
|
17
|
+
export const XXS = () => thumbnail({ size: "xxs" });
|
|
18
|
+
export const XS = () => thumbnail({ size: "xs" });
|
|
19
|
+
export const s = () => thumbnail({ size: "s" });
|
|
20
|
+
export const m = () => thumbnail({ size: "m" });
|
|
21
|
+
export const l = () => thumbnail({ size: "l" });
|
|
22
|
+
//# sourceMappingURL=thumbnail-sizes.stories.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["thumbnail-sizes.stories.ts"],
|
|
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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/thumbnail/sp-thumbnail.js';\nimport { thumbnail as image } from './images.js';\n\nexport default {\n title: 'Thumbnail/Sizes',\n component: 'sp-thumbnail',\n};\n\nconst thumbnail = ({\n size,\n}: {\n size: 'xxs' | 'xs' | 's' | 'm' | 'l';\n}): TemplateResult => {\n return html`\n <sp-thumbnail size=${size}>\n <img src=${image} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `;\n};\n\nexport const XXS = (): TemplateResult => thumbnail({ size: 'xxs' });\n\nexport const XS = (): TemplateResult => thumbnail({ size: 'xs' });\n\nexport const s = (): TemplateResult => thumbnail({ size: 's' });\n\nexport const m = (): TemplateResult => thumbnail({ size: 'm' });\n\nexport const l = (): TemplateResult => thumbnail({ size: 'l' });\n"],
|
|
5
|
+
"mappings": "AAYA;AAEA;AACA;AAEA,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AACf;AAEA,MAAM,YAAY,CAAC;AAAA,EACf;AAAA,MAGkB;AAClB,SAAO;AAAA,6BACkB;AAAA,uBACN;AAAA;AAAA;AAGvB;AAEO,aAAM,MAAM,MAAsB,UAAU,EAAE,MAAM,MAAM,CAAC;AAE3D,aAAM,KAAK,MAAsB,UAAU,EAAE,MAAM,KAAK,CAAC;AAEzD,aAAM,IAAI,MAAsB,UAAU,EAAE,MAAM,IAAI,CAAC;AAEvD,aAAM,IAAI,MAAsB,UAAU,EAAE,MAAM,IAAI,CAAC;AAEvD,aAAM,IAAI,MAAsB,UAAU,EAAE,MAAM,IAAI,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,51 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { html } from '@spectrum-web-components/base';
|
|
13
|
-
import '../sp-thumbnail.js';
|
|
14
|
-
import { landscape as landscapeImage, portrait as portraitImage, thumbnail, } from './images.js';
|
|
1
|
+
import { html } from "@spectrum-web-components/base";
|
|
2
|
+
import "@spectrum-web-components/thumbnail/sp-thumbnail.js";
|
|
3
|
+
import {
|
|
4
|
+
landscape as landscapeImage,
|
|
5
|
+
portrait as portraitImage,
|
|
6
|
+
thumbnail
|
|
7
|
+
} from "./images.js";
|
|
15
8
|
export default {
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
title: "Thumbnail",
|
|
10
|
+
component: "sp-thumbnail"
|
|
18
11
|
};
|
|
19
12
|
export const Default = () => {
|
|
20
|
-
|
|
13
|
+
return html`
|
|
21
14
|
<sp-thumbnail>
|
|
22
15
|
<img src=${thumbnail} alt="Woman crouching" />
|
|
23
16
|
</sp-thumbnail>
|
|
24
17
|
`;
|
|
25
18
|
};
|
|
26
19
|
export const selected = () => {
|
|
27
|
-
|
|
20
|
+
return html`
|
|
28
21
|
<sp-thumbnail selected>
|
|
29
22
|
<img src=${thumbnail} alt="Woman crouching" />
|
|
30
23
|
</sp-thumbnail>
|
|
31
24
|
`;
|
|
32
25
|
};
|
|
33
26
|
export const focused = () => {
|
|
34
|
-
|
|
27
|
+
return html`
|
|
35
28
|
<sp-thumbnail focused>
|
|
36
29
|
<img src=${thumbnail} alt="Woman crouching" />
|
|
37
30
|
</sp-thumbnail>
|
|
38
31
|
`;
|
|
39
32
|
};
|
|
40
33
|
export const portrait = () => {
|
|
41
|
-
|
|
34
|
+
return html`
|
|
42
35
|
<sp-thumbnail>
|
|
43
36
|
<img src=${portraitImage} alt="Eiffel Tower at night" />
|
|
44
37
|
</sp-thumbnail>
|
|
45
38
|
`;
|
|
46
39
|
};
|
|
47
40
|
export const landscape = () => {
|
|
48
|
-
|
|
41
|
+
return html`
|
|
49
42
|
<sp-thumbnail>
|
|
50
43
|
<img
|
|
51
44
|
src=${landscapeImage}
|
|
@@ -55,14 +48,14 @@ export const landscape = () => {
|
|
|
55
48
|
`;
|
|
56
49
|
};
|
|
57
50
|
export const portraitCover = () => {
|
|
58
|
-
|
|
51
|
+
return html`
|
|
59
52
|
<sp-thumbnail cover>
|
|
60
53
|
<img src=${portraitImage} alt="Eiffel Tower at night" />
|
|
61
54
|
</sp-thumbnail>
|
|
62
55
|
`;
|
|
63
56
|
};
|
|
64
57
|
export const landscapeCover = () => {
|
|
65
|
-
|
|
58
|
+
return html`
|
|
66
59
|
<sp-thumbnail cover>
|
|
67
60
|
<img
|
|
68
61
|
src=${landscapeImage}
|
|
@@ -72,10 +65,10 @@ export const landscapeCover = () => {
|
|
|
72
65
|
`;
|
|
73
66
|
};
|
|
74
67
|
export const background = () => {
|
|
75
|
-
|
|
68
|
+
return html`
|
|
76
69
|
<sp-thumbnail background="orange">
|
|
77
70
|
<img src=${thumbnail} alt="Woman crouching" />
|
|
78
71
|
</sp-thumbnail>
|
|
79
72
|
`;
|
|
80
73
|
};
|
|
81
|
-
//# sourceMappingURL=thumbnail.stories.js.map
|
|
74
|
+
//# sourceMappingURL=thumbnail.stories.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["thumbnail.stories.ts"],
|
|
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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/thumbnail/sp-thumbnail.js';\nimport {\n landscape as landscapeImage,\n portrait as portraitImage,\n thumbnail,\n} from './images.js';\n\nexport default {\n title: 'Thumbnail',\n component: 'sp-thumbnail',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-thumbnail>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `;\n};\n\nexport const selected = (): TemplateResult => {\n return html`\n <sp-thumbnail selected>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `;\n};\n\nexport const focused = (): TemplateResult => {\n return html`\n <sp-thumbnail focused>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `;\n};\n\nexport const portrait = (): TemplateResult => {\n return html`\n <sp-thumbnail>\n <img src=${portraitImage} alt=\"Eiffel Tower at night\" />\n </sp-thumbnail>\n `;\n};\n\nexport const landscape = (): TemplateResult => {\n return html`\n <sp-thumbnail>\n <img\n src=${landscapeImage}\n alt=\"Landscape with mountains and lake\"\n />\n </sp-thumbnail>\n `;\n};\n\nexport const portraitCover = (): TemplateResult => {\n return html`\n <sp-thumbnail cover>\n <img src=${portraitImage} alt=\"Eiffel Tower at night\" />\n </sp-thumbnail>\n `;\n};\n\nexport const landscapeCover = (): TemplateResult => {\n return html`\n <sp-thumbnail cover>\n <img\n src=${landscapeImage}\n alt=\"Landscape with mountains and lake\"\n />\n </sp-thumbnail>\n `;\n};\n\nexport const background = (): TemplateResult => {\n return html`\n <sp-thumbnail background=\"orange\">\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `;\n};\n"],
|
|
5
|
+
"mappings": "AAYA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAMA,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AACf;AAEO,aAAM,UAAU,MAAsB;AACzC,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;AAEO,aAAM,WAAW,MAAsB;AAC1C,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;AAEO,aAAM,UAAU,MAAsB;AACzC,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;AAEO,aAAM,WAAW,MAAsB;AAC1C,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;AAEO,aAAM,YAAY,MAAsB;AAC3C,SAAO;AAAA;AAAA;AAAA,sBAGW;AAAA;AAAA;AAAA;AAAA;AAKtB;AAEO,aAAM,gBAAgB,MAAsB;AAC/C,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;AAEO,aAAM,iBAAiB,MAAsB;AAChD,SAAO;AAAA;AAAA;AAAA,sBAGW;AAAA;AAAA;AAAA;AAAA;AAKtB;AAEO,aAAM,aAAa,MAAsB;AAC5C,SAAO;AAAA;AAAA,uBAEY;AAAA;AAAA;AAGvB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import '@spectrum-web-components/thumbnail/sp-thumbnail.js';
|
|
13
|
-
import { html } from 'lit';
|
|
14
|
-
import { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';
|
|
15
|
-
import { thumbnail } from '../../stories/images.js';
|
|
16
|
-
measureFixtureCreation(html `
|
|
1
|
+
import "@spectrum-web-components/thumbnail/sp-thumbnail.js";
|
|
2
|
+
import { html } from "lit";
|
|
3
|
+
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
4
|
+
import { thumbnail } from "../../stories/images.js";
|
|
5
|
+
measureFixtureCreation(html`
|
|
17
6
|
<sp-thumbnail>
|
|
18
7
|
<img src=${thumbnail} alt="Woman crouching" />
|
|
19
8
|
</sp-thumbnail>
|
|
20
9
|
`);
|
|
21
|
-
//# sourceMappingURL=basic-test.js.map
|
|
10
|
+
//# sourceMappingURL=basic-test.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["basic-test.ts"],
|
|
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/thumbnail/sp-thumbnail.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\nimport { thumbnail } from '../../stories/images.js';\n\nmeasureFixtureCreation(html`\n <sp-thumbnail>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n`);\n"],
|
|
5
|
+
"mappings": "AAYA;AACA;AACA;AACA;AAEA,uBAAuB;AAAA;AAAA,mBAEJ;AAAA;AAAA,CAElB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import * as stories from '../stories/thumbnail-sizes.stories.js';
|
|
13
|
-
import { regressVisuals } from '../../../test/visual/test.js';
|
|
14
|
-
regressVisuals('ThumbnailSizesStories', stories);
|
|
15
|
-
//# sourceMappingURL=thumbnail-sizes.test-vrt.js.map
|
|
1
|
+
import * as stories from "../stories/thumbnail-sizes.stories.js";
|
|
2
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
3
|
+
regressVisuals("ThumbnailSizesStories", stories);
|
|
4
|
+
//# sourceMappingURL=thumbnail-sizes.test-vrt.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["thumbnail-sizes.test-vrt.ts"],
|
|
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/thumbnail-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ThumbnailSizesStories', stories);\n"],
|
|
5
|
+
"mappings": "AAYA;AACA;AAEA,eAAe,yBAAyB,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import * as stories from '../stories/thumbnail.stories.js';
|
|
13
|
-
import { regressVisuals } from '../../../test/visual/test.js';
|
|
14
|
-
regressVisuals('ThumbnailStories', stories);
|
|
15
|
-
//# sourceMappingURL=thumbnail.test-vrt.js.map
|
|
1
|
+
import * as stories from "../stories/thumbnail.stories.js";
|
|
2
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
3
|
+
regressVisuals("ThumbnailStories", stories);
|
|
4
|
+
//# sourceMappingURL=thumbnail.test-vrt.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["thumbnail.test-vrt.ts"],
|
|
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/thumbnail.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ThumbnailStories', stories);\n"],
|
|
5
|
+
"mappings": "AAYA;AACA;AAEA,eAAe,oBAAoB,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/test/thumbnail.test.js
CHANGED
|
@@ -1,44 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { elementUpdated, expect, fixture, html } from '@open-wc/testing';
|
|
13
|
-
import '../sp-thumbnail.js';
|
|
14
|
-
import { thumbnail } from '../stories/images.js';
|
|
15
|
-
describe('Thumbnail', () => {
|
|
16
|
-
it('loads default thumbnail accessibly', async () => {
|
|
17
|
-
const el = await fixture(html `
|
|
1
|
+
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
2
|
+
import "../sp-thumbnail.js";
|
|
3
|
+
import { thumbnail } from "../stories/images.js";
|
|
4
|
+
describe("Thumbnail", () => {
|
|
5
|
+
it("loads default thumbnail accessibly", async () => {
|
|
6
|
+
const el = await fixture(html`
|
|
18
7
|
<sp-thumbnail>
|
|
19
8
|
<img src=${thumbnail} alt="Woman crouching" />
|
|
20
9
|
</sp-thumbnail>
|
|
21
10
|
`);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
await elementUpdated(el);
|
|
12
|
+
await expect(el).to.be.accessible();
|
|
13
|
+
});
|
|
14
|
+
it("can be size `xxs`", async () => {
|
|
15
|
+
const el = await fixture(html`
|
|
27
16
|
<sp-thumbnail size="xxs">
|
|
28
17
|
<img src=${thumbnail} alt="Woman crouching" />
|
|
29
18
|
</sp-thumbnail>
|
|
30
19
|
`);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
await elementUpdated(el);
|
|
21
|
+
expect(el.size).to.equal("xxs");
|
|
22
|
+
});
|
|
23
|
+
it("accepts `background`", async () => {
|
|
24
|
+
const el = await fixture(html`
|
|
36
25
|
<sp-thumbnail background="blue">
|
|
37
26
|
<img src=${thumbnail} alt="Woman crouching" />
|
|
38
27
|
</sp-thumbnail>
|
|
39
28
|
`);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
const background = el.shadowRoot.querySelector(".background");
|
|
30
|
+
expect(background).to.not.be.null;
|
|
31
|
+
});
|
|
43
32
|
});
|
|
44
|
-
//# sourceMappingURL=thumbnail.test.js.map
|
|
33
|
+
//# sourceMappingURL=thumbnail.test.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["thumbnail.test.ts"],
|
|
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 { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\nimport '../sp-thumbnail.js';\nimport { Thumbnail } from '..';\nimport { thumbnail } from '../stories/images.js';\n\ndescribe('Thumbnail', () => {\n it('loads default thumbnail accessibly', async () => {\n const el = await fixture<Thumbnail>(\n html`\n <sp-thumbnail>\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('can be size `xxs`', async () => {\n const el = await fixture<Thumbnail>(\n html`\n <sp-thumbnail size=\"xxs\">\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.size).to.equal('xxs');\n });\n it('accepts `background`', async () => {\n const el = await fixture<Thumbnail>(\n html`\n <sp-thumbnail background=\"blue\">\n <img src=${thumbnail} alt=\"Woman crouching\" />\n </sp-thumbnail>\n `\n );\n\n const background = el.shadowRoot.querySelector('.background');\n expect(background).to.not.be.null;\n });\n});\n"],
|
|
5
|
+
"mappings": "AAYA;AAEA;AAEA;AAEA,SAAS,aAAa,MAAM;AACxB,KAAG,sCAAsC,YAAY;AACjD,UAAM,KAAK,MAAM,QACb;AAAA;AAAA,+BAEmB;AAAA;AAAA,aAGvB;AAEA,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,qBAAqB,YAAY;AAChC,UAAM,KAAK,MAAM,QACb;AAAA;AAAA,+BAEmB;AAAA;AAAA,aAGvB;AAEA,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,IAAI,EAAE,GAAG,MAAM,KAAK;AAAA,EAClC,CAAC;AACD,KAAG,wBAAwB,YAAY;AACnC,UAAM,KAAK,MAAM,QACb;AAAA;AAAA,+BAEmB;AAAA;AAAA,aAGvB;AAEA,UAAM,aAAa,GAAG,WAAW,cAAc,aAAa;AAC5D,WAAO,UAAU,EAAE,GAAG,IAAI,GAAG;AAAA,EACjC,CAAC;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|