@m3e/web 2.5.8 → 2.5.9
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/all.js +256 -71
- package/dist/all.js.map +1 -1
- package/dist/all.min.js +56 -56
- package/dist/all.min.js.map +1 -1
- package/dist/button-group.js +31 -12
- package/dist/button-group.js.map +1 -1
- package/dist/button-group.min.js +1 -1
- package/dist/button-group.min.js.map +1 -1
- package/dist/button.js +62 -30
- package/dist/button.js.map +1 -1
- package/dist/button.min.js +1 -1
- package/dist/button.min.js.map +1 -1
- package/dist/core.js +37 -1
- package/dist/core.js.map +1 -1
- package/dist/core.min.js +1 -1
- package/dist/core.min.js.map +1 -1
- package/dist/css-custom-data.json +422 -422
- package/dist/custom-elements.json +15657 -15553
- package/dist/html-custom-data.json +191 -191
- package/dist/icon-button.js +62 -30
- package/dist/icon-button.js.map +1 -1
- package/dist/icon-button.min.js +1 -1
- package/dist/icon-button.min.js.map +1 -1
- package/dist/src/button/ButtonElement.d.ts.map +1 -1
- package/dist/src/button/styles/ButtonSizeStyle.d.ts.map +1 -1
- package/dist/src/button/styles/ButtonStyle.d.ts.map +1 -1
- package/dist/src/button-group/ButtonGroupElement.d.ts.map +1 -1
- package/dist/src/core/shared/tokens/DesignToken.d.ts +18 -0
- package/dist/src/core/shared/tokens/DesignToken.d.ts.map +1 -1
- package/dist/src/core/shared/tokens/MeasurementToken.d.ts +34 -0
- package/dist/src/core/shared/tokens/MeasurementToken.d.ts.map +1 -0
- package/dist/src/icon-button/IconButtonElement.d.ts.map +1 -1
- package/dist/src/icon-button/styles/IconButtonSizeStyle.d.ts.map +1 -1
- package/dist/src/icon-button/styles/IconButtonStyle.d.ts.map +1 -1
- package/dist/src/theme/ThemeElement.d.ts.map +1 -1
- package/dist/src/toc/TocElement.d.ts.map +1 -1
- package/dist/theme.js +51 -2
- package/dist/theme.js.map +1 -1
- package/dist/theme.min.js +31 -31
- package/dist/theme.min.js.map +1 -1
- package/dist/toc.js +19 -2
- package/dist/toc.js.map +1 -1
- package/dist/toc.min.js +1 -1
- package/dist/toc.min.js.map +1 -1
- package/package.json +1 -1
package/dist/all.js
CHANGED
|
@@ -2561,7 +2561,7 @@ const ButtonSizeToken = {
|
|
|
2561
2561
|
|
|
2562
2562
|
/** @private */
|
|
2563
2563
|
function buttonStyle(size) {
|
|
2564
|
-
return css`:host([size="${unsafeCSS(size)}"]) .base { height: ${ButtonSizeToken[size].containerHeight}; } :host([size="${unsafeCSS(size)}"]) .wrapper { padding-inline-start: ${ButtonSizeToken[size].leadingSpace}
|
|
2564
|
+
return css`:host([size="${unsafeCSS(size)}"]) .base { height: ${ButtonSizeToken[size].containerHeight}; } :host([size="${unsafeCSS(size)}"]) .wrapper { padding-inline-start: calc(${ButtonSizeToken[size].leadingSpace} - calc(calc(var(--_adjacent-shrink, 0px) / 2))); padding-inline-end: calc(${ButtonSizeToken[size].trailingSpace} - calc(calc(var(--_adjacent-shrink, 0px) / 2))); column-gap: ${ButtonSizeToken[size].iconLabelSpace}; } :host([size="${unsafeCSS(size)}"]) .label { font-size: ${ButtonSizeToken[size].labelTextFontSize}; font-weight: ${ButtonSizeToken[size].labelTextFontWeight}; line-height: ${ButtonSizeToken[size].labelTextLineHeight}; letter-spacing: ${ButtonSizeToken[size].labelTextTracking}; } :host([size="${unsafeCSS(size)}"]) .icon { font-size: ${ButtonSizeToken[size].iconSize}; --m3e-icon-size: ${ButtonSizeToken[size].iconSize}; } :host([size="${unsafeCSS(size)}"]) .base { outline-offset: calc(0px - ${ButtonSizeToken[size].outlineThickness}); outline-width: ${ButtonSizeToken[size].outlineThickness}; } :host(:not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="rounded"]) .base { border-radius: var(--_button-shape, ${ButtonSizeToken[size].shapeRound}); } :host( :is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="rounded"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: var(--_button-shape, ${ButtonSizeToken[size].shapeRound}); } :host( :not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="rounded"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: ${ButtonSizeToken[size].selectedShapeRound}; } :host(:not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="square"]) .base { border-radius: ${ButtonSizeToken[size].shapeSquare}; } :host( :not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="square"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: var(--_button-shape, ${ButtonSizeToken[size].selectedShapeSquare}); } :host(:not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"]:is(:state(--pressed), :--pressed)) .base { border-radius: ${ButtonSizeToken[size].shapePressedMorph}; } :host(:is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="rounded"]:not([toggle][selected])) .base { border-start-start-radius: var( --_button-rounded-start-shape, var(--_button-shape, ${ButtonSizeToken[size].shapeRound}) ); border-end-start-radius: var( --_button-rounded-start-shape, var(--_button-shape, ${ButtonSizeToken[size].shapeRound}) ); border-start-end-radius: var( --_button-rounded-end-shape, var(--_button-shape, ${ButtonSizeToken[size].shapeRound}) ); border-end-end-radius: var( --_button-rounded-end-shape, var(--_button-shape, ${ButtonSizeToken[size].shapeRound}) ); } :host(:is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="square"]) .base { border-start-start-radius: var(--_button-square-start-shape, ${ButtonSizeToken[size].shapeSquare}); border-end-start-radius: var(--_button-square-start-shape, ${ButtonSizeToken[size].shapeSquare}); border-start-end-radius: var(--_button-square-end-shape, ${ButtonSizeToken[size].shapeSquare}); border-end-end-radius: var(--_button-square-end-shape, ${ButtonSizeToken[size].shapeSquare}); } :host( :is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="square"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: var(--_button-shape, ${ButtonSizeToken[size].selectedShapeSquare}); } :host(:is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"]:is(:state(--pressed), :--pressed)) .base { border-start-start-radius: var(--_button-start-shape-pressed-morph, ${ButtonSizeToken[size].shapePressedMorph}); border-end-start-radius: var(--_button-start-shape-pressed-morph, ${ButtonSizeToken[size].shapePressedMorph}); border-start-end-radius: var(--_button-end-shape-pressed-morph, ${ButtonSizeToken[size].shapePressedMorph}); border-end-end-radius: var(--_button-end-shape-pressed-morph, ${ButtonSizeToken[size].shapePressedMorph}); }`;
|
|
2565
2565
|
}
|
|
2566
2566
|
/**
|
|
2567
2567
|
* Size variant styles for `M3eButtonElement`.
|
|
@@ -2574,7 +2574,7 @@ const ButtonSizeStyle = [buttonStyle("extra-small"), buttonStyle("small"), butto
|
|
|
2574
2574
|
* @internal
|
|
2575
2575
|
*/
|
|
2576
2576
|
const ButtonStyle = css`:host { display: inline-block; outline: none; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { box-sizing: border-box; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; position: relative; width: 100%; transition: ${unsafeCSS(`background-color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard}`)}; } .touch { position: absolute; height: 3rem; left: 0; right: 0; } :host(:is(:state(--pressed), :--pressed)) .base, :host(:is(:state(--resting), :--resting)) .base { transition: ${unsafeCSS(`background-color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard},
|
|
2577
|
-
border-radius ${DesignToken$1.motion.spring.fastEffects}`)}; } .wrapper { width: 100%; overflow: hidden; display: inline-flex; align-items: center;
|
|
2577
|
+
border-radius ${DesignToken$1.motion.spring.fastEffects}`)}; } .wrapper { width: 100%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; } .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: ${unsafeCSS(`color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard}`)}; } .icon { transition: ${unsafeCSS(`color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard}`)}; } :host(:not(:disabled):not([disabled-interactive])) { cursor: pointer; } :host([disabled-interactive]) { cursor: not-allowed; } ::slotted([slot="icon"]), ::slotted([slot="selected-icon"]), ::slotted([slot="trailing-icon"]) { font-size: inherit !important; flex: none; } ::slotted(svg[slot="icon"]), ::slotted(svg[slot="selected-icon"]), ::slotted(svg[slot="trailing-icon"]) { width: 1em; height: 1em; } :host([toggle]:not([selected])) .base.with-selected-icon slot[name="selected-icon"], :host([toggle][selected]) .base.with-selected-icon slot[name="icon"] { display: none; } a { all: unset; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1; } :host(:is(:state(--grouped), :--grouped):is(:state(--connected), :--connected)) { flex: 1 1 auto; } :host(:is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected))) { transition: ${unsafeCSS(`flex-basis ${DesignToken$1.motion.spring.fastEffects}`)}; } :host(:is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected))) .wrapper { transition: ${unsafeCSS(`padding-inline ${DesignToken$1.motion.spring.fastEffects}`)}; } :host(:is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected))) { flex-shrink: 0; flex-grow: 0; } :host( :is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected)):not( :is(:state(--pressed), :--pressed, :state(--adjacent-pressed), :--adjacent-pressed) ) ) { flex-basis: var(--_button-width); } :host( :is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected)):is( :state(--pressed), :--pressed ):not([disabled-interactive]):not(:disabled) ) { flex-basis: calc( var(--_button-width) + calc(var(--_button-width) * var(--m3e-standard-button-group-width-multiplier, 0.15)) ); } :host( :is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected)):is( :state(--adjacent-pressed), :--adjacent-pressed ):not(:is(:state(--pressed), :--pressed)) ) .label { text-overflow: clip; } @media (forced-colors: active) { .base, .label, .icon { transition: none; } :host(:is(:state(--pressed), :--pressed)) .base, :host(:is(:state(--resting), :--resting)) .base { transition: ${unsafeCSS(`border-radius ${DesignToken$1.motion.spring.fastEffects}`)}; } :host([variant]:not(:disabled):not([disabled-interactive]):not([toggle])) .base { background-color: ButtonFace; outline-color: ButtonText; } :host([variant]:not(:disabled):not([disabled-interactive]):not([toggle])) .label, :host([variant]:not(:disabled):not([disabled-interactive]):not([toggle])) .icon { color: ButtonText; } :host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .base { background-color: ButtonFace; outline-color: ButtonText; } :host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .label, :host([variant]:hover:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .label, :host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected]):focus) .label, :host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .icon, :host([variant]:hover:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .icon, :host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected]):focus) .icon { color: ButtonText; } :host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]) .base { background-color: ButtonText; outline: none; } :host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]) .label, :host([variant]:hover:not(:disabled):not([disabled-interactive])[toggle][selected]) .label, :host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]:focus) .label, :host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]) .icon, :host([variant]:hover:not(:disabled):not([disabled-interactive])[toggle][selected]) .icon, :host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]:focus) .icon { forced-color-adjust: none; color: ButtonFace; background-color: ButtonText; } :host([variant]:disabled) .base, :host([variant][disabled-interactive]) .base { outline-color: GrayText; background-color: unset; } :host([variant]:disabled) .label, :host([variant][disabled-interactive]) .label, :host([variant]:disabled) .icon, :host([variant][disabled-interactive]) .icon { color: GrayText; } .base { outline-style: solid; } :host([size="extra-small"]) .base { outline-offset: calc(0px - var(--m3e-button-extra-small-outline-thickness, 1px)); outline-width: var(--m3e-button-extra-small-outline-thickness, 1px); } :host([size="small"]) .base { outline-offset: calc(0px - var(--m3e-button-small-outline-thickness, 1px)); outline-width: var(--m3e-button-small-outline-thickness, 1px); } :host([size="medium"]) .base { outline-offset: calc(0px - var(--m3e-button-medium-outline-thickness, 1px)); outline-width: var(--m3e-button-medium-outline-thickness, 1px); } :host([size="large"]) .base { outline-offset: calc(0px - var(--m3e-button-large-outline-thickness, 2px)); outline-width: var(--m3e-button-large-outline-thickness, 2px); } :host([size="extra-large"]) .base { outline-offset: calc(0px - var(--m3e-button-extra-large-outline-thickness, 3px)); outline-width: var(--m3e-button-extra-large-outline-thickness, 3px); } } @media (prefers-reduced-motion) { :host(:is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected))), :host(:is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected))) .wrapper, :host(:is(:state(--pressed), :--pressed)) .base, :host(:is(:state(--resting), :--resting)) .base, .base, .label, .icon { transition: none; } }`;
|
|
2578
2578
|
|
|
2579
2579
|
/**
|
|
2580
2580
|
* Component design tokens that control the appearance variants of `M3eButtonElement`.
|
|
@@ -3148,7 +3148,7 @@ function buttonVariantStyle(variant) {
|
|
|
3148
3148
|
*/
|
|
3149
3149
|
const ButtonVariantStyle = [buttonVariantStyle("text"), buttonVariantStyle("elevated"), buttonVariantStyle("outlined"), buttonVariantStyle("filled"), buttonVariantStyle("tonal"), css`:host([variant="outlined"]:not([toggle][selected]):not(:disabled):not([disabled-interactive])) .base { outline-style: solid; }`];
|
|
3150
3150
|
|
|
3151
|
-
var _M3eButtonElement_instances, _M3eButtonElement_clickHandler, _M3eButtonElement_handleClick, _M3eButtonElement_handleSelectedIconSlotChange, _M3eButtonElement_updateButtonShape, _M3eButtonElement_handlePressedChange;
|
|
3151
|
+
var _M3eButtonElement_instances, _M3eButtonElement_clickHandler, _M3eButtonElement_handleClick, _M3eButtonElement_handleSelectedIconSlotChange, _M3eButtonElement_updateButtonShape, _M3eButtonElement_handlePressedChange, _M3eButtonElement_cleanupAdjacentPressed;
|
|
3152
3152
|
/**
|
|
3153
3153
|
* A button users interact with to perform an action.
|
|
3154
3154
|
*
|
|
@@ -3619,11 +3619,7 @@ let M3eButtonElement = class M3eButtonElement extends KeyboardClick$1(LinkButton
|
|
|
3619
3619
|
*/
|
|
3620
3620
|
this.selected = false;
|
|
3621
3621
|
new ResizeController$1(this, {
|
|
3622
|
-
callback: () =>
|
|
3623
|
-
if (this.grouped) {
|
|
3624
|
-
this._handleResize();
|
|
3625
|
-
}
|
|
3626
|
-
}
|
|
3622
|
+
callback: () => this._handleResize()
|
|
3627
3623
|
});
|
|
3628
3624
|
new FocusController$1(this, {
|
|
3629
3625
|
callback: focused => {
|
|
@@ -3639,11 +3635,7 @@ let M3eButtonElement = class M3eButtonElement extends KeyboardClick$1(LinkButton
|
|
|
3639
3635
|
if (!this.disabled && !this.disabledInteractive) {
|
|
3640
3636
|
if (pressed) {
|
|
3641
3637
|
__classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_updateButtonShape).call(this);
|
|
3642
|
-
|
|
3643
|
-
__classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_handlePressedChange).call(this, true);
|
|
3644
|
-
} else {
|
|
3645
|
-
requestAnimationFrame(() => __classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_handlePressedChange).call(this, true));
|
|
3646
|
-
}
|
|
3638
|
+
__classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_handlePressedChange).call(this, true);
|
|
3647
3639
|
} else {
|
|
3648
3640
|
__classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_handlePressedChange).call(this, false);
|
|
3649
3641
|
}
|
|
@@ -3670,7 +3662,7 @@ let M3eButtonElement = class M3eButtonElement extends KeyboardClick$1(LinkButton
|
|
|
3670
3662
|
["--pressed", "--resting", "--grouped", "--connected"].forEach(x => deleteCustomState$1(this, x));
|
|
3671
3663
|
this._base?.style.removeProperty("--_button-shape");
|
|
3672
3664
|
this.style.removeProperty("--_button-width");
|
|
3673
|
-
this.style.removeProperty("--_adjacent-
|
|
3665
|
+
this.style.removeProperty("--_adjacent-shrink");
|
|
3674
3666
|
deleteCustomState$1(this, "--adjacent-pressed");
|
|
3675
3667
|
this.removeEventListener("click", __classPrivateFieldGet(this, _M3eButtonElement_clickHandler, "f"));
|
|
3676
3668
|
}
|
|
@@ -3697,7 +3689,7 @@ let M3eButtonElement = class M3eButtonElement extends KeyboardClick$1(LinkButton
|
|
|
3697
3689
|
}
|
|
3698
3690
|
/** @private */
|
|
3699
3691
|
_handleResize() {
|
|
3700
|
-
if (this.grouped && !hasCustomState$1(this, "--
|
|
3692
|
+
if (this.grouped && !hasCustomState$1(this, "--no-resize") && this !== document.activeElement) {
|
|
3701
3693
|
this.style.setProperty("--_button-width", `${this.clientWidth}px`);
|
|
3702
3694
|
__classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_updateButtonShape).call(this, true);
|
|
3703
3695
|
}
|
|
@@ -3739,27 +3731,67 @@ _M3eButtonElement_updateButtonShape = function _M3eButtonElement_updateButtonSha
|
|
|
3739
3731
|
}
|
|
3740
3732
|
};
|
|
3741
3733
|
_M3eButtonElement_handlePressedChange = function _M3eButtonElement_handlePressedChange(pressed) {
|
|
3742
|
-
|
|
3743
|
-
setCustomState$1(this, "--resting", !pressed);
|
|
3734
|
+
const clientWidth = this.getBoundingClientRect().width;
|
|
3744
3735
|
const group = this.closest("m3e-button-group");
|
|
3745
|
-
if (group) {
|
|
3746
|
-
const clientWidth = this.getBoundingClientRect().width;
|
|
3736
|
+
if (group && group.variant === "standard") {
|
|
3747
3737
|
const buttons = [...group.querySelectorAll("m3e-button,m3e-icon-button")];
|
|
3748
3738
|
const index = buttons.indexOf(this);
|
|
3749
|
-
|
|
3750
|
-
const
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
}
|
|
3755
|
-
|
|
3756
|
-
|
|
3739
|
+
if (pressed) {
|
|
3740
|
+
const multiplier = parseFloat(getComputedStyle(this).getPropertyValue("--m3e-standard-button-group-width-multiplier") || "0.15");
|
|
3741
|
+
let adjacentShrink = clientWidth * multiplier;
|
|
3742
|
+
if (index > 0 && index < buttons.length - 1) {
|
|
3743
|
+
adjacentShrink /= 2;
|
|
3744
|
+
}
|
|
3745
|
+
for (let i = 0; i < buttons.length; i++) {
|
|
3746
|
+
if (i == index - 1 || i == index + 1) {
|
|
3747
|
+
addCustomState$1(buttons[i], "--no-resize");
|
|
3748
|
+
buttons[i].style.setProperty("--_adjacent-shrink", `${adjacentShrink}px`);
|
|
3749
|
+
addCustomState$1(buttons[i], "--adjacent-pressed");
|
|
3750
|
+
} else if (i == index) {
|
|
3751
|
+
addCustomState$1(buttons[i], "--no-resize");
|
|
3752
|
+
buttons[i].style.removeProperty("--_adjacent-shrink");
|
|
3753
|
+
deleteCustomState$1(buttons[i], "--adjacent-pressed");
|
|
3754
|
+
} else {
|
|
3755
|
+
deleteCustomState$1(buttons[i], "--no-resize");
|
|
3756
|
+
buttons[i].style.removeProperty("--_adjacent-shrink");
|
|
3757
|
+
deleteCustomState$1(buttons[i], "--adjacent-pressed");
|
|
3758
|
+
}
|
|
3759
|
+
}
|
|
3760
|
+
} else {
|
|
3761
|
+
for (let i = 0; i < buttons.length; i++) {
|
|
3762
|
+
if (i == index - 1 || i == index + 1) {
|
|
3763
|
+
buttons[i].style.setProperty("--_adjacent-shrink", "0px");
|
|
3764
|
+
}
|
|
3765
|
+
}
|
|
3766
|
+
if (!prefersReducedMotion$1()) {
|
|
3767
|
+
this.addEventListener("transitionend", e => {
|
|
3768
|
+
if (e.propertyName === "flex-basis") {
|
|
3769
|
+
queueMicrotask(() => {
|
|
3770
|
+
// Pressed state is tested to ensure this runs only when the button
|
|
3771
|
+
// is no longer pressed. This handles changes to pressed state in
|
|
3772
|
+
// quick succession.
|
|
3773
|
+
if (!hasCustomState$1(this, "--pressed")) {
|
|
3774
|
+
__classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_cleanupAdjacentPressed).call(this, buttons);
|
|
3775
|
+
}
|
|
3776
|
+
});
|
|
3777
|
+
}
|
|
3778
|
+
}, {
|
|
3779
|
+
once: true
|
|
3780
|
+
});
|
|
3757
3781
|
} else {
|
|
3758
|
-
|
|
3759
|
-
deleteCustomState$1(button, "--adjacent-pressed");
|
|
3782
|
+
__classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_cleanupAdjacentPressed).call(this, buttons);
|
|
3760
3783
|
}
|
|
3761
3784
|
}
|
|
3762
3785
|
}
|
|
3786
|
+
setCustomState$1(this, "--pressed", pressed);
|
|
3787
|
+
setCustomState$1(this, "--resting", !pressed);
|
|
3788
|
+
};
|
|
3789
|
+
_M3eButtonElement_cleanupAdjacentPressed = function _M3eButtonElement_cleanupAdjacentPressed(buttons) {
|
|
3790
|
+
for (const button of buttons) {
|
|
3791
|
+
deleteCustomState$1(button, "--adjacent-pressed");
|
|
3792
|
+
deleteCustomState$1(button, "--no-resize");
|
|
3793
|
+
button.style.removeProperty("--_adjacent-shrink");
|
|
3794
|
+
}
|
|
3763
3795
|
};
|
|
3764
3796
|
/** The styles of the element. */
|
|
3765
3797
|
M3eButtonElement.styles = [ButtonSizeStyle, ButtonVariantStyle, ButtonStyle];
|
|
@@ -3788,7 +3820,7 @@ __decorate([property({
|
|
|
3788
3820
|
__decorate([debounce$1(40)], M3eButtonElement.prototype, "_handleResize", null);
|
|
3789
3821
|
M3eButtonElement = __decorate([customElement$1("m3e-button")], M3eButtonElement);
|
|
3790
3822
|
|
|
3791
|
-
var _M3eButtonGroupElement_instances, _M3eButtonGroupElement_pressedController, _M3eButtonGroupElement_updateButtons, _M3eButtonGroupElement_handleChange;
|
|
3823
|
+
var _M3eButtonGroupElement_instances, _M3eButtonGroupElement_pressedController, _M3eButtonGroupElement_updateButtons, _M3eButtonGroupElement_handleChange, _M3eButtonGroupElement_handlePressedChange, _M3eButtonGroupElement_cleanupPressed;
|
|
3792
3824
|
/**
|
|
3793
3825
|
* Organizes buttons and adds interactions between them.
|
|
3794
3826
|
*
|
|
@@ -3853,16 +3885,7 @@ let M3eButtonGroupElement = class M3eButtonGroupElement extends Role$1(LitElemen
|
|
|
3853
3885
|
capture: true,
|
|
3854
3886
|
minPressedDuration: 150,
|
|
3855
3887
|
isPressedKey: key => key === " ",
|
|
3856
|
-
callback: pressed =>
|
|
3857
|
-
if (!this._base) return;
|
|
3858
|
-
if (!pressed || this.variant === "connected") {
|
|
3859
|
-
this._base.style.removeProperty("--_button-group-width");
|
|
3860
|
-
this._base.classList.remove("pressed");
|
|
3861
|
-
} else {
|
|
3862
|
-
this._base.classList.add("pressed");
|
|
3863
|
-
this._base.style.setProperty("--_button-group-width", `${this._base.getBoundingClientRect().width}px`);
|
|
3864
|
-
}
|
|
3865
|
-
}
|
|
3888
|
+
callback: pressed => __classPrivateFieldGet(this, _M3eButtonGroupElement_instances, "m", _M3eButtonGroupElement_handlePressedChange).call(this, pressed)
|
|
3866
3889
|
}));
|
|
3867
3890
|
/**
|
|
3868
3891
|
* The appearance variant of the group.
|
|
@@ -3952,6 +3975,34 @@ _M3eButtonGroupElement_handleChange = function _M3eButtonGroupElement_handleChan
|
|
|
3952
3975
|
}
|
|
3953
3976
|
}
|
|
3954
3977
|
};
|
|
3978
|
+
_M3eButtonGroupElement_handlePressedChange = function _M3eButtonGroupElement_handlePressedChange(pressed) {
|
|
3979
|
+
const base = this._base;
|
|
3980
|
+
if (!base) return;
|
|
3981
|
+
if (!pressed || this.variant === "connected") {
|
|
3982
|
+
const button = this.buttons.find(x => x === document.activeElement);
|
|
3983
|
+
if (!prefersReducedMotion$1() && button) {
|
|
3984
|
+
button.addEventListener("transitionend", () => queueMicrotask(() => {
|
|
3985
|
+
// Pressed state is tested to ensure this runs only when the button
|
|
3986
|
+
// is no longer pressed. This handles changes to pressed state in
|
|
3987
|
+
// quick succession.
|
|
3988
|
+
if (!hasCustomState$1(button, "--pressed")) {
|
|
3989
|
+
__classPrivateFieldGet(this, _M3eButtonGroupElement_instances, "m", _M3eButtonGroupElement_cleanupPressed).call(this, base);
|
|
3990
|
+
}
|
|
3991
|
+
}), {
|
|
3992
|
+
once: true
|
|
3993
|
+
});
|
|
3994
|
+
} else {
|
|
3995
|
+
__classPrivateFieldGet(this, _M3eButtonGroupElement_instances, "m", _M3eButtonGroupElement_cleanupPressed).call(this, base);
|
|
3996
|
+
}
|
|
3997
|
+
} else {
|
|
3998
|
+
base.classList.add("pressed");
|
|
3999
|
+
base.style.setProperty("--_button-group-width", `${base.getBoundingClientRect().width}px`);
|
|
4000
|
+
}
|
|
4001
|
+
};
|
|
4002
|
+
_M3eButtonGroupElement_cleanupPressed = function _M3eButtonGroupElement_cleanupPressed(base) {
|
|
4003
|
+
base.style.removeProperty("--_button-group-width");
|
|
4004
|
+
base.classList.remove("pressed");
|
|
4005
|
+
};
|
|
3955
4006
|
/** The styles of the element. */
|
|
3956
4007
|
M3eButtonGroupElement.styles = css`:host { display: flex; vertical-align: middle; flex-wrap: nowrap; align-items: center; } .base { display: flex; vertical-align: middle; flex-wrap: nowrap; align-items: center; } :host([variant="standard"]) { justify-content: center; } :host([variant="connected"]) .base { flex: 1 1 auto; } :host([variant="standard"]) .base { width: fit-content; flex: none; } :host([variant="standard"]) .base.pressed { justify-content: space-between; width: var(--_button-group-width); } :host([variant="standard"][size="extra-small"]) .base { column-gap: var(--m3e-standard-button-group-extra-small-spacing, 1.125rem); } :host([variant="standard"][size="small"]) .base { column-gap: var(--m3e-standard-button-group-small-spacing, 0.75rem); } :host([variant="standard"][size="medium"]).base { column-gap: var(--m3e-standard-button-group-medium-spacing, 0.5rem); } :host([variant="standard"][size="large"]) .base { column-gap: var(--m3e-standard-button-group-large-spacing, 0.5rem); } :host([variant="standard"][size="extra-large"]) .base { column-gap: var(--m3e-standard-button-group-extra-large-spacing, 0.5rem); } :host([variant="connected"]) .base { column-gap: var(--m3e-connected-button-group-spacing, 0.125rem); } :host([variant="connected"][size="extra-small"]) ::slotted(:is(:state(--first), :--first)[size="extra-small"]), :host([variant="connected"][size="extra-small"]) ::slotted(:not(:is(:state(--first), :--first)):not(:is(:state(--last), :--last))[size="extra-small"]) { --_button-rounded-end-shape: var( --m3e-connected-button-group-extra-small-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-square-end-shape: var( --m3e-connected-button-group-extra-small-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-square-end-pressed-shape: var( --m3e-connected-button-group-extra-small-inner-pressed-shape, ${DesignToken$1.shape.corner.extraSmall} ); } :host([variant="connected"][size="extra-small"]) ::slotted(:is(:state(--last), :--last)[size="extra-small"]), :host([variant="connected"][size="extra-small"]) ::slotted(:not(:is(:state(--first), :--first)):not(:is(:state(--last), :--last))[size="extra-small"]) { --_button-rounded-start-shape: var( --m3e-connected-button-group-extra-small-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-square-start-shape: var( --m3e-connected-button-group-extra-small-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-square-start-pressed-shape: var( --m3e-connected-button-group-extra-small-inner-pressed-shape, ${DesignToken$1.shape.corner.extraSmall} ); } :host([variant="connected"][size="small"]) ::slotted(:is(:state(--first), :--first)[size="small"]), :host([variant="connected"][size="small"]) ::slotted(:not(:is(:state(--first), :--first)):not(:is(:state(--last), :--last))[size="small"]) { --_button-rounded-end-shape: var( --m3e-connected-button-group-small-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-square-end-shape: var( --m3e-connected-button-group-small-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-end-shape-pressed-morph: var( --m3e-connected-button-group-small-inner-pressed-shape, ${DesignToken$1.shape.corner.extraSmall} ); } :host([variant="connected"][size="small"]) ::slotted(:is(:state(--last), :--last)[size="small"]), :host([variant="connected"][size="small"]) ::slotted(:not(:is(:state(--first), :--first)):not(:is(:state(--last), :--last))[size="small"]) { --_button-rounded-start-shape: var( --m3e-connected-button-group-small-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-square-start-shape: var( --m3e-connected-button-group-small-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-start-shape-pressed-morph: var( --m3e-connected-button-group-small-inner-pressed-shape, ${DesignToken$1.shape.corner.extraSmall} ); } :host([variant="connected"][size="medium"]) ::slotted(:is(:state(--first), :--first)[size="medium"]), :host([variant="connected"][size="medium"]) ::slotted(:not(:is(:state(--first), :--first)):not(:is(:state(--last), :--last))[size="medium"]) { --_button-rounded-end-shape: var( --m3e-connected-button-group-medium-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-square-end-shape: var( --m3e-connected-button-group-medium-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-square-end-pressed-shape: var( --m3e-connected-button-group-medium-inner-pressed-shape, ${DesignToken$1.shape.corner.extraSmall} ); } :host([variant="connected"][size="medium"]) ::slotted(:is(:state(--last), :--last)[size="medium"]), :host([variant="connected"][size="medium"]) ::slotted(:not(:is(:state(--first), :--first)):not(:is(:state(--last), :--last))[size="medium"]) { --_button-rounded-start-shape: var( --m3e-connected-button-group-medium-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-square-start-shape: var( --m3e-connected-button-group-medium-inner-shape, ${DesignToken$1.shape.corner.small} ); --_button-square-start-pressed-shape: var( --m3e-connected-button-group-medium-inner-pressed-shape, ${DesignToken$1.shape.corner.extraSmall} ); } :host([variant="connected"][size="large"]) ::slotted(:is(:state(--first), :--first)[size="large"]), :host([variant="connected"][size="large"]) ::slotted(:not(:is(:state(--first), :--first)):not(:is(:state(--last), :--last))[size="large"]) { --_button-rounded-end-shape: var( --m3e-connected-button-group-large-inner-shape, ${DesignToken$1.shape.corner.large} ); --_button-square-end-shape: var( --m3e-connected-button-group-large-inner-shape, ${DesignToken$1.shape.corner.large} ); --_button-square-end-pressed-shape: var( --m3e-connected-button-group-large-inner-pressed-shape, ${DesignToken$1.shape.corner.medium} ); } :host([variant="connected"][size="large"]) ::slotted(:is(:state(--last), :--last)[size="large"]), :host([variant="connected"][size="large"]) ::slotted(:not(:is(:state(--first), :--first)):not(:is(:state(--last), :--last))[size="large"]) { --_button-rounded-start-shape: var( --m3e-connected-button-group-large-inner-shape, ${DesignToken$1.shape.corner.large} ); --_button-square-start-shape: var( --m3e-connected-button-group-large-inner-shape, ${DesignToken$1.shape.corner.large} ); --_button-square-start-pressed-shape: var( --m3e-connected-button-group-large-inner-pressed-shape, ${DesignToken$1.shape.corner.medium} ); } :host([variant="connected"][size="extra-large"]) ::slotted(:is(:state(--first), :--first)[size="extra-large"]), :host([variant="connected"][size="extra-large"]) ::slotted(:not(:is(:state(--first), :--first)):not(:is(:state(--last), :--last))[size="extra-large"]) { --_button-rounded-end-shape: var( --m3e-connected-button-group-extra-large-inner-shape, ${DesignToken$1.shape.corner.largeIncreased} ); --_button-square-end-shape: var( --m3e-connected-button-group-extra-large-inner-shape, ${DesignToken$1.shape.corner.largeIncreased} ); --_button-square-end-pressed-shape: var( --m3e-connected-button-group-extra-large-inner-pressed-shape, ${DesignToken$1.shape.corner.large} ); } :host([variant="connected"][size="extra-large"]) ::slotted(:is(:state(--last), :--last)[size="extra-large"]), :host([variant="connected"][size="extra-large"]) ::slotted(:not(:is(:state(--first), :--first)):not(:is(:state(--last), :--last))[size="extra-large"]) { --_button-rounded-start-shape: var( --m3e-connected-button-group-extra-large-inner-shape, ${DesignToken$1.shape.corner.largeIncreased} ); --_button-square-start-shape: var( --m3e-connected-button-group-extra-large-inner-shape, ${DesignToken$1.shape.corner.largeIncreased} ); --_button-square-start-pressed-shape: var( --m3e-connected-button-group-extra-large-inner-pressed-shape, ${DesignToken$1.shape.corner.large} ); }`;
|
|
3957
4008
|
__decorate([query(".base")], M3eButtonGroupElement.prototype, "_base", void 0);
|
|
@@ -8967,6 +9018,40 @@ const ElevationToken$1 = {
|
|
|
8967
9018
|
level5: unsafeCSS(`var(--md-sys-elevation-level5, ${elevation(12)})`)
|
|
8968
9019
|
};
|
|
8969
9020
|
|
|
9021
|
+
/** Design tokens that control measurements. */
|
|
9022
|
+
const MeasurementToken = {
|
|
9023
|
+
/** Zero spacing. */
|
|
9024
|
+
space0: unsafeCSS("var(--md-sys-measurement-space0, 0rem)"),
|
|
9025
|
+
/** 2dp spacing. */
|
|
9026
|
+
space25: unsafeCSS("var(--md-sys-measurement-space25, 0.125rem)"),
|
|
9027
|
+
/** 4dp spacing. */
|
|
9028
|
+
space50: unsafeCSS("var(--md-sys-measurement-space50, 0.25rem)"),
|
|
9029
|
+
/** 6dp spacing. */
|
|
9030
|
+
space75: unsafeCSS("var(--md-sys-measurement-space75, 0.375rem)"),
|
|
9031
|
+
/** 8dp spacing. */
|
|
9032
|
+
space100: unsafeCSS("var(--md-sys-measurement-space100, 0.5rem)"),
|
|
9033
|
+
/** 12dp spacing. */
|
|
9034
|
+
space150: unsafeCSS("var(--md-sys-measurement-space150, 0.75rem)"),
|
|
9035
|
+
/** 16dp spacing. */
|
|
9036
|
+
space200: unsafeCSS("var(--md-sys-measurement-space200, 1rem)"),
|
|
9037
|
+
/** 20dp spacing. */
|
|
9038
|
+
space250: unsafeCSS("var(--md-sys-measurement-space250, 1.25rem)"),
|
|
9039
|
+
/** 32dp spacing. */
|
|
9040
|
+
space300: unsafeCSS("var(--md-sys-measurement-space300, 2rem)"),
|
|
9041
|
+
/** 40dp spacing. */
|
|
9042
|
+
space400: unsafeCSS("var(--md-sys-measurement-space400, 2.5rem)"),
|
|
9043
|
+
/** 48dp spacing. */
|
|
9044
|
+
space500: unsafeCSS("var(--md-sys-measurement-space500, 3rem)"),
|
|
9045
|
+
/** 56dp spacing. */
|
|
9046
|
+
space600: unsafeCSS("var(--md-sys-measurement-space600, 3.5rem)"),
|
|
9047
|
+
/** 64dp spacing. */
|
|
9048
|
+
space700: unsafeCSS("var(--md-sys-measurement-space700, 4rem)"),
|
|
9049
|
+
/** 72dp spacing. */
|
|
9050
|
+
space800: unsafeCSS("var(--md-sys-measurement-space800, 4.5rem)"),
|
|
9051
|
+
/** 96dp spacing. */
|
|
9052
|
+
space900: unsafeCSS("var(--md-sys-measurement-space900, 6rem)")
|
|
9053
|
+
};
|
|
9054
|
+
|
|
8970
9055
|
const EasingToken = {
|
|
8971
9056
|
/** Emphasized transition. */
|
|
8972
9057
|
emphasized: unsafeCSS("var(--md-sys-motion-easing-emphasized, cubic-bezier(0.2, 0.0, 0, 1.0))"),
|
|
@@ -9376,7 +9461,9 @@ const DesignToken = {
|
|
|
9376
9461
|
/** Design tokens that control scrollbars. */
|
|
9377
9462
|
scrollbar: ScrollbarToken,
|
|
9378
9463
|
/** Design tokens that control density. */
|
|
9379
|
-
density: DensityToken
|
|
9464
|
+
density: DensityToken,
|
|
9465
|
+
/** Design tokens that control measurement. */
|
|
9466
|
+
measurement: MeasurementToken
|
|
9380
9467
|
};
|
|
9381
9468
|
|
|
9382
9469
|
/**
|
|
@@ -16288,7 +16375,7 @@ const IconButtonSizeToken = {
|
|
|
16288
16375
|
|
|
16289
16376
|
/** @private */
|
|
16290
16377
|
function iconButtonStyle(size) {
|
|
16291
|
-
return css`:host([size="${unsafeCSS(size)}"]) .base { height: ${IconButtonSizeToken[size].containerHeight}; } :host([size="${unsafeCSS(size)}"][width="default"]) .wrapper { padding-inline-start: ${IconButtonSizeToken[size].defaultLeadingSpace}; padding-inline-end: ${IconButtonSizeToken[size].defaultTrailingSpace}; } :host([size="${unsafeCSS(size)}"][width="narrow"]) .wrapper { padding-inline-start: ${IconButtonSizeToken[size].narrowLeadingSpace}; padding-inline-end: ${IconButtonSizeToken[size].narrowTrailingSpace}; } :host([size="${unsafeCSS(size)}"][width="wide"]) .wrapper { padding-inline-start: ${IconButtonSizeToken[size].wideLeadingSpace}; padding-inline-end: ${IconButtonSizeToken[size].wideTrailingSpace}; } :host([size="${unsafeCSS(size)}"]) .icon { font-size: ${IconButtonSizeToken[size].iconSize}; } :host([size="${unsafeCSS(size)}"]) .base { outline-offset: calc(0px - ${IconButtonSizeToken[size].outlineThickness}); outline-width: ${IconButtonSizeToken[size].outlineThickness}; } :host( :not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="rounded"]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}); } :host(:not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="square"]) .base { border-radius: ${IconButtonSizeToken[size].shapeSquare}; } :host( :not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="rounded"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: ${IconButtonSizeToken[size].selectedShapeRound}; } :host( :not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="square"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: var(--_button-shape, ${IconButtonSizeToken[size].selectedShapeSquare}); } :host(:not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"]:is(:state(--pressed), :--pressed)) .base { border-radius: ${IconButtonSizeToken[size].shapePressedMorph}; } :host(:is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="rounded"]) .base { border-start-start-radius: var( --_button-rounded-start-shape, var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}) ); border-end-start-radius: var( --_button-rounded-start-shape, var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}) ); border-start-end-radius: var( --_button-rounded-end-shape, var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}) ); border-end-end-radius: var( --_button-rounded-end-shape, var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}) ); } :host(:is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="square"]) .base { border-start-start-radius: var(--_button-square-start-shape, ${IconButtonSizeToken[size].shapeSquare}); border-end-start-radius: var(--_button-square-start-shape, ${IconButtonSizeToken[size].shapeSquare}); border-start-end-radius: var(--_button-square-end-shape, ${IconButtonSizeToken[size].shapeSquare}); border-end-end-radius: var(--_button-square-end-shape, ${IconButtonSizeToken[size].shapeSquare}); } :host( :is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="square"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: var(--_button-shape, ${IconButtonSizeToken[size].selectedShapeSquare}); } :host(:is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"]:is(:state(--pressed), :--pressed)) .base { border-start-start-radius: var( --_button-start-shape-pressed-morph, ${IconButtonSizeToken[size].shapePressedMorph} ); border-end-start-radius: var(--_button-start-shape-pressed-morph, ${IconButtonSizeToken[size].shapePressedMorph}); border-start-end-radius: var(--_button-end-shape-pressed-morph, ${IconButtonSizeToken[size].shapePressedMorph}); border-end-end-radius: var(--_button-end-shape-pressed-morph, ${IconButtonSizeToken[size].shapePressedMorph}); }`;
|
|
16378
|
+
return css`:host([size="${unsafeCSS(size)}"]) .base { height: ${IconButtonSizeToken[size].containerHeight}; } :host([size="${unsafeCSS(size)}"][width="default"]) .wrapper { padding-inline-start: calc( ${IconButtonSizeToken[size].defaultLeadingSpace} - calc(calc(var(--_adjacent-shrink, 0px) / 2)) ); padding-inline-end: calc( ${IconButtonSizeToken[size].defaultTrailingSpace} - calc(calc(var(--_adjacent-shrink, 0px) / 2)) ); } :host([size="${unsafeCSS(size)}"][width="narrow"]) .wrapper { padding-inline-start: calc( ${IconButtonSizeToken[size].narrowLeadingSpace} - calc(calc(var(--_adjacent-shrink, 0px) / 2)) ); padding-inline-end: calc( ${IconButtonSizeToken[size].narrowTrailingSpace} - calc(calc(var(--_adjacent-shrink, 0px) / 2)) ); } :host([size="${unsafeCSS(size)}"][width="wide"]) .wrapper { padding-inline-start: calc( ${IconButtonSizeToken[size].wideLeadingSpace} - calc(calc(var(--_adjacent-shrink, 0px) / 2)) ); padding-inline-end: calc( ${IconButtonSizeToken[size].wideTrailingSpace} - calc(calc(var(--_adjacent-shrink, 0px) / 2)) ); } :host([size="${unsafeCSS(size)}"]) .icon { font-size: ${IconButtonSizeToken[size].iconSize}; } :host([size="${unsafeCSS(size)}"]) .base { outline-offset: calc(0px - ${IconButtonSizeToken[size].outlineThickness}); outline-width: ${IconButtonSizeToken[size].outlineThickness}; } :host( :not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="rounded"]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}); } :host( :is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="rounded"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}); } :host(:not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="square"]) .base { border-radius: ${IconButtonSizeToken[size].shapeSquare}; } :host( :not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="rounded"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: ${IconButtonSizeToken[size].selectedShapeRound}; } :host( :not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"][shape="square"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: var(--_button-shape, ${IconButtonSizeToken[size].selectedShapeSquare}); } :host(:not(:is(:state(--connected), :--connected))[size="${unsafeCSS(size)}"]:is(:state(--pressed), :--pressed)) .base { border-radius: ${IconButtonSizeToken[size].shapePressedMorph}; } :host(:is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="rounded"]:not([toggle][selected])) .base { border-start-start-radius: var( --_button-rounded-start-shape, var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}) ); border-end-start-radius: var( --_button-rounded-start-shape, var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}) ); border-start-end-radius: var( --_button-rounded-end-shape, var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}) ); border-end-end-radius: var( --_button-rounded-end-shape, var(--_button-shape, ${IconButtonSizeToken[size].shapeRound}) ); } :host(:is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="square"]) .base { border-start-start-radius: var(--_button-square-start-shape, ${IconButtonSizeToken[size].shapeSquare}); border-end-start-radius: var(--_button-square-start-shape, ${IconButtonSizeToken[size].shapeSquare}); border-start-end-radius: var(--_button-square-end-shape, ${IconButtonSizeToken[size].shapeSquare}); border-end-end-radius: var(--_button-square-end-shape, ${IconButtonSizeToken[size].shapeSquare}); } :host( :is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"][shape="square"][toggle][selected]:not( :is(:state(--pressed), :--pressed) ) ) .base { border-radius: var(--_button-shape, ${IconButtonSizeToken[size].selectedShapeSquare}); } :host(:is(:state(--connected), :--connected)[size="${unsafeCSS(size)}"]:is(:state(--pressed), :--pressed)) .base { border-start-start-radius: var( --_button-start-shape-pressed-morph, ${IconButtonSizeToken[size].shapePressedMorph} ); border-end-start-radius: var(--_button-start-shape-pressed-morph, ${IconButtonSizeToken[size].shapePressedMorph}); border-start-end-radius: var(--_button-end-shape-pressed-morph, ${IconButtonSizeToken[size].shapePressedMorph}); border-end-end-radius: var(--_button-end-shape-pressed-morph, ${IconButtonSizeToken[size].shapePressedMorph}); }`;
|
|
16292
16379
|
}
|
|
16293
16380
|
/**
|
|
16294
16381
|
* Size variant styles for `M3eIconButtonElement`.
|
|
@@ -16301,7 +16388,7 @@ const IconButtonSizeStyle = [iconButtonStyle("extra-small"), iconButtonStyle("sm
|
|
|
16301
16388
|
* @internal
|
|
16302
16389
|
*/
|
|
16303
16390
|
const IconButtonStyle = css`:host { display: inline-block; outline: none; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { box-sizing: border-box; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; position: relative; width: 100%; transition: ${unsafeCSS(`background-color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard}`)}; } .touch { position: absolute; aspect-ratio: 1 / 1; height: 3rem; left: auto; right: auto; } :host(:is(:state(--pressed), :--pressed)) .base, :host(:is(:state(--resting), :--resting)) .base { transition: ${unsafeCSS(`background-color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard},
|
|
16304
|
-
border-radius ${DesignToken$1.motion.spring.fastEffects}`)}; } .wrapper { width: 100%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; transition: ${unsafeCSS(`padding-inline ${DesignToken$1.motion.spring.fastEffects}`)}; } .icon { transition: ${unsafeCSS(`color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard}`)}; --m3e-icon-size: 1em; } :host(:not(:disabled):not([disabled-interactive])) { cursor: pointer; } :host([disabled-interactive]) { cursor: not-allowed; } ::slotted(*) { font-size: inherit !important; flex: none; transform: var(--_icon-button-icon-transform); transform-origin: center center; transition: ${unsafeCSS(`transform var(--_icon-button-icon-transform-transition, ${DesignToken$1.motion.spring.fastEffects})`)}; } ::slotted(svg) { width: 1em; height: 1em; } :host([toggle]:not([selected])) .base.with-selected-icon slot[name="selected"], :host([toggle][selected]) .base.with-selected-icon slot:not([name]) { display: none; } a { all: unset; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1; } :host(:is(:state(--grouped), :--grouped):is(:state(--connected), :--connected)) { flex: 1 1 auto; } :host(
|
|
16391
|
+
border-radius ${DesignToken$1.motion.spring.fastEffects}`)}; } .wrapper { width: 100%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; transition: ${unsafeCSS(`padding-inline ${DesignToken$1.motion.spring.fastEffects}`)}; } .icon { transition: ${unsafeCSS(`color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard}`)}; --m3e-icon-size: 1em; } :host(:not(:disabled):not([disabled-interactive])) { cursor: pointer; } :host([disabled-interactive]) { cursor: not-allowed; } ::slotted(*) { font-size: inherit !important; flex: none; transform: var(--_icon-button-icon-transform); transform-origin: center center; transition: ${unsafeCSS(`transform var(--_icon-button-icon-transform-transition, ${DesignToken$1.motion.spring.fastEffects})`)}; } ::slotted(svg) { width: 1em; height: 1em; } :host([toggle]:not([selected])) .base.with-selected-icon slot[name="selected"], :host([toggle][selected]) .base.with-selected-icon slot:not([name]) { display: none; } a { all: unset; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1; } :host(:is(:state(--grouped), :--grouped):is(:state(--connected), :--connected)) { flex: 1 1 auto; } :host(:is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected))) { transition: ${unsafeCSS(`flex-basis ${DesignToken$1.motion.spring.fastEffects}`)}; } :host(:is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected))) .wrapper { transition: ${unsafeCSS(`padding-inline ${DesignToken$1.motion.spring.fastEffects}`)}; } :host(:is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected))) { flex-shrink: 0; flex-grow: 0; } :host( :is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected)):not( :is(:state(--pressed), :--pressed, :state(--adjacent-pressed), :--adjacent-pressed) ) ) { flex-basis: var(--_button-width); } :host( :is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected)):is( :state(--pressed), :--pressed ):not([disabled-interactive]):not(:disabled) ) { flex-basis: calc( var(--_button-width) + calc(var(--_button-width) * var(--m3e-standard-button-group-width-multiplier, 0.15)) ); } @media (forced-colors: active) { .base, .icon { transition: none; } :host(:is(:state(--pressed), :--pressed)) .base, :host(:is(:state(--resting), :--resting)) .base { transition: border-radius ${DesignToken$1.motion.spring.fastEffects}; } :host([variant]:not(:disabled):not([disabled-interactive]):not([toggle])) .base { background-color: ButtonFace; outline-color: ButtonText; } :host([variant]:not(:disabled):not([disabled-interactive]):not([toggle])) .icon { color: ButtonText; } :host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .base { background-color: ButtonFace; outline-color: ButtonText; } :host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .icon, :host([variant]:hover:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .icon, :host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected]):focus) .icon { color: ButtonText; } :host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]) .base { background-color: ButtonText; outline: none; } :host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]) .icon, :host([variant]:hover:not(:disabled):not([disabled-interactive])[toggle][selected]) .icon, :host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]:focus) .icon { forced-color-adjust: none; color: ButtonFace; background-color: ButtonText; } :host([variant]:disabled) .base, :host([variant][disabled-interactive]) .base { outline-color: GrayText; background-color: unset; } :host([variant]:disabled) .icon, :host([variant][disabled-interactive]) .icon { color: GrayText; } .base { outline-style: solid; } :host([size="extra-small"]) .base { outline-offset: calc(0px - var(--m3e-icon-button-extra-small-outline-thickness, 1px)); outline-width: var(--m3e-icon-button-extra-small-outline-thickness, 1px); } :host([size="small"]) .base { outline-offset: calc(0px - var(--m3e-icon-button-small-outline-thickness, 1px)); outline-width: var(--m3e-icon-button-small-outline-thickness, 1px); } :host([size="medium"]) .base { outline-offset: calc(0px - var(--m3e-icon-button-medium-outline-thickness, 1px)); outline-width: var(--m3e-icon-button-medium-outline-thickness, 1px); } :host([size="large"]) .base { outline-offset: calc(0px - var(--m3e-icon-button-large-outline-thickness, 2px)); outline-width: var(--m3e-icon-button-large-outline-thickness, 2px); } :host([size="extra-large"]) .base { outline-offset: calc(0px - var(--m3e-icon-button-extra-large-outline-thickness, 3px)); outline-width: var(--m3e-icon-button-extra-large-outline-thickness, 3px); } } @media (prefers-reduced-motion) { :host(:is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected))), :host(:is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected))) .wrapper, :host(:is(:state(--pressed), :--pressed)) .base, :host(:is(:state(--resting), :--resting)) .base, .base, .wrapper, .icon { transition: none; } }`;
|
|
16305
16392
|
|
|
16306
16393
|
/**
|
|
16307
16394
|
* Component design tokens that control the appearance variants of `M3eIconButtonElement`.
|
|
@@ -16715,7 +16802,7 @@ function iconButtonVariantStyle(variant) {
|
|
|
16715
16802
|
*/
|
|
16716
16803
|
const IconButtonVariantStyle = [iconButtonVariantStyle("standard"), iconButtonVariantStyle("outlined"), iconButtonVariantStyle("filled"), iconButtonVariantStyle("tonal"), iconButtonVariantStyle("elevated"), css`:host([variant="outlined"]:not([toggle][selected]):not(:disabled):not([disabled-interactive])) .base { outline-style: solid; }`];
|
|
16717
16804
|
|
|
16718
|
-
var _M3eIconButtonElement_instances, _M3eIconButtonElement_clickHandler, _M3eIconButtonElement_updateButtonShape, _M3eIconButtonElement_handlePressedChange, _M3eIconButtonElement_handleClick, _M3eIconButtonElement_handleSelectedIconSlotChange;
|
|
16805
|
+
var _M3eIconButtonElement_instances, _M3eIconButtonElement_clickHandler, _M3eIconButtonElement_updateButtonShape, _M3eIconButtonElement_handlePressedChange, _M3eIconButtonElement_cleanupAdjacentPressed, _M3eIconButtonElement_handleClick, _M3eIconButtonElement_handleSelectedIconSlotChange;
|
|
16719
16806
|
/**
|
|
16720
16807
|
* An icon button users interact with to perform a supplementary action.
|
|
16721
16808
|
*
|
|
@@ -17058,11 +17145,7 @@ let M3eIconButtonElement = class M3eIconButtonElement extends KeyboardClick$1(Li
|
|
|
17058
17145
|
*/
|
|
17059
17146
|
this.selected = false;
|
|
17060
17147
|
new ResizeController$1(this, {
|
|
17061
|
-
callback: () =>
|
|
17062
|
-
if (this.grouped) {
|
|
17063
|
-
this._handleResize();
|
|
17064
|
-
}
|
|
17065
|
-
}
|
|
17148
|
+
callback: () => this._handleResize()
|
|
17066
17149
|
});
|
|
17067
17150
|
new FocusController$1(this, {
|
|
17068
17151
|
callback: focused => {
|
|
@@ -17078,11 +17161,7 @@ let M3eIconButtonElement = class M3eIconButtonElement extends KeyboardClick$1(Li
|
|
|
17078
17161
|
if (!this.disabled && !this.disabledInteractive) {
|
|
17079
17162
|
if (pressed) {
|
|
17080
17163
|
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_updateButtonShape).call(this);
|
|
17081
|
-
|
|
17082
|
-
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_handlePressedChange).call(this, true);
|
|
17083
|
-
} else {
|
|
17084
|
-
requestAnimationFrame(() => __classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_handlePressedChange).call(this, true));
|
|
17085
|
-
}
|
|
17164
|
+
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_handlePressedChange).call(this, true);
|
|
17086
17165
|
} else {
|
|
17087
17166
|
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_handlePressedChange).call(this, false);
|
|
17088
17167
|
}
|
|
@@ -17109,7 +17188,7 @@ let M3eIconButtonElement = class M3eIconButtonElement extends KeyboardClick$1(Li
|
|
|
17109
17188
|
["--pressed", "--resting", "--grouped", "--connected"].forEach(x => deleteCustomState$1(this, x));
|
|
17110
17189
|
this._base?.style.removeProperty("--_button-shape");
|
|
17111
17190
|
this.style.removeProperty("--_button-width");
|
|
17112
|
-
this.style.removeProperty("--_adjacent-
|
|
17191
|
+
this.style.removeProperty("--_adjacent-shrink");
|
|
17113
17192
|
deleteCustomState$1(this, "--adjacent-pressed");
|
|
17114
17193
|
this.removeEventListener("click", __classPrivateFieldGet(this, _M3eIconButtonElement_clickHandler, "f"));
|
|
17115
17194
|
}
|
|
@@ -17136,7 +17215,7 @@ let M3eIconButtonElement = class M3eIconButtonElement extends KeyboardClick$1(Li
|
|
|
17136
17215
|
}
|
|
17137
17216
|
/** @private */
|
|
17138
17217
|
_handleResize() {
|
|
17139
|
-
if (this.grouped && !hasCustomState$1(this, "--
|
|
17218
|
+
if (this.grouped && !hasCustomState$1(this, "--no-resize") && this !== document.activeElement) {
|
|
17140
17219
|
this.style.setProperty("--_button-width", `${this.clientWidth}px`);
|
|
17141
17220
|
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_updateButtonShape).call(this, true);
|
|
17142
17221
|
}
|
|
@@ -17155,27 +17234,67 @@ _M3eIconButtonElement_updateButtonShape = function _M3eIconButtonElement_updateB
|
|
|
17155
17234
|
}
|
|
17156
17235
|
};
|
|
17157
17236
|
_M3eIconButtonElement_handlePressedChange = function _M3eIconButtonElement_handlePressedChange(pressed) {
|
|
17158
|
-
|
|
17159
|
-
setCustomState$1(this, "--resting", !pressed);
|
|
17237
|
+
const clientWidth = this.getBoundingClientRect().width;
|
|
17160
17238
|
const group = this.closest("m3e-button-group");
|
|
17161
|
-
if (group) {
|
|
17162
|
-
const clientWidth = this.getBoundingClientRect().width;
|
|
17239
|
+
if (group && group.variant === "standard") {
|
|
17163
17240
|
const buttons = [...group.querySelectorAll("m3e-button,m3e-icon-button")];
|
|
17164
17241
|
const index = buttons.indexOf(this);
|
|
17165
|
-
|
|
17166
|
-
const
|
|
17167
|
-
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
}
|
|
17171
|
-
|
|
17172
|
-
|
|
17242
|
+
if (pressed) {
|
|
17243
|
+
const multiplier = parseFloat(getComputedStyle(this).getPropertyValue("--m3e-standard-button-group-width-multiplier") || "0.15");
|
|
17244
|
+
let adjacentShrink = clientWidth * multiplier;
|
|
17245
|
+
if (index > 0 && index < buttons.length - 1) {
|
|
17246
|
+
adjacentShrink /= 2;
|
|
17247
|
+
}
|
|
17248
|
+
for (let i = 0; i < buttons.length; i++) {
|
|
17249
|
+
if (i == index - 1 || i == index + 1) {
|
|
17250
|
+
addCustomState$1(buttons[i], "--no-resize");
|
|
17251
|
+
buttons[i].style.setProperty("--_adjacent-shrink", `${adjacentShrink}px`);
|
|
17252
|
+
addCustomState$1(buttons[i], "--adjacent-pressed");
|
|
17253
|
+
} else if (i == index) {
|
|
17254
|
+
addCustomState$1(buttons[i], "--no-resize");
|
|
17255
|
+
buttons[i].style.removeProperty("--_adjacent-shrink");
|
|
17256
|
+
deleteCustomState$1(buttons[i], "--adjacent-pressed");
|
|
17257
|
+
} else {
|
|
17258
|
+
deleteCustomState$1(buttons[i], "--no-resize");
|
|
17259
|
+
buttons[i].style.removeProperty("--_adjacent-shrink");
|
|
17260
|
+
deleteCustomState$1(buttons[i], "--adjacent-pressed");
|
|
17261
|
+
}
|
|
17262
|
+
}
|
|
17263
|
+
} else {
|
|
17264
|
+
for (let i = 0; i < buttons.length; i++) {
|
|
17265
|
+
if (i == index - 1 || i == index + 1) {
|
|
17266
|
+
buttons[i].style.setProperty("--_adjacent-shrink", "0px");
|
|
17267
|
+
}
|
|
17268
|
+
}
|
|
17269
|
+
if (!prefersReducedMotion$1()) {
|
|
17270
|
+
this.addEventListener("transitionend", e => {
|
|
17271
|
+
if (e.propertyName === "flex-basis") {
|
|
17272
|
+
queueMicrotask(() => {
|
|
17273
|
+
// Pressed state is tested to ensure this runs only when the button
|
|
17274
|
+
// is no longer pressed. This handles changes to pressed state in
|
|
17275
|
+
// quick succession.
|
|
17276
|
+
if (!hasCustomState$1(this, "--pressed")) {
|
|
17277
|
+
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_cleanupAdjacentPressed).call(this, buttons);
|
|
17278
|
+
}
|
|
17279
|
+
});
|
|
17280
|
+
}
|
|
17281
|
+
}, {
|
|
17282
|
+
once: true
|
|
17283
|
+
});
|
|
17173
17284
|
} else {
|
|
17174
|
-
|
|
17175
|
-
deleteCustomState$1(button, "--adjacent-pressed");
|
|
17285
|
+
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_cleanupAdjacentPressed).call(this, buttons);
|
|
17176
17286
|
}
|
|
17177
17287
|
}
|
|
17178
17288
|
}
|
|
17289
|
+
setCustomState$1(this, "--pressed", pressed);
|
|
17290
|
+
setCustomState$1(this, "--resting", !pressed);
|
|
17291
|
+
};
|
|
17292
|
+
_M3eIconButtonElement_cleanupAdjacentPressed = function _M3eIconButtonElement_cleanupAdjacentPressed(buttons) {
|
|
17293
|
+
for (const button of buttons) {
|
|
17294
|
+
deleteCustomState$1(button, "--adjacent-pressed");
|
|
17295
|
+
deleteCustomState$1(button, "--no-resize");
|
|
17296
|
+
button.style.removeProperty("--_adjacent-shrink");
|
|
17297
|
+
}
|
|
17179
17298
|
};
|
|
17180
17299
|
_M3eIconButtonElement_handleClick = function _M3eIconButtonElement_handleClick(e) {
|
|
17181
17300
|
if (this.disabled || this.disabledInteractive) {
|
|
@@ -35113,6 +35232,55 @@ _M3eThemeElement_getContrastLevel = function _M3eThemeElement_getContrastLevel()
|
|
|
35113
35232
|
return 0;
|
|
35114
35233
|
}
|
|
35115
35234
|
};
|
|
35235
|
+
(() => {
|
|
35236
|
+
if (typeof window !== "undefined") {
|
|
35237
|
+
const composeCss = token => {
|
|
35238
|
+
let css = "";
|
|
35239
|
+
for (const key in token) {
|
|
35240
|
+
const cssVar = token[key].toString();
|
|
35241
|
+
if (!cssVar.startsWith("var(")) continue;
|
|
35242
|
+
const inner = cssVar.trim().slice(4, -1); // remove "var(" and ")"
|
|
35243
|
+
const [prop, fallback] = inner.split(/,(.+)/).map(s => s.trim());
|
|
35244
|
+
if (!prop.startsWith("--") || !fallback) continue;
|
|
35245
|
+
css += `${prop}:${fallback};`;
|
|
35246
|
+
}
|
|
35247
|
+
return css;
|
|
35248
|
+
};
|
|
35249
|
+
const omitKey = (obj, key) => {
|
|
35250
|
+
const {
|
|
35251
|
+
[key]: _unused,
|
|
35252
|
+
...rest
|
|
35253
|
+
} = obj;
|
|
35254
|
+
return rest;
|
|
35255
|
+
};
|
|
35256
|
+
let css = "";
|
|
35257
|
+
css += composeCss(DesignToken$1.typescale.standard.display.large);
|
|
35258
|
+
css += composeCss(DesignToken$1.typescale.standard.display.medium);
|
|
35259
|
+
css += composeCss(DesignToken$1.typescale.standard.display.small);
|
|
35260
|
+
css += composeCss(DesignToken$1.typescale.standard.headline.large);
|
|
35261
|
+
css += composeCss(DesignToken$1.typescale.standard.headline.medium);
|
|
35262
|
+
css += composeCss(DesignToken$1.typescale.standard.headline.small);
|
|
35263
|
+
css += composeCss(DesignToken$1.typescale.standard.title.large);
|
|
35264
|
+
css += composeCss(DesignToken$1.typescale.standard.title.medium);
|
|
35265
|
+
css += composeCss(DesignToken$1.typescale.standard.title.small);
|
|
35266
|
+
css += composeCss(DesignToken$1.typescale.standard.label.large);
|
|
35267
|
+
css += composeCss(DesignToken$1.typescale.standard.label.medium);
|
|
35268
|
+
css += composeCss(DesignToken$1.typescale.standard.label.small);
|
|
35269
|
+
css += composeCss(DesignToken$1.typescale.standard.body.large);
|
|
35270
|
+
css += composeCss(DesignToken$1.typescale.standard.body.medium);
|
|
35271
|
+
css += composeCss(DesignToken$1.typescale.standard.body.small);
|
|
35272
|
+
css += composeCss(DesignToken$1.elevation);
|
|
35273
|
+
css += composeCss(DesignToken$1.shape.corner.value);
|
|
35274
|
+
css += composeCss(omitKey(DesignToken$1.shape.corner, "value"));
|
|
35275
|
+
css += composeCss(DesignToken$1.motion.duration);
|
|
35276
|
+
css += composeCss(DesignToken$1.motion.easing);
|
|
35277
|
+
css += composeCss(DesignToken$1.motion.spring);
|
|
35278
|
+
css += composeCss(omitKey(DesignToken$1.density, "calc"));
|
|
35279
|
+
css += composeCss(DesignToken$1.measurement);
|
|
35280
|
+
css += composeCss(DesignToken$1.state);
|
|
35281
|
+
registerStyleSheet$1(unsafeCSS(`html{${css}}`));
|
|
35282
|
+
}
|
|
35283
|
+
})();
|
|
35116
35284
|
/** The styles of the element. */
|
|
35117
35285
|
M3eThemeElement.styles = css`:host { display: contents; }`;
|
|
35118
35286
|
__decorate([property()], M3eThemeElement.prototype, "color", void 0);
|
|
@@ -35233,7 +35401,7 @@ _a$1 = TocGenerator, _TocGenerator_getHeaderLevel = function _TocGenerator_getHe
|
|
|
35233
35401
|
return element.tagName.startsWith("H") ? parseInt(element.tagName.substring(1)) : parseInt(element.getAttribute("level") ?? "0");
|
|
35234
35402
|
};
|
|
35235
35403
|
|
|
35236
|
-
var _M3eTocElement_instances, _M3eTocElement_ignoreScroll, _M3eTocElement_selectionManager, _M3eTocElement_intersectionController, _M3eTocElement_scrollController, _M3eTocElement_mutationController, _M3eTocElement_renderNode, _M3eTocElement_handleOverlineSlotChange, _M3eTocElement_handleTitleSlotChange, _M3eTocElement_handleClick, _M3eTocElement_generateToc;
|
|
35404
|
+
var _M3eTocElement_instances, _M3eTocElement_ignoreScroll, _M3eTocElement_selectionManager, _M3eTocElement_intersectionController, _M3eTocElement_scrollController, _M3eTocElement_mutationController, _M3eTocElement_resizeController, _M3eTocElement_renderNode, _M3eTocElement_handleOverlineSlotChange, _M3eTocElement_handleTitleSlotChange, _M3eTocElement_handleClick, _M3eTocElement_generateToc;
|
|
35237
35405
|
/**
|
|
35238
35406
|
* A table of contents that provides in-page scroll navigation.
|
|
35239
35407
|
*
|
|
@@ -35300,6 +35468,9 @@ let M3eTocElement = class M3eTocElement extends HtmlFor$1(AttachInternals$1(Role
|
|
|
35300
35468
|
_M3eTocElement_ignoreScroll.set(this, false);
|
|
35301
35469
|
/** @private */
|
|
35302
35470
|
_M3eTocElement_selectionManager.set(this, new SelectionManager().withHomeAndEnd().withVerticalOrientation().disableRovingTabIndex().onSelectedItemsChange(() => {
|
|
35471
|
+
for (const target of __classPrivateFieldGet(this, _M3eTocElement_resizeController, "f").targets) {
|
|
35472
|
+
__classPrivateFieldGet(this, _M3eTocElement_resizeController, "f").unobserve(target);
|
|
35473
|
+
}
|
|
35303
35474
|
if (this._activeIndicator) {
|
|
35304
35475
|
const item = __classPrivateFieldGet(this, _M3eTocElement_selectionManager, "f").selectedItems[0];
|
|
35305
35476
|
if (!item) {
|
|
@@ -35308,6 +35479,7 @@ let M3eTocElement = class M3eTocElement extends HtmlFor$1(AttachInternals$1(Role
|
|
|
35308
35479
|
this._activeIndicator.style.height = `0px`;
|
|
35309
35480
|
this._activeIndicator.style.visibility = "hidden";
|
|
35310
35481
|
} else {
|
|
35482
|
+
__classPrivateFieldGet(this, _M3eTocElement_resizeController, "f").observe(item);
|
|
35311
35483
|
const scrollContainer = this._scrollContainer;
|
|
35312
35484
|
if (item === __classPrivateFieldGet(this, _M3eTocElement_selectionManager, "f").items[0]) {
|
|
35313
35485
|
scrollContainer.scrollTo({
|
|
@@ -35373,6 +35545,18 @@ let M3eTocElement = class M3eTocElement extends HtmlFor$1(AttachInternals$1(Role
|
|
|
35373
35545
|
},
|
|
35374
35546
|
callback: () => this._updateToc()
|
|
35375
35547
|
}));
|
|
35548
|
+
/** @private */
|
|
35549
|
+
_M3eTocElement_resizeController.set(this, new ResizeController$1(this, {
|
|
35550
|
+
target: null,
|
|
35551
|
+
callback: () => {
|
|
35552
|
+
const item = __classPrivateFieldGet(this, _M3eTocElement_selectionManager, "f").selectedItems[0];
|
|
35553
|
+
if (item && this._activeIndicator) {
|
|
35554
|
+
this._activeIndicator.style.top = `${item.offsetTop}px`;
|
|
35555
|
+
this._activeIndicator.style.height = `${item.clientHeight}px`;
|
|
35556
|
+
this._activeIndicator.style.visibility = item.clientHeight == 0 ? "hidden" : "";
|
|
35557
|
+
}
|
|
35558
|
+
}
|
|
35559
|
+
}));
|
|
35376
35560
|
/**
|
|
35377
35561
|
* The maximum depth of the table of contents.
|
|
35378
35562
|
* @default 2
|
|
@@ -35440,6 +35624,7 @@ _M3eTocElement_selectionManager = new WeakMap();
|
|
|
35440
35624
|
_M3eTocElement_intersectionController = new WeakMap();
|
|
35441
35625
|
_M3eTocElement_scrollController = new WeakMap();
|
|
35442
35626
|
_M3eTocElement_mutationController = new WeakMap();
|
|
35627
|
+
_M3eTocElement_resizeController = new WeakMap();
|
|
35443
35628
|
_M3eTocElement_instances = new WeakSet();
|
|
35444
35629
|
_M3eTocElement_renderNode = function _M3eTocElement_renderNode(node) {
|
|
35445
35630
|
return html`<li><m3e-toc-item tabindex="-1" .node="${node}" @click="${__classPrivateFieldGet(this, _M3eTocElement_instances, "m", _M3eTocElement_handleClick)}">${node.label}</m3e-toc-item>${node.nodes.length == 0 ? nothing : html`<ul>${node.nodes.map(x => __classPrivateFieldGet(this, _M3eTocElement_instances, "m", _M3eTocElement_renderNode).call(this, x))}</ul>`}</li>`;
|