@redvars/peacock 3.2.7 → 3.2.8

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 (109) hide show
  1. package/dist/PeacockComponent-DMrFEGDh.js +80 -0
  2. package/dist/PeacockComponent-DMrFEGDh.js.map +1 -0
  3. package/dist/breadcrumb-item-DkhwoMAH.js +6879 -0
  4. package/dist/breadcrumb-item-DkhwoMAH.js.map +1 -0
  5. package/dist/button-BtpAXuLN.js +1180 -0
  6. package/dist/button-BtpAXuLN.js.map +1 -0
  7. package/dist/button-group.js +7 -6
  8. package/dist/button-group.js.map +1 -1
  9. package/dist/button.js +5 -0
  10. package/dist/button.js.map +1 -0
  11. package/dist/{class-map-BmCohX9p.js → class-map-CbncA34D.js} +2 -3
  12. package/dist/class-map-CbncA34D.js.map +1 -0
  13. package/dist/code-highlighter.js +9 -8
  14. package/dist/code-highlighter.js.map +1 -1
  15. package/dist/custom-elements.json +28 -0
  16. package/dist/index.js +87 -35
  17. package/dist/index.js.map +1 -1
  18. package/dist/number-counter.js +7 -6
  19. package/dist/number-counter.js.map +1 -1
  20. package/dist/peacock-loader.js +963 -38
  21. package/dist/peacock-loader.js.map +1 -1
  22. package/dist/src/PeacockComponent.d.ts +1 -0
  23. package/dist/{state-CV1fRmOT.js → state-CEVpI7Vv.js} +2 -2
  24. package/dist/{state-CV1fRmOT.js.map → state-CEVpI7Vv.js.map} +1 -1
  25. package/dist/{style-map-CdmclYgz.js → style-map-mOmZwsJT.js} +2 -3
  26. package/dist/style-map-mOmZwsJT.js.map +1 -0
  27. package/dist/tsconfig.tsbuildinfo +1 -1
  28. package/dist/{unsafe-html-BS8X6Gto.js → unsafe-html-Ca00SXpn.js} +2 -3
  29. package/dist/unsafe-html-Ca00SXpn.js.map +1 -0
  30. package/package.json +1 -1
  31. package/readme.md +2 -2
  32. package/src/PeacockComponent.ts +3 -0
  33. package/src/button/button/button.ts +3 -1
  34. package/src/button/button-group/button-group.ts +2 -0
  35. package/src/code-highlighter/code-highlighter.ts +2 -0
  36. package/src/number-counter/number-counter.ts +2 -0
  37. package/dist/BaseButton.js +0 -209
  38. package/dist/BaseButton.js.map +0 -1
  39. package/dist/BaseInput.js +0 -27
  40. package/dist/BaseInput.js.map +0 -1
  41. package/dist/accordion-item.js +0 -191
  42. package/dist/accordion-item.js.map +0 -1
  43. package/dist/accordion.js +0 -142
  44. package/dist/accordion.js.map +0 -1
  45. package/dist/avatar.js +0 -106
  46. package/dist/avatar.js.map +0 -1
  47. package/dist/badge.js +0 -84
  48. package/dist/badge.js.map +0 -1
  49. package/dist/base-progress.js +0 -33
  50. package/dist/base-progress.js.map +0 -1
  51. package/dist/breadcrumb-item.js +0 -160
  52. package/dist/breadcrumb-item.js.map +0 -1
  53. package/dist/breadcrumb.js +0 -84
  54. package/dist/breadcrumb.js.map +0 -1
  55. package/dist/checkbox.js +0 -530
  56. package/dist/checkbox.js.map +0 -1
  57. package/dist/chip.js +0 -303
  58. package/dist/chip.js.map +0 -1
  59. package/dist/class-map-BmCohX9p.js.map +0 -1
  60. package/dist/clock.js +0 -83
  61. package/dist/clock.js.map +0 -1
  62. package/dist/container.js +0 -135
  63. package/dist/container.js.map +0 -1
  64. package/dist/directive-Cuw6h7YA.js +0 -9
  65. package/dist/directive-Cuw6h7YA.js.map +0 -1
  66. package/dist/divider.js +0 -126
  67. package/dist/divider.js.map +0 -1
  68. package/dist/elevation.js +0 -79
  69. package/dist/elevation.js.map +0 -1
  70. package/dist/empty-state.js +0 -171
  71. package/dist/empty-state.js.map +0 -1
  72. package/dist/field.js +0 -416
  73. package/dist/field.js.map +0 -1
  74. package/dist/focus-ring.js +0 -107
  75. package/dist/focus-ring.js.map +0 -1
  76. package/dist/icon.js +0 -183
  77. package/dist/icon.js.map +0 -1
  78. package/dist/link.js +0 -91
  79. package/dist/link.js.map +0 -1
  80. package/dist/lit-element-CA46RFZ_.js +0 -28
  81. package/dist/lit-element-CA46RFZ_.js.map +0 -1
  82. package/dist/menu-item.js +0 -232
  83. package/dist/menu-item.js.map +0 -1
  84. package/dist/menu-list.js +0 -108
  85. package/dist/menu-list.js.map +0 -1
  86. package/dist/menu.js +0 -117
  87. package/dist/menu.js.map +0 -1
  88. package/dist/property-DNVWDdPC.js +0 -45
  89. package/dist/property-DNVWDdPC.js.map +0 -1
  90. package/dist/query-QBcUV-L_.js +0 -15
  91. package/dist/query-QBcUV-L_.js.map +0 -1
  92. package/dist/ripple.js +0 -128
  93. package/dist/ripple.js.map +0 -1
  94. package/dist/skeleton.js +0 -113
  95. package/dist/skeleton.js.map +0 -1
  96. package/dist/spinner.js +0 -93
  97. package/dist/spinner.js.map +0 -1
  98. package/dist/spread-axRTFMoH.js +0 -32
  99. package/dist/spread-axRTFMoH.js.map +0 -1
  100. package/dist/style-map-CdmclYgz.js.map +0 -1
  101. package/dist/switch-DqxIiVsB.js +0 -2738
  102. package/dist/switch-DqxIiVsB.js.map +0 -1
  103. package/dist/tag.js +0 -323
  104. package/dist/tag.js.map +0 -1
  105. package/dist/tooltip.js +0 -1857
  106. package/dist/tooltip.js.map +0 -1
  107. package/dist/unsafe-html-BS8X6Gto.js.map +0 -1
  108. package/dist/utils-DGMeCC48.js +0 -273
  109. package/dist/utils-DGMeCC48.js.map +0 -1
