@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
package/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@vollowx/seele)
|
|
4
4
|
[](https://builds.sr.ht/~lucaz/seele?)
|
|
5
|
-
[](https://www.webcomponents.org/element/@vollowx/seele)
|
|
6
5
|
|
|
7
6
|
[https://tideover.cc/seele/](https://tideover.cc/seele/)
|
|
8
7
|
[docs/](https://tideover.cc/seele/docs/)
|
|
@@ -74,7 +73,11 @@ It is 2026 now, so you don't really need to worry about this. However, in the
|
|
|
74
73
|
future, the following web features might be used and require higher browser
|
|
75
74
|
versions:
|
|
76
75
|
|
|
77
|
-
|
|
76
|
+
| feature | benefits | baseline | Chromium | Firefox | Safari |
|
|
77
|
+
| --- | --- | :---: | :---: | :---: | :---: |
|
|
78
|
+
| [`anchor()`][anchor] | remove the dependency `floating-dom` | 2026 | - | 147 | 26 |
|
|
79
|
+
| [`alpha()`][alpha] | replace `oklch()` | 2026 | 151 | 155 | 27 |
|
|
80
|
+
| [focusgroup][focusgroup] | replace roving focus code | not yet | 150 | not yet | not yet |
|
|
78
81
|
|
|
79
82
|
_* omitting a specific browser version means using that standard does not raise
|
|
80
83
|
the minimum required version of seele_
|
|
@@ -97,3 +100,5 @@ the minimum required version of seele_
|
|
|
97
100
|
[popover-api]: https://developer.mozilla.org/en-US/docs/Web/API/Popover_API
|
|
98
101
|
[starting-style]: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@starting-style
|
|
99
102
|
[anchor]: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/anchor
|
|
103
|
+
[alpha]: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/color_value/alpha
|
|
104
|
+
[focusgroup]: https://open-ui.org/components/focusgroup-v2.explainer/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vollowx/seele",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.4",
|
|
4
4
|
"description": "An extensible Web Components library, with Material 3 components pre-provided.",
|
|
5
5
|
"author": "vollowx",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"note": "echo 'tsc must be called after build:css since it completes missing *-styles.css.js'",
|
|
43
43
|
|
|
44
44
|
"dev": "web-dev-server",
|
|
45
|
-
"dev:css": "
|
|
46
|
-
"build": "
|
|
47
|
-
"build:css": "
|
|
45
|
+
"dev:css": "node scripts/convert-css.ts --watch",
|
|
46
|
+
"build": "pnpm run build:css && tsc && node scripts/minify-html-literals.ts",
|
|
47
|
+
"build:css": "node scripts/convert-css.ts --minify",
|
|
48
48
|
"clean": "./scripts/clean.sh",
|
|
49
|
-
"prepublishOnly": "
|
|
49
|
+
"prepublishOnly": "pnpm clean && pnpm run build",
|
|
50
50
|
"format": "prettier . --check",
|
|
51
51
|
"format:write": "prettier . --check --write",
|
|
52
52
|
"cem": "cem analyze --litelement --globs './src/m3/**/*.ts'"
|
package/src/all.d.ts
CHANGED
|
@@ -2,8 +2,10 @@ import './m3/autocomplete/autocomplete.js';
|
|
|
2
2
|
import './m3/badge/badge.js';
|
|
3
3
|
import './m3/button/common-button.js';
|
|
4
4
|
import './m3/button/common-button-toggle.js';
|
|
5
|
+
import './m3/button/common-button-link.js';
|
|
5
6
|
import './m3/button/icon-button.js';
|
|
6
7
|
import './m3/button/icon-button-toggle.js';
|
|
8
|
+
import './m3/button/icon-button-link.js';
|
|
7
9
|
import './m3/button-group/standard-button-group.js';
|
|
8
10
|
import './m3/button-group/connected-button-group.js';
|
|
9
11
|
import './m3/checkbox/checkbox.js';
|
|
@@ -21,6 +23,7 @@ import './m3/menu/composed-menu.js';
|
|
|
21
23
|
import './m3/navigation/navigation-rail.js';
|
|
22
24
|
import './m3/navigation/navigation-rail-item.js';
|
|
23
25
|
import './m3/popup/popup.js';
|
|
26
|
+
import './m3/progress/circular-progress.js';
|
|
24
27
|
import './m3/progress/linear-progress.js';
|
|
25
28
|
import './m3/radio/radio.js';
|
|
26
29
|
import './m3/ripple/ripple.js';
|
package/src/all.js
CHANGED
|
@@ -2,8 +2,10 @@ import './m3/autocomplete/autocomplete.js';
|
|
|
2
2
|
import './m3/badge/badge.js';
|
|
3
3
|
import './m3/button/common-button.js';
|
|
4
4
|
import './m3/button/common-button-toggle.js';
|
|
5
|
+
import './m3/button/common-button-link.js';
|
|
5
6
|
import './m3/button/icon-button.js';
|
|
6
7
|
import './m3/button/icon-button-toggle.js';
|
|
8
|
+
import './m3/button/icon-button-link.js';
|
|
7
9
|
import './m3/button-group/standard-button-group.js';
|
|
8
10
|
import './m3/button-group/connected-button-group.js';
|
|
9
11
|
import './m3/checkbox/checkbox.js';
|
|
@@ -21,6 +23,7 @@ import './m3/menu/composed-menu.js';
|
|
|
21
23
|
import './m3/navigation/navigation-rail.js';
|
|
22
24
|
import './m3/navigation/navigation-rail-item.js';
|
|
23
25
|
import './m3/popup/popup.js';
|
|
26
|
+
import './m3/progress/circular-progress.js';
|
|
24
27
|
import './m3/progress/linear-progress.js';
|
|
25
28
|
import './m3/radio/radio.js';
|
|
26
29
|
import './m3/ripple/ripple.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
declare const Base: Constructor<import("./mixins/focus-delegated.js").FocusDelegatedInterface> & Constructor<import("./mixins/internals-attached.js").InternalsAttachedInterface> & typeof LitElement;
|
|
3
|
+
export declare class Anchor extends Base {
|
|
4
|
+
href: string;
|
|
5
|
+
target: string;
|
|
6
|
+
rel: string;
|
|
7
|
+
/**
|
|
8
|
+
* `null` when the attribute is absent, `''` when the attribute is present
|
|
9
|
+
* but empty, in which case the browser suggests a filename, just like a
|
|
10
|
+
* native `<a>`.
|
|
11
|
+
*/
|
|
12
|
+
download: string | null;
|
|
13
|
+
hreflang: string;
|
|
14
|
+
referrerpolicy: string;
|
|
15
|
+
ping: Array<string>;
|
|
16
|
+
$anchor: HTMLAnchorElement | null;
|
|
17
|
+
static styles: any[];
|
|
18
|
+
_renderAnchor(content: unknown): import("lit").TemplateResult<1>;
|
|
19
|
+
click(): void;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement, nothing } from 'lit';
|
|
3
|
+
import { property, query } from 'lit/decorators.js';
|
|
4
|
+
import { FocusDelegated } from './mixins/focus-delegated.js';
|
|
5
|
+
import { InternalsAttached } from './mixins/internals-attached.js';
|
|
6
|
+
import { hiddenStyles } from './hidden-styles.css.js';
|
|
7
|
+
const Base = FocusDelegated(InternalsAttached(LitElement));
|
|
8
|
+
export class Anchor extends Base {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.href = '';
|
|
12
|
+
this.target = '';
|
|
13
|
+
this.rel = '';
|
|
14
|
+
/**
|
|
15
|
+
* `null` when the attribute is absent, `''` when the attribute is present
|
|
16
|
+
* but empty, in which case the browser suggests a filename, just like a
|
|
17
|
+
* native `<a>`.
|
|
18
|
+
*/
|
|
19
|
+
this.download = null;
|
|
20
|
+
this.hreflang = '';
|
|
21
|
+
this.referrerpolicy = '';
|
|
22
|
+
this.ping = [];
|
|
23
|
+
}
|
|
24
|
+
static { this.styles = [hiddenStyles]; }
|
|
25
|
+
_renderAnchor(content) {
|
|
26
|
+
return html `<a part="anchor" href="${this.href || nothing}" target="${this.target || nothing}" rel="${this.rel || nothing}" download="${this.download ?? nothing}" hreflang="${this.hreflang || nothing}" referrerpolicy="${this.referrerpolicy || nothing}" ping="${this.ping.join(' ') || nothing}">${content}</a>`;
|
|
27
|
+
}
|
|
28
|
+
click() {
|
|
29
|
+
this.$anchor.click();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
__decorate([
|
|
33
|
+
property()
|
|
34
|
+
], Anchor.prototype, "href", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
property()
|
|
37
|
+
], Anchor.prototype, "target", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
property()
|
|
40
|
+
], Anchor.prototype, "rel", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
property()
|
|
43
|
+
], Anchor.prototype, "download", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
property()
|
|
46
|
+
], Anchor.prototype, "hreflang", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
property()
|
|
49
|
+
], Anchor.prototype, "referrerpolicy", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
property({
|
|
52
|
+
converter: {
|
|
53
|
+
fromAttribute: (value) => value?.split(/\s+/).filter(Boolean) ?? [],
|
|
54
|
+
toAttribute: (value) => value.join(' '),
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
], Anchor.prototype, "ping", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
query('a')
|
|
60
|
+
], Anchor.prototype, "$anchor", void 0);
|
|
@@ -15,11 +15,11 @@ export declare class Autocomplete extends Base {
|
|
|
15
15
|
inputSlotElements: HTMLElement[];
|
|
16
16
|
itemSlotElements: HTMLElement[];
|
|
17
17
|
private get $input();
|
|
18
|
-
render(): import("lit
|
|
18
|
+
render(): import("lit").TemplateResult<1>;
|
|
19
19
|
/**
|
|
20
20
|
* Check example content from the m3 implementation
|
|
21
21
|
*/
|
|
22
|
-
renderMenu(): import("lit
|
|
22
|
+
renderMenu(): import("lit").TemplateResult<1>;
|
|
23
23
|
constructor();
|
|
24
24
|
firstUpdated(): Promise<void>;
|
|
25
25
|
private handleInputSlotChange;
|
|
@@ -9,8 +9,8 @@ import type { Menu } from './menu.js';
|
|
|
9
9
|
* @csspart menu - the internal menu part
|
|
10
10
|
*/
|
|
11
11
|
export declare class ComposedMenu extends Popup {
|
|
12
|
-
$menu: Menu;
|
|
13
|
-
render(): import("lit
|
|
12
|
+
$menu: Menu | null;
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
14
|
constructor();
|
|
15
15
|
[handleControlChange](prev: HTMLElement | null, next: HTMLElement | null): void;
|
|
16
16
|
}
|
|
@@ -19,13 +19,16 @@ export class ComposedMenu extends Popup {
|
|
|
19
19
|
constructor() {
|
|
20
20
|
super();
|
|
21
21
|
this[internals].role = 'application';
|
|
22
|
+
this[internals].ariaRoleDescription = 'Menu';
|
|
23
|
+
// You should set this to "Menu" in the language of your webpage
|
|
22
24
|
}
|
|
23
25
|
[handleControlChange](prev, next) {
|
|
24
26
|
if (next) {
|
|
25
27
|
next.ariaHasPopup = 'menu';
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
const menu = this.$menu;
|
|
29
|
+
ensureReady(menu).then(() => {
|
|
30
|
+
next.ariaControlsElements = [menu];
|
|
31
|
+
menu[internals].ariaLabelledByElements = [next];
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
34
|
super[handleControlChange](prev, next);
|
|
@@ -34,5 +34,5 @@ export declare class ListController<Item extends ListItem> implements ReactiveCo
|
|
|
34
34
|
focusPreviousItem(): void;
|
|
35
35
|
handleSlotChange(): void;
|
|
36
36
|
}
|
|
37
|
-
export declare function filterOptions(options: string[], filter: string, exclude?: string[]): string[];
|
|
37
|
+
export declare function filterOptions(options: string[] | undefined, filter: string, exclude?: string[]): string[];
|
|
38
38
|
export declare function getIndexByLetter(options: string[], filter: string, startIndex?: number): number;
|
|
@@ -9,7 +9,7 @@ export class ListController {
|
|
|
9
9
|
this.getPossibleItems = getPossibleItems;
|
|
10
10
|
this.blurItem = blurItem;
|
|
11
11
|
this.focusItem = focusItem;
|
|
12
|
-
this.wrapNavigation = wrapNavigation;
|
|
12
|
+
this.wrapNavigation = wrapNavigation ?? (() => false);
|
|
13
13
|
}
|
|
14
14
|
hostConnected() { }
|
|
15
15
|
hostDisconnected() { }
|
package/src/base/dialog.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { LitElement } from 'lit';
|
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
15
|
export declare class Dialog extends LitElement {
|
|
16
|
-
$dialog: HTMLDialogElement;
|
|
16
|
+
$dialog: HTMLDialogElement | null;
|
|
17
17
|
_handleCancel: (e: Event) => void;
|
|
18
18
|
show(): Promise<void>;
|
|
19
19
|
close(): Promise<void>;
|
package/src/base/dialog.js
CHANGED
|
@@ -24,6 +24,7 @@ export class Dialog extends LitElement {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
async show() {
|
|
27
|
+
await this.updateComplete;
|
|
27
28
|
this.$dialog.showModal();
|
|
28
29
|
const autoFocus = this.querySelector('[autofocus]');
|
|
29
30
|
if (autoFocus) {
|
|
@@ -35,6 +36,7 @@ export class Dialog extends LitElement {
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
async close() {
|
|
39
|
+
await this.updateComplete;
|
|
38
40
|
this.$dialog.close();
|
|
39
41
|
}
|
|
40
42
|
}
|
package/src/base/input.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare class Input extends Base {
|
|
|
27
27
|
autocomplete: string;
|
|
28
28
|
focused: boolean;
|
|
29
29
|
$inputOrTextarea: HTMLInputElement | HTMLTextAreaElement;
|
|
30
|
-
render(): import("lit
|
|
30
|
+
render(): import("lit").TemplateResult<1>;
|
|
31
31
|
protected updated(changedProperties: PropertyValues): void;
|
|
32
32
|
private handleInput;
|
|
33
33
|
private handleChange;
|
package/src/base/list.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare class List extends List_base {
|
|
|
29
29
|
focusFirstItem(): void;
|
|
30
30
|
focusLastItem(): void;
|
|
31
31
|
focusItem(item: ListItem): void;
|
|
32
|
-
render(): import("lit
|
|
32
|
+
render(): import("lit").TemplateResult<1>;
|
|
33
33
|
private readonly listController;
|
|
34
34
|
constructor();
|
|
35
35
|
handleKeyDown(event: KeyboardEvent): void;
|
package/src/base/menu.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare class Menu extends Menu_base {
|
|
|
31
31
|
focusFirstItem(): void;
|
|
32
32
|
focusLastItem(): void;
|
|
33
33
|
focusItem(item: MenuItem): void;
|
|
34
|
-
render(): import("lit
|
|
34
|
+
render(): import("lit").TemplateResult<1>;
|
|
35
35
|
constructor();
|
|
36
36
|
private readonly listController;
|
|
37
37
|
handleKeyDown(event: KeyboardEvent): void;
|
package/src/base/menu.js
CHANGED
|
@@ -85,7 +85,8 @@ export class Menu extends InternalsAttached(LitElement) {
|
|
|
85
85
|
this.listController.focusFirstItem();
|
|
86
86
|
}
|
|
87
87
|
#handleFocusOut() {
|
|
88
|
-
|
|
88
|
+
if (this.listController._focusedItem)
|
|
89
|
+
this.listController._blurItem(this.listController._focusedItem);
|
|
89
90
|
}
|
|
90
91
|
handleKeyDown(event) {
|
|
91
92
|
if (event.defaultPrevented)
|
|
@@ -5,6 +5,6 @@ export declare const replaceStates: unique symbol;
|
|
|
5
5
|
export declare class InternalsAttachedInterface {
|
|
6
6
|
[internals]: ElementInternals;
|
|
7
7
|
[updateInternals]?(): void;
|
|
8
|
-
[replaceStates](del: Array<string>, add: Array<string>): void;
|
|
8
|
+
[replaceStates](del: Array<string>, add: Array<string | null>): void;
|
|
9
9
|
}
|
|
10
10
|
export declare const InternalsAttached: <T extends Constructor<LitElement>>(superClass: T) => Constructor<InternalsAttachedInterface> & T;
|
|
@@ -12,7 +12,10 @@ export const InternalsAttached = (superClass) => {
|
|
|
12
12
|
}
|
|
13
13
|
[replaceStates](del, add) {
|
|
14
14
|
del.forEach((state) => this[internals].states.delete(state));
|
|
15
|
-
add.forEach((state) =>
|
|
15
|
+
add.forEach((state) => {
|
|
16
|
+
if (state)
|
|
17
|
+
this[internals].states.add(state);
|
|
18
|
+
});
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
return InternalsAttachedElement;
|
package/src/base/popup.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare class Popup extends Popup_base {
|
|
|
34
34
|
windowPadding: number;
|
|
35
35
|
$ariaControl: HTMLElement | null;
|
|
36
36
|
static styles: any[];
|
|
37
|
-
render(): import("lit
|
|
37
|
+
render(): import("lit").TemplateResult<1>;
|
|
38
38
|
constructor();
|
|
39
39
|
connectedCallback(): void;
|
|
40
40
|
disconnectedCallback(): void;
|
package/src/base/select.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
import type { Field } from './field.js';
|
|
3
2
|
import type { Option } from './option.js';
|
|
4
3
|
import type { Popup } from './popup.js';
|
|
5
4
|
import type { Menu, MenuItemFocusEvent, MenuActionEvent } from './menu.js';
|
|
@@ -31,23 +30,23 @@ export declare class Select extends Base {
|
|
|
31
30
|
get selectedIndex(): number;
|
|
32
31
|
set selectedIndex(index: number);
|
|
33
32
|
get selectedOptions(): Option[];
|
|
34
|
-
$field:
|
|
33
|
+
$field: any;
|
|
35
34
|
$popup: Popup;
|
|
36
35
|
$menu: Menu;
|
|
37
36
|
private lastUserSetValue;
|
|
38
37
|
private lastUserSetSelectedIndex;
|
|
39
38
|
private lastSelectedOption;
|
|
40
39
|
private lastSelectedOptionRecords;
|
|
41
|
-
render(): import("lit
|
|
40
|
+
render(): import("lit").TemplateResult<1>;
|
|
42
41
|
/**
|
|
43
42
|
* Check example content from the m3 implementation
|
|
44
43
|
*/
|
|
45
|
-
protected renderField(): import("lit
|
|
44
|
+
protected renderField(): import("lit").TemplateResult<1>;
|
|
46
45
|
/**
|
|
47
46
|
* Check example content from the m3 implementation
|
|
48
47
|
*/
|
|
49
|
-
protected renderMenu(): import("lit
|
|
50
|
-
protected renderFieldContent(): import("lit
|
|
48
|
+
protected renderMenu(): import("lit").TemplateResult<1>;
|
|
49
|
+
protected renderFieldContent(): import("lit").TemplateResult<1>;
|
|
51
50
|
constructor();
|
|
52
51
|
protected firstUpdated(changed: PropertyValues<Select>): Promise<void>;
|
|
53
52
|
protected update(changed: PropertyValues<Select>): void;
|
package/src/base/slider.d.ts
CHANGED
|
@@ -20,8 +20,6 @@ export declare class Slider extends Base {
|
|
|
20
20
|
ariaLabelEnd: string;
|
|
21
21
|
ariaValueTextEnd: string;
|
|
22
22
|
step: number;
|
|
23
|
-
ticks: boolean;
|
|
24
|
-
labeled: boolean;
|
|
25
23
|
range: boolean;
|
|
26
24
|
get nameStart(): string;
|
|
27
25
|
set nameStart(name: string);
|
|
@@ -46,7 +44,7 @@ export declare class Slider extends Base {
|
|
|
46
44
|
ariaValueText: string;
|
|
47
45
|
ariaMin: number;
|
|
48
46
|
ariaMax: number;
|
|
49
|
-
}): import("lit
|
|
47
|
+
}): import("lit").TemplateResult<1>;
|
|
50
48
|
private isRedispatchingEvent;
|
|
51
49
|
private action?;
|
|
52
50
|
ariaLabel: string | null;
|
package/src/base/slider.js
CHANGED
|
@@ -68,8 +68,6 @@ export class Slider extends Base {
|
|
|
68
68
|
this.ariaLabelEnd = '';
|
|
69
69
|
this.ariaValueTextEnd = '';
|
|
70
70
|
this.step = 1;
|
|
71
|
-
this.ticks = false;
|
|
72
|
-
this.labeled = false;
|
|
73
71
|
this.range = false;
|
|
74
72
|
this.startOnTop = false;
|
|
75
73
|
this.handlesOverlapping = false;
|
|
@@ -344,12 +342,6 @@ __decorate([
|
|
|
344
342
|
__decorate([
|
|
345
343
|
property({ type: Number })
|
|
346
344
|
], Slider.prototype, "step", void 0);
|
|
347
|
-
__decorate([
|
|
348
|
-
property({ type: Boolean })
|
|
349
|
-
], Slider.prototype, "ticks", void 0);
|
|
350
|
-
__decorate([
|
|
351
|
-
property({ type: Boolean })
|
|
352
|
-
], Slider.prototype, "labeled", void 0);
|
|
353
345
|
__decorate([
|
|
354
346
|
property({ type: Boolean })
|
|
355
347
|
], Slider.prototype, "range", void 0);
|
package/src/base/tab-panel.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare const TabPanel_base: Constructor<import("./mixins/internals-attached.js"
|
|
|
3
3
|
export declare class TabPanel extends TabPanel_base {
|
|
4
4
|
value: string;
|
|
5
5
|
selected: boolean;
|
|
6
|
-
render(): import("lit
|
|
6
|
+
render(): import("lit").TemplateResult<1>;
|
|
7
7
|
constructor();
|
|
8
8
|
}
|
|
9
9
|
export {};
|
package/src/base/tab.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare class Tab extends Tab_base {
|
|
|
5
5
|
disabled: boolean;
|
|
6
6
|
selected: boolean;
|
|
7
7
|
value: string;
|
|
8
|
-
render(): import("lit
|
|
8
|
+
render(): import("lit").TemplateResult<1>;
|
|
9
9
|
constructor();
|
|
10
10
|
protected updated(changed: Map<string, any>): void;
|
|
11
11
|
}
|
package/src/base/tabs.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class Tabs extends LitElement {
|
|
|
10
10
|
selected: string;
|
|
11
11
|
get $tabs(): Array<Tab>;
|
|
12
12
|
get $panels(): Array<TabPanel>;
|
|
13
|
-
render(): import("lit
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
14
|
constructor();
|
|
15
15
|
connectedCallback(): void;
|
|
16
16
|
protected updated(changed: Map<string, any>): void;
|
package/src/base/tooltip.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare class Tooltip extends Base {
|
|
|
28
28
|
forceInvisible: boolean;
|
|
29
29
|
open: boolean;
|
|
30
30
|
static styles: any[];
|
|
31
|
-
render(): import("lit
|
|
31
|
+
render(): import("lit").TemplateResult<1>;
|
|
32
32
|
constructor();
|
|
33
33
|
disconnectedCallback(): void;
|
|
34
34
|
protected updated(changedProperties: PropertyValues<this>): void;
|
package/src/base/tooltip.js
CHANGED
|
@@ -40,9 +40,6 @@ export class Tooltip extends Base {
|
|
|
40
40
|
this.windowPadding = 8;
|
|
41
41
|
this.forceInvisible = false;
|
|
42
42
|
this.open = false;
|
|
43
|
-
// Used to manage the delay before showing/hiding the tooltip.
|
|
44
|
-
this.#openTimer = null;
|
|
45
|
-
this.#closeTimer = null;
|
|
46
43
|
this.#holdingUserSelect = false;
|
|
47
44
|
this.#handleFocusIn = () => {
|
|
48
45
|
if (!focusVisible)
|
|
@@ -115,8 +112,9 @@ export class Tooltip extends Base {
|
|
|
115
112
|
touchend: this.#handleTouchEnd,
|
|
116
113
|
};
|
|
117
114
|
Object.keys(eventHandlers).forEach((key) => {
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
const handler = eventHandlers[key];
|
|
116
|
+
prev?.removeEventListener(key, handler);
|
|
117
|
+
next?.addEventListener(key, handler);
|
|
120
118
|
});
|
|
121
119
|
if (prev)
|
|
122
120
|
prev.ariaDescribedByElements = [];
|
package/src/core/ensure-ready.js
CHANGED
package/src/m3/badge/badge.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class M3Badge extends LitElement {
|
|
|
7
7
|
small: boolean;
|
|
8
8
|
left: boolean;
|
|
9
9
|
bottom: boolean;
|
|
10
|
-
$badge: HTMLSpanElement;
|
|
10
|
+
$badge: HTMLSpanElement | null;
|
|
11
11
|
static styles: any[];
|
|
12
|
-
render(): import("lit
|
|
12
|
+
render(): import("lit").TemplateResult<1>;
|
|
13
13
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Anchor } from '../../base/anchor.js';
|
|
2
|
+
import '../focus-ring/focus-ring.js';
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
|
+
/**
|
|
5
|
+
* @tag md-button-link
|
|
6
|
+
*
|
|
7
|
+
* @csspart anchor
|
|
8
|
+
* @csspart label
|
|
9
|
+
* @csspart icon
|
|
10
|
+
*
|
|
11
|
+
* @slot - label
|
|
12
|
+
* @slot icon - leading icon
|
|
13
|
+
*/
|
|
14
|
+
export declare class M3ButtonLink extends Anchor {
|
|
15
|
+
size: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
16
|
+
square: boolean;
|
|
17
|
+
color: 'primary' | 'secondary' | 'tertiary';
|
|
18
|
+
variant: 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';
|
|
19
|
+
/**
|
|
20
|
+
* Whether to show the icon at the end of the button.
|
|
21
|
+
*/
|
|
22
|
+
trailingIcon: boolean;
|
|
23
|
+
static styles: any[];
|
|
24
|
+
render(): import("lit").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
'md-button-link': M3ButtonLink;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { sharedButtonLinkStyles } from './shared-button-link-styles.css.js';
|
|
9
|
+
import { sharedButtonStyles } from './shared-button-styles.css.js';
|
|
10
|
+
import { commonButtonStyles } from './common-button-styles.css.js';
|
|
11
|
+
/**
|
|
12
|
+
* @tag md-button-link
|
|
13
|
+
*
|
|
14
|
+
* @csspart anchor
|
|
15
|
+
* @csspart label
|
|
16
|
+
* @csspart icon
|
|
17
|
+
*
|
|
18
|
+
* @slot - label
|
|
19
|
+
* @slot icon - leading icon
|
|
20
|
+
*/
|
|
21
|
+
let M3ButtonLink = class M3ButtonLink extends Anchor {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.size = 's';
|
|
25
|
+
this.square = false;
|
|
26
|
+
this.color = 'primary';
|
|
27
|
+
this.variant = 'filled';
|
|
28
|
+
/**
|
|
29
|
+
* Whether to show the icon at the end of the button.
|
|
30
|
+
*/
|
|
31
|
+
this.trailingIcon = false;
|
|
32
|
+
}
|
|
33
|
+
static { this.styles = [
|
|
34
|
+
...super.styles,
|
|
35
|
+
targetStyles,
|
|
36
|
+
sharedButtonStyles,
|
|
37
|
+
sharedButtonLinkStyles,
|
|
38
|
+
commonButtonStyles,
|
|
39
|
+
]; }
|
|
40
|
+
render() {
|
|
41
|
+
return this._renderAnchor(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>`);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
__decorate([
|
|
45
|
+
property({ reflect: true })
|
|
46
|
+
], M3ButtonLink.prototype, "size", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
property({ reflect: true, type: Boolean })
|
|
49
|
+
], M3ButtonLink.prototype, "square", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
property({ reflect: true })
|
|
52
|
+
], M3ButtonLink.prototype, "color", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
property({ reflect: true })
|
|
55
|
+
], M3ButtonLink.prototype, "variant", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
property({ type: Boolean, reflect: true, attribute: 'trailing-icon' })
|
|
58
|
+
], M3ButtonLink.prototype, "trailingIcon", void 0);
|
|
59
|
+
M3ButtonLink = __decorate([
|
|
60
|
+
customElement('md-button-link')
|
|
61
|
+
], M3ButtonLink);
|
|
62
|
+
export { M3ButtonLink };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const commonButtonStyles = css`@layer main{:host{--_padding:16px;--md-focus-ring-shape:calc(var(--_h) / 2);
|
|
2
|
+
export const commonButtonStyles = css`@layer main{:host{--_padding:16px;--md-focus-ring-shape:calc(var(--_h) / 2);font:var(--md-sys-typography-label-large);min-inline-size:64px;padding-inline:var(--_padding);transition:box-shadow var(--md-sys-motion-effects-default-duration) var(--md-sys-motion-effects-default), border-radius var(--md-sys-motion-spatial-fast-duration) var(--md-sys-motion-spatial-fast);justify-content:center;align-items:center;gap:8px;display:inline-flex}:host([size=xs]){--_padding:12px;gap:4px}:host([size=m]){--_padding:24px;font:var(--md-sys-typography-title-medium);gap:8px}:host([size=l]){--_padding:48px;font:var(--md-sys-typography-headline-small);gap:12px}:host([size=xl]){--_padding:64px;font:var(--md-sys-typography-headline-medium);gap:16px}:host([trailing-icon]){flex-direction:row-reverse}:host([variant=outlined]){padding-inline:calc(var(--_padding) - 1px)}:host([variant=text]){padding-inline:calc(var(--_padding) / 4 * 3)}::slotted([slot=icon]),::slotted([slot=icon-checked]){fill:currentColor;block-size:1em;font-size:var(--_icon-size);inline-size:1em}}@layer override{:host([variant=elevated]){background-color:var(--md-sys-color-surface-container-low);color:var(--_color);box-shadow:var(--md-sys-elevation-shadow-1)}@media (hover:hover) and (pointer:fine){:host([variant=filled]:hover:not(:active)),:host([variant=tonal]:hover:not(:active)){box-shadow:var(--md-sys-elevation-shadow-1)}:host([variant=elevated]:hover:not(:active)){box-shadow:var(--md-sys-elevation-shadow-2)}}}`;
|
|
@@ -15,7 +15,7 @@ declare const M3ButtonToggle_base: Constructor<import("../../base/mixins/button-
|
|
|
15
15
|
*/
|
|
16
16
|
export declare class M3ButtonToggle extends M3ButtonToggle_base {
|
|
17
17
|
static styles: any[];
|
|
18
|
-
render(): import("lit
|
|
18
|
+
render(): import("lit").TemplateResult<1>;
|
|
19
19
|
}
|
|
20
20
|
declare global {
|
|
21
21
|
interface HTMLElementTagNameMap {
|
|
@@ -12,7 +12,7 @@ import '../ripple/ripple.js';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class M3Button extends Button {
|
|
14
14
|
size: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
15
|
-
square:
|
|
15
|
+
square: boolean;
|
|
16
16
|
color: 'primary' | 'secondary' | 'tertiary';
|
|
17
17
|
variant: 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';
|
|
18
18
|
/**
|
|
@@ -20,7 +20,7 @@ export declare class M3Button extends Button {
|
|
|
20
20
|
*/
|
|
21
21
|
trailingIcon: boolean;
|
|
22
22
|
static styles: any[];
|
|
23
|
-
render(): import("lit
|
|
23
|
+
render(): import("lit").TemplateResult<1>;
|
|
24
24
|
}
|
|
25
25
|
declare global {
|
|
26
26
|
interface HTMLElementTagNameMap {
|