@spectrum-web-components/action-button 1.6.1-beta.0 → 1.7.0-snapshot.20250519143559

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/action-button",
3
- "version": "1.6.1-beta.0",
3
+ "version": "1.7.0-snapshot.20250519143559",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -64,14 +64,11 @@
64
64
  "css"
65
65
  ],
66
66
  "dependencies": {
67
- "@spectrum-web-components/base": "1.6.1-beta.0",
68
- "@spectrum-web-components/button": "1.6.1-beta.0",
69
- "@spectrum-web-components/icon": "1.6.1-beta.0",
70
- "@spectrum-web-components/icons-ui": "1.6.1-beta.0",
71
- "@spectrum-web-components/shared": "1.6.1-beta.0"
72
- },
73
- "devDependencies": {
74
- "@spectrum-css/actionbutton": "7.1.3"
67
+ "@spectrum-web-components/base": "1.7.0-snapshot.20250519143559",
68
+ "@spectrum-web-components/button": "1.7.0-snapshot.20250519143559",
69
+ "@spectrum-web-components/icon": "1.7.0-snapshot.20250519143559",
70
+ "@spectrum-web-components/icons-ui": "1.7.0-snapshot.20250519143559",
71
+ "@spectrum-web-components/shared": "1.7.0-snapshot.20250519143559"
75
72
  },
76
73
  "types": "./src/index.d.ts",
77
74
  "customElements": "custom-elements.json",
