@ambuj.bhaskar/react-component-library 0.10.8 → 0.11.1-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/index.d.ts CHANGED
@@ -20,66 +20,30 @@ 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
- background?: Color;
53
- backgroundStates?: ColorStatesType;
54
- border?: Color;
55
- borderStates?: ColorStatesType;
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
- loading?: boolean;
37
+ iconPosition?: IconPositionType;
62
38
  disabled?: boolean;
63
- text?: string;
64
- textSize?: TextSize;
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 = {
@@ -150,7 +114,7 @@ export declare type DateRangePickerProps = {
150
114
 
151
115
  declare type DateTimeFormat = string;
152
116
 
153
- export declare const DEFAULT_PALETTE: Theme;
117
+ export declare const DEFAULT_THEME: ThemeObject;
154
118
 
155
119
  export declare const DetectionCarousel: React.FC<DetectionCarouselProps>;
156
120
 
@@ -189,19 +153,6 @@ declare type HTMLButtonProps = ComponentProps<"button">;
189
153
 
190
154
  declare type HTMLInputProps = ComponentProps<"input">;
191
155
 
192
- /**
193
- * A component that renders an icon by its name.
194
- *
195
- * The icon must be registered in the {@link IconRegistry}.
196
- *
197
- * @prop {string} name - Name of the icon to use.
198
- * @prop {string} [className] - Additional class names for styling.
199
- * @prop {"xs" | "s" | "m" | "l" | "xl"} [size] - Size of the icon.
200
- * @prop {string} [background] - Background color of the icon.
201
- * @prop {string} [color] - Color of the icon.
202
- * @prop {React.MouseEventHandler<SVGSVGElement>} [onClick] - Callback when the icon is clicked.
203
- * @prop {React.SVGAttributes<SVGSVGElement>} ...svgProps - Additional props to pass to the SVG element.
204
- */
205
156
  export declare const Icon: React_2.FC<IconProps>;
206
157
 
207
158
  declare type IconName = keyof typeof IconRegistry;
@@ -219,24 +170,6 @@ export declare type IconProps = SVGprops & {
219
170
 
220
171
  declare const IconRegistry: Record<string, any>;
221
172
 
222
- /**
223
- * Input component.
224
- *
225
- * @prop {string} [className=""] - Additional class names for styling.
226
- * @prop {string | number | undefined} [value] - The current value of the input.
227
- * @prop {"s" | "m" | "l"} [height="m"] - Height of the input field.
228
- * @prop {CSSstring} [width="24rem"] - Width of the component.
229
- * @prop {JustifyContent} [placement="flex-start"] - Placement of the content inside the input.
230
- * @prop {IconName} [icon] - The icon to display inside the input.
231
- * @prop {string} [backgroundColor="#2929291a"] - Background color of the input.
232
- * @prop {string} [textColor="#292929"] - Color of the text inside the input.
233
- * @prop {string} [borderColor="#292929"] - Border color of the input.
234
- * @prop {"before" | "after"} [iconPosition="after"] - Position of the icon relative to the text.
235
- * @prop {string} [iconColor="#292929"] - Color of the icon inside the input.
236
- * @prop {boolean} [disabled=false] - If true, the input is disabled.
237
- * @prop {(val: string) => void} [onChange=() => {}] - Callback when the input value changes.
238
- * @prop {React.ComponentProps<HTMLInputElement>} ...props - Additional props to pass to the input element.
239
- */
240
173
  export declare const Input: React.FC<InputProps>;
241
174
 
242
175
  export declare type InputProps = HTMLInputProps & {
@@ -249,6 +182,7 @@ export declare type InputProps = HTMLInputProps & {
249
182
  iconPosition?: "before" | "after";
250
183
  iconColor?: Color;
251
184
  disabled?: boolean;
185
+ disabledColor?: Color;
252
186
  backgroundColor?: Color;
253
187
  textColor?: Color;
254
188
  borderColor?: Color;
@@ -266,20 +200,6 @@ export declare type ModalProps = {
266
200
  children: React.ReactNode;
267
201
  };
268
202
 
269
- /**
270
- * A multiselect component.
271
- *
272
- * @prop {Option[]} options - Options for the multiselect.
273
- * @prop {(value: string[]) => void} onChange - Callback function when the selection changes.
274
- * @prop {string} [placeholder] - Placeholder text for the input.
275
- * @prop {boolean} [searchable] - Whether the input is searchable.
276
- * @prop {string[]} [value] - The selected values.
277
- * @prop {string} [className] - The class name for the component.
278
- * @prop {boolean} [disabled] - Whether the component is disabled.
279
- * @prop {CSSstring} [width] - The width of the component.
280
- * @prop {string} [height] - The height of the component.
281
- * @prop {string} [id] - The id of the component.
282
- */
283
203
  export declare const Multiselect: default_2.FC<MultiselectProps>;
284
204
 
285
205
  export declare type MultiselectProps = {
@@ -308,20 +228,6 @@ declare type Option_2 = {
308
228
  value: string | number;
309
229
  };
310
230
 
311
- /**
312
- * A single select component.
313
- *
314
- * @prop {Option[]} options - Options for the select.
315
- * @prop {(value: string) => void} onChange - Callback function when the selection changes.
316
- * @prop {string} [placeholder] - Placeholder text for the input.
317
- * @prop {boolean} [searchable] - Whether the input is searchable.
318
- * @prop {string} [value] - The selected value.
319
- * @prop {string} [className] - The class name for the component.
320
- * @prop {boolean} [disabled] - Whether the component is disabled.
321
- * @prop {CSSstring} [width] - The width of the component.
322
- * @prop {string} [height] - The height of the component.
323
- * @prop {string} [id] - The id of the component.
324
- */
325
231
  export declare const Select: React.FC<SelectProps>;
326
232
 
327
233
  export declare type SelectProps = {
@@ -344,6 +250,53 @@ export declare type SelectProps = {
344
250
  suffixIcon?: ReactNode | boolean;
345
251
  };
346
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
+
347
300
  declare type Size = "s" | "m" | "l";
348
301
 
349
302
  /**
@@ -396,46 +349,17 @@ export declare type SwitchProps = {
396
349
 
397
350
  declare type TextSize = "xs" | "s" | "m" | "l" | "xl";
398
351
 
399
- export declare type Theme = Partial<{
400
- common: {
401
- primary?: string;
402
- secondary?: string;
403
- highlight?: string;
404
- success?: string;
405
- warning?: string;
406
- error?: string;
407
- info?: string;
408
- disabled?: string;
409
- };
410
- text: {
411
- primary?: string;
412
- secondary?: string;
413
- tertiary?: string;
414
- disabled?: string;
415
- };
416
- background: {
417
- primary?: string;
418
- };
419
- surface: {
420
- fill: {
421
- primary?: string;
422
- secondary?: string;
423
- tertiary?: string;
424
- };
425
- border: {
426
- primary?: string;
427
- secondary?: string;
428
- tertiary?: string;
429
- };
430
- };
431
- }> & UnknownObject;
432
-
433
352
  export declare type ThemeObject = {
434
353
  name?: string;
435
- palette: Theme;
354
+ palette?: ThemeSection;
355
+ sizes?: ThemeSection;
436
356
  };
437
357
 
438
- export declare const ThemeProvider: ({ theme, log, children }: ThemeProviderProps) => JSX_2.Element;
358
+ export declare const ThemeProvider: ({ theme, log, children, }: {
359
+ theme?: ThemeObject;
360
+ log?: boolean;
361
+ children: ReactNode;
362
+ }) => JSX_2.Element;
439
363
 
440
364
  export declare type ThemeProviderProps = {
441
365
  theme: ThemeObject;
@@ -443,8 +367,8 @@ export declare type ThemeProviderProps = {
443
367
  children: ReactNode;
444
368
  };
445
369
 
446
- declare type UnknownObject = {
447
- [key: string]: unknown;
370
+ export declare type ThemeSection = {
371
+ [key: string]: string | ThemeSection;
448
372
  };
449
373
 
450
374
  export declare const useTheme: () => Record<string, string>;