Skip to content

Commit 796683a

Browse files
authored
Merge branch 'material-components:main' into main-community
2 parents 829b95c + e16e2f6 commit 796683a

253 files changed

Lines changed: 23201 additions & 637 deletions

File tree

Some content is hidden

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

button/internal/button.ts

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,23 @@ import {property, query, queryAssignedElements} from 'lit/decorators.js';
1212

1313
import {ARIAMixinStrict} from '../../internal/aria/aria.js';
1414
import {mixinDelegatesAria} from '../../internal/aria/delegate.js';
15-
import {
16-
FormSubmitter,
17-
setupFormSubmitter,
18-
type FormSubmitterType,
19-
} from '../../internal/controller/form-submitter.js';
2015
import {
2116
dispatchActivationClick,
2217
isActivationClick,
2318
} from '../../internal/events/form-label-activation.js';
24-
import {
25-
internals,
26-
mixinElementInternals,
27-
} from '../../labs/behaviors/element-internals.js';
19+
import {mixinElementInternals} from '../../labs/behaviors/element-internals.js';
20+
import {mixinFormAssociated} from '../../labs/behaviors/form-associated.js';
21+
import {mixinFormSubmitter} from '../../labs/behaviors/form-submitter.js';
2822

2923
// Separate variable needed for closure.
30-
const buttonBaseClass = mixinDelegatesAria(mixinElementInternals(LitElement));
24+
const buttonBaseClass = mixinDelegatesAria(
25+
mixinFormSubmitter(mixinFormAssociated(mixinElementInternals(LitElement))),
26+
);
3127

3228
/**
3329
* A button component.
3430
*/
35-
export abstract class Button extends buttonBaseClass implements FormSubmitter {
36-
static {
37-
setupFormSubmitter(Button);
38-
}
39-
40-
/** @nocollapse */
41-
static readonly formAssociated = true;
42-
31+
export abstract class Button extends buttonBaseClass {
4332
/** @nocollapse */
4433
static override shadowRootOptions: ShadowRootInit = {
4534
mode: 'open',
@@ -49,7 +38,7 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
4938
/**
5039
* Whether or not the button is disabled.
5140
*/
52-
@property({type: Boolean, reflect: true}) disabled = false;
41+
declare disabled: boolean; // for jsdoc until lit-analyzer is updated
5342

5443
/**
5544
* Whether or not the button is "soft-disabled" (disabled but still
@@ -95,32 +84,6 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
9584
@property({type: Boolean, attribute: 'has-icon', reflect: true}) hasIcon =
9685
false;
9786

98-
/**
99-
* The default behavior of the button. May be "button", "reset", or "submit"
100-
* (default).
101-
*/
102-
@property() type: FormSubmitterType = 'submit';
103-
104-
/**
105-
* The value added to a form with the button's name when the button submits a
106-
* form.
107-
*/
108-
@property({reflect: true}) value = '';
109-
110-
get name() {
111-
return this.getAttribute('name') ?? '';
112-
}
113-
set name(name: string) {
114-
this.setAttribute('name', name);
115-
}
116-
117-
/**
118-
* The associated form element with which this element's value will submit.
119-
*/
120-
get form() {
121-
return this[internals].form;
122-
}
123-
12487
@query('.button') private readonly buttonElement!: HTMLElement | null;
12588

12689
@queryAssignedElements({slot: 'icon', flatten: true})

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default {
3232
'progress',
3333
'radio',
3434
'ripple',
35+
'sass-ext',
3536
'select',
3637
'slider',
3738
'switch',

docs/components/button.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dirname: button
1212

1313
<!--*
1414
# Document freshness: For more information, see go/fresh-source.
15-
freshness: { owner: 'lizmitchell' reviewed: '2025-05-20' }
15+
freshness: { owner: 'lizmitchell' reviewed: '2025-11-23' }
1616
tag: 'docType:reference'
1717
*-->
1818

docs/components/checkbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dirname: checkbox
1212
# Document freshness: For more information, see go/fresh-source.
1313
freshness: {
1414
owner: 'lizmitchell'
15-
reviewed: '2025-05-20'
15+
reviewed: '2025-11-23'
1616
}
1717
tag: 'docType:reference'
1818
*-->

docs/components/chip.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dirname: chips
1010

1111
<!--*
1212
# Document freshness: For more information, see go/fresh-source.
13-
freshness: { owner: 'lizmitchell' reviewed: '2025-05-20' }
13+
freshness: { owner: 'lizmitchell' reviewed: '2025-11-23' }
1414
tag: 'docType:reference'
1515
*-->
1616

docs/components/dialog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dirname: dialog
1010

1111
<!--*
1212
# Document freshness: For more information, see go/fresh-source.
13-
freshness: { owner: 'lizmitchell' reviewed: '2025-05-20' }
13+
freshness: { owner: 'lizmitchell' reviewed: '2025-11-23' }
1414
tag: 'docType:reference'
1515
*-->
1616

docs/components/divider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!--*
44
# Document freshness: For more information, see go/fresh-source.
5-
freshness: { owner: 'lizmitchell' reviewed: '2025-05-20' }
5+
freshness: { owner: 'lizmitchell' reviewed: '2025-11-23' }
66
tag: 'docType:reference'
77
*-->
88

docs/components/elevation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!--*
44
# Document freshness: For more information, see go/fresh-source.
5-
freshness: { owner: 'lizmitchell' reviewed: '2025-05-20' }
5+
freshness: { owner: 'lizmitchell' reviewed: '2025-11-23' }
66
tag: 'docType:reference'
77
*-->
88

docs/components/fab.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dirname: fab
1212

1313
<!--*
1414
# Document freshness: For more information, see go/fresh-source.
15-
freshness: { owner: 'lizmitchell' reviewed: '2025-05-20' }
15+
freshness: { owner: 'lizmitchell' reviewed: '2025-11-23' }
1616
tag: 'docType:reference'
1717
*-->
1818

docs/components/focus-ring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!--*
44
# Document freshness: For more information, see go/fresh-source.
5-
freshness: { owner: 'lizmitchell' reviewed: '2025-05-20' }
5+
freshness: { owner: 'lizmitchell' reviewed: '2025-11-23' }
66
tag: 'docType:reference'
77
*-->
88

0 commit comments

Comments
 (0)