@@ -1,346 +0,0 @@
1
- {
2
- "schemaVersion": "1.0.0",
3
- "readme": "",
4
- "modules": [
5
- {
6
- "kind": "javascript-module",
7
- "path": "sp-action-button.js",
8
- "declarations": [],
9
- "exports": [
10
- {
11
- "kind": "custom-element-definition",
12
- "name": "sp-action-button",
13
- "declaration": {
14
- "name": "ActionButton",
15
- "module": "/src/ActionButton.js"
16
- }
17
- }
18
- ]
19
- },
20
- {
21
- "kind": "javascript-module",
22
- "path": "src/ActionButton.js",
23
- "declarations": [
24
- {
25
- "kind": "variable",
26
- "name": "LONGPRESS_DURATION",
27
- "type": {
28
- "text": "number"
29
- },
30
- "default": "300"
31
- },
32
- {
33
- "kind": "class",
34
- "description": "",
35
- "name": "ActionButton",
36
- "slots": [
37
- {
38
- "description": "text label of the Action Button",
39
- "name": ""
40
- },
41
- {
42
- "description": "The icon to use for Action Button",
43
- "name": "icon"
44
- }
45
- ],
46
- "members": [
47
- {
48
- "kind": "field",
49
- "name": "emphasized",
50
- "type": {
51
- "text": "boolean"
52
- },
53
- "privacy": "public",
54
- "default": "false",
55
- "attribute": "emphasized",
56
- "reflects": true
57
- },
58
- {
59
- "kind": "field",
60
- "name": "holdAffordance",
61
- "type": {
62
- "text": "boolean"
63
- },
64
- "privacy": "public",
65
- "default": "false",
66
- "attribute": "hold-affordance",
67
- "reflects": true
68
- },
69
- {
70
- "kind": "field",
71
- "name": "quiet",
72
- "type": {
73
- "text": "boolean"
74
- },
75
- "privacy": "public",
76
- "default": "false",
77
- "attribute": "quiet",
78
- "reflects": true
79
- },
80
- {
81
- "kind": "field",
82
- "name": "role",
83
- "type": {
84
- "text": "string"
85
- },
86
- "privacy": "public",
87
- "default": "'button'",
88
- "attribute": "role",
89
- "reflects": true
90
- },
91
- {
92
- "kind": "field",
93
- "name": "selected",
94
- "type": {
95
- "text": "boolean"
96
- },
97
- "privacy": "public",
98
- "default": "false",
99
- "description": "Whether an Action Button with `role='button'`\nshould also be `aria-pressed='true'`",
100
- "attribute": "selected",
101
- "reflects": true
102
- },
103
- {
104
- "kind": "field",
105
- "name": "toggles",
106
- "type": {
107
- "text": "boolean"
108
- },
109
- "privacy": "public",
110
- "default": "false",
111
- "description": "Whether to automatically manage the `selected`\nattribute on interaction and whether `aria-pressed=\"false\"`\nshould be used when `selected === false`",
112
- "attribute": "toggles",
113
- "reflects": true
114
- },
115
- {
116
- "kind": "field",
117
- "name": "staticColor",
118
- "type": {
119
- "text": "'white' | 'black' | undefined"
120
- },
121
- "privacy": "public",
122
- "description": "The static color variant to use for the action button.",
123
- "attribute": "static-color",
124
- "reflects": true
125
- },
126
- {
127
- "kind": "field",
128
- "name": "value",
129
- "type": {
130
- "text": "string"
131
- },
132
- "privacy": "public",
133
- "attribute": "value"
134
- },
135
- {
136
- "kind": "field",
137
- "name": "_value",
138
- "type": {
139
- "text": "string"
140
- },
141
- "privacy": "private",
142
- "default": "''"
143
- },
144
- {
145
- "kind": "field",
146
- "name": "itemText",
147
- "type": {
148
- "text": "string"
149
- },
150
- "privacy": "private",
151
- "readonly": true
152
- },
153
- {
154
- "kind": "field",
155
- "name": "onClick",
156
- "privacy": "private"
157
- },
158
- {
159
- "kind": "method",
160
- "name": "handlePointerdownHoldAffordance",
161
- "privacy": "private",
162
- "return": {
163
- "type": {
164
- "text": "void"
165
- }
166
- },
167
- "parameters": [
168
- {
169
- "name": "event",
170
- "type": {
171
- "text": "PointerEvent"
172
- }
173
- }
174
- ]
175
- },
176
- {
177
- "kind": "method",
178
- "name": "handlePointerupHoldAffordance",
179
- "privacy": "private",
180
- "return": {
181
- "type": {
182
- "text": "void"
183
- }
184
- }
185
- },
186
- {
187
- "kind": "method",
188
- "name": "handleKeydown",
189
- "privacy": "private",
190
- "return": {
191
- "type": {
192
- "text": "void"
193
- }
194
- },
195
- "parameters": [
196
- {
197
- "name": "event",
198
- "type": {
199
- "text": "KeyboardEvent"
200
- }
201
- }
202
- ]
203
- },
204
- {
205
- "kind": "method",
206
- "name": "handleKeyup",
207
- "privacy": "protected",
208
- "return": {
209
- "type": {
210
- "text": "void"
211
- }
212
- },
213
- "parameters": [
214
- {
215
- "name": "event",
216
- "type": {
217
- "text": "KeyboardEvent"
218
- }
219
- }
220
- ]
221
- },
222
- {
223
- "kind": "field",
224
- "name": "buttonContent",
225
- "type": {
226
- "text": "TemplateResult[]"
227
- },
228
- "privacy": "protected",
229
- "readonly": true
230
- }
231
- ],
232
- "events": [
233
- {
234
- "name": "longpress",
235
- "type": {
236
- "text": "CustomEvent"
237
- },
238
- "description": "Synthesizes a \"longpress\" interaction that signifies a `pointerdown` event that is >=300ms or a keyboard event where code is `Space` or code is `ArrowDown` while `altKey===true`."
239
- },
240
- {
241
- "description": "Announces a change in the `selected` property of an action button",
242
- "name": "change"
243
- }
244
- ],
245
- "attributes": [
246
- {
247
- "name": "emphasized",
248
- "type": {
249
- "text": "boolean"
250
- },
251
- "default": "false",
252
- "fieldName": "emphasized"
253
- },
254
- {
255
- "name": "hold-affordance",
256
- "type": {
257
- "text": "boolean"
258
- },
259
- "default": "false",
260
- "fieldName": "holdAffordance"
261
- },
262
- {
263
- "name": "quiet",
264
- "type": {
265
- "text": "boolean"
266
- },
267
- "default": "false",
268
- "fieldName": "quiet"
269
- },
270
- {
271
- "name": "role",
272
- "type": {
273
- "text": "string"
274
- },
275
- "default": "'button'",
276
- "fieldName": "role"
277
- },
278
- {
279
- "name": "selected",
280
- "type": {
281
- "text": "boolean"
282
- },
283
- "default": "false",
284
- "description": "Whether an Action Button with `role='button'`\nshould also be `aria-pressed='true'`",
285
- "fieldName": "selected"
286
- },
287
- {
288
- "name": "toggles",
289
- "type": {
290
- "text": "boolean"
291
- },
292
- "default": "false",
293
- "description": "Whether to automatically manage the `selected`\nattribute on interaction and whether `aria-pressed=\"false\"`\nshould be used when `selected === false`",
294
- "fieldName": "toggles"
295
- },
296
- {
297
- "name": "static-color",
298
- "type": {
299
- "text": "'white' | 'black' | undefined"
300
- },
301
- "description": "The static color variant to use for the action button.",
302
- "fieldName": "staticColor"
303
- },
304
- {
305
- "name": "value",
306
- "type": {
307
- "text": "string"
308
- },
309
- "fieldName": "value"
310
- }
311
- ],
312
- "mixins": [
313
- {
314
- "name": "SizedMixin",
315
- "package": "@spectrum-web-components/base"
316
- }
317
- ],
318
- "superclass": {
319
- "name": "ButtonBase",
320
- "package": "@spectrum-web-components/button"
321
- },
322
- "tagName": "sp-action-button",
323
- "customElement": true
324
- }
325
- ],
326
- "exports": [
327
- {
328
- "kind": "js",
329
- "name": "LONGPRESS_DURATION",
330
- "declaration": {
331
- "name": "LONGPRESS_DURATION",
332
- "module": "src/ActionButton.js"
333
- }
334
- },
335
- {
336
- "kind": "js",
337
- "name": "ActionButton",
338
- "declaration": {
339
- "name": "ActionButton",
340
- "module": "src/ActionButton.js"
341
- }
342
- }
343
- ]
344
- }
345
- ]
346
- }
@@ -1,270 +0,0 @@
1
- // @ts-check
2
- /*
3
- Copyright 2023 Adobe. All rights reserved.
4
- This file is licensed to you under the Apache License, Version 2.0 (the 'License');
5
- you may not use this file except in compliance with the License. You may obtain a copy
6
- of the License at http://www.apache.org/licenses/LICENSE-2.0
7
-
8
- Unless required by applicable law or agreed to in writing, software distributed under
9
- the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
10
- OF ANY KIND, either express or implied. See the License for the specific language
11
- governing permissions and limitations under the License.
12
- */
13
-
14
- import {
15
- builder,
16
- converterFor,
17
- } from '../../../tasks/process-spectrum-utils.js';
18
-
19
- const converter = converterFor('spectrum-ActionButton');
20
-
21
- /**
22
- * @type { import('../../../tasks/spectrum-css-converter').SpectrumCSSConverter }
23
- */
24
- const config = {
25
- conversions: [
26
- {
27
- inPackage: '@spectrum-css/actionbutton',
28
- outPackage: 'action-button',
29
- fileName: 'action-button',
30
- systemOverrides: true,
31
- excludeByComponents: [
32
- {
33
- type: 'type',
34
- name: 'a',
35
- },
36
- {
37
- type: 'pseudo-element',
38
- kind: 'custom',
39
- name: '-moz-focus-inner',
40
- },
41
- ],
42
- components: [
43
- converter.classToHost(),
44
- converter.classToAttribute('spectrum-ActionButton--quiet'),
45
- converter.classToAttribute('is-disabled', 'disabled'),
46
- converter.pseudoToAttribute('disabled', 'disabled'),
47
- converter.classToAttribute('is-selected', 'selected'),
48
- {
49
- find: {
50
- type: 'pseudo-class',
51
- kind: 'active',
52
- },
53
- replace: {
54
- type: 'pseudo-class',
55
- kind: 'is',
56
- selectors: [
57
- [
58
- {
59
- type: 'pseudo-class',
60
- kind: 'active',
61
- },
62
- ],
63
- [
64
- {
65
- type: 'attribute',
66
- name: 'active',
67
- },
68
- ],
69
- ],
70
- },
71
- hoist: true,
72
- },
73
- converter.classToAttribute('is-active', 'active'),
74
- converter.classToAttribute('spectrum-ActionButton--emphasized'),
75
- ...converter.enumerateAttributes(
76
- [
77
- ['spectrum-ActionButton--staticWhite', 'white'],
78
- ['spectrum-ActionButton--staticBlack', 'black'],
79
- ],
80
- 'static-color'
81
- ),
82
- // Default to `size='m'` without needing the attribute
83
- converter.classToHost('spectrum-ActionButton--sizeM'),
84
- ...converter.enumerateAttributes(
85
- [
86
- ['spectrum-ActionButton--sizeXS', 'xs'],
87
- ['spectrum-ActionButton--sizeS', 's'],
88
- ['spectrum-ActionButton--sizeL', 'l'],
89
- ['spectrum-ActionButton--sizeXL', 'xl'],
90
- ],
91
- 'size'
92
- ),
93
- converter.classToClass(
94
- 'spectrum-ActionButton-hold',
95
- 'hold-affordance'
96
- ),
97
- converter.classToClass(
98
- 'spectrum-ActionButton-holdIcon',
99
- 'hold-affordance'
100
- ),
101
- converter.classToId('spectrum-ActionButton-label'),
102
- converter.classToSlotted('spectrum-ActionButton-icon', 'icon'),
103
- {
104
- find: [
105
- builder.class('spectrum-ActionButton-icon'),
106
- builder.pseudoClass('only-child'),
107
- ],
108
- replace: [
109
- {
110
- replace: builder.attribute('icon-only'),
111
- hoist: false,
112
- },
113
- {
114
- replace: {
115
- type: 'pseudo-element',
116
- kind: 'slotted',
117
- selector: [
118
- {
119
- type: 'attribute',
120
- name: 'slot',
121
- operation: {
122
- operator: 'equal',
123
- value: 'icon',
124
- },
125
- },
126
- ],
127
- },
128
- },
129
- ],
130
- },
131
- {
132
- find: [
133
- builder.class('spectrum-ActionButton-icon'),
134
- builder.combinator('+'),
135
- builder.class('spectrum-ActionButton-label'),
136
- ],
137
- replace: [
138
- {
139
- replace: {
140
- type: 'attribute',
141
- name: 'name',
142
- operation: {
143
- operator: 'equal',
144
- value: 'icon',
145
- },
146
- },
147
- hoist: false,
148
- },
149
- {
150
- replace: builder.combinator('+'),
151
- },
152
- {
153
- replace: builder.id('label'),
154
- },
155
- ],
156
- },
157
- {
158
- find: [
159
- builder.class('spectrum-ActionButton-hold'),
160
- {
161
- type: 'pseudo-class',
162
- kind: 'dir',
163
- direction: 'rtl',
164
- },
165
- ],
166
- replace: [
167
- {
168
- replace: {
169
- type: 'pseudo-class',
170
- kind: 'host',
171
- selectors: [
172
- {
173
- type: 'attribute',
174
- name: 'dir',
175
- operation: {
176
- value: 'rtl',
177
- operator: 'equal',
178
- },
179
- },
180
- ],
181
- },
182
- },
183
- {
184
- replace: builder.combinator(' '),
185
- },
186
- {
187
- replace: builder.class('hold-affordance'),
188
- },
189
- ],
190
- },
191
- {
192
- find: {
193
- type: 'pseudo-class',
194
- kind: 'not',
195
- selectors: [
196
- [
197
- {
198
- type: 'pseudo-class',
199
- kind: 'disabled',
200
- },
201
- ],
202
- ],
203
- },
204
- replace: {
205
- type: 'pseudo-class',
206
- kind: 'not',
207
- selectors: [
208
- [
209
- {
210
- type: 'pseudo-class',
211
- kind: 'disabled',
212
- },
213
- ],
214
- ],
215
- },
216
- hoist: true,
217
- },
218
- {
219
- find: {
220
- type: 'pseudo-class',
221
- kind: 'not',
222
- selectors: [
223
- [
224
- {
225
- type: 'class',
226
- name: 'spectrum-ActionButton--staticBlack',
227
- },
228
- ],
229
- [
230
- {
231
- type: 'class',
232
- name: 'spectrum-ActionButton--staticWhite',
233
- },
234
- ],
235
- ],
236
- },
237
- replace: {
238
- kind: 'not',
239
- type: 'pseudo-class',
240
- selectors: [
241
- [
242
- {
243
- type: 'attribute',
244
- name: 'static-color',
245
- operation: {
246
- operator: 'equal',
247
- value: 'black',
248
- },
249
- },
250
- ],
251
- [
252
- {
253
- type: 'attribute',
254
- name: 'static-color',
255
- operation: {
256
- operator: 'equal',
257
- value: 'white',
258
- },
259
- },
260
- ],
261
- ],
262
- },
263
- hoist: true,
264
- },
265
- ],
266
- },
267
- ],
268
- };
269
-
270
- export default config;