@ambuj.bhaskar/react-component-library 0.10.7 → 0.10.9-alpha
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/assets/index.css +1 -1
- package/dist/index.cjs +64 -64
- package/dist/index.d.ts +73 -145
- package/dist/index.js +7150 -6954
- package/dist/index.umd.js +64 -64
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -20,72 +20,37 @@ declare type BlobType = {
|
|
|
20
20
|
score?: number;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
* The Button component.
|
|
25
|
-
*
|
|
26
|
-
* @param {ButtonProps} props - The props object.
|
|
27
|
-
* @prop {string} [variant=primary] - The variant of the button. The default is "primary".
|
|
28
|
-
* @prop {string} [background=rgb(255, 204, 0)] - The background color of the button.
|
|
29
|
-
* @prop {string} [border] - The border color of the button. If not provided, the border color is the same as the background color.
|
|
30
|
-
* @prop {string} [container=hugging] - The container type of the button. The default is "hugging".
|
|
31
|
-
* @prop {string} [width=13.5rem] - The width of the button.
|
|
32
|
-
* @prop {string} [size=m] - The size of the button. The default is "m".
|
|
33
|
-
* @prop {string} [gap=0.25rem] - The gap between elements inside the button.
|
|
34
|
-
* @prop {string} [placement=center] - The placement of the content inside the button. The default is "center".
|
|
35
|
-
* @prop {boolean} [disabled=false] - If true, the button is disabled.
|
|
36
|
-
* @prop {boolean} [loading=false] - If true, the button shows a loading state.
|
|
37
|
-
* @prop {string} [text=null] - The text to display inside the button.
|
|
38
|
-
* @prop {string} [textSize] - The size of the text inside the button.
|
|
39
|
-
* @prop {string} [textColor] - The color of the text inside the button. If not provided, the color is the same as the variant.
|
|
40
|
-
* @prop {object} [textColorStates=null] - Overrides the behaviour of color on default, hover, active states, which is intially set by the variant.
|
|
41
|
-
* @prop {IconName} [icon=null] - The icon to display inside the button.
|
|
42
|
-
* @prop {string} [iconSize] - The size of the icon inside the button.
|
|
43
|
-
* @prop {string} [iconColor] - The color of the icon inside the button. If not provided, the color is the same as the variant.
|
|
44
|
-
* @prop {string} [iconPosition=before] - The position of the icon relative to the text. The default is "before".
|
|
45
|
-
* @prop {object} [iconColorStates=null] - Overrides the behaviour of color on default, hover, active states, which is intially set by the variant.
|
|
46
|
-
* @prop {string} [className=null] - Additional class names for styling.
|
|
47
|
-
*/
|
|
48
23
|
export declare const Button: React.FC<ButtonProps>;
|
|
49
24
|
|
|
50
25
|
export declare type ButtonProps = HTMLButtonProps & {
|
|
51
26
|
variant?: "primary" | "secondary" | "tertiary" | "nav";
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
container?: "fixed" | "hugging";
|
|
57
|
-
size?: Size;
|
|
27
|
+
backgroundColor?: Color;
|
|
28
|
+
borderColor?: Color;
|
|
29
|
+
textColor?: Color;
|
|
30
|
+
iconColor?: Color;
|
|
58
31
|
width?: CSSstring;
|
|
32
|
+
size?: Size;
|
|
33
|
+
textSize?: TextSize;
|
|
34
|
+
iconSize?: IconProps["size"];
|
|
59
35
|
gap?: CSSstring;
|
|
60
36
|
placement?: JustifyContent;
|
|
61
|
-
|
|
37
|
+
iconPosition?: IconPositionType;
|
|
62
38
|
disabled?: boolean;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
textColor?: Color;
|
|
66
|
-
textColorStates?: ColorStatesType;
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
content?: string;
|
|
67
41
|
icon?: IconName;
|
|
68
|
-
iconSize?: IconProps["size"];
|
|
69
|
-
iconColor?: Color;
|
|
70
|
-
iconPosition?: IconPositionType;
|
|
71
|
-
iconColorStates?: ColorStatesType;
|
|
72
42
|
className?: string;
|
|
73
43
|
};
|
|
74
44
|
|
|
75
45
|
declare type Color = string;
|
|
76
46
|
|
|
77
|
-
declare type ColorStatesType = {
|
|
78
|
-
default: Color;
|
|
79
|
-
hover?: Color;
|
|
80
|
-
active?: Color;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
47
|
export declare const CompactEventCard: React.FC<CompactEventCardPropsType>;
|
|
84
48
|
|
|
85
49
|
export declare type CompactEventCardPropsType = {
|
|
86
50
|
data: EventType;
|
|
87
51
|
className?: string;
|
|
88
52
|
isFocused?: boolean;
|
|
53
|
+
borderColor?: Color;
|
|
89
54
|
focusedBorderColor?: Color;
|
|
90
55
|
focusedBorderThickness?: CSSstring;
|
|
91
56
|
width?: CSSstring;
|
|
@@ -149,6 +114,8 @@ export declare type DateRangePickerProps = {
|
|
|
149
114
|
|
|
150
115
|
declare type DateTimeFormat = string;
|
|
151
116
|
|
|
117
|
+
export declare const DEFAULT_THEME: ThemeObject;
|
|
118
|
+
|
|
152
119
|
export declare const DetectionCarousel: React.FC<DetectionCarouselProps>;
|
|
153
120
|
|
|
154
121
|
export declare type DetectionCarouselProps = {
|
|
@@ -186,19 +153,6 @@ declare type HTMLButtonProps = ComponentProps<"button">;
|
|
|
186
153
|
|
|
187
154
|
declare type HTMLInputProps = ComponentProps<"input">;
|
|
188
155
|
|
|
189
|
-
/**
|
|
190
|
-
* A component that renders an icon by its name.
|
|
191
|
-
*
|
|
192
|
-
* The icon must be registered in the {@link IconRegistry}.
|
|
193
|
-
*
|
|
194
|
-
* @prop {string} name - Name of the icon to use.
|
|
195
|
-
* @prop {string} [className] - Additional class names for styling.
|
|
196
|
-
* @prop {"xs" | "s" | "m" | "l" | "xl"} [size] - Size of the icon.
|
|
197
|
-
* @prop {string} [background] - Background color of the icon.
|
|
198
|
-
* @prop {string} [color] - Color of the icon.
|
|
199
|
-
* @prop {React.MouseEventHandler<SVGSVGElement>} [onClick] - Callback when the icon is clicked.
|
|
200
|
-
* @prop {React.SVGAttributes<SVGSVGElement>} ...svgProps - Additional props to pass to the SVG element.
|
|
201
|
-
*/
|
|
202
156
|
export declare const Icon: React_2.FC<IconProps>;
|
|
203
157
|
|
|
204
158
|
declare type IconName = keyof typeof IconRegistry;
|
|
@@ -216,24 +170,6 @@ export declare type IconProps = SVGprops & {
|
|
|
216
170
|
|
|
217
171
|
declare const IconRegistry: Record<string, any>;
|
|
218
172
|
|
|
219
|
-
/**
|
|
220
|
-
* Input component.
|
|
221
|
-
*
|
|
222
|
-
* @prop {string} [className=""] - Additional class names for styling.
|
|
223
|
-
* @prop {string | number | undefined} [value] - The current value of the input.
|
|
224
|
-
* @prop {"s" | "m" | "l"} [height="m"] - Height of the input field.
|
|
225
|
-
* @prop {CSSstring} [width="24rem"] - Width of the component.
|
|
226
|
-
* @prop {JustifyContent} [placement="flex-start"] - Placement of the content inside the input.
|
|
227
|
-
* @prop {IconName} [icon] - The icon to display inside the input.
|
|
228
|
-
* @prop {string} [backgroundColor="#2929291a"] - Background color of the input.
|
|
229
|
-
* @prop {string} [textColor="#292929"] - Color of the text inside the input.
|
|
230
|
-
* @prop {string} [borderColor="#292929"] - Border color of the input.
|
|
231
|
-
* @prop {"before" | "after"} [iconPosition="after"] - Position of the icon relative to the text.
|
|
232
|
-
* @prop {string} [iconColor="#292929"] - Color of the icon inside the input.
|
|
233
|
-
* @prop {boolean} [disabled=false] - If true, the input is disabled.
|
|
234
|
-
* @prop {(val: string) => void} [onChange=() => {}] - Callback when the input value changes.
|
|
235
|
-
* @prop {React.ComponentProps<HTMLInputElement>} ...props - Additional props to pass to the input element.
|
|
236
|
-
*/
|
|
237
173
|
export declare const Input: React.FC<InputProps>;
|
|
238
174
|
|
|
239
175
|
export declare type InputProps = HTMLInputProps & {
|
|
@@ -246,6 +182,7 @@ export declare type InputProps = HTMLInputProps & {
|
|
|
246
182
|
iconPosition?: "before" | "after";
|
|
247
183
|
iconColor?: Color;
|
|
248
184
|
disabled?: boolean;
|
|
185
|
+
disabledColor?: Color;
|
|
249
186
|
backgroundColor?: Color;
|
|
250
187
|
textColor?: Color;
|
|
251
188
|
borderColor?: Color;
|
|
@@ -263,20 +200,6 @@ export declare type ModalProps = {
|
|
|
263
200
|
children: React.ReactNode;
|
|
264
201
|
};
|
|
265
202
|
|
|
266
|
-
/**
|
|
267
|
-
* A multiselect component.
|
|
268
|
-
*
|
|
269
|
-
* @prop {Option[]} options - Options for the multiselect.
|
|
270
|
-
* @prop {(value: string[]) => void} onChange - Callback function when the selection changes.
|
|
271
|
-
* @prop {string} [placeholder] - Placeholder text for the input.
|
|
272
|
-
* @prop {boolean} [searchable] - Whether the input is searchable.
|
|
273
|
-
* @prop {string[]} [value] - The selected values.
|
|
274
|
-
* @prop {string} [className] - The class name for the component.
|
|
275
|
-
* @prop {boolean} [disabled] - Whether the component is disabled.
|
|
276
|
-
* @prop {CSSstring} [width] - The width of the component.
|
|
277
|
-
* @prop {string} [height] - The height of the component.
|
|
278
|
-
* @prop {string} [id] - The id of the component.
|
|
279
|
-
*/
|
|
280
203
|
export declare const Multiselect: default_2.FC<MultiselectProps>;
|
|
281
204
|
|
|
282
205
|
export declare type MultiselectProps = {
|
|
@@ -305,20 +228,6 @@ declare type Option_2 = {
|
|
|
305
228
|
value: string | number;
|
|
306
229
|
};
|
|
307
230
|
|
|
308
|
-
/**
|
|
309
|
-
* A single select component.
|
|
310
|
-
*
|
|
311
|
-
* @prop {Option[]} options - Options for the select.
|
|
312
|
-
* @prop {(value: string) => void} onChange - Callback function when the selection changes.
|
|
313
|
-
* @prop {string} [placeholder] - Placeholder text for the input.
|
|
314
|
-
* @prop {boolean} [searchable] - Whether the input is searchable.
|
|
315
|
-
* @prop {string} [value] - The selected value.
|
|
316
|
-
* @prop {string} [className] - The class name for the component.
|
|
317
|
-
* @prop {boolean} [disabled] - Whether the component is disabled.
|
|
318
|
-
* @prop {CSSstring} [width] - The width of the component.
|
|
319
|
-
* @prop {string} [height] - The height of the component.
|
|
320
|
-
* @prop {string} [id] - The id of the component.
|
|
321
|
-
*/
|
|
322
231
|
export declare const Select: React.FC<SelectProps>;
|
|
323
232
|
|
|
324
233
|
export declare type SelectProps = {
|
|
@@ -341,6 +250,53 @@ export declare type SelectProps = {
|
|
|
341
250
|
suffixIcon?: ReactNode | boolean;
|
|
342
251
|
};
|
|
343
252
|
|
|
253
|
+
export declare const Sidebar: React.FC<SidebarProps>;
|
|
254
|
+
|
|
255
|
+
export declare type SidebarConfig = {
|
|
256
|
+
header: {
|
|
257
|
+
logo: string;
|
|
258
|
+
logoCollapsed: string;
|
|
259
|
+
logoClickAction?: () => void;
|
|
260
|
+
};
|
|
261
|
+
body: {
|
|
262
|
+
static: {
|
|
263
|
+
title: string;
|
|
264
|
+
icon: string;
|
|
265
|
+
key: string;
|
|
266
|
+
action: () => void;
|
|
267
|
+
notification?: {
|
|
268
|
+
value: number;
|
|
269
|
+
};
|
|
270
|
+
}[];
|
|
271
|
+
dynamic: {
|
|
272
|
+
[section: string]: {
|
|
273
|
+
title: string;
|
|
274
|
+
icon: string;
|
|
275
|
+
key: string;
|
|
276
|
+
action: () => void;
|
|
277
|
+
}[];
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
footer: {
|
|
281
|
+
image: string;
|
|
282
|
+
title: string;
|
|
283
|
+
description: string;
|
|
284
|
+
action: () => void;
|
|
285
|
+
key: string;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
export declare type SidebarProps = {
|
|
290
|
+
currentSection?: string;
|
|
291
|
+
currentSubSection?: string;
|
|
292
|
+
height?: CSSstring;
|
|
293
|
+
width?: CSSstring;
|
|
294
|
+
collapsedWidth?: CSSstring;
|
|
295
|
+
config: SidebarConfig;
|
|
296
|
+
isOpen?: boolean;
|
|
297
|
+
onToggle?: (isOpen: boolean) => void;
|
|
298
|
+
};
|
|
299
|
+
|
|
344
300
|
declare type Size = "s" | "m" | "l";
|
|
345
301
|
|
|
346
302
|
/**
|
|
@@ -393,54 +349,26 @@ export declare type SwitchProps = {
|
|
|
393
349
|
|
|
394
350
|
declare type TextSize = "xs" | "s" | "m" | "l" | "xl";
|
|
395
351
|
|
|
396
|
-
export declare type
|
|
397
|
-
common: {
|
|
398
|
-
primary?: string;
|
|
399
|
-
secondary?: string;
|
|
400
|
-
highlight?: string;
|
|
401
|
-
success?: string;
|
|
402
|
-
warning?: string;
|
|
403
|
-
error?: string;
|
|
404
|
-
info?: string;
|
|
405
|
-
disabled?: string;
|
|
406
|
-
};
|
|
407
|
-
text: {
|
|
408
|
-
primary?: string;
|
|
409
|
-
secondary?: string;
|
|
410
|
-
tertiary?: string;
|
|
411
|
-
disabled?: string;
|
|
412
|
-
};
|
|
413
|
-
background: {
|
|
414
|
-
primary?: string;
|
|
415
|
-
};
|
|
416
|
-
surface: {
|
|
417
|
-
fill: {
|
|
418
|
-
primary?: string;
|
|
419
|
-
secondary?: string;
|
|
420
|
-
tertiary?: string;
|
|
421
|
-
};
|
|
422
|
-
border: {
|
|
423
|
-
primary?: string;
|
|
424
|
-
secondary?: string;
|
|
425
|
-
tertiary?: string;
|
|
426
|
-
};
|
|
427
|
-
};
|
|
428
|
-
}> & UnknownObject;
|
|
429
|
-
|
|
430
|
-
declare type ThemeObject = {
|
|
352
|
+
export declare type ThemeObject = {
|
|
431
353
|
name?: string;
|
|
432
|
-
palette
|
|
354
|
+
palette?: ThemeSection;
|
|
355
|
+
sizes?: ThemeSection;
|
|
433
356
|
};
|
|
434
357
|
|
|
435
|
-
export declare const ThemeProvider: ({ theme, children }:
|
|
358
|
+
export declare const ThemeProvider: ({ theme, log, children, }: {
|
|
359
|
+
theme?: ThemeObject;
|
|
360
|
+
log?: boolean;
|
|
361
|
+
children: ReactNode;
|
|
362
|
+
}) => JSX_2.Element;
|
|
436
363
|
|
|
437
|
-
declare type ThemeProviderProps = {
|
|
364
|
+
export declare type ThemeProviderProps = {
|
|
438
365
|
theme: ThemeObject;
|
|
366
|
+
log?: boolean;
|
|
439
367
|
children: ReactNode;
|
|
440
368
|
};
|
|
441
369
|
|
|
442
|
-
declare type
|
|
443
|
-
[key: string]:
|
|
370
|
+
export declare type ThemeSection = {
|
|
371
|
+
[key: string]: string | ThemeSection;
|
|
444
372
|
};
|
|
445
373
|
|
|
446
374
|
export declare const useTheme: () => Record<string, string>;
|