@spectrum-web-components/button 0.0.0-20241209155954

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 (73) hide show
  1. package/README.md +354 -0
  2. package/package.json +104 -0
  3. package/sp-button.d.ts +6 -0
  4. package/sp-button.dev.js +5 -0
  5. package/sp-button.dev.js.map +7 -0
  6. package/sp-button.js +2 -0
  7. package/sp-button.js.map +7 -0
  8. package/sp-clear-button.d.ts +6 -0
  9. package/sp-clear-button.dev.js +5 -0
  10. package/sp-clear-button.dev.js.map +7 -0
  11. package/sp-clear-button.js +2 -0
  12. package/sp-clear-button.js.map +7 -0
  13. package/sp-close-button.d.ts +6 -0
  14. package/sp-close-button.dev.js +5 -0
  15. package/sp-close-button.dev.js.map +7 -0
  16. package/sp-close-button.js +2 -0
  17. package/sp-close-button.js.map +7 -0
  18. package/src/Button.d.ts +60 -0
  19. package/src/Button.dev.js +162 -0
  20. package/src/Button.dev.js.map +7 -0
  21. package/src/Button.js +5 -0
  22. package/src/Button.js.map +7 -0
  23. package/src/ButtonBase.d.ts +44 -0
  24. package/src/ButtonBase.dev.js +198 -0
  25. package/src/ButtonBase.dev.js.map +7 -0
  26. package/src/ButtonBase.js +13 -0
  27. package/src/ButtonBase.js.map +7 -0
  28. package/src/ClearButton.d.ts +26 -0
  29. package/src/ClearButton.dev.js +78 -0
  30. package/src/ClearButton.dev.js.map +7 -0
  31. package/src/ClearButton.js +24 -0
  32. package/src/ClearButton.js.map +7 -0
  33. package/src/CloseButton.d.ts +27 -0
  34. package/src/CloseButton.dev.js +76 -0
  35. package/src/CloseButton.dev.js.map +7 -0
  36. package/src/CloseButton.js +22 -0
  37. package/src/CloseButton.js.map +7 -0
  38. package/src/StyledButton.d.ts +3 -0
  39. package/src/StyledButton.dev.js +5 -0
  40. package/src/StyledButton.dev.js.map +7 -0
  41. package/src/StyledButton.js +2 -0
  42. package/src/StyledButton.js.map +7 -0
  43. package/src/button-base.css.d.ts +2 -0
  44. package/src/button-base.css.dev.js +7 -0
  45. package/src/button-base.css.dev.js.map +7 -0
  46. package/src/button-base.css.js +4 -0
  47. package/src/button-base.css.js.map +7 -0
  48. package/src/button-overrides.css.d.ts +2 -0
  49. package/src/button-overrides.css.dev.js +7 -0
  50. package/src/button-overrides.css.dev.js.map +7 -0
  51. package/src/button-overrides.css.js +4 -0
  52. package/src/button-overrides.css.js.map +7 -0
  53. package/src/button.css.d.ts +2 -0
  54. package/src/button.css.dev.js +7 -0
  55. package/src/button.css.dev.js.map +7 -0
  56. package/src/button.css.js +4 -0
  57. package/src/button.css.js.map +7 -0
  58. package/src/index.d.ts +5 -0
  59. package/src/index.dev.js +7 -0
  60. package/src/index.dev.js.map +7 -0
  61. package/src/index.js +2 -0
  62. package/src/index.js.map +7 -0
  63. package/src/spectrum-button-base.css.d.ts +2 -0
  64. package/src/spectrum-button-base.css.dev.js +7 -0
  65. package/src/spectrum-button-base.css.dev.js.map +7 -0
  66. package/src/spectrum-button-base.css.js +4 -0
  67. package/src/spectrum-button-base.css.js.map +7 -0
  68. package/src/spectrum-button.css.d.ts +2 -0
  69. package/src/spectrum-button.css.dev.js +7 -0
  70. package/src/spectrum-button.css.dev.js.map +7 -0
  71. package/src/spectrum-button.css.js +4 -0
  72. package/src/spectrum-button.css.js.map +7 -0
  73. package/src/spectrum-config.js +172 -0
