@spectrum-web-components/button 0.18.0 → 0.18.1
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 +193 -34
- package/custom-elements.json +90 -90
- package/package.json +50 -16
- package/sp-button.dev.js +3 -0
- package/sp-button.dev.js.map +7 -0
- package/sp-button.js +3 -14
- package/sp-button.js.map +7 -1
- package/sp-clear-button.dev.js +3 -0
- package/sp-clear-button.dev.js.map +7 -0
- package/sp-clear-button.js +3 -14
- package/sp-clear-button.js.map +7 -1
- package/sp-close-button.dev.js +3 -0
- package/sp-close-button.dev.js.map +7 -0
- package/sp-close-button.js +3 -14
- package/sp-close-button.js.map +7 -1
- package/src/Button.dev.js +79 -0
- package/src/Button.dev.js.map +7 -0
- package/src/Button.js +72 -87
- package/src/Button.js.map +7 -1
- package/src/ButtonBase.dev.js +215 -0
- package/src/ButtonBase.dev.js.map +7 -0
- package/src/ButtonBase.js +198 -201
- package/src/ButtonBase.js.map +7 -1
- package/src/ClearButton.dev.js +70 -0
- package/src/ClearButton.dev.js.map +7 -0
- package/src/ClearButton.js +45 -52
- package/src/ClearButton.js.map +7 -1
- package/src/CloseButton.dev.js +65 -0
- package/src/CloseButton.dev.js.map +7 -0
- package/src/CloseButton.js +42 -49
- package/src/CloseButton.js.map +7 -1
- package/src/StyledButton.dev.js +8 -0
- package/src/StyledButton.dev.js.map +7 -0
- package/src/StyledButton.js +6 -17
- package/src/StyledButton.js.map +7 -1
- package/src/button-base.css.dev.js +10 -0
- package/src/button-base.css.dev.js.map +7 -0
- package/src/button-base.css.js +4 -15
- package/src/button-base.css.js.map +7 -1
- package/src/button.css.dev.js +619 -0
- package/src/button.css.dev.js.map +7 -0
- package/src/button.css.js +4 -15
- package/src/button.css.js.map +7 -1
- package/src/index.dev.js +6 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +6 -17
- package/src/index.js.map +7 -1
- package/src/spectrum-button-base.css.dev.js +6 -0
- package/src/spectrum-button-base.css.dev.js.map +7 -0
- package/src/spectrum-button-base.css.js +3 -14
- package/src/spectrum-button-base.css.js.map +7 -1
- package/src/spectrum-button.css.dev.js +587 -0
- package/src/spectrum-button.css.dev.js.map +7 -0
- package/src/spectrum-button.css.js +4 -15
- package/src/spectrum-button.css.js.map +7 -1
- package/stories/button-accent-fill-sizes.stories.js +21 -18
- package/stories/button-accent-fill-sizes.stories.js.map +7 -1
- package/stories/button-accent-fill.stories.js +24 -20
- package/stories/button-accent-fill.stories.js.map +7 -1
- package/stories/button-accent-outline-sizes.stories.js +21 -18
- package/stories/button-accent-outline-sizes.stories.js.map +7 -1
- package/stories/button-accent-outline.stories.js +24 -20
- package/stories/button-accent-outline.stories.js.map +7 -1
- package/stories/button-black-fill-sizes.stories.js +22 -19
- package/stories/button-black-fill-sizes.stories.js.map +7 -1
- package/stories/button-black-fill.stories.js +26 -21
- package/stories/button-black-fill.stories.js.map +7 -1
- package/stories/button-black-outline-sizes.stories.js +22 -19
- package/stories/button-black-outline-sizes.stories.js.map +7 -1
- package/stories/button-black-outline.stories.js +26 -21
- package/stories/button-black-outline.stories.js.map +7 -1
- package/stories/button-negative-fill-sizes.stories.js +21 -18
- package/stories/button-negative-fill-sizes.stories.js.map +7 -1
- package/stories/button-negative-fill.stories.js +24 -20
- package/stories/button-negative-fill.stories.js.map +7 -1
- package/stories/button-negative-outline-sizes.stories.js +21 -18
- package/stories/button-negative-outline-sizes.stories.js.map +7 -1
- package/stories/button-negative-outline.stories.js +24 -20
- package/stories/button-negative-outline.stories.js.map +7 -1
- package/stories/button-primary-fill-sizes.stories.js +21 -18
- package/stories/button-primary-fill-sizes.stories.js.map +7 -1
- package/stories/button-primary-fill.stories.js +24 -20
- package/stories/button-primary-fill.stories.js.map +7 -1
- package/stories/button-primary-outline-sizes.stories.js +21 -18
- package/stories/button-primary-outline-sizes.stories.js.map +7 -1
- package/stories/button-primary-outline.stories.js +24 -20
- package/stories/button-primary-outline.stories.js.map +7 -1
- package/stories/button-secondary-fill-sizes.stories.js +21 -18
- package/stories/button-secondary-fill-sizes.stories.js.map +7 -1
- package/stories/button-secondary-fill.stories.js +24 -20
- package/stories/button-secondary-fill.stories.js.map +7 -1
- package/stories/button-secondary-outline-sizes.stories.js +21 -18
- package/stories/button-secondary-outline-sizes.stories.js.map +7 -1
- package/stories/button-secondary-outline.stories.js +24 -20
- package/stories/button-secondary-outline.stories.js.map +7 -1
- package/stories/button-white-fill-sizes.stories.js +22 -19
- package/stories/button-white-fill-sizes.stories.js.map +7 -1
- package/stories/button-white-fill.stories.js +26 -21
- package/stories/button-white-fill.stories.js.map +7 -1
- package/stories/button-white-outline-sizes.stories.js +22 -19
- package/stories/button-white-outline-sizes.stories.js.map +7 -1
- package/stories/button-white-outline.stories.js +26 -21
- package/stories/button-white-outline.stories.js.map +7 -1
- package/stories/index.js +92 -93
- package/stories/index.js.map +7 -1
- package/test/benchmark/test-basic.js +5 -16
- package/test/benchmark/test-basic.js.map +7 -1
- package/test/button-accent-fill-sizes.test-vrt.js +4 -15
- package/test/button-accent-fill-sizes.test-vrt.js.map +7 -1
- package/test/button-accent-fill.test-vrt.js +4 -15
- package/test/button-accent-fill.test-vrt.js.map +7 -1
- package/test/button-accent-outline-sizes.test-vrt.js +4 -15
- package/test/button-accent-outline-sizes.test-vrt.js.map +7 -1
- package/test/button-accent-outline.test-vrt.js +4 -15
- package/test/button-accent-outline.test-vrt.js.map +7 -1
- package/test/button-black-fill-sizes.test-vrt.js +4 -15
- package/test/button-black-fill-sizes.test-vrt.js.map +7 -1
- package/test/button-black-fill.test-vrt.js +4 -15
- package/test/button-black-fill.test-vrt.js.map +7 -1
- package/test/button-black-outline-sizes.test-vrt.js +4 -15
- package/test/button-black-outline-sizes.test-vrt.js.map +7 -1
- package/test/button-black-outline.test-vrt.js +4 -15
- package/test/button-black-outline.test-vrt.js.map +7 -1
- package/test/button-negative-fill-sizes.test-vrt.js +4 -15
- package/test/button-negative-fill-sizes.test-vrt.js.map +7 -1
- package/test/button-negative-fill.test-vrt.js +4 -15
- package/test/button-negative-fill.test-vrt.js.map +7 -1
- package/test/button-negative-outline-sizes.test-vrt.js +4 -15
- package/test/button-negative-outline-sizes.test-vrt.js.map +7 -1
- package/test/button-negative-outline.test-vrt.js +4 -15
- package/test/button-negative-outline.test-vrt.js.map +7 -1
- package/test/button-primary-fill-sizes.test-vrt.js +4 -15
- package/test/button-primary-fill-sizes.test-vrt.js.map +7 -1
- package/test/button-primary-fill.test-vrt.js +4 -15
- package/test/button-primary-fill.test-vrt.js.map +7 -1
- package/test/button-primary-outline-sizes.test-vrt.js +4 -15
- package/test/button-primary-outline-sizes.test-vrt.js.map +7 -1
- package/test/button-primary-outline.test-vrt.js +4 -15
- package/test/button-primary-outline.test-vrt.js.map +7 -1
- package/test/button-secondary-fill-sizes.test-vrt.js +4 -15
- package/test/button-secondary-fill-sizes.test-vrt.js.map +7 -1
- package/test/button-secondary-fill.test-vrt.js +4 -15
- package/test/button-secondary-fill.test-vrt.js.map +7 -1
- package/test/button-secondary-outline-sizes.test-vrt.js +4 -15
- package/test/button-secondary-outline-sizes.test-vrt.js.map +7 -1
- package/test/button-secondary-outline.test-vrt.js +4 -15
- package/test/button-secondary-outline.test-vrt.js.map +7 -1
- package/test/button-white-fill-sizes.test-vrt.js +4 -15
- package/test/button-white-fill-sizes.test-vrt.js.map +7 -1
- package/test/button-white-fill.test-vrt.js +4 -15
- package/test/button-white-fill.test-vrt.js.map +7 -1
- package/test/button-white-outline-sizes.test-vrt.js +4 -15
- package/test/button-white-outline-sizes.test-vrt.js.map +7 -1
- package/test/button-white-outline.test-vrt.js +4 -15
- package/test/button-white-outline.test-vrt.js.map +7 -1
- package/test/button.test.js +321 -320
- package/test/button.test.js.map +7 -1
- package/test/clear-button.test.js +13 -20
- package/test/clear-button.test.js.map +7 -1
- package/test/close-button.test.js +13 -20
- package/test/close-button.test.js.map +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/button",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,15 +20,49 @@
|
|
|
20
20
|
"module": "./src/index.js",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
|
-
".":
|
|
24
|
-
|
|
23
|
+
".": {
|
|
24
|
+
"development": "./src/index.dev.js",
|
|
25
|
+
"default": "./src/index.js"
|
|
26
|
+
},
|
|
25
27
|
"./package.json": "./package.json",
|
|
26
|
-
"./
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"./
|
|
31
|
-
|
|
28
|
+
"./src/Button.js": {
|
|
29
|
+
"development": "./src/Button.dev.js",
|
|
30
|
+
"default": "./src/Button.js"
|
|
31
|
+
},
|
|
32
|
+
"./src/ButtonBase.js": {
|
|
33
|
+
"development": "./src/ButtonBase.dev.js",
|
|
34
|
+
"default": "./src/ButtonBase.js"
|
|
35
|
+
},
|
|
36
|
+
"./src/ClearButton.js": {
|
|
37
|
+
"development": "./src/ClearButton.dev.js",
|
|
38
|
+
"default": "./src/ClearButton.js"
|
|
39
|
+
},
|
|
40
|
+
"./src/CloseButton.js": {
|
|
41
|
+
"development": "./src/CloseButton.dev.js",
|
|
42
|
+
"default": "./src/CloseButton.js"
|
|
43
|
+
},
|
|
44
|
+
"./src/StyledButton.js": {
|
|
45
|
+
"development": "./src/StyledButton.dev.js",
|
|
46
|
+
"default": "./src/StyledButton.js"
|
|
47
|
+
},
|
|
48
|
+
"./src/button-base.css.js": "./src/button-base.css.js",
|
|
49
|
+
"./src/button.css.js": "./src/button.css.js",
|
|
50
|
+
"./src/index.js": {
|
|
51
|
+
"development": "./src/index.dev.js",
|
|
52
|
+
"default": "./src/index.js"
|
|
53
|
+
},
|
|
54
|
+
"./sp-button.js": {
|
|
55
|
+
"development": "./sp-button.dev.js",
|
|
56
|
+
"default": "./sp-button.js"
|
|
57
|
+
},
|
|
58
|
+
"./sp-clear-button.js": {
|
|
59
|
+
"development": "./sp-clear-button.dev.js",
|
|
60
|
+
"default": "./sp-clear-button.js"
|
|
61
|
+
},
|
|
62
|
+
"./sp-close-button.js": {
|
|
63
|
+
"development": "./sp-close-button.dev.js",
|
|
64
|
+
"default": "./sp-close-button.js"
|
|
65
|
+
}
|
|
32
66
|
},
|
|
33
67
|
"scripts": {
|
|
34
68
|
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
|
|
@@ -48,12 +82,12 @@
|
|
|
48
82
|
"lit-html"
|
|
49
83
|
],
|
|
50
84
|
"dependencies": {
|
|
51
|
-
"@spectrum-web-components/base": "^0.
|
|
52
|
-
"@spectrum-web-components/clear-button": "^0.1.
|
|
53
|
-
"@spectrum-web-components/close-button": "^0.
|
|
54
|
-
"@spectrum-web-components/icon": "^0.11.
|
|
55
|
-
"@spectrum-web-components/icons-ui": "^0.8.
|
|
56
|
-
"@spectrum-web-components/shared": "^0.14.
|
|
85
|
+
"@spectrum-web-components/base": "^0.6.0",
|
|
86
|
+
"@spectrum-web-components/clear-button": "^0.1.8",
|
|
87
|
+
"@spectrum-web-components/close-button": "^0.2.0",
|
|
88
|
+
"@spectrum-web-components/icon": "^0.11.12",
|
|
89
|
+
"@spectrum-web-components/icons-ui": "^0.8.12",
|
|
90
|
+
"@spectrum-web-components/shared": "^0.14.5",
|
|
57
91
|
"tslib": "^2.0.0"
|
|
58
92
|
},
|
|
59
93
|
"devDependencies": {
|
|
@@ -64,5 +98,5 @@
|
|
|
64
98
|
"sideEffects": [
|
|
65
99
|
"./sp-*.js"
|
|
66
100
|
],
|
|
67
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "50cac779bbb0d6735c2061f1eceb86b9daf9b22b"
|
|
68
102
|
}
|
package/sp-button.dev.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-button.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*/\nimport { Button } from './src/Button.dev.js'\n\ncustomElements.define('sp-button', Button);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-button': Button;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA;AAEA,eAAe,OAAO,aAAa,MAAM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/sp-button.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
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 { Button } from './src/Button.js';
|
|
13
|
-
customElements.define('sp-button', Button);
|
|
14
|
-
//# sourceMappingURL=sp-button.js.map
|
|
1
|
+
import { Button } from "./src/Button.js";
|
|
2
|
+
customElements.define("sp-button", Button);
|
|
3
|
+
//# sourceMappingURL=sp-button.js.map
|
package/sp-button.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-button.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*/\nimport { Button } from './src/Button.js';\n\ncustomElements.define('sp-button', Button);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-button': Button;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA;AAEA,eAAe,OAAO,aAAa,MAAM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-clear-button.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*/\nimport { ClearButton } from './src/ClearButton.dev.js'\n\ncustomElements.define('sp-clear-button', ClearButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-clear-button': ClearButton;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA;AAEA,eAAe,OAAO,mBAAmB,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/sp-clear-button.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
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 { ClearButton } from './src/ClearButton.js';
|
|
13
|
-
customElements.define('sp-clear-button', ClearButton);
|
|
14
|
-
//# sourceMappingURL=sp-clear-button.js.map
|
|
1
|
+
import { ClearButton } from "./src/ClearButton.js";
|
|
2
|
+
customElements.define("sp-clear-button", ClearButton);
|
|
3
|
+
//# sourceMappingURL=sp-clear-button.js.map
|
package/sp-clear-button.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-clear-button.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*/\nimport { ClearButton } from './src/ClearButton.js';\n\ncustomElements.define('sp-clear-button', ClearButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-clear-button': ClearButton;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA;AAEA,eAAe,OAAO,mBAAmB,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-close-button.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 { CloseButton } from './src/CloseButton.dev.js'\n\ncustomElements.define('sp-close-button', CloseButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-close-button': CloseButton;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAYA;AAEA,eAAe,OAAO,mBAAmB,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/sp-close-button.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
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 { CloseButton } from './src/CloseButton.js';
|
|
13
|
-
customElements.define('sp-close-button', CloseButton);
|
|
14
|
-
//# sourceMappingURL=sp-close-button.js.map
|
|
1
|
+
import { CloseButton } from "./src/CloseButton.js";
|
|
2
|
+
customElements.define("sp-close-button", CloseButton);
|
|
3
|
+
//# sourceMappingURL=sp-close-button.js.map
|
package/sp-close-button.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-close-button.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 { CloseButton } from './src/CloseButton.js';\n\ncustomElements.define('sp-close-button', CloseButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-close-button': CloseButton;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAYA;AAEA,eAAe,OAAO,mBAAmB,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
SizedMixin
|
|
14
|
+
} from "@spectrum-web-components/base";
|
|
15
|
+
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
16
|
+
import { StyledButton } from "./StyledButton.dev.js";
|
|
17
|
+
import buttonStyles from "./button.css.js";
|
|
18
|
+
export const VALID_VARIANTS = [
|
|
19
|
+
"accent",
|
|
20
|
+
"primary",
|
|
21
|
+
"secondary",
|
|
22
|
+
"negative",
|
|
23
|
+
"white",
|
|
24
|
+
"black"
|
|
25
|
+
];
|
|
26
|
+
export class Button extends SizedMixin(StyledButton) {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
this._variant = "accent";
|
|
30
|
+
this.treatment = "fill";
|
|
31
|
+
}
|
|
32
|
+
static get styles() {
|
|
33
|
+
return [...super.styles, buttonStyles];
|
|
34
|
+
}
|
|
35
|
+
get variant() {
|
|
36
|
+
return this._variant;
|
|
37
|
+
}
|
|
38
|
+
set variant(variant) {
|
|
39
|
+
if (variant === this.variant)
|
|
40
|
+
return;
|
|
41
|
+
this.requestUpdate("variant", this.variant);
|
|
42
|
+
switch (variant) {
|
|
43
|
+
case "cta":
|
|
44
|
+
this._variant = "accent";
|
|
45
|
+
break;
|
|
46
|
+
case "overBackground":
|
|
47
|
+
this._variant = "white";
|
|
48
|
+
this.treatment = "outline";
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
if (!VALID_VARIANTS.includes(variant)) {
|
|
52
|
+
this._variant = "accent";
|
|
53
|
+
} else {
|
|
54
|
+
this._variant = variant;
|
|
55
|
+
}
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
this.setAttribute("variant", this.variant);
|
|
59
|
+
}
|
|
60
|
+
set quiet(quiet) {
|
|
61
|
+
this.treatment = quiet ? "outline" : "fill";
|
|
62
|
+
}
|
|
63
|
+
firstUpdated(changes) {
|
|
64
|
+
super.firstUpdated(changes);
|
|
65
|
+
if (!this.hasAttribute("variant")) {
|
|
66
|
+
this.setAttribute("variant", this.variant);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
__decorateClass([
|
|
71
|
+
property()
|
|
72
|
+
], Button.prototype, "variant", 1);
|
|
73
|
+
__decorateClass([
|
|
74
|
+
property({ reflect: true })
|
|
75
|
+
], Button.prototype, "treatment", 2);
|
|
76
|
+
__decorateClass([
|
|
77
|
+
property({ type: Boolean })
|
|
78
|
+
], Button.prototype, "quiet", 1);
|
|
79
|
+
//# sourceMappingURL=Button.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["Button.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 {\n CSSResultArray,\n PropertyValues,\n SizedMixin,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.dev.js'\nimport buttonStyles from './button.css.js';\n\nexport type DeprecatedButtonVariants = 'cta' | 'overBackground';\nexport type ButtonStatics = 'white' | 'black';\nexport type ButtonVariants =\n | 'accent'\n | 'primary'\n | 'secondary'\n | 'negative'\n | ButtonStatics\n | DeprecatedButtonVariants;\nexport const VALID_VARIANTS = [\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'white',\n 'black',\n];\n\nexport type ButtonTreatments = 'fill' | 'outline';\n\n/**\n * @element sp-button\n *\n * @slot - text label of the Button\n * @slot icon - The icon to use for Button\n */\nexport class Button extends SizedMixin(StyledButton) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property()\n public get variant(): ButtonVariants {\n return this._variant;\n }\n public set variant(variant: ButtonVariants) {\n if (variant === this.variant) return;\n\n this.requestUpdate('variant', this.variant);\n switch (variant) {\n case 'cta':\n this._variant = 'accent';\n break;\n case 'overBackground':\n this._variant = 'white';\n this.treatment = 'outline';\n break;\n default:\n if (!VALID_VARIANTS.includes(variant)) {\n this._variant = 'accent';\n } else {\n this._variant = variant;\n }\n break;\n }\n this.setAttribute('variant', this.variant);\n }\n private _variant: ButtonVariants = 'accent';\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public treatment: ButtonTreatments = 'fill';\n\n /**\n * Style this button to be less obvious\n */\n @property({ type: Boolean })\n public set quiet(quiet: boolean) {\n this.treatment = quiet ? 'outline' : 'fill';\n }\n\n protected override firstUpdated(changes: PropertyValues<this>): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('variant')) {\n this.setAttribute('variant', this.variant);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAKA;AACA;AACA;AAWO,aAAM,iBAAiB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAUO,aAAM,eAAe,WAAW,YAAY,EAAE;AAAA,EAA9C;AAAA;AAkCK,oBAA2B;AAM5B,qBAA8B;AAAA;AAAA,aAvCV,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,QAAQ,YAAY;AAAA,EACzC;AAAA,MAMW,UAA0B;AACjC,WAAO,KAAK;AAAA,EAChB;AAAA,MACW,QAAQ,SAAyB;AACxC,QAAI,YAAY,KAAK;AAAS;AAE9B,SAAK,cAAc,WAAW,KAAK,OAAO;AAC1C,YAAQ;AAAA,WACC;AACD,aAAK,WAAW;AAChB;AAAA,WACC;AACD,aAAK,WAAW;AAChB,aAAK,YAAY;AACjB;AAAA;AAEA,YAAI,CAAC,eAAe,SAAS,OAAO,GAAG;AACnC,eAAK,WAAW;AAAA,QACpB,OAAO;AACH,eAAK,WAAW;AAAA,QACpB;AACA;AAAA;AAER,SAAK,aAAa,WAAW,KAAK,OAAO;AAAA,EAC7C;AAAA,MAaW,MAAM,OAAgB;AAC7B,SAAK,YAAY,QAAQ,YAAY;AAAA,EACzC;AAAA,EAEmB,aAAa,SAAqC;AACjE,UAAM,aAAa,OAAO;AAC1B,QAAI,CAAC,KAAK,aAAa,SAAS,GAAG;AAC/B,WAAK,aAAa,WAAW,KAAK,OAAO;AAAA,IAC7C;AAAA,EACJ;AACJ;AA/Ce;AAAA,EADX,AAAC,SAAS;AAAA,GACC,AATR,OASQ;AA+BJ;AAAA,EADP,AAAC,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GACpB,AAxCJ,OAwCI;AAMI;AAAA,EADX,AAAC,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GAChB,AA9CR,OA8CQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/Button.js
CHANGED
|
@@ -1,94 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
SizedMixin
|
|
14
|
+
} from "@spectrum-web-components/base";
|
|
15
|
+
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
16
|
+
import { StyledButton } from "./StyledButton.js";
|
|
17
|
+
import buttonStyles from "./button.css.js";
|
|
17
18
|
export const VALID_VARIANTS = [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
"accent",
|
|
20
|
+
"primary",
|
|
21
|
+
"secondary",
|
|
22
|
+
"negative",
|
|
23
|
+
"white",
|
|
24
|
+
"black"
|
|
24
25
|
];
|
|
25
|
-
/**
|
|
26
|
-
* @element sp-button
|
|
27
|
-
*
|
|
28
|
-
* @slot - text label of the Button
|
|
29
|
-
* @slot icon - The icon to use for Button
|
|
30
|
-
*/
|
|
31
26
|
export class Button extends SizedMixin(StyledButton) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
break;
|
|
61
|
-
default:
|
|
62
|
-
if (!VALID_VARIANTS.includes(variant)) {
|
|
63
|
-
this._variant = 'accent';
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
this._variant = variant;
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
this._variant = "accent";
|
|
30
|
+
this.treatment = "fill";
|
|
31
|
+
}
|
|
32
|
+
static get styles() {
|
|
33
|
+
return [...super.styles, buttonStyles];
|
|
34
|
+
}
|
|
35
|
+
get variant() {
|
|
36
|
+
return this._variant;
|
|
37
|
+
}
|
|
38
|
+
set variant(variant) {
|
|
39
|
+
if (variant === this.variant)
|
|
40
|
+
return;
|
|
41
|
+
this.requestUpdate("variant", this.variant);
|
|
42
|
+
switch (variant) {
|
|
43
|
+
case "cta":
|
|
44
|
+
this._variant = "accent";
|
|
45
|
+
break;
|
|
46
|
+
case "overBackground":
|
|
47
|
+
this._variant = "white";
|
|
48
|
+
this.treatment = "outline";
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
if (!VALID_VARIANTS.includes(variant)) {
|
|
52
|
+
this._variant = "accent";
|
|
53
|
+
} else {
|
|
54
|
+
this._variant = variant;
|
|
69
55
|
}
|
|
70
|
-
|
|
56
|
+
break;
|
|
71
57
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
firstUpdated(changes)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.setAttribute('variant', this.variant);
|
|
82
|
-
}
|
|
58
|
+
this.setAttribute("variant", this.variant);
|
|
59
|
+
}
|
|
60
|
+
set quiet(quiet) {
|
|
61
|
+
this.treatment = quiet ? "outline" : "fill";
|
|
62
|
+
}
|
|
63
|
+
firstUpdated(changes) {
|
|
64
|
+
super.firstUpdated(changes);
|
|
65
|
+
if (!this.hasAttribute("variant")) {
|
|
66
|
+
this.setAttribute("variant", this.variant);
|
|
83
67
|
}
|
|
68
|
+
}
|
|
84
69
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
], Button.prototype, "variant",
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
], Button.prototype, "treatment",
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
], Button.prototype, "quiet",
|
|
94
|
-
//# sourceMappingURL=Button.js.map
|
|
70
|
+
__decorateClass([
|
|
71
|
+
property()
|
|
72
|
+
], Button.prototype, "variant", 1);
|
|
73
|
+
__decorateClass([
|
|
74
|
+
property({ reflect: true })
|
|
75
|
+
], Button.prototype, "treatment", 2);
|
|
76
|
+
__decorateClass([
|
|
77
|
+
property({ type: Boolean })
|
|
78
|
+
], Button.prototype, "quiet", 1);
|
|
79
|
+
//# sourceMappingURL=Button.js.map
|
package/src/Button.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["Button.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 {\n CSSResultArray,\n PropertyValues,\n SizedMixin,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.js';\nimport buttonStyles from './button.css.js';\n\nexport type DeprecatedButtonVariants = 'cta' | 'overBackground';\nexport type ButtonStatics = 'white' | 'black';\nexport type ButtonVariants =\n | 'accent'\n | 'primary'\n | 'secondary'\n | 'negative'\n | ButtonStatics\n | DeprecatedButtonVariants;\nexport const VALID_VARIANTS = [\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'white',\n 'black',\n];\n\nexport type ButtonTreatments = 'fill' | 'outline';\n\n/**\n * @element sp-button\n *\n * @slot - text label of the Button\n * @slot icon - The icon to use for Button\n */\nexport class Button extends SizedMixin(StyledButton) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property()\n public get variant(): ButtonVariants {\n return this._variant;\n }\n public set variant(variant: ButtonVariants) {\n if (variant === this.variant) return;\n\n this.requestUpdate('variant', this.variant);\n switch (variant) {\n case 'cta':\n this._variant = 'accent';\n break;\n case 'overBackground':\n this._variant = 'white';\n this.treatment = 'outline';\n break;\n default:\n if (!VALID_VARIANTS.includes(variant)) {\n this._variant = 'accent';\n } else {\n this._variant = variant;\n }\n break;\n }\n this.setAttribute('variant', this.variant);\n }\n private _variant: ButtonVariants = 'accent';\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public treatment: ButtonTreatments = 'fill';\n\n /**\n * Style this button to be less obvious\n */\n @property({ type: Boolean })\n public set quiet(quiet: boolean) {\n this.treatment = quiet ? 'outline' : 'fill';\n }\n\n protected override firstUpdated(changes: PropertyValues<this>): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('variant')) {\n this.setAttribute('variant', this.variant);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAKA;AACA;AACA;AAWO,aAAM,iBAAiB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAUO,aAAM,eAAe,WAAW,YAAY,EAAE;AAAA,EAA9C;AAAA;AAkCK,oBAA2B;AAM5B,qBAA8B;AAAA;AAAA,aAvCV,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,QAAQ,YAAY;AAAA,EACzC;AAAA,MAMW,UAA0B;AACjC,WAAO,KAAK;AAAA,EAChB;AAAA,MACW,QAAQ,SAAyB;AACxC,QAAI,YAAY,KAAK;AAAS;AAE9B,SAAK,cAAc,WAAW,KAAK,OAAO;AAC1C,YAAQ;AAAA,WACC;AACD,aAAK,WAAW;AAChB;AAAA,WACC;AACD,aAAK,WAAW;AAChB,aAAK,YAAY;AACjB;AAAA;AAEA,YAAI,CAAC,eAAe,SAAS,OAAO,GAAG;AACnC,eAAK,WAAW;AAAA,QACpB,OAAO;AACH,eAAK,WAAW;AAAA,QACpB;AACA;AAAA;AAER,SAAK,aAAa,WAAW,KAAK,OAAO;AAAA,EAC7C;AAAA,MAaW,MAAM,OAAgB;AAC7B,SAAK,YAAY,QAAQ,YAAY;AAAA,EACzC;AAAA,EAEmB,aAAa,SAAqC;AACjE,UAAM,aAAa,OAAO;AAC1B,QAAI,CAAC,KAAK,aAAa,SAAS,GAAG;AAC/B,WAAK,aAAa,WAAW,KAAK,OAAO;AAAA,IAC7C;AAAA,EACJ;AACJ;AA/Ce;AAAA,EADX,AAAC,SAAS;AAAA,GACC,AATR,OASQ;AA+BJ;AAAA,EADP,AAAC,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GACpB,AAxCJ,OAwCI;AAMI;AAAA,EADX,AAAC,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GAChB,AA9CR,OA8CQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|