material-web/ripple
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
..
lib chore(ripple): merge static/theme-styles 2022-10-20 11:34:58 -07:00
_ripple-theme.scss chore(ripple): merge static/theme-styles 2022-10-20 11:34:58 -07:00
directive.ts feat(ripple): Create a ripple directive 2022-12-01 14:29:57 -08:00
ripple.ts chore: add ".js" extensions to import statements. 2022-08-24 11:01:21 -07:00