meticulous-ui 3.5.0 → 3.5.2
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/components/Toast/Toast.js +47 -45
- package/components/Toast/styles.js +3 -3
- package/index.d.ts +495 -0
- package/package.json +1 -1
|
@@ -1,72 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as i, useRef as R, useEffect as C, createElement as N } from "react";
|
|
3
3
|
import { createPortal as b } from "react-dom";
|
|
4
4
|
import { Logo as j } from "./helpers.js";
|
|
5
|
-
import
|
|
6
|
-
import { COLOR_MAP as
|
|
7
|
-
import { ToastWrapper as
|
|
5
|
+
import y from "../../colors/grey.js";
|
|
6
|
+
import { COLOR_MAP as A, INFO as B, INFO_COLORS as D, ERROR as M } from "./constants.js";
|
|
7
|
+
import { ToastWrapper as I, Message as W, Title as _, Subtitle as z, CloseButtonContainer as q, ProgressRing as G, CloseWrapper as H, ToastsContainer as J } from "./styles.js";
|
|
8
8
|
const x = () => {
|
|
9
|
-
},
|
|
10
|
-
const [o,
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
}, re = ({ toasts: e, ...r }) => {
|
|
10
|
+
const [o, n] = i(e);
|
|
11
|
+
C(() => {
|
|
12
|
+
n(e);
|
|
13
13
|
}, [e]);
|
|
14
|
-
const
|
|
14
|
+
const l = ({ type: u, id: a, title: m, subtitle: d, duration: s, onExpire: f = x }, T) => /* @__PURE__ */ N(K, { type: u, title: m, subtitle: d, duration: s, key: a, onExpire: f });
|
|
15
15
|
return b(
|
|
16
|
-
/* @__PURE__ */ t(
|
|
16
|
+
/* @__PURE__ */ t(J, { ...r, children: [...o].reverse().map(l) }),
|
|
17
17
|
document.body
|
|
18
18
|
);
|
|
19
|
-
},
|
|
19
|
+
}, v = (e, r, o) => () => {
|
|
20
20
|
e(!0), setTimeout(() => {
|
|
21
21
|
r(!1), o();
|
|
22
22
|
}, 500);
|
|
23
|
-
},
|
|
24
|
-
type: e =
|
|
23
|
+
}, K = ({
|
|
24
|
+
type: e = B,
|
|
25
25
|
visible: r = !0,
|
|
26
26
|
duration: o = 5,
|
|
27
|
-
onExpire:
|
|
27
|
+
onExpire: n = x,
|
|
28
|
+
hasClockwiseRotation: l = !1,
|
|
28
29
|
title: u,
|
|
29
30
|
subtitle: a,
|
|
30
31
|
...m
|
|
31
32
|
}) => {
|
|
32
|
-
const [d,
|
|
33
|
-
g.current = Date.now(),
|
|
33
|
+
const [d, s] = i(r), [f, T] = i(!1), [L, O] = i(!1), h = R(null), p = R((o - 0.5) * 1e3), g = R(null), $ = (F) => {
|
|
34
|
+
g.current = Date.now(), h.current = setTimeout(v(T, s, n), F);
|
|
34
35
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, [r]),
|
|
38
|
-
const
|
|
39
|
-
clearTimeout(
|
|
40
|
-
},
|
|
36
|
+
C(() => {
|
|
37
|
+
s(r);
|
|
38
|
+
}, [r]), C(() => ($(p.current), () => clearTimeout(h.current)), []);
|
|
39
|
+
const E = () => {
|
|
40
|
+
clearTimeout(h.current), p.current -= Date.now() - g.current, O(!0);
|
|
41
|
+
}, P = () => {
|
|
41
42
|
O(!1), $(p.current);
|
|
42
|
-
}, { main:
|
|
43
|
+
}, { main: w, side: S, bg: k } = A[e] ?? D;
|
|
43
44
|
if (d)
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
|
|
45
|
+
return /* @__PURE__ */ c(
|
|
46
|
+
I,
|
|
46
47
|
{
|
|
47
|
-
$bg:
|
|
48
|
-
role: e ===
|
|
49
|
-
"aria-live": e ===
|
|
48
|
+
$bg: k,
|
|
49
|
+
role: e === M ? "alert" : "status",
|
|
50
|
+
"aria-live": e === M ? "assertive" : "polite",
|
|
50
51
|
"aria-atomic": "true",
|
|
51
52
|
className: `${f ? "fade-out" : "fade-in"}`,
|
|
52
|
-
onMouseEnter:
|
|
53
|
-
onMouseLeave:
|
|
53
|
+
onMouseEnter: E,
|
|
54
|
+
onMouseLeave: P,
|
|
54
55
|
...m,
|
|
55
56
|
children: [
|
|
56
|
-
/* @__PURE__ */ t(j, { type: e, $main:
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */ t(
|
|
59
|
-
a && /* @__PURE__ */ t(
|
|
57
|
+
/* @__PURE__ */ t(j, { type: e, $main: w, $side: S }),
|
|
58
|
+
/* @__PURE__ */ c(W, { children: [
|
|
59
|
+
/* @__PURE__ */ t(_, { children: u }),
|
|
60
|
+
a && /* @__PURE__ */ t(z, { children: a })
|
|
60
61
|
] }),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
62
|
+
/* @__PURE__ */ c(q, { children: [
|
|
63
|
+
/* @__PURE__ */ c(
|
|
64
|
+
G,
|
|
64
65
|
{
|
|
65
66
|
"aria-hidden": "true",
|
|
66
67
|
viewBox: "0 0 28 28",
|
|
67
68
|
$duration: o,
|
|
68
|
-
$color:
|
|
69
|
-
$paused:
|
|
69
|
+
$color: w,
|
|
70
|
+
$paused: L,
|
|
71
|
+
$hasClockwiseRotation: l,
|
|
70
72
|
children: [
|
|
71
73
|
/* @__PURE__ */ t("circle", { cx: "14", cy: "14", r: "12" }),
|
|
72
74
|
/* @__PURE__ */ t("circle", { cx: "14", cy: "14", r: "12" })
|
|
@@ -74,12 +76,12 @@ const x = () => {
|
|
|
74
76
|
}
|
|
75
77
|
),
|
|
76
78
|
/* @__PURE__ */ t(
|
|
77
|
-
|
|
79
|
+
H,
|
|
78
80
|
{
|
|
79
81
|
"aria-label": "Close notification",
|
|
80
82
|
size: 13,
|
|
81
|
-
color:
|
|
82
|
-
onClick:
|
|
83
|
+
color: y.m600,
|
|
84
|
+
onClick: v(T, s, n)
|
|
83
85
|
}
|
|
84
86
|
)
|
|
85
87
|
] })
|
|
@@ -88,6 +90,6 @@ const x = () => {
|
|
|
88
90
|
);
|
|
89
91
|
};
|
|
90
92
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
re as ToastContainer,
|
|
94
|
+
K as default
|
|
93
95
|
};
|
|
@@ -182,7 +182,7 @@ const s = r`
|
|
|
182
182
|
`, k = t.svg`
|
|
183
183
|
position: absolute;
|
|
184
184
|
inset: 0;
|
|
185
|
-
transform: rotate(-90deg);
|
|
185
|
+
transform: ${({ $hasClockwiseRotation: e }) => e ? "rotate(-90deg)" : "rotate(90deg) scaleX(-1)"};
|
|
186
186
|
pointer-events: none;
|
|
187
187
|
|
|
188
188
|
circle {
|
|
@@ -235,7 +235,7 @@ const s = r`
|
|
|
235
235
|
max-width: 18rem;
|
|
236
236
|
width: auto;
|
|
237
237
|
}
|
|
238
|
-
`,
|
|
238
|
+
`, X = t.div`
|
|
239
239
|
font-weight: 400;
|
|
240
240
|
font-size: 1.6rem;
|
|
241
241
|
color: ${a.m700};
|
|
@@ -257,7 +257,7 @@ export {
|
|
|
257
257
|
b as Outer,
|
|
258
258
|
y as OuterChild,
|
|
259
259
|
k as ProgressRing,
|
|
260
|
-
|
|
260
|
+
X as Subtitle,
|
|
261
261
|
z as Title,
|
|
262
262
|
g as ToastWrapper,
|
|
263
263
|
w as ToastsContainer
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Color palette type
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
export interface ColorShades {
|
|
8
|
+
m50?: string;
|
|
9
|
+
m100?: string;
|
|
10
|
+
m200?: string;
|
|
11
|
+
m300?: string;
|
|
12
|
+
m400?: string;
|
|
13
|
+
m500?: string;
|
|
14
|
+
m600?: string;
|
|
15
|
+
m700?: string;
|
|
16
|
+
m800?: string;
|
|
17
|
+
m900?: string;
|
|
18
|
+
a100?: string;
|
|
19
|
+
a200?: string;
|
|
20
|
+
a400?: string;
|
|
21
|
+
a700?: string;
|
|
22
|
+
[key: string]: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type ThemeColor =
|
|
26
|
+
| 'amber'
|
|
27
|
+
| 'black'
|
|
28
|
+
| 'blue'
|
|
29
|
+
| 'blueGray'
|
|
30
|
+
| 'brown'
|
|
31
|
+
| 'cider'
|
|
32
|
+
| 'cyan'
|
|
33
|
+
| 'deepOrange'
|
|
34
|
+
| 'deepPurple'
|
|
35
|
+
| 'green'
|
|
36
|
+
| 'grey'
|
|
37
|
+
| 'indigo'
|
|
38
|
+
| 'lightBlue'
|
|
39
|
+
| 'lightGreen'
|
|
40
|
+
| 'lime'
|
|
41
|
+
| 'orange'
|
|
42
|
+
| 'pink'
|
|
43
|
+
| 'purple'
|
|
44
|
+
| 'red'
|
|
45
|
+
| 'teal'
|
|
46
|
+
| 'violet'
|
|
47
|
+
| 'white'
|
|
48
|
+
| 'yellow';
|
|
49
|
+
|
|
50
|
+
export type ComponentSize = 'small' | 'medium' | 'large';
|
|
51
|
+
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
// Button
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
57
|
+
theme?: ThemeColor | ColorShades;
|
|
58
|
+
size?: ComponentSize;
|
|
59
|
+
width?: string | number;
|
|
60
|
+
leftIcon?: React.ReactNode;
|
|
61
|
+
rightIcon?: React.ReactNode;
|
|
62
|
+
isLoading?: boolean;
|
|
63
|
+
textColor?: string;
|
|
64
|
+
children?: React.ReactNode;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
68
|
+
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
// Pagination
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
|
|
73
|
+
export interface PaginationProps extends React.HTMLAttributes<HTMLElement> {
|
|
74
|
+
pageNumber: number;
|
|
75
|
+
setPageNumber: (page: number) => void;
|
|
76
|
+
totalPages: number;
|
|
77
|
+
theme?: ThemeColor;
|
|
78
|
+
size?: ComponentSize;
|
|
79
|
+
isDisabled?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare const Pagination: React.FC<PaginationProps>;
|
|
83
|
+
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// Toast
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
|
|
88
|
+
export type ToastType = 'info' | 'success' | 'warning' | 'error';
|
|
89
|
+
|
|
90
|
+
export interface ToastProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
91
|
+
type?: ToastType;
|
|
92
|
+
visible?: boolean;
|
|
93
|
+
duration?: number;
|
|
94
|
+
onExpire?: () => void;
|
|
95
|
+
title?: string;
|
|
96
|
+
subtitle?: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface ToastItem {
|
|
100
|
+
id: string;
|
|
101
|
+
type?: ToastType;
|
|
102
|
+
title?: string;
|
|
103
|
+
subtitle?: string;
|
|
104
|
+
duration?: number;
|
|
105
|
+
onExpire?: () => void;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface ToastContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
109
|
+
toasts: ToastItem[];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export declare const Toast: React.FC<ToastProps>;
|
|
113
|
+
export declare const ToastContainer: React.FC<ToastContainerProps>;
|
|
114
|
+
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
// Modal
|
|
117
|
+
// ---------------------------------------------------------------------------
|
|
118
|
+
|
|
119
|
+
export interface ModalProps {
|
|
120
|
+
isOpen: boolean;
|
|
121
|
+
onClose: () => void;
|
|
122
|
+
title?: string;
|
|
123
|
+
children?: React.ReactNode;
|
|
124
|
+
footer?: React.ReactNode;
|
|
125
|
+
footerAlign?: 'left' | 'center' | 'right';
|
|
126
|
+
width?: string | number;
|
|
127
|
+
closeOnOverlayClick?: boolean;
|
|
128
|
+
showCloseButton?: boolean;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
132
|
+
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
// Input
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
|
|
137
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
138
|
+
label?: string;
|
|
139
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
140
|
+
value?: string;
|
|
141
|
+
hasError?: boolean;
|
|
142
|
+
name?: string;
|
|
143
|
+
color?: ThemeColor;
|
|
144
|
+
size?: string;
|
|
145
|
+
disableAutoComplete?: boolean;
|
|
146
|
+
helperText?: string;
|
|
147
|
+
background?: string;
|
|
148
|
+
outerBackground?: string;
|
|
149
|
+
leftIcon?: string;
|
|
150
|
+
rightIcon?: string;
|
|
151
|
+
placeholder?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export declare const Input: React.FC<InputProps>;
|
|
155
|
+
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
// Textarea
|
|
158
|
+
// ---------------------------------------------------------------------------
|
|
159
|
+
|
|
160
|
+
export interface TextareaProps extends Omit<
|
|
161
|
+
React.TextareaHTMLAttributes<HTMLTextAreaElement>,
|
|
162
|
+
'cols' | 'rows'
|
|
163
|
+
> {
|
|
164
|
+
label?: string;
|
|
165
|
+
onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
166
|
+
value?: string;
|
|
167
|
+
hasError?: boolean;
|
|
168
|
+
name?: string;
|
|
169
|
+
color?: ThemeColor;
|
|
170
|
+
helperText?: string;
|
|
171
|
+
background?: string;
|
|
172
|
+
outerBackground?: string;
|
|
173
|
+
isDynamic?: boolean;
|
|
174
|
+
isResizeNone?: boolean;
|
|
175
|
+
rows?: string | number;
|
|
176
|
+
cols?: string | number;
|
|
177
|
+
leftIcon?: string;
|
|
178
|
+
rightIcon?: string;
|
|
179
|
+
placeholder?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export declare const Textarea: React.FC<TextareaProps>;
|
|
183
|
+
|
|
184
|
+
// ---------------------------------------------------------------------------
|
|
185
|
+
// Checkbox
|
|
186
|
+
// ---------------------------------------------------------------------------
|
|
187
|
+
|
|
188
|
+
export interface CheckboxProps extends Omit<React.HTMLAttributes<HTMLLabelElement>, 'onChange'> {
|
|
189
|
+
label?: string;
|
|
190
|
+
value?: boolean;
|
|
191
|
+
color?: ThemeColor;
|
|
192
|
+
textColor?: string;
|
|
193
|
+
disabled?: boolean;
|
|
194
|
+
onChange: (checked: boolean) => void;
|
|
195
|
+
tabIndex?: number;
|
|
196
|
+
innerShade?: string;
|
|
197
|
+
outerShade?: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export declare const Checkbox: React.FC<CheckboxProps>;
|
|
201
|
+
|
|
202
|
+
// ---------------------------------------------------------------------------
|
|
203
|
+
// RadioGroup
|
|
204
|
+
// ---------------------------------------------------------------------------
|
|
205
|
+
|
|
206
|
+
export interface RadioOption {
|
|
207
|
+
label: string;
|
|
208
|
+
value: string | number;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
212
|
+
options: RadioOption[];
|
|
213
|
+
value: string | number;
|
|
214
|
+
onChange: (value: string | number) => void;
|
|
215
|
+
color?: ThemeColor;
|
|
216
|
+
isHorizonatal?: boolean;
|
|
217
|
+
label?: string;
|
|
218
|
+
ariaLabel?: string;
|
|
219
|
+
name?: string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export declare const RadioGroup: React.FC<RadioGroupProps>;
|
|
223
|
+
|
|
224
|
+
// ---------------------------------------------------------------------------
|
|
225
|
+
// FileUploader
|
|
226
|
+
// ---------------------------------------------------------------------------
|
|
227
|
+
|
|
228
|
+
export interface FileUploaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
229
|
+
label?: string;
|
|
230
|
+
labelColor?: string;
|
|
231
|
+
theme?: ThemeColor | ColorShades;
|
|
232
|
+
size?: ComponentSize;
|
|
233
|
+
width?: string | number;
|
|
234
|
+
isLoading?: boolean;
|
|
235
|
+
disabled?: boolean;
|
|
236
|
+
prefixIcon?: React.ComponentType;
|
|
237
|
+
suffixIcon?: React.ComponentType;
|
|
238
|
+
type?: string;
|
|
239
|
+
accept?: string;
|
|
240
|
+
isMultiple?: boolean;
|
|
241
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export declare const FileUploader: React.FC<FileUploaderProps>;
|
|
245
|
+
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
// Dropdown
|
|
248
|
+
// ---------------------------------------------------------------------------
|
|
249
|
+
|
|
250
|
+
export interface DropdownOption {
|
|
251
|
+
label: string;
|
|
252
|
+
value: string | number;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
256
|
+
options: DropdownOption[];
|
|
257
|
+
onChange: (value: string | number) => void;
|
|
258
|
+
value?: string | number;
|
|
259
|
+
width?: string;
|
|
260
|
+
menuHeight?: string;
|
|
261
|
+
placeholder?: string;
|
|
262
|
+
theme?: ThemeColor;
|
|
263
|
+
isLoading?: boolean;
|
|
264
|
+
isDisabled?: boolean;
|
|
265
|
+
loaderColor?: string;
|
|
266
|
+
searchable?: boolean;
|
|
267
|
+
onLoadMore?: () => void;
|
|
268
|
+
hasMore?: boolean;
|
|
269
|
+
isLoadingMore?: boolean;
|
|
270
|
+
searchPh?: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export declare const Dropdown: React.FC<DropdownProps>;
|
|
274
|
+
|
|
275
|
+
// ---------------------------------------------------------------------------
|
|
276
|
+
// Selectbox
|
|
277
|
+
// ---------------------------------------------------------------------------
|
|
278
|
+
|
|
279
|
+
export interface SelectboxProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
280
|
+
options: DropdownOption[];
|
|
281
|
+
onChange: (value: Array<string | number>) => void;
|
|
282
|
+
value?: Array<string | number>;
|
|
283
|
+
width?: string;
|
|
284
|
+
menuHeight?: string;
|
|
285
|
+
placeholder?: string;
|
|
286
|
+
theme?: ThemeColor;
|
|
287
|
+
isDisabled?: boolean;
|
|
288
|
+
isLoading?: boolean;
|
|
289
|
+
searchable?: boolean;
|
|
290
|
+
searchPh?: string;
|
|
291
|
+
onLoadMore?: () => void;
|
|
292
|
+
hasMore?: boolean;
|
|
293
|
+
isLoadingMore?: boolean;
|
|
294
|
+
loaderColor?: string;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export declare const Selectbox: React.FC<SelectboxProps>;
|
|
298
|
+
|
|
299
|
+
// ---------------------------------------------------------------------------
|
|
300
|
+
// Shimmer
|
|
301
|
+
// ---------------------------------------------------------------------------
|
|
302
|
+
|
|
303
|
+
export interface ShimmerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
304
|
+
width?: string | number;
|
|
305
|
+
height?: string | number;
|
|
306
|
+
borderRadius?: string | number;
|
|
307
|
+
label?: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export declare const Shimmer: React.FC<ShimmerProps>;
|
|
311
|
+
|
|
312
|
+
// ---------------------------------------------------------------------------
|
|
313
|
+
// Spinner
|
|
314
|
+
// ---------------------------------------------------------------------------
|
|
315
|
+
|
|
316
|
+
export interface SpinnerProps extends React.SVGAttributes<SVGElement> {
|
|
317
|
+
color?: ThemeColor | string;
|
|
318
|
+
size?: 'small' | 'medium' | 'large';
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export declare const Spinner: React.FC<SpinnerProps>;
|
|
322
|
+
|
|
323
|
+
// ---------------------------------------------------------------------------
|
|
324
|
+
// Loader
|
|
325
|
+
// ---------------------------------------------------------------------------
|
|
326
|
+
|
|
327
|
+
export type LoaderTheme =
|
|
328
|
+
| 'blue'
|
|
329
|
+
| 'green'
|
|
330
|
+
| 'red'
|
|
331
|
+
| 'yellow'
|
|
332
|
+
| 'orange'
|
|
333
|
+
| 'black'
|
|
334
|
+
| 'grey'
|
|
335
|
+
| 'violet'
|
|
336
|
+
| 'teal'
|
|
337
|
+
| 'purple'
|
|
338
|
+
| 'pink';
|
|
339
|
+
|
|
340
|
+
export interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
341
|
+
size?: ComponentSize;
|
|
342
|
+
theme?: LoaderTheme;
|
|
343
|
+
isBounce?: boolean;
|
|
344
|
+
isMini?: boolean;
|
|
345
|
+
isMiniDark?: boolean;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export declare const Loader: React.FC<LoaderProps>;
|
|
349
|
+
|
|
350
|
+
// ---------------------------------------------------------------------------
|
|
351
|
+
// PageLoader
|
|
352
|
+
// ---------------------------------------------------------------------------
|
|
353
|
+
|
|
354
|
+
export interface PageLoaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
355
|
+
theme?: ThemeColor;
|
|
356
|
+
color?: string;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export declare const PageLoader: React.FC<PageLoaderProps>;
|
|
360
|
+
|
|
361
|
+
// ---------------------------------------------------------------------------
|
|
362
|
+
// OtpInput
|
|
363
|
+
// ---------------------------------------------------------------------------
|
|
364
|
+
|
|
365
|
+
export interface OtpInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
366
|
+
length?: number;
|
|
367
|
+
value?: string;
|
|
368
|
+
onChange?: (value: string) => void;
|
|
369
|
+
onComplete?: (value: string) => void;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export declare const OtpInput: React.FC<OtpInputProps>;
|
|
373
|
+
|
|
374
|
+
// ---------------------------------------------------------------------------
|
|
375
|
+
// Image
|
|
376
|
+
// ---------------------------------------------------------------------------
|
|
377
|
+
|
|
378
|
+
export interface ImageProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
379
|
+
src: string;
|
|
380
|
+
alt?: string;
|
|
381
|
+
width?: string | number;
|
|
382
|
+
height?: string | number;
|
|
383
|
+
borderRadius?: string | number;
|
|
384
|
+
loadLow?: boolean;
|
|
385
|
+
lowSrc?: string;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export declare const Image: React.FC<ImageProps>;
|
|
389
|
+
|
|
390
|
+
// ---------------------------------------------------------------------------
|
|
391
|
+
// VideoPlayer
|
|
392
|
+
// ---------------------------------------------------------------------------
|
|
393
|
+
|
|
394
|
+
export interface VideoPlayerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
395
|
+
link: string;
|
|
396
|
+
thumbnail?: string;
|
|
397
|
+
width?: string | number;
|
|
398
|
+
height?: string | number;
|
|
399
|
+
borderRadius?: number;
|
|
400
|
+
hasShimmer?: boolean;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export declare const VideoPlayer: React.FC<VideoPlayerProps>;
|
|
404
|
+
|
|
405
|
+
// ---------------------------------------------------------------------------
|
|
406
|
+
// Timer
|
|
407
|
+
// ---------------------------------------------------------------------------
|
|
408
|
+
|
|
409
|
+
export interface TimerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
410
|
+
color?: ThemeColor;
|
|
411
|
+
showTime?: boolean;
|
|
412
|
+
showTimeWithSec?: boolean;
|
|
413
|
+
timeZone?: string;
|
|
414
|
+
isDigital?: boolean;
|
|
415
|
+
timerSeconds?: number;
|
|
416
|
+
onTimerAdd?: () => void;
|
|
417
|
+
onTimerComplete?: () => void;
|
|
418
|
+
onTimerRemove?: () => void;
|
|
419
|
+
onTimerPause?: () => void;
|
|
420
|
+
onTimerPlay?: () => void;
|
|
421
|
+
size?: number;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export declare const Timer: React.FC<TimerProps>;
|
|
425
|
+
|
|
426
|
+
// ---------------------------------------------------------------------------
|
|
427
|
+
// Carousel
|
|
428
|
+
// ---------------------------------------------------------------------------
|
|
429
|
+
|
|
430
|
+
export interface CarouselProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
431
|
+
data: unknown[];
|
|
432
|
+
renderCarousel: (item: unknown, index: number) => React.ReactNode;
|
|
433
|
+
visibleSlides?: number;
|
|
434
|
+
hasArrow?: boolean;
|
|
435
|
+
overlayArrows?: boolean;
|
|
436
|
+
arrowTop?: string | number;
|
|
437
|
+
areDotsHidden?: boolean;
|
|
438
|
+
autoSlide?: boolean;
|
|
439
|
+
autoSlideSec?: number;
|
|
440
|
+
loop?: boolean;
|
|
441
|
+
dragToSlide?: boolean;
|
|
442
|
+
liveDrag?: boolean;
|
|
443
|
+
liveDragMobile?: boolean;
|
|
444
|
+
showProgress?: boolean;
|
|
445
|
+
defaultIndex?: number;
|
|
446
|
+
onSlideChange?: (index: number) => void;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export declare const Carousel: React.FC<CarouselProps>;
|
|
450
|
+
|
|
451
|
+
// ---------------------------------------------------------------------------
|
|
452
|
+
// RootComponent
|
|
453
|
+
// ---------------------------------------------------------------------------
|
|
454
|
+
|
|
455
|
+
export interface RootComponentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
456
|
+
children: React.ReactNode;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export declare const RootComponent: React.FC<RootComponentProps>;
|
|
460
|
+
|
|
461
|
+
// ---------------------------------------------------------------------------
|
|
462
|
+
// Hooks
|
|
463
|
+
// ---------------------------------------------------------------------------
|
|
464
|
+
|
|
465
|
+
export declare function usePrevious<T>(value: T): T | undefined;
|
|
466
|
+
export declare function useDebounce<T>(value: T, delay: number): T;
|
|
467
|
+
export declare function useThrottle<T>(value: T, delay: number): T;
|
|
468
|
+
export declare function useToggle(initial?: boolean): [boolean, (next?: boolean) => void];
|
|
469
|
+
export declare function useIsMounted(): React.MutableRefObject<boolean>;
|
|
470
|
+
export declare function useUnmount(callback: () => void): void;
|
|
471
|
+
export declare function useFirstRender(): boolean;
|
|
472
|
+
export declare function useTimeout(callback: () => void, delay: number | null): void;
|
|
473
|
+
export declare function useInterval(callback: () => void, delay: number | null): void;
|
|
474
|
+
export declare function useEventListener(
|
|
475
|
+
event: string,
|
|
476
|
+
handler: (e: Event) => void,
|
|
477
|
+
target?: EventTarget
|
|
478
|
+
): void;
|
|
479
|
+
export declare function useIntersectionObserver(
|
|
480
|
+
ref: React.RefObject<Element>,
|
|
481
|
+
options?: IntersectionObserverInit
|
|
482
|
+
): IntersectionObserverEntry | null;
|
|
483
|
+
export declare function useMediaQuery(query: string): boolean;
|
|
484
|
+
export declare function useOutsideClick(
|
|
485
|
+
ref: React.RefObject<Element>,
|
|
486
|
+
callback: (e: MouseEvent | TouchEvent) => void
|
|
487
|
+
): void;
|
|
488
|
+
export declare function useWindowSize(): { width: number; height: number };
|
|
489
|
+
export declare function useOnlineStatus(): boolean;
|
|
490
|
+
export declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T) => void];
|
|
491
|
+
export declare function useSessionStorage<T>(key: string, initialValue: T): [T, (value: T) => void];
|
|
492
|
+
export declare function useCopyToClipboard(): {
|
|
493
|
+
copied: boolean;
|
|
494
|
+
copy: (text: string) => Promise<void>;
|
|
495
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meticulous-ui",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"description": "A comprehensive React UI component library with a wide range of customizable components, icons, colors, and utilities for building modern web applications.",
|
|
6
6
|
"types": "./index.d.ts",
|