@spectrum-web-components/action-group 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -7
- package/LICENSE +0 -201
- package/stories/action-group-sizes.stories.js +0 -140
- package/stories/action-group-sizes.stories.js.map +0 -7
- package/stories/action-group-tooltip.stories.js +0 -388
- package/stories/action-group-tooltip.stories.js.map +0 -7
- package/stories/action-group.stories.js +0 -327
- package/stories/action-group.stories.js.map +0 -7
- package/test/action-group-memory.test.js +0 -5
- package/test/action-group-memory.test.js.map +0 -7
- package/test/action-group-sizes.test-vrt.js +0 -5
- package/test/action-group-sizes.test-vrt.js.map +0 -7
- package/test/action-group-tooltip.test-vrt.js +0 -5
- package/test/action-group-tooltip.test-vrt.js.map +0 -7
- package/test/action-group.test-vrt.js +0 -5
- package/test/action-group.test-vrt.js.map +0 -7
- package/test/action-group.test.js +0 -1249
- package/test/action-group.test.js.map +0 -7
- package/test/benchmark/basic-test.js +0 -13
- package/test/benchmark/basic-test.js.map +0 -7
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { html } from "@spectrum-web-components/base";
|
|
3
|
-
import { spreadProps } from "../../../test/lit-helpers.js";
|
|
4
|
-
import "@spectrum-web-components/action-group/sp-action-group.js";
|
|
5
|
-
import "@spectrum-web-components/action-button/sp-action-button.js";
|
|
6
|
-
import "@spectrum-web-components/overlay/overlay-trigger.js";
|
|
7
|
-
import "@spectrum-web-components/tooltip/sp-tooltip.js";
|
|
8
|
-
import "@spectrum-web-components/icons-workflow/icons/sp-icon-properties.js";
|
|
9
|
-
import "@spectrum-web-components/icons-workflow/icons/sp-icon-info.js";
|
|
10
|
-
import "@spectrum-web-components/icons-workflow/icons/sp-icon-view-all-tags.js";
|
|
11
|
-
import "@spectrum-web-components/action-menu/sp-action-menu.js";
|
|
12
|
-
import "@spectrum-web-components/menu/sp-menu.js";
|
|
13
|
-
import "@spectrum-web-components/menu/sp-menu-item.js";
|
|
14
|
-
export default {
|
|
15
|
-
title: "Action Group",
|
|
16
|
-
component: "sp-action-group",
|
|
17
|
-
args: {
|
|
18
|
-
compact: false,
|
|
19
|
-
emphasized: false,
|
|
20
|
-
justified: false,
|
|
21
|
-
quiet: false,
|
|
22
|
-
vertical: false,
|
|
23
|
-
size: "m"
|
|
24
|
-
},
|
|
25
|
-
argTypes: {
|
|
26
|
-
compact: {
|
|
27
|
-
name: "compact",
|
|
28
|
-
description: "Visually joins the buttons together to clarify their relationship to one another.",
|
|
29
|
-
type: { name: "boolean", required: false },
|
|
30
|
-
table: {
|
|
31
|
-
type: { summary: "boolean" },
|
|
32
|
-
defaultValue: { summary: false }
|
|
33
|
-
},
|
|
34
|
-
control: {
|
|
35
|
-
type: "boolean"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
emphasized: {
|
|
39
|
-
name: "emphasized",
|
|
40
|
-
type: { name: "boolean", required: false },
|
|
41
|
-
table: {
|
|
42
|
-
type: { summary: "boolean" },
|
|
43
|
-
defaultValue: { summary: false }
|
|
44
|
-
},
|
|
45
|
-
control: {
|
|
46
|
-
type: "boolean"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
justified: {
|
|
50
|
-
name: "justified",
|
|
51
|
-
description: "Aligns the action group items to use all the available space on that line.",
|
|
52
|
-
type: { name: "boolean", required: false },
|
|
53
|
-
table: {
|
|
54
|
-
type: { summary: "boolean" },
|
|
55
|
-
defaultValue: { summary: false }
|
|
56
|
-
},
|
|
57
|
-
control: {
|
|
58
|
-
type: "boolean"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
quiet: {
|
|
62
|
-
name: "quiet",
|
|
63
|
-
type: { name: "boolean", required: false },
|
|
64
|
-
table: {
|
|
65
|
-
type: { summary: "boolean" },
|
|
66
|
-
defaultValue: { summary: false }
|
|
67
|
-
},
|
|
68
|
-
control: {
|
|
69
|
-
type: "boolean"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
vertical: {
|
|
73
|
-
name: "vertical",
|
|
74
|
-
description: "Changes the orientation of the action group.",
|
|
75
|
-
type: { name: "boolean", required: false },
|
|
76
|
-
table: {
|
|
77
|
-
type: { summary: "boolean" },
|
|
78
|
-
defaultValue: { summary: false }
|
|
79
|
-
},
|
|
80
|
-
control: {
|
|
81
|
-
type: "boolean"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
size: {
|
|
85
|
-
name: "size",
|
|
86
|
-
description: "The size at which to display the action group.",
|
|
87
|
-
type: { name: "string", required: true },
|
|
88
|
-
table: {
|
|
89
|
-
type: { summary: '"s" | "m" | "l" | "xl"' },
|
|
90
|
-
defaultValue: { summary: "m" }
|
|
91
|
-
},
|
|
92
|
-
control: {
|
|
93
|
-
type: "select",
|
|
94
|
-
options: ["s", "m", "l", "xl"]
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
function renderIconButtons(args) {
|
|
100
|
-
return html`
|
|
101
|
-
<sp-action-group ${spreadProps(args)}>
|
|
102
|
-
<sp-action-button label="Properties">
|
|
103
|
-
<sp-icon-properties slot="icon"></sp-icon-properties>
|
|
104
|
-
</sp-action-button>
|
|
105
|
-
<sp-action-button label="Info">
|
|
106
|
-
<sp-icon-info slot="icon"></sp-icon-info>
|
|
107
|
-
</sp-action-button>
|
|
108
|
-
<sp-action-button label="View All Tags">
|
|
109
|
-
<sp-icon-view-all-tags slot="icon"></sp-icon-view-all-tags>
|
|
110
|
-
</sp-action-button>
|
|
111
|
-
</sp-action-group>
|
|
112
|
-
`;
|
|
113
|
-
}
|
|
114
|
-
function renderButtons(args) {
|
|
115
|
-
return html`
|
|
116
|
-
<sp-action-group ${spreadProps(args)}>
|
|
117
|
-
<sp-action-button>Button 1</sp-action-button>
|
|
118
|
-
<sp-action-button>Longer Button 2</sp-action-button>
|
|
119
|
-
<sp-action-button>Short 3</sp-action-button>
|
|
120
|
-
</sp-action-group>
|
|
121
|
-
`;
|
|
122
|
-
}
|
|
123
|
-
function displaySelectionState() {
|
|
124
|
-
const group = document.querySelector("sp-action-group");
|
|
125
|
-
const selectedDiv = group.nextElementSibling;
|
|
126
|
-
if (selectedDiv) {
|
|
127
|
-
selectedDiv.textContent = `Selected: ${JSON.stringify(group.selected)}`;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
export const Default = (args) => renderButtons(args);
|
|
131
|
-
export const HasActionMenuAsChild = (args) => {
|
|
132
|
-
return html`
|
|
133
|
-
<sp-action-group ${spreadProps(args)}>
|
|
134
|
-
<sp-action-button id="first">Button 1</sp-action-button>
|
|
135
|
-
<sp-action-button id="second">Longer Button 2</sp-action-button>
|
|
136
|
-
<sp-action-button id="third">Short 3</sp-action-button>
|
|
137
|
-
<sp-action-menu label="More Actions" id="action-menu">
|
|
138
|
-
<sp-menu-item id="first-menu-item">One</sp-menu-item>
|
|
139
|
-
<sp-menu-item id="second-menu-item">Two</sp-menu-item>
|
|
140
|
-
<sp-menu-item id="third-menu-item">Three</sp-menu-item>
|
|
141
|
-
<sp-menu-item id="fourth-menu-item">
|
|
142
|
-
Select some items
|
|
143
|
-
<sp-menu slot="submenu" selects="multiple">
|
|
144
|
-
<sp-menu-item id="first-sub-menu-item">A</sp-menu-item>
|
|
145
|
-
<sp-menu-item selected id="second-sub-menu-item">
|
|
146
|
-
B
|
|
147
|
-
</sp-menu-item>
|
|
148
|
-
<sp-menu-item id="third-sub-menu-item">C</sp-menu-item>
|
|
149
|
-
</sp-menu>
|
|
150
|
-
</sp-menu-item>
|
|
151
|
-
</sp-action-menu>
|
|
152
|
-
</sp-action-group>
|
|
153
|
-
`;
|
|
154
|
-
};
|
|
155
|
-
export const selectsSingle = (args) => {
|
|
156
|
-
requestAnimationFrame(displaySelectionState);
|
|
157
|
-
return html`
|
|
158
|
-
<sp-action-group
|
|
159
|
-
?compact=${args.compact}
|
|
160
|
-
?emphasized=${args.emphasized}
|
|
161
|
-
?quiet=${args.quiet}
|
|
162
|
-
?justified=${args.justified}
|
|
163
|
-
?vertical=${args.vertical}
|
|
164
|
-
size=${args.size}
|
|
165
|
-
label="Favorite Color"
|
|
166
|
-
selects="single"
|
|
167
|
-
@change=${({ target }) => {
|
|
168
|
-
const next = target.nextElementSibling;
|
|
169
|
-
next.textContent = `Selected: ${JSON.stringify(
|
|
170
|
-
target.selected
|
|
171
|
-
)}`;
|
|
172
|
-
}}
|
|
173
|
-
>
|
|
174
|
-
<sp-action-button>Red</sp-action-button>
|
|
175
|
-
<sp-action-button>Green</sp-action-button>
|
|
176
|
-
<sp-action-button>Blue</sp-action-button>
|
|
177
|
-
<sp-action-button selected>Yellow</sp-action-button>
|
|
178
|
-
</sp-action-group>
|
|
179
|
-
<div>Selected:</div>
|
|
180
|
-
`;
|
|
181
|
-
};
|
|
182
|
-
export const selectsMultiple = (args) => {
|
|
183
|
-
requestAnimationFrame(displaySelectionState);
|
|
184
|
-
return html`
|
|
185
|
-
<sp-action-group
|
|
186
|
-
${spreadProps(args)}
|
|
187
|
-
label="Favorite Colors"
|
|
188
|
-
selects="multiple"
|
|
189
|
-
size=${args.size}
|
|
190
|
-
@change=${({ target }) => {
|
|
191
|
-
const next = target.nextElementSibling;
|
|
192
|
-
next.textContent = `Selected: ${JSON.stringify(
|
|
193
|
-
target.selected
|
|
194
|
-
)}`;
|
|
195
|
-
}}
|
|
196
|
-
>
|
|
197
|
-
<sp-action-button>Red</sp-action-button>
|
|
198
|
-
<sp-action-button selected>Green</sp-action-button>
|
|
199
|
-
<sp-action-button selected>Blue</sp-action-button>
|
|
200
|
-
<sp-action-button>Yellow</sp-action-button>
|
|
201
|
-
</sp-action-group>
|
|
202
|
-
<div>Selected:</div>
|
|
203
|
-
`;
|
|
204
|
-
};
|
|
205
|
-
export const selectsMultipleWithTooltips = (args) => {
|
|
206
|
-
return html`
|
|
207
|
-
<sp-action-group
|
|
208
|
-
${spreadProps(args)}
|
|
209
|
-
label="Favorite Color"
|
|
210
|
-
selects="multiple"
|
|
211
|
-
size=${args.size}
|
|
212
|
-
@change=${({ target }) => {
|
|
213
|
-
const next = target.nextElementSibling;
|
|
214
|
-
next.textContent = `Selected: ${JSON.stringify(
|
|
215
|
-
target.selected
|
|
216
|
-
)}`;
|
|
217
|
-
}}
|
|
218
|
-
>
|
|
219
|
-
<overlay-trigger>
|
|
220
|
-
<sp-action-button slot="trigger">Red</sp-action-button>
|
|
221
|
-
<sp-tooltip slot="hover-content">
|
|
222
|
-
This is a cool color.
|
|
223
|
-
</sp-tooltip>
|
|
224
|
-
</overlay-trigger>
|
|
225
|
-
<overlay-trigger>
|
|
226
|
-
<sp-action-button slot="trigger">Green</sp-action-button>
|
|
227
|
-
<sp-tooltip slot="hover-content">
|
|
228
|
-
You wouldn't be wrong.
|
|
229
|
-
</sp-tooltip>
|
|
230
|
-
</overlay-trigger>
|
|
231
|
-
<overlay-trigger>
|
|
232
|
-
<sp-action-button slot="trigger">Blue</sp-action-button>
|
|
233
|
-
<sp-tooltip slot="hover-content">The sky in spring.</sp-tooltip>
|
|
234
|
-
</overlay-trigger>
|
|
235
|
-
<overlay-trigger>
|
|
236
|
-
<sp-action-button slot="trigger">Yellow</sp-action-button>
|
|
237
|
-
<sp-tooltip slot="hover-content">The sun at noon.</sp-tooltip>
|
|
238
|
-
</overlay-trigger>
|
|
239
|
-
</sp-action-group>
|
|
240
|
-
<div>Selected:</div>
|
|
241
|
-
`;
|
|
242
|
-
};
|
|
243
|
-
export const selectsMultipleControlled = (args) => {
|
|
244
|
-
requestAnimationFrame(displaySelectionState);
|
|
245
|
-
return html`
|
|
246
|
-
<sp-action-group
|
|
247
|
-
${spreadProps(args)}
|
|
248
|
-
selects="multiple"
|
|
249
|
-
.selected=${["donuts", "crepecakes"]}
|
|
250
|
-
label="Favorite Dessert"
|
|
251
|
-
size=${args.size}
|
|
252
|
-
@change=${({ target }) => {
|
|
253
|
-
const next = target.nextElementSibling;
|
|
254
|
-
next.textContent = `Selected: ${JSON.stringify(
|
|
255
|
-
target.selected
|
|
256
|
-
)}`;
|
|
257
|
-
}}
|
|
258
|
-
>
|
|
259
|
-
<sp-action-button value="lavacakes">Lava Cakes</sp-action-button>
|
|
260
|
-
<sp-action-button value="donuts">Donuts</sp-action-button>
|
|
261
|
-
<sp-action-button value="crepecakes">Crepe Cake</sp-action-button>
|
|
262
|
-
<sp-action-button value="fruittarts">Fruit Tarts</sp-action-button>
|
|
263
|
-
</sp-action-group>
|
|
264
|
-
<div>Selected:</div>
|
|
265
|
-
`;
|
|
266
|
-
};
|
|
267
|
-
export const iconsOnly = (args) => renderIconButtons(args);
|
|
268
|
-
export const quietIconsOnly = (args) => renderIconButtons(args);
|
|
269
|
-
quietIconsOnly.args = {
|
|
270
|
-
quiet: true
|
|
271
|
-
};
|
|
272
|
-
export const compact = (args) => renderButtons(args);
|
|
273
|
-
compact.args = {
|
|
274
|
-
compact: true
|
|
275
|
-
};
|
|
276
|
-
export const compactIconsOnly = (args) => renderIconButtons(args);
|
|
277
|
-
compactIconsOnly.args = {
|
|
278
|
-
compact: true
|
|
279
|
-
};
|
|
280
|
-
export const compactQuietIconsOnly = (args) => renderIconButtons(args);
|
|
281
|
-
compactQuietIconsOnly.args = {
|
|
282
|
-
compact: true,
|
|
283
|
-
quiet: true
|
|
284
|
-
};
|
|
285
|
-
export const vertical = (args) => renderButtons(args);
|
|
286
|
-
vertical.args = {
|
|
287
|
-
vertical: true
|
|
288
|
-
};
|
|
289
|
-
export const verticalIconsOnly = (args) => renderIconButtons(args);
|
|
290
|
-
verticalIconsOnly.args = {
|
|
291
|
-
vertical: true
|
|
292
|
-
};
|
|
293
|
-
export const verticalQuietIconsOnly = (args) => renderIconButtons(args);
|
|
294
|
-
verticalQuietIconsOnly.args = {
|
|
295
|
-
quiet: true,
|
|
296
|
-
vertical: true
|
|
297
|
-
};
|
|
298
|
-
export const compactVertical = (args) => renderButtons(args);
|
|
299
|
-
compactVertical.args = {
|
|
300
|
-
compact: true,
|
|
301
|
-
vertical: true
|
|
302
|
-
};
|
|
303
|
-
export const compactVerticalIconsOnly = (args) => renderIconButtons(args);
|
|
304
|
-
compactVerticalIconsOnly.args = {
|
|
305
|
-
compact: true,
|
|
306
|
-
vertical: true
|
|
307
|
-
};
|
|
308
|
-
export const compactQuietVerticalIconsOnly = (args) => renderIconButtons(args);
|
|
309
|
-
compactQuietVerticalIconsOnly.args = {
|
|
310
|
-
compact: true,
|
|
311
|
-
quiet: true,
|
|
312
|
-
vertical: true
|
|
313
|
-
};
|
|
314
|
-
export const justified = (args) => renderButtons(args);
|
|
315
|
-
justified.args = {
|
|
316
|
-
justified: true
|
|
317
|
-
};
|
|
318
|
-
export const justifiedIconsOnly = (args) => renderIconButtons(args);
|
|
319
|
-
justifiedIconsOnly.args = {
|
|
320
|
-
justified: true
|
|
321
|
-
};
|
|
322
|
-
export const compactJustifiedIconsOnly = (args) => renderIconButtons(args);
|
|
323
|
-
compactJustifiedIconsOnly.args = {
|
|
324
|
-
compact: true,
|
|
325
|
-
justified: true
|
|
326
|
-
};
|
|
327
|
-
//# sourceMappingURL=action-group.stories.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["action-group.stories.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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { spreadProps } from '../../../test/lit-helpers.js';\n\nimport '@spectrum-web-components/action-group/sp-action-group.js';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-properties.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-view-all-tags.js';\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport { ActionGroup } from '@spectrum-web-components/action-group/src/ActionGroup.js';\n\nexport default {\n title: 'Action Group',\n component: 'sp-action-group',\n args: {\n compact: false,\n emphasized: false,\n justified: false,\n quiet: false,\n vertical: false,\n size: 'm',\n },\n argTypes: {\n compact: {\n name: 'compact',\n description:\n 'Visually joins the buttons together to clarify their relationship to one another.',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n emphasized: {\n name: 'emphasized',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n justified: {\n name: 'justified',\n description:\n 'Aligns the action group items to use all the available space on that line.',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n quiet: {\n name: 'quiet',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n vertical: {\n name: 'vertical',\n description: 'Changes the orientation of the action group.',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n size: {\n name: 'size',\n description: 'The size at which to display the action group.',\n type: { name: 'string', required: true },\n table: {\n type: { summary: '\"s\" | \"m\" | \"l\" | \"xl\"' },\n defaultValue: { summary: 'm' },\n },\n control: {\n type: 'select',\n options: ['s', 'm', 'l', 'xl'],\n },\n },\n },\n};\n\ninterface Properties {\n compact?: boolean;\n emphasized?: boolean;\n justified?: boolean;\n quiet?: boolean;\n vertical?: boolean;\n size?: 's' | 'm' | 'l' | 'xl';\n [prop: string]: unknown;\n}\n\nfunction renderIconButtons(args: Properties): TemplateResult {\n return html`\n <sp-action-group ${spreadProps(args)}>\n <sp-action-button label=\"Properties\">\n <sp-icon-properties slot=\"icon\"></sp-icon-properties>\n </sp-action-button>\n <sp-action-button label=\"Info\">\n <sp-icon-info slot=\"icon\"></sp-icon-info>\n </sp-action-button>\n <sp-action-button label=\"View All Tags\">\n <sp-icon-view-all-tags slot=\"icon\"></sp-icon-view-all-tags>\n </sp-action-button>\n </sp-action-group>\n `;\n}\n\nfunction renderButtons(args: Properties): TemplateResult {\n return html`\n <sp-action-group ${spreadProps(args)}>\n <sp-action-button>Button 1</sp-action-button>\n <sp-action-button>Longer Button 2</sp-action-button>\n <sp-action-button>Short 3</sp-action-button>\n </sp-action-group>\n `;\n}\n\nfunction displaySelectionState(): void {\n const group = document.querySelector('sp-action-group') as ActionGroup;\n const selectedDiv = group.nextElementSibling;\n if (selectedDiv) {\n selectedDiv.textContent = `Selected: ${JSON.stringify(group.selected)}`;\n }\n}\n\nexport const Default = (args: Properties): TemplateResult =>\n renderButtons(args);\n\nexport const HasActionMenuAsChild = (args: Properties): TemplateResult => {\n return html`\n <sp-action-group ${spreadProps(args)}>\n <sp-action-button id=\"first\">Button 1</sp-action-button>\n <sp-action-button id=\"second\">Longer Button 2</sp-action-button>\n <sp-action-button id=\"third\">Short 3</sp-action-button>\n <sp-action-menu label=\"More Actions\" id=\"action-menu\">\n <sp-menu-item id=\"first-menu-item\">One</sp-menu-item>\n <sp-menu-item id=\"second-menu-item\">Two</sp-menu-item>\n <sp-menu-item id=\"third-menu-item\">Three</sp-menu-item>\n <sp-menu-item id=\"fourth-menu-item\">\n Select some items\n <sp-menu slot=\"submenu\" selects=\"multiple\">\n <sp-menu-item id=\"first-sub-menu-item\">A</sp-menu-item>\n <sp-menu-item selected id=\"second-sub-menu-item\">\n B\n </sp-menu-item>\n <sp-menu-item id=\"third-sub-menu-item\">C</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-action-menu>\n </sp-action-group>\n `;\n};\n\nexport const selectsSingle = (args: Properties): TemplateResult => {\n requestAnimationFrame(displaySelectionState);\n return html`\n <sp-action-group\n ?compact=${args.compact}\n ?emphasized=${args.emphasized}\n ?quiet=${args.quiet}\n ?justified=${args.justified}\n ?vertical=${args.vertical}\n size=${args.size}\n label=\"Favorite Color\"\n selects=\"single\"\n @change=${({ target }: Event & { target: ActionGroup }) => {\n const next = target.nextElementSibling as HTMLDivElement;\n next.textContent = `Selected: ${JSON.stringify(\n target.selected\n )}`;\n }}\n >\n <sp-action-button>Red</sp-action-button>\n <sp-action-button>Green</sp-action-button>\n <sp-action-button>Blue</sp-action-button>\n <sp-action-button selected>Yellow</sp-action-button>\n </sp-action-group>\n <div>Selected:</div>\n `;\n};\n\nexport const selectsMultiple = (args: Properties): TemplateResult => {\n requestAnimationFrame(displaySelectionState);\n return html`\n <sp-action-group\n ${spreadProps(args)}\n label=\"Favorite Colors\"\n selects=\"multiple\"\n size=${args.size}\n @change=${({ target }: Event & { target: ActionGroup }) => {\n const next = target.nextElementSibling as HTMLDivElement;\n next.textContent = `Selected: ${JSON.stringify(\n target.selected\n )}`;\n }}\n >\n <sp-action-button>Red</sp-action-button>\n <sp-action-button selected>Green</sp-action-button>\n <sp-action-button selected>Blue</sp-action-button>\n <sp-action-button>Yellow</sp-action-button>\n </sp-action-group>\n <div>Selected:</div>\n `;\n};\n\nexport const selectsMultipleWithTooltips = (\n args: Properties\n): TemplateResult => {\n return html`\n <sp-action-group\n ${spreadProps(args)}\n label=\"Favorite Color\"\n selects=\"multiple\"\n size=${args.size}\n @change=${({ target }: Event & { target: ActionGroup }) => {\n const next = target.nextElementSibling as HTMLDivElement;\n next.textContent = `Selected: ${JSON.stringify(\n target.selected\n )}`;\n }}\n >\n <overlay-trigger>\n <sp-action-button slot=\"trigger\">Red</sp-action-button>\n <sp-tooltip slot=\"hover-content\">\n This is a cool color.\n </sp-tooltip>\n </overlay-trigger>\n <overlay-trigger>\n <sp-action-button slot=\"trigger\">Green</sp-action-button>\n <sp-tooltip slot=\"hover-content\">\n You wouldn't be wrong.\n </sp-tooltip>\n </overlay-trigger>\n <overlay-trigger>\n <sp-action-button slot=\"trigger\">Blue</sp-action-button>\n <sp-tooltip slot=\"hover-content\">The sky in spring.</sp-tooltip>\n </overlay-trigger>\n <overlay-trigger>\n <sp-action-button slot=\"trigger\">Yellow</sp-action-button>\n <sp-tooltip slot=\"hover-content\">The sun at noon.</sp-tooltip>\n </overlay-trigger>\n </sp-action-group>\n <div>Selected:</div>\n `;\n};\n\nexport const selectsMultipleControlled = (args: Properties): TemplateResult => {\n requestAnimationFrame(displaySelectionState);\n return html`\n <sp-action-group\n ${spreadProps(args)}\n selects=\"multiple\"\n .selected=${['donuts', 'crepecakes']}\n label=\"Favorite Dessert\"\n size=${args.size}\n @change=${({ target }: Event & { target: ActionGroup }) => {\n const next = target.nextElementSibling as HTMLDivElement;\n next.textContent = `Selected: ${JSON.stringify(\n target.selected\n )}`;\n }}\n >\n <sp-action-button value=\"lavacakes\">Lava Cakes</sp-action-button>\n <sp-action-button value=\"donuts\">Donuts</sp-action-button>\n <sp-action-button value=\"crepecakes\">Crepe Cake</sp-action-button>\n <sp-action-button value=\"fruittarts\">Fruit Tarts</sp-action-button>\n </sp-action-group>\n <div>Selected:</div>\n `;\n};\n\nexport const iconsOnly = (args: Properties): TemplateResult =>\n renderIconButtons(args);\n\nexport const quietIconsOnly = (args: Properties): TemplateResult =>\n renderIconButtons(args);\nquietIconsOnly.args = {\n quiet: true,\n};\n\nexport const compact = (args: Properties): TemplateResult =>\n renderButtons(args);\ncompact.args = {\n compact: true,\n};\n\nexport const compactIconsOnly = (args: Properties): TemplateResult =>\n renderIconButtons(args);\ncompactIconsOnly.args = {\n compact: true,\n};\n\nexport const compactQuietIconsOnly = (args: Properties): TemplateResult =>\n renderIconButtons(args);\ncompactQuietIconsOnly.args = {\n compact: true,\n quiet: true,\n};\n\nexport const vertical = (args: Properties): TemplateResult =>\n renderButtons(args);\nvertical.args = {\n vertical: true,\n};\n\nexport const verticalIconsOnly = (args: Properties): TemplateResult =>\n renderIconButtons(args);\nverticalIconsOnly.args = {\n vertical: true,\n};\n\nexport const verticalQuietIconsOnly = (args: Properties): TemplateResult =>\n renderIconButtons(args);\nverticalQuietIconsOnly.args = {\n quiet: true,\n vertical: true,\n};\n\nexport const compactVertical = (args: Properties): TemplateResult =>\n renderButtons(args);\ncompactVertical.args = {\n compact: true,\n vertical: true,\n};\n\nexport const compactVerticalIconsOnly = (args: Properties): TemplateResult =>\n renderIconButtons(args);\ncompactVerticalIconsOnly.args = {\n compact: true,\n vertical: true,\n};\n\nexport const compactQuietVerticalIconsOnly = (\n args: Properties\n): TemplateResult => renderIconButtons(args);\ncompactQuietVerticalIconsOnly.args = {\n compact: true,\n quiet: true,\n vertical: true,\n};\n\nexport const justified = (args: Properties): TemplateResult =>\n renderButtons(args);\njustified.args = {\n justified: true,\n};\n\nexport const justifiedIconsOnly = (args: Properties): TemplateResult =>\n renderIconButtons(args);\njustifiedIconsOnly.args = {\n justified: true,\n};\n\nexport const compactJustifiedIconsOnly = (args: Properties): TemplateResult =>\n renderIconButtons(args);\ncompactJustifiedIconsOnly.args = {\n compact: true,\n justified: true,\n};\n"],
|
|
5
|
-
"mappings": ";AAYA,SAAS,YAA4B;AACrC,SAAS,mBAAmB;AAE5B,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAGP,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,MAAM;AAAA,IACF,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA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U;AACd;AAEO,aAAM,YAAY,CAAC,SACtB,cAAc,IAAI;AACtB,UAAU,OAAO;AAAA,EACb,WAAW;AACf;AAEO,aAAM,qBAAqB,CAAC,SAC/B,kBAAkB,IAAI;AAC1B,mBAAmB,OAAO;AAAA,EACtB,WAAW;AACf;AAEO,aAAM,4BAA4B,CAAC,SACtC,kBAAkB,IAAI;AAC1B,0BAA0B,OAAO;AAAA,EAC7B,SAAS;AAAA,EACT,WAAW;AACf;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["action-group-memory.test.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 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 { Default } from '../stories/action-group.stories.js';\nimport { testForMemoryLeaks } from '../../../test/testing-helpers.js';\n\ntestForMemoryLeaks(Default({}));\n"],
|
|
5
|
-
"mappings": ";AAYA,SAAS,eAAe;AACxB,SAAS,0BAA0B;AAEnC,mBAAmB,QAAQ,CAAC,CAAC,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["action-group-sizes.test-vrt.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/action-group-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionGroupSizesStories', stories as unknown as TestsType);\n"],
|
|
5
|
-
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,2BAA2B,OAA+B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["action-group-tooltip.test-vrt.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/action-group-tooltip.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionGroupTooltipStories', stories as unknown as TestsType);\n"],
|
|
5
|
-
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,6BAA6B,OAA+B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["action-group.test-vrt.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/action-group.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionGroupStories', stories as unknown as TestsType);\n"],
|
|
5
|
-
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,sBAAsB,OAA+B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|