@delightui/components 0.1.46 → 0.1.47
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/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2265 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ImgHTMLAttributes, SyntheticEvent, HTMLAttributes, ReactNode, MouseEvent, InputHTMLAttributes, TextareaHTMLAttributes, Dispatch, SetStateAction, Ref, FormHTMLAttributes, LiHTMLAttributes, CSSProperties, TableHTMLAttributes, TdHTMLAttributes } from 'react';
|
|
3
|
+
import { LinkProps } from 'react-router-dom';
|
|
4
|
+
import { Plugin } from 'flatpickr/dist/types/options';
|
|
5
|
+
import FlatPickr from 'react-flatpickr';
|
|
6
|
+
import { Offset } from 'react-overlays/usePopper';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Enum for different image fit options.
|
|
10
|
+
*/
|
|
11
|
+
type ImageFitEnum = 'Fit' | 'Fill' | 'Crop';
|
|
12
|
+
interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
13
|
+
/**
|
|
14
|
+
* The URL of the image to display if the image fails to load.
|
|
15
|
+
*/
|
|
16
|
+
fallback?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The fit option for the image.
|
|
19
|
+
* @default 'Fit'
|
|
20
|
+
*/
|
|
21
|
+
fit?: ImageFitEnum;
|
|
22
|
+
/**
|
|
23
|
+
* Callback function when the image has loaded.
|
|
24
|
+
*/
|
|
25
|
+
onLoad?: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Callback function when an error occurs while loading the image.
|
|
28
|
+
*/
|
|
29
|
+
onError?: (error: SyntheticEvent<HTMLImageElement>) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Flag to show a loading indicator for the image.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
showLoading?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Additional class for styling.
|
|
37
|
+
*/
|
|
38
|
+
className?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The aspect ratio of the image.
|
|
41
|
+
* @default natural aspect ratio of the image
|
|
42
|
+
*/
|
|
43
|
+
aspectRatio?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare const Image: (props: ImageProps) => JSX.Element;
|
|
47
|
+
|
|
48
|
+
type ActionImageProps = ImageProps & {
|
|
49
|
+
/**
|
|
50
|
+
* Specifies if the action image is disabled.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Additional class for styling.
|
|
56
|
+
*/
|
|
57
|
+
className?: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* ActionImage component definition.
|
|
62
|
+
*/
|
|
63
|
+
declare const ActionImage: (props: ActionImageProps) => React__default.JSX.Element;
|
|
64
|
+
|
|
65
|
+
type ButtonAppearanceEnum = 'Default' | 'Inverse';
|
|
66
|
+
type ButtonTypeEnum = 'Filled' | 'Outlined' | 'Ghost';
|
|
67
|
+
type ButtonStyleEnum = 'Primary' | 'Secondary' | 'Destructive';
|
|
68
|
+
type ButtonSizeEnum = 'Small' | 'Medium' | 'Large';
|
|
69
|
+
type ButtonActionTypeEnum = 'button' | 'submit' | 'reset';
|
|
70
|
+
type ButtonProps = Omit<HTMLAttributes<HTMLButtonElement>, 'style'> & {
|
|
71
|
+
/**
|
|
72
|
+
* Appearance of the button.
|
|
73
|
+
* @default 'Default'
|
|
74
|
+
*/
|
|
75
|
+
appearance?: ButtonAppearanceEnum;
|
|
76
|
+
/**
|
|
77
|
+
* Type of the button.
|
|
78
|
+
* @default 'Filled'
|
|
79
|
+
*/
|
|
80
|
+
type?: ButtonTypeEnum;
|
|
81
|
+
/**
|
|
82
|
+
* Style of the button.
|
|
83
|
+
* @default 'Primary'
|
|
84
|
+
*/
|
|
85
|
+
style?: ButtonStyleEnum;
|
|
86
|
+
/**
|
|
87
|
+
* Size of the button.
|
|
88
|
+
* @default 'Medium'
|
|
89
|
+
*/
|
|
90
|
+
size?: ButtonSizeEnum;
|
|
91
|
+
/**
|
|
92
|
+
* Indicates if the button is in a loading state.
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
loading?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Specifies if the button is disabled.
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
disabled?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Icon to be displayed before the button's content.
|
|
103
|
+
*/
|
|
104
|
+
leadingIcon?: ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* Icon to be displayed after the button's content.
|
|
107
|
+
*/
|
|
108
|
+
trailingIcon?: ReactNode;
|
|
109
|
+
/**
|
|
110
|
+
* Click event handler for the button.
|
|
111
|
+
*/
|
|
112
|
+
onClick?: (event?: MouseEvent<HTMLElement>) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Additional class for styling.
|
|
115
|
+
*/
|
|
116
|
+
className?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Type of action associated with the button.
|
|
119
|
+
* @default 'button'
|
|
120
|
+
*/
|
|
121
|
+
actionType?: ButtonActionTypeEnum;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Button component definition.
|
|
126
|
+
*/
|
|
127
|
+
declare const Button: (props: ButtonProps) => React__default.JSX.Element;
|
|
128
|
+
|
|
129
|
+
type IconStyleEnum = 'Outlined' | 'Filled' | 'Round';
|
|
130
|
+
type IconSizeEnum = 'Small' | 'Medium' | 'Large';
|
|
131
|
+
interface IconProps {
|
|
132
|
+
/**
|
|
133
|
+
* The name of the icon to be displayed.
|
|
134
|
+
*/
|
|
135
|
+
icon: string;
|
|
136
|
+
/**
|
|
137
|
+
* Style of the icon.
|
|
138
|
+
* @default 'Filled'
|
|
139
|
+
*/
|
|
140
|
+
style?: IconStyleEnum;
|
|
141
|
+
/**
|
|
142
|
+
* Size of the icon.
|
|
143
|
+
* @default 'Medium'
|
|
144
|
+
*/
|
|
145
|
+
size?: IconSizeEnum;
|
|
146
|
+
/**
|
|
147
|
+
* Additional class for styling.
|
|
148
|
+
*/
|
|
149
|
+
className?: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare const Icon: (props: IconProps) => React__default.JSX.Element | null;
|
|
153
|
+
|
|
154
|
+
type IconButtonAppearanceEnum = 'Default' | 'Inverse';
|
|
155
|
+
type IconButtonStyleEnum = 'Primary' | 'Secondary';
|
|
156
|
+
type IconButtonSizeEnum = 'Small' | 'Medium';
|
|
157
|
+
interface IconButtonProps extends Omit<ButtonProps, 'leadingIcon' | 'trailingIcon' | 'style' | 'size'> {
|
|
158
|
+
/**
|
|
159
|
+
* Appearance of the button.
|
|
160
|
+
* @default 'Default'
|
|
161
|
+
*/
|
|
162
|
+
appearance?: IconButtonAppearanceEnum;
|
|
163
|
+
/**
|
|
164
|
+
* The icon to be displayed.
|
|
165
|
+
*/
|
|
166
|
+
icon?: ReactNode;
|
|
167
|
+
/**
|
|
168
|
+
* Style of the button.
|
|
169
|
+
* @default 'Primary'
|
|
170
|
+
*/
|
|
171
|
+
style?: IconButtonStyleEnum;
|
|
172
|
+
/**
|
|
173
|
+
* Size of the button.
|
|
174
|
+
* @default 'Medium'
|
|
175
|
+
*/
|
|
176
|
+
size?: IconButtonSizeEnum;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
declare const IconButton: (props: IconButtonProps) => React__default.JSX.Element;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Enum for different input types.
|
|
183
|
+
*/
|
|
184
|
+
type InputTypeEnum = 'Text' | 'Number' | 'Email' | 'Password';
|
|
185
|
+
type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value'> & {
|
|
186
|
+
/**
|
|
187
|
+
* The type of input.
|
|
188
|
+
* @default 'Text'
|
|
189
|
+
*/
|
|
190
|
+
inputType?: InputTypeEnum;
|
|
191
|
+
/**
|
|
192
|
+
* The value of the input.
|
|
193
|
+
*/
|
|
194
|
+
value?: string;
|
|
195
|
+
/**
|
|
196
|
+
* Callback function when the input value changes.
|
|
197
|
+
* @param value - The new value of the input.
|
|
198
|
+
*/
|
|
199
|
+
onValueChanged?: (value: string) => void;
|
|
200
|
+
/**
|
|
201
|
+
* Indicates if the input is invalid.
|
|
202
|
+
* @default false
|
|
203
|
+
*/
|
|
204
|
+
invalid?: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Icon to be displayed before the input.
|
|
207
|
+
*/
|
|
208
|
+
leadingIcon?: React.ReactNode;
|
|
209
|
+
/**
|
|
210
|
+
* Icon to be displayed after the input.
|
|
211
|
+
*/
|
|
212
|
+
trailingIcon?: React.ReactNode;
|
|
213
|
+
/**
|
|
214
|
+
* provide a way to override the styling
|
|
215
|
+
*/
|
|
216
|
+
'component-variant'?: string;
|
|
217
|
+
/**
|
|
218
|
+
* The input is independent of the parent form field context.
|
|
219
|
+
* @default false
|
|
220
|
+
*/
|
|
221
|
+
independent?: boolean;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
declare const Input: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "value" | "type"> & {
|
|
225
|
+
inputType?: InputTypeEnum;
|
|
226
|
+
value?: string;
|
|
227
|
+
onValueChanged?: (value: string) => void;
|
|
228
|
+
invalid?: boolean;
|
|
229
|
+
leadingIcon?: React__default.ReactNode;
|
|
230
|
+
trailingIcon?: React__default.ReactNode;
|
|
231
|
+
'component-variant'?: string;
|
|
232
|
+
independent?: boolean;
|
|
233
|
+
} & React__default.RefAttributes<HTMLInputElement>>;
|
|
234
|
+
|
|
235
|
+
type PasswordProps = Omit<InputProps, 'inputType' | 'trailingIcon'> & {
|
|
236
|
+
hideTrailingIcon?: boolean;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
declare const Password: (props: PasswordProps) => React__default.JSX.Element;
|
|
240
|
+
|
|
241
|
+
type SpinnerProps = {
|
|
242
|
+
className?: string;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
declare const Spinner: ({ className }: SpinnerProps) => React__default.JSX.Element;
|
|
246
|
+
|
|
247
|
+
declare const types: readonly ["Heading1", "Heading2", "Heading3", "Heading4", "Heading5", "Heading6", "BodyLarge", "BodyMedium", "BodySmall"];
|
|
248
|
+
declare const weights: readonly ["Thin", "ExtraLight", "Light", "Regular", "Medium", "SemiBold", "Bold", "ExtraBold", "Black", "ExtraBlack", 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
249
|
+
declare const transforms: readonly ["None", "Capitalize", "UpperCase", "LowerCase"];
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Enum for the types of text.
|
|
253
|
+
*/
|
|
254
|
+
type TextTypeEnum = typeof types[number];
|
|
255
|
+
/**
|
|
256
|
+
* Enum for the weights of text.
|
|
257
|
+
*/
|
|
258
|
+
type TextWeightEnum = typeof weights[number];
|
|
259
|
+
/**
|
|
260
|
+
* Enum for text decorations.
|
|
261
|
+
*/
|
|
262
|
+
type TextDecorationEnum = 'None' | 'Underline' | 'Strikethrough';
|
|
263
|
+
/**
|
|
264
|
+
* Enum for text transformations.
|
|
265
|
+
*/
|
|
266
|
+
type TextTransformEnum = typeof transforms[number];
|
|
267
|
+
interface TextProps {
|
|
268
|
+
/**
|
|
269
|
+
* Additional class for styling.
|
|
270
|
+
*/
|
|
271
|
+
className?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Type of the text.
|
|
274
|
+
* @default 'BodyMedium'
|
|
275
|
+
*/
|
|
276
|
+
type?: TextTypeEnum;
|
|
277
|
+
/**
|
|
278
|
+
* Weight of the text.
|
|
279
|
+
* @default 'Regular'
|
|
280
|
+
*/
|
|
281
|
+
weight?: TextWeightEnum;
|
|
282
|
+
/**
|
|
283
|
+
* The content to be displayed as text.
|
|
284
|
+
*/
|
|
285
|
+
children?: React.ReactNode;
|
|
286
|
+
/**
|
|
287
|
+
* Flag to prevent text from wrapping.
|
|
288
|
+
* @default false
|
|
289
|
+
*/
|
|
290
|
+
noWrap?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Flag to handle how white space inside an element is handled.
|
|
293
|
+
* @default false
|
|
294
|
+
*/
|
|
295
|
+
whiteSpaceNoWrap?: boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Flag to italicize the text.
|
|
298
|
+
* @default false
|
|
299
|
+
*/
|
|
300
|
+
italic?: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Decoration style for the text.
|
|
303
|
+
* @default 'None'
|
|
304
|
+
*/
|
|
305
|
+
decoration?: TextDecorationEnum;
|
|
306
|
+
/**
|
|
307
|
+
* Flag to show ellipsis for overflowing text.
|
|
308
|
+
* @default false
|
|
309
|
+
*/
|
|
310
|
+
ellipsis?: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* Transform style for the text.
|
|
313
|
+
* @default 'None'
|
|
314
|
+
*/
|
|
315
|
+
transform?: TextTransformEnum;
|
|
316
|
+
/**
|
|
317
|
+
* Modify the element type used for rendering
|
|
318
|
+
*/
|
|
319
|
+
as?: React.ElementType<any, 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span'>;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Text component definition.
|
|
324
|
+
*/
|
|
325
|
+
declare const Text: (props: TextProps) => React__default.JSX.Element;
|
|
326
|
+
|
|
327
|
+
type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value'> & {
|
|
328
|
+
/**
|
|
329
|
+
* The value of the text area.
|
|
330
|
+
*/
|
|
331
|
+
value?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Callback function when the value of the text area changes.
|
|
334
|
+
* @param value - The new value of the text area.
|
|
335
|
+
*/
|
|
336
|
+
onValueChanged?: (value: string) => void;
|
|
337
|
+
/**
|
|
338
|
+
* Indicates if the text area is in an invalid state.
|
|
339
|
+
* @default false
|
|
340
|
+
*/
|
|
341
|
+
invalid?: boolean;
|
|
342
|
+
/**
|
|
343
|
+
* Additional class for styling.
|
|
344
|
+
*/
|
|
345
|
+
className?: string;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
declare const TextArea: React__default.ForwardRefExoticComponent<Omit<React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, "value"> & {
|
|
349
|
+
value?: string;
|
|
350
|
+
onValueChanged?: (value: string) => void;
|
|
351
|
+
invalid?: boolean;
|
|
352
|
+
className?: string;
|
|
353
|
+
} & React__default.RefAttributes<HTMLTextAreaElement>>;
|
|
354
|
+
|
|
355
|
+
type ResponsiveComponentProps<T> = {
|
|
356
|
+
className?: string;
|
|
357
|
+
component: React.FC<T>;
|
|
358
|
+
children: React.ReactElement<BreakpointProps<T>>[];
|
|
359
|
+
};
|
|
360
|
+
type BreakpointProps<T> = {
|
|
361
|
+
width: number;
|
|
362
|
+
children: React.ReactElement<T>;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
declare const Breakpoint: <T>({ children }: BreakpointProps<T>) => React__default.JSX.Element;
|
|
366
|
+
declare const ResponsiveComponent: <T>(props: ResponsiveComponentProps<T>) => React__default.JSX.Element;
|
|
367
|
+
|
|
368
|
+
type ListItemProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
369
|
+
/**
|
|
370
|
+
* Icon to be displayed before the button's content.
|
|
371
|
+
*/
|
|
372
|
+
leadingIcon?: ReactNode;
|
|
373
|
+
/**
|
|
374
|
+
* Icon to be displayed after the button's content.
|
|
375
|
+
*/
|
|
376
|
+
trailingIcon?: ReactNode;
|
|
377
|
+
/**
|
|
378
|
+
* Whether the list item is disabled.
|
|
379
|
+
*/
|
|
380
|
+
disabled?: boolean;
|
|
381
|
+
/**
|
|
382
|
+
* Click event handler for the list item.
|
|
383
|
+
*/
|
|
384
|
+
onClick?: (event?: MouseEvent<HTMLElement>) => void;
|
|
385
|
+
/**
|
|
386
|
+
* The label for the list item.
|
|
387
|
+
*/
|
|
388
|
+
children?: ReactNode;
|
|
389
|
+
/**
|
|
390
|
+
* Additional class for styling.
|
|
391
|
+
*/
|
|
392
|
+
className?: string;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
declare const ListItem: (props: ListItemProps) => React__default.JSX.Element;
|
|
396
|
+
|
|
397
|
+
type SelectListItemProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
398
|
+
/**
|
|
399
|
+
* Icon to be displayed before the button's content.
|
|
400
|
+
*/
|
|
401
|
+
leadingIcon?: ReactNode;
|
|
402
|
+
/**
|
|
403
|
+
* Icon to be displayed after the button's content.
|
|
404
|
+
*/
|
|
405
|
+
trailingIcon?: ReactNode;
|
|
406
|
+
/**
|
|
407
|
+
* Whether the list item is disabled.
|
|
408
|
+
*/
|
|
409
|
+
disabled?: boolean;
|
|
410
|
+
/**
|
|
411
|
+
* Click event handler for the list item.
|
|
412
|
+
*/
|
|
413
|
+
onClick?: (event?: MouseEvent<HTMLElement>) => void;
|
|
414
|
+
/**
|
|
415
|
+
* The label for the list item.
|
|
416
|
+
*/
|
|
417
|
+
children?: ReactNode;
|
|
418
|
+
/**
|
|
419
|
+
* Additional class for styling.
|
|
420
|
+
*/
|
|
421
|
+
className?: string;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
declare const SelectListItem: (props: SelectListItemProps) => React__default.JSX.Element;
|
|
425
|
+
|
|
426
|
+
type ToggleLabelAlignmentEnum = 'Left' | 'Right';
|
|
427
|
+
type ToggleProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'checked'> & {
|
|
428
|
+
/**
|
|
429
|
+
* The label of the toggle.
|
|
430
|
+
*/
|
|
431
|
+
children?: React.ReactNode;
|
|
432
|
+
/**
|
|
433
|
+
* The checked state of the toggle.
|
|
434
|
+
*/
|
|
435
|
+
checked?: boolean;
|
|
436
|
+
/**
|
|
437
|
+
* Callback function when the toggle state changes.
|
|
438
|
+
* @param value - The new checked state of the toggle.
|
|
439
|
+
*/
|
|
440
|
+
onValueChanged?: (value: boolean) => void;
|
|
441
|
+
/**
|
|
442
|
+
* Default checked state of the toggle.
|
|
443
|
+
* @default false
|
|
444
|
+
*/
|
|
445
|
+
defaultChecked?: boolean;
|
|
446
|
+
/**
|
|
447
|
+
* Indicates if the toggle is invalid.
|
|
448
|
+
* @default false
|
|
449
|
+
*/
|
|
450
|
+
invalid?: boolean;
|
|
451
|
+
/**
|
|
452
|
+
* Alignment of the label.
|
|
453
|
+
* @default 'Left'
|
|
454
|
+
*/
|
|
455
|
+
labelAlignment?: ToggleLabelAlignmentEnum;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
declare const Toggle: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "checked" | "value" | "type"> & {
|
|
459
|
+
children?: React__default.ReactNode;
|
|
460
|
+
checked?: boolean;
|
|
461
|
+
onValueChanged?: (value: boolean) => void;
|
|
462
|
+
defaultChecked?: boolean;
|
|
463
|
+
invalid?: boolean;
|
|
464
|
+
labelAlignment?: ToggleLabelAlignmentEnum;
|
|
465
|
+
} & React__default.RefAttributes<HTMLInputElement>>;
|
|
466
|
+
|
|
467
|
+
declare const ToggleButton: React__default.ForwardRefExoticComponent<Omit<ButtonProps, "type" | "actionType"> & {
|
|
468
|
+
checked?: boolean;
|
|
469
|
+
defaultChecked?: boolean;
|
|
470
|
+
onValueChanged?: (value: boolean) => void;
|
|
471
|
+
disabled?: boolean;
|
|
472
|
+
required?: boolean;
|
|
473
|
+
invalid?: boolean;
|
|
474
|
+
children?: React__default.ReactNode;
|
|
475
|
+
className?: string;
|
|
476
|
+
} & React__default.RefAttributes<HTMLInputElement>>;
|
|
477
|
+
|
|
478
|
+
type ToggleButtonProps = Omit<ButtonProps, 'type' | 'actionType'> & {
|
|
479
|
+
/**
|
|
480
|
+
* Controlled state of the toggle
|
|
481
|
+
*/
|
|
482
|
+
checked?: boolean;
|
|
483
|
+
/**
|
|
484
|
+
* Default value for uncontrolled component
|
|
485
|
+
*/
|
|
486
|
+
defaultChecked?: boolean;
|
|
487
|
+
/**
|
|
488
|
+
* Callback function when toggle state changes
|
|
489
|
+
*/
|
|
490
|
+
onValueChanged?: (value: boolean) => void;
|
|
491
|
+
/**
|
|
492
|
+
* Disable the toggle
|
|
493
|
+
*/
|
|
494
|
+
disabled?: boolean;
|
|
495
|
+
/**
|
|
496
|
+
* Make the toggle required
|
|
497
|
+
*/
|
|
498
|
+
required?: boolean;
|
|
499
|
+
/**
|
|
500
|
+
* Show invalid state
|
|
501
|
+
*/
|
|
502
|
+
invalid?: boolean;
|
|
503
|
+
/**
|
|
504
|
+
* Content of the button
|
|
505
|
+
*/
|
|
506
|
+
children?: ReactNode;
|
|
507
|
+
/**
|
|
508
|
+
* Additional className for the toggle
|
|
509
|
+
*/
|
|
510
|
+
className?: string;
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Enum for the action type of the Tooltip.
|
|
515
|
+
*/
|
|
516
|
+
type TooltipActionType = 'Click' | 'Hover' | 'Follow';
|
|
517
|
+
/**
|
|
518
|
+
* Enum for the direction of the Tooltip.
|
|
519
|
+
*/
|
|
520
|
+
type TooltipDirectionEnum = 'Top' | 'Bottom' | 'Right' | 'Left';
|
|
521
|
+
/**
|
|
522
|
+
* Enum for the alignment of the Tooltip.
|
|
523
|
+
*/
|
|
524
|
+
type TooltipAlignEnum = 'Start' | 'End' | 'Center';
|
|
525
|
+
/**
|
|
526
|
+
* Enum for the style of the Tooltip.
|
|
527
|
+
*/
|
|
528
|
+
type TooltipStyleEnum = 'Default' | 'Outlined';
|
|
529
|
+
/**
|
|
530
|
+
* Props for the Tooltip component.
|
|
531
|
+
*/
|
|
532
|
+
type TooltipProps = {
|
|
533
|
+
/**
|
|
534
|
+
* The content displayed inside the tooltip.
|
|
535
|
+
*/
|
|
536
|
+
children?: React__default.ReactNode;
|
|
537
|
+
/**
|
|
538
|
+
* The direction where the tooltip should appear relative to the target.
|
|
539
|
+
* @default "Top"
|
|
540
|
+
*/
|
|
541
|
+
direction?: TooltipDirectionEnum;
|
|
542
|
+
/**
|
|
543
|
+
* Alignment of the tooltip relative to the target.
|
|
544
|
+
* @default "Start"
|
|
545
|
+
*/
|
|
546
|
+
alignment?: TooltipAlignEnum;
|
|
547
|
+
/**
|
|
548
|
+
* The event that action the tooltip visibility.
|
|
549
|
+
* @default "Hover"
|
|
550
|
+
*/
|
|
551
|
+
action?: TooltipActionType;
|
|
552
|
+
/**
|
|
553
|
+
* Whether the tooltip is initially visible.
|
|
554
|
+
* @default false
|
|
555
|
+
*/
|
|
556
|
+
isVisible?: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* The target element that triggers the tooltip.
|
|
559
|
+
*/
|
|
560
|
+
target?: React__default.ReactNode;
|
|
561
|
+
/**
|
|
562
|
+
* The style of the tooltip.
|
|
563
|
+
* @default "Default"
|
|
564
|
+
*/
|
|
565
|
+
style?: TooltipStyleEnum;
|
|
566
|
+
/**
|
|
567
|
+
* Additional CSS class names for the tooltip.
|
|
568
|
+
*/
|
|
569
|
+
className?: string;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
declare const Tooltip: ({ children, direction, alignment, action, style, isVisible, target, className, }: TooltipProps) => React__default.JSX.Element;
|
|
573
|
+
|
|
574
|
+
interface CustomToggleProps {
|
|
575
|
+
/**
|
|
576
|
+
* Controlled state of the toggle
|
|
577
|
+
*/
|
|
578
|
+
checked?: boolean;
|
|
579
|
+
/**
|
|
580
|
+
* Default value for uncontrolled component
|
|
581
|
+
*/
|
|
582
|
+
defaultChecked?: boolean;
|
|
583
|
+
/**
|
|
584
|
+
* Callback function when toggle state changes
|
|
585
|
+
*/
|
|
586
|
+
onValueChanged?: (value: boolean) => void;
|
|
587
|
+
/**
|
|
588
|
+
* Disable the toggle
|
|
589
|
+
*/
|
|
590
|
+
disabled?: boolean;
|
|
591
|
+
/**
|
|
592
|
+
* Make the toggle required
|
|
593
|
+
*/
|
|
594
|
+
required?: boolean;
|
|
595
|
+
/**
|
|
596
|
+
* Show invalid state
|
|
597
|
+
*/
|
|
598
|
+
invalid?: boolean;
|
|
599
|
+
/**
|
|
600
|
+
* Content to show when toggle is off
|
|
601
|
+
*/
|
|
602
|
+
offContent?: ReactNode;
|
|
603
|
+
/**
|
|
604
|
+
* Content to show when toggle is on
|
|
605
|
+
*/
|
|
606
|
+
onContent?: ReactNode;
|
|
607
|
+
/**
|
|
608
|
+
* Additional className for the toggle
|
|
609
|
+
*/
|
|
610
|
+
className?: string;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
declare const CustomToggle: React__default.ForwardRefExoticComponent<CustomToggleProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
614
|
+
|
|
615
|
+
type ChipTypeEnum = 'Bright' | 'BrightOutline' | 'Subdued' | 'SubduedOutline';
|
|
616
|
+
type ChipStyleEnum = 'A' | 'B' | 'C' | 'D' | 'E' | 'F';
|
|
617
|
+
type ChipSizeEnum = 'Small' | 'Medium' | 'Large';
|
|
618
|
+
type ChipCornerEnum = 'Rounded' | 'Squared';
|
|
619
|
+
type ChipProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
620
|
+
/**
|
|
621
|
+
* Type of the chip.
|
|
622
|
+
* @default 'Filled'
|
|
623
|
+
*/
|
|
624
|
+
type?: ChipTypeEnum;
|
|
625
|
+
/**
|
|
626
|
+
* Style of the chip.
|
|
627
|
+
* @default 'A'
|
|
628
|
+
*/
|
|
629
|
+
style?: ChipStyleEnum;
|
|
630
|
+
/**
|
|
631
|
+
* Size of the chip.
|
|
632
|
+
* @default 'Medium'
|
|
633
|
+
*/
|
|
634
|
+
size?: ChipSizeEnum;
|
|
635
|
+
/**
|
|
636
|
+
* Determines if the chip is disabled.
|
|
637
|
+
* @default false
|
|
638
|
+
*/
|
|
639
|
+
isDisabled?: boolean;
|
|
640
|
+
/**
|
|
641
|
+
* Icon displayed before the chip's content.
|
|
642
|
+
*/
|
|
643
|
+
leadingIcon?: ReactNode;
|
|
644
|
+
/**
|
|
645
|
+
* Icon displayed after the chip's content.
|
|
646
|
+
*/
|
|
647
|
+
trailingIcon?: ReactNode;
|
|
648
|
+
/**
|
|
649
|
+
* Click event handler for the chip.
|
|
650
|
+
*/
|
|
651
|
+
onClick?: (event?: MouseEvent<HTMLDivElement>) => void;
|
|
652
|
+
/**
|
|
653
|
+
* Additional class for styling.
|
|
654
|
+
*/
|
|
655
|
+
className?: string;
|
|
656
|
+
/**
|
|
657
|
+
* Defines the corner shape of the chip.
|
|
658
|
+
* @default 'Rounded'
|
|
659
|
+
*/
|
|
660
|
+
corner?: ChipCornerEnum;
|
|
661
|
+
/**
|
|
662
|
+
* Determines if the chip is dismissible.
|
|
663
|
+
* @default false
|
|
664
|
+
*/
|
|
665
|
+
isDismissible?: boolean;
|
|
666
|
+
/**
|
|
667
|
+
* Close button/icon for dismissible chips.
|
|
668
|
+
*/
|
|
669
|
+
closeIcon?: ReactNode;
|
|
670
|
+
/**
|
|
671
|
+
* Event handler for the close action when chip is dismissible.
|
|
672
|
+
*/
|
|
673
|
+
onClose?: (event?: MouseEvent<HTMLElement>) => void;
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Chip component definition.
|
|
678
|
+
*/
|
|
679
|
+
declare const Chip: (props: ChipProps) => React__default.JSX.Element;
|
|
680
|
+
|
|
681
|
+
type CheckboxSizeEnum = 'Small' | 'Medium' | 'Large';
|
|
682
|
+
type CheckboxLabelAlignmentEnum = 'Left' | 'Right';
|
|
683
|
+
type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'value'> & {
|
|
684
|
+
/**
|
|
685
|
+
* The label of the checkbox.
|
|
686
|
+
*/
|
|
687
|
+
children?: React.ReactNode;
|
|
688
|
+
/**
|
|
689
|
+
* The size of the checkbox.
|
|
690
|
+
* @default 'Medium'
|
|
691
|
+
*/
|
|
692
|
+
size?: CheckboxSizeEnum;
|
|
693
|
+
/**
|
|
694
|
+
* The checked state of the checkbox.
|
|
695
|
+
*/
|
|
696
|
+
checked?: boolean;
|
|
697
|
+
/**
|
|
698
|
+
* Callback function when the checkbox state changes.
|
|
699
|
+
* @param value - The new checked state of the checkbox.
|
|
700
|
+
*/
|
|
701
|
+
onValueChanged?: (value: boolean) => void;
|
|
702
|
+
/**
|
|
703
|
+
* Default checked state of the checkbox.
|
|
704
|
+
* @default false
|
|
705
|
+
*/
|
|
706
|
+
defaultChecked?: boolean;
|
|
707
|
+
/**
|
|
708
|
+
* Indicates if the checkbox is invalid.
|
|
709
|
+
* @default false
|
|
710
|
+
*/
|
|
711
|
+
invalid?: boolean;
|
|
712
|
+
/**
|
|
713
|
+
* The value of the checkbox.
|
|
714
|
+
*/
|
|
715
|
+
value?: string | number;
|
|
716
|
+
/**
|
|
717
|
+
* The alignment of the label.
|
|
718
|
+
*/
|
|
719
|
+
labelAlignment?: CheckboxLabelAlignmentEnum;
|
|
720
|
+
/**
|
|
721
|
+
* The checkbox is independent of the parent form field context.
|
|
722
|
+
* @default false
|
|
723
|
+
*/
|
|
724
|
+
independent?: boolean;
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "checked" | "value" | "type"> & {
|
|
728
|
+
children?: React__default.ReactNode;
|
|
729
|
+
size?: CheckboxSizeEnum;
|
|
730
|
+
checked?: boolean;
|
|
731
|
+
onValueChanged?: (value: boolean) => void;
|
|
732
|
+
defaultChecked?: boolean;
|
|
733
|
+
invalid?: boolean;
|
|
734
|
+
value?: string | number;
|
|
735
|
+
labelAlignment?: CheckboxLabelAlignmentEnum;
|
|
736
|
+
independent?: boolean;
|
|
737
|
+
} & React__default.RefAttributes<HTMLInputElement>>;
|
|
738
|
+
|
|
739
|
+
declare const CheckboxItem: React__default.ForwardRefExoticComponent<Omit<CheckboxProps, "onValueChanged"> & {
|
|
740
|
+
onChange?: (value: boolean) => void;
|
|
741
|
+
showRightButton?: boolean;
|
|
742
|
+
onRightButtonClick?: () => void;
|
|
743
|
+
rightButtonIcon?: React__default.ReactNode;
|
|
744
|
+
} & React__default.RefAttributes<HTMLInputElement>>;
|
|
745
|
+
|
|
746
|
+
type CheckboxItemProps = Omit<CheckboxProps, 'onValueChanged'> & {
|
|
747
|
+
/**
|
|
748
|
+
* Callback function when the checkbox state changes.
|
|
749
|
+
* @param value: boolean - The new checked state of the checkbox.
|
|
750
|
+
*/
|
|
751
|
+
onChange?: (value: boolean) => void;
|
|
752
|
+
/**
|
|
753
|
+
* Flag to show right button.
|
|
754
|
+
* @default false
|
|
755
|
+
*/
|
|
756
|
+
showRightButton?: boolean;
|
|
757
|
+
/**
|
|
758
|
+
* Callback function when the right button is clicked.
|
|
759
|
+
*/
|
|
760
|
+
onRightButtonClick?: () => void;
|
|
761
|
+
/**
|
|
762
|
+
* Custom icon for the right button.
|
|
763
|
+
*/
|
|
764
|
+
rightButtonIcon?: ReactNode;
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
type SliderProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
768
|
+
/**
|
|
769
|
+
* The minimum value of the slider.
|
|
770
|
+
* @default 0
|
|
771
|
+
*/
|
|
772
|
+
min?: number;
|
|
773
|
+
/**
|
|
774
|
+
* The maximum value of the slider.
|
|
775
|
+
* @default 100
|
|
776
|
+
*/
|
|
777
|
+
max?: number;
|
|
778
|
+
/**
|
|
779
|
+
* The step size for the slider.
|
|
780
|
+
* @default 1
|
|
781
|
+
*/
|
|
782
|
+
step?: number;
|
|
783
|
+
/**
|
|
784
|
+
* The current value of the slider.
|
|
785
|
+
* Can be a single number or an array with exactly two numbers for range selection.
|
|
786
|
+
*/
|
|
787
|
+
value?: number | [number, number];
|
|
788
|
+
/**
|
|
789
|
+
* Callback function triggered when the slider value changes.
|
|
790
|
+
* @param value - The new value of the slider.
|
|
791
|
+
*/
|
|
792
|
+
onValueChange?: (value: number | [number, number]) => void;
|
|
793
|
+
/**
|
|
794
|
+
* Whether to display the minimum value label.
|
|
795
|
+
* @default false
|
|
796
|
+
*/
|
|
797
|
+
showMin?: boolean;
|
|
798
|
+
/**
|
|
799
|
+
* Whether to display the maximum value label.
|
|
800
|
+
* @default false
|
|
801
|
+
*/
|
|
802
|
+
showMax?: boolean;
|
|
803
|
+
/**
|
|
804
|
+
* Whether to show the current value on the slider thumb.
|
|
805
|
+
* @default false
|
|
806
|
+
*/
|
|
807
|
+
showValueOnThumb?: boolean;
|
|
808
|
+
/**
|
|
809
|
+
* Whether to enable range selection (two thumbs).
|
|
810
|
+
* @default false
|
|
811
|
+
*/
|
|
812
|
+
enableRange?: boolean;
|
|
813
|
+
/**
|
|
814
|
+
* Flag to disabled slider.
|
|
815
|
+
* @default false
|
|
816
|
+
*/
|
|
817
|
+
disabled?: boolean;
|
|
818
|
+
className?: string;
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
declare const Slider: (props: SliderProps) => React__default.JSX.Element;
|
|
822
|
+
|
|
823
|
+
type AccordionSizeEnum = 'Small' | 'Medium' | 'Large';
|
|
824
|
+
type AccordionSummaryProps = {
|
|
825
|
+
children: ReactNode;
|
|
826
|
+
className?: string;
|
|
827
|
+
/**
|
|
828
|
+
* Custom expand/collapse icon element to override the default icon.
|
|
829
|
+
* It will rotate 90 degrees clockwise when the accordion is expanded.
|
|
830
|
+
*/
|
|
831
|
+
expandIcon?: ReactNode;
|
|
832
|
+
};
|
|
833
|
+
type AccordionDetailsProps = {
|
|
834
|
+
/**
|
|
835
|
+
* The content to be displayed in the accordion details section.
|
|
836
|
+
*/
|
|
837
|
+
children: ReactNode;
|
|
838
|
+
/**
|
|
839
|
+
* Optional CSS class name for custom styling.
|
|
840
|
+
*/
|
|
841
|
+
className?: string;
|
|
842
|
+
};
|
|
843
|
+
type AccordionProps = {
|
|
844
|
+
children: ReactNode;
|
|
845
|
+
className?: string;
|
|
846
|
+
/**
|
|
847
|
+
* The size of the accordion.
|
|
848
|
+
* @default 'Medium'
|
|
849
|
+
*/
|
|
850
|
+
size?: AccordionSizeEnum;
|
|
851
|
+
/**
|
|
852
|
+
* Whether the accordion is expanded by default.
|
|
853
|
+
* @default false
|
|
854
|
+
*/
|
|
855
|
+
defaultExpanded?: boolean;
|
|
856
|
+
/**
|
|
857
|
+
* Controls the expanded state when using controlled mode.
|
|
858
|
+
* Use this prop along with onChange for controlled behavior.
|
|
859
|
+
*/
|
|
860
|
+
expanded?: boolean;
|
|
861
|
+
/**
|
|
862
|
+
* Callback function when the accordion is expanded/collapsed.
|
|
863
|
+
* @param isOpen - The new expanded state of the accordion.
|
|
864
|
+
*/
|
|
865
|
+
onChange?: (isOpen: boolean) => void;
|
|
866
|
+
/**
|
|
867
|
+
* Unique identifier for the accordion.
|
|
868
|
+
* This is used to identify the accordion in the group.
|
|
869
|
+
*/
|
|
870
|
+
name?: string;
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
declare const AccordionSummary: (props: AccordionSummaryProps) => React__default.JSX.Element;
|
|
874
|
+
declare const AccordionDetails: (props: AccordionDetailsProps) => React__default.JSX.Element;
|
|
875
|
+
declare const Accordion: (props: AccordionProps) => React__default.JSX.Element;
|
|
876
|
+
|
|
877
|
+
type AccordionGroupProps = {
|
|
878
|
+
children: ReactNode;
|
|
879
|
+
className?: string;
|
|
880
|
+
/**
|
|
881
|
+
* Unique identifier for the accordion group.
|
|
882
|
+
* This will be passed to the accordions as a prop.
|
|
883
|
+
*/
|
|
884
|
+
name?: string;
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
declare const AccordionGroup: (props: AccordionGroupProps) => React__default.JSX.Element;
|
|
888
|
+
|
|
889
|
+
type ActionCardProps = HTMLAttributes<HTMLDivElement> & Omit<LinkProps, 'to'> & {
|
|
890
|
+
/**
|
|
891
|
+
* The content to be displayed within the action card.
|
|
892
|
+
*/
|
|
893
|
+
children: ReactNode;
|
|
894
|
+
/**
|
|
895
|
+
* Specifies if the action card is disabled.
|
|
896
|
+
* @default false
|
|
897
|
+
*/
|
|
898
|
+
disabled?: boolean;
|
|
899
|
+
/**
|
|
900
|
+
* Additional class for styling.
|
|
901
|
+
*/
|
|
902
|
+
className?: string;
|
|
903
|
+
/**
|
|
904
|
+
* The destination URL or path for the navigation link.
|
|
905
|
+
* If the URL starts with "https", it will be treated as an external link and rendered as an <a> tag.
|
|
906
|
+
* Otherwise, it will be treated as an internal link and rendered as a <RouterNavLink> component.
|
|
907
|
+
*
|
|
908
|
+
* @example
|
|
909
|
+
* // Internal link
|
|
910
|
+
* <NavLink to="/home">Home</NavLink>
|
|
911
|
+
*
|
|
912
|
+
* // External link
|
|
913
|
+
* <NavLink to="https://www.example.com">External</NavLink>
|
|
914
|
+
*/
|
|
915
|
+
to?: string | -1;
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* ActionCard component definition.
|
|
920
|
+
*/
|
|
921
|
+
declare const ActionCard: (props: ActionCardProps) => React__default.JSX.Element;
|
|
922
|
+
|
|
923
|
+
interface BreadcrumbsProps {
|
|
924
|
+
/**
|
|
925
|
+
* The divider element to separate breadcrumb items.
|
|
926
|
+
* Can be a string, icon, or custom React node.
|
|
927
|
+
*/
|
|
928
|
+
divider?: ReactNode;
|
|
929
|
+
/**
|
|
930
|
+
* Additional classes for custom styling.
|
|
931
|
+
*/
|
|
932
|
+
className?: string;
|
|
933
|
+
/**
|
|
934
|
+
* The breadcrumb items to be displayed.
|
|
935
|
+
*/
|
|
936
|
+
children: ReactNode;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
declare const Breadcrumbs: (props: BreadcrumbsProps) => React__default.JSX.Element;
|
|
940
|
+
|
|
941
|
+
type NavLinkTypeEnum = 'Fill' | 'Underline';
|
|
942
|
+
type NavLinkProps = Omit<LinkProps, 'to'> & Pick<ButtonProps, 'appearance' | 'size' | 'style' | 'leadingIcon' | 'trailingIcon'> & {
|
|
943
|
+
/**
|
|
944
|
+
* The destination URL or path for the navigation link.
|
|
945
|
+
* If the URL starts with "https", it will be treated as an external link and rendered as an <a> tag.
|
|
946
|
+
* Otherwise, it will be treated as an internal link and rendered as a <RouterNavLink> component.
|
|
947
|
+
*
|
|
948
|
+
* @example
|
|
949
|
+
* // Internal link
|
|
950
|
+
* <NavLink to="/home">Home</NavLink>
|
|
951
|
+
*
|
|
952
|
+
* // External link
|
|
953
|
+
* <NavLink to="https://www.example.com">External</NavLink>
|
|
954
|
+
*/
|
|
955
|
+
to: string | -1;
|
|
956
|
+
/**
|
|
957
|
+
* The type of nav link to render.
|
|
958
|
+
* @default 'Fill'
|
|
959
|
+
*/
|
|
960
|
+
type?: NavLinkTypeEnum | ButtonTypeEnum;
|
|
961
|
+
/**
|
|
962
|
+
* provide a way to override the styling
|
|
963
|
+
*/
|
|
964
|
+
'component-variant'?: string;
|
|
965
|
+
};
|
|
966
|
+
|
|
967
|
+
declare const NavLink: (props: NavLinkProps) => React__default.JSX.Element;
|
|
968
|
+
|
|
969
|
+
interface BreadcrumbProps extends Omit<NavLinkProps, 'type'> {
|
|
970
|
+
/**
|
|
971
|
+
* Flag that defines the breadcrumb state.
|
|
972
|
+
* @default false
|
|
973
|
+
*/
|
|
974
|
+
selected?: boolean;
|
|
975
|
+
/**
|
|
976
|
+
* Defines the button type used for the breadcrumb link.
|
|
977
|
+
*/
|
|
978
|
+
navLinkType?: ButtonTypeEnum;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
declare const Breadcrumb: (props: BreadcrumbProps) => React__default.JSX.Element;
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* Enum for the alignment of the button-group.
|
|
985
|
+
*/
|
|
986
|
+
type ButtonGroupAlignEnum = 'Horizontal' | 'Vertical';
|
|
987
|
+
/**
|
|
988
|
+
* Enum for the type of the button-group.
|
|
989
|
+
*/
|
|
990
|
+
type ButtonGroupTypeEnum = 'Outlined' | 'Ghost';
|
|
991
|
+
type ButtonGroupProps = {
|
|
992
|
+
/**
|
|
993
|
+
* The alignment of the button-group.
|
|
994
|
+
* @default 'Horizontal'
|
|
995
|
+
*/
|
|
996
|
+
align?: ButtonGroupAlignEnum;
|
|
997
|
+
/**
|
|
998
|
+
* Type of the button-group.
|
|
999
|
+
* @default 'Filled'
|
|
1000
|
+
*/
|
|
1001
|
+
type?: ButtonGroupTypeEnum;
|
|
1002
|
+
/**
|
|
1003
|
+
* The content to be displayed within the ButtonGroup.
|
|
1004
|
+
*/
|
|
1005
|
+
children: ReactNode | ReactNode[];
|
|
1006
|
+
/**
|
|
1007
|
+
* Additional class for styling.
|
|
1008
|
+
*/
|
|
1009
|
+
className?: string;
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* ButtonGroup component definition.
|
|
1014
|
+
*/
|
|
1015
|
+
declare const ButtonGroup: (props: ButtonGroupProps) => React__default.JSX.Element;
|
|
1016
|
+
|
|
1017
|
+
type CardProps = {
|
|
1018
|
+
/**
|
|
1019
|
+
* The content to be displayed within the card.
|
|
1020
|
+
*/
|
|
1021
|
+
children: ReactNode;
|
|
1022
|
+
/**
|
|
1023
|
+
* Additional class for styling.
|
|
1024
|
+
*/
|
|
1025
|
+
className?: string;
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1028
|
+
/**
|
|
1029
|
+
* Card component definition.
|
|
1030
|
+
*/
|
|
1031
|
+
declare const Card: (props: CardProps) => React__default.JSX.Element;
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Enum for the alignment of the list.
|
|
1035
|
+
*
|
|
1036
|
+
* @typedef {'Horizontal' | 'Vertical'} ListAlignEnum
|
|
1037
|
+
*/
|
|
1038
|
+
type ListAlignEnum = 'Horizontal' | 'Vertical';
|
|
1039
|
+
/**
|
|
1040
|
+
* Represents a generic list item.
|
|
1041
|
+
*
|
|
1042
|
+
* @property {string | number} [id] - A unique identifier for the list item. This is optional and can be auto-generated if not provided.
|
|
1043
|
+
* @property {string} [itemClassName] - Additional class for styling the list item.
|
|
1044
|
+
* @property {React.CSSProperties} [itemStyle] - Additional styles for the list item.
|
|
1045
|
+
*/
|
|
1046
|
+
type ListItemType = object & {
|
|
1047
|
+
id?: string | number;
|
|
1048
|
+
itemClassName?: string;
|
|
1049
|
+
itemStyle?: React.CSSProperties;
|
|
1050
|
+
};
|
|
1051
|
+
/**
|
|
1052
|
+
* Props for the list wrapper component.
|
|
1053
|
+
*
|
|
1054
|
+
* @template T - The type of the list items.
|
|
1055
|
+
* @property {T[]} [data] - The data to be rendered in the list.
|
|
1056
|
+
* @property {React.FC<any>} component - The React functional component used to render each list item.
|
|
1057
|
+
* @property {(item: T, index: number) => string | number} [keyExtractor] - A function to extract unique keys for each item.
|
|
1058
|
+
* @property {'Horizontal' | 'Vertical'} [align='Vertical'] - The alignment of the list. Defaults to `'Vertical'`.
|
|
1059
|
+
* @property {boolean} [wrap] - Whether the list content should wrap.
|
|
1060
|
+
* @property {string} [className] - Additional class for styling the list.
|
|
1061
|
+
* @property {boolean} [sortable] - Whether the list items can be sorted using drag-and-drop.
|
|
1062
|
+
* @property {Dispatch<SetStateAction<T[]>>} [updateSortOrder] - Callback function to update the order of the list items after sorting.
|
|
1063
|
+
*/
|
|
1064
|
+
type ListProps<T extends ListItemType> = Omit<HTMLAttributes<HTMLUListElement>, 'children'> & {
|
|
1065
|
+
/**
|
|
1066
|
+
* The data to be rendered in the list.
|
|
1067
|
+
*/
|
|
1068
|
+
data?: T[];
|
|
1069
|
+
/**
|
|
1070
|
+
* The component used to render each item in the list.
|
|
1071
|
+
*/
|
|
1072
|
+
component: React.FC<any>;
|
|
1073
|
+
/**
|
|
1074
|
+
* Function to extract keys.
|
|
1075
|
+
*/
|
|
1076
|
+
keyExtractor?: (item: T, index: number) => string | number;
|
|
1077
|
+
/**
|
|
1078
|
+
* The alignment of the list.
|
|
1079
|
+
* @default 'Vertical'
|
|
1080
|
+
*/
|
|
1081
|
+
align?: ListAlignEnum;
|
|
1082
|
+
/**
|
|
1083
|
+
* Flag to control if the content should wrap.
|
|
1084
|
+
*/
|
|
1085
|
+
wrap?: boolean;
|
|
1086
|
+
/**
|
|
1087
|
+
* Additional class for styling.
|
|
1088
|
+
*/
|
|
1089
|
+
className?: string;
|
|
1090
|
+
/**
|
|
1091
|
+
* Flag to enable sorting of list items
|
|
1092
|
+
*/
|
|
1093
|
+
sortable?: boolean;
|
|
1094
|
+
/**
|
|
1095
|
+
* callback function to update the current order of data
|
|
1096
|
+
*
|
|
1097
|
+
* @param data
|
|
1098
|
+
* @returns
|
|
1099
|
+
*/
|
|
1100
|
+
updateSortOrder?: Dispatch<SetStateAction<T[]>>;
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* A wrapper component that manages the rendering of either a sortable or regular list based on the provided props.
|
|
1105
|
+
*
|
|
1106
|
+
* @template T - The type of the list items.
|
|
1107
|
+
* @param {ListProps<T>} props - The properties for the list wrapper.
|
|
1108
|
+
* @returns {JSX.Element} The rendered list component.
|
|
1109
|
+
*/
|
|
1110
|
+
declare const List: <T extends ListItemType>(props: ListProps<T>) => React__default.JSX.Element;
|
|
1111
|
+
|
|
1112
|
+
type ContextMenuProps<T extends ListItemType> = ListProps<T>;
|
|
1113
|
+
|
|
1114
|
+
declare const ContextMenu: <T extends ListItemType>(props: ContextMenuProps<T>) => React__default.JSX.Element;
|
|
1115
|
+
|
|
1116
|
+
type DatePickerPosition = 'auto' | 'above' | 'below' | 'auto left' | 'auto center' | 'auto right' | 'above left' | 'above center' | 'above right' | 'below left' | 'below center' | 'below right';
|
|
1117
|
+
type DatePickerProps = {
|
|
1118
|
+
/**
|
|
1119
|
+
* Additional class for styling.
|
|
1120
|
+
*/
|
|
1121
|
+
className?: string;
|
|
1122
|
+
/**
|
|
1123
|
+
* The minimum selectable date.
|
|
1124
|
+
*/
|
|
1125
|
+
minDate?: string | Date;
|
|
1126
|
+
/**
|
|
1127
|
+
* The maximum selectable date.
|
|
1128
|
+
*/
|
|
1129
|
+
maxDate?: string | Date;
|
|
1130
|
+
/**
|
|
1131
|
+
* Enable time selection in the date picker.
|
|
1132
|
+
* @default false
|
|
1133
|
+
*/
|
|
1134
|
+
enableTime?: boolean;
|
|
1135
|
+
/**
|
|
1136
|
+
* Enable selecting a start and end date.
|
|
1137
|
+
* @default false
|
|
1138
|
+
*/
|
|
1139
|
+
enableRange?: boolean;
|
|
1140
|
+
/**
|
|
1141
|
+
* The date that is initially displayed.
|
|
1142
|
+
*/
|
|
1143
|
+
defaultDate?: string | Date;
|
|
1144
|
+
/**
|
|
1145
|
+
* The format of the date to be displayed.
|
|
1146
|
+
* @remark
|
|
1147
|
+
* For info about what formats exist, refer to the flatpickr documentation
|
|
1148
|
+
*/
|
|
1149
|
+
dateFormat?: string;
|
|
1150
|
+
/**
|
|
1151
|
+
* Callback function when the date(s) are changed.
|
|
1152
|
+
* @param dates - Array of selected dates.
|
|
1153
|
+
* @param dateStr - String representation of the selected date(s). Will match the date format.
|
|
1154
|
+
*/
|
|
1155
|
+
onChange?: (dates: Date[], dateStr: string) => void;
|
|
1156
|
+
/**
|
|
1157
|
+
* Callback function when the date picker is opened.
|
|
1158
|
+
* @param dates - Array of selected dates.
|
|
1159
|
+
* @param dateStr - String representation of the selected date(s). Will match the date format.
|
|
1160
|
+
*/
|
|
1161
|
+
onOpen?: (dates: Date[], dateStr: string) => void;
|
|
1162
|
+
/**
|
|
1163
|
+
* Callback function when the date picker is closed.
|
|
1164
|
+
* @param dates - Array of selected dates.
|
|
1165
|
+
* @param dateStr - String representation of the selected date(s). Will match the date format.
|
|
1166
|
+
*/
|
|
1167
|
+
onClose?: (dates: Date[], dateStr: string) => void;
|
|
1168
|
+
/**
|
|
1169
|
+
* render date picker inline
|
|
1170
|
+
*/
|
|
1171
|
+
inline?: boolean;
|
|
1172
|
+
/**
|
|
1173
|
+
* Hide calendar for only time picker.
|
|
1174
|
+
* @default false
|
|
1175
|
+
*/
|
|
1176
|
+
noCalendar?: boolean;
|
|
1177
|
+
/**
|
|
1178
|
+
* The Flatpickr ref.
|
|
1179
|
+
*/
|
|
1180
|
+
datePickerRef?: React.RefObject<FlatPickr>;
|
|
1181
|
+
/**
|
|
1182
|
+
* Datepicker position
|
|
1183
|
+
*/
|
|
1184
|
+
position?: DatePickerPosition;
|
|
1185
|
+
/**
|
|
1186
|
+
* Function to parse date strings into Date objects.
|
|
1187
|
+
* Used for parsing both the initial date string and any date strings entered in the input field.
|
|
1188
|
+
* @param date - The date value to parse, can be a string
|
|
1189
|
+
* @param format - Optional format string to use when parsing date strings
|
|
1190
|
+
* @returns A Date object representing the parsed date
|
|
1191
|
+
*/
|
|
1192
|
+
parseDate?: (date: string, format?: string) => Date;
|
|
1193
|
+
/**
|
|
1194
|
+
* Allow user to type date/time in input.
|
|
1195
|
+
* @default false
|
|
1196
|
+
*/
|
|
1197
|
+
allowInput?: boolean;
|
|
1198
|
+
/**
|
|
1199
|
+
* Custom time picker plugin
|
|
1200
|
+
*/
|
|
1201
|
+
customTimePickerPlugin?: (config: CustomTimePickerConfig) => Plugin;
|
|
1202
|
+
/**
|
|
1203
|
+
* Custom time picker plugin
|
|
1204
|
+
*/
|
|
1205
|
+
customDateTimePickerPlugin?: (config: CustomTimePickerConfig) => Plugin;
|
|
1206
|
+
/**
|
|
1207
|
+
* Use custom time input same as date picker input
|
|
1208
|
+
* This is useful when the datepicker is inline and is re-added to the DOM after closing
|
|
1209
|
+
* For example using this inside a Popover as content
|
|
1210
|
+
*/
|
|
1211
|
+
useCustomTimeInputForTimePicker?: boolean;
|
|
1212
|
+
};
|
|
1213
|
+
type CustomTimePickerConfig = {
|
|
1214
|
+
minuteStep: number;
|
|
1215
|
+
};
|
|
1216
|
+
|
|
1217
|
+
declare const DatePicker: (props: DatePickerProps) => React__default.JSX.Element;
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* Type representing the allowed values for form fields
|
|
1221
|
+
*/
|
|
1222
|
+
type FieldValue = string | number | Date | boolean | File | Array<string | number | Date | File>;
|
|
1223
|
+
/**
|
|
1224
|
+
* Type representing the form values as a partial record of field names to field values
|
|
1225
|
+
* @example
|
|
1226
|
+
* ```typescript
|
|
1227
|
+
* const formState: FormState = {
|
|
1228
|
+
* name: 'John Doe',
|
|
1229
|
+
* age: 30,
|
|
1230
|
+
* dob: new Date('1990-01-01')
|
|
1231
|
+
* };
|
|
1232
|
+
* ```
|
|
1233
|
+
*/
|
|
1234
|
+
type FormState<T extends FieldValue = FieldValue> = Partial<Record<string, T>>;
|
|
1235
|
+
/**
|
|
1236
|
+
* Type representing the form errors as a partial record of field names to error messages
|
|
1237
|
+
*/
|
|
1238
|
+
type FormErrors<T extends FormState = FormState> = Partial<Record<keyof T, string>>;
|
|
1239
|
+
/**
|
|
1240
|
+
* Type representing a validation function for a form field
|
|
1241
|
+
* It takes an error setter function and the field value (optional) and returns a boolean indicating if the value is valid
|
|
1242
|
+
* @example
|
|
1243
|
+
* ```typescript
|
|
1244
|
+
* const nameValidator: FieldValidationFunction = (setError, value) => {
|
|
1245
|
+
* if (!value) {
|
|
1246
|
+
* setError('Name is required');
|
|
1247
|
+
* return false;
|
|
1248
|
+
* }
|
|
1249
|
+
* return true;
|
|
1250
|
+
* };
|
|
1251
|
+
* ```
|
|
1252
|
+
*/
|
|
1253
|
+
type FieldValidationFunction<T extends FieldValue = FieldValue> = (setError: (message: string) => void, value?: T) => boolean;
|
|
1254
|
+
/**
|
|
1255
|
+
* Type representing the required fields in a form
|
|
1256
|
+
* It's a partial record of field names to a boolean indicating if the field is required
|
|
1257
|
+
*/
|
|
1258
|
+
type RequiredFields<T extends FormState = FormState> = Partial<Record<keyof T, boolean>>;
|
|
1259
|
+
/**
|
|
1260
|
+
* Type representing the validation functions for each field in a form
|
|
1261
|
+
* It's a partial record of field names to validation functions (or undefined)
|
|
1262
|
+
* @example
|
|
1263
|
+
* ```typescript
|
|
1264
|
+
* const nameValidator: FieldValidationFunction = (setError, value) => {
|
|
1265
|
+
* if (!value) {
|
|
1266
|
+
* setError('Name is required');
|
|
1267
|
+
* return false;
|
|
1268
|
+
* }
|
|
1269
|
+
* return true;
|
|
1270
|
+
* };
|
|
1271
|
+
* const fieldValidators: FieldValidators = {
|
|
1272
|
+
* name: nameValidator,
|
|
1273
|
+
* age: undefined,
|
|
1274
|
+
* };
|
|
1275
|
+
* ```
|
|
1276
|
+
*/
|
|
1277
|
+
type FieldValidators<T extends FormState = FormState> = Partial<Record<keyof T, FieldValidationFunction | undefined>>;
|
|
1278
|
+
/**
|
|
1279
|
+
* Type representing a function that handles form state changes
|
|
1280
|
+
* It takes the new form state and an error setter function and doesn't return anything
|
|
1281
|
+
* @example
|
|
1282
|
+
* ```typescript
|
|
1283
|
+
* const handleFormStateChange: FormStateChangeHandler = (state, setError) => {
|
|
1284
|
+
* // Validate form state and set errors
|
|
1285
|
+
* if (!state.name) {
|
|
1286
|
+
* setError('name', 'Name is required');
|
|
1287
|
+
* }
|
|
1288
|
+
* };
|
|
1289
|
+
* ```
|
|
1290
|
+
*/
|
|
1291
|
+
type FormStateChangeHandler<T extends FormState = FormState> = (state: T, setError: (field: keyof T, errorMessage: string) => void) => void;
|
|
1292
|
+
/**
|
|
1293
|
+
* Type representing a function that validates the entire form
|
|
1294
|
+
* It takes the form values and an error setter function and returns a boolean indicating if the form is valid
|
|
1295
|
+
* @example
|
|
1296
|
+
* ```typescript
|
|
1297
|
+
* const validateForm: FormValidator = (state, setError) => {
|
|
1298
|
+
* let isValid = true;
|
|
1299
|
+
* if (!state.name) {
|
|
1300
|
+
* setError('name', 'Name is required');
|
|
1301
|
+
* isValid = false;
|
|
1302
|
+
* }
|
|
1303
|
+
* if (!state.age || typeof state.age !== 'number') {
|
|
1304
|
+
* setError('age', 'Age must be a number');
|
|
1305
|
+
* isValid = false;
|
|
1306
|
+
* }
|
|
1307
|
+
* return isValid;
|
|
1308
|
+
* };
|
|
1309
|
+
* ```
|
|
1310
|
+
*/
|
|
1311
|
+
type FormValidator<T extends FormState = FormState> = (state: T, setError: (field: keyof T, errorMessage: string) => void) => boolean;
|
|
1312
|
+
/**
|
|
1313
|
+
* Type representing a function that handles form submission.
|
|
1314
|
+
* It takes updated form state and a function to set error messages for specific fields.
|
|
1315
|
+
*
|
|
1316
|
+
* @template T - The type of the form state, defaulting to `FormState`.
|
|
1317
|
+
*
|
|
1318
|
+
* @param {T} values - The updated form state values.
|
|
1319
|
+
* @param {(field: keyof T, errorMessage: string) => void} setError - A function to set error messages for specific fields.
|
|
1320
|
+
*
|
|
1321
|
+
* @example
|
|
1322
|
+
* ```typescript
|
|
1323
|
+
* const handleFormSubmit: FormSubmitHandler = (values, setError) => {
|
|
1324
|
+
* // Submit form data
|
|
1325
|
+
* console.log(values);
|
|
1326
|
+
* };
|
|
1327
|
+
* ```
|
|
1328
|
+
*/
|
|
1329
|
+
type FormSubmitHandler<T extends FormState = FormState> = (values: T, setError: (field: keyof T, errorMessage: string) => void) => void;
|
|
1330
|
+
type FormProps = Omit<FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> & {
|
|
1331
|
+
formRef?: Ref<HTMLFormElement>;
|
|
1332
|
+
};
|
|
1333
|
+
type FormContextValues<T extends FormState = FormState> = {
|
|
1334
|
+
formRef?: Ref<HTMLFormElement>;
|
|
1335
|
+
formState?: T;
|
|
1336
|
+
updateFieldValue: (name: string, value: FieldValue) => void;
|
|
1337
|
+
formErrors: FormErrors<T>;
|
|
1338
|
+
updateFieldError: (name: keyof T, errorMessage: string) => void;
|
|
1339
|
+
onFormSubmit: React__default.FormEventHandler<HTMLFormElement>;
|
|
1340
|
+
updateFieldValidators: (name: keyof T, validate?: FieldValidationFunction) => void;
|
|
1341
|
+
updateRequiredFields: (name: keyof T, required?: boolean) => void;
|
|
1342
|
+
};
|
|
1343
|
+
type FormProviderProps<T extends FormState = FormState> = {
|
|
1344
|
+
formRef?: Ref<HTMLFormElement>;
|
|
1345
|
+
children?: React__default.ReactNode;
|
|
1346
|
+
formState?: T;
|
|
1347
|
+
onFormStateChange?: FormStateChangeHandler<T>;
|
|
1348
|
+
formValidator?: FormValidator<T>;
|
|
1349
|
+
onSubmit?: FormSubmitHandler<T>;
|
|
1350
|
+
validateOnChange?: boolean;
|
|
1351
|
+
};
|
|
1352
|
+
|
|
1353
|
+
/**
|
|
1354
|
+
* Props for the FormField component.
|
|
1355
|
+
*/
|
|
1356
|
+
type FormFieldProps = HTMLAttributes<HTMLDivElement> & {
|
|
1357
|
+
/**
|
|
1358
|
+
* The label for the form field
|
|
1359
|
+
*/
|
|
1360
|
+
label?: string;
|
|
1361
|
+
/**
|
|
1362
|
+
* Optional message for the form field
|
|
1363
|
+
*/
|
|
1364
|
+
message?: string;
|
|
1365
|
+
/**
|
|
1366
|
+
* Info icon for message
|
|
1367
|
+
*/
|
|
1368
|
+
infoIcon?: React.ReactNode;
|
|
1369
|
+
/**
|
|
1370
|
+
* Optional field for possible error message
|
|
1371
|
+
*/
|
|
1372
|
+
hasMessage?: boolean;
|
|
1373
|
+
};
|
|
1374
|
+
/**
|
|
1375
|
+
* Props for the FormFieldProvider component.
|
|
1376
|
+
*/
|
|
1377
|
+
type FormFieldProviderProps = {
|
|
1378
|
+
/**
|
|
1379
|
+
* Child components
|
|
1380
|
+
*/
|
|
1381
|
+
children: React.ReactNode;
|
|
1382
|
+
/**
|
|
1383
|
+
* Name of the form field
|
|
1384
|
+
*/
|
|
1385
|
+
name: string;
|
|
1386
|
+
/**
|
|
1387
|
+
* Indicates if the field is disabled
|
|
1388
|
+
* @default false
|
|
1389
|
+
*/
|
|
1390
|
+
disabled?: boolean;
|
|
1391
|
+
/**
|
|
1392
|
+
* Indicates if the field is invalid
|
|
1393
|
+
* @default false
|
|
1394
|
+
*/
|
|
1395
|
+
invalid?: boolean;
|
|
1396
|
+
/**
|
|
1397
|
+
* Indicates if the field is required
|
|
1398
|
+
* @default false
|
|
1399
|
+
*/
|
|
1400
|
+
required?: boolean;
|
|
1401
|
+
/**
|
|
1402
|
+
* Validation function for the field
|
|
1403
|
+
*/
|
|
1404
|
+
validate?: FieldValidationFunction;
|
|
1405
|
+
/**
|
|
1406
|
+
* id attribute to connect label and field of form field
|
|
1407
|
+
* note:- this is optional as FormFieldContext will generate an id
|
|
1408
|
+
*/
|
|
1409
|
+
id?: string;
|
|
1410
|
+
};
|
|
1411
|
+
/**
|
|
1412
|
+
* Props for the UseField hook.
|
|
1413
|
+
*/
|
|
1414
|
+
type UseFieldProps<T extends FieldValue = FieldValue> = {
|
|
1415
|
+
/**
|
|
1416
|
+
* The value of the field
|
|
1417
|
+
*/
|
|
1418
|
+
value?: T;
|
|
1419
|
+
/**
|
|
1420
|
+
* Indicates if the field is invalid
|
|
1421
|
+
* @default false
|
|
1422
|
+
*/
|
|
1423
|
+
invalid?: boolean;
|
|
1424
|
+
/**
|
|
1425
|
+
* Callback when the field value changes
|
|
1426
|
+
*/
|
|
1427
|
+
onValueChanged?: (value: T) => void;
|
|
1428
|
+
/**
|
|
1429
|
+
* Indicates if the field is disabled
|
|
1430
|
+
* @default false
|
|
1431
|
+
*/
|
|
1432
|
+
disabled?: boolean;
|
|
1433
|
+
/**
|
|
1434
|
+
* Indicates if the field is required
|
|
1435
|
+
* @default false
|
|
1436
|
+
*/
|
|
1437
|
+
required?: boolean;
|
|
1438
|
+
/**
|
|
1439
|
+
* Default value for the field
|
|
1440
|
+
*/
|
|
1441
|
+
defaultValue?: T;
|
|
1442
|
+
/**
|
|
1443
|
+
* the field is independent of the parent form field contexts
|
|
1444
|
+
* @default false
|
|
1445
|
+
*/
|
|
1446
|
+
independent?: boolean;
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1449
|
+
declare const useField: <T extends FieldValue = FieldValue>(props: UseFieldProps<T>) => {
|
|
1450
|
+
fieldValue: T;
|
|
1451
|
+
updateFieldValue: (newValue: T) => void;
|
|
1452
|
+
disabledField: boolean | undefined;
|
|
1453
|
+
requiredField: boolean | undefined;
|
|
1454
|
+
invalidField: boolean | undefined;
|
|
1455
|
+
formFieldId: string | undefined;
|
|
1456
|
+
name: string | undefined;
|
|
1457
|
+
};
|
|
1458
|
+
|
|
1459
|
+
type FormFieldPropsWithProvider = FormFieldProviderProps & FormFieldProps;
|
|
1460
|
+
declare const FormField: (props: FormFieldPropsWithProvider) => React__default.JSX.Element;
|
|
1461
|
+
|
|
1462
|
+
type GridProps = HTMLAttributes<HTMLDivElement> & {
|
|
1463
|
+
columns?: number;
|
|
1464
|
+
rows?: number;
|
|
1465
|
+
};
|
|
1466
|
+
type GridItemProps = HTMLAttributes<HTMLDivElement> & {
|
|
1467
|
+
columnSpan?: number;
|
|
1468
|
+
rowSpan?: number;
|
|
1469
|
+
};
|
|
1470
|
+
|
|
1471
|
+
declare const Grid: (props: GridProps) => React__default.JSX.Element;
|
|
1472
|
+
|
|
1473
|
+
declare const GridItem: (props: GridItemProps) => React$1.JSX.Element;
|
|
1474
|
+
|
|
1475
|
+
type GridListProps<T extends ListItemType> = Omit<ListProps<T>, 'style'> & {
|
|
1476
|
+
columns?: number;
|
|
1477
|
+
};
|
|
1478
|
+
|
|
1479
|
+
declare const GridList: <T extends ListItemType>(props: GridListProps<T>) => React__default.JSX.Element;
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* Enum defining the possible sizes for the Modal component.
|
|
1483
|
+
*/
|
|
1484
|
+
type ModalSizeEnum = 'Small' | 'Medium' | 'Large';
|
|
1485
|
+
/**
|
|
1486
|
+
* Props for the Modal component.
|
|
1487
|
+
*/
|
|
1488
|
+
type ModalProps = {
|
|
1489
|
+
/**
|
|
1490
|
+
* The content that will be rendered inside the modal.
|
|
1491
|
+
*/
|
|
1492
|
+
children: ReactNode;
|
|
1493
|
+
/**
|
|
1494
|
+
* Optional size of the modal. Defaults to 'Medium'.
|
|
1495
|
+
* @default "Medium"
|
|
1496
|
+
*/
|
|
1497
|
+
size?: ModalSizeEnum;
|
|
1498
|
+
/**
|
|
1499
|
+
* Callback function invoked when the modal is hidden.
|
|
1500
|
+
*/
|
|
1501
|
+
onHide?: () => void;
|
|
1502
|
+
/**
|
|
1503
|
+
* Controls whether the modal is visible (`true`) or hidden (`false`).
|
|
1504
|
+
* @default false
|
|
1505
|
+
*/
|
|
1506
|
+
show?: boolean;
|
|
1507
|
+
/**
|
|
1508
|
+
* The content to be rendered in the header of the modal.
|
|
1509
|
+
*/
|
|
1510
|
+
header?: ReactNode;
|
|
1511
|
+
/**
|
|
1512
|
+
* The content to be rendered in the footer of the modal.
|
|
1513
|
+
*/
|
|
1514
|
+
footer?: ReactNode;
|
|
1515
|
+
/**
|
|
1516
|
+
* Custom JSX element to render as the backdrop for the modal.
|
|
1517
|
+
*/
|
|
1518
|
+
renderBackdrop?: ReactNode;
|
|
1519
|
+
/**
|
|
1520
|
+
* Determines whether a backdrop should be displayed behind the modal.
|
|
1521
|
+
* @default true
|
|
1522
|
+
*/
|
|
1523
|
+
backdrop?: boolean;
|
|
1524
|
+
/**
|
|
1525
|
+
* Disables the ability to dismiss the modal by clicking on the backdrop.
|
|
1526
|
+
* @default false
|
|
1527
|
+
*/
|
|
1528
|
+
disableBackdropDismiss?: boolean;
|
|
1529
|
+
/**
|
|
1530
|
+
* Additional CSS class names to apply to the modal.
|
|
1531
|
+
*/
|
|
1532
|
+
className?: string;
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* Modal component for displaying a dialog window.
|
|
1537
|
+
*/
|
|
1538
|
+
declare const Modal: (props: ModalProps) => React__default.JSX.Element;
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* Defines the type of modal footer layout.
|
|
1542
|
+
* @default "1Button"
|
|
1543
|
+
*/
|
|
1544
|
+
type ModalFooterTypeEnum = "1Button" | "2Buttons";
|
|
1545
|
+
/**
|
|
1546
|
+
* Props for the ModalFooter component.
|
|
1547
|
+
*/
|
|
1548
|
+
type ModalFooterProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
1549
|
+
/**
|
|
1550
|
+
* Determines whether the footer contains one or two buttons.
|
|
1551
|
+
* @default "1Button"
|
|
1552
|
+
*/
|
|
1553
|
+
type?: ModalFooterTypeEnum;
|
|
1554
|
+
/**
|
|
1555
|
+
* The primary button element.
|
|
1556
|
+
*/
|
|
1557
|
+
primaryButton?: ReactNode;
|
|
1558
|
+
/**
|
|
1559
|
+
* The secondary button element (only applicable when type is "2 buttons").
|
|
1560
|
+
*/
|
|
1561
|
+
secondaryButton?: ReactNode;
|
|
1562
|
+
/**
|
|
1563
|
+
* Additional class for styling.
|
|
1564
|
+
*/
|
|
1565
|
+
className?: string;
|
|
1566
|
+
};
|
|
1567
|
+
|
|
1568
|
+
/**
|
|
1569
|
+
* Modal Footer component for displaying footer actions in a modal.
|
|
1570
|
+
*/
|
|
1571
|
+
declare const ModalFooter: React__default.FC<ModalFooterProps>;
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* Props for the ModalHeader component.
|
|
1575
|
+
*/
|
|
1576
|
+
type ModalHeaderProps = {
|
|
1577
|
+
/**
|
|
1578
|
+
* The title to be displayed in the header.
|
|
1579
|
+
*/
|
|
1580
|
+
title?: string;
|
|
1581
|
+
/**
|
|
1582
|
+
* An optional icon button to display in the header.
|
|
1583
|
+
*/
|
|
1584
|
+
iconButton?: ReactNode;
|
|
1585
|
+
/**
|
|
1586
|
+
* Additional CSS class names to apply to the modal header.
|
|
1587
|
+
*/
|
|
1588
|
+
className?: string;
|
|
1589
|
+
};
|
|
1590
|
+
|
|
1591
|
+
/**
|
|
1592
|
+
* Modal Header component definition.
|
|
1593
|
+
*/
|
|
1594
|
+
declare const ModalHeader: (props: ModalHeaderProps) => React__default.JSX.Element;
|
|
1595
|
+
|
|
1596
|
+
type NavProps = HTMLAttributes<HTMLElement> & {};
|
|
1597
|
+
|
|
1598
|
+
declare const Nav: (props: NavProps) => React__default.JSX.Element;
|
|
1599
|
+
|
|
1600
|
+
type NavItemProps = LiHTMLAttributes<HTMLElement> & {};
|
|
1601
|
+
|
|
1602
|
+
declare const NavItem: (props: NavItemProps) => React__default.JSX.Element;
|
|
1603
|
+
|
|
1604
|
+
type PaginationProps = {
|
|
1605
|
+
className?: string;
|
|
1606
|
+
currentPage?: number;
|
|
1607
|
+
totalPages?: number;
|
|
1608
|
+
updateCurrentPage?: (page: number) => void;
|
|
1609
|
+
previousPageIcon?: React.ReactNode;
|
|
1610
|
+
nextPageIcon?: React.ReactNode;
|
|
1611
|
+
};
|
|
1612
|
+
|
|
1613
|
+
declare const Pagination: (props: PaginationProps) => React$1.JSX.Element;
|
|
1614
|
+
|
|
1615
|
+
type PaginationNumberFieldProps = {
|
|
1616
|
+
className?: string;
|
|
1617
|
+
page?: number;
|
|
1618
|
+
totalPages?: number;
|
|
1619
|
+
onPageChanged?: (page: number) => void;
|
|
1620
|
+
};
|
|
1621
|
+
|
|
1622
|
+
declare const PaginationNumberField: (props: PaginationNumberFieldProps) => React$1.JSX.Element;
|
|
1623
|
+
|
|
1624
|
+
/**
|
|
1625
|
+
* Enum for the action type of the Popover.
|
|
1626
|
+
*/
|
|
1627
|
+
type ActionType = 'Click' | 'Hover' | 'DoubleClick';
|
|
1628
|
+
/**
|
|
1629
|
+
* Enum for the overlay direction of the Popover.
|
|
1630
|
+
*/
|
|
1631
|
+
type OverlayDirectionEnum = 'Up' | 'Down' | 'Right' | 'Left';
|
|
1632
|
+
/**
|
|
1633
|
+
* Enum for the overlay alignment of the Popover.
|
|
1634
|
+
*/
|
|
1635
|
+
type OverlayAlignEnum = 'Start' | 'End' | 'Center';
|
|
1636
|
+
/**
|
|
1637
|
+
* Props for the content of the Popover.
|
|
1638
|
+
*/
|
|
1639
|
+
type ContentProps = {
|
|
1640
|
+
width?: CSSProperties['width'] | 'match-trigger';
|
|
1641
|
+
minWidth?: CSSProperties['minWidth'] | 'match-trigger';
|
|
1642
|
+
};
|
|
1643
|
+
/**
|
|
1644
|
+
* Props for the Popover component.
|
|
1645
|
+
*/
|
|
1646
|
+
type PopoverProps = {
|
|
1647
|
+
/**
|
|
1648
|
+
* Ref or Element for the Popover component to render in.
|
|
1649
|
+
*/
|
|
1650
|
+
container?: HTMLElement | React__default.RefObject<HTMLElement> | null;
|
|
1651
|
+
/**
|
|
1652
|
+
* The content to display in the Popover.
|
|
1653
|
+
*/
|
|
1654
|
+
content: ReactNode;
|
|
1655
|
+
/**
|
|
1656
|
+
* The target element for the Popover.
|
|
1657
|
+
*/
|
|
1658
|
+
target: ReactNode;
|
|
1659
|
+
/**
|
|
1660
|
+
* Offset for positioning the Popover.
|
|
1661
|
+
*/
|
|
1662
|
+
offset?: Offset;
|
|
1663
|
+
/**
|
|
1664
|
+
* Function to handle hiding the Popover.
|
|
1665
|
+
*/
|
|
1666
|
+
onHide?: () => void;
|
|
1667
|
+
/**
|
|
1668
|
+
* Function to handle hiding the Popover.
|
|
1669
|
+
*/
|
|
1670
|
+
onOpen?: () => void;
|
|
1671
|
+
/**
|
|
1672
|
+
* Direction in which the Popover should open.
|
|
1673
|
+
* @default 'Down'
|
|
1674
|
+
*/
|
|
1675
|
+
direction?: OverlayDirectionEnum;
|
|
1676
|
+
/**
|
|
1677
|
+
* Indicates if Popover should hide on click away.
|
|
1678
|
+
* @default true
|
|
1679
|
+
*/
|
|
1680
|
+
hideOnClickAway?: boolean;
|
|
1681
|
+
/**
|
|
1682
|
+
* Indicates if content should stay on item click.
|
|
1683
|
+
* @default false
|
|
1684
|
+
*/
|
|
1685
|
+
keepContentOnItemClick?: boolean;
|
|
1686
|
+
/**
|
|
1687
|
+
* Indicates if the Popover is shown.
|
|
1688
|
+
* @default false
|
|
1689
|
+
*/
|
|
1690
|
+
show?: boolean;
|
|
1691
|
+
/**
|
|
1692
|
+
* Action type to trigger the Popover.
|
|
1693
|
+
* @default 'Click'
|
|
1694
|
+
*/
|
|
1695
|
+
action?: ActionType;
|
|
1696
|
+
/**
|
|
1697
|
+
* Alignment of the Popover.
|
|
1698
|
+
* @default 'Center'
|
|
1699
|
+
*/
|
|
1700
|
+
alignment?: OverlayAlignEnum;
|
|
1701
|
+
/**
|
|
1702
|
+
* Props for the content of the Popover.
|
|
1703
|
+
*/
|
|
1704
|
+
contentProps?: ContentProps;
|
|
1705
|
+
/**
|
|
1706
|
+
* Indicates if the Popover is disabled.
|
|
1707
|
+
* @default false
|
|
1708
|
+
*/
|
|
1709
|
+
disabled?: boolean;
|
|
1710
|
+
/**
|
|
1711
|
+
* Indicates if content should change placement to stay on the screen.
|
|
1712
|
+
* @default false
|
|
1713
|
+
*/
|
|
1714
|
+
flip?: boolean;
|
|
1715
|
+
/**
|
|
1716
|
+
* Additional class for styling.
|
|
1717
|
+
*/
|
|
1718
|
+
className?: string;
|
|
1719
|
+
/**
|
|
1720
|
+
* Additional class for overlay container styling.
|
|
1721
|
+
*/
|
|
1722
|
+
overlayClassName?: string;
|
|
1723
|
+
/**
|
|
1724
|
+
* Position of the Popover.
|
|
1725
|
+
* @default 'absolute'
|
|
1726
|
+
*/
|
|
1727
|
+
contentPosition?: 'absolute' | 'fixed';
|
|
1728
|
+
};
|
|
1729
|
+
type PopoverHandle = {
|
|
1730
|
+
close: () => void;
|
|
1731
|
+
open: () => void;
|
|
1732
|
+
};
|
|
1733
|
+
|
|
1734
|
+
/**
|
|
1735
|
+
* Popover component that displays a floating content element in relation to a target element.
|
|
1736
|
+
* It can be triggered via different user actions like 'Click' or 'Hover'.
|
|
1737
|
+
*/
|
|
1738
|
+
declare const Popover: React__default.ForwardRefExoticComponent<PopoverProps & React__default.RefAttributes<PopoverHandle>>;
|
|
1739
|
+
|
|
1740
|
+
type ProgressBarLabelType = "Percentage" | "Text";
|
|
1741
|
+
type ProgressBarProps = {
|
|
1742
|
+
/**
|
|
1743
|
+
* Current progress value
|
|
1744
|
+
* @default 0
|
|
1745
|
+
*/
|
|
1746
|
+
value: number;
|
|
1747
|
+
/**
|
|
1748
|
+
* Minimum value of the progress bar
|
|
1749
|
+
* @default 0
|
|
1750
|
+
*/
|
|
1751
|
+
min?: number;
|
|
1752
|
+
/**
|
|
1753
|
+
* Maximum value of the progress bar
|
|
1754
|
+
* @default 100
|
|
1755
|
+
*/
|
|
1756
|
+
max?: number;
|
|
1757
|
+
/**
|
|
1758
|
+
* Defines the orientation of the progress bar
|
|
1759
|
+
* @default "horizontal"
|
|
1760
|
+
*/
|
|
1761
|
+
/**
|
|
1762
|
+
* Determines if and how the label is displayed
|
|
1763
|
+
*/
|
|
1764
|
+
showLabel?: ProgressBarLabelType;
|
|
1765
|
+
/**
|
|
1766
|
+
* Custom label to be displayed when `showLabel` is set to "Text"
|
|
1767
|
+
*/
|
|
1768
|
+
label?: React.ReactNode;
|
|
1769
|
+
/**
|
|
1770
|
+
* Additional class for styling
|
|
1771
|
+
*/
|
|
1772
|
+
className?: string;
|
|
1773
|
+
};
|
|
1774
|
+
|
|
1775
|
+
declare const ProgressBar: React__default.FC<ProgressBarProps>;
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* Props for the Option component, extending LiHTMLAttributes<HTMLLIElement>.
|
|
1779
|
+
* Represents an option within a Select component.
|
|
1780
|
+
*/
|
|
1781
|
+
type OptionProps = LiHTMLAttributes<HTMLLIElement> & {
|
|
1782
|
+
/**
|
|
1783
|
+
* Value associated with the option.
|
|
1784
|
+
*/
|
|
1785
|
+
value: string | number;
|
|
1786
|
+
/**
|
|
1787
|
+
* Indicates if the option is disabled.
|
|
1788
|
+
* @default false
|
|
1789
|
+
*/
|
|
1790
|
+
disabled?: boolean;
|
|
1791
|
+
/**
|
|
1792
|
+
* Icon to be displayed before the option content.
|
|
1793
|
+
*/
|
|
1794
|
+
leadingIcon?: ReactNode;
|
|
1795
|
+
/**
|
|
1796
|
+
* Icon to be displayed after the option content.
|
|
1797
|
+
*/
|
|
1798
|
+
trailingIcon?: ReactNode;
|
|
1799
|
+
/**
|
|
1800
|
+
* Additional CSS class names for custom styling.
|
|
1801
|
+
*/
|
|
1802
|
+
className?: string;
|
|
1803
|
+
/**
|
|
1804
|
+
* Children elements or text content of the option.
|
|
1805
|
+
*/
|
|
1806
|
+
children?: ReactNode;
|
|
1807
|
+
};
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
* Functional component representing an option within a select dropdown.
|
|
1811
|
+
*
|
|
1812
|
+
* @param props - Props for configuring the Option component.
|
|
1813
|
+
* @returns Element representing the option.
|
|
1814
|
+
*/
|
|
1815
|
+
declare const Option: (props: OptionProps) => React__default.JSX.Element;
|
|
1816
|
+
|
|
1817
|
+
/**
|
|
1818
|
+
* Represents the context provided by the Select component.
|
|
1819
|
+
*/
|
|
1820
|
+
type SelectContextType = {
|
|
1821
|
+
/**
|
|
1822
|
+
* The currently selected value in the Select component.
|
|
1823
|
+
*/
|
|
1824
|
+
selectedValue: FieldValue;
|
|
1825
|
+
/**
|
|
1826
|
+
* Function to update the selected value.
|
|
1827
|
+
* @param value - The new value to select, either a string or number.
|
|
1828
|
+
*/
|
|
1829
|
+
updateSelectedValue: (value: string | number) => void;
|
|
1830
|
+
/**
|
|
1831
|
+
* Function to reset the selected value to its default state.
|
|
1832
|
+
*/
|
|
1833
|
+
resetSelectedValue: () => void;
|
|
1834
|
+
/**
|
|
1835
|
+
* Indicates whether the field is in an invalid state.
|
|
1836
|
+
*/
|
|
1837
|
+
invalidField?: boolean;
|
|
1838
|
+
/**
|
|
1839
|
+
* Indicates whether the field is disabled.
|
|
1840
|
+
*/
|
|
1841
|
+
disabledField?: boolean;
|
|
1842
|
+
/**
|
|
1843
|
+
* id to use as htmlFor for label, which will be fetched from FormFieldContext
|
|
1844
|
+
*/
|
|
1845
|
+
formFieldId: string;
|
|
1846
|
+
};
|
|
1847
|
+
/**
|
|
1848
|
+
* Props for the SelectProvider component, which manages state and provides context for Select.
|
|
1849
|
+
*/
|
|
1850
|
+
type SelectProviderProps = {
|
|
1851
|
+
/**
|
|
1852
|
+
* Child elements to be rendered within the SelectProvider.
|
|
1853
|
+
*/
|
|
1854
|
+
children: ReactNode;
|
|
1855
|
+
/**
|
|
1856
|
+
* Currently selected value (if controlled).
|
|
1857
|
+
*/
|
|
1858
|
+
value?: FieldValue;
|
|
1859
|
+
/**
|
|
1860
|
+
* Indicates if multiple options can be selected.
|
|
1861
|
+
* @default false
|
|
1862
|
+
*/
|
|
1863
|
+
multiple?: boolean;
|
|
1864
|
+
/**
|
|
1865
|
+
* Default selected value (if uncontrolled).
|
|
1866
|
+
*/
|
|
1867
|
+
defaultValue?: FieldValue;
|
|
1868
|
+
/**
|
|
1869
|
+
* Indicates whether the Select is disabled.
|
|
1870
|
+
* @default false
|
|
1871
|
+
*/
|
|
1872
|
+
disabled?: boolean;
|
|
1873
|
+
/**
|
|
1874
|
+
* Callback function invoked when the selected value changes.
|
|
1875
|
+
* @param event - Optional event containing the new field value.
|
|
1876
|
+
*/
|
|
1877
|
+
onValueChanged?: (event?: FieldValue) => void;
|
|
1878
|
+
/**
|
|
1879
|
+
* Indicates whether the selected field is hasDefaultOption or not.
|
|
1880
|
+
* @default false
|
|
1881
|
+
*/
|
|
1882
|
+
hasDefaultOption?: boolean;
|
|
1883
|
+
};
|
|
1884
|
+
/**
|
|
1885
|
+
* Enum representing different states of the Select component.
|
|
1886
|
+
*/
|
|
1887
|
+
type SelectStateEnum = 'Default' | 'Error';
|
|
1888
|
+
/**
|
|
1889
|
+
* Props for the SelectView component, defining its visual appearance and behavior.
|
|
1890
|
+
*/
|
|
1891
|
+
type SelectViewProps = Omit<HTMLAttributes<HTMLElement>, 'style' | 'children'> & {
|
|
1892
|
+
/**
|
|
1893
|
+
* Options to be rendered within the Select component.
|
|
1894
|
+
*/
|
|
1895
|
+
children: React.ReactElement<OptionProps> | React.ReactElement<OptionProps>[];
|
|
1896
|
+
/**
|
|
1897
|
+
* Placeholder text displayed when no option is selected.
|
|
1898
|
+
*/
|
|
1899
|
+
placeholder?: string;
|
|
1900
|
+
/**
|
|
1901
|
+
* Determines if the dropdown menu is initially open.
|
|
1902
|
+
* @default false
|
|
1903
|
+
*/
|
|
1904
|
+
defaultOpen?: boolean;
|
|
1905
|
+
/**
|
|
1906
|
+
* Icon displayed before the select input.
|
|
1907
|
+
*/
|
|
1908
|
+
leadingIcon?: ReactNode;
|
|
1909
|
+
/**
|
|
1910
|
+
* Icon displayed for the expand sign.
|
|
1911
|
+
*/
|
|
1912
|
+
expandIcon?: ReactNode;
|
|
1913
|
+
/**
|
|
1914
|
+
* Indicates whether the dropdown menu is currently open.
|
|
1915
|
+
* @default false
|
|
1916
|
+
*/
|
|
1917
|
+
open?: boolean;
|
|
1918
|
+
/**
|
|
1919
|
+
* Current state of the Select component.
|
|
1920
|
+
* @default 'Default'
|
|
1921
|
+
*/
|
|
1922
|
+
state?: SelectStateEnum;
|
|
1923
|
+
/**
|
|
1924
|
+
* Additional props for the dropdown menu.
|
|
1925
|
+
*/
|
|
1926
|
+
menuProps?: ContentProps;
|
|
1927
|
+
/**
|
|
1928
|
+
* Indicates whether the selected field is hasDefaultOption or not.
|
|
1929
|
+
* @default false
|
|
1930
|
+
*/
|
|
1931
|
+
hasDefaultOption?: boolean;
|
|
1932
|
+
/**
|
|
1933
|
+
* Indicates if multiple options can be selected.
|
|
1934
|
+
* @default false
|
|
1935
|
+
*/
|
|
1936
|
+
multiple?: boolean;
|
|
1937
|
+
/**
|
|
1938
|
+
* Additional CSS classes for customization.
|
|
1939
|
+
*/
|
|
1940
|
+
className?: string;
|
|
1941
|
+
/**
|
|
1942
|
+
* The component used to render each item in the list.
|
|
1943
|
+
*/
|
|
1944
|
+
selectedView?: React.FC<any>;
|
|
1945
|
+
};
|
|
1946
|
+
/**
|
|
1947
|
+
* Props for the Select component, combining provider and view props.
|
|
1948
|
+
*/
|
|
1949
|
+
type SelectProps = Omit<SelectProviderProps, 'children'> & SelectViewProps;
|
|
1950
|
+
|
|
1951
|
+
/**
|
|
1952
|
+
* Custom hook to use the SelectContext values.
|
|
1953
|
+
* Throws an error if used outside of a SelectProvider.
|
|
1954
|
+
*
|
|
1955
|
+
* @throws Error if used outside of SelectProvider.
|
|
1956
|
+
* @returns Context values of type SelectContextType.
|
|
1957
|
+
*/
|
|
1958
|
+
declare const useSelectContext: () => SelectContextType;
|
|
1959
|
+
/**
|
|
1960
|
+
* Provider component for managing state and providing context to Select components.
|
|
1961
|
+
* Manages the selected value state and provides methods to update or reset it.
|
|
1962
|
+
*
|
|
1963
|
+
* @param props - Props for configuring the SelectProvider.
|
|
1964
|
+
* @returns JSX element that provides context to its children.
|
|
1965
|
+
*/
|
|
1966
|
+
declare const SelectProvider: ({ children, value, defaultValue, multiple, disabled, onValueChanged, }: SelectProviderProps) => React__default.JSX.Element;
|
|
1967
|
+
|
|
1968
|
+
/**
|
|
1969
|
+
* Select component that wraps SelectComponent with SelectProvider.
|
|
1970
|
+
* Provides state management and context to SelectComponent.
|
|
1971
|
+
*
|
|
1972
|
+
* @param props - Props for configuring the Select component.
|
|
1973
|
+
* @returns JSX element that renders the SelectComponent wrapped with SelectProvider.
|
|
1974
|
+
*/
|
|
1975
|
+
declare const Select: (props: SelectProps) => JSX.Element;
|
|
1976
|
+
|
|
1977
|
+
/**
|
|
1978
|
+
* Dropzone component props
|
|
1979
|
+
* @param initial React.ReactNode - The initial state of the dropzone.
|
|
1980
|
+
* @param uploading React.ReactNode - The uploading state of the dropzone.
|
|
1981
|
+
* @param uploaded React.ReactNode - The uploaded state of the dropzone.
|
|
1982
|
+
* @param accept { [key: string]: readonly string[] } - The accepted file types.
|
|
1983
|
+
* @param maxSize number - The maximum size of the file in bytes.
|
|
1984
|
+
* @param maxFiles number - The maximum number of files to upload.
|
|
1985
|
+
* @param onFilesUpload (file: File) => void - callback when files are selected
|
|
1986
|
+
* @param onFilesReset () => void - callback when files are reset
|
|
1987
|
+
*/
|
|
1988
|
+
type DropzoneProps = {
|
|
1989
|
+
/**
|
|
1990
|
+
* The initial state of the dropzone.
|
|
1991
|
+
*/
|
|
1992
|
+
initial?: React.ReactNode;
|
|
1993
|
+
/**
|
|
1994
|
+
* The uploading state of the dropzone.
|
|
1995
|
+
*/
|
|
1996
|
+
uploading?: React.ReactNode;
|
|
1997
|
+
/**
|
|
1998
|
+
* The uploaded state of the dropzone.
|
|
1999
|
+
*/
|
|
2000
|
+
uploaded?: React.ReactNode;
|
|
2001
|
+
/**
|
|
2002
|
+
* The accepted file types based on mime type.
|
|
2003
|
+
* @example
|
|
2004
|
+
* accept={{
|
|
2005
|
+
* 'image/*': ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.ico', '.webp'],
|
|
2006
|
+
* }}
|
|
2007
|
+
*/
|
|
2008
|
+
accept?: {
|
|
2009
|
+
[key: string]: readonly string[];
|
|
2010
|
+
};
|
|
2011
|
+
/**
|
|
2012
|
+
* The maximum size of the file in bytes.
|
|
2013
|
+
*/
|
|
2014
|
+
maxSize?: number;
|
|
2015
|
+
/**
|
|
2016
|
+
* The maximum number of files to upload.
|
|
2017
|
+
* @default 1
|
|
2018
|
+
*/
|
|
2019
|
+
maxFiles?: number;
|
|
2020
|
+
disabled?: boolean;
|
|
2021
|
+
required?: boolean;
|
|
2022
|
+
/**
|
|
2023
|
+
* callback when files are selected
|
|
2024
|
+
*/
|
|
2025
|
+
onFilesSelected?: (files: File[]) => Promise<void> | void;
|
|
2026
|
+
/**
|
|
2027
|
+
* callback when files are reset
|
|
2028
|
+
*/
|
|
2029
|
+
onFilesReset?: () => void;
|
|
2030
|
+
};
|
|
2031
|
+
/**
|
|
2032
|
+
* Dropzone context type
|
|
2033
|
+
* @param status 'initial' | 'uploading' | 'uploaded' - The status of the dropzone.
|
|
2034
|
+
* @param file File | null - The file of the dropzone.
|
|
2035
|
+
* @param selectFile () => void - The function to call when the file is selected.
|
|
2036
|
+
* @param resetUpload () => void - The function to call when the file is reset.
|
|
2037
|
+
*/
|
|
2038
|
+
type DropzoneContextType = {
|
|
2039
|
+
/**
|
|
2040
|
+
* The status of the dropzone.
|
|
2041
|
+
*/
|
|
2042
|
+
status: 'initial' | 'uploading' | 'uploaded';
|
|
2043
|
+
/**
|
|
2044
|
+
* The files of the dropzone.
|
|
2045
|
+
*/
|
|
2046
|
+
files: File[];
|
|
2047
|
+
/**
|
|
2048
|
+
* The accepted file types based on mime type.
|
|
2049
|
+
* @example
|
|
2050
|
+
* accept={{
|
|
2051
|
+
* 'image/*': ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.ico', '.webp'],
|
|
2052
|
+
* }}
|
|
2053
|
+
*/
|
|
2054
|
+
accept: {
|
|
2055
|
+
[key: string]: readonly string[];
|
|
2056
|
+
};
|
|
2057
|
+
/**
|
|
2058
|
+
* The function to call to open the file dialog.
|
|
2059
|
+
*/
|
|
2060
|
+
selectFiles: () => void;
|
|
2061
|
+
/**
|
|
2062
|
+
* The function to call to reset the files.
|
|
2063
|
+
*/
|
|
2064
|
+
resetFiles: () => void;
|
|
2065
|
+
children?: ReactNode;
|
|
2066
|
+
};
|
|
2067
|
+
type DropzoneTriggerProps = ButtonProps;
|
|
2068
|
+
type DropzoneSupportedFormatsProps = TextProps;
|
|
2069
|
+
type DropzoneClearProps = IconButtonProps;
|
|
2070
|
+
type DropzoneFilenameProps = TextProps & {
|
|
2071
|
+
/**
|
|
2072
|
+
* The index of the file in the files array.
|
|
2073
|
+
* @default 0
|
|
2074
|
+
*/
|
|
2075
|
+
fileIndex?: number;
|
|
2076
|
+
};
|
|
2077
|
+
|
|
2078
|
+
declare const Dropzone: (props: DropzoneProps) => React__default.JSX.Element;
|
|
2079
|
+
declare const useDropzoneContext: () => DropzoneContextType;
|
|
2080
|
+
|
|
2081
|
+
declare const DropzoneClear: (props: DropzoneClearProps) => React__default.JSX.Element;
|
|
2082
|
+
|
|
2083
|
+
declare const DropzoneFilename: ({ children, fileIndex, ...props }: DropzoneFilenameProps) => React__default.JSX.Element;
|
|
2084
|
+
|
|
2085
|
+
declare const DropzoneSupportedFormats: (props: DropzoneSupportedFormatsProps) => React__default.JSX.Element;
|
|
2086
|
+
|
|
2087
|
+
declare const DropzoneTrigger: (props: DropzoneTriggerProps) => React__default.JSX.Element;
|
|
2088
|
+
|
|
2089
|
+
type DropzoneContentTypeEnum = 'Empty' | 'Uploaded' | 'Loading';
|
|
2090
|
+
type DropzoneContentProps = {
|
|
2091
|
+
className?: string;
|
|
2092
|
+
type: DropzoneContentTypeEnum;
|
|
2093
|
+
};
|
|
2094
|
+
|
|
2095
|
+
declare const DropzoneContent: (props: DropzoneContentProps) => React$1.JSX.Element;
|
|
2096
|
+
|
|
2097
|
+
declare const Form: <T extends FormState>(props: FormProviderProps<T> & FormProps) => React__default.JSX.Element;
|
|
2098
|
+
|
|
2099
|
+
type TableProps = TableHTMLAttributes<HTMLTableElement> & {
|
|
2100
|
+
/**
|
|
2101
|
+
* Whether the table header should stick to the top when scrolling
|
|
2102
|
+
*/
|
|
2103
|
+
stickyHeader?: boolean;
|
|
2104
|
+
};
|
|
2105
|
+
|
|
2106
|
+
declare const Table: (props: TableProps) => React__default.JSX.Element;
|
|
2107
|
+
|
|
2108
|
+
type TableRowProps = HTMLAttributes<HTMLTableRowElement>;
|
|
2109
|
+
|
|
2110
|
+
declare const TableRow: (props: TableRowProps) => React__default.JSX.Element;
|
|
2111
|
+
|
|
2112
|
+
type TableCellProps = TdHTMLAttributes<HTMLTableCellElement>;
|
|
2113
|
+
|
|
2114
|
+
declare const TableCell: (props: TableCellProps) => React__default.JSX.Element;
|
|
2115
|
+
|
|
2116
|
+
type TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;
|
|
2117
|
+
|
|
2118
|
+
declare const TableHeader: (props: TableHeaderProps) => React__default.JSX.Element;
|
|
2119
|
+
|
|
2120
|
+
type TableHeaderCellProps = TdHTMLAttributes<HTMLTableCellElement>;
|
|
2121
|
+
|
|
2122
|
+
declare const TableHeaderCell: (props: TableHeaderCellProps) => React__default.JSX.Element;
|
|
2123
|
+
|
|
2124
|
+
type TableBodyProps = HTMLAttributes<HTMLTableSectionElement>;
|
|
2125
|
+
|
|
2126
|
+
declare const TableBody: (props: TableBodyProps) => React__default.JSX.Element;
|
|
2127
|
+
|
|
2128
|
+
type TabsStyleEnum = 'Filled' | 'Underlined';
|
|
2129
|
+
type TabsTypeEnum = 'Horizontal' | 'Vertical';
|
|
2130
|
+
type TabContextType = {
|
|
2131
|
+
/**
|
|
2132
|
+
* The tab item style to apply.
|
|
2133
|
+
* @default Filled
|
|
2134
|
+
*/
|
|
2135
|
+
style: TabsStyleEnum;
|
|
2136
|
+
/**
|
|
2137
|
+
* The currently selected tab.
|
|
2138
|
+
*/
|
|
2139
|
+
currentTab: string | number;
|
|
2140
|
+
/**
|
|
2141
|
+
* Function to update the currently selected tab.
|
|
2142
|
+
* @param tabValue - The value of the tab to be set.
|
|
2143
|
+
*/
|
|
2144
|
+
updateCurrentTab: (tabValue: string | number) => void;
|
|
2145
|
+
};
|
|
2146
|
+
type TabProviderProps = {
|
|
2147
|
+
/**
|
|
2148
|
+
* The content to be displayed within the tab provider.
|
|
2149
|
+
*/
|
|
2150
|
+
children: React.ReactNode;
|
|
2151
|
+
/**
|
|
2152
|
+
* The value of the tab.
|
|
2153
|
+
*/
|
|
2154
|
+
value?: number | string;
|
|
2155
|
+
/**
|
|
2156
|
+
* The tab item style to apply.
|
|
2157
|
+
* @default Filled
|
|
2158
|
+
*/
|
|
2159
|
+
style?: TabsStyleEnum;
|
|
2160
|
+
/**
|
|
2161
|
+
* Callback function when a tab is clicked.
|
|
2162
|
+
* @param value - The value of the clicked tab.
|
|
2163
|
+
*/
|
|
2164
|
+
onClick?: (value: string | number) => void;
|
|
2165
|
+
};
|
|
2166
|
+
type TabsViewProps = {
|
|
2167
|
+
/**
|
|
2168
|
+
* The content to be displayed within the tabs.
|
|
2169
|
+
*/
|
|
2170
|
+
children: React.ReactNode;
|
|
2171
|
+
/**
|
|
2172
|
+
* Additional class for styling.
|
|
2173
|
+
*/
|
|
2174
|
+
className?: string;
|
|
2175
|
+
/**
|
|
2176
|
+
* The tab item style to apply.
|
|
2177
|
+
* @default Filled
|
|
2178
|
+
*/
|
|
2179
|
+
style?: TabsStyleEnum;
|
|
2180
|
+
/**
|
|
2181
|
+
* The tab item type to apply.
|
|
2182
|
+
* @default Horizontal
|
|
2183
|
+
*/
|
|
2184
|
+
type?: TabsTypeEnum;
|
|
2185
|
+
};
|
|
2186
|
+
type TabsProps = TabProviderProps & TabsViewProps;
|
|
2187
|
+
|
|
2188
|
+
/**
|
|
2189
|
+
* Custom hook to use the TabContext
|
|
2190
|
+
* Throws an error if used outside of a TabProvider
|
|
2191
|
+
*/
|
|
2192
|
+
declare const useTab: () => TabContextType;
|
|
2193
|
+
|
|
2194
|
+
declare const Tabs: (props: TabsProps) => React__default.JSX.Element;
|
|
2195
|
+
|
|
2196
|
+
type TabItemStyleEnum = 'Filled' | 'Underlined';
|
|
2197
|
+
type TabItemProps = Omit<ButtonProps, 'actionType' | 'appearance' | 'size' | 'style' | 'type'> & {
|
|
2198
|
+
/**
|
|
2199
|
+
* The tabs value.
|
|
2200
|
+
* @remarks
|
|
2201
|
+
* This is used for determining which tab is selected.
|
|
2202
|
+
* The value from TabContent will be compared to the value from TabItem.
|
|
2203
|
+
* @example
|
|
2204
|
+
* 1
|
|
2205
|
+
* "One"
|
|
2206
|
+
*/
|
|
2207
|
+
value: number | string;
|
|
2208
|
+
/**
|
|
2209
|
+
* The default tab.
|
|
2210
|
+
* @remarks
|
|
2211
|
+
* True means that this tab will be displayed initially
|
|
2212
|
+
*/
|
|
2213
|
+
defaultTab?: boolean;
|
|
2214
|
+
/**
|
|
2215
|
+
* The tab item style to apply.
|
|
2216
|
+
* @default Filled
|
|
2217
|
+
*/
|
|
2218
|
+
style?: TabItemStyleEnum;
|
|
2219
|
+
};
|
|
2220
|
+
|
|
2221
|
+
declare const TabItem: (props: TabItemProps) => React__default.JSX.Element;
|
|
2222
|
+
|
|
2223
|
+
interface TabContentProps {
|
|
2224
|
+
/**
|
|
2225
|
+
* The tab contents value.
|
|
2226
|
+
* @remarks
|
|
2227
|
+
* This is used for determining which tab is selected.
|
|
2228
|
+
* The value from TabContent will be compared to the value from TabItem.
|
|
2229
|
+
* @example
|
|
2230
|
+
* 1
|
|
2231
|
+
* "One"
|
|
2232
|
+
*/
|
|
2233
|
+
value: number | string;
|
|
2234
|
+
/**
|
|
2235
|
+
* The contents of the tab.
|
|
2236
|
+
*/
|
|
2237
|
+
children: React.ReactNode;
|
|
2238
|
+
/**
|
|
2239
|
+
* The classname applied to the tab content.
|
|
2240
|
+
*/
|
|
2241
|
+
className?: string;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
declare const TabContent: (props: TabContentProps) => React__default.JSX.Element;
|
|
2245
|
+
|
|
2246
|
+
type ThemeContextType = {
|
|
2247
|
+
theme: string;
|
|
2248
|
+
updateTheme: (theme: string) => void;
|
|
2249
|
+
};
|
|
2250
|
+
type ThemeProviderProps = {
|
|
2251
|
+
theme?: string;
|
|
2252
|
+
children?: ReactNode;
|
|
2253
|
+
};
|
|
2254
|
+
|
|
2255
|
+
declare const ThemeContext: React__default.Context<ThemeContextType>;
|
|
2256
|
+
declare const ThemeProvider: React__default.FC<ThemeProviderProps>;
|
|
2257
|
+
|
|
2258
|
+
/**
|
|
2259
|
+
* Props for the NotificationContainer component.
|
|
2260
|
+
*/
|
|
2261
|
+
type NotificationContainerProps = {
|
|
2262
|
+
className?: string;
|
|
2263
|
+
};
|
|
2264
|
+
|
|
2265
|
+
export { Accordion, AccordionDetails, AccordionGroup, AccordionSummary, ActionCard, type ActionCardProps, ActionImage, type ActionImageProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Breakpoint, type BreakpointProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Card, type CardProps, Checkbox, CheckboxItem, type CheckboxItemProps, type CheckboxLabelAlignmentEnum, type CheckboxProps, type CheckboxSizeEnum, Chip, type ChipProps, ContextMenu, type ContextMenuProps, type CustomTimePickerConfig, CustomToggle, type CustomToggleProps, DatePicker, type DatePickerProps, Dropzone, DropzoneClear, DropzoneContent, type DropzoneContentProps, type DropzoneContentTypeEnum, DropzoneFilename as DropzonePreview, type DropzoneProps, DropzoneSupportedFormats as DropzoneReject, DropzoneTrigger as DropzoneRoot, type FieldValidationFunction, type FieldValidators, type FieldValue, Form, type FormContextValues, type FormErrors, FormField, type FormFieldProps, type FormFieldPropsWithProvider, type FormProps, type FormProviderProps, type FormState, type FormStateChangeHandler, type FormSubmitHandler, type FormValidator, Grid, GridItem, type GridItemProps, GridList, type GridListProps, type GridProps, Icon, IconButton, type IconButtonProps, type IconButtonStyleEnum, type IconProps, type IconSizeEnum, type IconStyleEnum, Image, type ImageFitEnum, type ImageProps, Input, type InputProps, type InputTypeEnum, List, ListItem, type ListItemProps, type ListProps, Modal, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, type ModalProps, Nav, NavItem, type NavItemProps, NavLink, type NavLinkProps, type NavProps, type NotificationContainerProps, Option, type OptionProps, type OverlayDirectionEnum, Pagination, PaginationNumberField, type PaginationNumberFieldProps, type PaginationProps, Password, Popover, type PopoverHandle, type PopoverProps, ProgressBar, type ProgressBarProps, type RequiredFields, ResponsiveComponent, type ResponsiveComponentProps, Select, SelectListItem, type SelectListItemProps, type SelectProps, SelectProvider, Slider, type SliderProps, Spinner, type SpinnerProps, TabContent, type TabContentProps, TabItem, type TabItemProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHeader, TableHeaderCell, type TableHeaderCellProps, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, type TextDecorationEnum, type TextProps, type TextTypeEnum, type TextWeightEnum, ThemeContext, type ThemeContextType, ThemeProvider, type ThemeProviderProps, Toggle, ToggleButton, type ToggleButtonProps, type ToggleLabelAlignmentEnum, type ToggleProps, Tooltip, type TooltipProps, useDropzoneContext, useField, useSelectContext, useTab };
|