primolab-ui-kit 1.1.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/README.md +901 -0
- package/dist/index.d.ts +323 -0
- package/dist/primo-ui-kit.js +1633 -0
- package/dist/primo-ui-kit.umd.cjs +88 -0
- package/dist/primolab-ui-kit.css +1 -0
- package/package.json +52 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties, MouseEventHandler, ChangeEventHandler } from 'react';
|
|
2
|
+
|
|
3
|
+
// Button Component
|
|
4
|
+
export interface ButtonProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info' | 'outline' | 'outline-secondary' | 'outline-danger' | 'outline-success' | 'outline-warning' | 'outline-info' | 'ghost';
|
|
7
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
8
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export const Button: React.FC<ButtonProps>;
|
|
15
|
+
|
|
16
|
+
// Modal Component
|
|
17
|
+
export interface ModalProps {
|
|
18
|
+
isOpen: boolean;
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
title?: string;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
23
|
+
showCloseButton?: boolean;
|
|
24
|
+
closeOnBackdropClick?: boolean;
|
|
25
|
+
footer?: ReactNode;
|
|
26
|
+
icon?: ReactNode;
|
|
27
|
+
subtitle?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export const Modal: React.FC<ModalProps>;
|
|
30
|
+
|
|
31
|
+
// Table Component
|
|
32
|
+
export interface TableColumn {
|
|
33
|
+
header: string;
|
|
34
|
+
align?: 'left' | 'center' | 'right';
|
|
35
|
+
}
|
|
36
|
+
export interface TableProps {
|
|
37
|
+
columns: TableColumn[];
|
|
38
|
+
data: any[];
|
|
39
|
+
renderRow: (item: any, index: number) => ReactNode;
|
|
40
|
+
striped?: boolean;
|
|
41
|
+
hoverable?: boolean;
|
|
42
|
+
bordered?: boolean;
|
|
43
|
+
unwrapped?: boolean;
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
export const Table: React.FC<TableProps>;
|
|
47
|
+
|
|
48
|
+
// Input Component
|
|
49
|
+
export interface InputProps {
|
|
50
|
+
type?: string;
|
|
51
|
+
label?: string;
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
value?: string;
|
|
54
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
55
|
+
error?: string;
|
|
56
|
+
helperText?: string;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
required?: boolean;
|
|
59
|
+
fullWidth?: boolean;
|
|
60
|
+
size?: 'sm' | 'md' | 'lg';
|
|
61
|
+
className?: string;
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}
|
|
64
|
+
export const Input: React.FC<InputProps>;
|
|
65
|
+
|
|
66
|
+
// Select Component
|
|
67
|
+
export interface SelectOption {
|
|
68
|
+
value: string;
|
|
69
|
+
label: string;
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface SelectProps {
|
|
73
|
+
label?: string;
|
|
74
|
+
options?: SelectOption[];
|
|
75
|
+
value?: string;
|
|
76
|
+
onChange?: ChangeEventHandler<HTMLSelectElement>;
|
|
77
|
+
error?: string;
|
|
78
|
+
helperText?: string;
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
required?: boolean;
|
|
81
|
+
fullWidth?: boolean;
|
|
82
|
+
placeholder?: string;
|
|
83
|
+
size?: 'sm' | 'md' | 'lg';
|
|
84
|
+
variant?: 'default' | 'badge';
|
|
85
|
+
getBadgeColor?: (value: string) => string;
|
|
86
|
+
className?: string;
|
|
87
|
+
[key: string]: any;
|
|
88
|
+
}
|
|
89
|
+
export const Select: React.FC<SelectProps>;
|
|
90
|
+
|
|
91
|
+
// TextArea Component
|
|
92
|
+
export interface TextAreaProps {
|
|
93
|
+
label?: string;
|
|
94
|
+
placeholder?: string;
|
|
95
|
+
value?: string;
|
|
96
|
+
onChange?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
97
|
+
error?: string;
|
|
98
|
+
helperText?: string;
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
required?: boolean;
|
|
101
|
+
fullWidth?: boolean;
|
|
102
|
+
rows?: number;
|
|
103
|
+
resize?: boolean;
|
|
104
|
+
className?: string;
|
|
105
|
+
[key: string]: any;
|
|
106
|
+
}
|
|
107
|
+
export const TextArea: React.FC<TextAreaProps>;
|
|
108
|
+
|
|
109
|
+
// Card Component
|
|
110
|
+
export interface CardProps {
|
|
111
|
+
children: ReactNode;
|
|
112
|
+
title?: string;
|
|
113
|
+
subtitle?: string;
|
|
114
|
+
footer?: ReactNode;
|
|
115
|
+
hoverable?: boolean;
|
|
116
|
+
clickable?: boolean;
|
|
117
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
118
|
+
className?: string;
|
|
119
|
+
[key: string]: any;
|
|
120
|
+
}
|
|
121
|
+
export const Card: React.FC<CardProps>;
|
|
122
|
+
|
|
123
|
+
// Badge Component
|
|
124
|
+
export interface BadgeProps {
|
|
125
|
+
children: ReactNode;
|
|
126
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'grey';
|
|
127
|
+
size?: 'sm' | 'md' | 'lg';
|
|
128
|
+
rounded?: boolean;
|
|
129
|
+
className?: string;
|
|
130
|
+
}
|
|
131
|
+
export const Badge: React.FC<BadgeProps>;
|
|
132
|
+
|
|
133
|
+
// Alert Component
|
|
134
|
+
export interface AlertProps {
|
|
135
|
+
children: ReactNode;
|
|
136
|
+
variant?: 'success' | 'danger' | 'warning' | 'info';
|
|
137
|
+
title?: string;
|
|
138
|
+
onClose?: () => void;
|
|
139
|
+
showIcon?: boolean;
|
|
140
|
+
className?: string;
|
|
141
|
+
}
|
|
142
|
+
export const Alert: React.FC<AlertProps>;
|
|
143
|
+
|
|
144
|
+
// Spinner Component
|
|
145
|
+
export interface SpinnerProps {
|
|
146
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
147
|
+
color?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'white';
|
|
148
|
+
className?: string;
|
|
149
|
+
}
|
|
150
|
+
export const Spinner: React.FC<SpinnerProps>;
|
|
151
|
+
|
|
152
|
+
// Skeleton Component
|
|
153
|
+
export interface SkeletonProps {
|
|
154
|
+
variant?: 'text' | 'title' | 'button' | 'card' | 'avatar';
|
|
155
|
+
width?: string | number;
|
|
156
|
+
height?: string | number;
|
|
157
|
+
circle?: boolean;
|
|
158
|
+
count?: number;
|
|
159
|
+
className?: string;
|
|
160
|
+
}
|
|
161
|
+
export const Skeleton: React.FC<SkeletonProps>;
|
|
162
|
+
|
|
163
|
+
// SelectSearchable Component
|
|
164
|
+
export interface SelectSearchableProps {
|
|
165
|
+
label?: string;
|
|
166
|
+
options?: SelectOption[];
|
|
167
|
+
value?: string | string[];
|
|
168
|
+
onChange?: (event: { target: { value: string | string[] } }) => void;
|
|
169
|
+
error?: string;
|
|
170
|
+
helperText?: string;
|
|
171
|
+
disabled?: boolean;
|
|
172
|
+
required?: boolean;
|
|
173
|
+
fullWidth?: boolean;
|
|
174
|
+
placeholder?: string;
|
|
175
|
+
size?: 'sm' | 'md' | 'lg';
|
|
176
|
+
className?: string;
|
|
177
|
+
searchPlaceholder?: string;
|
|
178
|
+
noResultsText?: string;
|
|
179
|
+
multiple?: boolean;
|
|
180
|
+
[key: string]: any;
|
|
181
|
+
}
|
|
182
|
+
export const SelectSearchable: React.FC<SelectSearchableProps>;
|
|
183
|
+
|
|
184
|
+
// Loader Component
|
|
185
|
+
export interface LoaderProps {
|
|
186
|
+
type?: 'spinner' | 'skeleton';
|
|
187
|
+
variant?: 'inline' | 'overlay' | 'block';
|
|
188
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
189
|
+
color?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'white';
|
|
190
|
+
text?: string;
|
|
191
|
+
skeletonProps?: SkeletonProps;
|
|
192
|
+
className?: string;
|
|
193
|
+
children?: ReactNode;
|
|
194
|
+
}
|
|
195
|
+
export const Loader: React.FC<LoaderProps>;
|
|
196
|
+
|
|
197
|
+
// Bootbox Component
|
|
198
|
+
export interface BootboxProps {
|
|
199
|
+
isOpen: boolean;
|
|
200
|
+
onClose: () => void;
|
|
201
|
+
onConfirm?: () => void;
|
|
202
|
+
title?: string;
|
|
203
|
+
message?: string;
|
|
204
|
+
children?: ReactNode;
|
|
205
|
+
variant?: 'primary' | 'warning' | 'info' | 'danger';
|
|
206
|
+
type?: 'alert' | 'confirm' | 'custom';
|
|
207
|
+
confirmText?: string;
|
|
208
|
+
cancelText?: string;
|
|
209
|
+
closeText?: string;
|
|
210
|
+
closeOnBackdropClick?: boolean;
|
|
211
|
+
closeOnEscape?: boolean;
|
|
212
|
+
}
|
|
213
|
+
export const Bootbox: React.FC<BootboxProps>;
|
|
214
|
+
|
|
215
|
+
// Tooltip Component
|
|
216
|
+
export interface TooltipProps {
|
|
217
|
+
children: ReactNode;
|
|
218
|
+
content: ReactNode;
|
|
219
|
+
variant?: 'primary' | 'warning' | 'danger';
|
|
220
|
+
title?: string;
|
|
221
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
222
|
+
className?: string;
|
|
223
|
+
}
|
|
224
|
+
export const Tooltip: React.FC<TooltipProps>;
|
|
225
|
+
|
|
226
|
+
// Accordion Component
|
|
227
|
+
export interface AccordionProps {
|
|
228
|
+
children: ReactNode;
|
|
229
|
+
expandedContent: ReactNode;
|
|
230
|
+
defaultExpanded?: boolean;
|
|
231
|
+
asTableRow?: boolean;
|
|
232
|
+
className?: string;
|
|
233
|
+
arrowClassName?: string;
|
|
234
|
+
contentClassName?: string;
|
|
235
|
+
onToggle?: (isExpanded: boolean) => void;
|
|
236
|
+
}
|
|
237
|
+
export const Accordion: React.FC<AccordionProps>;
|
|
238
|
+
|
|
239
|
+
// Checkbox Component
|
|
240
|
+
export interface CheckboxProps {
|
|
241
|
+
label?: string;
|
|
242
|
+
checked?: boolean;
|
|
243
|
+
onChange?: (event: { target: { checked: boolean } }) => void;
|
|
244
|
+
disabled?: boolean;
|
|
245
|
+
error?: boolean | string;
|
|
246
|
+
helperText?: string;
|
|
247
|
+
required?: boolean;
|
|
248
|
+
className?: string;
|
|
249
|
+
[key: string]: any;
|
|
250
|
+
}
|
|
251
|
+
export const Checkbox: React.FC<CheckboxProps>;
|
|
252
|
+
|
|
253
|
+
// Toggle Component
|
|
254
|
+
export interface ToggleProps {
|
|
255
|
+
checked?: boolean;
|
|
256
|
+
onChange?: (checked: boolean) => void;
|
|
257
|
+
disabled?: boolean;
|
|
258
|
+
label?: string;
|
|
259
|
+
error?: string;
|
|
260
|
+
helperText?: string;
|
|
261
|
+
required?: boolean;
|
|
262
|
+
className?: string;
|
|
263
|
+
[key: string]: any;
|
|
264
|
+
}
|
|
265
|
+
export const Toggle: React.FC<ToggleProps>;
|
|
266
|
+
|
|
267
|
+
// DateTimePicker Component
|
|
268
|
+
export interface DateTimePickerProps {
|
|
269
|
+
label?: string;
|
|
270
|
+
value?: string;
|
|
271
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
272
|
+
error?: string;
|
|
273
|
+
helperText?: string;
|
|
274
|
+
disabled?: boolean;
|
|
275
|
+
required?: boolean;
|
|
276
|
+
fullWidth?: boolean;
|
|
277
|
+
size?: 'sm' | 'md' | 'lg';
|
|
278
|
+
showTime?: boolean;
|
|
279
|
+
className?: string;
|
|
280
|
+
[key: string]: any;
|
|
281
|
+
}
|
|
282
|
+
export const DateTimePicker: React.FC<DateTimePickerProps>;
|
|
283
|
+
|
|
284
|
+
// Toast Component
|
|
285
|
+
export interface ToastProps {
|
|
286
|
+
children: ReactNode;
|
|
287
|
+
variant?: 'success' | 'danger' | 'warning' | 'info';
|
|
288
|
+
title?: string;
|
|
289
|
+
onClose?: () => void;
|
|
290
|
+
showIcon?: boolean;
|
|
291
|
+
className?: string;
|
|
292
|
+
duration?: number;
|
|
293
|
+
position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
|
|
294
|
+
autoClose?: boolean;
|
|
295
|
+
}
|
|
296
|
+
export const Toast: React.FC<ToastProps>;
|
|
297
|
+
|
|
298
|
+
// InfoBox Component
|
|
299
|
+
export interface InfoBoxProps {
|
|
300
|
+
children: ReactNode;
|
|
301
|
+
variant?: 'info' | 'warning' | 'danger';
|
|
302
|
+
className?: string;
|
|
303
|
+
}
|
|
304
|
+
export const InfoBox: React.FC<InfoBoxProps>;
|
|
305
|
+
|
|
306
|
+
// Navbar Component
|
|
307
|
+
export interface NavbarProps {
|
|
308
|
+
children: ReactNode;
|
|
309
|
+
className?: string;
|
|
310
|
+
[key: string]: any;
|
|
311
|
+
}
|
|
312
|
+
export const Navbar: React.FC<NavbarProps>;
|
|
313
|
+
|
|
314
|
+
// NavbarItem Component
|
|
315
|
+
export interface NavbarItemProps {
|
|
316
|
+
children: ReactNode;
|
|
317
|
+
active?: boolean;
|
|
318
|
+
onClick?: MouseEventHandler<HTMLDivElement | HTMLAnchorElement>;
|
|
319
|
+
href?: string;
|
|
320
|
+
className?: string;
|
|
321
|
+
[key: string]: any;
|
|
322
|
+
}
|
|
323
|
+
export const NavbarItem: React.FC<NavbarItemProps>;
|