react-toolbox/components/ripple/index.d.ts

62 lines
1.3 KiB
TypeScript
Raw Normal View History

import * as React from "react";
import ReactToolbox from "../index";
2016-07-24 14:17:16 +03:00
export interface RippleTheme {
/**
* Root classname for the ripple.
*/
ripple?: string;
/**
* Applied when the ripple is active.
*/
rippleActive?: string;
/**
* Applied when the ripple is restarting.
*/
rippleRestarting?: string;
/**
* Wrapper class to fit to the parent element.
*/
rippleWrapper?: string;
}
2016-12-19 22:13:36 +03:00
export interface RippleProps {
2016-07-24 14:17:16 +03:00
/**
* Children to pass through the component.
*/
children?: React.ReactNode;
2016-07-24 14:17:16 +03:00
/**
* True in case you want a centered ripple.
* @default false
*/
disabled?: boolean;
/**
* Function that will be called when the ripple animation ends.
*/
onRippleEnded?: Function;
/**
* Factor to indicate how much should the ripple spread under the component.
* @default 2
*/
spread?: number;
/**
* Classnames object defining the component style.
*/
theme?: RippleTheme;
2016-12-19 22:13:36 +03:00
/**
* Additional properties passed to rippled component.
*/
[key: string]: any;
2016-07-24 14:17:16 +03:00
}
2016-12-19 22:13:36 +03:00
export interface RippledComponentFactory {
<P, RippledComponent extends (React.ComponentClass<P> | React.SFC<P>)>(component: RippledComponent): RippledComponent;
}
export function rippleFactory(
options: RippleProps
): RippledComponentFactory;
export { rippleFactory as Ripple };
2016-12-19 22:13:36 +03:00
export default rippleFactory;