@@ -2,6 +2,7 @@ import * as React from 'react';
22import { BaseProps } from './types' ;
33import { useCustomElement } from './utils/useCustomElement' ;
44import { Icon } from './utils/icons' ;
5+
56const { useMemo } = React ;
67
78export interface WiredIconButtonProps extends BaseProps {
@@ -30,10 +31,12 @@ export interface WiredIconButtonProps extends BaseProps {
3031 * @default favorite
3132 */
3233 icon ?: Icon ;
34+
3335 /**
3436 * Event fired when button is clicked/submitted
3537 */
3638 onClick ?( e : MouseEvent ) : void ;
39+
3740 /**
3841 * The children. Optionally pass in your own icon.
3942 */
@@ -48,18 +51,24 @@ export const WiredIconButton = ({
4851 iconSize = 24 ,
4952 onClick,
5053 children,
54+ className,
55+ style,
5156} : WiredIconButtonProps ) => {
5257 const customValues = useMemo ( ( ) => {
5358 return {
5459 attributes : { disabled } ,
55- methods : { click : onClick } ,
5660 css : { color : lineColor , '--mdc-icon-size' : iconSize } ,
5761 } ;
58- } , [ disabled , lineColor , iconSize , onClick ] ) ;
62+ } , [ disabled , lineColor , iconSize ] ) ;
5963
6064 const register = useCustomElement ( customValues ) ;
6165 return (
62- < wired-icon-button ref = { register } >
66+ < wired-icon-button
67+ onClick = { onClick }
68+ class = { className }
69+ style = { style }
70+ ref = { register }
71+ >
6372 < div style = { { height : '24px' , width : '24px' } } >
6473 { children || (
6574 < span
0 commit comments