@redvars/peacock 3.2.9 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PeacockComponent-CxJc63xj.js → IndividualComponent-tDnXrOLV.js} +3 -3
- package/dist/IndividualComponent-tDnXrOLV.js.map +1 -0
- package/dist/assets/tokens.css +2 -0
- package/dist/assets/tokens.css.map +1 -0
- package/dist/{button-2MeDq0Yy.js → button-BGFJfbT2.js} +23 -36
- package/dist/button-BGFJfbT2.js.map +1 -0
- package/dist/button-group.js +8 -8
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +6 -5
- package/dist/button.js.map +1 -1
- package/dist/chart-donut.js +307 -0
- package/dist/chart-donut.js.map +1 -0
- package/dist/chart-doughnut.js +307 -0
- package/dist/chart-doughnut.js.map +1 -0
- package/dist/chart-pie.js +259 -0
- package/dist/chart-pie.js.map +1 -0
- package/dist/{class-map-BvQRv7eW.js → class-map-DpeNtqCn.js} +2 -2
- package/dist/{class-map-BvQRv7eW.js.map → class-map-DpeNtqCn.js.map} +1 -1
- package/dist/clock.js +5 -6
- package/dist/clock.js.map +1 -1
- package/dist/code-editor.js +37 -24
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +21 -7
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +5377 -3122
- package/dist/custom-elements.json +5527 -3940
- package/dist/{dispatch-event-utils-vbdiOSeC.js → dispatch-event-utils-B4odODQf.js} +2 -15
- package/dist/dispatch-event-utils-B4odODQf.js.map +1 -0
- package/dist/index.js +13 -9
- package/dist/index.js.map +1 -1
- package/dist/number-counter.js +12 -10
- package/dist/number-counter.js.map +1 -1
- package/dist/{observe-theme-change-NneLARW8.js → observe-theme-change-BISF-Gl5.js} +2 -2
- package/dist/{observe-theme-change-NneLARW8.js.map → observe-theme-change-BISF-Gl5.js.map} +1 -1
- package/dist/peacock-loader.js +124 -62
- package/dist/peacock-loader.js.map +1 -1
- package/dist/query-QBcUV-L_.js +15 -0
- package/dist/query-QBcUV-L_.js.map +1 -0
- package/dist/{image-DK6VQW7N.js → slider-Dk9CFWTG.js} +1616 -331
- package/dist/slider-Dk9CFWTG.js.map +1 -0
- package/dist/src/IndividualComponent.d.ts +1 -0
- package/dist/src/accordion/{accordion-item/accordion-item.d.ts → accordion-item.d.ts} +4 -4
- package/dist/src/accordion/{accordion/accordion.d.ts → accordion.d.ts} +6 -6
- package/dist/src/accordion/{accordion-item/index.d.ts → index.d.ts} +1 -0
- package/dist/src/avatar/avatar.d.ts +2 -2
- package/dist/src/badge/badge.d.ts +2 -2
- package/dist/src/breadcrumb/breadcrumb/breadcrumb.d.ts +7 -8
- package/dist/src/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +3 -3
- package/dist/src/button/button/button.d.ts +2 -2
- package/dist/src/button/button-group/button-group.d.ts +5 -5
- package/dist/src/button/icon-button/icon-button.d.ts +2 -2
- package/dist/src/chart-donut/chart-donut.d.ts +53 -0
- package/dist/src/chart-donut/index.d.ts +1 -0
- package/dist/src/chart-doughnut/chart-doughnut.d.ts +53 -0
- package/dist/src/chart-doughnut/index.d.ts +1 -0
- package/dist/src/chart-pie/chart-pie.d.ts +50 -0
- package/dist/src/chart-pie/index.d.ts +1 -0
- package/dist/src/checkbox/checkbox.d.ts +3 -6
- package/dist/src/chip/chip/chip.d.ts +4 -4
- package/dist/src/chip/tag/tag.d.ts +3 -3
- package/dist/src/clock/clock.d.ts +3 -4
- package/dist/src/code-editor/code-editor.d.ts +11 -9
- package/dist/src/container/container.d.ts +6 -11
- package/dist/src/date-picker/date-picker.d.ts +3 -3
- package/dist/src/divider/divider.d.ts +2 -2
- package/dist/src/elevation/elevation.d.ts +2 -2
- package/dist/src/empty-state/empty-state.d.ts +9 -2
- package/dist/src/field/field.d.ts +17 -0
- package/dist/src/focus-ring/focus-ring.d.ts +1 -1
- package/dist/src/icon/icon.d.ts +2 -2
- package/dist/src/image/image.d.ts +4 -12
- package/dist/src/index.d.ts +5 -1
- package/dist/src/input/input.d.ts +2 -2
- package/dist/src/link/link.d.ts +4 -5
- package/dist/src/menu/menu/menu.d.ts +16 -0
- package/dist/src/menu/menu-item/menu-item.d.ts +12 -0
- package/dist/src/menu/menu-list/menu-list.d.ts +15 -0
- package/dist/src/number-counter/number-counter.d.ts +9 -7
- package/dist/src/number-field/number-field.d.ts +1 -1
- package/dist/src/popover/index.d.ts +1 -1
- package/dist/src/progress/circular-progress/circular-progress.d.ts +3 -3
- package/dist/src/progress/linear-progress/linear-progress.d.ts +3 -3
- package/dist/src/ripple/ripple.d.ts +60 -4
- package/dist/src/skeleton/skeleton.d.ts +6 -5
- package/dist/src/slider/index.d.ts +1 -0
- package/dist/src/slider/slider.d.ts +52 -0
- package/dist/src/spinner/spinner.d.ts +2 -2
- package/dist/src/switch/switch.d.ts +2 -2
- package/dist/src/tabs/index.d.ts +4 -0
- package/dist/src/tabs/tab-group.d.ts +41 -0
- package/dist/src/tabs/tab-panel.d.ts +21 -0
- package/dist/src/tabs/tab.d.ts +58 -0
- package/dist/src/tabs/tabs.d.ts +27 -0
- package/dist/src/textarea/textarea.d.ts +3 -3
- package/dist/src/time-picker/time-picker.d.ts +3 -3
- package/dist/src/{popover/tooltip → tooltip}/tooltip.d.ts +6 -3
- package/dist/{state-B09bP3XH.js → state-8v48Exzh.js} +2 -2
- package/dist/{state-B09bP3XH.js.map → state-8v48Exzh.js.map} +1 -1
- package/dist/{style-map-B8xgVEc9.js → style-map-CfNHEkQp.js} +2 -2
- package/dist/{style-map-B8xgVEc9.js.map → style-map-CfNHEkQp.js.map} +1 -1
- package/dist/transform-DRuHEvar.js +3312 -0
- package/dist/transform-DRuHEvar.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{unsafe-html-B-dV3Jps.js → unsafe-html-CV6Je6HL.js} +2 -2
- package/dist/{unsafe-html-B-dV3Jps.js.map → unsafe-html-CV6Je6HL.js.map} +1 -1
- package/package.json +3 -1
- package/readme.md +2 -2
- package/scss/tokens.scss +1 -0
- package/src/{PeacockComponent.ts → IndividualComponent.ts} +1 -1
- package/src/accordion/{accordion-item/accordion-item.scss → accordion-item.scss} +1 -1
- package/src/accordion/{accordion-item/accordion-item.ts → accordion-item.ts} +5 -5
- package/src/accordion/{accordion/accordion.scss → accordion.scss} +2 -1
- package/src/accordion/{accordion/accordion.ts → accordion.ts} +6 -6
- package/src/accordion/{accordion-item/index.ts → index.ts} +2 -0
- package/src/avatar/avatar.ts +2 -2
- package/src/badge/badge.ts +2 -2
- package/src/breadcrumb/breadcrumb/breadcrumb.ts +7 -8
- package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +3 -3
- package/src/button/BaseButton.ts +1 -1
- package/src/button/button/button.scss +10 -24
- package/src/button/button/button.ts +8 -8
- package/src/button/button-group/button-group.ts +7 -7
- package/src/button/icon-button/icon-button.ts +8 -8
- package/src/chart-donut/chart-donut.scss +37 -0
- package/src/chart-donut/chart-donut.ts +287 -0
- package/src/chart-donut/demo/index.html +51 -0
- package/src/chart-donut/index.ts +1 -0
- package/src/chart-doughnut/chart-donut.scss +37 -0
- package/src/chart-doughnut/chart-doughnut.ts +287 -0
- package/src/chart-doughnut/demo/index.html +51 -0
- package/src/chart-doughnut/index.ts +1 -0
- package/src/chart-pie/chart-pie.scss +27 -0
- package/src/chart-pie/chart-pie.ts +256 -0
- package/src/chart-pie/demo/index.html +51 -0
- package/src/chart-pie/index.ts +1 -0
- package/src/checkbox/checkbox.ts +3 -6
- package/src/chip/chip/chip.ts +6 -6
- package/src/chip/tag/tag.ts +6 -6
- package/src/clock/clock.ts +5 -6
- package/src/code-editor/code-editor.scss +3 -5
- package/src/code-editor/code-editor.ts +30 -15
- package/src/code-highlighter/code-highlighter.ts +19 -4
- package/src/container/container.ts +6 -11
- package/src/date-picker/date-picker.ts +7 -7
- package/src/divider/divider.ts +2 -2
- package/src/elevation/elevation.ts +2 -2
- package/src/empty-state/empty-state.ts +10 -3
- package/src/field/field.scss +4 -4
- package/src/field/field.ts +19 -2
- package/src/focus-ring/focus-ring.scss +2 -1
- package/src/focus-ring/focus-ring.ts +1 -1
- package/src/icon/icon.ts +2 -2
- package/src/icon/p-icon.ts +1 -1
- package/src/image/image.scss +55 -48
- package/src/image/image.ts +4 -12
- package/src/index.ts +6 -2
- package/src/input/input.ts +6 -6
- package/src/link/link.ts +4 -5
- package/src/menu/menu/menu.ts +16 -0
- package/src/menu/menu-item/menu-item-colors.scss +2 -2
- package/src/menu/menu-item/menu-item.ts +14 -2
- package/src/menu/menu-list/menu-list.ts +16 -1
- package/src/number-counter/demo/index.html +1 -1
- package/src/number-counter/number-counter.ts +11 -9
- package/src/number-field/number-field.ts +7 -7
- package/src/peacock-loader.ts +71 -44
- package/src/popover/index.ts +1 -1
- package/src/progress/circular-progress/circular-progress.scss +1 -1
- package/src/progress/circular-progress/circular-progress.ts +3 -3
- package/src/progress/linear-progress/linear-progress.ts +3 -3
- package/src/ripple/ripple.ts +478 -94
- package/src/skeleton/skeleton.ts +6 -5
- package/src/slider/index.ts +1 -0
- package/src/slider/slider.scss +130 -0
- package/src/slider/slider.ts +178 -0
- package/src/spinner/spinner.ts +2 -2
- package/src/switch/switch.ts +4 -4
- package/src/tabs/index.ts +4 -0
- package/src/tabs/tab-group.scss +10 -0
- package/src/tabs/tab-group.ts +137 -0
- package/src/tabs/tab-panel.scss +12 -0
- package/src/tabs/tab-panel.ts +28 -0
- package/src/tabs/tab.scss +157 -0
- package/src/tabs/tab.ts +242 -0
- package/src/tabs/tabs.scss +18 -0
- package/src/tabs/tabs.ts +64 -0
- package/src/textarea/textarea.ts +5 -5
- package/src/time-picker/time-picker.ts +7 -7
- package/src/{popover/tooltip → tooltip}/tooltip.scss +1 -1
- package/src/{popover/tooltip → tooltip}/tooltip.ts +10 -6
- package/dist/PeacockComponent-CxJc63xj.js.map +0 -1
- package/dist/button-2MeDq0Yy.js.map +0 -1
- package/dist/dispatch-event-utils-vbdiOSeC.js.map +0 -1
- package/dist/image-DK6VQW7N.js.map +0 -1
- package/dist/src/PeacockComponent.d.ts +0 -1
- package/dist/src/accordion/accordion/index.d.ts +0 -1
- package/dist/src/avatar/p-avatar.d.ts +0 -3
- package/dist/src/badge/p-badge.d.ts +0 -3
- package/src/accordion/accordion/index.ts +0 -1
- package/src/avatar/p-avatar.ts +0 -5
- package/src/badge/p-badge.ts +0 -5
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { i, _ as __decorate, n, a as i$1, b, c as __classPrivateFieldGet, A } from './
|
|
2
|
-
import { r } from './state-
|
|
1
|
+
import { i, _ as __decorate, n, a as i$1, b, c as __classPrivateFieldGet, A } from './IndividualComponent-tDnXrOLV.js';
|
|
2
|
+
import { r } from './state-8v48Exzh.js';
|
|
3
3
|
import { e as e$1 } from './directive-Cuw6h7YA.js';
|
|
4
|
-
import { e as e$2 } from './unsafe-html-
|
|
5
|
-
import {
|
|
6
|
-
import { e as e$3 } from './class-map-
|
|
7
|
-
import { c as css_248z$
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { e as e$2 } from './unsafe-html-CV6Je6HL.js';
|
|
5
|
+
import { c as createCacheFetch, s as sanitizeSvg, o as observerSlotChangesWithCallback, t as throttle, r as redispatchEvent, a as isDarkMode, i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-B4odODQf.js';
|
|
6
|
+
import { e as e$3 } from './class-map-DpeNtqCn.js';
|
|
7
|
+
import { c as css_248z$C, a as css_248z$D, b as BaseButton, s as spread } from './button-BGFJfbT2.js';
|
|
8
|
+
import { a as e, e as e$4 } from './query-QBcUV-L_.js';
|
|
9
|
+
import { o as o$3 } from './style-map-CfNHEkQp.js';
|
|
10
|
+
import { B as BaseInput, o as observeThemeChange } from './observe-theme-change-BISF-Gl5.js';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* @license
|
|
@@ -39,7 +40,7 @@ async function fetchIcon(name, provider = 'material-symbols') {
|
|
|
39
40
|
return fetchSVG(PROVIDERS[provider](name));
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
var css_248z$
|
|
43
|
+
var css_248z$B = i`* {
|
|
43
44
|
box-sizing: border-box;
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -69,7 +70,7 @@ var css_248z$w = i`* {
|
|
|
69
70
|
|
|
70
71
|
/**
|
|
71
72
|
* @label Icon
|
|
72
|
-
* @tag
|
|
73
|
+
* @tag wc-icon
|
|
73
74
|
* @rawTag icon
|
|
74
75
|
* @summary Icons are visual symbols used to represent ideas, objects, or actions.
|
|
75
76
|
* @overview Icons are visual symbols used to represent ideas, objects, or actions. They communicate messages at a glance, afford interactivity, and draw attention to important information.
|
|
@@ -79,7 +80,7 @@ var css_248z$w = i`* {
|
|
|
79
80
|
*
|
|
80
81
|
* @example
|
|
81
82
|
* ```html
|
|
82
|
-
* <
|
|
83
|
+
* <wc-icon name="home" style="--icon-size: 2rem;"></wc-icon>
|
|
83
84
|
* ```
|
|
84
85
|
*
|
|
85
86
|
*/
|
|
@@ -168,7 +169,7 @@ class Icon extends i$1 {
|
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
|
-
Icon.styles = [css_248z$
|
|
172
|
+
Icon.styles = [css_248z$B];
|
|
172
173
|
__decorate([
|
|
173
174
|
n({ type: String, reflect: true })
|
|
174
175
|
], Icon.prototype, "name", void 0);
|
|
@@ -188,7 +189,7 @@ __decorate([
|
|
|
188
189
|
r()
|
|
189
190
|
], Icon.prototype, "error", void 0);
|
|
190
191
|
|
|
191
|
-
var css_248z$
|
|
192
|
+
var css_248z$A = i`* {
|
|
192
193
|
box-sizing: border-box;
|
|
193
194
|
}
|
|
194
195
|
|
|
@@ -237,7 +238,7 @@ var css_248z$v = i`* {
|
|
|
237
238
|
|
|
238
239
|
/**
|
|
239
240
|
* @label Avatar
|
|
240
|
-
* @tag
|
|
241
|
+
* @tag wc-avatar
|
|
241
242
|
* @rawTag avatar
|
|
242
243
|
* @summary The Avatar component is used to represent user, and displays the profile picture, initials or fallback icon.
|
|
243
244
|
*
|
|
@@ -249,7 +250,7 @@ var css_248z$v = i`* {
|
|
|
249
250
|
*
|
|
250
251
|
* @example
|
|
251
252
|
* ```html
|
|
252
|
-
* <
|
|
253
|
+
* <wc-avatar name="Shivaji Varma" src="https://peacock.redvars.com/assets/img/avatar.xs.webp" style='--avatar-size: 4rem'></wc-avatar>
|
|
253
254
|
* ```
|
|
254
255
|
*
|
|
255
256
|
* @tags display
|
|
@@ -279,7 +280,7 @@ class Avatar extends i$1 {
|
|
|
279
280
|
return `${first.charAt(0)}${last.charAt(0)}`.toUpperCase();
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
|
-
Avatar.styles = [css_248z$
|
|
283
|
+
Avatar.styles = [css_248z$A];
|
|
283
284
|
__decorate([
|
|
284
285
|
n({ type: String, reflect: true })
|
|
285
286
|
], Avatar.prototype, "name", void 0);
|
|
@@ -287,7 +288,7 @@ __decorate([
|
|
|
287
288
|
n({ type: String, reflect: true })
|
|
288
289
|
], Avatar.prototype, "src", void 0);
|
|
289
290
|
|
|
290
|
-
var css_248z$
|
|
291
|
+
var css_248z$z = i`* {
|
|
291
292
|
box-sizing: border-box;
|
|
292
293
|
}
|
|
293
294
|
|
|
@@ -328,7 +329,7 @@ var css_248z$u = i`* {
|
|
|
328
329
|
|
|
329
330
|
/**
|
|
330
331
|
* @label Badge
|
|
331
|
-
* @tag
|
|
332
|
+
* @tag wc-badge
|
|
332
333
|
* @rawTag badge
|
|
333
334
|
* @summary The badge component is used to display a small amount of information to the user.
|
|
334
335
|
*
|
|
@@ -336,7 +337,7 @@ var css_248z$u = i`* {
|
|
|
336
337
|
*
|
|
337
338
|
* @example
|
|
338
339
|
* ```html
|
|
339
|
-
* <
|
|
340
|
+
* <wc-badge value="1"></wc-badge>
|
|
340
341
|
* ```
|
|
341
342
|
* @tags display
|
|
342
343
|
*/
|
|
@@ -359,12 +360,12 @@ class Badge extends i$1 {
|
|
|
359
360
|
</div>`;
|
|
360
361
|
}
|
|
361
362
|
}
|
|
362
|
-
Badge.styles = [css_248z$
|
|
363
|
+
Badge.styles = [css_248z$z];
|
|
363
364
|
__decorate([
|
|
364
365
|
n({ type: String })
|
|
365
366
|
], Badge.prototype, "value", void 0);
|
|
366
367
|
|
|
367
|
-
var css_248z$
|
|
368
|
+
var css_248z$y = i`* {
|
|
368
369
|
box-sizing: border-box;
|
|
369
370
|
}
|
|
370
371
|
|
|
@@ -428,7 +429,7 @@ var css_248z$t = i`* {
|
|
|
428
429
|
|
|
429
430
|
/**
|
|
430
431
|
* @label Divider
|
|
431
|
-
* @tag
|
|
432
|
+
* @tag wc-divider
|
|
432
433
|
* @rawTag divider
|
|
433
434
|
*
|
|
434
435
|
* @summary The divider component is used to visually separate content.
|
|
@@ -441,7 +442,7 @@ var css_248z$t = i`* {
|
|
|
441
442
|
*
|
|
442
443
|
* @example
|
|
443
444
|
* ```html
|
|
444
|
-
* <
|
|
445
|
+
* <wc-divider style="width: 12rem;">or</wc-divider>
|
|
445
446
|
* ```
|
|
446
447
|
* @tags display
|
|
447
448
|
*/
|
|
@@ -473,7 +474,7 @@ class Divider extends i$1 {
|
|
|
473
474
|
</div>`;
|
|
474
475
|
}
|
|
475
476
|
}
|
|
476
|
-
Divider.styles = [css_248z$
|
|
477
|
+
Divider.styles = [css_248z$y];
|
|
477
478
|
__decorate([
|
|
478
479
|
n({ type: Boolean, reflect: true })
|
|
479
480
|
], Divider.prototype, "vertical", void 0);
|
|
@@ -481,7 +482,7 @@ __decorate([
|
|
|
481
482
|
r()
|
|
482
483
|
], Divider.prototype, "slotHasContent", void 0);
|
|
483
484
|
|
|
484
|
-
var css_248z$
|
|
485
|
+
var css_248z$x = i`/**
|
|
485
486
|
* Derived from Material Design Elevation
|
|
486
487
|
* https://github.com/material-components/material-web/blob/main/elevation/internal/_elevation.scss
|
|
487
488
|
*/
|
|
@@ -529,7 +530,7 @@ var css_248z$s = i`/**
|
|
|
529
530
|
|
|
530
531
|
/**
|
|
531
532
|
* @label Elevation
|
|
532
|
-
* @tag
|
|
533
|
+
* @tag wc-elevation
|
|
533
534
|
* @rawTag elevation
|
|
534
535
|
*
|
|
535
536
|
* @summary Adds elevation to an element.
|
|
@@ -543,7 +544,7 @@ var css_248z$s = i`/**
|
|
|
543
544
|
* @example
|
|
544
545
|
* ```html
|
|
545
546
|
* <div style="position: relative; padding: var(--spacing-200);">
|
|
546
|
-
* <
|
|
547
|
+
* <wc-elevation style='--elevation-level: 2; --elevation-container-shape: var(--shape-corner-extra-small);'></wc-elevation>
|
|
547
548
|
* Level 2
|
|
548
549
|
* </div>
|
|
549
550
|
* ```
|
|
@@ -554,9 +555,9 @@ class Elevation extends i$1 {
|
|
|
554
555
|
return b `<span class="shadow"></span>`;
|
|
555
556
|
}
|
|
556
557
|
}
|
|
557
|
-
Elevation.styles = [css_248z$
|
|
558
|
+
Elevation.styles = [css_248z$x];
|
|
558
559
|
|
|
559
|
-
var css_248z$
|
|
560
|
+
var css_248z$w = i`.button {
|
|
560
561
|
--_container-padding: 0.75rem;
|
|
561
562
|
width: var(--_button-height);
|
|
562
563
|
--_container-padding: 0;
|
|
@@ -595,7 +596,7 @@ var css_248z$r = i`.button {
|
|
|
595
596
|
var _IconButton_id, _IconButton_tabindex;
|
|
596
597
|
/**
|
|
597
598
|
* @label Icon Button
|
|
598
|
-
* @tag icon-button
|
|
599
|
+
* @tag wc-icon-button
|
|
599
600
|
* @rawTag icon-button
|
|
600
601
|
*
|
|
601
602
|
* @summary Icon buttons allow users to take actions, and make choices, with a single tap.
|
|
@@ -632,7 +633,7 @@ var _IconButton_id, _IconButton_tabindex;
|
|
|
632
633
|
*
|
|
633
634
|
* @example
|
|
634
635
|
* ```html
|
|
635
|
-
* <icon-button name="home"></icon-button>
|
|
636
|
+
* <wc-icon-button name="home"></wc-icon-button>
|
|
636
637
|
* ```
|
|
637
638
|
* @tags display
|
|
638
639
|
*/
|
|
@@ -704,20 +705,20 @@ class IconButton extends BaseButton {
|
|
|
704
705
|
}
|
|
705
706
|
renderButtonContent() {
|
|
706
707
|
return b `
|
|
707
|
-
<focus-ring class="focus-ring" .control=${this} element="buttonElement"></focus-ring>
|
|
708
|
-
<
|
|
708
|
+
<wc-focus-ring class="focus-ring" .control=${this} element="buttonElement"></wc-focus-ring>
|
|
709
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
709
710
|
<div class="neo-background"></div>
|
|
710
711
|
<div class="background"></div>
|
|
711
712
|
<div class="outline"></div>
|
|
712
|
-
<
|
|
713
|
-
<
|
|
713
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
714
|
+
<wc-skeleton class="skeleton"></wc-skeleton>
|
|
714
715
|
|
|
715
716
|
<div class="button-content">
|
|
716
|
-
<
|
|
717
|
+
<wc-icon
|
|
717
718
|
name=${this.name}
|
|
718
719
|
src=${this.src}
|
|
719
720
|
provider=${this.provider}
|
|
720
|
-
></
|
|
721
|
+
></wc-icon>
|
|
721
722
|
</div>
|
|
722
723
|
|
|
723
724
|
${this.__renderDisabledReason()}
|
|
@@ -725,7 +726,7 @@ class IconButton extends BaseButton {
|
|
|
725
726
|
}
|
|
726
727
|
}
|
|
727
728
|
_IconButton_id = new WeakMap(), _IconButton_tabindex = new WeakMap();
|
|
728
|
-
IconButton.styles = [css_248z$
|
|
729
|
+
IconButton.styles = [css_248z$C, css_248z$D, css_248z$w];
|
|
729
730
|
__decorate([
|
|
730
731
|
n({ type: String, reflect: true })
|
|
731
732
|
], IconButton.prototype, "name", void 0);
|
|
@@ -736,7 +737,7 @@ __decorate([
|
|
|
736
737
|
n({ type: String })
|
|
737
738
|
], IconButton.prototype, "provider", void 0);
|
|
738
739
|
|
|
739
|
-
var css_248z$
|
|
740
|
+
var css_248z$v = i`:host {
|
|
740
741
|
display: none;
|
|
741
742
|
pointer-events: none;
|
|
742
743
|
position: absolute;
|
|
@@ -745,6 +746,7 @@ var css_248z$q = i`:host {
|
|
|
745
746
|
border-end-start-radius: var(--focus-ring-container-shape-end-start);
|
|
746
747
|
border-end-end-radius: var(--focus-ring-container-shape-end-end);
|
|
747
748
|
corner-shape: var(--focus-ring-container-shape-variant);
|
|
749
|
+
--focus-ring-color: var(--color-primary);
|
|
748
750
|
inset: calc(-1 * var(--focus-ring-inset, 2px));
|
|
749
751
|
animation-delay: 0s, calc(var(--focus-ring-duration, 600ms) * 0.25);
|
|
750
752
|
animation-duration: calc(var(--focus-ring-duration, 600ms) * 0.25), calc(var(--focus-ring-duration, 600ms) * 0.75);
|
|
@@ -754,13 +756,13 @@ var css_248z$q = i`:host {
|
|
|
754
756
|
|
|
755
757
|
:host([visible]) {
|
|
756
758
|
display: flex;
|
|
757
|
-
outline: 3px solid var(--color
|
|
759
|
+
outline: 3px solid var(--focus-ring-color);
|
|
758
760
|
}`;
|
|
759
761
|
|
|
760
762
|
/**
|
|
761
763
|
* @label Focus Ring
|
|
762
764
|
*
|
|
763
|
-
* @tag focus-ring
|
|
765
|
+
* @tag wc-focus-ring
|
|
764
766
|
* @rawTag focus-ring
|
|
765
767
|
*
|
|
766
768
|
* @summary Adds a focus ring to an element.
|
|
@@ -830,7 +832,7 @@ class FocusRing extends i$1 {
|
|
|
830
832
|
this._control = undefined;
|
|
831
833
|
}
|
|
832
834
|
}
|
|
833
|
-
FocusRing.styles = [css_248z$
|
|
835
|
+
FocusRing.styles = [css_248z$v];
|
|
834
836
|
__decorate([
|
|
835
837
|
n({ type: Boolean, reflect: true })
|
|
836
838
|
], FocusRing.prototype, "visible", void 0);
|
|
@@ -838,151 +840,460 @@ __decorate([
|
|
|
838
840
|
n({ type: String })
|
|
839
841
|
], FocusRing.prototype, "element", void 0);
|
|
840
842
|
|
|
843
|
+
const PRESS_GROW_MS = 450;
|
|
844
|
+
const MINIMUM_PRESS_MS = 225;
|
|
845
|
+
const INITIAL_ORIGIN_SCALE = 0.2;
|
|
846
|
+
const PADDING = 10;
|
|
847
|
+
const SOFT_EDGE_MINIMUM_SIZE = 75;
|
|
848
|
+
const SOFT_EDGE_CONTAINER_RATIO = 0.35;
|
|
849
|
+
const PRESS_PSEUDO = '::after';
|
|
850
|
+
const ANIMATION_FILL = 'forwards';
|
|
851
|
+
/**
|
|
852
|
+
* Interaction states for the ripple.
|
|
853
|
+
*
|
|
854
|
+
* On Touch:
|
|
855
|
+
* - `INACTIVE -> TOUCH_DELAY -> WAITING_FOR_CLICK -> INACTIVE`
|
|
856
|
+
*
|
|
857
|
+
* On Mouse or Pen:
|
|
858
|
+
* - `INACTIVE -> WAITING_FOR_CLICK -> INACTIVE`
|
|
859
|
+
*/
|
|
860
|
+
var State;
|
|
861
|
+
(function (State) {
|
|
862
|
+
/**
|
|
863
|
+
* Initial state of the control, no touch in progress.
|
|
864
|
+
*
|
|
865
|
+
* Transitions:
|
|
866
|
+
* - on touch down: transition to `TOUCH_DELAY`.
|
|
867
|
+
* - on mouse down: transition to `WAITING_FOR_CLICK`.
|
|
868
|
+
*/
|
|
869
|
+
State[State["INACTIVE"] = 0] = "INACTIVE";
|
|
870
|
+
/**
|
|
871
|
+
* Touch down has been received, waiting to determine if it's a swipe or
|
|
872
|
+
* scroll.
|
|
873
|
+
*
|
|
874
|
+
* Transitions:
|
|
875
|
+
* - on touch up: begin press; transition to `WAITING_FOR_CLICK`.
|
|
876
|
+
* - on cancel: transition to `INACTIVE`.
|
|
877
|
+
* - after `TOUCH_DELAY_MS`: begin press; transition to `HOLDING`.
|
|
878
|
+
*/
|
|
879
|
+
State[State["TOUCH_DELAY"] = 1] = "TOUCH_DELAY";
|
|
880
|
+
/**
|
|
881
|
+
* A touch has been deemed to be a press
|
|
882
|
+
*
|
|
883
|
+
* Transitions:
|
|
884
|
+
* - on up: transition to `WAITING_FOR_CLICK`.
|
|
885
|
+
*/
|
|
886
|
+
State[State["HOLDING"] = 2] = "HOLDING";
|
|
887
|
+
/**
|
|
888
|
+
* The user touch has finished, transition into rest state.
|
|
889
|
+
*
|
|
890
|
+
* Transitions:
|
|
891
|
+
* - on click end press; transition to `INACTIVE`.
|
|
892
|
+
*/
|
|
893
|
+
State[State["WAITING_FOR_CLICK"] = 3] = "WAITING_FOR_CLICK";
|
|
894
|
+
})(State || (State = {}));
|
|
895
|
+
/**
|
|
896
|
+
* Events that the ripple listens to.
|
|
897
|
+
*/
|
|
898
|
+
const EVENTS = [
|
|
899
|
+
'click',
|
|
900
|
+
'contextmenu',
|
|
901
|
+
'pointercancel',
|
|
902
|
+
'pointerdown',
|
|
903
|
+
'pointerenter',
|
|
904
|
+
'pointerleave',
|
|
905
|
+
'pointerup',
|
|
906
|
+
];
|
|
907
|
+
/**
|
|
908
|
+
* Delay reacting to touch so that we do not show the ripple for a swipe or
|
|
909
|
+
* scroll interaction.
|
|
910
|
+
*/
|
|
911
|
+
const TOUCH_DELAY_MS = 150;
|
|
912
|
+
/**
|
|
913
|
+
* Used to detect if HCM is active. Events do not process during HCM when the
|
|
914
|
+
* ripple is not displayed.
|
|
915
|
+
*/
|
|
916
|
+
const FORCED_COLORS = window.matchMedia('(forced-colors: active)');
|
|
917
|
+
/**
|
|
918
|
+
* @label Ripple
|
|
919
|
+
* @tag wc-ripple
|
|
920
|
+
* @rawTag ripple
|
|
921
|
+
*
|
|
922
|
+
* @summary Provides ripple effect for interactive elements.
|
|
923
|
+
* @overview
|
|
924
|
+
* <p>Ripple creates a visual feedback effect when users interact with buttons or other clickable elements.</p>
|
|
925
|
+
*
|
|
926
|
+
* @example
|
|
927
|
+
* ```html
|
|
928
|
+
* <button style="position: relative;">
|
|
929
|
+
* <wc-ripple></wc-ripple>
|
|
930
|
+
* Click me
|
|
931
|
+
* </button>
|
|
932
|
+
* ```
|
|
933
|
+
* @tags display
|
|
934
|
+
*/
|
|
841
935
|
class Ripple extends i$1 {
|
|
842
936
|
constructor() {
|
|
843
937
|
super(...arguments);
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
const x = event.clientX - rect.left;
|
|
855
|
-
const y = event.clientY - rect.top;
|
|
856
|
-
// 3. Create the ripple element
|
|
857
|
-
// We create this manually to avoid triggering a full Lit render cycle
|
|
858
|
-
// for a transient, fire-and-forget animation.
|
|
859
|
-
const ripple = document.createElement('div');
|
|
860
|
-
ripple.classList.add('ripple-effect');
|
|
861
|
-
ripple.style.width = `${diameter}px`;
|
|
862
|
-
ripple.style.height = `${diameter}px`;
|
|
863
|
-
ripple.style.left = `${x - radius}px`;
|
|
864
|
-
ripple.style.top = `${y - radius}px`;
|
|
865
|
-
// 4. Append to Shadow DOM
|
|
866
|
-
this.renderRoot.appendChild(ripple);
|
|
867
|
-
// 5. Cleanup
|
|
868
|
-
ripple.addEventListener('animationend', () => {
|
|
869
|
-
ripple.remove();
|
|
870
|
-
});
|
|
871
|
-
};
|
|
938
|
+
/**
|
|
939
|
+
* Disables the ripple.
|
|
940
|
+
*/
|
|
941
|
+
this.disabled = false;
|
|
942
|
+
this.hovered = false;
|
|
943
|
+
this.pressed = false;
|
|
944
|
+
this.rippleSize = '';
|
|
945
|
+
this.rippleScale = '';
|
|
946
|
+
this.initialSize = 0;
|
|
947
|
+
this.state = State.INACTIVE;
|
|
872
948
|
}
|
|
873
949
|
connectedCallback() {
|
|
874
950
|
super.connectedCallback();
|
|
875
|
-
//
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
951
|
+
// Needed for VoiceOver, which will create a "group" if the element is a
|
|
952
|
+
// sibling to other content.
|
|
953
|
+
this.setAttribute('aria-hidden', 'true');
|
|
954
|
+
// Attach to parent
|
|
955
|
+
this.attach(this.parentElement);
|
|
879
956
|
}
|
|
880
957
|
disconnectedCallback() {
|
|
881
958
|
super.disconnectedCallback();
|
|
882
|
-
|
|
883
|
-
|
|
959
|
+
this.detach();
|
|
960
|
+
}
|
|
961
|
+
attach(control) {
|
|
962
|
+
if (!control)
|
|
963
|
+
return;
|
|
964
|
+
EVENTS.forEach(event => {
|
|
965
|
+
control.addEventListener(event, this.handleEvent.bind(this));
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
detach() {
|
|
969
|
+
const control = this.parentElement;
|
|
970
|
+
if (!control)
|
|
971
|
+
return;
|
|
972
|
+
EVENTS.forEach(event => {
|
|
973
|
+
control.removeEventListener(event, this.handleEvent.bind(this));
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
render() {
|
|
977
|
+
const classes = {
|
|
978
|
+
'hovered': this.hovered,
|
|
979
|
+
'pressed': this.pressed,
|
|
980
|
+
};
|
|
981
|
+
return b `<div class="surface ${e$3(classes)}"></div>`;
|
|
982
|
+
}
|
|
983
|
+
update(changedProps) {
|
|
984
|
+
if (changedProps.has('disabled') && this.disabled) {
|
|
985
|
+
this.hovered = false;
|
|
986
|
+
this.pressed = false;
|
|
884
987
|
}
|
|
988
|
+
super.update(changedProps);
|
|
885
989
|
}
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
if (!parent)
|
|
990
|
+
handlePointerenter(event) {
|
|
991
|
+
if (!this.shouldReactToEvent(event)) {
|
|
889
992
|
return;
|
|
890
|
-
// 1. Force parent to be relative so we can position absolutely inside it
|
|
891
|
-
const style = window.getComputedStyle(parent);
|
|
892
|
-
if (style.position === 'static') {
|
|
893
|
-
parent.style.position = 'relative';
|
|
894
993
|
}
|
|
895
|
-
|
|
896
|
-
parent.addEventListener('pointerdown', this._createRipple);
|
|
994
|
+
this.hovered = true;
|
|
897
995
|
}
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
996
|
+
handlePointerleave(event) {
|
|
997
|
+
if (!this.shouldReactToEvent(event)) {
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
this.hovered = false;
|
|
1001
|
+
// release a held mouse or pen press that moves outside the element
|
|
1002
|
+
if (this.state !== State.INACTIVE) {
|
|
1003
|
+
this.endPressAnimation();
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
handlePointerup(event) {
|
|
1007
|
+
if (!this.shouldReactToEvent(event)) {
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
if (this.state === State.HOLDING) {
|
|
1011
|
+
this.state = State.WAITING_FOR_CLICK;
|
|
1012
|
+
return;
|
|
1013
|
+
}
|
|
1014
|
+
if (this.state === State.TOUCH_DELAY) {
|
|
1015
|
+
this.state = State.WAITING_FOR_CLICK;
|
|
1016
|
+
this.startPressAnimation(this.rippleStartEvent);
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
async handlePointerdown(event) {
|
|
1021
|
+
if (!this.shouldReactToEvent(event)) {
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
this.rippleStartEvent = event;
|
|
1025
|
+
if (!this.isTouch(event)) {
|
|
1026
|
+
this.state = State.WAITING_FOR_CLICK;
|
|
1027
|
+
this.startPressAnimation(event);
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
// Wait for a hold after touch delay
|
|
1031
|
+
this.state = State.TOUCH_DELAY;
|
|
1032
|
+
await new Promise((resolve) => {
|
|
1033
|
+
setTimeout(resolve, TOUCH_DELAY_MS);
|
|
1034
|
+
});
|
|
1035
|
+
if (this.state !== State.TOUCH_DELAY) {
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
this.state = State.HOLDING;
|
|
1039
|
+
this.startPressAnimation(event);
|
|
1040
|
+
}
|
|
1041
|
+
handleClick() {
|
|
1042
|
+
if (this.disabled) {
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
if (this.state === State.WAITING_FOR_CLICK) {
|
|
1046
|
+
this.endPressAnimation();
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
if (this.state === State.INACTIVE) {
|
|
1050
|
+
// keyboard synthesized click event
|
|
1051
|
+
this.startPressAnimation();
|
|
1052
|
+
this.endPressAnimation();
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
handlePointercancel(event) {
|
|
1056
|
+
if (!this.shouldReactToEvent(event)) {
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
this.endPressAnimation();
|
|
1060
|
+
}
|
|
1061
|
+
handleContextmenu() {
|
|
1062
|
+
if (this.disabled) {
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
this.endPressAnimation();
|
|
1066
|
+
}
|
|
1067
|
+
determineRippleSize() {
|
|
1068
|
+
const { height, width } = this.getBoundingClientRect();
|
|
1069
|
+
const maxDim = Math.max(height, width);
|
|
1070
|
+
const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDim, SOFT_EDGE_MINIMUM_SIZE);
|
|
1071
|
+
const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);
|
|
1072
|
+
const hypotenuse = Math.sqrt(width ** 2 + height ** 2);
|
|
1073
|
+
const maxRadius = hypotenuse + PADDING;
|
|
1074
|
+
this.initialSize = initialSize;
|
|
1075
|
+
const maybeZoomedScale = (maxRadius + softEdgeSize) / initialSize;
|
|
1076
|
+
this.rippleScale = `${maybeZoomedScale}`;
|
|
1077
|
+
this.rippleSize = `${initialSize}px`;
|
|
1078
|
+
}
|
|
1079
|
+
getTranslationCoordinates(positionEvent) {
|
|
1080
|
+
const { height, width } = this.getBoundingClientRect();
|
|
1081
|
+
// end in the center
|
|
1082
|
+
const endPoint = {
|
|
1083
|
+
x: (width - this.initialSize) / 2,
|
|
1084
|
+
y: (height - this.initialSize) / 2,
|
|
1085
|
+
};
|
|
1086
|
+
let startPoint;
|
|
1087
|
+
if (positionEvent instanceof PointerEvent) {
|
|
1088
|
+
startPoint = this.getNormalizedPointerEventCoords(positionEvent);
|
|
1089
|
+
}
|
|
1090
|
+
else {
|
|
1091
|
+
startPoint = {
|
|
1092
|
+
x: width / 2,
|
|
1093
|
+
y: height / 2,
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
// center around start point
|
|
1097
|
+
startPoint = {
|
|
1098
|
+
x: startPoint.x - this.initialSize / 2,
|
|
1099
|
+
y: startPoint.y - this.initialSize / 2,
|
|
1100
|
+
};
|
|
1101
|
+
return { startPoint, endPoint };
|
|
1102
|
+
}
|
|
1103
|
+
startPressAnimation(positionEvent) {
|
|
1104
|
+
if (!this.mdRoot) {
|
|
1105
|
+
return;
|
|
1106
|
+
}
|
|
1107
|
+
this.pressed = true;
|
|
1108
|
+
this.growAnimation?.cancel();
|
|
1109
|
+
this.determineRippleSize();
|
|
1110
|
+
const { startPoint, endPoint } = this.getTranslationCoordinates(positionEvent);
|
|
1111
|
+
const translateStart = `${startPoint.x}px, ${startPoint.y}px`;
|
|
1112
|
+
const translateEnd = `${endPoint.x}px, ${endPoint.y}px`;
|
|
1113
|
+
this.growAnimation = this.mdRoot.animate({
|
|
1114
|
+
top: [0, 0],
|
|
1115
|
+
left: [0, 0],
|
|
1116
|
+
height: [this.rippleSize, this.rippleSize],
|
|
1117
|
+
width: [this.rippleSize, this.rippleSize],
|
|
1118
|
+
transform: [
|
|
1119
|
+
`translate(${translateStart}) scale(1)`,
|
|
1120
|
+
`translate(${translateEnd}) scale(${this.rippleScale})`,
|
|
1121
|
+
],
|
|
1122
|
+
}, {
|
|
1123
|
+
pseudoElement: PRESS_PSEUDO,
|
|
1124
|
+
duration: PRESS_GROW_MS,
|
|
1125
|
+
easing: 'cubic-bezier(0.2, 0, 0, 1)',
|
|
1126
|
+
fill: ANIMATION_FILL,
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
async endPressAnimation() {
|
|
1130
|
+
this.rippleStartEvent = undefined;
|
|
1131
|
+
this.state = State.INACTIVE;
|
|
1132
|
+
const animation = this.growAnimation;
|
|
1133
|
+
let pressAnimationPlayState = Infinity;
|
|
1134
|
+
if (typeof animation?.currentTime === 'number') {
|
|
1135
|
+
pressAnimationPlayState = animation.currentTime;
|
|
1136
|
+
}
|
|
1137
|
+
else if (animation?.currentTime) {
|
|
1138
|
+
pressAnimationPlayState = animation.currentTime.to('ms').value;
|
|
1139
|
+
}
|
|
1140
|
+
if (pressAnimationPlayState >= MINIMUM_PRESS_MS) {
|
|
1141
|
+
this.pressed = false;
|
|
1142
|
+
return;
|
|
1143
|
+
}
|
|
1144
|
+
await new Promise((resolve) => {
|
|
1145
|
+
setTimeout(resolve, MINIMUM_PRESS_MS - pressAnimationPlayState);
|
|
1146
|
+
});
|
|
1147
|
+
if (this.growAnimation !== animation) {
|
|
1148
|
+
// A new press animation was started. The old animation was canceled and
|
|
1149
|
+
// should not finish the pressed state.
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1152
|
+
this.pressed = false;
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Returns `true` if
|
|
1156
|
+
* - the ripple element is enabled
|
|
1157
|
+
* - the pointer is primary for the input type
|
|
1158
|
+
* - the pointer is the pointer that started the interaction, or will start
|
|
1159
|
+
* the interaction
|
|
1160
|
+
* - the pointer is a touch, or the pointer state has the primary button
|
|
1161
|
+
* held, or the pointer is hovering
|
|
1162
|
+
*/
|
|
1163
|
+
shouldReactToEvent(event) {
|
|
1164
|
+
if (this.disabled || !event.isPrimary) {
|
|
1165
|
+
return false;
|
|
1166
|
+
}
|
|
1167
|
+
if (this.rippleStartEvent &&
|
|
1168
|
+
this.rippleStartEvent.pointerId !== event.pointerId) {
|
|
1169
|
+
return false;
|
|
1170
|
+
}
|
|
1171
|
+
if (event.type === 'pointerenter' || event.type === 'pointerleave') {
|
|
1172
|
+
return !this.isTouch(event);
|
|
1173
|
+
}
|
|
1174
|
+
const isPrimaryButton = event.buttons === 1;
|
|
1175
|
+
return this.isTouch(event) || isPrimaryButton;
|
|
1176
|
+
}
|
|
1177
|
+
isTouch({ pointerType }) {
|
|
1178
|
+
return pointerType === 'touch';
|
|
1179
|
+
}
|
|
1180
|
+
async handleEvent(event) {
|
|
1181
|
+
if (FORCED_COLORS?.matches) {
|
|
1182
|
+
// Skip event logic since the ripple is `display: none`.
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
switch (event.type) {
|
|
1186
|
+
case 'click':
|
|
1187
|
+
this.handleClick();
|
|
1188
|
+
break;
|
|
1189
|
+
case 'contextmenu':
|
|
1190
|
+
this.handleContextmenu();
|
|
1191
|
+
break;
|
|
1192
|
+
case 'pointercancel':
|
|
1193
|
+
this.handlePointercancel(event);
|
|
1194
|
+
break;
|
|
1195
|
+
case 'pointerdown':
|
|
1196
|
+
await this.handlePointerdown(event);
|
|
1197
|
+
break;
|
|
1198
|
+
case 'pointerenter':
|
|
1199
|
+
this.handlePointerenter(event);
|
|
1200
|
+
break;
|
|
1201
|
+
case 'pointerleave':
|
|
1202
|
+
this.handlePointerleave(event);
|
|
1203
|
+
break;
|
|
1204
|
+
case 'pointerup':
|
|
1205
|
+
this.handlePointerup(event);
|
|
1206
|
+
break;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
getNormalizedPointerEventCoords(pointerEvent) {
|
|
1210
|
+
const { scrollX, scrollY } = window;
|
|
1211
|
+
const { left, top } = this.getBoundingClientRect();
|
|
1212
|
+
const documentX = scrollX + left;
|
|
1213
|
+
const documentY = scrollY + top;
|
|
1214
|
+
const { pageX, pageY } = pointerEvent;
|
|
1215
|
+
return {
|
|
1216
|
+
x: pageX - documentX,
|
|
1217
|
+
y: pageY - documentY,
|
|
1218
|
+
};
|
|
901
1219
|
}
|
|
902
1220
|
}
|
|
903
1221
|
Ripple.styles = i `
|
|
904
1222
|
:host {
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
pointer-events: none;
|
|
908
|
-
overflow: hidden;
|
|
909
|
-
border-radius: inherit; /* Inherit parent's rounded corners */
|
|
910
|
-
z-index: 0;
|
|
911
|
-
--ripple-state-opacity: 0;
|
|
912
|
-
--ripple-pressed-color: var(--color-on-surface);
|
|
1223
|
+
display: flex;
|
|
1224
|
+
margin: auto;
|
|
1225
|
+
pointer-events: none;
|
|
913
1226
|
}
|
|
914
1227
|
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
pointer-events: none;
|
|
919
|
-
position: absolute;
|
|
1228
|
+
:host([disabled]) {
|
|
1229
|
+
display: none;
|
|
1230
|
+
}
|
|
920
1231
|
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
background-color 15ms linear;
|
|
1232
|
+
@media (forced-colors: active) {
|
|
1233
|
+
:host {
|
|
1234
|
+
display: none;
|
|
1235
|
+
}
|
|
926
1236
|
}
|
|
927
1237
|
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
position: absolute;
|
|
933
|
-
background: radial-gradient(
|
|
934
|
-
closest-side,
|
|
935
|
-
var(--ripple-pressed-color) max(100% - 70px, 65%),
|
|
936
|
-
transparent 100%
|
|
937
|
-
);
|
|
938
|
-
transform-origin: center center;
|
|
939
|
-
transition: opacity 375ms linear;
|
|
940
|
-
|
|
941
|
-
width: 25px;
|
|
942
|
-
top: 0px;
|
|
943
|
-
transform: translate(51.4375px, 7.5px) scale(8.75941);
|
|
944
|
-
left: 0px;
|
|
945
|
-
height: 25px;
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
.ripple-effect {
|
|
1238
|
+
:host,
|
|
1239
|
+
.surface {
|
|
1240
|
+
border-radius: inherit;
|
|
1241
|
+
corner-shape: inherit;
|
|
949
1242
|
position: absolute;
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
opacity: 0.12; /* Material 3 State Layer Opacity */
|
|
953
|
-
transform: scale(0);
|
|
954
|
-
animation: ripple-anim 600ms linear forwards;
|
|
1243
|
+
inset: 0;
|
|
1244
|
+
overflow: hidden;
|
|
955
1245
|
}
|
|
956
1246
|
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1247
|
+
.surface {
|
|
1248
|
+
-webkit-tap-highlight-color: transparent;
|
|
1249
|
+
|
|
1250
|
+
&::before,
|
|
1251
|
+
&::after {
|
|
1252
|
+
content: '';
|
|
960
1253
|
opacity: 0;
|
|
1254
|
+
position: absolute;
|
|
961
1255
|
}
|
|
962
|
-
}
|
|
963
|
-
`;
|
|
964
|
-
|
|
965
|
-
var css_248z$p = i`* {
|
|
966
|
-
box-sizing: border-box;
|
|
967
|
-
}
|
|
968
1256
|
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1257
|
+
&::before {
|
|
1258
|
+
background-color: var(--ripple-pressed-color, var(--color-on-surface));
|
|
1259
|
+
inset: 0;
|
|
1260
|
+
transition: opacity 15ms linear, background-color 15ms linear;
|
|
1261
|
+
}
|
|
972
1262
|
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1263
|
+
&::after {
|
|
1264
|
+
background: radial-gradient(
|
|
1265
|
+
closest-side,
|
|
1266
|
+
var(--ripple-pressed-color, var(--color-on-surface)) max(calc(100% - 70px), 65%),
|
|
1267
|
+
transparent 100%
|
|
1268
|
+
);
|
|
1269
|
+
transform-origin: center center;
|
|
1270
|
+
transition: opacity 375ms linear;
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
976
1273
|
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
}
|
|
1274
|
+
.hovered::before {
|
|
1275
|
+
opacity: 0.08;
|
|
1276
|
+
}
|
|
980
1277
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1278
|
+
.pressed::after {
|
|
1279
|
+
opacity: 0.12;
|
|
1280
|
+
transition-duration: 105ms;
|
|
1281
|
+
}
|
|
1282
|
+
`;
|
|
1283
|
+
__decorate([
|
|
1284
|
+
n({ type: Boolean, reflect: true })
|
|
1285
|
+
], Ripple.prototype, "disabled", void 0);
|
|
1286
|
+
__decorate([
|
|
1287
|
+
r()
|
|
1288
|
+
], Ripple.prototype, "hovered", void 0);
|
|
1289
|
+
__decorate([
|
|
1290
|
+
r()
|
|
1291
|
+
], Ripple.prototype, "pressed", void 0);
|
|
1292
|
+
__decorate([
|
|
1293
|
+
e$4('.surface')
|
|
1294
|
+
], Ripple.prototype, "mdRoot", void 0);
|
|
984
1295
|
|
|
985
|
-
var css_248z$
|
|
1296
|
+
var css_248z$u = i`* {
|
|
986
1297
|
box-sizing: border-box;
|
|
987
1298
|
}
|
|
988
1299
|
|
|
@@ -1072,15 +1383,15 @@ var css_248z$o = i`* {
|
|
|
1072
1383
|
var _AccordionItem_id;
|
|
1073
1384
|
/**
|
|
1074
1385
|
* @label Accordion Item
|
|
1075
|
-
* @tag accordion-item
|
|
1076
|
-
* @rawTag accordion
|
|
1386
|
+
* @tag wc-accordion-item
|
|
1387
|
+
* @rawTag accordion-item
|
|
1077
1388
|
* @summary An accordion item is single item in an accordion list. It contains a header and a content section that can be expanded or collapsed by the user.
|
|
1078
1389
|
*
|
|
1079
1390
|
* @example
|
|
1080
1391
|
* ```html
|
|
1081
|
-
* <
|
|
1392
|
+
* <wc-accordion-item>
|
|
1082
1393
|
* Testing
|
|
1083
|
-
* </accordion-item>
|
|
1394
|
+
* </wc-accordion-item>
|
|
1084
1395
|
* ```
|
|
1085
1396
|
* @tags display
|
|
1086
1397
|
*/
|
|
@@ -1134,7 +1445,7 @@ class AccordionItem extends i$1 {
|
|
|
1134
1445
|
@click=${this.__handleToggle}
|
|
1135
1446
|
aria-expanded=${this.open}
|
|
1136
1447
|
>
|
|
1137
|
-
<
|
|
1448
|
+
<wc-icon class="accordion-icon" name="keyboard_arrow_down"></wc-icon>
|
|
1138
1449
|
<div part="title" class="accordion-title">
|
|
1139
1450
|
<slot name="heading">${this.heading}</slot>
|
|
1140
1451
|
</div>
|
|
@@ -1151,7 +1462,7 @@ class AccordionItem extends i$1 {
|
|
|
1151
1462
|
}
|
|
1152
1463
|
}
|
|
1153
1464
|
_AccordionItem_id = new WeakMap();
|
|
1154
|
-
AccordionItem.styles = [css_248z$
|
|
1465
|
+
AccordionItem.styles = [css_248z$u];
|
|
1155
1466
|
__decorate([
|
|
1156
1467
|
n({ type: String, reflect: true })
|
|
1157
1468
|
], AccordionItem.prototype, "heading", void 0);
|
|
@@ -1165,19 +1476,40 @@ __decorate([
|
|
|
1165
1476
|
e$4('.accordion-heading')
|
|
1166
1477
|
], AccordionItem.prototype, "buttonElement", void 0);
|
|
1167
1478
|
|
|
1479
|
+
var css_248z$t = i`* {
|
|
1480
|
+
box-sizing: border-box;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
.screen-reader-only {
|
|
1484
|
+
display: none !important;
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
:host {
|
|
1488
|
+
display: block;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
slot::slotted(:not(:last-child)) {
|
|
1492
|
+
border-block-start: 1px solid var(--color-outline);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
slot::slotted(:last-child) {
|
|
1496
|
+
border-block-start: 1px solid var(--color-outline);
|
|
1497
|
+
border-block-end: 1px solid var(--color-outline);
|
|
1498
|
+
}`;
|
|
1499
|
+
|
|
1168
1500
|
/**
|
|
1169
1501
|
* @label Accordion
|
|
1170
|
-
* @tag
|
|
1502
|
+
* @tag wc-accordion
|
|
1171
1503
|
* @rawTag accordion
|
|
1172
1504
|
* @summary An accordion is a vertically stacked list of headers that reveal or hide associated sections of content.
|
|
1173
1505
|
*
|
|
1174
1506
|
* @example
|
|
1175
1507
|
* ```html
|
|
1176
|
-
* <
|
|
1177
|
-
* <accordion-item heading="Accordion">
|
|
1508
|
+
* <wc-accordion>
|
|
1509
|
+
* <wc-accordion-item heading="Accordion">
|
|
1178
1510
|
* Content
|
|
1179
|
-
* </accordion-item>
|
|
1180
|
-
* </
|
|
1511
|
+
* </wc-accordion-item>
|
|
1512
|
+
* </wc-accordion>
|
|
1181
1513
|
* ```
|
|
1182
1514
|
* @tags display
|
|
1183
1515
|
*/
|
|
@@ -1263,7 +1595,7 @@ class Accordion extends i$1 {
|
|
|
1263
1595
|
return b `<div class="accordion"><slot></slot></div>`;
|
|
1264
1596
|
}
|
|
1265
1597
|
}
|
|
1266
|
-
Accordion.styles = [css_248z$
|
|
1598
|
+
Accordion.styles = [css_248z$t];
|
|
1267
1599
|
Accordion.Item = AccordionItem;
|
|
1268
1600
|
__decorate([
|
|
1269
1601
|
n({ type: Boolean, attribute: 'allow-multiple' })
|
|
@@ -1272,7 +1604,7 @@ __decorate([
|
|
|
1272
1604
|
o$2({ selector: 'p-accordion-item' })
|
|
1273
1605
|
], Accordion.prototype, "items", void 0);
|
|
1274
1606
|
|
|
1275
|
-
var css_248z$
|
|
1607
|
+
var css_248z$s = i`* {
|
|
1276
1608
|
box-sizing: border-box;
|
|
1277
1609
|
}
|
|
1278
1610
|
|
|
@@ -1311,17 +1643,16 @@ var css_248z$n = i`* {
|
|
|
1311
1643
|
|
|
1312
1644
|
/**
|
|
1313
1645
|
* @label Link
|
|
1314
|
-
* @tag
|
|
1646
|
+
* @tag wc-link
|
|
1315
1647
|
* @rawTag link
|
|
1316
1648
|
* @summary The link component is used to navigate to a new page or section within the current page.
|
|
1317
|
-
*
|
|
1318
|
-
* @
|
|
1649
|
+
* @cssprop --link-color - Controls the color of the link.
|
|
1650
|
+
* @tags navigation
|
|
1319
1651
|
*
|
|
1320
1652
|
* @example
|
|
1321
1653
|
* ```html
|
|
1322
|
-
* <
|
|
1654
|
+
* <wc-link href="#">Link</wc-link>
|
|
1323
1655
|
* ```
|
|
1324
|
-
* @tags display
|
|
1325
1656
|
*/
|
|
1326
1657
|
class Link extends i$1 {
|
|
1327
1658
|
constructor() {
|
|
@@ -1344,7 +1675,7 @@ class Link extends i$1 {
|
|
|
1344
1675
|
</a>`;
|
|
1345
1676
|
}
|
|
1346
1677
|
}
|
|
1347
|
-
Link.styles = [css_248z$
|
|
1678
|
+
Link.styles = [css_248z$s];
|
|
1348
1679
|
__decorate([
|
|
1349
1680
|
n({ reflect: true })
|
|
1350
1681
|
], Link.prototype, "href", void 0);
|
|
@@ -1355,7 +1686,7 @@ __decorate([
|
|
|
1355
1686
|
r()
|
|
1356
1687
|
], Link.prototype, "tabIndexValue", void 0);
|
|
1357
1688
|
|
|
1358
|
-
var css_248z$
|
|
1689
|
+
var css_248z$r = i`* {
|
|
1359
1690
|
box-sizing: border-box;
|
|
1360
1691
|
}
|
|
1361
1692
|
|
|
@@ -1492,7 +1823,7 @@ slot::slotted(*) {
|
|
|
1492
1823
|
--_container-state-opacity: 0.08;
|
|
1493
1824
|
}`;
|
|
1494
1825
|
|
|
1495
|
-
var css_248z$
|
|
1826
|
+
var css_248z$q = i`:host([color=default]) {
|
|
1496
1827
|
--filled-tag-container-color: var(--color-surface);
|
|
1497
1828
|
--filled-tag-label-text-color: var(--color-on-surface);
|
|
1498
1829
|
--tonal-tag-container-color: var(--color-surface-container);
|
|
@@ -1558,7 +1889,7 @@ var css_248z$l = i`:host([color=default]) {
|
|
|
1558
1889
|
--outlined-tag-label-text-color: var(--color-purple);
|
|
1559
1890
|
}`;
|
|
1560
1891
|
|
|
1561
|
-
var css_248z$
|
|
1892
|
+
var css_248z$p = i`.tag {
|
|
1562
1893
|
font-family: var(--font-family-sans) !important;
|
|
1563
1894
|
}
|
|
1564
1895
|
|
|
@@ -1588,15 +1919,15 @@ var css_248z$k = i`.tag {
|
|
|
1588
1919
|
|
|
1589
1920
|
/**
|
|
1590
1921
|
* @label Tag
|
|
1591
|
-
* @tag
|
|
1922
|
+
* @tag wc-tag
|
|
1592
1923
|
* @rawTag tag
|
|
1593
1924
|
* @summary Tag component for displaying labels or values with optional dismiss functionality.
|
|
1925
|
+
* @tags display
|
|
1594
1926
|
*
|
|
1595
1927
|
* @example
|
|
1596
1928
|
* ```html
|
|
1597
|
-
* <
|
|
1929
|
+
* <wc-tag color="red">Tag</wc-tag>
|
|
1598
1930
|
* ```
|
|
1599
|
-
* @tags display
|
|
1600
1931
|
*/
|
|
1601
1932
|
class Tag extends i$1 {
|
|
1602
1933
|
constructor() {
|
|
@@ -1624,8 +1955,8 @@ class Tag extends i$1 {
|
|
|
1624
1955
|
@click=${this._dismissClickHandler}
|
|
1625
1956
|
aria-label="Dismiss"
|
|
1626
1957
|
>
|
|
1627
|
-
<
|
|
1628
|
-
<
|
|
1958
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
1959
|
+
<wc-icon class="dismiss-button-icon" name="close"></wc-icon>
|
|
1629
1960
|
</button>
|
|
1630
1961
|
`;
|
|
1631
1962
|
}
|
|
@@ -1639,7 +1970,7 @@ class Tag extends i$1 {
|
|
|
1639
1970
|
};
|
|
1640
1971
|
return b `
|
|
1641
1972
|
<div class="${e$3(classes)}">
|
|
1642
|
-
<
|
|
1973
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
1643
1974
|
<div class="background"></div>
|
|
1644
1975
|
<div class="outline"></div>
|
|
1645
1976
|
|
|
@@ -1657,7 +1988,7 @@ class Tag extends i$1 {
|
|
|
1657
1988
|
}
|
|
1658
1989
|
// Define styles (Lit handles Scoping via Shadow DOM by default)
|
|
1659
1990
|
// You would typically import your tag.scss.js here or use the css tag
|
|
1660
|
-
Tag.styles = [css_248z$
|
|
1991
|
+
Tag.styles = [css_248z$r, css_248z$q, css_248z$p];
|
|
1661
1992
|
__decorate([
|
|
1662
1993
|
n({ type: Boolean })
|
|
1663
1994
|
], Tag.prototype, "dismissible", void 0);
|
|
@@ -1671,7 +2002,7 @@ __decorate([
|
|
|
1671
2002
|
n()
|
|
1672
2003
|
], Tag.prototype, "size", void 0);
|
|
1673
2004
|
|
|
1674
|
-
var css_248z$
|
|
2005
|
+
var css_248z$o = i`* {
|
|
1675
2006
|
box-sizing: border-box;
|
|
1676
2007
|
}
|
|
1677
2008
|
|
|
@@ -1783,7 +2114,7 @@ var css_248z$j = i`* {
|
|
|
1783
2114
|
color: var(--background);
|
|
1784
2115
|
}`;
|
|
1785
2116
|
|
|
1786
|
-
var css_248z$
|
|
2117
|
+
var css_248z$n = i`:host([color=red]) {
|
|
1787
2118
|
--chip-container-color: var(--color-red-container);
|
|
1788
2119
|
--chip-outline-color: var(--color-on-red-container);
|
|
1789
2120
|
}
|
|
@@ -1812,7 +2143,7 @@ var css_248z$i = i`:host([color=red]) {
|
|
|
1812
2143
|
--chip-outline-color: var(--color-on-purple-container);
|
|
1813
2144
|
}`;
|
|
1814
2145
|
|
|
1815
|
-
var css_248z$
|
|
2146
|
+
var css_248z$m = i`.tag {
|
|
1816
2147
|
font-family: var(--font-family-sans) !important;
|
|
1817
2148
|
}
|
|
1818
2149
|
|
|
@@ -1872,15 +2203,15 @@ var css_248z$h = i`.tag {
|
|
|
1872
2203
|
|
|
1873
2204
|
/**
|
|
1874
2205
|
* @label Chip
|
|
1875
|
-
* @tag
|
|
2206
|
+
* @tag wc-chip
|
|
1876
2207
|
* @rawTag chip
|
|
1877
|
-
* @summary
|
|
2208
|
+
* @summary Chip component for displaying compact information with optional actions.
|
|
2209
|
+
* @tags display
|
|
1878
2210
|
*
|
|
1879
2211
|
* @example
|
|
1880
2212
|
* ```html
|
|
1881
|
-
* <
|
|
2213
|
+
* <wc-chip>Chip content</wc-chip>
|
|
1882
2214
|
* ```
|
|
1883
|
-
* @tags display
|
|
1884
2215
|
*/
|
|
1885
2216
|
class Chip extends i$1 {
|
|
1886
2217
|
constructor() {
|
|
@@ -1913,7 +2244,7 @@ class Chip extends i$1 {
|
|
|
1913
2244
|
@click=${this._dismissClickHandler}
|
|
1914
2245
|
aria-label="Dismiss"
|
|
1915
2246
|
>
|
|
1916
|
-
<
|
|
2247
|
+
<wc-icon class="close-btn-icon" name="close"></wc-icon>
|
|
1917
2248
|
</button>
|
|
1918
2249
|
`;
|
|
1919
2250
|
}
|
|
@@ -1935,7 +2266,7 @@ class Chip extends i$1 {
|
|
|
1935
2266
|
};
|
|
1936
2267
|
return b `
|
|
1937
2268
|
<div class="${e$3(classes)}">
|
|
1938
|
-
<
|
|
2269
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
1939
2270
|
<div class="background"></div>
|
|
1940
2271
|
<div class="outline"></div>
|
|
1941
2272
|
|
|
@@ -1950,7 +2281,7 @@ class Chip extends i$1 {
|
|
|
1950
2281
|
}
|
|
1951
2282
|
// Define styles (Lit handles Scoping via Shadow DOM by default)
|
|
1952
2283
|
// You would typically import your tag.scss.js here or use the css tag
|
|
1953
|
-
Chip.styles = [css_248z$
|
|
2284
|
+
Chip.styles = [css_248z$o, css_248z$n, css_248z$m];
|
|
1954
2285
|
__decorate([
|
|
1955
2286
|
n({ type: Boolean })
|
|
1956
2287
|
], Chip.prototype, "dismissible", void 0);
|
|
@@ -1967,7 +2298,7 @@ __decorate([
|
|
|
1967
2298
|
n({ type: String })
|
|
1968
2299
|
], Chip.prototype, "imageSrc", void 0);
|
|
1969
2300
|
|
|
1970
|
-
var css_248z$
|
|
2301
|
+
var css_248z$l = i`:host {
|
|
1971
2302
|
display: block;
|
|
1972
2303
|
--progress-height: 0.25rem;
|
|
1973
2304
|
--progress-container-color: var(--color-primary);
|
|
@@ -2119,14 +2450,14 @@ __decorate([
|
|
|
2119
2450
|
|
|
2120
2451
|
/**
|
|
2121
2452
|
* @label Linear Progress
|
|
2122
|
-
* @tag linear-progress
|
|
2453
|
+
* @tag wc-linear-progress
|
|
2123
2454
|
* @rawTag linear-progress
|
|
2124
|
-
*
|
|
2125
2455
|
* @summary A linear progress indicator is a visual representation of progress toward a specific goal.
|
|
2456
|
+
* @tags display
|
|
2126
2457
|
*
|
|
2127
2458
|
* @example
|
|
2128
2459
|
* ```html
|
|
2129
|
-
* <linear-progress value="30" style="width:10rem"></linear-progress>
|
|
2460
|
+
* <wc-linear-progress value="30" style="width:10rem"></wc-linear-progress>
|
|
2130
2461
|
* ```
|
|
2131
2462
|
*/
|
|
2132
2463
|
class LinearProgress extends BaseProgress {
|
|
@@ -2173,9 +2504,9 @@ class LinearProgress extends BaseProgress {
|
|
|
2173
2504
|
}
|
|
2174
2505
|
}
|
|
2175
2506
|
// Lit components use static styles for better performance
|
|
2176
|
-
LinearProgress.styles = [css_248z$
|
|
2507
|
+
LinearProgress.styles = [css_248z$l];
|
|
2177
2508
|
|
|
2178
|
-
var css_248z$
|
|
2509
|
+
var css_248z$k = i`:host {
|
|
2179
2510
|
display: inline-block;
|
|
2180
2511
|
--progress-height: 1.5rem;
|
|
2181
2512
|
--progress-line-thickness: 4px;
|
|
@@ -2254,7 +2585,7 @@ var css_248z$f = i`:host {
|
|
|
2254
2585
|
flex: 1;
|
|
2255
2586
|
}
|
|
2256
2587
|
.circular-progress.inline .progress-helper {
|
|
2257
|
-
text-align:
|
|
2588
|
+
text-align: start;
|
|
2258
2589
|
}
|
|
2259
2590
|
|
|
2260
2591
|
@keyframes rotate-container {
|
|
@@ -2279,14 +2610,14 @@ var css_248z$f = i`:host {
|
|
|
2279
2610
|
|
|
2280
2611
|
/**
|
|
2281
2612
|
* @label Circular Progress
|
|
2282
|
-
* @tag circular-progress
|
|
2613
|
+
* @tag wc-circular-progress
|
|
2283
2614
|
* @rawTag circular-progress
|
|
2284
|
-
*
|
|
2285
2615
|
* @summary A circular progress indicator is a visual representation of progress toward a specific goal.
|
|
2616
|
+
* @tags display
|
|
2286
2617
|
*
|
|
2287
2618
|
* @example
|
|
2288
2619
|
* ```html
|
|
2289
|
-
* <circular-progress value="30"></circular-progress>
|
|
2620
|
+
* <wc-circular-progress value="30"></wc-circular-progress>
|
|
2290
2621
|
* ```
|
|
2291
2622
|
*/
|
|
2292
2623
|
class CircularProgress extends BaseProgress {
|
|
@@ -2338,9 +2669,9 @@ class CircularProgress extends BaseProgress {
|
|
|
2338
2669
|
}
|
|
2339
2670
|
}
|
|
2340
2671
|
// Lit components use static styles for better performance
|
|
2341
|
-
CircularProgress.styles = [css_248z$
|
|
2672
|
+
CircularProgress.styles = [css_248z$k];
|
|
2342
2673
|
|
|
2343
|
-
var css_248z$
|
|
2674
|
+
var css_248z$j = i`:host {
|
|
2344
2675
|
--skeleton-container-color: var(--color-surface-container);
|
|
2345
2676
|
--skeleton-element: var(--color-on-surface);
|
|
2346
2677
|
display: inline-block;
|
|
@@ -2425,14 +2756,15 @@ var css_248z$e = i`:host {
|
|
|
2425
2756
|
|
|
2426
2757
|
/**
|
|
2427
2758
|
* @label Skeleton
|
|
2428
|
-
*
|
|
2429
|
-
* @tag base-skeleton
|
|
2759
|
+
* @tag wc-skeleton
|
|
2430
2760
|
* @rawTag skeleton
|
|
2431
|
-
*
|
|
2432
2761
|
* @summary Adds a skeleton effect to an element.
|
|
2433
|
-
*
|
|
2434
|
-
*
|
|
2435
2762
|
* @tags display
|
|
2763
|
+
*
|
|
2764
|
+
* @example
|
|
2765
|
+
* ```html
|
|
2766
|
+
* <wc-skeleton visible></wc-skeleton>
|
|
2767
|
+
* ```
|
|
2436
2768
|
*/
|
|
2437
2769
|
class Skeleton extends i$1 {
|
|
2438
2770
|
constructor() {
|
|
@@ -2443,12 +2775,12 @@ class Skeleton extends i$1 {
|
|
|
2443
2775
|
return b ` <div class="skeleton"></div>`;
|
|
2444
2776
|
}
|
|
2445
2777
|
}
|
|
2446
|
-
Skeleton.styles = [css_248z$
|
|
2778
|
+
Skeleton.styles = [css_248z$j];
|
|
2447
2779
|
__decorate([
|
|
2448
2780
|
n({ type: Boolean, reflect: true })
|
|
2449
2781
|
], Skeleton.prototype, "visible", void 0);
|
|
2450
2782
|
|
|
2451
|
-
var css_248z$
|
|
2783
|
+
var css_248z$i = i`* {
|
|
2452
2784
|
box-sizing: border-box;
|
|
2453
2785
|
}
|
|
2454
2786
|
|
|
@@ -2480,14 +2812,14 @@ var css_248z$d = i`* {
|
|
|
2480
2812
|
|
|
2481
2813
|
/**
|
|
2482
2814
|
* @label Input
|
|
2483
|
-
* @tag input
|
|
2815
|
+
* @tag wc-input
|
|
2484
2816
|
* @rawTag input
|
|
2485
2817
|
*
|
|
2486
2818
|
* @summary The Input component is used to capture user input.
|
|
2487
2819
|
*
|
|
2488
2820
|
* @example
|
|
2489
2821
|
* ```html
|
|
2490
|
-
* <input
|
|
2822
|
+
* <wc-input label="Name" required placeholder="Enter your name"></wc-input>
|
|
2491
2823
|
* ```
|
|
2492
2824
|
*/
|
|
2493
2825
|
class Input extends BaseInput {
|
|
@@ -2558,7 +2890,7 @@ class Input extends BaseInput {
|
|
|
2558
2890
|
render() {
|
|
2559
2891
|
const displayType = this.type === 'password' && this.passwordVisible ? 'text' : this.type;
|
|
2560
2892
|
return b `
|
|
2561
|
-
<
|
|
2893
|
+
<wc-field
|
|
2562
2894
|
?required=${this.required}
|
|
2563
2895
|
?disabled=${this.disabled}
|
|
2564
2896
|
?readonly=${this.readonly}
|
|
@@ -2603,7 +2935,7 @@ class Input extends BaseInput {
|
|
|
2603
2935
|
? 'Hide password'
|
|
2604
2936
|
: 'Show password'}
|
|
2605
2937
|
>
|
|
2606
|
-
<icon-button
|
|
2938
|
+
<wc-icon-button
|
|
2607
2939
|
class="password-toggle"
|
|
2608
2940
|
variant="text"
|
|
2609
2941
|
name=${this.passwordVisible ? 'visibility_off' : 'visibility'}
|
|
@@ -2611,17 +2943,17 @@ class Input extends BaseInput {
|
|
|
2611
2943
|
this.passwordVisible = !this.passwordVisible;
|
|
2612
2944
|
}}
|
|
2613
2945
|
>
|
|
2614
|
-
</icon-button>
|
|
2946
|
+
</wc-icon-button>
|
|
2615
2947
|
</pc-tooltip>
|
|
2616
2948
|
`
|
|
2617
2949
|
: A}
|
|
2618
2950
|
|
|
2619
2951
|
<slot name="end" slot="field-end"></slot>
|
|
2620
|
-
</
|
|
2952
|
+
</wc-field>
|
|
2621
2953
|
`;
|
|
2622
2954
|
}
|
|
2623
2955
|
}
|
|
2624
|
-
Input.styles = [css_248z$
|
|
2956
|
+
Input.styles = [css_248z$i];
|
|
2625
2957
|
__decorate([
|
|
2626
2958
|
n({ type: String })
|
|
2627
2959
|
], Input.prototype, "value", void 0);
|
|
@@ -2680,7 +3012,7 @@ __decorate([
|
|
|
2680
3012
|
e$4('.input-element')
|
|
2681
3013
|
], Input.prototype, "inputElement", void 0);
|
|
2682
3014
|
|
|
2683
|
-
var css_248z$
|
|
3015
|
+
var css_248z$h = i`* {
|
|
2684
3016
|
box-sizing: border-box;
|
|
2685
3017
|
}
|
|
2686
3018
|
|
|
@@ -2888,12 +3220,29 @@ var css_248z$c = i`* {
|
|
|
2888
3220
|
position: absolute;
|
|
2889
3221
|
top: 0;
|
|
2890
3222
|
left: 0;
|
|
2891
|
-
--skeleton-shape-start-start: var(--shape-
|
|
2892
|
-
--skeleton-shape-start-end: var(--shape-
|
|
2893
|
-
--skeleton-shape-end-start: var(--shape-
|
|
2894
|
-
--skeleton-shape-end-end: var(--shape-
|
|
3223
|
+
--skeleton-container-shape-start-start: var(--_container-shape-start-start);
|
|
3224
|
+
--skeleton-container-shape-start-end: var(--_container-shape-start-end);
|
|
3225
|
+
--skeleton-container-shape-end-start: var(--_container-shape-end-start);
|
|
3226
|
+
--skeleton-container-shape-end-end: var(--_container-shape-end-end);
|
|
2895
3227
|
}`;
|
|
2896
3228
|
|
|
3229
|
+
/**
|
|
3230
|
+
* @label Field
|
|
3231
|
+
* @tag wc-field
|
|
3232
|
+
* @rawTag field
|
|
3233
|
+
*
|
|
3234
|
+
* @summary Wrapper for form fields with label and help text.
|
|
3235
|
+
* @overview
|
|
3236
|
+
* <p>Field provides consistent styling and behavior for form inputs.</p>
|
|
3237
|
+
*
|
|
3238
|
+
* @example
|
|
3239
|
+
* ```html
|
|
3240
|
+
* <wc-field label="Name" required>
|
|
3241
|
+
* some text
|
|
3242
|
+
* </wc-field>
|
|
3243
|
+
* ```
|
|
3244
|
+
* @tags form
|
|
3245
|
+
*/
|
|
2897
3246
|
class Field extends i$1 {
|
|
2898
3247
|
constructor() {
|
|
2899
3248
|
super(...arguments);
|
|
@@ -2953,7 +3302,7 @@ class Field extends i$1 {
|
|
|
2953
3302
|
${this.label}${this.required
|
|
2954
3303
|
? b `<span class="required">*</span>`
|
|
2955
3304
|
: A}
|
|
2956
|
-
<
|
|
3305
|
+
<wc-skeleton class="skeleton"></wc-skeleton>
|
|
2957
3306
|
</label>
|
|
2958
3307
|
</div>`;
|
|
2959
3308
|
}
|
|
@@ -2977,7 +3326,7 @@ class Field extends i$1 {
|
|
|
2977
3326
|
<div class="field-body" @click=${this.__handleClick}>
|
|
2978
3327
|
<div class="outline"></div>
|
|
2979
3328
|
<div class="background"></div>
|
|
2980
|
-
<
|
|
3329
|
+
<wc-skeleton class="skeleton"></wc-skeleton>
|
|
2981
3330
|
|
|
2982
3331
|
<div class="field-content">
|
|
2983
3332
|
<div
|
|
@@ -3031,7 +3380,7 @@ class Field extends i$1 {
|
|
|
3031
3380
|
return b `<div class="text-count">${this.textCount}</div>`;
|
|
3032
3381
|
}
|
|
3033
3382
|
}
|
|
3034
|
-
Field.styles = [css_248z$
|
|
3383
|
+
Field.styles = [css_248z$h];
|
|
3035
3384
|
__decorate([
|
|
3036
3385
|
n({ type: String })
|
|
3037
3386
|
], Field.prototype, "label", void 0);
|
|
@@ -3087,7 +3436,7 @@ __decorate([
|
|
|
3087
3436
|
r()
|
|
3088
3437
|
], Field.prototype, "slotEndHasContent", void 0);
|
|
3089
3438
|
|
|
3090
|
-
var css_248z$
|
|
3439
|
+
var css_248z$g = i`* {
|
|
3091
3440
|
box-sizing: border-box;
|
|
3092
3441
|
}
|
|
3093
3442
|
|
|
@@ -3142,7 +3491,7 @@ var _NumberField_id;
|
|
|
3142
3491
|
*
|
|
3143
3492
|
* @example
|
|
3144
3493
|
* ```html
|
|
3145
|
-
* <number-field label="Age" placeholder="Enter your age"></number-field>
|
|
3494
|
+
* <wc-number-field label="Age" placeholder="Enter your age"></wc-number-field>
|
|
3146
3495
|
* ```
|
|
3147
3496
|
*/
|
|
3148
3497
|
class NumberField extends BaseInput {
|
|
@@ -3220,7 +3569,7 @@ class NumberField extends BaseInput {
|
|
|
3220
3569
|
stepper: this.stepper,
|
|
3221
3570
|
};
|
|
3222
3571
|
return b `
|
|
3223
|
-
<
|
|
3572
|
+
<wc-field
|
|
3224
3573
|
?required=${this.required}
|
|
3225
3574
|
?disabled=${this.disabled}
|
|
3226
3575
|
?readonly=${this.readonly}
|
|
@@ -3236,13 +3585,13 @@ class NumberField extends BaseInput {
|
|
|
3236
3585
|
class=${e$3(classes)}
|
|
3237
3586
|
>
|
|
3238
3587
|
${this.stepper && !this.disabled
|
|
3239
|
-
? b `<icon-button
|
|
3588
|
+
? b `<wc-icon-button
|
|
3240
3589
|
class="stepper"
|
|
3241
3590
|
name="remove"
|
|
3242
3591
|
variant="text"
|
|
3243
3592
|
slot="field-start"
|
|
3244
3593
|
@click=${this.stepDown}
|
|
3245
|
-
></icon-button>`
|
|
3594
|
+
></wc-icon-button>`
|
|
3246
3595
|
: A}
|
|
3247
3596
|
|
|
3248
3597
|
<slot name="start" slot="field-start"></slot>
|
|
@@ -3271,20 +3620,20 @@ class NumberField extends BaseInput {
|
|
|
3271
3620
|
<slot name="end" slot="field-end"></slot>
|
|
3272
3621
|
|
|
3273
3622
|
${this.stepper && !this.disabled
|
|
3274
|
-
? b `<icon-button
|
|
3623
|
+
? b `<wc-icon-button
|
|
3275
3624
|
class="stepper"
|
|
3276
3625
|
variant="text"
|
|
3277
3626
|
name="add"
|
|
3278
3627
|
slot="field-end"
|
|
3279
3628
|
@click=${this.stepUp}
|
|
3280
|
-
></icon-button>`
|
|
3629
|
+
></wc-icon-button>`
|
|
3281
3630
|
: A}
|
|
3282
|
-
</
|
|
3631
|
+
</wc-field>
|
|
3283
3632
|
`;
|
|
3284
3633
|
}
|
|
3285
3634
|
}
|
|
3286
3635
|
_NumberField_id = new WeakMap();
|
|
3287
|
-
NumberField.styles = [css_248z$
|
|
3636
|
+
NumberField.styles = [css_248z$g];
|
|
3288
3637
|
__decorate([
|
|
3289
3638
|
n({ type: Number })
|
|
3290
3639
|
], NumberField.prototype, "value", void 0);
|
|
@@ -3346,7 +3695,7 @@ __decorate([
|
|
|
3346
3695
|
e$4('.input-element')
|
|
3347
3696
|
], NumberField.prototype, "inputElement", void 0);
|
|
3348
3697
|
|
|
3349
|
-
var css_248z$
|
|
3698
|
+
var css_248z$f = i`* {
|
|
3350
3699
|
box-sizing: border-box;
|
|
3351
3700
|
}
|
|
3352
3701
|
|
|
@@ -3380,14 +3729,14 @@ var css_248z$a = i`* {
|
|
|
3380
3729
|
|
|
3381
3730
|
/**
|
|
3382
3731
|
* @label Date Picker
|
|
3383
|
-
* @tag date-picker
|
|
3732
|
+
* @tag wc-date-picker
|
|
3384
3733
|
* @rawTag date-picker
|
|
3385
|
-
*
|
|
3386
3734
|
* @summary The Date Picker component is used to capture date user input.
|
|
3735
|
+
* @tags input
|
|
3387
3736
|
*
|
|
3388
3737
|
* @example
|
|
3389
3738
|
* ```html
|
|
3390
|
-
* <date-picker label="
|
|
3739
|
+
* <wc-date-picker label="Date" placeholder="Select a date"></wc-date-picker>
|
|
3391
3740
|
* ```
|
|
3392
3741
|
*/
|
|
3393
3742
|
class DatePicker extends BaseInput {
|
|
@@ -3456,7 +3805,7 @@ class DatePicker extends BaseInput {
|
|
|
3456
3805
|
}
|
|
3457
3806
|
render() {
|
|
3458
3807
|
return b `
|
|
3459
|
-
<
|
|
3808
|
+
<wc-field
|
|
3460
3809
|
?required=${this.required}
|
|
3461
3810
|
?disabled=${this.disabled}
|
|
3462
3811
|
?readonly=${this.readonly}
|
|
@@ -3495,7 +3844,7 @@ class DatePicker extends BaseInput {
|
|
|
3495
3844
|
|
|
3496
3845
|
<slot name="end" slot="field-end"></slot>
|
|
3497
3846
|
|
|
3498
|
-
<icon-button
|
|
3847
|
+
<wc-icon-button
|
|
3499
3848
|
slot="field-end"
|
|
3500
3849
|
color="secondary"
|
|
3501
3850
|
variant="text"
|
|
@@ -3508,12 +3857,12 @@ class DatePicker extends BaseInput {
|
|
|
3508
3857
|
});
|
|
3509
3858
|
}}
|
|
3510
3859
|
>
|
|
3511
|
-
</icon-button>
|
|
3512
|
-
</
|
|
3860
|
+
</wc-icon-button>
|
|
3861
|
+
</wc-field>
|
|
3513
3862
|
`;
|
|
3514
3863
|
}
|
|
3515
3864
|
}
|
|
3516
|
-
DatePicker.styles = [css_248z$
|
|
3865
|
+
DatePicker.styles = [css_248z$f];
|
|
3517
3866
|
__decorate([
|
|
3518
3867
|
n({ type: String })
|
|
3519
3868
|
], DatePicker.prototype, "value", void 0);
|
|
@@ -3569,7 +3918,7 @@ __decorate([
|
|
|
3569
3918
|
e$4('.input-element')
|
|
3570
3919
|
], DatePicker.prototype, "inputElement", void 0);
|
|
3571
3920
|
|
|
3572
|
-
var css_248z$
|
|
3921
|
+
var css_248z$e = i`* {
|
|
3573
3922
|
box-sizing: border-box;
|
|
3574
3923
|
}
|
|
3575
3924
|
|
|
@@ -3603,14 +3952,14 @@ var css_248z$9 = i`* {
|
|
|
3603
3952
|
|
|
3604
3953
|
/**
|
|
3605
3954
|
* @label Time Picker
|
|
3606
|
-
* @tag time-picker
|
|
3955
|
+
* @tag wc-time-picker
|
|
3607
3956
|
* @rawTag time-picker
|
|
3608
|
-
*
|
|
3609
3957
|
* @summary The Time Picker component is used to capture time user input.
|
|
3958
|
+
* @tags input
|
|
3610
3959
|
*
|
|
3611
3960
|
* @example
|
|
3612
3961
|
* ```html
|
|
3613
|
-
* <time-picker label="
|
|
3962
|
+
* <wc-time-picker label="Time" placeholder="Select a time"></wc-time-picker>
|
|
3614
3963
|
* ```
|
|
3615
3964
|
*/
|
|
3616
3965
|
class TimePicker extends BaseInput {
|
|
@@ -3679,7 +4028,7 @@ class TimePicker extends BaseInput {
|
|
|
3679
4028
|
}
|
|
3680
4029
|
render() {
|
|
3681
4030
|
return b `
|
|
3682
|
-
<
|
|
4031
|
+
<wc-field
|
|
3683
4032
|
?required=${this.required}
|
|
3684
4033
|
?disabled=${this.disabled}
|
|
3685
4034
|
?readonly=${this.readonly}
|
|
@@ -3718,7 +4067,7 @@ class TimePicker extends BaseInput {
|
|
|
3718
4067
|
|
|
3719
4068
|
<slot name="end" slot="field-end"></slot>
|
|
3720
4069
|
|
|
3721
|
-
<icon-button
|
|
4070
|
+
<wc-icon-button
|
|
3722
4071
|
slot="field-end"
|
|
3723
4072
|
color="secondary"
|
|
3724
4073
|
variant="text"
|
|
@@ -3731,12 +4080,12 @@ class TimePicker extends BaseInput {
|
|
|
3731
4080
|
});
|
|
3732
4081
|
}}
|
|
3733
4082
|
>
|
|
3734
|
-
</icon-button>
|
|
3735
|
-
</
|
|
4083
|
+
</wc-icon-button>
|
|
4084
|
+
</wc-field>
|
|
3736
4085
|
`;
|
|
3737
4086
|
}
|
|
3738
4087
|
}
|
|
3739
|
-
TimePicker.styles = [css_248z$
|
|
4088
|
+
TimePicker.styles = [css_248z$e];
|
|
3740
4089
|
__decorate([
|
|
3741
4090
|
n({ type: String })
|
|
3742
4091
|
], TimePicker.prototype, "value", void 0);
|
|
@@ -3792,7 +4141,7 @@ __decorate([
|
|
|
3792
4141
|
e$4('.input-element')
|
|
3793
4142
|
], TimePicker.prototype, "inputElement", void 0);
|
|
3794
4143
|
|
|
3795
|
-
var css_248z$
|
|
4144
|
+
var css_248z$d = i`* {
|
|
3796
4145
|
box-sizing: border-box;
|
|
3797
4146
|
}
|
|
3798
4147
|
|
|
@@ -3833,14 +4182,14 @@ var css_248z$8 = i`* {
|
|
|
3833
4182
|
|
|
3834
4183
|
/**
|
|
3835
4184
|
* @label Textarea
|
|
3836
|
-
* @tag textarea
|
|
4185
|
+
* @tag wc-textarea
|
|
3837
4186
|
* @rawTag textarea
|
|
3838
|
-
*
|
|
3839
4187
|
* @summary The Textarea component is used to capture user input.
|
|
4188
|
+
* @tags input
|
|
3840
4189
|
*
|
|
3841
4190
|
* @example
|
|
3842
4191
|
* ```html
|
|
3843
|
-
* <textarea
|
|
4192
|
+
* <wc-textarea label="Description" placeholder="Enter text"></wc-textarea>
|
|
3844
4193
|
* ```
|
|
3845
4194
|
*/
|
|
3846
4195
|
class Textarea extends BaseInput {
|
|
@@ -3910,7 +4259,7 @@ class Textarea extends BaseInput {
|
|
|
3910
4259
|
}
|
|
3911
4260
|
render() {
|
|
3912
4261
|
return b `
|
|
3913
|
-
<
|
|
4262
|
+
<wc-field
|
|
3914
4263
|
?required=${this.required}
|
|
3915
4264
|
?disabled=${this.disabled}
|
|
3916
4265
|
?readonly=${this.readonly}
|
|
@@ -3948,11 +4297,11 @@ class Textarea extends BaseInput {
|
|
|
3948
4297
|
></textarea>
|
|
3949
4298
|
|
|
3950
4299
|
<slot name="end" slot="field-end"></slot>
|
|
3951
|
-
</
|
|
4300
|
+
</wc-field>
|
|
3952
4301
|
`;
|
|
3953
4302
|
}
|
|
3954
4303
|
}
|
|
3955
|
-
Textarea.styles = [css_248z$
|
|
4304
|
+
Textarea.styles = [css_248z$d];
|
|
3956
4305
|
__decorate([
|
|
3957
4306
|
n({ type: String })
|
|
3958
4307
|
], Textarea.prototype, "value", void 0);
|
|
@@ -4011,7 +4360,7 @@ __decorate([
|
|
|
4011
4360
|
e$4('.input-element')
|
|
4012
4361
|
], Textarea.prototype, "inputElement", void 0);
|
|
4013
4362
|
|
|
4014
|
-
var css_248z$
|
|
4363
|
+
var css_248z$c = i`* {
|
|
4015
4364
|
box-sizing: border-box;
|
|
4016
4365
|
}
|
|
4017
4366
|
|
|
@@ -4144,7 +4493,7 @@ var css_248z$7 = i`* {
|
|
|
4144
4493
|
|
|
4145
4494
|
/**
|
|
4146
4495
|
* @label Switch
|
|
4147
|
-
* @tag
|
|
4496
|
+
* @tag wc-switch
|
|
4148
4497
|
* @rawTag switch
|
|
4149
4498
|
*
|
|
4150
4499
|
* @summary Captures boolean input with an on/off switch interaction.
|
|
@@ -4164,7 +4513,7 @@ var css_248z$7 = i`* {
|
|
|
4164
4513
|
*
|
|
4165
4514
|
* @example
|
|
4166
4515
|
* ```html
|
|
4167
|
-
* <
|
|
4516
|
+
* <wc-switch value="true"></wc-switch>
|
|
4168
4517
|
* ```
|
|
4169
4518
|
* @tags input, form
|
|
4170
4519
|
*/
|
|
@@ -4298,8 +4647,8 @@ class Switch extends BaseInput {
|
|
|
4298
4647
|
__renderIcon() {
|
|
4299
4648
|
if (this.withIcon) {
|
|
4300
4649
|
if (this.value)
|
|
4301
|
-
return b `<
|
|
4302
|
-
return b `<
|
|
4650
|
+
return b `<wc-icon name="check" class="icon"></wc-icon>`;
|
|
4651
|
+
return b `<wc-icon name="close" class="icon"></wc-icon>`;
|
|
4303
4652
|
}
|
|
4304
4653
|
return A;
|
|
4305
4654
|
}
|
|
@@ -4352,7 +4701,7 @@ class Switch extends BaseInput {
|
|
|
4352
4701
|
`;
|
|
4353
4702
|
}
|
|
4354
4703
|
}
|
|
4355
|
-
Switch.styles = [css_248z$
|
|
4704
|
+
Switch.styles = [css_248z$c];
|
|
4356
4705
|
__decorate([
|
|
4357
4706
|
n({ type: Boolean })
|
|
4358
4707
|
], Switch.prototype, "value", void 0);
|
|
@@ -4396,7 +4745,7 @@ __decorate([
|
|
|
4396
4745
|
e$4('.input-native')
|
|
4397
4746
|
], Switch.prototype, "nativeElement", void 0);
|
|
4398
4747
|
|
|
4399
|
-
var css_248z$
|
|
4748
|
+
var css_248z$b = i`* {
|
|
4400
4749
|
box-sizing: border-box;
|
|
4401
4750
|
}
|
|
4402
4751
|
|
|
@@ -4462,7 +4811,7 @@ var css_248z$6 = i`* {
|
|
|
4462
4811
|
|
|
4463
4812
|
/**
|
|
4464
4813
|
* @label Spinner
|
|
4465
|
-
* @tag
|
|
4814
|
+
* @tag wc-spinner
|
|
4466
4815
|
* @rawTag spinner
|
|
4467
4816
|
* @summary A spinner component that animates a circular shape.
|
|
4468
4817
|
* @cssprop --spinner-track-color - The color of the track.
|
|
@@ -4471,7 +4820,7 @@ var css_248z$6 = i`* {
|
|
|
4471
4820
|
*
|
|
4472
4821
|
* @example
|
|
4473
4822
|
* ```html
|
|
4474
|
-
* <
|
|
4823
|
+
* <wc-spinner></wc-spinner>
|
|
4475
4824
|
* ```
|
|
4476
4825
|
*/
|
|
4477
4826
|
class Spinner extends i$1 {
|
|
@@ -4483,9 +4832,9 @@ class Spinner extends i$1 {
|
|
|
4483
4832
|
`;
|
|
4484
4833
|
}
|
|
4485
4834
|
}
|
|
4486
|
-
Spinner.styles = [css_248z$
|
|
4835
|
+
Spinner.styles = [css_248z$b];
|
|
4487
4836
|
|
|
4488
|
-
var css_248z$
|
|
4837
|
+
var css_248z$a = i`* {
|
|
4489
4838
|
box-sizing: border-box;
|
|
4490
4839
|
}
|
|
4491
4840
|
|
|
@@ -4570,22 +4919,17 @@ var css_248z$5 = i`* {
|
|
|
4570
4919
|
|
|
4571
4920
|
/**
|
|
4572
4921
|
* @label Container
|
|
4573
|
-
* @tag
|
|
4922
|
+
* @tag wc-container
|
|
4574
4923
|
* @rawTag container
|
|
4575
|
-
* @summary
|
|
4576
|
-
*
|
|
4577
|
-
* @cssprop --
|
|
4578
|
-
* @
|
|
4579
|
-
* @cssprop --avatar-size - Controls the size of the avatar.
|
|
4580
|
-
* @cssprop --avatar-text-color - Controls the color of the text inside the avatar.
|
|
4581
|
-
*
|
|
4924
|
+
* @summary A responsive container component for layout.
|
|
4925
|
+
* @cssprop --container-max-width - Controls the maximum width of the container.
|
|
4926
|
+
* @cssprop --container-padding - Controls the padding of the container.
|
|
4927
|
+
* @tags layout
|
|
4582
4928
|
*
|
|
4583
4929
|
* @example
|
|
4584
4930
|
* ```html
|
|
4585
|
-
* <
|
|
4931
|
+
* <wc-container size="lg">Content</wc-container>
|
|
4586
4932
|
* ```
|
|
4587
|
-
*
|
|
4588
|
-
* @tags display
|
|
4589
4933
|
*/
|
|
4590
4934
|
class Container extends i$1 {
|
|
4591
4935
|
constructor() {
|
|
@@ -4608,12 +4952,12 @@ class Container extends i$1 {
|
|
|
4608
4952
|
`;
|
|
4609
4953
|
}
|
|
4610
4954
|
}
|
|
4611
|
-
Container.styles = [css_248z$
|
|
4955
|
+
Container.styles = [css_248z$a];
|
|
4612
4956
|
__decorate([
|
|
4613
4957
|
n({ type: String, reflect: true })
|
|
4614
4958
|
], Container.prototype, "size", void 0);
|
|
4615
4959
|
|
|
4616
|
-
var css_248z$
|
|
4960
|
+
var css_248z$9 = i`* {
|
|
4617
4961
|
box-sizing: border-box;
|
|
4618
4962
|
}
|
|
4619
4963
|
|
|
@@ -4699,8 +5043,15 @@ var css_248z$4 = i`* {
|
|
|
4699
5043
|
|
|
4700
5044
|
/**
|
|
4701
5045
|
* @label Empty State
|
|
4702
|
-
* @
|
|
4703
|
-
* @
|
|
5046
|
+
* @tag wc-empty-state
|
|
5047
|
+
* @rawTag empty-state
|
|
5048
|
+
* @summary A message that displays when there is no information to display.
|
|
5049
|
+
* @tags display
|
|
5050
|
+
*
|
|
5051
|
+
* @example
|
|
5052
|
+
* ```html
|
|
5053
|
+
* <wc-empty-state headline="No items found"></wc-empty-state>
|
|
5054
|
+
* ```
|
|
4704
5055
|
*/
|
|
4705
5056
|
class EmptyState extends i$1 {
|
|
4706
5057
|
constructor() {
|
|
@@ -4747,7 +5098,7 @@ class EmptyState extends i$1 {
|
|
|
4747
5098
|
<div class="${e$3(classes)}">
|
|
4748
5099
|
<div class="empty-state-container">
|
|
4749
5100
|
<div class="illustration">
|
|
4750
|
-
<
|
|
5101
|
+
<wc-icon src="${illustrationPath}"></wc-icon>
|
|
4751
5102
|
</div>
|
|
4752
5103
|
|
|
4753
5104
|
<div class="content">
|
|
@@ -4762,7 +5113,7 @@ class EmptyState extends i$1 {
|
|
|
4762
5113
|
}
|
|
4763
5114
|
}
|
|
4764
5115
|
// Lit handles styles in a static property for better performance
|
|
4765
|
-
EmptyState.styles = [css_248z$
|
|
5116
|
+
EmptyState.styles = [css_248z$9];
|
|
4766
5117
|
__decorate([
|
|
4767
5118
|
n({ type: String, reflect: true })
|
|
4768
5119
|
], EmptyState.prototype, "illustration", void 0);
|
|
@@ -4776,7 +5127,7 @@ __decorate([
|
|
|
4776
5127
|
r()
|
|
4777
5128
|
], EmptyState.prototype, "vertical", void 0);
|
|
4778
5129
|
|
|
4779
|
-
var css_248z$
|
|
5130
|
+
var css_248z$8 = i`* {
|
|
4780
5131
|
box-sizing: border-box;
|
|
4781
5132
|
}
|
|
4782
5133
|
|
|
@@ -6421,15 +6772,17 @@ class PopoverController {
|
|
|
6421
6772
|
|
|
6422
6773
|
/**
|
|
6423
6774
|
* @label Tooltip
|
|
6424
|
-
* @tag
|
|
6775
|
+
* @tag wc-tooltip
|
|
6425
6776
|
* @rawTag tooltip
|
|
6426
6777
|
* @summary Displays a tooltip for an element.
|
|
6778
|
+
* @tags display
|
|
6427
6779
|
*
|
|
6428
6780
|
* @example
|
|
6429
6781
|
* ```html
|
|
6430
|
-
* <
|
|
6782
|
+
* <wc-tooltip content="Tooltip text">
|
|
6783
|
+
* <button>Hover me</button>
|
|
6784
|
+
* </wc-tooltip>
|
|
6431
6785
|
* ```
|
|
6432
|
-
* @tags display
|
|
6433
6786
|
*/
|
|
6434
6787
|
class Tooltip extends i$1 {
|
|
6435
6788
|
constructor() {
|
|
@@ -6443,6 +6796,7 @@ class Tooltip extends i$1 {
|
|
|
6443
6796
|
this.trigger = 'hover focus';
|
|
6444
6797
|
this.open = false;
|
|
6445
6798
|
this.variant = 'plain';
|
|
6799
|
+
this.preview = false;
|
|
6446
6800
|
this._target = null;
|
|
6447
6801
|
this._popover = new PopoverController(this, {
|
|
6448
6802
|
placement: 'top',
|
|
@@ -6556,7 +6910,7 @@ class Tooltip extends i$1 {
|
|
|
6556
6910
|
if (changedProps.has('for')) {
|
|
6557
6911
|
this.attachListeners();
|
|
6558
6912
|
}
|
|
6559
|
-
if (changedProps.has('open') && this.open && this._target) {
|
|
6913
|
+
if (changedProps.has('open') && this.open && this._target && !this.preview) {
|
|
6560
6914
|
this._popover.updatePosition(this._target, this.floatingEl);
|
|
6561
6915
|
}
|
|
6562
6916
|
}
|
|
@@ -6589,7 +6943,7 @@ class Tooltip extends i$1 {
|
|
|
6589
6943
|
__renderRichTooltip() {
|
|
6590
6944
|
return b `
|
|
6591
6945
|
<div class="tooltip-content">
|
|
6592
|
-
<
|
|
6946
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
6593
6947
|
|
|
6594
6948
|
<div class="tooltip-title" id="tooltip-labelledby">
|
|
6595
6949
|
<slot name="title"></slot>
|
|
@@ -6604,7 +6958,7 @@ class Tooltip extends i$1 {
|
|
|
6604
6958
|
`;
|
|
6605
6959
|
}
|
|
6606
6960
|
}
|
|
6607
|
-
Tooltip.styles = [css_248z$
|
|
6961
|
+
Tooltip.styles = [css_248z$8];
|
|
6608
6962
|
Tooltip.CLOSE_OTHERS_EVENT = 'tooltip--open';
|
|
6609
6963
|
__decorate([
|
|
6610
6964
|
n()
|
|
@@ -6621,11 +6975,14 @@ __decorate([
|
|
|
6621
6975
|
__decorate([
|
|
6622
6976
|
n({ type: String, reflect: true })
|
|
6623
6977
|
], Tooltip.prototype, "variant", void 0);
|
|
6978
|
+
__decorate([
|
|
6979
|
+
n({ type: Boolean, reflect: true })
|
|
6980
|
+
], Tooltip.prototype, "preview", void 0);
|
|
6624
6981
|
__decorate([
|
|
6625
6982
|
e$4('#tooltip')
|
|
6626
6983
|
], Tooltip.prototype, "floatingEl", void 0);
|
|
6627
6984
|
|
|
6628
|
-
var css_248z$
|
|
6985
|
+
var css_248z$7 = i`* {
|
|
6629
6986
|
box-sizing: border-box;
|
|
6630
6987
|
}
|
|
6631
6988
|
|
|
@@ -6663,24 +7020,23 @@ ol {
|
|
|
6663
7020
|
|
|
6664
7021
|
/**
|
|
6665
7022
|
* @label Breadcrumb
|
|
6666
|
-
* @tag
|
|
7023
|
+
* @tag wc-breadcrumb
|
|
6667
7024
|
* @rawTag breadcrumb
|
|
6668
|
-
*
|
|
6669
7025
|
* @summary A breadcrumb is a secondary navigation scheme that reveals the user's location in a website or web application.
|
|
6670
7026
|
* @overview
|
|
6671
7027
|
* - Breadcrumbs provide a trail for users to follow back to the starting or entry point.
|
|
6672
7028
|
* - They help users understand their current location within the site hierarchy.
|
|
6673
7029
|
* - Follows WCAG 2.1 guidelines for accessible navigation landmarks.
|
|
7030
|
+
* @tags navigation
|
|
6674
7031
|
*
|
|
6675
7032
|
* @example
|
|
6676
7033
|
* ```html
|
|
6677
|
-
* <
|
|
6678
|
-
* <breadcrumb-item href="#">Home</breadcrumb-item>
|
|
6679
|
-
* <breadcrumb-item href="#">Category</breadcrumb-item>
|
|
6680
|
-
* <breadcrumb-item active>Current Page</breadcrumb-item>
|
|
6681
|
-
* </
|
|
7034
|
+
* <wc-breadcrumb label="Breadcrumb">
|
|
7035
|
+
* <wc-breadcrumb-item href="#">Home</wc-breadcrumb-item>
|
|
7036
|
+
* <wc-breadcrumb-item href="#">Category</wc-breadcrumb-item>
|
|
7037
|
+
* <wc-breadcrumb-item active>Current Page</wc-breadcrumb-item>
|
|
7038
|
+
* </wc-breadcrumb>
|
|
6682
7039
|
* ```
|
|
6683
|
-
* @tags navigation
|
|
6684
7040
|
*/
|
|
6685
7041
|
class Breadcrumb extends i$1 {
|
|
6686
7042
|
constructor() {
|
|
@@ -6699,7 +7055,7 @@ class Breadcrumb extends i$1 {
|
|
|
6699
7055
|
</nav>`;
|
|
6700
7056
|
}
|
|
6701
7057
|
}
|
|
6702
|
-
Breadcrumb.styles = [css_248z$
|
|
7058
|
+
Breadcrumb.styles = [css_248z$7];
|
|
6703
7059
|
__decorate([
|
|
6704
7060
|
n({ type: String })
|
|
6705
7061
|
], Breadcrumb.prototype, "label", void 0);
|
|
@@ -6710,7 +7066,7 @@ __decorate([
|
|
|
6710
7066
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6711
7067
|
*/const o=o=>o??A;
|
|
6712
7068
|
|
|
6713
|
-
var css_248z$
|
|
7069
|
+
var css_248z$6 = i`* {
|
|
6714
7070
|
box-sizing: border-box;
|
|
6715
7071
|
}
|
|
6716
7072
|
|
|
@@ -6770,15 +7126,15 @@ var css_248z$1 = i`* {
|
|
|
6770
7126
|
|
|
6771
7127
|
/**
|
|
6772
7128
|
* @label Breadcrumb Item
|
|
6773
|
-
* @tag breadcrumb-item
|
|
7129
|
+
* @tag wc-breadcrumb-item
|
|
6774
7130
|
* @rawTag breadcrumb-item
|
|
6775
7131
|
* @summary A breadcrumb item component that represents a single item in a breadcrumb navigation.
|
|
7132
|
+
* @tags navigation
|
|
6776
7133
|
*
|
|
6777
7134
|
* @example
|
|
6778
7135
|
* ```html
|
|
6779
|
-
* <breadcrumb-item href="#">Home</breadcrumb-item>
|
|
7136
|
+
* <wc-breadcrumb-item href="#">Home</wc-breadcrumb-item>
|
|
6780
7137
|
* ```
|
|
6781
|
-
* @tags navigation
|
|
6782
7138
|
*/
|
|
6783
7139
|
class BreadcrumbItem extends i$1 {
|
|
6784
7140
|
constructor() {
|
|
@@ -6839,7 +7195,7 @@ class BreadcrumbItem extends i$1 {
|
|
|
6839
7195
|
`;
|
|
6840
7196
|
}
|
|
6841
7197
|
}
|
|
6842
|
-
BreadcrumbItem.styles = [css_248z$
|
|
7198
|
+
BreadcrumbItem.styles = [css_248z$6];
|
|
6843
7199
|
__decorate([
|
|
6844
7200
|
n({ reflect: true })
|
|
6845
7201
|
], BreadcrumbItem.prototype, "href", void 0);
|
|
@@ -6856,18 +7212,24 @@ __decorate([
|
|
|
6856
7212
|
r()
|
|
6857
7213
|
], BreadcrumbItem.prototype, "position", void 0);
|
|
6858
7214
|
|
|
6859
|
-
var css_248z = i`@charset "UTF-8";
|
|
7215
|
+
var css_248z$5 = i`@charset "UTF-8";
|
|
6860
7216
|
:host {
|
|
6861
|
-
display:
|
|
7217
|
+
display: block;
|
|
7218
|
+
height: 100%;
|
|
7219
|
+
width: 100%;
|
|
6862
7220
|
}
|
|
6863
7221
|
|
|
6864
7222
|
.image-wrapper {
|
|
6865
|
-
|
|
6866
|
-
|
|
7223
|
+
display: flex;
|
|
7224
|
+
align-items: center;
|
|
7225
|
+
justify-content: center;
|
|
7226
|
+
height: 100%;
|
|
7227
|
+
width: 100%;
|
|
6867
7228
|
}
|
|
6868
7229
|
|
|
6869
7230
|
img {
|
|
6870
7231
|
display: block;
|
|
7232
|
+
max-height: 100%;
|
|
6871
7233
|
max-width: 100%;
|
|
6872
7234
|
}
|
|
6873
7235
|
|
|
@@ -6883,7 +7245,7 @@ img.clickable {
|
|
|
6883
7245
|
}
|
|
6884
7246
|
|
|
6885
7247
|
/* Preview overlay — rendered in light DOM via portal, but we keep
|
|
6886
|
-
|
|
7248
|
+
a host-level overlay as a fallback when shadow DOM is used. */
|
|
6887
7249
|
.preview-overlay {
|
|
6888
7250
|
display: none;
|
|
6889
7251
|
position: fixed;
|
|
@@ -6909,23 +7271,15 @@ img.clickable {
|
|
|
6909
7271
|
|
|
6910
7272
|
/**
|
|
6911
7273
|
* @label Image
|
|
6912
|
-
* @tag
|
|
7274
|
+
* @tag wc-image
|
|
6913
7275
|
* @rawTag image
|
|
6914
|
-
*
|
|
6915
|
-
* @
|
|
6916
|
-
* @overview
|
|
6917
|
-
* - CodeHighlighter is a component that provides syntax highlighting for code snippets.
|
|
6918
|
-
* - It supports various programming languages and can display line numbers for better readability.
|
|
7276
|
+
* @summary An image component with lazy loading and theme support.
|
|
7277
|
+
* @tags media
|
|
6919
7278
|
*
|
|
6920
7279
|
* @example
|
|
6921
7280
|
* ```html
|
|
6922
|
-
* <
|
|
6923
|
-
* function helloWorld() {
|
|
6924
|
-
* console.log('Hello, world!');
|
|
6925
|
-
* }</code></pre>
|
|
6926
|
-
* </code-highlighter>
|
|
7281
|
+
* <wc-image src="image.jpg" alt="Description"></wc-image>
|
|
6927
7282
|
* ```
|
|
6928
|
-
* @tags display
|
|
6929
7283
|
*/
|
|
6930
7284
|
class Image extends i$1 {
|
|
6931
7285
|
constructor() {
|
|
@@ -7015,7 +7369,7 @@ class Image extends i$1 {
|
|
|
7015
7369
|
`;
|
|
7016
7370
|
}
|
|
7017
7371
|
}
|
|
7018
|
-
Image.styles = [css_248z];
|
|
7372
|
+
Image.styles = [css_248z$5];
|
|
7019
7373
|
__decorate([
|
|
7020
7374
|
n({ reflect: true })
|
|
7021
7375
|
], Image.prototype, "src", void 0);
|
|
@@ -7038,5 +7392,936 @@ __decorate([
|
|
|
7038
7392
|
r()
|
|
7039
7393
|
], Image.prototype, "_previewOpen", void 0);
|
|
7040
7394
|
|
|
7041
|
-
|
|
7042
|
-
|
|
7395
|
+
var css_248z$4 = i`* {
|
|
7396
|
+
box-sizing: border-box;
|
|
7397
|
+
}
|
|
7398
|
+
|
|
7399
|
+
.screen-reader-only {
|
|
7400
|
+
display: none !important;
|
|
7401
|
+
}
|
|
7402
|
+
|
|
7403
|
+
:host {
|
|
7404
|
+
display: inline-block;
|
|
7405
|
+
height: 100%;
|
|
7406
|
+
--tab-outline-color: var(--color-primary);
|
|
7407
|
+
}
|
|
7408
|
+
|
|
7409
|
+
.tab-element {
|
|
7410
|
+
background: transparent;
|
|
7411
|
+
border: none;
|
|
7412
|
+
appearance: none;
|
|
7413
|
+
margin: 0;
|
|
7414
|
+
outline: none;
|
|
7415
|
+
text-decoration: none;
|
|
7416
|
+
}
|
|
7417
|
+
|
|
7418
|
+
.tab {
|
|
7419
|
+
position: relative;
|
|
7420
|
+
display: flex;
|
|
7421
|
+
flex-direction: column;
|
|
7422
|
+
align-items: center;
|
|
7423
|
+
justify-content: center;
|
|
7424
|
+
height: var(--_tab-height);
|
|
7425
|
+
padding: 0 var(--_container-padding);
|
|
7426
|
+
width: 100%;
|
|
7427
|
+
cursor: pointer;
|
|
7428
|
+
}
|
|
7429
|
+
.tab .tab-content {
|
|
7430
|
+
position: relative;
|
|
7431
|
+
font-family: var(--typography-title-small-font-family) !important;
|
|
7432
|
+
font-size: var(--typography-title-small-font-size) !important;
|
|
7433
|
+
font-weight: var(--typography-title-small-font-weight) !important;
|
|
7434
|
+
line-height: var(--typography-title-small-line-height) !important;
|
|
7435
|
+
letter-spacing: var(--typography-title-small-letter-spacing) !important;
|
|
7436
|
+
display: flex;
|
|
7437
|
+
align-items: center;
|
|
7438
|
+
justify-content: center;
|
|
7439
|
+
gap: var(--_tab-icon-label-spacing);
|
|
7440
|
+
width: 100%;
|
|
7441
|
+
height: 100%;
|
|
7442
|
+
z-index: 0;
|
|
7443
|
+
color: var(--_label-text-color);
|
|
7444
|
+
opacity: var(--_label-text-opacity, 1);
|
|
7445
|
+
--icon-size: var(--tab-icon-size, var(--_tab-icon-size));
|
|
7446
|
+
--icon-color: var(--_label-text-color);
|
|
7447
|
+
}
|
|
7448
|
+
.tab .tab-content .slot-container {
|
|
7449
|
+
display: none;
|
|
7450
|
+
}
|
|
7451
|
+
.tab .indicator {
|
|
7452
|
+
position: absolute;
|
|
7453
|
+
pointer-events: none;
|
|
7454
|
+
z-index: 1;
|
|
7455
|
+
opacity: 0;
|
|
7456
|
+
background: var(--_active-indicator-color);
|
|
7457
|
+
border-radius: var(--_active-indicator-shape);
|
|
7458
|
+
transform-origin: left bottom;
|
|
7459
|
+
height: var(--_active-indicator-height);
|
|
7460
|
+
inset: auto 0px 0px;
|
|
7461
|
+
opacity: 0;
|
|
7462
|
+
}
|
|
7463
|
+
.tab.has-content .slot-container {
|
|
7464
|
+
display: flex;
|
|
7465
|
+
flex: none;
|
|
7466
|
+
justify-content: center;
|
|
7467
|
+
}
|
|
7468
|
+
.tab.disabled {
|
|
7469
|
+
cursor: not-allowed;
|
|
7470
|
+
}
|
|
7471
|
+
.tab {
|
|
7472
|
+
/*
|
|
7473
|
+
Background layers
|
|
7474
|
+
*/
|
|
7475
|
+
}
|
|
7476
|
+
.tab .focus-ring {
|
|
7477
|
+
z-index: 2;
|
|
7478
|
+
--focus-ring-container-shape-start-start: var(--_container-shape-start-start);
|
|
7479
|
+
--focus-ring-container-shape-start-end: var(--_container-shape-start-end);
|
|
7480
|
+
--focus-ring-container-shape-end-start: var(--_container-shape-end-start);
|
|
7481
|
+
--focus-ring-container-shape-end-end: var(--_container-shape-end-end);
|
|
7482
|
+
--focus-ring-container-shape-variant: var(--_container-corner-shape-variant);
|
|
7483
|
+
}
|
|
7484
|
+
.tab .ripple {
|
|
7485
|
+
corner-shape: var(--_container-corner-shape-variant);
|
|
7486
|
+
--ripple-state-opacity: var(--_container-state-opacity, 0);
|
|
7487
|
+
--ripple-pressed-color: var(--_container-state-color);
|
|
7488
|
+
}
|
|
7489
|
+
.tab .outline {
|
|
7490
|
+
z-index: 1;
|
|
7491
|
+
display: none;
|
|
7492
|
+
position: absolute;
|
|
7493
|
+
width: 100%;
|
|
7494
|
+
height: 100%;
|
|
7495
|
+
pointer-events: none;
|
|
7496
|
+
border: var(--_outline-width) solid var(--_outline-color);
|
|
7497
|
+
border-start-start-radius: var(--_container-shape-start-start);
|
|
7498
|
+
border-start-end-radius: var(--_container-shape-start-end);
|
|
7499
|
+
border-end-start-radius: var(--_container-shape-end-start);
|
|
7500
|
+
border-end-end-radius: var(--_container-shape-end-end);
|
|
7501
|
+
}
|
|
7502
|
+
|
|
7503
|
+
:host-context([variant=line]) .tab {
|
|
7504
|
+
--_tab-height: 100%;
|
|
7505
|
+
--_container-padding: 1rem;
|
|
7506
|
+
--_label-text-color: var(--color-on-surface);
|
|
7507
|
+
--_container-state-color: var(--_label-text-color);
|
|
7508
|
+
--_container-shape-start-start: var(--shape-corner-small);
|
|
7509
|
+
--_container-shape-start-end: var(--shape-corner-small);
|
|
7510
|
+
--_container-shape-end-start: var(--shape-corner-small);
|
|
7511
|
+
--_container-shape-end-end: var(--shape-corner-small);
|
|
7512
|
+
--_active-indicator-color: var(--color-primary);
|
|
7513
|
+
--_active-indicator-shape: 3px 3px 0 0;
|
|
7514
|
+
--_active-indicator-height: 2px;
|
|
7515
|
+
}
|
|
7516
|
+
:host-context([variant=line]) .tab .focus-ring {
|
|
7517
|
+
inset: 3px 3px 4px 3px;
|
|
7518
|
+
}
|
|
7519
|
+
:host-context([variant=line]) .tab.active .tab-content .indicator {
|
|
7520
|
+
opacity: 1;
|
|
7521
|
+
}
|
|
7522
|
+
:host-context([variant=line]) .tab.active .focus-ring {
|
|
7523
|
+
inset: 3px 3px calc(4px + var(--_active-indicator-height)) 3px;
|
|
7524
|
+
}
|
|
7525
|
+
:host-context([variant=line]) .tab:hover:not(:where(.disabled)) {
|
|
7526
|
+
--_container-state-opacity: 0.08;
|
|
7527
|
+
}
|
|
7528
|
+
:host-context([variant=line]) .tab.pressed:not(:where(.disabled)) {
|
|
7529
|
+
--_container-state-opacity: 0.12;
|
|
7530
|
+
}
|
|
7531
|
+
:host-context([variant=line]) .tab.disabled {
|
|
7532
|
+
--_label-text-color: var(--color-on-surface);
|
|
7533
|
+
--_label-text-opacity: 0.38;
|
|
7534
|
+
}
|
|
7535
|
+
:host-context([variant=line]) .tab.disabled .ripple {
|
|
7536
|
+
display: none;
|
|
7537
|
+
}`;
|
|
7538
|
+
|
|
7539
|
+
var _Tab_id;
|
|
7540
|
+
/**
|
|
7541
|
+
* @label Tab
|
|
7542
|
+
* @tag wc-tab
|
|
7543
|
+
* @rawTag tab
|
|
7544
|
+
*
|
|
7545
|
+
* @summary A tab component for use within tabs.
|
|
7546
|
+
* @overview
|
|
7547
|
+
* <p>Tab represents an individual tab in a tabs component.</p>
|
|
7548
|
+
*
|
|
7549
|
+
* @example
|
|
7550
|
+
* ```html
|
|
7551
|
+
* <wc-tab>Tab Label</wc-tab>
|
|
7552
|
+
* ```
|
|
7553
|
+
* @tags navigation
|
|
7554
|
+
*/
|
|
7555
|
+
class Tab extends i$1 {
|
|
7556
|
+
focus() {
|
|
7557
|
+
this.tabElement?.focus();
|
|
7558
|
+
}
|
|
7559
|
+
blur() {
|
|
7560
|
+
this.tabElement?.blur();
|
|
7561
|
+
}
|
|
7562
|
+
constructor() {
|
|
7563
|
+
super();
|
|
7564
|
+
_Tab_id.set(this, crypto.randomUUID());
|
|
7565
|
+
this.active = false;
|
|
7566
|
+
this.disabled = false;
|
|
7567
|
+
this.disabledReason = '';
|
|
7568
|
+
/**
|
|
7569
|
+
* Sets or retrieves the window or frame at which to target content.
|
|
7570
|
+
*/
|
|
7571
|
+
this.target = '_self';
|
|
7572
|
+
/**
|
|
7573
|
+
* Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.
|
|
7574
|
+
*/
|
|
7575
|
+
this.throttleDelay = 200;
|
|
7576
|
+
this.hasFocus = false;
|
|
7577
|
+
this.slotHasContent = false;
|
|
7578
|
+
/**
|
|
7579
|
+
* States
|
|
7580
|
+
*/
|
|
7581
|
+
this.isPressed = false;
|
|
7582
|
+
this._tabindex = 0;
|
|
7583
|
+
this.__dispatchClickWithThrottle = event => {
|
|
7584
|
+
this.__dispatchClick(event);
|
|
7585
|
+
};
|
|
7586
|
+
this.__dispatchClick = (event) => {
|
|
7587
|
+
// If the button is soft-disabled or a disabled link, we need to explicitly
|
|
7588
|
+
// prevent the click from propagating to other event listeners as well as
|
|
7589
|
+
// prevent the default action.
|
|
7590
|
+
if (this.disabled && this.href) {
|
|
7591
|
+
event.stopImmediatePropagation();
|
|
7592
|
+
event.preventDefault();
|
|
7593
|
+
return;
|
|
7594
|
+
}
|
|
7595
|
+
if (!isActivationClick(event) || !this.tabElement) {
|
|
7596
|
+
return;
|
|
7597
|
+
}
|
|
7598
|
+
this.focus();
|
|
7599
|
+
dispatchActivationClick(this.tabElement);
|
|
7600
|
+
};
|
|
7601
|
+
this.__handlePress = (event) => {
|
|
7602
|
+
if (this.disabled)
|
|
7603
|
+
return;
|
|
7604
|
+
if (event instanceof KeyboardEvent &&
|
|
7605
|
+
event.type === 'keydown' &&
|
|
7606
|
+
(event.key === 'Enter' || event.key === ' ')) {
|
|
7607
|
+
this.isPressed = true;
|
|
7608
|
+
}
|
|
7609
|
+
else if (event.type === 'mousedown') {
|
|
7610
|
+
this.isPressed = true;
|
|
7611
|
+
}
|
|
7612
|
+
else {
|
|
7613
|
+
this.isPressed = false;
|
|
7614
|
+
}
|
|
7615
|
+
};
|
|
7616
|
+
this._tabindex = 0;
|
|
7617
|
+
}
|
|
7618
|
+
firstUpdated() {
|
|
7619
|
+
this.__dispatchClickWithThrottle = throttle(this.__dispatchClick, this.throttleDelay);
|
|
7620
|
+
observerSlotChangesWithCallback(this.renderRoot.querySelector('slot'), hasContent => {
|
|
7621
|
+
this.slotHasContent = hasContent;
|
|
7622
|
+
this.requestUpdate();
|
|
7623
|
+
});
|
|
7624
|
+
}
|
|
7625
|
+
__isLink() {
|
|
7626
|
+
return !!this.href;
|
|
7627
|
+
}
|
|
7628
|
+
// private handleKeyDown(evt: KeyboardEvent) {
|
|
7629
|
+
// if (this.disabled || this.showLoader) return;
|
|
7630
|
+
// if (evt.key === 'Enter' || evt.key === ' ') {
|
|
7631
|
+
// evt.preventDefault();
|
|
7632
|
+
// this.isActive = true;
|
|
7633
|
+
// this.dispatchTabClick();
|
|
7634
|
+
// }
|
|
7635
|
+
// }
|
|
7636
|
+
render() {
|
|
7637
|
+
const isLink = this.__isLink();
|
|
7638
|
+
const cssClasses = {
|
|
7639
|
+
tab: true,
|
|
7640
|
+
'tab-element': true,
|
|
7641
|
+
disabled: this.disabled,
|
|
7642
|
+
pressed: this.isPressed,
|
|
7643
|
+
active: this.active,
|
|
7644
|
+
'has-content': this.slotHasContent
|
|
7645
|
+
};
|
|
7646
|
+
if (!isLink) {
|
|
7647
|
+
return b `<button
|
|
7648
|
+
class=${e$3(cssClasses)}
|
|
7649
|
+
tabindex="0"
|
|
7650
|
+
@mousedown=${this.__handlePress}
|
|
7651
|
+
@keydown=${this.__handlePress}
|
|
7652
|
+
@keyup=${this.__handlePress}
|
|
7653
|
+
?aria-describedby=${this.__getDisabledReasonID()}
|
|
7654
|
+
aria-disabled=${`${this.disabled}`}
|
|
7655
|
+
?disabled=${this.disabled}
|
|
7656
|
+
${spread(this.configAria)}
|
|
7657
|
+
>
|
|
7658
|
+
${this.renderTabContent()}
|
|
7659
|
+
</button>`;
|
|
7660
|
+
}
|
|
7661
|
+
return b `<a
|
|
7662
|
+
class=${e$3(cssClasses)}
|
|
7663
|
+
id="button"
|
|
7664
|
+
tabindex="0"
|
|
7665
|
+
href=${this.href}
|
|
7666
|
+
target=${this.target}
|
|
7667
|
+
@mousedown=${this.__handlePress}
|
|
7668
|
+
@keydown=${this.__handlePress}
|
|
7669
|
+
@keyup=${this.__handlePress}
|
|
7670
|
+
role="button"
|
|
7671
|
+
?aria-describedby=${this.__getDisabledReasonID()}
|
|
7672
|
+
aria-disabled=${`${this.disabled}`}
|
|
7673
|
+
${spread(this.configAria)}
|
|
7674
|
+
>
|
|
7675
|
+
${this.renderTabContent()}
|
|
7676
|
+
</a>`;
|
|
7677
|
+
}
|
|
7678
|
+
renderTabContent() {
|
|
7679
|
+
return b `
|
|
7680
|
+
<wc-focus-ring class="focus-ring" .control=${this} element="tabElement"></wc-focus-ring>
|
|
7681
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
7682
|
+
<div class="background"></div>
|
|
7683
|
+
<div class="outline"></div>
|
|
7684
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
7685
|
+
|
|
7686
|
+
<div class="tab-content">
|
|
7687
|
+
<div class="slot-container">
|
|
7688
|
+
<slot></slot>
|
|
7689
|
+
</div>
|
|
7690
|
+
|
|
7691
|
+
<slot name="icon"></slot>
|
|
7692
|
+
|
|
7693
|
+
<div class="indicator"></div>
|
|
7694
|
+
</div>
|
|
7695
|
+
|
|
7696
|
+
<div class="indicator"></div>
|
|
7697
|
+
|
|
7698
|
+
${this.__renderDisabledReason()}
|
|
7699
|
+
`;
|
|
7700
|
+
}
|
|
7701
|
+
__getDisabledReasonID() {
|
|
7702
|
+
return this.disabled && this.disabledReason
|
|
7703
|
+
? `disabled-reason-${__classPrivateFieldGet(this, _Tab_id, "f")}`
|
|
7704
|
+
: A;
|
|
7705
|
+
}
|
|
7706
|
+
__renderDisabledReason() {
|
|
7707
|
+
const disabledReasonID = this.__getDisabledReasonID();
|
|
7708
|
+
if (disabledReasonID)
|
|
7709
|
+
return b `<div
|
|
7710
|
+
id="disabled-reason-${__classPrivateFieldGet(this, _Tab_id, "f")}"
|
|
7711
|
+
role="tooltip"
|
|
7712
|
+
aria-label=${this.disabledReason}
|
|
7713
|
+
class="screen-reader-only"
|
|
7714
|
+
>
|
|
7715
|
+
{this.disabledReason}
|
|
7716
|
+
</div>`;
|
|
7717
|
+
return A;
|
|
7718
|
+
}
|
|
7719
|
+
}
|
|
7720
|
+
_Tab_id = new WeakMap();
|
|
7721
|
+
Tab.styles = [css_248z$4];
|
|
7722
|
+
__decorate([
|
|
7723
|
+
n({ type: Boolean, reflect: true })
|
|
7724
|
+
], Tab.prototype, "active", void 0);
|
|
7725
|
+
__decorate([
|
|
7726
|
+
n({ type: Boolean, reflect: true })
|
|
7727
|
+
], Tab.prototype, "disabled", void 0);
|
|
7728
|
+
__decorate([
|
|
7729
|
+
n({ type: String })
|
|
7730
|
+
], Tab.prototype, "disabledReason", void 0);
|
|
7731
|
+
__decorate([
|
|
7732
|
+
n({ type: String })
|
|
7733
|
+
], Tab.prototype, "icon", void 0);
|
|
7734
|
+
__decorate([
|
|
7735
|
+
n({ type: String })
|
|
7736
|
+
], Tab.prototype, "label", void 0);
|
|
7737
|
+
__decorate([
|
|
7738
|
+
n({ type: String })
|
|
7739
|
+
], Tab.prototype, "value", void 0);
|
|
7740
|
+
__decorate([
|
|
7741
|
+
n({ reflect: true })
|
|
7742
|
+
], Tab.prototype, "configAria", void 0);
|
|
7743
|
+
__decorate([
|
|
7744
|
+
n()
|
|
7745
|
+
], Tab.prototype, "target", void 0);
|
|
7746
|
+
__decorate([
|
|
7747
|
+
n({ type: String, reflect: true })
|
|
7748
|
+
], Tab.prototype, "href", void 0);
|
|
7749
|
+
__decorate([
|
|
7750
|
+
n()
|
|
7751
|
+
], Tab.prototype, "throttleDelay", void 0);
|
|
7752
|
+
__decorate([
|
|
7753
|
+
r()
|
|
7754
|
+
], Tab.prototype, "hasFocus", void 0);
|
|
7755
|
+
__decorate([
|
|
7756
|
+
r()
|
|
7757
|
+
], Tab.prototype, "slotHasContent", void 0);
|
|
7758
|
+
__decorate([
|
|
7759
|
+
r()
|
|
7760
|
+
], Tab.prototype, "isPressed", void 0);
|
|
7761
|
+
__decorate([
|
|
7762
|
+
e$4('.tab-element')
|
|
7763
|
+
], Tab.prototype, "tabElement", void 0);
|
|
7764
|
+
|
|
7765
|
+
var css_248z$3 = i`* {
|
|
7766
|
+
box-sizing: border-box;
|
|
7767
|
+
}
|
|
7768
|
+
|
|
7769
|
+
.screen-reader-only {
|
|
7770
|
+
display: none !important;
|
|
7771
|
+
}
|
|
7772
|
+
|
|
7773
|
+
:host {
|
|
7774
|
+
display: flex;
|
|
7775
|
+
flex-direction: column;
|
|
7776
|
+
height: 100%;
|
|
7777
|
+
}`;
|
|
7778
|
+
|
|
7779
|
+
/**
|
|
7780
|
+
* @label Tab Group
|
|
7781
|
+
* @tag wc-tab-group
|
|
7782
|
+
* @rawTag tab-group
|
|
7783
|
+
*
|
|
7784
|
+
* @summary The tab group component is used to display multiple panels of content in a container.
|
|
7785
|
+
* @overview
|
|
7786
|
+
* <p>The tab group component allows users to switch between different views or content sections.</p>
|
|
7787
|
+
*
|
|
7788
|
+
* @example
|
|
7789
|
+
* ```html
|
|
7790
|
+
* <wc-tab-group>
|
|
7791
|
+
*
|
|
7792
|
+
* <wc-tabs>
|
|
7793
|
+
* <wc-tab selected >Tab 1</wc-tab>
|
|
7794
|
+
* <wc-tab>Tab 2</wc-tab>
|
|
7795
|
+
* </wc-tabs>
|
|
7796
|
+
*
|
|
7797
|
+
* <wc-tab-panel>Panel 1</wc-tab-panel>
|
|
7798
|
+
* <wc-tab-panel>Panel 2</wc-tab-panel>
|
|
7799
|
+
* </wc-tab-group>
|
|
7800
|
+
* ```
|
|
7801
|
+
* @tags navigation
|
|
7802
|
+
*/
|
|
7803
|
+
class TabGroup extends i$1 {
|
|
7804
|
+
constructor() {
|
|
7805
|
+
super(...arguments);
|
|
7806
|
+
this.variant = 'line';
|
|
7807
|
+
this.uid = crypto.randomUUID();
|
|
7808
|
+
this.onTabClick = (event) => {
|
|
7809
|
+
const custom = event;
|
|
7810
|
+
event.stopPropagation();
|
|
7811
|
+
const targetValue = custom.detail?.target || custom.detail?.value;
|
|
7812
|
+
if (targetValue) {
|
|
7813
|
+
this.selectTab(targetValue);
|
|
7814
|
+
}
|
|
7815
|
+
};
|
|
7816
|
+
}
|
|
7817
|
+
connectedCallback() {
|
|
7818
|
+
super.connectedCallback();
|
|
7819
|
+
this.addEventListener('base-tab-click', this.onTabClick);
|
|
7820
|
+
}
|
|
7821
|
+
disconnectedCallback() {
|
|
7822
|
+
this.removeEventListener('base-tab-click', this.onTabClick);
|
|
7823
|
+
super.disconnectedCallback();
|
|
7824
|
+
}
|
|
7825
|
+
firstUpdated() {
|
|
7826
|
+
this.initializeTabs();
|
|
7827
|
+
}
|
|
7828
|
+
selectTab(target) {
|
|
7829
|
+
const tabs = this.getTabs();
|
|
7830
|
+
tabs.forEach((tab) => {
|
|
7831
|
+
tab.selected = false;
|
|
7832
|
+
tab.classList.remove('previous-tab', 'next-tab');
|
|
7833
|
+
});
|
|
7834
|
+
let selectedIndex = -1;
|
|
7835
|
+
tabs.forEach((tab, index) => {
|
|
7836
|
+
const t = tab.getAttribute('target') || tab.getAttribute('value');
|
|
7837
|
+
if (t === target) {
|
|
7838
|
+
selectedIndex = index;
|
|
7839
|
+
}
|
|
7840
|
+
});
|
|
7841
|
+
if (selectedIndex >= 0) {
|
|
7842
|
+
const selectedTab = tabs[selectedIndex];
|
|
7843
|
+
selectedTab.selected = true;
|
|
7844
|
+
if (tabs[selectedIndex - 1]) {
|
|
7845
|
+
tabs[selectedIndex - 1].classList.add('previous-tab');
|
|
7846
|
+
}
|
|
7847
|
+
if (tabs[selectedIndex + 1]) {
|
|
7848
|
+
tabs[selectedIndex + 1].classList.add('next-tab');
|
|
7849
|
+
}
|
|
7850
|
+
}
|
|
7851
|
+
const panels = this.getTabPanels();
|
|
7852
|
+
panels.forEach(panel => {
|
|
7853
|
+
const panelValue = panel.getAttribute('value');
|
|
7854
|
+
panel.active = panelValue === target;
|
|
7855
|
+
});
|
|
7856
|
+
}
|
|
7857
|
+
getTabs() {
|
|
7858
|
+
return this.querySelectorAll(':scope > tabs-list base-tab');
|
|
7859
|
+
}
|
|
7860
|
+
getTabPanels() {
|
|
7861
|
+
return this.querySelectorAll(':scope > base-tab-panel');
|
|
7862
|
+
}
|
|
7863
|
+
getTabList() {
|
|
7864
|
+
return this.querySelector(':scope > tabs-list');
|
|
7865
|
+
}
|
|
7866
|
+
tabsHaveTarget() {
|
|
7867
|
+
return !!this.querySelector(':scope > tabs-list base-tab[target]');
|
|
7868
|
+
}
|
|
7869
|
+
initializeTabs() {
|
|
7870
|
+
const tabs = Array.from(this.getTabs());
|
|
7871
|
+
if (!this.tabsHaveTarget()) {
|
|
7872
|
+
this.getTabPanels().forEach((panel, index) => {
|
|
7873
|
+
if (!panel.getAttribute('value')) {
|
|
7874
|
+
panel.setAttribute('value', `tab-${this.uid}-${index}`);
|
|
7875
|
+
}
|
|
7876
|
+
});
|
|
7877
|
+
if (tabs.length > 0) {
|
|
7878
|
+
const firstTarget = tabs[0].getAttribute('target');
|
|
7879
|
+
if (firstTarget) {
|
|
7880
|
+
this.selectTab(firstTarget);
|
|
7881
|
+
}
|
|
7882
|
+
}
|
|
7883
|
+
}
|
|
7884
|
+
else {
|
|
7885
|
+
const selectedTab = this.querySelector(':scope > tabs-list base-tab[selected]');
|
|
7886
|
+
if (selectedTab) {
|
|
7887
|
+
const selectedTarget = selectedTab.getAttribute('target');
|
|
7888
|
+
if (selectedTarget)
|
|
7889
|
+
this.selectTab(selectedTarget);
|
|
7890
|
+
}
|
|
7891
|
+
}
|
|
7892
|
+
}
|
|
7893
|
+
render() {
|
|
7894
|
+
return b `<slot></slot>`;
|
|
7895
|
+
}
|
|
7896
|
+
}
|
|
7897
|
+
TabGroup.styles = [css_248z$3];
|
|
7898
|
+
__decorate([
|
|
7899
|
+
n({ reflect: true })
|
|
7900
|
+
], TabGroup.prototype, "variant", void 0);
|
|
7901
|
+
|
|
7902
|
+
var css_248z$2 = i`* {
|
|
7903
|
+
box-sizing: border-box;
|
|
7904
|
+
}
|
|
7905
|
+
|
|
7906
|
+
.screen-reader-only {
|
|
7907
|
+
display: none !important;
|
|
7908
|
+
}
|
|
7909
|
+
|
|
7910
|
+
:host {
|
|
7911
|
+
display: block;
|
|
7912
|
+
flex: 1;
|
|
7913
|
+
}
|
|
7914
|
+
|
|
7915
|
+
:host([hidden]) {
|
|
7916
|
+
display: none;
|
|
7917
|
+
}`;
|
|
7918
|
+
|
|
7919
|
+
/**
|
|
7920
|
+
* @label Tab Panel
|
|
7921
|
+
* @tag wc-tab-panel
|
|
7922
|
+
* @rawTag tab-panel
|
|
7923
|
+
*
|
|
7924
|
+
* @summary Content panel for tabs.
|
|
7925
|
+
* @overview
|
|
7926
|
+
* <p>TabPanel contains the content associated with a tab.</p>
|
|
7927
|
+
*
|
|
7928
|
+
* @example
|
|
7929
|
+
* ```html
|
|
7930
|
+
* <wc-tab-panel>Content for this tab</wc-tab-panel>
|
|
7931
|
+
* ```
|
|
7932
|
+
* @tags navigation
|
|
7933
|
+
*/
|
|
7934
|
+
class TabPanel extends i$1 {
|
|
7935
|
+
render() {
|
|
7936
|
+
return b `<slot></slot>`;
|
|
7937
|
+
}
|
|
7938
|
+
}
|
|
7939
|
+
TabPanel.styles = [css_248z$2];
|
|
7940
|
+
__decorate([
|
|
7941
|
+
n({ reflect: true })
|
|
7942
|
+
], TabPanel.prototype, "value", void 0);
|
|
7943
|
+
|
|
7944
|
+
var css_248z$1 = i`* {
|
|
7945
|
+
box-sizing: border-box;
|
|
7946
|
+
}
|
|
7947
|
+
|
|
7948
|
+
.screen-reader-only {
|
|
7949
|
+
display: none !important;
|
|
7950
|
+
}
|
|
7951
|
+
|
|
7952
|
+
.tabs-list {
|
|
7953
|
+
display: flex;
|
|
7954
|
+
position: relative;
|
|
7955
|
+
width: 100%;
|
|
7956
|
+
}
|
|
7957
|
+
|
|
7958
|
+
:host-context([variant=line]) {
|
|
7959
|
+
--tabs-list-height: 3rem;
|
|
7960
|
+
}
|
|
7961
|
+
:host-context([variant=line]) .tabs-list {
|
|
7962
|
+
height: var(--tabs-list-height);
|
|
7963
|
+
border-bottom: 1px solid var(--color-surface-variant);
|
|
7964
|
+
}`;
|
|
7965
|
+
|
|
7966
|
+
/**
|
|
7967
|
+
* @label Tabs
|
|
7968
|
+
* @tag wc-tabs
|
|
7969
|
+
* @rawTag tabs
|
|
7970
|
+
*
|
|
7971
|
+
* @summary Container for tab components.
|
|
7972
|
+
* @overview
|
|
7973
|
+
* <p>Tabs holds the tab buttons and manages their layout.</p>
|
|
7974
|
+
*
|
|
7975
|
+
* @example
|
|
7976
|
+
* ```html
|
|
7977
|
+
* <wc-tabs>
|
|
7978
|
+
* <wc-tab>Tab 1</wc-tab>
|
|
7979
|
+
* <wc-tab>Tab 2</wc-tab>
|
|
7980
|
+
* </wc-tabs>
|
|
7981
|
+
* ```
|
|
7982
|
+
* @tags navigation
|
|
7983
|
+
*/
|
|
7984
|
+
class Tabs extends i$1 {
|
|
7985
|
+
constructor() {
|
|
7986
|
+
super(...arguments);
|
|
7987
|
+
this.managed = false;
|
|
7988
|
+
this.__handleTabClick = (event) => {
|
|
7989
|
+
if (this.managed)
|
|
7990
|
+
return;
|
|
7991
|
+
const detailEvent = event;
|
|
7992
|
+
const path = detailEvent.composedPath();
|
|
7993
|
+
const clickedTab = path.find(node => node instanceof Element && node.tagName.toLowerCase() === 'base-tab');
|
|
7994
|
+
if (!clickedTab)
|
|
7995
|
+
return;
|
|
7996
|
+
const tabs = this.querySelectorAll('base-tab');
|
|
7997
|
+
tabs.forEach(tab => {
|
|
7998
|
+
tab.active = false;
|
|
7999
|
+
});
|
|
8000
|
+
clickedTab.active = true;
|
|
8001
|
+
};
|
|
8002
|
+
}
|
|
8003
|
+
connectedCallback() {
|
|
8004
|
+
super.connectedCallback();
|
|
8005
|
+
this.addEventListener('click', this.__handleTabClick);
|
|
8006
|
+
}
|
|
8007
|
+
disconnectedCallback() {
|
|
8008
|
+
this.removeEventListener('click', this.__handleTabClick);
|
|
8009
|
+
super.disconnectedCallback();
|
|
8010
|
+
}
|
|
8011
|
+
render() {
|
|
8012
|
+
return b `
|
|
8013
|
+
<div class="tabs-list">
|
|
8014
|
+
<slot></slot>
|
|
8015
|
+
</div>
|
|
8016
|
+
`;
|
|
8017
|
+
}
|
|
8018
|
+
}
|
|
8019
|
+
Tabs.styles = [css_248z$1];
|
|
8020
|
+
__decorate([
|
|
8021
|
+
n({ type: Boolean })
|
|
8022
|
+
], Tabs.prototype, "managed", void 0);
|
|
8023
|
+
|
|
8024
|
+
var css_248z = i`:host {
|
|
8025
|
+
--_track-height: 4px;
|
|
8026
|
+
--_thumb-size: 20px;
|
|
8027
|
+
--thumb-half: 10px;
|
|
8028
|
+
--_active-track-color: var(--color-primary);
|
|
8029
|
+
--_inactive-track-color: var(--color-secondary-container);
|
|
8030
|
+
--_thumb-color: var(--color-primary);
|
|
8031
|
+
--_label-color: var(--color-primary);
|
|
8032
|
+
--_label-text-color: var(--color-on-primary);
|
|
8033
|
+
display: inline-block;
|
|
8034
|
+
width: 100%;
|
|
8035
|
+
min-width: 200px;
|
|
8036
|
+
vertical-align: middle;
|
|
8037
|
+
touch-action: none;
|
|
8038
|
+
}
|
|
8039
|
+
|
|
8040
|
+
.slider-container {
|
|
8041
|
+
position: relative;
|
|
8042
|
+
display: flex;
|
|
8043
|
+
align-items: center;
|
|
8044
|
+
width: 100%;
|
|
8045
|
+
height: 48px;
|
|
8046
|
+
cursor: pointer;
|
|
8047
|
+
}
|
|
8048
|
+
.slider-container.disabled {
|
|
8049
|
+
pointer-events: none;
|
|
8050
|
+
opacity: 0.38;
|
|
8051
|
+
}
|
|
8052
|
+
|
|
8053
|
+
.track {
|
|
8054
|
+
position: absolute;
|
|
8055
|
+
width: 100%;
|
|
8056
|
+
height: var(--_track-height);
|
|
8057
|
+
background-color: var(--_inactive-track-color);
|
|
8058
|
+
border-radius: var(--_track-height);
|
|
8059
|
+
overflow: hidden;
|
|
8060
|
+
pointer-events: none;
|
|
8061
|
+
}
|
|
8062
|
+
.track .track-active {
|
|
8063
|
+
position: absolute;
|
|
8064
|
+
height: 100%;
|
|
8065
|
+
background-color: var(--_active-track-color);
|
|
8066
|
+
transition: width 0.1s ease-out;
|
|
8067
|
+
will-change: width;
|
|
8068
|
+
}
|
|
8069
|
+
|
|
8070
|
+
.thumb {
|
|
8071
|
+
position: absolute;
|
|
8072
|
+
top: 50%;
|
|
8073
|
+
transform: translateY(-50%);
|
|
8074
|
+
width: var(--_thumb-size);
|
|
8075
|
+
height: var(--_thumb-size);
|
|
8076
|
+
background-color: var(--_thumb-color);
|
|
8077
|
+
border-radius: 50%;
|
|
8078
|
+
box-shadow: var(--md-sys-elevation-1);
|
|
8079
|
+
outline: none;
|
|
8080
|
+
cursor: grab;
|
|
8081
|
+
transition: left 0.05s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s ease;
|
|
8082
|
+
will-change: left;
|
|
8083
|
+
z-index: 2;
|
|
8084
|
+
display: flex;
|
|
8085
|
+
align-items: center;
|
|
8086
|
+
justify-content: center;
|
|
8087
|
+
}
|
|
8088
|
+
.thumb::before {
|
|
8089
|
+
content: "";
|
|
8090
|
+
position: absolute;
|
|
8091
|
+
top: 50%;
|
|
8092
|
+
left: 50%;
|
|
8093
|
+
width: 40px;
|
|
8094
|
+
height: 40px;
|
|
8095
|
+
transform: translate(-50%, -50%);
|
|
8096
|
+
border-radius: 50%;
|
|
8097
|
+
background-color: var(--_thumb-color);
|
|
8098
|
+
opacity: 0;
|
|
8099
|
+
transition: opacity 0.2s;
|
|
8100
|
+
}
|
|
8101
|
+
.thumb:hover::before {
|
|
8102
|
+
opacity: 0.08;
|
|
8103
|
+
}
|
|
8104
|
+
.thumb:focus-visible::before {
|
|
8105
|
+
opacity: 0.12;
|
|
8106
|
+
}
|
|
8107
|
+
.thumb:active {
|
|
8108
|
+
cursor: grabbing;
|
|
8109
|
+
box-shadow: var(--md-sys-elevation-5);
|
|
8110
|
+
}
|
|
8111
|
+
.thumb.dragging {
|
|
8112
|
+
transition: none;
|
|
8113
|
+
}
|
|
8114
|
+
|
|
8115
|
+
.value-label {
|
|
8116
|
+
position: absolute;
|
|
8117
|
+
bottom: 100%;
|
|
8118
|
+
margin-bottom: 8px;
|
|
8119
|
+
padding: 4px 8px;
|
|
8120
|
+
background-color: var(--_label-color);
|
|
8121
|
+
color: var(--_label-text-color);
|
|
8122
|
+
border-radius: 4px;
|
|
8123
|
+
font-size: 12px;
|
|
8124
|
+
white-space: nowrap;
|
|
8125
|
+
opacity: 0;
|
|
8126
|
+
transform: translateY(4px);
|
|
8127
|
+
transition: opacity 0.1s, transform 0.1s;
|
|
8128
|
+
pointer-events: none;
|
|
8129
|
+
}
|
|
8130
|
+
.value-label::after {
|
|
8131
|
+
content: "";
|
|
8132
|
+
position: absolute;
|
|
8133
|
+
top: 100%;
|
|
8134
|
+
left: 50%;
|
|
8135
|
+
transform: translateX(-50%);
|
|
8136
|
+
border: 6px solid transparent;
|
|
8137
|
+
border-top-color: var(--_label-color);
|
|
8138
|
+
}
|
|
8139
|
+
|
|
8140
|
+
.slider-container.dragging .value-label,
|
|
8141
|
+
.slider-container:active .value-label,
|
|
8142
|
+
.thumb:focus-visible .value-label {
|
|
8143
|
+
opacity: 1;
|
|
8144
|
+
transform: translateY(0);
|
|
8145
|
+
}`;
|
|
8146
|
+
|
|
8147
|
+
/**
|
|
8148
|
+
* @label Slider
|
|
8149
|
+
* @tag wc-slider
|
|
8150
|
+
* @rawTag slider
|
|
8151
|
+
*
|
|
8152
|
+
* @summary Sliders allow users to make selections from a range of values.
|
|
8153
|
+
*
|
|
8154
|
+
* @fires {CustomEvent} input - Dispatched when the slider value changes during interaction.
|
|
8155
|
+
* @fires {CustomEvent} change - Dispatched when the slider interaction ends.
|
|
8156
|
+
*
|
|
8157
|
+
* @example
|
|
8158
|
+
* ```html
|
|
8159
|
+
* <wc-slider min="0" max="100" value="50"></wc-slider>
|
|
8160
|
+
* ```
|
|
8161
|
+
*/
|
|
8162
|
+
class Slider extends i$1 {
|
|
8163
|
+
constructor() {
|
|
8164
|
+
super(...arguments);
|
|
8165
|
+
/**
|
|
8166
|
+
* The minimum value of the slider.
|
|
8167
|
+
*/
|
|
8168
|
+
this.min = 0;
|
|
8169
|
+
/**
|
|
8170
|
+
* The maximum value of the slider.
|
|
8171
|
+
*/
|
|
8172
|
+
this.max = 100;
|
|
8173
|
+
/**
|
|
8174
|
+
* The current value of the slider.
|
|
8175
|
+
*/
|
|
8176
|
+
this.value = 50;
|
|
8177
|
+
/**
|
|
8178
|
+
* The step increment for the slider.
|
|
8179
|
+
*/
|
|
8180
|
+
this.step = 1;
|
|
8181
|
+
/**
|
|
8182
|
+
* Whether the slider is disabled.
|
|
8183
|
+
*/
|
|
8184
|
+
this.disabled = false;
|
|
8185
|
+
/**
|
|
8186
|
+
* Whether to show labels on the slider.
|
|
8187
|
+
*/
|
|
8188
|
+
this.labeled = true;
|
|
8189
|
+
this.isDragging = false;
|
|
8190
|
+
this.onMouseMove = (e) => {
|
|
8191
|
+
if (this.isDragging) {
|
|
8192
|
+
e.preventDefault();
|
|
8193
|
+
this.handleInput(e);
|
|
8194
|
+
}
|
|
8195
|
+
};
|
|
8196
|
+
this.onMouseUp = () => {
|
|
8197
|
+
if (!this.isDragging)
|
|
8198
|
+
return;
|
|
8199
|
+
this.isDragging = false;
|
|
8200
|
+
this.container.classList.remove('dragging');
|
|
8201
|
+
this.thumbElement.classList.remove('dragging');
|
|
8202
|
+
this.dispatchEvent(new CustomEvent('change', { detail: { value: this.value }, bubbles: true, composed: true }));
|
|
8203
|
+
window.removeEventListener('mousemove', this.onMouseMove);
|
|
8204
|
+
window.removeEventListener('mouseup', this.onMouseUp);
|
|
8205
|
+
window.removeEventListener('touchmove', this.onMouseMove);
|
|
8206
|
+
window.removeEventListener('touchend', this.onMouseUp);
|
|
8207
|
+
window.removeEventListener('touchcancel', this.onMouseUp);
|
|
8208
|
+
};
|
|
8209
|
+
}
|
|
8210
|
+
handleInput(event) {
|
|
8211
|
+
if (this.disabled)
|
|
8212
|
+
return;
|
|
8213
|
+
const rect = this.container.getBoundingClientRect();
|
|
8214
|
+
const clientX = 'touches' in event ? event.touches[0].clientX : event.clientX;
|
|
8215
|
+
// Calculate percentage relative to track width
|
|
8216
|
+
let percentage = (clientX - rect.left) / rect.width;
|
|
8217
|
+
percentage = Math.max(0, Math.min(1, percentage));
|
|
8218
|
+
const rawValue = this.min + percentage * (this.max - this.min);
|
|
8219
|
+
const steppedValue = Math.round(rawValue / this.step) * this.step;
|
|
8220
|
+
const oldValue = this.value;
|
|
8221
|
+
this.value = Math.max(this.min, Math.min(this.max, steppedValue));
|
|
8222
|
+
if (oldValue !== this.value) {
|
|
8223
|
+
this.dispatchEvent(new CustomEvent('input', { detail: { value: this.value }, bubbles: true, composed: true }));
|
|
8224
|
+
}
|
|
8225
|
+
}
|
|
8226
|
+
onMouseDown(e) {
|
|
8227
|
+
if (this.disabled)
|
|
8228
|
+
return;
|
|
8229
|
+
e.preventDefault();
|
|
8230
|
+
this.isDragging = true;
|
|
8231
|
+
// Add dragging class for CSS state
|
|
8232
|
+
this.container.classList.add('dragging');
|
|
8233
|
+
this.thumbElement.classList.add('dragging');
|
|
8234
|
+
this.handleInput(e);
|
|
8235
|
+
window.addEventListener('mousemove', this.onMouseMove);
|
|
8236
|
+
window.addEventListener('mouseup', this.onMouseUp);
|
|
8237
|
+
window.addEventListener('touchmove', this.onMouseMove, { passive: false });
|
|
8238
|
+
window.addEventListener('touchend', this.onMouseUp);
|
|
8239
|
+
window.addEventListener('touchcancel', this.onMouseUp);
|
|
8240
|
+
}
|
|
8241
|
+
handleKeyDown(e) {
|
|
8242
|
+
if (this.disabled)
|
|
8243
|
+
return;
|
|
8244
|
+
const increment = e.shiftKey ? this.step * 10 : this.step;
|
|
8245
|
+
let newValue = this.value;
|
|
8246
|
+
if (e.key === 'ArrowRight' || e.key === 'ArrowUp') {
|
|
8247
|
+
newValue = Math.min(this.max, this.value + increment);
|
|
8248
|
+
e.preventDefault();
|
|
8249
|
+
}
|
|
8250
|
+
else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') {
|
|
8251
|
+
newValue = Math.max(this.min, this.value - increment);
|
|
8252
|
+
e.preventDefault();
|
|
8253
|
+
}
|
|
8254
|
+
else if (e.key === 'Home') {
|
|
8255
|
+
newValue = this.min;
|
|
8256
|
+
e.preventDefault();
|
|
8257
|
+
}
|
|
8258
|
+
else if (e.key === 'End') {
|
|
8259
|
+
newValue = this.max;
|
|
8260
|
+
e.preventDefault();
|
|
8261
|
+
}
|
|
8262
|
+
if (newValue !== this.value) {
|
|
8263
|
+
this.value = newValue;
|
|
8264
|
+
this.dispatchEvent(new CustomEvent('input', { detail: { value: this.value }, bubbles: true, composed: true }));
|
|
8265
|
+
this.dispatchEvent(new CustomEvent('change', { detail: { value: this.value }, bubbles: true, composed: true }));
|
|
8266
|
+
}
|
|
8267
|
+
}
|
|
8268
|
+
render() {
|
|
8269
|
+
const percentage = ((this.value - this.min) / (this.max - this.min)) * 100;
|
|
8270
|
+
return b `
|
|
8271
|
+
<div
|
|
8272
|
+
class="slider-container ${this.disabled ? 'disabled' : ''}"
|
|
8273
|
+
@mousedown=${this.onMouseDown}
|
|
8274
|
+
@touchstart=${this.onMouseDown}
|
|
8275
|
+
>
|
|
8276
|
+
<div class="track">
|
|
8277
|
+
<div class="track-active" style=${o$3({ width: `${percentage}%` })}></div>
|
|
8278
|
+
</div>
|
|
8279
|
+
|
|
8280
|
+
<div
|
|
8281
|
+
class="thumb"
|
|
8282
|
+
role="slider"
|
|
8283
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
8284
|
+
aria-valuemin=${this.min}
|
|
8285
|
+
aria-valuemax=${this.max}
|
|
8286
|
+
aria-valuenow=${this.value}
|
|
8287
|
+
aria-disabled=${this.disabled}
|
|
8288
|
+
style=${o$3({ left: `calc(${percentage}% - var(--thumb-half))` })}
|
|
8289
|
+
@keydown=${this.handleKeyDown}
|
|
8290
|
+
>
|
|
8291
|
+
${this.labeled ? b `<div class="value-label">${this.value}</div>` : ''}
|
|
8292
|
+
</div>
|
|
8293
|
+
</div>
|
|
8294
|
+
`;
|
|
8295
|
+
}
|
|
8296
|
+
}
|
|
8297
|
+
Slider.styles = [css_248z];
|
|
8298
|
+
__decorate([
|
|
8299
|
+
n({ type: Number })
|
|
8300
|
+
], Slider.prototype, "min", void 0);
|
|
8301
|
+
__decorate([
|
|
8302
|
+
n({ type: Number })
|
|
8303
|
+
], Slider.prototype, "max", void 0);
|
|
8304
|
+
__decorate([
|
|
8305
|
+
n({ type: Number, reflect: true })
|
|
8306
|
+
], Slider.prototype, "value", void 0);
|
|
8307
|
+
__decorate([
|
|
8308
|
+
n({ type: Number })
|
|
8309
|
+
], Slider.prototype, "step", void 0);
|
|
8310
|
+
__decorate([
|
|
8311
|
+
n({ type: Boolean, reflect: true })
|
|
8312
|
+
], Slider.prototype, "disabled", void 0);
|
|
8313
|
+
__decorate([
|
|
8314
|
+
n({ type: Boolean })
|
|
8315
|
+
], Slider.prototype, "labeled", void 0);
|
|
8316
|
+
__decorate([
|
|
8317
|
+
r()
|
|
8318
|
+
], Slider.prototype, "isDragging", void 0);
|
|
8319
|
+
__decorate([
|
|
8320
|
+
e$4('.slider-container')
|
|
8321
|
+
], Slider.prototype, "container", void 0);
|
|
8322
|
+
__decorate([
|
|
8323
|
+
e$4('.thumb')
|
|
8324
|
+
], Slider.prototype, "thumbElement", void 0);
|
|
8325
|
+
|
|
8326
|
+
export { Accordion as A, Badge as B, Chip as C, DatePicker as D, Elevation as E, Field as F, Icon as I, LinearProgress as L, NumberField as N, Ripple as R, Skeleton as S, Tab as T, Avatar as a, Breadcrumb as b, BreadcrumbItem as c, CircularProgress as d, Container as e, Divider as f, EmptyState as g, FocusRing as h, IconButton as i, Image as j, Input as k, Link as l, Slider as m, Spinner as n, Switch as o, TabGroup as p, TabPanel as q, Tabs as r, Tag as s, Textarea as t, TimePicker as u, Tooltip as v };
|
|
8327
|
+
//# sourceMappingURL=slider-Dk9CFWTG.js.map
|