react-hook-toolkit 1.1.9 → 1.2.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.
@@ -0,0 +1,23 @@
1
+ export declare const FileSkeleton: ({ length, width, borderColor }: {
2
+ length?: number | undefined;
3
+ width?: number | undefined;
4
+ borderColor?: string | undefined;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const TableSkeleton: ({ rows, columns }: {
7
+ rows?: number | undefined;
8
+ columns?: number | undefined;
9
+ }) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const LineChartSkeleton: () => import("react/jsx-runtime").JSX.Element;
11
+ export declare const CardSkeleton: () => import("react/jsx-runtime").JSX.Element;
12
+ export declare const PieChartSkeleton: React.FC;
13
+ export declare const FieldSkeleton: ({ length, width, spacing, isLabel, responsive, }: {
14
+ length?: number | undefined;
15
+ width?: string | undefined;
16
+ spacing?: number | undefined;
17
+ isLabel?: boolean | undefined;
18
+ responsive?: {
19
+ xs: number;
20
+ sm: number;
21
+ md: number;
22
+ } | undefined;
23
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,115 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { createElement as _createElement } from "react";
13
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { Box, Card, CardContent, CardHeader, Grid, IconButton, Skeleton, Table, TableBody, TableCell, TableHead, TableRow, Toolbar, Tooltip, } from "@mui/material";
15
+ import { Download } from "@mui/icons-material";
16
+ export var FileSkeleton = function (_a) {
17
+ var _b = _a.length, length = _b === void 0 ? 1 : _b, _c = _a.width, width = _c === void 0 ? 350 : _c, _d = _a.borderColor, borderColor = _d === void 0 ? '#dfdfdf' : _d;
18
+ return (_jsx(Grid, { container: true, spacing: 2, children: Array.from({ length: length }).map(function (_, index) { return (_jsx(Grid, { item: true, children: _jsx(Card, { variant: "outlined", sx: {
19
+ maxWidth: width,
20
+ minWidth: width,
21
+ border: "1px solid ".concat(borderColor),
22
+ borderRadius: 1,
23
+ '&:hover': { boxShadow: 2 },
24
+ marginLeft: 3,
25
+ }, children: _jsxs(CardContent, { sx: {
26
+ display: 'flex',
27
+ alignItems: 'center',
28
+ gap: 2,
29
+ padding: '8px !important',
30
+ }, children: [_jsx(Skeleton, { variant: "rectangular", width: 50, height: 40 }), _jsxs(Box, { sx: { flexGrow: 1 }, children: [_jsx(Skeleton, { variant: "text", width: width - 120, height: 20 }), _jsx(Skeleton, { variant: "text", width: 60, height: 14 })] }), _jsx(IconButton, { disabled: true, sx: { color: '#dfdfdf' }, children: _jsx(Download, { fontSize: "small", color: "disabled" }) })] }) }) }, index.toString())); }) }));
31
+ };
32
+ export var TableSkeleton = function (_a) {
33
+ var _b = _a.rows, rows = _b === void 0 ? 6 : _b, _c = _a.columns, columns = _c === void 0 ? 6 : _c;
34
+ return (_jsxs(Box, { sx: { width: '100%', overflowX: 'auto' }, children: [_jsxs(Toolbar, { sx: {
35
+ display: 'flex',
36
+ justifyContent: 'space-between',
37
+ p: 1,
38
+ borderBottom: '1px solid #dbdbdb',
39
+ }, children: [_jsx(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: _jsx(Skeleton, { variant: "rectangular", width: 200, height: 40 }) }), _jsx(Box, { children: _jsx(Tooltip, { title: "Filter", children: _jsx(IconButton, { children: _jsx(Skeleton, { variant: "circular", width: 40, height: 40 }) }) }) })] }), _jsxs(Table, { "aria-label": "loading table", children: [_jsx(TableHead, { children: _jsx(TableRow, { children: Array.from({ length: columns }).map(function (_, index) { return (_jsx(TableCell, { children: _jsx(Skeleton, { variant: "rectangular", height: 20 }) }, "head-".concat(index))); }) }) }), _jsx(TableBody, { children: Array.from({ length: rows }).map(function (_, rowIndex) { return (_jsx(TableRow, { children: Array.from({ length: columns }).map(function (_, colIndex) { return (_jsx(TableCell, { children: _jsx(Skeleton, { animation: "wave", variant: "text", width: "100%" }) }, "cell-".concat(rowIndex, "-").concat(colIndex))); }) }, "row-".concat(rowIndex))); }) })] })] }));
40
+ };
41
+ export var LineChartSkeleton = function () {
42
+ return (_jsxs(Box, { sx: { width: '100%', height: '300px', position: 'relative', padding: '16px' }, children: [_jsx(Skeleton, { variant: "text", width: "30%", height: 30, sx: { position: 'absolute', top: 10, left: '50%', transform: 'translateX(-50%)' } }), _jsx(Skeleton, { variant: "rectangular", width: "calc(100% - 40px)", height: 4, sx: { position: 'absolute', bottom: 40, left: 20 } }), _jsx(Skeleton, { variant: "rectangular", width: 2, height: "calc(100% - 40px)", sx: { position: 'absolute', top: 0, bottom: 40, left: 20 } }), _jsx(Skeleton, { variant: "rectangular", width: 2, height: "calc(100% - 40px)", sx: { position: 'absolute', top: 0, bottom: 40, right: 20 } }), [1, 2, 3, 4].map(function (_, index) { return (_jsx(Skeleton, { variant: "rectangular", width: "calc(100% - 40px)", height: 4, sx: { position: 'absolute', bottom: "".concat(40 + index * 50, "px"), left: '20px' } }, index.toString())); }), _jsx(Skeleton, { variant: "rectangular", width: "calc(100% - 40px)", height: 2, sx: {
43
+ position: 'absolute',
44
+ left: '20px',
45
+ top: '85%',
46
+ transform: 'rotate(-7deg)',
47
+ transformOrigin: 'left center',
48
+ } })] }));
49
+ };
50
+ export var CardSkeleton = function () {
51
+ var skeletonStyles = {
52
+ boxShadow: '0px 1px 8px -2px #444444de',
53
+ borderRadius: '10px',
54
+ overflow: 'hidden',
55
+ padding: '12px',
56
+ transition: '0.3s',
57
+ background: 'linear-gradient(to top left, #fff 20%, #f5f5f5 80%)',
58
+ width: {
59
+ xs: '90%',
60
+ sm: '70%',
61
+ md: '150%',
62
+ lg: '195%',
63
+ xl: '200%',
64
+ },
65
+ maxWidth: '600px',
66
+ };
67
+ return (_jsx(Grid, { item: true, xs: 12, sm: 6, md: 6, children: _jsxs(Box, { sx: skeletonStyles, children: [_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 30, sx: {
68
+ marginBottom: '12px',
69
+ borderRadius: '4px',
70
+ background: 'linear-gradient(to left, #e0e0e0 10%, #cfcfcf 100%)',
71
+ } }), _jsx(Box, { children: Array.from(new Array(4)).map(function (__, index) { return (_jsxs(Box, { sx: {
72
+ display: 'flex',
73
+ justifyContent: 'space-between',
74
+ alignItems: 'center',
75
+ marginBottom: index !== 3 ? 1 : 0,
76
+ }, children: [_jsx(Skeleton, { variant: "text", width: "70%", height: 20 }), _jsx(Skeleton, { variant: "text", width: "20%", height: 20 })] }, index.toString())); }) })] }) }));
77
+ };
78
+ export var PieChartSkeleton = function () {
79
+ return (_jsxs(_Fragment, { children: [_jsx(Grid, { item: true, xs: 12, sm: 6, md: 6, lg: 6, sx: { padding: '10px' }, children: _jsxs(Card, { sx: {
80
+ borderRadius: '6px',
81
+ height: '100%',
82
+ display: 'flex',
83
+ flexDirection: 'column',
84
+ justifyContent: 'space-between',
85
+ cursor: 'default',
86
+ }, children: [_jsx(CardHeader, { title: _jsx(Skeleton, { variant: "rectangular", width: "80%", height: "20px", sx: { margin: '0 auto', borderRadius: '4px' } }), sx: {
87
+ background: '#dbe7f2',
88
+ padding: '8px',
89
+ } }), _jsx(CardContent, { sx: {
90
+ display: 'flex',
91
+ justifyContent: 'center',
92
+ alignItems: 'center',
93
+ height: '320px',
94
+ }, children: _jsx(Skeleton, { variant: "circular", width: 200, height: 200, sx: { marginBottom: '16px' } }) })] }) }), _jsx(Grid, { item: true, xs: 12, sm: 6, md: 6, lg: 6, sx: { padding: '10px' }, children: _jsxs(Card, { sx: {
95
+ borderRadius: '6px',
96
+ height: '100%',
97
+ display: 'flex',
98
+ flexDirection: 'column',
99
+ justifyContent: 'space-between',
100
+ cursor: 'default',
101
+ }, children: [_jsx(CardHeader, { title: _jsx(Skeleton, { variant: "rectangular", width: "80%", height: "20px", sx: { margin: '0 auto', borderRadius: '4px' } }), sx: {
102
+ background: '#dbe7f2',
103
+ padding: '8px',
104
+ } }), _jsx(CardContent, { sx: {
105
+ display: 'flex',
106
+ justifyContent: 'center',
107
+ alignItems: 'center',
108
+ height: '320px',
109
+ }, children: _jsx(Skeleton, { variant: "circular", width: 200, height: 200, sx: { marginBottom: '16px' } }) })] }) })] }));
110
+ };
111
+ export var FieldSkeleton = function (_a) {
112
+ var _b = _a.length, length = _b === void 0 ? 1 : _b, _c = _a.width, width = _c === void 0 ? '100%' : _c, _d = _a.spacing, spacing = _d === void 0 ? 2 : _d, _e = _a.isLabel, isLabel = _e === void 0 ? false : _e, _f = _a.responsive, responsive = _f === void 0 ? { xs: 12, sm: 6, md: 4 } : _f;
113
+ return (_jsx(Grid, { container: true, spacing: spacing, children: Array.from({ length: length }).map(function (_, index) { return (_createElement(Grid, __assign({ item: true }, responsive, { key: index.toString() }),
114
+ _jsxs(Box, { sx: { width: '100%', margin: 2 }, children: [isLabel && _jsx(Skeleton, { variant: "text", width: "40%", height: 20, sx: { marginBottom: 1 } }), _jsx(Skeleton, { variant: "rectangular", width: width, height: 40, sx: { borderRadius: 1 } })] }))); }) }));
115
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { AnimatedWrapperProps } from '../type';
3
+ export declare const AnimatedWrapper: React.FC<AnimatedWrapperProps>;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export var AnimatedWrapper = function (_a) {
3
+ var _b = _a.animationClass, animationClass = _b === void 0 ? 'animate__bounceIn' : _b, _c = _a.delay, delay = _c === void 0 ? '0' : _c, children = _a.children;
4
+ var delayValue = Number(delay);
5
+ var delayClass = delayValue > 0 ? "animate__delay-".concat(delayValue, "s") : '';
6
+ return (_jsx("div", { className: "animate__animated ".concat(animationClass, " ").concat(delayClass), children: children }));
7
+ };