Skip to content

Commit 04ca20d

Browse files
authored
Merge branch 'main' into web-types
2 parents c5482b7 + 919fe12 commit 04ca20d

52 files changed

Lines changed: 1109 additions & 728 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: google/wireit@setup-github-actions-caching/v1
3232

3333
- run: npm ci
34-
- run: npx playwright install-deps
34+
- run: npx playwright install --with-deps
3535
- run: npm test
3636
env:
3737
WIREIT_FAILURES: continue

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ node_modules
99
*.d.ts
1010
!types/*.d.ts
1111
.wireit/
12+
*.tsbuildinfo
1213

1314
!catalog/**/*.css
1415
catalog/_dev
@@ -23,7 +24,6 @@ catalog/site/theming/*.md
2324
catalog/site/theming/images
2425
catalog/site/about/*.md
2526
catalog/site/about/images
26-
catalog/*.tsbuildinfo
2727
catalog/stories/*/
2828
!catalog/stories/components/
2929
!catalog/src/types/**/*.d.ts

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.0.0"
2+
".": "2.2.0"
33
}

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Changelog
22

3+
## [2.2.0](https://github.com/material-components/material-web/compare/v2.1.0...v2.2.0) (2024-09-17)
4+
5+
6+
### Features
7+
8+
* **field,textfield:** add `container` slot for custom background content ([44c13cd](https://github.com/material-components/material-web/commit/44c13cdd753108137e9765bf14a6ea3ed46be18e))
9+
10+
11+
### Bug Fixes
12+
13+
* **checkbox:** add override to symbol properties ([a9ee4f5](https://github.com/material-components/material-web/commit/a9ee4f5bc1d6702e5dc352eefed13a1d849577e3))
14+
* remove the input entirely and replace it with a touch target ([cf84a27](https://github.com/material-components/material-web/commit/cf84a271e75b806075427f4d176b38f8884fdd7e))
15+
* remove unnecessary css variable prefixes ([5044e6e](https://github.com/material-components/material-web/commit/5044e6eb2fe6c6bd3e53b19bef04ba6b6c0b2a2b))
16+
* Replace aria-hidden attribute with inert attribute in <md-radio> component ([192f17e](https://github.com/material-components/material-web/commit/192f17e8c1ce4a38cf76b5a81cb6c2b1ddcfbe46))
17+
* Set touch target to `display: none` ([a696121](https://github.com/material-components/material-web/commit/a69612162d79b63f0b82da0468201942dc82ed9e))
18+
19+
## [2.1.0](https://github.com/material-components/material-web/compare/v2.0.0...v2.1.0) (2024-08-20)
20+
21+
22+
### Features
23+
24+
* **switch:** add touch target token ([b8f362a](https://github.com/material-components/material-web/commit/b8f362a97d8369e0f6bab834794f99bd50b5ab78))
25+
* **textfield,field:** add leading/trailing icon spacing tokens ([c1991c4](https://github.com/material-components/material-web/commit/c1991c4c894c48fe77abe09a2791f97dc77d438f))
26+
27+
28+
### Bug Fixes
29+
30+
* changed checkmark to check in md-icon selected slot ([2e2817b](https://github.com/material-components/material-web/commit/2e2817bab5fc51bb32363b36471cb01d1f029a46))
31+
332
## [2.0.0](https://github.com/material-components/material-web/compare/v1.5.1...v2.0.0) (2024-07-23)
433

534

button/internal/button.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
6767
*/
6868
@property() href = '';
6969

70+
/**
71+
* The filename to use when downloading the linked resource.
72+
* If not specified, the browser will determine a filename.
73+
* This is only applicable when the button is used as a link (`href` is set).
74+
*/
75+
@property() download = '';
76+
7077
/**
7178
* Where to display the linked `href` URL for a link button. Common options
7279
* include `_blank` to open in a new tab.
@@ -184,6 +191,7 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
184191
aria-haspopup="${ariaHasPopup || nothing}"
185192
aria-expanded="${ariaExpanded || nothing}"
186193
href=${this.href}
194+
download=${this.download || nothing}
187195
target=${this.target || nothing}
188196
>${this.renderContent()}
189197
</a>`;

catalog/package.json

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
},
2424
"wireit": {
2525
"build:dev": {
26-
"dependencies": ["build:dev:eleventy", "build:dev:ts", "build:type-check"]
26+
"dependencies": [
27+
"build:dev:eleventy",
28+
"build:dev:ts",
29+
"build:type-check"
30+
]
2731
},
2832
"build:dev:eleventy": {
2933
"command": "NODE_ENV=DEV eleventy",
@@ -34,21 +38,42 @@
3438
"eleventy.config.cjs",
3539
"stories"
3640
],
37-
"output": ["_dev"],
38-
"dependencies": ["build:dev:ts", "build:copy-docs", "build:copy-stories"]
41+
"output": [
42+
"_dev"
43+
],
44+
"dependencies": [
45+
"build:dev:ts",
46+
"build:copy-docs",
47+
"build:copy-stories"
48+
]
3949
},
4050
"build:dev:ts": {
4151
"command": "NODE_ENV=DEV node esbuild.config.mjs",
42-
"files": ["src", "tsconfig.json", "esbuild.config.mjs"],
43-
"output": ["lib"],
44-
"dependencies": ["..:build"]
52+
"files": [
53+
"src",
54+
"tsconfig.json",
55+
"esbuild.config.mjs"
56+
],
57+
"output": [
58+
"lib"
59+
],
60+
"dependencies": [
61+
"..:build"
62+
]
4563
},
4664
"build:type-check": {
4765
"command": "tsc -p tsconfig.json --pretty --incremental",
48-
"files": ["src", "tsconfig.json"],
66+
"files": [
67+
"src",
68+
"tsconfig.json"
69+
],
4970
"clean": "if-file-deleted",
50-
"output": ["tsconfig.tsbuildinfo"],
51-
"dependencies": ["..:build"]
71+
"output": [
72+
"tsconfig.tsbuildinfo"
73+
],
74+
"dependencies": [
75+
"..:build"
76+
]
5277
},
5378
"build:prod": {
5479
"dependencies": [
@@ -66,14 +91,28 @@
6691
"eleventy.config.cjs",
6792
"stories/"
6893
],
69-
"output": ["_prod/"],
70-
"dependencies": ["build:prod:ts", "build:copy-docs", "build:copy-stories"]
94+
"output": [
95+
"_prod/"
96+
],
97+
"dependencies": [
98+
"build:prod:ts",
99+
"build:copy-docs",
100+
"build:copy-stories"
101+
]
71102
},
72103
"build:prod:ts": {
73104
"command": "NODE_ENV=PROD node esbuild.config.mjs",
74-
"files": ["src", "tsconfig.json", "esbuild.config.mjs"],
75-
"output": ["build"],
76-
"dependencies": ["..:build"]
105+
"files": [
106+
"src",
107+
"tsconfig.json",
108+
"esbuild.config.mjs"
109+
],
110+
"output": [
111+
"build"
112+
],
113+
"dependencies": [
114+
"..:build"
115+
]
77116
},
78117
"build:copy-docs": {
79118
"command": "node scripts/copy-docs.mjs",
@@ -121,7 +160,10 @@
121160
"!node_modules",
122161
"!../node_modules"
123162
],
124-
"output": ["stories/*/**/*", "!stories/components"]
163+
"output": [
164+
"stories/*/**/*",
165+
"!stories/components"
166+
]
125167
}
126168
},
127169
"license": "Apache-2.0",
@@ -132,7 +174,7 @@
132174
"@material/mwc-drawer": "^0.27.0",
133175
"@material/web": "*",
134176
"@preact/signals-core": "^1.3.0",
135-
"lit": "^2.7.4",
177+
"lit": "^2.8.0",
136178
"playground-elements": "^0.17.0",
137179
"postdoc-lib": "^1.0.3"
138180
},
@@ -155,7 +197,7 @@
155197
"markdown-it-anchor": "^8.6.7",
156198
"slugify": "^1.6.6",
157199
"tiny-glob": "^0.2.9",
158-
"typescript": "~5.1.6",
200+
"typescript": "5.6.2",
159201
"wireit": "^0.13.0"
160202
}
161203
}

catalog/src/components/copy-code-button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class CopyCodeButton extends LitElement {
8080
aria-label=${this.label}
8181
aria-label-selected=${this.successLabel}>
8282
<md-icon>content_copy</md-icon>
83-
<md-icon slot="selected">checkmark</md-icon>
83+
<md-icon slot="selected">check</md-icon>
8484
</md-icon-button>
8585
`;
8686
}

checkbox/internal/checkbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ export class Checkbox extends checkboxBaseClass {
204204
this.checked = state === 'true';
205205
}
206206

207-
[createValidator]() {
207+
override [createValidator]() {
208208
return new CheckboxValidator(() => this);
209209
}
210210

211-
[getValidityAnchor]() {
211+
override [getValidityAnchor]() {
212212
return this.input;
213213
}
214214
}

chips/internal/assist-chip.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ import {Chip} from './chip.js';
1919
export class AssistChip extends Chip {
2020
@property({type: Boolean}) elevated = false;
2121
@property() href = '';
22+
/**
23+
* The filename to use when downloading the linked resource.
24+
* If not specified, the browser will determine a filename.
25+
* This is only applicable when the chip is used as a link (`href` is set).
26+
*/
27+
@property() download = '';
2228
@property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';
2329

2430
protected get primaryId() {
@@ -49,6 +55,7 @@ export class AssistChip extends Chip {
4955
id="link"
5056
aria-label=${ariaLabel || nothing}
5157
href=${this.href}
58+
download=${this.download || nothing}
5259
target=${this.target || nothing}
5360
>${content}</a
5461
>

docs/components/button.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ payment'"
107107
</style>
108108
<div class="wrapper">
109109
<div>
110-
<md-elevated-button hasicon>
110+
<md-elevated-button has-icon>
111111
<md-icon slot="icon">add</md-icon>
112112
Elevated
113113
</md-elevated-button>
@@ -725,6 +725,7 @@ Token | Default value
725725

726726
## API
727727

728+
728729
### MdElevatedButton <code>&lt;md-elevated-button&gt;</code>
729730

730731
#### Properties
@@ -734,7 +735,7 @@ Token | Default value
734735
| Property | Attribute | Type | Default | Description |
735736
| --- | --- | --- | --- | --- |
736737
| `disabled` | `disabled` | `boolean` | `false` | Whether or not the button is disabled. |
737-
| `softDisabled` | `soft-disabled` | `boolean` | `false` | Whether the button is "soft-disabled" (disabled but still focusable). |
738+
| `softDisabled` | `soft-disabled` | `boolean` | `false` | Whether or not the button is "soft-disabled" (disabled but still focusable).<br>Use this when a button needs increased visibility when disabled. See https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls for more guidance on when this is needed. |
738739
| `href` | `href` | `string` | `''` | The URL that the link button points to. |
739740
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
740741
| `trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |
@@ -755,6 +756,7 @@ Token | Default value
755756
| Property | Attribute | Type | Default | Description |
756757
| --- | --- | --- | --- | --- |
757758
| `disabled` | `disabled` | `boolean` | `false` | Whether or not the button is disabled. |
759+
| `softDisabled` | `soft-disabled` | `boolean` | `false` | Whether or not the button is "soft-disabled" (disabled but still focusable).<br>Use this when a button needs increased visibility when disabled. See https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls for more guidance on when this is needed. |
758760
| `href` | `href` | `string` | `''` | The URL that the link button points to. |
759761
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
760762
| `trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |
@@ -775,6 +777,7 @@ Token | Default value
775777
| Property | Attribute | Type | Default | Description |
776778
| --- | --- | --- | --- | --- |
777779
| `disabled` | `disabled` | `boolean` | `false` | Whether or not the button is disabled. |
780+
| `softDisabled` | `soft-disabled` | `boolean` | `false` | Whether or not the button is "soft-disabled" (disabled but still focusable).<br>Use this when a button needs increased visibility when disabled. See https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls for more guidance on when this is needed. |
778781
| `href` | `href` | `string` | `''` | The URL that the link button points to. |
779782
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
780783
| `trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |
@@ -795,6 +798,7 @@ Token | Default value
795798
| Property | Attribute | Type | Default | Description |
796799
| --- | --- | --- | --- | --- |
797800
| `disabled` | `disabled` | `boolean` | `false` | Whether or not the button is disabled. |
801+
| `softDisabled` | `soft-disabled` | `boolean` | `false` | Whether or not the button is "soft-disabled" (disabled but still focusable).<br>Use this when a button needs increased visibility when disabled. See https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls for more guidance on when this is needed. |
798802
| `href` | `href` | `string` | `''` | The URL that the link button points to. |
799803
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
800804
| `trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |
@@ -815,6 +819,7 @@ Token | Default value
815819
| Property | Attribute | Type | Default | Description |
816820
| --- | --- | --- | --- | --- |
817821
| `disabled` | `disabled` | `boolean` | `false` | Whether or not the button is disabled. |
822+
| `softDisabled` | `soft-disabled` | `boolean` | `false` | Whether or not the button is "soft-disabled" (disabled but still focusable).<br>Use this when a button needs increased visibility when disabled. See https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls for more guidance on when this is needed. |
818823
| `href` | `href` | `string` | `''` | The URL that the link button points to. |
819824
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
820825
| `trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |

0 commit comments

Comments
 (0)