Skip to content

Commit b2a94b7

Browse files
rewrite all
1 parent eb20be3 commit b2a94b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+24022
-21608
lines changed

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
# React Floating Button Menu
1+
# react-floating-button-menu
22

3-
A Material floating button menu
3+
> A customizable floating action button menu
4+
5+
[![NPM](https://img.shields.io/npm/v/react-floating-button-menu.svg)](https://www.npmjs.com/package/react-floating-button-menu) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
46

57
Inspired by [react-material-floating-button](https://github.com/nobitagit/react-material-floating-button)
68

7-
## Installation
9+
## Install
810

9-
> npm install react-floating-button-menu --save
11+
```bash
12+
npm install --save react-floating-button-menu
13+
```
1014

1115
## Demo
1216

@@ -15,6 +19,7 @@ See the [project page](https://ifndefdeadmau5.github.io/react-floating-button-me
1519
## Usage
1620

1721
You can customize opening direction, speed, and styles of each button via props. Other options will be added soon
22+
1823
```javascript
1924
import {
2025
FloatingMenu,
@@ -62,15 +67,6 @@ state = {
6267
...
6368
```
6469

65-
## Try the Demos Locally
66-
```sh
67-
git clone https://github.com/ifndefdeadmau5/react-floating-button-menu.git
68-
cd react-floating-button-menu
69-
npm install
70-
cd docs
71-
npm install
72-
npm start
73-
```
70+
## License
7471

75-
## Contributing
76-
Any issues or PRs are welcome
72+
MIT © [ifndefdeadmau5](https://github.com/ifndefdeadmau5)

demo.gif

-172 KB
Binary file not shown.

dist/ChildButton.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Directions } from './FloatingMenu';
2+
export interface ChildButtonProps {
3+
icon?: any;
4+
direction?: Directions;
5+
index?: number;
6+
size?: number;
7+
spacing?: number;
8+
isOpen?: boolean;
9+
onClick?: any;
10+
background?: string;
11+
}
12+
declare const ChildButton: ({ direction, index, size, spacing, isOpen, onClick, icon, ...rest }: ChildButtonProps) => JSX.Element;
13+
export default ChildButton;

dist/FloatingMenu.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export declare const DIRECTIONS: {
2+
up: string;
3+
down: string;
4+
left: string;
5+
right: string;
6+
};
7+
export declare enum Directions {
8+
Up = "up",
9+
Down = "down",
10+
Left = "left",
11+
Right = "right"
12+
}
13+
export interface FloatingMenuProps {
14+
children: JSX.Element[] | JSX.Element | string;
15+
spacing?: number;
16+
slideSpeed?: number;
17+
direction?: Directions;
18+
isOpen: boolean;
19+
}
20+
declare const FloatingMenu: ({ slideSpeed, direction, isOpen, spacing, children, ...rest }: FloatingMenuProps) => JSX.Element;
21+
export default FloatingMenu;

dist/MainButton.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export interface MainButtonProps {
2+
iconActive: any;
3+
iconResting: any;
4+
isOpen?: boolean;
5+
background: string;
6+
onClick: any;
7+
size: number;
8+
}
9+
declare const MainButton: ({ iconResting, iconActive, isOpen, ...rest }: MainButtonProps) => JSX.Element;
10+
export default MainButton;

dist/index.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* add css module styles here (optional) */
2+
3+
._3ybTi {
4+
margin: 2em;
5+
padding: 0.5em;
6+
border: 2px solid #000;
7+
font-size: 2em;
8+
text-align: center;
9+
}

dist/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import ChildButton from './ChildButton';
2+
import FloatingMenu from './FloatingMenu';
3+
import MainButton from './MainButton';
4+
export { ChildButton, FloatingMenu, MainButton };

dist/index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.modern.js

Lines changed: 163 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)