@riishabh/react-calender-heatmap 1.0.0
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 +21 -0
- package/README.md +34 -0
- package/dist/cjs/index.js +1519 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types/components/Button/Button.d.ts +6 -0
- package/dist/cjs/types/components/Button/Buttons.stories.d.ts +16 -0
- package/dist/cjs/types/components/Button/index.d.ts +2 -0
- package/dist/cjs/types/components/Input/Input.d.ts +2 -0
- package/dist/cjs/types/components/Input/index.d.ts +2 -0
- package/dist/cjs/types/components/Tilechart/Tile.stories.d.ts +15 -0
- package/dist/cjs/types/components/Tilechart/Tilechart.d.ts +13 -0
- package/dist/cjs/types/components/Tilechart/index.d.ts +2 -0
- package/dist/cjs/types/components/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts +2 -0
- package/dist/cjs/types/stories/Button.d.ts +28 -0
- package/dist/cjs/types/stories/Header.d.ts +12 -0
- package/dist/cjs/types/stories/Page.d.ts +3 -0
- package/dist/esm/index.js +1517 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types/components/Button/Button.d.ts +6 -0
- package/dist/esm/types/components/Button/Buttons.stories.d.ts +16 -0
- package/dist/esm/types/components/Button/index.d.ts +2 -0
- package/dist/esm/types/components/Input/Input.d.ts +2 -0
- package/dist/esm/types/components/Input/index.d.ts +2 -0
- package/dist/esm/types/components/Tilechart/Tile.stories.d.ts +15 -0
- package/dist/esm/types/components/Tilechart/Tilechart.d.ts +13 -0
- package/dist/esm/types/components/Tilechart/index.d.ts +2 -0
- package/dist/esm/types/components/index.d.ts +1 -0
- package/dist/esm/types/index.d.ts +2 -0
- package/dist/esm/types/stories/Button.d.ts +28 -0
- package/dist/esm/types/stories/Header.d.ts +12 -0
- package/dist/esm/types/stories/Page.d.ts +3 -0
- package/dist/index.d.ts +14 -0
- package/package.json +98 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Rishabh Sharma
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# TileChart Component
|
|
2
|
+
|
|
3
|
+
The `TileChart` is a React component that displays data in a tile format, where each tile represents a day. The color of the tile indicates the status of that day, which can be "success", "warning", or "alert".
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
- `data`: An array of objects, where each object represents a day and has a `date` and a `status`. The `date` is a string in ISO format, and the `status` can be "success", "warning", or "alert".
|
|
8
|
+
- `range`: The number of months to display. It can be 3, 6, or 12. The default is 6.
|
|
9
|
+
- `onTileHover`: A callback function that is called when a tile is hovered over. It receives the date and status of the hovered tile.
|
|
10
|
+
- `tileText`: A string that is displayed on each tile.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import TileChart from './TileChart';
|
|
16
|
+
|
|
17
|
+
const data = [
|
|
18
|
+
{ date: '2022-01-01T00:00:00.000Z', status: 'success' },
|
|
19
|
+
{ date: '2022-01-02T00:00:00.000Z', status: 'warning' },
|
|
20
|
+
// More data...
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
function App() {
|
|
24
|
+
return (
|
|
25
|
+
<TileChart
|
|
26
|
+
data={data}
|
|
27
|
+
range={6}
|
|
28
|
+
onTileHover={(date, status) => console.log(date, status)}
|
|
29
|
+
tileText="Day"
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default App;
|