Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit a646a33

Browse files
mgr34Matt Goo
authored and
Matt Goo
committed
feat(fab): exited (#661)
1 parent 6876e62 commit a646a33

File tree

5 files changed

+282
-249
lines changed

5 files changed

+282
-249
lines changed

packages/fab/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ The Fab can be used with the `span`, `i`, `img` or `svg` elements. It can also b
4747
Prop Name | Type | Description
4848
--- | --- | ---
4949
className | String | Classes to be applied to the root element.
50-
mini | n/a | Enables the mini variant.
50+
exited | Boolean | When true animates the FAB out of view. When this false, the FAB will return to view.
51+
mini | Boolean | Enables the mini variant.
5152
icon | Element | The icon.
5253
textLabel | String | The label, which makes the FAB extended.
5354

packages/fab/index.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ import * as React from 'react';
2424
import * as classnames from 'classnames';
2525
import * as Ripple from '@material/react-ripple';
2626

27-
export interface FabProps extends Ripple.InjectedProps<HTMLButtonElement> {
28-
mini?: boolean;
29-
icon?: React.ReactElement<HTMLElement>;
30-
textLabel?: string;
31-
className?: string;
32-
initRipple: React.Ref<HTMLButtonElement>;
33-
unbounded: boolean;
27+
export interface FabProps extends Ripple.InjectedProps<HTMLButtonElement>,
28+
React.ButtonHTMLAttributes<HTMLButtonElement> {
29+
exited?: boolean;
30+
mini?: boolean;
31+
icon?: React.ReactElement<HTMLElement>;
32+
textLabel?: string;
33+
className?: string;
34+
initRipple: React.Ref<HTMLButtonElement>;
35+
unbounded: boolean;
3436
}
3537

3638
const Icon: React.FunctionComponent<{icon?: React.ReactElement<HTMLElement>}> = ({icon}) => {
@@ -54,6 +56,7 @@ const TextLabel: React.FunctionComponent<{textLabel: string}> = ({
5456

5557
export const Fab: React.FunctionComponent<FabProps & React.HTMLProps<HTMLButtonElement>> = ({
5658
/* eslint-disable react/prop-types */
59+
exited = false,
5760
mini = false,
5861
icon,
5962
textLabel = '',
@@ -67,6 +70,7 @@ export const Fab: React.FunctionComponent<FabProps & React.HTMLProps<HTMLButtonE
6770
const classes = classnames('mdc-fab', className, {
6871
'mdc-fab--mini': mini,
6972
'mdc-fab--extended': extended,
73+
'mdc-fab--exited': exited,
7074
});
7175

7276
return (

0 commit comments

Comments
 (0)