@vollowx/seele 0.14.2 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/package.json +5 -5
- package/src/all.d.ts +3 -0
- package/src/all.js +3 -0
- package/src/base/anchor.d.ts +21 -0
- package/src/base/anchor.js +60 -0
- package/src/base/autocomplete.d.ts +2 -2
- package/src/base/composed-menu.d.ts +2 -2
- package/src/base/composed-menu.js +6 -3
- package/src/base/controllers/list-controller.d.ts +1 -1
- package/src/base/controllers/list-controller.js +1 -1
- package/src/base/dialog.d.ts +1 -1
- package/src/base/dialog.js +2 -0
- package/src/base/input.d.ts +1 -1
- package/src/base/list.d.ts +1 -1
- package/src/base/menu.d.ts +1 -1
- package/src/base/menu.js +2 -1
- package/src/base/mixins/internals-attached.d.ts +1 -1
- package/src/base/mixins/internals-attached.js +4 -1
- package/src/base/popup.d.ts +1 -1
- package/src/base/select.d.ts +5 -6
- package/src/base/slider.d.ts +1 -3
- package/src/base/slider.js +0 -8
- package/src/base/tab-panel.d.ts +1 -1
- package/src/base/tab.d.ts +1 -1
- package/src/base/tabs.d.ts +1 -1
- package/src/base/tooltip.d.ts +1 -1
- package/src/base/tooltip.js +3 -5
- package/src/core/ensure-ready.js +1 -1
- package/src/m3/autocomplete/autocomplete.d.ts +1 -1
- package/src/m3/badge/badge.d.ts +2 -2
- package/src/m3/button/common-button-link.d.ts +30 -0
- package/src/m3/button/common-button-link.js +62 -0
- package/src/m3/button/common-button-styles.css.js +1 -1
- package/src/m3/button/common-button-toggle.d.ts +1 -1
- package/src/m3/button/common-button.d.ts +2 -2
- package/src/m3/button/common-button.js +1 -0
- package/src/m3/button/icon-button-link.d.ts +24 -0
- package/src/m3/button/icon-button-link.js +53 -0
- package/src/m3/button/icon-button-styles.css.js +1 -1
- package/src/m3/button/icon-button-toggle.d.ts +1 -1
- package/src/m3/button/icon-button.d.ts +1 -1
- package/src/m3/button/shared-button-link-styles.css.js +2 -0
- package/src/m3/button/shared-button-styles.css.js +1 -1
- package/src/m3/button/shared-button-toggle-styles.css.js +1 -1
- package/src/m3/button-group/connected-button-group-styles.css.js +1 -1
- package/src/m3/button-group/connected-button-group.d.ts +1 -1
- package/src/m3/button-group/standard-button-group.d.ts +7 -2
- package/src/m3/button-group/standard-button-group.js +3 -1
- package/src/m3/checkbox/checkbox-styles.css.js +1 -1
- package/src/m3/checkbox/checkbox.d.ts +3 -3
- package/src/m3/dialog/dialog.d.ts +20 -18
- package/src/m3/dialog/dialog.js +135 -85
- package/src/m3/fab/fab-styles.css.js +1 -1
- package/src/m3/fab/fab.d.ts +1 -1
- package/src/m3/field/field.d.ts +7 -12
- package/src/m3/field/field.js +5 -10
- package/src/m3/field/filled-field.d.ts +1 -1
- package/src/m3/field/outlined-field.d.ts +2 -2
- package/src/m3/focus-ring/focus-ring.js +3 -2
- package/src/m3/item/item.d.ts +3 -3
- package/src/m3/item/item.js +2 -3
- package/src/m3/list/list-item.d.ts +3 -3
- package/src/m3/list/list-item.js +2 -2
- package/src/m3/loading/loading.d.ts +2 -2
- package/src/m3/loading/loading.js +1 -1
- package/src/m3/navigation/navigation-rail-item.d.ts +3 -3
- package/src/m3/navigation/navigation-rail-item.js +2 -1
- package/src/m3/navigation/navigation-rail.d.ts +1 -1
- package/src/m3/progress/circular-progress-styles.css.js +2 -0
- package/src/m3/progress/circular-progress.d.ts +19 -0
- package/src/m3/progress/circular-progress.js +29 -0
- package/src/m3/progress/linear-progress.d.ts +1 -1
- package/src/m3/radio/radio-styles.css.js +1 -1
- package/src/m3/radio/radio.d.ts +2 -2
- package/src/m3/ripple/ripple.js +3 -0
- package/src/m3/select/filled-select.d.ts +1 -1
- package/src/m3/select/outlined-select.d.ts +1 -1
- package/src/m3/select/select.d.ts +1 -1
- package/src/m3/slider/slider-styles.css.js +1 -1
- package/src/m3/slider/slider.d.ts +5 -2
- package/src/m3/slider/slider.js +22 -4
- package/src/m3/switch/switch.d.ts +5 -5
- package/src/m3/tab/tab-styles.css.js +1 -1
- package/src/m3/tab/tab.d.ts +3 -4
- package/src/m3/tab/tab.js +2 -4
- package/src/m3/text-field/filled-text-field.d.ts +1 -1
- package/src/m3/text-field/outlined-text-field.d.ts +1 -1
- package/src/m3/toolbar/toolbar.d.ts +1 -1
- package/src/win98/button/button.d.ts +1 -1
- package/src/base/field.d.ts +0 -3
- package/src/base/field.js +0 -3
- package/src/base/item.d.ts +0 -7
- package/src/base/item.js +0 -7
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Anchor } from '../../base/anchor.js';
|
|
2
|
+
import '../focus-ring/focus-ring.js';
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
|
+
/**
|
|
5
|
+
* @tag md-icon-button-link
|
|
6
|
+
*
|
|
7
|
+
* @csspart anchor
|
|
8
|
+
* @csspart icon
|
|
9
|
+
*
|
|
10
|
+
* @slot - icon
|
|
11
|
+
*/
|
|
12
|
+
export declare class M3IconButtonLink extends Anchor {
|
|
13
|
+
size: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
14
|
+
color: 'primary' | 'secondary' | 'tertiary';
|
|
15
|
+
variant: 'text' | 'filled' | 'tonal' | 'outlined';
|
|
16
|
+
width: 'standard' | 'narrow' | 'wide';
|
|
17
|
+
static styles: any[];
|
|
18
|
+
render(): import("lit").TemplateResult<1>;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'md-icon-button-link': M3IconButtonLink;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { Anchor } from '../../base/anchor.js';
|
|
5
|
+
import '../focus-ring/focus-ring.js';
|
|
6
|
+
import '../ripple/ripple.js';
|
|
7
|
+
import { targetStyles } from '../target-styles.css.js';
|
|
8
|
+
import { iconButtonStyles } from './icon-button-styles.css.js';
|
|
9
|
+
import { sharedButtonLinkStyles } from './shared-button-link-styles.css.js';
|
|
10
|
+
import { sharedButtonStyles } from './shared-button-styles.css.js';
|
|
11
|
+
/**
|
|
12
|
+
* @tag md-icon-button-link
|
|
13
|
+
*
|
|
14
|
+
* @csspart anchor
|
|
15
|
+
* @csspart icon
|
|
16
|
+
*
|
|
17
|
+
* @slot - icon
|
|
18
|
+
*/
|
|
19
|
+
let M3IconButtonLink = class M3IconButtonLink extends Anchor {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.size = 's';
|
|
23
|
+
this.color = 'primary';
|
|
24
|
+
this.variant = 'text';
|
|
25
|
+
this.width = 'standard';
|
|
26
|
+
}
|
|
27
|
+
static { this.styles = [
|
|
28
|
+
...super.styles,
|
|
29
|
+
targetStyles,
|
|
30
|
+
sharedButtonStyles,
|
|
31
|
+
sharedButtonLinkStyles,
|
|
32
|
+
iconButtonStyles,
|
|
33
|
+
]; }
|
|
34
|
+
render() {
|
|
35
|
+
return this._renderAnchor(html `<md-focus-ring></md-focus-ring><md-ripple></md-ripple><span part="target"></span><slot part="icon"></slot>`);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
property({ reflect: true })
|
|
40
|
+
], M3IconButtonLink.prototype, "size", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
property({ reflect: true })
|
|
43
|
+
], M3IconButtonLink.prototype, "color", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
property({ reflect: true })
|
|
46
|
+
], M3IconButtonLink.prototype, "variant", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
property({ reflect: true })
|
|
49
|
+
], M3IconButtonLink.prototype, "width", void 0);
|
|
50
|
+
M3IconButtonLink = __decorate([
|
|
51
|
+
customElement('md-icon-button-link')
|
|
52
|
+
], M3IconButtonLink);
|
|
53
|
+
export { M3IconButtonLink };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const iconButtonStyles = css`@layer main{:host{--_wn:32px;--_ww:52px;
|
|
2
|
+
export const iconButtonStyles = css`@layer main{:host{--_wn:32px;--_ww:52px;transition:border-radius var(--md-sys-motion-spatial-fast-duration) var(--md-sys-motion-spatial-fast);inline-size:var(--_h);place-items:center;display:inline-grid}:host([size=xs]){--_wn:28px;--_ww:40px}:host([size=m]){--_wn:48px;--_ww:72px}:host([size=l]){--_wn:64px;--_ww:128px}:host([size=xl]){--_wn:104px;--_ww:184px}:host([width=narrow]){inline-size:var(--_wn)}:host([width=wide]){inline-size:var(--_ww)}::slotted(*){fill:currentColor;block-size:1em;font-size:var(--_icon-size);inline-size:1em}}@layer override{:host([size=small]){--_icon-size:24px}:host([variant=text]){color:var(--md-sys-color-on-surface-variant)}:host([variant=text]:state(checked)){color:var(--_color)}}`;
|
|
@@ -12,7 +12,7 @@ declare const M3IconButtonToggle_base: Constructor<import("../../base/mixins/but
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class M3IconButtonToggle extends M3IconButtonToggle_base {
|
|
14
14
|
static styles: any[];
|
|
15
|
-
render(): import("lit
|
|
15
|
+
render(): import("lit").TemplateResult<1>;
|
|
16
16
|
}
|
|
17
17
|
declare global {
|
|
18
18
|
interface HTMLElementTagNameMap {
|
|
@@ -14,7 +14,7 @@ export declare class M3IconButton extends Button {
|
|
|
14
14
|
variant: 'text' | 'filled' | 'tonal' | 'outlined';
|
|
15
15
|
width: 'standard' | 'narrow' | 'wide';
|
|
16
16
|
static styles: any[];
|
|
17
|
-
render(): import("lit
|
|
17
|
+
render(): import("lit").TemplateResult<1>;
|
|
18
18
|
}
|
|
19
19
|
declare global {
|
|
20
20
|
interface HTMLElementTagNameMap {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const sharedButtonStyles = css`@layer main;@layer shared{:host{--_on-color:var(--md-sys-color-on-primary);--_color:var(--md-sys-color-primary);--_h:40px;--_icon-size:20px;--_rs:12px;--_rp:8px
|
|
2
|
+
export const sharedButtonStyles = css`@layer main;@layer shared{:host{--_on-color:var(--md-sys-color-on-primary);--_color:var(--md-sys-color-primary);--_h:40px;--_icon-size:20px;--_rs:12px;--_rp:8px;color:var(--_on-color);background-color:var(--_color);box-sizing:border-box;cursor:pointer;block-size:var(--_h);-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;vertical-align:top;border-start-start-radius:var(--_inner-left-radius,calc(var(--_h) / 2));border-start-end-radius:var(--_inner-right-radius,calc(var(--_h) / 2));border-end-end-radius:var(--_inner-right-radius,calc(var(--_h) / 2));border-end-start-radius:var(--_inner-left-radius,calc(var(--_h) / 2));outline:0;flex-shrink:0;position:relative}:host([notransition]){transition:none!important}md-ripple,md-focus-ring{position:absolute}:host([size=xs]){--_h:32px}:host([size=m]){--_h:56px;--_icon-size:24px;--_rs:16px;--_rp:12px}:host([size=l]){--_h:96px;--_icon-size:32px;--_rs:28px;--_rp:16px}:host([size=xl]){--_h:136px;--_icon-size:40px;--_rs:28px;--_rp:16px}:host([color=secondary]){--_on-color:var(--md-sys-color-on-secondary);--_color:var(--md-sys-color-secondary)}:host([color=tertiary]){--_on-color:var(--md-sys-color-on-tertiary);--_color:var(--md-sys-color-tertiary)}:host([variant=tonal]){background-color:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}:host([variant=outlined]){--md-focus-ring-offset:3px;color:var(--md-sys-color-on-surface-variant);border-color:var(--md-sys-color-outline-variant);background-color:#0000;border-style:solid;border-width:1px;& md-ripple{inset:-1px}}:host([variant=text]){color:var(--_color);background-color:#0000}:host([square]){--md-focus-ring-shape:var(--_rs);border-radius:var(--_rs)}@media (forced-colors:active){:host{forced-color-adjust:none;color:buttontext;background:buttonface;border:1px solid buttonborder}}}@layer shared-toggle,override;@layer active{:host(:active),:host(:state(active)){--md-focus-ring-shape:var(--_rp);border-radius:var(--_rp)}}@layer disabled{:host([variant=outlined]:disabled){background-color:oklch(from var(--md-sys-color-outline) l c h / 10%)}:host(:disabled),:host([variant=outlined]:state(checked):disabled){background-color:oklch(from var(--md-sys-color-on-surface) l c h / 10%);color:oklch(from var(--md-sys-color-on-surface) l c h / 38%);border-color:oklch(from var(--md-sys-color-on-surface) l c h / 10%);box-shadow:none;pointer-events:none}@media (forced-colors:active){:host(:disabled){color:graytext;border-color:graytext}}}`;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const sharedButtonToggleStyles = css`@layer shared-toggle{:host{transition:border-radius var(--md-sys-motion-spatial-fast-duration) var(--md-sys-motion-spatial-fast), box-shadow var(--md-sys-motion-effects-default-duration) var(--md-sys-motion-effects-default), background-color var(--md-sys-motion-effects-fast-duration) var(--md-sys-motion-effects-fast), color var(--md-sys-motion-effects-fast-duration) var(--md-sys-motion-effects-fast)}:host(:state(checked)){--md-focus-ring-shape:var(--_rs);border-radius:var(--_rs)}:host(:state(checked)) [part~=unchecked],:host(:not(:state(checked))) [part~=checked]{display:none}:host([variant=filled]:not(:state(checked))){
|
|
2
|
+
export const sharedButtonToggleStyles = css`@layer shared-toggle{:host{transition:border-radius var(--md-sys-motion-spatial-fast-duration) var(--md-sys-motion-spatial-fast), box-shadow var(--md-sys-motion-effects-default-duration) var(--md-sys-motion-effects-default), background-color var(--md-sys-motion-effects-fast-duration) var(--md-sys-motion-effects-fast), color var(--md-sys-motion-effects-fast-duration) var(--md-sys-motion-effects-fast)}:host(:state(checked)){--md-focus-ring-shape:var(--_rs);border-radius:var(--_rs)}:host(:state(checked)) [part~=unchecked],:host(:not(:state(checked))) [part~=checked]{display:none}:host([variant=filled]:not(:state(checked))){background-color:var(--md-sys-color-surface-container);color:var(--md-sys-color-on-surface-variant)}:host([variant=tonal]:not(:state(checked))){background-color:var(--md-sys-color-surface-container-highest);color:var(--md-sys-color-on-surface-variant)}:host([variant=outlined]:state(checked)){background-color:var(--md-sys-color-inverse-surface);color:var(--md-sys-color-inverse-on-surface);border-width:0}@media (forced-colors:active){:host(:state(checked)){color:highlighttext;background:highlight}}}`;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const connectedButtonGroupStyles = css`:host{gap:2px;display:inline-flex}::slotted(*){flex:1}::slotted(:not(:first-child)[size=xs]){--_inner-left-radius:4px}::slotted(:not(:last-child)[size=xs]){--_inner-right-radius:4px}::slotted(:not(:first-child)){--_inner-left-radius:8px}::slotted(:not(:last-child)){--_inner-right-radius:8px}::slotted(:not(:first-child)[size=l]){--_inner-left-radius:16px}::slotted(:not(:last-child)[size=l]){--_inner-right-radius:16px}::slotted(:not(:first-child)[size=xl]){--_inner-left-radius:20px}::slotted(:not(:last-child)[size=xl]){--_inner-right-radius:20px}::slotted(:first-child:
|
|
2
|
+
export const connectedButtonGroupStyles = css`:host{gap:2px;display:inline-flex}::slotted(*){flex:1}::slotted(:not(:first-child)[size=xs]){--_inner-left-radius:4px}::slotted(:not(:last-child)[size=xs]){--_inner-right-radius:4px}::slotted(:not(:first-child)){--_inner-left-radius:8px}::slotted(:not(:last-child)){--_inner-right-radius:8px}::slotted(:not(:first-child)[size=l]){--_inner-left-radius:16px}::slotted(:not(:last-child)[size=l]){--_inner-right-radius:16px}::slotted(:not(:first-child)[size=xl]){--_inner-left-radius:20px}::slotted(:not(:last-child)[size=xl]){--_inner-right-radius:20px}::slotted(:first-child:not([square])){border-start-start-radius:calc(var(--_h) / 2);border-end-start-radius:calc(var(--_h) / 2)}::slotted(:last-child:not([square])){border-start-end-radius:calc(var(--_h) / 2);border-end-end-radius:calc(var(--_h) / 2)}`;
|
|
@@ -10,7 +10,7 @@ export declare class M3ConnectedButtonGroup extends LitElement {
|
|
|
10
10
|
multiple: boolean;
|
|
11
11
|
$buttons: Array<ToggleButton>;
|
|
12
12
|
static styles: any[];
|
|
13
|
-
render(): import("lit
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
14
|
}
|
|
15
15
|
declare global {
|
|
16
16
|
interface HTMLElementTagNameMap {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
declare const shapeAnimation: unique symbol;
|
|
3
|
+
type ShapeAnimatedElement = HTMLElement & {
|
|
4
|
+
[shapeAnimation]?: Animation;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* @tag md-button-group
|
|
4
8
|
*
|
|
@@ -7,9 +11,9 @@ import { LitElement } from 'lit';
|
|
|
7
11
|
export declare class M3StandardButtonGroup extends LitElement {
|
|
8
12
|
#private;
|
|
9
13
|
size: 'xs' | 's' | '';
|
|
10
|
-
$buttons: Array<
|
|
14
|
+
$buttons: Array<ShapeAnimatedElement>;
|
|
11
15
|
static styles: any[];
|
|
12
|
-
render(): import("lit
|
|
16
|
+
render(): import("lit").TemplateResult<1>;
|
|
13
17
|
constructor();
|
|
14
18
|
connectedCallback(): void;
|
|
15
19
|
firstUpdated(): Promise<void>;
|
|
@@ -24,3 +28,4 @@ declare global {
|
|
|
24
28
|
'md-button-group': M3StandardButtonGroup;
|
|
25
29
|
}
|
|
26
30
|
}
|
|
31
|
+
export {};
|
|
@@ -97,7 +97,9 @@ let M3StandardButtonGroup = class M3StandardButtonGroup extends LitElement {
|
|
|
97
97
|
* Passing no element resets all shape changes
|
|
98
98
|
*/
|
|
99
99
|
updateLayout(target = null) {
|
|
100
|
-
const pressedIndex = target
|
|
100
|
+
const pressedIndex = target
|
|
101
|
+
? this.$buttons.indexOf(target)
|
|
102
|
+
: -1;
|
|
101
103
|
this.#activeIndex = pressedIndex;
|
|
102
104
|
const pressedBaseWidth = pressedIndex !== -1 ? this.#baseWidths[pressedIndex] : 0;
|
|
103
105
|
const isPressedAtEdge = pressedIndex === 0 || pressedIndex === this.$buttons.length - 1;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const checkboxStyles = css`:host{--md-focus-ring-radius:9999px;--_container-color:transparent;--_outline-color:var(--md-sys-color-on-surface-variant);--_mark-color:var(--md-sys-color-surface-container-highest);--_ripple-color:var(--md-sys-color-on-surface);--_checkbox-size:18px;background-color:color-mix(in srgb, var(--_container-color) var(--_container-opacity,100%), transparent);border-color:color-mix(in srgb, var(--_outline-color) var(--_outline-opacity,100%), transparent);border-style:solid;border-width:var(--md-checkbox-outline-width,2px);box-sizing:border-box;cursor:pointer;height:var(--_checkbox-size);-webkit-tap-highlight-color:transparent;transition:background-color var(--md-sys-motion-effects-fast-duration) var(--md-sys-motion-effects-fast), border-color var(--md-sys-motion-effects-fast-duration) var(--md-sys-motion-effects-fast);-webkit-user-select:none;user-select:none;vertical-align:top;width:var(--_checkbox-size);border-radius:2px;outline:0;place-content:center;place-items:center;
|
|
2
|
+
export const checkboxStyles = css`:host{--md-focus-ring-radius:9999px;--_container-color:transparent;--_outline-color:var(--md-sys-color-on-surface-variant);--_mark-color:var(--md-sys-color-surface-container-highest);--_ripple-color:var(--md-sys-color-on-surface);--_checkbox-size:18px;background-color:color-mix(in srgb, var(--_container-color) var(--_container-opacity,100%), transparent);border-color:color-mix(in srgb, var(--_outline-color) var(--_outline-opacity,100%), transparent);border-style:solid;border-width:var(--md-checkbox-outline-width,2px);box-sizing:border-box;cursor:pointer;height:var(--_checkbox-size);margin:calc((40px - var(--_checkbox-size)) / 2);-webkit-tap-highlight-color:transparent;transition:background-color var(--md-sys-motion-effects-fast-duration) var(--md-sys-motion-effects-fast), border-color var(--md-sys-motion-effects-fast-duration) var(--md-sys-motion-effects-fast);-webkit-user-select:none;user-select:none;vertical-align:top;width:var(--_checkbox-size);border-radius:2px;outline:0;place-content:center;place-items:center;display:inline-grid;position:relative}:host(:state(checked)),:host(:state(indeterminate)){--_container-color:var(--md-sys-color-primary);--_outline-color:var(--md-sys-color-primary);--_mark-color:var(--md-sys-color-on-primary);--_mark-opacity:100%;--_ripple-color:var(--md-sys-color-primary)}:host([error]){--_outline-color:var(--md-sys-color-error);--_mark-color:var(--md-sys-color-surface-container-highest);--_ripple-color:var(--md-sys-color-error)}:host([error]:state(checked)),:host([error]:state(indeterminate)){--_container-color:var(--md-sys-color-error);--_outline-color:var(--md-sys-color-error);--_mark-color:var(--md-sys-color-on-error);--_ripple-color:var(--md-sys-color-error)}:host(:disabled){--_outline-color:var(--md-sys-color-on-surface);--_outline-opacity:38%;--_mark-color:var(--md-sys-color-surface-container-highest);cursor:default;pointer-events:none}:host(:disabled:state(checked)),:host(:disabled:state(indeterminate)){--_container-color:var(--md-sys-color-on-surface);--_container-opacity:38%;--_outline-color:var(--md-sys-color-surface);--_outline-opacity:0%;--_mark-color:var(--md-sys-color-surface)}@media (hover:hover) and (pointer:fine){:host(:hover){--_unchecked-outline-color:var(--md-sys-color-on-surface)}}@media (forced-colors:active){:host{forced-color-adjust:none}}:host(:disabled){--_unchecked-container-opacity:38%}[part~=icon]{fill:color-mix(in srgb, var(--_mark-color) var(--_mark-opacity,0%), transparent);height:18px;transition:fill var(--md-sys-motion-effects-fast-duration) var(--md-sys-motion-effects-fast);width:18px;position:absolute;inset:-2px}[part~=mark]{transition-duration:var(--md-sys-motion-effects-default-duration);transition-timing-function:var(--md-sys-motion-effects-default);transform:scaleY(-1)translate(7px,-14px)rotate(45deg)}:host(:state(indeterminate)) [part~=mark]{transform:scaleY(-1)translate(4px,-10px)rotate(0)}:host(:state(checked)) [part~=mark],:host(:state(indeterminate)) [part~=mark]{transition-duration:var(--md-sys-motion-effects-default-duration);transition-timing-function:var(--md-sys-motion-effects-default)}[part~=mark-short]{width:2px;height:0;transition-property:transform,height}[part~=mark-long]{width:0;height:2px;transition-property:transform,width}:host(:not(:state(checked)):not(:state(indeterminate)):state(was-checked)) [part~=mark],:host(:not(:state(checked)):not(:state(indeterminate)):state(was-indeterminate)) [part~=mark]{transition-delay:var(--md-sys-motion-effects-fast-duration)}:host(:state(checked)) [part~=mark-short]{height:5.65685px}:host(:state(checked)) [part~=mark-long]{width:11.3137px}:host(:state(checked):state(was-unchecked)) [part~=mark-short]{transition-property:none}:host(:state(indeterminate)) [part~=mark-short]{height:2px}:host(:state(indeterminate)) [part~=mark-long]{width:10px}:host(:state(indeterminate):state(was-unchecked)) [part~=mark-short]{transition-property:height}:host(:state(indeterminate):state(was-unchecked)) [part~=mark-long]{transition-property:width}md-focus-ring{height:44px;inset:unset;width:44px}md-ripple{--md-ripple-color:var(--_ripple-color);height:40px;inset:unset;border-radius:9999px;width:40px}@media (forced-colors:active){:host{--_outline-color:CanvasText;--_ripple-color:CanvasText}:host(:is(:state(checked),:state(indeterminate))){--md-sys-color-primary:SelectedItem;--_mark-color:SelectedItemText}}`;
|
|
@@ -12,10 +12,10 @@ import type { M3Ripple } from '../ripple/ripple.js';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class M3Checkbox extends Checkbox {
|
|
14
14
|
error: boolean;
|
|
15
|
-
$ripple: M3Ripple;
|
|
15
|
+
$ripple: M3Ripple | null;
|
|
16
16
|
static styles: any[];
|
|
17
|
-
render(): import("lit
|
|
18
|
-
renderIcon(): import("lit
|
|
17
|
+
render(): import("lit").TemplateResult<1>;
|
|
18
|
+
renderIcon(): import("lit").TemplateResult<1>;
|
|
19
19
|
firstUpdated(): void;
|
|
20
20
|
}
|
|
21
21
|
declare global {
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { Dialog } from '../../base/dialog.js';
|
|
2
|
+
type AnimationPart = 'container' | 'effects' | 'scrim' | 'body' | 'actions';
|
|
3
|
+
type AnimationRecipe = {
|
|
4
|
+
keyframes: Keyframe[];
|
|
5
|
+
options: KeyframeAnimationOptions;
|
|
6
|
+
};
|
|
7
|
+
type DialogAnimations = {
|
|
8
|
+
open: Partial<Record<AnimationPart, AnimationRecipe>>;
|
|
9
|
+
close: Partial<Record<AnimationPart, AnimationRecipe>>;
|
|
10
|
+
};
|
|
11
|
+
export declare const getFadeAnimations: (host: M3Dialog) => DialogAnimations;
|
|
12
|
+
export declare const getDefaultAnimations: (host: M3Dialog) => DialogAnimations;
|
|
2
13
|
/**
|
|
3
14
|
* TODO: test if form actions `cancel` and other things related work - no,
|
|
4
15
|
* event listener needed
|
|
5
|
-
* FIXME: on Firefox, the focus is not autoatically set to the first tabbable
|
|
6
|
-
* element
|
|
7
16
|
*
|
|
8
17
|
* @tag md-dialog
|
|
9
18
|
*
|
|
@@ -19,25 +28,17 @@ import { Dialog } from '../../base/dialog.js';
|
|
|
19
28
|
*/
|
|
20
29
|
export declare class M3Dialog extends Dialog {
|
|
21
30
|
#private;
|
|
22
|
-
_config: {
|
|
23
|
-
openEase: string;
|
|
24
|
-
closeEase: string;
|
|
25
|
-
vertSlide: number;
|
|
26
|
-
openDur: number;
|
|
27
|
-
closeDur: number;
|
|
28
|
-
bodyFadeInDur: number;
|
|
29
|
-
bodyFadeOutDur: number;
|
|
30
|
-
};
|
|
31
31
|
private hasIcon;
|
|
32
|
-
$container: HTMLDivElement;
|
|
33
|
-
$body: HTMLDivElement;
|
|
34
|
-
$icon: HTMLSlotElement;
|
|
35
|
-
$actions: HTMLDivElement;
|
|
36
|
-
$actionsPlaceholder: HTMLDivElement;
|
|
37
|
-
$scrim: HTMLDivElement;
|
|
32
|
+
$container: HTMLDivElement | null;
|
|
33
|
+
$body: HTMLDivElement | null;
|
|
34
|
+
$icon: HTMLSlotElement | null;
|
|
35
|
+
$actions: HTMLDivElement | null;
|
|
36
|
+
$actionsPlaceholder: HTMLDivElement | null;
|
|
37
|
+
$scrim: HTMLDivElement | null;
|
|
38
38
|
static styles: any[];
|
|
39
|
-
render(): import("lit
|
|
39
|
+
render(): import("lit").TemplateResult<1>;
|
|
40
40
|
firstUpdated(): Promise<void>;
|
|
41
|
+
_fullHeight: number;
|
|
41
42
|
show(): Promise<void>;
|
|
42
43
|
close(): Promise<void>;
|
|
43
44
|
}
|
|
@@ -46,3 +47,4 @@ declare global {
|
|
|
46
47
|
'md-dialog': M3Dialog;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
50
|
+
export {};
|
package/src/m3/dialog/dialog.js
CHANGED
|
@@ -3,12 +3,111 @@ import { html } from 'lit';
|
|
|
3
3
|
import { query, state, customElement } from 'lit/decorators.js';
|
|
4
4
|
import { ensureSlottedReady } from '../../core/ensure-ready.js';
|
|
5
5
|
import { Dialog } from '../../base/dialog.js';
|
|
6
|
+
import { getSpring } from '../styles/motion.js';
|
|
6
7
|
import { dialogStyles } from './dialog-styles.css.js';
|
|
8
|
+
// Was based on https://m3.material.io/styles/motion/easing-and-duration/applying-easing-and-duration#e5b958f0-435d-4e84-aed4-8d1ea395fa5c
|
|
9
|
+
// TODO: use curves and durations from motion physics
|
|
10
|
+
const options = {
|
|
11
|
+
openEase: 'cubic-bezier(0, 0, 0, 1)',
|
|
12
|
+
closeEase: 'cubic-bezier(0.3, 0, 1, 1)',
|
|
13
|
+
vertSlide: 40,
|
|
14
|
+
openDur: 500,
|
|
15
|
+
closeDur: 200,
|
|
16
|
+
bodyFadeInDur: 200,
|
|
17
|
+
bodyFadeOutDur: 100,
|
|
18
|
+
};
|
|
19
|
+
const opacity = (from, to, options) => ({
|
|
20
|
+
keyframes: [{ opacity: from }, { opacity: to }],
|
|
21
|
+
options,
|
|
22
|
+
});
|
|
23
|
+
export const getFadeAnimations = (host) => {
|
|
24
|
+
const effectsFast = getSpring(host, 'effects', 'fast');
|
|
25
|
+
const fade = (from, to) => opacity(from, to, { ...effectsFast, fill: 'forwards' });
|
|
26
|
+
const container = getComputedStyle(host.$container), scrim = getComputedStyle(host.$scrim);
|
|
27
|
+
return {
|
|
28
|
+
open: {
|
|
29
|
+
container: fade('0', '1'),
|
|
30
|
+
scrim: fade('0', '0.32'),
|
|
31
|
+
},
|
|
32
|
+
close: {
|
|
33
|
+
container: fade(container.opacity, '0'),
|
|
34
|
+
scrim: fade(scrim.opacity, '0'),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export const getDefaultAnimations = (host) => {
|
|
39
|
+
const container = getComputedStyle(host.$container), scrim = getComputedStyle(host.$scrim), body = getComputedStyle(host.$body), actions = getComputedStyle(host.$actions);
|
|
40
|
+
return {
|
|
41
|
+
open: {
|
|
42
|
+
container: {
|
|
43
|
+
keyframes: [
|
|
44
|
+
{
|
|
45
|
+
height: '0px',
|
|
46
|
+
minHeight: '0px',
|
|
47
|
+
transform: `translateY(-${options.vertSlide}px)`,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
height: `${host._fullHeight}px`,
|
|
51
|
+
minHeight: '0px',
|
|
52
|
+
transform: 'translateY(0px)',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
options: { duration: options.openDur, easing: options.openEase },
|
|
56
|
+
},
|
|
57
|
+
scrim: opacity('0', '0.32', {
|
|
58
|
+
duration: options.openDur,
|
|
59
|
+
easing: options.openEase,
|
|
60
|
+
fill: 'forwards',
|
|
61
|
+
}),
|
|
62
|
+
body: opacity('0.2', '1', {
|
|
63
|
+
duration: options.bodyFadeInDur,
|
|
64
|
+
fill: 'forwards',
|
|
65
|
+
}),
|
|
66
|
+
actions: opacity('0.5', '1', {
|
|
67
|
+
duration: options.bodyFadeInDur,
|
|
68
|
+
fill: 'forwards',
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
close: {
|
|
72
|
+
container: {
|
|
73
|
+
keyframes: [
|
|
74
|
+
{
|
|
75
|
+
height: container.height,
|
|
76
|
+
minHeight: '0px',
|
|
77
|
+
transform: container.transform,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
height: `${host._fullHeight * 0.35}px`,
|
|
81
|
+
minHeight: '0px',
|
|
82
|
+
transform: `translateY(-${options.vertSlide}px)`,
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
options: { duration: options.closeDur, easing: options.closeEase },
|
|
86
|
+
},
|
|
87
|
+
effects: opacity(container.opacity, '0', {
|
|
88
|
+
duration: options.closeDur - options.bodyFadeOutDur,
|
|
89
|
+
delay: options.bodyFadeOutDur,
|
|
90
|
+
fill: 'forwards',
|
|
91
|
+
}),
|
|
92
|
+
scrim: opacity(scrim.opacity, '0', {
|
|
93
|
+
duration: options.closeDur,
|
|
94
|
+
easing: options.closeEase,
|
|
95
|
+
fill: 'forwards',
|
|
96
|
+
}),
|
|
97
|
+
body: opacity(body.opacity, '0', {
|
|
98
|
+
duration: options.bodyFadeOutDur,
|
|
99
|
+
fill: 'forwards',
|
|
100
|
+
}),
|
|
101
|
+
actions: opacity(actions.opacity, '0', {
|
|
102
|
+
duration: options.bodyFadeOutDur,
|
|
103
|
+
fill: 'forwards',
|
|
104
|
+
}),
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
};
|
|
7
108
|
/**
|
|
8
109
|
* TODO: test if form actions `cancel` and other things related work - no,
|
|
9
110
|
* event listener needed
|
|
10
|
-
* FIXME: on Firefox, the focus is not autoatically set to the first tabbable
|
|
11
|
-
* element
|
|
12
111
|
*
|
|
13
112
|
* @tag md-dialog
|
|
14
113
|
*
|
|
@@ -25,19 +124,9 @@ import { dialogStyles } from './dialog-styles.css.js';
|
|
|
25
124
|
let M3Dialog = class M3Dialog extends Dialog {
|
|
26
125
|
constructor() {
|
|
27
126
|
super(...arguments);
|
|
28
|
-
// Was based on https://m3.material.io/styles/motion/easing-and-duration/applying-easing-and-duration#e5b958f0-435d-4e84-aed4-8d1ea395fa5c
|
|
29
|
-
// TODO: use curves and durations from motion physics
|
|
30
|
-
this._config = {
|
|
31
|
-
openEase: 'cubic-bezier(0, 0, 0, 1)',
|
|
32
|
-
closeEase: 'cubic-bezier(0.3, 0, 1, 1)',
|
|
33
|
-
vertSlide: 40,
|
|
34
|
-
openDur: 500,
|
|
35
|
-
closeDur: 200,
|
|
36
|
-
bodyFadeInDur: 200,
|
|
37
|
-
bodyFadeOutDur: 100,
|
|
38
|
-
};
|
|
39
127
|
this.hasIcon = false;
|
|
40
128
|
this.#activeAnimations = [];
|
|
129
|
+
this._fullHeight = 0;
|
|
41
130
|
this.#handleClick = (e) => {
|
|
42
131
|
const target = e.target;
|
|
43
132
|
if (!this.$container.contains(target) && !this.contains(target))
|
|
@@ -63,103 +152,64 @@ let M3Dialog = class M3Dialog extends Dialog {
|
|
|
63
152
|
this.#activeAnimations = [];
|
|
64
153
|
this.#opening = this.#closing = false;
|
|
65
154
|
}
|
|
155
|
+
#animate(recipes) {
|
|
156
|
+
const targets = {
|
|
157
|
+
container: this.$container,
|
|
158
|
+
effects: this.$container,
|
|
159
|
+
scrim: this.$scrim,
|
|
160
|
+
body: this.$body,
|
|
161
|
+
actions: this.$actions,
|
|
162
|
+
};
|
|
163
|
+
const animations = {};
|
|
164
|
+
for (const [name, recipe] of Object.entries(recipes)) {
|
|
165
|
+
animations[name] = targets[name].animate(recipe.keyframes, recipe.options);
|
|
166
|
+
this.#activeAnimations.push(animations[name]);
|
|
167
|
+
}
|
|
168
|
+
return animations;
|
|
169
|
+
}
|
|
170
|
+
get #fade() {
|
|
171
|
+
return (window.matchMedia('(prefers-reduced-motion: reduce)').matches ||
|
|
172
|
+
getComputedStyle(this)
|
|
173
|
+
.getPropertyValue('--md-dialog-animation')
|
|
174
|
+
.trim() === 'fade');
|
|
175
|
+
}
|
|
66
176
|
#handleClick;
|
|
67
177
|
#handleIconSlotChange;
|
|
68
178
|
#opening;
|
|
69
179
|
async show() {
|
|
70
180
|
if (this.#opening)
|
|
71
181
|
return;
|
|
182
|
+
await this.updateComplete;
|
|
72
183
|
this.#clearAnimations();
|
|
73
184
|
this.#opening = true;
|
|
74
185
|
// Reset margins to allow browser centering
|
|
75
186
|
this.$dialog.style.marginTop = 'auto';
|
|
76
187
|
this.$dialog.style.marginBottom = 'auto';
|
|
77
|
-
super.show();
|
|
188
|
+
await super.show();
|
|
78
189
|
const actionsHeight = this.$actions.offsetHeight;
|
|
79
190
|
this.$actionsPlaceholder.style.height = `${actionsHeight}px`;
|
|
80
191
|
this.$container.style.height = 'auto';
|
|
81
|
-
|
|
82
|
-
const endHeight = this.$container.offsetHeight;
|
|
192
|
+
this._fullHeight = this.$container.offsetHeight;
|
|
83
193
|
// Lock the position to prevent auto-centering during animation
|
|
84
194
|
const rect = this.$container.getBoundingClientRect();
|
|
85
195
|
this.$dialog.style.marginTop = `${rect.top}px`;
|
|
86
196
|
this.$dialog.style.marginBottom = 'auto';
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
height: `${startHeight}px`,
|
|
91
|
-
transform: `translateY(-${this._config.vertSlide}px)`,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
height: `${endHeight}px`,
|
|
95
|
-
transform: 'translateY(0px)',
|
|
96
|
-
},
|
|
97
|
-
], { duration: this._config.openDur, easing: this._config.openEase });
|
|
98
|
-
const scrim = this.$scrim.animate([{ opacity: 0 }, { opacity: 0.32 }], {
|
|
99
|
-
duration: this._config.openDur,
|
|
100
|
-
easing: this._config.openEase,
|
|
101
|
-
fill: 'forwards',
|
|
102
|
-
});
|
|
103
|
-
const body = this.$body.animate([{ opacity: 0.2 }, { opacity: 1 }], {
|
|
104
|
-
duration: this._config.bodyFadeInDur,
|
|
105
|
-
easing: 'linear',
|
|
106
|
-
fill: 'forwards',
|
|
107
|
-
});
|
|
108
|
-
const actions = this.$actions.animate([{ opacity: 0.5 }, { opacity: 1 }], {
|
|
109
|
-
duration: this._config.bodyFadeInDur,
|
|
110
|
-
easing: 'linear',
|
|
111
|
-
fill: 'forwards',
|
|
112
|
-
});
|
|
113
|
-
this.#activeAnimations.push(container, scrim, body, actions);
|
|
114
|
-
container.onfinish = () => {
|
|
115
|
-
this.$container.style.minHeight = '';
|
|
116
|
-
this.#clearAnimations();
|
|
117
|
-
};
|
|
197
|
+
const getAnimations = this.#fade ? getFadeAnimations : getDefaultAnimations;
|
|
198
|
+
const animations = this.#animate(getAnimations(this).open);
|
|
199
|
+
animations.container.onfinish = () => this.#clearAnimations();
|
|
118
200
|
}
|
|
119
201
|
#closing;
|
|
120
202
|
async close() {
|
|
121
203
|
if (this.#closing)
|
|
122
204
|
return;
|
|
205
|
+
await this.updateComplete;
|
|
206
|
+
const getAnimations = this.#fade ? getFadeAnimations : getDefaultAnimations;
|
|
207
|
+
const recipes = getAnimations(this).close;
|
|
123
208
|
this.#clearAnimations();
|
|
124
209
|
this.#closing = true;
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const containerSpatial = this.$container.animate([
|
|
129
|
-
{ height: `${startHeight}px`, transform: 'translateY(0px)' },
|
|
130
|
-
{
|
|
131
|
-
height: `${endHeight}px`,
|
|
132
|
-
transform: `translateY(-${this._config.vertSlide}px)`,
|
|
133
|
-
},
|
|
134
|
-
], {
|
|
135
|
-
duration: this._config.closeDur,
|
|
136
|
-
easing: this._config.closeEase,
|
|
137
|
-
});
|
|
138
|
-
const containerEffects = this.$container.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
139
|
-
duration: this._config.closeDur - this._config.bodyFadeOutDur,
|
|
140
|
-
delay: this._config.bodyFadeOutDur,
|
|
141
|
-
easing: 'linear',
|
|
142
|
-
fill: 'forwards',
|
|
143
|
-
});
|
|
144
|
-
const scrim = this.$scrim.animate([{ opacity: 0.32 }, { opacity: 0 }], {
|
|
145
|
-
duration: this._config.closeDur,
|
|
146
|
-
easing: this._config.closeEase,
|
|
147
|
-
fill: 'forwards',
|
|
148
|
-
});
|
|
149
|
-
const body = this.$body.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
150
|
-
duration: this._config.bodyFadeOutDur,
|
|
151
|
-
easing: 'linear',
|
|
152
|
-
fill: 'forwards',
|
|
153
|
-
});
|
|
154
|
-
const actions = this.$actions.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
155
|
-
duration: this._config.bodyFadeOutDur,
|
|
156
|
-
easing: 'linear',
|
|
157
|
-
fill: 'forwards',
|
|
158
|
-
});
|
|
159
|
-
this.#activeAnimations.push(containerSpatial, containerEffects, scrim, body, actions);
|
|
160
|
-
containerSpatial.onfinish = () => {
|
|
161
|
-
this.$container.style.minHeight = '';
|
|
162
|
-
super.close();
|
|
210
|
+
const animations = this.#animate(recipes);
|
|
211
|
+
animations.container.onfinish = async () => {
|
|
212
|
+
await super.close();
|
|
163
213
|
this.#clearAnimations();
|
|
164
214
|
};
|
|
165
215
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const fabStyles = css`:host{--md-focus-ring-shape:var(--_border-radius);--
|
|
2
|
+
export const fabStyles = css`:host{--md-focus-ring-shape:var(--_border-radius);--_size:56px;--_border-radius:16px;--_icon-size:24px;background-color:var(--md-sys-color-primary);border-radius:var(--_border-radius);box-shadow:var(--md-sys-elevation-shadow-3);box-sizing:border-box;color:var(--md-sys-color-on-primary);cursor:pointer;font:var(--md-sys-typography-label-large);height:var(--_size);min-width:var(--_size);padding-inline:calc((var(--_size) - var(--_icon-size)) / 2);-webkit-tap-highlight-color:transparent;transition:box-shadow var(--md-sys-motion-effects-default-duration) var(--md-sys-motion-effects-default);-webkit-user-select:none;user-select:none;vertical-align:middle;outline:0;justify-content:center;align-items:center;gap:8px;display:inline-flex;position:relative}md-ripple,md-focus-ring{position:absolute}:host([size=m]){--_size:80px;--_border-radius:20px;--_icon-size:28px}:host([size=l]){--_size:96px;--_border-radius:28px;--_icon-size:36px}:host([color=primary-container]){color:var(--md-sys-color-on-primary-container);background-color:var(--md-sys-color-primary-container)}:host([color=secondary-container]){color:var(--md-sys-color-on-secondary-container);background-color:var(--md-sys-color-secondary-container)}:host([color=tertiary-container]){color:var(--md-sys-color-on-tertiary-container);background-color:var(--md-sys-color-tertiary-container)}:host([color=secondary]){color:var(--md-sys-color-on-secondary);background-color:var(--md-sys-color-secondary)}:host([color=tertiary]){color:var(--md-sys-color-on-tertiary);background-color:var(--md-sys-color-tertiary)}:host([color=surface]){color:var(--md-sys-color-primary);background-color:var(--md-sys-color-surface-container-high)}:host(:disabled){background-color:oklch(from var(--md-sys-color-on-surface) l c h / 10%);color:oklch(from var(--md-sys-color-on-surface) l c h / 38%);box-shadow:none;pointer-events:none}@media (hover:hover) and (pointer:fine){:host(:hover:not(:active)){box-shadow:var(--md-sys-elevation-shadow-4)}}::slotted(:not([slot=label])){fill:currentColor;block-size:1em;font-size:var(--_icon-size);inline-size:1em}::slotted([slot=label]){margin-inline:4px}@media (forced-colors:active){:host{forced-color-adjust:none;color:buttontext;background:buttonface;border:1px solid buttonborder}}`;
|
package/src/m3/fab/fab.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class M3Fab extends Button {
|
|
|
14
14
|
size: 's' | 'm' | 'l';
|
|
15
15
|
color: 'surface' | 'primary-container' | 'secondary-container' | 'tertiary-container' | 'primary' | 'secondary' | 'tertiary';
|
|
16
16
|
static styles: any[];
|
|
17
|
-
render(): import("lit
|
|
17
|
+
render(): import("lit").TemplateResult<1>;
|
|
18
18
|
}
|
|
19
19
|
declare global {
|
|
20
20
|
interface HTMLElementTagNameMap {
|
package/src/m3/field/field.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { PropertyValues, TemplateResult } from 'lit';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @fires {Event} change - Fired when the selected value has changed.
|
|
5
|
-
* @fires {Event} input - Fired when the selected value has changed.
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class M3Field extends Field {
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
export declare abstract class M3Field extends LitElement {
|
|
3
|
+
#private;
|
|
8
4
|
label: string;
|
|
9
5
|
supportingText: string;
|
|
10
6
|
disabled: boolean;
|
|
@@ -19,10 +15,9 @@ export declare abstract class M3Field extends Field {
|
|
|
19
15
|
/**
|
|
20
16
|
* Should be implemented by subclasses.
|
|
21
17
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
abstract renderContainerContent(): TemplateResult;
|
|
19
|
+
renderSupportingText(): "" | TemplateResult<1>;
|
|
20
|
+
renderStart(): TemplateResult<1>;
|
|
21
|
+
renderEnd(): TemplateResult<1>;
|
|
26
22
|
update(changedProperties: PropertyValues): void;
|
|
27
|
-
protected handleSlotChange(e: Event): void;
|
|
28
23
|
}
|