scb-wc 0.1.78 → 0.1.80
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/README.md +41 -22
- package/all.js +0 -2
- package/index.js +88 -90
- package/mvc/components/all.js +0 -2
- package/mvc/components/scb-accordion/scb-accordion-item.js +3 -173
- package/mvc/components/scb-accordion/scb-accordion.js +4 -33
- package/mvc/components/scb-app-bar/scb-app-bar.js +2 -110
- package/mvc/components/scb-avatar/scb-avatar.js +2 -94
- package/mvc/components/scb-badge/scb-badge.js +2 -72
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -12
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +4 -91
- package/mvc/components/scb-button/scb-button.js +47 -309
- package/mvc/components/scb-calendar/scb-calendar-event.js +2 -6
- package/mvc/components/scb-calendar/scb-calendar.js +6 -120
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +21 -350
- package/mvc/components/scb-card/scb-card.js +54 -819
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +3 -31
- package/mvc/components/scb-checkbox/scb-checkbox.js +5 -127
- package/mvc/components/scb-chip/scb-chip.js +2 -76
- package/mvc/components/scb-collapse/scb-collapse.js +2 -44
- package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +7 -73
- package/mvc/components/scb-dialog/scb-dialog.js +2 -213
- package/mvc/components/scb-divider/scb-divider.js +1 -69
- package/mvc/components/scb-drawer/scb-drawer.js +6 -102
- package/mvc/components/scb-drop-zone/scb-drop-zone.js +2 -410
- package/mvc/components/scb-dropdown/scb-dropdown.js +17 -222
- package/mvc/components/scb-fab/scb-fab.js +7 -95
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +2 -69
- package/mvc/components/scb-fact-card/scb-fact-card.js +2 -214
- package/mvc/components/scb-footer/scb-footer-section.js +1 -3
- package/mvc/components/scb-footer/scb-footer.js +3 -172
- package/mvc/components/scb-gallery-grid/scb-gallery-grid.js +2 -112
- package/mvc/components/scb-grid/scb-grid-item.js +1 -32
- package/mvc/components/scb-grid/scb-grid.js +1 -99
- package/mvc/components/scb-grid/scb-stack.js +1 -33
- package/mvc/components/scb-header/scb-header-menu-item.js +1 -5
- package/mvc/components/scb-header/scb-header-tab.js +1 -5
- package/mvc/components/scb-header/scb-header.js +75 -888
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +43 -168
- package/mvc/components/scb-icon-button/scb-icon-button.js +59 -171
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +17 -218
- package/mvc/components/scb-link/scb-link.js +4 -55
- package/mvc/components/scb-list/scb-list-item.js +23 -126
- package/mvc/components/scb-list/scb-list.js +5 -26
- package/mvc/components/scb-menu/scb-menu-item.js +16 -190
- package/mvc/components/scb-menu/scb-menu-section.js +4 -36
- package/mvc/components/scb-menu/scb-menu.js +5 -69
- package/mvc/components/scb-menu/scb-sub-menu.js +2 -7
- package/mvc/components/scb-nav/scb-nav-item.js +1 -28
- package/mvc/components/scb-nav/scb-nav.js +5 -98
- package/mvc/components/scb-notification-card/scb-notification-card.js +7 -364
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +3 -50
- package/mvc/components/scb-options-menu/scb-options-menu.js +2 -82
- package/mvc/components/scb-options-menu/scb-options-sub-menu.js +2 -31
- package/mvc/components/scb-overlay/scb-overlay.js +3 -43
- package/mvc/components/scb-pagination/scb-pagination.js +19 -221
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +2 -67
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +4 -121
- package/mvc/components/scb-progress-stepper/scb-progress-stepper.js +2 -56
- package/mvc/components/scb-radio-button/scb-radio-button.js +5 -116
- package/mvc/components/scb-radio-button/scb-radio-group.js +2 -32
- package/mvc/components/scb-scrollspy/scb-scrollspy.js +2 -61
- package/mvc/components/scb-search/scb-search.js +5 -249
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +1 -32
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +2 -70
- package/mvc/components/scb-select/scb-select-option.js +2 -54
- package/mvc/components/scb-select/scb-select.js +4 -244
- package/mvc/components/scb-skeleton/scb-skeleton.js +2 -35
- package/mvc/components/scb-slider/scb-slider.js +5 -9
- package/mvc/components/scb-snackbar/scb-snackbar.js +9 -84
- package/mvc/components/scb-status-pill/scb-status-pill.js +2 -43
- package/mvc/components/scb-stepper/scb-step.js +8 -186
- package/mvc/components/scb-stepper/scb-stepper.js +2 -130
- package/mvc/components/scb-switch/scb-switch.js +4 -49
- package/mvc/components/scb-table/scb-table.js +2 -48
- package/mvc/components/scb-table-advanced/scb-table-advanced.js +2 -53
- package/mvc/components/scb-tabs/scb-primary-tab.js +2 -7
- package/mvc/components/scb-tabs/scb-secondary-tab.js +2 -7
- package/mvc/components/scb-tabs/scb-tabs.js +4 -31
- package/mvc/components/scb-textfield/scb-textfield.js +142 -388
- package/mvc/components/scb-toc/scb-toc-item.js +3 -251
- package/mvc/components/scb-toc/scb-toc.js +2 -16
- package/mvc/components/scb-tooltip/scb-tooltip.js +8 -155
- package/mvc/components/scb-viz/scb-viz.js +4 -619
- package/mvc/scb-wc-core.css +1 -1
- package/mvc/scb-wc-selfhost.css +1 -1
- package/mvc/scb-wc.css +1 -1
- package/mvc/vendor/assist-chip.js +3 -3
- package/mvc/vendor/chip-set.js +1 -1
- package/mvc/vendor/chip.js +2 -2
- package/mvc/vendor/elevation.js +2 -2
- package/mvc/vendor/filter-chip.js +1 -1
- package/mvc/vendor/focusable.js +1 -1
- package/mvc/vendor/form-associated.js +1 -1
- package/mvc/vendor/icon.js +2 -2
- package/mvc/vendor/lazy-focus-ring.js +2 -0
- package/mvc/vendor/lazy-ripple.js +2 -0
- package/mvc/vendor/md-focus-ring.js +2 -2
- package/mvc/vendor/ripple.js +2 -2
- package/mvc/vendor/scb-card-variants.internal.js +284 -0
- package/mvc/vendor/scb-chevron.js +10 -0
- package/mvc/vendor/scb-header-drawer.internal.js +71 -0
- package/mvc/vendor/shared-styles.js +1 -1
- package/mvc/vendor/tab-styles.js +3 -3
- package/mvc/vendor/validator.js +1 -1
- package/mvc/vendor/vendor.js +3 -4
- package/package.json +2 -2
- package/scb-accordion/scb-accordion-item.js +33 -32
- package/scb-app-bar/scb-app-bar.js +1 -1
- package/scb-button/scb-button.js +287 -259
- package/scb-calendar/scb-calendar.js +49 -49
- package/scb-calendar-card/scb-calendar-card.js +105 -59
- package/scb-card/scb-card-variants.internal.js +230 -0
- package/scb-card/scb-card.js +387 -528
- package/scb-checkbox/scb-checkbox.js +0 -1
- package/scb-chevron/scb-chevron.js +0 -1
- package/scb-components/scb-button/scb-button.d.ts +14 -2
- package/scb-components/scb-calendar/scb-calendar.d.ts +1 -0
- package/scb-components/scb-calendar-card/scb-calendar-card.d.ts +16 -4
- package/scb-components/scb-card/scb-card-variants.internal.d.ts +15 -0
- package/scb-components/scb-card/scb-card.d.ts +26 -9
- package/scb-components/scb-cookies-consent/scb-cookies-consent.d.ts +3 -0
- package/scb-components/scb-header/scb-header-drawer.internal.d.ts +31 -0
- package/scb-components/scb-header/scb-header.d.ts +1 -2
- package/scb-components/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +6 -1
- package/scb-components/scb-icon-button/scb-icon-button.d.ts +28 -29
- package/scb-components/scb-keyfigure-card/scb-keyfigure-card.d.ts +13 -4
- package/scb-components/scb-list/scb-list-item.d.ts +20 -2
- package/scb-components/scb-list/scb-list.d.ts +1 -2
- package/scb-components/scb-nav/scb-nav.d.ts +2 -0
- package/scb-components/scb-segmented-button/scb-segmented-item.d.ts +1 -0
- package/scb-components/scb-select/scb-select-option.d.ts +2 -0
- package/scb-components/scb-toc/scb-toc-item.d.ts +1 -0
- package/scb-components/scb-tooltip/scb-tooltip.d.ts +2 -0
- package/scb-cookies-consent/scb-cookies-consent.js +43 -31
- package/scb-datepicker/scb-datepicker.js +27 -25
- package/scb-dialog/scb-dialog.js +1 -1
- package/scb-dropdown/scb-dropdown.js +29 -28
- package/scb-header/scb-header-drawer.internal.js +78 -0
- package/scb-header/scb-header.js +41 -89
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +181 -88
- package/scb-icon-button/scb-icon-button.js +293 -205
- package/scb-keyfigure-card/scb-keyfigure-card.js +96 -43
- package/scb-list/scb-list-item.js +117 -52
- package/scb-list/scb-list.js +9 -9
- package/scb-nav/scb-nav.js +26 -23
- package/scb-notification-card/scb-notification-card.js +0 -2
- package/scb-options-menu/scb-options-menu-item.js +20 -20
- package/scb-pagination/scb-pagination.js +0 -1
- package/scb-progress-stepper/scb-progress-step.js +19 -17
- package/scb-radio-button/scb-radio-button.js +0 -1
- package/scb-search/scb-search.js +29 -28
- package/scb-segmented-button/scb-segmented-item.js +22 -19
- package/scb-select/scb-select-option.js +20 -14
- package/scb-select/scb-select.js +26 -26
- package/scb-stepper/scb-step.js +34 -31
- package/scb-textfield/scb-textfield.js +39 -39
- package/scb-toc/scb-toc-item.js +26 -26
- package/scb-tooltip/scb-tooltip.js +5 -4
- package/scb-viz/scb-viz.js +1 -1
- package/scb-wc-core.css +1 -1
- package/scb-wc-public-entry/index.d.ts +97 -0
- package/scb-wc-selfhost.css +1 -1
- package/scb-wc.bundle.js +1873 -1476
- package/scb-wc.css +1 -1
- package/scb-wc.d.ts +194 -198
- package/mvc/components/scb-chevron/scb-chevron.js +0 -41
- package/mvc/components/scb-datepicker/scb-datepicker.js +0 -296
- package/mvc/vendor/element-internals.js +0 -1
- package/mvc/vendor/filled-icon-button.js +0 -2
- package/mvc/vendor/filled-tonal-icon-button.js +0 -2
- package/mvc/vendor/form-label-activation.js +0 -1
- package/mvc/vendor/form-submitter.js +0 -1
- package/mvc/vendor/icon-button.js +0 -2
- package/mvc/vendor/list.js +0 -8
- package/mvc/vendor/outlined-icon-button.js +0 -2
- package/mvc/vendor/shared-styles2.js +0 -30
- package/scb-components/index.d.ts +0 -99
- package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -39
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
|
|
2
2
|
import { LitElement as t, css as n, html as r, nothing as i } from "lit";
|
|
3
3
|
import { customElement as a, property as o } from "lit/decorators.js";
|
|
4
|
-
import "@material/web/icon/icon.js";
|
|
5
4
|
//#region src/scb-components/scb-icon-button/scb-icon-button.ts
|
|
6
|
-
var s
|
|
5
|
+
var s, c;
|
|
6
|
+
function l() {
|
|
7
|
+
return s ??= import("../shared/lazy-focus-ring.js"), s;
|
|
8
|
+
}
|
|
9
|
+
function u() {
|
|
10
|
+
return c ??= import("../shared/lazy-ripple.js"), c;
|
|
11
|
+
}
|
|
12
|
+
var d = class extends t {
|
|
7
13
|
constructor(...e) {
|
|
8
|
-
super(...e), this.icon = "home", this.ariaLabel = "", this.variant = "standard", this.size = "medium", this.shape = "round", this.toggle = !1, this.selected = !1, this.toggleofficon = "add", this.toggleonicon = "remove", this.disabled = !1, this.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
super(...e), this.icon = "home", this.ariaLabel = "", this.variant = "standard", this.size = "medium", this.shape = "round", this.toggle = !1, this.selected = !1, this.toggleofficon = "add", this.toggleonicon = "remove", this.disabled = !1, this.href = "", this.target = "", this.rel = "", this.__filledValue = !1, this.__focusRingReady = !1, this.__focusRingImportRequested = !1, this.__rippleReady = !1, this.__pendingRippleClick = !1, this.__ensureFocusRing = () => {
|
|
15
|
+
this.__focusRingReady || this.__focusRingImportRequested || (this.__focusRingImportRequested = !0, l().then(({ ensureFocusRingReady: e }) => (e(), customElements.whenDefined("md-focus-ring"))).then(() => {
|
|
16
|
+
this.__focusRingReady = !0, this.toggleAttribute("data-native-focus-ring-ready", !0), this.requestUpdate(), this.updateComplete.then(() => this.__syncInteractiveState());
|
|
17
|
+
}));
|
|
18
|
+
}, this.__onFocusIn = (e) => {
|
|
19
|
+
let t = e.composedPath()[0];
|
|
20
|
+
t instanceof HTMLElement && t.matches(":focus-visible") && this.__ensureFocusRing();
|
|
21
|
+
}, this.__ensureRipple = (e, t = !1) => {
|
|
22
|
+
this.__rippleReady || this.disabled || (e && (this.__pendingRippleEvent = e), t && (this.__pendingRippleClick = !0), u().then(({ ensureRippleReady: e }) => e()).then(() => {
|
|
23
|
+
this.disabled || (this.__rippleReady = !0, this.toggleAttribute("data-native-ripple-ready", !0), this.requestUpdate(), this.updateComplete.then(() => this.__replayRippleState()));
|
|
24
|
+
}));
|
|
25
|
+
}, this.__onPointerInteraction = (e) => {
|
|
26
|
+
this.__ensureRipple(e);
|
|
27
|
+
}, this.__onClick = (e) => {
|
|
28
|
+
if (this.disabled) {
|
|
29
|
+
e.preventDefault(), e.stopPropagation();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.toggle && (this.selected = !this.selected, this.dispatchEvent(new CustomEvent("change", {
|
|
33
|
+
detail: { selected: this.selected },
|
|
12
34
|
bubbles: !0,
|
|
13
35
|
composed: !0
|
|
14
|
-
}));
|
|
36
|
+
}))), this.__ensureRipple(void 0, !0);
|
|
15
37
|
};
|
|
16
38
|
}
|
|
17
39
|
get filled() {
|
|
@@ -28,57 +50,40 @@ var s = class extends t {
|
|
|
28
50
|
let t = !!e, n = this.__filledValue;
|
|
29
51
|
n !== t && (this.__filledValue = t, this.requestUpdate("iconFilled", n), this.requestUpdate("filled", n));
|
|
30
52
|
}
|
|
31
|
-
|
|
32
|
-
|
|
53
|
+
firstUpdated() {
|
|
54
|
+
this.#e(), this.__syncInteractiveState();
|
|
33
55
|
}
|
|
34
56
|
updated(e) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
57
|
+
super.updated(e), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && this.#e(), (this.__focusRingReady || this.__rippleReady) && this.updateComplete.then(() => this.__syncInteractiveState());
|
|
58
|
+
}
|
|
59
|
+
focus(e) {
|
|
60
|
+
let t = this.__getNativeControl();
|
|
61
|
+
if (t) {
|
|
62
|
+
t.focus(e);
|
|
41
63
|
return;
|
|
42
64
|
}
|
|
43
|
-
|
|
44
|
-
this.__attachChangeListener(), this.__syncTitleAndAria();
|
|
45
|
-
});
|
|
65
|
+
super.focus(e);
|
|
46
66
|
}
|
|
47
|
-
|
|
48
|
-
this.
|
|
67
|
+
__getNativeControl() {
|
|
68
|
+
return this.renderRoot.querySelector(".native-icon-button");
|
|
49
69
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
break;
|
|
56
|
-
case "outlined":
|
|
57
|
-
await import("@material/web/iconbutton/outlined-icon-button.js");
|
|
58
|
-
break;
|
|
59
|
-
case "filled-tonal":
|
|
60
|
-
await import("@material/web/iconbutton/filled-tonal-icon-button.js");
|
|
61
|
-
break;
|
|
62
|
-
default:
|
|
63
|
-
await import("@material/web/iconbutton/icon-button.js");
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
this.__loadedVariants.add(this.variant);
|
|
67
|
-
}
|
|
68
|
-
this.__iconLoaded ||= (await import("@material/web/icon/icon.js"), !0);
|
|
70
|
+
__syncInteractiveState() {
|
|
71
|
+
let e = this.__getNativeControl(), t = this.renderRoot.querySelector("md-focus-ring");
|
|
72
|
+
t && e && (t.control = e, t.visible = e.matches(":focus-visible"));
|
|
73
|
+
let n = this.renderRoot.querySelector("md-ripple");
|
|
74
|
+
n && e && (n.control = e);
|
|
69
75
|
}
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
async __replayRippleState() {
|
|
77
|
+
let e = this.renderRoot.querySelector("md-ripple"), t = this.__getNativeControl(), n = this.__pendingRippleEvent, r = this.__pendingRippleClick;
|
|
78
|
+
this.__pendingRippleEvent = void 0, this.__pendingRippleClick = !1;
|
|
79
|
+
let { syncRippleToControl: i } = await u();
|
|
80
|
+
await i(e, t, n, r), this.__syncInteractiveState();
|
|
72
81
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
e && e !== this.__lastMdHost && (this.__lastMdHost?.removeEventListener?.("change", this.__onInnerChange), e.addEventListener("change", this.__onInnerChange), this.__lastMdHost = e), this.toggle && e && "selected" in e && (e.selected = this.selected);
|
|
82
|
+
__effectiveLabel() {
|
|
83
|
+
return (this.ariaLabel || this.getAttribute("aria-label") || "").trim() || this.__currentIcon() || i;
|
|
76
84
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (!e) return;
|
|
80
|
-
let t = (this.getAttribute("title") || "").trim(), n = (this.ariaLabel || this.getAttribute("aria-label") || "").trim(), r = this.getAttribute("aria-controls"), i = this.getAttribute("aria-expanded"), a = n || t || this.icon.trim() || void 0;
|
|
81
|
-
a ? e.setAttribute("aria-label", a) : e.removeAttribute("aria-label"), r === null ? e.removeAttribute("aria-controls") : e.setAttribute("aria-controls", r), i === null ? e.removeAttribute("aria-expanded") : e.setAttribute("aria-expanded", i);
|
|
85
|
+
__currentIcon() {
|
|
86
|
+
return this.toggle ? this.selected ? this.toggleonicon : this.toggleofficon : this.icon;
|
|
82
87
|
}
|
|
83
88
|
mapSpacingToken(e) {
|
|
84
89
|
if (!e) return;
|
|
@@ -99,48 +104,41 @@ var s = class extends t {
|
|
|
99
104
|
margin-inline-end: var(--scb-icon-button-spacing-inline-end, 0);
|
|
100
105
|
--scb-icon-button-font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
101
106
|
--scb-icon-button-shape-radius: var(--radius-full, 1000px);
|
|
102
|
-
|
|
103
|
-
--scb-icon-button-shape-square-radius: var(--radius-m, 12px);
|
|
104
|
-
--scb-icon-button-shape-square-radius-large: var(--radius-l, 16px);
|
|
105
|
-
|
|
106
107
|
--scb-icon-button-icon-size: var(--icon-size-medium, 24px);
|
|
107
|
-
--scb-icon-button-
|
|
108
|
-
--scb-icon-button-container-size: calc(
|
|
109
|
-
var(--scb-icon-button-icon-size) + (var(--scb-icon-button-padding) * 2)
|
|
110
|
-
);
|
|
108
|
+
--scb-icon-button-container-size: 40px;
|
|
111
109
|
}
|
|
112
110
|
|
|
113
|
-
:host([size=
|
|
111
|
+
:host([size='tiny']) {
|
|
114
112
|
--scb-icon-button-icon-size: var(--icon-size-tiny, 12px);
|
|
115
|
-
--scb-icon-button-
|
|
113
|
+
--scb-icon-button-container-size: 16px;
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
:host([size=
|
|
116
|
+
:host([size='extra-small']) {
|
|
119
117
|
--scb-icon-button-icon-size: var(--icon-size-extra-small, 16px);
|
|
120
|
-
--scb-icon-button-
|
|
118
|
+
--scb-icon-button-container-size: 24px;
|
|
121
119
|
}
|
|
122
120
|
|
|
123
|
-
:host([size=
|
|
121
|
+
:host([size='small']) {
|
|
124
122
|
--scb-icon-button-icon-size: var(--icon-size-small, 20px);
|
|
125
|
-
--scb-icon-button-
|
|
123
|
+
--scb-icon-button-container-size: 32px;
|
|
126
124
|
}
|
|
127
125
|
|
|
128
|
-
:host([size=
|
|
126
|
+
:host([size='medium']) {
|
|
129
127
|
--scb-icon-button-icon-size: var(--icon-size-medium, 24px);
|
|
130
|
-
--scb-icon-button-
|
|
128
|
+
--scb-icon-button-container-size: 40px;
|
|
131
129
|
}
|
|
132
130
|
|
|
133
|
-
:host([size=
|
|
131
|
+
:host([size='large']) {
|
|
134
132
|
--scb-icon-button-icon-size: var(--icon-size-medium, 24px);
|
|
135
|
-
--scb-icon-button-
|
|
133
|
+
--scb-icon-button-container-size: 56px;
|
|
136
134
|
}
|
|
137
135
|
|
|
138
|
-
:host([shape=
|
|
139
|
-
--scb-icon-button-shape-radius: var(--
|
|
136
|
+
:host([shape='square']) {
|
|
137
|
+
--scb-icon-button-shape-radius: var(--radius-m, 12px);
|
|
140
138
|
}
|
|
141
139
|
|
|
142
|
-
:host([shape=
|
|
143
|
-
--scb-icon-button-shape-radius: var(--
|
|
140
|
+
:host([shape='square'][size='large']) {
|
|
141
|
+
--scb-icon-button-shape-radius: var(--radius-l, 16px);
|
|
144
142
|
}
|
|
145
143
|
|
|
146
144
|
:host([filled]),
|
|
@@ -148,188 +146,278 @@ var s = class extends t {
|
|
|
148
146
|
--scb-icon-button-font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
149
147
|
}
|
|
150
148
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
149
|
+
.native-icon-button-wrap {
|
|
150
|
+
position: relative;
|
|
151
|
+
display: inline-flex;
|
|
152
|
+
inline-size: var(--scb-icon-button-container-size);
|
|
153
|
+
block-size: var(--scb-icon-button-container-size);
|
|
154
|
+
border-radius: var(--scb-icon-button-shape-radius);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.native-icon-button {
|
|
158
|
+
position: relative;
|
|
159
|
+
z-index: 0;
|
|
160
|
+
box-sizing: border-box;
|
|
161
|
+
display: inline-flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
justify-content: center;
|
|
164
|
+
inline-size: 100%;
|
|
165
|
+
block-size: 100%;
|
|
166
|
+
min-inline-size: 0;
|
|
167
|
+
min-block-size: 0;
|
|
168
|
+
padding: 0;
|
|
169
|
+
overflow: hidden;
|
|
170
|
+
border: 0;
|
|
171
|
+
border-radius: inherit;
|
|
172
|
+
background: transparent;
|
|
173
|
+
color: var(
|
|
174
|
+
--md-icon-button-icon-color,
|
|
175
|
+
var(--md-sys-color-on-surface-variant, var(--p-20, #0f0865))
|
|
176
|
+
);
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
text-decoration: none;
|
|
179
|
+
appearance: none;
|
|
180
|
+
-webkit-appearance: none;
|
|
181
|
+
touch-action: manipulation;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.native-icon-button::before {
|
|
185
|
+
content: '';
|
|
186
|
+
position: absolute;
|
|
187
|
+
inset: 0;
|
|
188
|
+
z-index: -1;
|
|
189
|
+
background: currentColor;
|
|
190
|
+
opacity: 0;
|
|
191
|
+
pointer-events: none;
|
|
192
|
+
transition: opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
:host(:not([data-native-ripple-ready])) .native-icon-button:hover::before {
|
|
196
|
+
opacity: var(--md-sys-state-hover-state-layer-opacity, 0.08);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:host(:not([data-native-ripple-ready])) .native-icon-button:active::before {
|
|
200
|
+
opacity: var(--md-sys-state-pressed-state-layer-opacity, 0.12);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.native-icon-button:focus {
|
|
204
|
+
outline: none;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
:host(:not([data-native-focus-ring-ready])) .native-icon-button:focus-visible {
|
|
208
|
+
outline: var(--stroke-border-m, 2px) solid var(--md-focus-ring-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));
|
|
209
|
+
outline-offset: var(--spacing-1, 2px);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.native-icon {
|
|
213
|
+
flex: 0 0 auto;
|
|
214
|
+
display: inline-block;
|
|
215
|
+
inline-size: var(--scb-icon-button-icon-size);
|
|
216
|
+
block-size: var(--scb-icon-button-icon-size);
|
|
217
|
+
overflow: hidden;
|
|
218
|
+
font-family: 'Material Symbols Outlined';
|
|
219
|
+
font-size: var(--scb-icon-button-icon-size);
|
|
220
|
+
line-height: 1;
|
|
221
|
+
text-align: center;
|
|
222
|
+
white-space: nowrap;
|
|
223
|
+
text-transform: none;
|
|
224
|
+
word-wrap: normal;
|
|
225
|
+
direction: ltr;
|
|
226
|
+
font-feature-settings: 'liga' 1;
|
|
227
|
+
font-variation-settings: var(--scb-icon-button-font-variation-settings);
|
|
228
|
+
-webkit-font-smoothing: antialiased;
|
|
229
|
+
-moz-osx-font-smoothing: grayscale;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
:host([variant='filled']) .native-icon-button {
|
|
233
|
+
background: var(--md-filled-icon-button-container-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));
|
|
234
|
+
color: var(--md-filled-icon-button-icon-color, var(--md-sys-color-on-primary, #ffffff));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
:host([variant='filled-tonal']) .native-icon-button {
|
|
238
|
+
background: var(
|
|
239
|
+
--md-filled-tonal-icon-button-container-color,
|
|
240
|
+
var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff))
|
|
241
|
+
);
|
|
242
|
+
color: var(
|
|
243
|
+
--md-filled-tonal-icon-button-icon-color,
|
|
244
|
+
var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be))
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
:host([variant='outlined']) .native-icon-button {
|
|
249
|
+
color: var(
|
|
250
|
+
--md-outlined-icon-button-icon-color,
|
|
251
|
+
var(--md-sys-color-on-surface-variant, var(--p-20, #0f0865))
|
|
252
|
+
);
|
|
253
|
+
box-shadow: inset 0 0 0 var(--stroke-border, 1px)
|
|
254
|
+
var(--md-outlined-icon-button-outline-color, var(--md-sys-color-outline, var(--p-20, #0f0865)));
|
|
156
255
|
}
|
|
157
256
|
|
|
158
|
-
|
|
159
|
-
--md-icon-button-icon-
|
|
160
|
-
--md-icon-button-container-size: var(--scb-icon-button-container-size);
|
|
161
|
-
--md-icon-button-state-layer-size: var(--scb-icon-button-container-size);
|
|
162
|
-
--md-icon-button-container-width: var(--scb-icon-button-container-size);
|
|
163
|
-
--md-icon-button-container-height: var(--scb-icon-button-container-size);
|
|
164
|
-
--md-icon-button-state-layer-width: var(--scb-icon-button-container-size);
|
|
165
|
-
--md-icon-button-state-layer-height: var(--scb-icon-button-container-size);
|
|
166
|
-
--md-icon-button-container-shape: var(--scb-icon-button-shape-radius);
|
|
167
|
-
border-radius: var(--scb-icon-button-shape-radius) !important;
|
|
257
|
+
:host([toggle][selected]) .native-icon-button {
|
|
258
|
+
color: var(--md-icon-button-selected-icon-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));
|
|
168
259
|
}
|
|
169
260
|
|
|
170
|
-
|
|
171
|
-
--md-filled-icon-button-
|
|
172
|
-
--md-filled-icon-button-
|
|
173
|
-
|
|
261
|
+
:host([variant='filled'][toggle][selected]) .native-icon-button {
|
|
262
|
+
background: var(--md-filled-icon-button-selected-container-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));
|
|
263
|
+
color: var(--md-filled-icon-button-selected-icon-color, var(--md-sys-color-on-primary, #ffffff));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
:host([variant='filled-tonal'][toggle][selected]) .native-icon-button {
|
|
267
|
+
background: var(
|
|
268
|
+
--md-filled-tonal-icon-button-selected-container-color,
|
|
269
|
+
var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff))
|
|
270
|
+
);
|
|
271
|
+
color: var(
|
|
272
|
+
--md-filled-tonal-icon-button-selected-icon-color,
|
|
273
|
+
var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be))
|
|
274
|
+
);
|
|
174
275
|
}
|
|
175
276
|
|
|
176
|
-
|
|
177
|
-
--md-
|
|
178
|
-
|
|
179
|
-
|
|
277
|
+
:host([variant='outlined'][toggle][selected]) .native-icon-button {
|
|
278
|
+
color: var(--md-outlined-icon-button-selected-icon-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));
|
|
279
|
+
box-shadow: inset 0 0 0 var(--stroke-border, 1px)
|
|
280
|
+
var(--md-outlined-icon-button-selected-outline-color, var(--md-sys-color-outline, var(--p-20, #0f0865)));
|
|
180
281
|
}
|
|
181
282
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
283
|
+
.native-icon-button[aria-disabled='true'],
|
|
284
|
+
.native-icon-button:disabled {
|
|
285
|
+
color: var(--md-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));
|
|
286
|
+
cursor: default;
|
|
287
|
+
pointer-events: none;
|
|
186
288
|
}
|
|
187
289
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
--md-icon-button-container-
|
|
193
|
-
--md-filled-icon-button-
|
|
194
|
-
--md-outlined-icon-button-container-shape: var(--scb-icon-button-shape-radius);
|
|
195
|
-
--md-filled-tonal-icon-button-container-shape: var(--scb-icon-button-shape-radius);
|
|
196
|
-
--md-icon-font-variation-settings: var(--scb-icon-button-font-variation-settings);
|
|
197
|
-
border-radius: var(--scb-icon-button-shape-radius) !important;
|
|
290
|
+
:host([variant='filled']) .native-icon-button[aria-disabled='true'],
|
|
291
|
+
:host([variant='filled']) .native-icon-button:disabled,
|
|
292
|
+
:host([variant='filled-tonal']) .native-icon-button[aria-disabled='true'],
|
|
293
|
+
:host([variant='filled-tonal']) .native-icon-button:disabled {
|
|
294
|
+
background: var(--md-filled-icon-button-disabled-container-color, rgb(15 8 101 / 12%));
|
|
295
|
+
color: var(--md-filled-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));
|
|
198
296
|
}
|
|
199
297
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
298
|
+
:host([variant='outlined']) .native-icon-button[aria-disabled='true'],
|
|
299
|
+
:host([variant='outlined']) .native-icon-button:disabled {
|
|
300
|
+
color: var(--md-outlined-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));
|
|
301
|
+
box-shadow: inset 0 0 0 var(--stroke-border, 1px)
|
|
302
|
+
var(--md-outlined-icon-button-disabled-outline-color, rgb(15 8 101 / 12%));
|
|
205
303
|
}
|
|
206
|
-
|
|
304
|
+
|
|
305
|
+
.native-icon-button-wrap md-ripple {
|
|
306
|
+
position: absolute;
|
|
307
|
+
inset: 0;
|
|
308
|
+
border-radius: inherit;
|
|
309
|
+
pointer-events: none;
|
|
310
|
+
--md-ripple-hover-color: var(--scb-icon-button-state-layer-color, currentColor);
|
|
311
|
+
--md-ripple-pressed-color: var(--scb-icon-button-state-layer-color, currentColor);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.native-icon-button-wrap md-focus-ring {
|
|
315
|
+
pointer-events: none;
|
|
316
|
+
border-radius: inherit;
|
|
317
|
+
}
|
|
318
|
+
`;
|
|
207
319
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
320
|
+
__renderControl(e) {
|
|
321
|
+
let t = this.__effectiveLabel(), n = this.getAttribute("aria-controls") ?? i, a = this.getAttribute("aria-expanded") ?? i, o = this.toggle ? String(this.selected) : i, s = this.getAttribute("title") ?? i;
|
|
322
|
+
return this.href ? r`
|
|
323
|
+
<a
|
|
324
|
+
class="native-icon-button"
|
|
325
|
+
part="button"
|
|
326
|
+
href=${this.disabled ? i : this.href}
|
|
327
|
+
target=${this.target || i}
|
|
328
|
+
rel=${this.rel || i}
|
|
329
|
+
title=${s}
|
|
330
|
+
aria-label=${t}
|
|
331
|
+
aria-controls=${n}
|
|
332
|
+
aria-expanded=${a}
|
|
333
|
+
aria-pressed=${o}
|
|
334
|
+
aria-disabled=${this.disabled ? "true" : i}
|
|
335
|
+
tabindex=${this.disabled ? "-1" : i}
|
|
336
|
+
@click=${this.__onClick}
|
|
337
|
+
@focusin=${this.__onFocusIn}
|
|
338
|
+
@pointerenter=${this.__onPointerInteraction}
|
|
339
|
+
@pointerdown=${this.__onPointerInteraction}
|
|
340
|
+
>
|
|
341
|
+
${e}
|
|
342
|
+
</a>
|
|
343
|
+
` : r`
|
|
344
|
+
<button
|
|
345
|
+
class="native-icon-button"
|
|
346
|
+
part="button"
|
|
347
|
+
type="button"
|
|
348
|
+
title=${s}
|
|
349
|
+
?disabled=${this.disabled}
|
|
350
|
+
aria-label=${t}
|
|
351
|
+
aria-controls=${n}
|
|
352
|
+
aria-expanded=${a}
|
|
353
|
+
aria-pressed=${o}
|
|
354
|
+
@click=${this.__onClick}
|
|
355
|
+
@focusin=${this.__onFocusIn}
|
|
356
|
+
@pointerenter=${this.__onPointerInteraction}
|
|
357
|
+
@pointerdown=${this.__onPointerInteraction}
|
|
358
|
+
>
|
|
359
|
+
${e}
|
|
360
|
+
</button>
|
|
212
361
|
`;
|
|
213
362
|
}
|
|
214
|
-
__renderSingleIcon() {
|
|
215
|
-
return r`<md-icon ?filled=${this.iconFilled || this.filled} aria-hidden="true">${this.icon}</md-icon>`;
|
|
216
|
-
}
|
|
217
|
-
__renderMd() {
|
|
218
|
-
let e = this.toggle ? this.__renderToggleIcons() : this.__renderSingleIcon();
|
|
219
|
-
if (this.toggle) switch (this.variant) {
|
|
220
|
-
case "filled": return r`
|
|
221
|
-
<md-filled-icon-button
|
|
222
|
-
toggle
|
|
223
|
-
?selected=${this.selected}
|
|
224
|
-
?disabled=${this.disabled}
|
|
225
|
-
href=${this.href || i}
|
|
226
|
-
target=${this.target || i}
|
|
227
|
-
rel=${this.rel || i}
|
|
228
|
-
>
|
|
229
|
-
${e}
|
|
230
|
-
</md-filled-icon-button>
|
|
231
|
-
`;
|
|
232
|
-
case "outlined": return r`
|
|
233
|
-
<md-outlined-icon-button
|
|
234
|
-
toggle
|
|
235
|
-
?selected=${this.selected}
|
|
236
|
-
?disabled=${this.disabled}
|
|
237
|
-
href=${this.href || i}
|
|
238
|
-
target=${this.target || i}
|
|
239
|
-
rel=${this.rel || i}
|
|
240
|
-
>
|
|
241
|
-
${e}
|
|
242
|
-
</md-outlined-icon-button>
|
|
243
|
-
`;
|
|
244
|
-
case "filled-tonal": return r`
|
|
245
|
-
<md-filled-tonal-icon-button
|
|
246
|
-
toggle
|
|
247
|
-
?selected=${this.selected}
|
|
248
|
-
?disabled=${this.disabled}
|
|
249
|
-
href=${this.href || i}
|
|
250
|
-
target=${this.target || i}
|
|
251
|
-
rel=${this.rel || i}
|
|
252
|
-
>
|
|
253
|
-
${e}
|
|
254
|
-
</md-filled-tonal-icon-button>
|
|
255
|
-
`;
|
|
256
|
-
default: return r`
|
|
257
|
-
<md-icon-button toggle ?selected=${this.selected} ?disabled=${this.disabled} href=${this.href || i} target=${this.target || i} rel=${this.rel || i}>
|
|
258
|
-
${e}
|
|
259
|
-
</md-icon-button>
|
|
260
|
-
`;
|
|
261
|
-
}
|
|
262
|
-
switch (this.variant) {
|
|
263
|
-
case "filled": return r`
|
|
264
|
-
<md-filled-icon-button ?disabled=${this.disabled} href=${this.href || i} target=${this.target || i} rel=${this.rel || i}>
|
|
265
|
-
${e}
|
|
266
|
-
</md-filled-icon-button>
|
|
267
|
-
`;
|
|
268
|
-
case "outlined": return r`
|
|
269
|
-
<md-outlined-icon-button ?disabled=${this.disabled} href=${this.href || i} target=${this.target || i} rel=${this.rel || i}>
|
|
270
|
-
${e}
|
|
271
|
-
</md-outlined-icon-button>
|
|
272
|
-
`;
|
|
273
|
-
case "filled-tonal": return r`
|
|
274
|
-
<md-filled-tonal-icon-button ?disabled=${this.disabled} href=${this.href || i} target=${this.target || i} rel=${this.rel || i}>
|
|
275
|
-
${e}
|
|
276
|
-
</md-filled-tonal-icon-button>
|
|
277
|
-
`;
|
|
278
|
-
default: return r`
|
|
279
|
-
<md-icon-button ?disabled=${this.disabled} href=${this.href || i} target=${this.target || i} rel=${this.rel || i}>
|
|
280
|
-
${e}
|
|
281
|
-
</md-icon-button>
|
|
282
|
-
`;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
363
|
render() {
|
|
286
|
-
|
|
364
|
+
let e = r`<span class="native-icon" part="icon" aria-hidden="true">${this.__currentIcon()}</span>`;
|
|
365
|
+
return r`
|
|
366
|
+
<span class="native-icon-button-wrap">
|
|
367
|
+
${this.__renderControl(e)}
|
|
368
|
+
${this.__rippleReady ? r`<md-ripple aria-hidden="true"></md-ripple>` : i}
|
|
369
|
+
${this.__focusRingReady ? r`<md-focus-ring aria-hidden="true"></md-focus-ring>` : i}
|
|
370
|
+
</span>
|
|
371
|
+
`;
|
|
287
372
|
}
|
|
288
373
|
};
|
|
289
|
-
e([o({ type: String })],
|
|
374
|
+
e([o({ type: String })], d.prototype, "icon", void 0), e([o({
|
|
290
375
|
type: Boolean,
|
|
291
376
|
reflect: !0
|
|
292
|
-
})],
|
|
377
|
+
})], d.prototype, "filled", null), e([o({
|
|
293
378
|
type: Boolean,
|
|
294
379
|
attribute: "icon-filled",
|
|
295
380
|
reflect: !0
|
|
296
|
-
})],
|
|
381
|
+
})], d.prototype, "iconFilled", null), e([o({
|
|
297
382
|
type: String,
|
|
298
383
|
attribute: "aria-label"
|
|
299
|
-
})],
|
|
384
|
+
})], d.prototype, "ariaLabel", void 0), e([o({
|
|
385
|
+
type: String,
|
|
386
|
+
reflect: !0
|
|
387
|
+
})], d.prototype, "variant", void 0), e([o({
|
|
300
388
|
type: String,
|
|
301
389
|
reflect: !0
|
|
302
|
-
})],
|
|
390
|
+
})], d.prototype, "size", void 0), e([o({
|
|
303
391
|
type: String,
|
|
304
392
|
reflect: !0
|
|
305
|
-
})],
|
|
393
|
+
})], d.prototype, "shape", void 0), e([o({
|
|
306
394
|
type: Boolean,
|
|
307
395
|
reflect: !0
|
|
308
|
-
})],
|
|
396
|
+
})], d.prototype, "toggle", void 0), e([o({
|
|
309
397
|
type: Boolean,
|
|
310
398
|
reflect: !0
|
|
311
|
-
})],
|
|
399
|
+
})], d.prototype, "selected", void 0), e([o({ type: String })], d.prototype, "toggleofficon", void 0), e([o({ type: String })], d.prototype, "toggleonicon", void 0), e([o({
|
|
312
400
|
type: Boolean,
|
|
313
401
|
reflect: !0
|
|
314
|
-
})],
|
|
402
|
+
})], d.prototype, "disabled", void 0), e([o({
|
|
315
403
|
type: String,
|
|
316
404
|
reflect: !0
|
|
317
|
-
})],
|
|
405
|
+
})], d.prototype, "spacing", void 0), e([o({
|
|
318
406
|
type: String,
|
|
319
407
|
attribute: "spacing-top",
|
|
320
408
|
reflect: !0
|
|
321
|
-
})],
|
|
409
|
+
})], d.prototype, "spacingTop", void 0), e([o({
|
|
322
410
|
type: String,
|
|
323
411
|
attribute: "spacing-bottom",
|
|
324
412
|
reflect: !0
|
|
325
|
-
})],
|
|
413
|
+
})], d.prototype, "spacingBottom", void 0), e([o({
|
|
326
414
|
type: String,
|
|
327
415
|
attribute: "spacing-left",
|
|
328
416
|
reflect: !0
|
|
329
|
-
})],
|
|
417
|
+
})], d.prototype, "spacingLeft", void 0), e([o({
|
|
330
418
|
type: String,
|
|
331
419
|
attribute: "spacing-right",
|
|
332
420
|
reflect: !0
|
|
333
|
-
})],
|
|
421
|
+
})], d.prototype, "spacingRight", void 0), e([o({ type: String })], d.prototype, "href", void 0), e([o({ type: String })], d.prototype, "target", void 0), e([o({ type: String })], d.prototype, "rel", void 0), d = e([a("scb-icon-button")], d);
|
|
334
422
|
//#endregion
|
|
335
|
-
export {
|
|
423
|
+
export { d as ScbIconButton };
|