Commit Graph

3420 Commits

Author SHA1 Message Date
Material Web Team
7473f4647d feat(switch): Switch now supports label activation by setting formAssociated.
PiperOrigin-RevId: 495993033
2022-12-16 17:06:39 -08:00
Material Web Team
3f6070ea31 chore(testing): Adds submitForm to testing harness. This submits the element's associated form if one exists and returns the submitted FormData object.
* updates form_controller tests.
* updates switch tests.
* adds form submission tests to text field.

PiperOrigin-RevId: 495992202
2022-12-16 17:01:56 -08:00
Daniel Freedman
0327283b7b feat(icon): Implement tokens for md-icon
Adds tokens for color, size, font-family, font-weight and font-variation-settings.

Slotted svg icons will also be sized and colored with the tokens.

PiperOrigin-RevId: 495716570
2022-12-15 15:46:19 -08:00
Material Web Team
cb55c90743 Improves how button handles activation clicks. Previously click() was overridden and this did not support directly dispatched click events. Now click events are explicitly handled if the event is targeted at the element itself. Since click() dispatches a click event, it no longer needs to be overridden.
PiperOrigin-RevId: 495694515
2022-12-15 14:17:03 -08:00
Material Web Team
4e3054bab3 feat(controller): add label activation support to FormController
Extends `FormController` to provide label activation via form associated custom elements via a shim where not supported (currently just Safari).

Performing label activation is the responsibility of form associated elements.

Helpers are provided to facilitate this, including `isActivationClick` and `dispatchActivationClick`. Note, any element that should perform an action via a click, could use these helpers to help distinguish external "activation" clicks.

PiperOrigin-RevId: 495689270
2022-12-15 13:56:49 -08:00
Material Web Team
2ce167ff70 clean up soy comments, remove hidden input, and add change event
PiperOrigin-RevId: 495453747
2022-12-14 16:49:43 -08:00
Daniel Freedman
cf0e6b41c6 chore(button): Normalize lazy ripple with other components
PiperOrigin-RevId: 495429247
2022-12-14 15:11:11 -08:00
Material Web Team
9796f6a694 Document Icon Button
PiperOrigin-RevId: 495414969
2022-12-14 14:18:45 -08:00
Material Web Team
f73c097141 Document focus-ring
PiperOrigin-RevId: 495402514
2022-12-14 13:32:05 -08:00
Daniel Freedman
f84e1557c2 chore(iconbutton): Remove ActionElement and create ripple lazily
PiperOrigin-RevId: 495365790
2022-12-14 11:15:52 -08:00
Material Web Team
74bda6e11c Document md-button
PiperOrigin-RevId: 495160072
2022-12-13 16:45:36 -08:00
Elizabeth Mitchell
27f7ea89ce feat(checkbox): refactor and simplify rendering/style logic
BREAKING CHANGE: Removed reducedTouchTarget. Instead, set the width and height on the checkbox.

PiperOrigin-RevId: 495087302
2022-12-13 11:59:05 -08:00
Elizabeth Mitchell
545c2eb494 fix(button): use new elevation component
PiperOrigin-RevId: 495085105
2022-12-13 11:51:20 -08:00
Elizabeth Mitchell
aef3ee3d3f chore(fab): use new elevation component
PiperOrigin-RevId: 495078250
2022-12-13 11:26:08 -08:00
Elizabeth Mitchell
7e316b8725 chore(navigationbar): use new elevation component
PiperOrigin-RevId: 495076686
2022-12-13 11:20:03 -08:00
Elizabeth Mitchell
9eb7bf081f feat(elevation): create md-elevation component
PiperOrigin-RevId: 495074655
2022-12-13 11:13:05 -08:00
Elizabeth Mitchell
ac94e489f1 chore(ripple): add ripple file instead of ripple-theme
PiperOrigin-RevId: 495047382
2022-12-13 09:40:29 -08:00
Material Web Team
c8341bbaee Document Switch
PiperOrigin-RevId: 494890466
2022-12-12 19:02:03 -08:00
Elizabeth Mitchell
a5850dccba chore(ripple): remove negative z-index
PiperOrigin-RevId: 494293324
2022-12-09 16:45:45 -08:00
Elizabeth Mitchell
eedb7f5d3c chore: replace * selector with :host
PiperOrigin-RevId: 493992896
2022-12-08 14:15:19 -08:00
Material Web Team
0ae1cccb8b Unblock TS4.8 upgrade.
PiperOrigin-RevId: 493982496
2022-12-08 13:36:27 -08:00
Material Web Team
212dd55dc5 IconButton now properly renders either an icon via the icon property or one specified via a slot, not both as it previously incorrectly did.
PiperOrigin-RevId: 493653205
2022-12-07 11:02:04 -08:00
Elizabeth Mitchell
89eee57074 chore(elevation): branch elevation styles
PiperOrigin-RevId: 493625319
2022-12-07 09:27:08 -08:00
Daniel Freedman
ca88cd765e chore(button): Create ripple lazily for buttons
PiperOrigin-RevId: 493350615
2022-12-06 10:44:09 -08:00
Material Web Team
07edf86432 Changes icon-button-toggle-*'s isOn property to be named selected.
This matches the name used for Switch and other "selectable" elements that do not have platform analogs suggesting other names (i.e. Checkbox and Radio have a `checked` property).

