@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.
Files changed (161) hide show
  1. package/README.md +193 -34
  2. package/custom-elements.json +90 -90
  3. package/package.json +50 -16
  4. package/sp-button.dev.js +3 -0
  5. package/sp-button.dev.js.map +7 -0
  6. package/sp-button.js +3 -14
  7. package/sp-button.js.map +7 -1
  8. package/sp-clear-button.dev.js +3 -0
  9. package/sp-clear-button.dev.js.map +7 -0
  10. package/sp-clear-button.js +3 -14
  11. package/sp-clear-button.js.map +7 -1
  12. package/sp-close-button.dev.js +3 -0
  13. package/sp-close-button.dev.js.map +7 -0
  14. package/sp-close-button.js +3 -14
  15. package/sp-close-button.js.map +7 -1
  16. package/src/Button.dev.js +79 -0
  17. package/src/Button.dev.js.map +7 -0
  18. package/src/Button.js +72 -87
  19. package/src/Button.js.map +7 -1
  20. package/src/ButtonBase.dev.js +215 -0
  21. package/src/ButtonBase.dev.js.map +7 -0
  22. package/src/ButtonBase.js +198 -201
  23. package/src/ButtonBase.js.map +7 -1
  24. package/src/ClearButton.dev.js +70 -0
  25. package/src/ClearButton.dev.js.map +7 -0
  26. package/src/ClearButton.js +45 -52
  27. package/src/ClearButton.js.map +7 -1
  28. package/src/CloseButton.dev.js +65 -0
  29. package/src/CloseButton.dev.js.map +7 -0
  30. package/src/CloseButton.js +42 -49
  31. package/src/CloseButton.js.map +7 -1
  32. package/src/StyledButton.dev.js +8 -0
  33. package/src/StyledButton.dev.js.map +7 -0
  34. package/src/StyledButton.js +6 -17
  35. package/src/StyledButton.js.map +7 -1
  36. package/src/button-base.css.dev.js +10 -0
  37. package/src/button-base.css.dev.js.map +7 -0
  38. package/src/button-base.css.js +4 -15
  39. package/src/button-base.css.js.map +7 -1
  40. package/src/button.css.dev.js +619 -0
  41. package/src/button.css.dev.js.map +7 -0
  42. package/src/button.css.js +4 -15
  43. package/src/button.css.js.map +7 -1
  44. package/src/index.dev.js +6 -0
  45. package/src/index.dev.js.map +7 -0
  46. package/src/index.js +6 -17
  47. package/src/index.js.map +7 -1
  48. package/src/spectrum-button-base.css.dev.js +6 -0
  49. package/src/spectrum-button-base.css.dev.js.map +7 -0
  50. package/src/spectrum-button-base.css.js +3 -14
  51. package/src/spectrum-button-base.css.js.map +7 -1
  52. package/src/spectrum-button.css.dev.js +587 -0
  53. package/src/spectrum-button.css.dev.js.map +7 -0
  54. package/src/spectrum-button.css.js +4 -15
  55. package/src/spectrum-button.css.js.map +7 -1
  56. package/stories/button-accent-fill-sizes.stories.js +21 -18
  57. package/stories/button-accent-fill-sizes.stories.js.map +7 -1
  58. package/stories/button-accent-fill.stories.js +24 -20
  59. package/stories/button-accent-fill.stories.js.map +7 -1
  60. package/stories/button-accent-outline-sizes.stories.js +21 -18
  61. package/stories/button-accent-outline-sizes.stories.js.map +7 -1
  62. package/stories/button-accent-outline.stories.js +24 -20
  63. package/stories/button-accent-outline.stories.js.map +7 -1
  64. package/stories/button-black-fill-sizes.stories.js +22 -19
  65. package/stories/button-black-fill-sizes.stories.js.map +7 -1
  66. package/stories/button-black-fill.stories.js +26 -21
  67. package/stories/button-black-fill.stories.js.map +7 -1
  68. package/stories/button-black-outline-sizes.stories.js +22 -19
  69. package/stories/button-black-outline-sizes.stories.js.map +7 -1
  70. package/stories/button-black-outline.stories.js +26 -21
  71. package/stories/button-black-outline.stories.js.map +7 -1
  72. package/stories/button-negative-fill-sizes.stories.js +21 -18
  73. package/stories/button-negative-fill-sizes.stories.js.map +7 -1
  74. package/stories/button-negative-fill.stories.js +24 -20
  75. package/stories/button-negative-fill.stories.js.map +7 -1
  76. package/stories/button-negative-outline-sizes.stories.js +21 -18
  77. package/stories/button-negative-outline-sizes.stories.js.map +7 -1
  78. package/stories/button-negative-outline.stories.js +24 -20
  79. package/stories/button-negative-outline.stories.js.map +7 -1
  80. package/stories/button-primary-fill-sizes.stories.js +21 -18
  81. package/stories/button-primary-fill-sizes.stories.js.map +7 -1
  82. package/stories/button-primary-fill.stories.js +24 -20
  83. package/stories/button-primary-fill.stories.js.map +7 -1
  84. package/stories/button-primary-outline-sizes.stories.js +21 -18
  85. package/stories/button-primary-outline-sizes.stories.js.map +7 -1
  86. package/stories/button-primary-outline.stories.js +24 -20
  87. package/stories/button-primary-outline.stories.js.map +7 -1
  88. package/stories/button-secondary-fill-sizes.stories.js +21 -18
  89. package/stories/button-secondary-fill-sizes.stories.js.map +7 -1
  90. package/stories/button-secondary-fill.stories.js +24 -20
  91. package/stories/button-secondary-fill.stories.js.map +7 -1
  92. package/stories/button-secondary-outline-sizes.stories.js +21 -18
  93. package/stories/button-secondary-outline-sizes.stories.js.map +7 -1
  94. package/stories/button-secondary-outline.stories.js +24 -20
  95. package/stories/button-secondary-outline.stories.js.map +7 -1
  96. package/stories/button-white-fill-sizes.stories.js +22 -19
  97. package/stories/button-white-fill-sizes.stories.js.map +7 -1
  98. package/stories/button-white-fill.stories.js +26 -21
  99. package/stories/button-white-fill.stories.js.map +7 -1
  100. package/stories/button-white-outline-sizes.stories.js +22 -19
  101. package/stories/button-white-outline-sizes.stories.js.map +7 -1
  102. package/stories/button-white-outline.stories.js +26 -21
  103. package/stories/button-white-outline.stories.js.map +7 -1
  104. package/stories/index.js +92 -93
  105. package/stories/index.js.map +7 -1
  106. package/test/benchmark/test-basic.js +5 -16
  107. package/test/benchmark/test-basic.js.map +7 -1
  108. package/test/button-accent-fill-sizes.test-vrt.js +4 -15
  109. package/test/button-accent-fill-sizes.test-vrt.js.map +7 -1
  110. package/test/button-accent-fill.test-vrt.js +4 -15
  111. package/test/button-accent-fill.test-vrt.js.map +7 -1
  112. package/test/button-accent-outline-sizes.test-vrt.js +4 -15
  113. package/test/button-accent-outline-sizes.test-vrt.js.map +7 -1
  114. package/test/button-accent-outline.test-vrt.js +4 -15
  115. package/test/button-accent-outline.test-vrt.js.map +7 -1
  116. package/test/button-black-fill-sizes.test-vrt.js +4 -15
  117. package/test/button-black-fill-sizes.test-vrt.js.map +7 -1
  118. package/test/button-black-fill.test-vrt.js +4 -15
  119. package/test/button-black-fill.test-vrt.js.map +7 -1
  120. package/test/button-black-outline-sizes.test-vrt.js +4 -15
  121. package/test/button-black-outline-sizes.test-vrt.js.map +7 -1
  122. package/test/button-black-outline.test-vrt.js +4 -15
  123. package/test/button-black-outline.test-vrt.js.map +7 -1
  124. package/test/button-negative-fill-sizes.test-vrt.js +4 -15
  125. package/test/button-negative-fill-sizes.test-vrt.js.map +7 -1
  126. package/test/button-negative-fill.test-vrt.js +4 -15
  127. package/test/button-negative-fill.test-vrt.js.map +7 -1
  128. package/test/button-negative-outline-sizes.test-vrt.js +4 -15
  129. package/test/button-negative-outline-sizes.test-vrt.js.map +7 -1
  130. package/test/button-negative-outline.test-vrt.js +4 -15
  131. package/test/button-negative-outline.test-vrt.js.map +7 -1
  132. package/test/button-primary-fill-sizes.test-vrt.js +4 -15
  133. package/test/button-primary-fill-sizes.test-vrt.js.map +7 -1
  134. package/test/button-primary-fill.test-vrt.js +4 -15
  135. package/test/button-primary-fill.test-vrt.js.map +7 -1
  136. package/test/button-primary-outline-sizes.test-vrt.js +4 -15
  137. package/test/button-primary-outline-sizes.test-vrt.js.map +7 -1
  138. package/test/button-primary-outline.test-vrt.js +4 -15
  139. package/test/button-primary-outline.test-vrt.js.map +7 -1
  140. package/test/button-secondary-fill-sizes.test-vrt.js +4 -15
  141. package/test/button-secondary-fill-sizes.test-vrt.js.map +7 -1
  142. package/test/button-secondary-fill.test-vrt.js +4 -15
  143. package/test/button-secondary-fill.test-vrt.js.map +7 -1
  144. package/test/button-secondary-outline-sizes.test-vrt.js +4 -15
  145. package/test/button-secondary-outline-sizes.test-vrt.js.map +7 -1
  146. package/test/button-secondary-outline.test-vrt.js +4 -15
  147. package/test/button-secondary-outline.test-vrt.js.map +7 -1
  148. package/test/button-white-fill-sizes.test-vrt.js +4 -15
  149. package/test/button-white-fill-sizes.test-vrt.js.map +7 -1
  150. package/test/button-white-fill.test-vrt.js +4 -15
  151. package/test/button-white-fill.test-vrt.js.map +7 -1
  152. package/test/button-white-outline-sizes.test-vrt.js +4 -15
  153. package/test/button-white-outline-sizes.test-vrt.js.map +7 -1
  154. package/test/button-white-outline.test-vrt.js +4 -15
  155. package/test/button-white-outline.test-vrt.js.map +7 -1
  156. package/test/button.test.js +321 -320
  157. package/test/button.test.js.map +7 -1
  158. package/test/clear-button.test.js +13 -20
  159. package/test/clear-button.test.js.map +7 -1
  160. package/test/close-button.test.js +13 -20
  161. 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.0",
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
- ".": "./src/index.js",
24
- "./src/*": "./src/*",
23
+ ".": {
24
+ "development": "./src/index.dev.js",
25
+ "default": "./src/index.js"
26
+ },
25
27
  "./package.json": "./package.json",
