react-animated-waves 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +13 -16
- package/README.md +28 -21
- package/dist/index.d.ts +10 -8
- package/dist/index.js +1493 -164
- package/package.json +52 -109
- package/dist/index.es.js +0 -2
- package/dist/index.min.js +0 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2025 Rohit Agrawal
|
|
4
4
|
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
6
|
+
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
9
|
+
following conditions:
|
|
11
10
|
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
12
|
+
portions of the Software.
|
|
14
13
|
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
15
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
16
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
17
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
18
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,35 +1,42 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<p align="center" style="width: 80%; margin: auto">
|
|
6
|
-
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/agrawal-rohit/react-animated-waves/Publish.yml">
|
|
7
|
-
<img alt="Codacy coverage" src="https://img.shields.io/codacy/coverage/09220ab3d193472ba76d1ad50f11ee51">
|
|
8
|
-
<img alt="npm" src="https://img.shields.io/npm/dw/react-animated-waves">
|
|
9
|
-
<img alt="Licence" src="https://img.shields.io/github/license/agrawal-rohit/react-animated-waves">
|
|
10
|
-
</p>
|
|
2
|
+
<h2>React Animated Waves</h2>
|
|
3
|
+
</div>
|
|
11
4
|
|
|
12
|
-
|
|
5
|
+
<div align="center">
|
|
6
|
+
<p align="center" style="width: 80%; margin: auto">
|
|
7
|
+
<a href="https://github.com/agrawal-rohit/grimoire"><img alt="Made with Grimoire" src="https://img.shields.io/badge/made_with-grimoire-7452A3"></a>
|
|
8
|
+
<img alt="Status" src="https://img.shields.io/github/actions/workflow/status/agrawal-rohit/react-animated-waves/ci.yml">
|
|
9
|
+
<img alt="Sonar Coverage" src="https://img.shields.io/sonar/coverage/agrawal-rohit_react-animated-waves?server=https%3A%2F%2Fsonarcloud.io">
|
|
10
|
+
<img alt="Downloads" src="https://img.shields.io/npm/dt/react-animated-waves">
|
|
11
|
+
<img alt="NPM bundle size" src="https://img.shields.io/bundlephobia/min/react-animated-waves">
|
|
12
|
+
<img alt="License" src="https://img.shields.io/github/license/agrawal-rohit/react-animated-waves" />
|
|
13
|
+
</p>
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
[Installation](#installation) • [Demo](#demo) • [Usage](#usage) • [Contributing](#contributing) • [License](#license)
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
<img src="https://cdn.rohit.build/oss/react-animated-waves/github-readme-preview.gif" alt="Preview" style="width: 80%; margin: auto" />
|
|
17
18
|
|
|
18
19
|
</div>
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
<br />
|
|
22
|
+
|
|
23
|
+
`react-animated-waves` is an opinionated canvas-based React component for displaying wave animations. The colors and strength of the wave animations can be customized to support dynamic UIs such as audio visualizations, voice UIs, progress loaders, etc.
|
|
21
24
|
|
|
22
25
|
## Installation
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
`react-animated-waves` can be installed using [npm](https://www.npmjs.com/) (or your favorite package manager):
|
|
25
28
|
|
|
26
29
|
```bash
|
|
27
|
-
npm install react-animated-waves
|
|
30
|
+
$ npm install react-animated-waves
|
|
28
31
|
```
|
|
29
32
|
|
|
33
|
+
## Demo
|
|
34
|
+
|
|
35
|
+
Check out an interactive demo [here](https://codesandbox.io/p/sandbox/react-animated-waves-example-6z9hlh).
|
|
36
|
+
|
|
30
37
|
## Usage
|
|
31
38
|
|
|
32
|
-
Import the `Waves` component from
|
|
39
|
+
Import the `Waves` component from `react-animated-waves` and use it in your React app as follows:
|
|
33
40
|
|
|
34
41
|
```jsx
|
|
35
42
|
import Waves from "react-animated-waves";
|
|
@@ -37,19 +44,19 @@ import Waves from "react-animated-waves";
|
|
|
37
44
|
<Waves amplitude={20} colors={["#FF6AC6", "#436EDB", "#FF6AC6"]} />;
|
|
38
45
|
```
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
### Props
|
|
41
48
|
|
|
42
49
|
The `Waves` component accepts the following props:
|
|
43
50
|
|
|
44
51
|
| Prop | Description | Default |
|
|
45
52
|
| ----------- | --------------------------------------------------------------------------- | ------------- |
|
|
46
|
-
| `amplitude` | Defines the
|
|
47
|
-
| `colors` | An array of colors used to create a linear gradient effect on the waveform. | `['#436EDB']` |
|
|
53
|
+
| `amplitude` | Defines the strength of the waveform. Higher values result in taller waves. | `20` |
|
|
54
|
+
| `colors` | An array of hex colors used to create a linear gradient effect on the waveform. | `['#436EDB']` |
|
|
48
55
|
|
|
49
56
|
## Contributing
|
|
50
57
|
|
|
51
|
-
|
|
58
|
+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to report issues, propose changes, and submit pull requests.
|
|
52
59
|
|
|
53
60
|
## License
|
|
54
61
|
|
|
55
|
-
[MIT
|
|
62
|
+
[MIT](LICENSE) © [Rohit Agrawal](https://github.com/agrawal-rohit)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react0 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/waves.d.ts
|
|
2
4
|
type WavesProps = React.DetailedHTMLProps<React.CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement> & {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/** The colors for the waveform */
|
|
6
|
+
colors?: string[];
|
|
7
|
+
/** The amplitude of the waveform */
|
|
8
|
+
amplitude?: number;
|
|
7
9
|
};
|
|
8
|
-
declare const
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
declare const Waves: react0.NamedExoticComponent<WavesProps>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Waves };
|