@vollowx/seele 0.13.5 → 0.13.7
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/custom-elements.json +1256 -115
- package/package.json +22 -14
- package/src/all.d.ts +34 -0
- package/src/base/autocomplete.d.ts +57 -0
- package/src/base/autocomplete.js +80 -98
- package/src/base/button.d.ts +13 -0
- package/src/base/button.js +21 -19
- package/src/base/checkbox.d.ts +18 -0
- package/src/base/checkbox.js +39 -34
- package/src/base/controllers/list-controller.d.ts +37 -0
- package/src/base/controllers/list-controller.js +23 -15
- package/src/base/controllers/popover-controller.d.ts +35 -0
- package/src/base/controllers/popover-controller.js +37 -29
- package/src/base/dialog.d.ts +20 -0
- package/src/base/dialog.js +11 -9
- package/src/base/field.d.ts +3 -0
- package/src/base/input.d.ts +44 -0
- package/src/base/input.js +57 -65
- package/src/base/item.d.ts +7 -0
- package/src/base/item.js +2 -1
- package/src/base/list-item.d.ts +15 -0
- package/src/base/list-item.js +22 -22
- package/src/base/list.d.ts +54 -0
- package/src/base/list.js +69 -55
- package/src/base/menu-item.d.ts +6 -0
- package/src/base/menu-item.js +4 -3
- package/src/base/menu.d.ts +78 -0
- package/src/base/menu.js +137 -143
- package/src/base/mixins/attachable.d.ts +9 -0
- package/src/base/mixins/attachable.js +22 -18
- package/src/base/mixins/focus-delegated.d.ts +5 -0
- package/src/base/mixins/focus-delegated.js +6 -8
- package/src/base/mixins/form-associated.d.ts +15 -0
- package/src/base/mixins/form-associated.js +11 -18
- package/src/base/mixins/internals-attached.d.ts +6 -0
- package/src/base/mixins/internals-attached.js +1 -1
- package/src/base/option.d.ts +9 -0
- package/src/base/option.js +7 -8
- package/src/base/radio.d.ts +13 -0
- package/src/base/radio.js +49 -42
- package/src/base/select.d.ts +116 -0
- package/src/base/select.js +130 -128
- package/src/base/slider.d.ts +75 -0
- package/src/base/slider.js +115 -118
- package/src/base/tab-panel.d.ts +9 -0
- package/src/base/tab-panel.js +11 -11
- package/src/base/tab.d.ts +18 -0
- package/src/base/tab.js +25 -24
- package/src/base/tabs.d.ts +19 -0
- package/src/base/tabs.js +84 -81
- package/src/base/toggle-button.d.ts +47 -0
- package/src/base/toggle-button.js +56 -52
- package/src/base/tooltip.d.ts +37 -0
- package/src/base/tooltip.js +70 -65
- package/src/core/decorators.d.ts +2 -0
- package/src/core/decorators.js +4 -3
- package/src/core/ensure-ready.d.ts +1 -0
- package/src/core/ensure-ready.js +15 -0
- package/src/core/focus-visible.d.ts +2 -0
- package/src/core/focus-visible.js +4 -4
- package/src/core/shared.d.ts +1 -0
- package/src/core/unique-id.d.ts +4 -0
- package/src/core/unique-id.js +2 -1
- package/src/m3/autocomplete/autocomplete.d.ts +9 -0
- package/src/m3/autocomplete/autocomplete.js +11 -10
- package/src/m3/badge/badge.d.ts +13 -0
- package/src/m3/badge/badge.js +28 -37
- package/src/m3/button/common-button-toggle.d.ts +31 -0
- package/src/m3/button/common-button-toggle.js +44 -41
- package/src/m3/button/common-button.d.ts +29 -0
- package/src/m3/button/common-button.js +40 -40
- package/src/m3/button/icon-button-toggle.d.ts +24 -0
- package/src/m3/button/icon-button-toggle.js +35 -32
- package/src/m3/button/icon-button.d.ts +23 -0
- package/src/m3/button/icon-button.js +33 -31
- package/src/m3/button-group/connected-button-group.d.ts +19 -0
- package/src/m3/button-group/connected-button-group.js +26 -24
- package/src/m3/button-group/standard-button-group.d.ts +24 -0
- package/src/m3/button-group/standard-button-group.js +71 -65
- package/src/m3/checkbox/checkbox.d.ts +25 -0
- package/src/m3/checkbox/checkbox.js +23 -22
- package/src/m3/dialog/dialog.d.ts +46 -0
- package/src/m3/dialog/dialog.js +90 -117
- package/src/m3/divider/divider.d.ts +13 -0
- package/src/m3/divider/divider.js +20 -33
- package/src/m3/fab/fab.d.ts +23 -0
- package/src/m3/fab/fab.js +24 -23
- package/src/m3/field/field.d.ts +28 -0
- package/src/m3/field/field.js +40 -55
- package/src/m3/field/filled-field.d.ts +11 -0
- package/src/m3/field/filled-field.js +7 -11
- package/src/m3/field/outlined-field.d.ts +11 -0
- package/src/m3/field/outlined-field.js +8 -12
- package/src/m3/focus-ring/focus-ring.d.ts +32 -0
- package/src/m3/focus-ring/focus-ring.js +38 -23
- package/src/m3/item/item.d.ts +31 -0
- package/src/m3/item/item.js +32 -17
- package/src/m3/list/list-item.d.ts +24 -0
- package/src/m3/list/list-item.js +20 -16
- package/src/m3/list/list.d.ts +15 -0
- package/src/m3/list/list.js +16 -15
- package/src/m3/loading-indicator/loading-indicator.d.ts +26 -0
- package/src/m3/loading-indicator/loading-indicator.js +113 -161
- package/src/m3/menu/menu-item.d.ts +15 -0
- package/src/m3/menu/menu-item.js +10 -4
- package/src/m3/menu/menu.d.ts +22 -0
- package/src/m3/menu/menu.js +20 -18
- package/src/m3/radio/radio-styles.css.js +1 -1
- package/src/m3/radio/radio.d.ts +17 -0
- package/src/m3/radio/radio.js +22 -11
- package/src/m3/ripple/ripple.d.ts +43 -0
- package/src/m3/ripple/ripple.js +82 -89
- package/src/m3/select/filled-select.d.ts +16 -0
- package/src/m3/select/filled-select.js +12 -10
- package/src/m3/select/option.d.ts +15 -0
- package/src/m3/select/option.js +10 -4
- package/src/m3/select/outlined-select.d.ts +16 -0
- package/src/m3/select/outlined-select.js +12 -10
- package/src/m3/select/select.d.ts +14 -0
- package/src/m3/select/select.js +17 -16
- package/src/m3/slider/slider.d.ts +20 -0
- package/src/m3/slider/slider.js +32 -26
- package/src/m3/switch/switch.d.ts +27 -0
- package/src/m3/switch/switch.js +62 -53
- package/src/m3/system/motion.d.ts +12 -0
- package/src/m3/system/motion.js +16 -9
- package/src/m3/tab/tab-panel.d.ts +9 -0
- package/src/m3/tab/tab-panel.js +6 -9
- package/src/m3/tab/tab.d.ts +19 -0
- package/src/m3/tab/tab.js +14 -12
- package/src/m3/tab/tabs.d.ts +25 -0
- package/src/m3/tab/tabs.js +34 -30
- package/src/m3/text-field/filled-text-field.d.ts +13 -0
- package/src/m3/text-field/filled-text-field.js +15 -20
- package/src/m3/text-field/outlined-text-field.d.ts +13 -0
- package/src/m3/text-field/outlined-text-field.js +15 -20
- package/src/m3/toolbar/toolbar.d.ts +26 -0
- package/src/m3/toolbar/toolbar.js +28 -25
- package/src/m3/tooltip/tooltip.d.ts +19 -0
- package/src/m3/tooltip/tooltip.js +15 -14
- package/src/win98/button/button.d.ts +13 -0
- package/src/win98/button/button.js +13 -11
- package/src/m3/dialog/dialog-spring.js +0 -179
- package/src/win98/button/radio.js +0 -8
- package/src/win98/radio/radio.js +0 -8
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export async function ensureReady(element) {
|
|
2
|
+
if (!element)
|
|
3
|
+
return null;
|
|
4
|
+
if (element.matches(':not(:defined)'))
|
|
5
|
+
await customElements.whenDefined(element.tagName.toLowerCase());
|
|
6
|
+
// Handles Lit update
|
|
7
|
+
if ('updateComplete' in element) {
|
|
8
|
+
await element.updateComplete;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
// Yield to the next frame to allow initial render to finish
|
|
12
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
13
|
+
}
|
|
14
|
+
return element;
|
|
15
|
+
}
|
|
@@ -4,10 +4,10 @@ export function setFocusVisible(value) {
|
|
|
4
4
|
focusVisible = value;
|
|
5
5
|
}
|
|
6
6
|
if (!isServer) {
|
|
7
|
-
window.addEventListener('keydown', ()=>focusVisible = true, {
|
|
8
|
-
capture: true
|
|
7
|
+
window.addEventListener('keydown', () => (focusVisible = true), {
|
|
8
|
+
capture: true,
|
|
9
9
|
});
|
|
10
|
-
window.addEventListener('mousedown', ()=>focusVisible = false, {
|
|
11
|
-
capture: true
|
|
10
|
+
window.addEventListener('mousedown', () => (focusVisible = false), {
|
|
11
|
+
capture: true,
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
type Constructor<T> = new (...args: any[]) => T;
|
package/src/core/unique-id.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Autocomplete } from '../../base/autocomplete.js';
|
|
2
|
+
import '../menu/menu.js';
|
|
3
|
+
/**
|
|
4
|
+
* TODO: Check if manually dispatching input/change events on input is necessary
|
|
5
|
+
*/
|
|
6
|
+
export declare class M3Autocomplete extends Autocomplete {
|
|
7
|
+
static styles: any[];
|
|
8
|
+
renderMenu(): import("lit-html").TemplateResult<1>;
|
|
9
|
+
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { customElement } from 'lit/decorators.js';
|
|
4
4
|
import { Autocomplete } from '../../base/autocomplete.js';
|
|
5
|
+
import '../menu/menu.js';
|
|
5
6
|
import { autocompleteStyles } from './autocomplete-styles.css.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
7
|
+
/**
|
|
8
|
+
* TODO: Check if manually dispatching input/change events on input is necessary
|
|
9
|
+
*/
|
|
10
|
+
let M3Autocomplete = class M3Autocomplete extends Autocomplete {
|
|
11
|
+
static { this.styles = [autocompleteStyles]; }
|
|
12
12
|
renderMenu() {
|
|
13
|
-
return html`<md-menu part="menu" id="menu" type="listbox" data-tabindex="-1" ?quick="${this.quick}" .offset="${this.offset}" .align="${this.align}" .alignStrategy="${this.alignStrategy}" ?keep-open-select="${this.keepOpenSelect}" no-focus-control ?open="${this.open}" @open="${()=>this.open = true}" @close="${()=>this.open = false}" @select="${this.handleMenuSelect}"><slot @slotchange="${this.handleItemsSlotChange}"></slot></md-menu>`;
|
|
13
|
+
return html `<md-menu part="menu" id="menu" type="listbox" data-tabindex="-1" ?quick="${this.quick}" .offset="${this.offset}" .align="${this.align}" .alignStrategy="${this.alignStrategy}" ?keep-open-select="${this.keepOpenSelect}" no-focus-control ?open="${this.open}" @open="${() => (this.open = true)}" @close="${() => (this.open = false)}" @select="${this.handleMenuSelect}"><slot @slotchange="${this.handleItemsSlotChange}"></slot></md-menu>`;
|
|
14
14
|
}
|
|
15
|
-
}
|
|
16
|
-
M3Autocomplete =
|
|
15
|
+
};
|
|
16
|
+
M3Autocomplete = __decorate([
|
|
17
17
|
customElement('md-autocomplete')
|
|
18
18
|
], M3Autocomplete);
|
|
19
|
+
export { M3Autocomplete };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class M3Badge extends LitElement {
|
|
3
|
+
#private;
|
|
4
|
+
value: number;
|
|
5
|
+
max: number;
|
|
6
|
+
showZero: boolean;
|
|
7
|
+
small: boolean;
|
|
8
|
+
left: boolean;
|
|
9
|
+
bottom: boolean;
|
|
10
|
+
$badge: HTMLSpanElement;
|
|
11
|
+
static styles: any[];
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
package/src/m3/badge/badge.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
2
|
import { LitElement, html } from 'lit';
|
|
3
3
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
4
4
|
import { badgeStyles } from './badge-styles.css.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
// TODO: integrate with md-tab
|
|
6
|
+
let M3Badge = class M3Badge extends LitElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.showZero = false;
|
|
10
|
+
this.small = false;
|
|
11
|
+
this.left = false;
|
|
12
|
+
this.bottom = false;
|
|
10
13
|
}
|
|
14
|
+
static { this.styles = [badgeStyles]; }
|
|
11
15
|
render() {
|
|
12
|
-
return html`<div part="root"><slot></slot><span part="badge">${this.#getDisplayValue()}</span></div>`;
|
|
16
|
+
return html `<div part="root"><slot></slot><span part="badge">${this.#getDisplayValue()}</span></div>`;
|
|
13
17
|
}
|
|
14
18
|
#getDisplayValue() {
|
|
15
19
|
const value = this.value;
|
|
@@ -19,42 +23,29 @@ export class M3Badge extends LitElement {
|
|
|
19
23
|
}
|
|
20
24
|
return value;
|
|
21
25
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
_ts_decorate([
|
|
27
|
-
property({
|
|
28
|
-
type: Number
|
|
29
|
-
})
|
|
26
|
+
};
|
|
27
|
+
__decorate([
|
|
28
|
+
property({ type: Number })
|
|
30
29
|
], M3Badge.prototype, "value", void 0);
|
|
31
|
-
|
|
32
|
-
property({
|
|
33
|
-
type: Number
|
|
34
|
-
})
|
|
30
|
+
__decorate([
|
|
31
|
+
property({ type: Number })
|
|
35
32
|
], M3Badge.prototype, "max", void 0);
|
|
36
|
-
|
|
37
|
-
property({
|
|
38
|
-
type: Boolean,
|
|
39
|
-
reflect: true,
|
|
40
|
-
attribute: 'show-zero'
|
|
41
|
-
})
|
|
33
|
+
__decorate([
|
|
34
|
+
property({ type: Boolean, reflect: true, attribute: 'show-zero' })
|
|
42
35
|
], M3Badge.prototype, "showZero", void 0);
|
|
43
|
-
|
|
44
|
-
property({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
36
|
+
__decorate([
|
|
37
|
+
property({ type: Boolean, reflect: true })
|
|
38
|
+
], M3Badge.prototype, "small", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
property({ type: Boolean, reflect: true })
|
|
48
41
|
], M3Badge.prototype, "left", void 0);
|
|
49
|
-
|
|
50
|
-
property({
|
|
51
|
-
type: Boolean,
|
|
52
|
-
reflect: true
|
|
53
|
-
})
|
|
42
|
+
__decorate([
|
|
43
|
+
property({ type: Boolean, reflect: true })
|
|
54
44
|
], M3Badge.prototype, "bottom", void 0);
|
|
55
|
-
|
|
45
|
+
__decorate([
|
|
56
46
|
query('[part~="badge"]')
|
|
57
47
|
], M3Badge.prototype, "$badge", void 0);
|
|
58
|
-
M3Badge =
|
|
48
|
+
M3Badge = __decorate([
|
|
59
49
|
customElement('md-badge')
|
|
60
50
|
], M3Badge);
|
|
51
|
+
export { M3Badge };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ToggleButton } from '../../base/toggle-button.js';
|
|
2
|
+
import '../focus-ring/focus-ring.js';
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
|
+
/**
|
|
5
|
+
* @tag md-button-toggle
|
|
6
|
+
*
|
|
7
|
+
* @csspart label
|
|
8
|
+
* @csspart label checked
|
|
9
|
+
* @csspart icon
|
|
10
|
+
* @csspart icon checked
|
|
11
|
+
*
|
|
12
|
+
* @slot - label
|
|
13
|
+
* @slot icon - leading icon
|
|
14
|
+
*/
|
|
15
|
+
export declare class M3ButtonToggle extends ToggleButton {
|
|
16
|
+
size: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
17
|
+
square: boolean;
|
|
18
|
+
color: 'primary' | 'secondary' | 'tertiary';
|
|
19
|
+
variant: 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';
|
|
20
|
+
/**
|
|
21
|
+
* Whether to show the icon at the end of the button.
|
|
22
|
+
*/
|
|
23
|
+
trailingIcon: boolean;
|
|
24
|
+
static styles: any[];
|
|
25
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
interface HTMLElementTagNameMap {
|
|
29
|
+
'md-button-toggle': M3ButtonToggle;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
4
|
import { ToggleButton } from '../../base/toggle-button.js';
|
|
@@ -8,53 +8,56 @@ import { targetStyles } from '../target-styles.css.js';
|
|
|
8
8
|
import { sharedButtonStyles } from './shared-button-styles.css.js';
|
|
9
9
|
import { sharedButtonToggleStyles } from './shared-button-toggle-styles.css.js';
|
|
10
10
|
import { commonButtonStyles } from './common-button-styles.css.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @tag md-button-toggle
|
|
13
|
+
*
|
|
14
|
+
* @csspart label
|
|
15
|
+
* @csspart label checked
|
|
16
|
+
* @csspart icon
|
|
17
|
+
* @csspart icon checked
|
|
18
|
+
*
|
|
19
|
+
* @slot - label
|
|
20
|
+
* @slot icon - leading icon
|
|
21
|
+
*/
|
|
22
|
+
let M3ButtonToggle = class M3ButtonToggle extends ToggleButton {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.size = 's';
|
|
26
|
+
this.square = false;
|
|
27
|
+
this.color = 'primary';
|
|
28
|
+
this.variant = 'filled';
|
|
29
|
+
/**
|
|
30
|
+
* Whether to show the icon at the end of the button.
|
|
31
|
+
*/
|
|
32
|
+
this.trailingIcon = false;
|
|
20
33
|
}
|
|
34
|
+
static { this.styles = [
|
|
35
|
+
...super.styles,
|
|
36
|
+
targetStyles,
|
|
37
|
+
sharedButtonStyles,
|
|
38
|
+
sharedButtonToggleStyles,
|
|
39
|
+
commonButtonStyles,
|
|
40
|
+
]; }
|
|
21
41
|
render() {
|
|
22
|
-
return html`<md-focus-ring></md-focus-ring><md-ripple></md-ripple><span part="target"></span><slot part="icon unchecked" name="icon" aria-hidden="true"></slot><slot part="icon checked" name="icon-checked" aria-hidden="true"></slot><slot part="label unchecked"></slot><slot part="label checked" name="checked"></slot>`;
|
|
42
|
+
return html `<md-focus-ring></md-focus-ring><md-ripple></md-ripple><span part="target"></span><slot part="icon unchecked" name="icon" aria-hidden="true"></slot><slot part="icon checked" name="icon-checked" aria-hidden="true"></slot><slot part="label unchecked"></slot><slot part="label checked" name="checked"></slot>`;
|
|
23
43
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*/ this.trailingIcon = false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
_ts_decorate([
|
|
31
|
-
property({
|
|
32
|
-
reflect: true
|
|
33
|
-
})
|
|
44
|
+
};
|
|
45
|
+
__decorate([
|
|
46
|
+
property({ reflect: true })
|
|
34
47
|
], M3ButtonToggle.prototype, "size", void 0);
|
|
35
|
-
|
|
36
|
-
property({
|
|
37
|
-
reflect: true,
|
|
38
|
-
type: Boolean
|
|
39
|
-
})
|
|
48
|
+
__decorate([
|
|
49
|
+
property({ reflect: true, type: Boolean })
|
|
40
50
|
], M3ButtonToggle.prototype, "square", void 0);
|
|
41
|
-
|
|
42
|
-
property({
|
|
43
|
-
reflect: true
|
|
44
|
-
})
|
|
51
|
+
__decorate([
|
|
52
|
+
property({ reflect: true })
|
|
45
53
|
], M3ButtonToggle.prototype, "color", void 0);
|
|
46
|
-
|
|
47
|
-
property({
|
|
48
|
-
reflect: true
|
|
49
|
-
})
|
|
54
|
+
__decorate([
|
|
55
|
+
property({ reflect: true })
|
|
50
56
|
], M3ButtonToggle.prototype, "variant", void 0);
|
|
51
|
-
|
|
52
|
-
property({
|
|
53
|
-
type: Boolean,
|
|
54
|
-
reflect: true,
|
|
55
|
-
attribute: 'trailing-icon'
|
|
56
|
-
})
|
|
57
|
+
__decorate([
|
|
58
|
+
property({ type: Boolean, reflect: true, attribute: 'trailing-icon' })
|
|
57
59
|
], M3ButtonToggle.prototype, "trailingIcon", void 0);
|
|
58
|
-
M3ButtonToggle =
|
|
60
|
+
M3ButtonToggle = __decorate([
|
|
59
61
|
customElement('md-button-toggle')
|
|
60
62
|
], M3ButtonToggle);
|
|
63
|
+
export { M3ButtonToggle };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Button } from '../../base/button.js';
|
|
2
|
+
import '../focus-ring/focus-ring.js';
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
|
+
/**
|
|
5
|
+
* @tag md-button
|
|
6
|
+
*
|
|
7
|
+
* @csspart label
|
|
8
|
+
* @csspart icon
|
|
9
|
+
*
|
|
10
|
+
* @slot - label
|
|
11
|
+
* @slot icon - leading icon
|
|
12
|
+
*/
|
|
13
|
+
export declare class M3Button extends Button {
|
|
14
|
+
size: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
15
|
+
square: false;
|
|
16
|
+
color: 'primary' | 'secondary' | 'tertiary';
|
|
17
|
+
variant: 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';
|
|
18
|
+
/**
|
|
19
|
+
* Whether to show the icon at the end of the button.
|
|
20
|
+
*/
|
|
21
|
+
trailingIcon: boolean;
|
|
22
|
+
static styles: any[];
|
|
23
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
24
|
+
}
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
'md-button': M3Button;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
4
|
import { Button } from '../../base/button.js';
|
|
@@ -7,52 +7,52 @@ import '../ripple/ripple.js';
|
|
|
7
7
|
import { targetStyles } from '../target-styles.css.js';
|
|
8
8
|
import { sharedButtonStyles } from './shared-button-styles.css.js';
|
|
9
9
|
import { commonButtonStyles } from './common-button-styles.css.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @tag md-button
|
|
12
|
+
*
|
|
13
|
+
* @csspart label
|
|
14
|
+
* @csspart icon
|
|
15
|
+
*
|
|
16
|
+
* @slot - label
|
|
17
|
+
* @slot icon - leading icon
|
|
18
|
+
*/
|
|
19
|
+
let M3Button = class M3Button extends Button {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.size = 's';
|
|
23
|
+
this.color = 'primary';
|
|
24
|
+
this.variant = 'filled';
|
|
25
|
+
/**
|
|
26
|
+
* Whether to show the icon at the end of the button.
|
|
27
|
+
*/
|
|
28
|
+
this.trailingIcon = false;
|
|
18
29
|
}
|
|
30
|
+
static { this.styles = [
|
|
31
|
+
...super.styles,
|
|
32
|
+
targetStyles,
|
|
33
|
+
sharedButtonStyles,
|
|
34
|
+
commonButtonStyles,
|
|
35
|
+
]; }
|
|
19
36
|
render() {
|
|
20
|
-
return html`<md-focus-ring></md-focus-ring><md-ripple></md-ripple><span part="target"></span><slot part="icon" name="icon" aria-hidden="true"></slot><slot part="label"></slot>`;
|
|
37
|
+
return html `<md-focus-ring></md-focus-ring><md-ripple></md-ripple><span part="target"></span><slot part="icon" name="icon" aria-hidden="true"></slot><slot part="label"></slot>`;
|
|
21
38
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*/ this.trailingIcon = false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
_ts_decorate([
|
|
29
|
-
property({
|
|
30
|
-
reflect: true
|
|
31
|
-
})
|
|
39
|
+
};
|
|
40
|
+
__decorate([
|
|
41
|
+
property({ reflect: true })
|
|
32
42
|
], M3Button.prototype, "size", void 0);
|
|
33
|
-
|
|
34
|
-
property({
|
|
35
|
-
reflect: true,
|
|
36
|
-
type: Boolean
|
|
37
|
-
})
|
|
43
|
+
__decorate([
|
|
44
|
+
property({ reflect: true, type: Boolean })
|
|
38
45
|
], M3Button.prototype, "square", void 0);
|
|
39
|
-
|
|
40
|
-
property({
|
|
41
|
-
reflect: true
|
|
42
|
-
})
|
|
46
|
+
__decorate([
|
|
47
|
+
property({ reflect: true })
|
|
43
48
|
], M3Button.prototype, "color", void 0);
|
|
44
|
-
|
|
45
|
-
property({
|
|
46
|
-
reflect: true
|
|
47
|
-
})
|
|
49
|
+
__decorate([
|
|
50
|
+
property({ reflect: true })
|
|
48
51
|
], M3Button.prototype, "variant", void 0);
|
|
49
|
-
|
|
50
|
-
property({
|
|
51
|
-
type: Boolean,
|
|
52
|
-
reflect: true,
|
|
53
|
-
attribute: 'trailing-icon'
|
|
54
|
-
})
|
|
52
|
+
__decorate([
|
|
53
|
+
property({ type: Boolean, reflect: true, attribute: 'trailing-icon' })
|
|
55
54
|
], M3Button.prototype, "trailingIcon", void 0);
|
|
56
|
-
M3Button =
|
|
55
|
+
M3Button = __decorate([
|
|
57
56
|
customElement('md-button')
|
|
58
57
|
], M3Button);
|
|
58
|
+
export { M3Button };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ToggleButton } from '../../base/toggle-button.js';
|
|
2
|
+
import '../focus-ring/focus-ring.js';
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
|
+
/**
|
|
5
|
+
* @tag md-icon-button-toggle
|
|
6
|
+
*
|
|
7
|
+
* @csspart icon
|
|
8
|
+
*
|
|
9
|
+
* @slot - icon
|
|
10
|
+
* @slot checked - icon when checked
|
|
11
|
+
*/
|
|
12
|
+
export declare class M3IconButtonToggle extends ToggleButton {
|
|
13
|
+
static styles: any[];
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
size: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
16
|
+
color: 'primary' | 'secondary' | 'tertiary';
|
|
17
|
+
variant: 'text' | 'filled' | 'tonal' | 'outlined';
|
|
18
|
+
width: 'standard' | 'narrow' | 'wide';
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'md-icon-button-toggle': M3IconButtonToggle;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
4
|
import { ToggleButton } from '../../base/toggle-button.js';
|
|
@@ -8,43 +8,46 @@ import { targetStyles } from '../target-styles.css.js';
|
|
|
8
8
|
import { sharedButtonStyles } from './shared-button-styles.css.js';
|
|
9
9
|
import { sharedButtonToggleStyles } from './shared-button-toggle-styles.css.js';
|
|
10
10
|
import { iconButtonStyles } from './icon-button-styles.css.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @tag md-icon-button-toggle
|
|
13
|
+
*
|
|
14
|
+
* @csspart icon
|
|
15
|
+
*
|
|
16
|
+
* @slot - icon
|
|
17
|
+
* @slot checked - icon when checked
|
|
18
|
+
*/
|
|
19
|
+
let M3IconButtonToggle = class M3IconButtonToggle extends ToggleButton {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.size = 's';
|
|
23
|
+
this.color = 'primary';
|
|
24
|
+
this.variant = 'text';
|
|
25
|
+
this.width = 'standard';
|
|
20
26
|
}
|
|
27
|
+
static { this.styles = [
|
|
28
|
+
...super.styles,
|
|
29
|
+
targetStyles,
|
|
30
|
+
sharedButtonStyles,
|
|
31
|
+
sharedButtonToggleStyles,
|
|
32
|
+
iconButtonStyles,
|
|
33
|
+
]; }
|
|
21
34
|
render() {
|
|
22
|
-
return html`<md-focus-ring></md-focus-ring><md-ripple enterbehavior="always"></md-ripple><span part="target"></span><slot part="icon unchecked"></slot><slot part="icon checked" name="checked"></slot>`;
|
|
35
|
+
return html `<md-focus-ring></md-focus-ring><md-ripple enterbehavior="always"></md-ripple><span part="target"></span><slot part="icon unchecked"></slot><slot part="icon checked" name="checked"></slot>`;
|
|
23
36
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
_ts_decorate([
|
|
29
|
-
property({
|
|
30
|
-
reflect: true
|
|
31
|
-
})
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
property({ reflect: true })
|
|
32
40
|
], M3IconButtonToggle.prototype, "size", void 0);
|
|
33
|
-
|
|
34
|
-
property({
|
|
35
|
-
reflect: true
|
|
36
|
-
})
|
|
41
|
+
__decorate([
|
|
42
|
+
property({ reflect: true })
|
|
37
43
|
], M3IconButtonToggle.prototype, "color", void 0);
|
|
38
|
-
|
|
39
|
-
property({
|
|
40
|
-
reflect: true
|
|
41
|
-
})
|
|
44
|
+
__decorate([
|
|
45
|
+
property({ reflect: true })
|
|
42
46
|
], M3IconButtonToggle.prototype, "variant", void 0);
|
|
43
|
-
|
|
44
|
-
property({
|
|
45
|
-
reflect: true
|
|
46
|
-
})
|
|
47
|
+
__decorate([
|
|
48
|
+
property({ reflect: true })
|
|
47
49
|
], M3IconButtonToggle.prototype, "width", void 0);
|
|
48
|
-
M3IconButtonToggle =
|
|
50
|
+
M3IconButtonToggle = __decorate([
|
|
49
51
|
customElement('md-icon-button-toggle')
|
|
50
52
|
], M3IconButtonToggle);
|
|
53
|
+
export { M3IconButtonToggle };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Button } from '../../base/button.js';
|
|
2
|
+
import '../focus-ring/focus-ring.js';
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
|
+
/**
|
|
5
|
+
* @tag md-icon-button
|
|
6
|
+
*
|
|
7
|
+
* @csspart icon
|
|
8
|
+
*
|
|
9
|
+
* @slot - icon
|
|
10
|
+
*/
|
|
11
|
+
export declare class M3IconButton extends Button {
|
|
12
|
+
size: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
13
|
+
color: 'primary' | 'secondary' | 'tertiary';
|
|
14
|
+
variant: 'text' | 'filled' | 'tonal' | 'outlined';
|
|
15
|
+
width: 'standard' | 'narrow' | 'wide';
|
|
16
|
+
static styles: any[];
|
|
17
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'md-icon-button': M3IconButton;
|
|
22
|
+
}
|
|
23
|
+
}
|