Commit Graph

63 Commits

Author SHA1 Message Date
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
Elizabeth Mitchell
7f50847bbd chore(ripple): merge static/theme-styles
PiperOrigin-RevId: 482549484
2022-10-20 11:34:58 -07:00
Elizabeth Mitchell
2e1816e817 chore(ripple): update to use local custom properties
PiperOrigin-RevId: 482544214
2022-10-20 11:16:51 -07:00
Elizabeth Mitchell
2ac6caf84e chore(ripple): flatten static/theme-styles
PiperOrigin-RevId: 482537324
2022-10-20 10:53:26 -07:00
Elizabeth Mitchell
73ca8ae0eb chore: use relative paths
PiperOrigin-RevId: 481941267
2022-10-18 09:28:59 -07:00
Material Web Team
32963e207a refactor(ripple): remove ripple when forced-colors is active
PiperOrigin-RevId: 474876313
2022-09-16 12:32:27 -07:00
Material Web Team
d1b0131a3f refactor(ripple): remove real timers from unit test
PiperOrigin-RevId: 472735384
2022-09-07 08:50:25 -07:00
Material Web Team
6362819aa9 refactor(ripple): move test file closer to the code it's testing
PiperOrigin-RevId: 472732363
2022-09-07 08:35:58 -07:00
Alexander Marks
30c95aeee1 chore: add ".js" extensions to import statements.
In particular, this allows external build tools like Rollup and @web/dev-server to understand imports of Lit, which is configured to require the ".js" extension via its export conditions (so that Lit import maps can remain minimal).

PiperOrigin-RevId: 469772992
2022-08-24 11:01:21 -07:00
Material Web Team
4d292f4cc6 feat(list): Add ripple to M3 list
PiperOrigin-RevId: 463358686
2022-07-26 09:42:26 -07:00
Material Web Team
0c2083add9 refactor(ripple): Move public sass mixins/functions to the top
PiperOrigin-RevId: 460713788
2022-07-13 07:51:48 -07:00
Elizabeth Mitchell
15d04ae3d2 chore(compat): add mwc-base compatibility deps
PiperOrigin-RevId: 456942410
2022-06-23 23:48:44 -07:00
Elizabeth Mitchell
2752e6d60e chore: add ripple
PiperOrigin-RevId: 455677714
2022-06-17 12:56:30 -07:00