@m3e/web 2.5.8 → 2.5.10
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 +267 -75
- 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 +39 -13
- 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 +63 -31
- 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 +444 -444
- package/dist/custom-elements.json +2985 -2881
- package/dist/html-custom-data.json +126 -126
- package/dist/icon-button.js +63 -31
- 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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { __classPrivateFieldGet, __decorate, __classPrivateFieldSet } from 'tslib';
|
|
7
7
|
import { unsafeCSS, css, LitElement, html, nothing, isServer, noChange, svg } from 'lit';
|
|
8
8
|
import { query, property, queryAssignedElements, state } from 'lit/decorators.js';
|
|
9
|
-
import { DesignToken as DesignToken$1, HtmlFor as HtmlFor$1, Role as Role$1, hasAssignedNodes as hasAssignedNodes$1, debounce as debounce$1, customElement as customElement$1, MutationController as MutationController$1, setCustomState as setCustomState$1, deleteCustomState as deleteCustomState$1, prefersReducedMotion as prefersReducedMotion$1, scrollIntoViewIfNeeded as scrollIntoViewIfNeeded$1, forcedColorsActive as forcedColorsActive$1, addCustomState as addCustomState$1, ActionElementBase as ActionElementBase$1, ReconnectedCallback as ReconnectedCallback$1, SuppressInitialAnimation as SuppressInitialAnimation$1, AttachInternals as AttachInternals$1, VelocityTracker as VelocityTracker$1, ScrollLockController as ScrollLockController$1, InertController as InertController$1, ResizeController as ResizeController$1, focusWhenReady as focusWhenReady$1, hasCustomState as hasCustomState$1, computeCssSize as computeCssSize$1, registerStyleSheet as registerStyleSheet$1, spaceSeparatedStringConverter as spaceSeparatedStringConverter$1, KeyboardClick as KeyboardClick$1, LinkButton as LinkButton$1, Focusable as Focusable$1, Disabled as Disabled$1, renderPseudoLink as renderPseudoLink$1, FormSubmitter as FormSubmitter$1, DisabledInteractive as DisabledInteractive$1, FocusController as FocusController$1, PressedController as PressedController$1, isSelectedMixin as isSelectedMixin$1, dateConverter as dateConverter$1, Labelled as Labelled$1, RequiredConstraintValidation as RequiredConstraintValidation$1, Dirty as Dirty$1, Touched as Touched$1, Required as Required$1, ConstraintValidation as ConstraintValidation$1, CheckedIndeterminate as CheckedIndeterminate$1, FormAssociated as FormAssociated$1, HoverController as HoverController$1, formValue as formValue$1, isDisabledMixin as isDisabledMixin$1, isDisabledInteractiveMixin as isDisabledInteractiveMixin$1, isLinkButtonMixin as isLinkButtonMixin$1, getTextContent as getTextContent$1, Vertical as Vertical$1, Selected as Selected$1, getScrollbarWidth as getScrollbarWidth$1, ScrollController as ScrollController$1, isReadOnlyMixin as isReadOnlyMixin$1, interceptProperty as interceptProperty$1, computeLineCount as computeLineCount$1, generateClipPaths as generateClipPaths$1, Checked as Checked$1, resumeAnimation as resumeAnimation$1, AnimationLoopController as AnimationLoopController$1, resolveFragmentUrl as resolveFragmentUrl$1, safeStyleMap as safeStyleMap$1, updateLabels as updateLabels$1,
|
|
9
|
+
import { DesignToken as DesignToken$1, HtmlFor as HtmlFor$1, Role as Role$1, hasAssignedNodes as hasAssignedNodes$1, debounce as debounce$1, customElement as customElement$1, MutationController as MutationController$1, setCustomState as setCustomState$1, deleteCustomState as deleteCustomState$1, prefersReducedMotion as prefersReducedMotion$1, scrollIntoViewIfNeeded as scrollIntoViewIfNeeded$1, forcedColorsActive as forcedColorsActive$1, addCustomState as addCustomState$1, ActionElementBase as ActionElementBase$1, ReconnectedCallback as ReconnectedCallback$1, SuppressInitialAnimation as SuppressInitialAnimation$1, AttachInternals as AttachInternals$1, VelocityTracker as VelocityTracker$1, ScrollLockController as ScrollLockController$1, InertController as InertController$1, ResizeController as ResizeController$1, focusWhenReady as focusWhenReady$1, hasCustomState as hasCustomState$1, computeCssSize as computeCssSize$1, registerStyleSheet as registerStyleSheet$1, spaceSeparatedStringConverter as spaceSeparatedStringConverter$1, KeyboardClick as KeyboardClick$1, LinkButton as LinkButton$1, Focusable as Focusable$1, Disabled as Disabled$1, renderPseudoLink as renderPseudoLink$1, FormSubmitter as FormSubmitter$1, DisabledInteractive as DisabledInteractive$1, FocusController as FocusController$1, PressedController as PressedController$1, waitForUpgrade as waitForUpgrade$1, isSelectedMixin as isSelectedMixin$1, dateConverter as dateConverter$1, Labelled as Labelled$1, RequiredConstraintValidation as RequiredConstraintValidation$1, Dirty as Dirty$1, Touched as Touched$1, Required as Required$1, ConstraintValidation as ConstraintValidation$1, CheckedIndeterminate as CheckedIndeterminate$1, FormAssociated as FormAssociated$1, HoverController as HoverController$1, formValue as formValue$1, isDisabledMixin as isDisabledMixin$1, isDisabledInteractiveMixin as isDisabledInteractiveMixin$1, isLinkButtonMixin as isLinkButtonMixin$1, getTextContent as getTextContent$1, Vertical as Vertical$1, Selected as Selected$1, getScrollbarWidth as getScrollbarWidth$1, ScrollController as ScrollController$1, isReadOnlyMixin as isReadOnlyMixin$1, interceptProperty as interceptProperty$1, computeLineCount as computeLineCount$1, generateClipPaths as generateClipPaths$1, Checked as Checked$1, resumeAnimation as resumeAnimation$1, AnimationLoopController as AnimationLoopController$1, resolveFragmentUrl as resolveFragmentUrl$1, safeStyleMap as safeStyleMap$1, updateLabels as updateLabels$1, guid as guid$1, IntersectionController as IntersectionController$1, LongPressController as LongPressController$1 } from '@m3e/web/core';
|
|
10
10
|
import { ListKeyManager, M3eLiveAnnouncer, M3eInteractivityChecker, isModifierAllowed, addAriaReferencedId, removeAriaReferencedId, selectionManager, SelectionManager, ListManager, RovingTabIndexManager, M3eAriaDescriber, typeaheadLabel } from '@m3e/web/core/a11y';
|
|
11
11
|
import { M3eOptGroupElement as M3eOptGroupElement$1 } from '@m3e/web/option';
|
|
12
12
|
import { M3eDirectionality } from '@m3e/web/core/bidi';
|
|
@@ -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(var(--_adjacent-shrink, 0px) / 2)); padding-inline-end: calc(${ButtonSizeToken[size].trailingSpace} - 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(`width ${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) ) ) { width: var(--_button-width); } :host( :is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected)):not( :is(:state(--pressed), :--pressed) ):is(:state(--adjacent-pressed), :--adjacent-pressed) ) { width: calc(var(--_button-width) - var(--_adjacent-shrink, 0px)); } :host( :is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected)):is( :state(--pressed), :--pressed ):not([disabled-interactive]):not(:disabled) ) { width: 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,8 +3689,8 @@ let M3eButtonElement = class M3eButtonElement extends KeyboardClick$1(LinkButton
|
|
|
3697
3689
|
}
|
|
3698
3690
|
/** @private */
|
|
3699
3691
|
_handleResize() {
|
|
3700
|
-
if (this.grouped && !hasCustomState$1(this, "--
|
|
3701
|
-
this.style.setProperty("--_button-width", `${this.
|
|
3692
|
+
if (this.grouped && !hasCustomState$1(this, "--no-resize") && this !== document.activeElement) {
|
|
3693
|
+
this.style.setProperty("--_button-width", `${this.getBoundingClientRect().width}px`);
|
|
3702
3694
|
__classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_updateButtonShape).call(this, true);
|
|
3703
3695
|
}
|
|
3704
3696
|
}
|
|
@@ -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 === "width") {
|
|
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.
|
|
@@ -3910,11 +3933,18 @@ let M3eButtonGroupElement = class M3eButtonGroupElement extends Role$1(LitElemen
|
|
|
3910
3933
|
};
|
|
3911
3934
|
_M3eButtonGroupElement_pressedController = new WeakMap();
|
|
3912
3935
|
_M3eButtonGroupElement_instances = new WeakSet();
|
|
3913
|
-
_M3eButtonGroupElement_updateButtons =
|
|
3936
|
+
_M3eButtonGroupElement_updateButtons = /** @private */
|
|
3937
|
+
async function _M3eButtonGroupElement_updateButtons() {
|
|
3914
3938
|
const buttons = this.buttons;
|
|
3915
3939
|
for (const target of __classPrivateFieldGet(this, _M3eButtonGroupElement_pressedController, "f").targets) {
|
|
3916
3940
|
__classPrivateFieldGet(this, _M3eButtonGroupElement_pressedController, "f").unobserve(target);
|
|
3917
3941
|
}
|
|
3942
|
+
for (const button of this.buttons) {
|
|
3943
|
+
await waitForUpgrade$1(button);
|
|
3944
|
+
if (button.isUpdatePending) {
|
|
3945
|
+
await button.updateComplete;
|
|
3946
|
+
}
|
|
3947
|
+
}
|
|
3918
3948
|
const canToggle = [...buttons].some(x => x.toggle);
|
|
3919
3949
|
// disable-role is an internal attribute to by split-button to disable setting roles.
|
|
3920
3950
|
if (!this.hasAttribute("disable-role")) {
|
|
@@ -3952,6 +3982,34 @@ _M3eButtonGroupElement_handleChange = function _M3eButtonGroupElement_handleChan
|
|
|
3952
3982
|
}
|
|
3953
3983
|
}
|
|
3954
3984
|
};
|
|
3985
|
+
_M3eButtonGroupElement_handlePressedChange = function _M3eButtonGroupElement_handlePressedChange(pressed) {
|
|
3986
|
+
const base = this._base;
|
|
3987
|
+
if (!base) return;
|
|
3988
|
+
if (!pressed || this.variant === "connected") {
|
|
3989
|
+
const button = this.buttons.find(x => x === document.activeElement);
|
|
3990
|
+
if (!prefersReducedMotion$1() && button) {
|
|
3991
|
+
button.addEventListener("transitionend", () => queueMicrotask(() => {
|
|
3992
|
+
// Pressed state is tested to ensure this runs only when the button
|
|
3993
|
+
// is no longer pressed. This handles changes to pressed state in
|
|
3994
|
+
// quick succession.
|
|
3995
|
+
if (!hasCustomState$1(button, "--pressed")) {
|
|
3996
|
+
__classPrivateFieldGet(this, _M3eButtonGroupElement_instances, "m", _M3eButtonGroupElement_cleanupPressed).call(this, base);
|
|
3997
|
+
}
|
|
3998
|
+
}), {
|
|
3999
|
+
once: true
|
|
4000
|
+
});
|
|
4001
|
+
} else {
|
|
4002
|
+
__classPrivateFieldGet(this, _M3eButtonGroupElement_instances, "m", _M3eButtonGroupElement_cleanupPressed).call(this, base);
|
|
4003
|
+
}
|
|
4004
|
+
} else {
|
|
4005
|
+
base.classList.add("pressed");
|
|
4006
|
+
base.style.setProperty("--_button-group-width", `${base.getBoundingClientRect().width}px`);
|
|
4007
|
+
}
|
|
4008
|
+
};
|
|
4009
|
+
_M3eButtonGroupElement_cleanupPressed = function _M3eButtonGroupElement_cleanupPressed(base) {
|
|
4010
|
+
base.style.removeProperty("--_button-group-width");
|
|
4011
|
+
base.classList.remove("pressed");
|
|
4012
|
+
};
|
|
3955
4013
|
/** The styles of the element. */
|
|
3956
4014
|
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
4015
|
__decorate([query(".base")], M3eButtonGroupElement.prototype, "_base", void 0);
|
|
@@ -8967,6 +9025,40 @@ const ElevationToken$1 = {
|
|
|
8967
9025
|
level5: unsafeCSS(`var(--md-sys-elevation-level5, ${elevation(12)})`)
|
|
8968
9026
|
};
|
|
8969
9027
|
|
|
9028
|
+
/** Design tokens that control measurements. */
|
|
9029
|
+
const MeasurementToken = {
|
|
9030
|
+
/** Zero spacing. */
|
|
9031
|
+
space0: unsafeCSS("var(--md-sys-measurement-space0, 0rem)"),
|
|
9032
|
+
/** 2dp spacing. */
|
|
9033
|
+
space25: unsafeCSS("var(--md-sys-measurement-space25, 0.125rem)"),
|
|
9034
|
+
/** 4dp spacing. */
|
|
9035
|
+
space50: unsafeCSS("var(--md-sys-measurement-space50, 0.25rem)"),
|
|
9036
|
+
/** 6dp spacing. */
|
|
9037
|
+
space75: unsafeCSS("var(--md-sys-measurement-space75, 0.375rem)"),
|
|
9038
|
+
/** 8dp spacing. */
|
|
9039
|
+
space100: unsafeCSS("var(--md-sys-measurement-space100, 0.5rem)"),
|
|
9040
|
+
/** 12dp spacing. */
|
|
9041
|
+
space150: unsafeCSS("var(--md-sys-measurement-space150, 0.75rem)"),
|
|
9042
|
+
/** 16dp spacing. */
|
|
9043
|
+
space200: unsafeCSS("var(--md-sys-measurement-space200, 1rem)"),
|
|
9044
|
+
/** 20dp spacing. */
|
|
9045
|
+
space250: unsafeCSS("var(--md-sys-measurement-space250, 1.25rem)"),
|
|
9046
|
+
/** 32dp spacing. */
|
|
9047
|
+
space300: unsafeCSS("var(--md-sys-measurement-space300, 2rem)"),
|
|
9048
|
+
/** 40dp spacing. */
|
|
9049
|
+
space400: unsafeCSS("var(--md-sys-measurement-space400, 2.5rem)"),
|
|
9050
|
+
/** 48dp spacing. */
|
|
9051
|
+
space500: unsafeCSS("var(--md-sys-measurement-space500, 3rem)"),
|
|
9052
|
+
/** 56dp spacing. */
|
|
9053
|
+
space600: unsafeCSS("var(--md-sys-measurement-space600, 3.5rem)"),
|
|
9054
|
+
/** 64dp spacing. */
|
|
9055
|
+
space700: unsafeCSS("var(--md-sys-measurement-space700, 4rem)"),
|
|
9056
|
+
/** 72dp spacing. */
|
|
9057
|
+
space800: unsafeCSS("var(--md-sys-measurement-space800, 4.5rem)"),
|
|
9058
|
+
/** 96dp spacing. */
|
|
9059
|
+
space900: unsafeCSS("var(--md-sys-measurement-space900, 6rem)")
|
|
9060
|
+
};
|
|
9061
|
+
|
|
8970
9062
|
const EasingToken = {
|
|
8971
9063
|
/** Emphasized transition. */
|
|
8972
9064
|
emphasized: unsafeCSS("var(--md-sys-motion-easing-emphasized, cubic-bezier(0.2, 0.0, 0, 1.0))"),
|
|
@@ -9376,7 +9468,9 @@ const DesignToken = {
|
|
|
9376
9468
|
/** Design tokens that control scrollbars. */
|
|
9377
9469
|
scrollbar: ScrollbarToken,
|
|
9378
9470
|
/** Design tokens that control density. */
|
|
9379
|
-
density: DensityToken
|
|
9471
|
+
density: DensityToken,
|
|
9472
|
+
/** Design tokens that control measurement. */
|
|
9473
|
+
measurement: MeasurementToken
|
|
9380
9474
|
};
|
|
9381
9475
|
|
|
9382
9476
|
/**
|
|
@@ -16288,7 +16382,7 @@ const IconButtonSizeToken = {
|
|
|
16288
16382
|
|
|
16289
16383
|
/** @private */
|
|
16290
16384
|
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}); }`;
|
|
16385
|
+
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(var(--_adjacent-shrink, 0px) / 2) ); padding-inline-end: calc( ${IconButtonSizeToken[size].defaultTrailingSpace} - calc(var(--_adjacent-shrink, 0px) / 2) ); } :host([size="${unsafeCSS(size)}"][width="narrow"]) .wrapper { padding-inline-start: calc( ${IconButtonSizeToken[size].narrowLeadingSpace} - calc(var(--_adjacent-shrink, 0px) / 2) ); padding-inline-end: calc( ${IconButtonSizeToken[size].narrowTrailingSpace} - calc(var(--_adjacent-shrink, 0px) / 2) ); } :host([size="${unsafeCSS(size)}"][width="wide"]) .wrapper { padding-inline-start: calc( ${IconButtonSizeToken[size].wideLeadingSpace} - calc(var(--_adjacent-shrink, 0px) / 2) ); padding-inline-end: calc(${IconButtonSizeToken[size].wideTrailingSpace} - 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
16386
|
}
|
|
16293
16387
|
/**
|
|
16294
16388
|
* Size variant styles for `M3eIconButtonElement`.
|
|
@@ -16301,7 +16395,7 @@ const IconButtonSizeStyle = [iconButtonStyle("extra-small"), iconButtonStyle("sm
|
|
|
16301
16395
|
* @internal
|
|
16302
16396
|
*/
|
|
16303
16397
|
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(
|
|
16398
|
+
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(`width ${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) ) ) { width: var(--_button-width); } :host( :is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected)):not( :is(:state(--pressed), :--pressed) ):is(:state(--adjacent-pressed), :--adjacent-pressed) ) { width: calc(var(--_button-width) - var(--_adjacent-shrink, 0px)); } :host( :is(:state(--grouped), :--grouped):not(:is(:state(--connected), :--connected)):is( :state(--pressed), :--pressed ):not([disabled-interactive]):not(:disabled) ) { width: 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
16399
|
|
|
16306
16400
|
/**
|
|
16307
16401
|
* Component design tokens that control the appearance variants of `M3eIconButtonElement`.
|
|
@@ -16715,7 +16809,7 @@ function iconButtonVariantStyle(variant) {
|
|
|
16715
16809
|
*/
|
|
16716
16810
|
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
16811
|
|
|
16718
|
-
var _M3eIconButtonElement_instances, _M3eIconButtonElement_clickHandler, _M3eIconButtonElement_updateButtonShape, _M3eIconButtonElement_handlePressedChange, _M3eIconButtonElement_handleClick, _M3eIconButtonElement_handleSelectedIconSlotChange;
|
|
16812
|
+
var _M3eIconButtonElement_instances, _M3eIconButtonElement_clickHandler, _M3eIconButtonElement_updateButtonShape, _M3eIconButtonElement_handlePressedChange, _M3eIconButtonElement_cleanupAdjacentPressed, _M3eIconButtonElement_handleClick, _M3eIconButtonElement_handleSelectedIconSlotChange;
|
|
16719
16813
|
/**
|
|
16720
16814
|
* An icon button users interact with to perform a supplementary action.
|
|
16721
16815
|
*
|
|
@@ -17058,11 +17152,7 @@ let M3eIconButtonElement = class M3eIconButtonElement extends KeyboardClick$1(Li
|
|
|
17058
17152
|
*/
|
|
17059
17153
|
this.selected = false;
|
|
17060
17154
|
new ResizeController$1(this, {
|
|
17061
|
-
callback: () =>
|
|
17062
|
-
if (this.grouped) {
|
|
17063
|
-
this._handleResize();
|
|
17064
|
-
}
|
|
17065
|
-
}
|
|
17155
|
+
callback: () => this._handleResize()
|
|
17066
17156
|
});
|
|
17067
17157
|
new FocusController$1(this, {
|
|
17068
17158
|
callback: focused => {
|
|
@@ -17078,11 +17168,7 @@ let M3eIconButtonElement = class M3eIconButtonElement extends KeyboardClick$1(Li
|
|
|
17078
17168
|
if (!this.disabled && !this.disabledInteractive) {
|
|
17079
17169
|
if (pressed) {
|
|
17080
17170
|
__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
|
-
}
|
|
17171
|
+
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_handlePressedChange).call(this, true);
|
|
17086
17172
|
} else {
|
|
17087
17173
|
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_handlePressedChange).call(this, false);
|
|
17088
17174
|
}
|
|
@@ -17109,7 +17195,7 @@ let M3eIconButtonElement = class M3eIconButtonElement extends KeyboardClick$1(Li
|
|
|
17109
17195
|
["--pressed", "--resting", "--grouped", "--connected"].forEach(x => deleteCustomState$1(this, x));
|
|
17110
17196
|
this._base?.style.removeProperty("--_button-shape");
|
|
17111
17197
|
this.style.removeProperty("--_button-width");
|
|
17112
|
-
this.style.removeProperty("--_adjacent-
|
|
17198
|
+
this.style.removeProperty("--_adjacent-shrink");
|
|
17113
17199
|
deleteCustomState$1(this, "--adjacent-pressed");
|
|
17114
17200
|
this.removeEventListener("click", __classPrivateFieldGet(this, _M3eIconButtonElement_clickHandler, "f"));
|
|
17115
17201
|
}
|
|
@@ -17136,8 +17222,8 @@ let M3eIconButtonElement = class M3eIconButtonElement extends KeyboardClick$1(Li
|
|
|
17136
17222
|
}
|
|
17137
17223
|
/** @private */
|
|
17138
17224
|
_handleResize() {
|
|
17139
|
-
if (this.grouped && !hasCustomState$1(this, "--
|
|
17140
|
-
this.style.setProperty("--_button-width", `${this.
|
|
17225
|
+
if (this.grouped && !hasCustomState$1(this, "--no-resize") && this !== document.activeElement) {
|
|
17226
|
+
this.style.setProperty("--_button-width", `${this.getBoundingClientRect().width}px`);
|
|
17141
17227
|
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_updateButtonShape).call(this, true);
|
|
17142
17228
|
}
|
|
17143
17229
|
}
|
|
@@ -17155,27 +17241,67 @@ _M3eIconButtonElement_updateButtonShape = function _M3eIconButtonElement_updateB
|
|
|
17155
17241
|
}
|
|
17156
17242
|
};
|
|
17157
17243
|
_M3eIconButtonElement_handlePressedChange = function _M3eIconButtonElement_handlePressedChange(pressed) {
|
|
17158
|
-
|
|
17159
|
-
setCustomState$1(this, "--resting", !pressed);
|
|
17244
|
+
const clientWidth = this.getBoundingClientRect().width;
|
|
17160
17245
|
const group = this.closest("m3e-button-group");
|
|
17161
|
-
if (group) {
|
|
17162
|
-
const clientWidth = this.getBoundingClientRect().width;
|
|
17246
|
+
if (group && group.variant === "standard") {
|
|
17163
17247
|
const buttons = [...group.querySelectorAll("m3e-button,m3e-icon-button")];
|
|
17164
17248
|
const index = buttons.indexOf(this);
|
|
17165
|
-
|
|
17166
|
-
const
|
|
17167
|
-
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
}
|
|
17171
|
-
|
|
17172
|
-
|
|
17249
|
+
if (pressed) {
|
|
17250
|
+
const multiplier = parseFloat(getComputedStyle(this).getPropertyValue("--m3e-standard-button-group-width-multiplier") || "0.15");
|
|
17251
|
+
let adjacentShrink = clientWidth * multiplier;
|
|
17252
|
+
if (index > 0 && index < buttons.length - 1) {
|
|
17253
|
+
adjacentShrink /= 2;
|
|
17254
|
+
}
|
|
17255
|
+
for (let i = 0; i < buttons.length; i++) {
|
|
17256
|
+
if (i == index - 1 || i == index + 1) {
|
|
17257
|
+
addCustomState$1(buttons[i], "--no-resize");
|
|
17258
|
+
buttons[i].style.setProperty("--_adjacent-shrink", `${adjacentShrink}px`);
|
|
17259
|
+
addCustomState$1(buttons[i], "--adjacent-pressed");
|
|
17260
|
+
} else if (i == index) {
|
|
17261
|
+
addCustomState$1(buttons[i], "--no-resize");
|
|
17262
|
+
buttons[i].style.removeProperty("--_adjacent-shrink");
|
|
17263
|
+
deleteCustomState$1(buttons[i], "--adjacent-pressed");
|
|
17264
|
+
} else {
|
|
17265
|
+
deleteCustomState$1(buttons[i], "--no-resize");
|
|
17266
|
+
buttons[i].style.removeProperty("--_adjacent-shrink");
|
|
17267
|
+
deleteCustomState$1(buttons[i], "--adjacent-pressed");
|
|
17268
|
+
}
|
|
17269
|
+
}
|
|
17270
|
+
} else {
|
|
17271
|
+
for (let i = 0; i < buttons.length; i++) {
|
|
17272
|
+
if (i == index - 1 || i == index + 1) {
|
|
17273
|
+
buttons[i].style.setProperty("--_adjacent-shrink", "0px");
|
|
17274
|
+
}
|
|
17275
|
+
}
|
|
17276
|
+
if (!prefersReducedMotion$1()) {
|
|
17277
|
+
this.addEventListener("transitionend", e => {
|
|
17278
|
+
if (e.propertyName === "width") {
|
|
17279
|
+
queueMicrotask(() => {
|
|
17280
|
+
// Pressed state is tested to ensure this runs only when the button
|
|
17281
|
+
// is no longer pressed. This handles changes to pressed state in
|
|
17282
|
+
// quick succession.
|
|
17283
|
+
if (!hasCustomState$1(this, "--pressed")) {
|
|
17284
|
+
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_cleanupAdjacentPressed).call(this, buttons);
|
|
17285
|
+
}
|
|
17286
|
+
});
|
|
17287
|
+
}
|
|
17288
|
+
}, {
|
|
17289
|
+
once: true
|
|
17290
|
+
});
|
|
17173
17291
|
} else {
|
|
17174
|
-
|
|
17175
|
-
deleteCustomState$1(button, "--adjacent-pressed");
|
|
17292
|
+
__classPrivateFieldGet(this, _M3eIconButtonElement_instances, "m", _M3eIconButtonElement_cleanupAdjacentPressed).call(this, buttons);
|
|
17176
17293
|
}
|
|
17177
17294
|
}
|
|
17178
17295
|
}
|
|
17296
|
+
setCustomState$1(this, "--pressed", pressed);
|
|
17297
|
+
setCustomState$1(this, "--resting", !pressed);
|
|
17298
|
+
};
|
|
17299
|
+
_M3eIconButtonElement_cleanupAdjacentPressed = function _M3eIconButtonElement_cleanupAdjacentPressed(buttons) {
|
|
17300
|
+
for (const button of buttons) {
|
|
17301
|
+
deleteCustomState$1(button, "--adjacent-pressed");
|
|
17302
|
+
deleteCustomState$1(button, "--no-resize");
|
|
17303
|
+
button.style.removeProperty("--_adjacent-shrink");
|
|
17304
|
+
}
|
|
17179
17305
|
};
|
|
17180
17306
|
_M3eIconButtonElement_handleClick = function _M3eIconButtonElement_handleClick(e) {
|
|
17181
17307
|
if (this.disabled || this.disabledInteractive) {
|
|
@@ -35113,6 +35239,55 @@ _M3eThemeElement_getContrastLevel = function _M3eThemeElement_getContrastLevel()
|
|
|
35113
35239
|
return 0;
|
|
35114
35240
|
}
|
|
35115
35241
|
};
|
|
35242
|
+
(() => {
|
|
35243
|
+
if (typeof window !== "undefined") {
|
|
35244
|
+
const composeCss = token => {
|
|
35245
|
+
let css = "";
|
|
35246
|
+
for (const key in token) {
|
|
35247
|
+
const cssVar = token[key].toString();
|
|
35248
|
+
if (!cssVar.startsWith("var(")) continue;
|
|
35249
|
+
const inner = cssVar.trim().slice(4, -1); // remove "var(" and ")"
|
|
35250
|
+
const [prop, fallback] = inner.split(/,(.+)/).map(s => s.trim());
|
|
35251
|
+
if (!prop.startsWith("--") || !fallback) continue;
|
|
35252
|
+
css += `${prop}:${fallback};`;
|
|
35253
|
+
}
|
|
35254
|
+
return css;
|
|
35255
|
+
};
|
|
35256
|
+
const omitKey = (obj, key) => {
|
|
35257
|
+
const {
|
|
35258
|
+
[key]: _unused,
|
|
35259
|
+
...rest
|
|
35260
|
+
} = obj;
|
|
35261
|
+
return rest;
|
|
35262
|
+
};
|
|
35263
|
+
let css = "";
|
|
35264
|
+
css += composeCss(DesignToken$1.typescale.standard.display.large);
|
|
35265
|
+
css += composeCss(DesignToken$1.typescale.standard.display.medium);
|
|
35266
|
+
css += composeCss(DesignToken$1.typescale.standard.display.small);
|
|
35267
|
+
css += composeCss(DesignToken$1.typescale.standard.headline.large);
|
|
35268
|
+
css += composeCss(DesignToken$1.typescale.standard.headline.medium);
|
|
35269
|
+
css += composeCss(DesignToken$1.typescale.standard.headline.small);
|
|
35270
|
+
css += composeCss(DesignToken$1.typescale.standard.title.large);
|
|
35271
|
+
css += composeCss(DesignToken$1.typescale.standard.title.medium);
|
|
35272
|
+
css += composeCss(DesignToken$1.typescale.standard.title.small);
|
|
35273
|
+
css += composeCss(DesignToken$1.typescale.standard.label.large);
|
|
35274
|
+
css += composeCss(DesignToken$1.typescale.standard.label.medium);
|
|
35275
|
+
css += composeCss(DesignToken$1.typescale.standard.label.small);
|
|
35276
|
+
css += composeCss(DesignToken$1.typescale.standard.body.large);
|
|
35277
|
+
css += composeCss(DesignToken$1.typescale.standard.body.medium);
|
|
35278
|
+
css += composeCss(DesignToken$1.typescale.standard.body.small);
|
|
35279
|
+
css += composeCss(DesignToken$1.elevation);
|
|
35280
|
+
css += composeCss(DesignToken$1.shape.corner.value);
|
|
35281
|
+
css += composeCss(omitKey(DesignToken$1.shape.corner, "value"));
|
|
35282
|
+
css += composeCss(DesignToken$1.motion.duration);
|
|
35283
|
+
css += composeCss(DesignToken$1.motion.easing);
|
|
35284
|
+
css += composeCss(DesignToken$1.motion.spring);
|
|
35285
|
+
css += composeCss(omitKey(DesignToken$1.density, "calc"));
|
|
35286
|
+
css += composeCss(DesignToken$1.measurement);
|
|
35287
|
+
css += composeCss(DesignToken$1.state);
|
|
35288
|
+
registerStyleSheet$1(unsafeCSS(`html{${css}}`));
|
|
35289
|
+
}
|
|
35290
|
+
})();
|
|
35116
35291
|
/** The styles of the element. */
|
|
35117
35292
|
M3eThemeElement.styles = css`:host { display: contents; }`;
|
|
35118
35293
|
__decorate([property()], M3eThemeElement.prototype, "color", void 0);
|
|
@@ -35233,7 +35408,7 @@ _a$1 = TocGenerator, _TocGenerator_getHeaderLevel = function _TocGenerator_getHe
|
|
|
35233
35408
|
return element.tagName.startsWith("H") ? parseInt(element.tagName.substring(1)) : parseInt(element.getAttribute("level") ?? "0");
|
|
35234
35409
|
};
|
|
35235
35410
|
|
|
35236
|
-
var _M3eTocElement_instances, _M3eTocElement_ignoreScroll, _M3eTocElement_selectionManager, _M3eTocElement_intersectionController, _M3eTocElement_scrollController, _M3eTocElement_mutationController, _M3eTocElement_renderNode, _M3eTocElement_handleOverlineSlotChange, _M3eTocElement_handleTitleSlotChange, _M3eTocElement_handleClick, _M3eTocElement_generateToc;
|
|
35411
|
+
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
35412
|
/**
|
|
35238
35413
|
* A table of contents that provides in-page scroll navigation.
|
|
35239
35414
|
*
|
|
@@ -35300,6 +35475,9 @@ let M3eTocElement = class M3eTocElement extends HtmlFor$1(AttachInternals$1(Role
|
|
|
35300
35475
|
_M3eTocElement_ignoreScroll.set(this, false);
|
|
35301
35476
|
/** @private */
|
|
35302
35477
|
_M3eTocElement_selectionManager.set(this, new SelectionManager().withHomeAndEnd().withVerticalOrientation().disableRovingTabIndex().onSelectedItemsChange(() => {
|
|
35478
|
+
for (const target of __classPrivateFieldGet(this, _M3eTocElement_resizeController, "f").targets) {
|
|
35479
|
+
__classPrivateFieldGet(this, _M3eTocElement_resizeController, "f").unobserve(target);
|
|
35480
|
+
}
|
|
35303
35481
|
if (this._activeIndicator) {
|
|
35304
35482
|
const item = __classPrivateFieldGet(this, _M3eTocElement_selectionManager, "f").selectedItems[0];
|
|
35305
35483
|
if (!item) {
|
|
@@ -35308,6 +35486,7 @@ let M3eTocElement = class M3eTocElement extends HtmlFor$1(AttachInternals$1(Role
|
|
|
35308
35486
|
this._activeIndicator.style.height = `0px`;
|
|
35309
35487
|
this._activeIndicator.style.visibility = "hidden";
|
|
35310
35488
|
} else {
|
|
35489
|
+
__classPrivateFieldGet(this, _M3eTocElement_resizeController, "f").observe(item);
|
|
35311
35490
|
const scrollContainer = this._scrollContainer;
|
|
35312
35491
|
if (item === __classPrivateFieldGet(this, _M3eTocElement_selectionManager, "f").items[0]) {
|
|
35313
35492
|
scrollContainer.scrollTo({
|
|
@@ -35373,6 +35552,18 @@ let M3eTocElement = class M3eTocElement extends HtmlFor$1(AttachInternals$1(Role
|
|
|
35373
35552
|
},
|
|
35374
35553
|
callback: () => this._updateToc()
|
|
35375
35554
|
}));
|
|
35555
|
+
/** @private */
|
|
35556
|
+
_M3eTocElement_resizeController.set(this, new ResizeController$1(this, {
|
|
35557
|
+
target: null,
|
|
35558
|
+
callback: () => {
|
|
35559
|
+
const item = __classPrivateFieldGet(this, _M3eTocElement_selectionManager, "f").selectedItems[0];
|
|
35560
|
+
if (item && this._activeIndicator) {
|
|
35561
|
+
this._activeIndicator.style.top = `${item.offsetTop}px`;
|
|
35562
|
+
this._activeIndicator.style.height = `${item.clientHeight}px`;
|
|
35563
|
+
this._activeIndicator.style.visibility = item.clientHeight == 0 ? "hidden" : "";
|
|
35564
|
+
}
|
|
35565
|
+
}
|
|
35566
|
+
}));
|
|
35376
35567
|
/**
|
|
35377
35568
|
* The maximum depth of the table of contents.
|
|
35378
35569
|
* @default 2
|
|
@@ -35440,6 +35631,7 @@ _M3eTocElement_selectionManager = new WeakMap();
|
|
|
35440
35631
|
_M3eTocElement_intersectionController = new WeakMap();
|
|
35441
35632
|
_M3eTocElement_scrollController = new WeakMap();
|
|
35442
35633
|
_M3eTocElement_mutationController = new WeakMap();
|
|
35634
|
+
_M3eTocElement_resizeController = new WeakMap();
|
|
35443
35635
|
_M3eTocElement_instances = new WeakSet();
|
|
35444
35636
|
_M3eTocElement_renderNode = function _M3eTocElement_renderNode(node) {
|
|
35445
35637
|
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>`;
|