PiperOrigin-RevId: 493098361
2022-12-05 13:34:58 -08:00
Material Web Team
73ed7a0233 fix(checkbox): Update checkbox to use property bindings for disabled and checked on internal input element.
After interaction with the native input, attribute bindings to it are ignored per platform standard behavior. Binding to the property fixes this issue.

PiperOrigin-RevId: 493048723
2022-12-05 10:33:36 -08:00
Daniel Freedman
1f2f26caad chore(button): Use ripple directive instead of ActionElement
PiperOrigin-RevId: 492334221
2022-12-01 16:53:30 -08:00
Daniel Freedman
6746d0f685 feat(ripple): Create a ripple directive
This directive encapsulates the event listeners necessary to drive the ripple component inside of an ElementPart directive, instead of relying on ActionController and ActionElement.

The ripple directive can take a Promise from `queryAsync`, or a function that returns a Ripple or a Promise that resolves to a ripple

Before:
```ts
// event listeners inherited from ActionElement
html`
<md-button
@pointerdown=${this.handlePointerDown}
@pointerleave=${this.handlePointerLeave}
@focus=${this.handleFocus}
...
>`
```

After:
```ts
html`
<md-button ${ripple(this.rippleElementPromise)}>
`
```
or
```
<md-button ${ripple(() => this.rippleElement)
```
or
```
<md-button ${ripple(() => {this.renderRipple = true; return this.rippleElementPromise})
```
PiperOrigin-RevId: 492300868
2022-12-01 14:29:57 -08:00
Copybara-Service
c076fbc575 Merge pull request #3799 from material-components:ci-tests
PiperOrigin-RevId: 492196098
2022-12-01 07:57:38 -08:00
Alexander Marks
d64eb1b803 Comment out webkit 2022-11-30 15:46:03 -08:00
Alexander Marks
e8ef2dfc46 PR feedback 2022-11-30 15:43:43 -08:00
Alexander Marks
066219f082 Merge branch 'master' into ci-tests 2022-11-30 11:44:18 -08:00
Alexander Marks
933cb14ac8 chore: Comment-out jasmine import statements for external compatibility
PiperOrigin-RevId: 491970248
2022-11-30 11:18:44 -08:00
Elizabeth Mitchell
cb5eaa3e8e chore(tokens): remove v0.96
PiperOrigin-RevId: 491952022
2022-11-30 10:14:12 -08:00
Alexander Marks
9b598850dd Add build and test GitHub actions 2022-11-29 20:16:35 -08:00
Alexander Marks
3b81050d7e Check in package lock for more reliable CI build 2022-11-29 20:16:35 -08:00
Alexander Marks
f151a028b9 Comment out invalid jasmine imports 2022-11-29 20:16:35 -08:00
Alexander Marks
88b0a0bca9 Set up test script with @web/test-runner 2022-11-29 20:16:30 -08:00
Alexander Marks
e22e89e465 Add type:module and convert css-to-ts.js to a module 2022-11-29 17:02:52 -08:00
Alexander Marks
89054e4154 Exclude irrelevant types like node and remove skipLibCheck 2022-11-29 17:00:05 -08:00
Alexander Marks
802bdccd1a Upgrade dependencies 2022-11-29 16:59:39 -08:00
Alexander Marks
0c84de8274 Add test dependencies 2022-11-29 16:59:36 -08:00
Elizabeth Mitchell
30f5e44e0c chore: update tokens
PiperOrigin-RevId: 491753341
2022-11-29 15:31:06 -08:00
Elizabeth Mitchell
491efc577f chore(text-field): update tokens
PiperOrigin-RevId: 491752389
2022-11-29 15:26:30 -08:00
Elizabeth Mitchell
4ba3f74d7f chore(navigation-bar): update tokens
PiperOrigin-RevId: 491730843
2022-11-29 14:05:50 -08:00
Elizabeth Mitchell
3724687b17 chore(button): update tokens
PiperOrigin-RevId: 491730790
2022-11-29 14:05:35 -08:00
Elizabeth Mitchell
395f297875 chore(radio): update tokens
PiperOrigin-RevId: 491730735
2022-11-29 14:03:50 -08:00
Elizabeth Mitchell
282dbe0cf1 chore(fab): update tokens
PiperOrigin-RevId: 491730693
2022-11-29 14:02:18 -08:00
Elizabeth Mitchell
0e41c696a7 chore(switch): update tokens
PiperOrigin-RevId: 491730567
2022-11-29 14:00:44 -08:00
Elizabeth Mitchell
85e8c46acc chore(checkbox): update tokens
PiperOrigin-RevId: 491730162
2022-11-29 13:59:07 -08:00