26
- "./sp-button": "./sp-button.js",
27
- "./sp-button.js": "./sp-button.js",
28
- "./sp-clear-button": "./sp-clear-button.js",
29
- "./sp-clear-button.js": "./sp-clear-button.js",
30
- "./sp-close-button": "./sp-close-button.js",
31
- "./sp-close-button.js": "./sp-close-button.js"
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.5.8",
52
- "@spectrum-web-components/clear-button": "^0.1.7",
53
- "@spectrum-web-components/close-button": "^0.1.7",
54
- "@spectrum-web-components/icon": "^0.11.11",
55
- "@spectrum-web-components/icons-ui": "^0.8.11",
56
- "@spectrum-web-components/shared": "^0.14.4",
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": "3be62133721efba844cd7032566a2c49ed6d9875"
101
+ "gitHead": "50cac779bbb0d6735c2061f1eceb86b9daf9b22b"
68
102
  }
@@ -0,0 +1,3 @@
1
+ import { Button } from "./src/Button.dev.js";
2
+ customElements.define("sp-button", Button);
3
+ //# sourceMappingURL=sp-button.dev.js.map
@@ -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
- 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 { 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
- {"version":3,"file":"sp-button.js","sourceRoot":"","sources":["sp-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,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*/\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"]}
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,3 @@
1
+ import { ClearButton } from "./src/ClearButton.dev.js";
2
+ customElements.define("sp-clear-button", ClearButton);
3
+ //# sourceMappingURL=sp-clear-button.dev.js.map
@@ -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
+ }
@@ -1,14 +1,3 @@
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 { 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
@@ -1 +1,7 @@
1
- {"version":3,"file":"sp-clear-button.js","sourceRoot":"","sources":["sp-clear-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,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*/\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"]}
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,3 @@
1
+ import { CloseButton } from "./src/CloseButton.dev.js";
2
+ customElements.define("sp-close-button", CloseButton);
3
+ //# sourceMappingURL=sp-close-button.dev.js.map
@@ -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
+ }
@@ -1,14 +1,3 @@
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 { 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
@@ -1 +1,7 @@
1
- {"version":3,"file":"sp-close-button.js","sourceRoot":"","sources":["sp-close-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,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 { 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"]}
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
- 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 { __decorate } from "tslib";
13
- import { SizedMixin, } from '@spectrum-web-components/base';
14
- import { property } from '@spectrum-web-components/base/src/decorators.js';
15
- import { StyledButton } from './StyledButton.js';
16
- import buttonStyles from './button.css.js';
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
- 'accent',
19
- 'primary',
20
- 'secondary',
21
- 'negative',
22
- 'white',
23
- 'black',
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
- constructor() {
33
- super(...arguments);
34
- this._variant = 'accent';
35
- /**
36
- * The visual variant to apply to this button.
37
- */
38
- this.treatment = 'fill';
39
- }
40
- static get styles() {
41
- return [...super.styles, buttonStyles];
42
- }
43
- /**
44
- * The visual variant to apply to this button.
45
- */
46
- get variant() {
47
- return this._variant;
48
- }
49
- set variant(variant) {
50
- if (variant === this.variant)
51
- return;
52
- this.requestUpdate('variant', this.variant);
53
- switch (variant) {
54
- case 'cta':
55
- this._variant = 'accent';
56
- break;
57
- case 'overBackground':
58
- this._variant = 'white';
59
- this.treatment = 'outline';
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
- this.setAttribute('variant', this.variant);
56
+ break;
71
57
  }
72
- /**
73
- * Style this button to be less obvious
74
- */
75
- set quiet(quiet) {
76
- this.treatment = quiet ? 'outline' : 'fill';
77
- }
78
- firstUpdated(changes) {
79
- super.firstUpdated(changes);
80
- if (!this.hasAttribute('variant')) {
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
- __decorate([
86
- property()
87
- ], Button.prototype, "variant", null);
88
- __decorate([
89
- property({ reflect: true })
90
- ], Button.prototype, "treatment", void 0);
91
- __decorate([
92
- property({ type: Boolean })
93
- ], Button.prototype, "quiet", null);
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
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["Button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAGH,UAAU,GACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAW3C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,OAAO;IACP,OAAO;CACV,CAAC;AAIF;;;;;GAKG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU,CAAC,YAAY,CAAC;IAApD;;QAkCY,aAAQ,GAAmB,QAAQ,CAAC;QAE5C;;WAEG;QAEI,cAAS,GAAqB,MAAM,CAAC;IAgBhD,CAAC;IAvDU,MAAM,KAAc,MAAM;QAC7B,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IAEH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACD,IAAW,OAAO,CAAC,OAAuB;QACtC,IAAI,OAAO,KAAK,IAAI,CAAC,OAAO;YAAE,OAAO;QAErC,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,QAAQ,OAAO,EAAE;YACb,KAAK,KAAK;gBACN,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBACzB,MAAM;YACV,KAAK,gBAAgB;gBACjB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;gBACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;gBAC3B,MAAM;YACV;gBACI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;oBACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;iBAC5B;qBAAM;oBACH,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;iBAC3B;gBACD,MAAM;SACb;QACD,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IASD;;OAEG;IAEH,IAAW,KAAK,CAAC,KAAc;QAC3B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IAChD,CAAC;IAEkB,YAAY,CAAC,OAA6B;QACzD,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;YAC/B,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SAC9C;IACL,CAAC;CACJ;AA/CG;IADC,QAAQ,EAAE;qCAGV;AA6BD;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCACgB;AAM5C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mCAG3B","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"]}
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
+ }