package/README.md ADDED
@@ -0,0 +1,354 @@
1
+ ## Description
2
+
3
+ An `<sp-button>` represents an action a user can take. sp-buttons can be clicked
4
+ or tapped to perform an action or to navigate to another page. sp-buttons in
5
+ Spectrum have several variations for different uses and multiple levels of
6
+ loudness for various attention-getting needs.
7
+
8
+ ### Usage
9
+
10
+ [![See it on NPM!](https://img.shields.io/npm/v/@spectrum-web-components/button?style=for-the-badge)](https://www.npmjs.com/package/@spectrum-web-components/button)
11
+ [![How big is this package in your project?](https://img.shields.io/bundlephobia/minzip/@spectrum-web-components/button?style=for-the-badge)](https://bundlephobia.com/result?p=@spectrum-web-components/button)
12
+ [![Try it on webcomponents.dev](https://img.shields.io/badge/Try%20it%20on-webcomponents.dev-green?style=for-the-badge)](https://webcomponents.dev/edit/collection/fO75441E1Q5ZlI0e9pgq/Zjc3o94DWuBkT4ve3dny/src/index.ts)
13
+
14
+ ```
15
+ yarn add @spectrum-web-components/button
16
+ ```
17
+
18
+ Import the side effectful registration of `<sp-button>` or `<sp-clear-button>` as follows:
19
+
20
+ ```
21
+ import '@spectrum-web-components/button/sp-button.js';
22
+ import '@spectrum-web-components/button/sp-clear-button.js';
23
+ import '@spectrum-web-components/button/sp-close-button.js';
24
+ ```
25
+
26
+ When looking to leverage the `Button`, `ClearButton`, or `CloseButton` base classes as a type and/or for extension purposes, do so via:
27
+
28
+ ```
29
+ import { Button, ClearButton, CloseButton } from '@spectrum-web-components/button';
30
+ ```
31
+
32
+ ## Sizes
33
+
34
+ <sp-tabs selected="m" auto label="Size Attribute Options">
35
+ <sp-tab value="s">Small</sp-tab>
36
+ <sp-tab-panel value="s">
37
+
38
+ ```html demo
39
+ <sp-button size="s">Small</sp-button>
40
+ ```
41
+
42
+ </sp-tab-panel>
43
+ <sp-tab value="m">Medium</sp-tab>
44
+ <sp-tab-panel value="m">
45
+
46
+ ```html demo
47
+ <sp-button size="m">Medium</sp-button>
48
+ ```
49
+
50
+ </sp-tab-panel>
51
+ <sp-tab value="l">Large</sp-tab>
52
+ <sp-tab-panel value="l">
53
+
54
+ ```html demo
55
+ <sp-button size="l">Large</sp-button>
56
+ ```
57
+
58
+ </sp-tab-panel>
59
+ <sp-tab value="xl">Extra Large</sp-tab>
60
+ <sp-tab-panel value="xl">
61
+
62
+ ```html demo
63
+ <sp-button size="xl">Extra Large</sp-button>
64
+ ```
65
+
66
+ </sp-tab-panel>
67
+ </sp-tabs>
68
+
69
+ ## Content
70
+
71
+ `<sp-button>` elements can be provided a visible label, a label with an icon, or just an icon (a non-visible label can be prived via the `label` attribute on an `<sp-button>` or on an `<sp-icon*>` element child to appropriately fulfill the accessibility contract of the button). An icon is provided by
72
+ placing an icon element to the `icon` slot.
73
+
74
+ ```html
75
+ <sp-button-group>
76
+ <sp-button variant="primary">Label only</sp-button>
77
+ <sp-button variant="primary">
78
+ <sp-icon-help slot="icon"></sp-icon-help>
79
+ Icon + Label
80
+ </sp-button>
81
+ <sp-button variant="primary">
82
+ <svg
83
+ slot="icon"
84
+ viewBox="0 0 36 36"
85
+ focusable="false"
86
+ aria-hidden="true"
87
+ role="img"
88
+ >
89
+ <path
90
+ d="M16 36a4.407 4.407 0 0 0 4-4h-8a4.407 4.407 0 0 0 4 4zm9.143-24.615c0-3.437-3.206-4.891-7.143-5.268V3a1.079 1.079 0 0 0-1.143-1h-1.714A1.079 1.079 0 0 0 14 3v3.117c-3.937.377-7.143 1.831-7.143 5.268C6.857 26.8 2 26.111 2 28.154V30h28v-1.846C30 26 25.143 26.8 25.143 11.385z"
91
+ ></path>
92
+ </svg>
93
+ SVG Icon + Label
94
+ </sp-button>
95
+ <sp-button variant="primary" label="Icon only" icon-only>
96
+ <sp-icon-help slot="icon"></sp-icon-help>
97
+ </sp-button>
98
+ </sp-button-group>
99
+ ```
100
+
101
+ ## Variants
102
+
103
+ There are many button variants to choose from in Spectrum. The `variant`
104
+ attribute defaults to `accent` but also accepts the following value: `accent`, `primary`, `secondary`, `negative`, `white`, and `black`. They display as follows:
105
+
106
+ <sp-tabs selected="accent" auto label="Variant Attribute Options">
107
+ <sp-tab value="accent">Accent</sp-tab>
108
+ <sp-tab-panel value="accent">
109
+
110
+ ```html demo
111
+ <sp-button-group style="min-width: max-content">
112
+ <sp-button variant="accent">Label only</sp-button>
113
+ <sp-button variant="accent">
114
+ <sp-icon-help slot="icon"></sp-icon-help>
115
+ Icon + Label
116
+ </sp-button>
117
+ <sp-button variant="accent" label="Icon only" icon-only>
118
+ <sp-icon-help slot="icon"></sp-icon-help>
119
+ </sp-button>
120
+ </sp-button-group>
121
+ ```
122
+
123
+ </sp-tab-panel>
124
+ <sp-tab value="primary">Primary</sp-tab>
125
+ <sp-tab-panel value="primary">
126
+
127
+ ```html demo
128
+ <sp-button-group style="min-width: max-content">
129
+ <sp-button variant="primary">Label only</sp-button>
130
+ <sp-button variant="primary">
131
+ <sp-icon-help slot="icon"></sp-icon-help>
132
+ Icon + Label
133
+ </sp-button>
134
+ <sp-button variant="primary" label="Icon only" icon-only>
135
+ <sp-icon-help slot="icon"></sp-icon-help>
136
+ </sp-button>
137
+ </sp-button-group>
138
+ ```
139
+
140
+ </sp-tab-panel>
141
+ <sp-tab value="secondary">Secondary</sp-tab>
142
+ <sp-tab-panel value="secondary">
143
+
144
+ ```html demo
145
+ <sp-button-group style="min-width: max-content">
146
+ <sp-button variant="secondary">Label only</sp-button>
147
+ <sp-button variant="secondary">
148
+ <sp-icon-help slot="icon"></sp-icon-help>
149
+ Icon + Label
150
+ </sp-button>
151
+ <sp-button variant="secondary" label="Icon only" icon-only>
152
+ <sp-icon-help slot="icon"></sp-icon-help>
153
+ </sp-button>
154
+ </sp-button-group>
155
+ ```
156
+
157
+ </sp-tab-panel>
158
+ <sp-tab value="negative">Negative</sp-tab>
159
+ <sp-tab-panel value="negative">
160
+
161
+ ```html demo
162
+ <sp-button-group style="min-width: max-content">
163
+ <sp-button variant="negative">Label only</sp-button>
164
+ <sp-button variant="negative">
165
+ <sp-icon-help slot="icon"></sp-icon-help>
166
+ Icon + Label
167
+ </sp-button>
168
+ <sp-button variant="negative" label="Icon only" icon-only>
169
+ <sp-icon-help slot="icon"></sp-icon-help>
170
+ </sp-button>
171
+ </sp-button-group>
172
+ ```
173
+
174
+ </sp-tab-panel>
175
+ <sp-tab value="black">Black</sp-tab>
176
+ <sp-tab-panel value="black">
177
+
178
+ ```html demo
179
+ <sp-button-group style="min-width: max-content">
180
+ <sp-button static-color="black">Label only</sp-button>
181
+ <sp-button static-color="black">
182
+ <sp-icon-help slot="icon"></sp-icon-help>
183
+ Icon + Label
184
+ </sp-button>
185
+ <sp-button static-color="black" label="Icon only" icon-only>
186
+ <sp-icon-help slot="icon"></sp-icon-help>
187
+ </sp-button>
188
+ </sp-button-group>
189
+ ```
190
+
191
+ </sp-tab-panel>
192
+ <sp-tab value="white">White</sp-tab>
193
+ <sp-tab-panel value="white">
194
+
195
+ ```html demo
196
+ <sp-button-group style="min-width: max-content">
197
+ <sp-button static-color="white">Label only</sp-button>
198
+ <sp-button static-color="white">
199
+ <sp-icon-help slot="icon"></sp-icon-help>
200
+ Icon + Label
201
+ </sp-button>
202
+ <sp-button static-color="white" label="Icon only" icon-only>
203
+ <sp-icon-help slot="icon"></sp-icon-help>
204
+ </sp-button>
205
+ </sp-button-group>
206
+ ```
207
+
208
+ </sp-tab-panel>
209
+ </sp-tabs>
210
+
211
+ ### Treatment
212
+
213
+ The `treatment` attribute accepts `fill` and `outline` as values, and defaults to `fill`. These display as follows:
214
+
215
+ <sp-tabs selected="fill" auto label="Treatment Attribute Options">
216
+ <sp-tab value="fill">Fill</sp-tab>
217
+ <sp-tab-panel value="fill">
218
+
219
+ ```html demo
220
+ <sp-button-group style="min-width: max-content">
221
+ <sp-button treatment="fill" variant="primary">Primary, Fill</sp-button>
222
+ <sp-button treatment="fill" variant="secondary">Secondary, Fill</sp-button>
223
+ <sp-button treatment="fill" variant="negative">Negative, Fill</sp-button>
224
+ </sp-button-group>
225
+ ```
226
+
227
+ </sp-tab-panel>
228
+ <sp-tab value="outline">Outline</sp-tab>
229
+ <sp-tab-panel value="outline">
230
+
231
+ ```html demo
232
+ <sp-button-group style="min-width: max-content">
233
+ <sp-button treatment="outline" variant="primary">
234
+ Primary, Outline
235
+ </sp-button>
236
+ <sp-button treatment="outline" variant="secondary">
237
+ Secondary, Outline
238
+ </sp-button>
239
+ <sp-button treatment="outline" variant="negative">
240
+ Negative, Outline
241
+ </sp-button>
242
+ </sp-button-group>
243
+ ```
244
+
245
+ </sp-tab-panel>
246
+ <sp-tab value="outline-black">Outline, black</sp-tab>
247
+ <sp-tab-panel value="outline-black">
248
+
249
+ ```html demo
250
+ <sp-button-group
251
+ style="background: var(--spectrum-seafoam-600); padding: 0.5em; min-width: max-content"
252
+ >
253
+ <sp-button treatment="outline" static-color="black">Label only</sp-button>
254
+ <sp-button treatment="outline" static-color="black">
255
+ <sp-icon-help slot="icon"></sp-icon-help>
256
+ Icon + Label
257
+ </sp-button>
258
+ <sp-button
259
+ treatment="outline"
260
+ static-color="black"
261
+ label="Icon only"
262
+ icon-only
263
+ >
264
+ <sp-icon-help slot="icon"></sp-icon-help>
265
+ </sp-button>
266
+ </sp-button-group>
267
+ ```
268
+
269
+ </sp-tab-panel>
270
+ <sp-tab value="outline-white">Outline, white</sp-tab>
271
+ <sp-tab-panel value="outline-white">
272
+
273
+ ```html demo
274
+ <sp-button-group
275
+ style="background: var(--spectrum-seafoam-600); padding: 0.5em; min-width: max-content"
276
+ >
277
+ <sp-button treatment="outline" static-color="white">Label only</sp-button>
278
+ <sp-button treatment="outline" static-color="white">
279
+ <sp-icon-help slot="icon"></sp-icon-help>
280
+ Icon + Label
281
+ </sp-button>
282
+ <sp-button
283
+ treatment="outline"
284
+ static-color="white"
285
+ label="Icon only"
286
+ icon-only
287
+ >
288
+ <sp-icon-help slot="icon"></sp-icon-help>
289
+ </sp-button>
290
+ </sp-button-group>
291
+ ```
292
+
293
+ </sp-tab-panel>
294
+ </sp-tabs>
295
+
296
+ ## States
297
+
298
+ In addition to the variant, `<sp-button>` elements support two different visual states, disabled and pending, which can be applied by adding the attribute `disabled` or `pending` respectively. All `<sp-button>` variants support these states.
299
+
300
+ ### Disabled
301
+
302
+ While disabled, `<sp-button>` elements will not respond to click events and will appear faded.
303
+
304
+ ```html
305
+ <sp-button-group>
306
+ <sp-button variant="primary">Normal</sp-button>
307
+ <sp-button variant="primary" disabled>Disabled</sp-button>
308
+ </sp-button-group>
309
+ ```
310
+
311
+ ### Pending
312
+
313
+ While in pending state, `<sp-button>` elements will not respond to click events and will appear faded with an indeterminent `<sp-progress-circle>`.
314
+ `<sp-button>` elements label and icon will be hidden while in pending state.
315
+
316
+ Note: `pending` state of the `<sp-button>` element is applied after 1s delay to avoid flashing the pending state for quick actions.
317
+ You can override the delay by adding custom css var `--pending-delay` to your css.
318
+
319
+ ```html
320
+ <sp-button-group>
321
+ <sp-button variant="primary">Normal</sp-button>
322
+ <sp-button variant="primary" pending>Pending</sp-button>
323
+ </sp-button-group>
324
+ ```
325
+
326
+ ## Handling events
327
+
328
+ Events handlers for clicks and other user actions can be registered on a
329
+ `<sp-button>` as on a standard HTML `<button>` element.
330
+
331
+ ```html
332
+ <sp-button onclick="spAlert(this, '<sp-button> clicked!')">Click me</sp-button>
333
+ ```
334
+
335
+ In addition to handling events like a native `<button>` HTML element, one can also use a `<sp-button>` in place of the `<a>` HTML element by using the `href` and optional `target` attribute.
336
+
337
+ ```html
338
+ <sp-button
339
+ href="https://github.com/adobe/spectrum-web-components"
340
+ target="_blank"
341
+ >
342
+ Click me
343
+ </sp-button>
344
+ ```
345
+
346
+ ### Autofocus
347
+
348
+ The `autofocus` attribute sets focus to the `<sp-button>` when the component
349
+ mounts. This is useful for setting focus to a specific sp-button when a
350
+ popover or dialog opens.
351
+
352
+ ```html
353
+ <sp-button autofocus>Confirm</sp-button>
354
+ ```
package/package.json ADDED
@@ -0,0 +1,104 @@
1
+ {
2
+ "name": "@spectrum-web-components/button",
3
+ "version": "0.0.0-20241209155954",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "",
8
+ "license": "Apache-2.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/adobe/spectrum-web-components.git",
12
+ "directory": "packages/button"
13
+ },
14
+ "author": "",
15
+ "homepage": "https://opensource.adobe.com/spectrum-web-components/components/button",
16
+ "bugs": {
17
+ "url": "https://github.com/adobe/spectrum-web-components/issues"
18
+ },
19
+ "main": "./src/index.js",
20
+ "module": "./src/index.js",
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "development": "./src/index.dev.js",
25
+ "default": "./src/index.js"
26
+ },
27
+ "./package.json": "./package.json",
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-overrides.css.js": "./src/button-overrides.css.js",
50
+ "./src/button.css.js": "./src/button.css.js",
51
+ "./src/index.js": {
52
+ "development": "./src/index.dev.js",
53
+ "default": "./src/index.js"
54
+ },
55
+ "./sp-button.js": {
56
+ "development": "./sp-button.dev.js",
57
+ "default": "./sp-button.js"
58
+ },
59
+ "./sp-clear-button.js": {
60
+ "development": "./sp-clear-button.dev.js",
61
+ "default": "./sp-clear-button.js"
62
+ },
63
+ "./sp-close-button.js": {
64
+ "development": "./sp-close-button.dev.js",
65
+ "default": "./sp-close-button.js"
66
+ }
67
+ },
68
+ "scripts": {
69
+ "test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
70
+ },
71
+ "files": [
72
+ "**/*.d.ts",
73
+ "**/*.js",
74
+ "**/*.js.map",
75
+ "custom-elements.json",
76
+ "!stories/",
77
+ "!test/"
78
+ ],
79
+ "keywords": [
80
+ "spectrum css",
81
+ "web components",
82
+ "lit-element",
83
+ "lit-html"
84
+ ],
85
+ "dependencies": {
86
+ "@spectrum-web-components/base": "0.0.0-20241209155954",
87
+ "@spectrum-web-components/clear-button": "0.0.0-20241209155954",
88
+ "@spectrum-web-components/close-button": "0.0.0-20241209155954",
89
+ "@spectrum-web-components/icon": "0.0.0-20241209155954",
90
+ "@spectrum-web-components/icons-ui": "0.0.0-20241209155954",
91
+ "@spectrum-web-components/progress-circle": "0.0.0-20241209155954",
92
+ "@spectrum-web-components/shared": "0.0.0-20241209155954",
93
+ "@spectrum-web-components/reactive-controllers": "0.0.0-20241209155954"
94
+ },
95
+ "devDependencies": {
96
+ "@spectrum-css/button": "^14.0.0-s2-foundations.18"
97
+ },
98
+ "types": "./src/index.d.ts",
99
+ "customElements": "custom-elements.json",
100
+ "sideEffects": [
101
+ "./sp-*.js",
102
+ "./**/*.dev.js"
103
+ ]
104
+ }
package/sp-button.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { Button } from './src/Button.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'sp-button': Button;
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import { Button } from "./src/Button.dev.js";
3
+ import { defineElement } from "@spectrum-web-components/base/src/define-element.js";
4
+ defineElement("sp-button", Button);
5
+ //# 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'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-button', Button);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-button': Button;\n }\n}\n"],
5
+ "mappings": ";AAWA,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAE9B,cAAc,aAAa,MAAM;",
6
+ "names": []
7
+ }
package/sp-button.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";import{Button as t}from"./src/Button.js";import{defineElement as e}from"@spectrum-web-components/base/src/define-element.js";e("sp-button",t);
2
+ //# sourceMappingURL=sp-button.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.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-button', Button);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-button': Button;\n }\n}\n"],
5
+ "mappings": "aAWA,OAAS,UAAAA,MAAc,kBACvB,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,YAAaD,CAAM",
6
+ "names": ["Button", "defineElement"]
7
+ }
@@ -0,0 +1,6 @@
1
+ import { ClearButton } from './src/ClearButton.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'sp-clear-button': ClearButton;
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import { ClearButton } from "./src/ClearButton.dev.js";
3
+ import { defineElement } from "@spectrum-web-components/base/src/define-element.js";
4
+ defineElement("sp-clear-button", ClearButton);
5
+ //# 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'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-clear-button', ClearButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-clear-button': ClearButton;\n }\n}\n"],
5
+ "mappings": ";AAWA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,cAAc,mBAAmB,WAAW;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{ClearButton as e}from"./src/ClearButton.js";import{defineElement as t}from"@spectrum-web-components/base/src/define-element.js";t("sp-clear-button",e);
2
+ //# sourceMappingURL=sp-clear-button.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.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-clear-button', ClearButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-clear-button': ClearButton;\n }\n}\n"],
5
+ "mappings": "aAWA,OAAS,eAAAA,MAAmB,uBAC5B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,kBAAmBD,CAAW",
6
+ "names": ["ClearButton", "defineElement"]
7
+ }
@@ -0,0 +1,6 @@
1
+ import { CloseButton } from './src/CloseButton.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'sp-close-button': CloseButton;
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import { CloseButton } from "./src/CloseButton.dev.js";
3
+ import { defineElement } from "@spectrum-web-components/base/src/define-element.js";
4
+ defineElement("sp-close-button", CloseButton);
5
+ //# 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'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-close-button', CloseButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-close-button': CloseButton;\n }\n}\n"],
5
+ "mappings": ";AAYA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,cAAc,mBAAmB,WAAW;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";import{CloseButton as e}from"./src/CloseButton.js";import{defineElement as o}from"@spectrum-web-components/base/src/define-element.js";o("sp-close-button",e);
2
+ //# sourceMappingURL=sp-close-button.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.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-close-button', CloseButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-close-button': CloseButton;\n }\n}\n"],
5
+ "mappings": "aAYA,OAAS,eAAAA,MAAmB,uBAC5B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,kBAAmBD,CAAW",
6
+ "names": ["CloseButton", "defineElement"]
7
+ }
@@ -0,0 +1,60 @@
1
+ import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
2
+ import { ButtonBase } from './ButtonBase.js';
3
+ import { PendingStateController } from '@spectrum-web-components/reactive-controllers/src/PendingState.js';
4
+ export type DeprecatedButtonVariants = 'cta' | 'overBackground';
5
+ export type ButtonStaticColors = 'white' | 'black';
6
+ export type ButtonVariants = 'accent' | 'primary' | 'secondary' | 'negative' | ButtonStaticColors | DeprecatedButtonVariants;
7
+ export declare const VALID_VARIANTS: string[];
8
+ export declare const VALID_STATIC_COLORS: string[];
9
+ export type ButtonTreatments = 'fill' | 'outline';
10
+ declare const Button_base: typeof ButtonBase & {
11
+ new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
12
+ prototype: import("@spectrum-web-components/base").SizedElementInterface;
13
+ };
14
+ /**
15
+ * @element sp-button
16
+ *
17
+ * @slot - text label of the Button
18
+ * @slot icon - The icon to use for Button
19
+ */
20
+ export declare class Button extends Button_base {
21
+ static get styles(): CSSResultArray;
22
+ pendingLabel: string;
23
+ pending: boolean;
24
+ pendingStateController: PendingStateController<this>;
25
+ /**
26
+ * Initializes the `PendingStateController` for the Button component.
27
+ * The `PendingStateController` manages the pending state of the Button.
28
+ */
29
+ constructor();
30
+ click(): void;
31
+ /**
32
+ * The visual variant to apply to this button.
33
+ */
34
+ get variant(): ButtonVariants;
35
+ set variant(variant: ButtonVariants);
36
+ private _variant;
37
+ /**
38
+ * The static color variant to use for this button.
39
+ */
40
+ staticColor?: 'black' | 'white';
41
+ /**
42
+ * The visual treatment to apply to this button.
43
+ */
44
+ treatment: ButtonTreatments;
45
+ /**
46
+ * Style this button to be less obvious
47
+ */
48
+ set quiet(quiet: boolean);
49
+ /**
50
+ * Disables text wrapping within the button component's label.
51
+ * Please note that this option is not a part of the design specification
52
+ * and should be used carefully, with consideration of this overflow behavior
53
+ * and the readability of the button's content.
54
+ */
55
+ noWrap: boolean;
56
+ get quiet(): boolean;
57
+ protected firstUpdated(changes: PropertyValues<this>): void;
58
+ protected renderButton(): TemplateResult;
59
+ }
60
+ export {};