@vonage/vivid 3.0.0-next.3 → 3.0.0-next.30

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 (143) hide show
  1. package/README.md +49 -4
  2. package/accordion/index.js +61 -0
  3. package/accordion-item/index.js +133 -0
  4. package/action-group/index.js +49 -0
  5. package/badge/index.js +27 -22
  6. package/banner/index.js +148 -0
  7. package/breadcrumb/index.js +41 -150
  8. package/breadcrumb-item/index.js +18 -8
  9. package/button/index.js +40 -663
  10. package/calendar/index.js +1550 -0
  11. package/calendar-event/index.js +117 -0
  12. package/card/index.js +134 -0
  13. package/checkbox/index.js +176 -0
  14. package/elevation/index.js +4 -38
  15. package/fab/index.js +101 -0
  16. package/focus/index.js +20 -3
  17. package/header/index.js +68 -0
  18. package/icon/index.js +40 -5
  19. package/index.d.ts +1 -0
  20. package/index.js +50 -14
  21. package/layout/index.js +5 -5
  22. package/lib/accordion/accordion.d.ts +9 -0
  23. package/lib/accordion/accordion.template.d.ts +4 -0
  24. package/lib/accordion/index.d.ts +2 -0
  25. package/lib/accordion-item/accordion-item.d.ts +13 -0
  26. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  27. package/lib/accordion-item/index.d.ts +4 -0
  28. package/lib/action-group/action-group.d.ts +10 -0
  29. package/lib/action-group/action-group.template.d.ts +4 -0
  30. package/lib/action-group/index.d.ts +2 -0
  31. package/lib/badge/badge.d.ts +8 -8
  32. package/lib/badge/index.d.ts +1 -1
  33. package/lib/banner/banner.d.ts +20 -0
  34. package/lib/banner/banner.template.d.ts +4 -0
  35. package/lib/banner/index.d.ts +3 -0
  36. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  37. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  38. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  39. package/lib/breadcrumb-item/index.d.ts +2 -0
  40. package/lib/button/button.d.ts +9 -8
  41. package/lib/button/index.d.ts +2 -19
  42. package/lib/calendar/calendar.d.ts +13 -0
  43. package/lib/calendar/calendar.template.d.ts +4 -0
  44. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  45. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  46. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  47. package/lib/calendar/index.d.ts +2 -0
  48. package/lib/calendar-event/calendar-event.d.ts +14 -0
  49. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  50. package/lib/calendar-event/index.d.ts +2 -0
  51. package/lib/card/card.d.ts +10 -0
  52. package/lib/card/card.template.d.ts +4 -0
  53. package/lib/card/index.d.ts +4 -0
  54. package/lib/checkbox/checkbox.d.ts +5 -0
  55. package/lib/checkbox/checkbox.template.d.ts +4 -0
  56. package/lib/checkbox/index.d.ts +4 -0
  57. package/lib/components.d.ts +23 -5
  58. package/lib/elevation/elevation.d.ts +2 -1
  59. package/lib/elevation/index.d.ts +1 -1
  60. package/lib/enums.d.ts +14 -7
  61. package/lib/fab/fab.d.ts +13 -0
  62. package/lib/fab/fab.template.d.ts +4 -0
  63. package/lib/fab/index.d.ts +4 -0
  64. package/lib/focus/index.d.ts +1 -1
  65. package/lib/header/header.d.ts +5 -0
  66. package/lib/header/header.template.d.ts +4 -0
  67. package/lib/header/index.d.ts +3 -0
  68. package/lib/icon/icon.d.ts +4 -5
  69. package/lib/layout/index.d.ts +1 -1
  70. package/lib/layout/layout.d.ts +3 -3
  71. package/lib/note/index.d.ts +2 -0
  72. package/lib/note/note.d.ts +10 -0
  73. package/lib/note/note.template.d.ts +5 -0
  74. package/lib/popup/index.d.ts +4 -0
  75. package/lib/popup/popup.d.ts +17 -0
  76. package/lib/popup/popup.template.d.ts +4 -0
  77. package/lib/progress/index.d.ts +2 -0
  78. package/lib/progress/progress.d.ts +9 -0
  79. package/lib/progress/progress.template.d.ts +5 -0
  80. package/lib/progress-ring/index.d.ts +2 -0
  81. package/lib/progress-ring/progress-ring.d.ts +7 -0
  82. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  83. package/lib/side-drawer/index.d.ts +2 -0
  84. package/lib/side-drawer/side-drawer.d.ts +7 -0
  85. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  86. package/lib/sidenav/index.d.ts +2 -0
  87. package/lib/sidenav/sidenav.d.ts +3 -0
  88. package/lib/sidenav/sidenav.template.d.ts +4 -0
  89. package/lib/sidenav-item/index.d.ts +1 -0
  90. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  91. package/lib/text/index.d.ts +2 -0
  92. package/lib/text/text.d.ts +10 -0
  93. package/lib/text/text.template.d.ts +4 -0
  94. package/lib/text-anchor/text-anchor.d.ts +4 -1
  95. package/lib/text-field/index.d.ts +4 -0
  96. package/lib/text-field/text-field.d.ts +23 -0
  97. package/lib/text-field/text-field.template.d.ts +5 -0
  98. package/lib/tooltip/index.d.ts +3 -0
  99. package/lib/tooltip/tooltip.d.ts +8 -0
  100. package/lib/tooltip/tooltip.template.d.ts +4 -0
  101. package/note/index.js +68 -0
  102. package/package.json +36 -6
  103. package/popup/index.js +2110 -0
  104. package/progress/index.js +107 -0
  105. package/progress-ring/index.js +82 -0
  106. package/shared/_has.js +58 -0
  107. package/shared/affix.js +10 -25
  108. package/shared/anchor.js +10 -3
  109. package/shared/aria-global.js +20 -20
  110. package/shared/base-progress.js +70 -0
  111. package/shared/breadcrumb-item.js +2 -2
  112. package/shared/button.js +195 -0
  113. package/shared/calendar-event.js +26 -0
  114. package/shared/enums.js +79 -0
  115. package/shared/es.object.assign.js +69 -0
  116. package/shared/export.js +972 -0
  117. package/shared/focus.js +5 -0
  118. package/shared/focus2.js +11 -0
  119. package/shared/form-associated.js +547 -0
  120. package/shared/icon.js +1389 -0
  121. package/shared/index.js +4940 -1426
  122. package/shared/index2.js +27 -4901
  123. package/shared/iterators.js +61 -0
  124. package/shared/object-keys.js +13 -0
  125. package/shared/patterns/affix.d.ts +3 -4
  126. package/shared/patterns/focus.d.ts +3 -0
  127. package/shared/patterns/index.d.ts +1 -0
  128. package/shared/slotted.js +119 -0
  129. package/shared/text-anchor.js +12 -0
  130. package/shared/text-anchor.template.js +16 -6
  131. package/shared/to-string.js +51 -0
  132. package/shared/web.dom-collections.iterator.js +46 -1059
  133. package/shared/when.js +15 -0
  134. package/side-drawer/index.js +82 -0
  135. package/sidenav/index.js +17 -0
  136. package/sidenav-item/index.js +24 -61
  137. package/styles/themes/dark.css +16 -4
  138. package/styles/themes/light.css +16 -4
  139. package/text/index.js +48 -0
  140. package/text-anchor/index.js +13 -13
  141. package/text-field/index.js +411 -0
  142. package/tooltip/index.js +70 -0
  143. package/shared/index3.js +0 -21
