@spectrum-web-components/swatch 0.1.2-devmode.0 → 0.1.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/package.json +8 -5
- package/sp-swatch-group.js +14 -3
- package/sp-swatch-group.js.map +1 -7
- package/sp-swatch.js +14 -3
- package/sp-swatch.js.map +1 -7
- package/src/Swatch.js +170 -165
- package/src/Swatch.js.map +1 -7
- package/src/SwatchGroup.js +216 -201
- package/src/SwatchGroup.js.map +1 -7
- package/src/index.js +14 -3
- package/src/index.js.map +1 -7
- package/src/spectrum-swatch-group.css.js +14 -3
- package/src/spectrum-swatch-group.css.js.map +1 -7
- package/src/spectrum-swatch.css.js +14 -3
- package/src/spectrum-swatch.css.js.map +1 -7
- package/src/swatch-group.css.js +14 -3
- package/src/swatch-group.css.js.map +1 -7
- package/src/swatch.css.js +14 -3
- package/src/swatch.css.js.map +1 -7
- package/stories/swatch-group.stories.js +133 -124
- package/stories/swatch-group.stories.js.map +1 -7
- package/stories/swatch-sizes.stories.js +21 -15
- package/stories/swatch-sizes.stories.js.map +1 -7
- package/stories/swatch.stories.js +73 -69
- package/stories/swatch.stories.js.map +1 -7
- package/test/benchmark/basic-test.js +16 -5
- package/test/benchmark/basic-test.js.map +1 -7
- package/test/swatch-group.test-vrt.js +15 -4
- package/test/swatch-group.test-vrt.js.map +1 -7
- package/test/swatch-group.test.js +240 -229
- package/test/swatch-group.test.js.map +1 -7
- package/test/swatch-sizes.test-vrt.js +15 -4
- package/test/swatch-sizes.test-vrt.js.map +1 -7
- package/test/swatch.test-vrt.js +15 -4
- package/test/swatch.test-vrt.js.map +1 -7
- package/test/swatch.test.js +135 -124
- package/test/swatch.test.js.map +1 -7
- package/sp-swatch-group.dev.js +0 -3
- package/sp-swatch-group.dev.js.map +0 -7
- package/sp-swatch.dev.js +0 -3
- package/sp-swatch.dev.js.map +0 -7
- package/src/Swatch.dev.js +0 -219
- package/src/Swatch.dev.js.map +0 -7
- package/src/SwatchGroup.dev.js +0 -220
- package/src/SwatchGroup.dev.js.map +0 -7
- package/src/index.dev.js +0 -3
- package/src/index.dev.js.map +0 -7
- package/src/spectrum-swatch-group.css.dev.js +0 -10
- package/src/spectrum-swatch-group.css.dev.js.map +0 -7
- package/src/spectrum-swatch.css.dev.js +0 -66
- package/src/spectrum-swatch.css.dev.js.map +0 -7
- package/src/swatch-group.css.dev.js +0 -10
- package/src/swatch-group.css.dev.js.map +0 -7
- package/src/swatch.css.dev.js +0 -66
- package/src/swatch.css.dev.js.map +0 -7
|
@@ -1,100 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 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 { html } from '@spectrum-web-components/base';
|
|
13
|
+
import { ifDefined } from '@spectrum-web-components/base/src/directives.js';
|
|
14
|
+
import '../sp-swatch.js';
|
|
4
15
|
export default {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
argTypes: {
|
|
11
|
-
color: { control: "color" },
|
|
12
|
-
border: {
|
|
13
|
-
name: "border",
|
|
14
|
-
type: { name: "string", required: false },
|
|
15
|
-
description: "The border to apply to the Swatch children.",
|
|
16
|
-
table: {
|
|
17
|
-
defaultValue: { summary: "" }
|
|
18
|
-
},
|
|
19
|
-
control: {
|
|
20
|
-
type: "inline-radio",
|
|
21
|
-
options: ["normal", "light", "none"]
|
|
22
|
-
}
|
|
16
|
+
title: 'Swatch',
|
|
17
|
+
component: 'sp-swatch',
|
|
18
|
+
args: {
|
|
19
|
+
color: '#ff0000',
|
|
23
20
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
argTypes: {
|
|
22
|
+
color: { control: 'color' },
|
|
23
|
+
border: {
|
|
24
|
+
name: 'border',
|
|
25
|
+
type: { name: 'string', required: false },
|
|
26
|
+
description: 'The border to apply to the Swatch children.',
|
|
27
|
+
table: {
|
|
28
|
+
defaultValue: { summary: '' },
|
|
29
|
+
},
|
|
30
|
+
control: {
|
|
31
|
+
type: 'inline-radio',
|
|
32
|
+
options: ['normal', 'light', 'none'],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
rounding: {
|
|
36
|
+
name: 'rounding',
|
|
37
|
+
type: { name: 'string', required: false },
|
|
38
|
+
description: 'The rounding to apply to the Swatch children.',
|
|
39
|
+
table: {
|
|
40
|
+
defaultValue: { summary: '' },
|
|
41
|
+
},
|
|
42
|
+
control: {
|
|
43
|
+
type: 'inline-radio',
|
|
44
|
+
options: ['normal', 'none', 'full'],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
shape: {
|
|
48
|
+
name: 'shape',
|
|
49
|
+
type: { name: 'string', required: false },
|
|
50
|
+
description: 'The shape to apply to the Swatch children.',
|
|
51
|
+
table: {
|
|
52
|
+
defaultValue: { summary: '' },
|
|
53
|
+
},
|
|
54
|
+
control: {
|
|
55
|
+
type: 'inline-radio',
|
|
56
|
+
options: ['normal', 'rectangle'],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
35
59
|
},
|
|
36
|
-
shape: {
|
|
37
|
-
name: "shape",
|
|
38
|
-
type: { name: "string", required: false },
|
|
39
|
-
description: "The shape to apply to the Swatch children.",
|
|
40
|
-
table: {
|
|
41
|
-
defaultValue: { summary: "" }
|
|
42
|
-
},
|
|
43
|
-
control: {
|
|
44
|
-
type: "inline-radio",
|
|
45
|
-
options: ["normal", "rectangle"]
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
60
|
};
|
|
50
|
-
const template = ({
|
|
51
|
-
|
|
52
|
-
border,
|
|
53
|
-
rounding,
|
|
54
|
-
shape,
|
|
55
|
-
mixedValue: mixedValue2,
|
|
56
|
-
nothing: nothing2
|
|
57
|
-
}) => {
|
|
58
|
-
return html`
|
|
61
|
+
const template = ({ color, border, rounding, shape, mixedValue, nothing, }) => {
|
|
62
|
+
return html `
|
|
59
63
|
<sp-swatch
|
|
60
|
-
border=${ifDefined(border ===
|
|
61
|
-
rounding=${ifDefined(rounding ===
|
|
62
|
-
shape=${ifDefined(shape ===
|
|
64
|
+
border=${ifDefined(border === 'normal' ? undefined : border)}
|
|
65
|
+
rounding=${ifDefined(rounding === 'normal' ? undefined : rounding)}
|
|
66
|
+
shape=${ifDefined(shape === 'normal' ? undefined : shape)}
|
|
63
67
|
color=${color}
|
|
64
|
-
?mixed-value=${
|
|
65
|
-
?nothing=${
|
|
68
|
+
?mixed-value=${mixedValue}
|
|
69
|
+
?nothing=${nothing}
|
|
66
70
|
></sp-swatch>
|
|
67
71
|
`;
|
|
68
72
|
};
|
|
69
73
|
export const Default = (args) => template(args);
|
|
70
74
|
export const mixedValue = (args) => template(args);
|
|
71
75
|
mixedValue.args = {
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
mixedValue: true,
|
|
77
|
+
color: '',
|
|
74
78
|
};
|
|
75
79
|
export const nothing = (args) => template(args);
|
|
76
80
|
nothing.args = {
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
nothing: true,
|
|
82
|
+
color: '',
|
|
79
83
|
};
|
|
80
84
|
export const borderLight = (args) => template(args);
|
|
81
85
|
borderLight.args = {
|
|
82
|
-
|
|
86
|
+
border: 'light',
|
|
83
87
|
};
|
|
84
88
|
export const borderNone = (args) => template(args);
|
|
85
89
|
borderNone.args = {
|
|
86
|
-
|
|
90
|
+
border: 'none',
|
|
87
91
|
};
|
|
88
92
|
export const roundingNone = (args) => template(args);
|
|
89
93
|
roundingNone.args = {
|
|
90
|
-
|
|
94
|
+
rounding: 'none',
|
|
91
95
|
};
|
|
92
96
|
export const roundingFull = (args) => template(args);
|
|
93
97
|
roundingFull.args = {
|
|
94
|
-
|
|
98
|
+
rounding: 'full',
|
|
95
99
|
};
|
|
96
100
|
export const shapeRectangle = (args) => template(args);
|
|
97
101
|
shapeRectangle.args = {
|
|
98
|
-
|
|
102
|
+
shape: 'rectangle',
|
|
99
103
|
};
|
|
100
|
-
//# sourceMappingURL=swatch.stories.js.map
|
|
104
|
+
//# sourceMappingURL=swatch.stories.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["swatch.stories.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2022 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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '../sp-swatch.js';\nimport type {\n SwatchBorder,\n SwatchRounding,\n SwatchShape,\n} from '../src/Swatch.js';\n\ntype Properties = {\n color: string;\n border: SwatchBorder | 'normal';\n rounding: SwatchRounding | 'normal';\n shape: SwatchShape | 'normal';\n mixedValue?: boolean;\n nothing?: boolean;\n};\n\nexport default {\n title: 'Swatch',\n component: 'sp-swatch',\n args: {\n color: '#ff0000',\n },\n argTypes: {\n color: { control: 'color' },\n border: {\n name: 'border',\n type: { name: 'string', required: false },\n description: 'The border to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'light', 'none'],\n },\n },\n rounding: {\n name: 'rounding',\n type: { name: 'string', required: false },\n description: 'The rounding to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'none', 'full'],\n },\n },\n shape: {\n name: 'shape',\n type: { name: 'string', required: false },\n description: 'The shape to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'rectangle'],\n },\n },\n },\n};\n\nconst template = ({\n color,\n border,\n rounding,\n shape,\n mixedValue,\n nothing,\n}: Properties): TemplateResult => {\n return html`\n <sp-swatch\n border=${ifDefined(border === 'normal' ? undefined : border)}\n rounding=${ifDefined(rounding === 'normal' ? undefined : rounding)}\n shape=${ifDefined(shape === 'normal' ? undefined : shape)}\n color=${color}\n ?mixed-value=${mixedValue}\n ?nothing=${nothing}\n ></sp-swatch>\n `;\n};\n\nexport const Default = (args: Properties): TemplateResult => template(args);\nexport const mixedValue = (args: Properties): TemplateResult => template(args);\nmixedValue.args = {\n mixedValue: true,\n color: '',\n};\nexport const nothing = (args: Properties): TemplateResult => template(args);\nnothing.args = {\n nothing: true,\n color: '',\n};\nexport const borderLight = (args: Properties): TemplateResult => template(args);\nborderLight.args = {\n border: 'light',\n};\nexport const borderNone = (args: Properties): TemplateResult => template(args);\nborderNone.args = {\n border: 'none',\n};\nexport const roundingNone = (args: Properties): TemplateResult =>\n template(args);\nroundingNone.args = {\n rounding: 'none',\n};\nexport const roundingFull = (args: Properties): TemplateResult =>\n template(args);\nroundingFull.args = {\n rounding: 'full',\n};\nexport const shapeRectangle = (args: Properties): TemplateResult =>\n template(args);\nshapeRectangle.args = {\n shape: 'rectangle',\n};\n"],
|
|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Q,CAAC,IAAI,CAAC,CAAC;AACnB,YAAY,CAAC,IAAI,GAAG;IAChB,QAAQ,EAAE,MAAM;CACnB,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAgB,EAAkB,EAAE,CAC/D,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnB,cAAc,CAAC,IAAI,GAAG;IAClB,KAAK,EAAE,WAAW;CACrB,CAAC","sourcesContent":["/*\nCopyright 2022 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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '../sp-swatch.js';\nimport type {\n SwatchBorder,\n SwatchRounding,\n SwatchShape,\n} from '../src/Swatch.js';\n\ntype Properties = {\n color: string;\n border: SwatchBorder | 'normal';\n rounding: SwatchRounding | 'normal';\n shape: SwatchShape | 'normal';\n mixedValue?: boolean;\n nothing?: boolean;\n};\n\nexport default {\n title: 'Swatch',\n component: 'sp-swatch',\n args: {\n color: '#ff0000',\n },\n argTypes: {\n color: { control: 'color' },\n border: {\n name: 'border',\n type: { name: 'string', required: false },\n description: 'The border to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'light', 'none'],\n },\n },\n rounding: {\n name: 'rounding',\n type: { name: 'string', required: false },\n description: 'The rounding to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'none', 'full'],\n },\n },\n shape: {\n name: 'shape',\n type: { name: 'string', required: false },\n description: 'The shape to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'rectangle'],\n },\n },\n },\n};\n\nconst template = ({\n color,\n border,\n rounding,\n shape,\n mixedValue,\n nothing,\n}: Properties): TemplateResult => {\n return html`\n <sp-swatch\n border=${ifDefined(border === 'normal' ? undefined : border)}\n rounding=${ifDefined(rounding === 'normal' ? undefined : rounding)}\n shape=${ifDefined(shape === 'normal' ? undefined : shape)}\n color=${color}\n ?mixed-value=${mixedValue}\n ?nothing=${nothing}\n ></sp-swatch>\n `;\n};\n\nexport const Default = (args: Properties): TemplateResult => template(args);\nexport const mixedValue = (args: Properties): TemplateResult => template(args);\nmixedValue.args = {\n mixedValue: true,\n color: '',\n};\nexport const nothing = (args: Properties): TemplateResult => template(args);\nnothing.args = {\n nothing: true,\n color: '',\n};\nexport const borderLight = (args: Properties): TemplateResult => template(args);\nborderLight.args = {\n border: 'light',\n};\nexport const borderNone = (args: Properties): TemplateResult => template(args);\nborderNone.args = {\n border: 'none',\n};\nexport const roundingNone = (args: Properties): TemplateResult =>\n template(args);\nroundingNone.args = {\n rounding: 'none',\n};\nexport const roundingFull = (args: Properties): TemplateResult =>\n template(args);\nroundingFull.args = {\n rounding: 'full',\n};\nexport const shapeRectangle = (args: Properties): TemplateResult =>\n template(args);\nshapeRectangle.args = {\n shape: 'rectangle',\n};\n"]}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 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/swatch/sp-swatch.js';
|
|
13
|
+
import { html } from '@spectrum-web-components/base';
|
|
14
|
+
import { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';
|
|
15
|
+
measureFixtureCreation(html `
|
|
5
16
|
<sp-swatch></sp-swatch>
|
|
6
17
|
`);
|
|
7
|
-
//# sourceMappingURL=basic-test.js.map
|
|
18
|
+
//# sourceMappingURL=basic-test.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["basic-test.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2022 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/swatch/sp-swatch.js';\nimport { html } from '@spectrum-web-components/base';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-swatch></sp-swatch>\n`);\n"],
|
|
5
|
-
"mappings": "AAWA;AACA;AACA;AAEA,uBAAuB;AAAA;AAAA,CAEtB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"basic-test.js","sourceRoot":"","sources":["basic-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,8CAA8C,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,sBAAsB,CAAC,IAAI,CAAA;;CAE1B,CAAC,CAAC","sourcesContent":["/*\nCopyright 2022 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/swatch/sp-swatch.js';\nimport { html } from '@spectrum-web-components/base';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-swatch></sp-swatch>\n`);\n"]}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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/swatch-group.stories.js';
|
|
13
|
+
import { regressVisuals } from '../../../test/visual/test.js';
|
|
14
|
+
regressVisuals('SwatchGroupStories', stories);
|
|
15
|
+
//# sourceMappingURL=swatch-group.test-vrt.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["swatch-group.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/swatch-group.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('SwatchGroupStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA;AACA;AAEA,eAAe,sBAAsB,OAAO;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"swatch-group.test-vrt.js","sourceRoot":"","sources":["swatch-group.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,oBAAoB,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/swatch-group.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('SwatchGroupStories', stories);\n"]}
|