@spectrum-web-components/thumbnail 0.5.1 → 0.5.4
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/custom-elements.json +0 -57
- package/package.json +4 -4
- package/src/Thumbnail.js.map +1 -1
- package/src/spectrum-thumbnail.css.js +3 -3
- package/src/spectrum-thumbnail.css.js.map +1 -1
- package/src/thumbnail.css.js +3 -3
- package/src/thumbnail.css.js.map +1 -1
- package/stories/images.js +3 -3
- package/stories/images.js.map +1 -1
- package/test/benchmark/basic-test.js +21 -0
- package/test/benchmark/basic-test.js.map +1 -0
- package/test/thumbnail-sizes.test-vrt.js +15 -0
- package/test/thumbnail-sizes.test-vrt.js.map +1 -0
- package/test/thumbnail.test-vrt.js +15 -0
- package/test/thumbnail.test-vrt.js.map +1 -0
- package/test/thumbnail.test.js +44 -0
- package/test/thumbnail.test.js.map +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
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 '@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 `
|
|
17
|
+
<sp-thumbnail>
|
|
18
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
19
|
+
</sp-thumbnail>
|
|
20
|
+
`);
|
|
21
|
+
//# sourceMappingURL=basic-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic-test.js","sourceRoot":"","sources":["basic-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,oDAAoD,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,sBAAsB,CAAC,IAAI,CAAA;;mBAER,SAAS;;CAE3B,CAAC,CAAC","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"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
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 * 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thumbnail-sizes.test-vrt.js","sourceRoot":"","sources":["thumbnail-sizes.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC","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"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
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 * 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thumbnail.test-vrt.js","sourceRoot":"","sources":["thumbnail.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC","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"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
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 { 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 `
|
|
18
|
+
<sp-thumbnail>
|
|
19
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
20
|
+
</sp-thumbnail>
|
|
21
|
+
`);
|
|
22
|
+
await elementUpdated(el);
|
|
23
|
+
await expect(el).to.be.accessible();
|
|
24
|
+
});
|
|
25
|
+
it('can be size `xxs`', async () => {
|
|
26
|
+
const el = await fixture(html `
|
|
27
|
+
<sp-thumbnail size="xxs">
|
|
28
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
29
|
+
</sp-thumbnail>
|
|
30
|
+
`);
|
|
31
|
+
await elementUpdated(el);
|
|
32
|
+
expect(el.size).to.equal('xxs');
|
|
33
|
+
});
|
|
34
|
+
it('accepts `background`', async () => {
|
|
35
|
+
const el = await fixture(html `
|
|
36
|
+
<sp-thumbnail background="blue">
|
|
37
|
+
<img src=${thumbnail} alt="Woman crouching" />
|
|
38
|
+
</sp-thumbnail>
|
|
39
|
+
`);
|
|
40
|
+
const background = el.shadowRoot.querySelector('.background');
|
|
41
|
+
expect(background).to.not.be.null;
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=thumbnail.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thumbnail.test.js","sourceRoot":"","sources":["thumbnail.test.ts"],"names":[],"mappings":"AAAA;;;;;;;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\");\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"]}
|