@material/web 2.5.0 → 2.5.1-nightly.efaa189.0
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 +2220 -838
- package/labs/gb/components/appbar/_app-bar-tokens.scss +136 -0
- package/labs/gb/components/appbar/app-bar-element.d.ts +53 -0
- package/labs/gb/components/appbar/app-bar-element.js +144 -0
- package/labs/gb/components/appbar/app-bar-element.js.map +1 -0
- package/labs/gb/components/appbar/app-bar.css +4 -0
- package/labs/gb/components/appbar/app-bar.css.map +1 -0
- package/labs/gb/components/appbar/app-bar.cssresult.d.ts +3 -0
- package/labs/gb/components/appbar/app-bar.cssresult.js +14 -0
- package/labs/gb/components/appbar/app-bar.cssresult.js.map +1 -0
- package/labs/gb/components/appbar/app-bar.d.ts +71 -0
- package/labs/gb/components/appbar/app-bar.js +96 -0
- package/labs/gb/components/appbar/app-bar.js.map +1 -0
- package/labs/gb/components/appbar/app-bar.scss +167 -0
- package/labs/gb/components/appbar/md-gb-app-bar.d.ts +12 -0
- package/labs/gb/components/appbar/md-gb-app-bar.js +8 -0
- package/labs/gb/components/appbar/md-gb-app-bar.js.map +1 -0
- package/labs/gb/components/chip/_chip-tokens.scss +167 -0
- package/labs/gb/components/chip/chip-element.d.ts +73 -0
- package/labs/gb/components/chip/chip-element.js +233 -0
- package/labs/gb/components/chip/chip-element.js.map +1 -0
- package/labs/gb/components/chip/chip.css +4 -0
- package/labs/gb/components/chip/chip.css.map +1 -0
- package/labs/gb/components/chip/chip.cssresult.d.ts +3 -0
- package/labs/gb/components/chip/chip.cssresult.js +14 -0
- package/labs/gb/components/chip/chip.cssresult.js.map +1 -0
- package/labs/gb/components/chip/chip.d.ts +77 -0
- package/labs/gb/components/chip/chip.js +99 -0
- package/labs/gb/components/chip/chip.js.map +1 -0
- package/labs/gb/components/chip/chip.scss +97 -0
- package/labs/gb/components/chip/md-gb-chip.d.ts +13 -0
- package/labs/gb/components/chip/md-gb-chip.js +9 -0
- package/labs/gb/components/chip/md-gb-chip.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 Google LLC
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
// Auto-generated by cascade_tokens
|
|
7
|
+
// Add `// EDIT:` comments for manual adjustments.
|
|
8
|
+
//
|
|
9
|
+
// --prefix=md.comp.app-bar
|
|
10
|
+
// --states=":small|[medium-flexible=medium]|[large-flexible=large],with-subtitle,search,on-scroll"
|
|
11
|
+
// --exclude=".medium.,.large."
|
|
12
|
+
|
|
13
|
+
@mixin root {
|
|
14
|
+
// LINT.IfChange
|
|
15
|
+
// md.comp.app-bar.avatar.size
|
|
16
|
+
--avatar-size: 32px;
|
|
17
|
+
// md.comp.app-bar.container.color
|
|
18
|
+
--container-color: var(--md-sys-color-surface);
|
|
19
|
+
// md.comp.app-bar.container.elevation
|
|
20
|
+
--container-elevation: var(--md-sys-elevation-shadow-0);
|
|
21
|
+
// md.comp.app-bar.small.container.height
|
|
22
|
+
--container-height: 64px;
|
|
23
|
+
// md.comp.app-bar.container.shape
|
|
24
|
+
--container-shape: var(--md-sys-shape-corner-none);
|
|
25
|
+
// md.comp.app-bar.icon-button-space
|
|
26
|
+
--icon-button-space: var(--md-sys-space-0);
|
|
27
|
+
// md.comp.app-bar.icon.size
|
|
28
|
+
--icon-size: 24px;
|
|
29
|
+
--label-text: unset;
|
|
30
|
+
--label-text-axes: unset;
|
|
31
|
+
--label-text-tracking: unset;
|
|
32
|
+
--label-color: unset;
|
|
33
|
+
// md.comp.app-bar.leading-icon.color
|
|
34
|
+
--leading-icon-color: var(--md-sys-color-on-surface);
|
|
35
|
+
// md.comp.app-bar.leading-space
|
|
36
|
+
--leading-space: var(--md-sys-space-50);
|
|
37
|
+
// ┌ md.comp.app-bar.small.subtitle.font
|
|
38
|
+
--subtitle: var(--md-sys-typescale-label-md);
|
|
39
|
+
// ┌┄ md.comp.app-bar.small.subtitle
|
|
40
|
+
--subtitle-axes: var(--md-sys-typescale-label-md-axes);
|
|
41
|
+
// md.comp.app-bar.subtitle.color
|
|
42
|
+
--subtitle-color: var(--md-sys-color-on-surface-variant);
|
|
43
|
+
// ┌┄ md.comp.app-bar.small.subtitle
|
|
44
|
+
--subtitle-tracking: var(--md-sys-typescale-label-md-tracking);
|
|
45
|
+
// ┌ md.comp.app-bar.small.title.font
|
|
46
|
+
--title: var(--md-sys-typescale-title-lg);
|
|
47
|
+
// ┌┄ md.comp.app-bar.small.title
|
|
48
|
+
--title-axes: var(--md-sys-typescale-title-lg-axes);
|
|
49
|
+
// md.comp.app-bar.title.color
|
|
50
|
+
--title-color: var(--md-sys-color-on-surface);
|
|
51
|
+
// ┌┄ md.comp.app-bar.small.title
|
|
52
|
+
--title-tracking: var(--md-sys-typescale-title-lg-tracking);
|
|
53
|
+
// md.comp.app-bar.trailing-icon.color
|
|
54
|
+
--trailing-icon-color: var(--md-sys-color-on-surface-variant);
|
|
55
|
+
// md.comp.app-bar.trailing-space
|
|
56
|
+
--trailing-space: var(--md-sys-space-50);
|
|
57
|
+
// LINT.ThenChange(md-gb-app-bar.ts) keep in sync with `@cssprop` jsdoc tags
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@mixin medium {
|
|
61
|
+
// md.comp.app-bar.medium-flexible.container.height
|
|
62
|
+
--container-height: 112px;
|
|
63
|
+
// ┌ md.comp.app-bar.medium-flexible.subtitle.font
|
|
64
|
+
--subtitle: var(--md-sys-typescale-label-lg);
|
|
65
|
+
// ┌┄ md.comp.app-bar.medium-flexible.subtitle
|
|
66
|
+
--subtitle-axes: var(--md-sys-typescale-label-lg-axes);
|
|
67
|
+
// ┌┄ md.comp.app-bar.medium-flexible.subtitle
|
|
68
|
+
--subtitle-tracking: var(--md-sys-typescale-label-lg-tracking);
|
|
69
|
+
// ┌ md.comp.app-bar.medium-flexible.title.font
|
|
70
|
+
--title: var(--md-sys-typescale-headline-md);
|
|
71
|
+
// ┌┄ md.comp.app-bar.medium-flexible.title
|
|
72
|
+
--title-axes: var(--md-sys-typescale-headline-md-axes);
|
|
73
|
+
// ┌┄ md.comp.app-bar.medium-flexible.title
|
|
74
|
+
--title-tracking: var(--md-sys-typescale-headline-md-tracking);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@mixin large {
|
|
78
|
+
// md.comp.app-bar.large-flexible.container.height
|
|
79
|
+
--container-height: 120px;
|
|
80
|
+
// ┌ md.comp.app-bar.large-flexible.subtitle.font
|
|
81
|
+
--subtitle: var(--md-sys-typescale-title-md);
|
|
82
|
+
// ┌┄ md.comp.app-bar.large-flexible.subtitle
|
|
83
|
+
--subtitle-axes: var(--md-sys-typescale-title-md-axes);
|
|
84
|
+
// ┌┄ md.comp.app-bar.large-flexible.subtitle
|
|
85
|
+
--subtitle-tracking: var(--md-sys-typescale-title-md-tracking);
|
|
86
|
+
// ┌ md.comp.app-bar.large-flexible.title.font
|
|
87
|
+
--title: var(--md-sys-typescale-display-sm);
|
|
88
|
+
// ┌┄ md.comp.app-bar.large-flexible.title
|
|
89
|
+
--title-axes: var(--md-sys-typescale-display-sm-axes);
|
|
90
|
+
// ┌┄ md.comp.app-bar.large-flexible.title
|
|
91
|
+
--title-tracking: var(--md-sys-typescale-display-sm-tracking);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@mixin with-subtitle {
|
|
95
|
+
// ┌ md.comp.app-bar.medium-flexible.with-subtitle.container.height
|
|
96
|
+
--container-height: 136px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@mixin with-subtitle-large {
|
|
100
|
+
// md.comp.app-bar.large-flexible.with-subtitle.container.height
|
|
101
|
+
--container-height: 152px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@mixin search {
|
|
105
|
+
// md.comp.app-bar.search.container.color
|
|
106
|
+
--container-color: var(--md-sys-color-surface-container);
|
|
107
|
+
// md.comp.app-bar.small.search.container.height
|
|
108
|
+
--container-height: 56px;
|
|
109
|
+
// md.comp.app-bar.small.search.container.shape
|
|
110
|
+
--container-shape: var(--md-sys-shape-corner-full);
|
|
111
|
+
// ┌ md.comp.app-bar.small.search.label-text.font
|
|
112
|
+
--label-text: var(--md-sys-typescale-body-lg);
|
|
113
|
+
// ┌┄ md.comp.app-bar.small.search.label-text
|
|
114
|
+
--label-text-axes: var(--md-sys-typescale-body-lg-axes);
|
|
115
|
+
// ┌┄ md.comp.app-bar.small.search.label-text
|
|
116
|
+
--label-text-tracking: var(--md-sys-typescale-body-lg-tracking);
|
|
117
|
+
// md.comp.app-bar.search.label.color
|
|
118
|
+
--label-color: var(--md-sys-color-on-surface-variant);
|
|
119
|
+
// md.comp.app-bar.search.leading-space
|
|
120
|
+
--leading-space: var(--md-sys-space-100);
|
|
121
|
+
// md.comp.app-bar.search.trailing-space
|
|
122
|
+
--trailing-space: var(--md-sys-space-100);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@mixin on-scroll {
|
|
126
|
+
// md.comp.app-bar.on-scroll.container.color
|
|
127
|
+
--container-color: var(--md-sys-color-surface-container);
|
|
128
|
+
// md.comp.app-bar.on-scroll.container.elevation
|
|
129
|
+
--container-elevation: var(--md-sys-elevation-shadow-2);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@mixin on-scroll-search {
|
|
133
|
+
// md.comp.app-bar.search.on-scroll.container.color
|
|
134
|
+
--container-color: var(--md-sys-color-surface-container-highest);
|
|
135
|
+
}
|
|
136
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CSSResultOrNative, LitElement } from 'lit';
|
|
7
|
+
import { type AppBarSize, type AppBarVariant } from './app-bar.js';
|
|
8
|
+
/**
|
|
9
|
+
* A Material Design Expressive App Bar component (`md-gb-app-bar`).
|
|
10
|
+
*
|
|
11
|
+
* @slot - Used to display the primary title text of the app bar.
|
|
12
|
+
* @slot subtitle - Used to display an optional subtitle below the title in medium/large bars.
|
|
13
|
+
* @slot leading - Used to display the leading navigation icon button (e.g. menu or back).
|
|
14
|
+
* @slot trailing - Used to display trailing action buttons and/or user avatar.
|
|
15
|
+
* @slot search - Used to display search bar input or controls when `variant="search"`.
|
|
16
|
+
* @fires {CustomEvent<{scrolled: boolean}>} scrollstatechange - Fired when the scrolled state changes. --bubbles --composed
|
|
17
|
+
* @csspart app-bar - The root container element.
|
|
18
|
+
* @cssprop --avatar-size
|
|
19
|
+
* @cssprop --container-color
|
|
20
|
+
* @cssprop --container-elevation
|
|
21
|
+
* @cssprop --container-height
|
|
22
|
+
* @cssprop --container-shape
|
|
23
|
+
* @cssprop --icon-button-space
|
|
24
|
+
* @cssprop --icon-size
|
|
25
|
+
* @cssprop --label-text
|
|
26
|
+
* @cssprop --label-text-axes
|
|
27
|
+
* @cssprop --label-text-tracking
|
|
28
|
+
* @cssprop --label-color
|
|
29
|
+
* @cssprop --leading-icon-color
|
|
30
|
+
* @cssprop --leading-space
|
|
31
|
+
* @cssprop --subtitle
|
|
32
|
+
* @cssprop --subtitle-axes
|
|
33
|
+
* @cssprop --subtitle-color
|
|
34
|
+
* @cssprop --subtitle-tracking
|
|
35
|
+
* @cssprop --title
|
|
36
|
+
* @cssprop --title-axes
|
|
37
|
+
* @cssprop --title-color
|
|
38
|
+
* @cssprop --title-tracking
|
|
39
|
+
* @cssprop --trailing-icon-color
|
|
40
|
+
* @cssprop --trailing-space
|
|
41
|
+
*/
|
|
42
|
+
export declare class AppBarElement extends LitElement {
|
|
43
|
+
static styles: CSSResultOrNative[];
|
|
44
|
+
/** The size of the app bar (`sm`, `md`, `lg`). Defaults to `sm`. */
|
|
45
|
+
size: AppBarSize;
|
|
46
|
+
/** The behavioral variant of the app bar (`standard` or `search`). Defaults to `standard`. */
|
|
47
|
+
variant: AppBarVariant;
|
|
48
|
+
/** Whether the app bar is in its scrolled state. Defaults to `false`. */
|
|
49
|
+
scrolled: boolean;
|
|
50
|
+
private hasSubtitle;
|
|
51
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
52
|
+
private handleSubtitleSlotChange;
|
|
53
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { __decorate } from "tslib";
|
|
7
|
+
import { css, html, LitElement } from 'lit';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
|
+
import { appBar } from './app-bar.js';
|
|
10
|
+
import { styles as appBarStyles } from './app-bar.cssresult.js';
|
|
11
|
+
/**
|
|
12
|
+
* A Material Design Expressive App Bar component (`md-gb-app-bar`).
|
|
13
|
+
*
|
|
14
|
+
* @slot - Used to display the primary title text of the app bar.
|
|
15
|
+
* @slot subtitle - Used to display an optional subtitle below the title in medium/large bars.
|
|
16
|
+
* @slot leading - Used to display the leading navigation icon button (e.g. menu or back).
|
|
17
|
+
* @slot trailing - Used to display trailing action buttons and/or user avatar.
|
|
18
|
+
* @slot search - Used to display search bar input or controls when `variant="search"`.
|
|
19
|
+
* @fires {CustomEvent<{scrolled: boolean}>} scrollstatechange - Fired when the scrolled state changes. --bubbles --composed
|
|
20
|
+
* @csspart app-bar - The root container element.
|
|
21
|
+
* @cssprop --avatar-size
|
|
22
|
+
* @cssprop --container-color
|
|
23
|
+
* @cssprop --container-elevation
|
|
24
|
+
* @cssprop --container-height
|
|
25
|
+
* @cssprop --container-shape
|
|
26
|
+
* @cssprop --icon-button-space
|
|
27
|
+
* @cssprop --icon-size
|
|
28
|
+
* @cssprop --label-text
|
|
29
|
+
* @cssprop --label-text-axes
|
|
30
|
+
* @cssprop --label-text-tracking
|
|
31
|
+
* @cssprop --label-color
|
|
32
|
+
* @cssprop --leading-icon-color
|
|
33
|
+
* @cssprop --leading-space
|
|
34
|
+
* @cssprop --subtitle
|
|
35
|
+
* @cssprop --subtitle-axes
|
|
36
|
+
* @cssprop --subtitle-color
|
|
37
|
+
* @cssprop --subtitle-tracking
|
|
38
|
+
* @cssprop --title
|
|
39
|
+
* @cssprop --title-axes
|
|
40
|
+
* @cssprop --title-color
|
|
41
|
+
* @cssprop --title-tracking
|
|
42
|
+
* @cssprop --trailing-icon-color
|
|
43
|
+
* @cssprop --trailing-space
|
|
44
|
+
*/
|
|
45
|
+
export class AppBarElement extends LitElement {
|
|
46
|
+
constructor() {
|
|
47
|
+
super(...arguments);
|
|
48
|
+
/** The size of the app bar (`sm`, `md`, `lg`). Defaults to `sm`. */
|
|
49
|
+
this.size = 'sm';
|
|
50
|
+
/** The behavioral variant of the app bar (`standard` or `search`). Defaults to `standard`. */
|
|
51
|
+
this.variant = 'standard';
|
|
52
|
+
/** Whether the app bar is in its scrolled state. Defaults to `false`. */
|
|
53
|
+
this.scrolled = false;
|
|
54
|
+
this.hasSubtitle = false;
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
const withSubtitle = this.size !== 'sm' && this.hasSubtitle;
|
|
58
|
+
const directive = appBar({
|
|
59
|
+
size: this.size,
|
|
60
|
+
withSubtitle,
|
|
61
|
+
variant: this.variant,
|
|
62
|
+
scrolled: this.scrolled,
|
|
63
|
+
});
|
|
64
|
+
if (this.variant === 'search') {
|
|
65
|
+
return html `<div part="app-bar" class="${directive}">
|
|
66
|
+
<div class="app-bar-leading">
|
|
67
|
+
<slot name="leading"></slot>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="app-bar-search-container">
|
|
70
|
+
<slot name="search"></slot>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="app-bar-trailing">
|
|
73
|
+
<slot name="trailing"></slot>
|
|
74
|
+
</div>
|
|
75
|
+
</div>`;
|
|
76
|
+
}
|
|
77
|
+
if (this.size !== 'sm') {
|
|
78
|
+
return html `<div part="app-bar" class="${directive}">
|
|
79
|
+
<div class="app-bar-top-row">
|
|
80
|
+
<div class="app-bar-leading">
|
|
81
|
+
<slot name="leading"></slot>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="app-bar-trailing">
|
|
84
|
+
<slot name="trailing"></slot>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="app-bar-bottom-row">
|
|
88
|
+
<div class="app-bar-title-wrapper">
|
|
89
|
+
<div class="app-bar-title">
|
|
90
|
+
<slot></slot>
|
|
91
|
+
</div>
|
|
92
|
+
<div
|
|
93
|
+
class="app-bar-subtitle"
|
|
94
|
+
style="${withSubtitle ? '' : 'display: none;'}">
|
|
95
|
+
<slot
|
|
96
|
+
name="subtitle"
|
|
97
|
+
@slotchange=${this.handleSubtitleSlotChange}></slot>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>`;
|
|
102
|
+
}
|
|
103
|
+
return html `<div part="app-bar" class="${directive}">
|
|
104
|
+
<div class="app-bar-leading">
|
|
105
|
+
<slot name="leading"></slot>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="app-bar-title-wrapper">
|
|
108
|
+
<div class="app-bar-title">
|
|
109
|
+
<slot></slot>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="app-bar-trailing">
|
|
113
|
+
<slot name="trailing"></slot>
|
|
114
|
+
</div>
|
|
115
|
+
</div>`;
|
|
116
|
+
}
|
|
117
|
+
handleSubtitleSlotChange(event) {
|
|
118
|
+
const slot = event.target;
|
|
119
|
+
this.hasSubtitle = slot.assignedNodes({ flatten: true }).length > 0;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
AppBarElement.styles = [
|
|
123
|
+
appBarStyles,
|
|
124
|
+
css `
|
|
125
|
+
:host {
|
|
126
|
+
display: flex;
|
|
127
|
+
width: 100%;
|
|
128
|
+
position: relative;
|
|
129
|
+
}
|
|
130
|
+
`,
|
|
131
|
+
];
|
|
132
|
+
__decorate([
|
|
133
|
+
property({ reflect: true })
|
|
134
|
+
], AppBarElement.prototype, "size", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
property({ reflect: true })
|
|
137
|
+
], AppBarElement.prototype, "variant", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
property({ type: Boolean, reflect: true })
|
|
140
|
+
], AppBarElement.prototype, "scrolled", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
state()
|
|
143
|
+
], AppBarElement.prototype, "hasSubtitle", void 0);
|
|
144
|
+
//# sourceMappingURL=app-bar-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-bar-element.js","sourceRoot":"","sources":["app-bar-element.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC7D,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAC,MAAM,EAAsC,MAAM,cAAc,CAAC;AACzE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,OAAO,aAAc,SAAQ,UAAU;IAA7C;;QAYE,oEAAoE;QACzC,SAAI,GAAe,IAAI,CAAC;QAEnD,8FAA8F;QACnE,YAAO,GAAkB,UAAU,CAAC;QAE/D,yEAAyE;QAC/B,aAAQ,GAAG,KAAK,CAAC;QAE1C,gBAAW,GAAG,KAAK,CAAC;IAuEvC,CAAC;IArEoB,MAAM;QACvB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC;QAC5D,MAAM,SAAS,GAAG,MAAM,CAAC;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,YAAY;YACZ,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QAEH,IAAI,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAA,8BAA8B,SAAS;;;;;;;;;;aAU3C,CAAC;QACV,CAAC;QAED,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACvB,OAAO,IAAI,CAAA,8BAA8B,SAAS;;;;;;;;;;;;;;;;uBAgBjC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB;;;8BAG7B,IAAI,CAAC,wBAAwB;;;;aAI9C,CAAC;QACV,CAAC;QAED,OAAO,IAAI,CAAA,8BAA8B,SAAS;;;;;;;;;;;;WAY3C,CAAC;IACV,CAAC;IAEO,wBAAwB,CAAC,KAAY;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,MAAyB,CAAC;QAC7C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACpE,CAAC;;AA1Fe,oBAAM,GAAwB;IAC5C,YAAY;IACZ,GAAG,CAAA;;;;;;KAMF;CACF,AATqB,CASpB;AAGyB;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;2CAAyB;AAGxB;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;8CAAqC;AAGrB;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;+CAAkB;AAE1C;IAAhB,KAAK,EAAE;kDAA6B","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {css, CSSResultOrNative, html, LitElement} from 'lit';\nimport {property, state} from 'lit/decorators.js';\n\nimport {appBar, type AppBarSize, type AppBarVariant} from './app-bar.js';\nimport {styles as appBarStyles} from './app-bar.cssresult.js';\n\n/**\n * A Material Design Expressive App Bar component (`md-gb-app-bar`).\n *\n * @slot - Used to display the primary title text of the app bar.\n * @slot subtitle - Used to display an optional subtitle below the title in medium/large bars.\n * @slot leading - Used to display the leading navigation icon button (e.g. menu or back).\n * @slot trailing - Used to display trailing action buttons and/or user avatar.\n * @slot search - Used to display search bar input or controls when `variant=\"search\"`.\n * @fires {CustomEvent<{scrolled: boolean}>} scrollstatechange - Fired when the scrolled state changes. --bubbles --composed\n * @csspart app-bar - The root container element.\n * @cssprop --avatar-size\n * @cssprop --container-color\n * @cssprop --container-elevation\n * @cssprop --container-height\n * @cssprop --container-shape\n * @cssprop --icon-button-space\n * @cssprop --icon-size\n * @cssprop --label-text\n * @cssprop --label-text-axes\n * @cssprop --label-text-tracking\n * @cssprop --label-color\n * @cssprop --leading-icon-color\n * @cssprop --leading-space\n * @cssprop --subtitle\n * @cssprop --subtitle-axes\n * @cssprop --subtitle-color\n * @cssprop --subtitle-tracking\n * @cssprop --title\n * @cssprop --title-axes\n * @cssprop --title-color\n * @cssprop --title-tracking\n * @cssprop --trailing-icon-color\n * @cssprop --trailing-space\n */\nexport class AppBarElement extends LitElement {\n static override styles: CSSResultOrNative[] = [\n appBarStyles,\n css`\n :host {\n display: flex;\n width: 100%;\n position: relative;\n }\n `,\n ];\n\n /** The size of the app bar (`sm`, `md`, `lg`). Defaults to `sm`. */\n @property({reflect: true}) size: AppBarSize = 'sm';\n\n /** The behavioral variant of the app bar (`standard` or `search`). Defaults to `standard`. */\n @property({reflect: true}) variant: AppBarVariant = 'standard';\n\n /** Whether the app bar is in its scrolled state. Defaults to `false`. */\n @property({type: Boolean, reflect: true}) scrolled = false;\n\n @state() private hasSubtitle = false;\n\n protected override render() {\n const withSubtitle = this.size !== 'sm' && this.hasSubtitle;\n const directive = appBar({\n size: this.size,\n withSubtitle,\n variant: this.variant,\n scrolled: this.scrolled,\n });\n\n if (this.variant === 'search') {\n return html`<div part=\"app-bar\" class=\"${directive}\">\n <div class=\"app-bar-leading\">\n <slot name=\"leading\"></slot>\n </div>\n <div class=\"app-bar-search-container\">\n <slot name=\"search\"></slot>\n </div>\n <div class=\"app-bar-trailing\">\n <slot name=\"trailing\"></slot>\n </div>\n </div>`;\n }\n\n if (this.size !== 'sm') {\n return html`<div part=\"app-bar\" class=\"${directive}\">\n <div class=\"app-bar-top-row\">\n <div class=\"app-bar-leading\">\n <slot name=\"leading\"></slot>\n </div>\n <div class=\"app-bar-trailing\">\n <slot name=\"trailing\"></slot>\n </div>\n </div>\n <div class=\"app-bar-bottom-row\">\n <div class=\"app-bar-title-wrapper\">\n <div class=\"app-bar-title\">\n <slot></slot>\n </div>\n <div\n class=\"app-bar-subtitle\"\n style=\"${withSubtitle ? '' : 'display: none;'}\">\n <slot\n name=\"subtitle\"\n @slotchange=${this.handleSubtitleSlotChange}></slot>\n </div>\n </div>\n </div>\n </div>`;\n }\n\n return html`<div part=\"app-bar\" class=\"${directive}\">\n <div class=\"app-bar-leading\">\n <slot name=\"leading\"></slot>\n </div>\n <div class=\"app-bar-title-wrapper\">\n <div class=\"app-bar-title\">\n <slot></slot>\n </div>\n </div>\n <div class=\"app-bar-trailing\">\n <slot name=\"trailing\"></slot>\n </div>\n </div>`;\n }\n\n private handleSubtitleSlotChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n this.hasSubtitle = slot.assignedNodes({flatten: true}).length > 0;\n }\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 Google LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/@layer md.sys;@layer md.comp.app-bar{.app-bar{--avatar-size: 32px;--container-color: var(--md-sys-color-surface);--container-elevation: var(--md-sys-elevation-shadow-0);--container-height: 64px;--container-shape: var(--md-sys-shape-corner-none);--icon-button-space: var(--md-sys-space-0);--icon-size: 24px;--label-text: unset;--label-text-axes: unset;--label-text-tracking: unset;--label-color: unset;--leading-icon-color: var(--md-sys-color-on-surface);--leading-space: var(--md-sys-space-50);--subtitle: var(--md-sys-typescale-label-md);--subtitle-axes: var(--md-sys-typescale-label-md-axes);--subtitle-color: var(--md-sys-color-on-surface-variant);--subtitle-tracking: var(--md-sys-typescale-label-md-tracking);--title: var(--md-sys-typescale-title-lg);--title-axes: var(--md-sys-typescale-title-lg-axes);--title-color: var(--md-sys-color-on-surface);--title-tracking: var(--md-sys-typescale-title-lg-tracking);--trailing-icon-color: var(--md-sys-color-on-surface-variant);--trailing-space: var(--md-sys-space-50)}.app-bar-md{--container-height: 112px;--subtitle: var(--md-sys-typescale-label-lg);--subtitle-axes: var(--md-sys-typescale-label-lg-axes);--subtitle-tracking: var(--md-sys-typescale-label-lg-tracking);--title: var(--md-sys-typescale-headline-md);--title-axes: var(--md-sys-typescale-headline-md-axes);--title-tracking: var(--md-sys-typescale-headline-md-tracking)}.app-bar-lg{--container-height: 120px;--subtitle: var(--md-sys-typescale-title-md);--subtitle-axes: var(--md-sys-typescale-title-md-axes);--subtitle-tracking: var(--md-sys-typescale-title-md-tracking);--title: var(--md-sys-typescale-display-sm);--title-axes: var(--md-sys-typescale-display-sm-axes);--title-tracking: var(--md-sys-typescale-display-sm-tracking)}.app-bar-with-subtitle{--container-height: 136px}.app-bar-with-subtitle.app-bar-lg{--container-height: 152px}.app-bar-search{--container-color: var(--md-sys-color-surface-container);--container-height: 56px;--container-shape: var(--md-sys-shape-corner-full);--label-text: var(--md-sys-typescale-body-lg);--label-text-axes: var(--md-sys-typescale-body-lg-axes);--label-text-tracking: var(--md-sys-typescale-body-lg-tracking);--label-color: var(--md-sys-color-on-surface-variant);--leading-space: var(--md-sys-space-100);--trailing-space: var(--md-sys-space-100)}.app-bar-scrolled{--container-color: var(--md-sys-color-surface-container);--container-elevation: var(--md-sys-elevation-shadow-2)}.app-bar-scrolled.app-bar-search{--container-color: var(--md-sys-color-surface-container-highest)}.app-bar{box-sizing:border-box;display:flex;position:relative;width:100%;min-height:var(--container-height);background-color:var(--container-color);border-radius:var(--container-shape);box-shadow:var(--container-elevation);color:var(--title-color);transition:background-color 200ms ease,box-shadow 200ms ease,min-height 200ms ease;padding-inline:var(--leading-space) var(--trailing-space)}.app-bar-sm,.app-bar-search{flex-direction:row;align-items:center;justify-content:space-between}.app-bar-md,.app-bar-lg{flex-direction:column;justify-content:space-between;align-items:stretch}.app-bar-md .app-bar-top-row,.app-bar-lg .app-bar-top-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;min-height:64px;width:100%}.app-bar-md .app-bar-bottom-row,.app-bar-lg .app-bar-bottom-row{display:flex;flex-direction:column;justify-content:flex-end;padding-bottom:24px;padding-inline:12px;flex:1 1 auto;min-height:0}.app-bar-leading,.app-bar-trailing{display:flex;align-items:center;gap:var(--icon-button-space);flex-shrink:0}.app-bar-leading{color:var(--leading-icon-color)}.app-bar-trailing{color:var(--trailing-icon-color)}.app-bar-title-wrapper{display:flex;flex-direction:column;justify-content:center;flex:1 1 auto;min-width:0;overflow:hidden}.app-bar-sm .app-bar-title-wrapper{margin-inline:4px}.app-bar-title{margin:0;font:var(--title);font-variation-settings:var(--title-axes);letter-spacing:var(--title-tracking);color:var(--title-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-bar-title ::slotted(*){margin:0;font:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit}.app-bar-subtitle{margin:0;margin-top:2px;font:var(--subtitle);font-variation-settings:var(--subtitle-axes);letter-spacing:var(--subtitle-tracking);color:var(--subtitle-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-bar-subtitle ::slotted(*){margin:0;font:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit}.app-bar-search-container{display:flex;flex:1 1 auto;align-items:center;min-width:0;margin-inline:8px}}/*# sourceMappingURL=app-bar.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["app-bar.scss","_app-bar-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,cACA,uBAEE,SCGA,oBAEA,+CAEA,wDAEA,yBAEA,mDAEA,2CAEA,kBACA,oBACA,yBACA,6BACA,qBAEA,qDAEA,wCAEA,6CAEA,uDAEA,yDAEA,+DAEA,0CAEA,oDAEA,8CAEA,4DAEA,8DAEA,yCDxCA,YC8CA,0BAEA,6CAEA,uDAEA,+DAEA,6CAEA,uDAEA,+DDvDA,YC4DA,0BAEA,6CAEA,uDAEA,+DAEA,4CAEA,sDAEA,8DDrEA,uBC0EA,0BDvEA,kCC4EA,0BDzEA,gBC8EA,yDAEA,yBAEA,mDAEA,8CAEA,wDAEA,gEAEA,sDAEA,yCAEA,0CD3FA,kBCgGA,yDAEA,wDD/FA,iCCoGA,iED/FA,SACE,sBACA,aACA,kBACA,WACA,mCACA,wCACA,qCACA,sCACA,yBACA,WACE,wEAGF,0DAIF,4BAEE,mBACA,mBACA,8BAIF,wBAEE,sBACA,8BACA,oBAEA,0DACE,aACA,mBACA,mBACA,8BACA,gBACA,WAGF,gEACE,aACA,sBACA,yBACA,oBACA,oBACA,cACA,aAKJ,mCAEE,aACA,mBACA,6BACA,cAGF,iBACE,gCAGF,kBACE,iCAGF,uBACE,aACA,sBACA,uBACA,cACA,YACA,gBAGF,mCACE,kBAGF,eACE,SACA,kBACA,0CACA,qCACA,yBACA,mBACA,gBACA,uBAEA,4BACE,SACA,aACA,gCACA,uBACA,cAIJ,kBACE,SACA,eACA,qBACA,6CACA,wCACA,4BACA,mBACA,gBACA,uBAEA,+BACE,SACA,aACA,gCACA,uBACA,cAIJ,0BACE,aACA,cACA,mBACA,YACA","file":"app-bar.css"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
// Generated stylesheet for ./labs/gb/components/appbar/app-bar.css.
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
export const styles = css `/*!
|
|
9
|
+
* Copyright 2026 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
11
|
+
*/@layer md.sys;@layer md.comp.app-bar{.app-bar{--avatar-size: 32px;--container-color: var(--md-sys-color-surface);--container-elevation: var(--md-sys-elevation-shadow-0);--container-height: 64px;--container-shape: var(--md-sys-shape-corner-none);--icon-button-space: var(--md-sys-space-0);--icon-size: 24px;--label-text: unset;--label-text-axes: unset;--label-text-tracking: unset;--label-color: unset;--leading-icon-color: var(--md-sys-color-on-surface);--leading-space: var(--md-sys-space-50);--subtitle: var(--md-sys-typescale-label-md);--subtitle-axes: var(--md-sys-typescale-label-md-axes);--subtitle-color: var(--md-sys-color-on-surface-variant);--subtitle-tracking: var(--md-sys-typescale-label-md-tracking);--title: var(--md-sys-typescale-title-lg);--title-axes: var(--md-sys-typescale-title-lg-axes);--title-color: var(--md-sys-color-on-surface);--title-tracking: var(--md-sys-typescale-title-lg-tracking);--trailing-icon-color: var(--md-sys-color-on-surface-variant);--trailing-space: var(--md-sys-space-50)}.app-bar-md{--container-height: 112px;--subtitle: var(--md-sys-typescale-label-lg);--subtitle-axes: var(--md-sys-typescale-label-lg-axes);--subtitle-tracking: var(--md-sys-typescale-label-lg-tracking);--title: var(--md-sys-typescale-headline-md);--title-axes: var(--md-sys-typescale-headline-md-axes);--title-tracking: var(--md-sys-typescale-headline-md-tracking)}.app-bar-lg{--container-height: 120px;--subtitle: var(--md-sys-typescale-title-md);--subtitle-axes: var(--md-sys-typescale-title-md-axes);--subtitle-tracking: var(--md-sys-typescale-title-md-tracking);--title: var(--md-sys-typescale-display-sm);--title-axes: var(--md-sys-typescale-display-sm-axes);--title-tracking: var(--md-sys-typescale-display-sm-tracking)}.app-bar-with-subtitle{--container-height: 136px}.app-bar-with-subtitle.app-bar-lg{--container-height: 152px}.app-bar-search{--container-color: var(--md-sys-color-surface-container);--container-height: 56px;--container-shape: var(--md-sys-shape-corner-full);--label-text: var(--md-sys-typescale-body-lg);--label-text-axes: var(--md-sys-typescale-body-lg-axes);--label-text-tracking: var(--md-sys-typescale-body-lg-tracking);--label-color: var(--md-sys-color-on-surface-variant);--leading-space: var(--md-sys-space-100);--trailing-space: var(--md-sys-space-100)}.app-bar-scrolled{--container-color: var(--md-sys-color-surface-container);--container-elevation: var(--md-sys-elevation-shadow-2)}.app-bar-scrolled.app-bar-search{--container-color: var(--md-sys-color-surface-container-highest)}.app-bar{box-sizing:border-box;display:flex;position:relative;width:100%;min-height:var(--container-height);background-color:var(--container-color);border-radius:var(--container-shape);box-shadow:var(--container-elevation);color:var(--title-color);transition:background-color 200ms ease,box-shadow 200ms ease,min-height 200ms ease;padding-inline:var(--leading-space) var(--trailing-space)}.app-bar-sm,.app-bar-search{flex-direction:row;align-items:center;justify-content:space-between}.app-bar-md,.app-bar-lg{flex-direction:column;justify-content:space-between;align-items:stretch}.app-bar-md .app-bar-top-row,.app-bar-lg .app-bar-top-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;min-height:64px;width:100%}.app-bar-md .app-bar-bottom-row,.app-bar-lg .app-bar-bottom-row{display:flex;flex-direction:column;justify-content:flex-end;padding-bottom:24px;padding-inline:12px;flex:1 1 auto;min-height:0}.app-bar-leading,.app-bar-trailing{display:flex;align-items:center;gap:var(--icon-button-space);flex-shrink:0}.app-bar-leading{color:var(--leading-icon-color)}.app-bar-trailing{color:var(--trailing-icon-color)}.app-bar-title-wrapper{display:flex;flex-direction:column;justify-content:center;flex:1 1 auto;min-width:0;overflow:hidden}.app-bar-sm .app-bar-title-wrapper{margin-inline:4px}.app-bar-title{margin:0;font:var(--title);font-variation-settings:var(--title-axes);letter-spacing:var(--title-tracking);color:var(--title-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-bar-title ::slotted(*){margin:0;font:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit}.app-bar-subtitle{margin:0;margin-top:2px;font:var(--subtitle);font-variation-settings:var(--subtitle-axes);letter-spacing:var(--subtitle-tracking);color:var(--subtitle-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-bar-subtitle ::slotted(*){margin:0;font:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit}.app-bar-search-container{display:flex;flex:1 1 auto;align-items:center;min-width:0;margin-inline:8px}}
|
|
12
|
+
`;
|
|
13
|
+
export default styles.styleSheet;
|
|
14
|
+
//# sourceMappingURL=app-bar.cssresult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-bar.cssresult.js","sourceRoot":"","sources":["app-bar.cssresult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oEAAoE;AACpE,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;CAIxB,CAAC;AACF,eAAe,MAAM,CAAC,UAAW,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./labs/gb/components/appbar/app-bar.css.\nimport {css} from 'lit';\nexport const styles = css`/*!\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */@layer md.sys;@layer md.comp.app-bar{.app-bar{--avatar-size: 32px;--container-color: var(--md-sys-color-surface);--container-elevation: var(--md-sys-elevation-shadow-0);--container-height: 64px;--container-shape: var(--md-sys-shape-corner-none);--icon-button-space: var(--md-sys-space-0);--icon-size: 24px;--label-text: unset;--label-text-axes: unset;--label-text-tracking: unset;--label-color: unset;--leading-icon-color: var(--md-sys-color-on-surface);--leading-space: var(--md-sys-space-50);--subtitle: var(--md-sys-typescale-label-md);--subtitle-axes: var(--md-sys-typescale-label-md-axes);--subtitle-color: var(--md-sys-color-on-surface-variant);--subtitle-tracking: var(--md-sys-typescale-label-md-tracking);--title: var(--md-sys-typescale-title-lg);--title-axes: var(--md-sys-typescale-title-lg-axes);--title-color: var(--md-sys-color-on-surface);--title-tracking: var(--md-sys-typescale-title-lg-tracking);--trailing-icon-color: var(--md-sys-color-on-surface-variant);--trailing-space: var(--md-sys-space-50)}.app-bar-md{--container-height: 112px;--subtitle: var(--md-sys-typescale-label-lg);--subtitle-axes: var(--md-sys-typescale-label-lg-axes);--subtitle-tracking: var(--md-sys-typescale-label-lg-tracking);--title: var(--md-sys-typescale-headline-md);--title-axes: var(--md-sys-typescale-headline-md-axes);--title-tracking: var(--md-sys-typescale-headline-md-tracking)}.app-bar-lg{--container-height: 120px;--subtitle: var(--md-sys-typescale-title-md);--subtitle-axes: var(--md-sys-typescale-title-md-axes);--subtitle-tracking: var(--md-sys-typescale-title-md-tracking);--title: var(--md-sys-typescale-display-sm);--title-axes: var(--md-sys-typescale-display-sm-axes);--title-tracking: var(--md-sys-typescale-display-sm-tracking)}.app-bar-with-subtitle{--container-height: 136px}.app-bar-with-subtitle.app-bar-lg{--container-height: 152px}.app-bar-search{--container-color: var(--md-sys-color-surface-container);--container-height: 56px;--container-shape: var(--md-sys-shape-corner-full);--label-text: var(--md-sys-typescale-body-lg);--label-text-axes: var(--md-sys-typescale-body-lg-axes);--label-text-tracking: var(--md-sys-typescale-body-lg-tracking);--label-color: var(--md-sys-color-on-surface-variant);--leading-space: var(--md-sys-space-100);--trailing-space: var(--md-sys-space-100)}.app-bar-scrolled{--container-color: var(--md-sys-color-surface-container);--container-elevation: var(--md-sys-elevation-shadow-2)}.app-bar-scrolled.app-bar-search{--container-color: var(--md-sys-color-surface-container-highest)}.app-bar{box-sizing:border-box;display:flex;position:relative;width:100%;min-height:var(--container-height);background-color:var(--container-color);border-radius:var(--container-shape);box-shadow:var(--container-elevation);color:var(--title-color);transition:background-color 200ms ease,box-shadow 200ms ease,min-height 200ms ease;padding-inline:var(--leading-space) var(--trailing-space)}.app-bar-sm,.app-bar-search{flex-direction:row;align-items:center;justify-content:space-between}.app-bar-md,.app-bar-lg{flex-direction:column;justify-content:space-between;align-items:stretch}.app-bar-md .app-bar-top-row,.app-bar-lg .app-bar-top-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;min-height:64px;width:100%}.app-bar-md .app-bar-bottom-row,.app-bar-lg .app-bar-bottom-row{display:flex;flex-direction:column;justify-content:flex-end;padding-bottom:24px;padding-inline:12px;flex:1 1 auto;min-height:0}.app-bar-leading,.app-bar-trailing{display:flex;align-items:center;gap:var(--icon-button-space);flex-shrink:0}.app-bar-leading{color:var(--leading-icon-color)}.app-bar-trailing{color:var(--trailing-icon-color)}.app-bar-title-wrapper{display:flex;flex-direction:column;justify-content:center;flex:1 1 auto;min-width:0;overflow:hidden}.app-bar-sm .app-bar-title-wrapper{margin-inline:4px}.app-bar-title{margin:0;font:var(--title);font-variation-settings:var(--title-axes);letter-spacing:var(--title-tracking);color:var(--title-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-bar-title ::slotted(*){margin:0;font:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit}.app-bar-subtitle{margin:0;margin-top:2px;font:var(--subtitle);font-variation-settings:var(--subtitle-axes);letter-spacing:var(--subtitle-tracking);color:var(--subtitle-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-bar-subtitle ::slotted(*){margin:0;font:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit}.app-bar-search-container{display:flex;flex:1 1 auto;align-items:center;min-width:0;margin-inline:8px}}\n`;\nexport default styles.styleSheet!;\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { type ClassInfo } from 'lit/directives/class-map.js';
|
|
7
|
+
/** App Bar size configuration types. */
|
|
8
|
+
export type AppBarSize = 'sm' | 'md' | 'lg';
|
|
9
|
+
/** App Bar size configurations. */
|
|
10
|
+
export declare const APP_BAR_SIZES: {
|
|
11
|
+
readonly sm: "sm";
|
|
12
|
+
readonly md: "md";
|
|
13
|
+
readonly lg: "lg";
|
|
14
|
+
};
|
|
15
|
+
/** App Bar variant configuration types. */
|
|
16
|
+
export type AppBarVariant = 'standard' | 'search';
|
|
17
|
+
/** App Bar variant configurations. */
|
|
18
|
+
export declare const APP_BAR_VARIANTS: {
|
|
19
|
+
readonly standard: "standard";
|
|
20
|
+
readonly search: "search";
|
|
21
|
+
};
|
|
22
|
+
/** App Bar classes. */
|
|
23
|
+
export declare const APP_BAR_CLASSES: {
|
|
24
|
+
readonly appBar: "app-bar";
|
|
25
|
+
readonly appBarSm: "app-bar-sm";
|
|
26
|
+
readonly appBarMd: "app-bar-md";
|
|
27
|
+
readonly appBarLg: "app-bar-lg";
|
|
28
|
+
readonly appBarWithSubtitle: "app-bar-with-subtitle";
|
|
29
|
+
readonly appBarSearch: "app-bar-search";
|
|
30
|
+
readonly appBarScrolled: "app-bar-scrolled";
|
|
31
|
+
};
|
|
32
|
+
/** The state provided to the `appBarClasses()` function. */
|
|
33
|
+
export interface AppBarClassesState {
|
|
34
|
+
/** The size of the app bar (`sm`, `md`, `lg`). */
|
|
35
|
+
size?: AppBarSize;
|
|
36
|
+
/** Whether the app bar has a subtitle. */
|
|
37
|
+
withSubtitle?: boolean;
|
|
38
|
+
/** The behavior variant (`standard` or `search`). */
|
|
39
|
+
variant?: AppBarVariant;
|
|
40
|
+
/** Whether the app bar is in a scrolled or docked state (`.app-bar-scrolled`). */
|
|
41
|
+
scrolled?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Returns the app bar classes to apply to an element based on the given state.
|
|
45
|
+
*
|
|
46
|
+
* @param state The state of the app bar.
|
|
47
|
+
* @return An object of class names and truthy values if they apply.
|
|
48
|
+
*/
|
|
49
|
+
export declare function appBarClasses({ size, withSubtitle, variant, scrolled, }?: AppBarClassesState): ClassInfo;
|
|
50
|
+
/**
|
|
51
|
+
* Sets up optional scroll target tracking for the given app bar element when an explicit `scrollTarget` is provided.
|
|
52
|
+
*
|
|
53
|
+
* @param appBar The element on which to set up app bar functionality.
|
|
54
|
+
* @param opts Setup options, containing an explicit `scrollTarget` and optional cleanup `signal`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function setupAppBar(appBar: HTMLElement, opts?: {
|
|
57
|
+
signal?: AbortSignal;
|
|
58
|
+
scrollTarget?: HTMLElement | Window;
|
|
59
|
+
}): void;
|
|
60
|
+
/**
|
|
61
|
+
* A Lit directive that adds app bar styling and optional scroll tracking functionality to its element.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* html`<div class="${appBar({size: 'md', scrolled: true})}">
|
|
66
|
+
* <div class="app-bar-top-row">...</div>
|
|
67
|
+
* <div class="app-bar-bottom-row">...</div>
|
|
68
|
+
* </div>`;
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare const appBar: (state?: AppBarClassesState & import("../shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { createClassMapDirective } from '../shared/directives.js';
|
|
7
|
+
/** App Bar size configurations. */
|
|
8
|
+
export const APP_BAR_SIZES = {
|
|
9
|
+
sm: 'sm',
|
|
10
|
+
md: 'md',
|
|
11
|
+
lg: 'lg',
|
|
12
|
+
};
|
|
13
|
+
/** App Bar variant configurations. */
|
|
14
|
+
export const APP_BAR_VARIANTS = {
|
|
15
|
+
standard: 'standard',
|
|
16
|
+
search: 'search',
|
|
17
|
+
};
|
|
18
|
+
/** App Bar classes. */
|
|
19
|
+
export const APP_BAR_CLASSES = {
|
|
20
|
+
appBar: 'app-bar',
|
|
21
|
+
appBarSm: 'app-bar-sm',
|
|
22
|
+
appBarMd: 'app-bar-md',
|
|
23
|
+
appBarLg: 'app-bar-lg',
|
|
24
|
+
appBarWithSubtitle: 'app-bar-with-subtitle',
|
|
25
|
+
appBarSearch: 'app-bar-search',
|
|
26
|
+
appBarScrolled: 'app-bar-scrolled',
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Returns the app bar classes to apply to an element based on the given state.
|
|
30
|
+
*
|
|
31
|
+
* @param state The state of the app bar.
|
|
32
|
+
* @return An object of class names and truthy values if they apply.
|
|
33
|
+
*/
|
|
34
|
+
export function appBarClasses({ size = 'sm', withSubtitle = false, variant = 'standard', scrolled = false, } = {}) {
|
|
35
|
+
return {
|
|
36
|
+
[APP_BAR_CLASSES.appBar]: true,
|
|
37
|
+
[APP_BAR_CLASSES.appBarSm]: size === APP_BAR_SIZES.sm || !size,
|
|
38
|
+
[APP_BAR_CLASSES.appBarMd]: size === APP_BAR_SIZES.md,
|
|
39
|
+
[APP_BAR_CLASSES.appBarLg]: size === APP_BAR_SIZES.lg,
|
|
40
|
+
[APP_BAR_CLASSES.appBarWithSubtitle]: withSubtitle,
|
|
41
|
+
[APP_BAR_CLASSES.appBarSearch]: variant === APP_BAR_VARIANTS.search,
|
|
42
|
+
[APP_BAR_CLASSES.appBarScrolled]: scrolled,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Sets up optional scroll target tracking for the given app bar element when an explicit `scrollTarget` is provided.
|
|
47
|
+
*
|
|
48
|
+
* @param appBar The element on which to set up app bar functionality.
|
|
49
|
+
* @param opts Setup options, containing an explicit `scrollTarget` and optional cleanup `signal`.
|
|
50
|
+
*/
|
|
51
|
+
export function setupAppBar(appBar, opts) {
|
|
52
|
+
if (!opts?.scrollTarget) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const target = opts.scrollTarget;
|
|
56
|
+
const signal = opts.signal;
|
|
57
|
+
const onScroll = () => {
|
|
58
|
+
if (signal?.aborted)
|
|
59
|
+
return;
|
|
60
|
+
let scrollTop = 0;
|
|
61
|
+
if (target instanceof Window) {
|
|
62
|
+
scrollTop = target.scrollY || target.document.documentElement.scrollTop;
|
|
63
|
+
}
|
|
64
|
+
else if (target instanceof HTMLElement) {
|
|
65
|
+
scrollTop = target.scrollTop;
|
|
66
|
+
}
|
|
67
|
+
const isScrolled = scrollTop > 0;
|
|
68
|
+
const wasScrolled = appBar.classList.contains(APP_BAR_CLASSES.appBarScrolled);
|
|
69
|
+
if (isScrolled !== wasScrolled) {
|
|
70
|
+
appBar.classList.toggle(APP_BAR_CLASSES.appBarScrolled, isScrolled);
|
|
71
|
+
appBar.dispatchEvent(new CustomEvent('scrollstatechange', {
|
|
72
|
+
bubbles: true,
|
|
73
|
+
composed: true,
|
|
74
|
+
detail: { scrolled: isScrolled },
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
target.addEventListener('scroll', onScroll, { passive: true, signal });
|
|
79
|
+
onScroll();
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A Lit directive that adds app bar styling and optional scroll tracking functionality to its element.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* html`<div class="${appBar({size: 'md', scrolled: true})}">
|
|
87
|
+
* <div class="app-bar-top-row">...</div>
|
|
88
|
+
* <div class="app-bar-bottom-row">...</div>
|
|
89
|
+
* </div>`;
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export const appBar = createClassMapDirective({
|
|
93
|
+
getClasses: appBarClasses,
|
|
94
|
+
setupElement: setupAppBar,
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=app-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-bar.js","sourceRoot":"","sources":["app-bar.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {type ClassInfo} from 'lit/directives/class-map.js';\n\nimport {createClassMapDirective} from '../shared/directives.js';\n\n/** App Bar size configuration types. */\nexport type AppBarSize = 'sm' | 'md' | 'lg';\n\n/** App Bar size configurations. */\nexport const APP_BAR_SIZES = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n} as const;\n\n/** App Bar variant configuration types. */\nexport type AppBarVariant = 'standard' | 'search';\n\n/** App Bar variant configurations. */\nexport const APP_BAR_VARIANTS = {\n standard: 'standard',\n search: 'search',\n} as const;\n\n/** App Bar classes. */\nexport const APP_BAR_CLASSES = {\n appBar: 'app-bar',\n appBarSm: 'app-bar-sm',\n appBarMd: 'app-bar-md',\n appBarLg: 'app-bar-lg',\n appBarWithSubtitle: 'app-bar-with-subtitle',\n appBarSearch: 'app-bar-search',\n appBarScrolled: 'app-bar-scrolled',\n} as const;\n\n/** The state provided to the `appBarClasses()` function. */\nexport interface AppBarClassesState {\n /** The size of the app bar (`sm`, `md`, `lg`). */\n size?: AppBarSize;\n /** Whether the app bar has a subtitle. */\n withSubtitle?: boolean;\n /** The behavior variant (`standard` or `search`). */\n variant?: AppBarVariant;\n /** Whether the app bar is in a scrolled or docked state (`.app-bar-scrolled`). */\n scrolled?: boolean;\n}\n\n/**\n * Returns the app bar classes to apply to an element based on the given state.\n *\n * @param state The state of the app bar.\n * @return An object of class names and truthy values if they apply.\n */\nexport function appBarClasses({\n size = 'sm',\n withSubtitle = false,\n variant = 'standard',\n scrolled = false,\n}: AppBarClassesState = {}): ClassInfo {\n return {\n [APP_BAR_CLASSES.appBar]: true,\n [APP_BAR_CLASSES.appBarSm]: size === APP_BAR_SIZES.sm || !size,\n [APP_BAR_CLASSES.appBarMd]: size === APP_BAR_SIZES.md,\n [APP_BAR_CLASSES.appBarLg]: size === APP_BAR_SIZES.lg,\n [APP_BAR_CLASSES.appBarWithSubtitle]: withSubtitle,\n [APP_BAR_CLASSES.appBarSearch]: variant === APP_BAR_VARIANTS.search,\n [APP_BAR_CLASSES.appBarScrolled]: scrolled,\n };\n}\n\n/**\n * Sets up optional scroll target tracking for the given app bar element when an explicit `scrollTarget` is provided.\n *\n * @param appBar The element on which to set up app bar functionality.\n * @param opts Setup options, containing an explicit `scrollTarget` and optional cleanup `signal`.\n */\nexport function setupAppBar(\n appBar: HTMLElement,\n opts?: {signal?: AbortSignal; scrollTarget?: HTMLElement | Window},\n): void {\n if (!opts?.scrollTarget) {\n return;\n }\n const target = opts.scrollTarget;\n const signal = opts.signal;\n\n const onScroll = () => {\n if (signal?.aborted) return;\n let scrollTop = 0;\n if (target instanceof Window) {\n scrollTop = target.scrollY || target.document.documentElement.scrollTop;\n } else if (target instanceof HTMLElement) {\n scrollTop = target.scrollTop;\n }\n const isScrolled = scrollTop > 0;\n const wasScrolled = appBar.classList.contains(\n APP_BAR_CLASSES.appBarScrolled,\n );\n if (isScrolled !== wasScrolled) {\n appBar.classList.toggle(APP_BAR_CLASSES.appBarScrolled, isScrolled);\n appBar.dispatchEvent(\n new CustomEvent('scrollstatechange', {\n bubbles: true,\n composed: true,\n detail: {scrolled: isScrolled},\n }),\n );\n }\n };\n\n target.addEventListener('scroll', onScroll, {passive: true, signal});\n onScroll();\n}\n\n/**\n * A Lit directive that adds app bar styling and optional scroll tracking functionality to its element.\n *\n * @example\n * ```ts\n * html`<div class=\"${appBar({size: 'md', scrolled: true})}\">\n * <div class=\"app-bar-top-row\">...</div>\n * <div class=\"app-bar-bottom-row\">...</div>\n * </div>`;\n * ```\n */\nexport const appBar = createClassMapDirective({\n getClasses: appBarClasses,\n setupElement: setupAppBar,\n});\n"]}
|