@@ -0,0 +1,1180 @@
1
+ import { i, e as e$2, d as i$1, t, _ as __decorate, n, a as i$2, A, c as __classPrivateFieldGet, b, P as PeacockComponent } from './PeacockComponent-DMrFEGDh.js';
2
+ import { r } from './state-CEVpI7Vv.js';
3
+ import { e as e$3 } from './class-map-CbncA34D.js';
4
+
5
+ /**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */
10
+ const e$1=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
11
+
12
+ /**
13
+ * @license
14
+ * Copyright 2017 Google LLC
15
+ * SPDX-License-Identifier: BSD-3-Clause
16
+ */function e(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$1(n,s,{get(){return o(this)}})}}
17
+
18
+ async function createCacheFetch(name) {
19
+ let cache = null;
20
+ // This map tracks requests currently being processed
21
+ const inFlightRequests = new Map();
22
+ try {
23
+ cache = await window.caches.open(name);
24
+ }
25
+ catch (e) {
26
+ console.warn('window.caches access not allowed');
27
+ }
28
+ return async (url) => {
29
+ // 1. Check if we are already fetching this URL
30
+ if (inFlightRequests.has(url)) {
31
+ // Return the existing promise instead of starting a new one
32
+ return inFlightRequests.get(url);
33
+ }
34
+ // 2. Create the main logic as a promise
35
+ const fetchPromise = (async () => {
36
+ const request = new Request(url);
37
+ // Check Cache first
38
+ if (cache) {
39
+ const cachedResponse = await cache.match(request);
40
+ if (cachedResponse) {
41
+ return cachedResponse.text();
42
+ }
43
+ }
44
+ // Prepare network request
45
+ const urlObj = new URL(request.url);
46
+ const isSameOrigin = urlObj.origin === window.location.origin;
47
+ const response = await fetch(request.url, {
48
+ method: 'GET',
49
+ mode: isSameOrigin ? 'no-cors' : 'cors',
50
+ credentials: isSameOrigin ? 'same-origin' : 'omit',
51
+ });
52
+ // --- Handle 404 ---
53
+ if (response.status === 404) {
54
+ console.error(`[Fetch Error] Resource not found (404): ${url}`);
55
+ return ''; // Return empty string as requested
56
+ }
57
+ const result = await response.text();
58
+ // Update Cache if applicable
59
+ if (cache && response.status === 200) {
60
+ // We clone the response logic by creating a new Response with the text body
61
+ await cache.put(request, new Response(result, {
62
+ status: response.status,
63
+ statusText: response.statusText,
64
+ headers: response.headers,
65
+ }));
66
+ }
67
+ return result;
68
+ })();
69
+ // 3. Store the promise in the map
70
+ inFlightRequests.set(url, fetchPromise);
71
+ try {
72
+ // 4. Wait for the result
73
+ return await fetchPromise;
74
+ }
75
+ finally {
76
+ // 5. Clean up: Remove the promise from the map when done
77
+ // This ensures subsequent calls (after this one finishes) can start fresh
78
+ inFlightRequests.delete(url);
79
+ }
80
+ };
81
+ }
82
+ // Basic sanitization: remove <script>, <foreignObject>, event handler attributes (on*), and iframes
83
+ function sanitizeSvg(rawSvg) {
84
+ try {
85
+ const parser = new DOMParser();
86
+ const doc = parser.parseFromString(rawSvg, 'image/svg+xml');
87
+ // remove script tags
88
+ const scripts = Array.from(doc.querySelectorAll('script'));
89
+ scripts.forEach(n => n.remove());
90
+ // remove foreignObject and iframe-like elements
91
+ const foreigns = Array.from(doc.querySelectorAll('foreignObject, iframe'));
92
+ foreigns.forEach(n => n.remove());
93
+ // remove event handler attributes like onload, onclick, etc.
94
+ const all = Array.from(doc.querySelectorAll('*'));
95
+ all.forEach(el => {
96
+ const attrs = Array.from(el.attributes).filter(a => /^on/i.test(a.name));
97
+ attrs.forEach(a => el.removeAttribute(a.name));
98
+ });
99
+ const el = doc.documentElement;
100
+ if (!el)
101
+ return '';
102
+ // serialize back to string
103
+ const serializer = new XMLSerializer();
104
+ return serializer.serializeToString(el);
105
+ }
106
+ catch (e) {
107
+ // parsing failed; fall back to empty content to avoid injecting unsafe content
108
+ return '';
109
+ }
110
+ }
111
+ function __hasMeaningfulContent(slotElement) {
112
+ const nodes = slotElement.assignedNodes({ flatten: true });
113
+ for (const node of nodes) {
114
+ // If it's an element node, it has content
115
+ if (node.nodeType === Node.ELEMENT_NODE) {
116
+ return true;
117
+ }
118
+ // If it's a text node and contains non-whitespace characters, it has content
119
+ if (node.nodeType === Node.TEXT_NODE &&
120
+ node.textContent.trim().length > 0) {
121
+ return true;
122
+ }
123
+ }
124
+ // No meaningful content found
125
+ return false;
126
+ }
127
+ function observerSlotChangesWithCallback(slot, callback) {
128
+ const observer = new MutationObserver(() => {
129
+ callback(__hasMeaningfulContent(slot));
130
+ });
131
+ // Observe the elements currently assigned to the slot
132
+ const assignedNodes = slot?.assignedNodes({ flatten: true }) || [];
133
+ assignedNodes.forEach(node => {
134
+ observer.observe(node, {
135
+ attributes: true,
136
+ childList: true,
137
+ characterData: true,
138
+ subtree: true,
139
+ });
140
+ });
141
+ callback(__hasMeaningfulContent(slot));
142
+ }
143
+ function throttle(func, delay, options = { leading: true, trailing: true }) {
144
+ let timerId;
145
+ let lastExec = 0;
146
+ return function (...args) {
147
+ // @ts-ignore
148
+ const context = this;
149
+ const now = Date.now();
150
+ const shouldCallNow = options.leading && now - lastExec >= delay;
151
+ if (shouldCallNow) {
152
+ func.apply(context, args);
153
+ lastExec = now;
154
+ }
155
+ else if (options.trailing && !timerId) {
156
+ timerId = setTimeout(() => {
157
+ func.apply(context, args);
158
+ lastExec = Date.now();
159
+ timerId = null;
160
+ }, delay);
161
+ }
162
+ };
163
+ }
164
+ /**
165
+ * Dispatches a click event to the given element that triggers a native action,
166
+ * but is not composed and therefore is not seen outside the element.
167
+ *
168
+ * This is useful for responding to an external click event on the host element
169
+ * that should trigger an internal action like a button click.
170
+ *
171
+ * Note, a helper is provided because setting this up correctly is a bit tricky.
172
+ * In particular, calling `click` on an element creates a composed event, which
173
+ * is not desirable, and a manually dispatched event must specifically be a
174
+ * `MouseEvent` to trigger a native action.
175
+ *
176
+ * @example
177
+ * hostClickListener = (event: MouseEvent) {
178
+ * if (isActivationClick(event)) {
179
+ * this.dispatchActivationClick(this.buttonElement);
180
+ * }
181
+ * }
182
+ *
183
+ */
184
+ function dispatchActivationClick(element) {
185
+ const event = new MouseEvent('click', { bubbles: true });
186
+ element.dispatchEvent(event);
187
+ return event;
188
+ }
189
+ // Ignore events for one microtask only.
190
+ let isSquelchingEvents = false;
191
+ async function __squelchEventsForMicrotask() {
192
+ isSquelchingEvents = true;
193
+ // Need to pause for just one microtask.
194
+ // tslint:disable-next-line
195
+ await null;
196
+ isSquelchingEvents = false;
197
+ }
198
+ // TODO(https://bugzilla.mozilla.org/show_bug.cgi?id=1804576)
199
+ // Remove when Firefox bug is addressed.
200
+ function __squelchEvent(event) {
201
+ const squelched = isSquelchingEvents;
202
+ if (squelched) {
203
+ event.preventDefault();
204
+ event.stopImmediatePropagation();
205
+ }
206
+ __squelchEventsForMicrotask();
207
+ return squelched;
208
+ }
209
+ /**
210
+ * Returns true if the click event should trigger an activation behavior. The
211
+ * behavior is defined by the element and is whatever it should do when
212
+ * clicked.
213
+ *
214
+ * Typically when an element needs to handle a click, the click is generated
215
+ * from within the element and an event listener within the element implements
216
+ * the needed behavior; however, it's possible to fire a click directly
217
+ * at the element that the element should handle. This method helps
218
+ * distinguish these "external" clicks.
219
+ *
220
+ * An "external" click can be triggered in a number of ways: via a click
221
+ * on an associated label for a form associated element, calling
222
+ * `element.click()`, or calling
223
+ * `element.dispatchEvent(new MouseEvent('click', ...))`.
224
+ *
225
+ * Also works around Firefox issue
226
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=1804576 by squelching
227
+ * events for a microtask after called.
228
+ *
229
+ * @example
230
+ * hostClickListener = (event: MouseEvent) {
231
+ * if (isActivationClick(event)) {
232
+ * this.dispatchActivationClick(this.buttonElement);
233
+ * }
234
+ * }
235
+ *
236
+ */
237
+ function isActivationClick(event) {
238
+ // Event must start at the event target.
239
+ if (event.currentTarget !== event.target) {
240
+ return false;
241
+ }
242
+ // Event must not be retargeted from shadowRoot.
243
+ if (event.composedPath()[0] !== event.target) {
244
+ return false;
245
+ }
246
+ // Target must not be disabled; this should only occur for a synthetically
247
+ // dispatched click.
248
+ if (event.target.disabled) {
249
+ return false;
250
+ }
251
+ // This is an activation if the event should not be squelched.
252
+ return !__squelchEvent(event);
253
+ }
254
+ /**
255
+ * Re-dispatches an event from the provided element.
256
+ *
257
+ * This function is useful for forwarding non-composed events, such as `change`
258
+ * events.
259
+ *
260
+ * @example
261
+ * class MyInput extends LitElement {
262
+ * render() {
263
+ * return html`<input @change=${this.redispatchEvent}>`;
264
+ * }
265
+ *
266
+ * protected redispatchEvent(event: Event) {
267
+ * redispatchEvent(this, event);
268
+ * }
269
+ * }
270
+ *
271
+ * @param element The element to dispatch the event from.
272
+ * @param event The event to re-dispatch.
273
+ * @return Whether or not the event was dispatched (if cancelable).
274
+ */
275
+ function redispatchEvent(element, event) {
276
+ // For bubbling events in SSR light DOM (or composed), stop their propagation
277
+ // and dispatch the copy.
278
+ if (event.bubbles && (!element.shadowRoot || event.composed)) {
279
+ event.stopPropagation();
280
+ }
281
+ const copy = Reflect.construct(event.constructor, [event.type, event]);
282
+ const dispatched = element.dispatchEvent(copy);
283
+ if (!dispatched) {
284
+ event.preventDefault();
285
+ }
286
+ return dispatched;
287
+ }
288
+
289
+ var css_248z$2 = i`* {
290
+ box-sizing: border-box;
291
+ }
292
+
293
+ .screen-reader-only {
294
+ display: none !important;
295
+ }
296
+
297
+ :host {
298
+ display: inline-flex;
299
+ --z-index-button: 0;
300
+ --button-height: unset;
301
+ --button-icon-size: unset;
302
+ --button-container-shape: unset;
303
+ --button-container-shape-start-start: unset;
304
+ --button-container-shape-start-end: unset;
305
+ --button-container-shape-end-start: unset;
306
+ --button-container-shape-end-end: unset;
307
+ --button-container-shape-variant: unset;
308
+ }
309
+
310
+ /**
311
+ * Private CSS Variables
312
+ * These variables are used internally within the button component
313
+ */
314
+ slot::slotted(*) {
315
+ --icon-size: var(--button-icon-size, var(--_button-icon-size));
316
+ --icon-color: var(--_label-text-color);
317
+ }
318
+
319
+ /*
320
+ * Reset native button/link styles
321
+ */
322
+ .button.button-element {
323
+ background: transparent;
324
+ border: none;
325
+ appearance: none;
326
+ margin: 0;
327
+ outline: none;
328
+ text-decoration: none;
329
+ }
330
+
331
+ .button {
332
+ position: relative;
333
+ display: inline-flex;
334
+ flex-direction: column;
335
+ align-items: center;
336
+ justify-content: center;
337
+ height: var(--button-height, var(--_button-height));
338
+ padding: 0 var(--_container-padding);
339
+ width: 100%;
340
+ font-family: var(--font-family-sans) !important;
341
+ cursor: pointer;
342
+ --_container-shape-start-start: var(--button-container-shape-start-start, var(--button-container-shape, var(--shape-corner-medium)));
343
+ --_container-shape-start-end: var(--button-container-shape-start-end, var(--button-container-shape, var(--shape-corner-medium)));
344
+ --_container-shape-end-start: var(--button-container-shape-end-start, var(--button-container-shape, var(--shape-corner-medium)));
345
+ --_container-shape-end-end: var(--button-container-shape-end-end, var(--button-container-shape, var(--shape-corner-medium)));
346
+ --_container-corner-shape-variant: var(--button-container-shape-variant, squircle);
347
+ }
348
+ .button .button-content {
349
+ display: flex;
350
+ align-items: center;
351
+ justify-content: center;
352
+ gap: var(--_button-icon-label-spacing);
353
+ width: 100%;
354
+ z-index: 1;
355
+ color: var(--_label-text-color);
356
+ opacity: var(--_label-text-opacity, 1);
357
+ --icon-size: var(--button-icon-size, var(--_button-icon-size));
358
+ --icon-color: var(--_label-text-color);
359
+ }
360
+ .button .button-content .slot-container {
361
+ display: none;
362
+ }
363
+ .button.disabled {
364
+ cursor: not-allowed;
365
+ }
366
+ .button {
367
+ /*
368
+ Background layers
369
+ */
370
+ }
371
+ .button .focus-ring {
372
+ z-index: 2;
373
+ --focus-ring-container-shape-start-start: var(--_container-shape-start-start);
374
+ --focus-ring-container-shape-start-end: var(--_container-shape-start-end);
375
+ --focus-ring-container-shape-end-start: var(--_container-shape-end-start);
376
+ --focus-ring-container-shape-end-end: var(--_container-shape-end-end);
377
+ --focus-ring-container-shape-variant: var(--_container-corner-shape-variant);
378
+ }
379
+ .button .ripple {
380
+ border-start-start-radius: var(--_container-shape-start-start);
381
+ border-start-end-radius: var(--_container-shape-start-end);
382
+ border-end-start-radius: var(--_container-shape-end-start);
383
+ border-end-end-radius: var(--_container-shape-end-end);
384
+ corner-shape: var(--_container-corner-shape-variant);
385
+ --ripple-state-opacity: var(--_container-state-opacity, 0);
386
+ --ripple-pressed-color: var(--_container-state-color);
387
+ }
388
+ .button .background {
389
+ display: block;
390
+ position: absolute;
391
+ left: 0;
392
+ width: 100%;
393
+ height: 100%;
394
+ background-color: var(--_container-color);
395
+ opacity: var(--_container-opacity, 1);
396
+ border-start-start-radius: var(--_container-shape-start-start);
397
+ border-start-end-radius: var(--_container-shape-start-end);
398
+ border-end-start-radius: var(--_container-shape-end-start);
399
+ border-end-end-radius: var(--_container-shape-end-end);
400
+ corner-shape: var(--_container-corner-shape-variant);
401
+ pointer-events: none;
402
+ }
403
+ .button .skeleton {
404
+ display: none;
405
+ width: 100%;
406
+ height: 100%;
407
+ z-index: 2;
408
+ position: absolute;
409
+ top: 0;
410
+ left: 0;
411
+ --skeleton-container-shape-start-start: var(--_container-shape-start-start);
412
+ --skeleton-container-shape-start-end: var(--_container-shape-start-end);
413
+ --skeleton-container-shape-end-start: var(--_container-shape-end-start);
414
+ --skeleton-container-shape-end-end: var(--_container-shape-end-end);
415
+ --skeleton-container-shape-variant: var(--_container-corner-shape-variant);
416
+ }
417
+ .button .elevation {
418
+ --elevation-level: var(--_container-elevation-level);
419
+ transition-duration: 280ms;
420
+ --elevation-container-shape-start-start: var(--_container-shape-start-start);
421
+ --elevation-container-shape-start-end: var(--_container-shape-start-end);
422
+ --elevation-container-shape-end-start: var(--_container-shape-end-start);
423
+ --elevation-container-shape-end-end: var(--_container-shape-end-end);
424
+ --elevation-container-shape-variant: var(--_container-corner-shape-variant);
425
+ }
426
+ .button .neo-background {
427
+ display: none;
428
+ position: absolute;
429
+ background: var(--color-inverse-surface);
430
+ border-start-start-radius: var(--_container-shape-start-start);
431
+ border-start-end-radius: var(--_container-shape-start-end);
432
+ border-end-start-radius: var(--_container-shape-end-start);
433
+ border-end-end-radius: var(--_container-shape-end-end);
434
+ corner-shape: var(--_container-corner-shape-variant);
435
+ width: 100%;
436
+ height: 100%;
437
+ pointer-events: none;
438
+ transform: translateX(0.25rem) translateY(0.25rem);
439
+ }
440
+ .button .neo-background:before {
441
+ z-index: 0;
442
+ content: "";
443
+ position: absolute;
444
+ pointer-events: none;
445
+ border-start-start-radius: var(--_container-shape-start-start);
446
+ border-start-end-radius: var(--_container-shape-start-end);
447
+ border-end-start-radius: var(--_container-shape-end-start);
448
+ border-end-end-radius: var(--_container-shape-end-end);
449
+ corner-shape: var(--_container-corner-shape-variant);
450
+ width: 100%;
451
+ height: 100%;
452
+ background: white;
453
+ left: 0;
454
+ transform: translateX(-0.25rem) translateY(-0.25rem);
455
+ }
456
+ .button .outline {
457
+ z-index: 0;
458
+ display: none;
459
+ position: absolute;
460
+ left: 0;
461
+ width: 100%;
462
+ height: 100%;
463
+ pointer-events: none;
464
+ border: var(--_outline-width) solid var(--_outline-color);
465
+ opacity: var(--_outline-opacity, 1);
466
+ border-start-start-radius: var(--_container-shape-start-start);
467
+ border-start-end-radius: var(--_container-shape-start-end);
468
+ border-end-start-radius: var(--_container-shape-end-start);
469
+ border-end-end-radius: var(--_container-shape-end-end);
470
+ corner-shape: var(--_container-corner-shape-variant);
471
+ }
472
+ .button.has-content .slot-container {
473
+ display: flex;
474
+ flex: none;
475
+ justify-content: center;
476
+ }
477
+ .button.show-skeleton .background {
478
+ display: none;
479
+ }
480
+ .button.show-skeleton .neo-background {
481
+ display: none;
482
+ }
483
+ .button.show-skeleton .neo-background:before {
484
+ display: none;
485
+ }
486
+ .button.show-skeleton .ripple {
487
+ display: none;
488
+ }
489
+ .button.show-skeleton .skeleton {
490
+ display: block;
491
+ }
492
+ .button.icon-align-start .button-content {
493
+ flex-direction: row-reverse;
494
+ }
495
+ .button.icon-align-end .button-content {
496
+ flex-direction: row;
497
+ }
498
+
499
+ /**
500
+ * Button variant definitions
501
+ */
502
+ .button.variant-elevated {
503
+ --_container-color: var(--elevated-button-container-color);
504
+ --_label-text-color: var(--elevated-button-label-text-color);
505
+ --_container-elevation-level: 1;
506
+ --_container-state-color: var(--_label-text-color);
507
+ }
508
+ .button.variant-elevated:hover:not(:where(.disabled, .soft-disabled, .show-skeleton)) {
509
+ --_container-elevation-level: 2;
510
+ --_container-state-opacity: 0.08;
511
+ }
512
+ .button.variant-elevated.pressed:not(:where(.disabled, .soft-disabled, .show-skeleton)) {
513
+ --_container-elevation-level: 1;
514
+ --_container-state-opacity: 0.12;
515
+ }
516
+ .button.variant-elevated.disabled {
517
+ --_container-color: var(--color-on-surface);
518
+ --_container-opacity: 0.1;
519
+ --_label-text-color: var(--color-on-surface);
520
+ --_label-text-opacity: 0.38;
521
+ }
522
+ .button.variant-elevated.disabled .ripple {
523
+ display: none;
524
+ }
525
+
526
+ .button.variant-filled {
527
+ --_container-color: var(--filled-button-container-color);
528
+ --_label-text-color: var(--filled-button-label-text-color);
529
+ --_container-state-color: var(--_label-text-color);
530
+ }
531
+ .button.variant-filled:hover:not(:where(.disabled, .soft-disabled, .show-skeleton)) {
532
+ --_container-elevation-level: 1;
533
+ --_container-state-opacity: 0.08;
534
+ }
535
+ .button.variant-filled.pressed:not(:where(.disabled, .soft-disabled, .show-skeleton)) {
536
+ --_container-elevation-level: 0;
537
+ --_container-state-opacity: 0.1;
538
+ }
539
+ .button.variant-filled.disabled {
540
+ --_container-color: var(--color-on-surface);
541
+ --_container-opacity: 0.1;
542
+ --_label-text-color: var(--color-on-surface);
543
+ --_label-text-opacity: 0.38;
544
+ }
545
+ .button.variant-filled.disabled .ripple {
546
+ display: none;
547
+ }
548
+
549
+ .button.variant-tonal {
550
+ --_container-color: var(--tonal-button-container-color);
551
+ --_label-text-color: var(--tonal-button-label-text-color);
552
+ --_container-state-color: var(--_label-text-color);
553
+ }
554
+ .button.variant-tonal:hover:not(:where(.disabled, .soft-disabled, .show-skeleton)) {
555
+ --_container-elevation-level: 1;
556
+ --_container-state-opacity: 0.08;
557
+ }
558
+ .button.variant-tonal.pressed:not(:where(.disabled, .soft-disabled, .show-skeleton)) {
559
+ --_container-elevation-level: 0;
560
+ --_container-state-opacity: 0.12;
561
+ }
562
+ .button.variant-tonal.disabled {
563
+ --_container-color: var(--color-on-surface);
564
+ --_container-opacity: 0.1;
565
+ --_label-text-color: var(--color-on-surface);
566
+ --_label-text-opacity: 0.38;
567
+ }
568
+ .button.variant-tonal.disabled .ripple {
569
+ display: none;
570
+ }
571
+
572
+ .button.variant-outlined {
573
+ --_outline-width: var(--outlined-button-outline-width, 0.0675rem);
574
+ --_outline-color: var(--outlined-button-outline-color);
575
+ --_label-text-color: var(--outlined-button-label-text-color);
576
+ --_container-state-color: var(--_label-text-color);
577
+ }
578
+ .button.variant-outlined .outline {
579
+ display: block;
580
+ }
581
+ .button.variant-outlined:hover:not(:where(.disabled, .soft-disabled, .show-skeleton)) {
582
+ --_container-state-opacity: 0.08;
583
+ }
584
+ .button.variant-outlined.pressed:not(:where(.disabled, .soft-disabled, .show-skeleton)) {
585
+ --_container-state-opacity: 0.12;
586
+ }
587
+ .button.variant-outlined.disabled {
588
+ --_outline-color: var(--color-on-surface);
589
+ --_label-text-color: var(--color-on-surface);
590
+ --_label-text-opacity: 0.38;
591
+ --_outline-opacity: 0.12;
592
+ }
593
+ .button.variant-outlined.disabled .ripple {
594
+ display: none;
595
+ }
596
+
597
+ .button.variant-text {
598
+ --_label-text-color: var(--text-button-label-text-color);
599
+ --_container-state-color: var(--_label-text-color);
600
+ }
601
+ .button.variant-text:hover:not(:where(.disabled, .soft-disabled, .show-skeleton)) {
602
+ --_container-state-opacity: 0.08;
603
+ }
604
+ .button.variant-text.pressed:not(:where(.disabled, .soft-disabled, .show-skeleton)) {
605
+ --_container-state-opacity: 0.12;
606
+ }
607
+ .button.variant-text.disabled {
608
+ --_label-text-color: var(--color-on-surface);
609
+ --_label-text-opacity: 0.38;
610
+ }
611
+ .button.variant-text.disabled .ripple {
612
+ display: none;
613
+ }
614
+
615
+ .button.variant-neo {
616
+ --_container-color: var(--neo-button-container-color);
617
+ --_label-text-color: var(--neo-button-label-text-color);
618
+ --_outline-width: var(--outlined-button-outline-width, 0.125rem);
619
+ --_outline-color: var(--color-inverse-surface);
620
+ }
621
+ .button.variant-neo .outline {
622
+ display: block;
623
+ }
624
+ .button.variant-neo .neo-background {
625
+ display: block;
626
+ }
627
+ .button.variant-neo .ripple {
628
+ display: none;
629
+ }
630
+ .button.variant-neo.pressed:not(:where(.disabled, .soft-disabled, .show-skeleton)) .background, .button.variant-neo.pressed:not(:where(.disabled, .soft-disabled, .show-skeleton)) .button-content, .button.variant-neo.pressed:not(:where(.disabled, .soft-disabled, .show-skeleton)) .outline {
631
+ transform: translateX(0.25rem) translateY(0.25rem);
632
+ }
633
+ .button.variant-neo.pressed:not(:where(.disabled, .soft-disabled, .show-skeleton)) .neo-background:before {
634
+ transform: translateX(0) translateY(0);
635
+ }
636
+ .button.variant-neo.disabled {
637
+ --_container-color: var(--color-on-surface);
638
+ --_container-opacity: 0.1;
639
+ --_label-text-color: var(--color-on-surface);
640
+ --_label-text-opacity: 0.38;
641
+ --_outline-opacity: 0.12;
642
+ }
643
+ .button.variant-neo.disabled .ripple {
644
+ display: none;
645
+ }
646
+
647
+ :host([block]) {
648
+ width: 100%;
649
+ }`;
650
+
651
+ var css_248z$1 = i`:host([color=primary]) {
652
+ --filled-button-container-color: var(--color-primary);
653
+ --filled-button-label-text-color: var(--color-on-primary);
654
+ --tonal-button-container-color: var(--color-primary-container);
655
+ --tonal-button-label-text-color: var(--color-on-primary-container);
656
+ --elevated-button-container-color: var(--color-surface-container-low);
657
+ --elevated-button-label-text-color: var(--color-primary);
658
+ --outlined-button-outline-color: var(--color-primary);
659
+ --outlined-button-label-text-color: var(--color-primary);
660
+ --text-button-label-text-color: var(--color-primary);
661
+ --neo-button-container-color: var(--color-primary);
662
+ --neo-button-label-text-color: var(--color-on-primary);
663
+ }
664
+
665
+ :host([color=secondary]) {
666
+ --filled-button-container-color: var(--color-secondary);
667
+ --filled-button-label-text-color: var(--color-on-secondary);
668
+ --tonal-button-container-color: var(--color-secondary-container);
669
+ --tonal-button-label-text-color: var(--color-on-secondary-container);
670
+ --elevated-button-container-color: var(--color-surface-container-low);
671
+ --elevated-button-label-text-color: var(--color-secondary);
672
+ --outlined-button-outline-color: var(--color-secondary);
673
+ --outlined-button-label-text-color: var(--color-secondary);
674
+ --text-button-label-text-color: var(--color-secondary);
675
+ --neo-button-container-color: var(--color-secondary);
676
+ --neo-button-label-text-color: var(--color-on-secondary);
677
+ }
678
+
679
+ :host([color=tertiary]) {
680
+ --filled-button-container-color: var(--color-tertiary);
681
+ --filled-button-label-text-color: var(--color-on-tertiary);
682
+ --tonal-button-container-color: var(--color-tertiary-container);
683
+ --tonal-button-label-text-color: var(--color-on-tertiary-container);
684
+ --elevated-button-container-color: var(--color-surface-container-low);
685
+ --elevated-button-label-text-color: var(--color-tertiary);
686
+ --outlined-button-outline-color: var(--color-tertiary);
687
+ --outlined-button-label-text-color: var(--color-tertiary);
688
+ --text-button-label-text-color: var(--color-tertiary);
689
+ --neo-button-container-color: var(--color-tertiary);
690
+ --neo-button-label-text-color: var(--color-on-tertiary);
691
+ }
692
+
693
+ :host([color=success]) {
694
+ --filled-button-container-color: var(--color-success);
695
+ --filled-button-label-text-color: var(--color-on-success);
696
+ --tonal-button-container-color: var(--color-success-container);
697
+ --tonal-button-label-text-color: var(--color-on-success-container);
698
+ --elevated-button-container-color: var(--color-surface-container-low);
699
+ --elevated-button-label-text-color: var(--color-success);
700
+ --outlined-button-outline-color: var(--color-success);
701
+ --outlined-button-label-text-color: var(--color-success);
702
+ --text-button-label-text-color: var(--color-success);
703
+ --neo-button-container-color: var(--color-success);
704
+ --neo-button-label-text-color: var(--color-on-success);
705
+ }
706
+
707
+ :host([color=danger]) {
708
+ --filled-button-container-color: var(--color-error);
709
+ --filled-button-label-text-color: var(--color-on-error);
710
+ --tonal-button-container-color: var(--color-error-container);
711
+ --tonal-button-label-text-color: var(--color-on-error-container);
712
+ --elevated-button-container-color: var(--color-surface-container-low);
713
+ --elevated-button-label-text-color: var(--color-error);
714
+ --outlined-button-outline-color: var(--color-error);
715
+ --outlined-button-label-text-color: var(--color-error);
716
+ --text-button-label-text-color: var(--color-error);
717
+ --neo-button-container-color: var(--color-error);
718
+ --neo-button-label-text-color: var(--color-on-error);
719
+ }
720
+
721
+ :host([color=dark]) {
722
+ --filled-button-container-color: var(--color-on-surface);
723
+ --filled-button-label-text-color: var(--color-surface);
724
+ --tonal-button-container-color: var(--color-surface-container);
725
+ --tonal-button-label-text-color: var(--color-on-surface-container);
726
+ --elevated-button-container-color: var(--color-surface-container-low);
727
+ --elevated-button-label-text-color: var(--color-on-surface);
728
+ --outlined-button-outline-color: var(--color-on-surface);
729
+ --outlined-button-label-text-color: var(--color-on-surface);
730
+ --text-button-label-text-color: var(--color-on-surface);
731
+ --neo-button-container-color: var(--color-on-surface);
732
+ --neo-button-label-text-color: var(--color-surface);
733
+ }
734
+
735
+ :host([color=light]) {
736
+ --filled-button-container-color: var(--color-surface);
737
+ --filled-button-label-text-color: var(--color-on-surface);
738
+ --tonal-button-container-color: var(--color-on-surface-container);
739
+ --tonal-button-label-text-color: var(--color-surface-container);
740
+ --elevated-button-container-color: var(--color-surface-container-low);
741
+ --elevated-button-label-text-color: var(--color-white);
742
+ --outlined-button-outline-color: var(--color-surface);
743
+ --outlined-button-label-text-color: var(--color-surface);
744
+ --text-button-label-text-color: var(--color-surface);
745
+ --neo-button-container-color: var(--color-surface);
746
+ --neo-button-label-text-color: var(--color-on-surface);
747
+ }`;
748
+
749
+ var css_248z = i`.button.size-xs,
750
+ .button.size-extra-small {
751
+ --_button-height: 2rem;
752
+ --_button-icon-size: 1rem;
753
+ --_container-padding: 0.75rem;
754
+ font-size: 0.875rem !important;
755
+ font-weight: var(--font-weight-medium) !important;
756
+ line-height: 1.25rem !important;
757
+ letter-spacing: 0.1px !important;
758
+ }
759
+
760
+ .button.size-sm,
761
+ .button.size-small {
762
+ --_button-height: 2.5rem;
763
+ --_button-icon-size: 1.25rem;
764
+ --_container-padding: 1rem;
765
+ --_button-icon-label-spacing: 0.5rem;
766
+ font-size: 0.875rem !important;
767
+ font-weight: var(--font-weight-medium) !important;
768
+ line-height: 1.25rem !important;
769
+ letter-spacing: 0.1px !important;
770
+ }
771
+
772
+ .button.size-md,
773
+ .button.size-medium {
774
+ --_button-height: 3.5rem;
775
+ --_button-icon-size: 1.5rem;
776
+ --_container-padding: 1.5rem;
777
+ font-size: 1rem !important;
778
+ font-weight: var(--font-weight-medium) !important;
779
+ line-height: 1.5rem !important;
780
+ letter-spacing: 0.15px !important;
781
+ }
782
+
783
+ .button.size-lg,
784
+ .button.size-large {
785
+ --_button-height: 6rem;
786
+ --_button-icon-size: 2rem;
787
+ --_container-padding: 3rem;
788
+ font-size: 1.5rem !important;
789
+ font-weight: var(--font-weight-regular) !important;
790
+ line-height: 2rem !important;
791
+ letter-spacing: 0 !important;
792
+ }
793
+
794
+ .button.size-xl {
795
+ --_button-height: 8.5rem;
796
+ --_button-icon-size: 2.5rem;
797
+ --_container-padding: 4rem;
798
+ font-size: 2rem !important;
799
+ font-weight: var(--font-weight-regular) !important;
800
+ line-height: 2.5rem !important;
801
+ letter-spacing: 0 !important;
802
+ }`;
803
+
804
+ class SpreadDirective extends i$1 {
805
+ constructor(partInfo) {
806
+ super(partInfo);
807
+ if (partInfo.type !== t.ELEMENT) {
808
+ throw new Error('spread() can only be used on elements');
809
+ }
810
+ }
811
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
812
+ render(_props) {
813
+ return '';
814
+ }
815
+ update(part, [props]) {
816
+ if (!props)
817
+ return;
818
+ // eslint-disable-next-line guard-for-in,no-restricted-syntax
819
+ for (const key in props) {
820
+ const value = props[key];
821
+ if (value === undefined || value === null) {
822
+ part.element.removeAttribute(key);
823
+ }
824
+ else {
825
+ part.element.setAttribute(key, value);
826
+ }
827
+ }
828
+ }
829
+ }
830
+ const spread = e$2(SpreadDirective);
831
+
832
+ var _BaseButton_id;
833
+ class BaseButton extends i$2 {
834
+ constructor() {
835
+ super(...arguments);
836
+ _BaseButton_id.set(this, crypto.randomUUID());
837
+ this.htmlType = 'button';
838
+ /**
839
+ * The visual style of the button.
840
+ *
841
+ * Possible variant values:
842
+ * `"filled"` is a filled button.
843
+ * `"outlined"` is an outlined button.
844
+ * `"text"` is a transparent button.
845
+ * `"tonal"` is a light color button.
846
+ * `"elevated"` is elevated button
847
+ */
848
+ this.variant = 'filled';
849
+ /**
850
+ * Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.
851
+ */
852
+ this.color = 'primary';
853
+ /**
854
+ * Button size.
855
+ * Possible values are `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`.
856
+ */
857
+ this.size = 'sm';
858
+ /**
859
+ * If true, the user cannot interact with the button. Defaults to `false`.
860
+ */
861
+ this.disabled = false;
862
+ this.skeleton = false;
863
+ /**
864
+ * If true, the user cannot interact with the button and the button is visually styled as disabled. But the button is still focusable. Defaults to `false`.
865
+ */
866
+ this.softDisabled = false;
867
+ /**
868
+ * If button is disabled, the reason why it is disabled.
869
+ */
870
+ this.disabledReason = '';
871
+ /**
872
+ * Sets or retrieves the window or frame at which to target content.
873
+ */
874
+ this.target = '_self';
875
+ this.selected = false;
876
+ /**
877
+ * Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.
878
+ */
879
+ this.throttleDelay = 200;
880
+ /**
881
+ * States
882
+ */
883
+ this.isPressed = false;
884
+ this.__handlePress = (event) => {
885
+ if (this.disabled || this.skeleton || this.softDisabled)
886
+ return;
887
+ if (event instanceof KeyboardEvent &&
888
+ event.type === 'keydown' &&
889
+ (event.key === 'Enter' || event.key === ' ')) {
890
+ this.isPressed = true;
891
+ }
892
+ else if (event.type === 'mousedown') {
893
+ this.isPressed = true;
894
+ }
895
+ else {
896
+ this.isPressed = false;
897
+ }
898
+ };
899
+ this.__dispatchClickWithThrottle = event => {
900
+ this.__dispatchClick(event);
901
+ };
902
+ this.__dispatchClick = (event) => {
903
+ // If the button is soft-disabled or a disabled link, we need to explicitly
904
+ // prevent the click from propagating to other event listeners as well as
905
+ // prevent the default action.
906
+ if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {
907
+ event.stopImmediatePropagation();
908
+ event.preventDefault();
909
+ return;
910
+ }
911
+ if (!isActivationClick(event) || !this.buttonElement) {
912
+ return;
913
+ }
914
+ this.focus();
915
+ dispatchActivationClick(this.buttonElement);
916
+ };
917
+ }
918
+ focus() {
919
+ this.buttonElement?.focus();
920
+ }
921
+ blur() {
922
+ this.buttonElement?.blur();
923
+ }
924
+ connectedCallback() {
925
+ super.connectedCallback();
926
+ this.addEventListener('click', this.__dispatchClickWithThrottle);
927
+ window.addEventListener('mouseup', this.__handlePress);
928
+ }
929
+ disconnectedCallback() {
930
+ window.removeEventListener('mouseup', this.__handlePress);
931
+ this.removeEventListener('click', this.__dispatchClickWithThrottle);
932
+ super.disconnectedCallback();
933
+ }
934
+ __isLink() {
935
+ return !!this.href;
936
+ }
937
+ __convertTypeToVariantAndColor() {
938
+ if (this.type === 'primary') {
939
+ this.color = 'primary';
940
+ this.variant = 'filled';
941
+ }
942
+ else if (this.type === 'secondary') {
943
+ this.color = 'dark';
944
+ this.variant = 'outlined';
945
+ }
946
+ else if (this.type === 'tertiary') {
947
+ this.color = 'primary';
948
+ this.variant = 'text';
949
+ }
950
+ else if (this.type === 'danger') {
951
+ this.color = 'danger';
952
+ this.variant = 'filled';
953
+ }
954
+ }
955
+ __getDisabledReasonID() {
956
+ return this.disabled && this.disabledReason
957
+ ? `disabled-reason-${__classPrivateFieldGet(this, _BaseButton_id, "f")}`
958
+ : A;
959
+ }
960
+ __renderDisabledReason() {
961
+ const disabledReasonID = this.__getDisabledReasonID();
962
+ if (disabledReasonID)
963
+ return b `<div
964
+ id="disabled-reason-${__classPrivateFieldGet(this, _BaseButton_id, "f")}"
965
+ role="tooltip"
966
+ aria-label=${this.disabledReason}
967
+ class="screen-reader-only"
968
+ >
969
+ {this.disabledReason}
970
+ </div>`;
971
+ return A;
972
+ }
973
+ __renderTooltip() {
974
+ if (this.tooltip) {
975
+ return b `<base-tooltip for="button">${this.tooltip}</base-tooltip>`;
976
+ }
977
+ return A;
978
+ }
979
+ }
980
+ _BaseButton_id = new WeakMap();
981
+ __decorate([
982
+ n({ type: String })
983
+ ], BaseButton.prototype, "htmlType", void 0);
984
+ __decorate([
985
+ n({ type: String })
986
+ ], BaseButton.prototype, "type", void 0);
987
+ __decorate([
988
+ n()
989
+ ], BaseButton.prototype, "variant", void 0);
990
+ __decorate([
991
+ n({ reflect: true })
992
+ ], BaseButton.prototype, "color", void 0);
993
+ __decorate([
994
+ n()
995
+ ], BaseButton.prototype, "size", void 0);
996
+ __decorate([
997
+ n({ type: Boolean, reflect: true })
998
+ ], BaseButton.prototype, "disabled", void 0);
999
+ __decorate([
1000
+ n()
1001
+ ], BaseButton.prototype, "skeleton", void 0);
1002
+ __decorate([
1003
+ n({ reflect: true, attribute: 'soft-disabled' })
1004
+ ], BaseButton.prototype, "softDisabled", void 0);
1005
+ __decorate([
1006
+ n({ attribute: 'disabled-reason' })
1007
+ ], BaseButton.prototype, "disabledReason", void 0);
1008
+ __decorate([
1009
+ n({ reflect: true })
1010
+ ], BaseButton.prototype, "href", void 0);
1011
+ __decorate([
1012
+ n({ reflect: true })
1013
+ ], BaseButton.prototype, "configAria", void 0);
1014
+ __decorate([
1015
+ n()
1016
+ ], BaseButton.prototype, "target", void 0);
1017
+ __decorate([
1018
+ n()
1019
+ ], BaseButton.prototype, "selected", void 0);
1020
+ __decorate([
1021
+ n()
1022
+ ], BaseButton.prototype, "throttleDelay", void 0);
1023
+ __decorate([
1024
+ n()
1025
+ ], BaseButton.prototype, "tooltip", void 0);
1026
+ __decorate([
1027
+ r()
1028
+ ], BaseButton.prototype, "isPressed", void 0);
1029
+ __decorate([
1030
+ e('.button')
1031
+ ], BaseButton.prototype, "buttonElement", void 0);
1032
+
1033
+ var _Button_tabindex;
1034
+ /**
1035
+ * @label Button
1036
+ * @tag base-button
1037
+ * @rawTag button
1038
+ *
1039
+ * @summary Buttons help people initiate actions, from sending an email, to sharing a document, to liking a post.
1040
+ * @overview
1041
+ * <p>Buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. Button labels express what action will occur when the user interacts with it.</p>
1042
+ *
1043
+ * @cssprop --button-container-shape: Defines the border radius of the button container shape.
1044
+ *
1045
+ * @cssprop --button-container-shape-start-start: Defines the start position of the button container shape.
1046
+ * @cssprop --button-container-shape-start-end: Defines the end position of the button container shape.
1047
+ * @cssprop --button-container-shape-end-start: Defines the start position of the button container shape.
1048
+ * @cssprop --button-container-shape-end-end: Defines the end position of the button container shape.
1049
+ *
1050
+ *
1051
+ * @cssprop --filled-button-container-color: Color of the filled button container.
1052
+ * @cssprop --filled-button-label-text-color: Text color of the filled button label.
1053
+ *
1054
+ * @cssprop --outlined-button-container-color: Color of the outlined button container.
1055
+ * @cssprop --outlined-button-label-text-color: Text color of the outlined button label.
1056
+ *
1057
+ * @cssprop --text-button-label-text-color: Text color of the text button label.
1058
+ *
1059
+ * @cssprop --tonal-button-container-color: Color of the tonal button container.
1060
+ * @cssprop --tonal-button-label-text-color: Text color of the tonal button label.
1061
+ *
1062
+ * @cssprop --elevated-button-container-color: Color of the elevated button container.
1063
+ * @cssprop --elevated-button-label-text-color: Text color of the elevated button label.
1064
+ *
1065
+ * @cssprop --neo-button-container-color: Color of the neo button container.
1066
+ * @cssprop --neo-button-label-text-color: Text color of the neo button label.
1067
+ *
1068
+ * @fires {MouseEvent} click - Dispatched when the button is clicked.
1069
+ *
1070
+ * @example
1071
+ * ```html
1072
+ * <base-button>Button</base-button>
1073
+ * ```
1074
+ * @tags display
1075
+ */
1076
+ let Button = class Button extends BaseButton {
1077
+ constructor() {
1078
+ super(...arguments);
1079
+ _Button_tabindex.set(this, 0);
1080
+ /**
1081
+ * Icon alignment.
1082
+ * Possible values are `"start"`, `"end"`. Defaults to `"end"`.
1083
+ */
1084
+ this.iconAlign = 'end';
1085
+ this.slotHasContent = false;
1086
+ }
1087
+ firstUpdated() {
1088
+ this.__dispatchClickWithThrottle = throttle(this.__dispatchClick, this.throttleDelay);
1089
+ observerSlotChangesWithCallback(this.renderRoot.querySelector('slot'), hasContent => {
1090
+ this.slotHasContent = hasContent;
1091
+ this.requestUpdate();
1092
+ });
1093
+ this.__convertTypeToVariantAndColor();
1094
+ }
1095
+ render() {
1096
+ const isLink = this.__isLink();
1097
+ const cssClasses = {
1098
+ button: true,
1099
+ 'button-element': true,
1100
+ [`size-${this.size}`]: true,
1101
+ [`variant-${this.variant}`]: true,
1102
+ [`color-${this.color}`]: true,
1103
+ disabled: this.disabled || this.softDisabled,
1104
+ pressed: this.isPressed,
1105
+ 'has-content': this.slotHasContent,
1106
+ 'show-skeleton': this.skeleton,
1107
+ [`icon-align-${this.iconAlign}`]: true,
1108
+ };
1109
+ if (!isLink) {
1110
+ return b `<button
1111
+ class=${e$3(cssClasses)}
1112
+ id="button"
1113
+ tabindex=${__classPrivateFieldGet(this, _Button_tabindex, "f")}
1114
+ type=${this.htmlType}
1115
+ @mousedown=${this.__handlePress}
1116
+ @keydown=${this.__handlePress}
1117
+ @keyup=${this.__handlePress}
1118
+ ?aria-describedby=${this.__getDisabledReasonID()}
1119
+ aria-disabled=${`${this.disabled || this.softDisabled}`}
1120
+ ?disabled=${this.disabled}
1121
+ ${spread(this.configAria)}
1122
+ >
1123
+ ${this.renderButtonContent()}
1124
+ </button>
1125
+ ${this.__renderTooltip()}`;
1126
+ }
1127
+ return b `<a
1128
+ class=${e$3(cssClasses)}
1129
+ id="button"
1130
+ tabindex=${__classPrivateFieldGet(this, _Button_tabindex, "f")}
1131
+ href=${this.href}
1132
+ target=${this.target}
1133
+ @mousedown=${this.__handlePress}
1134
+ @keydown=${this.__handlePress}
1135
+ @keyup=${this.__handlePress}
1136
+ role="button"
1137
+ ?aria-describedby=${this.__getDisabledReasonID()}
1138
+ aria-disabled=${`${this.disabled}`}
1139
+ ${spread(this.configAria)}
1140
+ >
1141
+ ${this.renderButtonContent()}
1142
+ </a>
1143
+ ${this.__renderTooltip()}`;
1144
+ }
1145
+ renderButtonContent() {
1146
+ return b `
1147
+ <focus-ring class="focus-ring" .control=${this} element="buttonElement"></focus-ring>
1148
+ <base-elevation class="elevation"></base-elevation>
1149
+ <div class="neo-background"></div>
1150
+ <div class="background"></div>
1151
+ <div class="outline"></div>
1152
+ <base-ripple class="ripple"></base-ripple>
1153
+ <base-skeleton class="skeleton"></base-skeleton>
1154
+
1155
+ <div class="button-content">
1156
+ <div class="slot-container">
1157
+ <slot></slot>
1158
+ </div>
1159
+
1160
+ <slot name="icon"></slot>
1161
+ </div>
1162
+
1163
+ ${this.__renderDisabledReason()}
1164
+ `;
1165
+ }
1166
+ };
1167
+ _Button_tabindex = new WeakMap();
1168
+ Button.styles = [css_248z$2, css_248z$1, css_248z];
1169
+ __decorate([
1170
+ n({ attribute: 'icon-align' })
1171
+ ], Button.prototype, "iconAlign", void 0);
1172
+ __decorate([
1173
+ r()
1174
+ ], Button.prototype, "slotHasContent", void 0);
1175
+ Button = __decorate([
1176
+ PeacockComponent
1177
+ ], Button);
1178
+
1179
+ export { Button as B, e$1 as a, sanitizeSvg as b, createCacheFetch as c, css_248z$2 as d, e, css_248z$1 as f, BaseButton as g, observerSlotChangesWithCallback as o, redispatchEvent as r, spread as s, throttle as t };
1180
+ //# sourceMappingURL=button-BtpAXuLN.js.map