@vollowx/seele 0.13.6 → 0.13.8
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 +32 -13
- package/package.json +1 -1
- package/src/all.d.ts +2 -0
- package/src/all.js +2 -0
- package/src/base/autocomplete.d.ts +1 -0
- package/src/base/autocomplete.js +7 -13
- package/src/base/button.d.ts +4 -2
- package/src/base/button.js +15 -10
- package/src/base/checkbox.js +3 -8
- package/src/base/controllers/popover-controller.js +1 -1
- package/src/base/experimental/popup-styles.css.js +2 -0
- package/src/base/experimental/popup.d.ts +38 -0
- package/src/base/experimental/popup.js +276 -0
- package/src/base/menu.d.ts +2 -0
- package/src/base/menu.js +2 -0
- package/src/base/mixins/button-toggle-mixin.d.ts +7 -0
- package/src/base/mixins/button-toggle-mixin.js +102 -0
- package/src/base/mixins/internals-attached.d.ts +2 -0
- package/src/base/mixins/internals-attached.js +5 -0
- package/src/base/toggle-button.d.ts +6 -45
- package/src/base/toggle-button.js +6 -135
- package/src/core/ensure-ready.d.ts +1 -0
- package/src/core/ensure-ready.js +15 -0
- package/src/m3/autocomplete/autocomplete.d.ts +1 -0
- package/src/m3/autocomplete/autocomplete.js +1 -0
- package/src/m3/badge/badge.d.ts +1 -0
- package/src/m3/badge/badge.js +4 -0
- package/src/m3/button/common-button-toggle.d.ts +4 -10
- package/src/m3/button/common-button-toggle.js +6 -40
- package/src/m3/button/icon-button-toggle.d.ts +4 -6
- package/src/m3/button/icon-button-toggle.js +6 -33
- 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/checkbox/checkbox-styles.css.js +1 -1
- package/src/m3/checkbox/checkbox.d.ts +1 -1
- package/src/m3/dialog/dialog-styles.css.js +1 -1
- package/src/m3/experimental/popup-styles.css.js +2 -0
- package/src/m3/experimental/popup.d.ts +9 -0
- package/src/m3/experimental/popup.js +11 -0
- package/src/m3/fab/fab-styles.css.js +1 -1
- package/src/m3/field/field-styles.css.js +1 -1
- package/src/m3/field/filled-field-styles.css.js +1 -1
- package/src/m3/focus-ring/focus-ring-styles.css.js +1 -1
- package/src/m3/list/list-item-styles.css.js +1 -1
- package/src/m3/list/list-item.d.ts +4 -2
- package/src/m3/list/list-item.js +2 -0
- package/src/m3/menu/menu-styles.css.js +1 -1
- package/src/m3/radio/radio-styles.css.js +1 -1
- package/src/m3/ripple/ripple-styles.css.js +1 -1
- package/src/m3/ripple/ripple.d.ts +1 -12
- package/src/m3/ripple/ripple.js +8 -9
- package/src/m3/select/select.d.ts +1 -0
- package/src/m3/select/select.js +1 -0
- package/src/m3/switch/switch-styles.css.js +1 -1
- package/src/m3/switch/switch.d.ts +3 -2
- package/src/m3/switch/switch.js +11 -10
- package/src/m3/tab/tabs-styles.css.js +1 -1
- package/src/m3/toolbar/toolbar-styles.css.js +1 -1
- package/src/win98/button/button-styles.css.js +1 -1
- package/src/m3/dialog/dialog-spring.d.ts +0 -45
- package/src/m3/dialog/dialog-spring.js +0 -176
- package/src/win98/button/radio.d.ts +0 -3
- package/src/win98/button/radio.js +0 -9
- package/src/win98/radio/radio.d.ts +0 -3
- package/src/win98/radio/radio.js +0 -9
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { internals, replaceStates } from './internals-attached.js';
|
|
4
|
+
import { updateInternals } from '../button.js';
|
|
5
|
+
const PROPERTY_FROM_ARIA_PRESSED = {
|
|
6
|
+
true: 'checked',
|
|
7
|
+
false: 'unchecked',
|
|
8
|
+
};
|
|
9
|
+
export const ButtonToggleMixin = (superClass) => {
|
|
10
|
+
class ButtonToggle extends superClass {
|
|
11
|
+
constructor(...args) {
|
|
12
|
+
super();
|
|
13
|
+
this.checked = false;
|
|
14
|
+
/**
|
|
15
|
+
* --> Drag-and-drop to the other side
|
|
16
|
+
*
|
|
17
|
+
* `checked` is supposed to be changed once
|
|
18
|
+
*
|
|
19
|
+
* 1. `pointerdown`: _ignoreClick = false
|
|
20
|
+
* 2. `pointermove`: _ignoreClick = true
|
|
21
|
+
* 3. `pointerup`: `checked` changed
|
|
22
|
+
* 4. `click`: ignored, _ignoreClick = false
|
|
23
|
+
*
|
|
24
|
+
* --> Drag-and-drop to the other side, then click
|
|
25
|
+
*
|
|
26
|
+
* `checked` is supposed to be changed twice
|
|
27
|
+
*
|
|
28
|
+
* 1. `pointerdown`: _ignoreClick = false
|
|
29
|
+
* 2. `pointermove`: _ignoreClick = true
|
|
30
|
+
* 3. `pointerup`: `checked` changed(1)
|
|
31
|
+
* 4. `click`: ignored, _ignoreClick = false
|
|
32
|
+
* 5. `click`: `checked` changed(2)
|
|
33
|
+
*
|
|
34
|
+
* --> Drag-and-drop to the other side, then click the label
|
|
35
|
+
*
|
|
36
|
+
* `checked` is supposed to be changed twice
|
|
37
|
+
*
|
|
38
|
+
* 1. `pointerdown`: _ignoreClick = false
|
|
39
|
+
* 2. `pointermove`: _ignoreClick = true
|
|
40
|
+
* 3. `pointerup`: `checked` changed(1)
|
|
41
|
+
* 4. `click` on label: _ignoreClick = false
|
|
42
|
+
* 5. `click` on switch: `checked` changed(2)
|
|
43
|
+
*/
|
|
44
|
+
this._ignoreClick = false;
|
|
45
|
+
this.checked = this.hasAttribute('checked');
|
|
46
|
+
}
|
|
47
|
+
connectedCallback() {
|
|
48
|
+
super.connectedCallback();
|
|
49
|
+
this.labels.forEach((label) => {
|
|
50
|
+
label.addEventListener('click', this.#handleLabelClick);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
disconnectedCallback() {
|
|
54
|
+
this.labels.forEach((label) => {
|
|
55
|
+
label.removeEventListener('click', this.#handleLabelClick);
|
|
56
|
+
});
|
|
57
|
+
super.disconnectedCallback();
|
|
58
|
+
}
|
|
59
|
+
updated(changed) {
|
|
60
|
+
if (changed.has('checked'))
|
|
61
|
+
this[updateInternals]();
|
|
62
|
+
}
|
|
63
|
+
[updateInternals]() {
|
|
64
|
+
super[updateInternals]();
|
|
65
|
+
this[internals].ariaPressed = this.checked ? 'true' : 'false';
|
|
66
|
+
this[replaceStates](['unchecked', 'checked'], [PROPERTY_FROM_ARIA_PRESSED[this[internals].ariaPressed]]);
|
|
67
|
+
this[internals].setFormValue(this.checked ? 'on' : null);
|
|
68
|
+
}
|
|
69
|
+
#handleLabelClick() {
|
|
70
|
+
this._ignoreClick = false;
|
|
71
|
+
}
|
|
72
|
+
_handleClick(e) {
|
|
73
|
+
e.stopPropagation();
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
if (this._ignoreClick) {
|
|
76
|
+
this._ignoreClick = false;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this._toggle();
|
|
80
|
+
}
|
|
81
|
+
_toggle() {
|
|
82
|
+
if (this.disabled)
|
|
83
|
+
return;
|
|
84
|
+
this.checked = !this.checked;
|
|
85
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
86
|
+
bubbles: true,
|
|
87
|
+
composed: true,
|
|
88
|
+
detail: this.checked,
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
formResetCallback() {
|
|
92
|
+
this.checked = this.hasAttribute('checked');
|
|
93
|
+
}
|
|
94
|
+
formStateRestoreCallback(state, _reason) {
|
|
95
|
+
this.checked = state === 'on';
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
__decorate([
|
|
99
|
+
property({ type: Boolean })
|
|
100
|
+
], ButtonToggle.prototype, "checked", void 0);
|
|
101
|
+
return ButtonToggle;
|
|
102
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
export declare const internals: unique symbol;
|
|
3
|
+
export declare const replaceStates: unique symbol;
|
|
3
4
|
export declare class InternalsAttachedInterface {
|
|
4
5
|
[internals]: ElementInternals;
|
|
6
|
+
[replaceStates](del: Array<string>, add: Array<string>): void;
|
|
5
7
|
}
|
|
6
8
|
export declare const InternalsAttached: <T extends Constructor<LitElement>>(superClass: T) => Constructor<InternalsAttachedInterface> & T;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const internals = Symbol('internals');
|
|
2
2
|
const privateInternals = Symbol('privateInternals');
|
|
3
|
+
export const replaceStates = Symbol('replaceStates');
|
|
3
4
|
export const InternalsAttached = (superClass) => {
|
|
4
5
|
class InternalsAttachedElement extends superClass {
|
|
5
6
|
get [internals]() {
|
|
@@ -8,6 +9,10 @@ export const InternalsAttached = (superClass) => {
|
|
|
8
9
|
}
|
|
9
10
|
return this[privateInternals];
|
|
10
11
|
}
|
|
12
|
+
[replaceStates](del, add) {
|
|
13
|
+
del.forEach((state) => this[internals].states.delete(state));
|
|
14
|
+
add.forEach((state) => this[internals].states.add(state));
|
|
15
|
+
}
|
|
11
16
|
}
|
|
12
17
|
return InternalsAttachedElement;
|
|
13
18
|
};
|
|
@@ -1,47 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
constructor();
|
|
8
|
-
connectedCallback(): void;
|
|
9
|
-
disconnectedCallback(): void;
|
|
10
|
-
protected updated(changed: Map<string, any>): void;
|
|
11
|
-
protected _updateInternals(): void;
|
|
12
|
-
/**
|
|
13
|
-
* --> Drag-and-drop to the other side
|
|
14
|
-
*
|
|
15
|
-
* `checked` is supposed to be changed once
|
|
16
|
-
*
|
|
17
|
-
* 1. `pointerdown`: _ignoreClick = false
|
|
18
|
-
* 2. `pointermove`: _ignoreClick = true
|
|
19
|
-
* 3. `pointerup`: `checked` changed
|
|
20
|
-
* 4. `click`: ignored, _ignoreClick = false
|
|
21
|
-
*
|
|
22
|
-
* --> Drag-and-drop to the other side, then click
|
|
23
|
-
*
|
|
24
|
-
* `checked` is supposed to be changed twice
|
|
25
|
-
*
|
|
26
|
-
* 1. `pointerdown`: _ignoreClick = false
|
|
27
|
-
* 2. `pointermove`: _ignoreClick = true
|
|
28
|
-
* 3. `pointerup`: `checked` changed(1)
|
|
29
|
-
* 4. `click`: ignored, _ignoreClick = false
|
|
30
|
-
* 5. `click`: `checked` changed(2)
|
|
31
|
-
*
|
|
32
|
-
* --> Drag-and-drop to the other side, then click the label
|
|
33
|
-
*
|
|
34
|
-
* `checked` is supposed to be changed twice
|
|
35
|
-
*
|
|
36
|
-
* 1. `pointerdown`: _ignoreClick = false
|
|
37
|
-
* 2. `pointermove`: _ignoreClick = true
|
|
38
|
-
* 3. `pointerup`: `checked` changed(1)
|
|
39
|
-
* 4. `click` on label: _ignoreClick = false
|
|
40
|
-
* 5. `click` on switch: `checked` changed(2)
|
|
41
|
-
*/
|
|
42
|
-
protected _ignoreClick: boolean;
|
|
43
|
-
protected toggleChecked(): void;
|
|
44
|
-
formResetCallback(): void;
|
|
45
|
-
formStateRestoreCallback(state: string, _reason: string): void;
|
|
1
|
+
import { Button } from './button.js';
|
|
2
|
+
declare const ToggleButton_base: Constructor<import("./mixins/button-toggle-mixin.js").ToggleableInterface> & typeof Button;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated compose the mixins yourself instead
|
|
5
|
+
*/
|
|
6
|
+
export declare class ToggleButton extends ToggleButton_base {
|
|
46
7
|
}
|
|
47
8
|
export {};
|
|
@@ -1,136 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const PROPERTY_FROM_ARIA_PRESSED = {
|
|
8
|
-
true: 'checked',
|
|
9
|
-
false: 'unchecked',
|
|
10
|
-
};
|
|
11
|
-
const Base = FormAssociated(InternalsAttached(LitElement));
|
|
12
|
-
export class ToggleButton extends Base {
|
|
13
|
-
static { this.styles = [hiddenStyles]; }
|
|
14
|
-
constructor() {
|
|
15
|
-
super();
|
|
16
|
-
this.checked = false;
|
|
17
|
-
/**
|
|
18
|
-
* --> Drag-and-drop to the other side
|
|
19
|
-
*
|
|
20
|
-
* `checked` is supposed to be changed once
|
|
21
|
-
*
|
|
22
|
-
* 1. `pointerdown`: _ignoreClick = false
|
|
23
|
-
* 2. `pointermove`: _ignoreClick = true
|
|
24
|
-
* 3. `pointerup`: `checked` changed
|
|
25
|
-
* 4. `click`: ignored, _ignoreClick = false
|
|
26
|
-
*
|
|
27
|
-
* --> Drag-and-drop to the other side, then click
|
|
28
|
-
*
|
|
29
|
-
* `checked` is supposed to be changed twice
|
|
30
|
-
*
|
|
31
|
-
* 1. `pointerdown`: _ignoreClick = false
|
|
32
|
-
* 2. `pointermove`: _ignoreClick = true
|
|
33
|
-
* 3. `pointerup`: `checked` changed(1)
|
|
34
|
-
* 4. `click`: ignored, _ignoreClick = false
|
|
35
|
-
* 5. `click`: `checked` changed(2)
|
|
36
|
-
*
|
|
37
|
-
* --> Drag-and-drop to the other side, then click the label
|
|
38
|
-
*
|
|
39
|
-
* `checked` is supposed to be changed twice
|
|
40
|
-
*
|
|
41
|
-
* 1. `pointerdown`: _ignoreClick = false
|
|
42
|
-
* 2. `pointermove`: _ignoreClick = true
|
|
43
|
-
* 3. `pointerup`: `checked` changed(1)
|
|
44
|
-
* 4. `click` on label: _ignoreClick = false
|
|
45
|
-
* 5. `click` on switch: `checked` changed(2)
|
|
46
|
-
*/
|
|
47
|
-
this._ignoreClick = false;
|
|
48
|
-
this.#handleLabelClick = () => {
|
|
49
|
-
this._ignoreClick = false;
|
|
50
|
-
};
|
|
51
|
-
this.#handleClick = (e) => {
|
|
52
|
-
e.stopPropagation();
|
|
53
|
-
e.preventDefault();
|
|
54
|
-
if (this._ignoreClick) {
|
|
55
|
-
this._ignoreClick = false;
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
this.toggleChecked();
|
|
59
|
-
};
|
|
60
|
-
this.#handleKeyDown = (e) => {
|
|
61
|
-
if (e.key !== ' ' && e.key !== 'Enter')
|
|
62
|
-
return;
|
|
63
|
-
e.preventDefault();
|
|
64
|
-
e.stopPropagation();
|
|
65
|
-
if (e.key === 'Enter')
|
|
66
|
-
this.toggleChecked();
|
|
67
|
-
};
|
|
68
|
-
this.#handleKeyUp = (e) => {
|
|
69
|
-
if (e.key === ' ') {
|
|
70
|
-
e.preventDefault();
|
|
71
|
-
e.stopPropagation();
|
|
72
|
-
this.toggleChecked();
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
this[internals].role = 'button';
|
|
76
|
-
this.checked = this.hasAttribute('checked');
|
|
77
|
-
this._updateInternals();
|
|
78
|
-
this.setAttribute('notransition', '');
|
|
79
|
-
}
|
|
80
|
-
connectedCallback() {
|
|
81
|
-
super.connectedCallback();
|
|
82
|
-
this.addEventListener('click', this.#handleClick);
|
|
83
|
-
this.addEventListener('keydown', this.#handleKeyDown);
|
|
84
|
-
this.addEventListener('keyup', this.#handleKeyUp);
|
|
85
|
-
this.labels.forEach((label) => {
|
|
86
|
-
label.addEventListener('click', this.#handleLabelClick);
|
|
87
|
-
});
|
|
88
|
-
requestAnimationFrame(() => requestAnimationFrame(() => this.removeAttribute('notransition')));
|
|
89
|
-
}
|
|
90
|
-
disconnectedCallback() {
|
|
91
|
-
this.removeEventListener('click', this.#handleClick);
|
|
92
|
-
this.removeEventListener('keydown', this.#handleKeyDown);
|
|
93
|
-
this.removeEventListener('keyup', this.#handleKeyUp);
|
|
94
|
-
this.labels.forEach((label) => {
|
|
95
|
-
label.removeEventListener('click', this.#handleLabelClick);
|
|
96
|
-
});
|
|
97
|
-
super.disconnectedCallback();
|
|
98
|
-
}
|
|
99
|
-
updated(changed) {
|
|
100
|
-
if (changed.has('checked') || changed.has('disabled')) {
|
|
101
|
-
this._updateInternals();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
_updateInternals() {
|
|
105
|
-
this[internals].states.delete('unchecked');
|
|
106
|
-
this[internals].states.delete('checked');
|
|
107
|
-
this[internals].ariaPressed = this.checked ? 'true' : 'false';
|
|
108
|
-
this[internals].states.add(`${PROPERTY_FROM_ARIA_PRESSED[this[internals].ariaPressed]}`);
|
|
109
|
-
this.setAttribute('tabindex', this.disabled ? '-1' : '0');
|
|
110
|
-
this[internals].ariaDisabled = this.disabled ? 'true' : 'false';
|
|
111
|
-
this[internals].setFormValue(this.checked ? 'on' : null);
|
|
112
|
-
}
|
|
113
|
-
#handleLabelClick;
|
|
114
|
-
#handleClick;
|
|
115
|
-
#handleKeyDown;
|
|
116
|
-
#handleKeyUp;
|
|
117
|
-
toggleChecked() {
|
|
118
|
-
if (this.disabled)
|
|
119
|
-
return;
|
|
120
|
-
this.checked = !this.checked;
|
|
121
|
-
this.dispatchEvent(new CustomEvent('change', {
|
|
122
|
-
bubbles: true,
|
|
123
|
-
composed: true,
|
|
124
|
-
detail: this.checked,
|
|
125
|
-
}));
|
|
126
|
-
}
|
|
127
|
-
formResetCallback() {
|
|
128
|
-
this.checked = this.hasAttribute('checked');
|
|
129
|
-
}
|
|
130
|
-
formStateRestoreCallback(state, _reason) {
|
|
131
|
-
this.checked = state === 'on';
|
|
132
|
-
}
|
|
1
|
+
import { Button } from './button.js';
|
|
2
|
+
import { ButtonToggleMixin } from './mixins/button-toggle-mixin.js';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated compose the mixins yourself instead
|
|
5
|
+
*/
|
|
6
|
+
export class ToggleButton extends ButtonToggleMixin(Button) {
|
|
133
7
|
}
|
|
134
|
-
__decorate([
|
|
135
|
-
property({ type: Boolean })
|
|
136
|
-
], ToggleButton.prototype, "checked", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ensureReady(element: HTMLElement): Promise<HTMLElement>;
|
|
@@ -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
|
+
}
|
|
@@ -2,6 +2,7 @@ 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
|
/**
|
|
7
8
|
* TODO: Check if manually dispatching input/change events on input is necessary
|
package/src/m3/badge/badge.d.ts
CHANGED
package/src/m3/badge/badge.js
CHANGED
|
@@ -7,6 +7,7 @@ let M3Badge = class M3Badge extends LitElement {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
9
|
this.showZero = false;
|
|
10
|
+
this.small = false;
|
|
10
11
|
this.left = false;
|
|
11
12
|
this.bottom = false;
|
|
12
13
|
}
|
|
@@ -32,6 +33,9 @@ __decorate([
|
|
|
32
33
|
__decorate([
|
|
33
34
|
property({ type: Boolean, reflect: true, attribute: 'show-zero' })
|
|
34
35
|
], M3Badge.prototype, "showZero", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
property({ type: Boolean, reflect: true })
|
|
38
|
+
], M3Badge.prototype, "small", void 0);
|
|
35
39
|
__decorate([
|
|
36
40
|
property({ type: Boolean, reflect: true })
|
|
37
41
|
], M3Badge.prototype, "left", void 0);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ToggleButton } from '../../base/toggle-button.js';
|
|
2
1
|
import '../focus-ring/focus-ring.js';
|
|
3
2
|
import '../ripple/ripple.js';
|
|
3
|
+
import { M3Button } from './common-button.js';
|
|
4
|
+
declare const M3ButtonToggle_base: Constructor<import("../../base/mixins/button-toggle-mixin.js").ToggleableInterface> & typeof M3Button;
|
|
4
5
|
/**
|
|
5
6
|
* @tag md-button-toggle
|
|
6
7
|
*
|
|
@@ -12,15 +13,7 @@ import '../ripple/ripple.js';
|
|
|
12
13
|
* @slot - label
|
|
13
14
|
* @slot icon - leading icon
|
|
14
15
|
*/
|
|
15
|
-
export declare class M3ButtonToggle extends
|
|
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;
|
|
16
|
+
export declare class M3ButtonToggle extends M3ButtonToggle_base {
|
|
24
17
|
static styles: any[];
|
|
25
18
|
render(): import("lit-html").TemplateResult<1>;
|
|
26
19
|
}
|
|
@@ -29,3 +22,4 @@ declare global {
|
|
|
29
22
|
'md-button-toggle': M3ButtonToggle;
|
|
30
23
|
}
|
|
31
24
|
}
|
|
25
|
+
export {};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import { ToggleButton } from '../../base/toggle-button.js';
|
|
5
2
|
import '../focus-ring/focus-ring.js';
|
|
6
3
|
import '../ripple/ripple.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { html } from 'lit';
|
|
5
|
+
import { customElement } from 'lit/decorators.js';
|
|
6
|
+
import { M3Button } from './common-button.js';
|
|
7
|
+
import { ButtonToggleMixin } from '../../base/mixins/button-toggle-mixin.js';
|
|
9
8
|
import { sharedButtonToggleStyles } from './shared-button-toggle-styles.css.js';
|
|
10
|
-
import { commonButtonStyles } from './common-button-styles.css.js';
|
|
11
9
|
/**
|
|
12
10
|
* @tag md-button-toggle
|
|
13
11
|
*
|
|
@@ -19,44 +17,12 @@ import { commonButtonStyles } from './common-button-styles.css.js';
|
|
|
19
17
|
* @slot - label
|
|
20
18
|
* @slot icon - leading icon
|
|
21
19
|
*/
|
|
22
|
-
let M3ButtonToggle = class M3ButtonToggle extends
|
|
23
|
-
|
|
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;
|
|
33
|
-
}
|
|
34
|
-
static { this.styles = [
|
|
35
|
-
...super.styles,
|
|
36
|
-
targetStyles,
|
|
37
|
-
sharedButtonStyles,
|
|
38
|
-
sharedButtonToggleStyles,
|
|
39
|
-
commonButtonStyles,
|
|
40
|
-
]; }
|
|
20
|
+
let M3ButtonToggle = class M3ButtonToggle extends ButtonToggleMixin(M3Button) {
|
|
21
|
+
static { this.styles = [...super.styles, sharedButtonToggleStyles]; }
|
|
41
22
|
render() {
|
|
42
23
|
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>`;
|
|
43
24
|
}
|
|
44
25
|
};
|
|
45
|
-
__decorate([
|
|
46
|
-
property({ reflect: true })
|
|
47
|
-
], M3ButtonToggle.prototype, "size", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
property({ reflect: true, type: Boolean })
|
|
50
|
-
], M3ButtonToggle.prototype, "square", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
property({ reflect: true })
|
|
53
|
-
], M3ButtonToggle.prototype, "color", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
property({ reflect: true })
|
|
56
|
-
], M3ButtonToggle.prototype, "variant", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
property({ type: Boolean, reflect: true, attribute: 'trailing-icon' })
|
|
59
|
-
], M3ButtonToggle.prototype, "trailingIcon", void 0);
|
|
60
26
|
M3ButtonToggle = __decorate([
|
|
61
27
|
customElement('md-button-toggle')
|
|
62
28
|
], M3ButtonToggle);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ToggleButton } from '../../base/toggle-button.js';
|
|
2
1
|
import '../focus-ring/focus-ring.js';
|
|
3
2
|
import '../ripple/ripple.js';
|
|
3
|
+
import { M3IconButton } from './icon-button.js';
|
|
4
|
+
declare const M3IconButtonToggle_base: Constructor<import("../../base/mixins/button-toggle-mixin.js").ToggleableInterface> & typeof M3IconButton;
|
|
4
5
|
/**
|
|
5
6
|
* @tag md-icon-button-toggle
|
|
6
7
|
*
|
|
@@ -9,16 +10,13 @@ import '../ripple/ripple.js';
|
|
|
9
10
|
* @slot - icon
|
|
10
11
|
* @slot checked - icon when checked
|
|
11
12
|
*/
|
|
12
|
-
export declare class M3IconButtonToggle extends
|
|
13
|
+
export declare class M3IconButtonToggle extends M3IconButtonToggle_base {
|
|
13
14
|
static styles: any[];
|
|
14
15
|
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
16
|
}
|
|
20
17
|
declare global {
|
|
21
18
|
interface HTMLElementTagNameMap {
|
|
22
19
|
'md-icon-button-toggle': M3IconButtonToggle;
|
|
23
20
|
}
|
|
24
21
|
}
|
|
22
|
+
export {};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import { ToggleButton } from '../../base/toggle-button.js';
|
|
5
2
|
import '../focus-ring/focus-ring.js';
|
|
6
3
|
import '../ripple/ripple.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { html } from 'lit';
|
|
5
|
+
import { customElement } from 'lit/decorators.js';
|
|
6
|
+
import { M3IconButton } from './icon-button.js';
|
|
7
|
+
import { ButtonToggleMixin } from '../../base/mixins/button-toggle-mixin.js';
|
|
9
8
|
import { sharedButtonToggleStyles } from './shared-button-toggle-styles.css.js';
|
|
10
|
-
import { iconButtonStyles } from './icon-button-styles.css.js';
|
|
11
9
|
/**
|
|
12
10
|
* @tag md-icon-button-toggle
|
|
13
11
|
*
|
|
@@ -16,37 +14,12 @@ import { iconButtonStyles } from './icon-button-styles.css.js';
|
|
|
16
14
|
* @slot - icon
|
|
17
15
|
* @slot checked - icon when checked
|
|
18
16
|
*/
|
|
19
|
-
let M3IconButtonToggle = class M3IconButtonToggle extends
|
|
20
|
-
|
|
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
|
-
sharedButtonToggleStyles,
|
|
32
|
-
iconButtonStyles,
|
|
33
|
-
]; }
|
|
17
|
+
let M3IconButtonToggle = class M3IconButtonToggle extends ButtonToggleMixin(M3IconButton) {
|
|
18
|
+
static { this.styles = [...super.styles, sharedButtonToggleStyles]; }
|
|
34
19
|
render() {
|
|
35
20
|
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>`;
|
|
36
21
|
}
|
|
37
22
|
};
|
|
38
|
-
__decorate([
|
|
39
|
-
property({ reflect: true })
|
|
40
|
-
], M3IconButtonToggle.prototype, "size", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
property({ reflect: true })
|
|
43
|
-
], M3IconButtonToggle.prototype, "color", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
property({ reflect: true })
|
|
46
|
-
], M3IconButtonToggle.prototype, "variant", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
property({ reflect: true })
|
|
49
|
-
], M3IconButtonToggle.prototype, "width", void 0);
|
|
50
23
|
M3IconButtonToggle = __decorate([
|
|
51
24
|
customElement('md-icon-button-toggle')
|
|
52
25
|
], M3IconButtonToggle);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const sharedButtonStyles = css`@layer common-button,icon-button;@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;--_text-color:var(--_on-color);--_background-color:var(--_color);box-sizing:border-box;cursor:pointer;height: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;justify-content:center;align-items:center;display:inline-flex;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);--_text-color:var(--md-sys-color-on-secondary-container)}:host([variant=outlined]){--_background-color:transparent;--_text-color:var(--md-sys-color-on-surface-variant);--md-focus-ring-offset:3px;border-color:color-mix(in srgb, var(--md-sys-color-outline-variant) 100%, transparent);border-style:solid;border-width:1px}:host([variant=text]){--_text-color:var(--_color);--_background-color:transparent!important}:host([square]){--md-focus-ring-shape:var(--_rs);border-radius:var(--_rs)}}@layer shared-toggle,override;@layer active{:host(:active){--md-focus-ring-shape:var(--_rp);border-radius:var(--_rp)}}@layer disabled{:host([variant=outlined]:disabled){--_background-color:var(--md-sys-color-outline)}:host(:disabled),:host([variant=outlined]:state(checked):disabled){--_background-color:var(--md-sys-color-on-surface);--_background-opacity:10%;--_text-color:var(--md-sys-color-on-surface);--_text-opacity:38%;border-color:color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);box-shadow:none;pointer-events:none}}`;
|
|
2
|
+
export const sharedButtonStyles = css`@layer common-button,icon-button;@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;--_text-color:var(--_on-color);--_background-color:var(--_color);box-sizing:border-box;cursor:pointer;height: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;justify-content:center;align-items:center;display:inline-flex;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);--_text-color:var(--md-sys-color-on-secondary-container)}:host([variant=outlined]){--_background-color:transparent;--_text-color:var(--md-sys-color-on-surface-variant);--md-focus-ring-offset:3px;border-color:color-mix(in srgb, var(--md-sys-color-outline-variant) 100%, transparent);border-style:solid;border-width:1px}:host([variant=text]){--_text-color:var(--_color);--_background-color:transparent!important}: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:var(--md-sys-color-outline)}:host(:disabled),:host([variant=outlined]:state(checked):disabled){--_background-color:var(--md-sys-color-on-surface);--_background-opacity:10%;--_text-color:var(--md-sys-color-on-surface);--_text-opacity:38%;border-color:color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);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))){--_background-color:var(--md-sys-color-surface-container);--_text-color:var(--md-sys-color-on-surface-variant)}:host([variant=tonal]:not(:state(checked))){--_background-color:var(--md-sys-color-surface-container-highest);--_text-color:var(--md-sys-color-on-surface-variant)}:host([variant=outlined]:state(checked)){--_background-color:var(--md-sys-color-inverse-surface);--_text-color:var(--md-sys-color-inverse-on-surface);border-width:0}}`;
|
|
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);--_text-color:var(--md-sys-color-on-surface-variant)}:host([variant=tonal]:not(:state(checked))){--_background-color:var(--md-sys-color-surface-container-highest);--_text-color:var(--md-sys-color-on-surface-variant)}:host([variant=outlined]:state(checked)){--_background-color:var(--md-sys-color-inverse-surface);--_text-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 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;margin:15px;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}`;
|
|
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;margin:15px;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}}`;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const dialogStyles = css`dialog{background:0 0;border:none;outline:0;min-width:280px;max-width:min(560px,100% - 48px);min-height:140px;max-height:min(560px,100% - 48px);padding:0;overflow:visible}dialog[open]{display:flex}dialog::backdrop{background:0 0}[part=container]{box-sizing:border-box;will-change:height, transform, opacity;background-color:var(--md-sys-color-surface-container-high);border-radius:28px;flex-direction:column;flex-grow:1;padding-top:8px;display:flex;position:relative;overflow:hidden}[part=headline]{flex-direction:column;display:flex}::slotted([slot=icon]){block-size:1em;color:var(--md-sys-color-secondary);fill:currentColor;inline-size:1em;margin:16px 0 0;font-size:24px}::slotted([slot=headline]){box-sizing:border-box;font:var(--md-sys-typography-headline-small);color:var(--md-sys-color-on-surface);margin:0;padding:16px 24px 0}[part=headline].has-icon{align-items:center}[part=content]{color:var(--md-sys-color-on-surface-variant);font:var(--md-sys-typography-body-medium);will-change:opacity;padding:16px 24px 0;display:block}[part=actions]{justify-content:flex-end;gap:8px;display:flex;position:absolute;bottom:0;left:0;right:0}slot[name=actions]::slotted(*){box-sizing:border-box;justify-content:flex-end;gap:8px;padding:24px;display:flex}[part=scrim]{background:var(--md-sys-color-scrim);opacity:.32;pointer-events:none;z-index:1;display:none;position:fixed;inset:0}dialog[open]+[part=scrim]{display:block}`;
|
|
2
|
+
export const dialogStyles = css`dialog{background:0 0;border:none;outline:0;min-width:280px;max-width:min(560px,100% - 48px);min-height:140px;max-height:min(560px,100% - 48px);padding:0;overflow:visible}dialog[open]{display:flex}dialog::backdrop{background:0 0}[part=container]{box-sizing:border-box;will-change:height, transform, opacity;background-color:var(--md-sys-color-surface-container-high);border-radius:28px;flex-direction:column;flex-grow:1;padding-top:8px;display:flex;position:relative;overflow:hidden}[part=headline]{flex-direction:column;display:flex}::slotted([slot=icon]){block-size:1em;color:var(--md-sys-color-secondary);fill:currentColor;inline-size:1em;margin:16px 0 0;font-size:24px}::slotted([slot=headline]){box-sizing:border-box;font:var(--md-sys-typography-headline-small);color:var(--md-sys-color-on-surface);margin:0;padding:16px 24px 0}[part=headline].has-icon{align-items:center}[part=content]{color:var(--md-sys-color-on-surface-variant);font:var(--md-sys-typography-body-medium);will-change:opacity;padding:16px 24px 0;display:block}[part=actions]{justify-content:flex-end;gap:8px;display:flex;position:absolute;bottom:0;left:0;right:0}slot[name=actions]::slotted(*){box-sizing:border-box;justify-content:flex-end;gap:8px;padding:24px;display:flex}[part=scrim]{background:var(--md-sys-color-scrim);opacity:.32;pointer-events:none;z-index:1;display:none;position:fixed;inset:0}dialog[open]+[part=scrim]{display:block}@media (forced-colors:active){[part=container]{outline:2px solid windowtext}}`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const popupStyles = css`:host{background:var(--md-sys-color-surface-container);box-shadow:var(--md-sys-elevation-shadow-2);color:var(--md-sys-color-on-surface);opacity:0;transition:opacity var(--md-sys-motion-effects-fast-duration), transform var(--md-sys-motion-spatial-fast-duration) var(--md-sys-motion-spatial-fast), display var(--md-sys-motion-spatial-default-duration) allow-discrete, overlay var(--md-sys-motion-spatial-default-duration) allow-discrete;border-radius:16px;transform:scaleY(.35)}slot{opacity:0;transition:opacity 67ms}:host(:popover-open){opacity:1;transition:opacity 67ms linear, transform var(--md-sys-motion-spatial-default-duration) var(--md-sys-motion-spatial-default);transform:scaleY(1);& slot{opacity:1;transition:opacity 67ms linear 67ms}}@starting-style{:host(:popover-open){opacity:0;transform:scaleY(.35);& slot{opacity:0}}}`;
|