package/button/index.js CHANGED
@@ -1,656 +1,28 @@
1
- import '../shared/index.js';
2
- import { F as Focus } from '../shared/index3.js';
3
- import { e as emptyArray, D as DOM, a as attr, o as observable, F as FoundationElement, _ as __decorate, b as __metadata, h as html, d as designSystem } from '../shared/index2.js';
1
+ import '../icon/index.js';
2
+ import '../focus/index.js';
3
+ import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
4
4
  import '../shared/web.dom-collections.iterator.js';
5
- import { P as PrefixOrSuffix, p as prefixOrSuffixTemplate } from '../shared/affix.js';
5
+ import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
6
+ import { B as Button$1 } from '../shared/button.js';
6
7
  import { a as applyMixins } from '../shared/apply-mixins.js';
7
- import { A as ARIAGlobalStatesAndProperties, S as StartEnd, r as ref } from '../shared/aria-global.js';
8
8
  import { s as styleInject } from '../shared/style-inject.es.js';
9
+ import { f as focusTemplateFactory } from '../shared/focus2.js';
10
+ import { r as ref } from '../shared/aria-global.js';
9
11
  import { c as classNames } from '../shared/class-names.js';
10
-
11
- /**
12
- * Key Code values
13
- * @deprecated - KeyCodes are deprecated, use individual string key exports
14
- */
15
- var KeyCodes;
16
- (function (KeyCodes) {
17
- KeyCodes[KeyCodes["alt"] = 18] = "alt";
18
- KeyCodes[KeyCodes["arrowDown"] = 40] = "arrowDown";
19
- KeyCodes[KeyCodes["arrowLeft"] = 37] = "arrowLeft";
20
- KeyCodes[KeyCodes["arrowRight"] = 39] = "arrowRight";
21
- KeyCodes[KeyCodes["arrowUp"] = 38] = "arrowUp";
22
- KeyCodes[KeyCodes["back"] = 8] = "back";
23
- KeyCodes[KeyCodes["backSlash"] = 220] = "backSlash";
24
- KeyCodes[KeyCodes["break"] = 19] = "break";
25
- KeyCodes[KeyCodes["capsLock"] = 20] = "capsLock";
26
- KeyCodes[KeyCodes["closeBracket"] = 221] = "closeBracket";
27
- KeyCodes[KeyCodes["colon"] = 186] = "colon";
28
- KeyCodes[KeyCodes["colon2"] = 59] = "colon2";
29
- KeyCodes[KeyCodes["comma"] = 188] = "comma";
30
- KeyCodes[KeyCodes["ctrl"] = 17] = "ctrl";
31
- KeyCodes[KeyCodes["delete"] = 46] = "delete";
32
- KeyCodes[KeyCodes["end"] = 35] = "end";
33
- KeyCodes[KeyCodes["enter"] = 13] = "enter";
34
- KeyCodes[KeyCodes["equals"] = 187] = "equals";
35
- KeyCodes[KeyCodes["equals2"] = 61] = "equals2";
36
- KeyCodes[KeyCodes["equals3"] = 107] = "equals3";
37
- KeyCodes[KeyCodes["escape"] = 27] = "escape";
38
- KeyCodes[KeyCodes["forwardSlash"] = 191] = "forwardSlash";
39
- KeyCodes[KeyCodes["function1"] = 112] = "function1";
40
- KeyCodes[KeyCodes["function10"] = 121] = "function10";
41
- KeyCodes[KeyCodes["function11"] = 122] = "function11";
42
- KeyCodes[KeyCodes["function12"] = 123] = "function12";
43
- KeyCodes[KeyCodes["function2"] = 113] = "function2";
44
- KeyCodes[KeyCodes["function3"] = 114] = "function3";
45
- KeyCodes[KeyCodes["function4"] = 115] = "function4";
46
- KeyCodes[KeyCodes["function5"] = 116] = "function5";
47
- KeyCodes[KeyCodes["function6"] = 117] = "function6";
48
- KeyCodes[KeyCodes["function7"] = 118] = "function7";
49
- KeyCodes[KeyCodes["function8"] = 119] = "function8";
50
- KeyCodes[KeyCodes["function9"] = 120] = "function9";
51
- KeyCodes[KeyCodes["home"] = 36] = "home";
52
- KeyCodes[KeyCodes["insert"] = 45] = "insert";
53
- KeyCodes[KeyCodes["menu"] = 93] = "menu";
54
- KeyCodes[KeyCodes["minus"] = 189] = "minus";
55
- KeyCodes[KeyCodes["minus2"] = 109] = "minus2";
56
- KeyCodes[KeyCodes["numLock"] = 144] = "numLock";
57
- KeyCodes[KeyCodes["numPad0"] = 96] = "numPad0";
58
- KeyCodes[KeyCodes["numPad1"] = 97] = "numPad1";
59
- KeyCodes[KeyCodes["numPad2"] = 98] = "numPad2";
60
- KeyCodes[KeyCodes["numPad3"] = 99] = "numPad3";
61
- KeyCodes[KeyCodes["numPad4"] = 100] = "numPad4";
62
- KeyCodes[KeyCodes["numPad5"] = 101] = "numPad5";
63
- KeyCodes[KeyCodes["numPad6"] = 102] = "numPad6";
64
- KeyCodes[KeyCodes["numPad7"] = 103] = "numPad7";
65
- KeyCodes[KeyCodes["numPad8"] = 104] = "numPad8";
66
- KeyCodes[KeyCodes["numPad9"] = 105] = "numPad9";
67
- KeyCodes[KeyCodes["numPadDivide"] = 111] = "numPadDivide";
68
- KeyCodes[KeyCodes["numPadDot"] = 110] = "numPadDot";
69
- KeyCodes[KeyCodes["numPadMinus"] = 109] = "numPadMinus";
70
- KeyCodes[KeyCodes["numPadMultiply"] = 106] = "numPadMultiply";
71
- KeyCodes[KeyCodes["numPadPlus"] = 107] = "numPadPlus";
72
- KeyCodes[KeyCodes["openBracket"] = 219] = "openBracket";
73
- KeyCodes[KeyCodes["pageDown"] = 34] = "pageDown";
74
- KeyCodes[KeyCodes["pageUp"] = 33] = "pageUp";
75
- KeyCodes[KeyCodes["period"] = 190] = "period";
76
- KeyCodes[KeyCodes["print"] = 44] = "print";
77
- KeyCodes[KeyCodes["quote"] = 222] = "quote";
78
- KeyCodes[KeyCodes["scrollLock"] = 145] = "scrollLock";
79
- KeyCodes[KeyCodes["shift"] = 16] = "shift";
80
- KeyCodes[KeyCodes["space"] = 32] = "space";
81
- KeyCodes[KeyCodes["tab"] = 9] = "tab";
82
- KeyCodes[KeyCodes["tilde"] = 192] = "tilde";
83
- KeyCodes[KeyCodes["windowsLeft"] = 91] = "windowsLeft";
84
- KeyCodes[KeyCodes["windowsOpera"] = 219] = "windowsOpera";
85
- KeyCodes[KeyCodes["windowsRight"] = 92] = "windowsRight";
86
- })(KeyCodes || (KeyCodes = {}));
87
- const keyEnter = "Enter";
88
-
89
- const proxySlotName = "form-associated-proxy";
90
- const ElementInternalsKey = "ElementInternals";
91
- /**
92
- * @alpha
93
- */
94
- const supportsElementInternals = ElementInternalsKey in window &&
95
- "setFormValue" in window[ElementInternalsKey].prototype;
96
- const InternalsMap = new Map();
97
- /**
98
- * Base function for providing Custom Element Form Association.
99
- *
100
- * @alpha
101
- */
102
- function FormAssociated(BaseCtor) {
103
- const C = class extends BaseCtor {
104
- constructor(...args) {
105
- super(...args);
106
- /**
107
- * Track whether the value has been changed from the initial value
108
- */
109
- this.dirtyValue = false;
110
- /**
111
- * Sets the element's disabled state. A disabled element will not be included during form submission.
112
- *
113
- * @remarks
114
- * HTML Attribute: disabled
115
- */
116
- this.disabled = false;
117
- /**
118
- * These are events that are still fired by the proxy
119
- * element based on user / programmatic interaction.
120
- *
121
- * The proxy implementation should be transparent to
122
- * the app author, so block these events from emitting.
123
- */
124
- this.proxyEventsToBlock = ["change", "click"];
125
- this.proxyInitialized = false;
126
- this.required = false;
127
- this.initialValue = this.initialValue || "";
128
- if (!this.elementInternals) {
129
- // When elementInternals is not supported, formResetCallback is
130
- // bound to an event listener, so ensure the handler's `this`
131
- // context is correct.
132
- this.formResetCallback = this.formResetCallback.bind(this);
133
- }
134
- }
135
- /**
136
- * Must evaluate to true to enable elementInternals.
137
- * Feature detects API support and resolve respectively
138
- *
139
- * @internal
140
- */
141
- static get formAssociated() {
142
- return supportsElementInternals;
143
- }
144
- /**
145
- * Returns the validity state of the element
146
- *
147
- * @alpha
148
- */
149
- get validity() {
150
- return this.elementInternals
151
- ? this.elementInternals.validity
152
- : this.proxy.validity;
153
- }
154
- /**
155
- * Retrieve a reference to the associated form.
156
- * Returns null if not associated to any form.
157
- *
158
- * @alpha
159
- */
160
- get form() {
161
- return this.elementInternals ? this.elementInternals.form : this.proxy.form;
162
- }
163
- /**
164
- * Retrieve the localized validation message,
165
- * or custom validation message if set.
166
- *
167
- * @alpha
168
- */
169
- get validationMessage() {
170
- return this.elementInternals
171
- ? this.elementInternals.validationMessage
172
- : this.proxy.validationMessage;
173
- }
174
- /**
175
- * Whether the element will be validated when the
176
- * form is submitted
177
- */
178
- get willValidate() {
179
- return this.elementInternals
180
- ? this.elementInternals.willValidate
181
- : this.proxy.willValidate;
182
- }
183
- /**
184
- * A reference to all associated label elements
185
- */
186
- get labels() {
187
- if (this.elementInternals) {
188
- return Object.freeze(Array.from(this.elementInternals.labels));
189
- }
190
- else if (this.proxy instanceof HTMLElement &&
191
- this.proxy.ownerDocument &&
192
- this.id) {
193
- // Labels associated by wrapping the element: <label><custom-element></custom-element></label>
194
- const parentLabels = this.proxy.labels;
195
- // Labels associated using the `for` attribute
196
- const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`));
197
- const labels = parentLabels
198
- ? forLabels.concat(Array.from(parentLabels))
199
- : forLabels;
200
- return Object.freeze(labels);
201
- }
202
- else {
203
- return emptyArray;
204
- }
205
- }
206
- /**
207
- * Invoked when the `value` property changes
208
- * @param previous - the previous value
209
- * @param next - the new value
210
- *
211
- * @remarks
212
- * If elements extending `FormAssociated` implement a `valueChanged` method
213
- * They must be sure to invoke `super.valueChanged(previous, next)` to ensure
214
- * proper functioning of `FormAssociated`
215
- */
216
- valueChanged(previous, next) {
217
- this.dirtyValue = true;
218
- if (this.proxy instanceof HTMLElement) {
219
- this.proxy.value = this.value;
220
- }
221
- this.currentValue = this.value;
222
- this.setFormValue(this.value);
223
- this.validate();
224
- }
225
- currentValueChanged() {
226
- this.value = this.currentValue;
227
- }
228
- /**
229
- * Invoked when the `initialValue` property changes
230
- *
231
- * @param previous - the previous value
232
- * @param next - the new value
233
- *
234
- * @remarks
235
- * If elements extending `FormAssociated` implement a `initialValueChanged` method
236
- * They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure
237
- * proper functioning of `FormAssociated`
238
- */
239
- initialValueChanged(previous, next) {
240
- // If the value is clean and the component is connected to the DOM
241
- // then set value equal to the attribute value.
242
- if (!this.dirtyValue) {
243
- this.value = this.initialValue;
244
- this.dirtyValue = false;
245
- }
246
- }
247
- /**
248
- * Invoked when the `disabled` property changes
249
- *
250
- * @param previous - the previous value
251
- * @param next - the new value
252
- *
253
- * @remarks
254
- * If elements extending `FormAssociated` implement a `disabledChanged` method
255
- * They must be sure to invoke `super.disabledChanged(previous, next)` to ensure
256
- * proper functioning of `FormAssociated`
257
- */
258
- disabledChanged(previous, next) {
259
- if (this.proxy instanceof HTMLElement) {
260
- this.proxy.disabled = this.disabled;
261
- }
262
- DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled));
263
- }
264
- /**
265
- * Invoked when the `name` property changes
266
- *
267
- * @param previous - the previous value
268
- * @param next - the new value
269
- *
270
- * @remarks
271
- * If elements extending `FormAssociated` implement a `nameChanged` method
272
- * They must be sure to invoke `super.nameChanged(previous, next)` to ensure
273
- * proper functioning of `FormAssociated`
274
- */
275
- nameChanged(previous, next) {
276
- if (this.proxy instanceof HTMLElement) {
277
- this.proxy.name = this.name;
278
- }
279
- }
280
- /**
281
- * Invoked when the `required` property changes
282
- *
283
- * @param previous - the previous value
284
- * @param next - the new value
285
- *
286
- * @remarks
287
- * If elements extending `FormAssociated` implement a `requiredChanged` method
288
- * They must be sure to invoke `super.requiredChanged(previous, next)` to ensure
289
- * proper functioning of `FormAssociated`
290
- */
291
- requiredChanged(prev, next) {
292
- if (this.proxy instanceof HTMLElement) {
293
- this.proxy.required = this.required;
294
- }
295
- DOM.queueUpdate(() => this.classList.toggle("required", this.required));
296
- this.validate();
297
- }
298
- /**
299
- * The element internals object. Will only exist
300
- * in browsers supporting the attachInternals API
301
- */
302
- get elementInternals() {
303
- if (!supportsElementInternals) {
304
- return null;
305
- }
306
- let internals = InternalsMap.get(this);
307
- if (!internals) {
308
- internals = this.attachInternals();
309
- InternalsMap.set(this, internals);
310
- }
311
- return internals;
312
- }
313
- /**
314
- * @internal
315
- */
316
- connectedCallback() {
317
- super.connectedCallback();
318
- this.addEventListener("keypress", this._keypressHandler);
319
- if (!this.value) {
320
- this.value = this.initialValue;
321
- this.dirtyValue = false;
322
- }
323
- if (!this.elementInternals) {
324
- this.attachProxy();
325
- if (this.form) {
326
- this.form.addEventListener("reset", this.formResetCallback);
327
- }
328
- }
329
- }
330
- /**
331
- * @internal
332
- */
333
- disconnectedCallback() {
334
- this.proxyEventsToBlock.forEach(name => this.proxy.removeEventListener(name, this.stopPropagation));
335
- if (!this.elementInternals && this.form) {
336
- this.form.removeEventListener("reset", this.formResetCallback);
337
- }
338
- }
339
- /**
340
- * Return the current validity of the element.
341
- */
342
- checkValidity() {
343
- return this.elementInternals
344
- ? this.elementInternals.checkValidity()
345
- : this.proxy.checkValidity();
346
- }
347
- /**
348
- * Return the current validity of the element.
349
- * If false, fires an invalid event at the element.
350
- */
351
- reportValidity() {
352
- return this.elementInternals
353
- ? this.elementInternals.reportValidity()
354
- : this.proxy.reportValidity();
355
- }
356
- /**
357
- * Set the validity of the control. In cases when the elementInternals object is not
358
- * available (and the proxy element is used to report validity), this function will
359
- * do nothing unless a message is provided, at which point the setCustomValidity method
360
- * of the proxy element will be invoked with the provided message.
361
- * @param flags - Validity flags
362
- * @param message - Optional message to supply
363
- * @param anchor - Optional element used by UA to display an interactive validation UI
364
- */
365
- setValidity(flags, message, anchor) {
366
- if (this.elementInternals) {
367
- this.elementInternals.setValidity(flags, message, anchor);
368
- }
369
- else if (typeof message === "string") {
370
- this.proxy.setCustomValidity(message);
371
- }
372
- }
373
- /**
374
- * Invoked when a connected component's form or fieldset has its disabled
375
- * state changed.
376
- * @param disabled - the disabled value of the form / fieldset
377
- */
378
- formDisabledCallback(disabled) {
379
- this.disabled = disabled;
380
- }
381
- formResetCallback() {
382
- this.value = this.initialValue;
383
- this.dirtyValue = false;
384
- }
385
- /**
386
- * Attach the proxy element to the DOM
387
- */
388
- attachProxy() {
389
- var _a;
390
- if (!this.proxyInitialized) {
391
- this.proxyInitialized = true;
392
- this.proxy.style.display = "none";
393
- this.proxyEventsToBlock.forEach(name => this.proxy.addEventListener(name, this.stopPropagation));
394
- // These are typically mapped to the proxy during
395
- // property change callbacks, but during initialization
396
- // on the initial call of the callback, the proxy is
397
- // still undefined. We should find a better way to address this.
398
- this.proxy.disabled = this.disabled;
399
- this.proxy.required = this.required;
400
- if (typeof this.name === "string") {
401
- this.proxy.name = this.name;
402
- }
403
- if (typeof this.value === "string") {
404
- this.proxy.value = this.value;
405
- }
406
- this.proxy.setAttribute("slot", proxySlotName);
407
- this.proxySlot = document.createElement("slot");
408
- this.proxySlot.setAttribute("name", proxySlotName);
409
- }
410
- (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot);
411
- this.appendChild(this.proxy);
412
- }
413
- /**
414
- * Detach the proxy element from the DOM
415
- */
416
- detachProxy() {
417
- var _a;
418
- this.removeChild(this.proxy);
419
- (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot);
420
- }
421
- /**
422
- * Sets the validity of the custom element. By default this uses the proxy element to determine
423
- * validity, but this can be extended or replaced in implementation.
424
- */
425
- validate() {
426
- if (this.proxy instanceof HTMLElement) {
427
- this.setValidity(this.proxy.validity, this.proxy.validationMessage);
428
- }
429
- }
430
- /**
431
- * Associates the provided value (and optional state) with the parent form.
432
- * @param value - The value to set
433
- * @param state - The state object provided to during session restores and when autofilling.
434
- */
435
- setFormValue(value, state) {
436
- if (this.elementInternals) {
437
- this.elementInternals.setFormValue(value, state || value);
438
- }
439
- }
440
- _keypressHandler(e) {
441
- switch (e.key) {
442
- case keyEnter:
443
- if (this.form instanceof HTMLFormElement) {
444
- // Implicit submission
445
- const defaultButton = this.form.querySelector("[type=submit]");
446
- defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click();
447
- }
448
- break;
449
- }
450
- }
451
- /**
452
- * Used to stop propagation of proxy element events
453
- * @param e - Event object
454
- */
455
- stopPropagation(e) {
456
- e.stopPropagation();
457
- }
458
- };
459
- attr({ mode: "boolean" })(C.prototype, "disabled");
460
- attr({ mode: "fromView", attribute: "value" })(C.prototype, "initialValue");
461
- attr({ attribute: "current-value" })(C.prototype, "currentValue");
462
- attr(C.prototype, "name");
463
- attr({ mode: "boolean" })(C.prototype, "required");
464
- observable(C.prototype, "value");
465
- return C;
466
- }
467
-
468
- class _Button extends FoundationElement {
469
- }
470
- /**
471
- * A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component.
472
- *
473
- * @internal
474
- */
475
- class FormAssociatedButton extends FormAssociated(_Button) {
476
- constructor() {
477
- super(...arguments);
478
- this.proxy = document.createElement("input");
479
- }
480
- }
481
-
482
- /**
483
- * A Button Custom HTML Element.
484
- * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
485
- *
486
- * @public
487
- */
488
- class Button$1 extends FormAssociatedButton {
489
- constructor() {
490
- super(...arguments);
491
- /**
492
- * Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements
493
- * @internal
494
- */
495
- this.handleClick = (e) => {
496
- var _a;
497
- if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {
498
- e.stopPropagation();
499
- }
500
- };
501
- /**
502
- * Submits the parent form
503
- */
504
- this.handleSubmission = () => {
505
- if (!this.form) {
506
- return;
507
- }
508
- const attached = this.proxy.isConnected;
509
- if (!attached) {
510
- this.attachProxy();
511
- }
512
- // Browser support for requestSubmit is not comprehensive
513
- // so click the proxy if it isn't supported
514
- typeof this.form.requestSubmit === "function"
515
- ? this.form.requestSubmit(this.proxy)
516
- : this.proxy.click();
517
- if (!attached) {
518
- this.detachProxy();
519
- }
520
- };
521
- /**
522
- * Resets the parent form
523
- */
524
- this.handleFormReset = () => {
525
- var _a;
526
- (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
527
- };
528
- /**
529
- * Overrides the focus call for where delegatesFocus is unsupported.
530
- * This check works for Chrome, Edge Chromium, FireFox, and Safari
531
- * Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
532
- */
533
- this.handleUnsupportedDelegatesFocus = () => {
534
- var _a;
535
- // Check to see if delegatesFocus is supported
536
- if (window.ShadowRoot &&
537
- !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
538
- this.focus = () => {
539
- this.control.focus();
540
- };
541
- }
542
- };
543
- }
544
- formactionChanged() {
545
- if (this.proxy instanceof HTMLInputElement) {
546
- this.proxy.formAction = this.formaction;
547
- }
548
- }
549
- formenctypeChanged() {
550
- if (this.proxy instanceof HTMLInputElement) {
551
- this.proxy.formEnctype = this.formenctype;
552
- }
553
- }
554
- formmethodChanged() {
555
- if (this.proxy instanceof HTMLInputElement) {
556
- this.proxy.formMethod = this.formmethod;
557
- }
558
- }
559
- formnovalidateChanged() {
560
- if (this.proxy instanceof HTMLInputElement) {
561
- this.proxy.formNoValidate = this.formnovalidate;
562
- }
563
- }
564
- formtargetChanged() {
565
- if (this.proxy instanceof HTMLInputElement) {
566
- this.proxy.formTarget = this.formtarget;
567
- }
568
- }
569
- typeChanged(previous, next) {
570
- if (this.proxy instanceof HTMLInputElement) {
571
- this.proxy.type = this.type;
572
- }
573
- next === "submit" && this.addEventListener("click", this.handleSubmission);
574
- previous === "submit" && this.removeEventListener("click", this.handleSubmission);
575
- next === "reset" && this.addEventListener("click", this.handleFormReset);
576
- previous === "reset" && this.removeEventListener("click", this.handleFormReset);
577
- }
578
- /**
579
- * @internal
580
- */
581
- connectedCallback() {
582
- var _a;
583
- super.connectedCallback();
584
- this.proxy.setAttribute("type", this.type);
585
- this.handleUnsupportedDelegatesFocus();
586
- const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
587
- if (elements) {
588
- elements.forEach((span) => {
589
- span.addEventListener("click", this.handleClick);
590
- });
591
- }
592
- }
593
- /**
594
- * @internal
595
- */
596
- disconnectedCallback() {
597
- var _a;
598
- super.disconnectedCallback();
599
- const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
600
- if (elements) {
601
- elements.forEach((span) => {
602
- span.removeEventListener("click", this.handleClick);
603
- });
604
- }
605
- }
606
- }
607
- __decorate([
608
- attr({ mode: "boolean" })
609
- ], Button$1.prototype, "autofocus", void 0);
610
- __decorate([
611
- attr({ attribute: "form" })
612
- ], Button$1.prototype, "formId", void 0);
613
- __decorate([
614
- attr
615
- ], Button$1.prototype, "formaction", void 0);
616
- __decorate([
617
- attr
618
- ], Button$1.prototype, "formenctype", void 0);
619
- __decorate([
620
- attr
621
- ], Button$1.prototype, "formmethod", void 0);
622
- __decorate([
623
- attr({ mode: "boolean" })
624
- ], Button$1.prototype, "formnovalidate", void 0);
625
- __decorate([
626
- attr
627
- ], Button$1.prototype, "formtarget", void 0);
628
- __decorate([
629
- attr
630
- ], Button$1.prototype, "type", void 0);
631
- __decorate([
632
- observable
633
- ], Button$1.prototype, "defaultSlottedContent", void 0);
634
- /**
635
- * Includes ARIA states and properties relating to the ARIA button role
636
- *
637
- * @public
638
- */
639
- class DelegatesARIAButton {
640
- }
641
- __decorate([
642
- attr({ attribute: "aria-expanded", mode: "fromView" })
643
- ], DelegatesARIAButton.prototype, "ariaExpanded", void 0);
644
- __decorate([
645
- attr({ attribute: "aria-pressed", mode: "fromView" })
646
- ], DelegatesARIAButton.prototype, "ariaPressed", void 0);
647
- applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);
648
- applyMixins(Button$1, StartEnd, DelegatesARIAButton);
12
+ import '../shared/icon.js';
13
+ import '../shared/export.js';
14
+ import '../shared/iterators.js';
15
+ import '../shared/to-string.js';
16
+ import '../shared/_has.js';
17
+ import '../shared/when.js';
18
+ import '../shared/focus.js';
19
+ import '../shared/object-keys.js';
20
+ import '../shared/form-associated.js';
649
21
 
650
22
  class Button extends Button$1 {
651
23
  constructor() {
652
24
  super(...arguments);
653
- this.label = '';
25
+ this.stacked = false;
654
26
  }
655
27
 
656
28
  }
@@ -661,22 +33,26 @@ __decorate([attr, __metadata("design:type", String)], Button.prototype, "shape",
661
33
 
662
34
  __decorate([attr, __metadata("design:type", String)], Button.prototype, "appearance", void 0);
663
35
 
664
- __decorate([attr, __metadata("design:type", String)], Button.prototype, "size", void 0);
36
+ __decorate([attr, __metadata("design:type", String)], Button.prototype, "density", void 0);
665
37
 
666
- __decorate([attr, __metadata("design:type", Object)], Button.prototype, "label", void 0);
38
+ __decorate([attr({
39
+ mode: 'boolean',
40
+ attribute: 'stacked'
41
+ }), __metadata("design:type", Object)], Button.prototype, "stacked", void 0);
667
42
 
668
- applyMixins(Button, PrefixOrSuffix);
43
+ __decorate([attr, __metadata("design:type", String)], Button.prototype, "label", void 0);
669
44
 
670
- var css_248z = "/*\n Do not edit directly\n Generated on Sun, 23 Jan 2022 11:15:05 GMT\n*/\n.control.appearance-filled {\n --appearance-color-fill: var(--connotation);\n --appearance-color-text: var(--on-connotation);\n}\n\n.control.appearance-outlined {\n --appearance-color-fill: transparent;\n --appearance-color-outline: var(--connotation-diverse);\n --appearance-color-text: var(--connotation-diverse);\n}\n\n.control.appearance-ghost,\n.control:not(.appearance-filled):not(.appearance-filled-idle):not(.appearance-outlined):not(.appearance-outlined-idle):not(.appearance-ghost-idle) {\n --appearance-color-fill: transparent;\n --appearance-color-text: var(--connotation-diverse);\n}\n\n.control.appearance-filled-idle {\n --appearance-color-fill: var(--vvd-color-neutral-10);\n --appearance-color-text: var(--vvd-color-neutral-30);\n}\n\n.control.appearance-outlined-idle {\n --appearance-color-fill: transparent;\n --appearance-color-outline: var(--vvd-color-neutral-30);\n --appearance-color-text: var(--vvd-color-neutral-30);\n}\n\n.control.appearance-ghost-idle {\n --appearance-color-fill: transparent;\n --appearance-color-text: var(--vvd-color-neutral-30);\n}\n\n:host {\n outline: 0 none;\n}\n\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n background-color: var(--appearance-color-fill);\n block-size: var(--button-block-size);\n box-shadow: inset 0 0 0 1px var(--appearance-color-outline);\n color: var(--appearance-color-text);\n outline: 0 none;\n vertical-align: middle;\n}\n.control:not(.connotation-cta):not(.connotation-success):not(.connotation-alert) {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n --connotation-diverse: var(--vvd-color-primary);\n}\n\n.control.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n --connotation-diverse: var(--vvd-color-cta-70);\n}\n\n.control.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n --connotation-diverse: var(--vvd-color-success-70);\n}\n\n.control.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n --connotation-diverse: var(--vvd-color-alert-70);\n}\n\n.control.icon-only {\n padding-inline: 0;\n place-content: center;\n}\n@supports (aspect-ratio: 1) {\n .control.icon-only {\n aspect-ratio: 1;\n }\n}\n@supports not (aspect-ratio: 1) {\n .control.icon-only {\n inline-size: var(--button-block-size);\n }\n}\n\n/* Size */\n.control.size-base-small {\n --button-block-size: 32px;\n font: 600 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control.size-base-small:not(.icon-only) {\n --button-icon-gap: 8px;\n padding-inline: 12px;\n}\n.control.size-base-small .icon {\n font-size: 16px;\n}\n\n.control.size-base-large {\n --button-block-size: 48px;\n font: 600 ultra-condensed 16px / 24px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control.size-base-large:not(.icon-only) {\n --button-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control.size-base-large .icon {\n font-size: 24px;\n}\n\n.control:not(.size-base-small):not(.size-base-large) {\n --button-block-size: 40px;\n font: 600 ultra-condensed 14px / 100% SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control:not(.size-base-small):not(.size-base-large):not(.icon-only) {\n --button-icon-gap: 8px;\n padding-inline: 16px;\n}\n.control:not(.size-base-small):not(.size-base-large) .icon {\n font-size: 20px;\n}\n\n/* Shape */\n.control:not(.shape-pill) {\n border-radius: 6px;\n}\n\n.control.shape-pill:not(.icon-only) {\n border-radius: 24px;\n}\n.control.shape-pill.icon-only {\n border-radius: 50%;\n}\n\n/* Icon */\n.icon:not(.icon-trailing) {\n margin-inline-end: var(--button-icon-gap);\n}\n.icon.icon-trailing {\n order: 1;\n margin-inline-start: var(--button-icon-gap);\n}\n\n:not(:focus) .focus-indicator {\n display: none;\n}\n.appearance-outlined .focus-indicator, .appearance-ghost .focus-indicator {\n --focus-stroke-gap-color: transparent;\n}";
45
+ applyMixins(Button, AffixIconWithTrailing);
46
+
47
+ var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n margin: 0;\n background-color: var(--_appearance-color-fill);\n block-size: var(--_button-block-size);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n gap: var(--_button-icon-gap);\n vertical-align: middle;\n white-space: nowrap;\n /* Size */\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta);\n --_connotation-color-on-primary: var(--vvd-color-on-cta);\n --_connotation-color-primary-increment: var(--vvd-color-cta-70);\n --_connotation-color-contrast: var(--vvd-color-cta-90);\n --_connotation-color-fierce: var(--vvd-color-cta-80);\n --_connotation-color-firm: var(--vvd-color-cta-70);\n --_connotation-color-soft: var(--vvd-color-cta-20);\n --_connotation-color-faint: var(--vvd-color-cta-10);\n}\n.control.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success);\n --_connotation-color-on-primary: var(--vvd-color-on-success);\n --_connotation-color-primary-increment: var(--vvd-color-success-70);\n --_connotation-color-contrast: var(--vvd-color-success-90);\n --_connotation-color-fierce: var(--vvd-color-success-80);\n --_connotation-color-firm: var(--vvd-color-success-70);\n --_connotation-color-soft: var(--vvd-color-success-20);\n --_connotation-color-faint: var(--vvd-color-success-10);\n}\n.control.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert);\n --_connotation-color-on-primary: var(--vvd-color-on-alert);\n --_connotation-color-primary-increment: var(--vvd-color-alert-70);\n --_connotation-color-contrast: var(--vvd-color-alert-90);\n --_connotation-color-fierce: var(--vvd-color-alert-80);\n --_connotation-color-firm: var(--vvd-color-alert-70);\n --_connotation-color-soft: var(--vvd-color-alert-20);\n --_connotation-color-faint: var(--vvd-color-alert-10);\n}\n.control:not(.connotation-cta, .connotation-success, .connotation-alert) {\n --_connotation-color-primary: var(--vvd-color-on-canvas);\n --_connotation-color-on-primary: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-90);\n --_connotation-color-contrast: var(--vvd-color-neutral-90);\n --_connotation-color-fierce: var(--vvd-color-neutral-80);\n --_connotation-color-firm: var(--vvd-color-on-canvas);\n --_connotation-color-soft: var(--vvd-color-neutral-20);\n --_connotation-color-faint: var(--vvd-color-neutral-10);\n}\n.control.appearance-filled {\n --_appearance-color-text: var(--_connotation-color-on-primary);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transaprent;\n}\n.control.appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)).appearance-filled {\n --_appearance-color-text: var(--_connotation-color-on-primary);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transaprent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)).appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transaprent;\n}\n.control:where(:disabled, .disabled).appearance-filled {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: var(--vvd-color-neutral-30);\n --_appearance-color-outline: transaprent;\n}\n.control:where(:disabled, .disabled).appearance-outlined {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--vvd-color-neutral-50);\n}\n.control:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)).appearance-filled {\n --_appearance-color-text: var(--_connotation-color-on-primary);\n --_appearance-color-fill: var(--_connotation-color-fierce);\n --_appearance-color-outline: transaprent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)).appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transaprent;\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n.control:not(:disabled) {\n cursor: pointer;\n}\n.control:disabled {\n cursor: not-allowed;\n}\n.control.icon-only {\n contain: size;\n padding-inline: 0;\n place-content: center;\n}\n@supports (aspect-ratio: 1) {\n .control.icon-only {\n aspect-ratio: 1;\n }\n}\n@supports not (aspect-ratio: 1) {\n .control.icon-only {\n inline-size: var(--_button-block-size);\n }\n}\n.control:not(.stacked).density-condensed {\n --_button-block-size: 32px;\n font: 600 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control:not(.stacked).density-condensed:not(.icon-only) {\n --_button-icon-gap: 8px;\n padding-inline: 12px;\n}\n.control:not(.stacked).density-condensed .icon {\n font-size: 16px;\n}\n.control:not(.stacked).density-extended {\n --_button-block-size: 48px;\n font: 600 ultra-condensed 16px / 24px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control:not(.stacked).density-extended:not(.icon-only) {\n --_button-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control:not(.stacked).density-extended .icon {\n font-size: 24px;\n}\n.control:not(.stacked):not(.density-condensed, .density-extended) {\n --_button-block-size: 40px;\n font: 600 ultra-condensed 14px / 100% SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control:not(.stacked):not(.density-condensed, .density-extended):not(.icon-only) {\n --_button-icon-gap: 8px;\n padding-inline: 16px;\n}\n.control:not(.stacked):not(.density-condensed, .density-extended) .icon {\n font-size: 20px;\n}\n.control.stacked {\n flex-direction: column;\n justify-content: center;\n --_button-block-size: 68px;\n font: 600 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control.stacked:not(.icon-only) {\n --_button-icon-gap: 10px;\n padding-inline: 16px;\n}\n.control.stacked .icon {\n font-size: 20px;\n}\n\n/* Shape */\n.control:not(.shape-pill:not(.stacked)) {\n border-radius: 6px;\n}\n\n.control.shape-pill:not(.stacked):not(.icon-only) {\n border-radius: 24px;\n}\n.control.shape-pill:not(.stacked).icon-only {\n border-radius: 50%;\n}\n\n/* Icon */\n.icon-trailing .icon {\n order: 1;\n}\n\n:not(:focus-visible) > .focus-indicator {\n display: none;\n}\n.appearance-outlined .focus-indicator, .appearance-ghost .focus-indicator {\n --focus-stroke-gap-color: transparent;\n}";
671
48
  styleInject(css_248z);
672
49
 
673
50
  let _ = t => t,
674
- _t,
675
- _t2;
51
+ _t;
676
52
 
677
53
  const getAppearanceClassName = (appearance, disabled) => {
678
54
  let className = `appearance-${appearance}`;
679
- disabled && (className += '-idle');
55
+ disabled && (className += ' disabled');
680
56
  return className;
681
57
  };
682
58
 
@@ -684,18 +60,18 @@ const getClasses = ({
684
60
  connotation,
685
61
  appearance,
686
62
  shape,
687
- size,
63
+ density,
64
+ iconTrailing,
688
65
  icon,
689
66
  label,
690
- disabled
691
- }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [getAppearanceClassName(appearance, disabled), Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)], ['icon-only', !label && !!icon]);
692
-
693
- const focusTemplate = context => {
694
- const focusTag = context.tagFor(Focus);
695
- return html(_t || (_t = _`<${0} class="focus-indicator"></${0}>`), focusTag, focusTag);
696
- };
697
-
698
- const buttonTemplate = context => html(_t2 || (_t2 = _`
67
+ disabled,
68
+ stacked
69
+ }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [getAppearanceClassName(appearance, disabled), Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`density-${density}`, Boolean(density)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing], ['stacked', Boolean(stacked)]);
70
+
71
+ const buttonTemplate = context => {
72
+ const affixIconTemplate = affixIconTemplateFactory(context);
73
+ const focusTemplate = focusTemplateFactory(context);
74
+ return html(_t || (_t = _`
699
75
  <button
700
76
  class="${0}"
701
77
  ?autofocus="${0}"
@@ -736,7 +112,8 @@ const buttonTemplate = context => html(_t2 || (_t2 = _`
736
112
  ${0}
737
113
  ${0}
738
114
  </button>
739
- `), getClasses, x => x.autofocus, x => x.disabled, x => x.formId, x => x.formaction, x => x.formenctype, x => x.formmethod, x => x.formnovalidate, x => x.formtarget, x => x.name, x => x.type, x => x.value, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaExpanded, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaPressed, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate(context), () => prefixOrSuffixTemplate(context), x => x.label);
115
+ `), getClasses, x => x.autofocus, x => x.disabled, x => x.formId, x => x.formaction, x => x.formenctype, x => x.formmethod, x => x.formnovalidate, x => x.formtarget, x => x.name, x => x.type, x => x.value, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaExpanded, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaPressed, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, x => affixIconTemplate(x.icon), x => x.label);
116
+ };
740
117
 
741
118
  const vividButton = Button.compose({
742
119
  baseName: 'button',