@bigbinary/neetoui 3.7.0-beta.9 → 4.0.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/index.d.ts ADDED
@@ -0,0 +1,563 @@
1
+ import React from "react";
2
+
3
+ export interface AccordionProps {
4
+ className?: string;
5
+ defaultActiveKey?: number;
6
+ padded?: boolean;
7
+ style?: "primary" | "secondary";
8
+ }
9
+
10
+ export interface AccordionItemProps {
11
+ id?: string;
12
+ title?: string;
13
+ isOpen?: boolean;
14
+ onClick?: () => void;
15
+ className?: string;
16
+ titleProps?: React.DetailedHTMLProps<
17
+ React.HTMLAttributes<HTMLDivElement>,
18
+ HTMLDivElement
19
+ >;
20
+ iconProps?: React.SVGProps<SVGSVGElement>;
21
+ }
22
+
23
+ export interface ColorPickerProps {
24
+ color: string;
25
+ size: "small" | "medium" | "large";
26
+ onChange: (color: string) => void;
27
+ colorPaletteProps?: {
28
+ color: { from: string; to: string };
29
+ colorList: { from: string; to: string }[];
30
+ onChange: (from: string, to: string) => void;
31
+ };
32
+ }
33
+
34
+ interface PopupProps {
35
+ isOpen?: boolean;
36
+ onClose?: () => void;
37
+ className?: string;
38
+ closeOnEsc?: boolean;
39
+ closeButton?: boolean;
40
+ backdropClassName?: string;
41
+ closeOnOutsideClick?: boolean;
42
+ [key: string]: any;
43
+ }
44
+
45
+ interface PopupContentProps {
46
+ className?: string;
47
+ }
48
+
49
+ export type ModalProps = PopupProps & { size?: "small" | "medium" | "large" };
50
+
51
+ export type PaneProps = PopupProps & { size?: "small" | "large" };
52
+
53
+ export interface RadioProps {
54
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
55
+ label?: string;
56
+ stacked?: boolean;
57
+ className?: string;
58
+ containerClassName?: string;
59
+ error?: string;
60
+ id?: any;
61
+ value?: any;
62
+ }
63
+
64
+ export type RadioItemProps = { label: string } & React.DetailedHTMLProps<
65
+ React.InputHTMLAttributes<HTMLInputElement>,
66
+ HTMLInputElement
67
+ >;
68
+
69
+ export type TabProps = {
70
+ size?: "large" | "small";
71
+ noUnderline?: boolean;
72
+ className?: string;
73
+ } & React.DetailedHTMLProps<
74
+ React.HTMLAttributes<HTMLDivElement>,
75
+ HTMLDivElement
76
+ >;
77
+
78
+ export type TabItemProps<S> = {
79
+ active?: boolean;
80
+ className?: string;
81
+ icon?: string | any;
82
+ onClick?: () => void;
83
+ activeClassName?: string;
84
+ [key: string]: any;
85
+ };
86
+
87
+ export interface ActionDropdownProps {
88
+ label?: string;
89
+ buttonStyle?: "primary" | "secondary";
90
+ buttonSize?: "small" | "medium" | "large";
91
+ disabled?: boolean;
92
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
93
+ className?: string;
94
+ buttonProps?: ButtonProps;
95
+ dropdownProps?: DropdownProps;
96
+ /** @deprecated Prop deprecated. Use `buttonStyle` prop instead*/
97
+ style?: "primary" | "secondary";
98
+ /** @deprecated Prop deprecated. Use `buttonStyle` prop instead*/
99
+ size?: "small" | "medium" | "large";
100
+ }
101
+
102
+ export interface AlertProps {
103
+ size?: "small" | "medium" | "large";
104
+ isOpen?: boolean;
105
+ isSubmitting?: boolean;
106
+ className?: string;
107
+ closeOnEsc?: boolean;
108
+ closeButton?: boolean;
109
+ backdropClassName?: string;
110
+ closeOnOutsideClick?: boolean;
111
+ onClose?: () => void;
112
+ onSubmit?: () => void;
113
+ title?: string;
114
+ message?: string;
115
+ submitButtonLabel?: string;
116
+ cancelButtonLabel?: string;
117
+ }
118
+
119
+ export type AvatarProps = {
120
+ size?: "small" | "medium" | "large" | "extraLarge";
121
+ user?: { name: string; imageUrl: string };
122
+ isSquare?: boolean;
123
+ status?: "online" | "idle" | "offline";
124
+ onClick?: React.MouseEventHandler<HTMLSpanElement>;
125
+ className?: string;
126
+ } & React.DetailedHTMLProps<
127
+ React.HTMLAttributes<HTMLSpanElement>,
128
+ HTMLSpanElement
129
+ >;
130
+
131
+ export interface ButtonProps {
132
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
133
+ icon?: string | any;
134
+ iconPosition?: "left" | "right";
135
+ iconSize?: number;
136
+ label?: string;
137
+ loading?: boolean;
138
+ to?: string;
139
+ type?: "button" | "reset" | "submit";
140
+ style?: "primary" | "secondary" | "danger" | "danger-text" | "text" | "link";
141
+ fullWidth?: boolean;
142
+ className?: string;
143
+ disabled?: boolean;
144
+ size?: "small" | "medium" | "large";
145
+ href?: string;
146
+ tooltipProps?: TooltipProps;
147
+ [key: string]: any;
148
+ }
149
+
150
+ export type CalloutProps = {
151
+ icon?: React.SVGProps<SVGSVGElement>;
152
+ style?: "info" | "warning" | "danger" | "success";
153
+ className?: string;
154
+ } & React.DetailedHTMLProps<
155
+ React.HTMLAttributes<HTMLDivElement>,
156
+ HTMLDivElement
157
+ >;
158
+
159
+ export type CheckboxProps = {
160
+ label?: string;
161
+ error?: string;
162
+ className?: string;
163
+ required?: false;
164
+ id?: string;
165
+ } & React.DetailedHTMLProps<
166
+ React.InputHTMLAttributes<HTMLInputElement>,
167
+ HTMLInputElement
168
+ >;
169
+
170
+ export type DatePickerProps = {
171
+ value: any;
172
+ defaultValue?: any;
173
+ className?: string;
174
+ label?: string;
175
+ size?: "small" | "medium" | "large";
176
+ dropdownClassName?: string;
177
+ dateFormat?: string;
178
+ timeFormat?: string;
179
+ onChange?: (date: any, dateString: string) => void;
180
+ onOk?: () => void;
181
+ picker?: "date" | "week" | "month" | "quarter" | "year";
182
+ showTime?: boolean;
183
+ type?: "range" | "date";
184
+ nakedInput?: boolean;
185
+ error?: string;
186
+ id?: string;
187
+ disabled?: boolean;
188
+ [key: string]: any;
189
+ };
190
+
191
+ export interface DropdownProps {
192
+ icon?: string | any;
193
+ label?: React.ReactNode;
194
+ isOpen?: boolean;
195
+ onClose?: () => void;
196
+ position?:
197
+ | "auto"
198
+ | "auto-start"
199
+ | "auto-end"
200
+ | "top"
201
+ | "top-start"
202
+ | "top-end"
203
+ | "bottom"
204
+ | "bottom-start"
205
+ | "bottom-end"
206
+ | "right"
207
+ | "right-start"
208
+ | "right-end"
209
+ | "left"
210
+ | "left-start"
211
+ | "left-end";
212
+ className?: string;
213
+ buttonSize?: "small" | "medium" | "large";
214
+ buttonStyle?:
215
+ | "primary"
216
+ | "secondary"
217
+ | "text"
218
+ | "danger"
219
+ | "danger-text"
220
+ | "link";
221
+ buttonProps?: ButtonProps;
222
+ customTarget?: React.ReactNode | (() => React.ReactNode);
223
+ disabled?: boolean;
224
+ dropdownProps?: any;
225
+ closeOnEsc?: boolean;
226
+ closeOnSelect?: boolean;
227
+ closeOnOutsideClick?: boolean;
228
+ dropdownModifiers?: any[];
229
+ trigger?: "click" | "hover";
230
+ strategy?: "absolute" | "fixed";
231
+ onClick?: () => void;
232
+ /** @deprecated Prop deprecated. Use `dropdownProps` prop instead*/
233
+ ulProps?: React.DetailedHTMLProps<
234
+ React.HTMLAttributes<HTMLUListElement>,
235
+ HTMLUListElement
236
+ >;
237
+ [key: string]: any;
238
+ }
239
+
240
+ export interface EmailInputProps {
241
+ label?: string;
242
+ placeholder?: string;
243
+ helpText?: string;
244
+ value?: { label: string; value: string; valid: boolean }[];
245
+ onChange?: (
246
+ emails: { label: string; value: string; valid: boolean }[]
247
+ ) => void;
248
+ error?: string;
249
+ onBlur?: () => void;
250
+ filterInvalidEmails?: { label: string };
251
+ counter?: boolean | { label: string; startFrom: number };
252
+ disabled?: boolean;
253
+ maxHeight?: number;
254
+ [key: string]: any;
255
+ }
256
+
257
+ export type InputProps = {
258
+ size?: "small" | "medium" | "large";
259
+ label?: string;
260
+ error?: string;
261
+ suffix?: React.ReactNode;
262
+ prefix?: React.ReactNode;
263
+ disabled?: boolean;
264
+ helpText?: string;
265
+ className?: string;
266
+ nakedInput?: boolean;
267
+ contentSize?: number;
268
+ required?: boolean;
269
+ } & React.DetailedHTMLProps<
270
+ React.InputHTMLAttributes<HTMLInputElement>,
271
+ HTMLInputElement
272
+ >;
273
+
274
+ export type LabelProps = {
275
+ className?: string;
276
+ required?: boolean;
277
+ helpIconProps?: {
278
+ onClick?: () => void;
279
+ icon?: any;
280
+ tooltipProps?: TooltipProps;
281
+ className?: string;
282
+ } & React.SVGProps<SVGSVGElement>;
283
+ } & React.DetailedHTMLProps<
284
+ React.LabelHTMLAttributes<HTMLLabelElement>,
285
+ HTMLLabelElement
286
+ >;
287
+
288
+ export type PageLoaderProps = { text?: string } & React.DetailedHTMLProps<
289
+ React.HTMLAttributes<HTMLDivElement>,
290
+ HTMLDivElement
291
+ >;
292
+
293
+ export interface PaginationProps {
294
+ pageSize: number;
295
+ count: number;
296
+ navigate?: (toPage: number) => void;
297
+ pageNo?: number;
298
+ siblingCount?: number;
299
+ className?: string;
300
+ }
301
+
302
+ export type SelectProps = {
303
+ size?: "small" | "medium" | "large";
304
+ label?: string;
305
+ required?: boolean;
306
+ error?: string;
307
+ helpText?: string;
308
+ className?: string;
309
+ innerRef?: React.Ref<HTMLSelectElement>;
310
+ isCreateable?: boolean;
311
+ strategy?: "default" | "fixed";
312
+ id?: string;
313
+ loadOptions?: boolean;
314
+ [key: string]: any;
315
+ };
316
+
317
+ export type SpinnerProps = {
318
+ theme?: "dark" | "light";
319
+ className?: string;
320
+ };
321
+
322
+ export type SwitchProps = {
323
+ label?: string;
324
+ required?: boolean;
325
+ className?: string;
326
+ error?: string;
327
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
328
+ checked?: boolean;
329
+ disabled?: boolean;
330
+ } & React.DetailedHTMLProps<
331
+ React.InputHTMLAttributes<HTMLInputElement>,
332
+ HTMLInputElement
333
+ >;
334
+
335
+ export interface TableProps {
336
+ rowData: any[];
337
+ columnData: any[];
338
+ allowRowClick?: boolean;
339
+ className?: string;
340
+ currentPageNumber?: number;
341
+ defaultPageSize?: number;
342
+ handlePageChange?: (page: number, pageSize: number) => void;
343
+ loading?: boolean;
344
+ onRowClick?: (
345
+ event: React.MouseEvent<any, MouseEvent>,
346
+ record: any,
347
+ rowIndex: number
348
+ ) => void;
349
+ onRowSelect?: (selectedRowKeys: React.Key[], selectedRows: any[]) => void;
350
+ totalCount?: number;
351
+ selectedRowKeys?: React.Key[];
352
+ fixedHeight?: boolean;
353
+ paginationProps?: any;
354
+ scroll?: {
355
+ x?: string | number | true;
356
+ y?: string | number;
357
+ scrollToFirstRowOnChange?: boolean;
358
+ };
359
+ rowSelection?: any;
360
+ [key: string]: any;
361
+ }
362
+
363
+ export interface TagProps {
364
+ icon?: string | any;
365
+ size?: "small" | "large";
366
+ label?: string;
367
+ type?: "outline" | "solid";
368
+ onClose?: () => void;
369
+ disabled?: boolean;
370
+ className?: string;
371
+ style?: "success" | "warning" | "danger" | "primary" | "secondary" | "info";
372
+ indicatorStyle?: "success" | "warning" | "danger" | "primary" | "secondary" | "info";
373
+ /** @deprecated Prop deprecated. Use `style` prop instead*/
374
+ color: string;
375
+ /** @deprecated Prop deprecated. Use `indicatorStyle` prop instead*/
376
+ indicatorColor?: string;
377
+ }
378
+
379
+ export type TextareaProps = {
380
+ rows?: number;
381
+ disabled?: boolean;
382
+ required?: boolean;
383
+ nakedTextarea?: boolean;
384
+ helpText?: string;
385
+ error?: string;
386
+ label?: string;
387
+ className?: string;
388
+ maxLength?: number;
389
+ } & React.DetailedHTMLProps<
390
+ React.TextareaHTMLAttributes<HTMLTextAreaElement>,
391
+ HTMLTextAreaElement
392
+ >;
393
+
394
+ export type TimePickerProps = {
395
+ className?: string;
396
+ label?: string;
397
+ format?: string;
398
+ size?: "small" | "medium" | "large";
399
+ interval?: {
400
+ hourStep: number;
401
+ minuteStep: number;
402
+ secondStep: number;
403
+ };
404
+ onChange?: (value: string) => void;
405
+ type?: "time" | "range";
406
+ nakedInput?: boolean;
407
+ disabled?: boolean;
408
+ error?: string;
409
+ defaultValue?: any;
410
+ value?: any;
411
+ id?: string;
412
+ [key: string]: any;
413
+ };
414
+
415
+ export interface TooltipProps {
416
+ content: React.ReactNode;
417
+ theme?: "dark" | "light";
418
+ disabled?: boolean;
419
+ position?:
420
+ | "auto"
421
+ | "auto-start"
422
+ | "auto-end"
423
+ | "top"
424
+ | "bottom"
425
+ | "right"
426
+ | "left"
427
+ | "auto"
428
+ | "top-start"
429
+ | "top-end"
430
+ | "bottom-start"
431
+ | "bottom-end"
432
+ | "right-start"
433
+ | "right-end"
434
+ | "left-start"
435
+ | "left-end";
436
+ interactive?: boolean;
437
+ hideAfter?: number;
438
+ hideOnTargetExit?: boolean;
439
+ [key: string]: any;
440
+ }
441
+
442
+ export type TypographyProps = {
443
+ style?:
444
+ | "h1"
445
+ | "h2"
446
+ | "h3"
447
+ | "h4"
448
+ | "h5"
449
+ | "h6"
450
+ | "body1"
451
+ | "body2"
452
+ | "body3"
453
+ | "nano";
454
+ weight?:
455
+ | "thin"
456
+ | "extralight"
457
+ | "light"
458
+ | "normal"
459
+ | "medium"
460
+ | "semibold"
461
+ | "bold"
462
+ | "extrabold"
463
+ | "black";
464
+ lineHeight?: "none" | "tight" | "snug" | "normal" | "relaxed" | "loose";
465
+ component?:
466
+ | "h1"
467
+ | "h2"
468
+ | "h3"
469
+ | "h4"
470
+ | "h5"
471
+ | "h6"
472
+ | "p"
473
+ | "span"
474
+ | "b"
475
+ | "strong"
476
+ | "i"
477
+ | "em"
478
+ | "mark"
479
+ | "del"
480
+ | "s"
481
+ | "ins"
482
+ | "sub"
483
+ | "sup"
484
+ | "u"
485
+ | "code"
486
+ | "blockquote";
487
+ textTransform?:
488
+ | "none"
489
+ | "capitalize"
490
+ | "uppercase"
491
+ | "lowercase"
492
+ | "fullwidth"
493
+ | "inherit"
494
+ | "initial"
495
+ | "revert"
496
+ | "unset";
497
+ className?: string;
498
+ } & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
499
+
500
+ // components
501
+
502
+ export const Accordion: React.FC<AccordionProps> & {
503
+ Item: React.FC<AccordionItemProps>;
504
+ };
505
+ export const Modal: React.FC<ModalProps> & {
506
+ Header: React.FC<PopupContentProps>;
507
+ Body: React.FC<PopupContentProps>;
508
+ Footer: React.FC<PopupContentProps>;
509
+ };
510
+ export const Pane: React.FC<PaneProps> & {
511
+ Header: React.FC<PopupContentProps>;
512
+ Body: React.FC<PopupContentProps & { hasFooter?: boolean }>;
513
+ Footer: React.FC<PopupContentProps>;
514
+ };
515
+ export const Radio: React.FC<RadioProps> & {
516
+ Item: React.FC<RadioItemProps>;
517
+ };
518
+ export const Tab: React.FC<TabProps> & {
519
+ Item: React.FC<TabItemProps<any>>;
520
+ };
521
+
522
+ type ToastrFunction = (
523
+ message: React.ReactNode,
524
+ buttonLabel?: React.ReactNode,
525
+ onClick?: () => void
526
+ ) => void;
527
+
528
+ export const Toastr: {
529
+ show: ToastrFunction;
530
+ info: ToastrFunction;
531
+ success: ToastrFunction;
532
+ error: (
533
+ message: React.ReactNode | Error,
534
+ buttonLabel: React.ReactNode,
535
+ onClick: () => void
536
+ ) => void;
537
+ warning: ToastrFunction;
538
+ };
539
+
540
+ export const ColorPicker: React.FC<ColorPickerProps>;
541
+
542
+ export const ActionDropdown: React.FC<ActionDropdownProps>;
543
+ export const Alert: React.FC<AlertProps>;
544
+ export const Avatar: React.FC<AvatarProps>;
545
+ export const Button: React.FC<ButtonProps>;
546
+ export const Callout: React.FC<CalloutProps>;
547
+ export const Checkbox: React.FC<CheckboxProps>;
548
+ export const DatePicker: React.FC<DatePickerProps>;
549
+ export const Dropdown: React.FC<DropdownProps>;
550
+ export const EmailInput: React.FC<EmailInputProps>;
551
+ export const Input: React.ForwardRefExoticComponent<InputProps>;
552
+ export const Label: React.FC<LabelProps>;
553
+ export const PageLoader: React.FC<PageLoaderProps>;
554
+ export const Pagination: React.FC<PaginationProps>;
555
+ export const Select: React.ForwardRefExoticComponent<SelectProps>;
556
+ export const Spinner: React.FC<SpinnerProps>;
557
+ export const Switch: React.ForwardRefExoticComponent<SwitchProps>;
558
+ export const Table: React.FC<TableProps>;
559
+ export const Tag: React.FC<TagProps>;
560
+ export const Textarea: React.ForwardRefExoticComponent<TextareaProps>;
561
+ export const TimePicker: React.FC<TimePickerProps>;
562
+ export const Typography: React.ForwardRefExoticComponent<TypographyProps>;
563
+ export const Tooltip: React.ForwardRefExoticComponent<TooltipProps>;